From 7e12139719e310e68b7eb2729eff859b4a5d3883 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 09:58:20 +0200 Subject: [PATCH 001/885] imap: treat capabilities case insensitively Reported-by: Joshua Rogers Fixes #19089 Closes #19090 --- lib/imap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index 47757d3f2978..0feaedf5acc8 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1056,19 +1056,19 @@ static CURLcode imap_state_capability_resp(struct Curl_easy *data, wordlen++; /* Does the server support the STARTTLS capability? */ - if(wordlen == 8 && !memcmp(line, "STARTTLS", 8)) + if(wordlen == 8 && curl_strnequal(line, "STARTTLS", 8)) imapc->tls_supported = TRUE; /* Has the server explicitly disabled clear text authentication? */ - else if(wordlen == 13 && !memcmp(line, "LOGINDISABLED", 13)) + else if(wordlen == 13 && curl_strnequal(line, "LOGINDISABLED", 13)) imapc->login_disabled = TRUE; /* Does the server support the SASL-IR capability? */ - else if(wordlen == 7 && !memcmp(line, "SASL-IR", 7)) + else if(wordlen == 7 && curl_strnequal(line, "SASL-IR", 7)) imapc->ir_supported = TRUE; /* Do we have a SASL based authentication mechanism? */ - else if(wordlen > 5 && !memcmp(line, "AUTH=", 5)) { + else if(wordlen > 5 && curl_strnequal(line, "AUTH=", 5)) { size_t llen; unsigned short mechbit; From 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 15 Oct 2025 21:01:46 +0200 Subject: [PATCH 002/885] mbedtls: add support for 4.0.0 After this patch libcurl requires (as already documented) the `curl_global_init()` call when using the `curl_formadd()` API with mbedTLS. Note: NTLM is not supported with mbedTLS 4+, because it lacks the necessary crypto primitive: DES. Also: - lib: de-dupe mbedTLS minimum version checks into `curl_setup.h`. - lib: initialize PSA Crypto as part of `curl_global_init()`. For MD5, SHA-256, `curl_formadd()`, and MultiSSL builds with mbedTLS but where mbedTLS isn't the default backend. - lib1308: fix to call `curl_global_init()` (for the Form API). - curl_ntlm_core: disable with mbedTLS 4+. - md4: disable mbedTLS implementation when building against 4.x. - md5: use mbedTLS PSA Crypto API when available, otherwise use the default local implementation. - sha256: use mbedTLS PSA Crypto API when available, otherwise use the default local implementation. - vtls/mbedtls: drop PSA Crypto initialization in favor of `curl_global_init()`. - vtls/mbedtls: use PSA Crypto random API with all mbedTLS versions. - vtls/mbedtls: do the same for the SHA-256 callback. - autotools: detect mbedTLS 4+, and disable NTLM for 3.x. - cmake: disable NTLM for mbedTLS 3.x. - GHA/linux: keep building mbedTLS 3.x manually and use it in an existing job, while also enabling pytest in it. - GHA/linux: bump to mbedTLS 4.0.0. Closes #19075 Closes #19074 Refs: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-4.0.0 https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-4.0.0/docs/4.0-migration-guide.md https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-4.0.0/tf-psa-crypto/docs/1.0-migration-guide.md [404] https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/tf-psa-crypto-1.0.0/docs/1.0-migration-guide.md https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/tf-psa-crypto-1.0.0/docs/psa-transition.md https://github.com/Mbed-TLS/TF-PSA-Crypto/tree/627f727bbed3d9319ed548f1c0839a29c223414e/docs/4.0-migration-guide Closes #19077 --- .github/workflows/linux.yml | 39 +++++++++--- CMakeLists.txt | 2 +- configure.ac | 4 +- lib/curl_ntlm_core.c | 20 ++++--- lib/curl_setup.h | 10 +++- lib/easy.c | 29 +++++++++ lib/md4.c | 12 ++-- lib/md5.c | 30 +++++----- lib/sha256.c | 29 +++++---- lib/vtls/mbedtls.c | 115 ++++++++++++++++++++---------------- m4/curl-mbedtls.m4 | 19 ++++++ tests/libtest/lib1308.c | 15 +++-- 12 files changed, 218 insertions(+), 106 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2d674dc195cf..527c9ce6075b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -42,7 +42,9 @@ env: # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.2 # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com - MBEDTLS_VERSION: 3.6.4 + MBEDTLS_VERSION: 4.0.0 + # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver:^3.0.0 registryUrl=https://github.com + MBEDTLS_VERSION_PREV: 3.6.4 # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com AWSLC_VERSION: 1.61.4 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com @@ -109,10 +111,10 @@ jobs: install_steps: mbedtls pytest configure: CC=clang LDFLAGS=-Wl,-rpath,/home/runner/mbedtls/lib --with-mbedtls=/home/runner/mbedtls --enable-debug --with-fish-functions-dir --with-zsh-functions-dir - - name: 'mbedtls' + - name: 'mbedtls-prev' install_packages: libnghttp2-dev libuv1-dev - install_steps: mbedtls - PKG_CONFIG_PATH: /home/runner/mbedtls/lib/pkgconfig # Requires v3.6.0 + install_steps: mbedtls-prev pytest + PKG_CONFIG_PATH: /home/runner/mbedtls-prev/lib/pkgconfig # Requires v3.6.0 generate: -DCURL_USE_MBEDTLS=ON -DCURL_USE_LIBUV=ON -DENABLE_DEBUG=ON - name: 'mbedtls-pkg MultiSSL !pc' @@ -435,7 +437,7 @@ jobs: - name: 'cache mbedtls' if: ${{ contains(matrix.build.install_steps, 'mbedtls') }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - id: cache-mbedtls + id: cache-mbedtls-threadsafe env: cache-name: cache-mbedtls-threadsafe with: @@ -443,7 +445,7 @@ jobs: key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MBEDTLS_VERSION }} - name: 'build mbedtls' - if: ${{ contains(matrix.build.install_steps, 'mbedtls') && steps.cache-mbedtls.outputs.cache-hit != 'true' }} + if: ${{ contains(matrix.build.install_steps, 'mbedtls') && steps.cache-mbedtls-threadsafe.outputs.cache-hit != 'true' }} run: | curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ --location "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${MBEDTLS_VERSION}/mbedtls-${MBEDTLS_VERSION}.tar.bz2" | tar -xj @@ -455,7 +457,30 @@ jobs: cmake --build . cmake --install . - - name: 'cache openldap-static' + - name: 'cache mbedtls (prev)' + if: ${{ contains(matrix.build.install_steps, 'mbedtls-prev') }} + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: cache-mbedtls-threadsafe-prev + env: + cache-name: cache-mbedtls-threadsafe-prev + with: + path: ~/mbedtls-prev + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MBEDTLS_VERSION }} + + - name: 'build mbedtls (prev)' + if: ${{ contains(matrix.build.install_steps, 'mbedtls-prev') && steps.cache-mbedtls-threadsafe-prev.outputs.cache-hit != 'true' }} + run: | + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ + --location "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${MBEDTLS_VERSION_PREV}/mbedtls-${MBEDTLS_VERSION_PREV}.tar.bz2" | tar -xj + cd "mbedtls-${MBEDTLS_VERSION_PREV}" + ./scripts/config.py set MBEDTLS_THREADING_C + ./scripts/config.py set MBEDTLS_THREADING_PTHREAD + cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/home/runner/mbedtls-prev \ + -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF + cmake --build . + cmake --install . + + - name: 'cache openldap (static)' if: ${{ contains(matrix.build.install_steps, 'openldap-static') }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 id: cache-openldap-static diff --git a/CMakeLists.txt b/CMakeLists.txt index 65eaaf670a5e..b6aff6ce7cc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2083,7 +2083,7 @@ endmacro() # These conditions must match those in lib/curl_setup.h. if(NOT CURL_DISABLE_NTLM AND (USE_OPENSSL OR - USE_MBEDTLS OR + (USE_MBEDTLS AND MBEDTLS_VERSION VERSION_LESS 4.0.0) OR USE_GNUTLS OR USE_WIN32_CRYPTO OR (USE_WOLFSSL AND HAVE_WOLFSSL_DES_ECB_ENCRYPT))) diff --git a/configure.ac b/configure.ac index 999ab122a323..97d031049775 100644 --- a/configure.ac +++ b/configure.ac @@ -5252,11 +5252,13 @@ fi use_curl_ntlm_core=no if test "x$CURL_DISABLE_NTLM" != "x1"; then - if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ + if test "x$OPENSSL_ENABLED" = "x1" \ -o "x$GNUTLS_ENABLED" = "x1" \ -o "x$USE_WIN32_CRYPTO" = "x1" \ -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1"; then use_curl_ntlm_core=yes + elif test "x$MBEDTLS_ENABLED" = "x1" && test "$mbedtls_4" = "0"; then + use_curl_ntlm_core=yes fi if test "x$use_curl_ntlm_core" = "xyes" \ diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index cf0e4dc28832..a81e97f0ce72 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -38,10 +38,9 @@ 1. USE_OPENSSL 2. USE_WOLFSSL 3. USE_GNUTLS - 4. - - 5. USE_MBEDTLS - 6. USE_OS400CRYPTO - 7. USE_WIN32_CRYPTO + 4. USE_MBEDTLS + 5. USE_OS400CRYPTO + 6. USE_WIN32_CRYPTO This ensures that: - the same SSL branch gets activated throughout this source @@ -61,6 +60,11 @@ #ifndef NO_DES3 #define USE_OPENSSL_DES #endif +#elif defined(USE_MBEDTLS) + #include + #if MBEDTLS_VERSION_NUMBER < 0x04000000 + #define USE_MBEDTLS_DES + #endif #endif #ifdef USE_OPENSSL_DES @@ -97,7 +101,7 @@ # include -#elif defined(USE_MBEDTLS) +#elif defined(USE_MBEDTLS_DES) # include @@ -178,7 +182,7 @@ static void setup_des_key(const unsigned char *key_56, des_set_key(des, (const uint8_t *) key); } -#elif defined(USE_MBEDTLS) +#elif defined(USE_MBEDTLS_DES) static bool encrypt_des(const unsigned char *in, unsigned char *out, const unsigned char *key_56) @@ -305,7 +309,7 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys, des_encrypt(&des, 8, results + 8, plaintext); setup_des_key(keys + 14, &des); des_encrypt(&des, 8, results + 16, plaintext); -#elif defined(USE_MBEDTLS) || defined(USE_OS400CRYPTO) || \ +#elif defined(USE_MBEDTLS_DES) || defined(USE_OS400CRYPTO) || \ defined(USE_WIN32_CRYPTO) encrypt_des(plaintext, results, keys); encrypt_des(plaintext, results + 8, keys + 7); @@ -353,7 +357,7 @@ CURLcode Curl_ntlm_core_mk_lm_hash(const char *password, des_encrypt(&des, 8, lmbuffer, magic); setup_des_key(pw + 7, &des); des_encrypt(&des, 8, lmbuffer + 8, magic); -#elif defined(USE_MBEDTLS) || defined(USE_OS400CRYPTO) || \ +#elif defined(USE_MBEDTLS_DES) || defined(USE_OS400CRYPTO) || \ defined(USE_WIN32_CRYPTO) encrypt_des(magic, lmbuffer, pw); encrypt_des(magic, lmbuffer + 8, pw + 7); diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 694d14df4f09..4934baa22b71 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -737,6 +737,13 @@ # endif #endif +#ifdef USE_MBEDTLS +#include +#if MBEDTLS_VERSION_NUMBER < 0x03020000 + #error "mbedTLS 3.2.0 or later required" +#endif +#endif + #if defined(USE_WOLFSSL) && defined(USE_GNUTLS) /* Avoid defining unprefixed wolfSSL SHA macros colliding with nettle ones */ #define NO_OLD_WC_NAMES @@ -756,8 +763,9 @@ /* Single point where USE_NTLM definition might be defined */ #ifndef CURL_DISABLE_NTLM -# if defined(USE_OPENSSL) || defined(USE_MBEDTLS) || \ +# if defined(USE_OPENSSL) || \ defined(USE_GNUTLS) || \ + (defined(USE_MBEDTLS) && MBEDTLS_VERSION_NUMBER < 0x04000000) || \ defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) || \ (defined(USE_WOLFSSL) && defined(HAVE_WOLFSSL_DES_ECB_ENCRYPT)) # define USE_CURL_NTLM_CORE diff --git a/lib/easy.c b/lib/easy.c index 793a18f33eb8..f12a8b143f0c 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -80,6 +80,10 @@ #include "easy_lock.h" +#ifdef USE_MBEDTLS +#include +#endif + /* The last 2 #include files should be in this order */ #include "curl_memory.h" #include "memdebug.h" @@ -137,6 +141,24 @@ curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; static char *leakpointer; #endif +static CURLcode crypto_init(void) +{ +#ifdef USE_MBEDTLS + psa_status_t status; + status = psa_crypto_init(); + if(status != PSA_SUCCESS) + return CURLE_FAILED_INIT; +#endif + return CURLE_OK; +} + +static void crypto_cleanup(void) +{ +#ifdef USE_MBEDTLS + mbedtls_psa_crypto_free(); +#endif +} + /** * curl_global_init() globally initializes curl given a bitwise set of the * different features of what to initialize. @@ -160,6 +182,11 @@ static CURLcode global_init(long flags, bool memoryfuncs) goto fail; } + if(crypto_init()) { + DEBUGF(curl_mfprintf(stderr, "Error: crypto_init failed\n")); + goto fail; + } + if(!Curl_ssl_init()) { DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n")); goto fail; @@ -298,6 +325,8 @@ void curl_global_cleanup(void) Curl_ssh_cleanup(); + crypto_cleanup(); + #ifdef DEBUGBUILD free(leakpointer); #endif diff --git a/lib/md4.c b/lib/md4.c index 9db85786e125..5d0908eadefa 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -53,11 +53,11 @@ #ifdef USE_MBEDTLS #include -#if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" -#endif +#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_MD4_C) +#define USE_MBEDTLS_MD4 #include -#endif /* USE_MBEDTLS */ +#endif +#endif /* When OpenSSL or wolfSSL is available, we use their MD4 functions. */ #if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4) @@ -78,7 +78,7 @@ #include #elif defined(USE_GNUTLS) #include -#elif(defined(USE_MBEDTLS) && defined(MBEDTLS_MD4_C)) +#elif defined(USE_MBEDTLS_MD4) #include #endif @@ -187,7 +187,7 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) md4_digest(ctx, MD4_DIGEST_SIZE, result); } -#elif(defined(USE_MBEDTLS) && defined(MBEDTLS_MD4_C)) +#elif defined(USE_MBEDTLS_MD4) struct md4_ctx { void *data; diff --git a/lib/md5.c b/lib/md5.c index 091924034055..897bd1b1a407 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -34,13 +34,6 @@ #include "curl_hmac.h" #include "curlx/warnless.h" -#ifdef USE_MBEDTLS -#include -#if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" -#endif -#endif /* USE_MBEDTLS */ - #ifdef USE_OPENSSL #include #if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_DEPRECATED_3_0) @@ -55,14 +48,21 @@ #endif #endif +#ifdef USE_MBEDTLS + #include + #if defined(PSA_WANT_ALG_MD5) && PSA_WANT_ALG_MD5 /* mbedTLS 4+ */ + #define USE_MBEDTLS_MD5 + #endif +#endif + #ifdef USE_GNUTLS #include #elif defined(USE_OPENSSL_MD5) #include #elif defined(USE_WOLFSSL_MD5) #include -#elif defined(USE_MBEDTLS) -#include +#elif defined(USE_MBEDTLS_MD5) +#include #elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040) && \ defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ @@ -152,13 +152,14 @@ static void my_md5_final(unsigned char *digest, void *ctx) (void)wolfSSL_MD5_Final(digest, ctx); } -#elif defined(USE_MBEDTLS) +#elif defined(USE_MBEDTLS_MD5) -typedef mbedtls_md5_context my_md5_ctx; +typedef psa_hash_operation_t my_md5_ctx; static CURLcode my_md5_init(void *ctx) { - if(mbedtls_md5_starts(ctx)) + memset(ctx, 0, sizeof(my_md5_ctx)); + if(psa_hash_setup(ctx, PSA_ALG_MD5) != PSA_SUCCESS) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } @@ -167,12 +168,13 @@ static void my_md5_update(void *ctx, const unsigned char *data, unsigned int length) { - (void)mbedtls_md5_update(ctx, data, length); + (void)psa_hash_update(ctx, data, length); } static void my_md5_final(unsigned char *digest, void *ctx) { - (void)mbedtls_md5_finish(ctx, digest); + size_t actual_length; + (void)psa_hash_finish(ctx, digest, 16, &actual_length); } #elif defined(AN_APPLE_OS) diff --git a/lib/sha256.c b/lib/sha256.c index 2d0357189a0e..cf8e98a550e5 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -32,16 +32,19 @@ #include "curl_sha256.h" #include "curl_hmac.h" +#ifdef USE_MBEDTLS + #include + #if defined(PSA_WANT_ALG_SHA_256) && PSA_WANT_ALG_SHA_256 /* mbedTLS 4+ */ + #define USE_MBEDTLS_SHA256 + #endif +#endif + #ifdef USE_OPENSSL #include #elif defined(USE_GNUTLS) #include -#elif defined(USE_MBEDTLS) -#include -#if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" -#endif -#include +#elif defined(USE_MBEDTLS_SHA256) +#include #elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)) || \ (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \ @@ -126,13 +129,15 @@ static void my_sha256_final(unsigned char *digest, void *ctx) sha256_digest(ctx, SHA256_DIGEST_SIZE, digest); } -#elif defined(USE_MBEDTLS) +#elif defined(USE_MBEDTLS_SHA256) -typedef mbedtls_sha256_context my_sha256_ctx; +typedef psa_hash_operation_t my_sha256_ctx; static CURLcode my_sha256_init(void *ctx) { - (void)mbedtls_sha256_starts(ctx, 0); + memset(ctx, 0, sizeof(my_sha256_ctx)); + if(psa_hash_setup(ctx, PSA_ALG_SHA_256) != PSA_SUCCESS) + return CURLE_OUT_OF_MEMORY; return CURLE_OK; } @@ -140,12 +145,14 @@ static void my_sha256_update(void *ctx, const unsigned char *data, unsigned int length) { - (void)mbedtls_sha256_update(ctx, data, length); + (void)psa_hash_update(ctx, data, length); } static void my_sha256_final(unsigned char *digest, void *ctx) { - (void)mbedtls_sha256_finish(ctx, digest); + size_t actual_length; + (void)psa_hash_finish(ctx, digest, CURL_SHA256_DIGEST_LENGTH, + &actual_length); } #elif defined(AN_APPLE_OS) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 3ff131b441a0..ebb8a4abc009 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -37,17 +37,21 @@ /* #define MBEDTLS_DEBUG */ #include -#if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" -#endif +#include #include #include #include +#include + +#if MBEDTLS_VERSION_NUMBER < 0x04000000 +#define CURL_MBEDTLS_DRBG +#endif #include +#ifdef CURL_MBEDTLS_DRBG #include #include -#include +#endif #ifdef MBEDTLS_DEBUG #include #endif @@ -77,8 +81,10 @@ #endif struct mbed_ssl_backend_data { +#ifdef CURL_MBEDTLS_DRBG mbedtls_ctr_drbg_context ctr_drbg; mbedtls_entropy_context entropy; +#endif mbedtls_ssl_context ssl; mbedtls_x509_crt cacert; mbedtls_x509_crt clicert; @@ -106,7 +112,7 @@ struct mbed_ssl_backend_data { #define mbedtls_strerror(a,b,c) b[0] = 0 #endif -#ifdef HAS_THREADING_SUPPORT +#if defined(CURL_MBEDTLS_DRBG) && defined(HAS_THREADING_SUPPORT) static mbedtls_entropy_context ts_entropy; static int entropy_init_initialized = 0; @@ -144,7 +150,7 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len) return ret; } -#endif /* HAS_THREADING_SUPPORT */ +#endif /* CURL_MBEDTLS_DRBG && HAS_THREADING_SUPPORT */ #ifdef MBEDTLS_DEBUG static void mbed_debug(void *context, int level, const char *f_name, @@ -538,6 +544,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_NOT_BUILT_IN; } +#ifdef CURL_MBEDTLS_DRBG #ifdef HAS_THREADING_SUPPORT mbedtls_ctr_drbg_init(&backend->ctr_drbg); @@ -562,6 +569,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_FAILED_INIT; } #endif /* HAS_THREADING_SUPPORT */ +#endif /* CURL_MBEDTLS_DRBG */ /* Load the trusted CA */ mbedtls_x509_crt_init(&backend->cacert); @@ -665,6 +673,17 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) if(ssl_config->key || ssl_config->key_blob) { if(ssl_config->key) { #ifdef MBEDTLS_FS_IO +#if MBEDTLS_VERSION_NUMBER >= 0x04000000 + ret = mbedtls_pk_parse_keyfile(&backend->pk, ssl_config->key, + ssl_config->key_passwd); + if(ret == 0 && !(mbedtls_pk_can_do_psa(&backend->pk, + PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_ANY_HASH), + PSA_KEY_USAGE_SIGN_HASH) || + mbedtls_pk_can_do_psa(&backend->pk, + MBEDTLS_PK_ALG_ECDSA(PSA_ALG_ANY_HASH), + PSA_KEY_USAGE_SIGN_HASH))) + ret = MBEDTLS_ERR_PK_TYPE_MISMATCH; +#else ret = mbedtls_pk_parse_keyfile(&backend->pk, ssl_config->key, ssl_config->key_passwd, mbedtls_ctr_drbg_random, @@ -672,6 +691,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) if(ret == 0 && !(mbedtls_pk_can_do(&backend->pk, MBEDTLS_PK_RSA) || mbedtls_pk_can_do(&backend->pk, MBEDTLS_PK_ECKEY))) ret = MBEDTLS_ERR_PK_TYPE_MISMATCH; +#endif if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); @@ -689,6 +709,18 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) const unsigned char *key_data = (const unsigned char *)ssl_key_blob->data; const char *passwd = ssl_config->key_passwd; +#if MBEDTLS_VERSION_NUMBER >= 0x04000000 + ret = mbedtls_pk_parse_key(&backend->pk, key_data, ssl_key_blob->len, + (const unsigned char *)passwd, + passwd ? strlen(passwd) : 0); + if(ret == 0 && !(mbedtls_pk_can_do_psa(&backend->pk, + PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_ANY_HASH), + PSA_KEY_USAGE_SIGN_HASH) || + mbedtls_pk_can_do_psa(&backend->pk, + MBEDTLS_PK_ALG_ECDSA(PSA_ALG_ANY_HASH), + PSA_KEY_USAGE_SIGN_HASH))) + ret = MBEDTLS_ERR_PK_TYPE_MISMATCH; +#else ret = mbedtls_pk_parse_key(&backend->pk, key_data, ssl_key_blob->len, (const unsigned char *)passwd, passwd ? strlen(passwd) : 0, @@ -697,6 +729,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) if(ret == 0 && !(mbedtls_pk_can_do(&backend->pk, MBEDTLS_PK_RSA) || mbedtls_pk_can_do(&backend->pk, MBEDTLS_PK_ECKEY))) ret = MBEDTLS_ERR_PK_TYPE_MISMATCH; +#endif if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); @@ -746,8 +779,9 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_SSL_CONNECT_ERROR; } -#ifdef MBEDTLS_SSL_SESSION_TICKETS - /* New in mbedTLS 3.6.1, need to enable, default is now disabled */ +#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_SSL_SESSION_TICKETS) + /* New in mbedTLS 3.6.1, need to enable, default is now disabled. + 4.0.0 enabled it by default for TLSv1.3. */ mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config, MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED); #endif @@ -769,8 +803,10 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) if(ret != CURLE_OK) return ret; +#ifdef CURL_MBEDTLS_DRBG mbedtls_ssl_conf_rng(&backend->config, mbedtls_ctr_drbg_random, &backend->ctr_drbg); +#endif ret = mbedtls_ssl_setup(&backend->ssl, &backend->config); if(ret) { @@ -1272,10 +1308,12 @@ static void mbedtls_close(struct Curl_cfilter *cf, struct Curl_easy *data) Curl_safefree(backend->ciphersuites); mbedtls_ssl_config_free(&backend->config); mbedtls_ssl_free(&backend->ssl); +#ifdef CURL_MBEDTLS_DRBG mbedtls_ctr_drbg_free(&backend->ctr_drbg); #ifndef HAS_THREADING_SUPPORT mbedtls_entropy_free(&backend->entropy); -#endif /* HAS_THREADING_SUPPORT */ +#endif /* !HAS_THREADING_SUPPORT */ +#endif backend->initialized = FALSE; } } @@ -1346,33 +1384,12 @@ static size_t mbedtls_version(char *buffer, size_t size) static CURLcode mbedtls_random(struct Curl_easy *data, unsigned char *entropy, size_t length) { -#ifdef MBEDTLS_CTR_DRBG_C - int ret; - mbedtls_entropy_context ctr_entropy; - mbedtls_ctr_drbg_context ctr_drbg; - mbedtls_entropy_init(&ctr_entropy); - mbedtls_ctr_drbg_init(&ctr_drbg); + psa_status_t status; (void)data; - ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, - &ctr_entropy, NULL, 0); - - if(!ret) - ret = mbedtls_ctr_drbg_random(&ctr_drbg, entropy, length); + status = psa_generate_random(entropy, length); - mbedtls_ctr_drbg_free(&ctr_drbg); - mbedtls_entropy_free(&ctr_entropy); - - return ret == 0 ? CURLE_OK : CURLE_FAILED_INIT; -#elif defined(MBEDTLS_HAVEGE_C) - mbedtls_havege_state hs; - mbedtls_havege_init(&hs); - mbedtls_havege_random(&hs, entropy, length); - mbedtls_havege_free(&hs); - return CURLE_OK; -#else - return CURLE_NOT_BUILT_IN; -#endif + return status == PSA_SUCCESS ? CURLE_OK : CURLE_FAILED_INIT; } static CURLcode mbedtls_connect(struct Curl_cfilter *cf, @@ -1434,29 +1451,15 @@ static int mbedtls_init(void) { if(!Curl_mbedtlsthreadlock_thread_setup()) return 0; -#ifdef HAS_THREADING_SUPPORT +#if defined(CURL_MBEDTLS_DRBG) && defined(HAS_THREADING_SUPPORT) entropy_init_mutex(&ts_entropy); #endif -#ifdef MBEDTLS_USE_PSA_CRYPTO /* requires mbedTLS 3.6.0+ */ - { - int ret; -#ifdef HAS_THREADING_SUPPORT - Curl_mbedtlsthreadlock_lock_function(0); -#endif - ret = psa_crypto_init(); -#ifdef HAS_THREADING_SUPPORT - Curl_mbedtlsthreadlock_unlock_function(0); -#endif - if(ret != PSA_SUCCESS) - return 0; - } -#endif /* MBEDTLS_USE_PSA_CRYPTO */ return 1; } static void mbedtls_cleanup(void) { -#ifdef HAS_THREADING_SUPPORT +#if defined(CURL_MBEDTLS_DRBG) && defined(HAS_THREADING_SUPPORT) entropy_cleanup_mutex(&ts_entropy); #endif (void)Curl_mbedtlsthreadlock_thread_cleanup(); @@ -1479,11 +1482,19 @@ static CURLcode mbedtls_sha256sum(const unsigned char *input, unsigned char *sha256sum, size_t sha256len) { - (void)sha256len; - /* returns 0 on success, otherwise failure */ - if(mbedtls_sha256(input, inputlen, sha256sum, 0) != 0) +#if defined(PSA_WANT_ALG_SHA_256) && PSA_WANT_ALG_SHA_256 /* mbedTLS 4+ */ + psa_status_t status; + size_t sha256len_actual; + status = psa_hash_compute(PSA_ALG_SHA_256, input, inputlen, + sha256sum, sha256len, + &sha256len_actual); + if(status != PSA_SUCCESS) return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_OK; +#else + (void)sha256len; + return Curl_sha256it(sha256sum, input, inputlen); +#endif } static void *mbedtls_get_internals(struct ssl_connect_data *connssl, diff --git a/m4/curl-mbedtls.m4 b/m4/curl-mbedtls.m4 index 519c29d79a69..55152c54081b 100644 --- a/m4/curl-mbedtls.m4 +++ b/m4/curl-mbedtls.m4 @@ -106,6 +106,25 @@ if test "x$OPT_MBEDTLS" != xno; then if false; then LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mbedtls mbedx509 mbedcrypto" fi + + mbedtls_4=0 + AC_MSG_CHECKING([for mbedTLS >= v4]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]],[[ + #if (MBEDTLS_VERSION_NUMBER >= 0x04000000) + return 0; + #else + #error older than 4 + #endif + ]]) + ],[ + mbedtls_4=1 + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + ]) fi fi dnl mbedTLS not disabled diff --git a/tests/libtest/lib1308.c b/tests/libtest/lib1308.c index 8e83462a7ade..1455b0b0dfe7 100644 --- a/tests/libtest/lib1308.c +++ b/tests/libtest/lib1308.c @@ -43,12 +43,15 @@ static CURLcode test_lib1308(const char *URL) { int errorcount = 0; CURLFORMcode rc; - int res; + CURLcode res = CURLE_OK; + int formres = 0; struct curl_httppost *post = NULL; struct curl_httppost *last = NULL; size_t total_size = 0; char buffer[] = "test buffer"; + global_init(CURL_GLOBAL_ALL); + rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_COPYCONTENTS, "content", CURLFORM_END); t1308_fail_unless(rc == 0, "curl_formadd returned error"); @@ -66,8 +69,8 @@ static CURLcode test_lib1308(const char *URL) CURLFORM_PTRCONTENTS, buffer, CURLFORM_END); t1308_fail_unless(rc == 0, "curl_formadd returned error"); - res = curl_formget(post, &total_size, print_httppost_callback); - t1308_fail_unless(res == 0, "curl_formget returned error"); + formres = curl_formget(post, &total_size, print_httppost_callback); + t1308_fail_unless(formres == 0, "curl_formget returned error"); t1308_fail_unless(total_size == 518, "curl_formget got wrong size back"); @@ -83,12 +86,14 @@ static CURLcode test_lib1308(const char *URL) CURLFORM_END); t1308_fail_unless(rc == 0, "curl_formadd returned error"); - res = curl_formget(post, &total_size, print_httppost_callback); + formres = curl_formget(post, &total_size, print_httppost_callback); - t1308_fail_unless(res == 0, "curl_formget returned error"); + t1308_fail_unless(formres == 0, "curl_formget returned error"); t1308_fail_unless(total_size == 899, "curl_formget got wrong size back"); curl_formfree(post); + curl_global_cleanup(); + return errorcount ? TEST_ERR_FAILURE : CURLE_OK; } From c4db9eb491b3652235ddb5b18425c08b29da0408 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 11:24:36 +0200 Subject: [PATCH 003/885] rustls: limit snprintf proper in cr_keylog_log_cb() It should limit the size to the size of the target array, not the incoming data. Pointed out by ZeroPath Closes #19095 --- lib/vtls/rustls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index ff2dea82b606..38e8a697a83b 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -518,7 +518,7 @@ cr_keylog_log_cb(struct rustls_str label, (void)client_random_len; DEBUGASSERT(client_random_len == CLIENT_RANDOM_SIZE); /* Turning a "rustls_str" into a null delimited "c" string */ - curl_msnprintf(clabel, label.len + 1, "%.*s", (int)label.len, label.data); + curl_msnprintf(clabel, sizeof(clabel), "%.*s", (int)label.len, label.data); Curl_tls_keylog_write(clabel, client_random, secret, secret_len); } From e2a4de8a607d3c7f52918ef50ab6411c753fa2ce Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 11:18:49 +0200 Subject: [PATCH 004/885] openssl: better return code checks when logging cert data Pointed out by ZeroPath Closes #19094 --- lib/vtls/openssl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 533acdaf8db7..04bab2cbf100 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4845,6 +4845,8 @@ static void infof_certstack(struct Curl_easy *data, const SSL *ssl) certstack = SSL_get_peer_cert_chain(ssl); else certstack = SSL_get0_verified_chain(ssl); + if(!certstack) + return; num_cert_levels = sk_X509_num(certstack); for(cert_level = 0; cert_level < num_cert_levels; cert_level++) { @@ -4860,12 +4862,17 @@ static void infof_certstack(struct Curl_easy *data, const SSL *ssl) const char *type_name; current_cert = sk_X509_value(certstack, cert_level); + if(!current_cert) + continue; + + current_pkey = X509_get0_pubkey(current_cert); + if(!current_pkey) + continue; X509_get0_signature(NULL, &palg_cert, current_cert); X509_ALGOR_get0(&paobj_cert, NULL, NULL, palg_cert); OBJ_obj2txt(cert_algorithm, sizeof(cert_algorithm), paobj_cert, 0); - current_pkey = X509_get0_pubkey(current_cert); key_bits = EVP_PKEY_bits(current_pkey); #ifndef HAVE_OPENSSL3 #define EVP_PKEY_get_security_bits EVP_PKEY_security_bits From 2719aa36b5cf7e638b1b4a0e5c69eb3068d5689d Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 17 Oct 2025 11:48:35 +0200 Subject: [PATCH 005/885] test_16: adjust timing expectations In MOST protocols and runs, the 'pretransfer' time is less than the 'starttransfer'. E.g. request being sent before response comes in. However, when curl is starved of cpu a server response might start streaming in before the multi-state transitioned to DID (and recorded the 'pretransfer' time). Do no longer check that 'pretransfer' is less or equal 'starttransfer'. Check that is is less or equal to the total time instead. Closes #19096 --- tests/http/test_16_info.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/http/test_16_info.py b/tests/http/test_16_info.py index ac4f4cc86605..53e335e950ac 100644 --- a/tests/http/test_16_info.py +++ b/tests/http/test_16_info.py @@ -160,9 +160,12 @@ def check_stat_times(self, s, idx): for key in ['time_appconnect', 'time_connect', 'time_namelookup']: assert s[key] < s['time_pretransfer'], f'time "{key}" larger than' \ f'"time_pretransfer": {s}' - # assert transfer start is after pretransfer - assert s['time_pretransfer'] <= s['time_starttransfer'], f'"time_pretransfer" '\ - f'greater than "time_starttransfer", {s}' + # assert transfer total is after pretransfer. + # (in MOST situations, pretransfer is before starttransfer, BUT + # in protocols like HTTP we might get a server response already before + # we transition to multi state DID.) + assert s['time_pretransfer'] <= s['time_total'], f'"time_pretransfer" '\ + f'greater than "time_total", {s}' # assert that transfer start is before total assert s['time_starttransfer'] <= s['time_total'], f'"time_starttransfer" '\ f'greater than "time_total", {s}' From f221cdeabe7d4f1b123b9306feed8e3b8fe6abb0 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 17 Oct 2025 10:59:11 +0200 Subject: [PATCH 006/885] ngtcp2: add a comment explaining write result handling The choice to continue processing incoming data although the writeout of the headers/data failed is not obvious. Add a comment explaining why this is done. Closes #19093 --- lib/vquic/curl_ngtcp2.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 53665b1a3d1d..56ca976b9f34 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1018,8 +1018,12 @@ static void h3_xfer_write_resp_hd(struct Curl_cfilter *cf, struct h3_stream_ctx *stream, const char *buf, size_t blen, bool eos) { - - /* If we already encountered an error, skip further writes */ + /* This function returns no error intentionally, but records + * the result at the stream, skipping further writes once the + * `result` of the transfer is known. + * The stream is subsequently cancelled "higher up" in the filter's + * send/recv callbacks. Closing the stream here leads to SEND/RECV + * errors in other places that then overwrite the transfer's result. */ if(!stream->xfer_result) { stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos); if(stream->xfer_result) @@ -1033,8 +1037,12 @@ static void h3_xfer_write_resp(struct Curl_cfilter *cf, struct h3_stream_ctx *stream, const char *buf, size_t blen, bool eos) { - - /* If we already encountered an error, skip further writes */ + /* This function returns no error intentionally, but records + * the result at the stream, skipping further writes once the + * `result` of the transfer is known. + * The stream is subsequently cancelled "higher up" in the filter's + * send/recv callbacks. Closing the stream here leads to SEND/RECV + * errors in other places that then overwrite the transfer's result. */ if(!stream->xfer_result) { stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos); /* If the transfer write is errored, we do not want any more data */ From 3df71e6dc23e80466c2d448ceb7dc070addbea67 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 10:12:50 +0200 Subject: [PATCH 007/885] openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs Detect and prevent abuse or mistakes. Limit set to 100. Closes #19091 --- lib/vtls/openssl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 04bab2cbf100..d51022b66474 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -349,6 +349,8 @@ static CURLcode X509V3_ext(struct Curl_easy *data, return result; } +#define MAX_ALLOWED_CERT_AMOUNT 100 + static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) { CURLcode result; @@ -364,6 +366,11 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) return CURLE_SSL_CONNECT_ERROR; numcerts = sk_X509_num(sk); + if(numcerts > MAX_ALLOWED_CERT_AMOUNT) { + failf(data, "%d certificates is more than allowed (%u)", (int)numcerts, + MAX_ALLOWED_CERT_AMOUNT); + return CURLE_SSL_CONNECT_ERROR; + } result = Curl_ssl_init_certinfo(data, (int)numcerts); if(result) From 9568109f71be2625c0bb6c4883e01042819b0f36 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 08:41:40 +0000 Subject: [PATCH 008/885] GHA: update ngtcp2/ngtcp2 to v1.17.0 Closes #19092 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 38d2fb6ac025..8971fc4e5408 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -54,7 +54,7 @@ env: # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com NGHTTP3_VERSION: 1.12.0 # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com - NGTCP2_VERSION: 1.16.0 + NGTCP2_VERSION: 1.17.0 # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com NGHTTP2_VERSION: 1.67.1 # renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com From 6296b9d383850bf603fb750e727dc2064b80fe69 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 13:05:58 +0200 Subject: [PATCH 009/885] tool_ipfs: simplify the ipfs gateway logic - make sure memory allocated by libcurl is freed with curl_free() - drop the ensure_trailing_slash complexity Closes #19097 --- src/tool_ipfs.c | 108 ++++++++++++++++-------------------------------- 1 file changed, 35 insertions(+), 73 deletions(-) diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index 13124133eaf3..1f77dad47fcc 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -30,100 +30,70 @@ #include "tool_ipfs.h" #include "memdebug.h" /* keep this as LAST include */ -/* ensure input ends in slash */ -static CURLcode ensure_trailing_slash(char **input) +/* input string ends in slash? */ +static bool has_trailing_slash(const char *input) { - if(*input && **input) { - size_t len = strlen(*input); - if(((*input)[len - 1] != '/')) { - struct dynbuf dyn; - curlx_dyn_init(&dyn, len + 2); - - if(curlx_dyn_addn(&dyn, *input, len)) { - tool_safefree(*input); - return CURLE_OUT_OF_MEMORY; - } - - tool_safefree(*input); - - if(curlx_dyn_addn(&dyn, "/", 1)) - return CURLE_OUT_OF_MEMORY; - - *input = curlx_dyn_ptr(&dyn); - } - } - - return CURLE_OK; + size_t len = strlen(input); + return (len && input[len - 1] == '/'); } static char *ipfs_gateway(void) { - char *ipfs_path = NULL; - char *gateway_composed_file_path = NULL; - FILE *gateway_file = NULL; - char *gateway = curl_getenv("IPFS_GATEWAY"); - - /* Gateway is found from environment variable. */ - if(gateway) { - if(ensure_trailing_slash(&gateway)) - goto fail; - return gateway; - } + char *ipfs_path_c = NULL; + char *gateway_composed_c = NULL; + FILE *gfile = NULL; + char *gateway_env = getenv("IPFS_GATEWAY"); + + if(gateway_env) + return strdup(gateway_env); /* Try to find the gateway in the IPFS data folder. */ - ipfs_path = curl_getenv("IPFS_PATH"); + ipfs_path_c = curl_getenv("IPFS_PATH"); - if(!ipfs_path) { + if(!ipfs_path_c) { char *home = getenv("HOME"); - if(home && *home) - ipfs_path = curl_maprintf("%s/.ipfs/", home); /* fallback to "~/.ipfs", as that is the default location. */ + if(home && *home) + ipfs_path_c = curl_maprintf("%s/.ipfs/", home); + if(!ipfs_path_c) + goto fail; } - if(!ipfs_path || ensure_trailing_slash(&ipfs_path)) - goto fail; - - gateway_composed_file_path = curl_maprintf("%sgateway", ipfs_path); + gateway_composed_c = + curl_maprintf("%s%sgateway", ipfs_path_c, + has_trailing_slash(ipfs_path_c) ? "" : "/"); - if(!gateway_composed_file_path) + if(!gateway_composed_c) goto fail; - gateway_file = curlx_fopen(gateway_composed_file_path, FOPEN_READTEXT); - tool_safefree(gateway_composed_file_path); + gfile = curlx_fopen(gateway_composed_c, FOPEN_READTEXT); + curl_free(gateway_composed_c); - if(gateway_file) { + if(gfile) { int c; struct dynbuf dyn; + char *gateway = NULL; curlx_dyn_init(&dyn, MAX_GATEWAY_URL_LEN); /* get the first line of the gateway file, ignore the rest */ - while((c = getc(gateway_file)) != EOF && c != '\n' && c != '\r') { + while((c = getc(gfile)) != EOF && c != '\n' && c != '\r') { char c_char = (char)c; if(curlx_dyn_addn(&dyn, &c_char, 1)) goto fail; } - curlx_fclose(gateway_file); - gateway_file = NULL; - if(curlx_dyn_len(&dyn)) gateway = curlx_dyn_ptr(&dyn); - if(gateway) - ensure_trailing_slash(&gateway); - - if(!gateway) - goto fail; - - tool_safefree(ipfs_path); + curl_free(ipfs_path_c); + curlx_fclose(gfile); return gateway; } fail: - if(gateway_file) - curlx_fclose(gateway_file); - tool_safefree(gateway); - tool_safefree(ipfs_path); + if(gfile) + curlx_fclose(gfile); + curl_free(ipfs_path_c); return NULL; } @@ -161,20 +131,13 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, * if we do have something but if it is an invalid url. */ if(config->ipfs_gateway) { - /* ensure the gateway ends in a trailing / */ - if(ensure_trailing_slash(&config->ipfs_gateway) != CURLE_OK) { - result = CURLE_OUT_OF_MEMORY; - goto clean; - } - if(!curl_url_set(gatewayurl, CURLUPART_URL, config->ipfs_gateway, - CURLU_GUESS_SCHEME)) { + CURLU_GUESS_SCHEME)) { gateway = strdup(config->ipfs_gateway); if(!gateway) { result = CURLE_URL_MALFORMAT; goto clean; } - } else { result = CURLE_BAD_FUNCTION_ARGUMENT; @@ -182,7 +145,6 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, } } else { - /* this is ensured to end in a trailing / within ipfs_gateway() */ gateway = ipfs_gateway(); if(!gateway) { result = CURLE_FILE_COULDNT_READ_FILE; @@ -230,10 +192,10 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, if(inputpath && (inputpath[0] == '/') && !inputpath[1]) *inputpath = '\0'; - /* ensure the gateway path ends with a trailing slash */ - ensure_trailing_slash(&gwpath); - pathbuffer = curl_maprintf("%s%s/%s%s", gwpath, protocol, cid, + pathbuffer = curl_maprintf("%s%s%s/%s%s", gwpath, + has_trailing_slash(gwpath) ? "" : "/", + protocol, cid, inputpath ? inputpath : ""); if(!pathbuffer) { goto clean; From fbff1d5b9071283024253ddf48e81547f6474394 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 14:27:58 +0200 Subject: [PATCH 010/885] openssl: avoid overwriting 'result' after error Follow-up to eefd03c572996e5de4dec4fe295ad6f Pointed out by ZeroPath https://zeropath.com/ Closes #19099 --- lib/vtls/openssl.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index d51022b66474..43fa417a3554 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5106,12 +5106,6 @@ static CURLcode ossl_apple_verify(struct Curl_cfilter *cf, { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); struct ossl_certs_ctx chain; - long ocsp_len = 0; -#ifdef HAVE_BORINGSSL_LIKE - const uint8_t *ocsp_data = NULL; -#else - unsigned char *ocsp_data = NULL; -#endif CURLcode result; memset(&chain, 0, sizeof(chain)); @@ -5123,13 +5117,20 @@ static CURLcode ossl_apple_verify(struct Curl_cfilter *cf, failf(data, "SSL: could not get peer certificate"); result = CURLE_PEER_FAILED_VERIFICATION; } + else { +#ifdef HAVE_BORINGSSL_LIKE + const uint8_t *ocsp_data = NULL; +#else + unsigned char *ocsp_data = NULL; +#endif + long ocsp_len = 0; + if(conn_config->verifystatus && !octx->reused_session) + ocsp_len = (long)SSL_get_tlsext_status_ocsp_resp(octx->ssl, &ocsp_data); - if(conn_config->verifystatus && !octx->reused_session) - ocsp_len = (long)SSL_get_tlsext_status_ocsp_resp(octx->ssl, &ocsp_data); - - result = Curl_vtls_apple_verify(cf, data, peer, chain.num_certs, - ossl_chain_get_der, &chain, - ocsp_data, ocsp_len); + result = Curl_vtls_apple_verify(cf, data, peer, chain.num_certs, + ossl_chain_get_der, &chain, + ocsp_data, ocsp_len); + } *pverified = !result; return result; } From c0564ceb3a51feb0f5c5236809aa8420644b1fc7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 13:23:46 +0200 Subject: [PATCH 011/885] cf-socket: if FD_CLOEXEC fails on accepted socket, cleanup Follow-up to 9d7b532404181568de1611084bd9f Pointed out by ZeroPath Closes #19098 --- lib/cf-socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 758641e40dbe..40df786bafa4 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -2138,6 +2138,7 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, (curlx_nonblock(s_accepted, TRUE) < 0)) { failf(data, "fcntl set CLOEXEC/NONBLOCK: %s", curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf))); + Curl_socket_close(data, cf->conn, s_accepted); return CURLE_FTP_ACCEPT_FAILED; } #endif From 4fb12f289189e8113967e9c9da09958fd8bfa4cb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 14:41:08 +0200 Subject: [PATCH 012/885] mime: fix use of fseek() Avoid the possible 64-bit offset truncation when used on systems with small 'long', like Windows. bonus: make mime_open_file() return bool Pointed out by ZeroPath Closes #19100 --- lib/formdata.c | 16 +--------------- lib/mime.c | 21 +++++++++++++++++---- lib/mime.h | 1 + 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/formdata.c b/lib/formdata.c index a98384c18ac9..382fd221dce6 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -771,20 +771,6 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) return res; } -/* wrap call to fseeko so it matches the calling convention of callback */ -static int fseeko_wrapper(void *stream, curl_off_t offset, int whence) -{ -#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) - return _fseeki64(stream, (__int64)offset, whence); -#elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) - return fseeko(stream, (off_t)offset, whence); -#else - if(offset > LONG_MAX) - return -1; - return fseek(stream, (long)offset, whence); -#endif -} - /* * Curl_getformdata() converts a linked list of "meta data" into a mime * structure. The input list is in 'post', while the output is stored in @@ -874,7 +860,7 @@ CURLcode Curl_getformdata(CURL *data, #endif result = curl_mime_data_cb(part, (curl_off_t) -1, (curl_read_callback) fread, - fseeko_wrapper, + Curl_fseeko, NULL, (void *) stdin); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop diff --git a/lib/mime.c b/lib/mime.c index b403d29b1fd9..baca30049f73 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -271,6 +271,19 @@ static char *Curl_basename(char *path) #define basename(x) Curl_basename((x)) #endif +int Curl_fseeko(void *stream, curl_off_t offset, int whence) +{ +#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) + return _fseeki64(stream, (__int64)offset, whence); +#elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) + return fseeko(stream, (off_t)offset, whence); +#else + if(offset > LONG_MAX) + return -1; + return fseek(stream, (long)offset, whence); +#endif +} + /* Set readback state. */ static void mimesetstate(struct mime_state *state, @@ -703,14 +716,14 @@ static void mime_mem_free(void *ptr) /* Named file callbacks. */ /* Argument is a pointer to the mime part. */ -static int mime_open_file(curl_mimepart *part) +static bool mime_open_file(curl_mimepart *part) { /* Open a MIMEKIND_FILE part. */ if(part->fp) - return 0; + return FALSE; part->fp = fopen_read(part->data, "rb"); - return part->fp ? 0 : -1; + return part->fp ? FALSE : TRUE; } static size_t mime_file_read(char *buffer, size_t size, size_t nitems, @@ -737,7 +750,7 @@ static int mime_file_seek(void *instream, curl_off_t offset, int whence) if(mime_open_file(part)) return CURL_SEEKFUNC_FAIL; - return fseek(part->fp, (long) offset, whence) ? + return Curl_fseeko(part->fp, offset, whence) ? CURL_SEEKFUNC_CANTSEEK : CURL_SEEKFUNC_OK; } diff --git a/lib/mime.h b/lib/mime.h index 5073a38f709a..dc6f0d4af176 100644 --- a/lib/mime.h +++ b/lib/mime.h @@ -138,6 +138,7 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) !defined(CURL_DISABLE_IMAP)) /* Prototypes. */ +int Curl_fseeko(void *stream, curl_off_t offset, int whence); void Curl_mime_initpart(struct curl_mimepart *part); void Curl_mime_cleanpart(struct curl_mimepart *part); CURLcode Curl_mime_duppart(struct Curl_easy *data, From 74147acd175d0faf7e1a8f04c905351fd43aad12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 18:19:42 +0000 Subject: [PATCH 013/885] GHA: update dependency ruff to v0.14.1 Closes #19085 --- .github/scripts/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 4533b2cfd7d9..564c3605ad72 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -6,4 +6,4 @@ cmakelang==0.6.13 codespell==2.4.1 pytype==2024.10.11 reuse==6.1.2 -ruff==0.14.0 +ruff==0.14.1 From 14e4d9c3c7fad13611a608fe2f9c4ed4139130e7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 17 Oct 2025 15:52:15 +0200 Subject: [PATCH 014/885] setopt: fix unused variable warning in minimal build Found via: #17961 Closes #19102 --- lib/setopt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/setopt.c b/lib/setopt.c index 7097c7f7b015..3c3adb06a9cb 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -870,7 +870,12 @@ static CURLcode value_range(long *value, long below_error, long min, long max) static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, long arg) { +#if !defined(CURL_DISABLE_PROXY) || \ + !defined(CURL_DISABLE_HTTP) || \ + defined(HAVE_GSSAPI) || \ + defined(USE_IPV6) unsigned long uarg = (unsigned long)arg; +#endif bool set = FALSE; CURLcode result = setopt_bool(data, option, arg, &set); struct UserDefined *s = &data->set; @@ -1097,7 +1102,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, #ifdef HAVE_GSSAPI case CURLOPT_GSSAPI_DELEGATION: - s->gssapi_delegation = (unsigned char)uarg& + s->gssapi_delegation = (unsigned char)uarg & (CURLGSSAPI_DELEGATION_POLICY_FLAG|CURLGSSAPI_DELEGATION_FLAG); break; #endif From 1d01d4975f540f3a363b38e1296aead62130fc6d Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 13 Oct 2025 11:32:17 +0200 Subject: [PATCH 015/885] socks_sspi: use the correct free function When freeing buffers allocated by SSPI, use its own function, not free(). Reported-by: Joshua Rogers Closes #19046 --- lib/socks_sspi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 54049e8c9928..1077019b11c5 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -590,9 +590,12 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); if(names.sUserName) Curl_pSecFn->FreeContextBuffer(names.sUserName); - free(sspi_w_token[0].pvBuffer); - free(sspi_w_token[1].pvBuffer); - free(sspi_w_token[2].pvBuffer); + if(sspi_w_token[0].pvBuffer) + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + if(sspi_w_token[1].pvBuffer) + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + if(sspi_w_token[2].pvBuffer) + Curl_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); free(etbuf); return result; } From 5cefb455d47db9965aa56288533489e495a123c5 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 17 Oct 2025 13:50:49 +0200 Subject: [PATCH 016/885] quic: improve UDP GRO receives Closes #19101 --- lib/vquic/curl_ngtcp2.c | 43 ++++++++++++++---------- lib/vquic/curl_quiche.c | 74 ++++++++++++++++++++++------------------- lib/vquic/vquic.c | 69 +++++++++++++++----------------------- lib/vquic/vquic_int.h | 11 +++--- 4 files changed, 97 insertions(+), 100 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 56ca976b9f34..b395cd082744 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1731,37 +1731,43 @@ static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } -static CURLcode recv_pkt(const unsigned char *pkt, size_t pktlen, - struct sockaddr_storage *remote_addr, - socklen_t remote_addrlen, int ecn, - void *userp) +static CURLcode cf_ngtcp2_recv_pkts(const unsigned char *buf, size_t buflen, + size_t gso_size, + struct sockaddr_storage *remote_addr, + socklen_t remote_addrlen, int ecn, + void *userp) { struct pkt_io_ctx *pktx = userp; struct cf_ngtcp2_ctx *ctx = pktx->cf->ctx; ngtcp2_pkt_info pi; ngtcp2_path path; + size_t offset, pktlen; int rv; if(ecn) - CURL_TRC_CF(pktx->data, pktx->cf, "vquic_recv(len=%zu, ecn=%x)", - pktlen, ecn); + CURL_TRC_CF(pktx->data, pktx->cf, "vquic_recv(len=%zu, gso=%zu, ecn=%x)", + buflen, gso_size, ecn); ngtcp2_addr_init(&path.local, (struct sockaddr *)&ctx->q.local_addr, (socklen_t)ctx->q.local_addrlen); ngtcp2_addr_init(&path.remote, (struct sockaddr *)remote_addr, remote_addrlen); pi.ecn = (uint8_t)ecn; - rv = ngtcp2_conn_read_pkt(ctx->qconn, &path, &pi, pkt, pktlen, pktx->ts); - if(rv) { - CURL_TRC_CF(pktx->data, pktx->cf, "ingress, read_pkt -> %s (%d)", - ngtcp2_strerror(rv), rv); - cf_ngtcp2_err_set(pktx->cf, pktx->data, rv); - - if(rv == NGTCP2_ERR_CRYPTO) - /* this is a "TLS problem", but a failed certificate verification - is a common reason for this */ - return CURLE_PEER_FAILED_VERIFICATION; - return CURLE_RECV_ERROR; + for(offset = 0; offset < buflen; offset += gso_size) { + pktlen = ((offset + gso_size) <= buflen) ? gso_size : (buflen - offset); + rv = ngtcp2_conn_read_pkt(ctx->qconn, &path, &pi, + buf + offset, pktlen, pktx->ts); + if(rv) { + CURL_TRC_CF(pktx->data, pktx->cf, "ingress, read_pkt -> %s (%d)", + ngtcp2_strerror(rv), rv); + cf_ngtcp2_err_set(pktx->cf, pktx->data, rv); + + if(rv == NGTCP2_ERR_CRYPTO) + /* this is a "TLS problem", but a failed certificate verification + is a common reason for this */ + return CURLE_PEER_FAILED_VERIFICATION; + return CURLE_RECV_ERROR; + } } return CURLE_OK; } @@ -1787,7 +1793,8 @@ static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, if(result) return result; - return vquic_recv_packets(cf, data, &ctx->q, 1000, recv_pkt, pktx); + return vquic_recv_packets(cf, data, &ctx->q, 1000, + cf_ngtcp2_recv_pkts, pktx); } /** diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 55f6e79ebefc..877a230e04f2 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -625,58 +625,63 @@ struct recv_ctx { int pkts; }; -static CURLcode recv_pkt(const unsigned char *pkt, size_t pktlen, - struct sockaddr_storage *remote_addr, - socklen_t remote_addrlen, int ecn, - void *userp) +static CURLcode cf_quiche_recv_pkts(const unsigned char *buf, size_t buflen, + size_t gso_size, + struct sockaddr_storage *remote_addr, + socklen_t remote_addrlen, int ecn, + void *userp) { struct recv_ctx *r = userp; struct cf_quiche_ctx *ctx = r->cf->ctx; quiche_recv_info recv_info; + size_t pktlen, offset; ssize_t nread; (void)ecn; - ++r->pkts; recv_info.to = (struct sockaddr *)&ctx->q.local_addr; recv_info.to_len = ctx->q.local_addrlen; recv_info.from = (struct sockaddr *)remote_addr; recv_info.from_len = remote_addrlen; - nread = quiche_conn_recv(ctx->qconn, - (unsigned char *)CURL_UNCONST(pkt), pktlen, - &recv_info); - if(nread < 0) { - if(QUICHE_ERR_DONE == nread) { - if(quiche_conn_is_draining(ctx->qconn)) { - CURL_TRC_CF(r->data, r->cf, "ingress, connection is draining"); - return CURLE_RECV_ERROR; + for(offset = 0; offset < buflen; offset += gso_size) { + pktlen = ((offset + gso_size) <= buflen) ? gso_size : (buflen - offset); + nread = quiche_conn_recv(ctx->qconn, + (unsigned char *)CURL_UNCONST(buf + offset), + pktlen, &recv_info); + if(nread < 0) { + if(QUICHE_ERR_DONE == nread) { + if(quiche_conn_is_draining(ctx->qconn)) { + CURL_TRC_CF(r->data, r->cf, "ingress, connection is draining"); + return CURLE_RECV_ERROR; + } + if(quiche_conn_is_closed(ctx->qconn)) { + CURL_TRC_CF(r->data, r->cf, "ingress, connection is closed"); + return CURLE_RECV_ERROR; + } + CURL_TRC_CF(r->data, r->cf, "ingress, quiche is DONE"); + return CURLE_OK; } - if(quiche_conn_is_closed(ctx->qconn)) { - CURL_TRC_CF(r->data, r->cf, "ingress, connection is closed"); + else if(QUICHE_ERR_TLS_FAIL == nread) { + long verify_ok = SSL_get_verify_result(ctx->tls.ossl.ssl); + if(verify_ok != X509_V_OK) { + failf(r->data, "SSL certificate problem: %s", + X509_verify_cert_error_string(verify_ok)); + return CURLE_PEER_FAILED_VERIFICATION; + } + failf(r->data, "ingress, quiche reports TLS fail"); return CURLE_RECV_ERROR; } - CURL_TRC_CF(r->data, r->cf, "ingress, quiche is DONE"); - return CURLE_OK; - } - else if(QUICHE_ERR_TLS_FAIL == nread) { - long verify_ok = SSL_get_verify_result(ctx->tls.ossl.ssl); - if(verify_ok != X509_V_OK) { - failf(r->data, "SSL certificate problem: %s", - X509_verify_cert_error_string(verify_ok)); - return CURLE_PEER_FAILED_VERIFICATION; + else { + failf(r->data, "quiche reports error %zd on receive", nread); + return CURLE_RECV_ERROR; } - failf(r->data, "ingress, quiche reports TLS fail"); - return CURLE_RECV_ERROR; } - else { - failf(r->data, "quiche reports error %zd on receive", nread); - return CURLE_RECV_ERROR; + else if((size_t)nread < pktlen) { + CURL_TRC_CF(r->data, r->cf, "ingress, quiche only read %zd/%zu bytes", + nread, pktlen); } - } - else if((size_t)nread < pktlen) { - CURL_TRC_CF(r->data, r->cf, "ingress, quiche only read %zd/%zu bytes", - nread, pktlen); + ++r->pkts; } return CURLE_OK; @@ -698,7 +703,8 @@ static CURLcode cf_process_ingress(struct Curl_cfilter *cf, rctx.data = data; rctx.pkts = 0; - result = vquic_recv_packets(cf, data, &ctx->q, 1000, recv_pkt, &rctx); + result = vquic_recv_packets(cf, data, &ctx->q, 1000, + cf_quiche_recv_pkts, &rctx); if(result) return result; diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 30917b835af0..24ba8a97e490 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -378,9 +378,16 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx, size_t max_pkts, - vquic_recv_pkt_cb *recv_cb, void *userp) + vquic_recv_pkts_cb *recv_cb, void *userp) { +#if defined(__linux__) && defined(UDP_GRO) #define MMSG_NUM 16 +#define UDP_GRO_CNT_MAX 64 +#else +#define MMSG_NUM 64 +#define UDP_GRO_CNT_MAX 1 +#endif +#define MSG_BUF_SIZE (UDP_GRO_CNT_MAX * 1500) struct iovec msg_iov[MMSG_NUM]; struct mmsghdr mmsg[MMSG_NUM]; uint8_t msg_ctrl[MMSG_NUM * CMSG_SPACE(sizeof(int))]; @@ -390,17 +397,15 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, char errstr[STRERROR_LEN]; CURLcode result = CURLE_OK; size_t gso_size; - size_t pktlen; - size_t offset, to; char *sockbuf = NULL; - uint8_t (*bufs)[64*1024] = NULL; + uint8_t (*bufs)[MSG_BUF_SIZE] = NULL; DEBUGASSERT(max_pkts > 0); - result = Curl_multi_xfer_sockbuf_borrow(data, MMSG_NUM * sizeof(bufs[0]), + result = Curl_multi_xfer_sockbuf_borrow(data, MMSG_NUM * MSG_BUF_SIZE, &sockbuf); if(result) goto out; - bufs = (uint8_t (*)[64*1024])sockbuf; + bufs = (uint8_t (*)[MSG_BUF_SIZE])sockbuf; total_nread = 0; while(pkts < max_pkts) { @@ -449,22 +454,12 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, gso_size = mmsg[i].msg_len; } - for(offset = 0; offset < mmsg[i].msg_len; offset = to) { - ++pkts; - - to = offset + gso_size; - if(to > mmsg[i].msg_len) { - pktlen = mmsg[i].msg_len - offset; - } - else { - pktlen = gso_size; - } - - result = recv_cb(bufs[i] + offset, pktlen, mmsg[i].msg_hdr.msg_name, - mmsg[i].msg_hdr.msg_namelen, 0, userp); - if(result) - goto out; - } + result = recv_cb(bufs[i], mmsg[i].msg_len, gso_size, + mmsg[i].msg_hdr.msg_name, + mmsg[i].msg_hdr.msg_namelen, 0, userp); + if(result) + goto out; + pkts += (mmsg[i].msg_len + gso_size - 1) / gso_size; } } @@ -481,7 +476,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx, size_t max_pkts, - vquic_recv_pkt_cb *recv_cb, void *userp) + vquic_recv_pkts_cb *recv_cb, void *userp) { struct iovec msg_iov; struct msghdr msg; @@ -494,8 +489,6 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, CURLcode result = CURLE_OK; uint8_t msg_ctrl[CMSG_SPACE(sizeof(int))]; size_t gso_size; - size_t pktlen; - size_t offset, to; DEBUGASSERT(max_pkts > 0); for(pkts = 0, total_nread = 0, calls = 0; pkts < max_pkts;) { @@ -542,20 +535,10 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, gso_size = nread; } - for(offset = 0; offset < nread; offset = to) { - ++pkts; - - to = offset + gso_size; - if(to > nread) - pktlen = nread - offset; - else - pktlen = gso_size; - - result = - recv_cb(buf + offset, pktlen, msg.msg_name, msg.msg_namelen, 0, userp); - if(result) - goto out; - } + result = recv_cb(buf, nread, gso_size, + msg.msg_name, msg.msg_namelen, 0, userp); + if(result) + goto out; } out: @@ -570,7 +553,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx, size_t max_pkts, - vquic_recv_pkt_cb *recv_cb, void *userp) + vquic_recv_pkts_cb *recv_cb, void *userp) { uint8_t buf[64*1024]; int bufsize = (int)sizeof(buf); @@ -611,8 +594,8 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, ++pkts; ++calls; total_nread += (size_t)nread; - result = recv_cb(buf, (size_t)nread, &remote_addr, remote_addrlen, - 0, userp); + result = recv_cb(buf, (size_t)nread, (size_t)nread, + &remote_addr, remote_addrlen, 0, userp); if(result) goto out; } @@ -629,7 +612,7 @@ CURLcode vquic_recv_packets(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx, size_t max_pkts, - vquic_recv_pkt_cb *recv_cb, void *userp) + vquic_recv_pkts_cb *recv_cb, void *userp) { CURLcode result; #ifdef HAVE_SENDMMSG diff --git a/lib/vquic/vquic_int.h b/lib/vquic/vquic_int.h index 38189beb7038..4e5959a4f803 100644 --- a/lib/vquic/vquic_int.h +++ b/lib/vquic/vquic_int.h @@ -78,16 +78,17 @@ CURLcode vquic_flush(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx); -typedef CURLcode vquic_recv_pkt_cb(const unsigned char *pkt, size_t pktlen, - struct sockaddr_storage *remote_addr, - socklen_t remote_addrlen, int ecn, - void *userp); +typedef CURLcode vquic_recv_pkts_cb(const unsigned char *buf, size_t buflen, + size_t gso_size, + struct sockaddr_storage *remote_addr, + socklen_t remote_addrlen, int ecn, + void *userp); CURLcode vquic_recv_packets(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx, size_t max_pkts, - vquic_recv_pkt_cb *recv_cb, void *userp); + vquic_recv_pkts_cb *recv_cb, void *userp); #endif /* !USE_HTTP3 */ From 373855a4da0882ccb07a1b80b3754c80acc0d502 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 17 Oct 2025 17:26:45 +0200 Subject: [PATCH 017/885] GHA/curl-for-win: add minimal Linux build A bit more minimal build than the one used for trurl. To stress test a build with most features disabled. Costs 40 seconds, of which 6 is the build, rest is installing tools. Ref: https://github.com/curl/curl-for-win/commit/5b385001d5f89886553cf83aa3f2f24476a865f4 Ref: https://github.com/curl/curl-for-win/commit/3ee10692c73a61522cabb3a4d2e94eb228249250 Follow-up to 5af2457848357141b3b3c67f7a45a4964ec25233 #17818 Closes #17961 --- .github/workflows/curl-for-win.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/curl-for-win.yml b/.github/workflows/curl-for-win.yml index 91b0382a7562..a029ba834411 100644 --- a/.github/workflows/curl-for-win.yml +++ b/.github/workflows/curl-for-win.yml @@ -71,6 +71,33 @@ jobs: "${DOCKER_IMAGE_STABLE}" \ sh -c ./_ci-linux-debian.sh + linux-glibc-gcc-minimal: # use gcc to minimize installed packages + name: 'Linux gcc glibc minimal' + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + path: 'curl' + fetch-depth: 8 + - name: 'build' + run: | + git clone --depth 1 https://github.com/curl/curl-for-win + mv curl-for-win/* . + export CW_CONFIG='-main-werror-unitybatch-prefill-zero-osnotls-osnoidn-nohttp-nocurltool-linux-x64-gcc' + export CW_REVISION="${GITHUB_SHA}" + . ./_versions.sh + sudo podman image trust set --type reject default + sudo podman image trust set --type accept docker.io/library + time podman pull "${DOCKER_IMAGE}" + podman images --digests + time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ + --env-file <(env | grep -a -E \ + '^(CW_|GITHUB_)') \ + "${DOCKER_IMAGE}" \ + sh -c ./_ci-linux-debian.sh + linux-musl-llvm: name: 'Linux llvm MUSL (amd64, riscv64)' runs-on: ubuntu-latest From e9455ea523d91c8f6f29c3ae1f37500f0b637204 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 17:05:08 +0200 Subject: [PATCH 018/885] rustls: make read_file_into not reject good files For files with sizes using an exact multiple of 256 bytes, the final successful read(s) filled the buffer(s) and the subsequent fread returned 0 for EOF, which caused read_file_into to fail. Now, it needs to return 0 and not be EOF to be an error. Follow-up to dd95a49d493d55db38b352fdbda2 Pointed out by ZeroPath Closes #19104 --- lib/vtls/rustls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 38e8a697a83b..ebd94213d493 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -404,8 +404,8 @@ read_file_into(const char *filename, for(;;) { uint8_t buf[256]; const size_t rr = fread(buf, 1, sizeof(buf), f); - if(rr == 0 || - CURLE_OK != curlx_dyn_addn(out, buf, rr)) { + if((!rr && !feof(f)) || + curlx_dyn_addn(out, buf, rr)) { curlx_fclose(f); return 0; } From 25eb34dd3e7fedb400d3e5b99920936db6711b1e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 16:54:57 +0200 Subject: [PATCH 019/885] KNOWN_BUGS: SOCKS-SSPI discards the security context Also make the verbose log say it Pointed out by ZeroPath Closes #19103 --- docs/KNOWN_BUGS | 10 ++++++++++ lib/socks_sspi.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS index d4e4423094ef..15ca40102aa8 100644 --- a/docs/KNOWN_BUGS +++ b/docs/KNOWN_BUGS @@ -67,6 +67,7 @@ problems may have been fixed or changed somewhat since this was written. 10. Connection 10.1 --interface with link-scoped IPv6 address 10.2 Does not acknowledge getaddrinfo sorting policy + 10.3 SOCKS-SSPI discards the security context 11. Internals 11.1 gssapi library name + version is missing in curl_version_info() @@ -444,6 +445,15 @@ problems may have been fixed or changed somewhat since this was written. https://github.com/curl/curl/issues/16718 + +10.3 SOCKS-SSPI discards the security context + + After a successful SSPI/GSS-API exchange, the function queries and logs the + authenticated username and reports the supported data-protection level, but + then immediately deletes the negotiated SSPI security context and frees the + credentials before returning. The negotiated context is not stored on the + connection and is therefore never used to protect later SOCKS5 traffic. + 11. Internals 11.1 gssapi library name + version is missing in curl_version_info() diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 1077019b11c5..d4837708a7a6 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -562,7 +562,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } (void)curlx_nonblock(sock, TRUE); - infof(data, "SOCKS5 access with%s protection granted.", + infof(data, "SOCKS5 access with%s protection granted BUT NOT USED.", (socksreq[0] == 0) ? "out GSS-API data": ((socksreq[0] == 1) ? " GSS-API integrity" : " GSS-API confidentiality")); From 87b72b81829f8ef8fc0a243667cb7aea9d0c1c6e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 14 Oct 2025 17:43:48 +0200 Subject: [PATCH 020/885] krb5: fix `output_token` allocators in the GSS debug stub (Windows) Before this patch system `malloc()`/`free()` were used to allocate the buffer returned in the `output_token` object from the debug stub of `gss_init_sec_context()` when enabled via `CURL_STUB_GSS_CREDS` in debug-enabled libcurl builds. This object is later released via stock `gss_release_buffer()`, which, in the Windows builds of MIT Kerberos, doesn't use the system `free()`, but the Win32 `HeapFree()`. Fix it by using the GSS alloc/free macros: `gssalloc_malloc()` and `gssalloc_free()` from `gssapi_alloc.h`. To make this work without MIT Kerberos feature detection, use a canary macro to detect a version which installs `gssapi_alloc.h` for Windows. For <1.15 (2016-11-30) releases, that do not install it, disable the GSS debug stub in libcurl. Strictly speaking, non-Windows builds would also need to use GSS allocators, but, detecting support for `gssapi_alloc.h` is impossible without build-level logic. Built-level logic is complex and overkill, and MIT Kerberos, as of 1.22.1, uses standard malloc/free on non-Windows platforms anyway. (except in GSS debug builds.) Follow-up to 73840836a51c443e6b5d385014ce1c8f5be3e02b #17752 Closes #19064 --- lib/curl_gssapi.c | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index 42ccaa3e2962..74128559c172 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -29,6 +29,28 @@ #include "curl_gssapi.h" #include "sendf.h" +#ifdef DEBUGBUILD +#if defined(HAVE_GSSGNU) || !defined(_WIN32) +/* To avoid memdebug macro replacement, wrap the name in parentheses to call + the original version. It is freed via the GSS API gss_release_buffer(). */ +#define Curl_gss_alloc (malloc) +#define Curl_gss_free (free) +#define CURL_GSS_STUB +/* For correctness this would be required for all platforms, not only Windows, + but, as of v1.22.1, MIT Kerberos uses a special allocator only for Windows, + and the availability of 'gssapi/gssapi_alloc.h' is difficult to detect, + because GSS headers are not versioned, and there is also no other macro to + indicate 1.18+ vs. previous versions. On Windows we can use 'GSS_S_BAD_MIC'. + */ +#elif defined(_WIN32) && defined(GSS_S_BAD_MIC) /* MIT Kerberos 1.15+ */ +/* MIT Kerberos 1.10+ (Windows), 1.18+ (all platforms), missing from GNU GSS */ +#include +#define Curl_gss_alloc gssalloc_malloc +#define Curl_gss_free gssalloc_free +#define CURL_GSS_STUB +#endif +#endif /* DEBUGBUILD */ + /* The last 2 #include files should be in this order */ #include "curl_memory.h" #include "memdebug.h" @@ -51,7 +73,7 @@ gss_OID_desc Curl_krb5_mech_oid CURL_ALIGN8 = { 9, CURL_UNCONST("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02") }; -#ifdef DEBUGBUILD +#ifdef CURL_GSS_STUB enum min_err_code { STUB_GSS_OK = 0, STUB_GSS_NO_MEMORY, @@ -212,9 +234,7 @@ stub_gss_init_sec_context(OM_uint32 *min, ctx->flags = req_flags; } - /* To avoid memdebug macro replacement, wrap the name in parentheses to call - the original version. It is freed via the GSS API gss_release_buffer(). */ - token = (malloc)(length); + token = Curl_gss_alloc(length); if(!token) { free(ctx); *min = STUB_GSS_NO_MEMORY; @@ -229,14 +249,14 @@ stub_gss_init_sec_context(OM_uint32 *min, major_status = gss_display_name(&minor_status, target_name, &target_desc, &name_type); if(GSS_ERROR(major_status)) { - (free)(token); + Curl_gss_free(token); free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; } if(strlen(creds) + target_desc.length + 5 >= sizeof(ctx->creds)) { - (free)(token); + Curl_gss_free(token); free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; @@ -252,7 +272,7 @@ stub_gss_init_sec_context(OM_uint32 *min, } if(used >= length) { - (free)(token); + Curl_gss_free(token); free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; @@ -294,7 +314,7 @@ stub_gss_delete_sec_context(OM_uint32 *min, return GSS_S_COMPLETE; } -#endif /* DEBUGBUILD */ +#endif /* CURL_GSS_STUB */ OM_uint32 Curl_gss_init_sec_context(struct Curl_easy *data, OM_uint32 *minor_status, @@ -324,7 +344,7 @@ OM_uint32 Curl_gss_init_sec_context(struct Curl_easy *data, if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_FLAG) req_flags |= GSS_C_DELEG_FLAG; -#ifdef DEBUGBUILD +#ifdef CURL_GSS_STUB if(getenv("CURL_STUB_GSS_CREDS")) return stub_gss_init_sec_context(minor_status, GSS_C_NO_CREDENTIAL, /* cred_handle */ @@ -339,7 +359,7 @@ OM_uint32 Curl_gss_init_sec_context(struct Curl_easy *data, output_token, ret_flags, NULL /* time_rec */); -#endif /* DEBUGBUILD */ +#endif /* CURL_GSS_STUB */ return gss_init_sec_context(minor_status, GSS_C_NO_CREDENTIAL, /* cred_handle */ @@ -360,12 +380,12 @@ OM_uint32 Curl_gss_delete_sec_context(OM_uint32 *min, gss_ctx_id_t *context, gss_buffer_t output_token) { -#ifdef DEBUGBUILD +#ifdef CURL_GSS_STUB if(getenv("CURL_STUB_GSS_CREDS")) return stub_gss_delete_sec_context(min, (struct stub_gss_ctx_id_t_desc **)context, output_token); -#endif /* DEBUGBUILD */ +#endif /* CURL_GSS_STUB */ return gss_delete_sec_context(min, context, output_token); } From 480ff0cf584413814955a45da84957f37ba02d1a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 18:23:11 +0200 Subject: [PATCH 021/885] INSTALL: update the list of known operating systems curl has run on Closes #19106 --- docs/INSTALL.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 453071afd57b..0fe724390c52 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -650,22 +650,22 @@ This is a probably incomplete list of known CPU architectures and operating systems that curl has been compiled for. If you know a system curl compiles and runs on, that is not listed, please let us know. -## 104 Operating Systems +## 108 Operating Systems - AIX, AmigaOS, Android, ArcoOS, Aros, Atari FreeMiNT, BeOS, Blackberry - 10, Blackberry Tablet OS, Cell OS, CheriBSD, Chrome OS, Cisco IOS, + AIX, AmigaOS, Android, ArcaOS, Aros, Atari FreeMiNT, BeOS, Blackberry 10, + Blackberry Tablet OS, Cell OS, Cesium, CheriBSD, Chrome OS, Cisco IOS, DG/UX, DR DOS, Dragonfly BSD, eCOS, FreeBSD, FreeDOS, FreeRTOS, Fuchsia, Garmin OS, Genode, Haiku, HardenedBSD, HP-UX, Hurd, IBM I, illumos, - Integrity, iOS, ipadOS, IRIX, Linux, Lua RTOS, Mac OS 9, macOS, Maemo, - Mbed, Meego, Micrium, MINIX, Minoca, Moblin, MorphOS, MPE/iX, MS-DOS, - NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo 3DS Nintendo Switch, - NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, OS21, Plan 9, - PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, RISC OS, ROS, - RTEMS, Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, software, - Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS, - ucLinux, Ultrix, UNICOS, UnixWare, VMS, vxWorks, watchOS, Wear OS, - WebOS, Wii system Wii U, Windows CE, Windows, Xbox System, Xenix, z/OS, - z/TPF, z/VM, z/VSE, Zephyr + Integrity, iOS, ipadOS, IRIX, KasperskyOS, Linux, Lua RTOS, Mac OS 9, + macOS, Maemo, Mbed, Meego, Micrium, MINIX, Minoca, Moblin, MorphOS, + MPE/iX, MS-DOS, NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo 3DS, + Nintendo Switch, NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, + OS21, PikeOS, Plan 9, PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, + RISC OS, ROS, RTEMS, Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, + SmartOS, Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, + tvOS, ucLinux, Ultrix, UNICOS, UnixWare, visionOS, VMS, vxWorks, watchOS, + Wear OS, WebOS, Wii System Software, Wii U, Windows, Windows CE, + Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr ## 28 CPU Architectures From d6c39cd2cb3a182f93f94cbff180dc29bfee461c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 17:55:15 +0200 Subject: [PATCH 022/885] curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY Bug: https://curl.se/mail/lib-2025-10/0018.html Reported-by: curl.stunt430 Closes #19105 --- include/curl/curl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/curl/curl.h b/include/curl/curl.h index 49552558ddb7..917b10142000 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -1953,8 +1953,7 @@ typedef enum { /* Pass in a bitmask of "header options" */ CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229), - /* The public key in DER form used to validate the peer public key - this option is used only if SSL_VERIFYPEER is true */ + /* The public key used to validate the peer public key */ CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230), /* Path to Unix domain socket */ From e29706d6e24f7327d3b3393b1f93b06aef642e7b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 22:47:28 +0200 Subject: [PATCH 023/885] mbedtls: move the crypto init into the vtls init function Follow-up to 3a305831d1a9d10b2bfd4fa3939 Closes #19108 --- lib/easy.c | 29 ----------------------------- lib/vtls/mbedtls.c | 5 +++++ 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/lib/easy.c b/lib/easy.c index f12a8b143f0c..793a18f33eb8 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -80,10 +80,6 @@ #include "easy_lock.h" -#ifdef USE_MBEDTLS -#include -#endif - /* The last 2 #include files should be in this order */ #include "curl_memory.h" #include "memdebug.h" @@ -141,24 +137,6 @@ curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; static char *leakpointer; #endif -static CURLcode crypto_init(void) -{ -#ifdef USE_MBEDTLS - psa_status_t status; - status = psa_crypto_init(); - if(status != PSA_SUCCESS) - return CURLE_FAILED_INIT; -#endif - return CURLE_OK; -} - -static void crypto_cleanup(void) -{ -#ifdef USE_MBEDTLS - mbedtls_psa_crypto_free(); -#endif -} - /** * curl_global_init() globally initializes curl given a bitwise set of the * different features of what to initialize. @@ -182,11 +160,6 @@ static CURLcode global_init(long flags, bool memoryfuncs) goto fail; } - if(crypto_init()) { - DEBUGF(curl_mfprintf(stderr, "Error: crypto_init failed\n")); - goto fail; - } - if(!Curl_ssl_init()) { DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n")); goto fail; @@ -325,8 +298,6 @@ void curl_global_cleanup(void) Curl_ssh_cleanup(); - crypto_cleanup(); - #ifdef DEBUGBUILD free(leakpointer); #endif diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index ebb8a4abc009..5ee0c814fd3d 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -1449,6 +1449,10 @@ static CURLcode mbedtls_connect(struct Curl_cfilter *cf, */ static int mbedtls_init(void) { + psa_status_t status; + status = psa_crypto_init(); + if(status != PSA_SUCCESS) + return 0; if(!Curl_mbedtlsthreadlock_thread_setup()) return 0; #if defined(CURL_MBEDTLS_DRBG) && defined(HAS_THREADING_SUPPORT) @@ -1463,6 +1467,7 @@ static void mbedtls_cleanup(void) entropy_cleanup_mutex(&ts_entropy); #endif (void)Curl_mbedtlsthreadlock_thread_cleanup(); + mbedtls_psa_crypto_free(); } static bool mbedtls_data_pending(struct Curl_cfilter *cf, From c921f6d05271e83c62ee6b2e142d76198900c4a4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 23:14:37 +0200 Subject: [PATCH 024/885] wolfssl: fix resource leak in verify_pinned error paths Pointed out by ZeroPath Closes #19110 --- lib/vtls/wolfssl.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index d4a0e066fa03..d2bb3eb49e81 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1546,6 +1546,8 @@ CURLcode Curl_wssl_verify_pinned(struct Curl_cfilter *cf, struct Curl_easy *data, struct wssl_ctx *wssl) { + WOLFSSL_X509 *x509 = NULL; + CURLcode result = CURLE_OK; #ifndef CURL_DISABLE_PROXY const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf) ? data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : @@ -1557,50 +1559,48 @@ CURLcode Curl_wssl_verify_pinned(struct Curl_cfilter *cf, if(pinnedpubkey) { #ifdef KEEP_PEER_CERT - WOLFSSL_X509 *x509; const char *x509_der; int x509_der_len; struct Curl_X509certificate x509_parsed; struct Curl_asn1Element *pubkey; - CURLcode result; + + result = CURLE_SSL_PINNEDPUBKEYNOTMATCH; x509 = wolfSSL_get_peer_certificate(wssl->ssl); if(!x509) { failf(data, "SSL: failed retrieving server certificate"); - return CURLE_SSL_PINNEDPUBKEYNOTMATCH; + goto end; } x509_der = (const char *)wolfSSL_X509_get_der(x509, &x509_der_len); if(!x509_der) { failf(data, "SSL: failed retrieving ASN.1 server certificate"); - return CURLE_SSL_PINNEDPUBKEYNOTMATCH; + goto end; } memset(&x509_parsed, 0, sizeof(x509_parsed)); if(Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len)) - return CURLE_SSL_PINNEDPUBKEYNOTMATCH; + goto end; pubkey = &x509_parsed.subjectPublicKeyInfo; if(!pubkey->header || pubkey->end <= pubkey->header) { failf(data, "SSL: failed retrieving public key from server certificate"); - return CURLE_SSL_PINNEDPUBKEYNOTMATCH; + goto end; } - result = Curl_pin_peer_pubkey(data, - pinnedpubkey, + result = Curl_pin_peer_pubkey(data, pinnedpubkey, (const unsigned char *)pubkey->header, (size_t)(pubkey->end - pubkey->header)); - wolfSSL_FreeX509(x509); - if(result) { + if(result) failf(data, "SSL: public key does not match pinned public key"); - return result; - } #else failf(data, "Library lacks pinning support built-in"); return CURLE_NOT_BUILT_IN; #endif } - return CURLE_OK; +end: + wolfSSL_FreeX509(x509); + return result; } #ifdef WOLFSSL_EARLY_DATA From 3087511b0fb11ce9199aca0e7fe77ca3403b25b3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 17 Oct 2025 23:39:16 +0200 Subject: [PATCH 025/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 110 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 77 insertions(+), 33 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0930a2719e04..740cfc9df249 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3519 + Contributors: 3520 This release includes the following changes: @@ -28,17 +28,18 @@ This release includes the following bugfixes: o asyn-thrdd resolver: clear timeout when done [97] o asyn-thrdd: drop pthread_cancel [30] o autotools: add support for libgsasl auto-detection via pkg-config [112] - o autotools: capitalize 'Rustls' in the log output [106] - o autotools: fix duplicate `UNIX` and `BSD` flags in `buildinfo.txt` [113] - o autotools: fix silly mistake in clang detection for `buildinfo.txt` [114] - o autotools: make `--enable-code-coverage` support llvm/clang [79] + o autotools: capitalize Rustls in the log output [106] + o autotools: drop detection of ancient OpenSSL libs RSAglue and rsaref [354] + o autotools: fix duplicate UNIX and BSD flags in buildinfo.txt [113] + o autotools: fix silly mistake in clang detection for buildinfo.txt [114] + o autotools: make --enable-code-coverage support llvm/clang [79] o aws-lc: re-enable large read-ahead with v1.61.0 again [16] o base64: accept zero length argument to base64_encode [82] - o build: address some `-Weverything` warnings, update picky warnings [74] - o build: avoid overriding system `open` and `stat` symbols [141] + o build: address some -Weverything warnings, update picky warnings [74] + o build: avoid overriding system open and stat symbols [141] o build: avoid overriding system symbols for fopen functions [150] o build: avoid overriding system symbols for socket functions [68] - o build: show llvm/clang in platform flags and `buildinfo.txt` [126] + o build: show llvm/clang in platform flags and buildinfo.txt [126] o c-ares: when resolving failed, persist error [270] o cf-h2-proxy: break loop on edge case [140] o cf-ip-happy: mention unix domain path, not port number [161] @@ -49,27 +50,27 @@ This release includes the following bugfixes: o cf-socket: use the right byte order for ports in bindlocal [61] o cfilter: unlink and discard [46] o checksrc: allow disabling warnings on FIXME/TODO comments [324] - o checksrc: catch banned functions when preceded by `(` [146] - o checksrc: fix possible endless loop when detecting `BANNEDFUNC` [149] - o checksrc: fix possible endless loops/errors in the banned function logic [220] - o checksrc: fix to handle `)` predecing a banned function [229] + o checksrc: catch banned functions when preceded by ( [146] + o checksrc: fix possible endless loop when detecting BANNEDFUNC [149] + o checksrc: fix possible endless loops in the banned function logic [220] + o checksrc: fix to handle ) predecing a banned function [229] o checksrc: reduce directory-specific exceptions [228] o CI.md: refresh [280] o cmake/FindGSS: dedupe pkg-config module strings [277] o cmake/FindGSS: drop wrong header check for GNU GSS [278] - o cmake/FindGSS: fix `pkg-config` fallback logic for CMake <3.16 [189] + o cmake/FindGSS: fix pkg-config fallback logic for CMake <3.16 [189] o cmake/FindGSS: simplify/de-dupe lib setup [253] o cmake/FindGSS: whitespace/formatting [268] - o cmake: add `CURL_CODE_COVERAGE` option [78] + o cmake: add CURL_CODE_COVERAGE option [78] o cmake: build the "all" examples source list dynamically [245] o cmake: clang detection tidy-ups [116] o cmake: drop exclamation in comment looking like a name [160] - o cmake: fix building docs when the base directory contains `.3` [18] + o cmake: fix building docs when the base directory contains .3 [18] o cmake: minor Heimdal flavour detection fix [269] o cmake: pre-fill three more type sizes on Windows [244] o cmake: support building some complicated examples, build them in CI [235] - o cmake: use modern alternatives for `get_filename_component()` [102] - o cmake: use more `COMPILER_OPTIONS`, `LINK_OPTIONS` / `LINK_FLAGS` [152] + o cmake: use modern alternatives for get_filename_component() [102] + o cmake: use more COMPILER_OPTIONS, LINK_OPTIONS / LINK_FLAGS [152] o cmdline-docs: extended, clarified, refreshed [28] o cmdline-opts/_PROGRESS.md: explain the suffixes [154] o configure: add "-mt" for pthread support on HP-UX [52] @@ -77,8 +78,9 @@ This release includes the following bugfixes: o connect: remove redundant condition in shutdown start [289] o cookie: avoid saving a cookie file if no transfer was done [11] o cpool: make bundle->dest an array; fix UB [218] + o curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY [320] o curl_easy_getinfo: error code on NULL arg [2] - o curl_mem_undef.h: limit to `CURLDEBUG` for non-memalloc overrides [19] + o curl_mem_undef.h: limit to CURLDEBUG for non-memalloc overrides [19] o curl_osslq: error out properly if BIO_ADDR_rawmake() fails [184] o Curl_resolv: fix comment. 'entry' argument is not optional [187] o curl_slist_append.md: clarify that a NULL pointer is not acceptable [72] @@ -90,7 +92,7 @@ This release includes the following bugfixes: o CURLOPT_SSL_VERIFYHOST.md: add see-also to two other VERIFYHOST options [32] o CURLOPT_TIMECONDITION.md: works for FILE and FTP as well [27] o digest_sspi: fix two memory leaks in error branches [77] - o dist: do not distribute `CI.md` [29] + o dist: do not distribute CI.md [29] o docs/cmdline-opts: drop double quotes from GLOBBING and URL examples [238] o docs/libcurl: clarify some timeout option behavior [15] o docs/libcurl: remove ancient version references [7] @@ -104,15 +106,17 @@ This release includes the following bugfixes: o examples/synctime: fix null termination assumptions [297] o examples/synctime: make the sscanf not overflow the local buffer [252] o examples/usercertinmem: avoid stripping const [247] - o examples: call `curl_global_cleanup()` where missing [323] + o examples/websocket: fix use of uninitialized rlen [346] + o examples: call curl_global_cleanup() where missing [323] o examples: check more errors, fix cleanups, scope variables [318] - o examples: drop unused `curl/mprintf.h` includes [224] + o examples: drop unused curl/mprintf.h includes [224] o examples: fix build issues in 'complicated' examples [243] o examples: fix two build issues surfaced with WinCE [223] o examples: fix two issues found by CodeQL [35] - o examples: fix two more cases of `stat()` TOCTOU [147] + o examples: fix two more cases of stat() TOCTOU [147] o examples: improve global init, error checks and returning errors [321] - o examples: return `curl_easy_perform()` results [322] + o examples: return curl_easy_perform() results [322] + o firefox-db2pem.sh: add macOS support, tidy-ups [348] o form.md: drop reference to MANUAL [178] o ftp: add extra buffer length check [195] o ftp: fix ftp_do_more returning with *completep unset [122] @@ -133,13 +137,16 @@ This release includes the following bugfixes: o http: look for trailing 'type=' in ftp:// without strstr [315] o http: make Content-Length parser more WHATWG [183] o httpsrr: free old pointers when storing new [57] + o imap: treat capabilities case insensitively [345] o INSTALL-CMAKE.md: document useful build targets [215] + o INSTALL: update the list of known operating systems [325] o INTERNALS: drop Winsock 2.2 from the dependency list [162] o ip-happy: do not set unnecessary timeout [95] o ip-happy: prevent event-based stall on retry [155] o kerberos: bump minimum to 1.3 (2003-07-08), drop legacy logic [279] o kerberos: drop logic for MIT Kerberos <1.2.3 (pre-2002) versions [285] - o kerberos: stop including `gssapi/gssapi_generic.h` [282] + o kerberos: stop including gssapi/gssapi_generic.h [282] + o krb5: fix output_token allocators in the GSS debug stub (Windows) [326] o krb5: return appropriate error on send failures [22] o krb5_gssapi: fix memory leak on error path [190] o krb5_sspi: the chlg argument is NOT optional [200] @@ -148,7 +155,7 @@ This release includes the following bugfixes: o ldap: tidy-up types, fix error code confusion [191] o lib1514: fix return code mixup [304] o lib: drop unused include and duplicate guards [226] - o lib: fix build error and compiler warnings with verbose strings disabled [173] + o lib: fix build error with verbose strings disabled [173] o lib: remove personal names from comments [168] o lib: SSL connection reuse [301] o lib: stop NULL-checking conn->passwd and ->user [309] @@ -183,13 +190,16 @@ This release includes the following bugfixes: o managen: render better manpage references/links [54] o managen: strict protocol check [109] o managen: verify the options used in example lines [181] + o mbedtls: add support for 4.0.0 [344] o mbedtls: check result of setting ALPN [127] o mbedtls: handle WANT_WRITE from mbedtls_ssl_read() [145] o mdlinkcheck: reject URLs containing quotes [174] o memdup0: handle edge case [241] + o mime: fix use of fseek() [334] o multi.h: add CURLMINFO_LASTENTRY [51] o multi_ev: remove unnecessary data check that confuses analysers [167] o nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header [227] + o ngtcp2: add a comment explaining write result handling [340] o ngtcp2: check error code on connect failure [13] o ngtcp2: close just-opened QUIC stream when submit_request fails [222] o ngtcp2: compare idle timeout in ms to avoid overflow [248] @@ -202,11 +212,14 @@ This release includes the following bugfixes: o openldap: check ldap_get_option() return codes [119] o openldap: fix memory-leak in error path [287] o openldap: fix memory-leak on oldap_do's exit path [286] + o openldap: limit max incoming size [347] o openssl-quic: check results better [132] o openssl-quic: handle error in SSL_get_stream_read_error_code [129] o openssl-quic: ignore unexpected streams opened by server [176] + o openssl: better return code checks when logging cert data [342] o openssl: call SSL_get_error() with proper error [207] o openssl: clear retry flag on x509 error [130] + o openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs [339] o openssl: fail the transfer if ossl_certchain() fails [23] o openssl: fix build for v1.0.2 [225] o openssl: fix peer certificate leak in channel binding [258] @@ -221,6 +234,7 @@ This release includes the following bugfixes: o pytest: skip specific tests for no-verbose builds [171] o quic: fix min TLS version handling [14] o quic: ignore EMSGSIZE on receive [4] + o quic: improve UDP GRO receives [330] o quic: remove data_idle handling [311] o quiche: fix possible leaks on teardown [205] o quiche: fix verbose message when ip quadruple cannot be obtained. [128] @@ -229,6 +243,8 @@ This release includes the following bugfixes: o runtests: tag tests that require curl verbose strings [172] o rustls: fix clang-tidy warning [107] o rustls: fix comment describing cr_recv() [117] + o rustls: limit snprintf proper in cr_keylog_log_cb() [343] + o rustls: make read_file_into not reject good files [328] o rustls: pass the correct result to rustls_failf [242] o rustls: typecast variable for safer trace output [69] o rustls: use %zu for size_t in failf() format string [121] @@ -236,8 +252,10 @@ This release includes the following bugfixes: o schannel: assign result before using it [62] o schannel_verify: fix mem-leak in Curl_verify_host [208] o schannel_verify: use more human friendly error messages [96] + o scripts: pass -- before passing xargs [349] o setopt: accept *_SSL_VERIFYHOST set to 2L [31] o setopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1 [257] + o setopt: fix unused variable warning in minimal build [332] o setopt: make CURLOPT_MAXREDIRS accept -1 (again) [1] o smb: adjust buffer size checks [45] o smb: transfer debugassert to real check [303] @@ -256,10 +274,11 @@ This release includes the following bugfixes: o socks_sspi: fix memory cleanup calls [40] o socks_sspi: remove the enforced mode clearing [291] o socks_sspi: restore non-blocking socket on error paths [48] + o socks_sspi: use the correct free function [331] o socksd: remove --bindonly mention, there is no such option [305] o ssl-sessions.md: mark option experimental [12] o strerror: drop workaround for SalfordC win32 header bug [214] - o sws: fix checking `sscanf()` return value [17] + o sws: fix checking sscanf() return value [17] o sws: pass in socket reference to allow function to close it [298] o tcp-nodelay.md: expand the documentation [153] o telnet: ignore empty suboptions [86] @@ -272,7 +291,7 @@ This release includes the following bugfixes: o telnet: send failure logged but not returned [175] o telnet: use pointer[0] for "unknown" option instead of pointer[i] [217] o tests/server: drop pointless memory allocation overrides [219] - o tests/server: drop unsafe `open()` override in signal handler (Windows) [151] + o tests/server: drop unsafe open() override in signal handler (Windows) [151] o tftp: check and act on tftp_set_timeouts() returning error [38] o tftp: check for trailing ";mode=" in URL without strstr [312] o tftp: default timeout per block is now 15 seconds [156] @@ -283,10 +302,10 @@ This release includes the following bugfixes: o tftp: return error if it hits an illegal state [138] o tftp: return error when sendto() fails [59] o thread: errno on thread creation [271] - o tidy-up: `fcntl.h` includes [98] + o tidy-up: fcntl.h includes [98] o tidy-up: assortment of small fixes [115] o tidy-up: avoid using the reserved macro namespace [76] - o tidy-up: update MS links, allow long URLs via `checksrc` [73] + o tidy-up: update MS links, allow long URLs via checksrc [73] o tidy-up: URLs [101] o time-cond.md: refer to the singular curl_getdate man page [148] o TODO: fix a typo [93] @@ -300,6 +319,7 @@ This release includes the following bugfixes: o tool_getparam: always disable "lib-ids" for tracing [169] o tool_getparam: make --fail and --fail-with-body override each other [293] o tool_getparam: warn if provided header looks malformed [179] + o tool_ipfs: simplify the ipfs gateway logic [337] o tool_msgs: make errorf() show if --show-error [294] o tool_operate: improve wording in retry message [37] o tool_operate: keep failed partial download for retry auto-resume [210] @@ -316,18 +336,20 @@ This release includes the following bugfixes: o urldata: make 'retrycount' a single byte [308] o urldata: make redirect counter 16 bit [295] o vauth/digest: improve the digest parser [203] + o version: add GSS backend name and version [353] o vquic: fix idle-timeout checks (ms<-->ns), 64-bit log & honor 0=no-timeout [249] o vquic: handling of io improvements [239] o vquic: sending non-gso packets fix for EAGAIN [265] o vtls: alpn setting, check proto parameter [134] o vtls_int.h: clarify data_pending [124] o vtls_scache: fix race condition [157] - o windows: replace `_beginthreadex()` with `CreateThread()` [80] + o windows: replace _beginthreadex() with CreateThread() [80] o windows: stop passing unused, optional argument for Win9x compatibility [75] o windows: use consistent format when showing error codes [199] o windows: use native error code types more [206] o wolfssl: check BIO read parameters [133] o wolfssl: fix error check in shutdown [105] + o wolfssl: fix resource leak in verify_pinned error paths [314] o wolfssl: no double get_error() detail [188] o ws: clarify an error message [125] o ws: fix some edge cases [274] @@ -357,8 +379,8 @@ This release would not have looked like this without help, code, reports and advice from friends like these: Adam Light, Alice Lee Poetics, Andrei Kurushin, Andrew Kirillov, - Andrew Olsen, BobodevMm on github, Christian Schmitz, Dan Fandrich, - Daniel Stenberg, Daniel Terhorst-North, dependabot[bot], + Andrew Olsen, BobodevMm on github, Christian Schmitz, curl.stunt430, + Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, dependabot[bot], divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, Howard Chu, Ignat Loskutov, Javier Blazquez, Jicea, jmaggard10 on github, @@ -368,7 +390,7 @@ advice from friends like these: plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, Stanislav Fort, Stefan Eissing, tkzv on github, Viktor Szakats - (47 contributors) + (48 contributors) References to bug reports and discussions on issues: @@ -685,11 +707,33 @@ References to bug reports and discussions on issues: [311] = https://curl.se/bug/?i=19060 [312] = https://curl.se/bug/?i=19070 [313] = https://curl.se/bug/?i=19069 + [314] = https://curl.se/bug/?i=19110 [315] = https://curl.se/bug/?i=19065 [316] = https://curl.se/bug/?i=19017 [317] = https://curl.se/bug/?i=16143 [318] = https://curl.se/bug/?i=19055 + [320] = https://curl.se/mail/lib-2025-10/0018.html [321] = https://curl.se/bug/?i=19053 [322] = https://curl.se/bug/?i=19052 [323] = https://curl.se/bug/?i=19051 [324] = https://curl.se/bug/?i=19048 + [325] = https://curl.se/bug/?i=19106 + [326] = https://curl.se/bug/?i=19064 + [328] = https://curl.se/bug/?i=19104 + [330] = https://curl.se/bug/?i=19101 + [331] = https://curl.se/bug/?i=19046 + [332] = https://curl.se/bug/?i=19102 + [334] = https://curl.se/bug/?i=19100 + [337] = https://curl.se/bug/?i=19097 + [339] = https://curl.se/bug/?i=19091 + [340] = https://curl.se/bug/?i=19093 + [342] = https://curl.se/bug/?i=19094 + [343] = https://curl.se/bug/?i=19095 + [344] = https://curl.se/bug/?i=19077 + [345] = https://curl.se/bug/?i=19089 + [346] = https://curl.se/bug/?i=19088 + [347] = https://issues.oss-fuzz.com/issues/432441303 + [348] = https://curl.se/bug/?i=19086 + [349] = https://curl.se/bug/?i=19076 + [353] = https://curl.se/bug/?i=19073 + [354] = https://curl.se/bug/?i=19078 From b9b8a7a5df552d4e5929d4d7e38490b9aef642a9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 00:01:26 +0200 Subject: [PATCH 026/885] openssl: fix resource leak in provider error path Pointed out by ZeroPath Closes #19111 --- lib/vtls/openssl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 43fa417a3554..2868ea85ec09 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1473,6 +1473,8 @@ static int providerload(struct Curl_easy *data, OSSL_STORE_CTX *store = OSSL_STORE_open_ex(cert_file, data->state.libctx, NULL, NULL, NULL, NULL, NULL, NULL); + int rc; + if(!store) { failf(data, "Failed to open OpenSSL store: %s", ossl_strerror(ERR_get_error(), error_buffer, @@ -1501,13 +1503,15 @@ static int providerload(struct Curl_easy *data, return 0; } - if(SSL_CTX_use_certificate(ctx, cert) != 1) { + rc = SSL_CTX_use_certificate(ctx, cert); + X509_free(cert); /* we do not need the handle any more... */ + + if(rc != 1) { failf(data, "unable to set client certificate [%s]", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); return 0; } - X509_free(cert); /* we do not need the handle any more... */ } else { failf(data, "crypto provider not set, cannot load certificate"); From f32451c12bb7fa4738d8c9cf6d7cd09ee876434b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 17 Oct 2025 18:31:52 +0200 Subject: [PATCH 027/885] curlx: promote `Curl_fseeko()` to `curlx_fseek()`, use it in `src` - tool_formparse: replace truncated `fseek` with `curlx_fseek`. - tool_operate: replace truncated `fseek` with `curlx_fseek`. - tool_paramhlp: replace local duplicate `myfseek`, with `curlx_fseek`. Follow-up to 4fb12f289189e8113967e9c9da09958fd8bfa4cb #19100 Closes #19107 --- lib/curlx/fopen.c | 16 +++++++++++++++- lib/curlx/fopen.h | 2 ++ lib/formdata.c | 3 ++- lib/mime.c | 15 +-------------- lib/mime.h | 1 - src/tool_formparse.c | 2 +- src/tool_operate.c | 6 ++---- src/tool_paramhlp.c | 15 +-------------- 8 files changed, 24 insertions(+), 36 deletions(-) diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index 22c7259c70dd..cc164c8c29b4 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -32,9 +32,23 @@ #include "../curl_setup.h" +#include "fopen.h" + +int curlx_fseek(void *stream, curl_off_t offset, int whence) +{ +#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) + return _fseeki64(stream, (__int64)offset, whence); +#elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) + return fseeko(stream, (off_t)offset, whence); +#else + if(offset > LONG_MAX) + return -1; + return fseek(stream, (long)offset, whence); +#endif +} + #if defined(_WIN32) && !defined(UNDER_CE) -#include "fopen.h" #include "multibyte.h" /* declare GetFullPathNameW for mingw-w64 UWP builds targeting old windows */ diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index b44cbbdfced2..51f4dbca173b 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -32,6 +32,8 @@ #include /* for open() and attributes */ #endif +int curlx_fseek(void *stream, curl_off_t offset, int whence); + #if defined(_WIN32) && !defined(UNDER_CE) FILE *curlx_win32_fopen(const char *filename, const char *mode); int curlx_win32_stat(const char *path, struct_stat *buffer); diff --git a/lib/formdata.c b/lib/formdata.c index 382fd221dce6..74a73028cd8c 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -37,6 +37,7 @@ struct Curl_easy; #include "sendf.h" #include "strdup.h" #include "rand.h" +#include "curlx/fopen.h" #include "curlx/warnless.h" /* The last 2 #include files should be in this order */ @@ -860,7 +861,7 @@ CURLcode Curl_getformdata(CURL *data, #endif result = curl_mime_data_cb(part, (curl_off_t) -1, (curl_read_callback) fread, - Curl_fseeko, + curlx_fseek, NULL, (void *) stdin); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop diff --git a/lib/mime.c b/lib/mime.c index baca30049f73..0a56b07bc51b 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -271,19 +271,6 @@ static char *Curl_basename(char *path) #define basename(x) Curl_basename((x)) #endif -int Curl_fseeko(void *stream, curl_off_t offset, int whence) -{ -#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) - return _fseeki64(stream, (__int64)offset, whence); -#elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) - return fseeko(stream, (off_t)offset, whence); -#else - if(offset > LONG_MAX) - return -1; - return fseek(stream, (long)offset, whence); -#endif -} - /* Set readback state. */ static void mimesetstate(struct mime_state *state, @@ -750,7 +737,7 @@ static int mime_file_seek(void *instream, curl_off_t offset, int whence) if(mime_open_file(part)) return CURL_SEEKFUNC_FAIL; - return Curl_fseeko(part->fp, offset, whence) ? + return curlx_fseek(part->fp, offset, whence) ? CURL_SEEKFUNC_CANTSEEK : CURL_SEEKFUNC_OK; } diff --git a/lib/mime.h b/lib/mime.h index dc6f0d4af176..5073a38f709a 100644 --- a/lib/mime.h +++ b/lib/mime.h @@ -138,7 +138,6 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) !defined(CURL_DISABLE_IMAP)) /* Prototypes. */ -int Curl_fseeko(void *stream, curl_off_t offset, int whence); void Curl_mime_initpart(struct curl_mimepart *part); void Curl_mime_cleanpart(struct curl_mimepart *part); CURLcode Curl_mime_duppart(struct Curl_easy *data, diff --git a/src/tool_formparse.c b/src/tool_formparse.c index cd3cf52e3ebd..0f0962ce0d1f 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -248,7 +248,7 @@ int tool_mime_stdin_seek(void *instream, curl_off_t offset, int whence) if(offset < 0) return CURL_SEEKFUNC_CANTSEEK; if(!sip->data) { - if(fseek(stdin, (long) (offset + sip->origin), SEEK_SET)) + if(curlx_fseek(stdin, offset + sip->origin, SEEK_SET)) return CURL_SEEKFUNC_CANTSEEK; } sip->curpos = offset; diff --git a/src/tool_operate.c b/src/tool_operate.c index c7d01bb59af2..00a98b360ba0 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -584,10 +584,8 @@ static CURLcode retrycheck(struct OperationConfig *config, rc = fseek(outs->stream, 0, SEEK_END); #else /* ftruncate is not available, so just reposition the file - to the location we would have truncated it. This will not - work properly with large files on 32-bit systems, but - most of those will have ftruncate. */ - rc = fseek(outs->stream, (long)outs->init, SEEK_SET); + to the location we would have truncated it. */ + rc = curlx_fseek(outs->stream, outs->init, SEEK_SET); #endif if(rc) { errorf("Failed seeking to end of file"); diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index 85c24f2ea355..fda05398783e 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -119,19 +119,6 @@ ParameterError file2string(char **bufp, FILE *file) return PARAM_OK; } -static int myfseek(void *stream, curl_off_t offset, int whence) -{ -#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) - return _fseeki64(stream, (__int64)offset, whence); -#elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) - return fseeko(stream, (off_t)offset, whence); -#else - if(offset > LONG_MAX) - return -1; - return fseek(stream, (long)offset, whence); -#endif -} - ParameterError file2memory_range(char **bufp, size_t *size, FILE *file, curl_off_t starto, curl_off_t endo) { @@ -143,7 +130,7 @@ ParameterError file2memory_range(char **bufp, size_t *size, FILE *file, if(starto) { if(file != stdin) { - if(myfseek(file, starto, SEEK_SET)) + if(curlx_fseek(file, starto, SEEK_SET)) return PARAM_READ_ERROR; offset = starto; } From f847d2ed0244319ee6b5e9b054c39077e62388ad Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 11:58:36 +0200 Subject: [PATCH 028/885] tool_formparse: rewrite the headers file parser The -F option allows users to provide a file with a set of headers for a specific formpost section. This code used old handcrafted parsing logic that potentially could do wrong. Rewrite to use my_get_line() and dynbuf. Supports longer lines and should be more solid parsing code. Gets somewhat complicated by the (unwise) feature that allows "folding" of header lines in the file: if a line starts with a space it should be appended to the previous. The previous code trimmed spurious CR characters wherever they would occur in a line but this version does not. It does not seem like something we want or that users would expect. Test 646 uses this feature. Closes #19113 --- src/tool_formparse.c | 107 +++++++++++++++++++++---------------------- tests/data/test646 | 2 +- 2 files changed, 54 insertions(+), 55 deletions(-) diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 0f0962ce0d1f..004ad6ff4c70 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -28,6 +28,7 @@ #include "tool_getparam.h" #include "tool_paramhlp.h" #include "tool_formparse.h" +#include "tool_parsecfg.h" #include "memdebug.h" /* keep this as LAST include */ @@ -417,65 +418,63 @@ static int slist_append(struct curl_slist **plist, const char *data) } /* Read headers from a file and append to list. */ -static int read_field_headers(const char *filename, FILE *fp, - struct curl_slist **pheaders) +static int read_field_headers(FILE *fp, struct curl_slist **pheaders) { - size_t hdrlen = 0; - size_t pos = 0; - bool incomment = FALSE; - int lineno = 1; - char hdrbuf[999] = ""; /* Max. header length + 1. */ - - for(;;) { - int c = getc(fp); - if(c == EOF || (!pos && !ISSPACE(c))) { - /* Strip and flush the current header. */ - while(hdrlen && ISSPACE(hdrbuf[hdrlen - 1])) - hdrlen--; - if(hdrlen) { - hdrbuf[hdrlen] = '\0'; - if(slist_append(pheaders, hdrbuf)) { - errorf("Out of memory for field headers"); - return -1; - } - hdrlen = 0; - } - } - - switch(c) { - case EOF: - if(ferror(fp)) { - char errbuf[STRERROR_LEN]; - errorf("Header file %s read error: %s", filename, - curlx_strerror(errno, errbuf, sizeof(errbuf))); - return -1; - } - return 0; /* Done. */ - case '\r': - continue; /* Ignore. */ - case '\n': - pos = 0; - incomment = FALSE; - lineno++; + struct dynbuf line; + bool error = FALSE; + int err = 0; + + curlx_dyn_init(&line, 8092); + while(my_get_line(fp, &line, &error)) { + const char *ptr = curlx_dyn_ptr(&line); + size_t len = curlx_dyn_len(&line); + bool folded = FALSE; + if(ptr[0] == '#') /* comment */ continue; - case '#': - if(!pos) - incomment = TRUE; - break; - } + else if(ptr[0] == ' ') /* a continuation from the line before */ + folded = TRUE; + /* trim off trailing CRLFs and whitespaces */ + while(len && (ISNEWLINE(ptr[len -1]) || ISBLANK(ptr[len - 1]))) + len--; - pos++; - if(!incomment) { - if(hdrlen == sizeof(hdrbuf) - 1) { - warnf("File %s line %d: header too long (truncated)", - filename, lineno); - c = ' '; + if(!len) + continue; + curlx_dyn_setlen(&line, len); /* set the new length */ + + if(folded && *pheaders) { + /* append this new line onto the previous line */ + struct dynbuf amend; + struct curl_slist *l = *pheaders; + curlx_dyn_init(&amend, 8092); + /* find the last node */ + while(l && l->next) + l = l->next; + /* add both parts */ + if(curlx_dyn_add(&amend, l->data) || curlx_dyn_addn(&amend, ptr, len)) { + err = -1; + break; } - if(hdrlen <= sizeof(hdrbuf) - 1) - hdrbuf[hdrlen++] = (char) c; + curl_free(l->data); + /* we use maprintf here to make it a libcurl alloc, to match the previous + curl_slist_append */ + l->data = curl_maprintf("%s", curlx_dyn_ptr(&amend)); + curlx_dyn_free(&amend); + if(!l->data) { + errorf("Out of memory for field headers"); + err = 1; + } + } + else { + err = slist_append(pheaders, ptr); + } + if(err) { + errorf("Out of memory for field headers"); + err = -1; + break; } } - /* NOTREACHED */ + curlx_dyn_free(&line); + return err; } static int get_param_part(char endchar, @@ -572,7 +571,7 @@ static int get_param_part(char endchar, curlx_strerror(errno, errbuf, sizeof(errbuf))); } else { - int i = read_field_headers(hdrfile, fp, &headers); + int i = read_field_headers(fp, &headers); curlx_fclose(fp); if(i) { diff --git a/tests/data/test646 b/tests/data/test646 index 4f26dbdf9291..fe86e32775b5 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -42,7 +42,7 @@ It may contain any type of data. X-fileheader1: This is a header from a file # This line is another comment. It precedes a folded header. -X-fileheader2: This is #a +X-fileheader2: This is #a folded header From 8de898414c422ed56980dd4ac3a0125bc6fec5c5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 12:11:09 +0200 Subject: [PATCH 029/885] openssl: free UI_METHOD on exit path In providercheck(), when failing to open the "store", the exit path would not previously free the created UI_METHOD and instead leak this resource. Pointed out by ZeroPath Closes #19114 --- lib/vtls/openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 2868ea85ec09..66c0fbfabdaa 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1328,6 +1328,7 @@ static int providercheck(struct Curl_easy *data, failf(data, "Failed to open OpenSSL store: %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); + UI_destroy_method(ui_method); return 0; } if(OSSL_STORE_expect(store, OSSL_STORE_INFO_PKEY) != 1) { From f30f1307c1d9d70a96557359f039ba7ef9b077fb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 18 Oct 2025 13:08:53 +0200 Subject: [PATCH 030/885] cmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`) - do not pre-fill `HAVE_LINUX_TCP_H` on Linux. `linux/tcp.h` is a Linux kernel userspace header. It's likely installed when using glibc and likely missing by default when using something else, e.g. MUSL (e.g. on Alpine). Therefore always detect it for Linux targets, and only pre-fill it for non-Linux ones. - do not pre-fill `HAVE_GLIBC_STRERROR_R` on Linux. To fix it for non-glibc envs, e.g. MUSL (e.g. on Alpine). Note, the pre-fill option is a disabled by default, internal option and strongly not recommended outside of curl development. Closes #19116 --- CMake/unix-cache.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMake/unix-cache.cmake b/CMake/unix-cache.cmake index 2c85626a4957..a0369e84e52f 100644 --- a/CMake/unix-cache.cmake +++ b/CMake/unix-cache.cmake @@ -142,7 +142,7 @@ set(HAVE_GETRLIMIT 1) set(HAVE_GETSOCKNAME 1) set(HAVE_GETTIMEOFDAY 1) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(HAVE_GLIBC_STRERROR_R 1) + # Depends on C library. else() set(HAVE_GLIBC_STRERROR_R 0) endif() @@ -164,7 +164,7 @@ else() endif() set(HAVE_LIBGEN_H 1) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(HAVE_LINUX_TCP_H 1) + # Requires Linux kernel userspace headers. Expected with glibc. May be missing by default with MUSL. else() set(HAVE_LINUX_TCP_H 0) endif() From a000444cb0917b490a7a1635e51be3ac5bf61b3e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 18 Oct 2025 14:25:08 +0200 Subject: [PATCH 031/885] cmake: fix Linux pre-fill `HAVE_POSIX_STRERROR_R` (when `_CURL_PREFILL=ON`) It depends on C library. Follow-up to f30f1307c1d9d70a96557359f039ba7ef9b077fb #19116 --- CMake/unix-cache.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/unix-cache.cmake b/CMake/unix-cache.cmake index a0369e84e52f..556e871a03cc 100644 --- a/CMake/unix-cache.cmake +++ b/CMake/unix-cache.cmake @@ -204,7 +204,7 @@ endif() set(HAVE_POLL 1) set(HAVE_POLL_H 1) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(HAVE_POSIX_STRERROR_R 0) + # Depends on C library. else() set(HAVE_POSIX_STRERROR_R 1) endif() From bff9679a016d18d6b87e773d8a45ac4a2f3be7aa Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sun, 19 Oct 2025 02:37:18 +0800 Subject: [PATCH 032/885] schannel_verify: do not call infof with an appended \n Discovered by ZeroPath Closes #19123 --- lib/vtls/schannel_verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index d72790e9df57..a5084944846f 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -576,7 +576,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, conn_hostname, strlen(conn_hostname))) { infof(data, "schannel: connection hostname (%s) validated " - "against certificate name (%s)\n", + "against certificate name (%s)", conn_hostname, cert_hostname); result = CURLE_OK; } From 9021e42c0274853d8166d7ec616212f148a8dc07 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sun, 19 Oct 2025 02:00:52 +0800 Subject: [PATCH 033/885] ldap: do not pass a \n to failf() Discovered by ZeroPath Closes #19122 --- lib/ldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldap.c b/lib/ldap.c index 0b475d07bbc4..322c870bc248 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -461,7 +461,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) /* we should probably never come up to here since configure should check in first place if we can support LDAP SSL/TLS */ failf(data, "LDAP local: SSL/TLS not supported with this version " - "of the OpenLDAP toolkit\n"); + "of the OpenLDAP toolkit"); result = CURLE_SSL_CERTPROBLEM; goto quit; #endif /* LDAP_OPT_X_TLS */ From c567b37548066b664ac06ad155a819b53b27ad1c Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sun, 19 Oct 2025 00:42:52 +0800 Subject: [PATCH 034/885] src/var: remove dead code Discovered by ZeroPath Closes #19119 --- src/var.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/var.c b/src/var.c index 79c8307248f1..87f33af28226 100644 --- a/src/var.c +++ b/src/var.c @@ -446,11 +446,8 @@ ParameterError setvariable(const char *input) /* read from file or stdin */ FILE *file; bool use_stdin; - struct dynbuf fname; line++; - curlx_dyn_init(&fname, MAX_FILENAME); - use_stdin = !strcmp(line, "-"); if(use_stdin) file = stdin; @@ -469,7 +466,6 @@ ParameterError setvariable(const char *input) if(clen) contalloc = TRUE; } - curlx_dyn_free(&fname); if(!use_stdin && file) curlx_fclose(file); if(err) From 023e453032a3b0d12c81b030f7935ac92e554011 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sun, 19 Oct 2025 00:47:11 +0800 Subject: [PATCH 035/885] openldap: do not pass newline to infof() Discovered by ZeroPath Closes #19120 --- lib/openldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openldap.c b/lib/openldap.c index 1b26b6e1b4d9..d7eefaa67795 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -746,7 +746,7 @@ static CURLcode oldap_state_mechs_resp(struct Curl_easy *data, case LDAP_RES_SEARCH_RESULT: switch(code) { case LDAP_SIZELIMIT_EXCEEDED: - infof(data, "Too many authentication mechanisms\n"); + infof(data, "Too many authentication mechanisms"); FALLTHROUGH(); case LDAP_SUCCESS: case LDAP_NO_RESULTS_RETURNED: From ea1eaa6f7c2c88f8c74ca9b454a8b7e7be1d7171 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 13:09:50 +0200 Subject: [PATCH 036/885] tool_paramhlp: remove outdated comment in str2tls_max() The function does not take positive number as input. It takes TLS version strings. Pointed out by ZeroPath Closes #19115 --- src/tool_paramhlp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index fda05398783e..9f54704ea2ed 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -715,7 +715,7 @@ CURLcode get_args(struct OperationConfig *config, const size_t i) /* * Parse the string and modify ssl_version in the val argument. Return PARAM_OK - * on success, otherwise a parameter error enum. ONLY ACCEPTS POSITIVE NUMBERS! + * on success, otherwise a parameter error enum. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str From 0217aca9f3d5e63edf63613e8ac3b5738147dc53 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 22:33:46 +0200 Subject: [PATCH 037/885] lib: remove newlines from failf() calls Closes #19124 --- lib/vauth/gsasl.c | 8 ++++---- lib/vquic/curl_ngtcp2.c | 2 +- lib/vquic/curl_osslq.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/vauth/gsasl.c b/lib/vauth/gsasl.c index 8fbb62af80d6..119c392cda13 100644 --- a/lib/vauth/gsasl.c +++ b/lib/vauth/gsasl.c @@ -48,7 +48,7 @@ bool Curl_auth_gsasl_is_supported(struct Curl_easy *data, res = gsasl_init(&gsasl->ctx); if(res != GSASL_OK) { - failf(data, "gsasl init: %s\n", gsasl_strerror(res)); + failf(data, "gsasl init: %s", gsasl_strerror(res)); return FALSE; } @@ -73,7 +73,7 @@ CURLcode Curl_auth_gsasl_start(struct Curl_easy *data, gsasl_property_set(gsasl->client, GSASL_AUTHID, userp); #if GSASL_VERSION_NUMBER >= 0x010b00 if(res != GSASL_OK) { - failf(data, "setting AUTHID failed: %s\n", gsasl_strerror(res)); + failf(data, "setting AUTHID failed: %s", gsasl_strerror(res)); return CURLE_OUT_OF_MEMORY; } #endif @@ -84,7 +84,7 @@ CURLcode Curl_auth_gsasl_start(struct Curl_easy *data, gsasl_property_set(gsasl->client, GSASL_PASSWORD, passwdp); #if GSASL_VERSION_NUMBER >= 0x010b00 if(res != GSASL_OK) { - failf(data, "setting PASSWORD failed: %s\n", gsasl_strerror(res)); + failf(data, "setting PASSWORD failed: %s", gsasl_strerror(res)); return CURLE_OUT_OF_MEMORY; } #endif @@ -107,7 +107,7 @@ CURLcode Curl_auth_gsasl_token(struct Curl_easy *data, (const char *) Curl_bufref_ptr(chlg), Curl_bufref_len(chlg), &response, &outlen); if(res != GSASL_OK && res != GSASL_NEEDS_MORE) { - failf(data, "GSASL step: %s\n", gsasl_strerror(res)); + failf(data, "GSASL step: %s", gsasl_strerror(res)); return CURLE_BAD_CONTENT_ENCODING; } diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index b395cd082744..421611520ad8 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1888,7 +1888,7 @@ static CURLcode read_pkt_to_send(void *userp, /* we add the amount of data bytes to the flow windows */ int rv = nghttp3_conn_add_write_offset(ctx->h3conn, stream_id, ndatalen); if(rv) { - failf(x->data, "nghttp3_conn_add_write_offset returned error: %s\n", + failf(x->data, "nghttp3_conn_add_write_offset returned error: %s", nghttp3_strerror(rv)); return CURLE_SEND_ERROR; } diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index a49074346270..84b89e93aff7 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1661,14 +1661,14 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, ctx->q.last_io = curlx_now(); rv = nghttp3_conn_add_write_offset(ctx->h3.conn, s->id, acked_len); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { - failf(data, "nghttp3_conn_add_write_offset returned error: %s\n", + failf(data, "nghttp3_conn_add_write_offset returned error: %s", nghttp3_strerror(rv)); result = CURLE_SEND_ERROR; goto out; } rv = nghttp3_conn_add_ack_offset(ctx->h3.conn, s->id, acked_len); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { - failf(data, "nghttp3_conn_add_ack_offset returned error: %s\n", + failf(data, "nghttp3_conn_add_ack_offset returned error: %s", nghttp3_strerror(rv)); result = CURLE_SEND_ERROR; goto out; From e4ec666a3d742202c06e76a97934f97f2bc7588c Mon Sep 17 00:00:00 2001 From: JimFuller-RedHat Date: Sat, 18 Oct 2025 11:21:15 +0200 Subject: [PATCH 038/885] examples/chkspeed: portable printing when outputting curl_off_t values Closes #19112 --- docs/examples/chkspeed.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index 996db393f584..efa2b0d5ea35 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -184,20 +184,22 @@ int main(int argc, char *argv[]) /* check for bytes downloaded */ res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD_T, &val); if((CURLE_OK == res) && (val > 0)) - printf("Data downloaded: %lu bytes.\n", (unsigned long)val); + printf("Data downloaded: %" CURL_FORMAT_CURL_OFF_T " bytes.\n", val); /* check for total download time */ res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME_T, &val); if((CURLE_OK == res) && (val > 0)) - printf("Total download time: %lu.%06lu sec.\n", - (unsigned long)(val / 1000000), - (unsigned long)(val % 1000000)); + printf("Total download time: %" CURL_FORMAT_CURL_OFF_T + ".%06" CURL_FORMAT_CURL_OFF_T " sec.\n", + val / 1000000, + val % 1000000); /* check for average download speed */ res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD_T, &val); if((CURLE_OK == res) && (val > 0)) - printf("Average download speed: %lu kbyte/sec.\n", - (unsigned long)(val / 1024)); + printf("Average download speed: %" + CURL_FORMAT_CURL_OFF_T " kbyte/sec.\n", + val / 1024); if(prtall) { /* check for name resolution time */ From e779650a86c74166954eac22ad995bbad8fd7dc6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 19 Oct 2025 01:24:49 +0200 Subject: [PATCH 039/885] GHA/curl-for-win: update container image envs Follow-up to https://github.com/curl/curl-for-win/commit/1f31ff06ad389f48059641ffb995af8261ba0233 Closes #19129 --- .github/workflows/curl-for-win.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/curl-for-win.yml b/.github/workflows/curl-for-win.yml index a029ba834411..08738857872a 100644 --- a/.github/workflows/curl-for-win.yml +++ b/.github/workflows/curl-for-win.yml @@ -63,12 +63,12 @@ jobs: export CW_GCCSUFFIX='-12' sudo podman image trust set --type reject default sudo podman image trust set --type accept docker.io/library - time podman pull "${DOCKER_IMAGE_STABLE}" + time podman pull "${OCI_IMAGE_DEBIAN_STABLE}" podman images --digests time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ --env-file <(env | grep -a -E \ '^(CW_|GITHUB_)') \ - "${DOCKER_IMAGE_STABLE}" \ + "${OCI_IMAGE_DEBIAN_STABLE}" \ sh -c ./_ci-linux-debian.sh linux-glibc-gcc-minimal: # use gcc to minimize installed packages @@ -90,12 +90,12 @@ jobs: . ./_versions.sh sudo podman image trust set --type reject default sudo podman image trust set --type accept docker.io/library - time podman pull "${DOCKER_IMAGE}" + time podman pull "${OCI_IMAGE_DEBIAN}" podman images --digests time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ --env-file <(env | grep -a -E \ '^(CW_|GITHUB_)') \ - "${DOCKER_IMAGE}" \ + "${OCI_IMAGE_DEBIAN}" \ sh -c ./_ci-linux-debian.sh linux-musl-llvm: @@ -117,12 +117,12 @@ jobs: . ./_versions.sh sudo podman image trust set --type reject default sudo podman image trust set --type accept docker.io/library - time podman pull "${DOCKER_IMAGE}" + time podman pull "${OCI_IMAGE_DEBIAN}" podman images --digests time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ --env-file <(env | grep -a -E \ '^(CW_|GITHUB_)') \ - "${DOCKER_IMAGE}" \ + "${OCI_IMAGE_DEBIAN}" \ sh -c ./_ci-linux-debian.sh mac-clang: @@ -164,12 +164,12 @@ jobs: . ./_versions.sh sudo podman image trust set --type reject default sudo podman image trust set --type accept docker.io/library - time podman pull "${DOCKER_IMAGE}" + time podman pull "${OCI_IMAGE_DEBIAN}" podman images --digests time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ --env-file <(env | grep -a -E \ '^(CW_|GITHUB_)') \ - "${DOCKER_IMAGE}" \ + "${OCI_IMAGE_DEBIAN}" \ sh -c ./_ci-linux-debian.sh win-gcc-libssh-zlibold-x64: @@ -191,10 +191,10 @@ jobs: . ./_versions.sh sudo podman image trust set --type reject default sudo podman image trust set --type accept docker.io/library - time podman pull "${DOCKER_IMAGE}" + time podman pull "${OCI_IMAGE_DEBIAN}" podman images --digests time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ --env-file <(env | grep -a -E \ '^(CW_|GITHUB_)') \ - "${DOCKER_IMAGE}" \ + "${OCI_IMAGE_DEBIAN}" \ sh -c ./_ci-linux-debian.sh From 66e3ff5d0e3aa9ded372f540a5f5bfd83238a958 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sun, 19 Oct 2025 00:25:45 +0800 Subject: [PATCH 040/885] schannel: fix memory leak - Do not leak memory on failed setting algorithm cipher list. Discovered by ZeroPath. - Do not free backend->cred after failed AcquireCredentialsHandle. backend->cred is always freed later, during cleanup. Closes https://github.com/curl/curl/pull/19118 --- lib/vtls/schannel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index ae5834d84342..9b2b1e702e81 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -818,6 +818,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, result = set_ssl_ciphers(&schannel_cred, ciphers, algIds); if(result) { failf(data, "schannel: Failed setting algorithm cipher list"); + if(client_certs[0]) + CertFreeCertificateContext(client_certs[0]); return result; } } @@ -845,7 +847,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, char buffer[STRERROR_LEN]; failf(data, "schannel: AcquireCredentialsHandle failed: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); - Curl_safefree(backend->cred); switch(sspi_status) { case SEC_E_INSUFFICIENT_MEMORY: return CURLE_OUT_OF_MEMORY; From e0798466a819245549a2041f4230a1dbd12a079d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 19 Oct 2025 13:44:37 +0900 Subject: [PATCH 041/885] ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available Adopt ngtcp2_conn_get_stream_user_data which has been available since ngtcp2 v1.17.0. This improves the time complexity of searching h3_stream_ctx from O(n) to O(1) where n is the number of stream. Closes #19132 --- lib/vquic/curl_ngtcp2.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 421611520ad8..9478b8d0f38d 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -300,6 +300,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, return CURLE_OK; } +#if NGTCP2_VERSION_NUM < 0x011100 struct cf_ngtcp2_sfind_ctx { curl_int64_t stream_id; struct h3_stream_ctx *stream; @@ -328,6 +329,20 @@ cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, curl_int64_t stream_id) Curl_uint_hash_visit(&ctx->streams, cf_ngtcp2_sfind, &fctx); return fctx.stream; } +#else +static struct h3_stream_ctx *cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, + curl_int64_t stream_id) +{ + struct Curl_easy *data = + ngtcp2_conn_get_stream_user_data(ctx->qconn, stream_id); + + if(!data) { + return NULL; + } + + return H3_STREAM_CTX(ctx, data); +} +#endif static void cf_ngtcp2_stream_close(struct Curl_cfilter *cf, struct Curl_easy *data, From 6550dd0f3d98ff27db9001090d72ee84558d3e4a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 23:41:26 +0200 Subject: [PATCH 042/885] wolfssl: clear variable to avoid uninitialized use Pointed out by ZeroPath Closes #19126 --- lib/vtls/wolfssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index d2bb3eb49e81..fe63097f9c3a 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -357,7 +357,7 @@ static int wssl_bio_cf_in_read(WOLFSSL_BIO *bio, char *buf, int blen) struct ssl_connect_data *connssl = cf->ctx; struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); - size_t nread; + size_t nread = 0; CURLcode result = CURLE_OK; DEBUGASSERT(data); From f03e7c1d645823db285e483ba2e3dde633d38dde Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Sun, 19 Oct 2025 09:40:35 +0200 Subject: [PATCH 043/885] openldap: fix limit max incoming size test logic Use LDAP_OPT_SUCCESS for ldap_get_option, as done in the other calls. ber_sockbuf_ctrl returns 1 on success so reverse the logic. Follow-up to f91be14bfb Closes #19138 --- lib/openldap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/openldap.c b/lib/openldap.c index d7eefaa67795..dbf2f5f4f368 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -662,11 +662,11 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done) { ber_len_t max = 256*1024; Sockbuf *sb; - if(ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, (void **)&sb) || + if((ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb) != LDAP_OPT_SUCCESS) || /* Set the maximum allowed size of an incoming message, which to OpenLDAP means that it will malloc() memory up to this size. If not set, there is no limit and we instead risk a malloc() failure. */ - ber_sockbuf_ctrl(sb, LBER_SB_OPT_SET_MAX_INCOMING, &max)) { + !ber_sockbuf_ctrl(sb, LBER_SB_OPT_SET_MAX_INCOMING, &max)) { result = CURLE_FAILED_INIT; goto out; } From 8d302ec93647ec7a57fdf8a6a1d2f7ac2af07fac Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 12:17:45 +0200 Subject: [PATCH 044/885] socks: avoid UAF risk in error path The code obtained a pointer resp via Curl_bufq_peek(), but called Curl_bufq_skip() before it would access them in the failf() call. The Curl_bufq_skip() call can trigger prune_head which may free or recycle the chunk that resp points into. Pointed out by ZeroPath Closes #19139 --- lib/socks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/socks.c b/lib/socks.c index 10fca7b44c99..d146b12abc72 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -765,13 +765,12 @@ static CURLproxycode socks5_check_auth_resp(struct socks_state *sx, /* ignore the first (VER) byte */ auth_status = resp[1]; - Curl_bufq_skip(&sx->iobuf, 2); - if(auth_status) { failf(data, "User was rejected by the SOCKS5 server (%d %d).", resp[0], resp[1]); return CURLPX_USER_REJECTED; } + Curl_bufq_skip(&sx->iobuf, 2); return CURLPX_OK; } From f6334f379d7f8885ae0d212b4d0168388b314037 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 19 Oct 2025 10:53:16 +0200 Subject: [PATCH 045/885] examples: replace casts with `curl_off_t` printf masks Follow-up to e4ec666a3d742202c06e76a97934f97f2bc7588c #19112 Closes #19133 --- docs/examples/chkspeed.c | 18 ++++++++++-------- docs/examples/fileupload.c | 10 ++++++---- docs/examples/ftpupload.c | 2 +- docs/examples/progressfunc.c | 17 +++++++++++------ docs/examples/sftpuploadresume.c | 2 +- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index efa2b0d5ea35..6cb1304c8703 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -197,24 +197,26 @@ int main(int argc, char *argv[]) /* check for average download speed */ res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD_T, &val); if((CURLE_OK == res) && (val > 0)) - printf("Average download speed: %" - CURL_FORMAT_CURL_OFF_T " kbyte/sec.\n", + printf("Average download speed: " + "%" CURL_FORMAT_CURL_OFF_T " kbyte/sec.\n", val / 1024); if(prtall) { /* check for name resolution time */ res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME_T, &val); if((CURLE_OK == res) && (val > 0)) - printf("Name lookup time: %lu.%06lu sec.\n", - (unsigned long)(val / 1000000), - (unsigned long)(val % 1000000)); + printf("Name lookup time: %" CURL_FORMAT_CURL_OFF_T + ".%06" CURL_FORMAT_CURL_OFF_T " sec.\n", + val / 1000000, + val % 1000000); /* check for connect time */ res = curl_easy_getinfo(curl_handle, CURLINFO_CONNECT_TIME_T, &val); if((CURLE_OK == res) && (val > 0)) - printf("Connect time: %lu.%06lu sec.\n", - (unsigned long)(val / 1000000), - (unsigned long)(val % 1000000)); + printf("Connect time: %" CURL_FORMAT_CURL_OFF_T + ".%06" CURL_FORMAT_CURL_OFF_T " sec.\n", + val / 1000000, + val % 1000000); } } else { diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index f827c68390a7..03dd323bda6b 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -98,10 +98,12 @@ int main(void) curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed_upload); curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &total_time); - fprintf(stderr, "Speed: %lu bytes/sec during %lu.%06lu seconds\n", - (unsigned long)speed_upload, - (unsigned long)(total_time / 1000000), - (unsigned long)(total_time % 1000000)); + fprintf(stderr, "Speed: %" CURL_FORMAT_CURL_OFF_T " bytes/sec during " + "%" CURL_FORMAT_CURL_OFF_T + ".%06" CURL_FORMAT_CURL_OFF_T " seconds\n", + speed_upload, + total_time / 1000000, + total_time % 1000000); } /* always cleanup */ curl_easy_cleanup(curl); diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 2bfb51f66e7c..db3fbfde505e 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -106,7 +106,7 @@ int main(void) } fsize = file_info.st_size; - printf("Local file size: %lu bytes.\n", (unsigned long)fsize); + printf("Local file size: %" CURL_FORMAT_CURL_OFF_T " bytes.\n", fsize); /* In Windows, this inits the Winsock stuff */ res = curl_global_init(CURL_GLOBAL_ALL); diff --git a/docs/examples/progressfunc.c b/docs/examples/progressfunc.c index 35adc6c82d56..052620dcdf67 100644 --- a/docs/examples/progressfunc.c +++ b/docs/examples/progressfunc.c @@ -53,14 +53,19 @@ static int xferinfo(void *p, be used */ if((curtime - myp->lastruntime) >= MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL) { myp->lastruntime = curtime; - fprintf(stderr, "TOTAL TIME: %lu.%06lu\r\n", - (unsigned long)(curtime / 1000000), - (unsigned long)(curtime % 1000000)); + fprintf(stderr, "TOTAL TIME: %" CURL_FORMAT_CURL_OFF_T + ".%06" CURL_FORMAT_CURL_OFF_T "\r\n", + curtime / 1000000, + curtime % 1000000); } - fprintf(stderr, "UP: %lu of %lu DOWN: %lu of %lu\r\n", - (unsigned long)ulnow, (unsigned long)ultotal, - (unsigned long)dlnow, (unsigned long)dltotal); + fprintf(stderr, + "UP: " + "%" CURL_FORMAT_CURL_OFF_T " of %" CURL_FORMAT_CURL_OFF_T " " + "DOWN: " + "%" CURL_FORMAT_CURL_OFF_T " of %" CURL_FORMAT_CURL_OFF_T "\r\n", + ulnow, ultotal, + dlnow, dltotal); if(dlnow > STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES) return 1; diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index 8745abe78b8f..d9cff10567df 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -68,7 +68,7 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) &remoteFileSizeByte); if(result) return -1; - printf("filesize: %lu\n", (unsigned long)remoteFileSizeByte); + printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); } curl_easy_cleanup(curlHandlePtr); From fffc16dd9c4ad063ecee2ac073266120b203e136 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 11:28:15 +0200 Subject: [PATCH 046/885] smtp: return value ignored Return value from Curl_client_write was overwritten by smtp_perform_command making errors ignored. Pointed out by ZeroPath Closes #19136 --- lib/smtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smtp.c b/lib/smtp.c index 76ed4f280afd..30f85357657e 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1136,7 +1136,7 @@ static CURLcode smtp_state_command_resp(struct Curl_easy *data, if(!data->req.no_body) result = Curl_client_write(data, CLIENTWRITE_BODY, line, len); - if(smtpcode != 1) { + if(!result && (smtpcode != 1)) { if(smtp->rcpt) { smtp->rcpt = smtp->rcpt->next; From 026498df4349f779d70241fe628e64af3959d98c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 13 Oct 2025 22:46:49 +0200 Subject: [PATCH 047/885] mod_curltest: tidy-ups and small fixes - honor request id (`id=`) in `curltest/put` and `curltest/sslinfo` handlers. - do not truncate `max_upload` input parameter. - delete unused variables. - formatting. Inspired by Joshua's report on tests. Closes #19061 --- .../http/testenv/mod_curltest/mod_curltest.c | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/http/testenv/mod_curltest/mod_curltest.c b/tests/http/testenv/mod_curltest/mod_curltest.c index d9ff9152c87d..e354e5a46909 100644 --- a/tests/http/testenv/mod_curltest/mod_curltest.c +++ b/tests/http/testenv/mod_curltest/mod_curltest.c @@ -610,7 +610,7 @@ static int curltest_put_handler(request_rec *r) } } else if(!strcmp("max_upload", arg)) { - rbody_max_len = (int)apr_atoi64(val); + rbody_max_len = (apr_off_t)apr_atoi64(val); continue; } } @@ -629,6 +629,7 @@ static int curltest_put_handler(request_rec *r) apr_table_unset(r->headers_out, "Content-Length"); /* Discourage content-encodings */ apr_table_unset(r->headers_out, "Content-Encoding"); + apr_table_setn(r->headers_out, "request-id", request_id); apr_table_setn(r->subprocess_env, "no-brotli", "1"); apr_table_setn(r->subprocess_env, "no-gzip", "1"); @@ -674,9 +675,9 @@ static int curltest_put_handler(request_rec *r) } cleanup: - if(rv == APR_SUCCESS - || r->status != HTTP_OK - || c->aborted) { + if(rv == APR_SUCCESS || + r->status != HTTP_OK || + c->aborted) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, rv, r, "put_handler: done"); return OK; } @@ -694,13 +695,7 @@ static int curltest_1_1_required(request_rec *r) apr_bucket_brigade *bb; apr_bucket *b; apr_status_t rv; - char buffer[16*1024]; const char *ct; - const char *request_id = "none"; - apr_time_t chunk_delay = 0; - apr_array_header_t *args = NULL; - long l; - int i; if(strcmp(r->handler, "curltest-1_1-required")) { return DECLINED; @@ -744,9 +739,9 @@ static int curltest_1_1_required(request_rec *r) rv = ap_pass_brigade(r->output_filters, bb); cleanup: - if(rv == APR_SUCCESS - || r->status != HTTP_OK - || c->aborted) { + if(rv == APR_SUCCESS || + r->status != HTTP_OK || + c->aborted) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, rv, r, "1_1_handler: done"); return OK; } @@ -774,10 +769,8 @@ static int curltest_sslinfo_handler(request_rec *r) apr_bucket_brigade *bb; apr_bucket *b; apr_status_t rv; - apr_array_header_t *args = NULL; const char *request_id = NULL; int close_conn = 0; - long l; int i; if(strcmp(r->handler, "curltest-sslinfo")) { @@ -821,6 +814,8 @@ static int curltest_sslinfo_handler(request_rec *r) apr_table_unset(r->headers_out, "Content-Length"); /* Discourage content-encodings */ apr_table_unset(r->headers_out, "Content-Encoding"); + if(request_id) + apr_table_setn(r->headers_out, "request-id", request_id); apr_table_setn(r->subprocess_env, "no-brotli", "1"); apr_table_setn(r->subprocess_env, "no-gzip", "1"); @@ -856,9 +851,9 @@ static int curltest_sslinfo_handler(request_rec *r) cleanup: if(close_conn) r->connection->keepalive = AP_CONN_CLOSE; - if(rv == APR_SUCCESS - || r->status != HTTP_OK - || c->aborted) { + if(rv == APR_SUCCESS || + r->status != HTTP_OK || + c->aborted) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, rv, r, "1_1_handler: done"); return OK; } From 990a23bb97915567415d5857ee6d862a1528f1af Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 11:24:46 +0200 Subject: [PATCH 048/885] libssh: return the proper error for readdir problems The code would return without setting sshc->actualcode or returning the CURLcode error. Reported by ZeroPath Closes #19135 --- lib/vssh/libssh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 3741db20dc63..e2574b68176b 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -613,6 +613,7 @@ static int myssh_in_SFTP_READDIR(struct Curl_easy *data, if(result) { myssh_to(data, sshc, SSH_STOP); + sshc->actualcode = result; return SSH_NO_ERROR; } From 769ccb4d4261a75c8a4236fbe7dc3e27956db1c9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 13:09:42 +0200 Subject: [PATCH 049/885] curl_get_line: enhance the API To make sure callers can properly differentiate between errors and know cleanly when EOF happens. Updated all users and unit test 3200. Triggered by a remark by ZeroPath Closes #19140 --- lib/altsvc.c | 16 ++++++----- lib/cookie.c | 30 +++++++++++++-------- lib/curl_get_line.c | 62 +++++++++++++++---------------------------- lib/curl_get_line.h | 2 +- lib/hsts.c | 30 ++++++++++++--------- lib/netrc.c | 27 +++++++++++-------- tests/unit/unit3200.c | 55 +++++++++++++++++++------------------- 7 files changed, 112 insertions(+), 110 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index 449bea8528dc..d9933f229802 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -228,14 +228,18 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file) fp = curlx_fopen(file, FOPEN_READTEXT); if(fp) { + bool eof = FALSE; struct dynbuf buf; curlx_dyn_init(&buf, MAX_ALTSVC_LINE); - while(Curl_get_line(&buf, fp)) { - const char *lineptr = curlx_dyn_ptr(&buf); - curlx_str_passblanks(&lineptr); - if(curlx_str_single(&lineptr, '#')) - altsvc_add(asi, lineptr); - } + do { + result = Curl_get_line(&buf, fp, &eof); + if(!result) { + const char *lineptr = curlx_dyn_ptr(&buf); + curlx_str_passblanks(&lineptr); + if(curlx_str_single(&lineptr, '#')) + altsvc_add(asi, lineptr); + } + } while(!result && !eof); curlx_dyn_free(&buf); /* free the line buffer */ curlx_fclose(fp); } diff --git a/lib/cookie.c b/lib/cookie.c index 59a841a303c7..98c13e621868 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -1205,19 +1205,27 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, ci->running = FALSE; /* this is not running, this is init */ if(fp) { struct dynbuf buf; + bool eof = FALSE; + CURLcode result; curlx_dyn_init(&buf, MAX_COOKIE_LINE); - while(Curl_get_line(&buf, fp)) { - const char *lineptr = curlx_dyn_ptr(&buf); - bool headerline = FALSE; - if(checkprefix("Set-Cookie:", lineptr)) { - /* This is a cookie line, get it! */ - lineptr += 11; - headerline = TRUE; - curlx_str_passblanks(&lineptr); - } + do { + result = Curl_get_line(&buf, fp, &eof); + if(!result) { + const char *lineptr = curlx_dyn_ptr(&buf); + bool headerline = FALSE; + if(checkprefix("Set-Cookie:", lineptr)) { + /* This is a cookie line, get it! */ + lineptr += 11; + headerline = TRUE; + curlx_str_passblanks(&lineptr); + } - Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL, NULL, TRUE); - } + (void)Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL, + NULL, TRUE); + /* File reading cookie failures are not propagated back to the + caller because there is no way to do that */ + } + } while(!result && !eof); curlx_dyn_free(&buf); /* free the line buffer */ /* diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c index 4b1c6c3e0970..b1b40212213d 100644 --- a/lib/curl_get_line.c +++ b/lib/curl_get_line.c @@ -32,63 +32,43 @@ /* The last #include file should be: */ #include "memdebug.h" -static int appendnl(struct dynbuf *buf) -{ - CURLcode result = curlx_dyn_addn(buf, "\n", 1); - if(result) - /* too long line or out of memory */ - return 0; /* error */ - return 1; /* all good */ -} +#define appendnl(b) \ + curlx_dyn_addn(buf, "\n", 1) /* - * Curl_get_line() makes sure to only return complete whole lines that end - * newlines. + * Curl_get_line() returns only complete whole lines that end with newline. + * When 'eof' is set TRUE, the last line has been read. */ -int Curl_get_line(struct dynbuf *buf, FILE *input) +CURLcode Curl_get_line(struct dynbuf *buf, FILE *input, bool *eof) { CURLcode result; char buffer[128]; curlx_dyn_reset(buf); while(1) { - char *b = fgets(buffer, sizeof(buffer), input); size_t rlen; + char *b = fgets(buffer, sizeof(buffer), input); - if(b) { - rlen = strlen(b); - - if(!rlen) - break; + *eof = feof(input); + rlen = b ? strlen(b) : 0; + if(rlen) { result = curlx_dyn_addn(buf, b, rlen); if(result) /* too long line or out of memory */ - return 0; /* error */ - - else if(b[rlen-1] == '\n') - /* end of the line */ - return 1; /* all good */ - - else if(feof(input)) - /* append a newline */ - return appendnl(buf); - } - else { - rlen = curlx_dyn_len(buf); - if(rlen) { - b = curlx_dyn_ptr(buf); - - if(b[rlen-1] != '\n') - /* append a newline */ - return appendnl(buf); - - return 1; /* all good */ - } - else - break; + return result; } + /* now check the full line */ + rlen = curlx_dyn_len(buf); + b = curlx_dyn_ptr(buf); + if(rlen && (b[rlen-1] == '\n')) + /* LF at end of the line */ + return CURLE_OK; /* all good */ + if(*eof) + /* append a newline */ + return appendnl(buf); + /* otherwise get next line to append */ } - return 0; + return CURLE_FAILED_INIT; } #endif /* if not disabled */ diff --git a/lib/curl_get_line.h b/lib/curl_get_line.h index d4877123f261..176d5f7a30e3 100644 --- a/lib/curl_get_line.h +++ b/lib/curl_get_line.h @@ -27,6 +27,6 @@ #include "curlx/dynbuf.h" /* Curl_get_line() returns complete lines that end with a newline. */ -int Curl_get_line(struct dynbuf *buf, FILE *input); +CURLcode Curl_get_line(struct dynbuf *buf, FILE *input, bool *eof); #endif /* HEADER_CURL_GET_LINE_H */ diff --git a/lib/hsts.c b/lib/hsts.c index 28989764b90f..4e41155f3006 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -526,20 +526,24 @@ static CURLcode hsts_load(struct hsts *h, const char *file) fp = curlx_fopen(file, FOPEN_READTEXT); if(fp) { struct dynbuf buf; + bool eof = FALSE; curlx_dyn_init(&buf, MAX_HSTS_LINE); - while(Curl_get_line(&buf, fp)) { - const char *lineptr = curlx_dyn_ptr(&buf); - curlx_str_passblanks(&lineptr); - - /* - * Skip empty or commented lines, since we know the line will have a - * trailing newline from Curl_get_line we can treat length 1 as empty. - */ - if((*lineptr == '#') || strlen(lineptr) <= 1) - continue; - - hsts_add(h, lineptr); - } + do { + result = Curl_get_line(&buf, fp, &eof); + if(!result) { + const char *lineptr = curlx_dyn_ptr(&buf); + curlx_str_passblanks(&lineptr); + + /* + * Skip empty or commented lines, since we know the line will have a + * trailing newline from Curl_get_line we can treat length 1 as empty. + */ + if((*lineptr == '#') || strlen(lineptr) <= 1) + continue; + + hsts_add(h, lineptr); + } + } while(!result && !eof); curlx_dyn_free(&buf); /* free the line buffer */ curlx_fclose(fp); } diff --git a/lib/netrc.c b/lib/netrc.c index f06dff8ed515..1309d3094237 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -81,22 +81,27 @@ static NETRCcode file2memory(const char *filename, struct dynbuf *filebuf) curlx_dyn_init(&linebuf, MAX_NETRC_LINE); if(file) { + CURLcode result = CURLE_OK; + bool eof; ret = NETRC_OK; - while(Curl_get_line(&linebuf, file)) { - CURLcode result; - const char *line = curlx_dyn_ptr(&linebuf); - /* skip comments on load */ - curlx_str_passblanks(&line); - if(*line == '#') - continue; - result = curlx_dyn_add(filebuf, line); + do { + const char *line; + result = Curl_get_line(&linebuf, file, &eof); + if(!result) { + line = curlx_dyn_ptr(&linebuf); + /* skip comments on load */ + curlx_str_passblanks(&line); + if(*line == '#') + continue; + result = curlx_dyn_add(filebuf, line); + } if(result) { + curlx_dyn_free(filebuf); ret = curl2netrc(result); - goto done; + break; } - } + } while(!eof); } -done: curlx_dyn_free(&linebuf); if(file) curlx_fclose(file); diff --git a/tests/unit/unit3200.c b/tests/unit/unit3200.c index 5c3e4d14ad47..15abba25db79 100644 --- a/tests/unit/unit3200.c +++ b/tests/unit/unit3200.c @@ -76,12 +76,13 @@ static CURLcode test_unit3200(const char *arg) #endif size_t i; - int rc = 0; + CURLcode result = CURLE_OK; for(i = 0; i < CURL_ARRAYSIZE(filecontents); i++) { FILE *fp; struct dynbuf buf; size_t len = 4096; char *line; + bool eof; curlx_dyn_init(&buf, len); fp = curlx_fopen(arg, "wb"); @@ -95,63 +96,63 @@ static CURLcode test_unit3200(const char *arg) curl_mfprintf(stderr, "Test %zd...", i); switch(i) { case 0: - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE1\n", line), + fail_unless(!result && line && !strcmp("LINE1\n", line), "First line failed (1)"); - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE2 NEWLINE\n", line), + fail_unless(!result && line && !strcmp("LINE2 NEWLINE\n", line), "Second line failed (1)"); - rc = Curl_get_line(&buf, fp); - abort_unless(!curlx_dyn_len(&buf), "Missed EOF (1)"); + result = Curl_get_line(&buf, fp, &eof); + abort_unless(eof, "Missed EOF (1)"); break; case 1: - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE1\n", line), + fail_unless(!result && line && !strcmp("LINE1\n", line), "First line failed (2)"); - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE2 NONEWLINE\n", line), + fail_unless(!result && line && !strcmp("LINE2 NONEWLINE\n", line), "Second line failed (2)"); - rc = Curl_get_line(&buf, fp); - abort_unless(!curlx_dyn_len(&buf), "Missed EOF (2)"); + result = Curl_get_line(&buf, fp, &eof); + abort_unless(eof, "Missed EOF (2)"); break; case 2: - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE1\n", line), + fail_unless(!result && line && !strcmp("LINE1\n", line), "First line failed (3)"); - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); fail_unless(!curlx_dyn_len(&buf), "Did not detect max read on EOF (3)"); break; case 3: - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE1\n", line), + fail_unless(!result && line && !strcmp("LINE1\n", line), "First line failed (4)"); - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); fail_unless(!curlx_dyn_len(&buf), "Did not ignore partial on EOF (4)"); break; case 4: - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE1\n", line), + fail_unless(!result && line && !strcmp("LINE1\n", line), "First line failed (5)"); - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); fail_unless(!curlx_dyn_len(&buf), "Did not bail out on too long line"); break; case 5: - rc = Curl_get_line(&buf, fp); + result = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(rc && line && !strcmp("LINE1\x1aTEST\n", line), + fail_unless(!result && line && !strcmp("LINE1\x1aTEST\n", line), "Missed/Misinterpreted ^Z (6)"); - rc = Curl_get_line(&buf, fp); - abort_unless(!curlx_dyn_len(&buf), "Missed EOF (6)"); + result = Curl_get_line(&buf, fp, &eof); + abort_unless(eof, "Missed EOF (6)"); break; default: abort_unless(1, "Unknown case"); @@ -161,7 +162,7 @@ static CURLcode test_unit3200(const char *arg) curlx_fclose(fp); curl_mfprintf(stderr, "OK\n"); } - return (CURLcode)rc; + return result; #endif From 976333dd4052855c22369e89e60a80a9cf925161 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 15:06:39 +0200 Subject: [PATCH 050/885] curl_path: make sure just whitespace is illegal This function could previously accidentally return true and a NULL path if only whitespace was provided as argument. Also, make it stricter and do not allow CR or LF within the string. Use more strparse parsing. Drop the comment saying this is from OpenSSH as it has now been rewritten since then. Closes #19141 --- lib/vssh/curl_path.c | 89 ++++++++++++++++++------------------------- tests/unit/unit2604.c | 4 ++ 2 files changed, 42 insertions(+), 51 deletions(-) diff --git a/lib/vssh/curl_path.c b/lib/vssh/curl_path.c index 7a0e5bffef20..44ea3d07a564 100644 --- a/lib/vssh/curl_path.c +++ b/lib/vssh/curl_path.c @@ -28,6 +28,7 @@ #include "curl_path.h" #include +#include "../curlx/strparse.h" #include "../curl_memory.h" #include "../escape.h" #include "../memdebug.h" @@ -105,32 +106,11 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, return CURLE_OK; } -/* The original get_pathname() function came from OpenSSH sftp.c version - 4.6p1. */ -/* - * Copyright (c) 2001-2004 Damien Miller - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - #define MAX_PATHLENGTH 65535 /* arbitrary long */ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) { - const char *cp = *cpp, *end; - char quot; - unsigned int i; - static const char WHITESPACE[] = " \t\r\n"; + const char *cp = *cpp; struct dynbuf out; CURLcode result; @@ -143,48 +123,37 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) curlx_dyn_init(&out, MAX_PATHLENGTH); /* Ignore leading whitespace */ - cp += strspn(cp, WHITESPACE); + curlx_str_passblanks(&cp); /* Check for quoted filenames */ if(*cp == '\"' || *cp == '\'') { - quot = *cp++; + char quot = *cp++; /* Search for terminating quote, unescape some chars */ - for(i = 0; i <= strlen(cp); i++) { - if(cp[i] == quot) { /* Found quote */ - i++; - break; - } - if(cp[i] == '\0') { /* End of string */ + while(*cp != quot) { + if(!*cp) /* End of string */ goto fail; - } - if(cp[i] == '\\') { /* Escaped characters */ - i++; - if(cp[i] != '\'' && cp[i] != '\"' && - cp[i] != '\\') { + + if(*cp == '\\') { /* Escaped characters */ + cp++; + if(*cp != '\'' && *cp != '\"' && *cp != '\\') goto fail; - } } - result = curlx_dyn_addn(&out, &cp[i], 1); + result = curlx_dyn_addn(&out, cp, 1); if(result) return result; + cp++; } + cp++; /* pass the end quote */ if(!curlx_dyn_len(&out)) goto fail; - /* return pointer to second parameter if it exists */ - *cpp = &cp[i] + strspn(&cp[i], WHITESPACE); } else { - /* Read to end of filename - either to whitespace or terminator */ - end = strpbrk(cp, WHITESPACE); - if(!end) - end = strchr(cp, '\0'); - - /* return pointer to second parameter if it exists */ - *cpp = end + strspn(end, WHITESPACE); - + struct Curl_str word; + bool content = FALSE; + int rc; /* Handling for relative path - prepend home directory */ if(cp[0] == '/' && cp[1] == '~' && cp[2] == '/') { result = curlx_dyn_add(&out, homedir); @@ -193,12 +162,30 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) if(result) return result; cp += 3; + content = TRUE; + } + /* Read to end of filename - either to whitespace or terminator */ + rc = curlx_str_word(&cp, &word, MAX_PATHLENGTH); + if(rc) { + if(rc == STRE_BIG) + return CURLE_TOO_LARGE; + else if(!content) + /* no path, no word, this is incorrect */ + goto fail; + } + else { + /* append the word */ + result = curlx_dyn_addn(&out, curlx_str(&word), curlx_strlen(&word)); + if(result) + return result; } - /* Copy path name up until first "whitespace" */ - result = curlx_dyn_addn(&out, cp, (end - cp)); - if(result) - return result; } + /* skip whitespace */ + curlx_str_passblanks(&cp); + + /* return pointer to second parameter if it exists */ + *cpp = cp; + *path = curlx_dyn_ptr(&out); return CURLE_OK; diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index 3d57f16c8ff1..7cb82bbcf1cf 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -68,6 +68,10 @@ static CURLcode test_unit2604(const char *arg) { "\"\" c", "", "", "", CURLE_QUOTE_ERROR}, { "foo\"", "foo\"", "", "/", CURLE_OK}, { "foo \"", "foo", "\"", "/", CURLE_OK}, + { " \t\t \t ", "", "", "/", CURLE_QUOTE_ERROR}, + { " ", "", "", "/", CURLE_QUOTE_ERROR}, + { "", "", "", "/", CURLE_QUOTE_ERROR}, + { " \r \n ", "\r", "\n ", "/", CURLE_OK}, { NULL, NULL, NULL, NULL, CURLE_OK } }; From d8a7aad061f96efa0ea93a01845fb66abc256280 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 19 Oct 2025 21:15:55 +0200 Subject: [PATCH 051/885] GHA/windows: drop `git config core.autocrlf input` steps CI works without it now. For an inexplicable reason, this single `git` command took 9 seconds per job, making this patch save more than 2 minutes per workflow run. It was also the only step using PowerShell. Closes #19150 --- .github/workflows/windows.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 975b592c7ce1..60eafaa4c0e9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -57,8 +57,6 @@ jobs: - { build: 'cmake' , platform: 'x86_64', tflags: '' , config: '-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DENABLE_THREADED_RESOLVER=OFF', install: 'libssl-devel libssh2-devel', name: 'openssl' } fail-fast: false steps: - - run: git config --global core.autocrlf input - shell: pwsh - uses: cygwin/cygwin-install-action@f2009323764960f80959895c7bc3bb30210afe4d # v6 with: platform: ${{ matrix.platform }} @@ -220,9 +218,6 @@ jobs: - { build: 'cmake' , sys: 'mingw32' , env: 'i686' , tflags: 'skiprun', config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', install: 'mingw-w64-i686-libssh2', type: 'Release', name: 'schannel R' } fail-fast: false steps: - - run: git config --global core.autocrlf input - shell: pwsh - - uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0 if: ${{ matrix.sys == 'msys' }} with: @@ -500,8 +495,6 @@ jobs: rm -r -f pack.bin ls -l - - run: git config --global core.autocrlf input - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false From 55e0526566f9ea452dec6e443bcd3c358b76b977 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Sun, 19 Oct 2025 21:26:17 +0300 Subject: [PATCH 052/885] openssl: fix unable do typo in failf() calls Closes #19149 --- lib/vtls/openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 66c0fbfabdaa..c580d6cc67af 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1251,7 +1251,7 @@ static int enginecheck(struct Curl_easy *data, UI_METHOD *ui_method = UI_create_method(OSSL_UI_METHOD_CAST("curl user interface")); if(!ui_method) { - failf(data, "unable do create " OSSL_PACKAGE " user-interface method"); + failf(data, "unable to create " OSSL_PACKAGE " user-interface method"); return 0; } UI_method_set_opener(ui_method, UI_method_get_opener(UI_OpenSSL())); @@ -1313,7 +1313,7 @@ static int providercheck(struct Curl_easy *data, UI_METHOD *ui_method = UI_create_method(OSSL_UI_METHOD_CAST("curl user interface")); if(!ui_method) { - failf(data, "unable do create " OSSL_PACKAGE " user-interface method"); + failf(data, "unable to create " OSSL_PACKAGE " user-interface method"); return 0; } UI_method_set_opener(ui_method, UI_method_get_opener(UI_OpenSSL())); From 7f19fa98199f967bda2ddb1da1d889c6eafcc14b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 16:40:11 +0200 Subject: [PATCH 053/885] lib: add asserts that hostname has content For all network related protocols there must be a non-blank hostname used. This change adds a few asserts in some places to make debug/tests catch mistakes if any such would slip in. Closes #19146 --- lib/doh.c | 1 + lib/hostip.c | 4 +++- lib/socks.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/doh.c b/lib/doh.c index 3dd7a2872d2f..8cdecf465720 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -458,6 +458,7 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, DEBUGASSERT(conn); DEBUGASSERT(!data->state.async.doh); + DEBUGASSERT(hostname && hostname[0]); if(data->state.async.doh) Curl_doh_cleanup(data); diff --git a/lib/hostip.c b/lib/hostip.c index 41db274c5d4e..055ea78b483c 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -858,6 +858,7 @@ CURLcode Curl_resolv(struct Curl_easy *data, /* We should intentionally error and not resolve .onion TLDs */ hostname_len = strlen(hostname); + DEBUGASSERT(hostname_len); if(hostname_len >= 7 && (curl_strequal(&hostname[hostname_len - 6], ".onion") || curl_strequal(&hostname[hostname_len - 7], ".onion."))) { @@ -982,7 +983,7 @@ CURLcode Curl_resolv_blocking(struct Curl_easy *data, struct Curl_dns_entry **dnsentry) { CURLcode result; - + DEBUGASSERT(hostname && *hostname); *dnsentry = NULL; result = Curl_resolv(data, hostname, port, ip_version, FALSE, dnsentry); switch(result) { @@ -1060,6 +1061,7 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, #endif /* USE_ALARM_TIMEOUT */ CURLcode result; + DEBUGASSERT(hostname && *hostname); *entry = NULL; if(timeoutms < 0) diff --git a/lib/socks.c b/lib/socks.c index d146b12abc72..238e140b0686 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -331,6 +331,7 @@ static CURLproxycode socks4_resolving(struct socks_state *sx, if(sx->start_resolving) { /* need to resolve hostname to add destination address */ sx->start_resolving = FALSE; + DEBUGASSERT(sx->hostname && *sx->hostname); result = Curl_resolv(data, sx->hostname, sx->remote_port, cf->conn->ip_version, TRUE, &dns); @@ -858,6 +859,7 @@ static CURLproxycode socks5_resolving(struct socks_state *sx, if(sx->start_resolving) { /* need to resolve hostname to add destination address */ sx->start_resolving = FALSE; + DEBUGASSERT(sx->hostname && *sx->hostname); result = Curl_resolv(data, sx->hostname, sx->remote_port, cf->conn->ip_version, TRUE, &dns); From 4c636b2dc1fb94e554f8885e595888a20cca11fc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 16:12:56 +0200 Subject: [PATCH 054/885] tool_operate: return error on strdup() failure In src/tool_operate.c inside the Windows safe-search branch (#ifdef CURL_CA_SEARCH_SAFE), the code assigns config->cacert = strdup(cacert); at line 2076 without checking whether strdup returned NULL. This would allow the code to continue with the wrong value set, causing possible confusion. Pointed out by ZeroPath Closes #19145 --- src/tool_operate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tool_operate.c b/src/tool_operate.c index 00a98b360ba0..0c03114d4072 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2072,6 +2072,10 @@ static CURLcode cacertpaths(struct OperationConfig *config) if(cafile) { curlx_fclose(cafile); config->cacert = strdup(cacert); + if(!config->cacert) { + result = CURLE_OUT_OF_MEMORY; + goto fail; + } } #elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ !defined(CURL_DISABLE_CA_SEARCH) From d3b2ba92c7ed587d48afd1bbc58de19eab6645bf Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 23:34:52 +0200 Subject: [PATCH 055/885] rustls: exit on error In init_config_builder_verifier() the call to rustls_root_cert_store_builder_build() set result on failure but did not return. Pointed out by ZeroPath Closes #19125 --- lib/vtls/rustls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index ebd94213d493..2173b3be88ba 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -746,6 +746,9 @@ init_config_builder_verifier(struct Curl_easy *data, if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to build trusted root certificate store"); result = CURLE_SSL_CACERT_BADFILE; + if(result) { + goto cleanup; + } } verifier_builder = rustls_web_pki_server_cert_verifier_builder_new(roots); @@ -754,7 +757,7 @@ init_config_builder_verifier(struct Curl_easy *data, result = init_config_builder_verifier_crl(data, conn_config, verifier_builder); - if(result != CURLE_OK) { + if(result) { goto cleanup; } } From 00cb679c04ef9e0f30bd99c9dcc58c1e1928c01a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 15:25:52 +0200 Subject: [PATCH 056/885] openssl: remove dead code A condition in infof_certstack() would always equal true after a previous change. Follow-up to e2a4de8a607d3c7f52918ef50ab6411c75 Pointed out by Coverity Closes #19142 --- lib/vtls/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index c580d6cc67af..f62f99cc86c1 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4898,7 +4898,7 @@ static void infof_certstack(struct Curl_easy *data, const SSL *ssl) curl_msnprintf(group_name_final, sizeof(group_name_final), "/%s", group_name); } - type_name = current_pkey ? EVP_PKEY_get0_type_name(current_pkey) : NULL; + type_name = EVP_PKEY_get0_type_name(current_pkey); #else get_group_name = 0; type_name = NULL; From 8504c41e2c61475355318a89446891c375b86aec Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 15:59:09 +0200 Subject: [PATCH 057/885] tool_cb_rea: use poll instead of select if available - poll doesn't have the FD_SETSIZE problem - select: if socket >= FD_SETSIZE, skip the call Closes #19143 --- src/tool_cb_rea.c | 90 ++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index b7bd9a722732..b5c614384521 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -26,6 +26,11 @@ #ifdef HAVE_SYS_SELECT_H #include #endif +#ifdef HAVE_POLL_H +#include +#elif defined(HAVE_SYS_POLL_H) +#include +#endif #include "tool_cfgable.h" #include "tool_cb_rea.h" @@ -35,6 +40,49 @@ #include "memdebug.h" /* keep this as LAST include */ +#ifndef _WIN32 +/* Wait up to a number of milliseconds for socket activity. This function + waits on read activity on a file descriptor that is not a socket which + makes it not work with select() or poll() on Windows. */ +static bool waitfd(int waitms, int fd) +{ +#ifdef HAVE_POLL + struct pollfd set; + + set.fd = fd; + set.events = POLLIN; + set.revents = 0; + if(poll(&set, 1, (int)waitms)) + return TRUE; /* timeout */ + return FALSE; +#else + fd_set bits; + struct timeval timeout; + + if(fd >= FD_SETSIZE) + /* can't wait! */ + return FALSE; + + /* wait this long at the most */ + timeout.tv_sec = waitms / 1000; + timeout.tv_usec = (int)((waitms % 1000) * 1000); + + FD_ZERO(&bits); +#ifdef __DJGPP__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warith-conversion" +#endif + FD_SET(fd, &bits); +#ifdef __DJGPP__ +#pragma GCC diagnostic pop +#endif + if(!select(fd + 1, &bits, NULL, NULL, &timeout)) + return TRUE; /* timeout */ + return FALSE; +#endif +} +#endif + /* ** callback for CURLOPT_READFUNCTION */ @@ -59,28 +107,11 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) /* timeout */ return 0; #ifndef _WIN32 - /* this logic waits on read activity on a file descriptor that is not a - socket which makes it not work with select() on Windows */ else { - fd_set bits; - struct timeval timeout; - long wait = config->timeout_ms - msdelta; - - /* wait this long at the most */ - timeout.tv_sec = wait/1000; - timeout.tv_usec = (int)((wait%1000)*1000); - - FD_ZERO(&bits); -#ifdef __DJGPP__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Warith-conversion" -#endif - FD_SET(per->infd, &bits); -#ifdef __DJGPP__ -#pragma GCC diagnostic pop -#endif - if(!select(per->infd + 1, &bits, NULL, NULL, &timeout)) - return 0; /* timeout */ + long w = config->timeout_ms - msdelta; + if(w > INT_MAX) + w = INT_MAX; + waitfd((int)w, per->infd); } #endif } @@ -154,22 +185,7 @@ int tool_readbusy_cb(void *clientp, if(config->readbusy) { if(ulprev == ulnow) { #ifndef _WIN32 - fd_set bits; - struct timeval timeout; - /* wait this long at the most */ - timeout.tv_sec = 0; - timeout.tv_usec = 1000; - - FD_ZERO(&bits); -#ifdef __DJGPP__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Warith-conversion" -#endif - FD_SET(per->infd, &bits); -#ifdef __DJGPP__ -#pragma GCC diagnostic pop -#endif - select(per->infd + 1, &bits, NULL, NULL, &timeout); + waitfd(1, per->infd); #else /* sleep */ curlx_wait_ms(1); From c21655e7ff243e5b9924c19a061e5e5ab70958b8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 17:00:06 +0200 Subject: [PATCH 058/885] tool_filetime: cap crazy filetimes instead of erroring Also cap the minimum allowed timestamp now. Closes #19147 --- src/tool_filetime.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/tool_filetime.c b/src/tool_filetime.c index 6dc2fbbe4234..041cc4dbd6cb 100644 --- a/src/tool_filetime.c +++ b/src/tool_filetime.c @@ -96,13 +96,17 @@ void setfiletime(curl_off_t filetime, const char *filename) HANDLE hfile; TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar(filename); - /* 910670515199 is the maximum Unix filetime that can be used as a - Windows FILETIME without overflow: 30827-12-31T23:59:59. */ + /* 910670515199 is the maximum Unix filetime that can be used as a Windows + FILETIME without overflow: 30827-12-31T23:59:59. */ if(filetime > 910670515199) { - warnf("Failed to set filetime %" CURL_FORMAT_CURL_OFF_T - " on outfile: overflow", filetime); - curlx_unicodefree(tchar_filename); - return; + filetime = 910670515199; + warnf("Capping set filetime to max to avoid overflow"); + } + else if(filetime < -6857222400) { + /* dates before 14 september 1752 (pre-Gregorian calendar) are not + accurate */ + filetime = -6857222400; + warnf("Capping set filetime to minimum to avoid overflow"); } hfile = CreateFile(tchar_filename, FILE_WRITE_ATTRIBUTES, From 3986149c0405d9d4f33fe1dc9c485e0f362c0a05 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 00:24:15 +0200 Subject: [PATCH 059/885] GHA/windows: delete remains of Perl `Win32-Process*` caching Follow-up to c8d6643df212791edee705a94c890335dac8762b #19083 --- .github/workflows/windows.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 60eafaa4c0e9..242d1e3e4440 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -365,7 +365,6 @@ jobs: run: | /usr/bin/pacman --noconfirm --noprogressbar --sync --needed openssh /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true - perl --version | tee "$GITHUB_WORKSPACE"/perlversion - name: 'run tests' if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} @@ -560,7 +559,6 @@ jobs: run: | /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt - perl --version | tee "$GITHUB_WORKSPACE"/perlversion - name: 'run tests' if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} @@ -937,7 +935,6 @@ jobs: if [ "${MATRIX_IMAGE}" != 'windows-11-arm' ]; then # save 30-60 seconds, to counteract the slower test run step python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt fi - perl --version | tee "$GITHUB_WORKSPACE"/perlversion - name: 'run tests' if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} From 0bb25cdbb78d9052a57b8147f3f399f6045b3238 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 00:34:56 +0200 Subject: [PATCH 060/885] curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS It was mistakenly removed in 8dab7465a594b1fb4b (shipped in 8.9.0) Also fix test 1139 which should have detected this but didn't due to a bad regex check. Reported-by: Jonathan Cardoso Fixes #19151 Closes #119152 --- docs/libcurl/curl_easy_setopt.md | 4 ++++ tests/test1139.pl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/libcurl/curl_easy_setopt.md b/docs/libcurl/curl_easy_setopt.md index 430c3c14abbc..49c57fb11f78 100644 --- a/docs/libcurl/curl_easy_setopt.md +++ b/docs/libcurl/curl_easy_setopt.md @@ -686,6 +686,10 @@ Port number to connect to. See CURLOPT_PORT(3) Make an HTTP POST. See CURLOPT_POST(3) +## CURLOPT_POSTFIELDS + +Send a POST with this data - does not copy it. See CURLOPT_POSTFIELDS(3) + ## CURLOPT_POSTFIELDSIZE The POST data is this big. See CURLOPT_POSTFIELDSIZE(3) diff --git a/tests/test1139.pl b/tests/test1139.pl index cabb893d6985..cebf58ccf207 100755 --- a/tests/test1139.pl +++ b/tests/test1139.pl @@ -90,7 +90,7 @@ sub scanmdpage { } } foreach my $m (@words) { - my @g = grep(/$m/, @m); + my @g = grep(/$m\b/, @m); if(!$g[0]) { print STDERR "Missing mention of $m in $file\n"; $errors++; From b5cdfcf8e2d460a6ef11a2ca6e09e228d5741b9b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 08:53:49 +0200 Subject: [PATCH 061/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 70 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 740cfc9df249..d58373330555 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -66,6 +66,8 @@ This release includes the following bugfixes: o cmake: clang detection tidy-ups [116] o cmake: drop exclamation in comment looking like a name [160] o cmake: fix building docs when the base directory contains .3 [18] + o cmake: fix Linux pre-fill `HAVE_POSIX_STRERROR_R` (when `_CURL_PREFILL=ON`) + o cmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`) [372] o cmake: minor Heimdal flavour detection fix [269] o cmake: pre-fill three more type sizes on Windows [244] o cmake: support building some complicated examples, build them in CI [235] @@ -80,8 +82,10 @@ This release includes the following bugfixes: o cpool: make bundle->dest an array; fix UB [218] o curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY [320] o curl_easy_getinfo: error code on NULL arg [2] + o curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS [319] o curl_mem_undef.h: limit to CURLDEBUG for non-memalloc overrides [19] o curl_osslq: error out properly if BIO_ADDR_rawmake() fails [184] + o curl_path: make sure just whitespace is illegal [351] o Curl_resolv: fix comment. 'entry' argument is not optional [187] o curl_slist_append.md: clarify that a NULL pointer is not acceptable [72] o curl_threads: delete WinCE fallback branch [233] @@ -101,6 +105,7 @@ This release includes the following bugfixes: o docs: fix/tidy code fences [87] o doswin: CloseHandle the thread on shutdown [307] o easy_getinfo: check magic, Curl_close safety [3] + o examples/chkspeed: portable printing when outputting curl_off_t values [365] o examples/sessioninfo: cast printf string mask length to int [232] o examples/sessioninfo: do not disable security [255] o examples/synctime: fix null termination assumptions [297] @@ -115,6 +120,7 @@ This release includes the following bugfixes: o examples: fix two issues found by CodeQL [35] o examples: fix two more cases of stat() TOCTOU [147] o examples: improve global init, error checks and returning errors [321] + o examples: replace casts with `curl_off_t` printf masks [358] o examples: return curl_easy_perform() results [322] o firefox-db2pem.sh: add macOS support, tidy-ups [348] o form.md: drop reference to MANUAL [178] @@ -152,10 +158,12 @@ This release includes the following bugfixes: o krb5_sspi: the chlg argument is NOT optional [200] o ldap: avoid null ptr deref on failure [284] o ldap: do not base64 encode zero length string [42] + o ldap: do not pass a \n to failf() [370] o ldap: tidy-up types, fix error code confusion [191] o lib1514: fix return code mixup [304] o lib: drop unused include and duplicate guards [226] o lib: fix build error with verbose strings disabled [173] + o lib: remove newlines from failf() calls [366] o lib: remove personal names from comments [168] o lib: SSL connection reuse [301] o lib: stop NULL-checking conn->passwd and ->user [309] @@ -184,6 +192,7 @@ This release includes the following bugfixes: o libssh: make atime and mtime cap the timestamp instead of wrap [283] o libssh: react on errors from ssh_scp_read [24] o libssh: return out of memory correctly if aprintf fails [60] + o libssh: return the proper error for readdir problems [355] o Makefile.example: fix option order [231] o Makefile.example: simplify and make it configurable [20] o managen: ignore version mentions < 7.66.0 [55] @@ -200,6 +209,7 @@ This release includes the following bugfixes: o multi_ev: remove unnecessary data check that confuses analysers [167] o nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header [227] o ngtcp2: add a comment explaining write result handling [340] + o ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available [362] o ngtcp2: check error code on connect failure [13] o ngtcp2: close just-opened QUIC stream when submit_request fails [222] o ngtcp2: compare idle timeout in ms to avoid overflow [248] @@ -210,6 +220,7 @@ This release includes the following bugfixes: o openldap: avoid indexing the result at -1 for blank responses [44] o openldap: check ber_sockbuf_add_io() return code [163] o openldap: check ldap_get_option() return codes [119] + o openldap: do not pass newline to infof() [368] o openldap: fix memory-leak in error path [287] o openldap: fix memory-leak on oldap_do's exit path [286] o openldap: limit max incoming size [347] @@ -223,6 +234,9 @@ This release includes the following bugfixes: o openssl: fail the transfer if ossl_certchain() fails [23] o openssl: fix build for v1.0.2 [225] o openssl: fix peer certificate leak in channel binding [258] + o openssl: fix resource leak in provider error path [376] + o openssl: fix unable do typo in failf() calls [341] + o openssl: free UI_METHOD on exit path [373] o openssl: make the asn1_object_dump name null terminated [56] o openssl: set io_need always [99] o openssl: skip session resumption when verifystatus is set [230] @@ -241,6 +255,7 @@ This release includes the following bugfixes: o quiche: handle tls fail correctly [266] o quiche: when ingress processing fails, return that error code [103] o runtests: tag tests that require curl verbose strings [172] + o rustls: exit on error [335] o rustls: fix clang-tidy warning [107] o rustls: fix comment describing cr_recv() [117] o rustls: limit snprintf proper in cr_keylog_log_cb() [343] @@ -250,6 +265,8 @@ This release includes the following bugfixes: o rustls: use %zu for size_t in failf() format string [121] o sasl: clear canceled mechanism instead of toggling it [41] o schannel: assign result before using it [62] + o schannel: fix memory leak [363] + o schannel_verify: do not call infof with an appended \n [371] o schannel_verify: fix mem-leak in Curl_verify_host [208] o schannel_verify: use more human friendly error messages [96] o scripts: pass -- before passing xargs [349] @@ -260,7 +277,9 @@ This release includes the following bugfixes: o smb: adjust buffer size checks [45] o smb: transfer debugassert to real check [303] o smtp: check EHLO responses case insensitively [50] + o smtp: return value ignored [357] o socks: advance iobuf instead of reset [276] + o socks: avoid UAF risk in error path [359] o socks: deny server basic-auth if not configured [264] o socks: handle error in verbose trace gracefully [94] o socks: handle premature close [246] @@ -276,6 +295,7 @@ This release includes the following bugfixes: o socks_sspi: restore non-blocking socket on error paths [48] o socks_sspi: use the correct free function [331] o socksd: remove --bindonly mention, there is no such option [305] + o src/var: remove dead code [369] o ssl-sessions.md: mark option experimental [12] o strerror: drop workaround for SalfordC win32 header bug [214] o sws: fix checking sscanf() return value [17] @@ -302,9 +322,9 @@ This release includes the following bugfixes: o tftp: return error if it hits an illegal state [138] o tftp: return error when sendto() fails [59] o thread: errno on thread creation [271] - o tidy-up: fcntl.h includes [98] o tidy-up: assortment of small fixes [115] o tidy-up: avoid using the reserved macro namespace [76] + o tidy-up: fcntl.h includes [98] o tidy-up: update MS links, allow long URLs via checksrc [73] o tidy-up: URLs [101] o time-cond.md: refer to the singular curl_getdate man page [148] @@ -313,8 +333,11 @@ This release includes the following bugfixes: o tool: fix exponential retry delay [47] o tool_cb_hdr: fix fwrite check in header callback [49] o tool_cb_hdr: size is always 1 [70] + o tool_cb_rea: use poll instead of select if available [329] o tool_doswin: fix to use curl socket functions [108] + o tool_filetime: cap crazy filetimes instead of erroring [327] o tool_filetime: replace cast with the fitting printf mask (Windows) [212] + o tool_formparse: rewrite the headers file parser [374] o tool_getparam/set_rate: skip the multiplication on overflow [84] o tool_getparam: always disable "lib-ids" for tracing [169] o tool_getparam: make --fail and --fail-with-body override each other [293] @@ -325,6 +348,8 @@ This release includes the following bugfixes: o tool_operate: keep failed partial download for retry auto-resume [210] o tool_operate: keep the progress meter for --out-null [33] o tool_operate: retry on HTTP response codes 522 and 524 [317] + o tool_operate: return error on strdup() failure [336] + o tool_paramhlp: remove outdated comment in str2tls_max() [367] o tool_progress: handle possible integer overflows [164] o tool_progress: make max5data() use an algorithm [170] o transfer: avoid busy loop with tiny speed limit [100] @@ -348,6 +373,7 @@ This release includes the following bugfixes: o windows: use consistent format when showing error codes [199] o windows: use native error code types more [206] o wolfssl: check BIO read parameters [133] + o wolfssl: clear variable to avoid uninitialized use [361] o wolfssl: fix error check in shutdown [105] o wolfssl: fix resource leak in verify_pinned error paths [314] o wolfssl: no double get_error() detail [188] @@ -383,14 +409,15 @@ advice from friends like these: Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, dependabot[bot], divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, Howard Chu, - Ignat Loskutov, Javier Blazquez, Jicea, jmaggard10 on github, - Johannes Schindelin, Joseph Birr-Pixton, Joshua Rogers, kapsiR on github, - kuchara on github, Marcel Raad, Michael Osipov, Michał Petryka, - Mitchell Blank Jr, Mohamed Daahir, Nir Azkiel, Patrick Monnerat, - plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], - rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, - Stanislav Fort, Stefan Eissing, tkzv on github, Viktor Szakats - (48 contributors) + Ignat Loskutov, James Fuller, Javier Blazquez, Jicea, jmaggard10 on github, + Jochen Sprickerhof, Johannes Schindelin, Jonathan Cardoso Machado, + Joseph Birr-Pixton, Joshua Rogers, kapsiR on github, kuchara on github, + Marcel Raad, Michael Osipov, Michał Petryka, Mitchell Blank Jr, + Mohamed Daahir, Nir Azkiel, Patrick Monnerat, plv1313 on github, + Pocs Norbert, Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, + Samuel Dionne-Riel, Samuel Henrique, Stanislav Fort, Stefan Eissing, + Tatsuhiro Tsujikawa, tkzv on github, Viktor Szakats, Yedaya Katsman + (53 contributors) References to bug reports and discussions on issues: @@ -712,6 +739,7 @@ References to bug reports and discussions on issues: [316] = https://curl.se/bug/?i=19017 [317] = https://curl.se/bug/?i=16143 [318] = https://curl.se/bug/?i=19055 + [319] = https://curl.se/bug/?i=19151 [320] = https://curl.se/mail/lib-2025-10/0018.html [321] = https://curl.se/bug/?i=19053 [322] = https://curl.se/bug/?i=19052 @@ -719,14 +747,19 @@ References to bug reports and discussions on issues: [324] = https://curl.se/bug/?i=19048 [325] = https://curl.se/bug/?i=19106 [326] = https://curl.se/bug/?i=19064 + [327] = https://curl.se/bug/?i=19147 [328] = https://curl.se/bug/?i=19104 + [329] = https://curl.se/bug/?i=19143 [330] = https://curl.se/bug/?i=19101 [331] = https://curl.se/bug/?i=19046 [332] = https://curl.se/bug/?i=19102 [334] = https://curl.se/bug/?i=19100 + [335] = https://curl.se/bug/?i=19125 + [336] = https://curl.se/bug/?i=19145 [337] = https://curl.se/bug/?i=19097 [339] = https://curl.se/bug/?i=19091 [340] = https://curl.se/bug/?i=19093 + [341] = https://curl.se/bug/?i=19149 [342] = https://curl.se/bug/?i=19094 [343] = https://curl.se/bug/?i=19095 [344] = https://curl.se/bug/?i=19077 @@ -735,5 +768,24 @@ References to bug reports and discussions on issues: [347] = https://issues.oss-fuzz.com/issues/432441303 [348] = https://curl.se/bug/?i=19086 [349] = https://curl.se/bug/?i=19076 + [351] = https://curl.se/bug/?i=19141 [353] = https://curl.se/bug/?i=19073 [354] = https://curl.se/bug/?i=19078 + [355] = https://curl.se/bug/?i=19135 + [357] = https://curl.se/bug/?i=19136 + [358] = https://curl.se/bug/?i=19133 + [359] = https://curl.se/bug/?i=19139 + [361] = https://curl.se/bug/?i=19126 + [362] = https://curl.se/bug/?i=19132 + [363] = https://curl.se/bug/?i=19118 + [365] = https://curl.se/bug/?i=19112 + [366] = https://curl.se/bug/?i=19124 + [367] = https://curl.se/bug/?i=19115 + [368] = https://curl.se/bug/?i=19120 + [369] = https://curl.se/bug/?i=19119 + [370] = https://curl.se/bug/?i=19122 + [371] = https://curl.se/bug/?i=19123 + [372] = https://curl.se/bug/?i=19116 + [373] = https://curl.se/bug/?i=19114 + [374] = https://curl.se/bug/?i=19113 + [376] = https://curl.se/bug/?i=19111 From f21d70e76c1c66cb2f59886e8ad52bffe1d66ed9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 08:47:43 +0200 Subject: [PATCH 062/885] HTTP3: clarify the status for "old" OpenSSL, not current Closes #19153 --- docs/HTTP3.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/HTTP3.md b/docs/HTTP3.md index 2047d4ad2e77..b3ddcbaaf832 100644 --- a/docs/HTTP3.md +++ b/docs/HTTP3.md @@ -93,8 +93,9 @@ Build curl: ## Build with quictls -OpenSSL does not offer the required APIs for building a QUIC client. You need -to use a TLS library that has such APIs and that works with *ngtcp2*. +OpenSSL before version 3.5 does not offer the required APIs for building a +QUIC client. You need to use a TLS library that has such APIs and that works +with *ngtcp2*. Build quictls (any `+quic` tagged version works): From cbd7823fd163c20e6b010977972dc7f7f180c709 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 09:09:50 +0200 Subject: [PATCH 063/885] RELEASE-NOTES: fix typo --- RELEASE-NOTES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d58373330555..009121768647 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -335,7 +335,7 @@ This release includes the following bugfixes: o tool_cb_hdr: size is always 1 [70] o tool_cb_rea: use poll instead of select if available [329] o tool_doswin: fix to use curl socket functions [108] - o tool_filetime: cap crazy filetimes instead of erroring [327] + o tool_filetime: cap crazy file times instead of erroring [327] o tool_filetime: replace cast with the fitting printf mask (Windows) [212] o tool_formparse: rewrite the headers file parser [374] o tool_getparam/set_rate: skip the multiplication on overflow [84] From 9596c4a2587a9e512ea46fbd7b6fc1ecb878590f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 10:59:38 +0200 Subject: [PATCH 064/885] http: return error for a second Location: header Unless it is identical to the previous one. Follow-up to dbcaa0065719acc0383 Adjusted test 580, added test 772 and 773 Fixes #19130 Reported-by: Jakub Stasiak Closes #19134 --- lib/http.c | 48 ++++++++++++++++++++++---------------- tests/data/Makefile.am | 2 +- tests/data/test580 | 11 +++++++++ tests/data/test772 | 52 ++++++++++++++++++++++++++++++++++++++++++ tests/data/test773 | 49 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+), 21 deletions(-) create mode 100644 tests/data/test772 create mode 100644 tests/data/test773 diff --git a/lib/http.c b/lib/http.c index db37995a12c7..2d5da2e0e142 100644 --- a/lib/http.c +++ b/lib/http.c @@ -3265,9 +3265,7 @@ static CURLcode http_header_l(struct Curl_easy *data, data->info.filetime = k->timeofdoc; return CURLE_OK; } - if((k->httpcode >= 300 && k->httpcode < 400) && - HD_IS(hd, hdlen, "Location:") && - !data->req.location) { + if(HD_IS(hd, hdlen, "Location:")) { /* this is the URL that the server advises us to use instead */ char *location = Curl_copy_header_value(hd); if(!location) @@ -3276,23 +3274,33 @@ static CURLcode http_header_l(struct Curl_easy *data, /* ignore empty data */ free(location); else { - data->req.location = location; - - if(data->set.http_follow_mode) { - CURLcode result; - DEBUGASSERT(!data->req.newurl); - data->req.newurl = strdup(data->req.location); /* clone */ - if(!data->req.newurl) - return CURLE_OUT_OF_MEMORY; - - /* some cases of POST and PUT etc needs to rewind the data - stream at this point */ - result = http_perhapsrewind(data, conn); - if(result) - return result; - - /* mark the next request as a followed location: */ - data->state.this_is_a_follow = TRUE; + if(data->req.location && + strcmp(data->req.location, location)) { + failf(data, "Multiple Location headers"); + free(location); + return CURLE_WEIRD_SERVER_REPLY; + } + else { + free(data->req.location); + data->req.location = location; + + if((k->httpcode >= 300 && k->httpcode < 400) && + data->set.http_follow_mode) { + CURLcode result; + DEBUGASSERT(!data->req.newurl); + data->req.newurl = strdup(data->req.location); /* clone */ + if(!data->req.newurl) + return CURLE_OUT_OF_MEMORY; + + /* some cases of POST and PUT etc needs to rewind the data + stream at this point */ + result = http_perhapsrewind(data, conn); + if(result) + return result; + + /* mark the next request as a followed location: */ + data->state.this_is_a_follow = TRUE; + } } } } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 99c287507f76..9984e92839f8 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -110,7 +110,7 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \ test745 test746 test747 test748 test749 test750 test751 test752 test753 \ test754 test755 test756 test757 test758 test759 test760 test761 test762 \ test763 test764 test765 test766 test767 test768 test769 test770 test771 \ -\ +test772 test773 \ test780 test781 test782 test783 test784 test785 test786 test787 test788 \ test789 test790 test791 test792 test793 test794 test796 test797 \ \ diff --git a/tests/data/test580 b/tests/data/test580 index 63cd0ca0deb9..c7f4bcfcd778 100644 --- a/tests/data/test580 +++ b/tests/data/test580 @@ -20,6 +20,14 @@ Connection: close Location: and there's a second one too! / moo.html + +HTTP/1.1 302 eat this! +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: this-is-the-first.html +Content-Length: 0 +Connection: close + # Client-side @@ -51,5 +59,8 @@ Host: %HOSTIP:%HTTPPORT Accept: */* + +8 + diff --git a/tests/data/test772 b/tests/data/test772 new file mode 100644 index 000000000000..f3b1d954e8d9 --- /dev/null +++ b/tests/data/test772 @@ -0,0 +1,52 @@ + + + +HTTP +HTTP GET +Location + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 +Connection: close +Location: this +Location: that + + + + +# +# Client-side + + +http + + +HTTP with two Location: headers triggers error + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +8 + + + diff --git a/tests/data/test773 b/tests/data/test773 new file mode 100644 index 000000000000..42d28dadd30f --- /dev/null +++ b/tests/data/test773 @@ -0,0 +1,49 @@ + + + +HTTP +HTTP GET +Location + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 +Connection: close +Location: this +Location: this + + + + +# +# Client-side + + +http + + +HTTP with two identical Location: headers triggers no error + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + + From 104299195e1676488f3c156a24b134fb33cf6e06 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 09:12:09 +0200 Subject: [PATCH 065/885] curl_get_line: the final return cannot be reached Follow-up to 769ccb4d4261a75c8a4236f Pointed out by CodeSonar Closes #19154 --- lib/curl_get_line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c index b1b40212213d..d5ab7b842720 100644 --- a/lib/curl_get_line.c +++ b/lib/curl_get_line.c @@ -68,7 +68,7 @@ CURLcode Curl_get_line(struct dynbuf *buf, FILE *input, bool *eof) return appendnl(buf); /* otherwise get next line to append */ } - return CURLE_FAILED_INIT; + /* UNREACHABLE */ } #endif /* if not disabled */ From d2af9c9a08340487a699e4d1949637f777415535 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 10:02:33 +0200 Subject: [PATCH 066/885] INSTALL.md: add another OS (Azure Sphere) Closes #19155 --- docs/INSTALL.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 0fe724390c52..dfbc1eebfd1b 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -650,22 +650,22 @@ This is a probably incomplete list of known CPU architectures and operating systems that curl has been compiled for. If you know a system curl compiles and runs on, that is not listed, please let us know. -## 108 Operating Systems - - AIX, AmigaOS, Android, ArcaOS, Aros, Atari FreeMiNT, BeOS, Blackberry 10, - Blackberry Tablet OS, Cell OS, Cesium, CheriBSD, Chrome OS, Cisco IOS, - DG/UX, DR DOS, Dragonfly BSD, eCOS, FreeBSD, FreeDOS, FreeRTOS, Fuchsia, - Garmin OS, Genode, Haiku, HardenedBSD, HP-UX, Hurd, IBM I, illumos, - Integrity, iOS, ipadOS, IRIX, KasperskyOS, Linux, Lua RTOS, Mac OS 9, - macOS, Maemo, Mbed, Meego, Micrium, MINIX, Minoca, Moblin, MorphOS, - MPE/iX, MS-DOS, NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo 3DS, - Nintendo Switch, NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, - OS21, PikeOS, Plan 9, PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, - RISC OS, ROS, RTEMS, Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, - SmartOS, Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, - tvOS, ucLinux, Ultrix, UNICOS, UnixWare, visionOS, VMS, vxWorks, watchOS, - Wear OS, WebOS, Wii System Software, Wii U, Windows, Windows CE, - Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr +## 109 Operating Systems + + AIX, AmigaOS, Android, ArcaOS, Aros, Atari FreeMiNT, Azure Sphere, BeOS, + Blackberry 10, Blackberry Tablet OS, Cell OS, Cesium, CheriBSD, Chrome OS, + Cisco IOS, DG/UX, DR DOS, Dragonfly BSD, eCOS, FreeBSD, FreeDOS, FreeRTOS, + Fuchsia, Garmin OS, Genode, Haiku, HardenedBSD, HP-UX, Hurd, IBM I, + illumos, Integrity, iOS, ipadOS, IRIX, KasperskyOS, Linux, Lua RTOS, + Mac OS 9, macOS, Maemo, Mbed, Meego, Micrium, MINIX, Minoca, Moblin, + MorphOS, MPE/iX, MS-DOS, NCR MP-RAS, NetBSD, Netware, NextStep, + Nintendo 3DS, Nintendo Switch, NonStop OS, NuttX, OpenBSD, OpenStep, + Orbis OS, OS/2, OS21, PikeOS, Plan 9, PlayStation Portable, QNX, Qubes OS, + ReactOS, Redox, RISC OS, ROS, RTEMS, Sailfish OS, SCO Unix, Serenity, + SINIX-Z, SkyOS, SmartOS, Solaris, Sortix, SunOS, Syllable OS, Symbian, + Tizen, TPF, Tru64, tvOS, ucLinux, Ultrix, UNICOS, UnixWare, visionOS, VMS, + vxWorks, watchOS, Wear OS, WebOS, Wii System Software, Wii U, Windows, + Windows CE, Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr ## 28 CPU Architectures From 1876ed6296c8b07ad82310e4838f6036b2421315 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 19 Oct 2025 11:38:30 +0200 Subject: [PATCH 067/885] cf-socket: make set_local_ip void, and remove failf() No callers of this function checked the return code, meaning failures are not lethal == using failf was wrong, and it can just as well return void. Closes #19137 --- lib/cf-socket.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 40df786bafa4..4a6bdb62445e 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1042,10 +1042,12 @@ static void cf_socket_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) cf->ctx = NULL; } -static CURLcode set_local_ip(struct Curl_cfilter *cf, - struct Curl_easy *data) +static void set_local_ip(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct cf_socket_ctx *ctx = cf->ctx; + ctx->ip.local_ip[0] = 0; + ctx->ip.local_port = -1; #ifdef HAVE_GETSOCKNAME if((ctx->sock != CURL_SOCKET_BAD) && @@ -1059,23 +1061,18 @@ static CURLcode set_local_ip(struct Curl_cfilter *cf, memset(&ssloc, 0, sizeof(ssloc)); if(getsockname(ctx->sock, (struct sockaddr*) &ssloc, &slen)) { int error = SOCKERRNO; - failf(data, "getsockname() failed with errno %d: %s", + infof(data, "getsockname() failed with errno %d: %s", error, curlx_strerror(error, buffer, sizeof(buffer))); - return CURLE_FAILED_INIT; } - if(!Curl_addr2string((struct sockaddr*)&ssloc, slen, - ctx->ip.local_ip, &ctx->ip.local_port)) { - failf(data, "ssloc inet_ntop() failed with errno %d: %s", + else if(!Curl_addr2string((struct sockaddr*)&ssloc, slen, + ctx->ip.local_ip, &ctx->ip.local_port)) { + infof(data, "ssloc inet_ntop() failed with errno %d: %s", errno, curlx_strerror(errno, buffer, sizeof(buffer))); - return CURLE_FAILED_INIT; } } #else (void)data; - ctx->ip.local_ip[0] = 0; - ctx->ip.local_port = -1; #endif - return CURLE_OK; } static CURLcode set_remote_ip(struct Curl_cfilter *cf, From 97dd1da8d014964cebf50a13b0454453a2bfd651 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 12:57:51 +0200 Subject: [PATCH 068/885] Makefile.example: bump default example from FTP to HTTPS To have a chance to work out of the box, securely. (assuming a TLS backend with CA certs setup.) Closes #19160 --- docs/examples/Makefile.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/Makefile.example b/docs/examples/Makefile.example index fbbca8a9a9c0..632c78dd13a7 100644 --- a/docs/examples/Makefile.example +++ b/docs/examples/Makefile.example @@ -22,7 +22,7 @@ # ########################################################################### -SRC ?= ftpget.c +SRC ?= https.c # What to call the final executable TARGET ?= example From a041bf6ca2339ad273a8057aa3bc6605c6706fc5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 13:23:34 +0200 Subject: [PATCH 069/885] Makefile.example: make default options more likely to work - replace default libpaths with more common ones. - drop Solaris network libs. Closes #19161 --- docs/examples/Makefile.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/Makefile.example b/docs/examples/Makefile.example index 632c78dd13a7..4031aa2e4366 100644 --- a/docs/examples/Makefile.example +++ b/docs/examples/Makefile.example @@ -36,12 +36,12 @@ CFLAGS ?= -g # This should point to a directory that holds libcurl, if it is not in the # system's standard lib dir # We also set a -L to include the directory where we have the OpenSSL libraries -LDFLAGS ?= -L/home/dast/lib -L/usr/local/ssl/lib +LDFLAGS ?= -L/usr/lib -L/usr/local/lib # We need -lsocket and -lnsl when on Solaris # We need -lssl and -lcrypto when using libcurl with TLS support # We need -lpthread for the pthread example -LIBS ?= -lsocket -lnsl -lssl -lcrypto +LIBS ?= -lssl -lcrypto # We need -lcurl for the curl stuff LIBS := -lcurl $(LIBS) From ccec2fae1bb4a41c5215b59dfdd90583bc19a572 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 14:02:06 +0200 Subject: [PATCH 070/885] GHA/curl-for-win: drop libssh Switch back to default libssh2. The distribution server has reliability issues (this time it works locally though): ``` ++ curl [...] --output pkg.bin https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz --output pkg.sig https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz.asc curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) [4x] ``` Ref: https://github.com/curl/curl/actions/runs/18651134321/job/53169147048#step:3:2391 There is also no official mirror that I know of. Ref: af8e1aa4b06e9dc78a559b485348e5464bd5cff5 #18257 Closes #19162 --- .github/workflows/curl-for-win.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/curl-for-win.yml b/.github/workflows/curl-for-win.yml index 08738857872a..a068f773d58d 100644 --- a/.github/workflows/curl-for-win.yml +++ b/.github/workflows/curl-for-win.yml @@ -172,8 +172,8 @@ jobs: "${OCI_IMAGE_DEBIAN}" \ sh -c ./_ci-linux-debian.sh - win-gcc-libssh-zlibold-x64: - name: 'Windows gcc libssh zlib-classic (x64)' + win-gcc-zlibold-x64: + name: 'Windows gcc zlib-classic (x64)' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -186,7 +186,7 @@ jobs: run: | git clone --depth 1 https://github.com/curl/curl-for-win mv curl-for-win/* . - export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-libssh1-zlibold' + export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-zlibold' export CW_REVISION="${GITHUB_SHA}" . ./_versions.sh sudo podman image trust set --type reject default From e7818999dbeff5acb00c032860d2259a1c5f9c5b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 10 Oct 2025 17:44:25 +0200 Subject: [PATCH 071/885] socks_gssapi: replace `gss_release_buffer()` with curl free for buffers owned by libcurl Before this patch, this code used to call `gss_release_buffer()` on objects with buffers allocated via curl's allocator. `gss_release_buffer()` calls system (or Win32) free on these buffers, which may mismatch with curl's allocator. To fix it, align these calls with the pattern used in vauth modules, by replacing `gss_release_buffer()` with curl free to release the buffers. Use `Curl_safefree()` to set the freed pointer to NULL, as `gss_release_buffer()` did. Also: use object length var when allocating. Reported-by: Joshua Rogers Closes #19018 --- lib/socks_gssapi.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 5ad93441a830..9b0b31792bc1 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -166,7 +166,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, GSS_C_NT_HOSTBASED_SERVICE, &server); } - gss_release_buffer(&gss_status, &service); /* clear allocated memory */ + Curl_safefree(service.value); if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_import_name()")) { @@ -192,7 +192,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, &gss_ret_flags); if(gss_token != GSS_C_NO_BUFFER) - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_init_sec_context") || /* the size needs to fit in a 16 bit field */ @@ -276,7 +276,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = ntohs(us_length); gss_recv_token.length = us_length; - gss_recv_token.value = malloc(us_length); + gss_recv_token.value = malloc(gss_recv_token.length); if(!gss_recv_token.value) { failf(data, "Could not allocate memory for GSS-API authentication " @@ -292,7 +292,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(result || (actualread != us_length)) { failf(data, "Failed to receive GSS-API authentication token."); gss_release_name(&gss_status, &server); - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } @@ -391,7 +391,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } else { gss_send_token.length = 1; - gss_send_token.value = Curl_memdup(&gss_enc, 1); + gss_send_token.value = Curl_memdup(&gss_enc, gss_send_token.length); if(!gss_send_token.value) { Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_OUT_OF_MEMORY; @@ -402,13 +402,13 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, &gss_conf_state, &gss_w_token); if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_wrap")) { - gss_release_buffer(&gss_status, &gss_send_token); + Curl_safefree(gss_send_token.value); gss_release_buffer(&gss_status, &gss_w_token); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to wrap GSS-API encryption value into token."); return CURLE_COULDNT_CONNECT; } - gss_release_buffer(&gss_status, &gss_send_token); + Curl_safefree(gss_send_token.value); us_length = htons((unsigned short)gss_w_token.length); memcpy(socksreq + 2, &us_length, sizeof(short)); @@ -481,7 +481,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(result || (actualread != us_length)) { failf(data, "Failed to receive GSS-API encryption type."); - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } @@ -492,13 +492,13 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, 0, GSS_C_QOP_DEFAULT); if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_unwrap")) { - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); gss_release_buffer(&gss_status, &gss_w_token); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to unwrap GSS-API encryption value into token."); return CURLE_COULDNT_CONNECT; } - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); if(gss_w_token.length != 1) { failf(data, "Invalid GSS-API encryption response length (%zu).", @@ -515,13 +515,13 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(gss_recv_token.length != 1) { failf(data, "Invalid GSS-API encryption response length (%zu).", gss_recv_token.length); - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } memcpy(socksreq, gss_recv_token.value, gss_recv_token.length); - gss_release_buffer(&gss_status, &gss_recv_token); + Curl_safefree(gss_recv_token.value); } (void)curlx_nonblock(sock, TRUE); From 4be9db7bc8c7b604e9288f7deaec48f61bbc61e0 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 20 Oct 2025 12:17:31 +0200 Subject: [PATCH 072/885] http: accept duplicate location with same value When a server sends a Location: header repeat with the same location, ignore the repeats silently. Follow-up to 9596c4a2587a9e512ea46f Closes #19159 --- lib/http.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/http.c b/lib/http.c index 2d5da2e0e142..172a09166867 100644 --- a/lib/http.c +++ b/lib/http.c @@ -3270,37 +3270,37 @@ static CURLcode http_header_l(struct Curl_easy *data, char *location = Curl_copy_header_value(hd); if(!location) return CURLE_OUT_OF_MEMORY; - if(!*location) - /* ignore empty data */ + if(!*location || + (data->req.location && !strcmp(data->req.location, location))) { + /* ignore empty header, or exact repeat of a previous one */ free(location); + return CURLE_OK; + } else { - if(data->req.location && - strcmp(data->req.location, location)) { + /* has value and is not an exact repeat */ + if(data->req.location) { failf(data, "Multiple Location headers"); free(location); return CURLE_WEIRD_SERVER_REPLY; } - else { - free(data->req.location); - data->req.location = location; - - if((k->httpcode >= 300 && k->httpcode < 400) && - data->set.http_follow_mode) { - CURLcode result; - DEBUGASSERT(!data->req.newurl); - data->req.newurl = strdup(data->req.location); /* clone */ - if(!data->req.newurl) - return CURLE_OUT_OF_MEMORY; - - /* some cases of POST and PUT etc needs to rewind the data - stream at this point */ - result = http_perhapsrewind(data, conn); - if(result) - return result; - - /* mark the next request as a followed location: */ - data->state.this_is_a_follow = TRUE; - } + data->req.location = location; + + if((k->httpcode >= 300 && k->httpcode < 400) && + data->set.http_follow_mode) { + CURLcode result; + DEBUGASSERT(!data->req.newurl); + data->req.newurl = strdup(data->req.location); /* clone */ + if(!data->req.newurl) + return CURLE_OUT_OF_MEMORY; + + /* some cases of POST and PUT etc needs to rewind the data + stream at this point */ + result = http_perhapsrewind(data, conn); + if(result) + return result; + + /* mark the next request as a followed location: */ + data->state.this_is_a_follow = TRUE; } } } From dbff3eec456d86386be4cebb89cbe4dfc21a06b6 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 20 Oct 2025 11:51:20 +0200 Subject: [PATCH 073/885] cf-socket: give information when unable to open socket Give ERRNO explanation in a failf() when unable to open a socket. Helps in finding out what the issue preventing your curl to work really is. Just had a wrong ulimit after a sys update. Closes #19158 --- lib/cf-socket.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 4a6bdb62445e..92fe433a69b1 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -344,6 +344,8 @@ static CURLcode socket_open(struct Curl_easy *data, struct Curl_sockaddr_ex *addr, curl_socket_t *sockfd) { + char errbuf[STRERROR_LEN]; + DEBUGASSERT(data); DEBUGASSERT(data->conn); if(data->set.fopensocket) { @@ -367,13 +369,15 @@ static CURLcode socket_open(struct Curl_easy *data, *sockfd = CURL_SOCKET(addr->family, addr->socktype, addr->protocol); } - if(*sockfd == CURL_SOCKET_BAD) + if(*sockfd == CURL_SOCKET_BAD) { /* no socket, no connection */ + failf(data, "failed to open socket: %s", + curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf))); return CURLE_COULDNT_CONNECT; + } #ifdef HAVE_FCNTL if(fcntl(*sockfd, F_SETFD, FD_CLOEXEC) < 0) { - char errbuf[STRERROR_LEN]; failf(data, "fcntl set CLOEXEC: %s", curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf))); close(*sockfd); From 921ff012636c99f9f8bce946a29cb4d158621a20 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 21 Oct 2025 00:22:49 +0200 Subject: [PATCH 074/885] cmake: two minor tidy-ups - flatten an if tree. - fix a typo in comment. Closes #19171 --- CMake/PickyWarnings.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CMake/PickyWarnings.cmake b/CMake/PickyWarnings.cmake index bdd226e9246e..d46c878d46b4 100644 --- a/CMake/PickyWarnings.cmake +++ b/CMake/PickyWarnings.cmake @@ -29,12 +29,10 @@ set(_picky_nocheck "") # not to pass to feature checks if(CURL_WERROR) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) set(CMAKE_COMPILE_WARNING_AS_ERROR ON) - else() - if(MSVC) - list(APPEND _picky_nocheck "-WX") - else() # llvm/clang and gcc style options - list(APPEND _picky_nocheck "-Werror") - endif() + elseif(MSVC) + list(APPEND _picky_nocheck "-WX") + else() # llvm/clang and gcc-style options + list(APPEND _picky_nocheck "-Werror") endif() if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND From 1afdb65b554bf6ae601998965053efc0f1e82460 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 21 Oct 2025 00:11:00 +0200 Subject: [PATCH 075/885] INSTALL-CMAKE.md: fix descriptions for LDAP dependency options After introducing the local FindLDAP module, these options work the same way as with other dependencies. Follow-up to 49f2a23d509645d534cbb2e2ffbd6347fac6e59e #15273 Closes #19170 --- docs/INSTALL-CMAKE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index e5c6b0d375e6..1c5fee1b0d0f 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -405,9 +405,9 @@ Details via CMake - `CARES_LIBRARY`: Path to `cares` library. - `DL_LIBRARY`: Path to `dl` library. (for Rustls) - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment) -- `LDAP_LIBRARY`: Name or full path to `ldap` library. Default: `ldap` -- `LDAP_LBER_LIBRARY`: Name or full path to `lber` library. Default: `lber` -- `LDAP_INCLUDE_DIR`: Path to LDAP include directory. +- `LDAP_INCLUDE_DIR`: The LDAP include directory. +- `LDAP_LIBRARY`: Path to `ldap` library. +- `LDAP_LBER_LIBRARY`: Path to `lber` library. - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory. - `LIBGSASL_LIBRARY`: Path to `libgsasl` library. - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory. From b4f57c804573016ac7eb0a43e6af0f427a556571 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 21 Oct 2025 01:26:58 +0200 Subject: [PATCH 076/885] cmake: inline linter instructions To avoid it applying to all the rest of the script. Follow-up to b761eb5addb9e29b2ee0e5841633c09d1fd77704 #17576 Closes #19172 --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6aff6ce7cc4..cdd580ab598e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2013,9 +2013,8 @@ endif() # (= regenerate it). function(curl_transform_makefile_inc _input_file _output_file) file(READ ${_input_file} _makefile_inc_text) - # cmake-lint: disable=W0106 - string(REPLACE "$(top_srcdir)" "\${PROJECT_SOURCE_DIR}" _makefile_inc_text ${_makefile_inc_text}) - string(REPLACE "$(top_builddir)" "\${PROJECT_BINARY_DIR}" _makefile_inc_text ${_makefile_inc_text}) + string(REPLACE "$(top_srcdir)" "\${PROJECT_SOURCE_DIR}" _makefile_inc_text ${_makefile_inc_text}) # cmake-lint: disable=W0106 + string(REPLACE "$(top_builddir)" "\${PROJECT_BINARY_DIR}" _makefile_inc_text ${_makefile_inc_text}) # cmake-lint: disable=W0106 string(REGEX REPLACE "\\\\\n" "!^!^!" _makefile_inc_text ${_makefile_inc_text}) string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "set(\\1 \\2)" _makefile_inc_text ${_makefile_inc_text}) From 9e198618dea14231488005b53c7800d4e80e2dce Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 22:46:56 +0200 Subject: [PATCH 077/885] tool_parsecfg: detect and error on recursive --config use The config file parser now has a maximum level of inclusions allowed (5) to detect and prevent recursive inclusions of itself leading to badness. Bonus: clean up return code handling from the config parser. Test 774 verifies Closes #19168 --- src/tool_getparam.c | 23 +++++++++++++++-------- src/tool_getparam.h | 5 +++-- src/tool_helpers.c | 2 -- src/tool_operate.c | 2 +- src/tool_parsecfg.c | 37 ++++++++++++++++++++++--------------- src/tool_parsecfg.h | 4 +++- tests/data/Makefile.am | 2 +- tests/data/test2080 | 2 +- tests/data/test462 | 2 +- tests/data/test774 | 25 +++++++++++++++++++++++++ 10 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 tests/data/test774 diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 0cff5b558d9b..5624d3cd761d 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -2167,7 +2167,8 @@ static ParameterError opt_bool(struct OperationConfig *config, /* opt_file handles file options */ static ParameterError opt_file(struct OperationConfig *config, const struct LongShort *a, - const char *nextarg) + const char *nextarg, + int max_recursive) { ParameterError err = PARAM_OK; if((nextarg[0] == '-') && nextarg[1]) { @@ -2189,9 +2190,13 @@ static ParameterError opt_file(struct OperationConfig *config, GetFileAndPassword(nextarg, &config->cert, &config->key_passwd); break; case C_CONFIG: /* --config */ - if(parseconfig(nextarg)) { - errorf("cannot read config from '%s'", nextarg); - err = PARAM_READ_ERROR; + if(--max_recursive < 0) { + errorf("Max config file recursion level reached (%u)", + CONFIG_MAX_LEVELS); + err = PARAM_BAD_USE; + } + else { + err = parseconfig(nextarg, max_recursive); } break; case C_CRLFILE: /* --crlfile */ @@ -2831,7 +2836,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ const char *nextarg, /* NULL if unset */ bool *usedarg, /* set to TRUE if the arg has been used */ - struct OperationConfig *config) + struct OperationConfig *config, + int max_recursive) { const char *parse = NULL; bool longopt = FALSE; @@ -2962,7 +2968,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ "Maybe ASCII was intended?", nextarg); } if(ARGTYPE(a->desc) == ARG_FILE) - err = opt_file(config, a, nextarg); + err = opt_file(config, a, nextarg, max_recursive); else /* if(ARGTYPE(a->desc) == ARG_STRG) */ err = opt_string(config, a, nextarg); if(a->desc & ARG_CLEAR) @@ -3020,7 +3026,8 @@ ParameterError parse_args(int argc, argv_item_t argv[]) } } - result = getparameter(orig_opt, nextarg, &passarg, config); + result = getparameter(orig_opt, nextarg, &passarg, config, + CONFIG_MAX_LEVELS); unicodefree(nextarg); config = global->last; @@ -3056,7 +3063,7 @@ ParameterError parse_args(int argc, argv_item_t argv[]) bool used; /* Just add the URL please */ - result = getparameter("--url", orig_opt, &used, config); + result = getparameter("--url", orig_opt, &used, config, 0); } if(!result) { diff --git a/src/tool_getparam.h b/src/tool_getparam.h index 6b97b9c11f45..6b37cc50ebe7 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -335,7 +335,6 @@ struct LongShort { typedef enum { PARAM_OK = 0, - PARAM_OPTION_AMBIGUOUS, PARAM_OPTION_UNKNOWN, PARAM_REQUIRES_PARAMETER, PARAM_BAD_USE, @@ -358,6 +357,7 @@ typedef enum { PARAM_EXPAND_ERROR, /* --expand problem */ PARAM_BLANK_STRING, PARAM_VAR_SYNTAX, /* --variable syntax error */ + PARAM_RECURSION, PARAM_LAST } ParameterError; @@ -368,7 +368,8 @@ const struct LongShort *findshortopt(char letter); ParameterError getparameter(const char *flag, const char *nextarg, bool *usedarg, - struct OperationConfig *config); + struct OperationConfig *config, + int max_recursive); #ifdef UNITTESTS void parse_cert_parameter(const char *cert_parameter, diff --git a/src/tool_helpers.c b/src/tool_helpers.c index fbf3f1c932e0..b36bd4af1d87 100644 --- a/src/tool_helpers.c +++ b/src/tool_helpers.c @@ -40,8 +40,6 @@ const char *param2text(ParameterError error) return "had unsupported trailing garbage"; case PARAM_OPTION_UNKNOWN: return "is unknown"; - case PARAM_OPTION_AMBIGUOUS: - return "is ambiguous"; case PARAM_REQUIRES_PARAMETER: return "requires parameter"; case PARAM_BAD_USE: diff --git a/src/tool_operate.c b/src/tool_operate.c index 0c03114d4072..1c003517297e 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2221,7 +2221,7 @@ CURLcode operate(int argc, argv_item_t argv[]) if((argc == 1) || (first_arg && strncmp(first_arg, "-q", 2) && strcmp(first_arg, "--disable"))) { - parseconfig(NULL); /* ignore possible failure */ + parseconfig(NULL, CONFIG_MAX_LEVELS); /* ignore possible failure */ /* If we had no arguments then make sure a url was specified in .curlrc */ if((argc < 2) && (!global->first->url_list)) { diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 5cf3527ce2a5..03f9930c5d8c 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -81,11 +81,11 @@ static int unslashquote(const char *line, struct dynbuf *param) #define MAX_CONFIG_LINE_LENGTH (10*1024*1024) /* return 0 on everything-is-fine, and non-zero otherwise */ -int parseconfig(const char *filename) +ParameterError parseconfig(const char *filename, int max_recursive) { FILE *file = NULL; bool usedarg = FALSE; - int rc = 0; + ParameterError err = PARAM_OK; struct OperationConfig *config = global->last; char *pathalloc = NULL; @@ -96,7 +96,7 @@ int parseconfig(const char *filename) file = curlx_fopen(curlrc, FOPEN_READTEXT); if(!file) { free(curlrc); - return 1; + return PARAM_READ_ERROR; } filename = pathalloc = curlrc; } @@ -133,12 +133,12 @@ int parseconfig(const char *filename) curlx_dyn_init(&pbuf, MAX_CONFIG_LINE_LENGTH); DEBUGASSERT(filename); - while(!rc && my_get_line(file, &buf, &fileerror)) { + while(!err && my_get_line(file, &buf, &fileerror)) { ParameterError res; lineno++; line = curlx_dyn_ptr(&buf); if(!line) { - rc = 1; /* out of memory */ + err = PARAM_NO_MEM; /* out of memory */ break; } @@ -166,9 +166,11 @@ int parseconfig(const char *filename) /* the parameter starts here (unless quoted) */ if(*line == '\"') { /* quoted parameter, do the quote dance */ - rc = unslashquote(++line, &pbuf); - if(rc) + int rc = unslashquote(++line, &pbuf); + if(rc) { + err = PARAM_BAD_USE; break; + } param = curlx_dyn_len(&pbuf) ? curlx_dyn_ptr(&pbuf) : CURL_UNCONST(""); } else { @@ -206,7 +208,7 @@ int parseconfig(const char *filename) #ifdef DEBUG_CONFIG curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n",(param ? param : "(null)")); #endif - res = getparameter(option, param, &usedarg, config); + res = getparameter(option, param, &usedarg, config, max_recursive); config = global->last; if(!res && param && *param && !usedarg) @@ -240,10 +242,12 @@ int parseconfig(const char *filename) res != PARAM_VERSION_INFO_REQUESTED && res != PARAM_ENGINES_REQUESTED && res != PARAM_CA_EMBED_REQUESTED) { - const char *reason = param2text(res); - errorf("%s:%d: '%s' %s", - filename, lineno, option, reason); - rc = (int)res; + /* only show error in the first level config call */ + if(max_recursive == CONFIG_MAX_LEVELS) { + const char *reason = param2text(res); + errorf("%s:%d: '%s' %s", filename, lineno, option, reason); + } + err = res; } } } @@ -252,13 +256,16 @@ int parseconfig(const char *filename) if(file != stdin) curlx_fclose(file); if(fileerror) - rc = 1; + err = PARAM_READ_ERROR; } else - rc = 1; /* could not open the file */ + err = PARAM_READ_ERROR; /* could not open the file */ + + if((err == PARAM_READ_ERROR) && filename) + errorf("cannot read config from '%s'", filename); free(pathalloc); - return rc; + return err; } diff --git a/src/tool_parsecfg.h b/src/tool_parsecfg.h index 46977d8eddc9..3aad9bdd9cbd 100644 --- a/src/tool_parsecfg.h +++ b/src/tool_parsecfg.h @@ -25,7 +25,9 @@ ***************************************************************************/ #include "tool_setup.h" -int parseconfig(const char *filename); +/* only allow this many levels of recursive --config use */ +#define CONFIG_MAX_LEVELS 5 +ParameterError parseconfig(const char *filename, int max_recursive); bool my_get_line(FILE *fp, struct dynbuf *db, bool *error); #endif /* HEADER_CURL_TOOL_PARSECFG_H */ diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 9984e92839f8..21d20151d375 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -110,7 +110,7 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \ test745 test746 test747 test748 test749 test750 test751 test752 test753 \ test754 test755 test756 test757 test758 test759 test760 test761 test762 \ test763 test764 test765 test766 test767 test768 test769 test770 test771 \ -test772 test773 \ +test772 test773 test774 \ test780 test781 test782 test783 test784 test785 test786 test787 test788 \ test789 test790 test791 test792 test793 test794 test796 test797 \ \ diff --git a/tests/data/test2080 b/tests/data/test2080 index d49bd5c453cc..44d16b6ee331 100644 --- a/tests/data/test2080 +++ b/tests/data/test2080 @@ -30,7 +30,7 @@ config file with overly long option # the used option in the config file is too long -26 +2 diff --git a/tests/data/test462 b/tests/data/test462 index fdbce3b46210..3fbcae7313f3 100644 --- a/tests/data/test462 +++ b/tests/data/test462 @@ -30,7 +30,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd # Verify data after the test has been "shot" -26 +2 diff --git a/tests/data/test774 b/tests/data/test774 new file mode 100644 index 000000000000..758ad0de8d6a --- /dev/null +++ b/tests/data/test774 @@ -0,0 +1,25 @@ + + + +--config + + + + + +config file recursively including itself + + +--config %LOGDIR/cmd + + +http://%HOSTIP:%HTTPPORT/ -K %LOGDIR/cmd + + + + + +2 + + + From 1966c86d71eb90beeeb3ccbefd6321bd64992553 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 15:51:39 +0200 Subject: [PATCH 078/885] cmake: add and use local FindGnuTLS module Replacing a combination of custom logic in the main script and relying on CMake's built-in Find module, with code and behavior used for the rest of dependencies. Also to: - add version detection in the non-pkg-config path. - make `GNUTLS_INCLUDE_DIR` and `GNUTLS_LIBRARY` take precedence over pkg-config. As with other dependencies. - document the above two configuration options. - prepare for #16973, which originally introduced this local Find module. The local module is doing largely the same as CMake's built-in FindGnuTLS. Differences: - honors `CURL_USE_PKGCONFIG`. - returns GnuTLS version for non-pkg-config detection. - consistently returns `GNUTLS_VERSION`. (CMake's built-in uses s different name in <3.16.) - CMake 3.16+ returns an imported target. curl supports 3.7, therefore we may only use it conditionally, which isn't worth it. Cherry-picked from #16973 Closes #19163 --- CMake/FindGnuTLS.cmake | 83 ++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 30 +++++++-------- Makefile.am | 1 + docs/INSTALL-CMAKE.md | 2 + 4 files changed, 99 insertions(+), 17 deletions(-) create mode 100644 CMake/FindGnuTLS.cmake diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake new file mode 100644 index 000000000000..5b564fd9b224 --- /dev/null +++ b/CMake/FindGnuTLS.cmake @@ -0,0 +1,83 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### +# Find the GnuTLS library +# +# Input variables: +# +# - `GNUTLS_INCLUDE_DIR`: The GnuTLS include directory. +# - `GNUTLS_LIBRARY`: Path to `gnutls` library. +# +# Result variables: +# +# - `GNUTLS_FOUND`: System has GnuTLS. +# - `GNUTLS_INCLUDE_DIRS`: The GnuTLS include directories. +# - `GNUTLS_LIBRARIES`: The GnuTLS library names. +# - `GNUTLS_LIBRARY_DIRS`: The GnuTLS library directories. +# - `GNUTLS_PC_REQUIRES`: The GnuTLS pkg-config packages. +# - `GNUTLS_CFLAGS`: Required compiler flags. +# - `GNUTLS_VERSION`: Version of GnuTLS. + +set(GNUTLS_PC_REQUIRES "gnutls") + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED GNUTLS_INCLUDE_DIR AND + NOT DEFINED GNUTLS_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(GNUTLS ${GNUTLS_PC_REQUIRES}) +endif() + +if(GNUTLS_FOUND) + set(GnuTLS_FOUND TRUE) + string(REPLACE ";" " " GNUTLS_CFLAGS "${GNUTLS_CFLAGS}") + message(STATUS "Found GnuTLS (via pkg-config): ${GNUTLS_INCLUDE_DIRS} (found version \"${GNUTLS_VERSION}\")") +else() + find_path(GNUTLS_INCLUDE_DIR NAMES "gnutls/gnutls.h") + find_library(GNUTLS_LIBRARY NAMES "gnutls" "libgnutls") + + unset(GNUTLS_VERSION CACHE) + if(GNUTLS_INCLUDE_DIR AND EXISTS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h") + set(_version_regex "#[\t ]*define[\t ]+GNUTLS_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(GNUTLS_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(GnuTLS + REQUIRED_VARS + GNUTLS_INCLUDE_DIR + GNUTLS_LIBRARY + VERSION_VAR + GNUTLS_VERSION + ) + + if(GNUTLS_FOUND) + set(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR}) + set(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY}) + endif() + + mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY) +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index cdd580ab598e..2986902c02aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -890,27 +890,23 @@ if(CURL_USE_WOLFSSL) endif() if(CURL_USE_GNUTLS) - if(CURL_USE_PKGCONFIG) - find_package(PkgConfig QUIET) - pkg_check_modules(GNUTLS "gnutls") - if(GNUTLS_FOUND) - set(GNUTLS_LIBRARIES ${GNUTLS_LINK_LIBRARIES}) - string(REPLACE ";" " " GNUTLS_CFLAGS "${GNUTLS_CFLAGS}") - if(GNUTLS_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${GNUTLS_CFLAGS}") - endif() - endif() - endif() - if(NOT GNUTLS_FOUND) - find_package(GnuTLS REQUIRED) + find_package(GnuTLS REQUIRED) + list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${GNUTLS_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${GNUTLS_PC_REQUIRES}) + include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS}) + link_directories(${GNUTLS_LIBRARY_DIRS}) + if(GNUTLS_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${GNUTLS_CFLAGS}") endif() + find_package(Nettle REQUIRED) set(_ssl_enabled ON) set(USE_GNUTLS ON) - list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${GNUTLS_LIBRARY_DIRS} ${NETTLE_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gnutls" ${NETTLE_PC_REQUIRES}) - include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS} ${NETTLE_INCLUDE_DIRS}) + list(APPEND CURL_LIBS ${NETTLE_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${NETTLE_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NETTLE_PC_REQUIRES}) + include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS}) link_directories(${NETTLE_LIBRARY_DIRS}) if(NETTLE_CFLAGS) string(APPEND CMAKE_C_FLAGS " ${NETTLE_CFLAGS}") diff --git a/Makefile.am b/Makefile.am index 76873854160c..7b2f05f92e56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,6 +34,7 @@ CMAKE_DIST = \ CMake/CurlTests.c \ CMake/FindBrotli.cmake \ CMake/FindCares.cmake \ + CMake/FindGnuTLS.cmake \ CMake/FindGSS.cmake \ CMake/FindLDAP.cmake \ CMake/FindLibgsasl.cmake \ diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index 1c5fee1b0d0f..a2a73050b0c2 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -404,6 +404,8 @@ Details via CMake - `CARES_INCLUDE_DIR`: The c-ares include directory. - `CARES_LIBRARY`: Path to `cares` library. - `DL_LIBRARY`: Path to `dl` library. (for Rustls) +- `GNUTLS_INCLUDE_DIR`: The GnuTLS include directory. +- `GNUTLS_LIBRARY`: Path to `gnutls` library. - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment) - `LDAP_INCLUDE_DIR`: The LDAP include directory. - `LDAP_LIBRARY`: Path to `ldap` library. From 38c19edd67e705066379530bdc28ea6c25aba8df Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 23:11:53 +0200 Subject: [PATCH 079/885] cmake: say 'absolute path' in option descriptions and docs To not have to guess. Also to sync with autotools, which already uses this wording. Also: - replace the stray term 'folder' with 'directory' for consistency. - store help text in a temp variable to avoid overly long strings (mandatory in CMake <4.2.0 and can't be trivially split), also to avoid repeating this string 4 times. Ref: https://cmake.org/cmake/help/v4.2/command/set.html Closes #19169 --- CMake/FindBrotli.cmake | 6 +- CMake/FindCares.cmake | 4 +- CMake/FindGSS.cmake | 4 +- CMake/FindGnuTLS.cmake | 4 +- CMake/FindLDAP.cmake | 6 +- CMake/FindLibgsasl.cmake | 4 +- CMake/FindLibidn2.cmake | 4 +- CMake/FindLibpsl.cmake | 4 +- CMake/FindLibrtmp.cmake | 4 +- CMake/FindLibssh.cmake | 4 +- CMake/FindLibssh2.cmake | 4 +- CMake/FindLibuv.cmake | 4 +- CMake/FindMbedTLS.cmake | 8 +-- CMake/FindNGHTTP2.cmake | 4 +- CMake/FindNGHTTP3.cmake | 4 +- CMake/FindNGTCP2.cmake | 16 ++--- CMake/FindNettle.cmake | 4 +- CMake/FindQuiche.cmake | 4 +- CMake/FindRustls.cmake | 4 +- CMake/FindWolfSSL.cmake | 4 +- CMake/FindZstd.cmake | 4 +- CMakeLists.txt | 18 +++--- docs/INSTALL-CMAKE.md | 134 +++++++++++++++++++-------------------- 23 files changed, 129 insertions(+), 127 deletions(-) diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake index 690b5a9c27ce..c129a76567c5 100644 --- a/CMake/FindBrotli.cmake +++ b/CMake/FindBrotli.cmake @@ -25,9 +25,9 @@ # # Input variables: # -# - `BROTLI_INCLUDE_DIR`: The brotli include directory. -# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library. -# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library. +# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory. +# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library. +# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library. # # Result variables: # diff --git a/CMake/FindCares.cmake b/CMake/FindCares.cmake index cc47e2d33103..ae2db52d85aa 100644 --- a/CMake/FindCares.cmake +++ b/CMake/FindCares.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `CARES_INCLUDE_DIR`: The c-ares include directory. -# - `CARES_LIBRARY`: Path to `cares` library. +# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory. +# - `CARES_LIBRARY`: Absolute path to `cares` library. # # Result variables: # diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake index 1661f208d2f8..89545aa74134 100644 --- a/CMake/FindGSS.cmake +++ b/CMake/FindGSS.cmake @@ -25,7 +25,7 @@ # # Input variables: # -# - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment) +# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment) # # Result variables: # @@ -253,7 +253,7 @@ find_package_handle_standard_args(GSS VERSION_VAR GSS_VERSION FAIL_MESSAGE - "Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR" + "Could NOT find GSS, try to set the absolute path to GSS installation root directory in the environment variable GSS_ROOT_DIR" ) mark_as_advanced( diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake index 5b564fd9b224..4de4f82eee38 100644 --- a/CMake/FindGnuTLS.cmake +++ b/CMake/FindGnuTLS.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `GNUTLS_INCLUDE_DIR`: The GnuTLS include directory. -# - `GNUTLS_LIBRARY`: Path to `gnutls` library. +# - `GNUTLS_INCLUDE_DIR`: Absolute path to GnuTLS include directory. +# - `GNUTLS_LIBRARY`: Absolute path to `gnutls` library. # # Result variables: # diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake index fdc6d7be943d..36ff08e397d8 100644 --- a/CMake/FindLDAP.cmake +++ b/CMake/FindLDAP.cmake @@ -25,9 +25,9 @@ # # Input variables: # -# - `LDAP_INCLUDE_DIR`: The ldap include directory. -# - `LDAP_LIBRARY`: Path to `ldap` library. -# - `LDAP_LBER_LIBRARY`: Path to `lber` library. +# - `LDAP_INCLUDE_DIR`: Absolute path to ldap include directory. +# - `LDAP_LIBRARY`: Absolute path to `ldap` library. +# - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library. # # Result variables: # diff --git a/CMake/FindLibgsasl.cmake b/CMake/FindLibgsasl.cmake index 878d651883da..e584f75371c0 100644 --- a/CMake/FindLibgsasl.cmake +++ b/CMake/FindLibgsasl.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory. -# - `LIBGSASL_LIBRARY`: Path to `libgsasl` library. +# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory. +# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library. # # Result variables: # diff --git a/CMake/FindLibidn2.cmake b/CMake/FindLibidn2.cmake index f8f00f0c7913..9112428f37dc 100644 --- a/CMake/FindLibidn2.cmake +++ b/CMake/FindLibidn2.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory. -# - `LIBIDN2_LIBRARY`: Path to `libidn2` library. +# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory. +# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library. # # Result variables: # diff --git a/CMake/FindLibpsl.cmake b/CMake/FindLibpsl.cmake index d6fde4b2d03c..13740fa9b3fa 100644 --- a/CMake/FindLibpsl.cmake +++ b/CMake/FindLibpsl.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBPSL_INCLUDE_DIR`: The libpsl include directory. -# - `LIBPSL_LIBRARY`: Path to `libpsl` library. +# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory. +# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library. # # Result variables: # diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake index 50fc9692bd24..be975794b773 100644 --- a/CMake/FindLibrtmp.cmake +++ b/CMake/FindLibrtmp.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBRTMP_INCLUDE_DIR`: The librtmp include directory. -# - `LIBRTMP_LIBRARY`: Path to `librtmp` library. +# - `LIBRTMP_INCLUDE_DIR`: Absolute path to librtmp include directory. +# - `LIBRTMP_LIBRARY`: Absolute path to `librtmp` library. # # Result variables: # diff --git a/CMake/FindLibssh.cmake b/CMake/FindLibssh.cmake index e2b27d975c3b..cb895aa8d74b 100644 --- a/CMake/FindLibssh.cmake +++ b/CMake/FindLibssh.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBSSH_INCLUDE_DIR`: The libssh include directory. -# - `LIBSSH_LIBRARY`: Path to libssh library. +# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory. +# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library. # # Result variables: # diff --git a/CMake/FindLibssh2.cmake b/CMake/FindLibssh2.cmake index 0b81ecb3cfcb..08415533e0db 100644 --- a/CMake/FindLibssh2.cmake +++ b/CMake/FindLibssh2.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory. -# - `LIBSSH2_LIBRARY`: Path to `libssh2` library. +# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory. +# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library. # # Result variables: # diff --git a/CMake/FindLibuv.cmake b/CMake/FindLibuv.cmake index b16b3554f651..2565ba3a386a 100644 --- a/CMake/FindLibuv.cmake +++ b/CMake/FindLibuv.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `LIBUV_INCLUDE_DIR`: The libuv include directory. -# - `LIBUV_LIBRARY`: Path to `libuv` library. +# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory. +# - `LIBUV_LIBRARY`: Absolute path to `libuv` library. # # Result variables: # diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake index 4b5a6121f193..e1bee7dc4c1b 100644 --- a/CMake/FindMbedTLS.cmake +++ b/CMake/FindMbedTLS.cmake @@ -25,10 +25,10 @@ # # Input variables: # -# - `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory. -# - `MBEDTLS_LIBRARY`: Path to `mbedtls` library. -# - `MBEDX509_LIBRARY`: Path to `mbedx509` library. -# - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library. +# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory. +# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library. +# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library. +# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library. # # Result variables: # diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake index b8f37fdaebf1..1ccf64158915 100644 --- a/CMake/FindNGHTTP2.cmake +++ b/CMake/FindNGHTTP2.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory. -# - `NGHTTP2_LIBRARY`: Path to `nghttp2` library. +# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory. +# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library. # # Result variables: # diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake index 99edd19955ed..fba2c5779b36 100644 --- a/CMake/FindNGHTTP3.cmake +++ b/CMake/FindNGHTTP3.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory. -# - `NGHTTP3_LIBRARY`: Path to `nghttp3` library. +# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory. +# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library. # # Result variables: # diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake index eb4358ef00a7..d3d383521328 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake @@ -35,14 +35,14 @@ # # Input variables: # -# - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory. -# - `NGTCP2_LIBRARY`: Path to `ngtcp2` library. -# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library. -# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library. -# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Path to `ngtcp2_crypto_libressl` library. -# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library. -# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library. -# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library. +# - `NGTCP2_INCLUDE_DIR`: Absolute path to ngtcp2 include directory. +# - `NGTCP2_LIBRARY`: Absolute path to `ngtcp2` library. +# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_boringssl` library. +# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_gnutls` library. +# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Absolute path to `ngtcp2_crypto_libressl` library. +# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_ossl` library. +# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library. +# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library. # # Result variables: # diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake index c2decf6e7b08..7f2f69c1ca3e 100644 --- a/CMake/FindNettle.cmake +++ b/CMake/FindNettle.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `NETTLE_INCLUDE_DIR`: The nettle include directory. -# - `NETTLE_LIBRARY`: Path to `nettle` library. +# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory. +# - `NETTLE_LIBRARY`: Absolute path to `nettle` library. # # Result variables: # diff --git a/CMake/FindQuiche.cmake b/CMake/FindQuiche.cmake index 6939c64e0ff9..934cf9f69f15 100644 --- a/CMake/FindQuiche.cmake +++ b/CMake/FindQuiche.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `QUICHE_INCLUDE_DIR`: The quiche include directory. -# - `QUICHE_LIBRARY`: Path to `quiche` library. +# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory. +# - `QUICHE_LIBRARY`: Absolute path to `quiche` library. # # Result variables: # diff --git a/CMake/FindRustls.cmake b/CMake/FindRustls.cmake index 564b08ce15bc..a29ce5fa098b 100644 --- a/CMake/FindRustls.cmake +++ b/CMake/FindRustls.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `RUSTLS_INCLUDE_DIR`: The Rustls include directory. -# - `RUSTLS_LIBRARY`: Path to `rustls` library. +# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory. +# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library. # # Result variables: # diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake index 87b640a1f23d..4d172c029a39 100644 --- a/CMake/FindWolfSSL.cmake +++ b/CMake/FindWolfSSL.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory. -# - `WOLFSSL_LIBRARY`: Path to `wolfssl` library. +# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory. +# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library. # # Result variables: # diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake index 0ea1fef46724..655f0cc700a8 100644 --- a/CMake/FindZstd.cmake +++ b/CMake/FindZstd.cmake @@ -25,8 +25,8 @@ # # Input variables: # -# - `ZSTD_INCLUDE_DIR`: The zstd include directory. -# - `ZSTD_LIBRARY`: Path to `zstd` library. +# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory. +# - `ZSTD_LIBRARY`: Absolute path to `zstd` library. # # Result variables: # diff --git a/CMakeLists.txt b/CMakeLists.txt index 2986902c02aa..3a6a7314266e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -645,7 +645,7 @@ elseif(DOS) include_directories(SYSTEM "${WATT_ROOT}/inc") list(APPEND CMAKE_REQUIRED_INCLUDES "${WATT_ROOT}/inc") else() - message(FATAL_ERROR "Set WATT_ROOT variable to the root installation of Watt-32.") + message(FATAL_ERROR "Set WATT_ROOT variable to the absolute path to the root installation of Watt-32.") endif() elseif(AMIGA) if(AMISSL_INCLUDE_DIR AND AMISSL_STUBS_LIBRARY AND AMISSL_AUTO_LIBRARY) @@ -1498,14 +1498,16 @@ endif() # CA handling # if(_curl_ca_bundle_supported) + set(_ca_opt_desc "Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + set(CURL_CA_BUNDLE "auto" CACHE - STRING "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + STRING "Absolute path to the CA bundle. ${_ca_opt_desc}") set(CURL_CA_FALLBACK OFF CACHE BOOL "Use built-in CA store of OpenSSL. Defaults to OFF") set(CURL_CA_PATH "auto" CACHE - STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + STRING "Absolute path to a directory containing CA certificates stored individually. ${_ca_opt_desc}") set(CURL_CA_EMBED "" CACHE - STRING "Path to the CA bundle to embed in the curl tool.") + STRING "Absolute path to the CA bundle to embed in the curl tool.") if(CURL_CA_FALLBACK AND NOT CURL_USE_OPENSSL) message(FATAL_ERROR "CURL_CA_FALLBACK only works with OpenSSL.") @@ -1556,8 +1558,8 @@ if(_curl_ca_bundle_supported) if(EXISTS "${_search_ca_bundle_path}") message(STATUS "Found CA bundle: ${_search_ca_bundle_path}") set(CURL_CA_BUNDLE "${_search_ca_bundle_path}" CACHE - STRING "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") - set(CURL_CA_BUNDLE_SET TRUE CACHE BOOL "Path to the CA bundle has been set") + STRING "Absolute path to the CA bundle. ${_ca_opt_desc}") + set(CURL_CA_BUNDLE_SET TRUE CACHE BOOL "Absolute path to the CA bundle has been set") break() endif() endforeach() @@ -1570,8 +1572,8 @@ if(_curl_ca_bundle_supported) unset(_curl_ca_files_found) message(STATUS "Found CA path: ${_search_ca_path}") set(CURL_CA_PATH "${_search_ca_path}" CACHE - STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") - set(CURL_CA_PATH_SET TRUE CACHE BOOL "Path to the CA bundle has been set") + STRING "Absolute path to a directory containing CA certificates stored individually. ${_ca_opt_desc}") + set(CURL_CA_PATH_SET TRUE CACHE BOOL "Absolute path to the CA bundle has been set") endif() endif() endif() diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index a2a73050b0c2..996ba698d042 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -255,10 +255,10 @@ target_link_libraries(my_target PRIVATE CURL::libcurl) ## CA bundle options -- `CURL_CA_BUNDLE`: Path to the CA bundle. Set `none` to disable or `auto` for auto-detection. Default: `auto` -- `CURL_CA_EMBED`: Path to the CA bundle to embed in the curl tool. Default: (disabled) +- `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) - `CURL_CA_FALLBACK`: Use built-in CA store of OpenSSL. Default: `OFF` -- `CURL_CA_PATH`: Location of default CA path. Set `none` to disable or `auto` for auto-detection. Default: `auto` +- `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` ## Enabling features @@ -379,13 +379,13 @@ Details via CMake ## Dependency options (via CMake) -- `OPENSSL_ROOT_DIR`: Set this variable to the root installation of OpenSSL (and forks). -- `OPENSSL_INCLUDE_DIR`: The OpenSSL include directory. -- `OPENSSL_SSL_LIBRARY`: Path to `ssl` library. With MSVC, CMake uses variables `SSL_EAY_DEBUG`/`SSL_EAY_RELEASE` instead. -- `OPENSSL_CRYPTO_LIBRARY`: Path to `crypto` library. With MSVC, CMake uses variables `LIB_EAY_DEBUG`/`LIB_EAY_RELEASE` instead. +- `OPENSSL_ROOT_DIR`: Absolute path to the root installation of OpenSSL (and forks). +- `OPENSSL_INCLUDE_DIR`: Absolute path to OpenSSL include directory. +- `OPENSSL_SSL_LIBRARY`: Absolute path to `ssl` library. With MSVC, CMake uses variables `SSL_EAY_DEBUG`/`SSL_EAY_RELEASE` instead. +- `OPENSSL_CRYPTO_LIBRARY`: Absolute path to `crypto` library. With MSVC, CMake uses variables `LIB_EAY_DEBUG`/`LIB_EAY_RELEASE` instead. - `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries. -- `ZLIB_INCLUDE_DIR`: The zlib include directory. -- `ZLIB_LIBRARY`: Path to `zlib` library. +- `ZLIB_INCLUDE_DIR`: Absolute path to zlib include directory. +- `ZLIB_LIBRARY`: Absolute path to `zlib` library. - `ZLIB_USE_STATIC_LIBS`: Look for static ZLIB library (requires CMake v3.24). ## Dependency options (tools) @@ -395,64 +395,64 @@ Details via CMake ## Dependency options (libraries) -- `AMISSL_INCLUDE_DIR`: The AmiSSL include directory. -- `AMISSL_STUBS_LIBRARY`: Path to `amisslstubs` library. -- `AMISSL_AUTO_LIBRARY`: Path to `amisslauto` library. -- `BROTLI_INCLUDE_DIR`: The brotli include directory. -- `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library. -- `BROTLIDEC_LIBRARY`: Path to `brotlidec` library. -- `CARES_INCLUDE_DIR`: The c-ares include directory. -- `CARES_LIBRARY`: Path to `cares` library. -- `DL_LIBRARY`: Path to `dl` library. (for Rustls) -- `GNUTLS_INCLUDE_DIR`: The GnuTLS include directory. -- `GNUTLS_LIBRARY`: Path to `gnutls` library. -- `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment) -- `LDAP_INCLUDE_DIR`: The LDAP include directory. -- `LDAP_LIBRARY`: Path to `ldap` library. -- `LDAP_LBER_LIBRARY`: Path to `lber` library. -- `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory. -- `LIBGSASL_LIBRARY`: Path to `libgsasl` library. -- `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory. -- `LIBIDN2_LIBRARY`: Path to `libidn2` library. -- `LIBPSL_INCLUDE_DIR`: The libpsl include directory. -- `LIBPSL_LIBRARY`: Path to `libpsl` library. -- `LIBRTMP_INCLUDE_DIR`: The librtmp include directory. -- `LIBRTMP_LIBRARY`: Path to `librtmp` library. -- `LIBSSH_INCLUDE_DIR`: The libssh include directory. -- `LIBSSH_LIBRARY`: Path to `libssh` library. -- `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory. -- `LIBSSH2_LIBRARY`: Path to `libssh2` library. -- `LIBUV_INCLUDE_DIR`: The libuv include directory. -- `LIBUV_LIBRARY`: Path to `libuv` library. -- `MATH_LIBRARY`: Path to `m` library. (for Rustls, wolfSSL) -- `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory. -- `MBEDTLS_LIBRARY`: Path to `mbedtls` library. -- `MBEDX509_LIBRARY`: Path to `mbedx509` library. -- `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library. -- `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory. -- `NGHTTP2_LIBRARY`: Path to `nghttp2` library. -- `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory. -- `NGHTTP3_LIBRARY`: Path to `nghttp3` library. -- `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory. -- `NGTCP2_LIBRARY`: Path to `ngtcp2` library. -- `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library. (also for AWS-LC) -- `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library. -- `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Path to `ngtcp2_crypto_libressl` library. (requires ngtcp2 1.15.0+) -- `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library. -- `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library. (also for LibreSSL with ngtcp2 <1.15.0) -- `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library. -- `NETTLE_INCLUDE_DIR`: The nettle include directory. -- `NETTLE_LIBRARY`: Path to `nettle` library. -- `PTHREAD_LIBRARY`: Path to `pthread` library. (for Rustls) -- `QUICHE_INCLUDE_DIR`: The quiche include directory. -- `QUICHE_LIBRARY`: Path to `quiche` library. -- `RUSTLS_INCLUDE_DIR`: The Rustls include directory. -- `RUSTLS_LIBRARY`: Path to `rustls` library. -- `WATT_ROOT`: Set this variable to the root installation of Watt-32. -- `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory. -- `WOLFSSL_LIBRARY`: Path to `wolfssl` library. -- `ZSTD_INCLUDE_DIR`: The zstd include directory. -- `ZSTD_LIBRARY`: Path to `zstd` library. +- `AMISSL_INCLUDE_DIR`: Absolute path to AmiSSL include directory. +- `AMISSL_STUBS_LIBRARY`: Absolute path to `amisslstubs` library. +- `AMISSL_AUTO_LIBRARY`: Absolute path to `amisslauto` library. +- `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory. +- `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library. +- `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library. +- `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory. +- `CARES_LIBRARY`: Absolute path to `cares` library. +- `DL_LIBRARY`: Absolute path to `dl` library. (for Rustls) +- `GNUTLS_INCLUDE_DIR`: Absolute path to GnuTLS include directory. +- `GNUTLS_LIBRARY`: Absolute path to `gnutls` library. +- `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment) +- `LDAP_INCLUDE_DIR`: Absolute path to LDAP include directory. +- `LDAP_LIBRARY`: Absolute path to `ldap` library. +- `LDAP_LBER_LIBRARY`: Absolute path to `lber` library. +- `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory. +- `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library. +- `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory. +- `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library. +- `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory. +- `LIBPSL_LIBRARY`: Absolute path to `libpsl` library. +- `LIBRTMP_INCLUDE_DIR`: Absolute path to librtmp include directory. +- `LIBRTMP_LIBRARY`: Absolute path to `librtmp` library. +- `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory. +- `LIBSSH_LIBRARY`: Absolute path to `libssh` library. +- `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory. +- `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library. +- `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory. +- `LIBUV_LIBRARY`: Absolute path to `libuv` library. +- `MATH_LIBRARY`: Absolute path to `m` library. (for Rustls, wolfSSL) +- `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory. +- `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library. +- `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library. +- `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library. +- `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory. +- `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library. +- `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory. +- `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library. +- `NGTCP2_INCLUDE_DIR`: Absolute path to ngtcp2 include directory. +- `NGTCP2_LIBRARY`: Absolute path to `ngtcp2` library. +- `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_boringssl` library. (also for AWS-LC) +- `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_gnutls` library. +- `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Absolute path to `ngtcp2_crypto_libressl` library. (requires ngtcp2 1.15.0+) +- `NGTCP2_CRYPTO_OSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_ossl` library. +- `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library. (also for LibreSSL with ngtcp2 <1.15.0) +- `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library. +- `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory. +- `NETTLE_LIBRARY`: Absolute path to `nettle` library. +- `PTHREAD_LIBRARY`: Absolute path to `pthread` library. (for Rustls) +- `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory. +- `QUICHE_LIBRARY`: Absolute path to `quiche` library. +- `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory. +- `RUSTLS_LIBRARY`: Absolute path to `rustls` library. +- `WATT_ROOT`: Absolute path to the root installation of Watt-32. +- `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory. +- `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library. +- `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory. +- `ZSTD_LIBRARY`: Absolute path to `zstd` library. ## Test tools From 76d28525509c2c06786fc9b8d2e2e8536dceb3bc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Oct 2025 13:33:18 +0200 Subject: [PATCH 080/885] hmac: free memory properly on errors If one of the hmac init calls fail, Curl_HMAC_init previously would return without first freeing the allocated HMAC_context. Fixes #19176 Reported-by: WangDaLei on github Closes #19177 --- lib/hmac.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/hmac.c b/lib/hmac.c index 5e7dd0df0c2d..7842f0601b06 100644 --- a/lib/hmac.c +++ b/lib/hmac.c @@ -74,7 +74,7 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, /* If the key is too long, replace it by its hash digest. */ if(keylen > hashparams->maxkeylen) { if(hashparams->hinit(ctxt->hashctxt1)) - return NULL; + goto fail; hashparams->hupdate(ctxt->hashctxt1, key, keylen); hkey = (unsigned char *) ctxt->hashctxt2 + hashparams->ctxtsize; hashparams->hfinal(hkey, ctxt->hashctxt1); @@ -85,7 +85,7 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, /* Prime the two hash contexts with the modified key. */ if(hashparams->hinit(ctxt->hashctxt1) || hashparams->hinit(ctxt->hashctxt2)) - return NULL; + goto fail; for(i = 0; i < keylen; i++) { b = (unsigned char)(*key ^ hmac_ipad); @@ -101,6 +101,10 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, /* Done, return pointer to HMAC context. */ return ctxt; + +fail: + free(ctxt); + return NULL; } int Curl_HMAC_update(struct HMAC_context *ctxt, From 40f7cd2bdd14e09b9bb1b4ddefc8b5e5ce71865a Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 21 Oct 2025 13:51:10 +0200 Subject: [PATCH 081/885] mime: fix unpausing of readers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When unpausing a transfer, check if the reader pause state differs in addition to the "keepon" flags. Reported-by: 包布丁 Fixes #18848 Closes #19178 --- lib/easy.c | 3 +- lib/sendf.c | 1 + tests/http/test_07_upload.py | 19 ++++++++++ tests/http/testenv/httpd.py | 6 ++-- .../http/testenv/mod_curltest/mod_curltest.c | 15 ++++++++ tests/libtest/cli_hx_upload.c | 36 +++++++++++++------ 6 files changed, 67 insertions(+), 13 deletions(-) diff --git a/lib/easy.c b/lib/easy.c index 793a18f33eb8..4236a01d8744 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -1165,7 +1165,8 @@ CURLcode curl_easy_pause(CURL *d, int action) send_paused = Curl_xfer_send_is_paused(data); send_paused_new = (action & CURLPAUSE_SEND); - if(send_paused != send_paused_new) { + if((send_paused != send_paused_new) || + (send_paused_new != Curl_creader_is_paused(data))) { changed = TRUE; result = Curl_1st_err(result, Curl_xfer_pause_send(data, send_paused_new)); } diff --git a/lib/sendf.c b/lib/sendf.c index c6d84127620b..7307f872dfaa 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -1442,6 +1442,7 @@ CURLcode Curl_creader_unpause(struct Curl_easy *data) while(reader) { result = reader->crt->cntrl(data, reader, CURL_CRCNTRL_UNPAUSE); + CURL_TRC_READ(data, "unpausing %s -> %d", reader->crt->name, result); if(result) break; reader = reader->next; diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index d17d3a44ad04..c2377d41e422 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -671,6 +671,25 @@ def test_07_62_upload_issue_15688(self, env: Env, httpd, proto): ]) r.check_stats(count=1, http_status=200, exitcode=0) + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_07_63_upload_exp100_paused(self, env: Env, httpd, nghttpx, proto): + read_delay = 1 + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]'\ + f'&read_delay={read_delay}s' + upload_size = 128 * 1024 + client = LocalClient(name='cli_hx_upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', '1', + '-S', f'{upload_size}', + '-P', '1', + '-M', 'MIME', + '-r', f'{env.domain1}:{env.port_for(proto)}:127.0.0.1', + '-V', proto, url + ]) + r.check_exit_code(0) + # nghttpx is the only server we have that supports TLS early data and # has a limit of 16k it announces @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx") diff --git a/tests/http/testenv/httpd.py b/tests/http/testenv/httpd.py index d9f535dd22d2..740237abc4e6 100644 --- a/tests/http/testenv/httpd.py +++ b/tests/http/testenv/httpd.py @@ -575,11 +575,13 @@ def _init_curltest(self): return local_dir = os.path.dirname(inspect.getfile(Httpd)) out_dir = os.path.join(self.env.gen_dir, 'mod_curltest') + in_source = os.path.join(local_dir, 'mod_curltest/mod_curltest.c') out_source = os.path.join(out_dir, 'mod_curltest.c') if not os.path.exists(out_dir): os.mkdir(out_dir) - if not os.path.exists(out_source): - shutil.copy(os.path.join(local_dir, 'mod_curltest/mod_curltest.c'), out_source) + if not os.path.exists(out_source) or \ + os.stat(in_source).st_mtime > os.stat(out_source).st_mtime: + shutil.copy(in_source, out_source) p = subprocess.run([ self.env.apxs, '-c', out_source ], capture_output=True, cwd=out_dir) diff --git a/tests/http/testenv/mod_curltest/mod_curltest.c b/tests/http/testenv/mod_curltest/mod_curltest.c index e354e5a46909..17d0688ace68 100644 --- a/tests/http/testenv/mod_curltest/mod_curltest.c +++ b/tests/http/testenv/mod_curltest/mod_curltest.c @@ -188,6 +188,7 @@ static int curltest_echo_handler(request_rec *r) char buffer[8192]; const char *ct; apr_off_t die_after_len = -1, total_read_len = 0; + apr_time_t read_delay = 0; int just_die = 0, die_after_100 = 0; long l; @@ -221,6 +222,12 @@ static int curltest_echo_handler(request_rec *r) die_after_100 = 1; continue; } + else if(!strcmp("read_delay", arg)) { + rv = duration_parse(&read_delay, val, "s"); + if(APR_SUCCESS == rv) { + continue; + } + } } } } @@ -258,6 +265,12 @@ static int curltest_echo_handler(request_rec *r) apr_table_setn(r->headers_out, "Request-TE", apr_table_get(r->headers_in, "TE")); + if(read_delay) { + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, + "put_handler: read_delay"); + apr_sleep(read_delay); + } + bb = apr_brigade_create(r->pool, c->bucket_alloc); /* copy any request body into the response */ rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK); @@ -637,6 +650,8 @@ static int curltest_put_handler(request_rec *r) ap_set_content_type(r, ct ? ct : "text/plain"); if(read_delay) { + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, + "put_handler: read_delay"); apr_sleep(read_delay); } bb = apr_brigade_create(r->pool, c->bucket_alloc); diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index a0a6b95db847..5d9c2f26f8b3 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -33,6 +33,7 @@ struct transfer_u { CURL *easy; const char *method; char filename[128]; + curl_mime *mime; FILE *out; curl_off_t send_total; curl_off_t recv_size; @@ -158,18 +159,28 @@ static int setup_hx_upload(CURL *hnd, const char *url, struct transfer_u *t, if(use_earlydata) curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); - if(!t->method || !strcmp("PUT", t->method)) - curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); - else if(!strcmp("POST", t->method)) - curl_easy_setopt(hnd, CURLOPT_POST, 1L); + if(!strcmp("MIME", t->method)) { + curl_mimepart *part; + t->mime = curl_mime_init(hnd); + part = curl_mime_addpart(t->mime); + curl_mime_name(part, "file"); + curl_mime_data_cb(part, -1, my_read_cb, NULL, NULL, t); + curl_easy_setopt(hnd, CURLOPT_MIMEPOST, t->mime); + } else { - curl_mfprintf(stderr, "unsupported method '%s'\n", t->method); - return 1; + if(!t->method || !strcmp("PUT", t->method)) + curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); + else if(!strcmp("POST", t->method)) + curl_easy_setopt(hnd, CURLOPT_POST, 1L); + else { + curl_mfprintf(stderr, "unsupported method '%s'\n", t->method); + return 1; + } + curl_easy_setopt(hnd, CURLOPT_READFUNCTION, my_read_cb); + curl_easy_setopt(hnd, CURLOPT_READDATA, t); + if(announce_length) + curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, t->send_total); } - curl_easy_setopt(hnd, CURLOPT_READFUNCTION, my_read_cb); - curl_easy_setopt(hnd, CURLOPT_READDATA, t); - if(announce_length) - curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, t->send_total); curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_u_cb); @@ -488,6 +499,7 @@ static CURLcode test_cli_hx_upload(const char *URL) } while(active_transfers); /* as long as we have transfers going */ + curl_mfprintf(stderr, "all transfers done, cleanup multi\n"); curl_multi_cleanup(multi_handle); } @@ -501,9 +513,13 @@ static CURLcode test_cli_hx_upload(const char *URL) curl_easy_cleanup(t->easy); t->easy = NULL; } + if(t->mime) { + curl_mime_free(t->mime); + } } free(transfer_u); curl_share_cleanup(share); + curl_slist_free_all(host); return CURLE_OK; } From 48df7b29d905314c2c0c3b4b3f949569a490d3aa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2025 11:34:25 +0200 Subject: [PATCH 082/885] cookie: only count accepted cookies in Curl_cookie_add The counter used to stop accepting cookies after a certain amount has been received in a single response would previously also count some cookies that were not actually accepted as they were discarded after the counter was increased. Starting now, the counter is increased only for cookies that were accepted. Pointed out by ZeroPath Closes #19157 --- lib/cookie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cookie.c b/lib/cookie.c index 98c13e621868..9b89b7df7078 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -750,7 +750,6 @@ parse_cookie_header(struct Curl_easy *data, if(!co->name) return CERR_BAD; - data->req.setcookies++; return CERR_OK; } @@ -1140,6 +1139,9 @@ Curl_cookie_add(struct Curl_easy *data, if(co->expires && (co->expires < ci->next_expiration)) ci->next_expiration = co->expires; + if(httpheader) + data->req.setcookies++; + return co; fail: freecookie(co); From 09f857803f5373e7a4052a488131b8bbea1bc453 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 21 Oct 2025 15:08:53 +0200 Subject: [PATCH 083/885] INSTALL-CMAKE.md: add manual configuration examples Closes #19179 --- docs/INSTALL-CMAKE.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index 996ba698d042..c622b8392098 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -454,6 +454,22 @@ Details via CMake - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory. - `ZSTD_LIBRARY`: Absolute path to `zstd` library. +Examples: + +- `-DLIBPSL_INCLUDE_DIR=/path/to/libpl/include`, + which directory contains `libpsl.h`. + No ending slash or backslash is necessary. + +- `-DNGHTTP3_INCLUDE_DIR=/path/to/libnghttp3/include`, + which directory contains an `nghttp3` subdirectory with `.h` files in it. + +- `-DLIBPSL_LIBRARY=/path/to/libpsl/lib/libpsl.a` + Always a single library, with its complete filename, as-is on the file system. + +- `-DOPENSSL_ROOT_DIR=/path/to/openssl`, + which directory (typically) contains `include` and `lib` subdirectories. + No ending slash or backslash is necessary. + ## Test tools - `APXS`: Default: `apxs` From ea6455b7a4ed3dca3b2f03d6a0ae3ba101c16160 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 21 Oct 2025 15:22:43 +0200 Subject: [PATCH 084/885] spelling: subdirectories Closes #19180 --- .github/scripts/badwords.txt | 1 + docs/cmdline-opts/list-only.md | 2 +- packages/vms/curl_gnv_build_steps.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index 741e5376fced..492ea32537b2 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -46,6 +46,7 @@ there's:there is \. But: Rewrite it somehow? \. So : Rewrite without "so" ? dir :directory +sub-director:subdirector can't:cannot that's:that is web page:webpage diff --git a/docs/cmdline-opts/list-only.md b/docs/cmdline-opts/list-only.md index 2800a8f79313..eb52d8884972 100644 --- a/docs/cmdline-opts/list-only.md +++ b/docs/cmdline-opts/list-only.md @@ -24,7 +24,7 @@ used like this, the option causes an NLST command to be sent to the server instead of LIST. Note: Some FTP servers list only files in their response to NLST; they do not -include sub-directories and symbolic links. +include subdirectories and symbolic links. When listing an SFTP directory, this switch forces a name-only view, one per line. This is especially useful if the user wants to machine-parse the diff --git a/packages/vms/curl_gnv_build_steps.txt b/packages/vms/curl_gnv_build_steps.txt index b7ea95219b51..46c2c6e0a617 100644 --- a/packages/vms/curl_gnv_build_steps.txt +++ b/packages/vms/curl_gnv_build_steps.txt @@ -48,7 +48,7 @@ VMS_ROOT: is for the source files that are specific to OpenVMS. Note, you should create the VMS_ROOT: directory tree even if it is initially empty. This is where you should put edits if you are making changes. -LCL_ROOT: is manually created to have the same base and sub-directories as +LCL_ROOT: is manually created to have the same base and subdirectories as SRC_ROOT: and VMS_ROOT: The logical name REF_ROOT: may be defined to be a search list for From 30734e48d6719590967a6f3db31b02c5edbf2d9c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 05:33:33 +0000 Subject: [PATCH 085/885] Dockerfile: update debian:bookworm-slim Docker digest to 78d2f66 Closes #19173 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 88a356bb88c5..fc5bf9e1ef6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ # $ ./scripts/maketgz 8.7.1 # To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags -FROM debian:bookworm-slim@sha256:7e490910eea2861b9664577a96b54ce68ea3e02ce7f51d89cb0103a6f9c386e0 +FROM debian:bookworm-slim@sha256:78d2f66e0fec9e5a39fb2c72ea5e052b548df75602b5215ed01a17171529f706 RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \ build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \ From 7d5d0645e5562f65005488fbc7fd270a71239a5f Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 22 Oct 2025 02:03:29 +0800 Subject: [PATCH 086/885] http: unify error handling in Curl_http() Closes #19182 --- lib/http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/http.c b/lib/http.c index 172a09166867..44d36b9a847a 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2936,8 +2936,10 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) char *pq = NULL; if(data->state.up.query) { pq = curl_maprintf("%s?%s", data->state.up.path, data->state.up.query); - if(!pq) - return CURLE_OUT_OF_MEMORY; + if(!pq) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } } result = Curl_http_output_auth(data, data->conn, method, httpreq, (pq ? pq : data->state.up.path), FALSE); From 7295546447af980adacb37553a276cb1c782ba23 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Oct 2025 23:43:30 +0200 Subject: [PATCH 087/885] hostip: fix infof() output for non-ipv6 builds using IPv6 address Pointed out by ZeroPath Closes #19184 --- lib/hostip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hostip.c b/lib/hostip.c index 055ea78b483c..d4b1b87e7ad5 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -1352,9 +1352,9 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) } } #ifndef USE_IPV6 - if(memchr(target.str, ':', target.len)) { - infof(data, "Ignoring resolve address '%s', missing IPv6 support.", - address); + if(memchr(curlx_str(&target), ':', curlx_strlen(&target))) { + infof(data, "Ignoring resolve address '%.*s', missing IPv6 support.", + (int)curlx_strlen(&target), curlx_str(&target)); if(curlx_str_single(&host, ',')) goto err; continue; From 68e63a7997e33dd6393c60fe9157023c70b57fc3 Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 22 Oct 2025 13:24:55 +0800 Subject: [PATCH 088/885] curl_path: add curlx_dyn_free() on an error path Follow-up to 976333dd4052855c22369e89 Closes #19183 --- lib/vssh/curl_path.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vssh/curl_path.c b/lib/vssh/curl_path.c index 44ea3d07a564..a6d572520fac 100644 --- a/lib/vssh/curl_path.c +++ b/lib/vssh/curl_path.c @@ -167,8 +167,10 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) /* Read to end of filename - either to whitespace or terminator */ rc = curlx_str_word(&cp, &word, MAX_PATHLENGTH); if(rc) { - if(rc == STRE_BIG) + if(rc == STRE_BIG) { + curlx_dyn_free(&out); return CURLE_TOO_LARGE; + } else if(!content) /* no path, no word, this is incorrect */ goto fail; From f8ba00fe9ddb88827e212a9ebf8dd8293b5a1cb8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 09:55:34 +0200 Subject: [PATCH 089/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 009121768647..01d0511d4c1e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3520 + Contributors: 3523 This release includes the following changes: @@ -45,6 +45,7 @@ This release includes the following bugfixes: o cf-ip-happy: mention unix domain path, not port number [161] o cf-socket: always check Curl_cf_socket_peek() return code [198] o cf-socket: check params and remove accept procondition [197] + o cf-socket: make set_local_ip void, and remove failf() [390] o cf-socket: set FD_CLOEXEC on all sockets opened [273] o cf-socket: tweak a memcpy() to read better [177] o cf-socket: use the right byte order for ports in bindlocal [61] @@ -61,6 +62,7 @@ This release includes the following bugfixes: o cmake/FindGSS: fix pkg-config fallback logic for CMake <3.16 [189] o cmake/FindGSS: simplify/de-dupe lib setup [253] o cmake/FindGSS: whitespace/formatting [268] + o cmake: add and use local FindGnuTLS module [379] o cmake: add CURL_CODE_COVERAGE option [78] o cmake: build the "all" examples source list dynamically [245] o cmake: clang detection tidy-ups [116] @@ -70,6 +72,7 @@ This release includes the following bugfixes: o cmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`) [372] o cmake: minor Heimdal flavour detection fix [269] o cmake: pre-fill three more type sizes on Windows [244] + o cmake: say 'absolute path' in option descriptions and docs [378] o cmake: support building some complicated examples, build them in CI [235] o cmake: use modern alternatives for get_filename_component() [102] o cmake: use more COMPILER_OPTIONS, LINK_OPTIONS / LINK_FLAGS [152] @@ -79,6 +82,7 @@ This release includes the following bugfixes: o conn: fix hostname move on connection reuse [272] o connect: remove redundant condition in shutdown start [289] o cookie: avoid saving a cookie file if no transfer was done [11] + o cookie: only count accepted cookies in Curl_cookie_add [364] o cpool: make bundle->dest an array; fix UB [218] o curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY [320] o curl_easy_getinfo: error code on NULL arg [2] @@ -134,17 +138,23 @@ This release includes the following bugfixes: o ftp: simplify the 150/126 size scanner [288] o gnutls: check conversion of peer cert chain [275] o gtls: avoid potential use of uninitialized variable in trace output [83] + o hmac: free memory properly on errors [377] o hostip: don't store negative resolves due unrelated errors [256] + o hostip: fix infof() output for non-ipv6 builds using IPv6 address [338] o hostip: remove leftover INT_MAX check in Curl_dnscache_prune [88] o http2: check push header names by length first [261] o http2: cleanup pushed newhandle on fail [260] o http2: ingress handling edge cases [259] + o HTTP3: clarify the status for "old" OpenSSL, not current [394] o http: handle user-defined connection headers [165] o http: look for trailing 'type=' in ftp:// without strstr [315] o http: make Content-Length parser more WHATWG [183] + o http: return error for a second Location: header [393] o httpsrr: free old pointers when storing new [57] o imap: treat capabilities case insensitively [345] + o INSTALL-CMAKE.md: add manual configuration examples [360] o INSTALL-CMAKE.md: document useful build targets [215] + o INSTALL-CMAKE.md: fix descriptions for LDAP dependency options [382] o INSTALL: update the list of known operating systems [325] o INTERNALS: drop Winsock 2.2 from the dependency list [162] o ip-happy: do not set unnecessary timeout [95] @@ -193,7 +203,9 @@ This release includes the following bugfixes: o libssh: react on errors from ssh_scp_read [24] o libssh: return out of memory correctly if aprintf fails [60] o libssh: return the proper error for readdir problems [355] + o Makefile.example: bump default example from FTP to HTTPS [389] o Makefile.example: fix option order [231] + o Makefile.example: make default options more likely to work [388] o Makefile.example: simplify and make it configurable [20] o managen: ignore version mentions < 7.66.0 [55] o managen: render better manpage references/links [54] @@ -204,6 +216,7 @@ This release includes the following bugfixes: o mbedtls: handle WANT_WRITE from mbedtls_ssl_read() [145] o mdlinkcheck: reject URLs containing quotes [174] o memdup0: handle edge case [241] + o mime: fix unpausing of readers [375] o mime: fix use of fseek() [334] o multi.h: add CURLMINFO_LASTENTRY [51] o multi_ev: remove unnecessary data check that confuses analysers [167] @@ -289,6 +302,7 @@ This release includes the following bugfixes: o socks_gssapi: reject too long tokens [90] o socks_gssapi: remove superfluous releases of the gss_recv_token [139] o socks_gssapi: remove the forced "no protection" [143] + o socks_gssapi: replace `gss_release_buffer()` with curl free [386] o socks_sspi: bail out on too long fields [137] o socks_sspi: fix memory cleanup calls [40] o socks_sspi: remove the enforced mode clearing [291] @@ -350,6 +364,7 @@ This release includes the following bugfixes: o tool_operate: retry on HTTP response codes 522 and 524 [317] o tool_operate: return error on strdup() failure [336] o tool_paramhlp: remove outdated comment in str2tls_max() [367] + o tool_parsecfg: detect and error on recursive --config use [380] o tool_progress: handle possible integer overflows [164] o tool_progress: make max5data() use an algorithm [170] o transfer: avoid busy loop with tiny speed limit [100] @@ -409,15 +424,16 @@ advice from friends like these: Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, dependabot[bot], divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, Howard Chu, - Ignat Loskutov, James Fuller, Javier Blazquez, Jicea, jmaggard10 on github, - Jochen Sprickerhof, Johannes Schindelin, Jonathan Cardoso Machado, - Joseph Birr-Pixton, Joshua Rogers, kapsiR on github, kuchara on github, - Marcel Raad, Michael Osipov, Michał Petryka, Mitchell Blank Jr, - Mohamed Daahir, Nir Azkiel, Patrick Monnerat, plv1313 on github, - Pocs Norbert, Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, - Samuel Dionne-Riel, Samuel Henrique, Stanislav Fort, Stefan Eissing, - Tatsuhiro Tsujikawa, tkzv on github, Viktor Szakats, Yedaya Katsman - (53 contributors) + Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, Jicea, + jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, + Jonathan Cardoso Machado, Joseph Birr-Pixton, Joshua Rogers, + kapsiR on github, kuchara on github, Marcel Raad, Michael Osipov, + Michał Petryka, Mitchell Blank Jr, Mohamed Daahir, Nir Azkiel, + Patrick Monnerat, plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], + rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, + Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, tkzv on github, + Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 + (57 contributors) References to bug reports and discussions on issues: @@ -757,6 +773,7 @@ References to bug reports and discussions on issues: [335] = https://curl.se/bug/?i=19125 [336] = https://curl.se/bug/?i=19145 [337] = https://curl.se/bug/?i=19097 + [338] = https://curl.se/bug/?i=19184 [339] = https://curl.se/bug/?i=19091 [340] = https://curl.se/bug/?i=19093 [341] = https://curl.se/bug/?i=19149 @@ -775,9 +792,11 @@ References to bug reports and discussions on issues: [357] = https://curl.se/bug/?i=19136 [358] = https://curl.se/bug/?i=19133 [359] = https://curl.se/bug/?i=19139 + [360] = https://curl.se/bug/?i=19179 [361] = https://curl.se/bug/?i=19126 [362] = https://curl.se/bug/?i=19132 [363] = https://curl.se/bug/?i=19118 + [364] = https://curl.se/bug/?i=19157 [365] = https://curl.se/bug/?i=19112 [366] = https://curl.se/bug/?i=19124 [367] = https://curl.se/bug/?i=19115 @@ -788,4 +807,16 @@ References to bug reports and discussions on issues: [372] = https://curl.se/bug/?i=19116 [373] = https://curl.se/bug/?i=19114 [374] = https://curl.se/bug/?i=19113 + [375] = https://curl.se/bug/?i=18848 [376] = https://curl.se/bug/?i=19111 + [377] = https://curl.se/bug/?i=19176 + [378] = https://curl.se/bug/?i=19169 + [379] = https://curl.se/bug/?i=19163 + [380] = https://curl.se/bug/?i=19168 + [382] = https://curl.se/bug/?i=19170 + [386] = https://curl.se/bug/?i=19018 + [388] = https://curl.se/bug/?i=19161 + [389] = https://curl.se/bug/?i=19160 + [390] = https://curl.se/bug/?i=19137 + [393] = https://curl.se/bug/?i=19130 + [394] = https://curl.se/bug/?i=19153 From 9c313b61b419c8a6c92420f77da67de8d287ff8a Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 22 Oct 2025 10:00:53 +0200 Subject: [PATCH 090/885] ftp: check errors on remote ip for data connection Obtaining the remote ip of the control connection to be used for the data connection can fail. Check that and fail the transfer when that does not work. Triggered by an OSS-Fuzz issue. Closes #19185 --- lib/ftp.c | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index fd957a2bb485..0fab17c1c1b4 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1771,23 +1771,32 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data, } -static char *control_address_dup(struct Curl_easy *data, - struct connectdata *conn) +static CURLcode ftp_control_addr_dup(struct Curl_easy *data, + struct ftp_conn *ftpc) { - struct ip_quadruple ipquad; - bool is_ipv6; + struct connectdata *conn = data->conn; + struct ip_quadruple ipquad; + bool is_ipv6; /* Returns the control connection IP address. If a proxy tunnel is used, returns the original hostname instead, because the effective control connection address is the proxy address, not the ftp host. */ + free(ftpc->newhost); #ifndef CURL_DISABLE_PROXY if(conn->bits.tunnel_proxy || conn->bits.socksproxy) - return strdup(conn->host.name); + ftpc->newhost = strdup(conn->host.name); + else #endif - if(!Curl_conn_get_ip_info(data, conn, FIRSTSOCKET, &is_ipv6, &ipquad)) - return strdup(ipquad.remote_ip); - return NULL; + if(!Curl_conn_get_ip_info(data, conn, FIRSTSOCKET, &is_ipv6, &ipquad) && + *ipquad.remote_ip) + ftpc->newhost = strdup(ipquad.remote_ip); + else { + /* failed to get the remote_ip of the DATA connection */ + failf(data, "unable to get peername of DATA connection"); + return CURLE_FAILED_INIT; + } + return ftpc->newhost ? CURLE_OK : CURLE_OUT_OF_MEMORY; } static bool match_pasv_6nums(const char *p, @@ -1840,9 +1849,9 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, return CURLE_FTP_WEIRD_PASV_REPLY; } ftpc->newport = (unsigned short)num; - ftpc->newhost = control_address_dup(data, conn); - if(!ftpc->newhost) - return CURLE_OUT_OF_MEMORY; + result = ftp_control_addr_dup(data, ftpc); + if(result) + return result; } else ptr = NULL; @@ -1884,7 +1893,9 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, infof(data, "Skip %u.%u.%u.%u for data connection, reuse %s instead", ip[0], ip[1], ip[2], ip[3], conn->host.name); - ftpc->newhost = control_address_dup(data, conn); + result = ftp_control_addr_dup(data, ftpc); + if(result) + return result; } else ftpc->newhost = curl_maprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); @@ -1938,9 +1949,9 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, /* postponed address resolution in case of tcp fastopen */ if(conn->bits.tcp_fastopen && !conn->bits.reuse && !ftpc->newhost[0]) { free(ftpc->newhost); - ftpc->newhost = control_address_dup(data, conn); - if(!ftpc->newhost) - return CURLE_OUT_OF_MEMORY; + result = ftp_control_addr_dup(data, ftpc); + if(result) + return result; } (void)Curl_resolv_blocking(data, ftpc->newhost, ftpc->newport, From fcae0733a7c55e712955b0f6df24fc8412023e2d Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 22 Oct 2025 10:39:58 +0200 Subject: [PATCH 091/885] gnutls: fix re-handshake comments With GnuTLS, a GNUTLS_E_REHANDSHAKE can be a renegotiate in TLSv1.2 or a key update in TLSv1.3. This had been made non-blocking in a1850ad7debe33fded6367e34d5c06be4d51f58e but the comment warning about a blocking call was not updated. Closes #19187 --- lib/vtls/gtls.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 1c0a6fb2d610..19c2ce893fb9 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -239,8 +239,8 @@ static void unload_file(gnutls_datum_t data) /* this function does an SSL/TLS (re-)handshake */ -static CURLcode handshake(struct Curl_cfilter *cf, - struct Curl_easy *data) +static CURLcode cf_gtls_handshake(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct gtls_ssl_backend_data *backend = @@ -2005,7 +2005,7 @@ static CURLcode gtls_connect_common(struct Curl_cfilter *cf, DEBUGASSERT((connssl->earlydata_state == ssl_earlydata_none) || (connssl->earlydata_state == ssl_earlydata_sent)); #endif - result = handshake(cf, data); + result = cf_gtls_handshake(cf, data); if(result) goto out; connssl->connecting_state = ssl_connect_3; @@ -2265,11 +2265,10 @@ static CURLcode gtls_recv(struct Curl_cfilter *cf, goto out; } else if(nread == GNUTLS_E_REHANDSHAKE) { - /* BLOCKING call, this is bad but a work-around for now. Fixing this "the - proper way" takes a whole lot of work. */ - result = handshake(cf, data); + /* Either TLSv1.2 renegotiate or a TLSv1.3 session key update. */ + result = cf_gtls_handshake(cf, data); if(!result) - result = CURLE_AGAIN; /* then return as if this was a wouldblock */ + result = CURLE_AGAIN; /* make us get called again. */ goto out; } else { From bb78c45407e9ad5fc1884d3b5fa9a16bde8af3d7 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 22 Oct 2025 10:12:54 +0200 Subject: [PATCH 092/885] vquic: fix recvmsg loop for max_pkts The parameter `max_pkts` was not checked in the recvmsg() implementation of vquic_recv_packets() as the packter counter was never increased. This led to the loop running until an EAGAIN was encountered. Which, in any real case scenario, does no harm as long as libcurl is ingesting packets faster than a server is able to send them. However on a slow device and a fast network this could happen and allow a denial of serice. Not a real regression as the vulnerable code has never been released. libcurl 8.16.0 does not have this bug. Closes #19186 --- lib/vquic/vquic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 24ba8a97e490..7533001eaf2e 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -539,6 +539,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, msg.msg_name, msg.msg_namelen, 0, userp); if(result) goto out; + pkts += (nread + gso_size - 1) / gso_size; } out: From fb6a4802d7a76d8e36652bedbf6c03270b541974 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 11:25:42 +0200 Subject: [PATCH 093/885] imap: parse and use UIDVALIDITY as a number Instead of a string. Saves a malloc, adds earlier format check. RFC 3501 section 2.3.1.1 documents the value as a 32-bit value. Closes #19188 --- lib/imap.c | 109 +++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 62 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index 0feaedf5acc8..8cbda96a050c 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -115,8 +115,8 @@ struct imap_conn { struct SASL sasl; /* SASL-related parameters */ struct dynbuf dyn; /* for the IMAP commands */ char *mailbox; /* The last selected mailbox */ - char *mailbox_uidvalidity; /* UIDVALIDITY parsed from select response */ imapstate state; /* Always use imap.c:state() to change state! */ + unsigned int mb_uidvalidity; /* UIDVALIDITY parsed from select response */ char resptag[5]; /* Response tag to wait for */ unsigned char preftype; /* Preferred authentication type */ unsigned char cmdid; /* Last used command ID */ @@ -125,6 +125,7 @@ struct imap_conn { BIT(tls_supported); /* StartTLS capability supported by server */ BIT(login_disabled); /* LOGIN command disabled by server */ BIT(ir_supported); /* Initial response supported by server */ + BIT(mb_uidvalidity_set); }; /* This IMAP struct is used in the Curl_easy. All IMAP data that is @@ -134,7 +135,6 @@ struct imap_conn { struct IMAP { curl_pp_transfer transfer; char *mailbox; /* Mailbox to select */ - char *uidvalidity; /* UIDVALIDITY to check in select */ char *uid; /* Message UID to fetch */ char *mindex; /* Index in mail box of mail to fetch */ char *section; /* Message SECTION to fetch */ @@ -142,6 +142,8 @@ struct IMAP { char *query; /* Query to search for */ char *custom; /* Custom request */ char *custom_params; /* Parameters for the custom request */ + unsigned int uidvalidity; /* UIDVALIDITY to check in select */ + BIT(uidvalidity_set); }; @@ -780,7 +782,6 @@ static CURLcode imap_perform_select(struct Curl_easy *data, /* Invalidate old information as we are switching mailboxes */ Curl_safefree(imapc->mailbox); - Curl_safefree(imapc->mailbox_uidvalidity); /* Check we have a mailbox */ if(!imap->mailbox) { @@ -1222,24 +1223,19 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, if(imapcode == '*') { /* See if this is an UIDVALIDITY response */ if(checkprefix("OK [UIDVALIDITY ", line + 2)) { - size_t len = 0; + curl_off_t value; const char *p = &line[2] + strlen("OK [UIDVALIDITY "); - while((len < 20) && p[len] && ISDIGIT(p[len])) - len++; - if(len && (p[len] == ']')) { - struct dynbuf uid; - curlx_dyn_init(&uid, 20); - if(curlx_dyn_addn(&uid, p, len)) - return CURLE_OUT_OF_MEMORY; - free(imapc->mailbox_uidvalidity); - imapc->mailbox_uidvalidity = curlx_dyn_ptr(&uid); + if(!curlx_str_number(&p, &value, UINT_MAX)) { + imapc->mb_uidvalidity = (unsigned int)value; + imapc->mb_uidvalidity_set = TRUE; } + } } else if(imapcode == IMAP_RESP_OK) { /* Check if the UIDVALIDITY has been specified and matches */ - if(imap->uidvalidity && imapc->mailbox_uidvalidity && - !curl_strequal(imap->uidvalidity, imapc->mailbox_uidvalidity)) { + if(imap->uidvalidity_set && imapc->mb_uidvalidity_set && + (imap->uidvalidity != imapc->mb_uidvalidity)) { failf(data, "Mailbox UIDVALIDITY has changed"); result = CURLE_REMOTE_FILE_NOT_FOUND; } @@ -1690,8 +1686,8 @@ static CURLcode imap_perform(struct Curl_easy *data, bool *connected, has already been selected on this connection */ if(imap->mailbox && imapc->mailbox && curl_strequal(imap->mailbox, imapc->mailbox) && - (!imap->uidvalidity || !imapc->mailbox_uidvalidity || - curl_strequal(imap->uidvalidity, imapc->mailbox_uidvalidity))) + (!imap->uidvalidity_set || !imapc->mb_uidvalidity_set || + (imap->uidvalidity == imapc->mb_uidvalidity))) selected = TRUE; /* Start the first command in the DO phase */ @@ -1861,7 +1857,6 @@ static CURLcode imap_regular_transfer(struct Curl_easy *data, static void imap_easy_reset(struct IMAP *imap) { Curl_safefree(imap->mailbox); - Curl_safefree(imap->uidvalidity); Curl_safefree(imap->uid); Curl_safefree(imap->mindex); Curl_safefree(imap->section); @@ -1890,7 +1885,6 @@ static void imap_conn_dtor(void *key, size_t klen, void *entry) Curl_pp_disconnect(&imapc->pp); curlx_dyn_free(&imapc->dyn); Curl_safefree(imapc->mailbox); - Curl_safefree(imapc->mailbox_uidvalidity); free(imapc); } @@ -2177,54 +2171,45 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data, DEBUGF(infof(data, "IMAP URL parameter '%s' = '%s'", name, value)); - /* Process the known hierarchical parameters (UIDVALIDITY, UID, SECTION and - PARTIAL) stripping of the trailing slash character if it is present. + /* Process the known hierarchical parameters (UIDVALIDITY, UID, SECTION + and PARTIAL) stripping of the trailing slash character if it is + present. Note: Unknown parameters trigger a URL_MALFORMAT error. */ - if(curl_strequal(name, "UIDVALIDITY") && !imap->uidvalidity) { - if(valuelen > 0 && value[valuelen - 1] == '/') - value[valuelen - 1] = '\0'; - - imap->uidvalidity = value; - value = NULL; - } - else if(curl_strequal(name, "UID") && !imap->uid) { - if(valuelen > 0 && value[valuelen - 1] == '/') - value[valuelen - 1] = '\0'; - - imap->uid = value; - value = NULL; - } - else if(curl_strequal(name, "MAILINDEX") && !imap->mindex) { - if(valuelen > 0 && value[valuelen - 1] == '/') - value[valuelen - 1] = '\0'; - - imap->mindex = value; - value = NULL; - } - else if(curl_strequal(name, "SECTION") && !imap->section) { - if(valuelen > 0 && value[valuelen - 1] == '/') - value[valuelen - 1] = '\0'; - - imap->section = value; - value = NULL; - } - else if(curl_strequal(name, "PARTIAL") && !imap->partial) { - if(valuelen > 0 && value[valuelen - 1] == '/') - value[valuelen - 1] = '\0'; - - imap->partial = value; - value = NULL; + if(valuelen > 0 && value[valuelen - 1] == '/') + value[valuelen - 1] = '\0'; + if(valuelen) { + if(curl_strequal(name, "UIDVALIDITY") && !imap->uidvalidity_set) { + curl_off_t num; + const char *p = (const char *)value; + if(!curlx_str_number(&p, &num, UINT_MAX)) { + imap->uidvalidity = (unsigned int)num; + imap->uidvalidity_set = TRUE; + } + free(value); + } + else if(curl_strequal(name, "UID") && !imap->uid) { + imap->uid = value; + } + else if(curl_strequal(name, "MAILINDEX") && !imap->mindex) { + imap->mindex = value; + } + else if(curl_strequal(name, "SECTION") && !imap->section) { + imap->section = value; + } + else if(curl_strequal(name, "PARTIAL") && !imap->partial) { + imap->partial = value; + } + else { + free(name); + free(value); + return CURLE_URL_MALFORMAT; + } } - else { - free(name); + else + /* blank? */ free(value); - - return CURLE_URL_MALFORMAT; - } - free(name); - free(value); } /* Does the URL contain a query parameter? Only valid when we have a mailbox From 61156f792105597991b5286de76fb5226082dfe4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 13:08:21 +0200 Subject: [PATCH 094/885] ftp: remove 'newhost' and 'newport' from the ftp_conn struct They are only needed locally, no need to keep them around. Closes #19190 --- lib/ftp.c | 74 +++++++++++++++++++++++++++++-------------------------- lib/ftp.h | 4 --- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index 0fab17c1c1b4..1d33a96b10e8 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -334,7 +334,6 @@ static void freedirs(struct ftp_conn *ftpc) ftpc->dirdepth = 0; Curl_safefree(ftpc->rawpath); ftpc->file = NULL; - Curl_safefree(ftpc->newhost); } #ifdef CURL_PREFER_LF_LINEENDS @@ -1772,7 +1771,7 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data, static CURLcode ftp_control_addr_dup(struct Curl_easy *data, - struct ftp_conn *ftpc) + char **newhostp) { struct connectdata *conn = data->conn; struct ip_quadruple ipquad; @@ -1782,21 +1781,21 @@ static CURLcode ftp_control_addr_dup(struct Curl_easy *data, If a proxy tunnel is used, returns the original hostname instead, because the effective control connection address is the proxy address, not the ftp host. */ - free(ftpc->newhost); #ifndef CURL_DISABLE_PROXY if(conn->bits.tunnel_proxy || conn->bits.socksproxy) - ftpc->newhost = strdup(conn->host.name); + *newhostp = strdup(conn->host.name); else #endif if(!Curl_conn_get_ip_info(data, conn, FIRSTSOCKET, &is_ipv6, &ipquad) && *ipquad.remote_ip) - ftpc->newhost = strdup(ipquad.remote_ip); + *newhostp = strdup(ipquad.remote_ip); else { /* failed to get the remote_ip of the DATA connection */ failf(data, "unable to get peername of DATA connection"); - return CURLE_FAILED_INIT; + *newhostp = NULL; + return CURLE_FTP_CANT_GET_HOST; } - return ftpc->newhost ? CURLE_OK : CURLE_OUT_OF_MEMORY; + return *newhostp ? CURLE_OK : CURLE_OUT_OF_MEMORY; } static bool match_pasv_6nums(const char *p, @@ -1826,12 +1825,11 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, struct Curl_dns_entry *dns = NULL; unsigned short connectport; /* the local port connect() should use! */ struct pingpong *pp = &ftpc->pp; + char *newhost = NULL; + unsigned short newport = 0; char *str = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */ - /* if we come here again, make sure the former name is cleared */ - Curl_safefree(ftpc->newhost); - if((ftpc->count1 == 0) && (ftpcode == 229)) { /* positive EPSV response */ @@ -1848,8 +1846,8 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, failf(data, "Illegal port number in EPSV reply"); return CURLE_FTP_WEIRD_PASV_REPLY; } - ftpc->newport = (unsigned short)num; - result = ftp_control_addr_dup(data, ftpc); + newport = (unsigned short)num; + result = ftp_control_addr_dup(data, &newhost); if(result) return result; } @@ -1893,17 +1891,17 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, infof(data, "Skip %u.%u.%u.%u for data connection, reuse %s instead", ip[0], ip[1], ip[2], ip[3], conn->host.name); - result = ftp_control_addr_dup(data, ftpc); + result = ftp_control_addr_dup(data, &newhost); if(result) return result; } else - ftpc->newhost = curl_maprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); + newhost = curl_maprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); - if(!ftpc->newhost) + if(!newhost) return CURLE_OUT_OF_MEMORY; - ftpc->newport = (unsigned short)(((ip[4] << 8) + ip[5]) & 0xffff); + newport = (unsigned short)(((ip[4] << 8) + ip[5]) & 0xffff); } else if(ftpc->count1 == 0) { /* EPSV failed, move on to PASV */ @@ -1937,31 +1935,31 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, if(!dns) { failf(data, "cannot resolve proxy host %s:%hu", host_name, connectport); - return CURLE_COULDNT_RESOLVE_PROXY; + result = CURLE_COULDNT_RESOLVE_PROXY; + goto error; } } else #endif { /* normal, direct, ftp connection */ - DEBUGASSERT(ftpc->newhost); + DEBUGASSERT(newhost); /* postponed address resolution in case of tcp fastopen */ - if(conn->bits.tcp_fastopen && !conn->bits.reuse && !ftpc->newhost[0]) { - free(ftpc->newhost); - result = ftp_control_addr_dup(data, ftpc); + if(conn->bits.tcp_fastopen && !conn->bits.reuse && !newhost[0]) { + free(newhost); + result = ftp_control_addr_dup(data, &newhost); if(result) - return result; + goto error; } - (void)Curl_resolv_blocking(data, ftpc->newhost, ftpc->newport, - conn->ip_version, &dns); - connectport = ftpc->newport; /* we connect to the remote port */ + (void)Curl_resolv_blocking(data, newhost, newport, conn->ip_version, &dns); + connectport = newport; /* we connect to the remote port */ if(!dns) { - failf(data, "cannot resolve new host %s:%hu", - ftpc->newhost, connectport); - return CURLE_FTP_CANT_GET_HOST; + failf(data, "cannot resolve new host %s:%hu", newhost, connectport); + result = CURLE_FTP_CANT_GET_HOST; + goto error; } } @@ -1970,10 +1968,12 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, CURL_CF_SSL_ENABLE : CURL_CF_SSL_DISABLE); if(result) { - if(ftpc->count1 == 0 && ftpcode == 229) + if(ftpc->count1 == 0 && ftpcode == 229) { + free(newhost); return ftp_epsv_disable(data, ftpc, conn); + } - return result; + goto error; } @@ -1985,17 +1985,21 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, if(data->set.verbose) /* this just dumps information about this second connection */ - ftp_pasv_verbose(data, dns->addr, ftpc->newhost, connectport); + ftp_pasv_verbose(data, dns->addr, newhost, connectport); free(conn->secondaryhostname); - conn->secondary_port = ftpc->newport; - conn->secondaryhostname = strdup(ftpc->newhost); - if(!conn->secondaryhostname) - return CURLE_OUT_OF_MEMORY; + conn->secondary_port = newport; + conn->secondaryhostname = strdup(newhost); + if(!conn->secondaryhostname) { + result = CURLE_OUT_OF_MEMORY; + goto error; + } conn->bits.do_more = TRUE; ftp_state(data, ftpc, FTP_STOP); /* this phase is completed */ +error: + free(newhost); return result; } diff --git a/lib/ftp.h b/lib/ftp.h index fdbb4b0539f2..76326331b48f 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -133,8 +133,6 @@ struct ftp_conn { const char *file; /* url-decoded filename (or path), points into rawpath */ char *rawpath; /* URL decoded, allocated, version of the path */ struct pathcomp *dirs; /* allocated array for path components */ - char *newhost; /* the (allocated) IP addr or hostname to connect the data - connection to */ char *prevpath; /* url-decoded conn->path from the previous transfer */ char transfertype; /* set by ftp_transfertype for use by Curl_client_write()a and others (A/I or zero) */ @@ -148,8 +146,6 @@ struct ftp_conn { int count1; /* general purpose counter for the state machine */ int count2; /* general purpose counter for the state machine */ int count3; /* general purpose counter for the state machine */ - unsigned short newport; /* the port of 'newhost' to connect the data - connection to */ ftpstate state; /* always use ftp.c:state() to change state! */ ftpstate state_saved; /* transfer type saved to be reloaded after data connection is established */ From 4d93592a26e31ea5632b98281225807b9f938460 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 13:22:21 +0200 Subject: [PATCH 095/885] ftp: reduce size of some struct fields Closes #19191 --- lib/ftp.c | 4 +++- lib/ftp.h | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index 1d33a96b10e8..cd8903e1b3dc 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -4169,6 +4169,8 @@ static size_t numof_slashes(const char *str) return num; } +#define FTP_MAX_DIR_DEPTH 1000 + /*********************************************************************** * * ftp_parse_url_path() @@ -4242,7 +4244,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data, /* number of entries to allocate for the 'dirs' array */ size_t dirAlloc = numof_slashes(rawPath); - if(dirAlloc >= 1000) + if(dirAlloc >= FTP_MAX_DIR_DEPTH) /* suspiciously deep dir hierarchy */ return CURLE_URL_MALFORMAT; diff --git a/lib/ftp.h b/lib/ftp.h index 76326331b48f..d06738f11392 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -141,14 +141,18 @@ struct ftp_conn { curl_off_t known_filesize; /* file size is different from -1, if wildcard LIST parsing was done and wc_statemach set it */ - int dirdepth; /* number of entries used in the 'dirs' array */ - int cwdcount; /* number of CWD commands issued */ int count1; /* general purpose counter for the state machine */ int count2; /* general purpose counter for the state machine */ int count3; /* general purpose counter for the state machine */ - ftpstate state; /* always use ftp.c:state() to change state! */ - ftpstate state_saved; /* transfer type saved to be reloaded after data - connection is established */ + unsigned short dirdepth; /* number of entries used in the 'dirs' array, + < FTP_MAX_DIR_DEPTH */ + unsigned short cwdcount; /* number of CWD commands issued, + < FTP_MAX_DIR_DEPTH */ + unsigned char state; /* (ftpstate enum) always use ftp.c:state() to change + state! */ + unsigned char state_saved; /* (ftpstate enum) transfer type saved to be + reloaded after data connection is + established */ unsigned char use_ssl; /* if AUTH TLS is to be attempted etc, for FTP or IMAP or POP3 or others! (type: curl_usessl)*/ unsigned char ccc; /* ccc level for this connection */ From 96717dea4c0ba8da7ef85190300f7eaeaa4b7d62 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 22 Oct 2025 18:57:32 +0200 Subject: [PATCH 096/885] GHA/labeler: add FindGnuTLS.cmake Follow-up to 1966c86d71eb90beeeb3ccbefd6321bd64992553 #19163 Cherry-picked from #16973 --- .github/labeler.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 982055f16a3b..770b293e3f96 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -451,6 +451,7 @@ TLS: - all: - changed-files: - any-glob-to-all-files: "{\ + CMake/FindGnuTLS.cmake,\ CMake/FindMbedTLS.cmake,\ CMake/FindWolfSSL.cmake,\ CMake/FindRustls.cmake,\ From a8f16da712402733609943b5da003af5baa058e6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 14:55:32 +0200 Subject: [PATCH 097/885] ftp: remove the state_saved struct field It was not necessary. Its only purpose was to know if an upload is done, and that information is already available elsewhere. Closes #19192 --- lib/ftp.c | 9 +++------ lib/ftp.h | 3 --- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index cd8903e1b3dc..8025d80f2116 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -533,7 +533,7 @@ static CURLcode ftp_initiate_transfer(struct Curl_easy *data, if(result || !connected) return result; - if(ftpc->state_saved == FTP_STOR) { + if(data->state.upload) { /* When we know we are uploading a specified file, we can get the file size prior to the actual upload. */ Curl_pgrsSetUploadSize(data, data->state.infilesize); @@ -2428,7 +2428,7 @@ static CURLcode ftp_state_rest_resp(struct Curl_easy *data, static CURLcode ftp_state_stor_resp(struct Curl_easy *data, struct ftp_conn *ftpc, - int ftpcode, ftpstate instate) + int ftpcode) { CURLcode result = CURLE_OK; @@ -2438,8 +2438,6 @@ static CURLcode ftp_state_stor_resp(struct Curl_easy *data, return CURLE_UPLOAD_FAILED; } - ftpc->state_saved = instate; - /* PORT means we are now awaiting the server to connect to us. */ if(data->set.ftp_use_port) { bool connected; @@ -2541,7 +2539,6 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, infof(data, "Getting file with size: %" FMT_OFF_T, size); /* FTP download: */ - ftpc->state_saved = instate; ftpc->retr_size_saved = size; if(data->set.ftp_use_port) { @@ -3142,7 +3139,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, break; case FTP_STOR: - result = ftp_state_stor_resp(data, ftpc, ftpcode, ftpc->state); + result = ftp_state_stor_resp(data, ftpc, ftpcode); break; case FTP_QUIT: diff --git a/lib/ftp.h b/lib/ftp.h index d06738f11392..e09aadabc3aa 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -150,9 +150,6 @@ struct ftp_conn { < FTP_MAX_DIR_DEPTH */ unsigned char state; /* (ftpstate enum) always use ftp.c:state() to change state! */ - unsigned char state_saved; /* (ftpstate enum) transfer type saved to be - reloaded after data connection is - established */ unsigned char use_ssl; /* if AUTH TLS is to be attempted etc, for FTP or IMAP or POP3 or others! (type: curl_usessl)*/ unsigned char ccc; /* ccc level for this connection */ From d51d19bd06529207aedc87ecde154ef57427f655 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 22:54:28 +0200 Subject: [PATCH 098/885] ftp: remove the retr_size_saved struct field It was basically a duplicate of data->req.size already Closes #19194 --- lib/ftp.c | 20 +++++++++----------- lib/ftp.h | 1 - 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index 8025d80f2116..5b96f63ad68f 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -548,7 +548,7 @@ static CURLcode ftp_initiate_transfer(struct Curl_easy *data, } else { /* FTP download, shutdown, do not ignore errors */ - Curl_xfer_setup_recv(data, SECONDARYSOCKET, ftpc->retr_size_saved); + Curl_xfer_setup_recv(data, SECONDARYSOCKET, data->req.size); Curl_xfer_set_shutdown(data, TRUE, FALSE); } @@ -2486,7 +2486,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, E: 125 Data connection already open; Transfer starting. */ - curl_off_t size = -1; /* default unknown size */ + data->req.size = -1; /* default unknown size */ /* @@ -2519,27 +2519,25 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, if(!curlx_str_number(&c, &what, CURL_OFF_T_MAX) && !curlx_str_single(&c, ' ') && !strncmp(c, "bytes", 5)) { - size = what; + data->req.size = what; break; } } } } else if(ftp->downloadsize > -1) - size = ftp->downloadsize; + data->req.size = ftp->downloadsize; - if(size > data->req.maxdownload && data->req.maxdownload > 0) - size = data->req.size = data->req.maxdownload; + if(data->req.size > data->req.maxdownload && data->req.maxdownload > 0) + data->req.size = data->req.maxdownload; else if((instate != FTP_LIST) && (data->state.prefer_ascii)) - size = -1; /* kludge for servers that understate ASCII mode file size */ + data->req.size = -1; /* for servers that understate ASCII mode file + size */ infof(data, "Maxdownload = %" FMT_OFF_T, data->req.maxdownload); if(instate != FTP_LIST) - infof(data, "Getting file with size: %" FMT_OFF_T, size); - - /* FTP download: */ - ftpc->retr_size_saved = size; + infof(data, "Getting file with size: %" FMT_OFF_T, data->req.size); if(data->set.ftp_use_port) { bool connected; diff --git a/lib/ftp.h b/lib/ftp.h index e09aadabc3aa..8d5f9c203147 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -136,7 +136,6 @@ struct ftp_conn { char *prevpath; /* url-decoded conn->path from the previous transfer */ char transfertype; /* set by ftp_transfertype for use by Curl_client_write()a and others (A/I or zero) */ - curl_off_t retr_size_saved; /* Size of retrieved file saved */ char *server_os; /* The target server operating system. */ curl_off_t known_filesize; /* file size is different from -1, if wildcard LIST parsing was done and wc_statemach set From 9e15b0763809bf6f43b1862d561be0c58a69365a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 00:53:09 +0200 Subject: [PATCH 099/885] openssl: only try engine/provider if a certificate file/name is provided Bug: https://issues.oss-fuzz.com/issues/435278402 Closes #19197 --- lib/vtls/openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f62f99cc86c1..336902b95105 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1721,12 +1721,12 @@ static CURLcode client_cert(struct Curl_easy *data, break; case SSL_FILETYPE_ENGINE: - if(!engineload(data, ctx, cert_file)) + if(!cert_file || !engineload(data, ctx, cert_file)) return CURLE_SSL_CERTPROBLEM; break; case SSL_FILETYPE_PROVIDER: - if(!providerload(data, ctx, cert_file)) + if(!cert_file || !providerload(data, ctx, cert_file)) return CURLE_SSL_CERTPROBLEM; break; From 28ebaf86ce7d524f8b8088560d70039582acfe32 Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 22 Oct 2025 19:07:57 +0800 Subject: [PATCH 100/885] cw-out: unify the error handling pattern in cw_out_do_write to proper set the error status and release resource Closes #19195 --- lib/cw-out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cw-out.c b/lib/cw-out.c index 7a9274b5f21b..1f4031649267 100644 --- a/lib/cw-out.c +++ b/lib/cw-out.c @@ -403,7 +403,7 @@ static CURLcode cw_out_do_write(struct cw_out_ctx *ctx, /* still have buffered data, append and flush */ result = cw_out_append(ctx, data, otype, buf, blen); if(result) - return result; + goto out; result = cw_out_flush_chain(ctx, data, &ctx->buf, flush_all); if(result) goto out; From 6032b8f2a22aa5af3cc99ceaf67311b19b6dddd1 Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 22 Oct 2025 21:45:07 +0800 Subject: [PATCH 101/885] vtls: unify the error handling in ssl_cf_connect(). Check preference at first, then init peer and do connect. Also fixes CF_DATA_RESTORE. Closes #19196 --- lib/vtls/vtls.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 7ee9699dbf0b..115559b70db8 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1365,6 +1365,15 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, DEBUGASSERT(connssl); *done = FALSE; + + if(!connssl->prefs_checked) { + if(!ssl_prefs_check(data)) { + result = CURLE_SSL_CONNECT_ERROR; + goto out; + } + connssl->prefs_checked = TRUE; + } + if(!connssl->peer.hostname) { char tls_id[80]; connssl->ssl_impl->version(tls_id, sizeof(tls_id) - 1); @@ -1373,12 +1382,6 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, goto out; } - if(!connssl->prefs_checked) { - if(!ssl_prefs_check(data)) - return CURLE_SSL_CONNECT_ERROR; - connssl->prefs_checked = TRUE; - } - result = connssl->ssl_impl->do_connect(cf, data, done); if(!result && *done) { From d922db880c5235eeba481c5be2484d68f610dfff Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 07:54:33 +0200 Subject: [PATCH 102/885] ntlm: improved error path on bad incoming NTLM TYPE3 message No leaks Reported-by: Tim Becker Closes #19198 --- lib/vauth/ntlm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 791fc87d1153..d860fbbd5058 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -788,7 +788,8 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, /* ntresplen + size should not be risking an integer overflow here */ if(ntresplen + size > sizeof(ntlmbuf)) { failf(data, "incoming NTLM message too big"); - return CURLE_OUT_OF_MEMORY; + result = CURLE_TOO_LARGE; + goto error; } DEBUGASSERT(size == (size_t)ntrespoff); memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen); @@ -799,8 +800,6 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, ntlm_print_hex(stderr, (char *)&ntlmbuf[ntrespoff], ntresplen); }); - free(ntlmv2resp);/* Free the dynamic buffer allocated for NTLMv2 */ - DEBUG_OUT({ curl_mfprintf(stderr, "\n flags=0x%02.2x%02.2x%02.2x%02.2x 0x%08.8x ", LONGQUARTET(ntlm->flags), ntlm->flags); @@ -811,8 +810,9 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, /* Make sure that the domain, user and host strings fit in the buffer before we copy them there. */ if(size + userlen + domlen + hostlen >= NTLM_BUFSIZE) { - failf(data, "user + domain + hostname too big"); - return CURLE_OUT_OF_MEMORY; + failf(data, "user + domain + hostname too big for NTLM"); + result = CURLE_TOO_LARGE; + goto error; } DEBUGASSERT(size == domoff); @@ -842,6 +842,9 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, /* Return the binary blob. */ result = Curl_bufref_memdup(out, ntlmbuf, size); +error: + free(ntlmv2resp);/* Free the dynamic buffer allocated for NTLMv2 */ + Curl_auth_cleanup_ntlm(ntlm); return result; From 41e6b45eddf5b1a9cdba49f5d1b0294ade373f20 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Oct 2025 07:57:26 +0200 Subject: [PATCH 103/885] test775: verify NTLM with too long user name set --- tests/data/Makefile.am | 2 +- tests/data/test775 | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/data/test775 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 21d20151d375..3fc7ccc0c663 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -110,7 +110,7 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \ test745 test746 test747 test748 test749 test750 test751 test752 test753 \ test754 test755 test756 test757 test758 test759 test760 test761 test762 \ test763 test764 test765 test766 test767 test768 test769 test770 test771 \ -test772 test773 test774 \ +test772 test773 test774 test775 \ test780 test781 test782 test783 test784 test785 test786 test787 test788 \ test789 test790 test791 test792 test793 test794 test796 test797 \ \ diff --git a/tests/data/test775 b/tests/data/test775 new file mode 100644 index 000000000000..d9f5b122f225 --- /dev/null +++ b/tests/data/test775 @@ -0,0 +1,67 @@ + + + +HTTP +HTTP NTLM auth +NTLM + + +# Server-side + + +# This is supposed to be returned when the server gets a first +# Authorization: NTLM line passed-in from the client + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +This is not the real page either! + + + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + + + + + +# Client-side + + +NTLM +SSL +!SSPI + + +http + + +HTTP with NTLM with too long user name + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuserAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:testpass --ntlm + + + +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + + + +100 + + + From a7ece53e96baa014911f4f4a757b78559f91d19d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 09:22:19 +0200 Subject: [PATCH 104/885] test776: NTLM with too long NTMLv2 ntresplen --- tests/data/Makefile.am | 2 +- tests/data/test776 | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 tests/data/test776 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 3fc7ccc0c663..4c13c14fd926 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -110,7 +110,7 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \ test745 test746 test747 test748 test749 test750 test751 test752 test753 \ test754 test755 test756 test757 test758 test759 test760 test761 test762 \ test763 test764 test765 test766 test767 test768 test769 test770 test771 \ -test772 test773 test774 test775 \ +test772 test773 test774 test775 test776 \ test780 test781 test782 test783 test784 test785 test786 test787 test788 \ test789 test790 test791 test792 test793 test794 test796 test797 \ \ diff --git a/tests/data/test776 b/tests/data/test776 new file mode 100644 index 000000000000..214cd5028e57 --- /dev/null +++ b/tests/data/test776 @@ -0,0 +1,51 @@ + + + +HTTP +HTTP GET +HTTP NTLM auth +NTLM + + + + + +HTTP/1.1 401 Authorization Required swsclose +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAAAAAAAABAIgAAQIDBAUGBwgAAAAAAAAAAP////8wAAAAAgD3/0F%repeat[21841 x BQUF]%BQUEAAAAA +Content-Length: 0 + + + + +# Client-side + + +NTLM +!SSPI + + +http + + +HTTP with NTLM with too long NTMLv2 ntresplen + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u user:pass --ntlm + + + +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + + + +100 + + + From 0a79a599a9c09f7173e82eec23607742667a9944 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 22 Oct 2025 12:37:59 +0200 Subject: [PATCH 105/885] transfer: fix retry for empty downloads on reuse When a reused connection did transfer 0 bytes, it assumed the transfer had failed and needed a retry. Add a check for data->red.done, so we can successfully accept the transfer of a 0-length file via SFTP. Add test case 1583 to verfiy. Fix SFTP disconnect debug trace when there was nothing to disconnect (like when reusing a connection). Fixes #19165 Reported-by: Alexander Blach Closes #19189 --- lib/transfer.c | 24 +++++++++++++++--------- lib/vssh/libssh2.c | 20 +++++++++----------- tests/data/Makefile.am | 2 +- tests/data/test1583 | 37 +++++++++++++++++++++++++++++++++++++ tests/data/test613 | 1 + tests/data/test614 | 1 + tests/libtest/test613.pl | 9 +++++++++ 7 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 tests/data/test1583 diff --git a/lib/transfer.c b/lib/transfer.c index d7014aab87e5..0269a4c2505f 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -254,6 +254,7 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, curl_off_t total_received = 0; bool is_multiplex = FALSE; bool rcvd_eagain = FALSE; + bool is_eos = FALSE; result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen); if(result) @@ -262,7 +263,6 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, /* This is where we loop until we have read everything there is to read or we get a CURLE_AGAIN */ do { - bool is_eos = FALSE; size_t bytestoread; ssize_t nread; @@ -309,9 +309,14 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, blen = (size_t)nread; is_eos = (blen == 0); - if(!blen) { - /* if we receive 0 or less here, either the data transfer is done or the - server closed the connection and we bail out from this! */ + if(!blen && (conn->recv[FIRSTSOCKET] == Curl_cf_recv)) { + /* if we receive 0 or less here and the protocol handler did not + replace the connection's `recv` callback, either the data transfer + is done or the server closed the connection and + we bail out from this! + With a `recv` replacement, we assume the protocol handler knows + what it is doing and a 0-length receive is fine. For example, + SFTP downloads of an empty file would show this. See #19165. */ if(is_multiplex) DEBUGF(infof(data, "nread == 0, stream closed, bailing")); else @@ -340,9 +345,9 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, } while(maxloops--); - if(!Curl_xfer_is_blocked(data) && + if(!is_eos && !Curl_xfer_is_blocked(data) && (!rcvd_eagain || data_pending(data, rcvd_eagain))) { - /* Did not read until EAGAIN or there is still data pending + /* Did not read until EAGAIN/EOS or there is still data pending * in buffers. Mark as read-again via simulated SELECT results. */ Curl_multi_mark_dirty(data); CURL_TRC_M(data, "sendrecv_dl() no EAGAIN/pending data, mark as dirty"); @@ -662,9 +667,10 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) !(conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_RTSP))) return CURLE_OK; - if((data->req.bytecount + data->req.headerbytecount == 0) && - conn->bits.reuse && - (!data->req.no_body || (conn->handler->protocol & PROTO_FAMILY_HTTP)) + if(conn->bits.reuse && + (data->req.bytecount + data->req.headerbytecount == 0) && + ((!data->req.no_body && !data->req.done) || + (conn->handler->protocol & PROTO_FAMILY_HTTP)) #ifndef CURL_DISABLE_RTSP && (data->set.rtspreq != RTSPREQ_RECEIVE) #endif diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index f9160944befe..c0335db9c103 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3837,18 +3837,16 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); (void)dead_connection; - DEBUGF(infof(data, "SSH DISCONNECT starts now")); - - if(sshc && sshc->ssh_session && sshp) { - /* only if there is a session still around to use! */ - myssh_state(data, sshc, SSH_SFTP_SHUTDOWN); - result = ssh_block_statemach(data, sshc, sshp, TRUE); - } - - DEBUGF(infof(data, "SSH DISCONNECT is done")); - if(sshc) + if(sshc) { + if(sshc->ssh_session && sshp) { + /* only if there is a session still around to use! */ + DEBUGF(infof(data, "SSH DISCONNECT starts now")); + myssh_state(data, sshc, SSH_SFTP_SHUTDOWN); + result = ssh_block_statemach(data, sshc, sshp, TRUE); + DEBUGF(infof(data, "SSH DISCONNECT is done -> %d", result)); + } sshc_cleanup(sshc, data, TRUE); - + } return result; } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 4c13c14fd926..595943fb6717 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -209,7 +209,7 @@ test1548 test1549 test1550 test1551 test1552 test1553 test1554 test1555 \ test1556 test1557 test1558 test1559 test1560 test1561 test1562 test1563 \ test1564 test1565 test1566 test1567 test1568 test1569 test1570 test1571 \ test1572 test1573 test1574 test1575 test1576 test1577 test1578 test1579 \ -test1580 test1581 test1582 \ +test1580 test1581 test1582 test1583 \ \ test1590 test1591 test1592 test1593 test1594 test1595 test1596 test1597 \ test1598 test1599 test1600 test1601 test1602 test1603 test1604 test1605 \ diff --git a/tests/data/test1583 b/tests/data/test1583 new file mode 100644 index 000000000000..b266d7eea8e1 --- /dev/null +++ b/tests/data/test1583 @@ -0,0 +1,37 @@ + + + +SFTP + + + +# +# Server-side + + + +# +# Client-side + + +sftp + + +%PERL %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir + + +SFTP dir and empty file + + +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: --insecure sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.dir/ --next --key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: --insecure sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.dir/emptyfile.txt + + + +# +# Verify data after the test has been "shot" + + +0 + + + diff --git a/tests/data/test613 b/tests/data/test613 index 9161bafd4603..92c7905065fb 100644 --- a/tests/data/test613 +++ b/tests/data/test613 @@ -11,6 +11,7 @@ directory d????????? N U U N ??? N NN:NN asubdir +-rw??????? 1 U U 0 Jan 1 2000 emptyfile.txt -rw??????? 1 U U 37 Jan 1 2000 plainfile.txt -r-??????? 1 U U 47 Dec 31 2000 rofile.txt diff --git a/tests/data/test614 b/tests/data/test614 index ad270c6c85ef..a113ecdd4574 100644 --- a/tests/data/test614 +++ b/tests/data/test614 @@ -12,6 +12,7 @@ directory d????????? N U U N ??? N NN:NN asubdir +-rw??????? 1 U U 0 Jan 1 2000 emptyfile.txt -r-??????? 1 U U 37 Jan 1 2000 plainfile.txt -r-??????? 1 U U 47 Dec 31 2000 rofile.txt diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index 48179833f3fc..d45e2e4e960a 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -59,6 +59,14 @@ sub errout { utime time, timegm(0,0,12,1,0,100), "plainfile.txt"; chmod 0666, "plainfile.txt"; + open(FILE, ">emptyfile.txt") || errout "$!"; + binmode FILE; + close(FILE); + # The mtime is specifically chosen to be an even number so that it can be + # represented exactly on a FAT file system. + utime time, timegm(0,0,12,1,0,100), "emptyfile.txt"; + chmod 0666, "emptyfile.txt"; + open(FILE, ">rofile.txt") || errout "$!"; binmode FILE; print FILE "Read-only test file to support curl test suite\n"; @@ -83,6 +91,7 @@ sub errout { } chmod 0666, "$dirname/rofile.txt"; unlink "$dirname/rofile.txt"; + unlink "$dirname/emptyfile.txt"; unlink "$dirname/plainfile.txt"; rmdir "$dirname/asubdir"; From a330117bb05f6b68f066a748177bfba13c4da35b Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 22 Oct 2025 15:04:53 +0200 Subject: [PATCH 106/885] smtp: fix EOB handling SMTP automatically appends a \n.\n to an upload if there is not already one at the end of the input. The implementation had a bug where this did not happen, depending on read size and buffering. Change test 900 to reproduce the failure. The bug only happened for mail body input of known length, where EOS was known on the last chunk read. Change test 900 to use an input file and make it large enough. Fixes #18798 Closes #19193 Reported-by: madoe on github --- lib/smtp.c | 49 ++++++++++++++++++++++++++-------------------- tests/data/test900 | 10 +++++++--- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/lib/smtp.c b/lib/smtp.c index 30f85357657e..3d4f36364bfa 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1927,6 +1927,7 @@ struct cr_eob_ctx { size_t eob; /* Number of bytes of the EOB (End Of Body) that have been received so far */ BIT(read_eos); /* we read an EOS from the next reader */ + BIT(processed_eos); /* we read and processed an EOS */ BIT(eos); /* we have returned an EOS */ }; @@ -1967,6 +1968,8 @@ static CURLcode cr_eob_read(struct Curl_easy *data, if(!ctx->read_eos && Curl_bufq_is_empty(&ctx->buf)) { /* Get more and convert it when needed */ result = Curl_creader_read(data, reader->next, buf, blen, &nread, &eos); + CURL_TRC_SMTP(data, "cr_eob_read, next_read(len=%zu) -> %d, %zu eos=%d", + blen, result, nread, eos); if(result) return result; @@ -2010,31 +2013,34 @@ static CURLcode cr_eob_read(struct Curl_easy *data, return result; } } + } - if(ctx->read_eos) { - /* if we last matched a CRLF or if the data was empty, add ".\r\n" - * to end the body. If we sent something and it did not end with "\r\n", - * add "\r\n.\r\n" to end the body */ - const char *eob = SMTP_EOB; - switch(ctx->n_eob) { - case 2: - /* seen a CRLF at the end, just add the remainder */ - eob = &SMTP_EOB[2]; - break; - case 3: - /* ended with '\r\n.', we should escape the last '.' */ - eob = "." SMTP_EOB; - break; - default: - break; - } - result = Curl_bufq_cwrite(&ctx->buf, eob, strlen(eob), &n); - if(result) - return result; + *peos = FALSE; + + if(ctx->read_eos && !ctx->processed_eos) { + /* if we last matched a CRLF or if the data was empty, add ".\r\n" + * to end the body. If we sent something and it did not end with "\r\n", + * add "\r\n.\r\n" to end the body */ + const char *eob = SMTP_EOB; + CURL_TRC_SMTP(data, "auto-ending mail body with '\\r\\n.\\r\\n'"); + switch(ctx->n_eob) { + case 2: + /* seen a CRLF at the end, just add the remainder */ + eob = &SMTP_EOB[2]; + break; + case 3: + /* ended with '\r\n.', we should escape the last '.' */ + eob = "." SMTP_EOB; + break; + default: + break; } + result = Curl_bufq_cwrite(&ctx->buf, eob, strlen(eob), &n); + if(result) + return result; + ctx->processed_eos = TRUE; } - *peos = FALSE; if(!Curl_bufq_is_empty(&ctx->buf)) { result = Curl_bufq_cread(&ctx->buf, buf, blen, pnread); } @@ -2043,6 +2049,7 @@ static CURLcode cr_eob_read(struct Curl_easy *data, if(ctx->read_eos && Curl_bufq_is_empty(&ctx->buf)) { /* no more data, read all, done. */ + CURL_TRC_SMTP(data, "mail body complete, returning EOS"); ctx->eos = TRUE; } *peos = ctx->eos; diff --git a/tests/data/test900 b/tests/data/test900 index 371544b7657a..f3aae4b6310f 100644 --- a/tests/data/test900 +++ b/tests/data/test900 @@ -19,14 +19,16 @@ smtp SMTP - + From: different To: another body - +%repeat[6553 x 0123456789]% + + -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T %LOGDIR/mail%TESTNUMBER @@ -45,6 +47,8 @@ From: different To: another body +%repeat[6553 x 0123456789]% + . From 9752d5fe0b935b0742792c0a3469de7c5a9d4226 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 10:51:03 +0200 Subject: [PATCH 107/885] netrc: when the cached file is discarded, unmark it as loaded Pointed out by ZeroPath Closes #19199 --- lib/netrc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/netrc.c b/lib/netrc.c index 1309d3094237..9c5c6c7f20c8 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -362,6 +362,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, } else { curlx_dyn_free(filebuf); + store->loaded = FALSE; if(!specific_login) free(login); free(password); From 2edce4406594fb30b04acc4e079fa19d5c1f53ec Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Thu, 23 Oct 2025 13:12:48 +0200 Subject: [PATCH 108/885] vtls: remove call to PKCS12_PBE_add() Curl is one of the last callers of PKCS12_PBE_add(). It has been a noop since OpenSSL 0.9.8k (2006) stubbed it out when moving the built-in PBE algorithms to a static table: https://github.com/openssl/openssl/commit/b8f702a0affa2087758230967b55df504a176774 Closes #19201 --- lib/setup-vms.h | 1 - lib/vtls/openssl.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib/setup-vms.h b/lib/setup-vms.h index 0fd5e542b775..e3777ded6e10 100644 --- a/lib/setup-vms.h +++ b/lib/setup-vms.h @@ -257,7 +257,6 @@ static struct passwd *vms_getpwuid(uid_t uid) #endif #define PEM_read_X509 PEM_READ_X509 #define PEM_write_bio_X509 PEM_WRITE_BIO_X509 -#define PKCS12_PBE_add PKCS12_PBE_ADD #define PKCS12_free PKCS12_FREE #define PKCS12_parse PKCS12_PARSE #define RAND_add RAND_ADD diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 336902b95105..535e4118da81 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1578,8 +1578,6 @@ static int pkcs12load(struct Curl_easy *data, return 0; } - PKCS12_PBE_add(); - if(!PKCS12_parse(p12, key_passwd, &pri, &x509, &ca)) { failf(data, "could not parse PKCS12 file, check password, " OSSL_PACKAGE From 0d1d35fa346907dc3a289a477962ee6b58205cbe Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 11:16:03 +0200 Subject: [PATCH 109/885] http: only accept ';' as a separator for custom headers When parsing incoming headers, they need to have a plain normal colon. Previously out of convenience we used the same parser function for both cases (incoming + custom set headers via the API) which made the function too liberal for incoming HTTP traffic. Closes #19200 --- lib/http.c | 74 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/lib/http.c b/lib/http.c index 44d36b9a847a..0b55796dc529 100644 --- a/lib/http.c +++ b/lib/http.c @@ -277,14 +277,13 @@ static bool http_header_is_empty(const char *header) /* * Strip off leading and trailing whitespace from the value in the given HTTP - * header line and return a strdup()ed copy. Returns NULL in case of - * allocation failure or bad input. Returns an empty string if the header - * value consists entirely of whitespace. + * header line and return a strdup()ed copy in 'valp' - returns an empty + * string if the header value consists entirely of whitespace. * - * If the header is provided as "name;", ending with a semicolon, it must - * return a blank string. + * If the header is provided as "name;", ending with a semicolon, it returns a + * blank string. */ -char *Curl_copy_header_value(const char *header) +static CURLcode copy_custom_value(const char *header, char **valp) { struct Curl_str out; @@ -294,9 +293,37 @@ char *Curl_copy_header_value(const char *header) curlx_str_untilnl(&header, &out, MAX_HTTP_RESP_HEADER_SIZE); curlx_str_trimblanks(&out); - return Curl_memdup0(curlx_str(&out), curlx_strlen(&out)); + *valp = Curl_memdup0(curlx_str(&out), curlx_strlen(&out)); + if(*valp) + return CURLE_OK; + return CURLE_OUT_OF_MEMORY; } /* bad input */ + *valp = NULL; + return CURLE_BAD_FUNCTION_ARGUMENT; +} + +/* + * Strip off leading and trailing whitespace from the value in the given HTTP + * header line and return a strdup()ed copy in 'valp' - returns an empty + * string if the header value consists entirely of whitespace. + * + * This function MUST be used after the header has already been confirmed to + * lead with "word:". + */ +char *Curl_copy_header_value(const char *header) +{ + struct Curl_str out; + + /* find the end of the header name */ + if(!curlx_str_until(&header, &out, MAX_HTTP_RESP_HEADER_SIZE, ':') && + !curlx_str_single(&header, ':')) { + curlx_str_untilnl(&header, &out, MAX_HTTP_RESP_HEADER_SIZE); + curlx_str_trimblanks(&out); + return Curl_memdup0(curlx_str(&out), curlx_strlen(&out)); + } + /* bad input, should never happen */ + DEBUGASSERT(0); return NULL; } @@ -1906,9 +1933,10 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data) custom Host: header if this is NOT a redirect, as setting Host: in the redirected request is being out on thin ice. Except if the hostname is the same as the first one! */ - char *cookiehost = Curl_copy_header_value(ptr); - if(!cookiehost) - return CURLE_OUT_OF_MEMORY; + char *cookiehost; + CURLcode result = copy_custom_value(ptr, &cookiehost); + if(result) + return result; if(!*cookiehost) /* ignore empty data */ free(cookiehost); @@ -2657,7 +2685,6 @@ static CURLcode http_add_connection_hd(struct Curl_easy *data, const char *sep = "Connection: "; CURLcode result = CURLE_OK; size_t rlen = curlx_dyn_len(req); - char *value; bool skip; /* Add the 1st custom "Connection: " header, if there is one */ @@ -2665,9 +2692,10 @@ static CURLcode http_add_connection_hd(struct Curl_easy *data, if(curl_strnequal(head->data, "Connection", 10) && Curl_headersep(head->data[10]) && !http_header_is_empty(head->data)) { - value = Curl_copy_header_value(head->data); - if(!value) - return CURLE_OUT_OF_MEMORY; + char *value; + result = copy_custom_value(head->data, &value); + if(result) + return result; result = curlx_dyn_addf(req, "%s%s", sep, value); sep = ", "; free(value); @@ -3346,11 +3374,11 @@ static CURLcode http_header_p(struct Curl_easy *data, #endif if((407 == k->httpcode) && HD_IS(hd, hdlen, "Proxy-authenticate:")) { char *auth = Curl_copy_header_value(hd); - CURLcode result; - if(!auth) - return CURLE_OUT_OF_MEMORY; - result = Curl_http_input_auth(data, TRUE, auth); - free(auth); + CURLcode result = auth ? CURLE_OK : CURLE_OUT_OF_MEMORY; + if(!result) { + result = Curl_http_input_auth(data, TRUE, auth); + free(auth); + } return result; } #ifdef USE_SPNEGO @@ -3525,9 +3553,11 @@ static CURLcode http_header_w(struct Curl_easy *data, if((401 == k->httpcode) && HD_IS(hd, hdlen, "WWW-Authenticate:")) { char *auth = Curl_copy_header_value(hd); if(!auth) - return CURLE_OUT_OF_MEMORY; - result = Curl_http_input_auth(data, FALSE, auth); - free(auth); + result = CURLE_OUT_OF_MEMORY; + else { + result = Curl_http_input_auth(data, FALSE, auth); + free(auth); + } } return result; } From 3ac38a6b80e16f5885e629b35cb5a36a006ea8a5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 23 Oct 2025 15:10:30 +0200 Subject: [PATCH 110/885] md4: drop mbedtls implementation (not available in mbedtls v3+) Follow-up to 01a2308236ffd4a13a45c3d9850a66a602839af6 #18254 Closes #19202 --- lib/md4.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/lib/md4.c b/lib/md4.c index 5d0908eadefa..083ecb0d48f2 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -51,14 +51,6 @@ #endif #endif -#ifdef USE_MBEDTLS -#include -#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_MD4_C) -#define USE_MBEDTLS_MD4 -#include -#endif -#endif - /* When OpenSSL or wolfSSL is available, we use their MD4 functions. */ #if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4) #include @@ -78,8 +70,6 @@ #include #elif defined(USE_GNUTLS) #include -#elif defined(USE_MBEDTLS_MD4) -#include #endif /* The last 2 #include files should be in this order */ @@ -187,39 +177,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) md4_digest(ctx, MD4_DIGEST_SIZE, result); } -#elif defined(USE_MBEDTLS_MD4) - -struct md4_ctx { - void *data; - unsigned long size; -}; -typedef struct md4_ctx MD4_CTX; - -static int MD4_Init(MD4_CTX *ctx) -{ - ctx->data = NULL; - ctx->size = 0; - return 1; -} - -static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size) -{ - if(!ctx->data) { - ctx->data = Curl_memdup(data, size); - if(ctx->data) - ctx->size = size; - } -} - -static void MD4_Final(unsigned char *result, MD4_CTX *ctx) -{ - if(ctx->data) { - mbedtls_md4(ctx->data, ctx->size, result); - Curl_safefree(ctx->data); - ctx->size = 0; - } -} - #else /* When no other crypto library is available, or the crypto library does not * support MD4, we use this code segment this implementation of it From 3692cd837e327bad414769a4af8a73efaeb864f2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 16:00:46 +0200 Subject: [PATCH 111/885] schannel: replace a run-time condition with an assert For detecting a bad function argument that probably also would cause a compiler warning. Closes #19203 --- lib/vtls/schannel.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 9b2b1e702e81..2e29ea2f185e 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1711,15 +1711,11 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, failf(data, "schannel: unexpected call to schannel_recv_renegotiate"); return CURLE_SSL_CONNECT_ERROR; } - + DEBUGASSERT(caller <= SCH_RENEG_CALLER_IS_SEND); if(caller == SCH_RENEG_CALLER_IS_RECV) SCH_DEV(infof(data, "schannel: renegotiation caller is schannel_recv")); - else if(caller == SCH_RENEG_CALLER_IS_SEND) + else SCH_DEV(infof(data, "schannel: renegotiation caller is schannel_send")); - else { - failf(data, "schannel: unknown caller for schannel_recv_renegotiate"); - return CURLE_SSL_CONNECT_ERROR; - } sockfd = Curl_conn_cf_get_socket(cf, data); From 48d314f262f865d645004f345e1e4b3bb7f6b738 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 16:20:01 +0200 Subject: [PATCH 112/885] connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply Since using CONNECT_ONLY is by defintion only a connect, we make the timeleft function return 0 after the connection is done so that it does not - surprisingly - timeout later. Fixes #18991 Reported-by: Pavel P Closes #19204 --- lib/connect.c | 6 +++--- lib/pingpong.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/connect.c b/lib/connect.c index 5dc4e2fc747b..e3295524b0ec 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -123,7 +123,7 @@ timediff_t Curl_timeleft(struct Curl_easy *data, before the connect timeout expires and we must acknowledge whichever timeout that is reached first. The total timeout is set per entire operation, while the connect timeout is set per connect. */ - if(data->set.timeout <= 0 && !duringconnect) + if((!data->set.timeout || data->set.connect_only) && !duringconnect) return 0; /* no timeout in place or checked, return "no limit" */ if(!nowp) { @@ -131,9 +131,9 @@ timediff_t Curl_timeleft(struct Curl_easy *data, nowp = &now; } - if(data->set.timeout > 0) { + if(data->set.timeout) { timeleft_ms = data->set.timeout - - curlx_timediff(*nowp, data->progress.t_startop); + curlx_timediff(*nowp, data->progress.t_startop); if(!timeleft_ms) timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ if(!duringconnect) diff --git a/lib/pingpong.c b/lib/pingpong.c index 3f6da71eae2c..0a15e33f0a31 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -64,7 +64,7 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, full response to arrive before we bail out */ timeout_ms = response_time - curlx_timediff(now, pp->response); - if((data->set.timeout > 0) && !disconnecting) { + if(data->set.timeout && !disconnecting) { /* if timeout is requested, find out how much overall remains */ timediff_t timeout2_ms = Curl_timeleft(data, &now, FALSE); /* pick the lowest number */ From e51966d9df6d92308f813a0f7a2dd95f20e09936 Mon Sep 17 00:00:00 2001 From: Dalei Date: Fri, 24 Oct 2025 08:02:47 +0000 Subject: [PATCH 113/885] tool_cfgable: remove superfluous free calls Fixes #19213 Closes #19214 --- src/tool_cfgable.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 48148a88ad5b..29d5ecc78220 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -184,8 +184,6 @@ static void free_config_fields(struct OperationConfig *config) tool_safefree(config->ftp_account); tool_safefree(config->ftp_alternative_to_user); tool_safefree(config->aws_sigv4); - tool_safefree(config->proto_str); - tool_safefree(config->proto_redir_str); tool_safefree(config->ech); tool_safefree(config->ech_config); tool_safefree(config->ech_public); From 576f9f7c07f0635b2f1614e1056bf80742b6dbe3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 24 Oct 2025 08:55:01 +0200 Subject: [PATCH 114/885] cfilters: check return code from Curl_pollset_set_out_only() I added WARN_UNUSED_RESULT to two of the cfilter functions to make this mistake harder to slip in next time. Pointed out by CodeSonar Closes #19211 --- lib/cfilters.c | 5 +++-- lib/select.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index 2ef5d75d431c..090365fdd6ed 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -542,8 +542,9 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, Curl_pollfds_reset(&cpfds); /* In general, we want to send after connect, wait on that. */ if(sockfd != CURL_SOCKET_BAD) - Curl_pollset_set_out_only(data, &ps, sockfd); - result = Curl_conn_adjust_pollset(data, data->conn, &ps); + result = Curl_pollset_set_out_only(data, &ps, sockfd); + if(!result) + result = Curl_conn_adjust_pollset(data, data->conn, &ps); if(result) goto out; result = Curl_pollfds_add_ps(&cpfds, &ps); diff --git a/lib/select.h b/lib/select.h index a23921ceb999..c1f975e9d79c 100644 --- a/lib/select.h +++ b/lib/select.h @@ -154,11 +154,12 @@ void Curl_pollset_move(struct easy_pollset *to, struct easy_pollset *from); */ CURLcode Curl_pollset_change(struct Curl_easy *data, struct easy_pollset *ps, curl_socket_t sock, - int add_flags, int remove_flags); + int add_flags, + int remove_flags) WARN_UNUSED_RESULT; CURLcode Curl_pollset_set(struct Curl_easy *data, struct easy_pollset *ps, curl_socket_t sock, - bool do_in, bool do_out); + bool do_in, bool do_out) WARN_UNUSED_RESULT; #define Curl_pollset_add_in(data, ps, sock) \ Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0) From ab590ba62f4974b2f51cdbd7ee42d93b0f81568f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 24 Oct 2025 09:22:40 +0200 Subject: [PATCH 115/885] TODO: a fixed FTP directory listing format Closes #19212 --- docs/TODO | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/TODO b/docs/TODO index 6c3ba904e721..add6819eae77 100644 --- a/docs/TODO +++ b/docs/TODO @@ -54,6 +54,7 @@ 4. FTP 4.1 HOST + 4.2 A fixed directory listing format 4.6 GSSAPI via Windows SSPI 4.7 STAT for LIST without data connection 4.8 Passive transfer could try other IP addresses @@ -484,6 +485,16 @@ https://datatracker.ietf.org/doc/html/rfc7151 +4.2 A fixed directory listing format + + Since listing the contents of a remove directory with FTP is returning the + list in a format and style the server likes without any estblished or even + defactor standard existing, it would be a feature to users if curl could + parse the directory listing and output a general curl format that is fixed + and the same, independent of the server's choice. This would allow users to + better and more reliably extract information about remote content via FTP + directory listings. + 4.6 GSSAPI via Windows SSPI In addition to currently supporting the SASL GSSAPI mechanism (Kerberos V5) From 1de4a9a5fb09198a39040ffdbb93cea0d68cce85 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 00:55:37 +0200 Subject: [PATCH 116/885] mbedtls: fix building with <3.6.1 ``` lib/vtls/mbedtls.c:786:3: error: call to undeclared function 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 786 | mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config, | ^ lib/vtls/mbedtls.c:787:5: error: use of undeclared identifier 'MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED'; did you mean 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH'? 787 | MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH dep/mbedtls-3.4.0/_pkg/include/mbedtls/ssl.h:700:5: note: 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH' declared here 700 | MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH, | ^ 2 errors generated. ``` Regression from d63e40f8e6298efaabae57c714ef8df57c54474d #18271 (8.16.0) Closes #19208 --- lib/vtls/mbedtls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 5ee0c814fd3d..89157f655fe6 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -779,7 +779,8 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_SSL_CONNECT_ERROR; } -#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_SSL_SESSION_TICKETS) +#if defined(MBEDTLS_SSL_SESSION_TICKETS) && \ + MBEDTLS_VERSION_NUMBER >= 0x03060100 && MBEDTLS_VERSION_NUMBER < 0x04000000 /* New in mbedTLS 3.6.1, need to enable, default is now disabled. 4.0.0 enabled it by default for TLSv1.3. */ mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config, From 4a6fbd5e1dd584c85c4936a1bfd08f2b12a2ea4b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 23 Oct 2025 22:08:53 +0200 Subject: [PATCH 117/885] NTLM: disable if DES support missing from OpenSSL or mbedTLS Make autotools and cmake detect DES support in OpenSSL and mbedTLS. Forward feature macros to C and omit NTLM from the feature preview list. Use the feature macros in source. This ensure that `-V` output matches the preview. OpenSSL doesn't support DES when built with `no-des` or `no-deprecated`. mbedTLS 4.x no longer supports it, and it's possible to disable it in <4 with `scripts/config.py unset MBEDTLS_DES_C`. Before this patch this worked for mbedTLS 4 only, and with a regression for pending PR #16973. Also: - drop NTLM feature check from `curl_setup.h` in favour of autotools/ cmake feature macros. This makes `curl_setup.h` no longer need to include an mbedTLS header, which in turn makes tests/server build without depending on mbedTLS. Fixing, in #16973: ``` In file included from tests/server/first.h:40, from bld/tests/server/servers.c:3: lib/curl_setup.h:741:10: fatal error: mbedtls/version.h: No such file or directory 741 | #include | ^~~~~~~~~~~~~~~~~~~ ``` Ref: https://github.com/curl/curl/actions/runs/18689537893/job/53291322012?pr=16973 Ref: #19181 (initial fix idea) Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077 - move back mbedTLS header include and version check from `curl_setup.h` to each source which consumes mbedTLS. - GHA/http3-linux: drop workaround that disabled NTLM for `no-deprecated` OpenSSL builds. Follow-up to 006977859dcc4b8670878bd669276d778a2715bb #12384 - curl_ntlm_core: drop pointless macro `CURL_NTLM_NOT_SUPPORTED`. Follow-up to 006977859dcc4b8670878bd669276d778a2715bb #12384 Closes #19206 --- .github/workflows/http3-linux.yml | 34 +++++++++---------------------- CMakeLists.txt | 19 +++++++++++++++-- configure.ac | 7 +++---- docs/INSTALL-CMAKE.md | 2 ++ lib/curl_config.h.cmake | 10 +++++++-- lib/curl_ntlm_core.c | 34 +++++++++++++------------------ lib/curl_setup.h | 11 ++-------- lib/md5.c | 4 ++++ lib/sha256.c | 4 ++++ lib/vtls/mbedtls.c | 3 +++ m4/curl-mbedtls.m4 | 23 +++++---------------- m4/curl-openssl.m4 | 23 +++++++++++++++++++++ 12 files changed, 95 insertions(+), 79 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 8971fc4e5408..668de7ede413 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -334,8 +334,7 @@ jobs: PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig configure: >- LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib - --with-ngtcp2 --disable-ntlm - --with-openssl=/home/runner/openssl/build --enable-ssls-export + --with-openssl=/home/runner/openssl/build --with-ngtcp2 --enable-ssls-export - name: 'openssl' install_steps: skipall @@ -343,7 +342,6 @@ jobs: generate: >- -DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_NGTCP2=ON -DCURL_DISABLE_LDAP=ON - -DCURL_DISABLE_NTLM=ON -DCMAKE_UNITY_BUILD=ON - name: 'libressl' @@ -351,29 +349,25 @@ jobs: PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig configure: >- LDFLAGS=-Wl,-rpath,/home/runner/libressl/build/lib - --with-ngtcp2 --disable-ntlm - --with-openssl=/home/runner/libressl/build --enable-ssls-export + --with-openssl=/home/runner/libressl/build --with-ngtcp2 --enable-ssls-export --enable-unity - name: 'libressl' PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig generate: >- - -DOPENSSL_ROOT_DIR=/home/runner/libressl/build - -DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON + -DOPENSSL_ROOT_DIR=/home/runner/libressl/build -DUSE_NGTCP2=ON - name: 'awslc' install_steps: skipall PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig configure: >- LDFLAGS=-Wl,-rpath,/home/runner/awslc/build/lib - --with-ngtcp2 --disable-ntlm - --with-openssl=/home/runner/awslc/build --enable-ssls-export + --with-openssl=/home/runner/awslc/build --with-ngtcp2 --enable-ssls-export - name: 'awslc' PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig generate: >- - -DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DBUILD_SHARED_LIBS=OFF - -DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON + -DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_UNITY_BUILD=ON - name: 'boringssl' @@ -381,14 +375,12 @@ jobs: 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 configure: >- LDFLAGS=-Wl,-rpath,/home/runner/boringssl/build/lib - --with-ngtcp2 --disable-ntlm - --with-openssl=/home/runner/boringssl/build --enable-ssls-export + --with-openssl=/home/runner/boringssl/build --with-ngtcp2 --enable-ssls-export - name: 'boringssl' 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 generate: >- - -DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DBUILD_SHARED_LIBS=OFF - -DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON + -DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_UNITY_BUILD=ON - name: 'gnutls' @@ -397,15 +389,13 @@ jobs: PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig configure: >- LDFLAGS=-Wl,-rpath,/home/runner/gnutls/build/lib - --with-ngtcp2 - --with-gnutls=/home/runner/gnutls/build --enable-ssls-export + --with-gnutls=/home/runner/gnutls/build --with-ngtcp2 --enable-ssls-export - name: 'gnutls' install_packages: nettle-dev libp11-kit-dev PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig generate: >- - -DCURL_USE_GNUTLS=ON - -DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON + -DCURL_USE_GNUTLS=ON -DUSE_NGTCP2=ON -DCMAKE_UNITY_BUILD=ON - name: 'wolfssl' @@ -413,9 +403,7 @@ jobs: PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig configure: >- LDFLAGS=-Wl,-rpath,/home/runner/wolfssl/build/lib - --with-ngtcp2 - --with-wolfssl=/home/runner/wolfssl/build - --enable-ech --enable-ssls-export + --with-wolfssl=/home/runner/wolfssl/build --with-ngtcp2 --enable-ech --enable-ssls-export --enable-unity - name: 'wolfssl' @@ -429,7 +417,6 @@ jobs: PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig configure: >- LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib - --disable-ntlm --with-openssl=/home/runner/openssl/build --with-openssl-quic - name: 'openssl-quic' @@ -437,7 +424,6 @@ jobs: generate: >- -DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_OPENSSL_QUIC=ON -DCURL_DISABLE_LDAP=ON - -DCURL_DISABLE_NTLM=ON -DCMAKE_UNITY_BUILD=ON - name: 'quiche' diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a6a7314266e..da3b99cff44a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -868,6 +868,18 @@ if(CURL_USE_MBEDTLS) set(_valid_default_ssl_backend TRUE) endif() set(_curl_ca_bundle_supported TRUE) + + if(MBEDTLS_VERSION VERSION_GREATER_EQUAL 4.0.0) + set(HAVE_MBEDTLS_DES_CRYPT_ECB 0) # pre-fill detection result + endif() + if(NOT DEFINED HAVE_MBEDTLS_DES_CRYPT_ECB) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${MBEDTLS_LIBRARIES}") + curl_required_libpaths("${MBEDTLS_LIBRARY_DIRS}") + check_function_exists("mbedtls_des_crypt_ecb" HAVE_MBEDTLS_DES_CRYPT_ECB) # in mbedTLS <4 + cmake_pop_check_state() + endif() endif() if(CURL_USE_WOLFSSL) @@ -1075,6 +1087,9 @@ if(USE_WOLFSSL) endif() if(USE_OPENSSL) + if(NOT DEFINED HAVE_DES_ECB_ENCRYPT) + curl_openssl_check_exists("DES_ecb_encrypt" "openssl/des.h" HAVE_DES_ECB_ENCRYPT) + endif() if(NOT DEFINED HAVE_SSL_SET0_WBIO) curl_openssl_check_exists("SSL_set0_wbio" HAVE_SSL_SET0_WBIO) endif() @@ -2079,8 +2094,8 @@ endmacro() # NTLM support requires crypto functions from various SSL libs. # These conditions must match those in lib/curl_setup.h. if(NOT CURL_DISABLE_NTLM AND - (USE_OPENSSL OR - (USE_MBEDTLS AND MBEDTLS_VERSION VERSION_LESS 4.0.0) OR + ((USE_OPENSSL AND HAVE_DES_ECB_ENCRYPT) OR + (USE_MBEDTLS AND HAVE_MBEDTLS_DES_CRYPT_ECB) OR USE_GNUTLS OR USE_WIN32_CRYPTO OR (USE_WOLFSSL AND HAVE_WOLFSSL_DES_ECB_ENCRYPT))) diff --git a/configure.ac b/configure.ac index 97d031049775..cc16f4120af5 100644 --- a/configure.ac +++ b/configure.ac @@ -5252,12 +5252,11 @@ fi use_curl_ntlm_core=no if test "x$CURL_DISABLE_NTLM" != "x1"; then - if test "x$OPENSSL_ENABLED" = "x1" \ + if test "x$HAVE_DES_ECB_ENCRYPT" = "x1" \ -o "x$GNUTLS_ENABLED" = "x1" \ -o "x$USE_WIN32_CRYPTO" = "x1" \ - -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1"; then - use_curl_ntlm_core=yes - elif test "x$MBEDTLS_ENABLED" = "x1" && test "$mbedtls_4" = "0"; then + -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1" \ + -o "x$HAVE_MBEDTLS_DES_CRYPT_ECB" = "x1"; then use_curl_ntlm_core=yes fi diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index c622b8392098..4b9b85326ff0 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -491,9 +491,11 @@ the parent project, ideally in the "extra" find package redirect file: Available variables: +- `HAVE_DES_ECB_ENCRYPT`: `DES_ecb_encrypt` present in OpenSSL (or fork). - `HAVE_GNUTLS_SRP`: `gnutls_srp_verifier` present in GnuTLS. - `HAVE_LDAP_INIT_FD`: `ldap_init_fd` present in LDAP library. - `HAVE_LDAP_URL_PARSE`: `ldap_url_parse` present in LDAP library. +- `HAVE_MBEDTLS_DES_CRYPT_ECB`: `mbedtls_des_crypt_ecb` present in mbedTLS <4. - `HAVE_OPENSSL_SRP`: `SSL_CTX_set_srp_username` present in OpenSSL (or fork). - `HAVE_QUICHE_CONN_SET_QLOG_FD`: `quiche_conn_set_qlog_fd` present in quiche. - `HAVE_RUSTLS_SUPPORTED_HPKE`: `rustls_supported_hpke` present in Rustls (unused if Rustls is detected via `pkg-config`). diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 1fabc24c182f..88b991d7ef94 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -673,6 +673,9 @@ ${SIZEOF_TIME_T_CODE} /* if mbedTLS is enabled */ #cmakedefine USE_MBEDTLS 1 +/* if mbedTLS <4 has the mbedtls_des_crypt_ecb function. */ +#cmakedefine HAVE_MBEDTLS_DES_CRYPT_ECB 1 + /* if Rustls is enabled */ #cmakedefine USE_RUSTLS 1 @@ -801,7 +804,10 @@ ${SIZEOF_TIME_T_CODE} #cmakedefine USE_ECH 1 /* Define to 1 if you have the wolfSSL_CTX_GenerateEchConfig function. */ -#cmakedefine HAVE_WOLFSSL_CTX_GENERATEECHCONFIG +#cmakedefine HAVE_WOLFSSL_CTX_GENERATEECHCONFIG 1 /* Define to 1 if you have the SSL_set1_ech_config_list function. */ -#cmakedefine HAVE_SSL_SET1_ECH_CONFIG_LIST +#cmakedefine HAVE_SSL_SET1_ECH_CONFIG_LIST 1 + +/* Define to 1 if OpenSSL has the DES_ecb_encrypt function. */ +#cmakedefine HAVE_DES_ECB_ENCRYPT 1 diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index a81e97f0ce72..be273f0c90ee 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -50,21 +50,19 @@ in NTLM type-3 messages. */ -#ifdef USE_OPENSSL - #include - #if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_DEPRECATED_3_0) - #define USE_OPENSSL_DES - #endif -#elif defined(USE_WOLFSSL) - #include - #ifndef NO_DES3 - #define USE_OPENSSL_DES - #endif -#elif defined(USE_MBEDTLS) - #include - #if MBEDTLS_VERSION_NUMBER < 0x04000000 - #define USE_MBEDTLS_DES - #endif +#ifdef USE_MBEDTLS +#include +#if MBEDTLS_VERSION_NUMBER < 0x03020000 + #error "mbedTLS 3.2.0 or later required" +#endif +#endif + +#if defined(USE_OPENSSL) && defined(HAVE_DES_ECB_ENCRYPT) + #define USE_OPENSSL_DES +#elif defined(USE_WOLFSSL) && defined(HAVE_WOLFSSL_DES_ECB_ENCRYPT) + #define USE_OPENSSL_DES +#elif defined(USE_MBEDTLS) && defined(HAVE_MBEDTLS_DES_CRYPT_ECB) + #define USE_MBEDTLS_DES #endif #ifdef USE_OPENSSL_DES @@ -79,6 +77,7 @@ # endif # define DESKEY(x) &x #else +# include # include # include # include @@ -111,7 +110,6 @@ # include #else # error "cannot compile NTLM support without a crypto library with DES." -# define CURL_NTLM_NOT_SUPPORTED #endif #include "urldata.h" @@ -128,7 +126,6 @@ #include "curl_memory.h" #include "memdebug.h" -#ifndef CURL_NTLM_NOT_SUPPORTED /* * Turns a 56-bit key into being 64-bit wide. */ @@ -143,7 +140,6 @@ static void extend_key_56_to_64(const unsigned char *key_56, char *key) key[6] = (char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6)); key[7] = (char) ((key_56[6] << 1) & 0xFF); } -#endif #ifdef USE_OPENSSL_DES /* @@ -328,11 +324,9 @@ CURLcode Curl_ntlm_core_mk_lm_hash(const char *password, unsigned char *lmbuffer /* 21 bytes */) { unsigned char pw[14]; -#ifndef CURL_NTLM_NOT_SUPPORTED static const unsigned char magic[] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 /* i.e. KGS!@#$% */ }; -#endif size_t len = CURLMIN(strlen(password), 14); Curl_strntoupper((char *)pw, password, len); diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 4934baa22b71..7c033623c5ff 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -737,13 +737,6 @@ # endif #endif -#ifdef USE_MBEDTLS -#include -#if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" -#endif -#endif - #if defined(USE_WOLFSSL) && defined(USE_GNUTLS) /* Avoid defining unprefixed wolfSSL SHA macros colliding with nettle ones */ #define NO_OLD_WC_NAMES @@ -763,9 +756,9 @@ /* Single point where USE_NTLM definition might be defined */ #ifndef CURL_DISABLE_NTLM -# if defined(USE_OPENSSL) || \ +# if (defined(USE_OPENSSL) && defined(HAVE_DES_ECB_ENCRYPT)) || \ defined(USE_GNUTLS) || \ - (defined(USE_MBEDTLS) && MBEDTLS_VERSION_NUMBER < 0x04000000) || \ + (defined(USE_MBEDTLS) && defined(HAVE_MBEDTLS_DES_CRYPT_ECB)) || \ defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) || \ (defined(USE_WOLFSSL) && defined(HAVE_WOLFSSL_DES_ECB_ENCRYPT)) # define USE_CURL_NTLM_CORE diff --git a/lib/md5.c b/lib/md5.c index 897bd1b1a407..d99554a4aac9 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -49,6 +49,10 @@ #endif #ifdef USE_MBEDTLS + #include + #if MBEDTLS_VERSION_NUMBER < 0x03020000 + #error "mbedTLS 3.2.0 or later required" + #endif #include #if defined(PSA_WANT_ALG_MD5) && PSA_WANT_ALG_MD5 /* mbedTLS 4+ */ #define USE_MBEDTLS_MD5 diff --git a/lib/sha256.c b/lib/sha256.c index cf8e98a550e5..f7bb5456133d 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -33,6 +33,10 @@ #include "curl_hmac.h" #ifdef USE_MBEDTLS + #include + #if MBEDTLS_VERSION_NUMBER < 0x03020000 + #error "mbedTLS 3.2.0 or later required" + #endif #include #if defined(PSA_WANT_ALG_SHA_256) && PSA_WANT_ALG_SHA_256 /* mbedTLS 4+ */ #define USE_MBEDTLS_SHA256 diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 89157f655fe6..5a2310d115a1 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -37,6 +37,9 @@ /* #define MBEDTLS_DEBUG */ #include +#if MBEDTLS_VERSION_NUMBER < 0x03020000 + #error "mbedTLS 3.2.0 or later required" +#endif #include #include #include diff --git a/m4/curl-mbedtls.m4 b/m4/curl-mbedtls.m4 index 55152c54081b..573db4c3ab8f 100644 --- a/m4/curl-mbedtls.m4 +++ b/m4/curl-mbedtls.m4 @@ -107,24 +107,11 @@ if test "x$OPT_MBEDTLS" != xno; then LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mbedtls mbedx509 mbedcrypto" fi - mbedtls_4=0 - AC_MSG_CHECKING([for mbedTLS >= v4]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - #if (MBEDTLS_VERSION_NUMBER >= 0x04000000) - return 0; - #else - #error older than 4 - #endif - ]]) - ],[ - mbedtls_4=1 - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - ]) + dnl Check DES support in mbedTLS <4. + AC_CHECK_FUNCS(mbedtls_des_crypt_ecb) + if test "$ac_cv_func_mbedtls_des_crypt_ecb" = 'yes'; then + HAVE_MBEDTLS_DES_CRYPT_ECB=1 + fi fi fi dnl mbedTLS not disabled diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index 56245c9c2a9e..5175bb85d262 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -340,6 +340,29 @@ if test X"$OPT_OPENSSL" != Xno && AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected]) fi +dnl --- +dnl We check OpenSSL for DES support. +dnl --- +if test "$OPENSSL_ENABLED" = "1"; then + AC_MSG_CHECKING([for DES support in OpenSSL]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #ifndef OPENSSL_SUPPRESS_DEPRECATED + #define OPENSSL_SUPPRESS_DEPRECATED + #endif + #include + ]],[[ + DES_ecb_encrypt(0, 0, 0, DES_ENCRYPT); + ]]) + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_DES_ECB_ENCRYPT, 1, [if you have the function DES_ecb_encrypt]) + HAVE_DES_ECB_ENCRYPT=1 + ],[ + AC_MSG_RESULT([no]) + ]) +fi + dnl --- dnl We require OpenSSL with SRP support. dnl --- From c96b7c4636b03c0a9c4e8303852553c4217446ee Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 02:28:46 +0200 Subject: [PATCH 118/885] des: merge curl_des into `curl_ntlm_core.c` `curl_des.c` contained a single, short, function `Curl_des_set_odd_parity()`, called from `curl_ntlm_core.c` alone. Move it there, and define it only when needed. Follow-up to 300876a7a62ff598c3be359e45a00b79cf9944ad Follow-up to 8cc70db2db5f58e519a1bdfed266ca6514013145 Closes #19209 --- .github/labeler.yml | 2 +- lib/Makefile.inc | 2 -- lib/curl_des.c | 68 -------------------------------------------- lib/curl_des.h | 39 ------------------------- lib/curl_ntlm_core.c | 48 ++++++++++++++++++++++++++++--- 5 files changed, 45 insertions(+), 114 deletions(-) delete mode 100644 lib/curl_des.c delete mode 100644 lib/curl_des.h diff --git a/.github/labeler.yml b/.github/labeler.yml index 770b293e3f96..75ea8686da0a 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -162,9 +162,9 @@ cryptography: docs/libcurl/opts/CURLOPT_EGDSOCKET*,\ lib/*sha256*,\ lib/*sha512*,\ - lib/curl_des.*,\ lib/curl_hmac.*,\ lib/curl_md?.*,\ + lib/curl_ntlm_core.*,\ lib/md?.*,\ lib/rand.*\ }" diff --git a/lib/Makefile.inc b/lib/Makefile.inc index f06af2ca70e3..8b506febcfab 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -160,7 +160,6 @@ LIB_CFILES = \ cookie.c \ cshutdn.c \ curl_addrinfo.c \ - curl_des.c \ curl_endian.c \ curl_fnmatch.c \ curl_fopen.c \ @@ -290,7 +289,6 @@ LIB_HFILES = \ cookie.h \ curl_addrinfo.h \ curl_ctype.h \ - curl_des.h \ curl_endian.h \ curl_fnmatch.h \ curl_fopen.h \ diff --git a/lib/curl_des.c b/lib/curl_des.c deleted file mode 100644 index a202dd3fe4a5..000000000000 --- a/lib/curl_des.c +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Steve Holme, . - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include "curl_setup.h" - -#if defined(USE_CURL_NTLM_CORE) && \ - (defined(USE_GNUTLS) || \ - defined(USE_OS400CRYPTO) || \ - defined(USE_WIN32_CRYPTO)) - -#include "curl_des.h" - -/* - * Curl_des_set_odd_parity() - * - * This is used to apply odd parity to the given byte array. It is typically - * used by when a cryptography engine does not have its own version. - * - * The function is a port of the Java based oddParity() function over at: - * - * https://davenport.sourceforge.net/ntlm.html - * - * Parameters: - * - * bytes [in/out] - The data whose parity bits are to be adjusted for - * odd parity. - * len [out] - The length of the data. - */ -void Curl_des_set_odd_parity(unsigned char *bytes, size_t len) -{ - size_t i; - - for(i = 0; i < len; i++) { - unsigned char b = bytes[i]; - - bool needs_parity = (((b >> 7) ^ (b >> 6) ^ (b >> 5) ^ - (b >> 4) ^ (b >> 3) ^ (b >> 2) ^ - (b >> 1)) & 0x01) == 0; - - if(needs_parity) - bytes[i] |= 0x01; - else - bytes[i] &= 0xfe; - } -} - -#endif diff --git a/lib/curl_des.h b/lib/curl_des.h deleted file mode 100644 index c50aaf45b176..000000000000 --- a/lib/curl_des.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef HEADER_CURL_DES_H -#define HEADER_CURL_DES_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Steve Holme, . - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include "curl_setup.h" - -#if defined(USE_CURL_NTLM_CORE) && \ - (defined(USE_GNUTLS) || \ - defined(USE_OS400CRYPTO) || \ - defined(USE_WIN32_CRYPTO)) - -/* Applies odd parity to the given byte array */ -void Curl_des_set_odd_parity(unsigned char *bytes, size_t length); - -#endif - -#endif /* HEADER_CURL_DES_H */ diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index be273f0c90ee..72a0f24b77f2 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -99,6 +99,7 @@ #elif defined(USE_GNUTLS) # include +# define USE_CURL_DES_SET_ODD_PARITY #elif defined(USE_MBEDTLS_DES) @@ -106,8 +107,10 @@ #elif defined(USE_OS400CRYPTO) # include "cipher.mih" /* mih/cipher */ +# define USE_CURL_DES_SET_ODD_PARITY #elif defined(USE_WIN32_CRYPTO) # include +# define USE_CURL_DES_SET_ODD_PARITY #else # error "cannot compile NTLM support without a crypto library with DES." #endif @@ -119,13 +122,50 @@ #include "curl_hmac.h" #include "curlx/warnless.h" #include "curl_endian.h" -#include "curl_des.h" #include "curl_md4.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" #include "memdebug.h" +#ifdef USE_CURL_DES_SET_ODD_PARITY +/* + * curl_des_set_odd_parity() + * + * Copyright (C) Steve Holme, + * + * This is used to apply odd parity to the given byte array. It is typically + * used by when a cryptography engine does not have its own version. + * + * The function is a port of the Java based oddParity() function over at: + * + * https://davenport.sourceforge.net/ntlm.html + * + * Parameters: + * + * bytes [in/out] - The data whose parity bits are to be adjusted for + * odd parity. + * len [out] - The length of the data. + */ +static void curl_des_set_odd_parity(unsigned char *bytes, size_t len) +{ + size_t i; + + for(i = 0; i < len; i++) { + unsigned char b = bytes[i]; + + bool needs_parity = (((b >> 7) ^ (b >> 6) ^ (b >> 5) ^ + (b >> 4) ^ (b >> 3) ^ (b >> 2) ^ + (b >> 1)) & 0x01) == 0; + + if(needs_parity) + bytes[i] |= 0x01; + else + bytes[i] &= 0xfe; + } +} +#endif /* USE_CURL_DES_SET_ODD_PARITY */ + /* * Turns a 56-bit key into being 64-bit wide. */ @@ -172,7 +212,7 @@ static void setup_des_key(const unsigned char *key_56, extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ - Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); + curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Set the key */ des_set_key(des, (const uint8_t *) key); @@ -214,7 +254,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, extend_key_56_to_64(key_56, ctl.Crypto_Key); /* Set the key parity to odd */ - Curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len); + curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len); /* Perform the encryption */ _CIPHER((_SPCPTR *) &out, &ctl, (_SPCPTR *) &in); @@ -252,7 +292,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, extend_key_56_to_64(key_56, blob.key); /* Set the key parity to odd */ - Curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key)); + curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key)); /* Import the key */ if(!CryptImportKey(hprov, (BYTE *) &blob, sizeof(blob), 0, 0, &hkey)) { From 82fa9862dfa3083d4014d6dcfb721a7278e66f0b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 13:02:55 +0200 Subject: [PATCH 119/885] GHA: set `concurrency:` where missing To silence zizmor 1.16.0 warnings. Also: - http3-linux: replace hard-coded workflow name with variable. Follow-up to a8174176b5425c5692b55b78e40aef3a2331155f #13841 - codeql: set `cancel-in-progress: true`. zizmor apparently does not allow `false` in pedantic mode anymore: https://github.com/zizmorcore/zizmor/pull/1227 - codeql: sync concurrency setting with the rest of the jobs. (I'm not sure this is correct, or why it was previously special-cased.) Expressions used (before and after this patch): - `group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}` for GHA/appveyor-status. - `group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}` for all the rest. Ref: https://github.com/curl/curl/actions/runs/18776245057/job/53571438139?pr=19209 Closes #19215 --- .github/workflows/checksrc.yml | 4 ++++ .github/workflows/codeql.yml | 3 ++- .github/workflows/configure-vs-cmake.yml | 4 ++++ .github/workflows/fuzz.yml | 4 ++++ .github/workflows/http3-linux.yml | 3 +-- .github/workflows/label.yml | 4 ++++ .github/workflows/linux-old.yml | 4 ++++ 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index a0337904f2c7..bd930f8ff1ff 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -27,6 +27,10 @@ name: 'Source' - 'plan9/**' - 'tests/data/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + permissions: {} jobs: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 58eaa35be5ba..5cbde8de054c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,7 +32,8 @@ name: 'CodeQL' - cron: '0 0 * * 4' concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true permissions: {} diff --git a/.github/workflows/configure-vs-cmake.yml b/.github/workflows/configure-vs-cmake.yml index 5c35051f6a34..ade83e0c6028 100644 --- a/.github/workflows/configure-vs-cmake.yml +++ b/.github/workflows/configure-vs-cmake.yml @@ -30,6 +30,10 @@ name: 'configure-vs-cmake' - '.github/scripts/cmp-config.pl' - '.github/workflows/configure-vs-cmake.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + permissions: {} jobs: diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 1c466160fc77..98cdd8a97d0e 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -35,6 +35,10 @@ name: 'Fuzzer' - 'projects/**' - 'tests/data/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + permissions: {} jobs: diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 668de7ede413..b29a3076f93b 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -30,8 +30,7 @@ name: 'Linux HTTP/3' - 'projects/**' concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: http3-${{ github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true permissions: {} diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index a5f42f9d409b..0c169e607573 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -13,6 +13,10 @@ name: 'Labeler' 'on': [pull_request_target] # zizmor: ignore[dangerous-triggers] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + permissions: {} jobs: diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index e145633708de..198f90c538ef 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -43,6 +43,10 @@ name: 'Old Linux' - 'plan9/**' - 'projects/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + permissions: {} env: From 87ab1cd255b8e70d0379f42d8ee2f25815400ec7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 13:44:44 +0200 Subject: [PATCH 120/885] GHA/fuzz: try fixing concurrency group deadlock ``` Fuzzer Canceling since a deadlock was detected for concurrency group: 'Fuzzer-82fa9862dfa3083d4014d6dcfb721a7278e66f0b' between a top level workflow and 'Fuzzing' ``` https://github.com/curl/curl/actions/runs/18778617351 Follow-up to 82fa9862dfa3083d4014d6dcfb721a7278e66f0b #19215 --- .github/workflows/fuzz.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 98cdd8a97d0e..eb4bd0dc887b 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -36,7 +36,8 @@ name: 'Fuzzer' - 'tests/data/**' concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + # Hard-coded workflow name to avoid colliding with curl-fuzzer's group + group: curl-fuzz-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true permissions: {} From 7d0261c2288ac52dd8a59ac14ebe823a564ce1ed Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 13:49:51 +0200 Subject: [PATCH 121/885] GHA/checksrc: extend zizmor to Dependabot, set cooldown periods Closes #19216 --- .github/dependabot.yml | 7 +++++++ .github/workflows/checksrc.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bd5661bea41a..a6b58f1e6254 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,8 @@ updates: directory: '/' schedule: interval: 'monthly' + cooldown: + default-days: 7 commit-message: prefix: 'GHA:' @@ -17,5 +19,10 @@ updates: - '/tests' schedule: interval: 'monthly' + cooldown: + default-days: 7 + semver-major-days: 15 + semver-minor-days: 7 + semver-patch-days: 3 commit-message: prefix: 'GHA:' diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index bd930f8ff1ff..05dcc2ec91d6 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -135,7 +135,7 @@ jobs: GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - zizmor --pedantic .github/workflows/*.yml + zizmor --pedantic .github/workflows/*.yml .github/dependabot.yml - name: 'shellcheck CI' run: | From e0d6ecdf01c029c3498fe8081116dfb4707fe296 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 12:02:18 +0000 Subject: [PATCH 122/885] GHA: bump pips - cryptography from 46.0.2 to 46.0.3 in /tests - filelock from 3.19.1 to 3.20.0 in /tests - psutil from 7.1.0 to 7.1.1 in /tests Closes #19217 Closes #19218 Closes #19219 --- tests/http/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/http/requirements.txt b/tests/http/requirements.txt index 3b81a2ca13b0..bc872085c680 100644 --- a/tests/http/requirements.txt +++ b/tests/http/requirements.txt @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: curl -cryptography==46.0.2 -filelock==3.19.1 -psutil==7.1.0 +cryptography==46.0.3 +filelock==3.20.0 +psutil==7.1.1 pytest==8.4.2 pytest-xdist==3.8.0 websockets==15.0.1 From f4293cd81e9ed8cacee186161fd5294bdfe063dd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 14:57:52 +0200 Subject: [PATCH 123/885] GHA/dependabot: group updates To avoid update spam and PR that can't be applied on top of each other. Ref: #19217 #19218 #19219 Closes #19220 --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a6b58f1e6254..e9126e58d3d8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,10 @@ updates: interval: 'monthly' cooldown: default-days: 7 + groups: + actions-deps: + patterns: + - '*' commit-message: prefix: 'GHA:' @@ -24,5 +28,9 @@ updates: semver-major-days: 15 semver-minor-days: 7 semver-patch-days: 3 + groups: + actions-deps: + patterns: + - '*' commit-message: prefix: 'GHA:' From 207a74206bb64ed06a9c33d132036712dfaa2e48 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 18:34:35 +0200 Subject: [PATCH 124/885] mbedtls: fix building with sha-256 missing from PSA Fixing: ``` lib/vtls/mbedtls.c:1505:10: error: call to undeclared function 'Curl_sha256it'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1505 | return Curl_sha256it(sha256sum, input, inputlen); | ^ 1 error generated. ``` with mbedTLS configuration: ``` tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_SHA_256 tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS tf-psa-crypto/scripts/config.py unset MBEDTLS_LMS_C ``` Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077 Closes #19223 --- lib/vtls/mbedtls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 5a2310d115a1..89d4eff64ea4 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -73,6 +73,7 @@ #include "../multiif.h" #include "mbedtls_threadlock.h" #include "../strdup.h" +#include "../curl_sha256.h" /* The last 2 #include files should be in this order */ #include "../curl_memory.h" From 833da09b53fa99b1cd83154e4a5febf584d7c040 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 18:41:20 +0200 Subject: [PATCH 125/885] vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition Closes #19224 --- lib/vtls/schannel.c | 1 + lib/vtls/schannel_int.h | 1 + lib/vtls/vtls.h | 4 ---- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 2e29ea2f185e..0178659f9aad 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -58,6 +58,7 @@ #include "../rand.h" #include "../curlx/strparse.h" #include "../progress.h" +#include "../curl_sha256.h" /* The last #include file should be: */ #include "../curl_memory.h" diff --git a/lib/vtls/schannel_int.h b/lib/vtls/schannel_int.h index f9adb5829440..05116dfa1a92 100644 --- a/lib/vtls/schannel_int.h +++ b/lib/vtls/schannel_int.h @@ -29,6 +29,7 @@ #ifdef USE_SCHANNEL #include "vtls.h" +#include "../curl_sha256.h" #if defined(_MSC_VER) && (_MSC_VER <= 1600) /* Workaround for warning: diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index c62b8ae25842..180333e63cc8 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -99,10 +99,6 @@ CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name, #define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1MB */ #endif -#ifndef CURL_SHA256_DIGEST_LENGTH -#define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */ -#endif - curl_sslbackend Curl_ssl_backend(void); /** From 2b30d29c3c1b6fbda1c50e91c2948bb1986f4bd8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 18:03:52 +0200 Subject: [PATCH 126/885] autotools: merge `if`s in GnuTLS/OpenSSL feature detection Closes #19222 --- m4/curl-gnutls.m4 | 16 ++++++---------- m4/curl-openssl.m4 | 30 ++++++++++++------------------ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index fb98f8d8fbb4..0872ee52b683 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -137,11 +137,10 @@ if test "x$OPT_GNUTLS" != xno; then test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi -dnl --- -dnl Check which crypto backend GnuTLS uses -dnl --- - if test "$GNUTLS_ENABLED" = "1"; then + dnl --- + dnl Check which crypto backend GnuTLS uses + dnl --- USE_GNUTLS_NETTLE= # First check if we can detect either crypto library via transitive linking AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) @@ -154,17 +153,14 @@ if test "$GNUTLS_ENABLED" = "1"; then AC_MSG_ERROR([GnuTLS found, but nettle was not found]) fi LIBS="-lnettle $LIBS" -fi -dnl --- -dnl We require GnuTLS with SRP support. -dnl --- -if test "$GNUTLS_ENABLED" = "1"; then + dnl --- + dnl We require GnuTLS with SRP support. + dnl --- AC_CHECK_LIB(gnutls, gnutls_srp_verifier, [ AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) HAVE_GNUTLS_SRP=1 ]) fi - ]) diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index 5175bb85d262..18c929e2b27e 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -340,10 +340,10 @@ if test X"$OPT_OPENSSL" != Xno && AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected]) fi -dnl --- -dnl We check OpenSSL for DES support. -dnl --- if test "$OPENSSL_ENABLED" = "1"; then + dnl --- + dnl We check OpenSSL for DES support. + dnl --- AC_MSG_CHECKING([for DES support in OpenSSL]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ @@ -361,12 +361,10 @@ if test "$OPENSSL_ENABLED" = "1"; then ],[ AC_MSG_RESULT([no]) ]) -fi -dnl --- -dnl We require OpenSSL with SRP support. -dnl --- -if test "$OPENSSL_ENABLED" = "1"; then + dnl --- + dnl We require OpenSSL with SRP support. + dnl --- AC_MSG_CHECKING([for SRP support in OpenSSL]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ @@ -385,12 +383,10 @@ if test "$OPENSSL_ENABLED" = "1"; then ],[ AC_MSG_RESULT([no]) ]) -fi -dnl --- -dnl Whether the OpenSSL configuration will be loaded automatically -dnl --- -if test X"$OPENSSL_ENABLED" = X"1"; then + dnl --- + dnl Whether the OpenSSL configuration will be loaded automatically + dnl --- AC_ARG_ENABLE(openssl-auto-load-config, AS_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration]) AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]), @@ -399,12 +395,10 @@ AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading o AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically]) fi ]) -fi -dnl --- -dnl We may use OpenSSL QUIC. -dnl --- -if test "$OPENSSL_ENABLED" = "1"; then + dnl --- + dnl We may use OpenSSL QUIC. + dnl --- AC_MSG_CHECKING([for QUIC support and OpenSSL >= 3.3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ From 3fc727751f8cc5af5a2bac8fda995ecf19c6b6c6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 18:46:50 +0200 Subject: [PATCH 127/885] lib: delete unused crypto header includes Tested OK with full non-unity CI run. Closes #19225 --- lib/curl_ntlm_core.c | 2 -- lib/curl_sasl.c | 1 - lib/md4.c | 1 - lib/vauth/ntlm.c | 1 - lib/vssh/libssh2.c | 1 - lib/vtls/vtls.c | 1 - 6 files changed, 7 deletions(-) diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index 72a0f24b77f2..9c5e8047795b 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -69,7 +69,6 @@ #ifdef USE_OPENSSL # include -# include # include # include # ifdef OPENSSL_IS_AWSLC /* for versions 1.2.0 to 1.30.1 */ @@ -79,7 +78,6 @@ #else # include # include -# include # include # include # ifdef OPENSSL_COEXIST diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index c907c2c27bb2..043786f73fa1 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -43,7 +43,6 @@ #include "urldata.h" #include "curlx/base64.h" -#include "curl_md5.h" #include "vauth/vauth.h" #include "cfilters.h" #include "vtls/vtls.h" diff --git a/lib/md4.c b/lib/md4.c index 083ecb0d48f2..d86a24628c46 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -28,7 +28,6 @@ #include -#include "strdup.h" #include "curl_md4.h" #include "curlx/warnless.h" diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index d860fbbd5058..4b793b7cdbb4 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -40,7 +40,6 @@ #include "../curl_ntlm_core.h" #include "../curl_gethostname.h" #include "../curlx/multibyte.h" -#include "../curl_md5.h" #include "../curlx/warnless.h" #include "../rand.h" #include "../vtls/vtls.h" diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index c0335db9c103..bd444c7b87e8 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -69,7 +69,6 @@ #include "curl_path.h" #include "../curlx/strparse.h" #include "../curlx/base64.h" /* for base64 encoding/decoding */ -#include "../curl_sha256.h" /* The last 2 #include files should be in this order */ #include "../curl_memory.h" diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 115559b70db8..973e4b2c01ee 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -67,7 +67,6 @@ #include "../multiif.h" #include "../curlx/fopen.h" #include "../curlx/timeval.h" -#include "../curl_md5.h" #include "../curl_sha256.h" #include "../curlx/warnless.h" #include "../curlx/base64.h" From 543b78652a37695c3429d981639b38f37bdef52e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 21:12:37 +0200 Subject: [PATCH 128/885] curl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang Not tested in default CI. macOS / CM clang OpenSSL gsasl rtmp AppleIDN SecTrust +examples, macOS / CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples: ``` lib/vquic/curl_ngtcp2.c:530:5: error: code will never be executed [-Werror,-Wunreachable-code] 530 | const ngtcp2_transport_params *rp; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` Ref: https://github.com/curl/curl/actions/runs/18787154442/job/53608230871?pr=19225#step:11:183 Confirmed fixed via #19225 Closes #19226 --- lib/vquic/curl_ngtcp2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 9478b8d0f38d..36265b73716d 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -526,6 +526,7 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data) ctx->tls_vrfy_result = Curl_vquic_tls_verify_peer(&ctx->tls, cf, data, &ctx->peer); +#ifndef CURL_DISABLE_VERBOSE_STRINGS if(Curl_trc_is_verbose(data)) { const ngtcp2_transport_params *rp; rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn); @@ -537,6 +538,7 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data) (curl_uint64_t)rp->max_udp_payload_size, (curl_uint64_t)rp->initial_max_data); } +#endif /* In case of earlydata, where we simulate being connected, update * the handshake time when we really did connect */ From 71d1eec675b3b7629a6f5dc4609b231ce60ade2a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 7 Oct 2025 12:49:02 +0200 Subject: [PATCH 129/885] tidy-up: miscellaneous - cmake/Find*: make double quotes consistent. - drop redundant parenthesis. - GHA/checksrc: sync a step name with others. - whitespace. Closes #19233 --- .github/workflows/checksrc.yml | 2 +- .github/workflows/non-native.yml | 4 ++-- CMake/FindBrotli.cmake | 2 +- CMake/FindLDAP.cmake | 2 +- CMake/FindMbedTLS.cmake | 2 +- CMake/FindNGTCP2.cmake | 2 +- docs/examples/log_failed_transfers.c | 2 +- docs/examples/usercertinmem.c | 2 +- include/curl/curl.h | 8 ++++---- lib/ldap.c | 4 ++-- lib/urldata.h | 30 ++++++++++++++-------------- lib/vauth/ntlm.c | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 05dcc2ec91d6..c5b918aa8e0a 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -53,7 +53,7 @@ jobs: with: persist-credentials: false - - name: 'install' + - name: 'install prereqs' run: | python3 -m venv ~/venv ~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \ diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 8dccb9e39964..71829ec302bd 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -138,8 +138,8 @@ jobs: include: - { build: 'autotools', arch: 'x86_64', compiler: 'clang' } - { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' } - - { build: 'autotools', arch: 'arm64', compiler: 'clang' } - - { build: 'cmake' , arch: 'arm64', compiler: 'clang' } + - { build: 'autotools', arch: 'arm64' , compiler: 'clang' } + - { build: 'cmake' , arch: 'arm64' , compiler: 'clang' } fail-fast: false steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake index c129a76567c5..d2b50d962124 100644 --- a/CMake/FindBrotli.cmake +++ b/CMake/FindBrotli.cmake @@ -51,7 +51,7 @@ endif() if(BROTLI_FOUND) set(Brotli_FOUND TRUE) - set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}") + set(BROTLI_VERSION ${BROTLI_libbrotlicommon_VERSION}) string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}") message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") else() diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake index 36ff08e397d8..0a897aa13f88 100644 --- a/CMake/FindLDAP.cmake +++ b/CMake/FindLDAP.cmake @@ -50,7 +50,7 @@ if(CURL_USE_PKGCONFIG AND endif() if(LDAP_FOUND) - set(LDAP_VERSION "${LDAP_ldap_VERSION}") + set(LDAP_VERSION ${LDAP_ldap_VERSION}) string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}") message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")") else() diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake index e1bee7dc4c1b..11b4f076f4dc 100644 --- a/CMake/FindMbedTLS.cmake +++ b/CMake/FindMbedTLS.cmake @@ -59,7 +59,7 @@ endif() if(MBEDTLS_FOUND) set(MbedTLS_FOUND TRUE) - set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}") + set(MBEDTLS_VERSION ${MBEDTLS_mbedtls_VERSION}) string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}") message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") else() diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake index d3d383521328..cda3b0e08cb2 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake @@ -86,7 +86,7 @@ if(CURL_USE_PKGCONFIG AND endif() if(NGTCP2_FOUND) - set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}") + set(NGTCP2_VERSION ${NGTCP2_libngtcp2_VERSION}) string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}") message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") else() diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index fe5f02f882c8..9237f69b32ed 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -130,7 +130,7 @@ static int mem_add(struct mem *mem, const char *str) } #if defined(__GNUC__) || defined(__clang__) -__attribute__ ((format (printf, 2, 3))) +__attribute__((format(printf, 2, 3))) #endif static int mem_addf(struct mem *mem, const char *format, ...) { diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index c53fcde9cbce..0fb5ab0de9de 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -176,9 +176,9 @@ int main(void) /* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is no CA certificate */ - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(ch, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); curl_easy_setopt(ch, CURLOPT_SSLKEYTYPE, "PEM"); diff --git a/include/curl/curl.h b/include/curl/curl.h index 917b10142000..9e07527dc9c4 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -401,12 +401,12 @@ typedef int (*curl_seek_callback)(void *instream, #define CURL_TRAILERFUNC_ABORT 1 typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); + size_t size, + size_t nitems, + void *instream); typedef int (*curl_trailer_callback)(struct curl_slist **list, - void *userdata); + void *userdata); typedef enum { CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ diff --git a/lib/ldap.c b/lib/ldap.c index 322c870bc248..8db1f41338b1 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -399,8 +399,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) #ifdef LDAP_OPT_X_TLS if(conn->ssl_config.verifypeer) { /* OpenLDAP SDK supports BASE64 files. */ - if((data->set.ssl.cert_type) && - (!curl_strequal(data->set.ssl.cert_type, "PEM"))) { + if(data->set.ssl.cert_type && + !curl_strequal(data->set.ssl.cert_type, "PEM")) { failf(data, "LDAP local: ERROR OpenLDAP only supports PEM cert-type"); result = CURLE_SSL_CERTPROBLEM; goto quit; diff --git a/lib/urldata.h b/lib/urldata.h index c7e19201fe88..19f96bbc1744 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -419,12 +419,12 @@ struct hostname { * Flags on the keepon member of the Curl_transfer_keeper */ -#define KEEP_NONE 0 -#define KEEP_RECV (1<<0) /* there is or may be data to read */ -#define KEEP_SEND (1<<1) /* there is or may be data to write */ -#define KEEP_RECV_HOLD (1<<2) /* when set, no reading should be done but there - might still be data to read */ -#define KEEP_SEND_HOLD (1<<3) /* when set, no writing should be done but there +#define KEEP_NONE 0 +#define KEEP_RECV (1<<0) /* there is or may be data to read */ +#define KEEP_SEND (1<<1) /* there is or may be data to write */ +#define KEEP_RECV_HOLD (1<<2) /* when set, no reading should be done but there + might still be data to read */ +#define KEEP_SEND_HOLD (1<<3) /* when set, no writing should be done but there might still be data to write */ #define KEEP_RECV_PAUSE (1<<4) /* reading is paused */ #define KEEP_SEND_PAUSE (1<<5) /* writing is paused */ @@ -543,10 +543,10 @@ struct Curl_handler { followtype type); int defport; /* Default port. */ - curl_prot_t protocol; /* See CURLPROTO_* - this needs to be the single - specific protocol bit */ - curl_prot_t family; /* single bit for protocol family; basically the - non-TLS name of the protocol this is */ + curl_prot_t protocol; /* See CURLPROTO_* - this needs to be the single + specific protocol bit */ + curl_prot_t family; /* single bit for protocol family; basically the + non-TLS name of the protocol this is */ unsigned int flags; /* Extra particular characteristics, see PROTOPT_* */ }; @@ -574,13 +574,13 @@ struct Curl_handler { #define PROTOPT_PROXY_AS_HTTP (1<<11) /* allow this non-HTTP scheme over a HTTP proxy as HTTP proxies may know this protocol and act as a gateway */ -#define PROTOPT_WILDCARD (1<<12) /* protocol supports wildcard matching */ +#define PROTOPT_WILDCARD (1<<12) /* protocol supports wildcard matching */ #define PROTOPT_USERPWDCTRL (1<<13) /* Allow "control bytes" (< 32 ASCII) in username and password */ -#define PROTOPT_NOTCPPROXY (1<<14) /* this protocol cannot proxy over TCP */ -#define PROTOPT_SSL_REUSE (1<<15) /* this protocol may reuse an existing - SSL connection in the same family - without having PROTOPT_SSL. */ +#define PROTOPT_NOTCPPROXY (1<<14) /* this protocol cannot proxy over TCP */ +#define PROTOPT_SSL_REUSE (1<<15) /* this protocol may reuse an existing + SSL connection in the same family + without having PROTOPT_SSL. */ #define CONNCHECK_NONE 0 /* No checks */ #define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 4b793b7cdbb4..1e9b629d8f49 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -842,7 +842,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, result = Curl_bufref_memdup(out, ntlmbuf, size); error: - free(ntlmv2resp);/* Free the dynamic buffer allocated for NTLMv2 */ + free(ntlmv2resp); /* Free the dynamic buffer allocated for NTLMv2 */ Curl_auth_cleanup_ntlm(ntlm); From a13d811044a52fee79acffe8dc67e9a547792267 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 19:21:18 +0200 Subject: [PATCH 130/885] lib: delete unused header includes `escape.h`, `getinfo.h`, `strdup.h`. Tested OK with full non-unity CI run. Closes #19231 --- lib/asyn-ares.c | 1 - lib/asyn-thrdd.c | 1 - lib/content_encoding.c | 1 - lib/escape.c | 1 - lib/file.c | 1 - lib/fileinfo.c | 1 - lib/gopher.c | 1 - lib/http2.c | 1 - lib/mqtt.c | 1 - lib/pingpong.c | 1 - lib/sendf.c | 1 - lib/socks_sspi.c | 1 - lib/vquic/curl_ngtcp2.c | 1 - lib/vquic/curl_osslq.c | 1 - lib/vquic/curl_quiche.c | 1 - lib/vssh/libssh.c | 3 --- lib/vssh/libssh2.c | 3 --- lib/vtls/vtls.c | 1 - lib/vtls/vtls_scache.c | 1 - 19 files changed, 23 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 040100acec36..094d703ec0c0 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -61,7 +61,6 @@ #include "progress.h" #include "curlx/timediff.h" #include "httpsrr.h" -#include "strdup.h" #include #include /* really old c-ares did not include this by diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index dc13143e245d..cb19f8645254 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -64,7 +64,6 @@ #include "multiif.h" #include "curl_threads.h" #include "select.h" -#include "strdup.h" #ifdef USE_ARES #include diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 28cccacdb647..b724b576b41d 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -51,7 +51,6 @@ #include "sendf.h" #include "http.h" #include "content_encoding.h" -#include "strdup.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" diff --git a/lib/escape.c b/lib/escape.c index e7587e49b40e..2064f4d05fb3 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -34,7 +34,6 @@ struct Curl_easy; #include "urldata.h" #include "curlx/warnless.h" #include "escape.h" -#include "strdup.h" #include "curlx/strparse.h" #include "curl_printf.h" diff --git a/lib/file.c b/lib/file.c index fe07df5d2a92..f45a487c90f3 100644 --- a/lib/file.c +++ b/lib/file.c @@ -61,7 +61,6 @@ #include "escape.h" #include "file.h" #include "speedcheck.h" -#include "getinfo.h" #include "multiif.h" #include "transfer.h" #include "url.h" diff --git a/lib/fileinfo.c b/lib/fileinfo.c index 47cdb102e373..bddd3fe6fbb1 100644 --- a/lib/fileinfo.c +++ b/lib/fileinfo.c @@ -26,7 +26,6 @@ #ifndef CURL_DISABLE_FTP -#include "strdup.h" #include "fileinfo.h" #include "curl_memory.h" /* The last #include file should be: */ diff --git a/lib/gopher.c b/lib/gopher.c index 6ff47d58c70a..3a6c73e6a274 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -35,7 +35,6 @@ #include "progress.h" #include "gopher.h" #include "select.h" -#include "strdup.h" #include "vtls/vtls.h" #include "url.h" #include "escape.h" diff --git a/lib/http2.c b/lib/http2.c index 4e2d59ff5187..36bfd6103339 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -42,7 +42,6 @@ #include "cfilters.h" #include "connect.h" #include "rand.h" -#include "strdup.h" #include "curlx/strparse.h" #include "transfer.h" #include "curlx/dynbuf.h" diff --git a/lib/mqtt.c b/lib/mqtt.c index c76ce0a229b7..0bf956c05bd4 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -34,7 +34,6 @@ #include "progress.h" #include "mqtt.h" #include "select.h" -#include "strdup.h" #include "url.h" #include "escape.h" #include "curlx/warnless.h" diff --git a/lib/pingpong.c b/lib/pingpong.c index 0a15e33f0a31..ac22e2e34000 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -37,7 +37,6 @@ #include "pingpong.h" #include "multiif.h" #include "vtls/vtls.h" -#include "strdup.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" diff --git a/lib/sendf.c b/lib/sendf.c index 7307f872dfaa..f2c29956d1f5 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -50,7 +50,6 @@ #include "multiif.h" #include "strerror.h" #include "select.h" -#include "strdup.h" #include "http2.h" #include "progress.h" #include "curlx/warnless.h" diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index d4837708a7a6..a7aa81b75d8e 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -37,7 +37,6 @@ #include "curl_sspi.h" #include "curlx/multibyte.h" #include "curlx/warnless.h" -#include "strdup.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 36265b73716d..3b918cd87062 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -50,7 +50,6 @@ #include "../url.h" #include "../uint-hash.h" #include "../sendf.h" -#include "../strdup.h" #include "../rand.h" #include "../multiif.h" #include "../cfilters.h" diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 84b89e93aff7..e30cfc648a30 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -35,7 +35,6 @@ #include "../urldata.h" #include "../hash.h" #include "../sendf.h" -#include "../strdup.h" #include "../rand.h" #include "../multiif.h" #include "../cfilters.h" diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 877a230e04f2..a2ab24bae73c 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -34,7 +34,6 @@ #include "../cfilters.h" #include "../cf-socket.h" #include "../sendf.h" -#include "../strdup.h" #include "../rand.h" #include "../multiif.h" #include "../connect.h" diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index e2574b68176b..df466dac4c76 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -51,13 +51,10 @@ #include "../hostip.h" #include "../progress.h" #include "../transfer.h" -#include "../escape.h" #include "../http.h" /* for HTTP proxy tunnel stuff */ #include "ssh.h" #include "../url.h" #include "../speedcheck.h" -#include "../getinfo.h" -#include "../strdup.h" #include "../vtls/vtls.h" #include "../cfilters.h" #include "../connect.h" diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index bd444c7b87e8..18e3cdb1d560 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -50,13 +50,10 @@ #include "../hostip.h" #include "../progress.h" #include "../transfer.h" -#include "../escape.h" #include "../http.h" /* for HTTP proxy tunnel stuff */ #include "ssh.h" #include "../url.h" #include "../speedcheck.h" -#include "../getinfo.h" -#include "../strdup.h" #include "../vtls/vtls.h" #include "../cfilters.h" #include "../connect.h" diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 973e4b2c01ee..3cd60e91b9aa 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -74,7 +74,6 @@ #include "../connect.h" #include "../select.h" #include "../setopt.h" -#include "../strdup.h" #include "../rand.h" #ifdef USE_APPLE_SECTRUST diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 763b474cfc7d..8203baa9038b 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -46,7 +46,6 @@ #include "../curl_sha256.h" #include "../rand.h" #include "../curlx/warnless.h" -#include "../strdup.h" /* The last #include files should be: */ #include "../curl_memory.h" From af8c98a0f3cae04b38c3555545eb9619dd91db09 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 20:56:14 +0000 Subject: [PATCH 131/885] GHA: bump GitHub artifact Actions - actions/download-artifact: v5.0.0 -> v6.0.0 - actions/upload-artifact: v4.6.2 -> v5.0.0 Closes #19232 --- .github/workflows/distcheck.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index c6b4e775ebe2..fef5de4f7b97 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -49,7 +49,7 @@ jobs: - name: 'maketgz' run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97 - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: 'release-tgz' path: 'curl-99.98.97.tar.gz' @@ -75,7 +75,7 @@ jobs: timeout-minutes: 10 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' @@ -99,7 +99,7 @@ jobs: timeout-minutes: 10 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' @@ -125,7 +125,7 @@ jobs: timeout-minutes: 10 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' @@ -149,7 +149,7 @@ jobs: timeout-minutes: 10 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' @@ -170,7 +170,7 @@ jobs: timeout-minutes: 5 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' @@ -192,7 +192,7 @@ jobs: timeout-minutes: 5 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' @@ -218,7 +218,7 @@ jobs: with: persist-credentials: false - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: 'release-tgz' From a3793ee7e3b08c361ab8511beba053c23655ce94 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 24 Oct 2025 23:21:27 +0200 Subject: [PATCH 132/885] GHA/windows: delete MSYS2 ARM64 workaround Follow-up to 5249b99a70be6d5689092e3cbe1f938e98124569 #18438 Follow-up to c4e776cafa22533fe8a6113a39f6a9f624e8c467 #17103 Closes #19234 --- .github/workflows/windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 242d1e3e4440..1090857fe2bf 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -238,7 +238,6 @@ jobs: if: ${{ matrix.sys != 'msys' }} with: msystem: ${{ matrix.sys }} - update: ${{ matrix.sys == 'clangarm64' }} # delete this line on next msys2/setup-msys2 bump install: >- mingw-w64-${{ matrix.env }}-cc mingw-w64-${{ matrix.env }}-${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || '' }} From 3e12ed955bd54b738fa882b29dd8439fe919af4c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Oct 2025 16:25:24 +0200 Subject: [PATCH 133/885] schannel: lower the maximum allowed time to block to 7 seconds During TLS renegotiation, the schannel_recv_renegotiate() function is allowed to block for a short while. Reduce the maximum allowed time to block from 10 minutes down to 7 seconds. Closes #19205 --- lib/vtls/schannel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 0178659f9aad..0561d6fbddfa 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1691,6 +1691,8 @@ enum schannel_renegotiate_caller_t { SCH_RENEG_CALLER_IS_SEND }; +#define MAX_RENEG_BLOCK_TIME (7 * 1000) /* 7 seconds in milliseconds */ + /* This function renegotiates the connection due to a server request received by schannel_recv. This function returns CURLE_AGAIN if the renegotiation is incomplete. In that case, we remain in the renegotiation (connecting) stage @@ -1702,7 +1704,6 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, { CURLcode result; curl_socket_t sockfd; - const timediff_t max_renegotiate_ms = 5 * 60 * 1000; /* 5 minutes */ struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = (struct schannel_ssl_backend_data *)connssl->backend; @@ -1743,7 +1744,7 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, timediff_t elapsed; elapsed = curlx_timediff(curlx_now(), rs->start_time); - if(elapsed >= max_renegotiate_ms) { + if(elapsed >= MAX_RENEG_BLOCK_TIME) { failf(data, "schannel: renegotiation timeout"); result = CURLE_SSL_CONNECT_ERROR; break; @@ -1810,12 +1811,12 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, } elapsed = curlx_timediff(curlx_now(), rs->start_time); - if(elapsed >= max_renegotiate_ms) { + if(elapsed >= MAX_RENEG_BLOCK_TIME) { failf(data, "schannel: renegotiation timeout"); result = CURLE_SSL_CONNECT_ERROR; break; } - remaining = max_renegotiate_ms - elapsed; + remaining = MAX_RENEG_BLOCK_TIME - elapsed; if(blocking) { timeout = Curl_timeleft(data, NULL, FALSE); From 6f36d58c25ae0b88e55f8a2c34c422d0a1f9295f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 25 Oct 2025 17:55:58 +0200 Subject: [PATCH 134/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 89 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 01d0511d4c1e..673a61052a2e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3523 + Contributors: 3529 This release includes the following changes: @@ -33,6 +33,7 @@ This release includes the following bugfixes: o autotools: fix duplicate UNIX and BSD flags in buildinfo.txt [113] o autotools: fix silly mistake in clang detection for buildinfo.txt [114] o autotools: make --enable-code-coverage support llvm/clang [79] + o autotools: merge `if`s in GnuTLS/OpenSSL feature detection [385] o aws-lc: re-enable large read-ahead with v1.61.0 again [16] o base64: accept zero length argument to base64_encode [82] o build: address some -Weverything warnings, update picky warnings [74] @@ -50,6 +51,7 @@ This release includes the following bugfixes: o cf-socket: tweak a memcpy() to read better [177] o cf-socket: use the right byte order for ports in bindlocal [61] o cfilter: unlink and discard [46] + o cfilters: check return code from Curl_pollset_set_out_only() [402] o checksrc: allow disabling warnings on FIXME/TODO comments [324] o checksrc: catch banned functions when preceded by ( [146] o checksrc: fix possible endless loop when detecting BANNEDFUNC [149] @@ -80,6 +82,7 @@ This release includes the following bugfixes: o cmdline-opts/_PROGRESS.md: explain the suffixes [154] o configure: add "-mt" for pthread support on HP-UX [52] o conn: fix hostname move on connection reuse [272] + o connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply [404] o connect: remove redundant condition in shutdown start [289] o cookie: avoid saving a cookie file if no transfer was done [11] o cookie: only count accepted cookies in Curl_cookie_add [364] @@ -88,6 +91,7 @@ This release includes the following bugfixes: o curl_easy_getinfo: error code on NULL arg [2] o curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS [319] o curl_mem_undef.h: limit to CURLDEBUG for non-memalloc overrides [19] + o curl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang [383] o curl_osslq: error out properly if BIO_ADDR_rawmake() fails [184] o curl_path: make sure just whitespace is illegal [351] o Curl_resolv: fix comment. 'entry' argument is not optional [187] @@ -99,6 +103,7 @@ This release includes the following bugfixes: o CURLOPT_MAXLIFETIME_CONN: make default 24 hours [10] o CURLOPT_SSL_VERIFYHOST.md: add see-also to two other VERIFYHOST options [32] o CURLOPT_TIMECONDITION.md: works for FILE and FTP as well [27] + o cw-out: unify the error handling pattern in cw_out_do_write [414] o digest_sspi: fix two memory leaks in error branches [77] o dist: do not distribute CI.md [29] o docs/cmdline-opts: drop double quotes from GLOBBING and URL examples [238] @@ -129,14 +134,20 @@ This release includes the following bugfixes: o firefox-db2pem.sh: add macOS support, tidy-ups [348] o form.md: drop reference to MANUAL [178] o ftp: add extra buffer length check [195] + o ftp: check errors on remote ip for data connection [423] o ftp: fix ftp_do_more returning with *completep unset [122] o ftp: fix port number range loop for PORT commands [66] o ftp: fix the 213 scanner memchr buffer limit argument [196] o ftp: improve fragile check for first digit > 3 [194] + o ftp: reduce size of some struct fields [418] + o ftp: remove 'newhost' and 'newport' from the ftp_conn struct [419] o ftp: remove misleading comments [193] + o ftp: remove the retr_size_saved struct field [416] + o ftp: remove the state_saved struct field [417] o ftp: replace strstr() in ;type= handling [313] o ftp: simplify the 150/126 size scanner [288] o gnutls: check conversion of peer cert chain [275] + o gnutls: fix re-handshake comments [422] o gtls: avoid potential use of uninitialized variable in trace output [83] o hmac: free memory properly on errors [377] o hostip: don't store negative resolves due unrelated errors [256] @@ -149,8 +160,10 @@ This release includes the following bugfixes: o http: handle user-defined connection headers [165] o http: look for trailing 'type=' in ftp:// without strstr [315] o http: make Content-Length parser more WHATWG [183] + o http: only accept ';' as a separator for custom headers [407] o http: return error for a second Location: header [393] o httpsrr: free old pointers when storing new [57] + o imap: parse and use UIDVALIDITY as a number [420] o imap: treat capabilities case insensitively [345] o INSTALL-CMAKE.md: add manual configuration examples [360] o INSTALL-CMAKE.md: document useful build targets [215] @@ -171,6 +184,7 @@ This release includes the following bugfixes: o ldap: do not pass a \n to failf() [370] o ldap: tidy-up types, fix error code confusion [191] o lib1514: fix return code mixup [304] + o lib: delete unused crypto header includes [384] o lib: drop unused include and duplicate guards [226] o lib: fix build error with verbose strings disabled [173] o lib: remove newlines from failf() calls [366] @@ -213,13 +227,17 @@ This release includes the following bugfixes: o managen: verify the options used in example lines [181] o mbedtls: add support for 4.0.0 [344] o mbedtls: check result of setting ALPN [127] + o mbedtls: fix building with <3.6.1 [400] + o mbedtls: fix building with sha-256 missing from PSA [391] o mbedtls: handle WANT_WRITE from mbedtls_ssl_read() [145] + o md4: drop mbedtls implementation (not available in mbedtls v3+) [406] o mdlinkcheck: reject URLs containing quotes [174] o memdup0: handle edge case [241] o mime: fix unpausing of readers [375] o mime: fix use of fseek() [334] o multi.h: add CURLMINFO_LASTENTRY [51] o multi_ev: remove unnecessary data check that confuses analysers [167] + o netrc: when the cached file is discarded, unmark it as loaded [409] o nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header [227] o ngtcp2: add a comment explaining write result handling [340] o ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available [362] @@ -230,6 +248,8 @@ This release includes the following bugfixes: o ngtcp2: fix handling of blocked stream data [236] o ngtcp2: fix returns when TLS verify failed [251] o noproxy: fix the IPV6 network mask pattern match [166] + o NTLM: disable if DES support missing from OpenSSL or mbedTLS [399] + o ntlm: improved error path on bad incoming NTLM TYPE3 message [412] o openldap: avoid indexing the result at -1 for blank responses [44] o openldap: check ber_sockbuf_add_io() return code [163] o openldap: check ldap_get_option() return codes [119] @@ -251,6 +271,7 @@ This release includes the following bugfixes: o openssl: fix unable do typo in failf() calls [341] o openssl: free UI_METHOD on exit path [373] o openssl: make the asn1_object_dump name null terminated [56] + o openssl: only try engine/provider if a cert file/name is provided [415] o openssl: set io_need always [99] o openssl: skip session resumption when verifystatus is set [230] o os400: document threads handling in code. [254] @@ -279,6 +300,7 @@ This release includes the following bugfixes: o sasl: clear canceled mechanism instead of toggling it [41] o schannel: assign result before using it [62] o schannel: fix memory leak [363] + o schannel: lower the maximum allowed time to block to 7 seconds [333] o schannel_verify: do not call infof with an appended \n [371] o schannel_verify: fix mem-leak in Curl_verify_host [208] o schannel_verify: use more human friendly error messages [96] @@ -290,6 +312,7 @@ This release includes the following bugfixes: o smb: adjust buffer size checks [45] o smb: transfer debugassert to real check [303] o smtp: check EHLO responses case insensitively [50] + o smtp: fix EOB handling [410] o smtp: return value ignored [357] o socks: advance iobuf instead of reset [276] o socks: avoid UAF risk in error path [359] @@ -348,6 +371,7 @@ This release includes the following bugfixes: o tool_cb_hdr: fix fwrite check in header callback [49] o tool_cb_hdr: size is always 1 [70] o tool_cb_rea: use poll instead of select if available [329] + o tool_cfgable: remove superfluous free calls [403] o tool_doswin: fix to use curl socket functions [108] o tool_filetime: cap crazy file times instead of erroring [327] o tool_filetime: replace cast with the fitting printf mask (Windows) [212] @@ -368,6 +392,7 @@ This release includes the following bugfixes: o tool_progress: handle possible integer overflows [164] o tool_progress: make max5data() use an algorithm [170] o transfer: avoid busy loop with tiny speed limit [100] + o transfer: fix retry for empty downloads on reuse [411] o transfer: reset retry count on each request [310] o unit1323: sync time types and printf masks, drop casts [211] o unit1664: drop casts, expand masks to full values [221] @@ -378,9 +403,13 @@ This release includes the following bugfixes: o vauth/digest: improve the digest parser [203] o version: add GSS backend name and version [353] o vquic: fix idle-timeout checks (ms<-->ns), 64-bit log & honor 0=no-timeout [249] + o vquic: fix recvmsg loop for max_pkts [421] o vquic: handling of io improvements [239] o vquic: sending non-gso packets fix for EAGAIN [265] o vtls: alpn setting, check proto parameter [134] + o vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition [387] + o vtls: remove call to PKCS12_PBE_add() [408] + o vtls: unify the error handling in ssl_cf_connect(). [413] o vtls_int.h: clarify data_pending [124] o vtls_scache: fix race condition [157] o windows: replace _beginthreadex() with CreateThread() [80] @@ -419,21 +448,22 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Adam Light, Alice Lee Poetics, Andrei Kurushin, Andrew Kirillov, - Andrew Olsen, BobodevMm on github, Christian Schmitz, curl.stunt430, - Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, dependabot[bot], - divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, - Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, Howard Chu, - Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, Jicea, - jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, + Adam Light, Alexander Blach, Alice Lee Poetics, Andrei Kurushin, + Andrew Kirillov, Andrew Olsen, BobodevMm on github, Christian Schmitz, + curl.stunt430, Dalei, Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, + dependabot[bot], divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, + Ethan Everett, Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, + Howard Chu, Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, + Jicea, jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, Jonathan Cardoso Machado, Joseph Birr-Pixton, Joshua Rogers, - kapsiR on github, kuchara on github, Marcel Raad, Michael Osipov, - Michał Petryka, Mitchell Blank Jr, Mohamed Daahir, Nir Azkiel, - Patrick Monnerat, plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], - rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, - Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, tkzv on github, - Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 - (57 contributors) + kapsiR on github, kuchara on github, madoe on github, Marcel Raad, + Michael Osipov, Michał Petryka, Mitchell Blank Jr, Mohamed Daahir, + Nir Azkiel, Patrick Monnerat, Pavel P, plv1313 on github, Pocs Norbert, + Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, Samuel Dionne-Riel, + Samuel Henrique, Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, + Theo Buehler, Tim Becker, tkzv on github, Viktor Szakats, + WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 + (63 contributors) References to bug reports and discussions on issues: @@ -769,6 +799,7 @@ References to bug reports and discussions on issues: [330] = https://curl.se/bug/?i=19101 [331] = https://curl.se/bug/?i=19046 [332] = https://curl.se/bug/?i=19102 + [333] = https://curl.se/bug/?i=19205 [334] = https://curl.se/bug/?i=19100 [335] = https://curl.se/bug/?i=19125 [336] = https://curl.se/bug/?i=19145 @@ -814,9 +845,37 @@ References to bug reports and discussions on issues: [379] = https://curl.se/bug/?i=19163 [380] = https://curl.se/bug/?i=19168 [382] = https://curl.se/bug/?i=19170 + [383] = https://curl.se/bug/?i=19226 + [384] = https://curl.se/bug/?i=19225 + [385] = https://curl.se/bug/?i=19222 [386] = https://curl.se/bug/?i=19018 + [387] = https://curl.se/bug/?i=19224 [388] = https://curl.se/bug/?i=19161 [389] = https://curl.se/bug/?i=19160 [390] = https://curl.se/bug/?i=19137 + [391] = https://curl.se/bug/?i=19223 [393] = https://curl.se/bug/?i=19130 [394] = https://curl.se/bug/?i=19153 + [399] = https://curl.se/bug/?i=19206 + [400] = https://curl.se/bug/?i=19208 + [402] = https://curl.se/bug/?i=19211 + [403] = https://curl.se/bug/?i=19213 + [404] = https://curl.se/bug/?i=18991 + [406] = https://curl.se/bug/?i=19202 + [407] = https://curl.se/bug/?i=19200 + [408] = https://curl.se/bug/?i=19201 + [409] = https://curl.se/bug/?i=19199 + [410] = https://curl.se/bug/?i=18798 + [411] = https://curl.se/bug/?i=19165 + [412] = https://curl.se/bug/?i=19198 + [413] = https://curl.se/bug/?i=19196 + [414] = https://curl.se/bug/?i=19195 + [415] = https://issues.oss-fuzz.com/issues/435278402 + [416] = https://curl.se/bug/?i=19194 + [417] = https://curl.se/bug/?i=19192 + [418] = https://curl.se/bug/?i=19191 + [419] = https://curl.se/bug/?i=19190 + [420] = https://curl.se/bug/?i=19188 + [421] = https://curl.se/bug/?i=19186 + [422] = https://curl.se/bug/?i=19187 + [423] = https://curl.se/bug/?i=19185 From c59bf9018633fadf253c44d3bf63ea67cc1ed76e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 Oct 2025 09:42:00 +0000 Subject: [PATCH 135/885] GHA: update nghttp2/nghttp2 to v1.68.0 Closes #19238 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index b29a3076f93b..c532a35c15f1 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -55,7 +55,7 @@ env: # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com NGTCP2_VERSION: 1.17.0 # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com - NGHTTP2_VERSION: 1.67.1 + NGHTTP2_VERSION: 1.68.0 # renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com QUICHE_VERSION: 0.24.6 From 18119eb91654e689d3a402e7c5bd8a2c184ac08a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 25 Oct 2025 10:45:39 +0200 Subject: [PATCH 136/885] ECH.md: make OpenSSL branch clone instructions work Closes #19237 --- docs/ECH.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/ECH.md b/docs/ECH.md index d39f4b2f36a2..b40cd17e78b6 100644 --- a/docs/ECH.md +++ b/docs/ECH.md @@ -22,9 +22,8 @@ To build the OpenSSL project's ECH feature branch: ```sh cd $HOME/code -git clone https://github.com/openssl/openssl +git clone https://github.com/openssl/openssl --branch feature/ech cd openssl -git checkout feature/ech ./config --libdir=lib --prefix=$HOME/code/openssl-local-inst ...stuff... make -j8 From 4f03e3fcbd2857be1821fbac4875592c2a81feff Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Oct 2025 22:23:39 +0200 Subject: [PATCH 137/885] socks_gssapi: also reset buffer length after free To mimic this behavior of the previously used `gss_release_buffer()`. Some or all of these zero assignments may be redundant. Follow-up to e7818999dbeff5acb00c032860d2259a1c5f9c5b #19018 Closes #19167 --- lib/socks_gssapi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 9b0b31792bc1..34380ae9a045 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -167,6 +167,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } Curl_safefree(service.value); + service.length = 0; if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_import_name()")) { @@ -191,8 +192,10 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, TRUE, &gss_ret_flags); - if(gss_token != GSS_C_NO_BUFFER) + if(gss_token != GSS_C_NO_BUFFER) { Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; + } if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_init_sec_context") || /* the size needs to fit in a 16 bit field */ @@ -293,6 +296,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "Failed to receive GSS-API authentication token."); gss_release_name(&gss_status, &server); Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } @@ -403,12 +407,14 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_wrap")) { Curl_safefree(gss_send_token.value); + gss_send_token.length = 0; gss_release_buffer(&gss_status, &gss_w_token); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to wrap GSS-API encryption value into token."); return CURLE_COULDNT_CONNECT; } Curl_safefree(gss_send_token.value); + gss_send_token.length = 0; us_length = htons((unsigned short)gss_w_token.length); memcpy(socksreq + 2, &us_length, sizeof(short)); @@ -482,6 +488,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(result || (actualread != us_length)) { failf(data, "Failed to receive GSS-API encryption type."); Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } @@ -493,12 +500,14 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(check_gss_err(data, gss_major_status, gss_minor_status, "gss_unwrap")) { Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; gss_release_buffer(&gss_status, &gss_w_token); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to unwrap GSS-API encryption value into token."); return CURLE_COULDNT_CONNECT; } Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; if(gss_w_token.length != 1) { failf(data, "Invalid GSS-API encryption response length (%zu).", @@ -516,12 +525,14 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "Invalid GSS-API encryption response length (%zu).", gss_recv_token.length); Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } memcpy(socksreq, gss_recv_token.value, gss_recv_token.length); Curl_safefree(gss_recv_token.value); + gss_recv_token.length = 0; } (void)curlx_nonblock(sock, TRUE); From b602de775ed59f6f40c76c5b928ba677613c3923 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 25 Oct 2025 22:28:01 +0200 Subject: [PATCH 138/885] test776: set as 'flaky' I have not figured out why, but having this test failing in CI every so often is disturbing. Reported-by: Viktor Szakatas Fixes #19235 Closes #19243 --- tests/data/test776 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/data/test776 b/tests/data/test776 index 214cd5028e57..fc4f06d6f7c0 100644 --- a/tests/data/test776 +++ b/tests/data/test776 @@ -5,6 +5,7 @@ HTTP HTTP GET HTTP NTLM auth NTLM +flaky From a49e4e3d16991465144558f405b2d7972824abb0 Mon Sep 17 00:00:00 2001 From: TheBitBrine Date: Sun, 26 Oct 2025 03:15:07 +0000 Subject: [PATCH 139/885] pop3: fix CAPA response termination detection The code was checking if a line starts with '.', which would incorrectly match capability names starting with dots. Per RFC 2449, the terminator must be a line containing only a single dot. RFC 2449 also explicitly excludes '.' from valid capability name starting characters, so this is purely theoretical, but the code should match the spec. Changed to check for exact match: line length of 3 with '.\r' or length 2 with '.\n' to handle both CRLF and LF-only servers. (Mistake detected with ZeroPath) Fixes #19228 Reported-by: Joshua Rogers Closes #19245 --- lib/pop3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pop3.c b/lib/pop3.c index 2fd496cb3142..c6b6ed659c9d 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -323,8 +323,10 @@ static bool pop3_endofresp(struct Curl_easy *data, struct connectdata *conn, /* Are we processing CAPA command responses? */ if(pop3c->state == POP3_CAPA) { - /* Do we have the terminating line? */ - if(len >= 1 && line[0] == '.') + /* Do we have the terminating line? Per RFC 2449 this is a line + containing only a single dot */ + if((len == 3 && line[0] == '.' && line[1] == '\r') || + (len == 2 && line[0] == '.' && line[1] == '\n')) /* Treat the response as a success */ *resp = '+'; else From ab20bb47cf4c4869d7f7e82c9492dd738f52bacd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 27 Oct 2025 07:02:39 +0100 Subject: [PATCH 140/885] GHA/linux: make OpenLDAP local build smaller By disabling its `slapd` component, that's not needed for curl. Cache size: 2.7 -> 1.7 MB Also merge two `make` invocations. Closes #19250 --- .github/workflows/linux.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 527c9ce6075b..e28354c257e8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -496,8 +496,7 @@ jobs: curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ --location "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${OPENLDAP_VERSION}.tgz" | tar -xz cd "openldap-${OPENLDAP_VERSION}" - ./configure --enable-static --disable-shared --prefix=/home/runner/openldap-static - make + ./configure --enable-static --disable-shared --disable-slapd --prefix=/home/runner/openldap-static make install - name: 'cache openssl (thread sanitizer)' From fb0c014e30e5f4de7aa0d566c52c836a6423da29 Mon Sep 17 00:00:00 2001 From: Samuel Henrique Date: Sun, 26 Oct 2025 17:34:46 +0000 Subject: [PATCH 141/885] wcurl: sync to +dev snapshot Closes #19247 --- scripts/wcurl | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/scripts/wcurl b/scripts/wcurl index 1014779e131b..b1a06efe584d 100755 --- a/scripts/wcurl +++ b/scripts/wcurl @@ -29,7 +29,7 @@ # Stop on errors and on usage of unset variables. set -eu -VERSION="2025.09.27" +VERSION="2025.09.27+dev" PROGRAM_NAME="$(basename "$0")" readonly PROGRAM_NAME @@ -65,7 +65,7 @@ Options: multiple times, only the last value is considered. --no-decode-filename: Don't percent-decode the output filename, even if the percent-encoding in - the URL was done by wcurl, e.g.: The URL contained whitespaces. + the URL was done by wcurl, e.g.: The URL contained whitespace. --dry-run: Don't actually execute curl, just print what would be invoked. @@ -77,7 +77,7 @@ Options: instead forwarded to the curl invocation. : URL to be downloaded. Anything that is not a parameter is considered - an URL. Whitespaces are percent-encoded and the URL is passed to curl, which + an URL. Whitespace is percent-encoded and the URL is passed to curl, which then performs the parsing. May be specified more than once. _EOF_ } @@ -113,6 +113,13 @@ readonly PER_URL_PARAMETERS="\ --remote-time \ --retry 5 " +# Valid percent-encode codes that are considered unsafe to be decoded. +# This is a list of space-separated percent-encoded uppercase +# characters. +# 2F = / +# 5C = \ +readonly UNSAFE_PERCENT_ENCODE="2F 5C" + # Whether to invoke curl or not. DRY_RUN="false" @@ -137,6 +144,20 @@ is_subset_of() esac } +# Indicate via exit code whether the HTML code given in the first +# parameter is safe to be decoded. +is_safe_percent_encode() +{ + upper_str=$(printf "%s" "${1}" | tr "[:lower:]" "[:upper:]") + for unsafe in ${UNSAFE_PERCENT_ENCODE}; do + if [ "${unsafe}" = "${upper_str}" ]; then + return 1 + fi + done + + return 0 +} + # Print the given string percent-decoded. percent_decode() { @@ -151,9 +172,10 @@ percent_decode() decode_out="${decode_out}${decode_hex2}" # Skip decoding if this is a control character (00-1F). # Skip decoding if DECODE_FILENAME is not "true". - if is_subset_of "${decode_hex1}" "23456789abcdefABCDEF" \ + if [ "${DECODE_FILENAME}" = "true" ] \ + && is_subset_of "${decode_hex1}" "23456789abcdefABCDEF" \ && is_subset_of "${decode_hex2}" "0123456789abcdefABCDEF" \ - && [ "${DECODE_FILENAME}" = "true" ]; then + && is_safe_percent_encode "${decode_out}"; then # Use printf to decode it into octal and then decode it to the final format. decode_out="$(printf "%b" "\\$(printf %o "0x${decode_hex1}${decode_hex2}")")" fi @@ -301,7 +323,7 @@ while [ -n "${1-}" ]; do # This is the start of the list of URLs. shift for url in "$@"; do - # Encode whitespaces into %20, since wget supports those URLs. + # Encode whitespace into %20, since wget supports those URLs. newurl=$(printf "%s\n" "${url}" | sed 's/ /%20/g') URLS="${URLS} ${newurl}" done @@ -314,7 +336,7 @@ while [ -n "${1-}" ]; do *) # This must be a URL. - # Encode whitespaces into %20, since wget supports those URLs. + # Encode whitespace into %20, since wget supports those URLs. newurl=$(printf "%s\n" "${1}" | sed 's/ /%20/g') URLS="${URLS} ${newurl}" ;; From cdd945e486392dd9f337e8e0edd6d6f7d8ddc524 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 25 Oct 2025 18:48:36 +0200 Subject: [PATCH 142/885] http_proxy: fix adding custom proxy headers Reported-by: Joshua Rogers Fixes #19227 Closes #19239 --- lib/http_proxy.c | 109 ++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 63 deletions(-) diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 845ba2e8f8da..f6e546b9fd96 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -48,18 +48,11 @@ #include "curl_memory.h" #include "memdebug.h" -static bool hd_name_eq(const char *n1, size_t n1len, - const char *n2, size_t n2len) -{ - return (n1len == n2len) ? curl_strnequal(n1, n2, n1len) : FALSE; -} - static CURLcode dynhds_add_custom(struct Curl_easy *data, bool is_connect, int httpversion, struct dynhds *hds) { struct connectdata *conn = data->conn; - const char *ptr; struct curl_slist *h[2]; struct curl_slist *headers; int numlists = 1; /* by default */ @@ -95,86 +88,76 @@ static CURLcode dynhds_add_custom(struct Curl_easy *data, /* loop through one or two lists */ for(i = 0; i < numlists; i++) { for(headers = h[i]; headers; headers = headers->next) { - const char *name, *value; - size_t namelen, valuelen; + struct Curl_str name; + const char *value = NULL; + size_t valuelen = 0; + const char *ptr = headers->data; /* There are 2 quirks in place for custom headers: * 1. setting only 'name:' to suppress a header from being sent * 2. setting only 'name;' to send an empty (illegal) header */ - ptr = strchr(headers->data, ':'); - if(ptr) { - name = headers->data; - namelen = ptr - headers->data; - ptr++; /* pass the colon */ - curlx_str_passblanks(&ptr); - if(*ptr) { - value = ptr; - valuelen = strlen(value); + if(!curlx_str_cspn(&ptr, &name, ";:")) { + if(!curlx_str_single(&ptr, ':')) { + curlx_str_passblanks(&ptr); + if(*ptr) { + value = ptr; + valuelen = strlen(value); + } + else { + /* quirk #1, suppress this header */ + continue; + } } - else { - /* quirk #1, suppress this header */ - continue; + else if(!curlx_str_single(&ptr, ';')) { + curlx_str_passblanks(&ptr); + if(!*ptr) { + /* quirk #2, send an empty header */ + value = ""; + valuelen = 0; + } + else { + /* this may be used for something else in the future, + * ignore this for now */ + continue; + } } - } - else { - ptr = strchr(headers->data, ';'); - - if(!ptr) { - /* neither : nor ; in provided header value. We seem - * to ignore this silently */ + else + /* neither : nor ; in provided header value. We ignore this + * silently */ continue; - } - - name = headers->data; - namelen = ptr - headers->data; - ptr++; /* pass the semicolon */ - curlx_str_passblanks(&ptr); - if(!*ptr) { - /* quirk #2, send an empty header */ - value = ""; - valuelen = 0; - } - else { - /* this may be used for something else in the future, - * ignore this for now */ - continue; - } } + else + /* no name, move on */ + continue; - DEBUGASSERT(name && value); + DEBUGASSERT(curlx_strlen(&name) && value); if(data->state.aptr.host && /* a Host: header was sent already, do not pass on any custom Host: header as that will produce *two* in the same request! */ - hd_name_eq(name, namelen, STRCONST("Host:"))) - ; + curlx_str_casecompare(&name, "Host")); else if(data->state.httpreq == HTTPREQ_POST_FORM && /* this header (extended by formdata.c) is sent later */ - hd_name_eq(name, namelen, STRCONST("Content-Type:"))) - ; + curlx_str_casecompare(&name, "Content-Type")); else if(data->state.httpreq == HTTPREQ_POST_MIME && /* this header is sent later */ - hd_name_eq(name, namelen, STRCONST("Content-Type:"))) - ; + curlx_str_casecompare(&name, "Content-Type")); else if(data->req.authneg && /* while doing auth neg, do not allow the custom length since we will force length zero then */ - hd_name_eq(name, namelen, STRCONST("Content-Length:"))) - ; + curlx_str_casecompare(&name, "Content-Length")); else if((httpversion >= 20) && - hd_name_eq(name, namelen, STRCONST("Transfer-Encoding:"))) - /* HTTP/2 and HTTP/3 do not support chunked requests */ - ; - else if((hd_name_eq(name, namelen, STRCONST("Authorization:")) || - hd_name_eq(name, namelen, STRCONST("Cookie:"))) && + curlx_str_casecompare(&name, "Transfer-Encoding")); + /* HTTP/2 and HTTP/3 do not support chunked requests */ + else if((curlx_str_casecompare(&name, "Authorization") || + curlx_str_casecompare(&name, "Cookie")) && /* be careful of sending this potentially sensitive header to other hosts */ - !Curl_auth_allowed_to_host(data)) - ; + !Curl_auth_allowed_to_host(data)); else { - CURLcode result; - - result = Curl_dynhds_add(hds, name, namelen, value, valuelen); + CURLcode result = + Curl_dynhds_add(hds, curlx_str(&name), curlx_strlen(&name), + value, valuelen); if(result) return result; } From f9dfabb42a79616d00fac48ac3deae28d797a856 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 25 Oct 2025 18:58:49 +0200 Subject: [PATCH 143/885] test1802: test --proxy-headers and --headers setting user-agent --- tests/data/Makefile.am | 2 +- tests/data/test1802 | 63 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/data/test1802 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 595943fb6717..1d7445363d77 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -230,7 +230,7 @@ test1680 test1681 test1682 test1683 \ test1700 test1701 test1702 test1703 test1704 test1705 test1706 test1707 \ test1708 test1709 test1710 test1711 \ \ -test1800 test1801 \ +test1800 test1801 test1802 \ \ test1900 test1901 test1902 test1903 test1904 test1905 test1906 test1907 \ test1908 test1909 test1910 test1911 test1912 test1913 test1914 test1915 \ diff --git a/tests/data/test1802 b/tests/data/test1802 new file mode 100644 index 000000000000..61f6426a9020 --- /dev/null +++ b/tests/data/test1802 @@ -0,0 +1,63 @@ + + + +HTTP +HTTP CONNECT + + + + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html + +-foo- + + +HTTP/1.1 200 fine +Connection: close +Content-Length: 0 + + + + +# +# Client-side + + +ftp +proxy + + +http + + +HTTP CONNECT with custom headers for proxy and server + + +http://hello/wanted/page -p -x %HOSTIP:%HTTPPORT --header "User-Agent: myapp/1.0" --proxy-header "User-Agent: Benjamin/2" --proxy-header "Host: todeloo" --header "Host: foo" + + + +# +# Verify data after the test has been "shot" + + + +CONNECT hello:80 HTTP/1.1 +Proxy-Connection: Keep-Alive +User-Agent: Benjamin/2 +Host: todeloo + +GET /wanted/page HTTP/1.1 +Host: foo +Accept: */* +User-Agent: myapp/1.0 + + + + From 6c97ff8c120f2ba3d4c6f1ceb7ca834cb98d808e Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 27 Oct 2025 22:29:38 +0800 Subject: [PATCH 144/885] socks: properly maintain the status of 'done' Closes #19255 --- lib/socks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/socks.c b/lib/socks.c index 238e140b0686..9936aaf5bb15 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -1248,8 +1248,10 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, if(!sx) { cf->ctx = sx = calloc(1, sizeof(*sx)); - if(!sx) - return CURLE_OUT_OF_MEMORY; + if(!sx) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } /* for the secondary socket (FTP), use the "connect to host" * but ignore the "connect to port" (use the secondary port) From 2bb33c18a7fb041aa6831846210e4a9bbf45322f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 27 Oct 2025 14:16:26 +0100 Subject: [PATCH 145/885] pingpong: change repsonse timeout to one minute It was previously two minutes by default and sometimes one minute. Removes a struct field. Closes #19254 --- lib/ftp.c | 6 ------ lib/pingpong.c | 4 ++-- lib/pingpong.h | 3 --- lib/urldata.h | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index 5b96f63ad68f..3ac8db6813bb 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3364,15 +3364,9 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, * data has been transferred. This happens when doing through NATs etc that * abandon old silent connections. */ - timediff_t old_time = pp->response_time; - - pp->response_time = 60*1000; /* give it only a minute for now */ pp->response = curlx_now(); /* timeout relative now */ - result = getftpresponse(data, &nread, &ftpcode); - pp->response_time = old_time; /* set this back to previous value */ - if(!nread && (CURLE_OPERATION_TIMEDOUT == result)) { failf(data, "control connection looks dead"); ftpc->ctl_valid = FALSE; /* mark control connection as bad */ diff --git a/lib/pingpong.c b/lib/pingpong.c index ac22e2e34000..470199a6ff84 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -50,8 +50,8 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, struct pingpong *pp, bool disconnecting) { timediff_t timeout_ms; /* in milliseconds */ - timediff_t response_time = (data->set.server_response_timeout > 0) ? - data->set.server_response_timeout : pp->response_time; + timediff_t response_time = data->set.server_response_timeout ? + data->set.server_response_timeout : RESP_TIMEOUT; struct curltime now = curlx_now(); /* if CURLOPT_SERVER_RESPONSE_TIMEOUT is set, use that to determine diff --git a/lib/pingpong.h b/lib/pingpong.h index 5db96c4345f8..bd723b1c9bf4 100644 --- a/lib/pingpong.h +++ b/lib/pingpong.h @@ -53,8 +53,6 @@ struct pingpong { size_t sendsize; /* total size of the sendthis buffer */ struct curltime response; /* set to Curl_now() when a command has been sent off, used to time-out response reading */ - timediff_t response_time; /* When no timeout is given, this is the amount of - milliseconds we await for a server response. */ struct dynbuf sendbuf; struct dynbuf recvbuf; size_t overflow; /* number of bytes left after a final response line */ @@ -75,7 +73,6 @@ struct pingpong { #define PINGPONG_SETUP(pp,s,e) \ do { \ - (pp)->response_time = RESP_TIMEOUT; \ (pp)->statemachine = s; \ (pp)->endofresp = e; \ } while(0) diff --git a/lib/urldata.h b/lib/urldata.h index 19f96bbc1744..f79ccca0aceb 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -127,7 +127,7 @@ typedef unsigned int curl_prot_t; #define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") /* Default FTP/IMAP etc response timeout in milliseconds */ -#define RESP_TIMEOUT (120*1000) +#define RESP_TIMEOUT (60*1000) /* Max string input length is a precaution against abuse and to detect junk input easier and better. */ From 692c7f133e6f9a5053a87b1fffbf3c41697a7742 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 27 Oct 2025 12:16:59 +0100 Subject: [PATCH 146/885] TLS: IP address verification, extend test Change the test certificate to carry a altname 'dns:127.0.0.1' which should *not* match in test_17_05_bad_ip_addr. wolfSSL: since `wolfSSL_check_domain_name()` does not differentiate between DNS and IP names, use if only for DNS names. For IP addresses, get the peer certificate after the handshake and check that using wolfSSL_X509_check_ip_asc(). Unfortunately, this succeeds where it should not, as wolfSSL internally used the same check code for both cases. So, skip the test case until wolfSSL fixes that. Reported-by: Joshua Rogers Closes #19252 --- lib/vquic/vquic-tls.c | 13 +++++++++---- lib/vtls/wolfssl.c | 28 +++++++++++++++++++++++----- tests/http/test_02_download.py | 2 ++ tests/http/test_07_upload.py | 2 ++ tests/http/test_17_ssl_use.py | 21 +++++++++++++++++++++ tests/http/testenv/certs.py | 14 +++++++++----- tests/http/testenv/env.py | 1 + 7 files changed, 67 insertions(+), 14 deletions(-) diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index fa89c0b80967..f4ef06c33b72 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -178,12 +178,17 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, #elif defined(USE_WOLFSSL) (void)data; if(conn_config->verifyhost) { - char *snihost = peer->sni ? peer->sni : peer->hostname; WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(ctx->wssl.ssl); - if(wolfSSL_X509_check_host(cert, snihost, strlen(snihost), 0, NULL) - == WOLFSSL_FAILURE) { + if(!cert) + result = CURLE_OUT_OF_MEMORY; + else if(peer->sni && + (wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, NULL) + == WOLFSSL_FAILURE)) + result = CURLE_PEER_FAILED_VERIFICATION; + else if(!peer->sni && + (wolfSSL_X509_check_ip_asc(cert, peer->hostname, 0) + == WOLFSSL_FAILURE)) result = CURLE_PEER_FAILED_VERIFICATION; - } wolfSSL_X509_free(cert); } if(!result) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index fe63097f9c3a..1efb5dc37094 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1491,11 +1491,10 @@ wssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } #endif - /* Enable RFC2818 checks */ - if(conn_config->verifyhost) { - char *snihost = connssl->peer.sni ? - connssl->peer.sni : connssl->peer.hostname; - if(wolfSSL_check_domain_name(wssl->ssl, snihost) != + /* Enable RFC2818 checks on domain names. This cannot check + * IP addresses which we need to do extra after the handshake. */ + if(conn_config->verifyhost && connssl->peer.sni) { + if(wolfSSL_check_domain_name(wssl->ssl, connssl->peer.sni) != WOLFSSL_SUCCESS) { return CURLE_SSL_CONNECT_ERROR; } @@ -1719,6 +1718,25 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, detail = wolfSSL_get_error(wssl->ssl, ret); CURL_TRC_CF(data, cf, "wolfSSL_connect() -> %d, detail=%d", ret, detail); + /* On a successful handshake with an IP address, do an extra check + * on the peer certificate */ + if(ret == WOLFSSL_SUCCESS && + conn_config->verifyhost && + !connssl->peer.sni) { + /* we have an IP address as host name. */ + WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(wssl->ssl); + if(!cert) { + failf(data, "unable to get peer certificate"); + return CURLE_PEER_FAILED_VERIFICATION; + } + ret = wolfSSL_X509_check_ip_asc(cert, connssl->peer.hostname, 0); + CURL_TRC_CF(data, cf, "check peer certificate for IP match on %s -> %d", + connssl->peer.hostname, ret); + if(ret != WOLFSSL_SUCCESS) + detail = DOMAIN_NAME_MISMATCH; + wolfSSL_X509_free(cert); + } + if(ret == WOLFSSL_SUCCESS) { return CURLE_OK; } diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 26da1d2feee9..574401cb7297 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -610,6 +610,8 @@ def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): pytest.skip("h3 not supported") if proto != 'h3' and sys.platform.startswith('darwin') and env.ci_run: pytest.skip('failing on macOS CI runners') + if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('wolfssl'): + pytest.skip('h3 wolfssl early data failing on macOS') if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('gnutls'): pytest.skip('h3 gnutls early data failing on macOS') count = 2 diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index c2377d41e422..fa2ef272d7c6 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -712,6 +712,8 @@ def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, pytest.skip("h3 not supported") if proto != 'h3' and sys.platform.startswith('darwin') and env.ci_run: pytest.skip('failing on macOS CI runners') + if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('wolfssl'): + pytest.skip('h3 wolfssl early data failing on macOS') if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('gnutls'): pytest.skip('h3 gnutls early data failing on macOS') count = 2 diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index 619ecd25e6f1..d0af093af0b6 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -186,6 +186,27 @@ def test_17_05_bad_ip_addr(self, env: Env, proto, r = curl.http_get(url=url, alpn_proto=proto) assert r.exit_code == 60, f'{r}' + # use IP address that is in cert as DNS name (not really legal) + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_17_05_very_bad_ip_addr(self, env: Env, proto, + httpd, configures_httpd, + nghttpx, configures_nghttpx): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if env.curl_uses_lib('mbedtls'): + pytest.skip("mbedtls falsely verifies a DNS: altname as IP address") + if env.curl_uses_lib('wolfssl'): + pytest.skip("wolfSSL falsely verifies a DNS: altname as IP address") + httpd.set_domain1_cred_name('domain1-very-bad') + httpd.reload_if_config_changed() + if proto == 'h3': + nghttpx.set_cred_name('domain1-very-bad') + nghttpx.reload_if_config_changed() + curl = CurlClient(env=env) + url = f'https://127.0.0.1:{env.port_for(proto)}/curltest/sslinfo' + r = curl.http_get(url=url, alpn_proto=proto) + assert r.exit_code == 60, f'{r}' + # use localhost for connect @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_06_localhost(self, env: Env, proto, httpd, nghttpx): diff --git a/tests/http/testenv/certs.py b/tests/http/testenv/certs.py index bfb7287eeee5..e59b1ea147e1 100644 --- a/tests/http/testenv/certs.py +++ b/tests/http/testenv/certs.py @@ -459,11 +459,15 @@ def _add_ca_usages(csr: Any) -> Any: def _add_leaf_usages(csr: Any, domains: List[str], issuer: Credentials) -> Any: names = [] for name in domains: - try: - names.append(x509.IPAddress(ipaddress.ip_address(name))) - # TODO: specify specific exceptions here - except: # noqa: E722 - names.append(x509.DNSName(name)) + m = re.match(r'dns:(.+)', name) + if m: + names.append(x509.DNSName(m.group(1))) + else: + try: + names.append(x509.IPAddress(ipaddress.ip_address(name))) + # TODO: specify specific exceptions here + except: # noqa: E722 + names.append(x509.DNSName(name)) return csr.add_extension( x509.BasicConstraints(ca=False, path_length=None), diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index 0cd9101342d1..ff8741530b70 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -188,6 +188,7 @@ def __init__(self, pytestconfig: Optional[pytest.Config] = None, self.cert_specs = [ CertificateSpec(domains=[self.domain1, self.domain1brotli, 'localhost', '127.0.0.1'], key_type='rsa2048'), CertificateSpec(name='domain1-no-ip', domains=[self.domain1, self.domain1brotli], key_type='rsa2048'), + CertificateSpec(name='domain1-very-bad', domains=[self.domain1, 'dns:127.0.0.1'], key_type='rsa2048'), CertificateSpec(domains=[self.domain2], key_type='rsa2048'), CertificateSpec(domains=[self.ftp_domain], key_type='rsa2048'), CertificateSpec(domains=[self.proxy_domain, '127.0.0.1'], key_type='rsa2048'), From 05eea37e78e8e429437699749eb692cd0325d909 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 27 Oct 2025 16:37:03 +0100 Subject: [PATCH 147/885] CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also Also move the old name mention to a HISTORY section Closes #19258 --- docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md | 9 ++++++--- docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md b/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md index 30ae25b42ac5..85695316e655 100644 --- a/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md +++ b/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md @@ -5,6 +5,7 @@ Title: CURLOPT_SERVER_RESPONSE_TIMEOUT Section: 3 Source: libcurl See-also: + - CURLOPT_SERVER_RESPONSE_TIMEOUT_MS (3) - CURLOPT_CONNECTTIMEOUT (3) - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TIMEOUT (3) @@ -40,11 +41,9 @@ connection is considered dead and the transfer fails. It is recommended that if used in conjunction with CURLOPT_TIMEOUT(3), you set CURLOPT_SERVER_RESPONSE_TIMEOUT(3) to a value smaller than CURLOPT_TIMEOUT(3). -This option was formerly known as CURLOPT_FTP_RESPONSE_TIMEOUT. - # DEFAULT -None +60 seconds # %PROTOCOLS% @@ -66,6 +65,10 @@ int main(void) } ~~~ +# HISTORY + +This option was formerly known as CURLOPT_FTP_RESPONSE_TIMEOUT. + # %AVAILABILITY% # RETURN VALUE diff --git a/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md b/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md index 267659cde2db..98d93fe5dc95 100644 --- a/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md +++ b/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md @@ -5,6 +5,7 @@ Title: CURLOPT_SERVER_RESPONSE_TIMEOUT_MS Section: 3 Source: libcurl See-also: + - CURLOPT_SERVER_RESPONSE_TIMEOUT (3) - CURLOPT_CONNECTTIMEOUT (3) - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TIMEOUT (3) @@ -47,7 +48,7 @@ This is the millisecond version of CURLOPT_SERVER_RESPONSE_TIMEOUT(3). # DEFAULT -None +60000 milliseconds # %PROTOCOLS% From 73811b4c51a959696b38f7b872afbebd230e6f06 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 27 Oct 2025 16:40:52 +0100 Subject: [PATCH 148/885] header: see-also --proxy-header and vice versa Closes #19259 --- docs/cmdline-opts/header.md | 1 + docs/cmdline-opts/proxy-header.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/cmdline-opts/header.md b/docs/cmdline-opts/header.md index 66816aac538b..7af86aba1833 100644 --- a/docs/cmdline-opts/header.md +++ b/docs/cmdline-opts/header.md @@ -12,6 +12,7 @@ Multi: append See-also: - user-agent - referer + - proxy-header Example: - -H "X-First-Name: Joe" $URL - -H "User-Agent: yes-please/2000" $URL diff --git a/docs/cmdline-opts/proxy-header.md b/docs/cmdline-opts/proxy-header.md index 3edf6c9a90e5..459eb462f683 100644 --- a/docs/cmdline-opts/proxy-header.md +++ b/docs/cmdline-opts/proxy-header.md @@ -10,6 +10,7 @@ Category: proxy Multi: append See-also: - proxy + - header Example: - --proxy-header "X-First-Name: Joe" -x http://proxy $URL - --proxy-header "User-Agent: surprise" -x http://proxy $URL From fa49c50ac359bc3ac7c76e86e0be0fe9a0cb6b7c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 27 Oct 2025 19:23:37 +0100 Subject: [PATCH 149/885] tests/server/dnsd: fix potential buffer overflow When handling incoming DNS packets. Reported-by: Joshua Rogers Closes #19261 --- tests/server/dnsd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/server/dnsd.c b/tests/server/dnsd.c index 3f8f5b37a7d3..93edcb2397c6 100644 --- a/tests/server/dnsd.c +++ b/tests/server/dnsd.c @@ -83,7 +83,7 @@ static const char *type2string(unsigned short qtype) * Return query (qname + type + class), type and id. */ static int store_incoming(const unsigned char *data, size_t size, - unsigned char *qbuf, size_t *qlen, + unsigned char *qbuf, size_t qbuflen, size_t *qlen, unsigned short *qtype, unsigned short *idp) { FILE *server; @@ -159,6 +159,12 @@ static int store_incoming(const unsigned char *data, size_t size, (void) get16bit(&data, &size); *qlen = qsize - size; /* total size of the query */ + if(*qlen > qbuflen) { + logmsg("dnsd: query too large: %lu > %lu", + (unsigned long)*qlen, (unsigned long)qbuflen); + fclose(server); + return -1; + } memcpy(qbuf, qptr, *qlen); } else @@ -616,7 +622,7 @@ static int test_dnsd(int argc, char **argv) per test case */ read_instructions(); - store_incoming(inbuffer, n, qbuf, &qlen, &qtype, &id); + store_incoming(inbuffer, n, qbuf, sizeof(qbuf), &qlen, &qtype, &id); set_advisor_read_lock(loglockfile); serverlogslocked = 1; From bc9977021773e299c560e4afc60d623fd882825b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Oct 2025 09:37:39 +0100 Subject: [PATCH 150/885] singleuse.pl: fix string warning "Use of uninitialized value $unittests in concatenation on line 170" Closes #19266 --- scripts/singleuse.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/singleuse.pl b/scripts/singleuse.pl index b4cbe3ff4a12..3ce5dda4423b 100755 --- a/scripts/singleuse.pl +++ b/scripts/singleuse.pl @@ -36,7 +36,7 @@ use strict; use warnings; -my $unittests; +my $unittests=""; if(@ARGV && $ARGV[0] eq "--unit") { $unittests = "tests/unit "; shift @ARGV; From 02113a6307a5f9ffcafd60604fba22b750942da5 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 28 Oct 2025 13:16:36 +0800 Subject: [PATCH 151/885] Curl_resolv: explicitly set *entry to NULL at the top Closes #19263 --- lib/hostip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/hostip.c b/lib/hostip.c index d4b1b87e7ad5..7e2551d8f301 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -848,6 +848,8 @@ CURLcode Curl_resolv(struct Curl_easy *data, size_t hostname_len; bool keep_negative = TRUE; /* cache a negative result */ + *entry = NULL; + #ifndef CURL_DISABLE_DOH data->conn->bits.doh = FALSE; /* default is not */ #else @@ -969,7 +971,6 @@ CURLcode Curl_resolv(struct Curl_easy *data, error: if(dns) Curl_resolv_unlink(data, &dns); - *entry = NULL; Curl_async_shutdown(data); if(keep_negative) store_negative_resolve(data, hostname, port); From 9308ea22e8299fb79f4acd0398829cbe37a3fb1c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Oct 2025 11:56:03 +0100 Subject: [PATCH 152/885] cookie: remove the temporary file on (all) errors Fixes #19267 Reported-by: Harry Sintonen Closes #19268 --- lib/cookie.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index 9b89b7df7078..35b252971d9a 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -1595,7 +1595,6 @@ static CURLcode cookie_output(struct Curl_easy *data, curlx_fclose(out); out = NULL; if(tempstore && Curl_rename(tempstore, filename)) { - unlink(tempstore); error = CURLE_WRITE_ERROR; goto error; } @@ -1612,7 +1611,10 @@ static CURLcode cookie_output(struct Curl_easy *data, error: if(out && !use_stdout) curlx_fclose(out); - free(tempstore); + if(tempstore) { + unlink(tempstore); + free(tempstore); + } return error; } From 875ea98c360df34dd757eb7e1e62a1cb2d177da8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Oct 2025 09:05:25 +0100 Subject: [PATCH 153/885] schannel: handle Curl_conn_cf_send() errors better Avoid a resource leak in the error path. Reported-by: Joshua Rogers Closes #19265 --- lib/vtls/schannel.c | 115 ++++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 51 deletions(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 0561d6fbddfa..376d1a67eae3 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1113,6 +1113,41 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OK; } +static CURLcode schannel_error(struct Curl_easy *data, + SECURITY_STATUS sspi_status) +{ + char buffer[STRERROR_LEN]; + switch(sspi_status) { + case SEC_E_INSUFFICIENT_MEMORY: + failf(data, "schannel: next InitializeSecurityContext failed: %s", + Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); + return CURLE_OUT_OF_MEMORY; + case SEC_E_WRONG_PRINCIPAL: + failf(data, "schannel: SNI or certificate check failed: %s", + Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); + return CURLE_PEER_FAILED_VERIFICATION; + case SEC_E_UNTRUSTED_ROOT: + failf(data, "schannel: %s", + Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); + return CURLE_PEER_FAILED_VERIFICATION; +#if 0 + case SEC_E_INVALID_HANDLE: + case SEC_E_INVALID_TOKEN: + case SEC_E_LOGON_DENIED: + case SEC_E_TARGET_UNKNOWN: + case SEC_E_NO_AUTHENTICATING_AUTHORITY: + case SEC_E_INTERNAL_ERROR: + case SEC_E_NO_CREDENTIALS: + case SEC_E_UNSUPPORTED_FUNCTION: + case SEC_E_APPLICATION_PROTOCOL_MISMATCH: +#endif + default: + failf(data, "schannel: next InitializeSecurityContext failed: %s", + Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); + return CURLE_SSL_CONNECT_ERROR; + } +} + static CURLcode schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) { @@ -1266,28 +1301,18 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) Curl_safefree(inbuf[0].pvBuffer); /* check if the handshake was incomplete */ - if(sspi_status == SEC_E_INCOMPLETE_MESSAGE) { + switch(sspi_status) { + case SEC_E_INCOMPLETE_MESSAGE: backend->encdata_is_incomplete = TRUE; connssl->io_need = CURL_SSL_IO_NEED_RECV; DEBUGF(infof(data, "schannel: received incomplete message, need more data")); return CURLE_OK; - } - /* If the server has requested a client certificate, attempt to continue - the handshake without one. This will allow connections to servers which - request a client certificate but do not require it. */ - if(sspi_status == SEC_I_INCOMPLETE_CREDENTIALS && - !(backend->req_flags & ISC_REQ_USE_SUPPLIED_CREDS)) { - backend->req_flags |= ISC_REQ_USE_SUPPLIED_CREDS; - connssl->io_need = CURL_SSL_IO_NEED_SEND; - DEBUGF(infof(data, - "schannel: a client certificate has been requested")); - return CURLE_OK; - } - - /* check if the handshake needs to be continued */ - if(sspi_status == SEC_I_CONTINUE_NEEDED || sspi_status == SEC_E_OK) { + case SEC_I_CONTINUE_NEEDED: + case SEC_E_OK: + /* check if the handshake needs to be continued */ + result = CURLE_OK; for(i = 0; i < 3; i++) { /* search for handshake tokens that need to be send */ if(outbuf[i].BufferType == SECBUFFER_TOKEN && outbuf[i].cbBuffer > 0) { @@ -1301,47 +1326,35 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) if(result || (outbuf[i].cbBuffer != written)) { failf(data, "schannel: failed to send next handshake data: " "sent %zu of %lu bytes", written, outbuf[i].cbBuffer); - return CURLE_SSL_CONNECT_ERROR; + result = CURLE_SSL_CONNECT_ERROR; } } - + } + for(i = 0; i < 3; i++) { /* free obsolete buffer */ - if(outbuf[i].pvBuffer) { + if(outbuf[i].pvBuffer) Curl_pSecFn->FreeContextBuffer(outbuf[i].pvBuffer); - } } - } - else { - char buffer[STRERROR_LEN]; - switch(sspi_status) { - case SEC_E_INSUFFICIENT_MEMORY: - failf(data, "schannel: next InitializeSecurityContext failed: %s", - Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); - return CURLE_OUT_OF_MEMORY; - case SEC_E_WRONG_PRINCIPAL: - failf(data, "schannel: SNI or certificate check failed: %s", - Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); - return CURLE_PEER_FAILED_VERIFICATION; - case SEC_E_UNTRUSTED_ROOT: - failf(data, "schannel: %s", - Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); - return CURLE_PEER_FAILED_VERIFICATION; -#if 0 - case SEC_E_INVALID_HANDLE: - case SEC_E_INVALID_TOKEN: - case SEC_E_LOGON_DENIED: - case SEC_E_TARGET_UNKNOWN: - case SEC_E_NO_AUTHENTICATING_AUTHORITY: - case SEC_E_INTERNAL_ERROR: - case SEC_E_NO_CREDENTIALS: - case SEC_E_UNSUPPORTED_FUNCTION: - case SEC_E_APPLICATION_PROTOCOL_MISMATCH: -#endif - default: - failf(data, "schannel: next InitializeSecurityContext failed: %s", - Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); - return CURLE_SSL_CONNECT_ERROR; + if(result) + return result; + break; + + case SEC_I_INCOMPLETE_CREDENTIALS: + if(!(backend->req_flags & ISC_REQ_USE_SUPPLIED_CREDS)) { + /* If the server has requested a client certificate, attempt to + continue the handshake without one. This will allow connections to + servers which request a client certificate but do not require + it. */ + backend->req_flags |= ISC_REQ_USE_SUPPLIED_CREDS; + connssl->io_need = CURL_SSL_IO_NEED_SEND; + DEBUGF(infof(data, + "schannel: a client certificate has been requested")); + return CURLE_OK; } + FALLTHROUGH(); + + default: + return schannel_error(data, sspi_status); } /* check if there was additional remaining encrypted data */ From fe9e0115b1572f5fd39503ed266efc1097f96b09 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 27 Oct 2025 17:18:25 +0100 Subject: [PATCH 154/885] tests: reduce max allowed allocations for four tests and completely remove the check for one Closes #19260 --- tests/data/test1 | 2 +- tests/data/test142 | 1 + tests/data/test440 | 2 +- tests/data/test767 | 2 +- tests/data/test770 | 4 ---- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/data/test1 b/tests/data/test1 index 4368eb78be3e..5c3c318be533 100644 --- a/tests/data/test1 +++ b/tests/data/test1 @@ -50,7 +50,7 @@ Accept: */* -Allocations: 135 +Allocations: 120 Maximum allocated: 136000 diff --git a/tests/data/test142 b/tests/data/test142 index cb03b832af67..f59555642e09 100644 --- a/tests/data/test142 +++ b/tests/data/test142 @@ -188,6 +188,7 @@ QUIT Allocations: 170 +Maximum allocated: 150000 diff --git a/tests/data/test440 b/tests/data/test440 index 81cf738473bd..7da9a8bd3cc8 100644 --- a/tests/data/test440 +++ b/tests/data/test440 @@ -74,7 +74,7 @@ https://this.hsts.example./%TESTNUMBER 56 -Allocations: 1100 +Allocations: 145 diff --git a/tests/data/test767 b/tests/data/test767 index 0927be4f1b3f..2695e3bffa6c 100644 --- a/tests/data/test767 +++ b/tests/data/test767 @@ -51,7 +51,7 @@ Accept: */* -Allocations: 135 +Allocations: 120 Maximum allocated: 136000 diff --git a/tests/data/test770 b/tests/data/test770 index 98e3850c4c43..89ba5b1a8052 100644 --- a/tests/data/test770 +++ b/tests/data/test770 @@ -50,9 +50,5 @@ User-Agent: curl/%VERSION Accept: */* - -Allocations: 135 -Maximum allocated: 136000 - From ba85f9d60579d38cd588ecdd3e0e6e306e6c4380 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Oct 2025 23:33:16 +0100 Subject: [PATCH 155/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 673a61052a2e..792ef742c682 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3529 + Contributors: 3531 This release includes the following changes: @@ -86,6 +86,7 @@ This release includes the following bugfixes: o connect: remove redundant condition in shutdown start [289] o cookie: avoid saving a cookie file if no transfer was done [11] o cookie: only count accepted cookies in Curl_cookie_add [364] + o cookie: remove the temporary file on (all) errors [356] o cpool: make bundle->dest an array; fix UB [218] o curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY [320] o curl_easy_getinfo: error code on NULL arg [2] @@ -101,6 +102,7 @@ This release includes the following bugfixes: o CURLOPT_COOKIEFILE.md: clarify when the cookies are loaded [159] o CURLOPT_HEADER/WRITEFUNCTION.md: drop '* size' since size is always 1 [63] o CURLOPT_MAXLIFETIME_CONN: make default 24 hours [10] + o CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also [397] o CURLOPT_SSL_VERIFYHOST.md: add see-also to two other VERIFYHOST options [32] o CURLOPT_TIMECONDITION.md: works for FILE and FTP as well [27] o cw-out: unify the error handling pattern in cw_out_do_write [414] @@ -114,6 +116,7 @@ This release includes the following bugfixes: o docs: fix/tidy code fences [87] o doswin: CloseHandle the thread on shutdown [307] o easy_getinfo: check magic, Curl_close safety [3] + o ECH.md: make OpenSSL branch clone instructions work [430] o examples/chkspeed: portable printing when outputting curl_off_t values [365] o examples/sessioninfo: cast printf string mask length to int [232] o examples/sessioninfo: do not disable security [255] @@ -149,6 +152,7 @@ This release includes the following bugfixes: o gnutls: check conversion of peer cert chain [275] o gnutls: fix re-handshake comments [422] o gtls: avoid potential use of uninitialized variable in trace output [83] + o header.md: see-also --proxy-header and vice versa [396] o hmac: free memory properly on errors [377] o hostip: don't store negative resolves due unrelated errors [256] o hostip: fix infof() output for non-ipv6 builds using IPv6 address [338] @@ -162,6 +166,7 @@ This release includes the following bugfixes: o http: make Content-Length parser more WHATWG [183] o http: only accept ';' as a separator for custom headers [407] o http: return error for a second Location: header [393] + o http_proxy: fix adding custom proxy headers [424] o httpsrr: free old pointers when storing new [57] o imap: parse and use UIDVALIDITY as a number [420] o imap: treat capabilities case insensitively [345] @@ -278,6 +283,7 @@ This release includes the following bugfixes: o OS400: fix a use-after-free/double-free case [142] o osslq: set idle timeout to 0 [237] o pingpong: remove two old leftover debug infof() calls + o pop3: fix CAPA response termination detection [427] o pop3: function could get the ->transfer field wrong [292] o pytest: skip specific tests for no-verbose builds [171] o quic: fix min TLS version handling [14] @@ -300,6 +306,7 @@ This release includes the following bugfixes: o sasl: clear canceled mechanism instead of toggling it [41] o schannel: assign result before using it [62] o schannel: fix memory leak [363] + o schannel: handle Curl_conn_cf_send() errors better [352] o schannel: lower the maximum allowed time to block to 7 seconds [333] o schannel_verify: do not call infof with an appended \n [371] o schannel_verify: fix mem-leak in Curl_verify_host [208] @@ -309,6 +316,7 @@ This release includes the following bugfixes: o setopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1 [257] o setopt: fix unused variable warning in minimal build [332] o setopt: make CURLOPT_MAXREDIRS accept -1 (again) [1] + o singleuse.pl: fix string warning [392] o smb: adjust buffer size checks [45] o smb: transfer debugassert to real check [303] o smtp: check EHLO responses case insensitively [50] @@ -320,7 +328,9 @@ This release includes the following bugfixes: o socks: handle error in verbose trace gracefully [94] o socks: handle premature close [246] o socks: make Curl_blockread_all return CURLcode [67] + o socks: properly maintain the status of 'done' [405] o socks: rewwork, cleaning up socks state handling [135] + o socks_gssapi: also reset buffer length after free [429] o socks_gssapi: make the gss_context a local variable [144] o socks_gssapi: reject too long tokens [90] o socks_gssapi: remove superfluous releases of the gss_recv_token [139] @@ -365,6 +375,7 @@ This release includes the following bugfixes: o tidy-up: update MS links, allow long URLs via checksrc [73] o tidy-up: URLs [101] o time-cond.md: refer to the singular curl_getdate man page [148] + o TLS: IP address verification, extend test [398] o TODO: fix a typo [93] o TODO: remove already implemented or bad items [36] o tool: fix exponential retry delay [47] @@ -412,6 +423,7 @@ This release includes the following bugfixes: o vtls: unify the error handling in ssl_cf_connect(). [413] o vtls_int.h: clarify data_pending [124] o vtls_scache: fix race condition [157] + o wcurl: sync to +dev snapshot [425] o windows: replace _beginthreadex() with CreateThread() [80] o windows: stop passing unused, optional argument for Win9x compatibility [75] o windows: use consistent format when showing error codes [199] @@ -461,9 +473,9 @@ advice from friends like these: Nir Azkiel, Patrick Monnerat, Pavel P, plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, - Theo Buehler, Tim Becker, tkzv on github, Viktor Szakats, - WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 - (63 contributors) + TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, Viktor Szakatas, + Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 + (65 contributors) References to bug reports and discussions on issues: @@ -817,9 +829,11 @@ References to bug reports and discussions on issues: [348] = https://curl.se/bug/?i=19086 [349] = https://curl.se/bug/?i=19076 [351] = https://curl.se/bug/?i=19141 + [352] = https://curl.se/bug/?i=19265 [353] = https://curl.se/bug/?i=19073 [354] = https://curl.se/bug/?i=19078 [355] = https://curl.se/bug/?i=19135 + [356] = https://curl.se/bug/?i=19267 [357] = https://curl.se/bug/?i=19136 [358] = https://curl.se/bug/?i=19133 [359] = https://curl.se/bug/?i=19139 @@ -854,13 +868,18 @@ References to bug reports and discussions on issues: [389] = https://curl.se/bug/?i=19160 [390] = https://curl.se/bug/?i=19137 [391] = https://curl.se/bug/?i=19223 + [392] = https://curl.se/bug/?i=19266 [393] = https://curl.se/bug/?i=19130 [394] = https://curl.se/bug/?i=19153 + [396] = https://curl.se/bug/?i=19259 + [397] = https://curl.se/bug/?i=19258 + [398] = https://curl.se/bug/?i=19252 [399] = https://curl.se/bug/?i=19206 [400] = https://curl.se/bug/?i=19208 [402] = https://curl.se/bug/?i=19211 [403] = https://curl.se/bug/?i=19213 [404] = https://curl.se/bug/?i=18991 + [405] = https://curl.se/bug/?i=19255 [406] = https://curl.se/bug/?i=19202 [407] = https://curl.se/bug/?i=19200 [408] = https://curl.se/bug/?i=19201 @@ -879,3 +898,8 @@ References to bug reports and discussions on issues: [421] = https://curl.se/bug/?i=19186 [422] = https://curl.se/bug/?i=19187 [423] = https://curl.se/bug/?i=19185 + [424] = https://curl.se/bug/?i=19227 + [425] = https://curl.se/bug/?i=19247 + [427] = https://curl.se/bug/?i=19228 + [429] = https://curl.se/bug/?i=19167 + [430] = https://curl.se/bug/?i=19237 From 0ba006601ffa813388bf4b4f01a181767fbdad15 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Sun, 19 Oct 2025 11:42:37 -0400 Subject: [PATCH 156/885] tool_operate: move the checks that skip ca cert detection - Move the checks into the function that needs them, cacertpaths(). Prior to this change the caller made the determination whether to skip calling cacertpaths for cert detection. However for posterity it is better to have the checks in cacertpaths since other code could call it. Closes https://github.com/curl/curl/pull/19148 --- src/tool_operate.c | 59 ++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 1c003517297e..f290a288dee7 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2032,35 +2032,54 @@ static CURLcode is_using_schannel(int *pusing) * environment-specified filename is found then check for CA bundle default * filename curl-ca-bundle.crt in the user's PATH. * + * If the user has set a CA cert/path or disabled peer verification (including + * for DoH, so completely disabled) then these locations are ignored. + * * If Schannel is the selected SSL backend then these locations are ignored. * We allow setting CA location for Schannel only when explicitly specified by * the user via CURLOPT_CAINFO / --cacert. */ - static CURLcode cacertpaths(struct OperationConfig *config) { - CURLcode result = CURLE_OUT_OF_MEMORY; - char *env = curl_getenv("CURL_CA_BUNDLE"); + char *env; + CURLcode result; + int using_schannel; + + if(!feature_ssl || config->cacert || config->capath || + (config->insecure_ok && (!config->doh_url || config->doh_insecure_ok))) + return CURLE_OK; + + result = is_using_schannel(&using_schannel); + if(result || using_schannel) + return result; + + env = curl_getenv("CURL_CA_BUNDLE"); if(env) { config->cacert = strdup(env); curl_free(env); - if(!config->cacert) + if(!config->cacert) { + result = CURLE_OUT_OF_MEMORY; goto fail; + } } else { env = curl_getenv("SSL_CERT_DIR"); if(env) { config->capath = strdup(env); curl_free(env); - if(!config->capath) + if(!config->capath) { + result = CURLE_OUT_OF_MEMORY; goto fail; + } } env = curl_getenv("SSL_CERT_FILE"); if(env) { config->cacert = strdup(env); curl_free(env); - if(!config->cacert) + if(!config->cacert) { + result = CURLE_OUT_OF_MEMORY; goto fail; + } } } @@ -2087,7 +2106,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) #endif return CURLE_OK; fail: - free(config->capath); + Curl_safefree(config->capath); return result; } @@ -2106,30 +2125,8 @@ static CURLcode transfer_per_config(struct OperationConfig *config, return CURLE_FAILED_INIT; } - /* On Windows we cannot set the path to curl-ca-bundle.crt at compile time. - * We look for the file in two ways: - * 1: look at the environment variable CURL_CA_BUNDLE for a path - * 2: if #1 is not found, use the Windows API function SearchPath() - * to find it along the app's path (includes app's dir and CWD) - * - * We support the environment variable thing for non-Windows platforms - * too. Just for the sake of it. - */ - if(feature_ssl && - !config->cacert && - !config->capath && - (!config->insecure_ok || (config->doh_url && !config->doh_insecure_ok))) { - int using_schannel = -1; - - result = is_using_schannel(&using_schannel); - - /* With the addition of CAINFO support for Schannel, this search could - * find a certificate bundle that was previously ignored. To maintain - * backward compatibility, only perform this search if not using Schannel. - */ - if(!result && !using_schannel) - result = cacertpaths(config); - } + if(!result) + result = cacertpaths(config); if(!result) { result = single_transfer(config, share, added, skipped); From c82a70628dea815364ed41f30e2f6b8eb87f9fdd Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 27 Oct 2025 10:33:41 +0100 Subject: [PATCH 157/885] ssl-session-cache: check use on config and availability Replace the check if a ssl session cache is configured with a function checking if it is configured *and* if an ssl session cache is available. During normal operations, a session cache is always there, however for "connect-only" transfers this might not be the case. When such transfers receive new sessions/tickets, they need to silently discard those and not fail. Reported-by: Marc Aldorasi Fixes https://github.com/curl/curl/issues/18983 Closes https://github.com/curl/curl/pull/19251 --- lib/vquic/curl_ngtcp2.c | 7 +++---- lib/vtls/gtls.c | 3 +-- lib/vtls/mbedtls.c | 5 ++--- lib/vtls/openssl.c | 7 +++---- lib/vtls/schannel.c | 5 ++--- lib/vtls/vtls_scache.c | 9 +++++++++ lib/vtls/vtls_scache.h | 6 ++++++ lib/vtls/wolfssl.c | 4 ++-- 8 files changed, 28 insertions(+), 18 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 3b918cd87062..3493f996cee1 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -2384,7 +2384,6 @@ static CURLcode cf_ngtcp2_tls_ctx_setup(struct Curl_cfilter *cf, void *user_data) { struct curl_tls_ctx *ctx = user_data; - struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); #ifdef USE_OPENSSL #if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC) @@ -2401,7 +2400,7 @@ static CURLcode cf_ngtcp2_tls_ctx_setup(struct Curl_cfilter *cf, return CURLE_FAILED_INIT; } #endif /* !OPENSSL_IS_BORINGSSL && !OPENSSL_IS_AWSLC */ - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { /* Enable the session cache because it is a prerequisite for the * "new session" callback. Use the "external storage" mode to prevent * OpenSSL from creating an internal session cache. @@ -2417,7 +2416,7 @@ static CURLcode cf_ngtcp2_tls_ctx_setup(struct Curl_cfilter *cf, failf(data, "ngtcp2_crypto_gnutls_configure_client_session failed"); return CURLE_FAILED_INIT; } - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { gnutls_handshake_set_hook_function(ctx->gtls.session, GNUTLS_HANDSHAKE_ANY, GNUTLS_HOOK_POST, quic_gtls_handshake_cb); @@ -2428,7 +2427,7 @@ static CURLcode cf_ngtcp2_tls_ctx_setup(struct Curl_cfilter *cf, failf(data, "ngtcp2_crypto_wolfssl_configure_client_context failed"); return CURLE_FAILED_INIT; } - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { /* Register to get notified when a new session is received */ wolfSSL_CTX_sess_set_new_cb(ctx->wssl.ssl_ctx, wssl_quic_new_session_cb); } diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 19c2ce893fb9..c79f192e823f 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -684,14 +684,13 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf, unsigned char *quic_tp, size_t quic_tp_len) { - struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); struct Curl_ssl_session *sc_session; unsigned char *sdata, *qtp_clone = NULL; size_t sdata_len = 0; size_t earlydata_max = 0; CURLcode result = CURLE_OK; - if(!ssl_config->primary.cache_session) + if(!Curl_ssl_scache_use(cf, data)) return CURLE_OK; /* we always unconditionally get the session id here, as even if we diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 89d4eff64ea4..ea8981b3cda9 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -859,7 +859,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) #endif /* Check if there is a cached ID we can/should use here! */ - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { struct Curl_ssl_session *sc_session = NULL; CURLcode result; @@ -1086,7 +1086,6 @@ mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) struct ssl_connect_data *connssl = cf->ctx; struct mbed_ssl_backend_data *backend = (struct mbed_ssl_backend_data *)connssl->backend; - struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); mbedtls_ssl_session session; bool msession_alloced = FALSE; struct Curl_ssl_session *sc_session = NULL; @@ -1097,7 +1096,7 @@ mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) int ret; DEBUGASSERT(backend); - if(!ssl_config->primary.cache_session) + if(!Curl_ssl_scache_use(cf, data)) return CURLE_OK; mbedtls_ssl_session_init(&session); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 535e4118da81..838c0242213b 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3056,7 +3056,6 @@ CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, unsigned char *quic_tp, size_t quic_tp_len) { - const struct ssl_config_data *config; unsigned char *der_session_buf = NULL; unsigned char *qtp_clone = NULL; CURLcode result = CURLE_OK; @@ -3064,8 +3063,7 @@ CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, if(!cf || !data) goto out; - config = Curl_ssl_cf_get_config(cf, data); - if(config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { struct Curl_ssl_session *sc_session = NULL; size_t der_session_size; unsigned char *der_session_ptr; @@ -3755,7 +3753,7 @@ ossl_init_session_and_alpns(struct ossl_ctx *octx, Curl_alpn_copy(&alpns, alpns_requested); octx->reused_session = FALSE; - if(ssl_config->primary.cache_session && !conn_cfg->verifystatus) { + if(Curl_ssl_scache_use(cf, data) && !conn_cfg->verifystatus) { struct Curl_ssl_session *scs = NULL; result = Curl_ssl_scache_take(cf, data, peer->scache_key, &scs); @@ -3797,6 +3795,7 @@ ossl_init_session_and_alpns(struct ossl_ctx *octx, } } #else + (void)ssl_config; (void)sess_reuse_cb; #endif } diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 376d1a67eae3..55a99b3b437c 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -927,7 +927,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) backend->cred = NULL; /* check for an existing reusable credential handle */ - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { struct Curl_schannel_cred *old_cred; Curl_ssl_scache_lock(data); old_cred = Curl_ssl_scache_get_obj(cf, data, connssl->peer.scache_key); @@ -1530,7 +1530,6 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = (struct schannel_ssl_backend_data *)connssl->backend; - struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); CURLcode result = CURLE_OK; SECURITY_STATUS sspi_status = SEC_E_OK; CERT_CONTEXT *ccert_context = NULL; @@ -1598,7 +1597,7 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) #endif /* save the current session data for possible reuse */ - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { Curl_ssl_scache_lock(data); /* Up ref count since call takes ownership */ backend->cred->refcount++; diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 8203baa9038b..b9abc6e3faed 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -353,6 +353,15 @@ void Curl_ssl_scache_destroy(struct Curl_ssl_scache *scache) } } +bool Curl_ssl_scache_use(struct Curl_cfilter *cf, struct Curl_easy *data) +{ + if(cf_ssl_scache_get(data)) { + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + return ssl_config ? ssl_config->primary.cache_session : FALSE; + } + return FALSE; +} + /* Lock shared SSL session data */ void Curl_ssl_scache_lock(struct Curl_easy *data) { diff --git a/lib/vtls/vtls_scache.h b/lib/vtls/vtls_scache.h index deedccfe8c66..445f21054937 100644 --- a/lib/vtls/vtls_scache.h +++ b/lib/vtls/vtls_scache.h @@ -65,6 +65,12 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, const char *tls_id, char **ppeer_key); +/* Return if there is a session cache shall be used. + * An ssl session might not be configured or not available for + * "connect-only" transfers. + */ +bool Curl_ssl_scache_use(struct Curl_cfilter *cf, struct Curl_easy *data); + /* Lock session cache mutex. * Call this before calling other Curl_ssl_*session* functions * Caller should unlock this mutex as soon as possible, as it may block diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 1efb5dc37094..9639709fdbe0 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1257,7 +1257,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, } #endif - if(ssl_config->primary.cache_session && (transport != TRNSPRT_QUIC)) { + if(Curl_ssl_scache_use(cf, data) && (transport != TRNSPRT_QUIC)) { /* Register to get notified when a new session is received */ wolfSSL_CTX_sess_set_new_cb(wctx->ssl_ctx, wssl_vtls_new_session_cb); } @@ -1316,7 +1316,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, #endif /* Check if there is a cached ID we can/should use here! */ - if(ssl_config->primary.cache_session) { + if(Curl_ssl_scache_use(cf, data)) { /* Set session from cache if there is one */ (void)wssl_setup_session(cf, data, wctx, &alpns, peer->scache_key, sess_reuse_cb); From d3e7bef1efd6c9683cb5ed8cf8782c83439d0674 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:33:24 +0000 Subject: [PATCH 158/885] GHA: update reuse to v6.2.0 Closes #19257 --- .github/scripts/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 564c3605ad72..a0c5c4d4be68 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -5,5 +5,5 @@ cmakelang==0.6.13 codespell==2.4.1 pytype==2024.10.11 -reuse==6.1.2 +reuse==6.2.0 ruff==0.14.1 From 614895c0450828edbedf667acb496de6cdceb8f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:57:13 +0000 Subject: [PATCH 159/885] GHA: update pyspelling to v2.12 Closes #19262 --- .github/scripts/requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/requirements-docs.txt b/.github/scripts/requirements-docs.txt index bd50e5010efb..fa26c105d095 100644 --- a/.github/scripts/requirements-docs.txt +++ b/.github/scripts/requirements-docs.txt @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: curl -pyspelling==2.11 +pyspelling==2.12 From a97f9d41cc01c733cec085008d644397ee6edd74 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 29 Oct 2025 09:11:09 +0100 Subject: [PATCH 160/885] openldap/ldap; check for binary attribute case insensitively This bug was found with ZeroPath Fixes #19240 Reported-by: Joshua Rogers Closes #19273 --- lib/ldap.c | 2 +- lib/openldap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ldap.c b/lib/ldap.c index 8db1f41338b1..f0bc2f2a3790 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -623,7 +623,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) } if((attr_len > 7) && - (strcmp(";binary", attr + (attr_len - 7)) == 0)) { + curl_strequal(";binary", attr + (attr_len - 7)) ) { /* Binary attribute, encode to base64. */ if(vals[i]->bv_len) { result = curlx_base64_encode(vals[i]->bv_val, vals[i]->bv_len, diff --git a/lib/openldap.c b/lib/openldap.c index dbf2f5f4f368..f06587f01724 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -1096,7 +1096,6 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, BerElement *ber = NULL; struct timeval tv = {0, 0}; struct berval bv, *bvals; - bool binary = FALSE; CURLcode result = CURLE_AGAIN; int code; char *info = NULL; @@ -1167,6 +1166,7 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, rc == LDAP_SUCCESS; rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals)) { int i; + bool binary; if(!bv.bv_val) break; @@ -1180,7 +1180,7 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, } binary = bv.bv_len > 7 && - !strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7); + curl_strnequal(bv.bv_val + bv.bv_len - 7, ";binary", 7); for(i = 0; bvals[i].bv_val != NULL; i++) { bool binval = FALSE; From 446dae5bfe3277d9458321f6888d7e214f832a21 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 29 Oct 2025 09:48:50 +0100 Subject: [PATCH 161/885] ngtcp2: overwrite rate-limits defaults In pytests test_08 with the Caddy server, the new rate-limiting in ngtcp2 did close the connection because it found "too many" stream data packet repeats. It is unclear if this is some Caddy issue or if the ngtcp2 implementaton is wrong. Or if curl can do anything here. Reported as https://github.com/ngtcp2/ngtcp2/issues/1850 This PR overwrites the ratelimit defaults in ngtcp2 with ten times increased values. This makes the errors disappear on macOS. Enable test_08_04/05 in CI again to see if there are any issues to be found there. (We had those disabled before having parallel pytests.) Closes #19274 --- lib/vquic/curl_ngtcp2.c | 20 ++++---------------- tests/http/test_08_caddy.py | 3 --- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 3493f996cee1..f72f6630f523 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -457,17 +457,6 @@ static void quic_settings(struct cf_ngtcp2_ctx *ctx, struct Curl_easy *data, struct pkt_io_ctx *pktx) { -#ifdef NGTCP2_SETTINGS_V2x -static uint16_t mtu_probes[] = { - 1472, /* what h2o offers */ - 1452, /* what Caddy offers */ - 1454 - 48, /* The well known MTU used by a domestic optic fiber - service in Japan. */ - 1390 - 48, /* Typical Tunneled MTU */ - 1280 - 48, /* IPv6 minimum MTU */ - 1492 - 48, /* PPPoE */ -}; -#endif ngtcp2_settings *s = &ctx->settings; ngtcp2_transport_params *t = &ctx->transport_params; @@ -485,12 +474,11 @@ static uint16_t mtu_probes[] = { s->max_window = 100 * ctx->max_stream_window; s->max_stream_window = 10 * ctx->max_stream_window; s->no_pmtud = FALSE; -#ifdef NGTCP2_SETTINGS_V2x - s->pmtud_probes = mtu_probes; - s->pmtud_probeslen = CURL_ARRAYSIZE(mtu_probes); - s->max_tx_udp_payload_size = 64 * 1024; /* mtu_probes[0]; */ +#ifdef NGTCP2_SETTINGS_V3 + /* try ten times the ngtcp2 defaults here for problems with Caddy */ + s->glitch_ratelim_burst = 1000 * 10; + s->glitch_ratelim_rate = 33 * 10; #endif - t->initial_max_data = 10 * ctx->max_stream_window; t->initial_max_stream_data_bidi_local = ctx->max_stream_window; t->initial_max_stream_data_bidi_remote = ctx->max_stream_window; diff --git a/tests/http/test_08_caddy.py b/tests/http/test_08_caddy.py index 3073607e043c..319ffeb96268 100644 --- a/tests/http/test_08_caddy.py +++ b/tests/http/test_08_caddy.py @@ -108,7 +108,6 @@ def test_08_03_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): # download 5MB files sequentially @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") - @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): if proto == 'h3' and not env.have_h3_curl(): @@ -121,7 +120,6 @@ def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): # download 10MB files sequentially @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") - @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): if proto == 'h3' and not env.have_h3_curl(): @@ -135,7 +133,6 @@ def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): # download 10MB files parallel @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) - @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") From 7973cb0b3ef2f2de677e65bc29062c122536262b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 29 Oct 2025 13:31:23 +0100 Subject: [PATCH 162/885] http: fix `-Wunreachable-code` in !websockets !unity builds Also requires non-unity build. Possibly more non-default options are necessary to reproduce. Seen with llvm/clang. ``` lib/http.c:1856:15: error: code will never be executed [-Werror,-Wunreachable-code] 1856 | httpreq = HTTPREQ_GET; | ^~~~~~~~~~~ 1 error generated. ``` Closes #19275 --- lib/http.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index 0b55796dc529..b8a4edef6106 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1852,9 +1852,12 @@ void Curl_http_method(struct Curl_easy *data, { Curl_HttpReq httpreq = (Curl_HttpReq)data->state.httpreq; const char *request; +#ifndef CURL_DISABLE_WEBSOCKETS if(data->conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS)) httpreq = HTTPREQ_GET; - else if((data->conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_FTP)) && + else +#endif + if((data->conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_FTP)) && data->state.upload) httpreq = HTTPREQ_PUT; From 25aee8648ab1c8c5db03db0d3494523491511772 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 29 Oct 2025 14:18:11 +0100 Subject: [PATCH 163/885] http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds ``` lib/http.c:2783:23: error: unused variable 'conn' [-Werror,-Wunused-variable] 2783 | struct connectdata *conn = data->conn; | ^~~~ 1 error generated. ``` Closes #19276 --- lib/http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/http.c b/lib/http.c index b8a4edef6106..16d619951fb0 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2780,7 +2780,11 @@ static CURLcode http_add_hd(struct Curl_easy *data, Curl_HttpReq httpreq) { CURLcode result = CURLE_OK; +#if !defined(CURL_DISABLE_ALTSVC) || \ + !defined(CURL_DISABLE_PROXY) || \ + !defined(CURL_DISABLE_WEBSOCKETS) struct connectdata *conn = data->conn; +#endif switch(id) { case H1_HD_REQUEST: /* add the main request stuff */ From e64c28e243d797da4ef76d6e89598f7fc2da8869 Mon Sep 17 00:00:00 2001 From: TheBitBrine Date: Sun, 26 Oct 2025 04:39:02 +0000 Subject: [PATCH 164/885] imap: fix custom FETCH commands to handle literal responses Custom IMAP commands using -X (e.g. 'FETCH 123 BODY[1]') were only returning the first line of responses containing literals, instead of the full multi-line body data. The issue was that custom commands route through imap_perform_list() and imap_state_listsearch_resp(), which didn't detect or handle IMAP literal syntax {size}. This commit adds literal detection to imap_state_listsearch_resp(): - Detects literal syntax {size} in untagged responses - Writes the response header line containing the literal marker - Handles any literal body data already in the pingpong buffer - Sets up transfer layer to read remaining literal data from socket - Configures maxdownload and transfer size to include header + body - Initializes pp->overflow to 0 when no buffered data present - Modifies imap_done() to transition to FETCH_FINAL for custom commands that set up downloads Test 841 and 3206 verify. Fixes #18847 Reported-by: BohwaZ Bug: https://github.com/curl/curl/issues/18847 Closes #19246 --- lib/imap.c | 104 ++++++++++++++++- tests/data/Makefile.am | 2 +- tests/data/test3206 | 248 +++++++++++++++++++++++++++++++++++++++++ tests/data/test841 | 5 + 4 files changed, 352 insertions(+), 7 deletions(-) create mode 100644 tests/data/test3206 diff --git a/lib/imap.c b/lib/imap.c index 8cbda96a050c..1902619a6ffa 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1197,8 +1197,97 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data, (void)instate; - if(imapcode == '*') - result = Curl_client_write(data, CLIENTWRITE_BODY, line, len); + if(imapcode == '*') { + /* Check if this response contains a literal (e.g. FETCH responses with + body data). Literal syntax is {size}\r\n */ + const char *cr = memchr(line, '\r', len); + size_t line_len = cr ? (size_t)(cr - line) : len; + const char *ptr = memchr(line, '{', line_len); + if(ptr) { + curl_off_t size = 0; + bool parsed = FALSE; + ptr++; + if(!curlx_str_number(&ptr, &size, CURL_OFF_T_MAX) && + !curlx_str_single(&ptr, '}')) + parsed = TRUE; + + if(parsed) { + struct pingpong *pp = &imapc->pp; + size_t buffer_len = curlx_dyn_len(&pp->recvbuf); + size_t after_header = buffer_len - pp->nfinal; + + /* This is a literal response, setup to receive the body data */ + infof(data, "Found %" FMT_OFF_T " bytes to download", size); + /* Progress size includes both header line and literal body */ + Curl_pgrsSetDownloadSize(data, size + len); + + /* First write the header line */ + result = Curl_client_write(data, CLIENTWRITE_BODY, line, len); + if(result) + return result; + + /* Handle data already in buffer after the header line */ + if(after_header > 0) { + /* There is already data in the buffer that is part of the literal + body or subsequent responses */ + size_t chunk = after_header; + + /* Keep only the data after the header line */ + curlx_dyn_tail(&pp->recvbuf, chunk); + pp->nfinal = 0; /* done */ + + /* Limit chunk to the literal size */ + if(chunk > (size_t)size) + chunk = (size_t)size; + + if(chunk) { + /* Write the literal body data */ + result = Curl_client_write(data, CLIENTWRITE_BODY, + curlx_dyn_ptr(&pp->recvbuf), chunk); + if(result) + return result; + } + + /* Handle remaining data in buffer (either more literal data or + subsequent responses) */ + if(after_header > chunk) { + /* Keep the data after the literal body */ + pp->overflow = after_header - chunk; + curlx_dyn_tail(&pp->recvbuf, pp->overflow); + } + else { + pp->overflow = 0; + curlx_dyn_reset(&pp->recvbuf); + } + } + else { + /* No data in buffer yet, reset overflow */ + pp->overflow = 0; + } + + if(data->req.bytecount == size + (curl_off_t)len) + /* All data already transferred (header + literal body) */ + Curl_xfer_setup_nop(data); + else { + /* Setup to receive the literal body data. + maxdownload and transfer size include both header line and + literal body */ + data->req.maxdownload = size + len; + Curl_xfer_setup_recv(data, FIRSTSOCKET, size + len); + } + /* End of DO phase */ + imap_state(data, imapc, IMAP_STOP); + } + else { + /* Failed to parse literal, just write the line */ + result = Curl_client_write(data, CLIENTWRITE_BODY, line, len); + } + } + else { + /* No literal, just write the line as-is */ + result = Curl_client_write(data, CLIENTWRITE_BODY, line, len); + } + } else if(imapcode != IMAP_RESP_OK) result = CURLE_QUOTE_ERROR; else @@ -1631,10 +1720,13 @@ static CURLcode imap_done(struct Curl_easy *data, CURLcode status, connclose(conn, "IMAP done with bad status"); /* marked for closure */ result = status; /* use the already set error code */ } - else if(!data->set.connect_only && !imap->custom && - (imap->uid || imap->mindex || data->state.upload || - IS_MIME_POST(data))) { - /* Handle responses after FETCH or APPEND transfer has finished */ + else if(!data->set.connect_only && + ((!imap->custom && (imap->uid || imap->mindex)) || + (imap->custom && data->req.maxdownload > 0) || + data->state.upload || IS_MIME_POST(data))) { + /* Handle responses after FETCH or APPEND transfer has finished. + For custom commands, check if we set up a download which indicates + a FETCH-like command with literal data. */ if(!data->state.upload && !IS_MIME_POST(data)) imap_state(data, imapc, IMAP_FETCH_FINAL); diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 1d7445363d77..22d6eca2356b 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -279,7 +279,7 @@ test3032 test3033 test3034 test3035 \ \ test3100 test3101 test3102 test3103 test3104 test3105 \ \ -test3200 test3201 test3202 test3203 test3204 test3205 test3207 test3208 \ +test3200 test3201 test3202 test3203 test3204 test3205 test3206 test3207 test3208 \ test3209 test3210 test3211 test3212 test3213 test3214 test3215 \ test4000 test4001 diff --git a/tests/data/test3206 b/tests/data/test3206 new file mode 100644 index 000000000000..2bcb82e1525e --- /dev/null +++ b/tests/data/test3206 @@ -0,0 +1,248 @@ + + + +IMAP +Clear Text +FETCH +CUSTOMREQUEST + + + +# +# Server-side + + +Line 001: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 002: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 003: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 004: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 005: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 006: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 007: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 008: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 009: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 010: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 011: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 012: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 013: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 014: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 015: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 016: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 017: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 018: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 019: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 020: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 021: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 022: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 023: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 024: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 025: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 026: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 027: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 028: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 029: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 030: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 031: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 032: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 033: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 034: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 035: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 036: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 037: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 038: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 039: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 040: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 041: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 042: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 043: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 044: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 045: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 046: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 047: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 048: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 049: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 050: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 051: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 052: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 053: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 054: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 055: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 056: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 057: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 058: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 059: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 060: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 061: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 062: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 063: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 064: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 065: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 066: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 067: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 068: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 069: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 070: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 071: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 072: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 073: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 074: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 075: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 076: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 077: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 078: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 079: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 080: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 081: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 082: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 083: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 084: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 085: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 086: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 087: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 088: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 089: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 090: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 091: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 092: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 093: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 094: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 095: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 096: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 097: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 098: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 099: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 100: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX + + + +* 456 FETCH (BODY[TEXT] {7101} +Line 001: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 002: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 003: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 004: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 005: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 006: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 007: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 008: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 009: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 010: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 011: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 012: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 013: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 014: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 015: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 016: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 017: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 018: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 019: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 020: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 021: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 022: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 023: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 024: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 025: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 026: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 027: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 028: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 029: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 030: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 031: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 032: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 033: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 034: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 035: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 036: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 037: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 038: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 039: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 040: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 041: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 042: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 043: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 044: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 045: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 046: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 047: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 048: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 049: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 050: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 051: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 052: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 053: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 054: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 055: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 056: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 057: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 058: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 059: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 060: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 061: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 062: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 063: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 064: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 065: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 066: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 067: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 068: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 069: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 070: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 071: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 072: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 073: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 074: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 075: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 076: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 077: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 078: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 079: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 080: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 081: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 082: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 083: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 084: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 085: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 086: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 087: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 088: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 089: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 090: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 091: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 092: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 093: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 094: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 095: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 096: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 097: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 098: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 099: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX +Line 100: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX + + + + +# +# Client-side + + +imap + + +IMAP custom FETCH with larger literal response (~7KB) + + + imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/ -u user:secret -X 'FETCH 456 BODY[TEXT]' + + + +# +# Verify data after the test has been "shot" + + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 456 BODY[TEXT] +A005 LOGOUT + + + diff --git a/tests/data/test841 b/tests/data/test841 index cc1d075fbc3f..debf6cfb848b 100644 --- a/tests/data/test841 +++ b/tests/data/test841 @@ -20,6 +20,11 @@ body * 123 FETCH (BODY[1] {70} +body + ++ Curl did not used to like this line +-- + yours sincerely From 55d4767876eae8678ab069082aa7fe8fe316a021 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 Oct 2025 08:53:09 +0100 Subject: [PATCH 165/885] tests: use %repeat[] to make tests smaller Avoid putting huge chunks of repeated texts in test cases. test3206, test1060, test1061 and test22 Closes #19279 --- tests/data/test1060 | 805 +------------------------------------------- tests/data/test1061 | 803 +------------------------------------------ tests/data/test22 | 4 +- tests/data/test3206 | 206 +----------- 4 files changed, 10 insertions(+), 1808 deletions(-) diff --git a/tests/data/test1060 b/tests/data/test1060 index 50ce55a87f11..b64e202e81b2 100644 --- a/tests/data/test1060 +++ b/tests/data/test1060 @@ -17,809 +17,10 @@ HTTP proxy Digest auth HTTP/1.1 407 Authorization Required to proxy me my dear Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 40000 +Content-Length: 35701 X-tra-long-header: %repeat[16080 x a]% -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +%repeat[700 x And you should ignore this data. aaaaaaaaaaaaaaaa %0a]% # this is returned when we get a GET! @@ -844,7 +45,7 @@ Server: no HTTP/1.1 407 Authorization Required to proxy me my dear Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 40000 +Content-Length: 35701 X-tra-long-header: %repeat[16080 x a]% HTTP/1.1 200 OK diff --git a/tests/data/test1061 b/tests/data/test1061 index 9e2402a58494..1ec22f942639 100644 --- a/tests/data/test1061 +++ b/tests/data/test1061 @@ -21,807 +21,8 @@ Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" Transfer-Encoding: chunked X-tra-long-header: %repeat[16080 x a]% -9c40 -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -And you should ignore this data. aaaaaaaaaaaaaaaa -end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +9c41 +%repeat[800 x And you should ignore this data. aaaaaaaaaaaaaaa %0a]% 0 diff --git a/tests/data/test22 b/tests/data/test22 index b594a9cf74c2..900778279343 100644 --- a/tests/data/test22 +++ b/tests/data/test22 @@ -25,14 +25,14 @@ http get HTTP with URL > 10000 bytes -%HOSTIP:%HTTPPORT/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/%TESTNUMBER +%HOSTIP:%HTTPPORT/%repeat[11000 x a]%/%TESTNUMBER # Verify data after the test has been "shot" -GET /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/%TESTNUMBER HTTP/1.1 +GET /%repeat[11000 x a]%/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test3206 b/tests/data/test3206 index 2bcb82e1525e..d47494a86686 100644 --- a/tests/data/test3206 +++ b/tests/data/test3206 @@ -12,211 +12,11 @@ CUSTOMREQUEST # Server-side -Line 001: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 002: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 003: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 004: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 005: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 006: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 007: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 008: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 009: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 010: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 011: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 012: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 013: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 014: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 015: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 016: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 017: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 018: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 019: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 020: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 021: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 022: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 023: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 024: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 025: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 026: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 027: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 028: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 029: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 030: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 031: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 032: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 033: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 034: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 035: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 036: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 037: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 038: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 039: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 040: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 041: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 042: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 043: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 044: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 045: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 046: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 047: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 048: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 049: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 050: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 051: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 052: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 053: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 054: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 055: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 056: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 057: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 058: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 059: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 060: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 061: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 062: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 063: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 064: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 065: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 066: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 067: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 068: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 069: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 070: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 071: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 072: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 073: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 074: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 075: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 076: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 077: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 078: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 079: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 080: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 081: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 082: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 083: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 084: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 085: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 086: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 087: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 088: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 089: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 090: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 091: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 092: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 093: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 094: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 095: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 096: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 097: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 098: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 099: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 100: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX - +%repeat[120 x Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX%0d]% -* 456 FETCH (BODY[TEXT] {7101} -Line 001: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 002: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 003: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 004: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 005: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 006: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 007: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 008: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 009: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 010: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 011: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 012: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 013: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 014: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 015: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 016: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 017: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 018: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 019: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 020: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 021: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 022: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 023: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 024: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 025: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 026: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 027: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 028: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 029: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 030: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 031: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 032: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 033: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 034: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 035: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 036: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 037: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 038: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 039: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 040: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 041: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 042: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 043: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 044: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 045: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 046: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 047: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 048: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 049: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 050: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 051: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 052: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 053: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 054: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 055: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 056: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 057: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 058: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 059: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 060: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 061: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 062: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 063: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 064: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 065: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 066: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 067: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 068: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 069: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 070: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 071: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 072: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 073: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 074: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 075: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 076: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 077: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 078: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 079: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 080: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 081: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 082: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 083: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 084: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 085: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 086: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 087: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 088: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 089: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 090: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 091: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 092: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 093: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 094: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 095: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 096: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 097: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 098: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 099: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX -Line 100: Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX - +* 456 FETCH (BODY[TEXT] {7201} +%repeat[120 x Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX%0d]% From c1f1b66d78f27ab17f073c1ce3af595975b6e662 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 Oct 2025 08:44:51 +0100 Subject: [PATCH 166/885] pop3: check for CAPA responses case insensitively Reported by ZeroPath Closes #19278 --- lib/pop3.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/pop3.c b/lib/pop3.c index c6b6ed659c9d..affd64276cd8 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -878,15 +878,15 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code, /* Do we have an untagged continuation response? */ if(pop3code == '*') { /* Does the server support the STLS capability? */ - if(len >= 4 && !memcmp(line, "STLS", 4)) + if(len >= 4 && curl_strnequal(line, "STLS", 4)) pop3c->tls_supported = TRUE; /* Does the server support clear text authentication? */ - else if(len >= 4 && !memcmp(line, "USER", 4)) + else if(len >= 4 && curl_strnequal(line, "USER", 4)) pop3c->authtypes |= POP3_TYPE_CLEARTEXT; /* Does the server support SASL based authentication? */ - else if(len >= 5 && !memcmp(line, "SASL ", 5)) { + else if(len >= 5 && curl_strnequal(line, "SASL ", 5)) { pop3c->authtypes |= POP3_TYPE_SASL; /* Advance past the SASL keyword */ @@ -896,13 +896,10 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code, /* Loop through the data line */ for(;;) { size_t llen; - size_t wordlen; + size_t wordlen = 0; unsigned short mechbit; - while(len && - (*line == ' ' || *line == '\t' || - *line == '\r' || *line == '\n')) { - + while(len && (ISBLANK(*line) || ISNEWLINE(*line))) { line++; len--; } @@ -911,9 +908,8 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code, break; /* Extract the word */ - for(wordlen = 0; wordlen < len && line[wordlen] != ' ' && - line[wordlen] != '\t' && line[wordlen] != '\r' && - line[wordlen] != '\n';) + while(wordlen < len && !ISBLANK(line[wordlen]) && + !ISNEWLINE(line[wordlen])) wordlen++; /* Test the word for a matching authentication mechanism */ From fbc4d59151dc4a56052f3a92da3682dc97b32148 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 28 Oct 2025 23:35:45 +0800 Subject: [PATCH 167/885] conncache: prevent integer overflow in maxconnects calculation Closes #19271 --- lib/conncache.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/conncache.c b/lib/conncache.c index 67e2a63d8a57..5c4bc357cc7a 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -531,12 +531,19 @@ static bool cpool_foreach(struct Curl_easy *data, bool Curl_cpool_conn_now_idle(struct Curl_easy *data, struct connectdata *conn) { - unsigned int maxconnects = !data->multi->maxconnects ? - (Curl_multi_xfers_running(data->multi) * 4) : data->multi->maxconnects; + unsigned int maxconnects; struct connectdata *oldest_idle = NULL; struct cpool *cpool = cpool_get_instance(data); bool kept = TRUE; + if(!data->multi->maxconnects) { + unsigned int running = Curl_multi_xfers_running(data->multi); + maxconnects = (running <= UINT_MAX / 4) ? running * 4 : UINT_MAX; + } + else { + maxconnects = data->multi->maxconnects; + } + conn->lastused = curlx_now(); /* it was used up until now */ if(cpool && maxconnects) { /* may be called form a callback already under lock */ From 80258309b26546e27837432b0121f4e65e74b030 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 Oct 2025 14:42:03 +0100 Subject: [PATCH 168/885] lib: reduce memcpy calls socks_gssapi: the malloc + memcpy was superflous and can be skipped cleartext: avoid malloc + three memcpy with aprintf() digest_sspi: use memdup0 instead of malloc + memcpy vtls: use memdup0 instead of malloc + memcpy Closes #19282 --- lib/socks_gssapi.c | 16 +++------------- lib/vauth/cleartext.c | 39 ++++++++++++++------------------------- lib/vauth/digest_sspi.c | 13 ++----------- lib/vtls/vtls.c | 5 ++--- 4 files changed, 21 insertions(+), 52 deletions(-) diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 34380ae9a045..929132f570a3 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -126,7 +126,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, gss_name_t server = GSS_C_NO_NAME; gss_name_t gss_client_name = GSS_C_NO_NAME; unsigned short us_length; - char *user = NULL; unsigned char socksreq[4]; /* room for GSS-API exchange header only */ const char *serviceptr = data->set.str[STRING_PROXY_SERVICE_NAME] ? data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd"; @@ -327,21 +326,12 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "Failed to determine username."); return CURLE_COULDNT_CONNECT; } - user = malloc(gss_send_token.length + 1); - if(!user) { - Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); - gss_release_name(&gss_status, &gss_client_name); - gss_release_buffer(&gss_status, &gss_send_token); - return CURLE_OUT_OF_MEMORY; - } - memcpy(user, gss_send_token.value, gss_send_token.length); - user[gss_send_token.length] = '\0'; + infof(data, "SOCKS5 server authenticated user %.*s with GSS-API.", + (int)gss_send_token.length, (char *)gss_send_token.value); + gss_release_name(&gss_status, &gss_client_name); gss_release_buffer(&gss_status, &gss_send_token); - infof(data, "SOCKS5 server authenticated user %s with GSS-API.",user); - free(user); - user = NULL; /* Do encryption */ socksreq[0] = 1; /* GSS-API subnegotiation version */ diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index dcfb13912d27..884ebce0f268 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -62,35 +62,24 @@ CURLcode Curl_auth_create_plain_message(const char *authzid, const char *passwd, struct bufref *out) { - char *plainauth; - size_t plainlen; - size_t zlen; - size_t clen; - size_t plen; + size_t len; + char *auth; - zlen = (authzid == NULL ? 0 : strlen(authzid)); - clen = strlen(authcid); - plen = strlen(passwd); + size_t zlen = (authzid == NULL ? 0 : strlen(authzid)); + size_t clen = strlen(authcid); + size_t plen = strlen(passwd); - /* Compute binary message length. Check for overflows. */ - if((zlen > SIZE_MAX/4) || (clen > SIZE_MAX/4) || - (plen > (SIZE_MAX/2 - 2))) - return CURLE_OUT_OF_MEMORY; - plainlen = zlen + clen + plen + 2; + if((zlen > CURL_MAX_INPUT_LENGTH) || (clen > CURL_MAX_INPUT_LENGTH) || + (plen > CURL_MAX_INPUT_LENGTH)) + return CURLE_TOO_LARGE; - plainauth = malloc(plainlen + 1); - if(!plainauth) - return CURLE_OUT_OF_MEMORY; + len = zlen + clen + plen + 2; - /* Calculate the reply */ - if(zlen) - memcpy(plainauth, authzid, zlen); - plainauth[zlen] = '\0'; - memcpy(plainauth + zlen + 1, authcid, clen); - plainauth[zlen + clen + 1] = '\0'; - memcpy(plainauth + zlen + clen + 2, passwd, plen); - plainauth[plainlen] = '\0'; - Curl_bufref_set(out, plainauth, plainlen, curl_free); + auth = curl_maprintf("%s%c%s%c%s", authzid ? authzid : "", '\0', + authcid, '\0', passwd); + if(!auth) + return CURLE_OUT_OF_MEMORY; + Curl_bufref_set(out, auth, len, curl_free); return CURLE_OK; } diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index 5bf37705653a..9441ee26fcca 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -629,24 +629,15 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, Curl_sspi_free_identity(p_identity); } - resp = malloc(output_token_len + 1); + resp = Curl_memdup0((const char *)output_token, output_token_len); + free(output_token); if(!resp) { - free(output_token); - return CURLE_OUT_OF_MEMORY; } - /* Copy the generated response */ - memcpy(resp, output_token, output_token_len); - resp[output_token_len] = 0; - /* Return the response */ *outptr = resp; *outlen = output_token_len; - - /* Free the response buffer */ - free(output_token); - return CURLE_OK; } diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 3cd60e91b9aa..22d820b1602e 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -75,6 +75,7 @@ #include "../select.h" #include "../setopt.h" #include "../rand.h" +#include "../strdup.h" #ifdef USE_APPLE_SECTRUST #include @@ -2060,11 +2061,9 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, result = CURLE_SSL_CONNECT_ERROR; goto out; } - connssl->negotiated.alpn = malloc(proto_len + 1); + connssl->negotiated.alpn = Curl_memdup0((const char *)proto, proto_len); if(!connssl->negotiated.alpn) return CURLE_OUT_OF_MEMORY; - memcpy(connssl->negotiated.alpn, proto, proto_len); - connssl->negotiated.alpn[proto_len] = 0; } if(proto && proto_len) { From c5de083bcc92e8edecbb4214b0ca5107496a80f6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 Oct 2025 11:32:15 +0100 Subject: [PATCH 169/885] base64: make base64_encode() error on too long input The maximum size is set to 16MB. It should not possible to call this function with this large input, but this is a precaution to catch mistakes and replaces the earlier check on architectures with small size_t. Closes #19280 --- lib/curlx/base64.c | 8 ++++---- lib/curlx/base64.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/curlx/base64.c b/lib/curlx/base64.c index 5f6887bd5c4c..ef07243dd3c5 100644 --- a/lib/curlx/base64.c +++ b/lib/curlx/base64.c @@ -184,10 +184,10 @@ static CURLcode base64_encode(const char *table64, if(!insize) return CURLE_OK; -#if SIZEOF_SIZE_T == 4 - if(insize > UINT_MAX/4) - return CURLE_OUT_OF_MEMORY; -#endif + /* safety precaution */ + DEBUGASSERT(insize <= CURL_MAX_BASE64_INPUT); + if(insize > CURL_MAX_BASE64_INPUT) + return CURLE_TOO_LARGE; base64data = output = malloc((insize + 2) / 3 * 4 + 1); if(!output) diff --git a/lib/curlx/base64.h b/lib/curlx/base64.h index 026f80e4d37f..31cfcb36e767 100644 --- a/lib/curlx/base64.h +++ b/lib/curlx/base64.h @@ -33,4 +33,8 @@ CURLcode curlx_base64_decode(const char *src, extern const char Curl_base64encdec[]; +/* maximum input length acceptable to base64 encode, here to catch and prevent + mistakes */ +#define CURL_MAX_BASE64_INPUT 16000000 + #endif /* HEADER_CURL_BASE64_H */ From a83eae4d53911aa7fb9396a76b027165f9e63f61 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:41:48 +0000 Subject: [PATCH 170/885] GHA: update libressl/portable to v4.2.1 Closes #19283 --- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index c532a35c15f1..ff24d0fa4b68 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -41,7 +41,7 @@ env: # handled in renovate.json OPENSSL_VERSION: 3.6.0 # renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com - LIBRESSL_VERSION: 4.2.0 + LIBRESSL_VERSION: 4.2.1 # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com AWSLC_VERSION: 1.61.4 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e28354c257e8..6eeb6b697e98 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -38,7 +38,7 @@ env: CURL_CI: github CURL_CLANG_TIDYFLAGS: '-checks=-clang-analyzer-security.insecureAPI.bzero,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.ArrayBound,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-valist.Uninitialized' # renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com - LIBRESSL_VERSION: 4.2.0 + LIBRESSL_VERSION: 4.2.1 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.2 # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1e9f2408a8ba..00d8fabcbb05 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -59,7 +59,7 @@ jobs: MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }} MATRIX_OPTIONS: ${{ matrix.build.options }} # renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com - LIBRESSL_VERSION: 4.2.0 + LIBRESSL_VERSION: 4.2.1 strategy: fail-fast: false matrix: From eb22e37060a8f3ad4fd9511db136c1edbb3b2a85 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 30 Oct 2025 12:57:06 +0100 Subject: [PATCH 171/885] tests: use %repeat[] to make tests smaller (cont.) tests: 46, 265, 304, 316, 397, 443, 551, 552, 559, 651, 742, 775, 1003, 1005, 1006, 1008, 1062, 1070, 1086, 1112, 1151, 1160, 1178, 1192, 1193, 1205, 1237, 3207. Total `test*` size reduction: 2,395,537 -> 2,165,631 bytes. Follow-up to 55d4767876eae8678ab069082aa7fe8fe316a021 #19279 Closes #19281 --- tests/data/test1003 | 2 +- tests/data/test1005 | 2 +- tests/data/test1006 | 2 +- tests/data/test1008 | 2 +- tests/data/test1062 | 2 +- tests/data/test1070 | 2 +- tests/data/test1086 | 51 +---------------- tests/data/test1112 | 51 +---------------- tests/data/test1151 | 12 ++-- tests/data/test1160 | 2 +- tests/data/test1178 | 2 +- tests/data/test1192 | 6 +- tests/data/test1193 | 21 +------ tests/data/test1205 | 2 +- tests/data/test1237 | 2 +- tests/data/test265 | 2 +- tests/data/test304 | 4 +- tests/data/test316 | 131 +------------------------------------------- tests/data/test3207 | 131 +------------------------------------------- tests/data/test397 | 131 +------------------------------------------- tests/data/test443 | 42 +++++++------- tests/data/test46 | 4 +- tests/data/test551 | 6 +- tests/data/test552 | 4 +- tests/data/test559 | 4 +- tests/data/test651 | 2 +- tests/data/test742 | 8 +-- tests/data/test775 | 2 +- 28 files changed, 67 insertions(+), 565 deletions(-) diff --git a/tests/data/test1003 b/tests/data/test1003 index 06cfbb61b0ac..c4a1bb001af7 100644 --- a/tests/data/test1003 +++ b/tests/data/test1003 @@ -14,7 +14,7 @@ mooo # a ~17000 bytes response string to CWD to make sure the ftp parser deals # with it nicely -REPLY CWD 250 CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB +REPLY CWD 250 C%repeat[16998 x A]%B diff --git a/tests/data/test1005 b/tests/data/test1005 index 28af85f40e1e..1827fbdc8cad 100644 --- a/tests/data/test1005 +++ b/tests/data/test1005 @@ -14,7 +14,7 @@ mooo # a long set of response strings to CWD to make sure the ftp parser deals # with it nicely -REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250 Finally, here is the response +REPLY CWD %repeat[226 x 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n]%250 Finally, here is the response diff --git a/tests/data/test1006 b/tests/data/test1006 index b3d093672428..13d426d05395 100644 --- a/tests/data/test1006 +++ b/tests/data/test1006 @@ -15,7 +15,7 @@ mooo # with it nicely. The length hits a boundary condition that may make curl # hang. -REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250 Finally, here is the response +REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAA\r\n%repeat[218 x 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n]%250 Finally, here is the response diff --git a/tests/data/test1008 b/tests/data/test1008 index fee52702fbab..4535d65076b3 100644 --- a/tests/data/test1008 +++ b/tests/data/test1008 @@ -26,7 +26,7 @@ Transfer-Encoding: chunked 20 And you should ignore this data. FA0 -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +%repeat[4000 x X]% 0 diff --git a/tests/data/test1062 b/tests/data/test1062 index 31a27a9473b0..c6033457015f 100644 --- a/tests/data/test1062 +++ b/tests/data/test1062 @@ -15,7 +15,7 @@ mooo # a long set of response strings to CWD to make sure the ftp parser deals # with it nicely -REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-A Exactly fill curl's buffer\r\n250 Finally, here is the response, boundary condition +REPLY CWD %repeat[218 x 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n]%250-A Exactly fill curl's buffer\r\n250 Finally, here is the response, boundary condition diff --git a/tests/data/test1070 b/tests/data/test1070 index 18c2df3adcd2..a2665039bb2c 100644 --- a/tests/data/test1070 +++ b/tests/data/test1070 @@ -41,7 +41,7 @@ rather large (larger than your typical TCP packet) so that not all of it can nor will be sent in one go as that is kind of the point of this test! Here's 2000 x 'O': -OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO +%repeat[2000 x O]% diff --git a/tests/data/test1086 b/tests/data/test1086 index ae5e7a093ee7..8b7828fb2f91 100644 --- a/tests/data/test1086 +++ b/tests/data/test1086 @@ -23,56 +23,7 @@ REPLY PWD 257 "/" REPLY TYPE 200 OK -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. +%repeat[50 x Long chunk of data that couldn't possibly be sent in the time allotted.%0a]% diff --git a/tests/data/test1112 b/tests/data/test1112 index 0790d0352ba6..2ef60a9eb7d2 100644 --- a/tests/data/test1112 +++ b/tests/data/test1112 @@ -23,56 +23,7 @@ REPLY PWD 257 "/" REPLY TYPE 200 OK -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. -Long chunk of data that couldn't possibly be sent in the time allotted. +%repeat[50 x Long chunk of data that couldn't possibly be sent in the time allotted.%0a]% diff --git a/tests/data/test1151 b/tests/data/test1151 index 2da611ebfa26..dd916a61334d 100644 --- a/tests/data/test1151 +++ b/tests/data/test1151 @@ -22,10 +22,10 @@ Server: test-server/fake Content-Type: text/html Funny-head: yesyes swsclose Set-Cookie: foobar=name; domain=127.0.0.1; path=/; -Set-Cookie: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB; domain=127.0.0.1; path=/; -Set-Cookie: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC=BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB; domain=127.0.0.1; path=/; -Set-Cookie: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD=E; domain=127.0.0.1; path=/; -Set-Cookie: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF=E; domain=127.0.0.1; path=/; +Set-Cookie: %repeat[3000 x A]%=%repeat[1096 x B]%; domain=127.0.0.1; path=/; +Set-Cookie: %repeat[3000 x C]%=%repeat[1097 x B]%; domain=127.0.0.1; path=/; +Set-Cookie: %repeat[4096 x D]%=E; domain=127.0.0.1; path=/; +Set-Cookie: %repeat[4094 x F]%=E; domain=127.0.0.1; path=/; @@ -60,8 +60,8 @@ Accept: */* # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -127.0.0.1 FALSE / FALSE 0 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF E -127.0.0.1 FALSE / FALSE 0 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +127.0.0.1 FALSE / FALSE 0 %repeat[4094 x F]% E +127.0.0.1 FALSE / FALSE 0 %repeat[3000 x A]% %repeat[1096 x B]% 127.0.0.1 FALSE / FALSE 0 foobar name diff --git a/tests/data/test1160 b/tests/data/test1160 index c24decedca7d..d503945fe355 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -15,7 +15,7 @@ cookies HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 -Set-Cookie: ____________%hex[%ff]hex%= ; %hex[%ff]hex% zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz%hex[%86%85%85%80]hex%zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz%hex[%fa]hex%zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz%hex[%f3%a0%81%96]hex%zzzzzzzzzzzz~zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz%hex[%b6]hex%zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +Set-Cookie: ____________%hex[%ff]hex%= ;%repeat[117 x %20]%%hex[%ff]hex%%repeat[2602 x %20]%%repeat[434 x z]%%hex[%86%85%85%80]hex%%repeat[49 x z]%%hex[%fa]hex%%repeat[540 x z]%%hex[%f3%a0%81%96]hex%zzzzzzzzzzzz~%repeat[82 x z]%%hex[%b6]hex%%repeat[364 x z]% diff --git a/tests/data/test1178 b/tests/data/test1178 index ac42ee52de42..52eea37fec1f 100644 --- a/tests/data/test1178 +++ b/tests/data/test1178 @@ -30,7 +30,7 @@ HTTP proxy auth with credentials longer than 256 bytes # 400 x 'A' : 600 x 'B' ... -http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER -x http://%HOSTIP:%HTTPPORT -U AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER -x http://%HOSTIP:%HTTPPORT -U %repeat[400 x A]%:%repeat[600 x B]% proxy diff --git a/tests/data/test1192 b/tests/data/test1192 index 47036ab83ea5..c1b1fd790037 100644 --- a/tests/data/test1192 +++ b/tests/data/test1192 @@ -30,7 +30,7 @@ mqtt MQTT SUBSCRIBE 2k topic -mqtt://%HOSTIP:%MQTTPORT/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/%TESTNUMBER +mqtt://%HOSTIP:%MQTTPORT/%repeat[2048 x A]%/%TESTNUMBER @@ -47,9 +47,9 @@ s/^(.* 00044d5154540402003c000c6375726c).*/$1/ client CONNECT 18 00044d5154540402003c000c6375726c server CONNACK 2 20020000 -client SUBSCRIBE 80a 0001080541414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141412f3131393200 +client SUBSCRIBE 80a 000108054%repeat[2047 x 14]%12f3131393200 server SUBACK 3 9003000100 -server PUBLISH 80d 308d10080541414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141412f3131393268656c6c6f0a +server PUBLISH 80d 308d1008054%repeat[2047 x 14]%12f3131393268656c6c6f0a server DISCONNECT 0 e000 diff --git a/tests/data/test1193 b/tests/data/test1193 index 531efa2597b7..5e6b1c82e76d 100644 --- a/tests/data/test1193 +++ b/tests/data/test1193 @@ -29,26 +29,7 @@ MQTT PUBLISH 2k payload mqtt://%HOSTIP:%MQTTPORT/%TESTNUMBER -d @%LOGDIR/payload%TESTNUMBER -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +%repeat[20 x 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789%0a]% diff --git a/tests/data/test1205 b/tests/data/test1205 index 5a7fb7dc51fa..547ef0d1d142 100644 --- a/tests/data/test1205 +++ b/tests/data/test1205 @@ -14,7 +14,7 @@ HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 6 Connection: close -Funny-head: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAendofthem +Funny-head: %repeat[18000 x A]%endofthem -foo- diff --git a/tests/data/test1237 b/tests/data/test1237 index 9fc2377df7fe..e81d872aa992 100644 --- a/tests/data/test1237 +++ b/tests/data/test1237 @@ -27,7 +27,7 @@ http URL with 1000+ letter user name + password -"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB@%HOSTIP:%HTTPPORT/%TESTNUMBER" +"%repeat[1000 x A]%:%repeat[1002 x B]%@%HOSTIP:%HTTPPORT/%TESTNUMBER" diff --git a/tests/data/test265 b/tests/data/test265 index fd0a09717f92..6b407b24dd35 100644 --- a/tests/data/test265 +++ b/tests/data/test265 @@ -21,7 +21,7 @@ Connection: Keep-Alive Content-Length: 1033 And you should ignore this data. -QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ +%repeat[999 x Q]% # This is supposed to be returned when the server gets the second diff --git a/tests/data/test304 b/tests/data/test304 index 2283192e2232..b7f7588c25c9 100644 --- a/tests/data/test304 +++ b/tests/data/test304 @@ -35,7 +35,7 @@ HTTPS multipart formpost # We create this file before the command is invoked! -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +%repeat[1000 x a]% @@ -64,7 +64,7 @@ curl Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" Content-Type: text/plain -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +%repeat[1000 x a]% ------------------------------qrstuvwxyz0123456789AB-- diff --git a/tests/data/test316 b/tests/data/test316 index 0ac38bde3642..3036c836b1e0 100644 --- a/tests/data/test316 +++ b/tests/data/test316 @@ -23,7 +23,7 @@ Content-Length: 31 %hex[%1b%7f%40%00%64%f1%98%cf%28%1a%eb%af%c7%12%ac%41%ab%42%62%51%f3%c8%ea%d9%7b%9f%dc%1b%00%48%00%0a]hex% - + HTTP/1.1 200 OK Date: Mon, 29 Nov 2004 21:56:53 GMT Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 @@ -32,134 +32,7 @@ Content-Type: text/html; charset=ISO-8859-1 Content-Encoding: br Content-Length: 31 -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF +%repeat[128 x 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF%0a]% diff --git a/tests/data/test3207 b/tests/data/test3207 index 7902d0ae298f..4806ef5474d6 100644 --- a/tests/data/test3207 +++ b/tests/data/test3207 @@ -16,135 +16,8 @@ Content-Length: 29 run 1: foobar and so on fun! - -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! -run 1: foobar and so on fun! + +%repeat[128 x run 1: foobar and so on fun!%0a]% diff --git a/tests/data/test397 b/tests/data/test397 index 7528cd35595b..f05fe21970b7 100644 --- a/tests/data/test397 +++ b/tests/data/test397 @@ -24,7 +24,7 @@ Content-Length: 47 %hex[%04%00%7c%9f%60%78%00%04%1a%1d%d2%ab%4d%3a%97%82%af%b9%9c]hex% - + HTTP/1.1 200 OK Date: Mon, 29 Nov 2004 21:56:53 GMT Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 @@ -33,134 +33,7 @@ Content-Type: text/html; charset=ISO-8859-1 Content-Encoding: zstd Content-Length: 47 -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF -0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF +%repeat[128 x 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF%0a]% diff --git a/tests/data/test443 b/tests/data/test443 index 975d8fdaee71..cbc8685ac2b0 100644 --- a/tests/data/test443 +++ b/tests/data/test443 @@ -41,26 +41,26 @@ Cookie header in request no longer than 8K http://attack.invalid:%HTTPPORT/a/b/%TESTNUMBER -b %LOGDIR/cookie%TESTNUMBER --resolve attack.invalid:%HTTPPORT:%HOSTIP -L -attack.invalid TRUE / FALSE 0 huge-1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-1 -attack.invalid TRUE / FALSE 0 huge-2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-2 -attack.invalid TRUE / FALSE 0 huge-3 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-3 -attack.invalid TRUE / FALSE 0 huge-4 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-4 -attack.invalid TRUE / FALSE 0 huge-5 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-5 -attack.invalid TRUE / FALSE 0 huge-6 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-6 -attack.invalid TRUE / FALSE 0 huge-7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-7 -attack.invalid TRUE / FALSE 0 huge-8 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-8 -attack.invalid TRUE / FALSE 0 huge-9 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-9 -attack.invalid TRUE / FALSE 0 huge-10 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-10 -attack.invalid TRUE / FALSE 0 huge-11 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-11 -attack.invalid TRUE / FALSE 0 huge-12 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-12 -attack.invalid TRUE / FALSE 0 huge-13 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-13 -attack.invalid TRUE / FALSE 0 huge-14 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-14 -attack.invalid TRUE / FALSE 0 huge-15 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-15 -attack.invalid TRUE / FALSE 0 huge-16 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-16 -attack.invalid TRUE / FALSE 0 huge-17 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-17 -attack.invalid TRUE / FALSE 0 huge-18 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-18 -attack.invalid TRUE / FALSE 0 huge-19 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-19 -attack.invalid TRUE / FALSE 0 huge-20 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-20 +attack.invalid TRUE / FALSE 0 huge-1 %repeat[500 x a]%-1 +attack.invalid TRUE / FALSE 0 huge-2 %repeat[500 x a]%-2 +attack.invalid TRUE / FALSE 0 huge-3 %repeat[500 x a]%-3 +attack.invalid TRUE / FALSE 0 huge-4 %repeat[500 x a]%-4 +attack.invalid TRUE / FALSE 0 huge-5 %repeat[500 x a]%-5 +attack.invalid TRUE / FALSE 0 huge-6 %repeat[500 x a]%-6 +attack.invalid TRUE / FALSE 0 huge-7 %repeat[500 x a]%-7 +attack.invalid TRUE / FALSE 0 huge-8 %repeat[500 x a]%-8 +attack.invalid TRUE / FALSE 0 huge-9 %repeat[500 x a]%-9 +attack.invalid TRUE / FALSE 0 huge-10 %repeat[500 x a]%-10 +attack.invalid TRUE / FALSE 0 huge-11 %repeat[500 x a]%-11 +attack.invalid TRUE / FALSE 0 huge-12 %repeat[500 x a]%-12 +attack.invalid TRUE / FALSE 0 huge-13 %repeat[500 x a]%-13 +attack.invalid TRUE / FALSE 0 huge-14 %repeat[500 x a]%-14 +attack.invalid TRUE / FALSE 0 huge-15 %repeat[500 x a]%-15 +attack.invalid TRUE / FALSE 0 huge-16 %repeat[500 x a]%-16 +attack.invalid TRUE / FALSE 0 huge-17 %repeat[500 x a]%-17 +attack.invalid TRUE / FALSE 0 huge-18 %repeat[500 x a]%-18 +attack.invalid TRUE / FALSE 0 huge-19 %repeat[500 x a]%-19 +attack.invalid TRUE / FALSE 0 huge-20 %repeat[500 x a]%-20 cookies @@ -75,7 +75,7 @@ GET /a/b/%TESTNUMBER HTTP/1.1 Host: attack.invalid:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -Cookie: huge-20=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-20; huge-19=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-19; huge-18=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-18; huge-17=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-17; huge-16=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-16; huge-15=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-15; huge-14=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-14; huge-13=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-13; huge-12=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-12; huge-11=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-11; huge-10=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-10; huge-9=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-9; huge-8=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-8; huge-7=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-7; huge-6=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-6 +Cookie: huge-20=%repeat[500 x a]%-20; huge-19=%repeat[500 x a]%-19; huge-18=%repeat[500 x a]%-18; huge-17=%repeat[500 x a]%-17; huge-16=%repeat[500 x a]%-16; huge-15=%repeat[500 x a]%-15; huge-14=%repeat[500 x a]%-14; huge-13=%repeat[500 x a]%-13; huge-12=%repeat[500 x a]%-12; huge-11=%repeat[500 x a]%-11; huge-10=%repeat[500 x a]%-10; huge-9=%repeat[500 x a]%-9; huge-8=%repeat[500 x a]%-8; huge-7=%repeat[500 x a]%-7; huge-6=%repeat[500 x a]%-6 diff --git a/tests/data/test46 b/tests/data/test46 index 0a0e84914ff3..cb4bc518dcc7 100644 --- a/tests/data/test46 +++ b/tests/data/test46 @@ -24,7 +24,7 @@ Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2037 11:56:27 GMT; path Set-Cookie: ckySession=temporary; path=/ Set-Cookie: ASPSESSIONIDQGGQQSJJ=GKNBDIFAAOFDPDAIEAKDIBKE; path=/ Set-Cookie: justaname=; path=/; -Set-Cookie: simplyhuge=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +Set-Cookie: simplyhuge=%repeat[3998 x z]% Cache-control: private Content-Length: 41 @@ -87,7 +87,7 @@ Cookie: empty=; mooo2=indeed2; mooo=indeed # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -domain..tld FALSE /want/ FALSE 0 simplyhuge zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +domain..tld FALSE /want/ FALSE 0 simplyhuge %repeat[3998 x z]% domain..tld FALSE / FALSE 0 justaname domain..tld FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ GKNBDIFAAOFDPDAIEAKDIBKE domain..tld FALSE / FALSE 0 ckySession temporary diff --git a/tests/data/test551 b/tests/data/test551 index c7a560e812a0..74ed90754540 100644 --- a/tests/data/test551 +++ b/tests/data/test551 @@ -17,7 +17,7 @@ HTTP proxy Digest auth HTTP/1.1 407 Authorization Required swsclose Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Digest realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" Content-Type: text/html; charset=iso-8859-1 Connection: close @@ -38,7 +38,7 @@ Contents of that page you requested, sir. HTTP/1.1 407 Authorization Required swsclose Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Digest realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" Content-Type: text/html; charset=iso-8859-1 Connection: close @@ -87,7 +87,7 @@ Content-Type: application/x-www-form-urlencoded this is the blurb we want to upload POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 Host: test.remote.example.com -Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", uri="/path/%TESTNUMBER", response="3325240726fbdaf1e61f3a0dd40b930c" +Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="%repeat[400 x A]%", uri="/path/%TESTNUMBER", response="3325240726fbdaf1e61f3a0dd40b930c" Accept: */* Proxy-Connection: Keep-Alive Content-Length: 36 diff --git a/tests/data/test552 b/tests/data/test552 index b38a6b5e295b..114fe5e0dcc9 100644 --- a/tests/data/test552 +++ b/tests/data/test552 @@ -19,7 +19,7 @@ HTTP proxy Digest auth HTTP/1.1 407 Authorization Required swsclose Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Digest realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" Content-Type: text/html; charset=iso-8859-1 Connection: close @@ -79,7 +79,7 @@ Content-Type: application/x-www-form-urlencoded %repeat[7000 x test data%00]%POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 Host: test.remote.example.com -Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", uri="/path/%TESTNUMBER", response="be7aedc47d821b6d847c445ded782c43" +Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="%repeat[400 x A]%", uri="/path/%TESTNUMBER", response="be7aedc47d821b6d847c445ded782c43" Accept: */* Proxy-Connection: Keep-Alive Content-Length: 70000 diff --git a/tests/data/test559 b/tests/data/test559 index 982209ce9df4..1cd494fac877 100644 --- a/tests/data/test559 +++ b/tests/data/test559 @@ -19,9 +19,9 @@ Accept-Ranges: bytes Content-Length: 2049 Connection: close Content-Type: text/html -Silly-header: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ +Silly-header: %repeat[511 x Z]% -ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ +%repeat[2048 x Z]% diff --git a/tests/data/test651 b/tests/data/test651 index 48e42df6174d..cf19bfc34a27 100644 --- a/tests/data/test651 +++ b/tests/data/test651 @@ -68,7 +68,7 @@ Content-Type: multipart/form-data; boundary=---------------------------- ------------------------------ Content-Disposition: form-data; name="hello" -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ +%repeat[1000 x A]%%repeat[1000 x B]%%repeat[1000 x C]%%repeat[1000 x D]%%repeat[1000 x E]%%repeat[1000 x F]%%repeat[1000 x G]%%repeat[1000 x H]%%repeat[1000 x I]%%repeat[1000 x J]%%repeat[1000 x K]%%repeat[1000 x L]%%repeat[1000 x M]%%repeat[1000 x N]%%repeat[1000 x O]%%repeat[1000 x P]%%repeat[999 x Q]% -------------------------------- diff --git a/tests/data/test742 b/tests/data/test742 index 34e284d18dab..5f56a1a500da 100644 --- a/tests/data/test742 +++ b/tests/data/test742 @@ -26,8 +26,8 @@ Funny-head: yesyes # method 2 is SOCKS5 asking for user+password method 2 -user aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -password bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +user %repeat[255 x a]% +password %repeat[255 x b]% backendport %HTTPPORT @@ -45,7 +45,7 @@ SOCKS5-hostname with max length credentials and max host name length # target a port that won't work without the SOCKS magic -http://cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:%HTTPPORT -x socks5h://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@%HOSTIP:%SOCKSPORT +http://%repeat[254 x c]%:%HTTPPORT -x socks5h://%repeat[255 x a]%:%repeat[255 x b]%@%HOSTIP:%SOCKSPORT proxy @@ -57,7 +57,7 @@ proxy GET / HTTP/1.1 -Host: cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:%HTTPPORT +Host: %repeat[254 x c]%:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test775 b/tests/data/test775 index d9f5b122f225..7b5c3696dc23 100644 --- a/tests/data/test775 +++ b/tests/data/test775 @@ -46,7 +46,7 @@ http HTTP with NTLM with too long user name -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuserAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:testpass --ntlm +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser%repeat[1100 x A]%:testpass --ntlm From 1afc4bb76890e24266aca5d86c2c083ac3666adf Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 Oct 2025 18:18:22 +0100 Subject: [PATCH 172/885] tool/var: explain how the null termination byte is there Closes #19287 --- src/var.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/var.c b/src/var.c index 87f33af28226..94d79695acc9 100644 --- a/src/var.c +++ b/src/var.c @@ -362,6 +362,7 @@ static ParameterError addvariable(const char *name, p = calloc(1, sizeof(struct tool_var) + nlen); if(p) { memcpy(p->name, name, nlen); + /* the null termination byte is already present from above */ p->content = contalloc ? content : memdup0(content, clen); if(p->content) { From d2e8acfaa6effaa31dee91aea25ec1c54e6fa5c4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 30 Oct 2025 23:21:00 +0100 Subject: [PATCH 173/885] test1100: fix missing `` section To make it actually run. Also fix the NTLM expected result, also syncing it with other tests. Follow-up to e6b21d422e631a7c0cc81abf956af179b3b4c5e8 #6037 Closes #19288 --- tests/data/test1100 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/data/test1100 b/tests/data/test1100 index 13eaeb3177b5..10bf811eddd6 100644 --- a/tests/data/test1100 +++ b/tests/data/test1100 @@ -80,6 +80,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -L -d "stuff to # Verify data after the test has been "shot" + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= @@ -90,7 +91,7 @@ Content-Type: application/x-www-form-urlencoded POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q= +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= User-Agent: curl/%VERSION Accept: */* Content-Length: 18 @@ -101,5 +102,6 @@ Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* + From 5bf9445315f0964a4848ef08ef0f2bf3ce4c3567 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 03:41:53 +0100 Subject: [PATCH 174/885] ftp: fix leaking internal buffer `newhost` on error Pointed out by TIOBE scanner via Coverity 2025.3.0. Closes #19290 --- lib/ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ftp.c b/lib/ftp.c index 3ac8db6813bb..4858ae230f14 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1925,7 +1925,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, result = Curl_conn_get_ip_info(data, data->conn, FIRSTSOCKET, &is_ipv6, &ipquad); if(result) - return result; + goto error; (void)Curl_resolv_blocking(data, host_name, ipquad.remote_port, is_ipv6 ? CURL_IPRESOLVE_V6 : CURL_IPRESOLVE_V4, From 4b85e489a45c81b235d3e47d1524cbe1d6b25b06 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 03:33:14 +0100 Subject: [PATCH 175/885] examples/http2-serverpush: fix file handle leaks Also: - tests/libtest/cli_h2_serverpush: re-sync formatting. Previously fixed in tests based on a local clang-tidy v20 report. Pointed out by TIOBE scanner via Coverity 2025.3.0. Follow-up to 83a8818cfebe5f2a4bab5c9ddc55fd64b5629296 #17706 Closes #19291 --- docs/examples/http2-serverpush.c | 47 +++++++++++++++++-------------- tests/libtest/cli_h2_serverpush.c | 21 +++++++------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index e97be991a8cb..c12a5f7d2ea2 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -40,6 +40,8 @@ #error "too old libcurl, cannot do HTTP/2 server push!" #endif +static FILE *out_download; + static void dump(const char *text, unsigned char *ptr, size_t size, char nohex) { size_t i; @@ -127,21 +129,13 @@ static int my_trace(CURL *handle, curl_infotype type, static int setup(CURL *hnd, const char *url) { - FILE *out = fopen(OUTPUTFILE, "wb"); - if(!out) - /* failed */ - return 1; - - /* write to this file */ - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out); + out_download = fopen(OUTPUTFILE, "wb"); + if(!out_download) + return 1; /* failed */ /* set the same URL */ curl_easy_setopt(hnd, CURLOPT_URL, url); - /* please be verbose */ - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace); - /* HTTP/2 please */ curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); @@ -149,13 +143,22 @@ static int setup(CURL *hnd, const char *url) curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); -#if (CURLPIPE_MULTIPLEX > 0) + /* write to this file */ + curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out_download); + + /* please be verbose */ + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace); + +#if CURLPIPE_MULTIPLEX > 0 /* wait for pipe connection to confirm */ curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); #endif return 0; /* all is good */ } +static FILE *out_push; + /* called when there is an incoming push */ static int server_push_callback(CURL *parent, CURL *easy, @@ -167,7 +170,6 @@ static int server_push_callback(CURL *parent, size_t i; int *transfers = (int *)userp; char filename[128]; - FILE *out; static unsigned int count = 0; (void)parent; @@ -175,15 +177,15 @@ static int server_push_callback(CURL *parent, snprintf(filename, sizeof(filename), "push%u", count++); /* here's a new stream, save it in a new file for each new push */ - out = fopen(filename, "wb"); - if(!out) { + out_push = fopen(filename, "wb"); + if(!out_push) { /* if we cannot save it, deny it */ fprintf(stderr, "Failed to create output file for push\n"); return CURL_PUSH_DENY; } /* write to this file */ - curl_easy_setopt(easy, CURLOPT_WRITEDATA, out); + curl_easy_setopt(easy, CURLOPT_WRITEDATA, out_push); fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n", count, (unsigned long)num_headers); @@ -199,10 +201,10 @@ static int server_push_callback(CURL *parent, } (*transfers)++; /* one more */ + return CURL_PUSH_OK; } - /* * Download a file over HTTP/2, take care of server push. */ @@ -233,13 +235,13 @@ int main(int argc, char *argv[]) return 1; } - /* add the easy transfer */ - curl_multi_add_handle(multi_handle, easy); - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); curl_multi_setopt(multi_handle, CURLMOPT_PUSHFUNCTION, server_push_callback); curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers); + /* add the easy transfer */ + curl_multi_add_handle(multi_handle, easy); + do { struct CURLMsg *m; int still_running; /* keep number of running handles */ @@ -257,7 +259,6 @@ int main(int argc, char *argv[]) * created and added one or more easy handles but we need to clean them up * when we are done. */ - do { int msgq = 0; m = curl_multi_info_read(multi_handle, &msgq); @@ -274,5 +275,9 @@ int main(int argc, char *argv[]) curl_multi_cleanup(multi_handle); curl_global_cleanup(); + fclose(out_download); + if(out_push) + fclose(out_push); + return 0; } diff --git a/tests/libtest/cli_h2_serverpush.c b/tests/libtest/cli_h2_serverpush.c index a865fdfd8f5b..10d369faafe4 100644 --- a/tests/libtest/cli_h2_serverpush.c +++ b/tests/libtest/cli_h2_serverpush.c @@ -54,7 +54,7 @@ static int setup_h2_serverpush(CURL *hnd, const char *url) static FILE *out_push; -/* called when there's an incoming push */ +/* called when there is an incoming push */ static int server_push_callback(CURL *parent, CURL *easy, size_t num_headers, @@ -66,9 +66,9 @@ static int server_push_callback(CURL *parent, int *transfers = (int *)userp; char filename[128]; static unsigned int count = 0; - int rv; (void)parent; + curl_msnprintf(filename, sizeof(filename) - 1, "push%u", count++); /* here's a new stream, save it in a new file for each new push */ @@ -76,8 +76,7 @@ static int server_push_callback(CURL *parent, if(!out_push) { /* if we cannot save it, deny it */ curl_mfprintf(stderr, "Failed to create output file for push\n"); - rv = CURL_PUSH_DENY; - goto out; + return CURL_PUSH_DENY; } /* write to this file */ @@ -98,10 +97,8 @@ static int server_push_callback(CURL *parent, } (*transfers)++; /* one more */ - rv = CURL_PUSH_OK; -out: - return rv; + return CURL_PUSH_OK; } /* @@ -112,7 +109,6 @@ static CURLcode test_cli_h2_serverpush(const char *URL) CURL *easy; CURLM *multi_handle; int transfers = 1; /* we start with one */ - struct CURLMsg *m; debug_config.nohex = TRUE; debug_config.tracetime = FALSE; @@ -123,9 +119,6 @@ static CURLcode test_cli_h2_serverpush(const char *URL) } multi_handle = curl_multi_init(); - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - curl_multi_setopt(multi_handle, CURLMOPT_PUSHFUNCTION, server_push_callback); - curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers); easy = curl_easy_init(); if(setup_h2_serverpush(easy, URL)) { @@ -134,8 +127,14 @@ static CURLcode test_cli_h2_serverpush(const char *URL) return (CURLcode)1; } + curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi_handle, CURLMOPT_PUSHFUNCTION, server_push_callback); + curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers); + curl_multi_add_handle(multi_handle, easy); + do { + struct CURLMsg *m; int still_running; /* keep number of running handles */ CURLMcode mc = curl_multi_perform(multi_handle, &still_running); From 869143b19402845855e8a0c36eb0ee67127f7a24 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 04:22:42 +0100 Subject: [PATCH 176/885] examples: fix more potential resource leaks, and more Also: - delete dead code. - sync `http2-download.c` and `http2-upload.c` sources. - simplessl: fix constant expression. - simplessl: avoid `expression is constant` VS2010 warning, drop pragma. - replace large stack buffers with dynamic allocation. - http2-download: fix to fill transfer number. Some of these were pointed out by TIOBE scanner via Coverity 2025.3.0. Closes #19292 --- docs/examples/10-at-a-time.c | 14 +-- docs/examples/http2-download.c | 98 +++++++++++-------- docs/examples/http2-serverpush.c | 13 ++- docs/examples/http2-upload.c | 160 ++++++++++++++++--------------- docs/examples/sftpuploadresume.c | 39 ++++---- docs/examples/simplessl.c | 143 +++++++++++++-------------- docs/examples/smtp-authzid.c | 17 ++-- docs/examples/smtp-mail.c | 17 ++-- docs/examples/smtp-multi.c | 17 ++-- docs/examples/smtp-ssl.c | 17 ++-- docs/examples/smtp-tls.c | 17 ++-- 11 files changed, 278 insertions(+), 274 deletions(-) diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index 87971cbde62f..ec385926711b 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -80,7 +80,7 @@ static const char *urls[] = { "https://www.un.org", }; -#define MAX_PARALLEL 10 /* number of simultaneous transfers */ +#define MAX_PARALLEL 10 /* number of simultaneous transfers */ #define NUM_URLS sizeof(urls)/sizeof(char *) static size_t write_cb(char *data, size_t n, size_t l, void *userp) @@ -88,16 +88,18 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp) /* take care of the data here, ignored in this example */ (void)data; (void)userp; - return n*l; + return n * l; } static void add_transfer(CURLM *cm, unsigned int i, int *left) { CURL *eh = curl_easy_init(); - curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(eh, CURLOPT_URL, urls[i]); - curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]); - curl_multi_add_handle(cm, eh); + if(eh) { + curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(eh, CURLOPT_URL, urls[i]); + curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]); + curl_multi_add_handle(cm, eh); + } (*left)++; } diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 06902415e18d..15bb9fa1a50d 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -34,13 +34,13 @@ #include #endif -/* curl stuff */ -#include - #if defined(_MSC_VER) && (_MSC_VER < 1900) #define snprintf _snprintf #endif +/* curl stuff */ +#include + #ifndef CURLPIPE_MULTIPLEX /* This little trick makes sure that we do not enable pipelining for libcurls old enough to not have this symbol. It is _not_ defined to zero in a recent @@ -49,26 +49,23 @@ #endif struct transfer { - CURL *easy; - unsigned int num; FILE *out; + CURL *easy; + int num; }; -#define NUM_HANDLES 1000 - -static void dump(const char *text, unsigned int num, unsigned char *ptr, +static void dump(const char *text, int num, unsigned char *ptr, size_t size, char nohex) { size_t i; size_t c; - unsigned int width = 0x10; if(nohex) /* without the hex output, we can fit more on screen */ width = 0x40; - fprintf(stderr, "%u %s, %lu bytes (0x%lx)\n", + fprintf(stderr, "%d %s, %lu bytes (0x%lx)\n", num, text, (unsigned long)size, (unsigned long)size); for(i = 0; i < size; i += width) { @@ -109,12 +106,12 @@ static int my_trace(CURL *handle, curl_infotype type, { const char *text; struct transfer *t = (struct transfer *)userp; - unsigned int num = t->num; + int num = t->num; (void)handle; switch(type) { case CURLINFO_TEXT: - fprintf(stderr, "== %u Info: %s", num, data); + fprintf(stderr, "== [%d] Info: %s", num, data); return 0; case CURLINFO_HEADER_OUT: text = "=> Send header"; @@ -145,12 +142,12 @@ static int my_trace(CURL *handle, curl_infotype type, static int setup(struct transfer *t, int num) { char filename[128]; - CURL *hnd; + CURL *easy; - hnd = t->easy = curl_easy_init(); + easy = t->easy = NULL; + t->num = num; snprintf(filename, sizeof(filename), "dl-%d", num); - t->out = fopen(filename, "wb"); if(!t->out) { fprintf(stderr, "error: could not open file %s for writing: %s\n", @@ -158,27 +155,31 @@ static int setup(struct transfer *t, int num) return 1; } - /* write to this file */ - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t->out); + easy = t->easy = curl_easy_init(); + if(easy) { + + /* write to this file */ + curl_easy_setopt(easy, CURLOPT_WRITEDATA, t->out); - /* set the same URL */ - curl_easy_setopt(hnd, CURLOPT_URL, "https://localhost:8443/index.html"); + /* set the same URL */ + curl_easy_setopt(easy, CURLOPT_URL, "https://localhost:8443/index.html"); - /* please be verbose */ - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace); - curl_easy_setopt(hnd, CURLOPT_DEBUGDATA, t); + /* please be verbose */ + curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(easy, CURLOPT_DEBUGDATA, t); - /* enlarge the receive buffer for potentially higher transfer speeds */ - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 100000L); + /* enlarge the receive buffer for potentially higher transfer speeds */ + curl_easy_setopt(easy, CURLOPT_BUFFERSIZE, 100000L); - /* HTTP/2 please */ - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + /* HTTP/2 please */ + curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); #if (CURLPIPE_MULTIPLEX > 0) - /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + /* wait for pipe connection to confirm */ + curl_easy_setopt(easy, CURLOPT_PIPEWAIT, 1L); #endif + } return 0; } @@ -188,8 +189,8 @@ static int setup(struct transfer *t, int num) int main(int argc, char **argv) { CURLcode res; - struct transfer trans[NUM_HANDLES]; - CURLM *multi_handle; + struct transfer *trans; + CURLM *multi_handle = NULL; int i; int still_running = 0; /* keep number of running handles */ int num_transfers; @@ -197,25 +198,30 @@ int main(int argc, char **argv) if(argc > 1) { /* if given a number, do that many transfers */ num_transfers = atoi(argv[1]); - if((num_transfers < 1) || (num_transfers > NUM_HANDLES)) - num_transfers = 3; /* a suitable low default */ + if((num_transfers < 1) || (num_transfers > 1000)) + num_transfers = 3; /* a suitable low default */ } else - num_transfers = 3; /* suitable default */ + num_transfers = 3; /* a suitable low default */ res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - memset(trans, 0, sizeof(trans)); + trans = calloc(num_transfers, sizeof(*trans)); + if(!trans) { + fprintf(stderr, "error allocating transfer structs\n"); + goto error; + } /* init a multi stack */ multi_handle = curl_multi_init(); + if(!multi_handle) + goto error; for(i = 0; i < num_transfers; i++) { if(setup(&trans[i], i)) { - curl_global_cleanup(); - return 1; + goto error; } /* add the individual transfer */ @@ -233,14 +239,24 @@ int main(int argc, char **argv) if(mc) break; + } while(still_running); - for(i = 0; i < num_transfers; i++) { - curl_multi_remove_handle(multi_handle, trans[i].easy); - curl_easy_cleanup(trans[i].easy); +error: + + if(multi_handle) { + for(i = 0; i < num_transfers; i++) { + curl_multi_remove_handle(multi_handle, trans[i].easy); + curl_easy_cleanup(trans[i].easy); + + if(trans[i].out) + fclose(trans[i].out); + } + curl_multi_cleanup(multi_handle); } - curl_multi_cleanup(multi_handle); + free(trans); + curl_global_cleanup(); return 0; diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index c12a5f7d2ea2..8c261e9aed2b 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -225,14 +225,15 @@ int main(int argc, char *argv[]) /* init a multi stack */ multi_handle = curl_multi_init(); + if(!multi_handle) + goto error; easy = curl_easy_init(); /* set options */ - if(setup(easy, url)) { + if(!easy || setup(easy, url)) { fprintf(stderr, "failed\n"); - curl_global_cleanup(); - return 1; + goto error; } curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); @@ -272,7 +273,11 @@ int main(int argc, char *argv[]) } while(transfers); /* as long as we have transfers going */ - curl_multi_cleanup(multi_handle); +error: + + if(multi_handle) + curl_multi_cleanup(multi_handle); + curl_global_cleanup(); fclose(out_download); diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 55162c03a3ad..fda941c49f4d 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -64,8 +64,6 @@ #define CURLPIPE_MULTIPLEX 0L #endif -#define NUM_HANDLES 1000 - #ifdef _MSC_VER #define gettimeofday(a, b) my_gettimeofday((a), (b)) static int my_gettimeofday(struct timeval *tp, void *tzp) @@ -90,12 +88,12 @@ struct input { FILE *in; FILE *out; size_t bytes_read; /* count up */ - CURL *hnd; + CURL *easy; int num; }; -static void dump(const char *text, int num, unsigned char *ptr, size_t size, - char nohex) +static void dump(const char *text, int num, unsigned char *ptr, + size_t size, char nohex) { size_t i; size_t c; @@ -141,8 +139,8 @@ static void dump(const char *text, int num, unsigned char *ptr, size_t size, } } -static int my_trace(CURL *handle, curl_infotype type, char *data, - size_t size, void *userp) +static int my_trace(CURL *handle, curl_infotype type, + char *data, size_t size, void *userp) { char timebuf[60]; const char *text; @@ -203,33 +201,33 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return retcode; } -static int setup(struct input *i, int num, const char *upload) +static int setup(struct input *t, int num, const char *upload) { char url[256]; char filename[128]; struct stat file_info; curl_off_t uploadsize; - CURL *hnd; + CURL *easy; - hnd = i->hnd = NULL; + easy = t->easy = NULL; - i->num = num; + t->num = num; snprintf(filename, sizeof(filename), "dl-%d", num); - i->out = fopen(filename, "wb"); - if(!i->out) { - fprintf(stderr, "error: could not open file %s for writing: %s\n", upload, - strerror(errno)); + t->out = fopen(filename, "wb"); + if(!t->out) { + fprintf(stderr, "error: could not open file %s for writing: %s\n", + upload, strerror(errno)); return 1; } snprintf(url, sizeof(url), "https://localhost:8443/upload-%d", num); - i->in = fopen(upload, "rb"); - if(!i->in) { - fprintf(stderr, "error: could not open file %s for reading: %s\n", upload, - strerror(errno)); - fclose(i->out); - i->out = NULL; + t->in = fopen(upload, "rb"); + if(!t->in) { + fprintf(stderr, "error: could not open file %s for reading: %s\n", + upload, strerror(errno)); + fclose(t->out); + t->out = NULL; return 1; } @@ -237,51 +235,51 @@ static int setup(struct input *i, int num, const char *upload) /* !checksrc! disable BANNEDFUNC 1 */ if(stat(upload, &file_info) != 0) { #else - if(fstat(fileno(i->in), &file_info) != 0) { + if(fstat(fileno(t->in), &file_info) != 0) { #endif - fprintf(stderr, "error: could not stat file %s: %s\n", upload, - strerror(errno)); - fclose(i->out); - i->out = NULL; + fprintf(stderr, "error: could not stat file %s: %s\n", + upload, strerror(errno)); + fclose(t->out); + t->out = NULL; return 1; } uploadsize = file_info.st_size; - hnd = i->hnd = curl_easy_init(); - if(hnd) { + easy = t->easy = curl_easy_init(); + if(easy) { /* write to this file */ - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, i->out); + curl_easy_setopt(easy, CURLOPT_WRITEDATA, t->out); /* we want to use our own read function */ - curl_easy_setopt(hnd, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(easy, CURLOPT_READFUNCTION, read_callback); /* read from this file */ - curl_easy_setopt(hnd, CURLOPT_READDATA, i); + curl_easy_setopt(easy, CURLOPT_READDATA, t); /* provide the size of the upload */ - curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, uploadsize); + curl_easy_setopt(easy, CURLOPT_INFILESIZE_LARGE, uploadsize); /* send in the URL to store the upload as */ - curl_easy_setopt(hnd, CURLOPT_URL, url); + curl_easy_setopt(easy, CURLOPT_URL, url); /* upload please */ - curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(easy, CURLOPT_UPLOAD, 1L); /* please be verbose */ - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace); - curl_easy_setopt(hnd, CURLOPT_DEBUGDATA, i); + curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(easy, CURLOPT_DEBUGDATA, t); /* HTTP/2 please */ - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); /* we use a self-signed test server, skip verification during debugging */ - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(easy, CURLOPT_SSL_VERIFYHOST, 0L); #if (CURLPIPE_MULTIPLEX > 0) /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(easy, CURLOPT_PIPEWAIT, 1L); #endif } return 0; @@ -293,79 +291,83 @@ static int setup(struct input *i, int num, const char *upload) int main(int argc, char **argv) { CURLcode res; - struct input trans[NUM_HANDLES]; - CURLM *multi_handle; + struct input *trans; + CURLM *multi_handle = NULL; int i; const char *filename = "index.html"; + int still_running = 0; /* keep number of running handles */ int num_transfers; if(argc > 1) { /* if given a number, do that many transfers */ num_transfers = atoi(argv[1]); - - if(!num_transfers || (num_transfers > NUM_HANDLES)) - num_transfers = 3; /* a suitable low default */ + if((num_transfers < 1) || (num_transfers > 1000)) + num_transfers = 3; /* a suitable low default */ if(argc > 2) /* if given a file name, upload this! */ filename = argv[2]; } else - num_transfers = 3; + num_transfers = 3; /* a suitable low default */ res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - memset(trans, 0, sizeof(trans)); + trans = calloc(num_transfers, sizeof(*trans)); + if(!trans) { + fprintf(stderr, "error allocating transfer structs\n"); + goto error; + } /* init a multi stack */ multi_handle = curl_multi_init(); - if(multi_handle) { + if(!multi_handle) + goto error; - int still_running = 0; /* keep number of running handles */ + for(i = 0; i < num_transfers; i++) { + if(setup(&trans[i], i, filename)) { + goto error; + } - for(i = 0; i < num_transfers; i++) { - if(setup(&trans[i], i, filename)) { - curl_global_cleanup(); - return 1; - } + /* add the individual transfer */ + curl_multi_add_handle(multi_handle, trans[i].easy); + } - /* add the individual transfer */ - curl_multi_add_handle(multi_handle, trans[i].hnd); - } + curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + /* We do HTTP/2 so let's stick to one connection per host */ + curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 1L); - /* We do HTTP/2 so let's stick to one connection per host */ - curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 1L); + do { + CURLMcode mc = curl_multi_perform(multi_handle, &still_running); - do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + if(still_running) + /* wait for activity, timeout or "nothing" */ + mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); - if(still_running) - /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + if(mc) + break; - if(mc) - break; + } while(still_running); - } while(still_running); +error: - for(i = 0; i < num_transfers; i++) - curl_multi_remove_handle(multi_handle, trans[i].hnd); + if(multi_handle) { + for(i = 0; i < num_transfers; i++) { + curl_multi_remove_handle(multi_handle, trans[i].easy); + curl_easy_cleanup(trans[i].easy); + if(trans[i].in) + fclose(trans[i].in); + if(trans[i].out) + fclose(trans[i].out); + } curl_multi_cleanup(multi_handle); } - for(i = 0; i < num_transfers; i++) { - curl_easy_cleanup(trans[i].hnd); - - if(trans[i].in) - fclose(trans[i].in); - if(trans[i].out) - fclose(trans[i].out); - } + free(trans); curl_global_cleanup(); diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index d9cff10567df..fa42859672b5 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -49,28 +49,31 @@ static size_t readfunc(char *ptr, size_t size, size_t nmemb, void *stream) */ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) { - CURLcode result = CURLE_GOT_NOTHING; curl_off_t remoteFileSizeByte = -1; CURL *curlHandlePtr = curl_easy_init(); - curl_easy_setopt(curlHandlePtr, CURLOPT_VERBOSE, 1L); - - curl_easy_setopt(curlHandlePtr, CURLOPT_URL, i_remoteFile); - curl_easy_setopt(curlHandlePtr, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_NOBODY, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_HEADER, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_FILETIME, 1L); - - result = curl_easy_perform(curlHandlePtr); - if(CURLE_OK == result) { - result = curl_easy_getinfo(curlHandlePtr, - CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, - &remoteFileSizeByte); - if(result) - return -1; - printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); + if(curlHandlePtr) { + CURLcode result; + + curl_easy_setopt(curlHandlePtr, CURLOPT_VERBOSE, 1L); + + curl_easy_setopt(curlHandlePtr, CURLOPT_URL, i_remoteFile); + curl_easy_setopt(curlHandlePtr, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curlHandlePtr, CURLOPT_NOBODY, 1L); + curl_easy_setopt(curlHandlePtr, CURLOPT_HEADER, 1L); + curl_easy_setopt(curlHandlePtr, CURLOPT_FILETIME, 1L); + + result = curl_easy_perform(curlHandlePtr); + if(CURLE_OK == result) { + result = curl_easy_getinfo(curlHandlePtr, + CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, + &remoteFileSizeByte); + if(result) + return -1; + printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); + } + curl_easy_cleanup(curlHandlePtr); } - curl_easy_cleanup(curlHandlePtr); return remoteFileSizeByte; } diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index 5da79a79a068..9fc2e4148405 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -49,7 +49,7 @@ int main(void) { - CURL *curl; + CURL *curl = NULL; CURLcode res; FILE *headerfile; const char *pPassphrase = NULL; @@ -61,98 +61,89 @@ int main(void) const char *pKeyName; const char *pKeyType; - const char *pEngine; - #ifdef USE_ENGINE pKeyName = "rsa_test"; pKeyType = "ENG"; - pEngine = "chil"; /* for nCipher HSM... */ #else pKeyName = "testkey.pem"; pKeyType = "PEM"; - pEngine = NULL; #endif - headerfile = fopen(pHeaderFile, "wb"); - if(!headerfile) - return 1; - res = curl_global_init(CURL_GLOBAL_ALL); if(res) { - fclose(headerfile); return (int)res; } + headerfile = fopen(pHeaderFile, "wb"); + if(!headerfile) + goto error; + curl = curl_easy_init(); - if(curl) { - /* what call to write: */ - curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://secure.site.example"); - curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile); - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4127) /* conditional expression is constant */ -#endif - do { /* dummy loop, just to break out from */ - if(pEngine) { - /* use crypto engine */ - if(curl_easy_setopt(curl, CURLOPT_SSLENGINE, pEngine) != CURLE_OK) { - /* load the crypto engine */ - fprintf(stderr, "cannot set crypto engine\n"); - break; - } - if(curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L) != CURLE_OK) { - /* set the crypto engine as default */ - /* only needed for the first time you load - an engine in a curl object... */ - fprintf(stderr, "cannot set crypto engine as default\n"); - break; - } - } - /* cert is stored PEM coded in file... */ - /* since PEM is default, we needn't set it for PEM */ - curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); - - /* set the cert for client authentication */ - curl_easy_setopt(curl, CURLOPT_SSLCERT, pCertFile); - - /* sorry, for engine we must set the passphrase - (if the key has one...) */ - if(pPassphrase) - curl_easy_setopt(curl, CURLOPT_KEYPASSWD, pPassphrase); - - /* if we use a key stored in a crypto engine, - we must set the key type to "ENG" */ - curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, pKeyType); - - /* set the private key (file or ID in engine) */ - curl_easy_setopt(curl, CURLOPT_SSLKEY, pKeyName); - - /* set the file with the certs validating the server */ - curl_easy_setopt(curl, CURLOPT_CAINFO, pCACertFile); - - /* disconnect if we cannot validate server's cert */ - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); - - /* Perform the request, res gets the return code */ - res = curl_easy_perform(curl); - /* Check for errors */ - if(res != CURLE_OK) - fprintf(stderr, "curl_easy_perform() failed: %s\n", - curl_easy_strerror(res)); - - /* we are done... */ - } while(0); -#ifdef _MSC_VER -#pragma warning(pop) + if(!curl) + goto error; + + /* what call to write: */ + curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://secure.site.example"); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile); + +#ifdef USE_ENGINE + /* use crypto engine. nCipher HSM... */ + if(curl_easy_setopt(curl, CURLOPT_SSLENGINE, "chil") != CURLE_OK) { + /* load the crypto engine */ + fprintf(stderr, "cannot set crypto engine\n"); + goto error; + } + if(curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L) != CURLE_OK) { + /* set the crypto engine as default */ + /* only needed for the first time you load + an engine in a curl object... */ + fprintf(stderr, "cannot set crypto engine as default\n"); + goto error; + } #endif - /* always cleanup */ + + /* cert is stored PEM coded in file... */ + /* since PEM is default, we needn't set it for PEM */ + curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); + + /* set the cert for client authentication */ + curl_easy_setopt(curl, CURLOPT_SSLCERT, pCertFile); + + /* sorry, for engine we must set the passphrase + (if the key has one...) */ + if(pPassphrase) + curl_easy_setopt(curl, CURLOPT_KEYPASSWD, pPassphrase); + + /* if we use a key stored in a crypto engine, + we must set the key type to "ENG" */ + curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, pKeyType); + + /* set the private key (file or ID in engine) */ + curl_easy_setopt(curl, CURLOPT_SSLKEY, pKeyName); + + /* set the file with the certs validating the server */ + curl_easy_setopt(curl, CURLOPT_CAINFO, pCACertFile); + + /* disconnect if we cannot validate server's cert */ + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); + + /* Perform the request, res gets the return code */ + res = curl_easy_perform(curl); + /* Check for errors */ + if(res != CURLE_OK) + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); + +error: + + /* always cleanup */ + if(curl) curl_easy_cleanup(curl); - } - curl_global_cleanup(); + if(headerfile) + fclose(headerfile); - fclose(headerfile); + curl_global_cleanup(); - return 0; + return (int)res; } diff --git a/docs/examples/smtp-authzid.c b/docs/examples/smtp-authzid.c index 758a7fdaaf2a..1fb1176b2a8b 100644 --- a/docs/examples/smtp-authzid.c +++ b/docs/examples/smtp-authzid.c @@ -72,6 +72,7 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; size_t room = size * nmemb; + size_t len; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; @@ -79,17 +80,13 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) data = &payload_text[upload_ctx->bytes_read]; - if(data) { - size_t len = strlen(data); - if(room < len) - len = room; - memcpy(ptr, data, len); - upload_ctx->bytes_read += len; + len = strlen(data); + if(room < len) + len = room; + memcpy(ptr, data, len); + upload_ctx->bytes_read += len; - return len; - } - - return 0; + return len; } int main(void) diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c index d3f4346b8c0a..d41fc07b8014 100644 --- a/docs/examples/smtp-mail.c +++ b/docs/examples/smtp-mail.c @@ -69,6 +69,7 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; size_t room = size * nmemb; + size_t len; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; @@ -76,17 +77,13 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) data = &payload_text[upload_ctx->bytes_read]; - if(data) { - size_t len = strlen(data); - if(room < len) - len = room; - memcpy(ptr, data, len); - upload_ctx->bytes_read += len; + len = strlen(data); + if(room < len) + len = room; + memcpy(ptr, data, len); + upload_ctx->bytes_read += len; - return len; - } - - return 0; + return len; } int main(void) diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index f7619465ee17..0973378e0f9b 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -62,6 +62,7 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; size_t room = size * nmemb; + size_t len; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; @@ -69,17 +70,13 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) data = &payload_text[upload_ctx->bytes_read]; - if(data) { - size_t len = strlen(data); - if(room < len) - len = room; - memcpy(ptr, data, len); - upload_ctx->bytes_read += len; + len = strlen(data); + if(room < len) + len = room; + memcpy(ptr, data, len); + upload_ctx->bytes_read += len; - return len; - } - - return 0; + return len; } int main(void) diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index ca73b73fca9a..31ef81eae19a 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -66,6 +66,7 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; size_t room = size * nmemb; + size_t len; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; @@ -73,17 +74,13 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) data = &payload_text[upload_ctx->bytes_read]; - if(data) { - size_t len = strlen(data); - if(room < len) - len = room; - memcpy(ptr, data, len); - upload_ctx->bytes_read += len; + len = strlen(data); + if(room < len) + len = room; + memcpy(ptr, data, len); + upload_ctx->bytes_read += len; - return len; - } - - return 0; + return len; } int main(void) diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index 4f7379529c1e..5d9214455e22 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -66,6 +66,7 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; size_t room = size * nmemb; + size_t len; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; @@ -73,17 +74,13 @@ static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) data = &payload_text[upload_ctx->bytes_read]; - if(data) { - size_t len = strlen(data); - if(room < len) - len = room; - memcpy(ptr, data, len); - upload_ctx->bytes_read += len; + len = strlen(data); + if(room < len) + len = room; + memcpy(ptr, data, len); + upload_ctx->bytes_read += len; - return len; - } - - return 0; + return len; } int main(void) From 4d2a05d3fe8ba4db9168b03057029ea5ce7dab77 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 30 Oct 2025 15:46:17 +0100 Subject: [PATCH 177/885] tests: use `crlf=yes` attribute more To make special newlines more explicit and visible. Mostly in `` sections, some in `` and ``. Reducing the number of `tests/data/test*`: - CRLF newlines from 21535 to 11337. - files with mixed newlines from 1335 to 707. Also delete empty `` sections. Closes #19284 --- tests/data/test100 | 18 +- tests/data/test1000 | 12 +- tests/data/test1003 | 20 +- tests/data/test1004 | 12 +- tests/data/test1005 | 20 +- tests/data/test1006 | 20 +- tests/data/test101 | 16 +- tests/data/test1010 | 20 +- tests/data/test1011 | 26 +- tests/data/test1012 | 30 +-- tests/data/test1015 | 16 +- tests/data/test102 | 20 +- tests/data/test1021 | 46 ++-- tests/data/test1024 | 34 +-- tests/data/test1025 | 38 +-- tests/data/test1028 | 28 +- tests/data/test1029 | 12 +- tests/data/test103 | 22 +- tests/data/test1031 | 22 +- tests/data/test1032 | 14 +- tests/data/test1033 | 12 +- tests/data/test1036 | 22 +- tests/data/test1037 | 20 +- tests/data/test1038 | 18 +- tests/data/test1039 | 18 +- tests/data/test104 | 22 +- tests/data/test1040 | 14 +- tests/data/test1042 | 14 +- tests/data/test1043 | 14 +- tests/data/test1044 | 20 +- tests/data/test1045 | 12 +- tests/data/test1046 | 12 +- tests/data/test1047 | 16 +- tests/data/test1048 | 16 +- tests/data/test105 | 18 +- tests/data/test1054 | 30 +-- tests/data/test1056 | 22 +- tests/data/test1057 | 22 +- tests/data/test1058 | 14 +- tests/data/test1059 | 12 +- tests/data/test106 | 22 +- tests/data/test1060 | 34 +-- tests/data/test1061 | 34 +-- tests/data/test1062 | 20 +- tests/data/test1066 | 22 +- tests/data/test1067 | 26 +- tests/data/test107 | 16 +- tests/data/test1070 | 18 +- tests/data/test1074 | 22 +- tests/data/test1076 | 30 +-- tests/data/test1077 | 26 +- tests/data/test1078 | 22 +- tests/data/test1079 | 24 +- tests/data/test108 | 22 +- tests/data/test1080 | 22 +- tests/data/test1081 | 22 +- tests/data/test1082 | 12 +- tests/data/test1083 | 12 +- tests/data/test1086 | 16 +- tests/data/test1087 | 40 +-- tests/data/test1088 | 42 +-- tests/data/test1089 | 22 +- tests/data/test109 | 16 +- tests/data/test1090 | 22 +- tests/data/test1091 | 24 +- tests/data/test1092 | 14 +- tests/data/test1095 | 24 +- tests/data/test1096 | 26 +- tests/data/test1097 | 28 +- tests/data/test11 | 22 +- tests/data/test110 | 22 +- tests/data/test1100 | 44 +-- tests/data/test1101 | 14 +- tests/data/test1102 | 24 +- tests/data/test1103 | 20 +- tests/data/test1104 | 28 +- tests/data/test1105 | 16 +- tests/data/test1106 | 14 +- tests/data/test1107 | 20 +- tests/data/test1108 | 10 +- tests/data/test1109 | 12 +- tests/data/test111 | 16 +- tests/data/test1110 | 12 +- tests/data/test1111 | 12 +- tests/data/test1112 | 20 +- tests/data/test1113 | 78 +++--- tests/data/test1115 | 12 +- tests/data/test1116 | 12 +- tests/data/test1117 | 26 +- tests/data/test1118 | 12 +- tests/data/test112 | 16 +- tests/data/test1120 | 10 +- tests/data/test1121 | 12 +- tests/data/test1122 | 16 +- tests/data/test1123 | 16 +- tests/data/test1124 | 16 +- tests/data/test1125 | 16 +- tests/data/test1126 | 14 +- tests/data/test1127 | 14 +- tests/data/test1128 | 26 +- tests/data/test1129 | 34 +-- tests/data/test113 | 4 +- tests/data/test1130 | 34 +-- tests/data/test1131 | 30 +-- tests/data/test1137 | 18 +- tests/data/test114 | 6 +- tests/data/test1141 | 26 +- tests/data/test1142 | 14 +- tests/data/test1143 | 12 +- tests/data/test1144 | 12 +- tests/data/test1147 | 16 +- tests/data/test1148 | 12 +- tests/data/test1149 | 30 +-- tests/data/test115 | 14 +- tests/data/test1150 | 26 +- tests/data/test1151 | 12 +- tests/data/test1152 | 18 +- tests/data/test1153 | 18 +- tests/data/test1154 | 12 +- tests/data/test1155 | 12 +- tests/data/test1157 | 12 +- tests/data/test1159 | 12 +- tests/data/test1160 | 12 +- tests/data/test1161 | 12 +- tests/data/test1162 | 20 +- tests/data/test1163 | 20 +- tests/data/test1164 | 12 +- tests/data/test1166 | 22 +- tests/data/test1168 | 26 +- tests/data/test117 | 16 +- tests/data/test1170 | 16 +- tests/data/test1171 | 16 +- tests/data/test1172 | 12 +- tests/data/test1174 | 12 +- tests/data/test1176 | 12 +- tests/data/test1178 | 16 +- tests/data/test118 | 20 +- tests/data/test1180 | 14 +- tests/data/test1181 | 14 +- tests/data/test1183 | 12 +- tests/data/test1184 | 22 +- tests/data/test1187 | 38 +-- tests/data/test1188 | 22 +- tests/data/test119 | 16 +- tests/data/test1197 | 26 +- tests/data/test12 | 14 +- tests/data/test120 | 22 +- tests/data/test1200 | 4 +- tests/data/test1201 | 4 +- tests/data/test1202 | 4 +- tests/data/test1203 | 4 +- tests/data/test1204 | 24 +- tests/data/test1205 | 12 +- tests/data/test121 | 22 +- tests/data/test1210 | 12 +- tests/data/test1212 | 14 +- tests/data/test1213 | 14 +- tests/data/test1214 | 14 +- tests/data/test1215 | 30 +-- tests/data/test1216 | 28 +- tests/data/test1217 | 30 +-- tests/data/test1218 | 40 +-- tests/data/test1219 | 14 +- tests/data/test122 | 18 +- tests/data/test1221 | 16 +- tests/data/test1223 | 12 +- tests/data/test1224 | 20 +- tests/data/test1225 | 34 +-- tests/data/test1226 | 20 +- tests/data/test1227 | 18 +- tests/data/test1228 | 28 +- tests/data/test1229 | 24 +- tests/data/test123 | 14 +- tests/data/test1230 | 22 +- tests/data/test1231 | 22 +- tests/data/test1232 | 26 +- tests/data/test1233 | 20 +- tests/data/test1235 | 42 +-- tests/data/test1237 | 14 +- tests/data/test1239 | 14 +- tests/data/test124 | 20 +- tests/data/test1240 | 22 +- tests/data/test1241 | 26 +- tests/data/test1244 | 14 +- tests/data/test1245 | 12 +- tests/data/test1246 | 26 +- tests/data/test1248 | 14 +- tests/data/test1249 | 14 +- tests/data/test1250 | 14 +- tests/data/test1251 | 14 +- tests/data/test1252 | 12 +- tests/data/test1253 | 14 +- tests/data/test1254 | 14 +- tests/data/test1255 | 12 +- tests/data/test1256 | 14 +- tests/data/test1257 | 14 +- tests/data/test1258 | 24 +- tests/data/test1259 | 14 +- tests/data/test126 | 22 +- tests/data/test1261 | 12 +- tests/data/test1262 | 14 +- tests/data/test1265 | 12 +- tests/data/test1266 | 12 +- tests/data/test1267 | 12 +- tests/data/test127 | 24 +- tests/data/test1270 | 12 +- tests/data/test1271 | 12 +- tests/data/test1272 | 4 +- tests/data/test1273 | 14 +- tests/data/test1274 | 12 +- tests/data/test1277 | 18 +- tests/data/test128 | 32 +-- tests/data/test1280 | 42 +-- tests/data/test1282 | 6 +- tests/data/test1283 | 12 +- tests/data/test1284 | 32 +-- tests/data/test1286 | 36 +-- tests/data/test1287 | 12 +- tests/data/test1288 | 12 +- tests/data/test129 | 12 +- tests/data/test1290 | 12 +- tests/data/test1292 | 12 +- tests/data/test1293 | 26 +- tests/data/test1294 | 14 +- tests/data/test1295 | 18 +- tests/data/test1296 | 14 +- tests/data/test1297 | 12 +- tests/data/test1298 | 14 +- tests/data/test1299 | 14 +- tests/data/test13 | 12 +- tests/data/test130 | 16 +- tests/data/test131 | 16 +- tests/data/test1310 | 12 +- tests/data/test1311 | 12 +- tests/data/test1312 | 12 +- tests/data/test1313 | 12 +- tests/data/test1314 | 26 +- tests/data/test1316 | 16 +- tests/data/test1317 | 12 +- tests/data/test1318 | 22 +- tests/data/test1319 | 12 +- tests/data/test132 | 16 +- tests/data/test1320 | 24 +- tests/data/test1321 | 12 +- tests/data/test1322 | 12 +- tests/data/test1324 | 12 +- tests/data/test1325 | 30 +-- tests/data/test1326 | 6 +- tests/data/test1327 | 6 +- tests/data/test1328 | 22 +- tests/data/test133 | 16 +- tests/data/test1331 | 30 +-- tests/data/test1332 | 30 +-- tests/data/test1333 | 20 +- tests/data/test1334 | 12 +- tests/data/test1335 | 12 +- tests/data/test1336 | 12 +- tests/data/test1337 | 12 +- tests/data/test1338 | 12 +- tests/data/test1339 | 12 +- tests/data/test134 | 16 +- tests/data/test1340 | 12 +- tests/data/test1341 | 12 +- tests/data/test1342 | 12 +- tests/data/test1343 | 12 +- tests/data/test1344 | 12 +- tests/data/test1345 | 12 +- tests/data/test1346 | 12 +- tests/data/test1347 | 12 +- tests/data/test1348 | 20 +- tests/data/test1349 | 20 +- tests/data/test135 | 22 +- tests/data/test1350 | 20 +- tests/data/test1351 | 20 +- tests/data/test1352 | 20 +- tests/data/test1353 | 20 +- tests/data/test1354 | 20 +- tests/data/test1355 | 20 +- tests/data/test1356 | 20 +- tests/data/test1357 | 20 +- tests/data/test1358 | 20 +- tests/data/test1359 | 20 +- tests/data/test136 | 18 +- tests/data/test1360 | 20 +- tests/data/test1361 | 20 +- tests/data/test1362 | 20 +- tests/data/test1363 | 20 +- tests/data/test1364 | 12 +- tests/data/test1365 | 12 +- tests/data/test1366 | 12 +- tests/data/test1367 | 12 +- tests/data/test1368 | 12 +- tests/data/test1369 | 12 +- tests/data/test137 | 22 +- tests/data/test1370 | 12 +- tests/data/test1371 | 12 +- tests/data/test1372 | 12 +- tests/data/test1373 | 12 +- tests/data/test1374 | 12 +- tests/data/test1375 | 12 +- tests/data/test1376 | 12 +- tests/data/test1377 | 12 +- tests/data/test1378 | 20 +- tests/data/test1379 | 20 +- tests/data/test138 | 22 +- tests/data/test1380 | 20 +- tests/data/test1381 | 20 +- tests/data/test1382 | 20 +- tests/data/test1383 | 20 +- tests/data/test1384 | 20 +- tests/data/test1385 | 20 +- tests/data/test1386 | 20 +- tests/data/test1387 | 20 +- tests/data/test1388 | 20 +- tests/data/test1389 | 20 +- tests/data/test139 | 22 +- tests/data/test1390 | 20 +- tests/data/test1391 | 20 +- tests/data/test1392 | 20 +- tests/data/test1393 | 20 +- tests/data/test14 | 12 +- tests/data/test140 | 14 +- tests/data/test1400 | 12 +- tests/data/test1401 | 20 +- tests/data/test1402 | 16 +- tests/data/test1403 | 12 +- tests/data/test1405 | 30 +-- tests/data/test1406 | 26 +- tests/data/test1407 | 12 +- tests/data/test1408 | 24 +- tests/data/test141 | 20 +- tests/data/test1411 | 14 +- tests/data/test1412 | 46 ++-- tests/data/test1413 | 22 +- tests/data/test1415 | 14 +- tests/data/test1416 | 12 +- tests/data/test1417 | 12 +- tests/data/test142 | 318 +++++++++++----------- tests/data/test1420 | 12 +- tests/data/test1422 | 12 +- tests/data/test1423 | 12 +- tests/data/test1424 | 14 +- tests/data/test1425 | 12 +- tests/data/test1426 | 12 +- tests/data/test1428 | 16 +- tests/data/test1429 | 12 +- tests/data/test143 | 22 +- tests/data/test1430 | 12 +- tests/data/test1431 | 12 +- tests/data/test1432 | 12 +- tests/data/test1433 | 12 +- tests/data/test1434 | 14 +- tests/data/test1435 | 12 +- tests/data/test1436 | 32 +-- tests/data/test1437 | 24 +- tests/data/test1438 | 12 +- tests/data/test1439 | 12 +- tests/data/test144 | 16 +- tests/data/test1443 | 12 +- tests/data/test1444 | 20 +- tests/data/test1448 | 22 +- tests/data/test1449 | 12 +- tests/data/test145 | 16 +- tests/data/test1455 | 16 +- tests/data/test1456 | 14 +- tests/data/test1457 | 12 +- tests/data/test1458 | 12 +- tests/data/test146 | 32 +-- tests/data/test1465 | 16 +- tests/data/test1466 | 12 +- tests/data/test1467 | 12 +- tests/data/test1468 | 12 +- tests/data/test147 | 28 +- tests/data/test1470 | 12 +- tests/data/test1473 | 12 +- tests/data/test1475 | 14 +- tests/data/test1479 | 22 +- tests/data/test148 | 16 +- tests/data/test1480 | 12 +- tests/data/test1481 | 14 +- tests/data/test1482 | 12 +- tests/data/test1483 | 12 +- tests/data/test1484 | 12 +- tests/data/test1485 | 10 +- tests/data/test1487 | 12 +- tests/data/test149 | 26 +- tests/data/test1492 | 12 +- tests/data/test1493 | 12 +- tests/data/test1494 | 12 +- tests/data/test1495 | 12 +- tests/data/test1496 | 12 +- tests/data/test1497 | 22 +- tests/data/test1499 | 22 +- tests/data/test15 | 12 +- tests/data/test150 | 26 +- tests/data/test1501 | 18 +- tests/data/test1502 | 10 +- tests/data/test1503 | 10 +- tests/data/test1504 | 10 +- tests/data/test1505 | 10 +- tests/data/test1506 | 82 +++--- tests/data/test1507 | 10 +- tests/data/test151 | 12 +- tests/data/test1510 | 34 +-- tests/data/test1512 | 18 +- tests/data/test1513 | 2 - tests/data/test1514 | 40 +-- tests/data/test1517 | 14 +- tests/data/test1518 | 2 - tests/data/test1519 | 2 - tests/data/test152 | 12 +- tests/data/test1520 | 36 +-- tests/data/test153 | 58 ++-- tests/data/test1531 | 14 +- tests/data/test1532 | 10 +- tests/data/test1533 | 50 ++-- tests/data/test1534 | 10 +- tests/data/test1535 | 10 +- tests/data/test1536 | 10 +- tests/data/test1540 | 10 +- tests/data/test1541 | 10 +- tests/data/test1542 | 34 +-- tests/data/test1543 | 18 +- tests/data/test1546 | 16 +- tests/data/test1547 | 18 +- tests/data/test1551 | 34 +-- tests/data/test1552 | 2 - tests/data/test1553 | 2 - tests/data/test1555 | 2 - tests/data/test1556 | 10 +- tests/data/test1561 | 22 +- tests/data/test1562 | 34 +-- tests/data/test1563 | 12 +- tests/data/test1566 | 14 +- tests/data/test1567 | 34 +-- tests/data/test1568 | 24 +- tests/data/test1569 | 26 +- tests/data/test157 | 12 +- tests/data/test1570 | 26 +- tests/data/test1571 | 2 +- tests/data/test1572 | 2 +- tests/data/test1575 | 2 +- tests/data/test1576 | 2 +- tests/data/test1577 | 2 +- tests/data/test1578 | 2 +- tests/data/test158 | 26 +- tests/data/test1580 | 2 +- tests/data/test1581 | 2 +- tests/data/test1582 | 10 +- tests/data/test159 | 14 +- tests/data/test1591 | 30 +-- tests/data/test1593 | 10 +- tests/data/test1594 | 10 +- tests/data/test1595 | 10 +- tests/data/test1596 | 10 +- tests/data/test1598 | 28 +- tests/data/test16 | 16 +- tests/data/test160 | 22 +- tests/data/test161 | 16 +- tests/data/test1613 | 16 +- tests/data/test1617 | 18 +- tests/data/test162 | 16 +- tests/data/test1631 | 18 +- tests/data/test1632 | 24 +- tests/data/test1633 | 50 ++-- tests/data/test1634 | 22 +- tests/data/test1635 | 22 +- tests/data/test164 | 14 +- tests/data/test165 | 26 +- tests/data/test167 | 32 +-- tests/data/test1670 | 12 +- tests/data/test168 | 44 +-- tests/data/test169 | 44 +-- tests/data/test17 | 12 +- tests/data/test170 | 18 +- tests/data/test1700 | 22 +- tests/data/test1701 | 16 +- tests/data/test1702 | 12 +- tests/data/test1704 | 18 +- tests/data/test171 | 14 +- tests/data/test1711 | 12 +- tests/data/test172 | 14 +- tests/data/test174 | 16 +- tests/data/test175 | 30 +-- tests/data/test176 | 32 +-- tests/data/test177 | 16 +- tests/data/test178 | 12 +- tests/data/test179 | 16 +- tests/data/test1800 | 18 +- tests/data/test1801 | 18 +- tests/data/test182 | 18 +- tests/data/test183 | 26 +- tests/data/test184 | 26 +- tests/data/test185 | 26 +- tests/data/test186 | 38 +-- tests/data/test187 | 22 +- tests/data/test188 | 26 +- tests/data/test189 | 26 +- tests/data/test190 | 10 +- tests/data/test1904 | 12 +- tests/data/test1905 | 10 +- tests/data/test1906 | 10 +- tests/data/test1907 | 10 +- tests/data/test1908 | 18 +- tests/data/test1909 | 22 +- tests/data/test191 | 18 +- tests/data/test1910 | 22 +- tests/data/test1919 | 22 +- tests/data/test192 | 12 +- tests/data/test193 | 22 +- tests/data/test1933 | 12 +- tests/data/test1934 | 12 +- tests/data/test1935 | 12 +- tests/data/test1936 | 12 +- tests/data/test1937 | 14 +- tests/data/test195 | 6 +- tests/data/test1955 | 20 +- tests/data/test1956 | 14 +- tests/data/test1957 | 14 +- tests/data/test1958 | 14 +- tests/data/test1959 | 14 +- tests/data/test196 | 10 +- tests/data/test1964 | 12 +- tests/data/test197 | 22 +- tests/data/test1970 | 16 +- tests/data/test1971 | 22 +- tests/data/test1972 | 26 +- tests/data/test1974 | 14 +- tests/data/test1975 | 22 +- tests/data/test1977 | 26 +- tests/data/test198 | 22 +- tests/data/test199 | 22 +- tests/data/test2 | 14 +- tests/data/test2005 | 14 +- tests/data/test2023 | 52 ++-- tests/data/test2024 | 52 ++-- tests/data/test2025 | 82 +++--- tests/data/test2026 | 68 ++--- tests/data/test2027 | 78 +++--- tests/data/test2028 | 98 +++---- tests/data/test2029 | 72 ++--- tests/data/test2030 | 82 +++--- tests/data/test2031 | 102 +++---- tests/data/test2032 | 42 +-- tests/data/test2033 | 12 +- tests/data/test2034 | 12 +- tests/data/test2037 | 12 +- tests/data/test2039 | 16 +- tests/data/test2040 | 24 +- tests/data/test2041 | 12 +- tests/data/test2046 | 22 +- tests/data/test2047 | 26 +- tests/data/test2049 | 42 +-- tests/data/test2050 | 12 +- tests/data/test2051 | 32 +-- tests/data/test2052 | 22 +- tests/data/test2053 | 22 +- tests/data/test2054 | 42 +-- tests/data/test2055 | 12 +- tests/data/test2056 | 14 +- tests/data/test2057 | 26 +- tests/data/test2061 | 24 +- tests/data/test2062 | 24 +- tests/data/test2063 | 24 +- tests/data/test2064 | 24 +- tests/data/test2065 | 24 +- tests/data/test2066 | 24 +- tests/data/test2067 | 32 +-- tests/data/test2068 | 32 +-- tests/data/test2069 | 32 +-- tests/data/test207 | 12 +- tests/data/test2070 | 12 +- tests/data/test2073 | 42 +-- tests/data/test2074 | 14 +- tests/data/test2076 | 24 +- tests/data/test2078 | 16 +- tests/data/test2079 | 12 +- tests/data/test2081 | 28 +- tests/data/test2087 | 12 +- tests/data/test2088 | 12 +- tests/data/test2089 | 12 +- tests/data/test209 | 36 +-- tests/data/test210 | 28 +- tests/data/test2100 | 82 +++--- tests/data/test211 | 30 +-- tests/data/test213 | 40 +-- tests/data/test214 | 12 +- tests/data/test215 | 26 +- tests/data/test216 | 26 +- tests/data/test217 | 12 +- tests/data/test22 | 12 +- tests/data/test220 | 14 +- tests/data/test221 | 14 +- tests/data/test222 | 14 +- tests/data/test223 | 14 +- tests/data/test224 | 14 +- tests/data/test227 | 30 +-- tests/data/test228 | 20 +- tests/data/test229 | 8 +- tests/data/test230 | 14 +- tests/data/test2300 | 20 +- tests/data/test2301 | 20 +- tests/data/test2302 | 20 +- tests/data/test2303 | 20 +- tests/data/test2304 | 2 +- tests/data/test2306 | 18 +- tests/data/test2308 | 10 +- tests/data/test2309 | 14 +- tests/data/test232 | 14 +- tests/data/test233 | 32 +-- tests/data/test234 | 34 +-- tests/data/test235 | 18 +- tests/data/test236 | 18 +- tests/data/test237 | 10 +- tests/data/test238 | 12 +- tests/data/test239 | 38 +-- tests/data/test24 | 12 +- tests/data/test240 | 12 +- tests/data/test2401 | 20 +- tests/data/test2404 | 46 ++-- tests/data/test2405 | 2 - tests/data/test241 | 12 +- tests/data/test242 | 14 +- tests/data/test243 | 54 ++-- tests/data/test244 | 16 +- tests/data/test245 | 32 +-- tests/data/test246 | 32 +-- tests/data/test247 | 12 +- tests/data/test248 | 18 +- tests/data/test249 | 14 +- tests/data/test25 | 62 ++--- tests/data/test250 | 16 +- tests/data/test2501 | 18 +- tests/data/test2502 | 46 ++-- tests/data/test251 | 16 +- tests/data/test252 | 16 +- tests/data/test254 | 16 +- tests/data/test256 | 18 +- tests/data/test257 | 42 +-- tests/data/test26 | 12 +- tests/data/test260 | 12 +- tests/data/test261 | 18 +- tests/data/test262 | 12 +- tests/data/test263 | 14 +- tests/data/test264 | 16 +- tests/data/test265 | 40 +-- tests/data/test266 | 12 +- tests/data/test267 | 42 +-- tests/data/test269 | 12 +- tests/data/test27 | 36 +-- tests/data/test270 | 18 +- tests/data/test273 | 24 +- tests/data/test274 | 12 +- tests/data/test276 | 22 +- tests/data/test277 | 26 +- tests/data/test278 | 16 +- tests/data/test279 | 16 +- tests/data/test28 | 22 +- tests/data/test280 | 20 +- tests/data/test282 | 12 +- tests/data/test287 | 12 +- tests/data/test29 | 12 +- tests/data/test290 | 16 +- tests/data/test291 | 18 +- tests/data/test292 | 12 +- tests/data/test293 | 12 +- tests/data/test294 | 20 +- tests/data/test295 | 6 +- tests/data/test296 | 24 +- tests/data/test297 | 20 +- tests/data/test298 | 18 +- tests/data/test299 | 16 +- tests/data/test3 | 18 +- tests/data/test30 | 12 +- tests/data/test300 | 12 +- tests/data/test3000 | 12 +- tests/data/test3001 | 12 +- tests/data/test3002 | 32 +-- tests/data/test3003 | 32 +-- tests/data/test3004 | 32 +-- tests/data/test3005 | 32 +-- tests/data/test3006 | 18 +- tests/data/test3007 | 10 +- tests/data/test3008 | 12 +- tests/data/test3009 | 12 +- tests/data/test301 | 14 +- tests/data/test3011 | 12 +- tests/data/test3012 | 12 +- tests/data/test3013 | 22 +- tests/data/test3014 | 12 +- tests/data/test3015 | 22 +- tests/data/test3023 | 12 +- tests/data/test3024 | 12 +- tests/data/test3027 | 20 +- tests/data/test3028 | 14 +- tests/data/test303 | 12 +- tests/data/test3031 | 12 +- tests/data/test3032 | 42 +-- tests/data/test3035 | 60 ++--- tests/data/test306 | 12 +- tests/data/test307 | 12 +- tests/data/test309 | 22 +- tests/data/test31 | 12 +- tests/data/test310 | 12 +- tests/data/test3100 | 20 +- tests/data/test3101 | 20 +- tests/data/test3102 | 10 +- tests/data/test314 | 14 +- tests/data/test315 | 14 +- tests/data/test316 | 14 +- tests/data/test317 | 32 +-- tests/data/test318 | 34 +-- tests/data/test319 | 12 +- tests/data/test320 | 2 - tests/data/test3201 | 16 +- tests/data/test3202 | 14 +- tests/data/test3204 | 14 +- tests/data/test3206 | 12 +- tests/data/test3215 | 24 +- tests/data/test325 | 12 +- tests/data/test326 | 12 +- tests/data/test327 | 24 +- tests/data/test328 | 12 +- tests/data/test329 | 26 +- tests/data/test330 | 28 +- tests/data/test331 | 28 +- tests/data/test334 | 12 +- tests/data/test335 | 44 +-- tests/data/test336 | 24 +- tests/data/test337 | 24 +- tests/data/test339 | 12 +- tests/data/test34 | 12 +- tests/data/test340 | 8 +- tests/data/test341 | 14 +- tests/data/test342 | 14 +- tests/data/test343 | 14 +- tests/data/test344 | 14 +- tests/data/test345 | 14 +- tests/data/test346 | 18 +- tests/data/test347 | 12 +- tests/data/test348 | 16 +- tests/data/test349 | 12 +- tests/data/test350 | 18 +- tests/data/test351 | 16 +- tests/data/test352 | 18 +- tests/data/test353 | 16 +- tests/data/test354 | 16 +- tests/data/test355 | 12 +- tests/data/test356 | 12 +- tests/data/test36 | 12 +- tests/data/test361 | 22 +- tests/data/test362 | 18 +- tests/data/test363 | 16 +- tests/data/test365 | 12 +- tests/data/test366 | 12 +- tests/data/test367 | 14 +- tests/data/test368 | 14 +- tests/data/test369 | 12 +- tests/data/test37 | 12 +- tests/data/test371 | 12 +- tests/data/test372 | 12 +- tests/data/test373 | 12 +- tests/data/test374 | 12 +- tests/data/test376 | 12 +- tests/data/test379 | 12 +- tests/data/test38 | 14 +- tests/data/test380 | 16 +- tests/data/test381 | 16 +- tests/data/test383 | 16 +- tests/data/test385 | 16 +- tests/data/test386 | 26 +- tests/data/test387 | 16 +- tests/data/test389 | 12 +- tests/data/test391 | 22 +- tests/data/test392 | 24 +- tests/data/test393 | 12 +- tests/data/test394 | 12 +- tests/data/test395 | 12 +- tests/data/test396 | 14 +- tests/data/test397 | 14 +- tests/data/test398 | 12 +- tests/data/test4 | 38 +-- tests/data/test40 | 22 +- tests/data/test400 | 20 +- tests/data/test4000 | 12 +- tests/data/test401 | 20 +- tests/data/test402 | 6 +- tests/data/test403 | 22 +- tests/data/test406 | 20 +- tests/data/test407 | 32 +-- tests/data/test408 | 26 +- tests/data/test409 | 20 +- tests/data/test410 | 14 +- tests/data/test412 | 14 +- tests/data/test413 | 14 +- tests/data/test414 | 34 +-- tests/data/test415 | 12 +- tests/data/test416 | 16 +- tests/data/test417 | 12 +- tests/data/test42 | 22 +- tests/data/test43 | 26 +- tests/data/test430 | 50 ++-- tests/data/test431 | 50 ++-- tests/data/test432 | 50 ++-- tests/data/test433 | 18 +- tests/data/test434 | 12 +- tests/data/test435 | 22 +- tests/data/test436 | 18 +- tests/data/test437 | 12 +- tests/data/test440 | 12 +- tests/data/test441 | 12 +- tests/data/test442 | 14 +- tests/data/test443 | 14 +- tests/data/test444 | 12 +- tests/data/test45 | 22 +- tests/data/test457 | 12 +- tests/data/test46 | 14 +- tests/data/test47 | 12 +- tests/data/test471 | 22 +- tests/data/test473 | 12 +- tests/data/test475 | 16 +- tests/data/test476 | 16 +- tests/data/test477 | 22 +- tests/data/test478 | 16 +- tests/data/test479 | 30 +-- tests/data/test483 | 8 +- tests/data/test486 | 28 +- tests/data/test49 | 22 +- tests/data/test493 | 12 +- tests/data/test494 | 18 +- tests/data/test495 | 14 +- tests/data/test5 | 14 +- tests/data/test50 | 22 +- tests/data/test500 | 10 +- tests/data/test505 | 20 +- tests/data/test51 | 22 +- tests/data/test510 | 36 +-- tests/data/test511 | 16 +- tests/data/test512 | 10 +- tests/data/test514 | 10 +- tests/data/test515 | 14 +- tests/data/test516 | 12 +- tests/data/test518 | 10 +- tests/data/test519 | 22 +- tests/data/test52 | 22 +- tests/data/test520 | 20 +- tests/data/test521 | 18 +- tests/data/test522 | 12 +- tests/data/test523 | 14 +- tests/data/test524 | 8 +- tests/data/test525 | 18 +- tests/data/test526 | 38 +-- tests/data/test527 | 38 +-- tests/data/test528 | 34 +-- tests/data/test529 | 18 +- tests/data/test53 | 14 +- tests/data/test530 | 2 - tests/data/test531 | 18 +- tests/data/test532 | 38 +-- tests/data/test533 | 26 +- tests/data/test534 | 20 +- tests/data/test535 | 18 +- tests/data/test537 | 10 +- tests/data/test538 | 6 +- tests/data/test539 | 30 +-- tests/data/test54 | 12 +- tests/data/test541 | 20 +- tests/data/test542 | 16 +- tests/data/test546 | 26 +- tests/data/test549 | 12 +- tests/data/test55 | 22 +- tests/data/test550 | 12 +- tests/data/test556 | 8 +- tests/data/test56 | 24 +- tests/data/test560 | 10 +- tests/data/test561 | 12 +- tests/data/test562 | 16 +- tests/data/test563 | 12 +- tests/data/test564 | 20 +- tests/data/test565 | 54 ++-- tests/data/test566 | 10 +- tests/data/test567 | 12 +- tests/data/test569 | 50 ++-- tests/data/test57 | 12 +- tests/data/test570 | 24 +- tests/data/test573 | 10 +- tests/data/test574 | 78 +++--- tests/data/test575 | 122 ++++----- tests/data/test580 | 10 +- tests/data/test581 | 10 +- tests/data/test584 | 34 +-- tests/data/test585 | 10 +- tests/data/test586 | 18 +- tests/data/test589 | 12 +- tests/data/test59 | 12 +- tests/data/test590 | 36 +-- tests/data/test595 | 18 +- tests/data/test597 | 8 +- tests/data/test598 | 24 +- tests/data/test6 | 14 +- tests/data/test61 | 12 +- tests/data/test62 | 26 +- tests/data/test627 | 2 - tests/data/test63 | 16 +- tests/data/test64 | 24 +- tests/data/test644 | 22 +- tests/data/test646 | 12 +- tests/data/test647 | 10 +- tests/data/test648 | 52 ++-- tests/data/test649 | 10 +- tests/data/test65 | 24 +- tests/data/test650 | 14 +- tests/data/test651 | 24 +- tests/data/test652 | 632 ++++++++++++++++++++++---------------------- tests/data/test653 | 46 ++-- tests/data/test658 | 10 +- tests/data/test659 | 12 +- tests/data/test66 | 12 +- tests/data/test660 | 4 +- tests/data/test661 | 70 ++--- tests/data/test662 | 26 +- tests/data/test663 | 26 +- tests/data/test667 | 44 +-- tests/data/test669 | 34 +-- tests/data/test67 | 26 +- tests/data/test670 | 24 +- tests/data/test671 | 24 +- tests/data/test672 | 24 +- tests/data/test673 | 24 +- tests/data/test674 | 18 +- tests/data/test675 | 26 +- tests/data/test676 | 24 +- tests/data/test677 | 6 +- tests/data/test678 | 12 +- tests/data/test679 | 14 +- tests/data/test68 | 26 +- tests/data/test681 | 12 +- tests/data/test682 | 14 +- tests/data/test683 | 14 +- tests/data/test684 | 14 +- tests/data/test685 | 14 +- tests/data/test687 | 12 +- tests/data/test688 | 12 +- tests/data/test689 | 12 +- tests/data/test69 | 36 +-- tests/data/test693 | 12 +- tests/data/test695 | 62 ++--- tests/data/test696 | 14 +- tests/data/test698 | 26 +- tests/data/test7 | 12 +- tests/data/test70 | 24 +- tests/data/test700 | 12 +- tests/data/test701 | 12 +- tests/data/test706 | 16 +- tests/data/test707 | 16 +- tests/data/test708 | 12 +- tests/data/test709 | 12 +- tests/data/test710 | 12 +- tests/data/test711 | 18 +- tests/data/test712 | 18 +- tests/data/test713 | 18 +- tests/data/test714 | 18 +- tests/data/test715 | 18 +- tests/data/test717 | 12 +- tests/data/test718 | 12 +- tests/data/test719 | 12 +- tests/data/test72 | 24 +- tests/data/test720 | 12 +- tests/data/test721 | 12 +- tests/data/test73 | 12 +- tests/data/test74 | 22 +- tests/data/test742 | 12 +- tests/data/test744 | 12 +- tests/data/test753 | 20 +- tests/data/test754 | 28 +- tests/data/test756 | 22 +- tests/data/test757 | 62 ++--- tests/data/test762 | 12 +- tests/data/test77 | 14 +- tests/data/test775 | 14 +- tests/data/test78 | 14 +- tests/data/test79 | 14 +- tests/data/test794 | 2 +- tests/data/test796 | 2 +- tests/data/test797 | 2 +- tests/data/test799 | 12 +- tests/data/test8 | 14 +- tests/data/test80 | 12 +- tests/data/test800 | 12 +- tests/data/test801 | 12 +- tests/data/test802 | 12 +- tests/data/test803 | 10 +- tests/data/test804 | 14 +- tests/data/test805 | 30 +-- tests/data/test806 | 10 +- tests/data/test807 | 10 +- tests/data/test808 | 10 +- tests/data/test809 | 10 +- tests/data/test81 | 30 +-- tests/data/test810 | 12 +- tests/data/test811 | 10 +- tests/data/test812 | 10 +- tests/data/test813 | 10 +- tests/data/test814 | 12 +- tests/data/test815 | 14 +- tests/data/test816 | 14 +- tests/data/test817 | 10 +- tests/data/test818 | 10 +- tests/data/test819 | 14 +- tests/data/test82 | 16 +- tests/data/test820 | 16 +- tests/data/test821 | 14 +- tests/data/test822 | 16 +- tests/data/test823 | 16 +- tests/data/test824 | 14 +- tests/data/test825 | 12 +- tests/data/test826 | 14 +- tests/data/test827 | 14 +- tests/data/test828 | 12 +- tests/data/test83 | 14 +- tests/data/test830 | 8 +- tests/data/test831 | 10 +- tests/data/test832 | 8 +- tests/data/test833 | 18 +- tests/data/test834 | 20 +- tests/data/test835 | 18 +- tests/data/test836 | 22 +- tests/data/test837 | 14 +- tests/data/test838 | 14 +- tests/data/test839 | 12 +- tests/data/test84 | 16 +- tests/data/test840 | 12 +- tests/data/test841 | 12 +- tests/data/test842 | 14 +- tests/data/test843 | 12 +- tests/data/test844 | 8 +- tests/data/test845 | 8 +- tests/data/test846 | 10 +- tests/data/test847 | 12 +- tests/data/test848 | 14 +- tests/data/test849 | 8 +- tests/data/test85 | 18 +- tests/data/test850 | 12 +- tests/data/test851 | 12 +- tests/data/test852 | 12 +- tests/data/test853 | 12 +- tests/data/test854 | 12 +- tests/data/test855 | 12 +- tests/data/test856 | 8 +- tests/data/test857 | 12 +- tests/data/test858 | 12 +- tests/data/test859 | 12 +- tests/data/test86 | 32 +-- tests/data/test860 | 12 +- tests/data/test861 | 12 +- tests/data/test862 | 12 +- tests/data/test863 | 12 +- tests/data/test864 | 10 +- tests/data/test865 | 12 +- tests/data/test866 | 14 +- tests/data/test867 | 12 +- tests/data/test868 | 14 +- tests/data/test869 | 14 +- tests/data/test870 | 12 +- tests/data/test871 | 10 +- tests/data/test872 | 12 +- tests/data/test873 | 12 +- tests/data/test874 | 10 +- tests/data/test876 | 8 +- tests/data/test877 | 10 +- tests/data/test878 | 8 +- tests/data/test879 | 16 +- tests/data/test880 | 18 +- tests/data/test881 | 16 +- tests/data/test882 | 22 +- tests/data/test883 | 12 +- tests/data/test884 | 12 +- tests/data/test885 | 10 +- tests/data/test886 | 10 +- tests/data/test887 | 12 +- tests/data/test888 | 10 +- tests/data/test889 | 10 +- tests/data/test89 | 50 ++-- tests/data/test890 | 8 +- tests/data/test891 | 8 +- tests/data/test892 | 12 +- tests/data/test893 | 8 +- tests/data/test895 | 12 +- tests/data/test897 | 12 +- tests/data/test898 | 30 +-- tests/data/test90 | 70 ++--- tests/data/test900 | 12 +- tests/data/test901 | 36 +-- tests/data/test902 | 26 +- tests/data/test903 | 22 +- tests/data/test904 | 24 +- tests/data/test905 | 22 +- tests/data/test906 | 24 +- tests/data/test907 | 24 +- tests/data/test908 | 22 +- tests/data/test909 | 24 +- tests/data/test91 | 36 +-- tests/data/test910 | 24 +- tests/data/test911 | 16 +- tests/data/test912 | 24 +- tests/data/test913 | 8 +- tests/data/test914 | 8 +- tests/data/test915 | 24 +- tests/data/test916 | 10 +- tests/data/test917 | 32 +-- tests/data/test918 | 12 +- tests/data/test919 | 20 +- tests/data/test92 | 58 ++-- tests/data/test920 | 22 +- tests/data/test921 | 22 +- tests/data/test922 | 20 +- tests/data/test923 | 8 +- tests/data/test924 | 8 +- tests/data/test925 | 8 +- tests/data/test926 | 8 +- tests/data/test927 | 8 +- tests/data/test928 | 8 +- tests/data/test929 | 8 +- tests/data/test93 | 14 +- tests/data/test930 | 8 +- tests/data/test932 | 8 +- tests/data/test933 | 10 +- tests/data/test934 | 8 +- tests/data/test935 | 26 +- tests/data/test936 | 28 +- tests/data/test937 | 26 +- tests/data/test938 | 36 +-- tests/data/test939 | 20 +- tests/data/test94 | 12 +- tests/data/test940 | 18 +- tests/data/test941 | 40 +-- tests/data/test942 | 22 +- tests/data/test943 | 22 +- tests/data/test944 | 20 +- tests/data/test945 | 20 +- tests/data/test946 | 22 +- tests/data/test947 | 20 +- tests/data/test948 | 10 +- tests/data/test949 | 8 +- tests/data/test950 | 8 +- tests/data/test951 | 18 +- tests/data/test952 | 18 +- tests/data/test953 | 22 +- tests/data/test954 | 8 +- tests/data/test955 | 8 +- tests/data/test956 | 10 +- tests/data/test957 | 8 +- tests/data/test958 | 8 +- tests/data/test959 | 8 +- tests/data/test960 | 10 +- tests/data/test961 | 8 +- tests/data/test962 | 24 +- tests/data/test963 | 24 +- tests/data/test964 | 8 +- tests/data/test965 | 24 +- tests/data/test966 | 24 +- tests/data/test967 | 8 +- tests/data/test968 | 8 +- tests/data/test969 | 16 +- tests/data/test973 | 34 +-- tests/data/test974 | 28 +- tests/data/test975 | 34 +-- tests/data/test976 | 30 +-- tests/data/test980 | 6 +- tests/data/test981 | 6 +- tests/data/test982 | 6 +- tests/data/test983 | 4 +- tests/data/test984 | 4 +- tests/data/test987 | 24 +- tests/data/test988 | 28 +- tests/data/test989 | 12 +- tests/data/test99 | 14 +- tests/data/test992 | 22 +- tests/data/test993 | 12 +- tests/data/test997 | 22 +- tests/data/test998 | 30 +-- tests/data/test999 | 28 +- 1182 files changed, 11433 insertions(+), 11453 deletions(-) diff --git a/tests/data/test100 b/tests/data/test100 index b7554383ea30..152633ba8016 100644 --- a/tests/data/test100 +++ b/tests/data/test100 @@ -41,15 +41,15 @@ ftp://%HOSTIP:%FTPPORT/test-%TESTNUMBER/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD test-%TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD test-%TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1000 b/tests/data/test1000 index fe94010ac313..e679207d304c 100644 --- a/tests/data/test1000 +++ b/tests/data/test1000 @@ -31,12 +31,12 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ -I # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD %TESTNUMBER +QUIT diff --git a/tests/data/test1003 b/tests/data/test1003 index c4a1bb001af7..a4104d216bc2 100644 --- a/tests/data/test1003 +++ b/tests/data/test1003 @@ -33,16 +33,16 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1004 b/tests/data/test1004 index 33faaafb197b..d7c0ae51760a 100644 --- a/tests/data/test1004 +++ b/tests/data/test1004 @@ -46,12 +46,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy "" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1005 b/tests/data/test1005 index 1827fbdc8cad..356de5a55636 100644 --- a/tests/data/test1005 +++ b/tests/data/test1005 @@ -33,16 +33,16 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1006 b/tests/data/test1006 index 13d426d05395..a714a899bc1c 100644 --- a/tests/data/test1006 +++ b/tests/data/test1006 @@ -34,16 +34,16 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test101 b/tests/data/test101 index 3febc5e72aa5..6f0d79efce0e 100644 --- a/tests/data/test101 +++ b/tests/data/test101 @@ -43,14 +43,14 @@ ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -PORT 127,0,0,1,243,212 -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +PORT 127,0,0,1,243,212 +TYPE A +LIST +QUIT diff --git a/tests/data/test1010 b/tests/data/test1010 index d45efdc8a5e4..7f5701d32e73 100644 --- a/tests/data/test1010 +++ b/tests/data/test1010 @@ -42,16 +42,16 @@ ftp://%HOSTIP:%FTPPORT//list/this/path/%TESTNUMBER/ ftp://%HOSTIP:%FTPPORT//list # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST /list/this/path/%TESTNUMBER -EPSV -LIST /list/this/path/%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST /list/this/path/%TESTNUMBER +EPSV +LIST /list/this/path/%TESTNUMBER +QUIT diff --git a/tests/data/test1011 b/tests/data/test1011 index d6a3d1aa7d07..0ef87ae1a6b8 100644 --- a/tests/data/test1011 +++ b/tests/data/test1011 @@ -56,19 +56,19 @@ http://%HOSTIP:%HTTPPORT/blah/%TESTNUMBER -L -d "moo" # # Verify data after the test has been "shot" - -POST /blah/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooGET /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +POST /blah/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooGET /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1012 b/tests/data/test1012 index da6ec61922d0..5ced62b24d48 100644 --- a/tests/data/test1012 +++ b/tests/data/test1012 @@ -56,21 +56,21 @@ http://%HOSTIP:%HTTPPORT/blah/%TESTNUMBER -L -d "moo" --post301 # # Verify data after the test has been "shot" - -POST /blah/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - + +POST /blah/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + moo diff --git a/tests/data/test1015 b/tests/data/test1015 index fc26149121d6..52a7d3e9572e 100644 --- a/tests/data/test1015 +++ b/tests/data/test1015 @@ -38,14 +38,14 @@ content to _?!#$'|<> # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 119 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 119 +Content-Type: application/x-www-form-urlencoded + my+name+is+moo%5B%5D&y e s=s_i_r&v_alue=content+to+_%3F%21%23%24%27%7C%3C%3E%0A&content+to+_%3F%21%23%24%27%7C%3C%3E%0A diff --git a/tests/data/test102 b/tests/data/test102 index 7037986f46a9..99fda2dcc9cd 100644 --- a/tests/data/test102 +++ b/tests/data/test102 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1021 b/tests/data/test1021 index bb34615fd611..25fb2bfc3c1d 100644 --- a/tests/data/test1021 +++ b/tests/data/test1021 @@ -106,29 +106,29 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1024 b/tests/data/test1024 index 55deec98bbdb..24c5e6ca67eb 100644 --- a/tests/data/test1024 +++ b/tests/data/test1024 @@ -84,23 +84,23 @@ cookies # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /data/%TESTNUMBER0002.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/%TESTNUMBER0003.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: firstcookie=want - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /data/%TESTNUMBER0002.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/%TESTNUMBER0003.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: firstcookie=want + diff --git a/tests/data/test1025 b/tests/data/test1025 index 762e34a8354e..c08a157d570c 100644 --- a/tests/data/test1025 +++ b/tests/data/test1025 @@ -84,25 +84,25 @@ cookies # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: forcedcookie=yes - -GET /data/%TESTNUMBER0002.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: forcedcookie=yes - -GET /want/%TESTNUMBER0003.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: firstcookie=want; forcedcookie=yes - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: forcedcookie=yes + +GET /data/%TESTNUMBER0002.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: forcedcookie=yes + +GET /want/%TESTNUMBER0003.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: firstcookie=want; forcedcookie=yes + diff --git a/tests/data/test1028 b/tests/data/test1028 index 3e36597322fd..81728c686467 100644 --- a/tests/data/test1028 +++ b/tests/data/test1028 @@ -52,20 +52,20 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -L # # Verify data after the test has been "shot" - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 -QUIT + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER0002 +RETR %TESTNUMBER0002 +QUIT HTTP/1.1 302 OK diff --git a/tests/data/test1029 b/tests/data/test1029 index da393cb41b82..f37146a74787 100644 --- a/tests/data/test1029 +++ b/tests/data/test1029 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url} %{url} %{ex # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 301 This is a weirdo text message swsclose diff --git a/tests/data/test103 b/tests/data/test103 index 52e5645bc0ea..d6283c62bb5e 100644 --- a/tests/data/test103 +++ b/tests/data/test103 @@ -38,17 +38,17 @@ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER -P - ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -PORT 127,0,0,1,0,0 -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +PORT 127,0,0,1,0,0 +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1031 b/tests/data/test1031 index 305a0f7eb57e..39f374b05807 100644 --- a/tests/data/test1031 +++ b/tests/data/test1031 @@ -59,17 +59,17 @@ http://%HOSTIP:%HTTPPORT/want/this/%TESTNUMBER -L # Verify data after the test has been "shot" - -GET /want/this/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/this/%TESTNUMBER?coolsite=yes/%TESTNUMBER0002.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/this/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/this/%TESTNUMBER?coolsite=yes/%TESTNUMBER0002.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1032 b/tests/data/test1032 index 5456542ae3ed..d6d4f9ec4c64 100644 --- a/tests/data/test1032 +++ b/tests/data/test1032 @@ -42,13 +42,13 @@ HTTP HEAD with --range # # Verify data after the test has been "shot" - -HEAD /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=1-3 -User-Agent: curl/%VERSION -Accept: */* - + +HEAD /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=1-3 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1033 b/tests/data/test1033 index b19bf1ce96fd..460e7f8806ba 100644 --- a/tests/data/test1033 +++ b/tests/data/test1033 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1036 b/tests/data/test1036 index f777a6ff7dd7..b5aeea8dd998 100644 --- a/tests/data/test1036 +++ b/tests/data/test1036 @@ -40,17 +40,17 @@ This is the start!! # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -REST 20 -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +REST 20 +RETR %TESTNUMBER +QUIT This is the start!! diff --git a/tests/data/test1037 b/tests/data/test1037 index 18c9e5266a40..d540a003737d 100644 --- a/tests/data/test1037 +++ b/tests/data/test1037 @@ -39,16 +39,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C - # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1038 b/tests/data/test1038 index c2e60a0a4994..294c7b94c16b 100644 --- a/tests/data/test1038 +++ b/tests/data/test1038 @@ -34,15 +34,15 @@ worx? # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -APPE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +APPE %TESTNUMBER +QUIT cr@p******** that we're gonna upload diff --git a/tests/data/test1039 b/tests/data/test1039 index a032c2f9ab5c..6637c5721bd5 100644 --- a/tests/data/test1039 +++ b/tests/data/test1039 @@ -34,15 +34,15 @@ worx? # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +STOR %TESTNUMBER +QUIT this is the *****cr@p******** that we're gonna upload diff --git a/tests/data/test104 b/tests/data/test104 index 3674f1da0a8d..fda73d0ee55a 100644 --- a/tests/data/test104 +++ b/tests/data/test104 @@ -27,17 +27,17 @@ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER --head # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -MDTM %TESTNUMBER -TYPE I -SIZE %TESTNUMBER -REST 0 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +MDTM %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +REST 0 +QUIT diff --git a/tests/data/test1040 b/tests/data/test1040 index bd1e5b0e3238..18dab6c5782e 100644 --- a/tests/data/test1040 +++ b/tests/data/test1040 @@ -65,13 +65,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=100- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=100- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1042 b/tests/data/test1042 index a2a5c62f36c2..3fb798048f18 100644 --- a/tests/data/test1042 +++ b/tests/data/test1042 @@ -80,13 +80,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 200 33 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=200- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=200- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1043 b/tests/data/test1043 index ea850a1f97df..d3ca56b0377d 100644 --- a/tests/data/test1043 +++ b/tests/data/test1043 @@ -70,13 +70,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=40- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=40- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1044 b/tests/data/test1044 index 471f099a3f1d..5486b344eda1 100644 --- a/tests/data/test1044 +++ b/tests/data/test1044 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -I # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -MDTM %TESTNUMBER -TYPE I -SIZE %TESTNUMBER -REST 0 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +MDTM %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +REST 0 +QUIT Last-Modified: Sat, 26 Jul 2008 10:26:59 GMT diff --git a/tests/data/test1045 b/tests/data/test1045 index e8745bf2de36..6fdfbfe2059b 100644 --- a/tests/data/test1045 +++ b/tests/data/test1045 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --interface %CLIENTIP # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1046 b/tests/data/test1046 index fd05b3d5357b..3cf9d57bca3e 100644 --- a/tests/data/test1046 +++ b/tests/data/test1046 @@ -43,12 +43,12 @@ HTTP-IPv6 GET with numeric localhost --interface # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1047 b/tests/data/test1047 index b863bd0061bd..772cd4d17bf6 100644 --- a/tests/data/test1047 +++ b/tests/data/test1047 @@ -43,14 +43,14 @@ ftp://%HOSTIP:%FTPPORT/ --interface %CLIENTIP # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1048 b/tests/data/test1048 index cf90020fef74..3a58d7b51e86 100644 --- a/tests/data/test1048 +++ b/tests/data/test1048 @@ -48,14 +48,14 @@ FTP-IPv6 dir list PASV with localhost --interface # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test105 b/tests/data/test105 index 2a26ac7ecafb..f0a5e4bc2aa7 100644 --- a/tests/data/test105 +++ b/tests/data/test105 @@ -37,15 +37,15 @@ ftp://userdude:passfellow@%HOSTIP:%FTPPORT/%TESTNUMBER --use-ascii # Verify data after the test has been "shot" - -USER userdude -PASS passfellow -PWD -EPSV -PASV -TYPE A -RETR %TESTNUMBER -QUIT + +USER userdude +PASS passfellow +PWD +EPSV +PASV +TYPE A +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1054 b/tests/data/test1054 index b0425e545c92..49ca87ba33c0 100644 --- a/tests/data/test1054 +++ b/tests/data/test1054 @@ -58,21 +58,21 @@ http://%HOSTIP:%HTTPPORT/blah/%TESTNUMBER -L -d @%LOGDIR/test%TESTNUMBER.txt --p # # Verify data after the test has been "shot" - -POST /blah/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 -Content-Type: application/x-www-form-urlencoded - -field=dataPOST /blah/moo/testcase/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 -Content-Type: application/x-www-form-urlencoded - + +POST /blah/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 +Content-Type: application/x-www-form-urlencoded + +field=dataPOST /blah/moo/testcase/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 +Content-Type: application/x-www-form-urlencoded + field=data diff --git a/tests/data/test1056 b/tests/data/test1056 index 302b9c541276..c0b74ec83f56 100644 --- a/tests/data/test1056 +++ b/tests/data/test1056 @@ -66,17 +66,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /moo/%TESTNUMBER0002 HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /moo/%TESTNUMBER0002 HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1057 b/tests/data/test1057 index a7cb3bc61ef2..0a6f1bcd09d6 100644 --- a/tests/data/test1057 +++ b/tests/data/test1057 @@ -36,17 +36,17 @@ FTP retrieve a byte-range relative to end of file # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -REST 52 -RETR %TESTNUMBER -ABOR -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +REST 52 +RETR %TESTNUMBER +ABOR +QUIT diff --git a/tests/data/test1058 b/tests/data/test1058 index 794d2ef22a7f..ec7a59c80b47 100644 --- a/tests/data/test1058 +++ b/tests/data/test1058 @@ -39,13 +39,13 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -r -101 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=-101 -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=-101 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1059 b/tests/data/test1059 index 5da753e59459..44a3ed8a5348 100644 --- a/tests/data/test1059 +++ b/tests/data/test1059 @@ -46,12 +46,12 @@ ftp://test-number:%TESTNUMBER/wanted/page -p -x %HOSTIP:%HTTPPORT 56 - -CONNECT test-number:%TESTNUMBER HTTP/1.1 -Host: test-number:%TESTNUMBER -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test-number:%TESTNUMBER HTTP/1.1 +Host: test-number:%TESTNUMBER +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test106 b/tests/data/test106 index b5e1e6929b3a..3e1784c1d603 100644 --- a/tests/data/test106 +++ b/tests/data/test106 @@ -35,17 +35,17 @@ FTP GET with type=A style ASCII URL using %20 codes # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -CWD path with spaces -CWD and things2 -EPSV -TYPE A -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +CWD path with spaces +CWD and things2 +EPSV +TYPE A +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1060 b/tests/data/test1060 index b64e202e81b2..d87124a7f547 100644 --- a/tests/data/test1060 +++ b/tests/data/test1060 @@ -83,23 +83,23 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http:// # Verify data after the test has been "shot" - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se.%TESTNUMBER:8990", response="e1fbed39c26f4efe284adc0e576ff638" -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se.%TESTNUMBER:8990", response="e1fbed39c26f4efe284adc0e576ff638" +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1061 b/tests/data/test1061 index 1ec22f942639..46ad8f98f73b 100644 --- a/tests/data/test1061 +++ b/tests/data/test1061 @@ -88,23 +88,23 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http:// # Verify data after the test has been "shot" - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se.%TESTNUMBER:8990", response="4e23449fa93224834299e7282a70472c" -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se.%TESTNUMBER:8990", response="4e23449fa93224834299e7282a70472c" +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1062 b/tests/data/test1062 index c6033457015f..5b8c36f55fac 100644 --- a/tests/data/test1062 +++ b/tests/data/test1062 @@ -34,16 +34,16 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1066 b/tests/data/test1066 index 5b2b178f0969..7ac4903d1f81 100644 --- a/tests/data/test1066 +++ b/tests/data/test1066 @@ -41,17 +41,17 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUM # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1067 b/tests/data/test1067 index 8bb2233e36e5..85a5f8bc3fdb 100644 --- a/tests/data/test1067 +++ b/tests/data/test1067 @@ -59,19 +59,19 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER --silent --location --referer "firston # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Referer: firstone.html - -GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Referer: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Referer: firstone.html + +GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Referer: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER + |http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER| diff --git a/tests/data/test107 b/tests/data/test107 index a741b7667f8b..48ef6cc7c429 100644 --- a/tests/data/test107 +++ b/tests/data/test107 @@ -38,14 +38,14 @@ that FTP works so does it? - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test1070 b/tests/data/test1070 index a2665039bb2c..7f2b4fb09b3f 100644 --- a/tests/data/test1070 +++ b/tests/data/test1070 @@ -48,15 +48,15 @@ Here's 2000 x 'O': # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Expect: 100-continue -Content-Length: 2313 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Expect: 100-continue +Content-Length: 2313 +Content-Type: application/x-www-form-urlencoded + This creates diff --git a/tests/data/test1074 b/tests/data/test1074 index 183d51a571d0..77d4caac7262 100644 --- a/tests/data/test1074 +++ b/tests/data/test1074 @@ -60,17 +60,17 @@ Connection: close surprise2 - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /wantmore/%TESTNUMBER0001 HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /wantmore/%TESTNUMBER0001 HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1076 b/tests/data/test1076 index 258d14e6a8fd..8613a9a92229 100644 --- a/tests/data/test1076 +++ b/tests/data/test1076 @@ -56,21 +56,21 @@ http://%HOSTIP:%HTTPPORT/blah/%TESTNUMBER -L -d "moo" --post302 # # Verify data after the test has been "shot" - -POST /blah/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - + +POST /blah/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + moo diff --git a/tests/data/test1077 b/tests/data/test1077 index 5162eb3420a6..847aa013d23f 100644 --- a/tests/data/test1077 +++ b/tests/data/test1077 @@ -57,19 +57,19 @@ FTP over HTTP proxy with downgrade to HTTP 1.0 # # Verify data after the test has been "shot" - -GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER0002 HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER0002 HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1078 b/tests/data/test1078 index 97b30853fc0c..9ec0f44eec01 100644 --- a/tests/data/test1078 +++ b/tests/data/test1078 @@ -60,17 +60,17 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/that/page/%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/that/page/%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 Mighty fine indeed diff --git a/tests/data/test1079 b/tests/data/test1079 index 83de2aedbf35..418a25db0ac9 100644 --- a/tests/data/test1079 +++ b/tests/data/test1079 @@ -59,18 +59,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest 52 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="e340c7cdca0950462070f46ee139e9f7" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="e340c7cdca0950462070f46ee139e9f7" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test108 b/tests/data/test108 index 20ef6577ed5b..b639781b59bf 100644 --- a/tests/data/test108 +++ b/tests/data/test108 @@ -36,17 +36,17 @@ Moooooooooooo ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD CWD -CWD STOR -CWD RETR -PORT 127,0,0,1,5,109 -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD CWD +CWD STOR +CWD RETR +PORT 127,0,0,1,5,109 +TYPE I +STOR %TESTNUMBER +QUIT Moooooooooooo diff --git a/tests/data/test1080 b/tests/data/test1080 index 6b9dd5a136dd..6848f61bf0eb 100644 --- a/tests/data/test1080 +++ b/tests/data/test1080 @@ -36,17 +36,17 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/wan # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 301 This is a weirdo text message swsclose diff --git a/tests/data/test1081 b/tests/data/test1081 index 557be4fe65a3..418804d33003 100644 --- a/tests/data/test1081 +++ b/tests/data/test1081 @@ -44,17 +44,17 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/wan # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/our/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/our/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 301 This is a weirdo text message swsclose diff --git a/tests/data/test1082 b/tests/data/test1082 index 40e7b6a70c06..cc9d461cfe09 100644 --- a/tests/data/test1082 +++ b/tests/data/test1082 @@ -42,12 +42,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -4 --interface 127.0.0.1 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1083 b/tests/data/test1083 index dae302b110d4..eb3fc7cfc305 100644 --- a/tests/data/test1083 +++ b/tests/data/test1083 @@ -46,12 +46,12 @@ HTTP-IPv6 GET with ip6-localhost --interface # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1086 b/tests/data/test1086 index 8b7828fb2f91..562ebbad9298 100644 --- a/tests/data/test1086 +++ b/tests/data/test1086 @@ -49,14 +49,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -m 5 28 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER diff --git a/tests/data/test1087 b/tests/data/test1087 index daf4c8094956..6891fd1b8490 100644 --- a/tests/data/test1087 +++ b/tests/data/test1087 @@ -88,26 +88,26 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 -Host: first.host.it.is -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 -Host: first.host.it.is -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://goto.second.host.now/%TESTNUMBER1002 HTTP/1.1 -Host: goto.second.host.now -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 +Host: first.host.it.is +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 +Host: first.host.it.is +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://goto.second.host.now/%TESTNUMBER1002 HTTP/1.1 +Host: goto.second.host.now +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1088 b/tests/data/test1088 index 11a88fc40ab0..08d418a72eca 100644 --- a/tests/data/test1088 +++ b/tests/data/test1088 @@ -89,27 +89,27 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 -Host: first.host.it.is -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 -Host: first.host.it.is -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://goto.second.host.now/%TESTNUMBER1002 HTTP/1.1 -Host: goto.second.host.now -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 +Host: first.host.it.is +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 +Host: first.host.it.is +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://goto.second.host.now/%TESTNUMBER1002 HTTP/1.1 +Host: goto.second.host.now +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1089 b/tests/data/test1089 index c36f21cbbe09..b65f0ddd4f7c 100644 --- a/tests/data/test1089 +++ b/tests/data/test1089 @@ -50,17 +50,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n%{num_redirects}\n%{si # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test109 b/tests/data/test109 index d466437f2135..19e22caf822b 100644 --- a/tests/data/test109 +++ b/tests/data/test109 @@ -31,14 +31,14 @@ Moooooooooooo # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -APPE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +APPE %TESTNUMBER +QUIT Moooooooooooo diff --git a/tests/data/test1090 b/tests/data/test1090 index ffd81bc610bb..454913ac1be7 100644 --- a/tests/data/test1090 +++ b/tests/data/test1090 @@ -57,17 +57,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n%{num_redirects}\n%{si # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1091 b/tests/data/test1091 index 445d31655f73..47eb46a11288 100644 --- a/tests/data/test1091 +++ b/tests/data/test1091 @@ -30,18 +30,18 @@ FTP URL with type=i # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -CWD tmp -CWD moo -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +CWD tmp +CWD moo +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1092 b/tests/data/test1092 index 3d7b741ea746..2c5fbb81cdc0 100644 --- a/tests/data/test1092 +++ b/tests/data/test1092 @@ -43,13 +43,13 @@ FTP with type=i over HTTP proxy # # Verify data after the test has been "shot" - -GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER;type=i HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER;type=i HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1095 b/tests/data/test1095 index 8e23ae6a3a16..942aa0e10cc8 100644 --- a/tests/data/test1095 +++ b/tests/data/test1095 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="test \"this\" realm!!", nonce="1053604145", uri="/%TESTNUMBER", response="df3246f44d2bc8de0e9f8fc4d7cf6e95" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="test \"this\" realm!!", nonce="1053604145", uri="/%TESTNUMBER", response="df3246f44d2bc8de0e9f8fc4d7cf6e95" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1096 b/tests/data/test1096 index e7b16392473d..6a3818c07390 100644 --- a/tests/data/test1096 +++ b/tests/data/test1096 @@ -33,19 +33,19 @@ ftp://%HOSTIP:%FTPPORT/dir/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/dir/%TESTNUMBER 78 - -USER anonymous -PASS ftp@example.com -PWD -CWD dir -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD dir +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1097 b/tests/data/test1097 index 106a8537b879..84b9300d49b9 100644 --- a/tests/data/test1097 +++ b/tests/data/test1097 @@ -59,20 +59,20 @@ http://test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT/%TESTNUMBER --proxy http # Verify data after the test has been "shot" - -CONNECT test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -POST /%TESTNUMBER HTTP/1.1 -Host: test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +CONNECT test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +POST /%TESTNUMBER HTTP/1.1 +Host: test.a.galaxy.far.far.away.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + dummy=value diff --git a/tests/data/test11 b/tests/data/test11 index 5affc6bde28d..60164d6d62f2 100644 --- a/tests/data/test11 +++ b/tests/data/test11 @@ -59,17 +59,17 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test110 b/tests/data/test110 index e53fcd1377af..f8418fbbcacc 100644 --- a/tests/data/test110 +++ b/tests/data/test110 @@ -36,17 +36,17 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C 20 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -REST 20 -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +REST 20 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1100 b/tests/data/test1100 index 10bf811eddd6..500a05b31a57 100644 --- a/tests/data/test1100 +++ b/tests/data/test1100 @@ -80,28 +80,28 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -L -d "stuff to # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 18 -Content-Type: application/x-www-form-urlencoded - -stuff to send awayGET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 18 +Content-Type: application/x-www-form-urlencoded + +stuff to send awayGET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1101 b/tests/data/test1101 index e70f256abc50..9e2dff25be6e 100644 --- a/tests/data/test1101 +++ b/tests/data/test1101 @@ -42,13 +42,13 @@ http://user:secret@%HOSTIP:%HTTPPORT/gimme/%TESTNUMBER # Verify data after the test has been "shot" - -GET /gimme/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /gimme/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1102 b/tests/data/test1102 index 16994d953340..aacb15690383 100644 --- a/tests/data/test1102 +++ b/tests/data/test1102 @@ -34,18 +34,18 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -SYST -SITE NAMEFMT 1 -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +SYST +SITE NAMEFMT 1 +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1103 b/tests/data/test1103 index a53b504bdc07..604178710760 100644 --- a/tests/data/test1103 +++ b/tests/data/test1103 @@ -33,16 +33,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -SYST -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +SYST +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1104 b/tests/data/test1104 index 9c5d659bc337..c0fabfc1d586 100644 --- a/tests/data/test1104 +++ b/tests/data/test1104 @@ -69,20 +69,20 @@ proxy # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://%HOSTIP:%HTTPPORT/want/data/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: test2=true - + +GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://%HOSTIP:%HTTPPORT/want/data/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: test2=true + diff --git a/tests/data/test1105 b/tests/data/test1105 index 68922dc770ca..cb828bf0488e 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -45,14 +45,14 @@ local-http # Verify data after the test has been "shot" - -POST /we/want/%TESTNUMBER?parm1=this*that/other/thing&parm2=foobar/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 33 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/%TESTNUMBER?parm1=this*that/other/thing&parm2=foobar/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 33 +Content-Type: application/x-www-form-urlencoded + userid=myname&password=mypassword diff --git a/tests/data/test1106 b/tests/data/test1106 index e3acdac16be5..e8bb0a52afa2 100644 --- a/tests/data/test1106 +++ b/tests/data/test1106 @@ -44,13 +44,13 @@ ftp://%HOSTIP:23456/%TESTNUMBER # Verify data after the test has been "shot" - -GET ftp://%HOSTIP:23456/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:23456 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://%HOSTIP:23456/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:23456 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1107 b/tests/data/test1107 index 8b31c76f8397..3eeb0457e4e1 100644 --- a/tests/data/test1107 +++ b/tests/data/test1107 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-pret # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -PRET RETR %TESTNUMBER -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +PRET RETR %TESTNUMBER +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1108 b/tests/data/test1108 index c6008af30059..107ef8d55caa 100644 --- a/tests/data/test1108 +++ b/tests/data/test1108 @@ -31,11 +31,11 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-pret # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -PRET RETR %TESTNUMBER + +USER anonymous +PASS ftp@example.com +PWD +PRET RETR %TESTNUMBER # we expect that the server doesn't understand PRET diff --git a/tests/data/test1109 b/tests/data/test1109 index 93aa9e4dbce9..da640789f7b9 100644 --- a/tests/data/test1109 +++ b/tests/data/test1109 @@ -33,12 +33,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER#test # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test111 b/tests/data/test111 index a46f7aef1d24..4044fdd41d83 100644 --- a/tests/data/test111 +++ b/tests/data/test111 @@ -32,14 +32,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C 2000 36 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +QUIT diff --git a/tests/data/test1110 b/tests/data/test1110 index 165a8acd8621..d2dfcc4f350c 100644 --- a/tests/data/test1110 +++ b/tests/data/test1110 @@ -34,12 +34,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?q=foobar#fragment # Verify data after the test has been "shot" - -GET /%TESTNUMBER?q=foobar HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER?q=foobar HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1111 b/tests/data/test1111 index 157cd2751cbe..f68668a520a4 100644 --- a/tests/data/test1111 +++ b/tests/data/test1111 @@ -34,12 +34,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?q=foobar#fragment#fragment2 # Verify data after the test has been "shot" - -GET /%TESTNUMBER?q=foobar HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER?q=foobar HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1112 b/tests/data/test1112 index 2ef60a9eb7d2..8d42cea80fa0 100644 --- a/tests/data/test1112 +++ b/tests/data/test1112 @@ -52,16 +52,16 @@ FTPS download with strict timeout and slow data transfer 28 - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER diff --git a/tests/data/test1113 b/tests/data/test1113 index 744c012ee144..474c6aadc494 100644 --- a/tests/data/test1113 +++ b/tests/data/test1113 @@ -40,45 +40,45 @@ FTP wildcard download - changed fnmatch, 2x perform (DOS LIST response) 0 # THERE SHOULD NOT BE "SIZE"! and one "USER/PASS" - -USER anonymous -PASS ftp@example.com -PWD -CWD fully_simulated -CWD DOS -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD fully_simulated +CWD DOS +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +QUIT This file should have permissions 444 diff --git a/tests/data/test1115 b/tests/data/test1115 index 40ce7c15e19a..176570992ee4 100644 --- a/tests/data/test1115 +++ b/tests/data/test1115 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1116 b/tests/data/test1116 index 8feed326eaaa..0775bb42db3f 100644 --- a/tests/data/test1116 +++ b/tests/data/test1116 @@ -60,12 +60,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 funky chunky! diff --git a/tests/data/test1117 b/tests/data/test1117 index 67df822c9e7e..c133501027c5 100644 --- a/tests/data/test1117 +++ b/tests/data/test1117 @@ -69,19 +69,19 @@ Content-Type: text/plain partial body - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=10-22 -User-Agent: curl/%VERSION -Accept: */* - -GET /wantmore/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=10-22 -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=10-22 +User-Agent: curl/%VERSION +Accept: */* + +GET /wantmore/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=10-22 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1118 b/tests/data/test1118 index 3daa8a63e7d0..13f686f4034c 100644 --- a/tests/data/test1118 +++ b/tests/data/test1118 @@ -42,12 +42,12 @@ http://%HOSTIP:%HTTPPORT?email=name@example.com/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /?email=name@example.com/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /?email=name@example.com/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test112 b/tests/data/test112 index 41bbc025d960..9a73da35a57c 100644 --- a/tests/data/test112 +++ b/tests/data/test112 @@ -31,14 +31,14 @@ worx? # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -APPE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +APPE %TESTNUMBER +QUIT gonna upload diff --git a/tests/data/test1120 b/tests/data/test1120 index 464b8ac09726..9a96aed2bc16 100644 --- a/tests/data/test1120 +++ b/tests/data/test1120 @@ -32,11 +32,11 @@ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER # Verify data after the test has been "shot" # Strip all valid kinds of PORT and EPRT that curl can send - -USER anonymous -PASS ftp@example.com -PWD -CWD a + +USER anonymous +PASS ftp@example.com +PWD +CWD a # CURLE_OPERATION_TIMEDOUT is 28 diff --git a/tests/data/test1121 b/tests/data/test1121 index 3eec862d6d1f..0804c59e26a8 100644 --- a/tests/data/test1121 +++ b/tests/data/test1121 @@ -34,12 +34,12 @@ HTTP multiple provided Host: headers # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: host1 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: host1 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1122 b/tests/data/test1122 index d0ce3ffaf043..cbd74b2ea90a 100644 --- a/tests/data/test1122 +++ b/tests/data/test1122 @@ -61,14 +61,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + diff --git a/tests/data/test1123 b/tests/data/test1123 index a01aae69beb0..2a1b10605fce 100644 --- a/tests/data/test1123 +++ b/tests/data/test1123 @@ -171,14 +171,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + diff --git a/tests/data/test1124 b/tests/data/test1124 index fdc172398ff8..33415aab798d 100644 --- a/tests/data/test1124 +++ b/tests/data/test1124 @@ -62,14 +62,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + diff --git a/tests/data/test1125 b/tests/data/test1125 index 3b4d58b2e605..1f1f15383589 100644 --- a/tests/data/test1125 +++ b/tests/data/test1125 @@ -61,14 +61,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection: close" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: close, TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: close, TE + diff --git a/tests/data/test1126 b/tests/data/test1126 index b25820b0cfa5..9fb7c5a832d2 100644 --- a/tests/data/test1126 +++ b/tests/data/test1126 @@ -38,13 +38,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT + diff --git a/tests/data/test1127 b/tests/data/test1127 index fa3ee85fe7b0..8f2b6b1103ec 100644 --- a/tests/data/test1127 +++ b/tests/data/test1127 @@ -47,13 +47,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT + diff --git a/tests/data/test1128 b/tests/data/test1128 index 37b5b522ed30..977ed4d8be42 100644 --- a/tests/data/test1128 +++ b/tests/data/test1128 @@ -48,19 +48,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -z # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT + diff --git a/tests/data/test1129 b/tests/data/test1129 index 99e390c50023..44b0f3ab8268 100644 --- a/tests/data/test1129 +++ b/tests/data/test1129 @@ -74,23 +74,23 @@ Content-Type: text/html -foo- - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1053700 -Content-Type: application/x-www-form-urlencoded -Expect: 100-continue - -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1053700 -Content-Type: application/x-www-form-urlencoded -Expect: 100-continue - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 1053700 +Content-Type: application/x-www-form-urlencoded +Expect: 100-continue + +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 1053700 +Content-Type: application/x-www-form-urlencoded +Expect: 100-continue + Maximum allocated: 3200000 diff --git a/tests/data/test113 b/tests/data/test113 index 1c0a8b246c6b..463da9c624ee 100644 --- a/tests/data/test113 +++ b/tests/data/test113 @@ -30,8 +30,8 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 67 - -USER anonymous + +USER anonymous diff --git a/tests/data/test1130 b/tests/data/test1130 index bdab216d812a..59ca8c52eb62 100644 --- a/tests/data/test1130 +++ b/tests/data/test1130 @@ -75,23 +75,23 @@ Content-Type: text/html -foo- - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Expect: 100-continue -Content-Length: 100 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Expect: 100-continue -Content-Length: 100 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Expect: 100-continue +Content-Length: 100 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Expect: 100-continue +Content-Length: 100 +Content-Type: application/x-www-form-urlencoded + diff --git a/tests/data/test1131 b/tests/data/test1131 index 20ad5cfd85e7..e9c37395e573 100644 --- a/tests/data/test1131 +++ b/tests/data/test1131 @@ -75,21 +75,21 @@ Content-Type: text/html FAILURE2 - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Expect: 100-continue -Content-Length: 100 - -PUT /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Expect: 100-continue -Content-Length: 100 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Expect: 100-continue +Content-Length: 100 + +PUT /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Expect: 100-continue +Content-Length: 100 + diff --git a/tests/data/test1137 b/tests/data/test1137 index cb20aee313ec..241f740aa7e7 100644 --- a/tests/data/test1137 +++ b/tests/data/test1137 @@ -38,15 +38,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ignore-content-length # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test114 b/tests/data/test114 index 8a545f2a8532..ce43a93d4f37 100644 --- a/tests/data/test114 +++ b/tests/data/test114 @@ -30,9 +30,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 67 - -USER anonymous -PASS ftp@example.com + +USER anonymous +PASS ftp@example.com diff --git a/tests/data/test1141 b/tests/data/test1141 index 727cbcd5653a..68eea75dc22b 100644 --- a/tests/data/test1141 +++ b/tests/data/test1141 @@ -54,19 +54,19 @@ proxy # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://foo.example.com/want/%TESTNUMBER0001 HTTP/1.1 -Host: foo.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://foo.example.com/want/%TESTNUMBER0001 HTTP/1.1 +Host: foo.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1142 b/tests/data/test1142 index c35190006f51..64793147cc09 100644 --- a/tests/data/test1142 +++ b/tests/data/test1142 @@ -49,13 +49,13 @@ proxy # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + # 3, CURLE_URL_MALFORMAT for the four slashes diff --git a/tests/data/test1143 b/tests/data/test1143 index e9053b179436..b845a6576260 100644 --- a/tests/data/test1143 +++ b/tests/data/test1143 @@ -37,12 +37,12 @@ MSYS2_ARG_CONV_EXCL=http:/ # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1144 b/tests/data/test1144 index be51dae13d4b..7915cb610bd3 100644 --- a/tests/data/test1144 +++ b/tests/data/test1144 @@ -54,12 +54,12 @@ HTTP HEAD, receive no headers only body # # Verify data after the test has been "shot" - -HEAD /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +HEAD /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 8 diff --git a/tests/data/test1147 b/tests/data/test1147 index 9298e48a1812..5f27abc59b0e 100644 --- a/tests/data/test1147 +++ b/tests/data/test1147 @@ -51,14 +51,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -H @%LOGDIR/heads%TESTNUMBER.txt # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -One: 1 -Two: 2 - And A Funny One : wohoo - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +One: 1 +Two: 2 + And A Funny One : wohoo + diff --git a/tests/data/test1148 b/tests/data/test1148 index 5653ef61049d..ba37c8dd30a8 100644 --- a/tests/data/test1148 +++ b/tests/data/test1148 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -# --stderr %LOGDIR/stderrlog%TESTNUMBER # - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Check that the progress finished at 100% and has the right bar width. diff --git a/tests/data/test1149 b/tests/data/test1149 index d4e97d540d50..f5239aea2549 100644 --- a/tests/data/test1149 +++ b/tests/data/test1149 @@ -42,21 +42,21 @@ ftp://%HOSTIP:%FTPPORT/list/this/path/%TESTNUMBER/ --ftp-method multicwd --next # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD list -CWD this -CWD path -CWD %TESTNUMBER -EPSV -TYPE A -LIST -CWD / -EPSV -LIST list/this/path/%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD list +CWD this +CWD path +CWD %TESTNUMBER +EPSV +TYPE A +LIST +CWD / +EPSV +LIST list/this/path/%TESTNUMBER +QUIT diff --git a/tests/data/test115 b/tests/data/test115 index 22f75c0b6e81..62ec4ea827ea 100644 --- a/tests/data/test115 +++ b/tests/data/test115 @@ -32,13 +32,13 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 13 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +QUIT diff --git a/tests/data/test1150 b/tests/data/test1150 index cafc00cd0759..e4d0ed01a673 100644 --- a/tests/data/test1150 +++ b/tests/data/test1150 @@ -39,19 +39,19 @@ proxy # Verify data after the test has been "shot" - -GET http://test.remote.example.com.%TESTNUMBER:150/path HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:150 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.example.com.%TESTNUMBER:1234/path/ HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:1234 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.example.com.%TESTNUMBER:150/path HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:150 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.example.com.%TESTNUMBER:1234/path/ HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:1234 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1151 b/tests/data/test1151 index dd916a61334d..f8b14ebb4eec 100644 --- a/tests/data/test1151 +++ b/tests/data/test1151 @@ -48,12 +48,12 @@ cookies # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test1152 b/tests/data/test1152 index 1823bab4a9af..f02104f2cf50 100644 --- a/tests/data/test1152 +++ b/tests/data/test1152 @@ -45,15 +45,15 @@ ftp://%HOSTIP:%FTPPORT/test-%TESTNUMBER/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD test-%TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD test-%TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1153 b/tests/data/test1153 index a74b1838ceca..5198092bce41 100644 --- a/tests/data/test1153 +++ b/tests/data/test1153 @@ -45,15 +45,15 @@ ftp://%HOSTIP:%FTPPORT/test-%TESTNUMBER/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD test-%TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD test-%TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1154 b/tests/data/test1154 index bd08ce26c10d..27bfc17ae4a9 100644 --- a/tests/data/test1154 +++ b/tests/data/test1154 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # 100 == CURLE_TOO_LARGE diff --git a/tests/data/test1155 b/tests/data/test1155 index 579328d9253a..195028a4d47c 100644 --- a/tests/data/test1155 +++ b/tests/data/test1155 @@ -37,12 +37,12 @@ cookies # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test1157 b/tests/data/test1157 index 4e246e7031b5..b13536773f7f 100644 --- a/tests/data/test1157 +++ b/tests/data/test1157 @@ -45,12 +45,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -H @%LOGDIR/heads%TESTNUMBER.txt # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1159 b/tests/data/test1159 index 6ef2e4ad66e7..769e84db3c32 100644 --- a/tests/data/test1159 +++ b/tests/data/test1159 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 301 This is a weirdo text message swsclose diff --git a/tests/data/test1160 b/tests/data/test1160 index d503945fe355..b5b55a4d29ab 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -38,12 +38,12 @@ cookies # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test1161 b/tests/data/test1161 index dd8f9c9ebfc1..4dbb0a4a7b6d 100644 --- a/tests/data/test1161 +++ b/tests/data/test1161 @@ -37,12 +37,12 @@ cookies # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test1162 b/tests/data/test1162 index b6b394139e22..9f8f931936e3 100644 --- a/tests/data/test1162 +++ b/tests/data/test1162 @@ -37,16 +37,16 @@ MSYS2_ARG_CONV_EXCL=ftp:// - -USER anonymous -PASS ftp@example.com -PWD -CWD fully_simulated -CWD DOS -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD fully_simulated +CWD DOS +EPSV +TYPE A +LIST +QUIT # 78 == CURLE_REMOTE_FILE_NOT_FOUND diff --git a/tests/data/test1163 b/tests/data/test1163 index a109b511bcc7..006e612f98e5 100644 --- a/tests/data/test1163 +++ b/tests/data/test1163 @@ -33,16 +33,16 @@ FTP wildcard with pattern ending with an open-bracket - -USER anonymous -PASS ftp@example.com -PWD -CWD fully_simulated -CWD DOS -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD fully_simulated +CWD DOS +EPSV +TYPE A +LIST +QUIT # 78 == CURLE_REMOTE_FILE_NOT_FOUND diff --git a/tests/data/test1164 b/tests/data/test1164 index 40422da8b741..c5c25d339db9 100644 --- a/tests/data/test1164 +++ b/tests/data/test1164 @@ -31,12 +31,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{size_download}\n' --http0.9 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 208 diff --git a/tests/data/test1166 b/tests/data/test1166 index 92e8ff40469b..6720c09d31f7 100644 --- a/tests/data/test1166 +++ b/tests/data/test1166 @@ -36,17 +36,17 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUM # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1168 b/tests/data/test1168 index 2bba7eccd393..04403597de8a 100644 --- a/tests/data/test1168 +++ b/tests/data/test1168 @@ -59,19 +59,19 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L -u "catmai#d:#DZaRJYrixKE*gFY" # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[catmai#d:#DZaRJYrixKE*gFY]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /data/%TESTNUMBER0002.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[catmai#d:#DZaRJYrixKE*gFY]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[catmai#d:#DZaRJYrixKE*gFY]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /data/%TESTNUMBER0002.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[catmai#d:#DZaRJYrixKE*gFY]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test117 b/tests/data/test117 index 3bd5cb57f1ec..8811dd95364b 100644 --- a/tests/data/test117 +++ b/tests/data/test117 @@ -31,14 +31,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 17 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +QUIT diff --git a/tests/data/test1170 b/tests/data/test1170 index d6271714bd11..499044e39902 100644 --- a/tests/data/test1170 +++ b/tests/data/test1170 @@ -61,14 +61,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection:" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + diff --git a/tests/data/test1171 b/tests/data/test1171 index 486aadb94b5d..5dd570add8d2 100644 --- a/tests/data/test1171 +++ b/tests/data/test1171 @@ -61,14 +61,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection;" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + diff --git a/tests/data/test1172 b/tests/data/test1172 index 0de4713d39c8..6afe814c0489 100644 --- a/tests/data/test1172 +++ b/tests/data/test1172 @@ -33,12 +33,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --no-http0.9 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # unsupported protocol diff --git a/tests/data/test1174 b/tests/data/test1174 index 48938a7be3f5..21dd5d54b659 100644 --- a/tests/data/test1174 +++ b/tests/data/test1174 @@ -33,12 +33,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # unsupported protocol diff --git a/tests/data/test1176 b/tests/data/test1176 index 86d23a2ccc28..6bfe6a6f6a62 100644 --- a/tests/data/test1176 +++ b/tests/data/test1176 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o '%LOGDIR/base-#0' # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1178 b/tests/data/test1178 index 52eea37fec1f..6f5fdd7161ab 100644 --- a/tests/data/test1178 +++ b/tests/data/test1178 @@ -40,14 +40,14 @@ proxy # # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: Basic %b64[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: Basic %b64[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test118 b/tests/data/test118 index 9b5b8708eb6b..190dc79c1223 100644 --- a/tests/data/test118 +++ b/tests/data/test118 @@ -34,16 +34,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 19 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1180 b/tests/data/test1180 index d04542ef965c..8607f825525d 100644 --- a/tests/data/test1180 +++ b/tests/data/test1180 @@ -36,13 +36,13 @@ HTTP GET request with proxy and -H "Proxy-Connection: keep-alive" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1181 b/tests/data/test1181 index 9cdf3fa4640a..8fe4587dfcb0 100644 --- a/tests/data/test1181 +++ b/tests/data/test1181 @@ -36,13 +36,13 @@ HTTP GET request with proxy and "Proxy-Connection: Keep-Alive" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1183 b/tests/data/test1183 index 5f795ed66601..34cba4aa5187 100644 --- a/tests/data/test1183 +++ b/tests/data/test1183 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify that the %TESTNUMBER has been resolved to %TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1184 b/tests/data/test1184 index 268da350fbe8..0f5d8c91f0d2 100644 --- a/tests/data/test1184 +++ b/tests/data/test1184 @@ -71,17 +71,17 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP.%TESTNUMBER:%HTTPPORT -Accept: */* -User-Agent: %TESTNUMBER-agent - -GET /we/want/that/page/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP.%TESTNUMBER:%HTTPPORT -Accept: */* -User-Agent: %TESTNUMBER-agent - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP.%TESTNUMBER:%HTTPPORT +Accept: */* +User-Agent: %TESTNUMBER-agent + +GET /we/want/that/page/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP.%TESTNUMBER:%HTTPPORT +Accept: */* +User-Agent: %TESTNUMBER-agent + HTTP/1.1 200 Mighty fine indeed diff --git a/tests/data/test1187 b/tests/data/test1187 index aaa8d107b381..5fbf4efd3472 100644 --- a/tests/data/test1187 +++ b/tests/data/test1187 @@ -41,26 +41,26 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -Content-Type: multipart/mixed; boundary=---------------------------- -Mime-Version: 1.0 - ------------------------------- - -This is the mail text ------------------------------- -Content-Disposition: attachment; filename="strange\\file\"name" - -File content --------------------------------- -. + +Content-Type: multipart/mixed; boundary=---------------------------- +Mime-Version: 1.0 + +------------------------------ + +This is the mail text +------------------------------ +Content-Disposition: attachment; filename="strange\\file\"name" + +File content +-------------------------------- +. diff --git a/tests/data/test1188 b/tests/data/test1188 index 702856245d97..6c7f8261e209 100644 --- a/tests/data/test1188 +++ b/tests/data/test1188 @@ -32,17 +32,17 @@ http # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 0 says 22 The requested URL returned error: 404 diff --git a/tests/data/test119 b/tests/data/test119 index 4426def0bde4..8ddb2e2ef3de 100644 --- a/tests/data/test119 +++ b/tests/data/test119 @@ -38,14 +38,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P - ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1197 b/tests/data/test1197 index 22bf8dbbe8d6..2daf7939d856 100644 --- a/tests/data/test1197 +++ b/tests/data/test1197 @@ -50,19 +50,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{method}\n" -L -d "twinkle twinkle lit # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 27 -Content-Type: application/x-www-form-urlencoded - -twinkle twinkle little starGET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 27 +Content-Type: application/x-www-form-urlencoded + +twinkle twinkle little starGET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test12 b/tests/data/test12 index 48380a1e9b93..71cfdb6e6827 100644 --- a/tests/data/test12 +++ b/tests/data/test12 @@ -42,13 +42,13 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -r 100-200 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=100-200 -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=100-200 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test120 b/tests/data/test120 index 64628b6599fc..7799f5644ab3 100644 --- a/tests/data/test120 +++ b/tests/data/test120 @@ -37,17 +37,17 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "-DELE file" # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -DELE file -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +DELE file +QUIT diff --git a/tests/data/test1200 b/tests/data/test1200 index 342077b8a5d8..bf40f1c8a493 100644 --- a/tests/data/test1200 +++ b/tests/data/test1200 @@ -32,8 +32,8 @@ gopher://%HOSTIP:%GOPHERPORT/1/%TESTNUMBER # # Verify data after the test has been "shot" - -/%TESTNUMBER + +/%TESTNUMBER diff --git a/tests/data/test1201 b/tests/data/test1201 index f4c1a483865e..aec07681e133 100644 --- a/tests/data/test1201 +++ b/tests/data/test1201 @@ -32,8 +32,8 @@ gopher://%HOSTIP:%GOPHERPORT/1/selector/SELECTOR/%TESTNUMBER # # Verify data after the test has been "shot" - -/selector/SELECTOR/%TESTNUMBER + +/selector/SELECTOR/%TESTNUMBER diff --git a/tests/data/test1202 b/tests/data/test1202 index ab1d51c0f81b..586e658d66d0 100644 --- a/tests/data/test1202 +++ b/tests/data/test1202 @@ -33,8 +33,8 @@ Gopher query # # Verify data after the test has been "shot" - -/the/search/engine query succeeded/%TESTNUMBER + +/the/search/engine query succeeded/%TESTNUMBER diff --git a/tests/data/test1203 b/tests/data/test1203 index 267fc15cb791..29f9bed0ad18 100644 --- a/tests/data/test1203 +++ b/tests/data/test1203 @@ -36,8 +36,8 @@ Gopher IPv6 index # # Verify data after the test has been "shot" - -/moo/%TESTNUMBER + +/moo/%TESTNUMBER diff --git a/tests/data/test1204 b/tests/data/test1204 index 97bebe7ba6f4..89d14ad1f87d 100644 --- a/tests/data/test1204 +++ b/tests/data/test1204 @@ -61,18 +61,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1205 b/tests/data/test1205 index 547ef0d1d142..6fa833893a9d 100644 --- a/tests/data/test1205 +++ b/tests/data/test1205 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test121 b/tests/data/test121 index 3625d0e3e041..6d18f564b30a 100644 --- a/tests/data/test121 +++ b/tests/data/test121 @@ -35,17 +35,17 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "-DELE after_transfer" -Q "DELE before_tra # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -DELE before_transfer -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -DELE after_transfer -QUIT + +USER anonymous +PASS ftp@example.com +PWD +DELE before_transfer +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +DELE after_transfer +QUIT diff --git a/tests/data/test1210 b/tests/data/test1210 index 09f830c72bfa..d709a6f72a5f 100644 --- a/tests/data/test1210 +++ b/tests/data/test1210 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?junk -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER?junk HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER?junk HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test1212 b/tests/data/test1212 index e67878d9062b..fa7add16774e 100644 --- a/tests/data/test1212 +++ b/tests/data/test1212 @@ -40,13 +40,13 @@ http://user:secret@%HOSTIP:%HTTPPORT/ulion/%TESTNUMBER --socks5 non-existing-hos # Verify data after the test has been "shot" - -GET /ulion/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /ulion/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1213 b/tests/data/test1213 index 195329ecb200..9a511c002294 100644 --- a/tests/data/test1213 +++ b/tests/data/test1213 @@ -42,13 +42,13 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com.%TESTNUMBER/ HTTP/1.1 -Host: we.want.that.site.com.%TESTNUMBER -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com.%TESTNUMBER/ HTTP/1.1 +Host: we.want.that.site.com.%TESTNUMBER +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1214 b/tests/data/test1214 index fc8a94eaf70f..b80d0071c25d 100644 --- a/tests/data/test1214 +++ b/tests/data/test1214 @@ -42,13 +42,13 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com.%TESTNUMBER/?moo=foo HTTP/1.1 -Host: we.want.that.site.com.%TESTNUMBER -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com.%TESTNUMBER/?moo=foo HTTP/1.1 +Host: we.want.that.site.com.%TESTNUMBER +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1215 b/tests/data/test1215 index 31c8723913ac..c405ce04d08c 100644 --- a/tests/data/test1215 +++ b/tests/data/test1215 @@ -76,21 +76,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm --proxy http:// # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1216 b/tests/data/test1216 index 6341ba473c33..7301aa571c21 100644 --- a/tests/data/test1216 +++ b/tests/data/test1216 @@ -47,20 +47,20 @@ proxy # Verify data after the test has been "shot" - -GET http://example.fake/c/%TESTNUMBER HTTP/1.1 -Host: example.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: moo3=indeed; moo2=indeed - -GET http://bexample.fake/c/%TESTNUMBER HTTP/1.1 -Host: bexample.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://example.fake/c/%TESTNUMBER HTTP/1.1 +Host: example.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: moo3=indeed; moo2=indeed + +GET http://bexample.fake/c/%TESTNUMBER HTTP/1.1 +Host: bexample.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1217 b/tests/data/test1217 index 691c88e73203..86e1f3693afe 100644 --- a/tests/data/test1217 +++ b/tests/data/test1217 @@ -37,21 +37,21 @@ ftp://%HOSTIP:%FTPPORT/get/file/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/get/file/agai ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD get/file -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -CWD /this/is/the/path -CWD get/file/again -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD get/file +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +CWD /this/is/the/path +CWD get/file/again +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1218 b/tests/data/test1218 index afbc2b564674..8b0aa9cf5874 100644 --- a/tests/data/test1218 +++ b/tests/data/test1218 @@ -40,26 +40,26 @@ proxy # Verify data after the test has been "shot" - -GET http://example.fake/c/%TESTNUMBER HTTP/1.1 -Host: example.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://example.fake/c/%TESTNUMBER HTTP/1.1 -Host: example.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: bug=fixed - -GET http://bexample.fake/c/%TESTNUMBER HTTP/1.1 -Host: bexample.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://example.fake/c/%TESTNUMBER HTTP/1.1 +Host: example.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://example.fake/c/%TESTNUMBER HTTP/1.1 +Host: example.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: bug=fixed + +GET http://bexample.fake/c/%TESTNUMBER HTTP/1.1 +Host: bexample.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1219 b/tests/data/test1219 index 454654399b92..23ffe3bd643d 100644 --- a/tests/data/test1219 +++ b/tests/data/test1219 @@ -37,13 +37,13 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test122 b/tests/data/test122 index 1f007c1ce036..7aacf2aa0fd2 100644 --- a/tests/data/test122 +++ b/tests/data/test122 @@ -31,15 +31,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C 5 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +QUIT diff --git a/tests/data/test1221 b/tests/data/test1221 index c2fd7a5dddc5..565e83073a1b 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -39,14 +39,14 @@ content to _?!#$'|<> # # Verify data after the test has been "shot" - -POST /%TESTNUMBER?my+name+is+moo%5b%5d&yes=s+i+r&v_alue=content+to+_%3f%21%23%24%27%7c%3c%3e%0a&content+to+_%3f%21%23%24%27%7c%3c%3e%0a&%3d%3d HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 24 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER?my+name+is+moo%5b%5d&yes=s+i+r&v_alue=content+to+_%3f%21%23%24%27%7c%3c%3e%0a&content+to+_%3f%21%23%24%27%7c%3c%3e%0a&%3d%3d HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 24 +Content-Type: application/x-www-form-urlencoded + start=once+upon+the+time diff --git a/tests/data/test1223 b/tests/data/test1223 index 6c1ee00189e7..11b0206ee18a 100644 --- a/tests/data/test1223 +++ b/tests/data/test1223 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w 'IP %{remote_ip} and PORT %{remote_port} # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1224 b/tests/data/test1224 index 64ba4482c586..904fe38932c1 100644 --- a/tests/data/test1224 +++ b/tests/data/test1224 @@ -34,16 +34,16 @@ ftp://%HOSTIP:%FTPPORT//%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1225 b/tests/data/test1225 index b20363c3e45c..51cdaa0a020c 100644 --- a/tests/data/test1225 +++ b/tests/data/test1225 @@ -34,23 +34,23 @@ ftp://%HOSTIP:%FTPPORT//foo/%TESTNUMBER ftp://%HOSTIP:%FTPPORT//foo/bar/%TESTNUM # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -CWD foo -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -CWD / -CWD foo -CWD bar -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +CWD foo +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +CWD / +CWD foo +CWD bar +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1226 b/tests/data/test1226 index 08e706b9b016..8e7c47191610 100644 --- a/tests/data/test1226 +++ b/tests/data/test1226 @@ -34,16 +34,16 @@ ftp://%HOSTIP:%FTPPORT//%TESTNUMBER --ftp-method singlecwd # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1227 b/tests/data/test1227 index 30477a46a0b8..3c3fbfeb7a97 100644 --- a/tests/data/test1227 +++ b/tests/data/test1227 @@ -34,15 +34,15 @@ ftp://%HOSTIP:%FTPPORT//%TESTNUMBER --ftp-method nocwd # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE /%TESTNUMBER -RETR /%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE /%TESTNUMBER +RETR /%TESTNUMBER +QUIT diff --git a/tests/data/test1228 b/tests/data/test1228 index a4df51c46ccf..64f49257afa0 100644 --- a/tests/data/test1228 +++ b/tests/data/test1228 @@ -39,20 +39,20 @@ proxy # Verify data after the test has been "shot" - -GET http://example.fake/hoge/%TESTNUMBER HTTP/1.1 -Host: example.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://example.fake/hogege/ HTTP/1.1 -Host: example.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: path1=root - + +GET http://example.fake/hoge/%TESTNUMBER HTTP/1.1 +Host: example.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://example.fake/hogege/ HTTP/1.1 +Host: example.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: path1=root + diff --git a/tests/data/test1229 b/tests/data/test1229 index cc179499ad22..c225e7d4723e 100644 --- a/tests/data/test1229 +++ b/tests/data/test1229 @@ -66,18 +66,18 @@ http://%5cuser%22:password@%HOSTIP:%HTTPPORT/%TESTNUMBER --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="\\user\"", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="f2694d426040712584c156d3de72b8d6" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="\\user\"", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="f2694d426040712584c156d3de72b8d6" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test123 b/tests/data/test123 index 8ccd69cf6816..249f89ab5520 100644 --- a/tests/data/test123 +++ b/tests/data/test123 @@ -28,13 +28,13 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -C 51 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +QUIT diff --git a/tests/data/test1230 b/tests/data/test1230 index fbcff60393b0..507580d1c3fd 100644 --- a/tests/data/test1230 +++ b/tests/data/test1230 @@ -62,17 +62,17 @@ http://[1234:1234:1234::4ce]:%HTTPPORT/wanted/page/%TESTNUMBER -p -x %HOSTIP:%HT # # Verify data after the test has been "shot" - -CONNECT [1234:1234:1234::4ce]:%HTTPPORT HTTP/1.1 -Host: [1234:1234:1234::4ce]:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /wanted/page/%TESTNUMBER HTTP/1.1 -Host: [1234:1234:1234::4ce]:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT [1234:1234:1234::4ce]:%HTTPPORT HTTP/1.1 +Host: [1234:1234:1234::4ce]:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /wanted/page/%TESTNUMBER HTTP/1.1 +Host: [1234:1234:1234::4ce]:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1231 b/tests/data/test1231 index 2c7c8bb0009d..5573bfc1ae66 100644 --- a/tests/data/test1231 +++ b/tests/data/test1231 @@ -44,17 +44,17 @@ http://%HOSTIP:%HTTPPORT/../../hej/but/who/../%TESTNUMBER?stupid=me/../%TESTNUMB # # Verify data after the test has been "shot" - -GET /hej/but/%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /hej/but/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /hej/but/%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /hej/but/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1232 b/tests/data/test1232 index 28d2eee735d7..278c4e4bd9fb 100644 --- a/tests/data/test1232 +++ b/tests/data/test1232 @@ -49,19 +49,19 @@ proxy # # Verify data after the test has been "shot" - -GET http://test.remote.haxx.se.%TESTNUMBER:8990/hej/but/%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.haxx.se.%TESTNUMBER:8990/hej/but/%TESTNUMBER0001 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.haxx.se.%TESTNUMBER:8990/hej/but/%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.haxx.se.%TESTNUMBER:8990/hej/but/%TESTNUMBER0001 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1233 b/tests/data/test1233 index 95635334968d..e8b45cd04067 100644 --- a/tests/data/test1233 +++ b/tests/data/test1233 @@ -32,16 +32,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1235 b/tests/data/test1235 index 56664f3f0e82..553d59779539 100644 --- a/tests/data/test1235 +++ b/tests/data/test1235 @@ -40,27 +40,27 @@ multiple requests using {}{} in the URL # Verify data after the test has been "shot" - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1237 b/tests/data/test1237 index e81d872aa992..2dec456bb472 100644 --- a/tests/data/test1237 +++ b/tests/data/test1237 @@ -33,13 +33,13 @@ URL with 1000+ letter user name + password # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1239 b/tests/data/test1239 index 601f45459de0..5f430220f3f9 100644 --- a/tests/data/test1239 +++ b/tests/data/test1239 @@ -41,13 +41,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "-dec 12 12:00:00 1999 GMT" -w '%{respon # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Unmodified-Since: Sun, 12 Dec 1999 12:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Unmodified-Since: Sun, 12 Dec 1999 12:00:00 GMT + HTTP/1.1 200 OK diff --git a/tests/data/test124 b/tests/data/test124 index d2717949c930..e89f8c557d48 100644 --- a/tests/data/test124 +++ b/tests/data/test124 @@ -32,16 +32,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1240 b/tests/data/test1240 index 5e99f8aff095..59656d6ca1c5 100644 --- a/tests/data/test1240 +++ b/tests/data/test1240 @@ -31,17 +31,17 @@ glob [0-1] with stuff after range (7.33.0 regression) # Verify data after the test has been "shot" - -GET /00/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /01/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /00/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /01/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1241 b/tests/data/test1241 index e114ad326a5f..d6ea187601bf 100644 --- a/tests/data/test1241 +++ b/tests/data/test1241 @@ -48,19 +48,19 @@ proxy # # Verify data after the test has been "shot" - -GET http://test.remote.haxx.se.%TESTNUMBER:8990/../../hej/but/who/../%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.haxx.se.%TESTNUMBER:8990/../../hej/but/who/../%TESTNUMBER0001 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.haxx.se.%TESTNUMBER:8990/../../hej/but/who/../%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.haxx.se.%TESTNUMBER:8990/../../hej/but/who/../%TESTNUMBER0001 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1244 b/tests/data/test1244 index fa8ac90753c5..238c0c609f3c 100644 --- a/tests/data/test1244 +++ b/tests/data/test1244 @@ -50,13 +50,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -x %HOSTIP:%HTTPPORT --next http://%HOSTIP: 56 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1245 b/tests/data/test1245 index 0814e7dc328a..ad096eaca575 100644 --- a/tests/data/test1245 +++ b/tests/data/test1245 @@ -42,12 +42,12 @@ ftp # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # 1 - Protocol ftp not supported or disabled in libcurl diff --git a/tests/data/test1246 b/tests/data/test1246 index 7723192fa14e..33859c469512 100644 --- a/tests/data/test1246 +++ b/tests/data/test1246 @@ -48,19 +48,19 @@ proxy # # Verify data after the test has been "shot" - -GET http://test.remote.haxx.se.%TESTNUMBER:%HTTPPORT/ HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://no-scheme-url.com.%TESTNUMBER:%HTTPPORT/ HTTP/1.1 -Host: no-scheme-url.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.haxx.se.%TESTNUMBER:%HTTPPORT/ HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://no-scheme-url.com.%TESTNUMBER:%HTTPPORT/ HTTP/1.1 +Host: no-scheme-url.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1248 b/tests/data/test1248 index 515b873519a5..4e9a5ae483bb 100644 --- a/tests/data/test1248 +++ b/tests/data/test1248 @@ -38,13 +38,13 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://dummy:%NOLISTENP # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1249 b/tests/data/test1249 index 83c79bff8408..00ffa64aee0d 100644 --- a/tests/data/test1249 +++ b/tests/data/test1249 @@ -41,13 +41,13 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://dummy:%NOLISTENP # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1250 b/tests/data/test1250 index 905810a45160..cc82fe9f5711 100644 --- a/tests/data/test1250 +++ b/tests/data/test1250 @@ -39,13 +39,13 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --noproxy %HOSTIP --max-time 5 # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1251 b/tests/data/test1251 index 3f1503575b77..4703d6a4347a 100644 --- a/tests/data/test1251 +++ b/tests/data/test1251 @@ -40,13 +40,13 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --max-time 5 # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1252 b/tests/data/test1252 index 0da6012d57f7..6daa4b167189 100644 --- a/tests/data/test1252 +++ b/tests/data/test1252 @@ -42,12 +42,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --noproxy # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1253 b/tests/data/test1253 index f6c4153f8667..615a5c0d991f 100644 --- a/tests/data/test1253 +++ b/tests/data/test1253 @@ -42,13 +42,13 @@ proxy # Verify data after the test has been "shot" - -GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 -Host: somewhere.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 +Host: somewhere.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1254 b/tests/data/test1254 index 07e77ed2a2ec..56299ffac2e2 100644 --- a/tests/data/test1254 +++ b/tests/data/test1254 @@ -42,13 +42,13 @@ proxy # Verify data after the test has been "shot" - -GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 -Host: somewhere.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 +Host: somewhere.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1255 b/tests/data/test1255 index 9316051b9918..78f0b47cffc7 100644 --- a/tests/data/test1255 +++ b/tests/data/test1255 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --noproxy %HOSTIP # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1256 b/tests/data/test1256 index b5dd610c0d0b..312b3ad6be16 100644 --- a/tests/data/test1256 +++ b/tests/data/test1256 @@ -44,13 +44,13 @@ proxy # Verify data after the test has been "shot" - -GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 -Host: somewhere.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 +Host: somewhere.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1257 b/tests/data/test1257 index 47245e9dd0a6..2812b9f0328a 100644 --- a/tests/data/test1257 +++ b/tests/data/test1257 @@ -44,13 +44,13 @@ proxy # Verify data after the test has been "shot" - -GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 -Host: somewhere.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 +Host: somewhere.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1258 b/tests/data/test1258 index ae4a33e4b228..81518de97eff 100644 --- a/tests/data/test1258 +++ b/tests/data/test1258 @@ -39,18 +39,18 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: localhost -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want?hoge=fuga HTTP/1.1 -Host: localhost -User-Agent: curl/%VERSION -Accept: */* -Cookie: I-am=here - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: localhost +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want?hoge=fuga HTTP/1.1 +Host: localhost +User-Agent: curl/%VERSION +Accept: */* +Cookie: I-am=here + diff --git a/tests/data/test1259 b/tests/data/test1259 index 981e8d77b790..4b98a5e467f6 100644 --- a/tests/data/test1259 +++ b/tests/data/test1259 @@ -33,13 +33,13 @@ HTTP URL with semicolon in password # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:pass]b64%O3dvcmQ= -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:pass]b64%O3dvcmQ= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test126 b/tests/data/test126 index b830fc77819f..f23feaabacbb 100644 --- a/tests/data/test126 +++ b/tests/data/test126 @@ -32,17 +32,17 @@ ftp://%HOSTIP:%FTPPORT/blalbla/lululul/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -CWD lululul -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +CWD lululul +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1261 b/tests/data/test1261 index 17a8af82c03b..7cfb8d762c09 100644 --- a/tests/data/test1261 +++ b/tests/data/test1261 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' --locati # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # CURLE_TOO_MANY_REDIRECTS diff --git a/tests/data/test1262 b/tests/data/test1262 index 0a7046ce9382..d094f3ece571 100644 --- a/tests/data/test1262 +++ b/tests/data/test1262 @@ -28,13 +28,13 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -z "-1 jan 2001" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -MDTM %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +MDTM %TESTNUMBER +QUIT diff --git a/tests/data/test1265 b/tests/data/test1265 index d5cc00b7105c..05dea240638e 100644 --- a/tests/data/test1265 +++ b/tests/data/test1265 @@ -46,12 +46,12 @@ http://%HOST6IP:%HTTP6PORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1266 b/tests/data/test1266 index 83975116dc48..733724c75a3d 100644 --- a/tests/data/test1266 +++ b/tests/data/test1266 @@ -33,12 +33,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http0.9 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1267 b/tests/data/test1267 index 42cf40c31dfb..b94ea3dc2e85 100644 --- a/tests/data/test1267 +++ b/tests/data/test1267 @@ -33,12 +33,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http0.9 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test127 b/tests/data/test127 index ebf122d018e4..72f813649ced 100644 --- a/tests/data/test127 +++ b/tests/data/test127 @@ -29,18 +29,18 @@ ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER --disable-epsv # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -CWD to -CWD file -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +CWD to +CWD file +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1270 b/tests/data/test1270 index 1e1fa67bb54f..22e056d9c802 100644 --- a/tests/data/test1270 +++ b/tests/data/test1270 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' -s # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1271 b/tests/data/test1271 index 3cc994b716d2..2e3f3128a2c5 100644 --- a/tests/data/test1271 +++ b/tests/data/test1271 @@ -35,12 +35,12 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w @%LOGDIR/blank%TESTNUMBER # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1272 b/tests/data/test1272 index 41fc3ef76f8e..ea2dd0331c7a 100644 --- a/tests/data/test1272 +++ b/tests/data/test1272 @@ -36,8 +36,8 @@ Gophers index # # Verify data after the test has been "shot" - -/%TESTNUMBER + +/%TESTNUMBER diff --git a/tests/data/test1273 b/tests/data/test1273 index fb5d47b2d409..c78ea0294324 100644 --- a/tests/data/test1273 +++ b/tests/data/test1273 @@ -69,13 +69,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - -f # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=100- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=100- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1274 b/tests/data/test1274 index 1568c1aa6f9e..dd53c1596430 100644 --- a/tests/data/test1274 +++ b/tests/data/test1274 @@ -43,12 +43,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/out%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1277 b/tests/data/test1277 index 52a0f675a2e8..7c7554bf0f92 100644 --- a/tests/data/test1277 +++ b/tests/data/test1277 @@ -178,15 +178,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Accept-Encoding: xxx -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Accept-Encoding: xxx +Connection: TE + diff --git a/tests/data/test128 b/tests/data/test128 index 089717da7964..86a48f0f7302 100644 --- a/tests/data/test128 +++ b/tests/data/test128 @@ -35,23 +35,23 @@ the # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +STOR %TESTNUMBER +QUIT - -file -with Unix newlines -meant to be -converted -with -the ---crlf option + +file +with Unix newlines +meant to be +converted +with +the +--crlf option diff --git a/tests/data/test1280 b/tests/data/test1280 index 081cbbe547a1..5d2023357ef3 100644 --- a/tests/data/test1280 +++ b/tests/data/test1280 @@ -33,27 +33,27 @@ http://%HOSTIP:%HTTPPORT/[a-d]/%TESTNUMBER # Verify data after the test has been "shot" - -GET /a/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /b/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /c/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /d/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /a/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /b/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /c/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /d/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1282 b/tests/data/test1282 index a54166be9661..ba5d545dca6b 100644 --- a/tests/data/test1282 +++ b/tests/data/test1282 @@ -29,9 +29,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com + +USER anonymous +PASS ftp@example.com # 67 == CURLE_LOGIN_DENIED diff --git a/tests/data/test1283 b/tests/data/test1283 index 1e8e9d44744e..93bca79a1cea 100644 --- a/tests/data/test1283 +++ b/tests/data/test1283 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/[a-a][1-1][b-b:1][2-2:1]/%TESTNUMBER -o "%LOGDIR/outfil # Verify data after the test has been "shot" - -GET /a1b2/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /a1b2/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1284 b/tests/data/test1284 index 925150b6e743..a319b0cf4792 100644 --- a/tests/data/test1284 +++ b/tests/data/test1284 @@ -67,22 +67,22 @@ HTTP POST --digest with user-specified Content-Length header # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="5763079608de439072861a59ac733515" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="5763079608de439072861a59ac733515" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test1286 b/tests/data/test1286 index b8b47e7ef509..90f5e40be70a 100644 --- a/tests/data/test1286 +++ b/tests/data/test1286 @@ -89,24 +89,24 @@ HTTP GET --digest increasing nonce-count if(s/^(Authorization: Digest )([^\r\n]+)(\r?\n)$//) { $_ = $1 . join(', ', map { s/^(cnonce=)"[a-zA-Z0-9+\/=]+"$/$1REMOVED/; s/^(response=)"[a-f0-9]{32}"$/$1REMOVED/; s/^qop="auth"$/qop=auth/; $_ } sort split(/, */, $2)) . $3; } - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest cnonce=REMOVED, nc=00000001, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/%TESTNUMBER", username="auser" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest cnonce=REMOVED, nc=00000002, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/%TESTNUMBER0001", username="auser" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest cnonce=REMOVED, nc=00000001, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/%TESTNUMBER", username="auser" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest cnonce=REMOVED, nc=00000002, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/%TESTNUMBER0001", username="auser" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1287 b/tests/data/test1287 index c9d2a6cb2db1..314f1efe037e 100644 --- a/tests/data/test1287 +++ b/tests/data/test1287 @@ -76,12 +76,12 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + * Ignoring Content-Length in CONNECT 200 response diff --git a/tests/data/test1288 b/tests/data/test1288 index e94bd5104d29..0581d0e7b07d 100644 --- a/tests/data/test1288 +++ b/tests/data/test1288 @@ -59,12 +59,12 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # This test is structured to test all the expectations of diff --git a/tests/data/test129 b/tests/data/test129 index 22e071d3e15b..c01842f07d00 100644 --- a/tests/data/test129 +++ b/tests/data/test129 @@ -42,12 +42,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # CURLE_UNSUPPORTED_PROTOCOL diff --git a/tests/data/test1290 b/tests/data/test1290 index 959247863ec7..293a2131c857 100644 --- a/tests/data/test1290 +++ b/tests/data/test1290 @@ -35,12 +35,12 @@ Verify URL globbing ignores [] # Verify data after the test has been "shot" - -GET /we/want/[]/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/[]/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1292 b/tests/data/test1292 index e674bfd89c1d..71b2aefa215b 100644 --- a/tests/data/test1292 +++ b/tests/data/test1292 @@ -37,12 +37,12 @@ Replaced internal headers with a blank one # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: -User-Agent: curl/%VERSION -Accept: - + +GET /%TESTNUMBER HTTP/1.1 +Host: +User-Agent: curl/%VERSION +Accept: + diff --git a/tests/data/test1293 b/tests/data/test1293 index afecfaf2f9bc..ec71b8a6a580 100644 --- a/tests/data/test1293 +++ b/tests/data/test1293 @@ -50,19 +50,19 @@ http://0 http://%HOSTIP:%HTTPPORT/%TESTNUMBER -F= s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 138 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data - - --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 138 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data + + +-------------------------------- diff --git a/tests/data/test1294 b/tests/data/test1294 index 58e2d379e0cb..887023959bd2 100644 --- a/tests/data/test1294 +++ b/tests/data/test1294 @@ -51,13 +51,13 @@ http://%HOSTIP:%HTTPPORT/0123456790123456790123456790123456790123456790123456790 # # Verify data after the test has been "shot" - -GET /012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small to ___, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter: 511 - + +GET /012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small to ___, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter: 511 + diff --git a/tests/data/test1295 b/tests/data/test1295 index 5c963cae43e8..bfd13c73f635 100644 --- a/tests/data/test1295 +++ b/tests/data/test1295 @@ -51,15 +51,15 @@ http://%HOSTIP:%HTTPPORT/0123456790123456790123456790123456790123456790123456790 # # Verify data after the test has been "shot" - -POST /012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679: 300 -Content-Length: 165 -Content-Type: application/x-www-form-urlencoded - + +POST /012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679: 300 +Content-Length: 165 +Content-Type: application/x-www-form-urlencoded + Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table. diff --git a/tests/data/test1296 b/tests/data/test1296 index 316cc63bd71d..253c8c6c7a50 100644 --- a/tests/data/test1296 +++ b/tests/data/test1296 @@ -41,13 +41,13 @@ http://user%0aname:password@%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user%0aname:password]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user%0aname:password]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1297 b/tests/data/test1297 index 386154af30b3..eda49ba5f92e 100644 --- a/tests/data/test1297 +++ b/tests/data/test1297 @@ -50,12 +50,12 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # 52 - got nothing diff --git a/tests/data/test1298 b/tests/data/test1298 index cebe4a9f71f6..60c1b7b17e3d 100644 --- a/tests/data/test1298 +++ b/tests/data/test1298 @@ -42,13 +42,13 @@ HTTP GET special path with --request-target # # Verify data after the test has been "shot" - -GET XXX HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER - + +GET XXX HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER + diff --git a/tests/data/test1299 b/tests/data/test1299 index 11ac0c41f7eb..a0781bc9e598 100644 --- a/tests/data/test1299 +++ b/tests/data/test1299 @@ -41,13 +41,13 @@ Send "OPTIONS *" with --request-target # # Verify data after the test has been "shot" - -OPTIONS * HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER - + +OPTIONS * HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER + diff --git a/tests/data/test13 b/tests/data/test13 index b8bcf164944e..90c53724d8a1 100644 --- a/tests/data/test13 +++ b/tests/data/test13 @@ -31,12 +31,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -X DELETE # Verify data after the test has been "shot" - -DELETE /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +DELETE /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test130 b/tests/data/test130 index 2c4dfe85eb54..91bde4910661 100644 --- a/tests/data/test130 +++ b/tests/data/test130 @@ -50,14 +50,14 @@ default login userdef password passwddef # # Verify data after the test has been "shot" - -USER user1 -PASS passwd1 -PWD -EPSV -TYPE A -LIST -QUIT + +USER user1 +PASS passwd1 +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test131 b/tests/data/test131 index 4a73de285013..4cff26ac5c5b 100644 --- a/tests/data/test131 +++ b/tests/data/test131 @@ -47,14 +47,14 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - -USER user2 -PASS passwd2 -PWD -EPSV -TYPE A -LIST -QUIT + +USER user2 +PASS passwd2 +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1310 b/tests/data/test1310 index 49bb0d36df44..4d164596c9d2 100644 --- a/tests/data/test1310 +++ b/tests/data/test1310 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/junk -J -O --show-headers --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /junk HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /junk HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1311 b/tests/data/test1311 index 1a14547ced3d..e5942fe1d657 100644 --- a/tests/data/test1311 +++ b/tests/data/test1311 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test1312 b/tests/data/test1312 index b67fdded7966..fcf3cbc0a113 100644 --- a/tests/data/test1312 +++ b/tests/data/test1312 @@ -39,12 +39,12 @@ HTTP GET with -J, Content-Disposition and ; in filename # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test1313 b/tests/data/test1313 index 922dbc7613ac..16ce2bbf1008 100644 --- a/tests/data/test1313 +++ b/tests/data/test1313 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test1314 b/tests/data/test1314 index 40cd18971cba..3043466de3a9 100644 --- a/tests/data/test1314 +++ b/tests/data/test1314 @@ -63,19 +63,19 @@ proxy # Verify data after the test has been "shot" - -GET http://firstplace.example.com/want/%TESTNUMBER HTTP/1.1 -Host: firstplace.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://somewhere.example.com/reply/%TESTNUMBER HTTP/1.1 -Host: somewhere.example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://firstplace.example.com/want/%TESTNUMBER HTTP/1.1 +Host: firstplace.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://somewhere.example.com/reply/%TESTNUMBER HTTP/1.1 +Host: somewhere.example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1316 b/tests/data/test1316 index 2218b6e14742..08d9ec7b8509 100644 --- a/tests/data/test1316 +++ b/tests/data/test1316 @@ -60,14 +60,14 @@ ftp://ftp.%TESTNUMBER:%FTPPORT/ -p -x %HOSTIP:%PROXYPORT # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1317 b/tests/data/test1317 index 6ef065280d9e..d81358997e30 100644 --- a/tests/data/test1317 +++ b/tests/data/test1317 @@ -43,12 +43,12 @@ HTTP with --resolve # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1318 b/tests/data/test1318 index b7cc434eb3af..18188785d287 100644 --- a/tests/data/test1318 +++ b/tests/data/test1318 @@ -43,17 +43,17 @@ HTTP with --resolve and same host name using different cases # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: MiXeDcAsE.cOm:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: mixedcase.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: MiXeDcAsE.cOm:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: mixedcase.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1319 b/tests/data/test1319 index 2dd8870955b4..a4b32eec2103 100644 --- a/tests/data/test1319 +++ b/tests/data/test1319 @@ -63,12 +63,12 @@ pop3://pop.%TESTNUMBER:%POP3PORT/%TESTNUMBER -p -x %HOSTIP:%PROXYPORT -u user:se # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -RETR %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +RETR %TESTNUMBER +QUIT CONNECT pop.%TESTNUMBER:%POP3PORT HTTP/1.1 diff --git a/tests/data/test132 b/tests/data/test132 index 77d47c8fd2e7..d9b89436ebb5 100644 --- a/tests/data/test132 +++ b/tests/data/test132 @@ -47,14 +47,14 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - -USER mary -PASS mark -PWD -EPSV -TYPE A -LIST -QUIT + +USER mary +PASS mark +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1320 b/tests/data/test1320 index 9237ea5722e7..5061e8bed730 100644 --- a/tests/data/test1320 +++ b/tests/data/test1320 @@ -46,19 +46,19 @@ smtp://smtp.%TESTNUMBER:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. CONNECT smtp.%TESTNUMBER:%SMTPPORT HTTP/1.1 diff --git a/tests/data/test1321 b/tests/data/test1321 index 4fe83fefbb72..0ccd858c0d86 100644 --- a/tests/data/test1321 +++ b/tests/data/test1321 @@ -59,12 +59,12 @@ IMAP FETCH tunneled through HTTP proxy # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT CONNECT imap.%TESTNUMBER:%IMAPPORT HTTP/1.1 diff --git a/tests/data/test1322 b/tests/data/test1322 index a70952710911..6f87503432e2 100644 --- a/tests/data/test1322 +++ b/tests/data/test1322 @@ -44,12 +44,12 @@ HTTP with --resolve and hostname with trailing dot # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: example.com.:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: example.com.:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1324 b/tests/data/test1324 index 7669da7b67ea..30b404fe23a6 100644 --- a/tests/data/test1324 +++ b/tests/data/test1324 @@ -48,12 +48,12 @@ HTTP with --resolve and [ipv6address] # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: example.com:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: example.com:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1325 b/tests/data/test1325 index 67b31d58fe7f..622981bd455c 100644 --- a/tests/data/test1325 +++ b/tests/data/test1325 @@ -58,21 +58,21 @@ http://%HOSTIP:%HTTPPORT/we/%TESTNUMBER -L -d "moo" # # Verify data after the test has been "shot" - -POST /we/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooPOST /we/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - + +POST /we/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooPOST /we/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + moo diff --git a/tests/data/test1326 b/tests/data/test1326 index 89e5a79c7358..c712faea6fbc 100644 --- a/tests/data/test1326 +++ b/tests/data/test1326 @@ -40,9 +40,9 @@ telnet://%HOSTIP:%HTTPPORT --upload-file - # # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.0 - + +GET /we/want/%TESTNUMBER HTTP/1.0 + diff --git a/tests/data/test1327 b/tests/data/test1327 index c54f2a8898eb..cf1c9c7fbd4c 100644 --- a/tests/data/test1327 +++ b/tests/data/test1327 @@ -39,9 +39,9 @@ telnet://%HOSTIP:%HTTPPORT -T %LOGDIR/%TESTNUMBER.txt # # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.0 - + +GET /we/want/%TESTNUMBER HTTP/1.0 + diff --git a/tests/data/test1328 b/tests/data/test1328 index e913e19cea57..b650946a419c 100644 --- a/tests/data/test1328 +++ b/tests/data/test1328 @@ -54,17 +54,17 @@ HTTP GET a globbed range with -f # # Verify data after the test has been "shot" - -GET /%TESTNUMBER0000 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0000 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test133 b/tests/data/test133 index 4a2c46cde4b8..c125ed9f0436 100644 --- a/tests/data/test133 +++ b/tests/data/test133 @@ -47,14 +47,14 @@ machine %HOSTIP login mary password drfrank # # Verify data after the test has been "shot" - -USER mary -PASS drfrank -PWD -EPSV -TYPE A -LIST -QUIT + +USER mary +PASS drfrank +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1331 b/tests/data/test1331 index ed7462311240..9c211cf36663 100644 --- a/tests/data/test1331 +++ b/tests/data/test1331 @@ -72,21 +72,21 @@ proxy # Verify data after the test has been "shot" - -GET http://z.x.com/%TESTNUMBER HTTP/1.1 -Host: z.x.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://z.x.com/%TESTNUMBER HTTP/1.1 -Host: z.x.com -Proxy-Authorization: Basic %b64[myname:mypassword]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: proxycookie=weirdo - + +GET http://z.x.com/%TESTNUMBER HTTP/1.1 +Host: z.x.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://z.x.com/%TESTNUMBER HTTP/1.1 +Host: z.x.com +Proxy-Authorization: Basic %b64[myname:mypassword]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: proxycookie=weirdo + diff --git a/tests/data/test1332 b/tests/data/test1332 index 835294082329..c852d84b5d6f 100644 --- a/tests/data/test1332 +++ b/tests/data/test1332 @@ -57,21 +57,21 @@ http://%HOSTIP:%HTTPPORT/blah/%TESTNUMBER -L -d "moo" --post303 # # Verify data after the test has been "shot" - -POST /blah/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - + +POST /blah/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + moo diff --git a/tests/data/test1333 b/tests/data/test1333 index 5a5dd63a2d9a..050b041163b1 100644 --- a/tests/data/test1333 +++ b/tests/data/test1333 @@ -38,16 +38,16 @@ HTTP POST zero length, chunked-encoded # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded - -0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded + +0 + diff --git a/tests/data/test1334 b/tests/data/test1334 index 1a13864c2ea1..2c12a7ce7a35 100644 --- a/tests/data/test1334 +++ b/tests/data/test1334 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1335 b/tests/data/test1335 index 146ff6d91828..f98e879d41f0 100644 --- a/tests/data/test1335 +++ b/tests/data/test1335 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir="%LOGDIR" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1336 b/tests/data/test1336 index dd93b5f9fc1f..fabb3cf06856 100644 --- a/tests/data/test1336 +++ b/tests/data/test1336 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1337 b/tests/data/test1337 index 5dbddeea61d9..97815624200e 100644 --- a/tests/data/test1337 +++ b/tests/data/test1337 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1338 b/tests/data/test1338 index bc7b641e6ed7..beb58447cd67 100644 --- a/tests/data/test1338 +++ b/tests/data/test1338 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER --output- # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1339 b/tests/data/test1339 index a3533841d174..f6ee7ac0570d 100644 --- a/tests/data/test1339 +++ b/tests/data/test1339 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test134 b/tests/data/test134 index 207e4f5d4741..57403acf90d6 100644 --- a/tests/data/test134 +++ b/tests/data/test134 @@ -49,14 +49,14 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - -USER romulus -PASS rhemus -PWD -EPSV -TYPE A -LIST -QUIT + +USER romulus +PASS rhemus +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1340 b/tests/data/test1340 index 9b6c092da3bc..91072c0aac6f 100644 --- a/tests/data/test1340 +++ b/tests/data/test1340 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER -w "curl # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1341 b/tests/data/test1341 index 74cfd3b35423..0dcd2d03a8a7 100644 --- a/tests/data/test1341 +++ b/tests/data/test1341 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - -w "curl saved to filename %{fil # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1342 b/tests/data/test1342 index 6d039f7ee36e..15e1f8ece0df 100644 --- a/tests/data/test1342 +++ b/tests/data/test1342 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER --output- # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1343 b/tests/data/test1343 index c6a18f2ba7d2..66401d14153c 100644 --- a/tests/data/test1343 +++ b/tests/data/test1343 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1344 b/tests/data/test1344 index de440520e050..50d9456932ca 100644 --- a/tests/data/test1344 +++ b/tests/data/test1344 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER --output- # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1345 b/tests/data/test1345 index a093e5d8cf70..ac5cb063dd58 100644 --- a/tests/data/test1345 +++ b/tests/data/test1345 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1346 b/tests/data/test1346 index af2a35cbabff..81b170ecb96f 100644 --- a/tests/data/test1346 +++ b/tests/data/test1346 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1347 b/tests/data/test1347 index bbef9f409c0b..e1e14cf568ae 100644 --- a/tests/data/test1347 +++ b/tests/data/test1347 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1348 b/tests/data/test1348 index b99ab58f8d3a..e072169f8577 100644 --- a/tests/data/test1348 +++ b/tests/data/test1348 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1349 b/tests/data/test1349 index 03f91ae23a80..63c06e2983df 100644 --- a/tests/data/test1349 +++ b/tests/data/test1349 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --out # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test135 b/tests/data/test135 index 3dc1d531f5b3..2780c03354bf 100644 --- a/tests/data/test135 +++ b/tests/data/test135 @@ -38,17 +38,17 @@ FTP retrieve a byte-range # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -REST 4 -RETR %TESTNUMBER -ABOR -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +REST 4 +RETR %TESTNUMBER +ABOR +QUIT diff --git a/tests/data/test1350 b/tests/data/test1350 index 60d3620773fb..5d7a36539419 100644 --- a/tests/data/test1350 +++ b/tests/data/test1350 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D - --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1351 b/tests/data/test1351 index 05a22ce62978..d05f9b026c38 100644 --- a/tests/data/test1351 +++ b/tests/data/test1351 @@ -30,16 +30,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER -- # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1352 b/tests/data/test1352 index ae94e5aad452..db093ab72b7d 100644 --- a/tests/data/test1352 +++ b/tests/data/test1352 @@ -30,16 +30,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D - --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1353 b/tests/data/test1353 index 45aad1c4baba..45308f1cf150 100644 --- a/tests/data/test1353 +++ b/tests/data/test1353 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D %LOGDIR/heads%TESTNUMBER -- # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1354 b/tests/data/test1354 index c7ff933cc1df..dfba8ba3a5ac 100644 --- a/tests/data/test1354 +++ b/tests/data/test1354 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D - --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1355 b/tests/data/test1355 index 7158a6e99fee..30f40eac39e1 100644 --- a/tests/data/test1355 +++ b/tests/data/test1355 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1356 b/tests/data/test1356 index e690747f1684..55161e143784 100644 --- a/tests/data/test1356 +++ b/tests/data/test1356 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1357 b/tests/data/test1357 index 926fd538d95f..25ce6b24b763 100644 --- a/tests/data/test1357 +++ b/tests/data/test1357 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --out # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1358 b/tests/data/test1358 index 14fc95afeed9..c5e3ce80fb1c 100644 --- a/tests/data/test1358 +++ b/tests/data/test1358 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D - --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1359 b/tests/data/test1359 index c26ac187b46e..e7d005860073 100644 --- a/tests/data/test1359 +++ b/tests/data/test1359 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER -- # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test136 b/tests/data/test136 index ef0b2c49ac74..949ae2ebb2d4 100644 --- a/tests/data/test136 +++ b/tests/data/test136 @@ -28,15 +28,15 @@ FTP with user and no password # Verify data after the test has been "shot" - -USER user -PASS -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER user +PASS +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1360 b/tests/data/test1360 index a7ed493023c3..794ba6453671 100644 --- a/tests/data/test1360 +++ b/tests/data/test1360 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D - --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1361 b/tests/data/test1361 index 18c9f5f08c97..13138941d703 100644 --- a/tests/data/test1361 +++ b/tests/data/test1361 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D %LOGDIR/heads%TESTNUMBER -- # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1362 b/tests/data/test1362 index 261950969b79..1ffa1a2e9aad 100644 --- a/tests/data/test1362 +++ b/tests/data/test1362 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D - --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1363 b/tests/data/test1363 index 022940257d20..876304a39cfd 100644 --- a/tests/data/test1363 +++ b/tests/data/test1363 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i --output-dir %LOGDIR # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1364 b/tests/data/test1364 index 2b3b566f6ab4..05b10105bb64 100644 --- a/tests/data/test1364 +++ b/tests/data/test1364 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/he # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1365 b/tests/data/test1365 index 1a28a77ede8d..8643199f2dbc 100644 --- a/tests/data/test1365 +++ b/tests/data/test1365 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1366 b/tests/data/test1366 index 1107c2281150..2b8d65ed2015 100644 --- a/tests/data/test1366 +++ b/tests/data/test1366 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/he # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1367 b/tests/data/test1367 index 5d1efa3a955c..d665b770d102 100644 --- a/tests/data/test1367 +++ b/tests/data/test1367 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1368 b/tests/data/test1368 index c9ee02169173..cbe8d64d6b42 100644 --- a/tests/data/test1368 +++ b/tests/data/test1368 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1369 b/tests/data/test1369 index 93627e6a484a..bc818ce774d4 100644 --- a/tests/data/test1369 +++ b/tests/data/test1369 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test137 b/tests/data/test137 index 33b93589ec36..43c4fcebf18a 100644 --- a/tests/data/test137 +++ b/tests/data/test137 @@ -31,17 +31,17 @@ ftp://%HOSTIP:%FTPPORT/blalbla/lululul/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -CWD lululul -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +CWD lululul +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1370 b/tests/data/test1370 index 637444c540e6..0a08c0b8e3bb 100644 --- a/tests/data/test1370 +++ b/tests/data/test1370 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1371 b/tests/data/test1371 index d05c1a15bf00..145a0a7a535f 100644 --- a/tests/data/test1371 +++ b/tests/data/test1371 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1372 b/tests/data/test1372 index a39a243c99dd..c005a39a74bf 100644 --- a/tests/data/test1372 +++ b/tests/data/test1372 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1373 b/tests/data/test1373 index 7d94775d6ffc..33634c92fbab 100644 --- a/tests/data/test1373 +++ b/tests/data/test1373 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1374 b/tests/data/test1374 index 95af862faa18..6dda00478881 100644 --- a/tests/data/test1374 +++ b/tests/data/test1374 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1375 b/tests/data/test1375 index f56a7d90b368..c226dc566f7a 100644 --- a/tests/data/test1375 +++ b/tests/data/test1375 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1376 b/tests/data/test1376 index 5b3280b0336e..ce11a423b774 100644 --- a/tests/data/test1376 +++ b/tests/data/test1376 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1377 b/tests/data/test1377 index 4bdc864bc1ee..52495d524b74 100644 --- a/tests/data/test1377 +++ b/tests/data/test1377 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1378 b/tests/data/test1378 index 199679cab636..42e0c4654165 100644 --- a/tests/data/test1378 +++ b/tests/data/test1378 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1379 b/tests/data/test1379 index 39b66ebe3b38..5faf44ac1bb3 100644 --- a/tests/data/test1379 +++ b/tests/data/test1379 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D %L # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test138 b/tests/data/test138 index db3b6ec7df26..765039d70c32 100644 --- a/tests/data/test138 +++ b/tests/data/test138 @@ -34,17 +34,17 @@ ftp://%HOSTIP:%FTPPORT/blalbla/lululul/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -CWD lululul -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +CWD lululul +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1380 b/tests/data/test1380 index cca8020eb047..02db86ac271f 100644 --- a/tests/data/test1380 +++ b/tests/data/test1380 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D - # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1381 b/tests/data/test1381 index 3455369a981f..4ae53c38cb35 100644 --- a/tests/data/test1381 +++ b/tests/data/test1381 @@ -30,16 +30,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1382 b/tests/data/test1382 index 78d05a321544..bce914faa682 100644 --- a/tests/data/test1382 +++ b/tests/data/test1382 @@ -30,16 +30,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1383 b/tests/data/test1383 index 96c3e9a27858..23a9ec55bae8 100644 --- a/tests/data/test1383 +++ b/tests/data/test1383 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1384 b/tests/data/test1384 index 4251c42a1e7f..459a4e0236b1 100644 --- a/tests/data/test1384 +++ b/tests/data/test1384 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1385 b/tests/data/test1385 index c14ddba20f69..33a5bb75de3d 100644 --- a/tests/data/test1385 +++ b/tests/data/test1385 @@ -29,16 +29,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1386 b/tests/data/test1386 index 72f13ca58283..622afb41c0d4 100644 --- a/tests/data/test1386 +++ b/tests/data/test1386 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1387 b/tests/data/test1387 index 43c28cc582e3..44b7d8aea2c5 100644 --- a/tests/data/test1387 +++ b/tests/data/test1387 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D %L # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1388 b/tests/data/test1388 index 0a3c173e50b4..6bb799727956 100644 --- a/tests/data/test1388 +++ b/tests/data/test1388 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D - # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1389 b/tests/data/test1389 index 0c648309e556..5c6979bd3195 100644 --- a/tests/data/test1389 +++ b/tests/data/test1389 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test139 b/tests/data/test139 index 160f628e2cb0..bde3f2d3b48a 100644 --- a/tests/data/test139 +++ b/tests/data/test139 @@ -31,17 +31,17 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -z "1 jan 1989" # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -MDTM %TESTNUMBER -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +MDTM %TESTNUMBER +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1390 b/tests/data/test1390 index 6b3f4dad3eb5..e263fef96966 100644 --- a/tests/data/test1390 +++ b/tests/data/test1390 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1391 b/tests/data/test1391 index 447a57829188..063294b8e7b6 100644 --- a/tests/data/test1391 +++ b/tests/data/test1391 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1392 b/tests/data/test1392 index 4af7966889e3..824cc214c2d9 100644 --- a/tests/data/test1392 +++ b/tests/data/test1392 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test1393 b/tests/data/test1393 index 492da66fc01d..08946ee9ec9f 100644 --- a/tests/data/test1393 +++ b/tests/data/test1393 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE file%TESTNUMBER -RETR file%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE file%TESTNUMBER +RETR file%TESTNUMBER +QUIT diff --git a/tests/data/test14 b/tests/data/test14 index 1bffda78d75f..32ff62746e2a 100644 --- a/tests/data/test14 +++ b/tests/data/test14 @@ -30,12 +30,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -i --head # Verify data after the test has been "shot" - -HEAD /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +HEAD /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test140 b/tests/data/test140 index 5e29f5c7c758..0910ff3dc2b1 100644 --- a/tests/data/test140 +++ b/tests/data/test140 @@ -30,13 +30,13 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -z "1 jan 2004" # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -MDTM %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +MDTM %TESTNUMBER +QUIT diff --git a/tests/data/test1400 b/tests/data/test1400 index 4a9e1e66a5fc..1ff85505ca28 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + s/(USERAGENT, \")[^\"]+/${1}stripped/ diff --git a/tests/data/test1401 b/tests/data/test1401 index bb5a7a97ac25..5cb90eeacb4b 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -48,16 +48,16 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[fake:user]b64% -User-Agent: MyUA -Accept: */* -Cookie: chocolate=chip -X-Files: Mulder -X-Men: cyclops, iceman - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[fake:user]b64% +User-Agent: MyUA +Accept: */* +Cookie: chocolate=chip +X-Files: Mulder +X-Men: cyclops, iceman + # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with diff --git a/tests/data/test1402 b/tests/data/test1402 index c973e7d8f8ca..9c0330532db4 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -41,14 +41,14 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 16 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 16 +Content-Type: application/x-www-form-urlencoded + foo=bar&baz=quux diff --git a/tests/data/test1403 b/tests/data/test1403 index a03da1d6d648..a6e56d9ff05a 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER?foo=bar&baz=quux HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER?foo=bar&baz=quux HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # curl's default user-agent varies with version, libraries etc. diff --git a/tests/data/test1405 b/tests/data/test1405 index b4560aa05213..1860f408c8e7 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -45,21 +45,21 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FA # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -NOOP 1 -FAIL -EPSV -PASV -TYPE I -NOOP 2 -FAIL HARD -SIZE %TESTNUMBER -RETR %TESTNUMBER -NOOP 3 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +NOOP 1 +FAIL +EPSV +PASV +TYPE I +NOOP 2 +FAIL HARD +SIZE %TESTNUMBER +RETR %TESTNUMBER +NOOP 3 +QUIT /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1406 b/tests/data/test1406 index a41276c45dce..bee4b337a4c9 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -47,20 +47,20 @@ ftp # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: SIZE=38 -RCPT TO: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: SIZE=38 +RCPT TO: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1407 b/tests/data/test1407 index 94724a6faed9..cb838fc06715 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -42,12 +42,12 @@ ftp # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -LIST %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +LIST %TESTNUMBER +QUIT /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1408 b/tests/data/test1408 index 5c7f6493dfea..d46634ebee34 100644 --- a/tests/data/test1408 +++ b/tests/data/test1408 @@ -56,18 +56,18 @@ HTTP receive cookies over IPV6 # # Verify data after the test has been "shot" - -GET /path/%TESTNUMBER0001 HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: time=1 - + +GET /path/%TESTNUMBER0001 HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: time=1 + diff --git a/tests/data/test141 b/tests/data/test141 index 425a98f2a631..7a7b4f648bc8 100644 --- a/tests/data/test141 +++ b/tests/data/test141 @@ -32,16 +32,16 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -I # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD blalbla -MDTM %TESTNUMBER -TYPE I -SIZE %TESTNUMBER -REST 0 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD blalbla +MDTM %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +REST 0 +QUIT Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT diff --git a/tests/data/test1411 b/tests/data/test1411 index 9c75a225cc2d..f70cfa48563a 100644 --- a/tests/data/test1411 +++ b/tests/data/test1411 @@ -46,13 +46,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T %LOGDIR/empty%TESTNUMBER # # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 + diff --git a/tests/data/test1412 b/tests/data/test1412 index 56e016a0c061..7b665f12abcd 100644 --- a/tests/data/test1412 +++ b/tests/data/test1412 @@ -101,29 +101,29 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth http://%HOST # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="0390dbe89e31adca0413d11f91f30e7f" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER0001", response="0085df91870374c8bf4e94415e7fbf8e" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="0390dbe89e31adca0413d11f91f30e7f" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER0001", response="0085df91870374c8bf4e94415e7fbf8e" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1413 b/tests/data/test1413 index 1ab4c1a818dc..c88f769824bd 100644 --- a/tests/data/test1413 +++ b/tests/data/test1413 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/this/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /this/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /this/moo.html/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /this/moo.html/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1415 b/tests/data/test1415 index 1e7090092f11..cfccdf397478 100644 --- a/tests/data/test1415 +++ b/tests/data/test1415 @@ -64,13 +64,13 @@ proxy # Verify data after the test has been "shot" - -GET http://example.com/we/want/%TESTNUMBER HTTP/1.1 -Host: example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://example.com/we/want/%TESTNUMBER HTTP/1.1 +Host: example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1416 b/tests/data/test1416 index 1af3b61f0803..d0efdf665d95 100644 --- a/tests/data/test1416 +++ b/tests/data/test1416 @@ -44,12 +44,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # 56 = CURLE_RECV_ERROR diff --git a/tests/data/test1417 b/tests/data/test1417 index 7c9be16b6e87..558da7da1eb1 100644 --- a/tests/data/test1417 +++ b/tests/data/test1417 @@ -56,12 +56,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 funky chunky! diff --git a/tests/data/test142 b/tests/data/test142 index f59555642e09..ffabe95ccfb8 100644 --- a/tests/data/test142 +++ b/tests/data/test142 @@ -26,165 +26,165 @@ ftp://%HOSTIP:%FTPPORT/part1/part2/part3/part4/part5/part6/part7/part8/part9/par # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD part1 -CWD part2 -CWD part3 -CWD part4 -CWD part5 -CWD part6 -CWD part7 -CWD part8 -CWD part9 -CWD part10 -CWD part11 -CWD part12 -CWD part13 -CWD part14 -CWD part15 -CWD part16 -CWD part17 -CWD part18 -CWD part19 -CWD part20 -CWD part21 -CWD part22 -CWD part23 -CWD part24 -CWD part25 -CWD part26 -CWD part27 -CWD part28 -CWD part29 -CWD part30 -CWD part31 -CWD part32 -CWD part33 -CWD part34 -CWD part35 -CWD part36 -CWD part37 -CWD part38 -CWD part39 -CWD part40 -CWD part41 -CWD part42 -CWD part43 -CWD part44 -CWD part45 -CWD part46 -CWD part47 -CWD part48 -CWD part49 -CWD part50 -CWD part51 -CWD part52 -CWD part53 -CWD part54 -CWD part55 -CWD part56 -CWD part57 -CWD part58 -CWD part59 -CWD part60 -CWD part61 -CWD part62 -CWD part63 -CWD part64 -CWD part65 -CWD part66 -CWD part67 -CWD part68 -CWD part69 -CWD part70 -CWD part71 -CWD part72 -CWD part73 -CWD part74 -CWD part75 -CWD part76 -CWD part77 -CWD part78 -CWD part79 -CWD part80 -CWD part81 -CWD part82 -CWD part83 -CWD part84 -CWD part85 -CWD part86 -CWD part87 -CWD part88 -CWD part89 -CWD part90 -CWD part91 -CWD part92 -CWD part93 -CWD part94 -CWD part95 -CWD part96 -CWD part97 -CWD part98 -CWD part99 -CWD part100 -CWD part101 -CWD part102 -CWD part103 -CWD part104 -CWD part105 -CWD part106 -CWD part107 -CWD part108 -CWD part109 -CWD part110 -CWD part111 -CWD part112 -CWD part113 -CWD part114 -CWD part115 -CWD part116 -CWD part117 -CWD part118 -CWD part119 -CWD part120 -CWD part121 -CWD part122 -CWD part123 -CWD part124 -CWD part125 -CWD part126 -CWD part127 -CWD part128 -CWD part129 -CWD part130 -CWD part131 -CWD part132 -CWD part133 -CWD part134 -CWD part135 -CWD part136 -CWD part137 -CWD part138 -CWD part139 -CWD part140 -CWD part141 -CWD part142 -CWD part143 -CWD part144 -CWD part145 -CWD part146 -CWD part147 -CWD part148 -CWD part149 -CWD part150 -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD part1 +CWD part2 +CWD part3 +CWD part4 +CWD part5 +CWD part6 +CWD part7 +CWD part8 +CWD part9 +CWD part10 +CWD part11 +CWD part12 +CWD part13 +CWD part14 +CWD part15 +CWD part16 +CWD part17 +CWD part18 +CWD part19 +CWD part20 +CWD part21 +CWD part22 +CWD part23 +CWD part24 +CWD part25 +CWD part26 +CWD part27 +CWD part28 +CWD part29 +CWD part30 +CWD part31 +CWD part32 +CWD part33 +CWD part34 +CWD part35 +CWD part36 +CWD part37 +CWD part38 +CWD part39 +CWD part40 +CWD part41 +CWD part42 +CWD part43 +CWD part44 +CWD part45 +CWD part46 +CWD part47 +CWD part48 +CWD part49 +CWD part50 +CWD part51 +CWD part52 +CWD part53 +CWD part54 +CWD part55 +CWD part56 +CWD part57 +CWD part58 +CWD part59 +CWD part60 +CWD part61 +CWD part62 +CWD part63 +CWD part64 +CWD part65 +CWD part66 +CWD part67 +CWD part68 +CWD part69 +CWD part70 +CWD part71 +CWD part72 +CWD part73 +CWD part74 +CWD part75 +CWD part76 +CWD part77 +CWD part78 +CWD part79 +CWD part80 +CWD part81 +CWD part82 +CWD part83 +CWD part84 +CWD part85 +CWD part86 +CWD part87 +CWD part88 +CWD part89 +CWD part90 +CWD part91 +CWD part92 +CWD part93 +CWD part94 +CWD part95 +CWD part96 +CWD part97 +CWD part98 +CWD part99 +CWD part100 +CWD part101 +CWD part102 +CWD part103 +CWD part104 +CWD part105 +CWD part106 +CWD part107 +CWD part108 +CWD part109 +CWD part110 +CWD part111 +CWD part112 +CWD part113 +CWD part114 +CWD part115 +CWD part116 +CWD part117 +CWD part118 +CWD part119 +CWD part120 +CWD part121 +CWD part122 +CWD part123 +CWD part124 +CWD part125 +CWD part126 +CWD part127 +CWD part128 +CWD part129 +CWD part130 +CWD part131 +CWD part132 +CWD part133 +CWD part134 +CWD part135 +CWD part136 +CWD part137 +CWD part138 +CWD part139 +CWD part140 +CWD part141 +CWD part142 +CWD part143 +CWD part144 +CWD part145 +CWD part146 +CWD part147 +CWD part148 +CWD part149 +CWD part150 +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT Allocations: 170 diff --git a/tests/data/test1420 b/tests/data/test1420 index 2cc70390629c..c3c3f6ffc8f7 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -48,12 +48,12 @@ ftp # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1422 b/tests/data/test1422 index 9aa95bf273d3..3d57e77d2f73 100644 --- a/tests/data/test1422 +++ b/tests/data/test1422 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O file://%FILE_PWD/%LOGDIR/name%TESTNUM # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1423 b/tests/data/test1423 index 16a4cf31fcf8..a49a04cbdd38 100644 --- a/tests/data/test1423 +++ b/tests/data/test1423 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER file://%FILE_ # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1424 b/tests/data/test1424 index 640582549d80..806906a63392 100644 --- a/tests/data/test1424 +++ b/tests/data/test1424 @@ -57,13 +57,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 11:00:00 1999 GMT" -o %LOGDIR/ou # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 11:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 11:00:00 GMT + diff --git a/tests/data/test1425 b/tests/data/test1425 index 63032181b2e1..681b06f6a606 100644 --- a/tests/data/test1425 +++ b/tests/data/test1425 @@ -49,12 +49,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1426 b/tests/data/test1426 index 737c7514f126..407a499dab08 100644 --- a/tests/data/test1426 +++ b/tests/data/test1426 @@ -49,12 +49,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --output - # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1428 b/tests/data/test1428 index 51d7721bce7f..5636f04710e7 100644 --- a/tests/data/test1428 +++ b/tests/data/test1428 @@ -68,14 +68,14 @@ Proxy-Connection: Keep-Alive header-type: proxy - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -Authorization: Basic %b64[iam:my:;self]b64% -User-Agent: curl/%VERSION -Accept: */* -header-type: server - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +Authorization: Basic %b64[iam:my:;self]b64% +User-Agent: curl/%VERSION +Accept: */* +header-type: server + diff --git a/tests/data/test1429 b/tests/data/test1429 index 3d8dce1a9571..d313bc4b89e8 100644 --- a/tests/data/test1429 +++ b/tests/data/test1429 @@ -57,12 +57,12 @@ Funny-head: yesyes -foo- 999 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test143 b/tests/data/test143 index ed89e70dec71..205cc1fc6df5 100644 --- a/tests/data/test143 +++ b/tests/data/test143 @@ -28,17 +28,17 @@ FTP URL with type=a # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -CWD tmp -CWD moo -EPSV -TYPE A -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +CWD tmp +CWD moo +EPSV +TYPE A +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1430 b/tests/data/test1430 index 11db3ccbfcfa..ebf025101ee9 100644 --- a/tests/data/test1430 +++ b/tests/data/test1430 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # 1 - CURLE_UNSUPPORTED_PROTOCOL # Due to invalid HTTP response code diff --git a/tests/data/test1431 b/tests/data/test1431 index 3f396a4a2185..b8a1b01dd41c 100644 --- a/tests/data/test1431 +++ b/tests/data/test1431 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 1 diff --git a/tests/data/test1432 b/tests/data/test1432 index 4789057a1b40..971e85417843 100644 --- a/tests/data/test1432 +++ b/tests/data/test1432 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 1 diff --git a/tests/data/test1433 b/tests/data/test1433 index aec6181a1eb3..852e056f70a3 100644 --- a/tests/data/test1433 +++ b/tests/data/test1433 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 1 diff --git a/tests/data/test1434 b/tests/data/test1434 index b6f775e0f603..92e7dbaa8549 100644 --- a/tests/data/test1434 +++ b/tests/data/test1434 @@ -76,13 +76,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 100 # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=100- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=100- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1435 b/tests/data/test1435 index 321ea4c022e1..01726bad2fb9 100644 --- a/tests/data/test1435 +++ b/tests/data/test1435 @@ -33,12 +33,12 @@ simple HTTP GET over Unix socket - -GET /%TESTNUMBER HTTP/1.1 -Host: server-interpreted.example.com -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: server-interpreted.example.com +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1436 b/tests/data/test1436 index f82384e58df9..dbb00f5ee0c2 100644 --- a/tests/data/test1436 +++ b/tests/data/test1436 @@ -47,22 +47,22 @@ HTTP requests with multiple connections over Unix socket - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: one.example.com -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: two.example.com -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0003 HTTP/1.1 -Host: one.example.com -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: one.example.com +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: two.example.com +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0003 HTTP/1.1 +Host: one.example.com +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1437 b/tests/data/test1437 index ad8fa080e11f..9d1183908756 100644 --- a/tests/data/test1437 +++ b/tests/data/test1437 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER", response="4376eb639bf8e7343a6e7b56e1b89c4f", algorithm=MD5 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER", response="4376eb639bf8e7343a6e7b56e1b89c4f", algorithm=MD5 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1438 b/tests/data/test1438 index cbf19550d0bc..d099d9182413 100644 --- a/tests/data/test1438 +++ b/tests/data/test1438 @@ -46,12 +46,12 @@ Content-Type: text/plain testdata http - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1439 b/tests/data/test1439 index 9a9196e4b6d8..17776a452b45 100644 --- a/tests/data/test1439 +++ b/tests/data/test1439 @@ -45,12 +45,12 @@ Content-Type: text/plain testdata 1.1 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test144 b/tests/data/test144 index be2ca5c8c5a0..644cddda8be1 100644 --- a/tests/data/test144 +++ b/tests/data/test144 @@ -36,14 +36,14 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -PORT 127,0,0,1,243,212 -TYPE A -NLST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +PORT 127,0,0,1,243,212 +TYPE A +NLST +QUIT diff --git a/tests/data/test1443 b/tests/data/test1443 index c42480ae8768..125627043d52 100644 --- a/tests/data/test1443 +++ b/tests/data/test1443 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O --remote-time --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test1444 b/tests/data/test1444 index 2f4c8d068728..bbe80e12978d 100644 --- a/tests/data/test1444 +++ b/tests/data/test1444 @@ -32,16 +32,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --remote-time # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -MDTM %TESTNUMBER -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM %TESTNUMBER +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT # Verify the mtime of the file. The mtime is specifically chosen to be an even # number so that it can be represented exactly on a FAT file system. diff --git a/tests/data/test1448 b/tests/data/test1448 index f7ff09f952c0..dfc761ee84c4 100644 --- a/tests/data/test1448 +++ b/tests/data/test1448 @@ -57,17 +57,17 @@ http://%hex[%c3%a5%c3%a4%c3%b6]hex%.se:%HTTPPORT/%TESTNUMBER --resolve xn--4cab6 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: xn--4cab6c.se:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: xn--4cab6c.se:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: xn--4cab6c.se:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: xn--4cab6c.se:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1449 b/tests/data/test1449 index 0b9de0192c85..a65c705811b6 100644 --- a/tests/data/test1449 +++ b/tests/data/test1449 @@ -27,12 +27,12 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -r 36893488147419103232- # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +QUIT diff --git a/tests/data/test145 b/tests/data/test145 index 53f3f631d7bf..388c854f4b14 100644 --- a/tests/data/test145 +++ b/tests/data/test145 @@ -38,14 +38,14 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -PORT 127,0,0,1,243,212 -TYPE A -NLST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +PORT 127,0,0,1,243,212 +TYPE A +NLST +QUIT diff --git a/tests/data/test1455 b/tests/data/test1455 index 23b76ff78a07..5fa09e1c27cf 100644 --- a/tests/data/test1455 +++ b/tests/data/test1455 @@ -50,14 +50,14 @@ proxy s/^PROXY TCP4 %CLIENTIP %HOSTIP (\d*) %HTTPPORT/proxy-line/ - -proxy-line -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER - + +proxy-line +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER + diff --git a/tests/data/test1456 b/tests/data/test1456 index d846b41ebc61..6f1b0260d5c7 100644 --- a/tests/data/test1456 +++ b/tests/data/test1456 @@ -55,13 +55,13 @@ proxy s/PROXY TCP6 ::1 ::1 (\d+) (\d+)/PROXY TCP6 ::1 ::1 $2/ - -PROXY TCP6 ::1 ::1 %HTTP6PORT -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +PROXY TCP6 ::1 ::1 %HTTP6PORT +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1457 b/tests/data/test1457 index 235b8404ab10..c25133a964c6 100644 --- a/tests/data/test1457 +++ b/tests/data/test1457 @@ -49,12 +49,12 @@ line1line3 line2 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1458 b/tests/data/test1458 index 785ceae16f3e..45ff971b0a1f 100644 --- a/tests/data/test1458 +++ b/tests/data/test1458 @@ -43,12 +43,12 @@ HTTP with wildcard --resolve # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test146 b/tests/data/test146 index 803fbfc4d70b..af72284da945 100644 --- a/tests/data/test146 +++ b/tests/data/test146 @@ -34,22 +34,22 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/%TESTNU ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD first -CWD dir -CWD here -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -CWD / -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD first +CWD dir +CWD here +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +CWD / +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1465 b/tests/data/test1465 index b521d2f31f01..bef59be3c004 100644 --- a/tests/data/test1465 +++ b/tests/data/test1465 @@ -45,14 +45,14 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 24 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 24 +Content-Type: application/x-www-form-urlencoded + %hex[ab%81cd%00e\"?%0D%0A%09%01fghi%1Ajklm%FD]hex% diff --git a/tests/data/test1466 b/tests/data/test1466 index 315974ad413b..dda651ff4623 100644 --- a/tests/data/test1466 +++ b/tests/data/test1466 @@ -34,12 +34,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1467 b/tests/data/test1467 index 568670a71a13..cf77bcbb4e13 100644 --- a/tests/data/test1467 +++ b/tests/data/test1467 @@ -49,12 +49,12 @@ HTTP GET via SOCKS5 proxy via Unix sockets # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1468 b/tests/data/test1468 index 9836434d4a9f..a39e1e64a6fd 100644 --- a/tests/data/test1468 +++ b/tests/data/test1468 @@ -50,12 +50,12 @@ http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://localhost%SOC # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: this.is.a.host.name:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: this.is.a.host.name:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + atyp 3 => this.is.a.host.name diff --git a/tests/data/test147 b/tests/data/test147 index 769043d48904..9b17219f5eb0 100644 --- a/tests/data/test147 +++ b/tests/data/test147 @@ -36,20 +36,20 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/%TESTNUMBER --ftp-create-dirs ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD first -MKD first -CWD first -CWD dir -CWD here -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD first +MKD first +CWD first +CWD dir +CWD here +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1470 b/tests/data/test1470 index 5c3d74343441..54adeb6138de 100644 --- a/tests/data/test1470 +++ b/tests/data/test1470 @@ -51,12 +51,12 @@ https://this.is.a.host.name:%HTTPSPORT/%TESTNUMBER --insecure --proxy socks5h:// # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: this.is.a.host.name:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: this.is.a.host.name:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + atyp 3 => this.is.a.host.name diff --git a/tests/data/test1473 b/tests/data/test1473 index 4c0190cea021..1e21534c29b3 100644 --- a/tests/data/test1473 +++ b/tests/data/test1473 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1475 b/tests/data/test1475 index f88ef74ee279..2b483cb0ae36 100644 --- a/tests/data/test1475 +++ b/tests/data/test1475 @@ -71,13 +71,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - -f # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=100- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=100- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1479 b/tests/data/test1479 index 3677b673808e..68dc2b758ce1 100644 --- a/tests/data/test1479 +++ b/tests/data/test1479 @@ -41,17 +41,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # weird_server_reply diff --git a/tests/data/test148 b/tests/data/test148 index 051d31a9deac..7ff578336fea 100644 --- a/tests/data/test148 +++ b/tests/data/test148 @@ -36,14 +36,14 @@ ftp://%HOSTIP:%FTPPORT/attempt/to/get/this/%TESTNUMBER --ftp-create-dirs 9 - -USER anonymous -PASS ftp@example.com -PWD -CWD attempt -MKD attempt -CWD attempt -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD attempt +MKD attempt +CWD attempt +QUIT diff --git a/tests/data/test1480 b/tests/data/test1480 index 0f51f12b6445..6eea7504837c 100644 --- a/tests/data/test1480 +++ b/tests/data/test1480 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # weird_server_reply diff --git a/tests/data/test1481 b/tests/data/test1481 index 87aada2873e0..8f63141b8727 100644 --- a/tests/data/test1481 +++ b/tests/data/test1481 @@ -42,13 +42,13 @@ http://moo/ --libcurl %LOGDIR/test%TESTNUMBER.c --tls-max 1.3 --proxy-tlsv1 -x h # Verify data after the test has been "shot" - -GET http://moo/ HTTP/1.1 -Host: moo -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://moo/ HTTP/1.1 +Host: moo +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + s/(USERAGENT, \")[^\"]+/${1}stripped/ diff --git a/tests/data/test1482 b/tests/data/test1482 index 2a322f6a8663..30353e290957 100644 --- a/tests/data/test1482 +++ b/tests/data/test1482 @@ -60,12 +60,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 funky chunky! diff --git a/tests/data/test1483 b/tests/data/test1483 index 60ff2104b271..88827a2cc8c3 100644 --- a/tests/data/test1483 +++ b/tests/data/test1483 @@ -62,12 +62,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 funky chunky! diff --git a/tests/data/test1484 b/tests/data/test1484 index 52de029a0814..7cdce889dd2c 100644 --- a/tests/data/test1484 +++ b/tests/data/test1484 @@ -42,12 +42,12 @@ HTTP HEAD with response body to ignore # # Verify data after the test has been "shot" - -HEAD /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +HEAD /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1485 b/tests/data/test1485 index d89362f4658d..d36705bbf1ec 100644 --- a/tests/data/test1485 +++ b/tests/data/test1485 @@ -41,11 +41,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1487 b/tests/data/test1487 index a3eac5dbad26..3a0c8e83560b 100644 --- a/tests/data/test1487 +++ b/tests/data/test1487 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test149 b/tests/data/test149 index 404922b296c4..dfb16cfd850e 100644 --- a/tests/data/test149 +++ b/tests/data/test149 @@ -32,19 +32,19 @@ send away this contents ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD dir1 -EPSV -TYPE I -STOR %TESTNUMBER -CWD / -CWD dir2 -EPSV -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD dir1 +EPSV +TYPE I +STOR %TESTNUMBER +CWD / +CWD dir2 +EPSV +STOR %TESTNUMBER +QUIT send away this contents diff --git a/tests/data/test1492 b/tests/data/test1492 index 2e7e1f32ae8b..b2ef8f50d5f6 100644 --- a/tests/data/test1492 +++ b/tests/data/test1492 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/junk%TESTNUMBER -J -O --show-headers --output-dir %LOGD # # Verify data after the test has been "shot" - -GET /junk%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /junk%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test1493 b/tests/data/test1493 index f1d1fba5eba2..91797378117c 100644 --- a/tests/data/test1493 +++ b/tests/data/test1493 @@ -57,12 +57,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 funky chunky! diff --git a/tests/data/test1494 b/tests/data/test1494 index 5546831c0919..67b8dc33226d 100644 --- a/tests/data/test1494 +++ b/tests/data/test1494 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1495 b/tests/data/test1495 index 2c0f33f8dfbd..de725b7b4e1a 100644 --- a/tests/data/test1495 +++ b/tests/data/test1495 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 61 diff --git a/tests/data/test1496 b/tests/data/test1496 index dda32606f347..d669dedaa9da 100644 --- a/tests/data/test1496 +++ b/tests/data/test1496 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 61 diff --git a/tests/data/test1497 b/tests/data/test1497 index 94b19a251439..6e8caef8d602 100644 --- a/tests/data/test1497 +++ b/tests/data/test1497 @@ -44,17 +44,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 3 -o /dev/null # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1499 b/tests/data/test1499 index 9d79e1a38c5f..cb432f7c53e7 100644 --- a/tests/data/test1499 +++ b/tests/data/test1499 @@ -59,17 +59,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LO # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test15 b/tests/data/test15 index ba24d2e0b2c1..ec065e38fa5d 100644 --- a/tests/data/test15 +++ b/tests/data/test15 @@ -44,12 +44,12 @@ Content-Length: 26 Repeated nonsense-headers http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER 200 26 - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test150 b/tests/data/test150 index fb906bf4bcf3..a06c6421dad3 100644 --- a/tests/data/test150 +++ b/tests/data/test150 @@ -74,19 +74,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm --fail # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1501 b/tests/data/test1501 index 195c17998cd3..3382b87a852a 100644 --- a/tests/data/test1501 +++ b/tests/data/test1501 @@ -42,15 +42,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ 0 - -USER anonymous -PASS ftp@example.com -PWD -CWD %TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD %TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1502 b/tests/data/test1502 index e2639f404af0..c4c378c59e57 100644 --- a/tests/data/test1502 +++ b/tests/data/test1502 @@ -45,11 +45,11 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: google.com:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: google.com:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1503 b/tests/data/test1503 index c387b8d3c549..fe5783e31120 100644 --- a/tests/data/test1503 +++ b/tests/data/test1503 @@ -45,11 +45,11 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: google.com:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: google.com:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1504 b/tests/data/test1504 index 916a40ba8c77..3a9de6804e4b 100644 --- a/tests/data/test1504 +++ b/tests/data/test1504 @@ -45,11 +45,11 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: google.com:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: google.com:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1505 b/tests/data/test1505 index 61e634641a09..500abdf1279f 100644 --- a/tests/data/test1505 +++ b/tests/data/test1505 @@ -45,11 +45,11 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: google.com:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: google.com:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1506 b/tests/data/test1506 index af581ae6bf55..b08d1aeadf1c 100644 --- a/tests/data/test1506 +++ b/tests/data/test1506 @@ -9,36 +9,36 @@ verbose logs # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file @@ -64,23 +64,23 @@ HTTP GET connection cache limit (CURLMOPT_MAXCONNECTS) # Verify data after the test has been "shot" - -GET /path/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0004 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /path/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0004 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + ^Host:.* diff --git a/tests/data/test1507 b/tests/data/test1507 index e1eb12bc3682..afc87120566b 100644 --- a/tests/data/test1507 +++ b/tests/data/test1507 @@ -39,11 +39,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM:<%TESTNUMBER-realuser@example.com> -RCPT TO:<%TESTNUMBER-recipient@example.com> -DATA + +EHLO %TESTNUMBER +MAIL FROM:<%TESTNUMBER-realuser@example.com> +RCPT TO:<%TESTNUMBER-recipient@example.com> +DATA diff --git a/tests/data/test151 b/tests/data/test151 index 98035f8b4762..f50672cf19c5 100644 --- a/tests/data/test151 +++ b/tests/data/test151 @@ -34,12 +34,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1510 b/tests/data/test1510 index 4a80b7a1d2f6..447f6d00d856 100644 --- a/tests/data/test1510 +++ b/tests/data/test1510 @@ -61,23 +61,23 @@ HTTP GET connection cache limit (CURLOPT_MAXCONNECTS) # Verify data after the test has been "shot" - -GET /path/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0004 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /path/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0004 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + ^Host:.* diff --git a/tests/data/test1512 b/tests/data/test1512 index a0e321432b44..ff21e11aba36 100644 --- a/tests/data/test1512 +++ b/tests/data/test1512 @@ -60,15 +60,15 @@ GLOBAL CACHE test over two easy performs # Verify data after the test has been "shot" - -GET /path/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /path/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + ^Host:.* diff --git a/tests/data/test1513 b/tests/data/test1513 index 90c32229f75e..6957761af9fb 100644 --- a/tests/data/test1513 +++ b/tests/data/test1513 @@ -37,8 +37,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - - # 42 == CURLE_ABORTED_BY_CALLBACK 42 diff --git a/tests/data/test1514 b/tests/data/test1514 index b34406e0727b..571ee6daa6d4 100644 --- a/tests/data/test1514 +++ b/tests/data/test1514 @@ -39,26 +39,26 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Content-Length header is not present # Transfer-Encoding header is added automatically - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded -Expect: 100-continue - -1 -d -1 -u -1 -m -1 -m -1 -y -0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded +Expect: 100-continue + +1 +d +1 +u +1 +m +1 +m +1 +y +0 + diff --git a/tests/data/test1517 b/tests/data/test1517 index 18d1fcaf2f09..d2c477593c96 100644 --- a/tests/data/test1517 +++ b/tests/data/test1517 @@ -62,13 +62,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^(this is what we post to the silly web server)(\r)?\n// - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 45 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 45 +Content-Type: application/x-www-form-urlencoded + 0 diff --git a/tests/data/test1518 b/tests/data/test1518 index ea5304d1b6ad..09a7efb0147e 100644 --- a/tests/data/test1518 +++ b/tests/data/test1518 @@ -46,8 +46,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - - res 0 status 302 diff --git a/tests/data/test1519 b/tests/data/test1519 index f57f68544a43..d284bd96609f 100644 --- a/tests/data/test1519 +++ b/tests/data/test1519 @@ -46,8 +46,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - - res 0 status 302 diff --git a/tests/data/test152 b/tests/data/test152 index 31c2360192b8..aa5cf971decc 100644 --- a/tests/data/test152 +++ b/tests/data/test152 @@ -35,12 +35,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 22 diff --git a/tests/data/test1520 b/tests/data/test1520 index c360cabc75f3..eb398f414a46 100644 --- a/tests/data/test1520 +++ b/tests/data/test1520 @@ -39,25 +39,25 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - - -.. -.. - -.. - -body -. + +From: different +To: another + + +.. +.. + +.. + +body +. diff --git a/tests/data/test153 b/tests/data/test153 index a38cce6fa91d..44c06ca5b549 100644 --- a/tests/data/test153 +++ b/tests/data/test153 @@ -91,35 +91,35 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u testuser:testpass --digest http://%H ^Authorization.*cnonce - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0001", response="f4f83139396995bac665f24a1f1055c7" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0002", response="f84511b014fdd0ba6494f42871079c32" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/%TESTNUMBER0002", cnonce="MTA4MzIr", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm=MD5 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0001", response="f4f83139396995bac665f24a1f1055c7" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0002", response="f84511b014fdd0ba6494f42871079c32" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/%TESTNUMBER0002", cnonce="MTA4MzIr", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm=MD5 +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 401 Authorization Required swsclose diff --git a/tests/data/test1531 b/tests/data/test1531 index f80056ab06d4..865aeda1f8cf 100644 --- a/tests/data/test1531 +++ b/tests/data/test1531 @@ -25,13 +25,13 @@ CURLOPT_POSTFIELDS with binary data set after multi_add_handle # it should be detected and an error should be reported - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 8 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 8 +Content-Type: application/x-www-form-urlencoded + %hex[%2eabc%00xyz]hex% diff --git a/tests/data/test1532 b/tests/data/test1532 index 582f05a5bc13..fddfe5675de5 100644 --- a/tests/data/test1532 +++ b/tests/data/test1532 @@ -36,11 +36,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + 0 diff --git a/tests/data/test1533 b/tests/data/test1533 index a957bebbc7bf..e0d85669efa5 100644 --- a/tests/data/test1533 +++ b/tests/data/test1533 @@ -43,31 +43,31 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 41 - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -aaaPOST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +aaaPOST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + aaa diff --git a/tests/data/test1534 b/tests/data/test1534 index 0f98ad604349..d35b5cb1c5d7 100644 --- a/tests/data/test1534 +++ b/tests/data/test1534 @@ -38,11 +38,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + 0 diff --git a/tests/data/test1535 b/tests/data/test1535 index 477f3fac2895..dac9b2c85c46 100644 --- a/tests/data/test1535 +++ b/tests/data/test1535 @@ -37,11 +37,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + 0 diff --git a/tests/data/test1536 b/tests/data/test1536 index ea7ce3966a58..111e07766f1d 100644 --- a/tests/data/test1536 +++ b/tests/data/test1536 @@ -37,11 +37,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + 0 diff --git a/tests/data/test1540 b/tests/data/test1540 index dc1aa7011e0c..c3d918b4dac0 100644 --- a/tests/data/test1540 +++ b/tests/data/test1540 @@ -57,11 +57,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1541 b/tests/data/test1541 index 9b29f43534e3..9b7a479d5b63 100644 --- a/tests/data/test1541 +++ b/tests/data/test1541 @@ -64,11 +64,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1542 b/tests/data/test1542 index e9061a8f2bea..cdde885ce7f5 100644 --- a/tests/data/test1542 +++ b/tests/data/test1542 @@ -39,23 +39,23 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + == Info: Connection #0 to host %HOSTIP:%HTTPPORT left intact diff --git a/tests/data/test1543 b/tests/data/test1543 index 3aefe57ef11a..798b273e321e 100644 --- a/tests/data/test1543 +++ b/tests/data/test1543 @@ -52,15 +52,15 @@ CURLOPT_CURLU, URL with space and CURLINFO_EFFECTIVE_URL # # Verify data after the test has been "shot" - -GET /%20/with/%20space/%20/file HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%20/with/%20space/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%20/with/%20space/%20/file HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%20/with/%20space/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + res 0 diff --git a/tests/data/test1546 b/tests/data/test1546 index b83b7ee95fa1..facd30947500 100644 --- a/tests/data/test1546 +++ b/tests/data/test1546 @@ -47,14 +47,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + 61 diff --git a/tests/data/test1547 b/tests/data/test1547 index 067b3568edec..7e1625aa4b9e 100644 --- a/tests/data/test1547 +++ b/tests/data/test1547 @@ -42,15 +42,15 @@ ftp://%HOSTIP:%FTPPORT/test-%TESTNUMBER/ -P %CLIENTIP --ftp-pasv # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD test-%TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD test-%TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test1551 b/tests/data/test1551 index 8af8d6641e39..78999e883365 100644 --- a/tests/data/test1551 +++ b/tests/data/test1551 @@ -47,23 +47,23 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1552 b/tests/data/test1552 index fd35ca1f61c6..6e89c9c1e825 100644 --- a/tests/data/test1552 +++ b/tests/data/test1552 @@ -46,7 +46,5 @@ lib%TESTNUMBER # # Verify data after the test has been "shot" - - diff --git a/tests/data/test1553 b/tests/data/test1553 index 0c01ab3e6960..10863307374d 100644 --- a/tests/data/test1553 +++ b/tests/data/test1553 @@ -51,7 +51,5 @@ imap://non-existing-host.haxx.se:%IMAPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - - diff --git a/tests/data/test1555 b/tests/data/test1555 index e3c7e55c6921..b224f7c0edd0 100644 --- a/tests/data/test1555 +++ b/tests/data/test1555 @@ -37,8 +37,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - - # 42 == CURLE_ABORTED_BY_CALLBACK 42 diff --git a/tests/data/test1556 b/tests/data/test1556 index 80254da2d444..49ca0d90ade7 100644 --- a/tests/data/test1556 +++ b/tests/data/test1556 @@ -46,11 +46,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + -foo- diff --git a/tests/data/test1561 b/tests/data/test1561 index 1341d12130ce..aea133c628cf 100644 --- a/tests/data/test1561 +++ b/tests/data/test1561 @@ -76,17 +76,17 @@ Cookies set over HTTP can't override secure ones - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: www.example.com -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: www.example.com -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: www.example.com +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: www.example.com +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test1562 b/tests/data/test1562 index 88e442f7b20a..cfcc430985d0 100644 --- a/tests/data/test1562 +++ b/tests/data/test1562 @@ -48,23 +48,23 @@ Expire secure cookies over HTTPS - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: www.example.com -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: www.example.com -User-Agent: curl/%VERSION -Accept: */* -Cookie: foo=123 - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: www.example.com -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: www.example.com +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: www.example.com +User-Agent: curl/%VERSION +Accept: */* +Cookie: foo=123 + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: www.example.com +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1563 b/tests/data/test1563 index 6bf3ad905b4e..ab089213f33e 100644 --- a/tests/data/test1563 +++ b/tests/data/test1563 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -L -H "Host: www.example.com" 1 - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: www.example.com -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: www.example.com +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1566 b/tests/data/test1566 index be047dcebb57..b348352ebb13 100644 --- a/tests/data/test1566 +++ b/tests/data/test1566 @@ -46,13 +46,13 @@ downloaded already # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "123456" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "123456" + # verify that the target file is untouched diff --git a/tests/data/test1567 b/tests/data/test1567 index 68b1fe21102f..486d3eb9fbcc 100644 --- a/tests/data/test1567 +++ b/tests/data/test1567 @@ -48,23 +48,23 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1568 b/tests/data/test1568 index 899d9b59f19f..896077517aa2 100644 --- a/tests/data/test1568 +++ b/tests/data/test1568 @@ -71,18 +71,18 @@ http://%HOSTIP/%TESTNUMBER %HTTPPORT # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: lib%TESTNUMBER -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="9cbbd857a37e45f2bcad5c7d088191df" -User-Agent: lib%TESTNUMBER -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: lib%TESTNUMBER +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="9cbbd857a37e45f2bcad5c7d088191df" +User-Agent: lib%TESTNUMBER +Accept: */* + diff --git a/tests/data/test1569 b/tests/data/test1569 index 159a813919ee..b5d16e062288 100644 --- a/tests/data/test1569 +++ b/tests/data/test1569 @@ -40,19 +40,19 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE A -RETR %TESTNUMBER -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE A +RETR %TESTNUMBER +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test157 b/tests/data/test157 index 5ab45ec05b39..a29112175ab1 100644 --- a/tests/data/test157 +++ b/tests/data/test157 @@ -34,12 +34,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1570 b/tests/data/test1570 index 713ab5ea778c..57dc6b077e99 100644 --- a/tests/data/test1570 +++ b/tests/data/test1570 @@ -40,19 +40,19 @@ lib1569 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE A -NLST -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE A +NLST +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1571 b/tests/data/test1571 index e75423a73c1c..440711b39e01 100644 --- a/tests/data/test1571 +++ b/tests/data/test1571 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1572 b/tests/data/test1572 index 4c2329506ec3..968f76a9b889 100644 --- a/tests/data/test1572 +++ b/tests/data/test1572 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1575 b/tests/data/test1575 index 1d1e4b7ed392..5e44ca5ad488 100644 --- a/tests/data/test1575 +++ b/tests/data/test1575 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1576 b/tests/data/test1576 index 3b243bc632e2..459218fecce1 100644 --- a/tests/data/test1576 +++ b/tests/data/test1576 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - + CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1577 b/tests/data/test1577 index d5ff6a725d3a..e26d1c44eef3 100644 --- a/tests/data/test1577 +++ b/tests/data/test1577 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %TESTNUMBER ^User-Agent:.* - + CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1578 b/tests/data/test1578 index ba43782506aa..ede98d89cfe4 100644 --- a/tests/data/test1578 +++ b/tests/data/test1578 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - + CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test158 b/tests/data/test158 index db3a49b7f57b..89def179cccc 100644 --- a/tests/data/test158 +++ b/tests/data/test158 @@ -37,19 +37,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -F name=daniel ^Content-Type: multipart/form-data.* ^-----------------------.* - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 157 -Content-Type: multipart/form-data; boundary=----------------------------4f12fcdaa3bc - -------------------------------4f12fcdaa3bc -Content-Disposition: form-data; name="name" - -daniel -------------------------------4f12fcdaa3bc-- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 157 +Content-Type: multipart/form-data; boundary=----------------------------4f12fcdaa3bc + +------------------------------4f12fcdaa3bc +Content-Disposition: form-data; name="name" + +daniel +------------------------------4f12fcdaa3bc-- 52 diff --git a/tests/data/test1580 b/tests/data/test1580 index 629cf1ab451d..70b0f512f7e7 100644 --- a/tests/data/test1580 +++ b/tests/data/test1580 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1578 ^User-Agent:.* - + CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1581 b/tests/data/test1581 index 98c78b613a35..c2f800c18f6d 100644 --- a/tests/data/test1581 +++ b/tests/data/test1581 @@ -78,7 +78,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1582 b/tests/data/test1582 index 146863fd6994..e446c7508f02 100644 --- a/tests/data/test1582 +++ b/tests/data/test1582 @@ -42,11 +42,11 @@ https://%HOSTIP:%HTTPSPORT/ - -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -Accept: */* - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +Accept: */* + diff --git a/tests/data/test159 b/tests/data/test159 index cc183855a71f..b81faa17ac14 100644 --- a/tests/data/test159 +++ b/tests/data/test159 @@ -60,13 +60,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -0 # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1591 b/tests/data/test1591 index 738696db1c7d..f5971e8f2948 100644 --- a/tests/data/test1591 +++ b/tests/data/test1591 @@ -40,21 +40,21 @@ more than one byte # Verify data after the test has been "shot" - -PUT /bzz/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Trailer: my-super-awesome-trailer, my-other-awesome-trailer -Expect: 100-continue - -e -Hello Cloud! - -0 -my-super-awesome-trailer: trail1 -my-other-awesome-trailer: trail2 - + +PUT /bzz/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Transfer-Encoding: chunked +Trailer: my-super-awesome-trailer, my-other-awesome-trailer +Expect: 100-continue + +e +Hello Cloud! + +0 +my-super-awesome-trailer: trail1 +my-other-awesome-trailer: trail2 + diff --git a/tests/data/test1593 b/tests/data/test1593 index 60d9f0b87d68..daf70afa4e0c 100644 --- a/tests/data/test1593 +++ b/tests/data/test1593 @@ -36,11 +36,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Note here the lack of If-Modified-Since - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1594 b/tests/data/test1594 index a93f89d374a2..24128d257f56 100644 --- a/tests/data/test1594 +++ b/tests/data/test1594 @@ -36,11 +36,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + Retry-After 22 diff --git a/tests/data/test1595 b/tests/data/test1595 index 4dade7c199a3..6b11a8d7b828 100644 --- a/tests/data/test1595 +++ b/tests/data/test1595 @@ -35,11 +35,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + Retry-After 0 diff --git a/tests/data/test1596 b/tests/data/test1596 index 2f4084a28bf1..376fb5ebb8fb 100644 --- a/tests/data/test1596 +++ b/tests/data/test1596 @@ -36,11 +36,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + # Retry-After time is limited to 6 hours (21600 seconds) diff --git a/tests/data/test1598 b/tests/data/test1598 index eb0ade1040fe..a85c1246922b 100644 --- a/tests/data/test1598 +++ b/tests/data/test1598 @@ -40,20 +40,20 @@ more than one byte # Verify data after the test has been "shot" - -POST /bzz/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Trailer: my-super-awesome-trailer, my-other-awesome-trailer -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded - -11 -xxx=yyy&aaa=bbbbb -0 -my-super-awesome-trailer: trail1 -my-other-awesome-trailer: trail2 - + +POST /bzz/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Trailer: my-super-awesome-trailer, my-other-awesome-trailer +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded + +11 +xxx=yyy&aaa=bbbbb +0 +my-super-awesome-trailer: trail1 +my-other-awesome-trailer: trail2 + diff --git a/tests/data/test16 b/tests/data/test16 index be3fc8853cae..5184c202ea01 100644 --- a/tests/data/test16 +++ b/tests/data/test16 @@ -40,14 +40,14 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 -Host: we.want.that.site.com -Proxy-Authorization: Basic %b64[fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 +Host: we.want.that.site.com +Proxy-Authorization: Basic %b64[fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test160 b/tests/data/test160 index e74a40b66af1..957dbd7fa294 100644 --- a/tests/data/test160 +++ b/tests/data/test160 @@ -57,17 +57,17 @@ Connection: close surprise2 - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /wantmore/%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /wantmore/%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test161 b/tests/data/test161 index d8d779376154..201fe52bfaaf 100644 --- a/tests/data/test161 +++ b/tests/data/test161 @@ -34,14 +34,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # This doesn't send QUIT because of known bug: # "7.8 Premature transfer end but healthy control channel" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER # CURLE_PARTIAL_FILE = 18 diff --git a/tests/data/test1613 b/tests/data/test1613 index 040fae3301f3..fce1cb370a60 100644 --- a/tests/data/test1613 +++ b/tests/data/test1613 @@ -40,14 +40,14 @@ proxy - -OPTIONS * HTTP/1.1 -Host: www.example.org -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Testno: %TESTNUMBER - + +OPTIONS * HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Testno: %TESTNUMBER + diff --git a/tests/data/test1617 b/tests/data/test1617 index 0fe967bd27a7..623dd84a4462 100644 --- a/tests/data/test1617 +++ b/tests/data/test1617 @@ -61,15 +61,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection: this" -H "Con # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: this, TE -Connection: that - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: this, TE +Connection: that + diff --git a/tests/data/test162 b/tests/data/test162 index ec0cd2545a32..8de635b04496 100644 --- a/tests/data/test162 +++ b/tests/data/test162 @@ -44,14 +44,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --proxy-us # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + 22 diff --git a/tests/data/test1631 b/tests/data/test1631 index e838700fe790..161952caadb9 100644 --- a/tests/data/test1631 +++ b/tests/data/test1631 @@ -73,15 +73,15 @@ User-Agent: curl Proxy-Connection: Keep-Alive - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1632 b/tests/data/test1632 index 9d877f8f8798..81be0800638e 100644 --- a/tests/data/test1632 +++ b/tests/data/test1632 @@ -88,18 +88,18 @@ User-Agent: curl Proxy-Connection: Keep-Alive - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER0002 +RETR %TESTNUMBER0002 +QUIT diff --git a/tests/data/test1633 b/tests/data/test1633 index 0752575942c1..8934fab29d9f 100644 --- a/tests/data/test1633 +++ b/tests/data/test1633 @@ -69,31 +69,31 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -d moo --retry 1 -L # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooGET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded - -mooGET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooGET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooGET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1634 b/tests/data/test1634 index ee7a50871aa7..50dfec7fcca0 100644 --- a/tests/data/test1634 +++ b/tests/data/test1634 @@ -55,17 +55,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1 --fail # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1635 b/tests/data/test1635 index 751d46232c8b..a3a1c82e4791 100644 --- a/tests/data/test1635 +++ b/tests/data/test1635 @@ -44,17 +44,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1 --fail-with-body # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + moo diff --git a/tests/data/test164 b/tests/data/test164 index 83f7a107a126..b68876dbde2d 100644 --- a/tests/data/test164 +++ b/tests/data/test164 @@ -54,13 +54,13 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -r 0-10,12-15 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=0-10,12-15 -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=0-10,12-15 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test165 b/tests/data/test165 index 4996a3564f5b..9c686b685d36 100644 --- a/tests/data/test165 +++ b/tests/data/test165 @@ -46,19 +46,19 @@ http://www.%hex[%c3%a5%c3%a4%c3%b6]hex%.se/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - -GET http://www.xn--4cab6c.se/page/%TESTNUMBER HTTP/1.1 -Host: www.xn--4cab6c.se -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://www.xn--groe-xna.de/page/%TESTNUMBER HTTP/1.1 -Host: www.xn--groe-xna.de -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://www.xn--4cab6c.se/page/%TESTNUMBER HTTP/1.1 +Host: www.xn--4cab6c.se +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://www.xn--groe-xna.de/page/%TESTNUMBER HTTP/1.1 +Host: www.xn--groe-xna.de +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test167 b/tests/data/test167 index 7221e3c3236e..cf5358bc214c 100644 --- a/tests/data/test167 +++ b/tests/data/test167 @@ -58,22 +58,22 @@ http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --proxy http://% # Verify data after the test has been "shot" - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: Basic %b64[foo:bar]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: Basic %b64[foo:bar]b64% -Authorization: Digest username="digest", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="304c55b19dbcb9c7e7a3354abd11ba1b" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: Basic %b64[foo:bar]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: Basic %b64[foo:bar]b64% +Authorization: Digest username="digest", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="304c55b19dbcb9c7e7a3354abd11ba1b" +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1670 b/tests/data/test1670 index 34d79f766fce..ba46bda1bdc8 100644 --- a/tests/data/test1670 +++ b/tests/data/test1670 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%header{etag} %header{nope} %header{DAT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + "21025-dc7-39462498" Tue, 09 Nov 2010 14:49:00 GMT diff --git a/tests/data/test168 b/tests/data/test168 index db4473ce98a7..4a6ea11b5ef3 100644 --- a/tests/data/test168 +++ b/tests/data/test168 @@ -72,28 +72,28 @@ http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --proxy http://% # Verify data after the test has been "shot" - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="fb8608e00ad9239a3dedb14bc8575976" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="fb8608e00ad9239a3dedb14bc8575976" -Authorization: Digest username="digest", realm="realmweirdo", nonce="123456", uri="/%TESTNUMBER", response="bfecb43898f3db12543650d45493313b" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="fb8608e00ad9239a3dedb14bc8575976" +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="fb8608e00ad9239a3dedb14bc8575976" +Authorization: Digest username="digest", realm="realmweirdo", nonce="123456", uri="/%TESTNUMBER", response="bfecb43898f3db12543650d45493313b" +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test169 b/tests/data/test169 index 8a2bb108a91f..0b296a496eae 100644 --- a/tests/data/test169 +++ b/tests/data/test169 @@ -93,28 +93,28 @@ http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --proxy http://% # Verify data after the test has been "shot" - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Authorization: Digest username="digest", realm="r e a l m", nonce="abcdef", uri="/%TESTNUMBER", response="89b737a4b6eefde285c093c92e9bd6ea" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Authorization: Digest username="digest", realm="r e a l m", nonce="abcdef", uri="/%TESTNUMBER", response="89b737a4b6eefde285c093c92e9bd6ea" +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test17 b/tests/data/test17 index 67d2a9fcc750..97a37d85cfd5 100644 --- a/tests/data/test17 +++ b/tests/data/test17 @@ -43,12 +43,12 @@ request MOOO # Verify data after the test has been "shot" - -MOOO /that.site.com/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: agent007 license to drill -Accept: */* - + +MOOO /that.site.com/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: agent007 license to drill +Accept: */* + diff --git a/tests/data/test170 b/tests/data/test170 index f8c7357e681d..7bfb06fcb81f 100644 --- a/tests/data/test170 +++ b/tests/data/test170 @@ -34,15 +34,15 @@ http://a.galaxy.far.far.away/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --prox # Verify data after the test has been "shot" - -POST http://a.galaxy.far.far.away/%TESTNUMBER HTTP/1.1 -Host: a.galaxy.far.far.away -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - + +POST http://a.galaxy.far.far.away/%TESTNUMBER HTTP/1.1 +Host: a.galaxy.far.far.away +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + # 52 is CURLE_GOT_NOTHING diff --git a/tests/data/test1700 b/tests/data/test1700 index be5644db5a68..7ebc98790ed7 100644 --- a/tests/data/test1700 +++ b/tests/data/test1700 @@ -59,17 +59,17 @@ http://%HOSTIP:%HTTP2PORT/%TESTNUMBER --http2 http://%HOSTIP:%HTTP2PORT/%TESTNUM ^X-Forwarded-Proto:.* ^Via:.* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTP2PORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTP2PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTP2PORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTP2PORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 101 Switching Protocols diff --git a/tests/data/test1701 b/tests/data/test1701 index 469026d79d00..4af318b7eaee 100644 --- a/tests/data/test1701 +++ b/tests/data/test1701 @@ -50,14 +50,14 @@ http://%HOSTIP:%HTTP2PORT/%TESTNUMBER --http2 -d "datatosend" ^X-Forwarded-Proto:.* ^Via:.* - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTP2PORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTP2PORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 +Content-Type: application/x-www-form-urlencoded + datatosend diff --git a/tests/data/test1702 b/tests/data/test1702 index ce4a1c04d49b..6b7496c1b56a 100644 --- a/tests/data/test1702 +++ b/tests/data/test1702 @@ -49,12 +49,12 @@ http://%HOSTIP:%HTTP2PORT/%TESTNUMBER --http2 --head ^X-Forwarded-Proto:.* ^Via:.* - -HEAD /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTP2PORT -User-Agent: curl/%VERSION -Accept: */* - + +HEAD /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTP2PORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 101 Switching Protocols diff --git a/tests/data/test1704 b/tests/data/test1704 index 324551a068d7..8fd7ee57b597 100644 --- a/tests/data/test1704 +++ b/tests/data/test1704 @@ -47,15 +47,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http2 ^X-Forwarded-Proto:.* ^Via:.* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Upgrade: h2c -HTTP2-Settings: AAMAAABkAAQAAQAAAAIAAAAA -Connection: Upgrade, HTTP2-Settings - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Upgrade: h2c +HTTP2-Settings: AAMAAABkAAQAAQAAAAIAAAAA +Connection: Upgrade, HTTP2-Settings + # CURLE_WEIRD_SERVER_REPLY (8) diff --git a/tests/data/test171 b/tests/data/test171 index a03ec8a6883f..d913d1191e51 100644 --- a/tests/data/test171 +++ b/tests/data/test171 @@ -41,13 +41,13 @@ proxy # Verify data after the test has been "shot" - -GET http://z.x.com/%TESTNUMBER HTTP/1.1 -Host: z.x.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://z.x.com/%TESTNUMBER HTTP/1.1 +Host: z.x.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + # Netscape HTTP Cookie File diff --git a/tests/data/test1711 b/tests/data/test1711 index 077dd74be9ea..72016e3557a4 100644 --- a/tests/data/test1711 +++ b/tests/data/test1711 @@ -40,12 +40,12 @@ RCPT TO: DATA QUIT - -From: different -To: another - -%repeat[5000 x test in body... ]% -. + +From: different +To: another + +%repeat[5000 x test in body... ]% +. diff --git a/tests/data/test172 b/tests/data/test172 index 3a9a9ed6648a..5bdfbebcf83b 100644 --- a/tests/data/test172 +++ b/tests/data/test172 @@ -45,13 +45,13 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: nodomain=value; partmatch=present; tool=curl; name=fool - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: nodomain=value; partmatch=present; tool=curl; name=fool + diff --git a/tests/data/test174 b/tests/data/test174 index 399164425d34..f07db6ac2263 100644 --- a/tests/data/test174 +++ b/tests/data/test174 @@ -35,14 +35,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth -d "junkelij # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test175 b/tests/data/test175 index 2af0a9b843b2..1b5bb7fa9b25 100644 --- a/tests/data/test175 +++ b/tests/data/test175 @@ -63,21 +63,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u auser:apasswd --digest -d "junkelijunk" # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test176 b/tests/data/test176 index f86fa7f677e7..3d34b38b8824 100644 --- a/tests/data/test176 +++ b/tests/data/test176 @@ -64,22 +64,22 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u auser:apasswd --ntlm -d "junkelijunk" # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test177 b/tests/data/test177 index 2034876d9087..27bbfd83d4bc 100644 --- a/tests/data/test177 +++ b/tests/data/test177 @@ -39,14 +39,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u auser:apasswd --digest -d "junkelijunk" # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + diff --git a/tests/data/test178 b/tests/data/test178 index afff507273b2..60f93bf92fcc 100644 --- a/tests/data/test178 +++ b/tests/data/test178 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # weird_server_reply diff --git a/tests/data/test179 b/tests/data/test179 index e3869b7fbf16..7a91b34fc678 100644 --- a/tests/data/test179 +++ b/tests/data/test179 @@ -46,14 +46,14 @@ proxy # Verify data after the test has been "shot" - -GET http://supertrooper.fake/c/%TESTNUMBER HTTP/1.1 -Host: supertrooper.fake -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: moo2=indeed - + +GET http://supertrooper.fake/c/%TESTNUMBER HTTP/1.1 +Host: supertrooper.fake +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: moo2=indeed + diff --git a/tests/data/test1800 b/tests/data/test1800 index 222437e8e179..56a40806db7a 100644 --- a/tests/data/test1800 +++ b/tests/data/test1800 @@ -42,15 +42,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http2 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Upgrade: %H2CVER -HTTP2-Settings: AAMAAABkAAQAAQAAAAIAAAAA -Connection: Upgrade, HTTP2-Settings - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Upgrade: %H2CVER +HTTP2-Settings: AAMAAABkAAQAAQAAAAIAAAAA +Connection: Upgrade, HTTP2-Settings + diff --git a/tests/data/test1801 b/tests/data/test1801 index a65a2d5d4560..d5499b3cb9b5 100644 --- a/tests/data/test1801 +++ b/tests/data/test1801 @@ -49,15 +49,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http2 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Connection: Upgrade, HTTP2-Settings -Upgrade: %H2CVER -HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: Upgrade, HTTP2-Settings +Upgrade: %H2CVER +HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA + # CURLE_HTTP2: Send failure: Broken pipe diff --git a/tests/data/test182 b/tests/data/test182 index cb1e4f0c200e..90a088545545 100644 --- a/tests/data/test182 +++ b/tests/data/test182 @@ -29,15 +29,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test183 b/tests/data/test183 index ba0df8c2feae..f13ff2af4349 100644 --- a/tests/data/test183 +++ b/tests/data/test183 @@ -37,19 +37,19 @@ proxy # Verify data after the test has been "shot" - -GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 -Host: deathstar.another.galaxy -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://a.galaxy.far.far.away/%TESTNUMBER HTTP/1.1 -Host: a.galaxy.far.far.away -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 +Host: deathstar.another.galaxy +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://a.galaxy.far.far.away/%TESTNUMBER HTTP/1.1 +Host: a.galaxy.far.far.away +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test184 b/tests/data/test184 index 95c9e288b731..19d81cb03a7a 100644 --- a/tests/data/test184 +++ b/tests/data/test184 @@ -57,19 +57,19 @@ proxy # Verify data after the test has been "shot" - -GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 -Host: another.visitor.stay.a.while.stay.foreeeeeever -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://yet.another.host/%TESTNUMBER HTTP/1.1 -Host: yet.another.host -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 +Host: another.visitor.stay.a.while.stay.foreeeeeever +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://yet.another.host/%TESTNUMBER HTTP/1.1 +Host: yet.another.host +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test185 b/tests/data/test185 index 81093d2b0648..66bba00bf70d 100644 --- a/tests/data/test185 +++ b/tests/data/test185 @@ -57,19 +57,19 @@ proxy # Verify data after the test has been "shot" - -GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 -Host: another.visitor.stay.a.while.stay.foreeeeeever -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://deathstar.another.galaxy/go/west/%TESTNUMBER HTTP/1.1 -Host: another.visitor.stay.a.while.stay.foreeeeeever -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 +Host: another.visitor.stay.a.while.stay.foreeeeeever +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://deathstar.another.galaxy/go/west/%TESTNUMBER HTTP/1.1 +Host: another.visitor.stay.a.while.stay.foreeeeeever +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test186 b/tests/data/test186 index 006de7904776..ea9d4d1145e5 100644 --- a/tests/data/test186 +++ b/tests/data/test186 @@ -41,25 +41,25 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=daniel;type=moo/foo-.4" -F ^(Content-Type: multipart/form-data;|------------).* - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 341 -Content-Type: multipart/form-data; boundary=----------------------------212d9006ceb5 - -------------------------------212d9006ceb5 -Content-Disposition: form-data; name="name" -Content-Type: moo/foo-.4 - -daniel -------------------------------212d9006ceb5 -Content-Disposition: form-data; name="html" -Content-Type: text/html;charset=verymoo - -hello -------------------------------212d9006ceb5-- + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 341 +Content-Type: multipart/form-data; boundary=----------------------------212d9006ceb5 + +------------------------------212d9006ceb5 +Content-Disposition: form-data; name="name" +Content-Type: moo/foo-.4 + +daniel +------------------------------212d9006ceb5 +Content-Disposition: form-data; name="html" +Content-Type: text/html;charset=verymoo + +hello +------------------------------212d9006ceb5-- diff --git a/tests/data/test187 b/tests/data/test187 index aff3a9d1ade8..823bcdc47183 100644 --- a/tests/data/test187 +++ b/tests/data/test187 @@ -60,17 +60,17 @@ http://%HOSTIP:%HTTPPORT?oh=what-weird=test/%TESTNUMBER -L # Verify data after the test has been "shot" - -GET /?oh=what-weird=test/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /root/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /?oh=what-weird=test/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /root/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test188 b/tests/data/test188 index 00d29990f8eb..43fa70e726f7 100644 --- a/tests/data/test188 +++ b/tests/data/test188 @@ -57,19 +57,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 50 -L # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=50- -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=50- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=50- +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=50- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test189 b/tests/data/test189 index f4ff1fa366ad..6ca4b66e1733 100644 --- a/tests/data/test189 +++ b/tests/data/test189 @@ -51,19 +51,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 50 -L # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=50- -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=50- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=50- +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=50- +User-Agent: curl/%VERSION +Accept: */* + # 33 is CURLE_RANGE_ERROR diff --git a/tests/data/test190 b/tests/data/test190 index 033152f38083..2bd225ed9caa 100644 --- a/tests/data/test190 +++ b/tests/data/test190 @@ -37,11 +37,11 @@ ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER -m 10 28 - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path diff --git a/tests/data/test1904 b/tests/data/test1904 index 8f005365f6d8..4d359e4200b3 100644 --- a/tests/data/test1904 +++ b/tests/data/test1904 @@ -68,12 +68,12 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1905 b/tests/data/test1905 index a17425e42d70..f335a0113bb2 100644 --- a/tests/data/test1905 +++ b/tests/data/test1905 @@ -42,11 +42,11 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test1906 b/tests/data/test1906 index 6769d0cdb0ee..5a6eb7132662 100644 --- a/tests/data/test1906 +++ b/tests/data/test1906 @@ -39,11 +39,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test1907 b/tests/data/test1907 index 31a4cbc2d04a..d92427ccedf9 100644 --- a/tests/data/test1907 +++ b/tests/data/test1907 @@ -37,11 +37,11 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + Effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test1908 b/tests/data/test1908 index fe0b5d626ae9..a49c49db2245 100644 --- a/tests/data/test1908 +++ b/tests/data/test1908 @@ -57,15 +57,15 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + # strip out the (dynamic) expire date from the file so that the rest diff --git a/tests/data/test1909 b/tests/data/test1909 index 2d868cc0bb60..bcce977df63c 100644 --- a/tests/data/test1909 +++ b/tests/data/test1909 @@ -43,17 +43,17 @@ HTTP GET --retry-all-errors to overcome partial transfer # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test191 b/tests/data/test191 index 029369363129..b1cbb266a212 100644 --- a/tests/data/test191 +++ b/tests/data/test191 @@ -27,15 +27,15 @@ FTP URL with ?-letters in username and password # Verify data after the test has been "shot" - -USER use?r -PASS pass?word -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER use?r +PASS pass?word +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1910 b/tests/data/test1910 index 2653690200fc..8485119e6544 100644 --- a/tests/data/test1910 +++ b/tests/data/test1910 @@ -49,17 +49,17 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user%0aname:pass%0aword]b64% -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user%0aname:pass%0aword]b64% -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user%0aname:pass%0aword]b64% +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user%0aname:pass%0aword]b64% +Accept: */* + diff --git a/tests/data/test1919 b/tests/data/test1919 index b5f4bb17c260..ad2f851db85d 100644 --- a/tests/data/test1919 +++ b/tests/data/test1919 @@ -35,17 +35,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Bearer c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1 -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Bearer c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1 -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Bearer c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1 +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Bearer c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1 +Accept: */* + diff --git a/tests/data/test192 b/tests/data/test192 index 12ed68db641a..76912d227a34 100644 --- a/tests/data/test192 +++ b/tests/data/test192 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test193 b/tests/data/test193 index 9e4dac0448f0..398127d5224a 100644 --- a/tests/data/test193 +++ b/tests/data/test193 @@ -48,17 +48,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" -L # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1933 b/tests/data/test1933 index ef4013caa45f..15bbb9af733e 100644 --- a/tests/data/test1933 +++ b/tests/data/test1933 @@ -59,12 +59,12 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H ^Content-Type:.* ^Accept:.* - -GET /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-xxx-date, Signature=3d8e00a02e437211a596143dcd590fcc805b731365c68f7f48951ea6eda39c4f -X-Xxx-Date: 19700101T000000Z - + +GET /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-xxx-date, Signature=3d8e00a02e437211a596143dcd590fcc805b731365c68f7f48951ea6eda39c4f +X-Xxx-Date: 19700101T000000Z + diff --git a/tests/data/test1934 b/tests/data/test1934 index 86553a46338b..7aa3575e9f69 100644 --- a/tests/data/test1934 +++ b/tests/data/test1934 @@ -59,12 +59,12 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - -GET /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=cf8dc9a4af903a1a9bb1385d8e2366d780afb501e266436598438395e502d58c -X-Yyy-Date: 19700101T000000Z - + +GET /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=cf8dc9a4af903a1a9bb1385d8e2366d780afb501e266436598438395e502d58c +X-Yyy-Date: 19700101T000000Z + diff --git a/tests/data/test1935 b/tests/data/test1935 index 26701aee8d4b..26c9425376a4 100644 --- a/tests/data/test1935 +++ b/tests/data/test1935 @@ -59,12 +59,12 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - -GET /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/rrr/127/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=a0b11b97b54689428d4188b788ed32865d607822d85d3e91cf06141f479dac0b -X-Yyy-Date: 19700101T000000Z - + +GET /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/rrr/127/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=a0b11b97b54689428d4188b788ed32865d607822d85d3e91cf06141f479dac0b +X-Yyy-Date: 19700101T000000Z + diff --git a/tests/data/test1936 b/tests/data/test1936 index 0d100c55e1dc..2628b9230559 100644 --- a/tests/data/test1936 +++ b/tests/data/test1936 @@ -59,12 +59,12 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - -GET /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/rrr/sss/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=026b713d76b0789bd224c5e41322f74eed088f8a22fd15183ca68376c575c5b0 -X-Yyy-Date: 19700101T000000Z - + +GET /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/rrr/sss/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=026b713d76b0789bd224c5e41322f74eed088f8a22fd15183ca68376c575c5b0 +X-Yyy-Date: 19700101T000000Z + diff --git a/tests/data/test1937 b/tests/data/test1937 index b1bd518a9fe9..816b9c18d766 100644 --- a/tests/data/test1937 +++ b/tests/data/test1937 @@ -60,13 +60,13 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - -POST /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: PROVIDER14-HMAC-SHA256 Credential=keyId/19700101/region/service/provider14_request, SignedHeaders=content-type;host;x-provider2-date, Signature=4928ccf97a9e71fe27f91db5a3b3c943b6080d25e6f4df8593d4c38e7d1e849b -X-Provider2-Date: 19700101T000000Z -Content-Length: 8 - + +POST /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: PROVIDER14-HMAC-SHA256 Credential=keyId/19700101/region/service/provider14_request, SignedHeaders=content-type;host;x-provider2-date, Signature=4928ccf97a9e71fe27f91db5a3b3c943b6080d25e6f4df8593d4c38e7d1e849b +X-Provider2-Date: 19700101T000000Z +Content-Length: 8 + postData diff --git a/tests/data/test195 b/tests/data/test195 index be0c206d675f..5662bc5597ce 100644 --- a/tests/data/test195 +++ b/tests/data/test195 @@ -30,9 +30,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 67 - -USER anonymous -PASS ftp@example.com + +USER anonymous +PASS ftp@example.com diff --git a/tests/data/test1955 b/tests/data/test1955 index 67de2a1e8d97..2266529bbe36 100644 --- a/tests/data/test1955 +++ b/tests/data/test1955 @@ -59,16 +59,16 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -GET /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;tesmixcase;test2;test3;test_space;x-xxx-date, Signature=dd39202e9fb7b836ebf2abb83b114cae11ff3b6a169f0c64b290a774a873db9d -X-Xxx-Date: 19700101T000000Z -test3: 1234 -test2: -test_space: t s m end -tesMixCase: MixCase - + +GET /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;tesmixcase;test2;test3;test_space;x-xxx-date, Signature=dd39202e9fb7b836ebf2abb83b114cae11ff3b6a169f0c64b290a774a873db9d +X-Xxx-Date: 19700101T000000Z +test3: 1234 +test2: +test_space: t s m end +tesMixCase: MixCase + diff --git a/tests/data/test1956 b/tests/data/test1956 index 84b2a81e0285..a53e57c44d48 100644 --- a/tests/data/test1956 +++ b/tests/data/test1956 @@ -59,13 +59,13 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -GET /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=dfe78c8846a9b7d65d1eb4c1d6ea7bc886650d03f3568088cb8d5b4c3778287f -X-Xxx-Date: 19700101T000000Z -X-Xxx-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - + +GET /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=dfe78c8846a9b7d65d1eb4c1d6ea7bc886650d03f3568088cb8d5b4c3778287f +X-Xxx-Date: 19700101T000000Z +X-Xxx-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + diff --git a/tests/data/test1957 b/tests/data/test1957 index 2f538cc8e2fa..b30d9acdd366 100644 --- a/tests/data/test1957 +++ b/tests/data/test1957 @@ -59,13 +59,13 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -GET /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff -X-Xxx-Date: 19700101T000000Z -X-Xxx-Content-Sha256: arbitrary - + +GET /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff +X-Xxx-Date: 19700101T000000Z +X-Xxx-Content-Sha256: arbitrary + diff --git a/tests/data/test1958 b/tests/data/test1958 index 27be746d37ef..239a11eccb2f 100644 --- a/tests/data/test1958 +++ b/tests/data/test1958 @@ -59,13 +59,13 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -GET /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff -X-Xxx-Date: 19700101T000000Z -X-Xxx-Content-Sha256: arbitrary - + +GET /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff +X-Xxx-Date: 19700101T000000Z +X-Xxx-Content-Sha256: arbitrary + diff --git a/tests/data/test1959 b/tests/data/test1959 index c6c15cadf485..46ef85a678cf 100644 --- a/tests/data/test1959 +++ b/tests/data/test1959 @@ -59,13 +59,13 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -GET /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=7b343a4aa55d73ffc05005d84480bc705a3367373ed8cae1a1c0fbd2b3aa0483 -X-Xxx-Date: 19700101T000000Z -X-Xxx-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - + +GET /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=7b343a4aa55d73ffc05005d84480bc705a3367373ed8cae1a1c0fbd2b3aa0483 +X-Xxx-Date: 19700101T000000Z +X-Xxx-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + diff --git a/tests/data/test196 b/tests/data/test196 index c72cbebf49ec..60083affe3e8 100644 --- a/tests/data/test196 +++ b/tests/data/test196 @@ -32,11 +32,11 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --retry 1 -w '%{num_retries}\n' 67 - -USER anonymous -PASS ftp@example.com -USER anonymous -PASS ftp@example.com + +USER anonymous +PASS ftp@example.com +USER anonymous +PASS ftp@example.com 1 diff --git a/tests/data/test1964 b/tests/data/test1964 index cd148faf7108..b005bbf932be 100644 --- a/tests/data/test1964 +++ b/tests/data/test1964 @@ -58,12 +58,12 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H ^Content-Type:.* ^Accept:.* - -GET /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-xxx-date, Signature=35da102c1df68f2ef85ade08ecc212fa663a66e3a973146f6578a5c5426e9669 -X-Xxx-Date: 19700101T000000Z - + +GET /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-xxx-date, Signature=35da102c1df68f2ef85ade08ecc212fa663a66e3a973146f6578a5c5426e9669 +X-Xxx-Date: 19700101T000000Z + diff --git a/tests/data/test197 b/tests/data/test197 index d940b0dc38e9..31f132f8fde1 100644 --- a/tests/data/test197 +++ b/tests/data/test197 @@ -44,17 +44,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1000 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1970 b/tests/data/test1970 index 106a0e316274..b3d3a36a0e30 100644 --- a/tests/data/test1970 +++ b/tests/data/test1970 @@ -59,14 +59,14 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -PUT /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=a028756f42a859122e9609c1f90cae4b272d6b03bf60d9fd354138176dfa2260 -X-Amz-Date: 19700101T000000Z -x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -Content-Length: 0 - + +PUT /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=a028756f42a859122e9609c1f90cae4b272d6b03bf60d9fd354138176dfa2260 +X-Amz-Date: 19700101T000000Z +x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +Content-Length: 0 + diff --git a/tests/data/test1971 b/tests/data/test1971 index d6f550793323..57cb834e9524 100644 --- a/tests/data/test1971 +++ b/tests/data/test1971 @@ -52,17 +52,17 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -PUT /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=4a6e9b4af0542ffb83744c6852f8e1bfec14f2a67e6f6f037b39f172f79d62af -X-Amz-Date: 19700101T000000Z -x-amz-content-sha256: UNSIGNED-PAYLOAD -Transfer-Encoding: chunked -Expect: 100-continue - -0 - + +PUT /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=4a6e9b4af0542ffb83744c6852f8e1bfec14f2a67e6f6f037b39f172f79d62af +X-Amz-Date: 19700101T000000Z +x-amz-content-sha256: UNSIGNED-PAYLOAD +Transfer-Encoding: chunked +Expect: 100-continue + +0 + diff --git a/tests/data/test1972 b/tests/data/test1972 index 5a07d544d4fc..7b4168d119a3 100644 --- a/tests/data/test1972 +++ b/tests/data/test1972 @@ -62,19 +62,19 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -POST /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=eaee0f1c5984ad5d81c8bc7805f28c7b83b35322de654b2ace18cb8cf6d5a9cb -X-Amz-Date: 19700101T000000Z -x-amz-content-sha256: UNSIGNED-PAYLOAD -Content-Length: 154 - ---------------------------qrstuvwxyz0123456789AB -Content-Disposition: attachment; name="foo" - -bar ---------------------------qrstuvwxyz0123456789AB-- + +POST /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=eaee0f1c5984ad5d81c8bc7805f28c7b83b35322de654b2ace18cb8cf6d5a9cb +X-Amz-Date: 19700101T000000Z +x-amz-content-sha256: UNSIGNED-PAYLOAD +Content-Length: 154 + +--------------------------qrstuvwxyz0123456789AB +Content-Disposition: attachment; name="foo" + +bar +--------------------------qrstuvwxyz0123456789AB-- diff --git a/tests/data/test1974 b/tests/data/test1974 index b184ca4b5afa..f91606e362be 100644 --- a/tests/data/test1974 +++ b/tests/data/test1974 @@ -59,13 +59,13 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -GET /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=e6270423932feafe9b00ca5d60c9ed566be649f9ca9676144288273945153021 -X-Amz-Date: 19700101T000000Z -x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - + +GET /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=e6270423932feafe9b00ca5d60c9ed566be649f9ca9676144288273945153021 +X-Amz-Date: 19700101T000000Z +x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + diff --git a/tests/data/test1975 b/tests/data/test1975 index 1e980c5a82cc..92fd563da868 100644 --- a/tests/data/test1975 +++ b/tests/data/test1975 @@ -52,17 +52,17 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -PUT /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=a028756f42a859122e9609c1f90cae4b272d6b03bf60d9fd354138176dfa2260 -X-Amz-Date: 19700101T000000Z -Transfer-Encoding: chunked -X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -Expect: 100-continue - -0 - + +PUT /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=a028756f42a859122e9609c1f90cae4b272d6b03bf60d9fd354138176dfa2260 +X-Amz-Date: 19700101T000000Z +Transfer-Encoding: chunked +X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +Expect: 100-continue + +0 + diff --git a/tests/data/test1977 b/tests/data/test1977 index c105c46662be..f2c1ead98614 100644 --- a/tests/data/test1977 +++ b/tests/data/test1977 @@ -44,19 +44,19 @@ effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo&bar - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER?foo HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER?foo&bar HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER?foo HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER?foo&bar HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test198 b/tests/data/test198 index 95b1f99e1cef..e1e81aee51f6 100644 --- a/tests/data/test198 +++ b/tests/data/test198 @@ -53,17 +53,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1000 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test199 b/tests/data/test199 index 1289fd2d9b33..4965d3ce935a 100644 --- a/tests/data/test199 +++ b/tests/data/test199 @@ -42,17 +42,17 @@ HTTP with -d, -G and {} # # Verify data after the test has been "shot" - -GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2 b/tests/data/test2 index 86ec605dba5b..79d2cf9b7c2a 100644 --- a/tests/data/test2 +++ b/tests/data/test2 @@ -36,13 +36,13 @@ HTTP GET with user and password # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[fake:user]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[fake:user]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2005 b/tests/data/test2005 index 91e256298a40..51e90782a91e 100644 --- a/tests/data/test2005 +++ b/tests/data/test2005 @@ -43,13 +43,13 @@ machine example.com # # Verify data after the test has been "shot" - -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[:5up3r53cr37]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[:5up3r53cr37]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2023 b/tests/data/test2023 index 9c3cc94c0a82..3626499be107 100644 --- a/tests/data/test2023 +++ b/tests/data/test2023 @@ -119,32 +119,32 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic basic # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + diff --git a/tests/data/test2024 b/tests/data/test2024 index e79285bc7bbf..b2d6f729ae28 100644 --- a/tests/data/test2024 +++ b/tests/data/test2024 @@ -134,32 +134,32 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0200", response="ed646c565f79e2dd9fa37cb5a621213c" -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0400", response="9741ced8caacc6124770187b36f007c5" -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/%TESTNUMBER0500", response="5bc77ec8c2d443b27a1b55f1fd8fbb13" -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0200", response="ed646c565f79e2dd9fa37cb5a621213c" +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0400", response="9741ced8caacc6124770187b36f007c5" +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/%TESTNUMBER0500", response="5bc77ec8c2d443b27a1b55f1fd8fbb13" +Accept: */* + diff --git a/tests/data/test2025 b/tests/data/test2025 index 7982b68d22e6..9f6dd4176da9 100644 --- a/tests/data/test2025 +++ b/tests/data/test2025 @@ -216,47 +216,47 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic ntlm # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + diff --git a/tests/data/test2026 b/tests/data/test2026 index ee434319d49f..e3b5e946cce6 100644 --- a/tests/data/test2026 +++ b/tests/data/test2026 @@ -170,40 +170,40 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest basic # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="5f992a2e761ab926256419f7c685f85b" -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/%TESTNUMBER0300", response="132242e602882251929be93228c830ae" -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="5f992a2e761ab926256419f7c685f85b" +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/%TESTNUMBER0300", response="132242e602882251929be93228c830ae" +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + diff --git a/tests/data/test2027 b/tests/data/test2027 index 259e439504df..b4ca0e327ddc 100644 --- a/tests/data/test2027 +++ b/tests/data/test2027 @@ -193,45 +193,45 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="f7fd60eefaff5225971bf9b3d80d6ba6" -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0200", response="785ca3ef511999f7e9c178195f5b388c" -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/%TESTNUMBER0300", response="4c735d2360fd6848e7cb32a11ae3612b" -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead" -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead" -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/%TESTNUMBER0500", response="8ef4d935fd964a46c3965c0863b52cf1" -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="f7fd60eefaff5225971bf9b3d80d6ba6" +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0200", response="785ca3ef511999f7e9c178195f5b388c" +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/%TESTNUMBER0300", response="4c735d2360fd6848e7cb32a11ae3612b" +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead" +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead" +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/%TESTNUMBER0500", response="8ef4d935fd964a46c3965c0863b52cf1" +Accept: */* + diff --git a/tests/data/test2028 b/tests/data/test2028 index 461d7ba6a814..ef87640ac80b 100644 --- a/tests/data/test2028 +++ b/tests/data/test2028 @@ -253,55 +253,55 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest ntlm # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="53c80666f5e3a4a55f92a66aaf0078bb" -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/%TESTNUMBER0300", response="1aa5d90da9803ca12d04b24e0f19476e" -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="53c80666f5e3a4a55f92a66aaf0078bb" +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/%TESTNUMBER0300", response="1aa5d90da9803ca12d04b24e0f19476e" +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + diff --git a/tests/data/test2029 b/tests/data/test2029 index 7adadaa57e39..9b43d0f87f7a 100644 --- a/tests/data/test2029 +++ b/tests/data/test2029 @@ -189,42 +189,42 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ntlm basic # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:wrongpass]b64% -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:wrongpass]b64% +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + diff --git a/tests/data/test2030 b/tests/data/test2030 index 4961e668d6de..2baee6731193 100644 --- a/tests/data/test2030 +++ b/tests/data/test2030 @@ -242,47 +242,47 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ntlm digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0200", response="2f2d784ba53a0a307758a90e98d25c27" -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="d6262e9147db08c62ff2f53b515861e8" -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="d6262e9147db08c62ff2f53b515861e8" -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/%TESTNUMBER0500", response="198757e61163a779cf24ed4c49c1ad7d" -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0200", response="2f2d784ba53a0a307758a90e98d25c27" +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="d6262e9147db08c62ff2f53b515861e8" +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="d6262e9147db08c62ff2f53b515861e8" +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/%TESTNUMBER0500", response="198757e61163a779cf24ed4c49c1ad7d" +Accept: */* + diff --git a/tests/data/test2031 b/tests/data/test2031 index b464b0b7a2f8..1d3b168e5f43 100644 --- a/tests/data/test2031 +++ b/tests/data/test2031 @@ -255,57 +255,57 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ntlm ntlm # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0300 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0400 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0500 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0400 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0500 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + diff --git a/tests/data/test2032 b/tests/data/test2032 index 06aa1ebfacb8..403ca153638c 100644 --- a/tests/data/test2032 +++ b/tests/data/test2032 @@ -88,27 +88,27 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* + diff --git a/tests/data/test2033 b/tests/data/test2033 index 2973eb89879c..447e8c533052 100644 --- a/tests/data/test2033 +++ b/tests/data/test2033 @@ -47,12 +47,12 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2034 b/tests/data/test2034 index adb4f1767134..a2ecffdb412b 100644 --- a/tests/data/test2034 +++ b/tests/data/test2034 @@ -43,12 +43,12 @@ simple HTTPS GET with DER public key pinning # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2037 b/tests/data/test2037 index 9f229cfd3ea8..138f573004f6 100644 --- a/tests/data/test2037 +++ b/tests/data/test2037 @@ -43,12 +43,12 @@ simple HTTPS GET with PEM public key pinning # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2039 b/tests/data/test2039 index 7cab984ce5ab..c7e7acb63ff9 100644 --- a/tests/data/test2039 +++ b/tests/data/test2039 @@ -48,14 +48,14 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - -USER userdef -PASS passwddef -PWD -EPSV -TYPE A -LIST -QUIT + +USER userdef +PASS passwddef +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test2040 b/tests/data/test2040 index 6537d193e3c4..ab7987cb2be1 100644 --- a/tests/data/test2040 +++ b/tests/data/test2040 @@ -47,18 +47,18 @@ HTTP Basic authorization, then without authorization # Verify data after the test has been "shot" - -GET /%TESTNUMBER0100 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0200 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0200 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + Finally, this is the real page! diff --git a/tests/data/test2041 b/tests/data/test2041 index 71112c27f8b2..75da98ba9efe 100644 --- a/tests/data/test2041 +++ b/tests/data/test2041 @@ -43,12 +43,12 @@ simple HTTPS GET with base64-sha256 public key pinning # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2046 b/tests/data/test2046 index 555515aa4a31..4eb6ce69999e 100644 --- a/tests/data/test2046 +++ b/tests/data/test2046 @@ -57,17 +57,17 @@ http://%hex[%c3%a5%c3%a4%c3%b6]hex%.se:%HTTPPORT/%TESTNUMBER --resolve xn--4cab6 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: xn--4cab6c.se:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: xn--4cab6c.se:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: xn--4cab6c.se:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: xn--4cab6c.se:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2047 b/tests/data/test2047 index 9c671b178536..ac934a6f7671 100644 --- a/tests/data/test2047 +++ b/tests/data/test2047 @@ -58,19 +58,19 @@ http://%hex[%c3%a5%c3%a4%c3%b6]hex%.se/%TESTNUMBER -x %HOSTIP:%HTTPPORT -w "%{nu # # Verify data after the test has been "shot" - -GET http://xn--4cab6c.se/%TESTNUMBER HTTP/1.1 -Host: xn--4cab6c.se -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://xn--4cab6c.se/%TESTNUMBER0001 HTTP/1.1 -Host: xn--4cab6c.se -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://xn--4cab6c.se/%TESTNUMBER HTTP/1.1 +Host: xn--4cab6c.se +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://xn--4cab6c.se/%TESTNUMBER0001 HTTP/1.1 +Host: xn--4cab6c.se +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test2049 b/tests/data/test2049 index 98be38bee670..31513551accb 100644 --- a/tests/data/test2049 +++ b/tests/data/test2049 @@ -38,27 +38,27 @@ http://www1.example.com:8081/%TESTNUMBER --connect-to ::%HOSTIP:%HTTPPORT --next # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: www1.example.com:8081 -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: www2.example.com:8082 -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: www3.example.com:8083 -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: www4.example.com:8084 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: www1.example.com:8081 +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: www2.example.com:8082 +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: www3.example.com:8083 +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: www4.example.com:8084 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2050 b/tests/data/test2050 index ed4713f9a5fc..202ea39106b6 100644 --- a/tests/data/test2050 +++ b/tests/data/test2050 @@ -68,12 +68,12 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /%TESTNUMBER HTTP/1.1 -Host: www.example.com.%TESTNUMBER -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: www.example.com.%TESTNUMBER +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2051 b/tests/data/test2051 index ce76cc93c059..b11d3c452b3c 100644 --- a/tests/data/test2051 +++ b/tests/data/test2051 @@ -38,22 +38,22 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" --next --connect-to # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2052 b/tests/data/test2052 index 18fc7c5ebfd9..60b45402b2d6 100644 --- a/tests/data/test2052 +++ b/tests/data/test2052 @@ -39,17 +39,17 @@ http://www.example.com:%HTTPPORT/%TESTNUMBER --resolve www.example.com:%HTTPPORT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: www.example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: www.example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: www.example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: www.example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2053 b/tests/data/test2053 index a416d528689c..ac35ed37e54d 100644 --- a/tests/data/test2053 +++ b/tests/data/test2053 @@ -38,17 +38,17 @@ http://10.0.0.1:8081/%TESTNUMBER --connect-to 10.0.0.1:8081:%HOSTIP:%HTTPPORT -- # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: 10.0.0.1:8081 -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: [fc00::1]:8082 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: 10.0.0.1:8081 +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: [fc00::1]:8082 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2054 b/tests/data/test2054 index 8217444e5364..59ec523bb76b 100644 --- a/tests/data/test2054 +++ b/tests/data/test2054 @@ -38,27 +38,27 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --connect-to foo::bar: --connect-to :123::4 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: www.example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:8083 -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: www.example.com:8084 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: www.example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:8083 +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: www.example.com:8084 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2055 b/tests/data/test2055 index 4710970ffd98..dca5630263df 100644 --- a/tests/data/test2055 +++ b/tests/data/test2055 @@ -69,12 +69,12 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /%TESTNUMBER HTTP/1.1 -Host: www.example.com.%TESTNUMBER -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: www.example.com.%TESTNUMBER +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2056 b/tests/data/test2056 index 3833663c10f2..9d0db1d747bc 100644 --- a/tests/data/test2056 +++ b/tests/data/test2056 @@ -51,13 +51,13 @@ CURL_STUB_GSS_CREDS="KRB5_Alice" # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Negotiate %b64["KRB5_Alice":HTTP@127.0.0.1:1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Negotiate %b64["KRB5_Alice":HTTP@127.0.0.1:1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2057 b/tests/data/test2057 index 7e45ae1214c5..e9b613334312 100644 --- a/tests/data/test2057 +++ b/tests/data/test2057 @@ -67,19 +67,19 @@ CURL_STUB_GSS_CREDS="NTLM_Alice" # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Negotiate %b64["NTLM_Alice":HTTP@127.0.0.1:2:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Negotiate %b64["NTLM_Alice":HTTP@127.0.0.1:3:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Negotiate %b64["NTLM_Alice":HTTP@127.0.0.1:2:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Negotiate %b64["NTLM_Alice":HTTP@127.0.0.1:3:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2061 b/tests/data/test2061 index 605d827be7c7..26a2869712c3 100644 --- a/tests/data/test2061 +++ b/tests/data/test2061 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="9dc55255f1a2537b838311674b621d45346b862a81631bb20e4ce356ef25062d", algorithm=SHA-256 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="9dc55255f1a2537b838311674b621d45346b862a81631bb20e4ce356ef25062d", algorithm=SHA-256 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2062 b/tests/data/test2062 index 039354382daa..3f8eedc7b471 100644 --- a/tests/data/test2062 +++ b/tests/data/test2062 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="9d3256ee6526ec40dd48743bb48e51ee9baba587c78f15c3a86166242150af98", algorithm=SHA-512-256 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="9d3256ee6526ec40dd48743bb48e51ee9baba587c78f15c3a86166242150af98", algorithm=SHA-512-256 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2063 b/tests/data/test2063 index 07e12f3c778a..cc4c4c2fb07e 100644 --- a/tests/data/test2063 +++ b/tests/data/test2063 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="75af8a3500f771e58a52093a25e7905d6e428a511285c12ea1420c73078dfd61", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="6c470aec384ab1d4e12d3ce1f5b08303d8cad177e52ebe50ec1a3e141adb0cdc", algorithm=SHA-256, userhash=true -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="75af8a3500f771e58a52093a25e7905d6e428a511285c12ea1420c73078dfd61", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="6c470aec384ab1d4e12d3ce1f5b08303d8cad177e52ebe50ec1a3e141adb0cdc", algorithm=SHA-256, userhash=true +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2064 b/tests/data/test2064 index d3142704647e..54102887e324 100644 --- a/tests/data/test2064 +++ b/tests/data/test2064 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="a9c3ec1036068b336cbabefe9dfcad52ee8b89bc7c91ddbb5bb415c6acdf38a5", algorithm=SHA-256 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="a9c3ec1036068b336cbabefe9dfcad52ee8b89bc7c91ddbb5bb415c6acdf38a5", algorithm=SHA-256 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2065 b/tests/data/test2065 index 5365cac3fd71..c15341049a6f 100644 --- a/tests/data/test2065 +++ b/tests/data/test2065 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="0373a49d7d352ff54884faaf762fc6c89281b4112ad8fcbbe1d1ee52dcf7a802", algorithm=SHA-512-256 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="0373a49d7d352ff54884faaf762fc6c89281b4112ad8fcbbe1d1ee52dcf7a802", algorithm=SHA-512-256 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2066 b/tests/data/test2066 index 8f5f7aa8a4e9..3a43fbb2bed8 100644 --- a/tests/data/test2066 +++ b/tests/data/test2066 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="75af8a3500f771e58a52093a25e7905d6e428a511285c12ea1420c73078dfd61", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="374a35326cc09e7d1ec3165aee9de01cae46daac33d8999aa1f483fa7882b86c", algorithm=SHA-256, userhash=true -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="75af8a3500f771e58a52093a25e7905d6e428a511285c12ea1420c73078dfd61", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="374a35326cc09e7d1ec3165aee9de01cae46daac33d8999aa1f483fa7882b86c", algorithm=SHA-256, userhash=true +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2067 b/tests/data/test2067 index 20120e1873cf..12f2ff18e63d 100644 --- a/tests/data/test2067 +++ b/tests/data/test2067 @@ -67,22 +67,22 @@ HTTP POST --digest with SHA256 and user-specified Content-Length header # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="67b97af219c92fa7e8685e5bebb8e74892f6c6792e911c52bd2dfbf0b49272eb", algorithm=SHA-256 -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="67b97af219c92fa7e8685e5bebb8e74892f6c6792e911c52bd2dfbf0b49272eb", algorithm=SHA-256 +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test2068 b/tests/data/test2068 index 867330e135f8..a19faf2f878c 100644 --- a/tests/data/test2068 +++ b/tests/data/test2068 @@ -67,22 +67,22 @@ HTTP POST Digest with SHA-512-256, userhash and set Content-Length # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="0ba2f7ec8045446588eea82bb0c3812aedb05f4eac8883ea65040a52e9c5629e", algorithm=SHA-512-256 -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="0ba2f7ec8045446588eea82bb0c3812aedb05f4eac8883ea65040a52e9c5629e", algorithm=SHA-512-256 +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test2069 b/tests/data/test2069 index 650726d17c5c..06e444f17a44 100644 --- a/tests/data/test2069 +++ b/tests/data/test2069 @@ -67,22 +67,22 @@ HTTP POST Digest with SHA-256, userhash and set Content-Length header # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="fddc3bc7b753b73ab0848fd83cb20cbbca971258eb8d20c941dd5e0b010d66be", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="9a29f1dab407e62daa7121185f9f12db6177415e03f35d9a881550095a83378d", algorithm=SHA-256, userhash=true -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="fddc3bc7b753b73ab0848fd83cb20cbbca971258eb8d20c941dd5e0b010d66be", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="9a29f1dab407e62daa7121185f9f12db6177415e03f35d9a881550095a83378d", algorithm=SHA-256, userhash=true +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test207 b/tests/data/test207 index 4c0e0c72ea1f..193926f08b31 100644 --- a/tests/data/test207 +++ b/tests/data/test207 @@ -48,12 +48,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # curl: (18) transfer closed with outstanding read data remaining diff --git a/tests/data/test2070 b/tests/data/test2070 index c2c0cdee9acf..0769d1af0f7a 100644 --- a/tests/data/test2070 +++ b/tests/data/test2070 @@ -46,12 +46,12 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2073 b/tests/data/test2073 index 8eea2655368f..6000c7db6e21 100644 --- a/tests/data/test2073 +++ b/tests/data/test2073 @@ -47,27 +47,27 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -F 'name=a;filename=a.pdf' --next http://%H ^(Content-Type: multipart/form-data;|------------).* - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 201 - -Content-Disposition: form-data; name="name"; filename="a.pdf" -Content-Type: application/pdf - -a -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 196 - -Content-Disposition: form-data; name="name"; filename="b.jpg" -Content-Type: image/jpeg - -b + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 201 + +Content-Disposition: form-data; name="name"; filename="a.pdf" +Content-Type: application/pdf + +a +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 196 + +Content-Disposition: form-data; name="name"; filename="b.jpg" +Content-Type: image/jpeg + +b diff --git a/tests/data/test2074 b/tests/data/test2074 index 1ef3480b5c25..9e3d26d4da8d 100644 --- a/tests/data/test2074 +++ b/tests/data/test2074 @@ -43,13 +43,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --oauth2-bearer mF_9.B5f-4.1JqM # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Bearer mF_9.B5f-4.1JqM -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Bearer mF_9.B5f-4.1JqM +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2076 b/tests/data/test2076 index 6ef44c2c7294..cb5e911da990 100644 --- a/tests/data/test2076 +++ b/tests/data/test2076 @@ -58,18 +58,18 @@ HTTP with digest auth and URI contains query # Verify data after the test has been "shot" - -GET /%TESTNUMBER?query HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER?query HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER?query", response="5758bd3bbde7f33236e6ccd278eb59af" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER?query HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER?query HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER?query", response="5758bd3bbde7f33236e6ccd278eb59af" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2078 b/tests/data/test2078 index ec1277e5efc9..de1f1cf5c22d 100644 --- a/tests/data/test2078 +++ b/tests/data/test2078 @@ -38,14 +38,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --negotiate --data name=value 0 - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 +Content-Type: application/x-www-form-urlencoded + name=value diff --git a/tests/data/test2079 b/tests/data/test2079 index 117a712c3f8b..0e2cf01a248b 100644 --- a/tests/data/test2079 +++ b/tests/data/test2079 @@ -47,12 +47,12 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2081 b/tests/data/test2081 index 7aad41621563..421b47588660 100644 --- a/tests/data/test2081 +++ b/tests/data/test2081 @@ -42,20 +42,20 @@ http://user:pass@%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER#anchor --location --r # Verify data after the test has been "shot" - -GET /we/want/our/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:pass]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:pass]b64% -User-Agent: curl/%VERSION -Accept: */* -Referer: http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER - + +GET /we/want/our/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:pass]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:pass]b64% +User-Agent: curl/%VERSION +Accept: */* +Referer: http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER + HTTP/1.1 301 This is a weirdo text message swsclose diff --git a/tests/data/test2087 b/tests/data/test2087 index f347bbc61b68..bffab46fa2c4 100644 --- a/tests/data/test2087 +++ b/tests/data/test2087 @@ -47,12 +47,12 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2088 b/tests/data/test2088 index 71839ee37c6a..b318e674c9fd 100644 --- a/tests/data/test2088 +++ b/tests/data/test2088 @@ -42,12 +42,12 @@ HTTPS GET with client authentication (mtls) # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPS-MTLSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPS-MTLSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2089 b/tests/data/test2089 index aee93abf6e42..5a64225d9129 100644 --- a/tests/data/test2089 +++ b/tests/data/test2089 @@ -42,12 +42,12 @@ HTTPS GET with client authentication (mtls) and --insecure # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPS-MTLSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPS-MTLSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test209 b/tests/data/test209 index 887d04fbeef7..3a9c1218a8b0 100644 --- a/tests/data/test209 +++ b/tests/data/test209 @@ -92,24 +92,24 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test210 b/tests/data/test210 index 1ee313d76ac9..954ec03648e4 100644 --- a/tests/data/test210 +++ b/tests/data/test210 @@ -33,20 +33,20 @@ data blobb # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test2100 b/tests/data/test2100 index efe54a6bc700..a5e809c6eff3 100644 --- a/tests/data/test2100 +++ b/tests/data/test2100 @@ -69,49 +69,49 @@ http://foo.example.com:%HTTPPORT/%TESTNUMBER --doh-url http://%HOSTIP:%HTTPPORT/ s/com\x00\x00(\x1c|\x01)/com-00-00!/g; - + %if HTTPSRR -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Type: application/dns-message -Content-Length: 33 - -%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Type: application/dns-message -Content-Length: 33 - -%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Type: application/dns-message -Content-Length: 47 - -%hex[%00%00%01%00%00%01%00%00%00%00%00%00%06_%HTTPPORT%06_https%03foo%07example%03com%00%00A%00%01]hex%GET /%TESTNUMBER HTTP/1.1 -Host: foo.example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Type: application/dns-message +Content-Length: 33 + +%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Type: application/dns-message +Content-Length: 33 + +%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Type: application/dns-message +Content-Length: 47 + +%hex[%00%00%01%00%00%01%00%00%00%00%00%00%06_%HTTPPORT%06_https%03foo%07example%03com%00%00A%00%01]hex%GET /%TESTNUMBER HTTP/1.1 +Host: foo.example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + %else -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Type: application/dns-message -Content-Length: 33 - -%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Type: application/dns-message -Content-Length: 33 - -%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%GET /%TESTNUMBER HTTP/1.1 -Host: foo.example.com:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Type: application/dns-message +Content-Length: 33 + +%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Type: application/dns-message +Content-Length: 33 + +%hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%GET /%TESTNUMBER HTTP/1.1 +Host: foo.example.com:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + %endif diff --git a/tests/data/test211 b/tests/data/test211 index 6830727ab6fb..3e6a8f9ada72 100644 --- a/tests/data/test211 +++ b/tests/data/test211 @@ -34,21 +34,21 @@ data blobb # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -PASV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +PASV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test213 b/tests/data/test213 index 877d9276ce80..7780b231c175 100644 --- a/tests/data/test213 +++ b/tests/data/test213 @@ -92,26 +92,26 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.0 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.0 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -POST /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 6 -Content-Type: application/x-www-form-urlencoded - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.0 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.0 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +POST /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 6 +Content-Type: application/x-www-form-urlencoded + postit diff --git a/tests/data/test214 b/tests/data/test214 index 846b46458e58..76c328ac98cb 100644 --- a/tests/data/test214 +++ b/tests/data/test214 @@ -40,12 +40,12 @@ MSYS2_ARG_CONV_EXCL=http:// # # Verify data after the test has been "shot" - -GET /{}\/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /{}\/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test215 b/tests/data/test215 index 058639f272cb..f06bca11fa06 100644 --- a/tests/data/test215 +++ b/tests/data/test215 @@ -38,19 +38,19 @@ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER/ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNU # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -CWD %TESTNUMBER -EPSV -TYPE A -LIST -EPSV -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +CWD %TESTNUMBER +EPSV +TYPE A +LIST +EPSV +LIST +QUIT diff --git a/tests/data/test216 b/tests/data/test216 index 1be87c0d1ea4..5fbc6153ef18 100644 --- a/tests/data/test216 +++ b/tests/data/test216 @@ -27,19 +27,19 @@ upload this file twice # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -CWD %TESTNUMBER -EPSV -TYPE I -STOR upload.%TESTNUMBER -EPSV -STOR ..anotherup.%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +CWD %TESTNUMBER +EPSV +TYPE I +STOR upload.%TESTNUMBER +EPSV +STOR ..anotherup.%TESTNUMBER +QUIT diff --git a/tests/data/test217 b/tests/data/test217 index cb6c6738b6e2..07bbeac46fdc 100644 --- a/tests/data/test217 +++ b/tests/data/test217 @@ -41,12 +41,12 @@ proxy # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + # CURLE_RECV_ERROR diff --git a/tests/data/test22 b/tests/data/test22 index 900778279343..2141182295d7 100644 --- a/tests/data/test22 +++ b/tests/data/test22 @@ -31,12 +31,12 @@ get HTTP with URL > 10000 bytes # Verify data after the test has been "shot" - -GET /%repeat[11000 x a]%/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%repeat[11000 x a]%/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test220 b/tests/data/test220 index b87ad7ee2214..48cd0af3bebb 100644 --- a/tests/data/test220 +++ b/tests/data/test220 @@ -61,13 +61,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test221 b/tests/data/test221 index c5d8fa456b38..d51d730f7552 100644 --- a/tests/data/test221 +++ b/tests/data/test221 @@ -61,13 +61,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + 61 diff --git a/tests/data/test222 b/tests/data/test222 index 1a1fe89492ac..f01c017f83c4 100644 --- a/tests/data/test222 +++ b/tests/data/test222 @@ -172,13 +172,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test223 b/tests/data/test223 index ba62b2ca7533..bcdc415d18b0 100644 --- a/tests/data/test223 +++ b/tests/data/test223 @@ -60,13 +60,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + 61 diff --git a/tests/data/test224 b/tests/data/test224 index 99400cd1d821..cf8673111318 100644 --- a/tests/data/test224 +++ b/tests/data/test224 @@ -58,13 +58,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test227 b/tests/data/test227 index f7b445185d7d..e0a6af9f76c6 100644 --- a/tests/data/test227 +++ b/tests/data/test227 @@ -37,21 +37,21 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FA # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -NOOP 1 -FAIL -EPSV -PASV -TYPE I -NOOP 2 -FAIL HARD -SIZE %TESTNUMBER -RETR %TESTNUMBER -NOOP 3 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +NOOP 1 +FAIL +EPSV +PASV +TYPE I +NOOP 2 +FAIL HARD +SIZE %TESTNUMBER +RETR %TESTNUMBER +NOOP 3 +QUIT diff --git a/tests/data/test228 b/tests/data/test228 index 8e7d73ff0c98..e9acda8ddb3d 100644 --- a/tests/data/test228 +++ b/tests/data/test228 @@ -37,16 +37,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-account "one count" # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -ACCT one count -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +ACCT one count +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test229 b/tests/data/test229 index 71da135fc0e9..9b79392a9681 100644 --- a/tests/data/test229 +++ b/tests/data/test229 @@ -29,10 +29,10 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-account "one count" # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -ACCT one count + +USER anonymous +PASS ftp@example.com +ACCT one count 11 diff --git a/tests/data/test230 b/tests/data/test230 index 47663ad294c6..3dc478fc99d6 100644 --- a/tests/data/test230 +++ b/tests/data/test230 @@ -172,13 +172,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test2300 b/tests/data/test2300 index 8b2877468609..33460cdd4b68 100644 --- a/tests/data/test2300 +++ b/tests/data/test2300 @@ -47,16 +47,16 @@ WebSockets upgrade only # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Upgrade: websocket -Sec-WebSocket-Version: 13 -Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== -Connection: Upgrade - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Upgrade: websocket +Sec-WebSocket-Version: 13 +Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== +Connection: Upgrade + 52 diff --git a/tests/data/test2301 b/tests/data/test2301 index 1b968c767285..1762a2c57f1b 100644 --- a/tests/data/test2301 +++ b/tests/data/test2301 @@ -52,16 +52,16 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: webbie-sox/3 -Accept: */* -Upgrade: websocket -Sec-WebSocket-Version: 13 -Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== -Connection: Upgrade - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: webbie-sox/3 +Accept: */* +Upgrade: websocket +Sec-WebSocket-Version: 13 +Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== +Connection: Upgrade + %hex[%8a%00]hex% diff --git a/tests/data/test2302 b/tests/data/test2302 index 8e2d34877f5f..117b5a7ebfed 100644 --- a/tests/data/test2302 +++ b/tests/data/test2302 @@ -53,16 +53,16 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER # PONG with no data and the 32 bit mask # - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: webbie-sox/3 -Accept: */* -Upgrade: websocket -Sec-WebSocket-Version: 13 -Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== -Connection: Upgrade - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: webbie-sox/3 +Accept: */* +Upgrade: websocket +Sec-WebSocket-Version: 13 +Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== +Connection: Upgrade + %hex[%8a%808321]hex% diff --git a/tests/data/test2303 b/tests/data/test2303 index 8ad45cbecaf4..cfb1f0d6cd38 100644 --- a/tests/data/test2303 +++ b/tests/data/test2303 @@ -43,16 +43,16 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: webbie-sox/3 -Accept: */* -Upgrade: websocket -Sec-WebSocket-Version: 13 -Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== -Connection: Upgrade - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: webbie-sox/3 +Accept: */* +Upgrade: websocket +Sec-WebSocket-Version: 13 +Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ== +Connection: Upgrade + # 22 == CURLE_HTTP_RETURNED_ERROR diff --git a/tests/data/test2304 b/tests/data/test2304 index 8ed75d96a9cf..47c81b2a96e7 100644 --- a/tests/data/test2304 +++ b/tests/data/test2304 @@ -52,7 +52,7 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER # PONG with no data and the 32 bit mask # - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: websocket/%TESTNUMBER diff --git a/tests/data/test2306 b/tests/data/test2306 index 620f7b5ecc12..0f7bd541dfac 100644 --- a/tests/data/test2306 +++ b/tests/data/test2306 @@ -54,15 +54,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test2308 b/tests/data/test2308 index 3881d353db6c..c4e35ad8cc2a 100644 --- a/tests/data/test2308 +++ b/tests/data/test2308 @@ -44,11 +44,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + Returned 23, should be 23. diff --git a/tests/data/test2309 b/tests/data/test2309 index 4ba78ee91e17..3763822d0e8f 100644 --- a/tests/data/test2309 +++ b/tests/data/test2309 @@ -54,13 +54,13 @@ password $y$j9T$WUVjiVvDbRAWafDLs6cab1$01NX.oaZKf5lw8MR2Nk9Yaxv4CqbE0IaDF.GpGxPu - -GET http://github.com/ HTTP/1.1 -Host: github.com -Authorization: Basic %b64[daniel:$y$j9T$WUVjiVvDbRAWafDLs6cab1$01NX.oaZKf5lw8MR2Nk9Yaxv4CqbE0IaDF.GpGxPul1]b64% -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://github.com/ HTTP/1.1 +Host: github.com +Authorization: Basic %b64[daniel:$y$j9T$WUVjiVvDbRAWafDLs6cab1$01NX.oaZKf5lw8MR2Nk9Yaxv4CqbE0IaDF.GpGxPul1]b64% +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test232 b/tests/data/test232 index 7f39d7a2fea8..25cab8372bbe 100644 --- a/tests/data/test232 +++ b/tests/data/test232 @@ -172,13 +172,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test233 b/tests/data/test233 index fa83d750d144..3b55200e2008 100644 --- a/tests/data/test233 +++ b/tests/data/test233 @@ -75,22 +75,22 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: first.host.it.is -Proxy-Authorization: Basic %b64[testing:this]b64% -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 -Host: goto.second.host.now -Proxy-Authorization: Basic %b64[testing:this]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: first.host.it.is +Proxy-Authorization: Basic %b64[testing:this]b64% +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 +Host: goto.second.host.now +Proxy-Authorization: Basic %b64[testing:this]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test234 b/tests/data/test234 index 2902da1528d2..b3b06cc6be01 100644 --- a/tests/data/test234 +++ b/tests/data/test234 @@ -77,23 +77,23 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: first.host.it.is -Proxy-Authorization: Basic %b64[testing:this]b64% -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 -Host: goto.second.host.now -Proxy-Authorization: Basic %b64[testing:this]b64% -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: first.host.it.is +Proxy-Authorization: Basic %b64[testing:this]b64% +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 +Host: goto.second.host.now +Proxy-Authorization: Basic %b64[testing:this]b64% +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test235 b/tests/data/test235 index 7081a776c8f5..651dd55cd130 100644 --- a/tests/data/test235 +++ b/tests/data/test235 @@ -33,15 +33,15 @@ worx? # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +STOR %TESTNUMBER +QUIT this is the *****crap******** that we're gonna upload diff --git a/tests/data/test236 b/tests/data/test236 index a66fa046d93e..735b5bf583b7 100644 --- a/tests/data/test236 +++ b/tests/data/test236 @@ -34,15 +34,15 @@ Test data # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +STOR %TESTNUMBER +QUIT # (25) Failed FTP upload: 550 diff --git a/tests/data/test237 b/tests/data/test237 index 010f4f4322f0..fe407993fa30 100644 --- a/tests/data/test237 +++ b/tests/data/test237 @@ -34,11 +34,11 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --disable-epsv 14 - -USER anonymous -PASS ftp@example.com -PWD -PASV + +USER anonymous +PASS ftp@example.com +PWD +PASV diff --git a/tests/data/test238 b/tests/data/test238 index 6e2af83d7e45..bd01546ea618 100644 --- a/tests/data/test238 +++ b/tests/data/test238 @@ -31,12 +31,12 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 13 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +QUIT diff --git a/tests/data/test239 b/tests/data/test239 index 230fcc31ad65..6bd571b7e2b3 100644 --- a/tests/data/test239 +++ b/tests/data/test239 @@ -67,25 +67,25 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --proxy-us # Verify data after the test has been "shot" - -POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 6 -Content-Type: application/x-www-form-urlencoded - + +POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 6 +Content-Type: application/x-www-form-urlencoded + postit diff --git a/tests/data/test24 b/tests/data/test24 index 888c63573314..ae343baa5949 100644 --- a/tests/data/test24 +++ b/tests/data/test24 @@ -31,12 +31,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail --silent --show-error # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 22 diff --git a/tests/data/test240 b/tests/data/test240 index 75bd4bb3de69..d4d3551b8256 100644 --- a/tests/data/test240 +++ b/tests/data/test240 @@ -45,12 +45,12 @@ HTTP-IPv6 GET # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test2401 b/tests/data/test2401 index 8f686e850333..979a8b235687 100644 --- a/tests/data/test2401 +++ b/tests/data/test2401 @@ -55,16 +55,16 @@ server: nghttpx via: 1.1 nghttpx - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTP2TLSPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded -X-Forwarded-Proto: https -Via: 2 nghttpx - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTP2TLSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded +X-Forwarded-Proto: https +Via: 2 nghttpx + moo diff --git a/tests/data/test2404 b/tests/data/test2404 index 881a32120fe5..3a5901e8f3aa 100644 --- a/tests/data/test2404 +++ b/tests/data/test2404 @@ -11,35 +11,35 @@ verbose logs # Server-side -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file diff --git a/tests/data/test2405 b/tests/data/test2405 index 8489156e7315..ee25b1de53e4 100644 --- a/tests/data/test2405 +++ b/tests/data/test2405 @@ -44,7 +44,5 @@ http://%HOSTIP:%HTTP2PORT/%TESTNUMBER # Verify data after the test has been "shot" - - diff --git a/tests/data/test241 b/tests/data/test241 index f8cf6e9a43a2..66161f6569c0 100644 --- a/tests/data/test241 +++ b/tests/data/test241 @@ -43,12 +43,12 @@ HTTP-IPv6 GET (using ip6-localhost) # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: ip6-localhost:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: ip6-localhost:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test242 b/tests/data/test242 index 2e9f89165a98..62be5173cce1 100644 --- a/tests/data/test242 +++ b/tests/data/test242 @@ -40,13 +40,13 @@ HTTP-IPv6 GET with username+password in URL # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -Authorization: Basic %b64[foobar:barfoo]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +Authorization: Basic %b64[foobar:barfoo]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test243 b/tests/data/test243 index 3952571b6ed1..273bd05492d2 100644 --- a/tests/data/test243 +++ b/tests/data/test243 @@ -88,33 +88,33 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --proxy-us # Verify data after the test has been "shot" - -POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 6 -Content-Type: application/x-www-form-urlencoded - -postitPOST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 6 -Content-Type: application/x-www-form-urlencoded - + +POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 6 +Content-Type: application/x-www-form-urlencoded + +postitPOST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 6 +Content-Type: application/x-www-form-urlencoded + postit diff --git a/tests/data/test244 b/tests/data/test244 index 782be2be403f..a54ce3f6a525 100644 --- a/tests/data/test244 +++ b/tests/data/test244 @@ -41,14 +41,14 @@ FTP dir listing with nocwd and URL encoded path # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST fir#t/third/%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST fir#t/third/%TESTNUMBER +QUIT diff --git a/tests/data/test245 b/tests/data/test245 index da263692153c..da95cc5a6ba1 100644 --- a/tests/data/test245 +++ b/tests/data/test245 @@ -64,22 +64,22 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u auser:apasswd --digest -d "junkelijunk" # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="379a439b1737ba257c1d2f103914b18b" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="379a439b1737ba257c1d2f103914b18b" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test246 b/tests/data/test246 index 3ab338213c47..9f2ab7435315 100644 --- a/tests/data/test246 +++ b/tests/data/test246 @@ -74,22 +74,22 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u auser:apasswd --digest -d "junkelijunk" # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="761e6fc9a760c39d587092e8d840e740" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="761e6fc9a760c39d587092e8d840e740" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + junkelijunk diff --git a/tests/data/test247 b/tests/data/test247 index 8b154f419b78..43401696c483 100644 --- a/tests/data/test247 +++ b/tests/data/test247 @@ -35,12 +35,12 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt -z "apr 1 2005 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -MDTM %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM %TESTNUMBER +QUIT diff --git a/tests/data/test248 b/tests/data/test248 index b497dd7af282..f7d15cd630a5 100644 --- a/tests/data/test248 +++ b/tests/data/test248 @@ -44,15 +44,15 @@ that FTP works so does it? - -USER anonymous -PASS ftp@example.com -PWD -MDTM %TESTNUMBER -EPSV -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM %TESTNUMBER +EPSV +TYPE I +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test249 b/tests/data/test249 index 82b0a1406c8e..6f671080c10b 100644 --- a/tests/data/test249 +++ b/tests/data/test249 @@ -40,13 +40,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT + diff --git a/tests/data/test25 b/tests/data/test25 index b00ef84ece69..f641da93bbae 100644 --- a/tests/data/test25 +++ b/tests/data/test25 @@ -73,37 +73,37 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L --max-redirs 5 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data/reply/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data/reply/data/reply/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data/reply/data/reply/data/reply/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data/reply/data/reply/data/reply/data/reply/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data/reply/data/reply/data/reply/data/reply/data/reply/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data/reply/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data/reply/data/reply/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data/reply/data/reply/data/reply/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data/reply/data/reply/data/reply/data/reply/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data/reply/data/reply/data/reply/data/reply/data/reply/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test250 b/tests/data/test250 index 4f01ea79a38a..550aca257a2e 100644 --- a/tests/data/test250 +++ b/tests/data/test250 @@ -46,14 +46,14 @@ ftp://%HOSTIP:%FTPPORT/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test2501 b/tests/data/test2501 index d05395754d55..6de5b755c1a7 100644 --- a/tests/data/test2501 +++ b/tests/data/test2501 @@ -54,15 +54,15 @@ funny-head: yesyes via: 1.1 nghttpx - -POST https://%HOSTIP:%HTTP3PORT/2501 HTTP/1.1 -Host: %HOSTIP:%HTTP3PORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 3 -Content-Type: application/x-www-form-urlencoded -Via: 3 nghttpx - + +POST https://%HOSTIP:%HTTP3PORT/2501 HTTP/1.1 +Host: %HOSTIP:%HTTP3PORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded +Via: 3 nghttpx + moo diff --git a/tests/data/test2502 b/tests/data/test2502 index 8625ee7b74b2..b878e2c9ece6 100644 --- a/tests/data/test2502 +++ b/tests/data/test2502 @@ -11,35 +11,35 @@ verbose logs # Server-side -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file diff --git a/tests/data/test251 b/tests/data/test251 index 9ed8c9488009..a743b2824fc3 100644 --- a/tests/data/test251 +++ b/tests/data/test251 @@ -46,14 +46,14 @@ ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -PORT 127,0,0,1,243,212 -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +PORT 127,0,0,1,243,212 +TYPE A +LIST +QUIT diff --git a/tests/data/test252 b/tests/data/test252 index 1480ee1ec1dc..77fb9246bb1e 100644 --- a/tests/data/test252 +++ b/tests/data/test252 @@ -45,14 +45,14 @@ FTP IPv6 dir list PASV # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test254 b/tests/data/test254 index 90b58a0b3067..632548424568 100644 --- a/tests/data/test254 +++ b/tests/data/test254 @@ -46,14 +46,14 @@ FTP IPv6 dir list PASV and --disable-epsv # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test256 b/tests/data/test256 index aa60459548e1..e8ac36b5aa1e 100644 --- a/tests/data/test256 +++ b/tests/data/test256 @@ -45,15 +45,15 @@ proxy 33 - -GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: Basic %b64[daniel:stenberg]b64% -Range: bytes=78- -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: Basic %b64[daniel:stenberg]b64% +Range: bytes=78- +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + # the download target file must remain untouched diff --git a/tests/data/test257 b/tests/data/test257 index 4a245b0120fe..4ffb7a6f3205 100644 --- a/tests/data/test257 +++ b/tests/data/test257 @@ -85,27 +85,27 @@ machine anotherone.com login user2 password passwd2 # Verify data after the test has been "shot" - -GET http://supersite.com/want/%TESTNUMBER HTTP/1.1 -Host: supersite.com -Authorization: Basic %b64[user1:passwd1]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://anotherone.com/%TESTNUMBER0002 HTTP/1.1 -Host: anotherone.com -Authorization: Basic %b64[user2:passwd2]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://athird.com/%TESTNUMBER0003 HTTP/1.1 -Host: athird.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://supersite.com/want/%TESTNUMBER HTTP/1.1 +Host: supersite.com +Authorization: Basic %b64[user1:passwd1]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://anotherone.com/%TESTNUMBER0002 HTTP/1.1 +Host: anotherone.com +Authorization: Basic %b64[user2:passwd2]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://athird.com/%TESTNUMBER0003 HTTP/1.1 +Host: athird.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test26 b/tests/data/test26 index 9e334bc5b50a..438109516d67 100644 --- a/tests/data/test26 +++ b/tests/data/test26 @@ -31,12 +31,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -o - -o - # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test260 b/tests/data/test260 index b72d6cd1663d..41a8a7a6341c 100644 --- a/tests/data/test260 +++ b/tests/data/test260 @@ -42,12 +42,12 @@ HTTP GET URL without slash but with question mark # # Verify data after the test has been "shot" - -GET /?%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /?%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test261 b/tests/data/test261 index d5f940372e8d..59cc16fec250 100644 --- a/tests/data/test261 +++ b/tests/data/test261 @@ -34,15 +34,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test262 b/tests/data/test262 index fae51caeae9d..6b5ad6204ee8 100644 --- a/tests/data/test262 +++ b/tests/data/test262 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 8 diff --git a/tests/data/test263 b/tests/data/test263 index 648702529713..e1fbe036caa8 100644 --- a/tests/data/test263 +++ b/tests/data/test263 @@ -41,13 +41,13 @@ HTTP-IPv6 GET with proxy specified using IPv6-numerical address # # Verify data after the test has been "shot" - -GET http://veryveryremotesite.com/%TESTNUMBER HTTP/1.1 -Host: veryveryremotesite.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://veryveryremotesite.com/%TESTNUMBER HTTP/1.1 +Host: veryveryremotesite.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test264 b/tests/data/test264 index 8eae539bdc03..cb1ad053b310 100644 --- a/tests/data/test264 +++ b/tests/data/test264 @@ -37,14 +37,14 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 -Host: we.want.that.site.com -Proxy-Authorization: Basic %b64[fake:user]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 +Host: we.want.that.site.com +Proxy-Authorization: Basic %b64[fake:user]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test265 b/tests/data/test265 index 6b407b24dd35..75d943f0f7ac 100644 --- a/tests/data/test265 +++ b/tests/data/test265 @@ -95,26 +95,26 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -POST /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 6 -Content-Type: application/x-www-form-urlencoded - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +POST /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 6 +Content-Type: application/x-www-form-urlencoded + postit diff --git a/tests/data/test266 b/tests/data/test266 index 8604c609b89e..aa974b628be6 100644 --- a/tests/data/test266 +++ b/tests/data/test266 @@ -60,12 +60,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 funky chunky! diff --git a/tests/data/test267 b/tests/data/test267 index f24c7f6a9178..60f8878cbf7f 100644 --- a/tests/data/test267 +++ b/tests/data/test267 @@ -73,27 +73,27 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -d "data" -H "H # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Header1: yes -Header2: no -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Header1: yes -Header2: no -Content-Length: 4 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Header1: yes +Header2: no +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Header1: yes +Header2: no +Content-Length: 4 +Content-Type: application/x-www-form-urlencoded + data diff --git a/tests/data/test269 b/tests/data/test269 index e9e7843d44b1..1533ef7eebf0 100644 --- a/tests/data/test269 +++ b/tests/data/test269 @@ -40,12 +40,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --ignore-content-length # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test27 b/tests/data/test27 index 75c73acc2bfd..f9ec0cf051c0 100644 --- a/tests/data/test27 +++ b/tests/data/test27 @@ -36,24 +36,24 @@ cookies # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: thewinneris=nowayyouwin - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: thewinneris=nowayyouwin - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: thewinneris=nowayyouwin + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: thewinneris=nowayyouwin + diff --git a/tests/data/test270 b/tests/data/test270 index efa183f1559b..6f1db343a769 100644 --- a/tests/data/test270 +++ b/tests/data/test270 @@ -36,15 +36,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-skip-pasv-ip --disable-epsv # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -PASV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +PASV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test273 b/tests/data/test273 index eb7ab1cc6a27..e3629c1843e4 100644 --- a/tests/data/test273 +++ b/tests/data/test273 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="576ae57b1db0039f8c0de43ef58e49e3" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="576ae57b1db0039f8c0de43ef58e49e3" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test274 b/tests/data/test274 index bb7200614840..685bd0854adb 100644 --- a/tests/data/test274 +++ b/tests/data/test274 @@ -34,12 +34,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L --max-redirs 0 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test276 b/tests/data/test276 index 6814f9ed7b25..f71a2de427ec 100644 --- a/tests/data/test276 +++ b/tests/data/test276 @@ -59,17 +59,17 @@ HTTP Location: following with multiple question marks in URLs # Verify data after the test has been "shot" - -GET /want?uri=http://anything/%TESTNUMBER?secondq/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /data/%TESTNUMBER0002.txt?coolsite=http://anotherurl/?a_second/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want?uri=http://anything/%TESTNUMBER?secondq/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /data/%TESTNUMBER0002.txt?coolsite=http://anotherurl/?a_second/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test277 b/tests/data/test277 index 69a17fea5ef1..0f8cdaa3e05b 100644 --- a/tests/data/test277 +++ b/tests/data/test277 @@ -40,19 +40,19 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -F name=daniel -H "Content-Type: text/ s/^--------------------------[A-Za-z0-9]*/--------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=------------------------/ - -POST /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 158 -Content-Type: text/info; boundary=------------------------ - --------------------------- -Content-Disposition: attachment; name="name" - -daniel ----------------------------- + +POST /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 158 +Content-Type: text/info; boundary=------------------------ + +-------------------------- +Content-Disposition: attachment; name="name" + +daniel +---------------------------- diff --git a/tests/data/test278 b/tests/data/test278 index eebd2e4623fb..102815aae08d 100644 --- a/tests/data/test278 +++ b/tests/data/test278 @@ -37,14 +37,14 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 -Host: we.want.that.site.com -Proxy-Authorization: Basic %b64[fake:]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 +Host: we.want.that.site.com +Proxy-Authorization: Basic %b64[fake:]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test279 b/tests/data/test279 index 627be88f9169..579e13f8097c 100644 --- a/tests/data/test279 +++ b/tests/data/test279 @@ -38,14 +38,14 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 -Host: we.want.that.site.com -Proxy-Authorization: Basic %b64[fake:]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 +Host: we.want.that.site.com +Proxy-Authorization: Basic %b64[fake:]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test28 b/tests/data/test28 index 667d8f97f61a..979868cea3bd 100644 --- a/tests/data/test28 +++ b/tests/data/test28 @@ -58,17 +58,17 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /online/1,1795,Welcome,00.html/%TESTNUMBER0002.txt?logout=TRUE HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /online/1,1795,Welcome,00.html/%TESTNUMBER0002.txt?logout=TRUE HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test280 b/tests/data/test280 index 1aee4b517f11..9959188dad8e 100644 --- a/tests/data/test280 +++ b/tests/data/test280 @@ -46,16 +46,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ --ftp-alternative-to-user "USER replacement" # # Verify data after the test has been "shot" - -USER anonymous -USER replacement -PASS ftp@example.com -PWD -CWD %TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +USER replacement +PASS ftp@example.com +PWD +CWD %TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test282 b/tests/data/test282 index 68d3b428cbcd..e5b1321be2d2 100644 --- a/tests/data/test282 +++ b/tests/data/test282 @@ -32,12 +32,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test287 b/tests/data/test287 index 85d557ec96d9..1bc6654ba3d1 100644 --- a/tests/data/test287 +++ b/tests/data/test287 @@ -37,12 +37,12 @@ proxy # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Connection: Keep-Alive -User-Agent: looser/2007 - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Connection: Keep-Alive +User-Agent: looser/2007 + # CURLE_RECV_ERROR diff --git a/tests/data/test29 b/tests/data/test29 index 689ac43ee1c4..b99b02f04cfb 100644 --- a/tests/data/test29 +++ b/tests/data/test29 @@ -39,12 +39,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -m 2 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 28 diff --git a/tests/data/test290 b/tests/data/test290 index e7048a5384d5..99f7299c8b9f 100644 --- a/tests/data/test290 +++ b/tests/data/test290 @@ -30,14 +30,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --max-filesize 30 63 - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +QUIT diff --git a/tests/data/test291 b/tests/data/test291 index 05cc2b444a06..33ddb32ba3f4 100644 --- a/tests/data/test291 +++ b/tests/data/test291 @@ -33,15 +33,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --max-filesize 100 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test292 b/tests/data/test292 index 0ae74a9bc045..02159882e404 100644 --- a/tests/data/test292 +++ b/tests/data/test292 @@ -43,12 +43,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 1000 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test293 b/tests/data/test293 index 04f98999103e..3b2fc4d9ee37 100644 --- a/tests/data/test293 +++ b/tests/data/test293 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 2 63 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test294 b/tests/data/test294 index 67108aedb91f..55d08f053f33 100644 --- a/tests/data/test294 +++ b/tests/data/test294 @@ -47,16 +47,16 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ --ftp-account "data for acct" # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -ACCT data for acct -PWD -CWD %TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +ACCT data for acct +PWD +CWD %TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test295 b/tests/data/test295 index ebb1a3697604..ff5f89169d66 100644 --- a/tests/data/test295 +++ b/tests/data/test295 @@ -37,9 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ 67 - -USER anonymous -PASS ftp@example.com + +USER anonymous +PASS ftp@example.com diff --git a/tests/data/test296 b/tests/data/test296 index c88ec99bf7cf..8f38eab457ef 100644 --- a/tests/data/test296 +++ b/tests/data/test296 @@ -31,18 +31,18 @@ FTP CWD with --ftp-method multicwd # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD first -CWD second -CWD third -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD first +CWD second +CWD third +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test297 b/tests/data/test297 index 99c10d3e135b..e361425398a4 100644 --- a/tests/data/test297 +++ b/tests/data/test297 @@ -31,16 +31,16 @@ FTP CWD with --ftp-method singlecwd # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD first/second/third -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD first/second/third +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test298 b/tests/data/test298 index 5188c85477d1..5af79e7ff952 100644 --- a/tests/data/test298 +++ b/tests/data/test298 @@ -31,15 +31,15 @@ FTP CWD with --ftp-method nocwd # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE first/second/third/%TESTNUMBER -RETR first/second/third/%TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE first/second/third/%TESTNUMBER +RETR first/second/third/%TESTNUMBER +QUIT diff --git a/tests/data/test299 b/tests/data/test299 index 932e065b8b51..6de5234d2bd3 100644 --- a/tests/data/test299 +++ b/tests/data/test299 @@ -39,14 +39,14 @@ FTP over HTTP proxy with user:pass not in url # Verify data after the test has been "shot" - -GET ftp://michal:aybabtu@host.com/we/want/%TESTNUMBER HTTP/1.1 -Host: host.com:21 -Authorization: Basic %b64[michal:aybabtu]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://michal:aybabtu@host.com/we/want/%TESTNUMBER HTTP/1.1 +Host: host.com:21 +Authorization: Basic %b64[michal:aybabtu]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test3 b/tests/data/test3 index a7cb4f8839ed..fbf60558c0a4 100644 --- a/tests/data/test3 +++ b/tests/data/test3 @@ -43,15 +43,15 @@ HTTP POST with auth and contents but with content-length set to 0 # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[fake:-user]b64% -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 37 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[fake:-user]b64% +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 37 +Content-Type: application/x-www-form-urlencoded + fooo=mooo&pooo=clue&doo=%20%20%20++++ diff --git a/tests/data/test30 b/tests/data/test30 index 6d6a7f645274..5facba61b398 100644 --- a/tests/data/test30 +++ b/tests/data/test30 @@ -27,12 +27,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 52 diff --git a/tests/data/test300 b/tests/data/test300 index 3dbf0f01d9c9..53c945033715 100644 --- a/tests/data/test300 +++ b/tests/data/test300 @@ -40,12 +40,12 @@ simple HTTPS GET # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3000 b/tests/data/test3000 index e46012d2788e..9fd21ec507b9 100644 --- a/tests/data/test3000 +++ b/tests/data/test3000 @@ -42,12 +42,12 @@ HTTPS localhost, first subaltname matches, CN does not match # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3001 b/tests/data/test3001 index ce53eb9aa0a4..e4732d1cba68 100644 --- a/tests/data/test3001 +++ b/tests/data/test3001 @@ -42,12 +42,12 @@ HTTPS localhost, last subject alt name matches, CN does not match # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3002 b/tests/data/test3002 index 206bb7d4d9f4..21d799b183f3 100644 --- a/tests/data/test3002 +++ b/tests/data/test3002 @@ -33,23 +33,23 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid. # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test3003 b/tests/data/test3003 index dea4bd651726..a0b4d67202ca 100644 --- a/tests/data/test3003 +++ b/tests/data/test3003 @@ -33,23 +33,23 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt recipien # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test3004 b/tests/data/test3004 index a995ddee542e..30f67cbc74d8 100644 --- a/tests/data/test3004 +++ b/tests/data/test3004 @@ -33,23 +33,23 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt recipien # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test3005 b/tests/data/test3005 index 8fd333062281..cfe63acdfbea 100644 --- a/tests/data/test3005 +++ b/tests/data/test3005 @@ -33,23 +33,23 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid. # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test3006 b/tests/data/test3006 index 5ebf0bdf1643..0d0449d9134d 100644 --- a/tests/data/test3006 +++ b/tests/data/test3006 @@ -37,15 +37,15 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid. 55 - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +QUIT diff --git a/tests/data/test3007 b/tests/data/test3007 index 9a4aede6f85b..2cbc4f9a6f71 100644 --- a/tests/data/test3007 +++ b/tests/data/test3007 @@ -37,11 +37,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid. 55 - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +QUIT diff --git a/tests/data/test3008 b/tests/data/test3008 index 51afb047e8c6..7701a2c33c56 100644 --- a/tests/data/test3008 +++ b/tests/data/test3008 @@ -43,12 +43,12 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/%LOGDIR # # Verify data after the test has been "shot" - -GET /this/is/the/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/is/the/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + -foo- diff --git a/tests/data/test3009 b/tests/data/test3009 index 213e8ae682bc..96e9d8035f72 100644 --- a/tests/data/test3009 +++ b/tests/data/test3009 @@ -43,12 +43,12 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/not-there # # Verify data after the test has been "shot" - -GET /this/is/the/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/is/the/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 23 diff --git a/tests/data/test301 b/tests/data/test301 index af394784ecd4..76a5a61ade6d 100644 --- a/tests/data/test301 +++ b/tests/data/test301 @@ -40,13 +40,13 @@ HTTPS GET with user and password # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -Authorization: Basic %b64[fake:user]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +Authorization: Basic %b64[fake:user]b64% +User-Agent: curl/%VERSION +Accept: */* + [insert full protocol verifiction dump here] diff --git a/tests/data/test3011 b/tests/data/test3011 index f5b2f1d8c651..6933b584ab1e 100644 --- a/tests/data/test3011 +++ b/tests/data/test3011 @@ -43,12 +43,12 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/%LOGDIR/tm # # Verify data after the test has been "shot" - -GET /this/is/the/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/is/the/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + -foo- diff --git a/tests/data/test3012 b/tests/data/test3012 index a9c950587431..5b98c0c4e21e 100644 --- a/tests/data/test3012 +++ b/tests/data/test3012 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -OJR --output-dir %PWD/%LOGDIR # # Verify data after the test has been "shot" - -GET /this/is/the/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/is/the/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + -foo- diff --git a/tests/data/test3013 b/tests/data/test3013 index 183667e6823c..305e435eb56b 100644 --- a/tests/data/test3013 +++ b/tests/data/test3013 @@ -46,17 +46,17 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/%LOGDIR ht # # Verify data after the test has been "shot" - -GET /this/is/the/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /another/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/is/the/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /another/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + -foo- diff --git a/tests/data/test3014 b/tests/data/test3014 index eb5c705716b0..7a6686495d2d 100644 --- a/tests/data/test3014 +++ b/tests/data/test3014 @@ -45,12 +45,12 @@ Content-Type: text/plain testdata 4 - -GET /1439 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /1439 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3015 b/tests/data/test3015 index 41e0640bc239..b2697aa3e0cd 100644 --- a/tests/data/test3015 +++ b/tests/data/test3015 @@ -57,17 +57,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_headers}\n" -L -o%DEV_NULL # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3023 b/tests/data/test3023 index b4210bf4820c..c5ee22f7d722 100644 --- a/tests/data/test3023 +++ b/tests/data/test3023 @@ -46,12 +46,12 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3024 b/tests/data/test3024 index 7e4b5bb6f4d8..76bd4481a55f 100644 --- a/tests/data/test3024 +++ b/tests/data/test3024 @@ -46,12 +46,12 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3027 b/tests/data/test3027 index 05a811f4e801..aaa3e547046c 100644 --- a/tests/data/test3027 +++ b/tests/data/test3027 @@ -40,16 +40,16 @@ data blobb # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -MDTM %TESTNUMBER -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM %TESTNUMBER +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test3028 b/tests/data/test3028 index bc69e862af08..7929f52c0758 100644 --- a/tests/data/test3028 +++ b/tests/data/test3028 @@ -60,13 +60,13 @@ Proxy-Connection: Keep-Alive - -proxy-line -GET /page HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +proxy-line +GET /page HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test303 b/tests/data/test303 index f2aad9dfb74e..c5c6613cb2e4 100644 --- a/tests/data/test303 +++ b/tests/data/test303 @@ -43,12 +43,12 @@ HTTPS with 8 secs timeout # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + 28 diff --git a/tests/data/test3031 b/tests/data/test3031 index 58edc376dda8..b8da69e5fde2 100644 --- a/tests/data/test3031 +++ b/tests/data/test3031 @@ -43,12 +43,12 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER --dump-header %PWD/%LOGDIR/tmp/ # # Verify data after the test has been "shot" - -GET /this/is/the/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /this/is/the/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test3032 b/tests/data/test3032 index 985ff4ff6440..067e43c02ae3 100644 --- a/tests/data/test3032 +++ b/tests/data/test3032 @@ -86,27 +86,27 @@ HTTP redirect loop 3x swsbounce test # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3035 b/tests/data/test3035 index 19fefa23183f..98fe7c5fd0c9 100644 --- a/tests/data/test3035 +++ b/tests/data/test3035 @@ -87,36 +87,36 @@ HTTP retry failed download with keep data and auto-resume # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=5- -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=11- -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=11- -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=11- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=5- +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=11- +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=11- +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=11- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test306 b/tests/data/test306 index e0b5f9075200..6fac104547f7 100644 --- a/tests/data/test306 +++ b/tests/data/test306 @@ -52,12 +52,12 @@ HTTPS GET, receive no headers only data! # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test307 b/tests/data/test307 index 650daaea1c17..3d796bfc01c4 100644 --- a/tests/data/test307 +++ b/tests/data/test307 @@ -43,12 +43,12 @@ simple HTTPS GET with openssl engine # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test309 b/tests/data/test309 index 29058d4c9665..33e36fce00a5 100644 --- a/tests/data/test309 +++ b/tests/data/test309 @@ -65,17 +65,17 @@ HTTP Location: redirect to HTTPS URL # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test31 b/tests/data/test31 index 8de7adc7836a..b8b09b8d0fe0 100644 --- a/tests/data/test31 +++ b/tests/data/test31 @@ -99,12 +99,12 @@ local-http # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: test31.curl:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: test31.curl:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test310 b/tests/data/test310 index f2415a329fb8..f58b673782d2 100644 --- a/tests/data/test310 +++ b/tests/data/test310 @@ -42,12 +42,12 @@ simple HTTPS GET # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3100 b/tests/data/test3100 index 32ce6d3bedfb..cd8dd0a3a1fb 100644 --- a/tests/data/test3100 +++ b/tests/data/test3100 @@ -69,16 +69,16 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 -CSeq: 1 -Accept: application/sdp - -DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 -CSeq: 2 -Accept: application/sdp -Authorization: Basic %b64[user:pass]b64%d29yZA== - + +DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 +CSeq: 1 +Accept: application/sdp + +DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 +CSeq: 2 +Accept: application/sdp +Authorization: Basic %b64[user:pass]b64%d29yZA== + diff --git a/tests/data/test3101 b/tests/data/test3101 index d5fd882db065..7d4dae7f64f2 100644 --- a/tests/data/test3101 +++ b/tests/data/test3101 @@ -72,16 +72,16 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:pass]b64%d29yZA== -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:pass]b64%d29yZA== +Accept: */* + diff --git a/tests/data/test3102 b/tests/data/test3102 index 9142c46460b4..779642fbb0bf 100644 --- a/tests/data/test3102 +++ b/tests/data/test3102 @@ -38,11 +38,11 @@ https://%HOSTIP:%HTTPSPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +Accept: */* + diff --git a/tests/data/test314 b/tests/data/test314 index 287ccb886e95..5970391cc538 100644 --- a/tests/data/test314 +++ b/tests/data/test314 @@ -174,13 +174,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test315 b/tests/data/test315 index 9be36dc0f21e..4b1c443c3f65 100644 --- a/tests/data/test315 +++ b/tests/data/test315 @@ -60,13 +60,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + 61 diff --git a/tests/data/test316 b/tests/data/test316 index 3036c836b1e0..12b9fd378d2d 100644 --- a/tests/data/test316 +++ b/tests/data/test316 @@ -60,13 +60,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test317 b/tests/data/test317 index e510c98b45ca..435b99d970be 100644 --- a/tests/data/test317 +++ b/tests/data/test317 @@ -75,22 +75,22 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: first.host.it.is -Proxy-Authorization: Basic %b64[testing:this]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Authorization: s3cr3t - -GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 -Host: goto.second.host.now -Proxy-Authorization: Basic %b64[testing:this]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: first.host.it.is +Proxy-Authorization: Basic %b64[testing:this]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Authorization: s3cr3t + +GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 +Host: goto.second.host.now +Proxy-Authorization: Basic %b64[testing:this]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test318 b/tests/data/test318 index 9f712782be0d..cdbde8a105bd 100644 --- a/tests/data/test318 +++ b/tests/data/test318 @@ -75,23 +75,23 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: first.host.it.is -Proxy-Authorization: Basic %b64[testing:this]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Authorization: s3cr3t - -GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 -Host: goto.second.host.now -Proxy-Authorization: Basic %b64[testing:this]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Authorization: s3cr3t - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: first.host.it.is +Proxy-Authorization: Basic %b64[testing:this]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Authorization: s3cr3t + +GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 +Host: goto.second.host.now +Proxy-Authorization: Basic %b64[testing:this]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Authorization: s3cr3t + diff --git a/tests/data/test319 b/tests/data/test319 index d6ad42e9b1c1..12da8ecbedf9 100644 --- a/tests/data/test319 +++ b/tests/data/test319 @@ -48,12 +48,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --raw # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test320 b/tests/data/test320 index edf74bc58557..60290b835f1b 100644 --- a/tests/data/test320 +++ b/tests/data/test320 @@ -56,8 +56,6 @@ simple TLS-SRP HTTPS GET, check user in response # Verify data after the test has been "shot" - - HTTP/1.0 200 OK Content-type: text/html diff --git a/tests/data/test3201 b/tests/data/test3201 index 730da8d93275..ddbf9bc24b37 100644 --- a/tests/data/test3201 +++ b/tests/data/test3201 @@ -50,14 +50,14 @@ proxy s/^PROXY TCP4 192.168.1.1 %HOSTIP (\d*) %HTTPPORT/proxy-line/ - -proxy-line -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER - + +proxy-line +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER + diff --git a/tests/data/test3202 b/tests/data/test3202 index 48a74e132cf3..d4ea6a33c317 100644 --- a/tests/data/test3202 +++ b/tests/data/test3202 @@ -55,13 +55,13 @@ proxy s/^PROXY TCP6 2001:db8:: ::1 (\d*) %HTTP6PORT/proxy-line/ - -proxy-line -GET /%TESTNUMBER HTTP/1.1 -Host: %HOST6IP:%HTTP6PORT -User-Agent: curl/%VERSION -Accept: */* - + +proxy-line +GET /%TESTNUMBER HTTP/1.1 +Host: %HOST6IP:%HTTP6PORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test3204 b/tests/data/test3204 index 8cc9c2f5b5fb..25450cb00ab8 100644 --- a/tests/data/test3204 +++ b/tests/data/test3204 @@ -37,13 +37,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # Verify that the file still exists with the correct etag value. - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "21025-dc7-39462498" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "21025-dc7-39462498" + "21025-dc7-39462498" diff --git a/tests/data/test3206 b/tests/data/test3206 index d47494a86686..1acc2c729d81 100644 --- a/tests/data/test3206 +++ b/tests/data/test3206 @@ -37,12 +37,12 @@ IMAP custom FETCH with larger literal response (~7KB) # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 456 BODY[TEXT] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 456 BODY[TEXT] +A005 LOGOUT diff --git a/tests/data/test3215 b/tests/data/test3215 index 70c12e9d36cb..8eab081f5201 100644 --- a/tests/data/test3215 +++ b/tests/data/test3215 @@ -38,19 +38,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt " NOTIFY # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: RET=HDRS -RCPT TO: NOTIFY=SUCCESS,FAILURE -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: RET=HDRS +RCPT TO: NOTIFY=SUCCESS,FAILURE +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test325 b/tests/data/test325 index 4f5826252043..c18f6dfe2063 100644 --- a/tests/data/test325 +++ b/tests/data/test325 @@ -49,12 +49,12 @@ HTTPS with attempted redirect to denied HTTP # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + # 1 - Protocol http not supported or disabled in libcurl diff --git a/tests/data/test326 b/tests/data/test326 index 920a9c1af686..656fbf8b722f 100644 --- a/tests/data/test326 +++ b/tests/data/test326 @@ -53,12 +53,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --raw # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test327 b/tests/data/test327 index 6e86c3722b54..91849746c4f1 100644 --- a/tests/data/test327 +++ b/tests/data/test327 @@ -52,18 +52,18 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: foobar=name - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: foobar=name + # Netscape HTTP Cookie File diff --git a/tests/data/test328 b/tests/data/test328 index cb891b044fa0..2cde3b22fb7b 100644 --- a/tests/data/test328 +++ b/tests/data/test328 @@ -44,12 +44,12 @@ http://%HOSTIP:%HTTPPORT/hello/%TESTNUMBER --compressed ^Accept-Encoding:.* - -GET /hello/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /hello/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test329 b/tests/data/test329 index 93135c5ec105..4d3b721e2233 100644 --- a/tests/data/test329 +++ b/tests/data/test329 @@ -59,19 +59,19 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: host.foo.com -User-Agent: curl/%VERSION -Accept: */* -Cookie: tester=yes; test=no - -GET /we/want/%TESTNUMBER0002 HTTP/1.1 -Host: host.foo.com -User-Agent: curl/%VERSION -Accept: */* -Cookie: tester=yes - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: host.foo.com +User-Agent: curl/%VERSION +Accept: */* +Cookie: tester=yes; test=no + +GET /we/want/%TESTNUMBER0002 HTTP/1.1 +Host: host.foo.com +User-Agent: curl/%VERSION +Accept: */* +Cookie: tester=yes + diff --git a/tests/data/test330 b/tests/data/test330 index 4344e2d4b27a..0e6d21defb13 100644 --- a/tests/data/test330 +++ b/tests/data/test330 @@ -74,20 +74,20 @@ proxy # # Verify data after the test has been "shot" - -GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: first.host.it.is -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: test=yes - -GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 -Host: goto.second.host.now -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: first.host.it.is +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: test=yes + +GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 +Host: goto.second.host.now +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test331 b/tests/data/test331 index 8ab268203f88..6d656ac73414 100644 --- a/tests/data/test331 +++ b/tests/data/test331 @@ -50,20 +50,20 @@ proxy # Verify data after the test has been "shot" - -GET http://moo/we/want/%TESTNUMBER HTTP/1.1 -Host: moo -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://moo/we/want/%TESTNUMBER0002 HTTP/1.1 -Host: moo -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Cookie: moo=yes - + +GET http://moo/we/want/%TESTNUMBER HTTP/1.1 +Host: moo +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://moo/we/want/%TESTNUMBER0002 HTTP/1.1 +Host: moo +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Cookie: moo=yes + diff --git a/tests/data/test334 b/tests/data/test334 index 159335093b8d..b6194e09be86 100644 --- a/tests/data/test334 +++ b/tests/data/test334 @@ -31,12 +31,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test335 b/tests/data/test335 index 327296df32be..c4057953d288 100644 --- a/tests/data/test335 +++ b/tests/data/test335 @@ -74,28 +74,28 @@ http://digest:a-lot@data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --p # Verify data after the test has been "shot" - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="f61609cd8f5bb205ef4e169b2c5626cb" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 -Host: data.from.server.requiring.digest.hohoho.com -Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="f61609cd8f5bb205ef4e169b2c5626cb" -Authorization: Digest username="digest", realm="realmweirdo", nonce="123456", uri="/%TESTNUMBER", response="ea0f4cb7a119a1a6f6c6c6c2e4190860" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="f61609cd8f5bb205ef4e169b2c5626cb" +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 +Host: data.from.server.requiring.digest.hohoho.com +Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/%TESTNUMBER", response="f61609cd8f5bb205ef4e169b2c5626cb" +Authorization: Digest username="digest", realm="realmweirdo", nonce="123456", uri="/%TESTNUMBER", response="ea0f4cb7a119a1a6f6c6c6c2e4190860" +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test336 b/tests/data/test336 index f50b42adb332..ddf4266b46b6 100644 --- a/tests/data/test336 +++ b/tests/data/test336 @@ -41,18 +41,18 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --range 3-6 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -REST 3 -RETR %TESTNUMBER -ABOR -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +REST 3 +RETR %TESTNUMBER +ABOR +QUIT diff --git a/tests/data/test337 b/tests/data/test337 index d44a712fbbb7..a54f964e10fe 100644 --- a/tests/data/test337 +++ b/tests/data/test337 @@ -41,18 +41,18 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --range 3-6 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -PASV -TYPE I -SIZE %TESTNUMBER -REST 3 -RETR %TESTNUMBER -ABOR -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE %TESTNUMBER +REST 3 +RETR %TESTNUMBER +ABOR +QUIT diff --git a/tests/data/test339 b/tests/data/test339 index 8c43402757c6..29205e0431d9 100644 --- a/tests/data/test339 +++ b/tests/data/test339 @@ -46,12 +46,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + W/"asdf" diff --git a/tests/data/test34 b/tests/data/test34 index 5d81a5a8f784..bda5a23fc568 100644 --- a/tests/data/test34 +++ b/tests/data/test34 @@ -52,12 +52,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test340 b/tests/data/test340 index c003e42afa91..d971a07c099e 100644 --- a/tests/data/test340 +++ b/tests/data/test340 @@ -28,10 +28,10 @@ FTP using %00 in path with singlecwd # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD 3 diff --git a/tests/data/test341 b/tests/data/test341 index b6e429a222c2..3a5f82ea24e3 100644 --- a/tests/data/test341 +++ b/tests/data/test341 @@ -46,13 +46,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "" + diff --git a/tests/data/test342 b/tests/data/test342 index 79f60256350c..14d343998db0 100644 --- a/tests/data/test342 +++ b/tests/data/test342 @@ -44,13 +44,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "21025-dc7-39462498" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "21025-dc7-39462498" + diff --git a/tests/data/test343 b/tests/data/test343 index dd13708ce895..c23c3080538e 100644 --- a/tests/data/test343 +++ b/tests/data/test343 @@ -44,13 +44,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "21025-dc7-39462498" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "21025-dc7-39462498" + "21025-dc7-11111" diff --git a/tests/data/test344 b/tests/data/test344 index 197c00489bdb..06e70c8597a8 100644 --- a/tests/data/test344 +++ b/tests/data/test344 @@ -41,13 +41,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "" + "21025-dc7-11111" diff --git a/tests/data/test345 b/tests/data/test345 index c6da676a83d8..5fbd2dfd9f56 100644 --- a/tests/data/test345 +++ b/tests/data/test345 @@ -44,13 +44,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-None-Match: "21025-dc7-39462498" - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-None-Match: "21025-dc7-39462498" + "21025-dc7-11111" diff --git a/tests/data/test346 b/tests/data/test346 index a94da860b0e2..0f67cfb33945 100644 --- a/tests/data/test346 +++ b/tests/data/test346 @@ -44,15 +44,15 @@ HTTP GET over proxy with credentials using blank passwords # - -GET http://remote.example/%TESTNUMBER HTTP/1.1 -Host: remote.example -Proxy-Authorization: Basic %b64[puser:]b64% -Authorization: Basic %b64[suser:]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://remote.example/%TESTNUMBER HTTP/1.1 +Host: remote.example +Proxy-Authorization: Basic %b64[puser:]b64% +Authorization: Basic %b64[suser:]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test347 b/tests/data/test347 index 606335c0d060..dae91d3ca274 100644 --- a/tests/data/test347 +++ b/tests/data/test347 @@ -46,12 +46,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test348 b/tests/data/test348 index 55e9d608ddc8..108e089444df 100644 --- a/tests/data/test348 +++ b/tests/data/test348 @@ -44,14 +44,14 @@ that FTP works so does it? - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +STOR %TESTNUMBER +QUIT # 70 - CURLE_REMOTE_DISK_FULL diff --git a/tests/data/test349 b/tests/data/test349 index c1106f2ac3ca..6dc32dbbf550 100644 --- a/tests/data/test349 +++ b/tests/data/test349 @@ -31,12 +31,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail-with-body # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 22 diff --git a/tests/data/test350 b/tests/data/test350 index 3eb8b80aa6bd..9bc9237836f2 100644 --- a/tests/data/test350 +++ b/tests/data/test350 @@ -41,15 +41,15 @@ ftp://%HOSTIP:%FTPPORT// --ftp-method multicwd # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test351 b/tests/data/test351 index ffa93e3e2987..4ac29ecee6e9 100644 --- a/tests/data/test351 +++ b/tests/data/test351 @@ -41,14 +41,14 @@ ftp://%HOSTIP:%FTPPORT// --ftp-method nocwd # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST / -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST / +QUIT diff --git a/tests/data/test352 b/tests/data/test352 index 0cc4d69fd1e4..2311bfa457f8 100644 --- a/tests/data/test352 +++ b/tests/data/test352 @@ -41,15 +41,15 @@ ftp://%HOSTIP:%FTPPORT// --ftp-method singlecwd # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD / -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD / +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test353 b/tests/data/test353 index a94828bd6b98..4b4889926363 100644 --- a/tests/data/test353 +++ b/tests/data/test353 @@ -41,14 +41,14 @@ ftp://%HOSTIP:%FTPPORT/ --ftp-method singlecwd # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test354 b/tests/data/test354 index dc6d732d8ba2..641cd01f8b5a 100644 --- a/tests/data/test354 +++ b/tests/data/test354 @@ -37,14 +37,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test355 b/tests/data/test355 index 67f7777ff504..ffb7cbc3c1d0 100644 --- a/tests/data/test355 +++ b/tests/data/test355 @@ -44,12 +44,12 @@ h1 example.com 80 h1 %HOSTIP %HTTPPORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test356 b/tests/data/test356 index 8d7cd45b17da..d723b3953db3 100644 --- a/tests/data/test356 +++ b/tests/data/test356 @@ -50,12 +50,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --alt-svc "%LOGDIR/altsvc-%TESTNUMBER" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # strip out the (dynamic) expire date from the file so that the rest diff --git a/tests/data/test36 b/tests/data/test36 index 1f055726bce8..efe23719a808 100644 --- a/tests/data/test36 +++ b/tests/data/test36 @@ -52,12 +52,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 56 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test361 b/tests/data/test361 index 4fbf3d5ea24e..c9642fbbfa81 100644 --- a/tests/data/test361 +++ b/tests/data/test361 @@ -31,17 +31,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 22 diff --git a/tests/data/test362 b/tests/data/test362 index e8ce9731ed83..2259211adcce 100644 --- a/tests/data/test362 +++ b/tests/data/test362 @@ -37,15 +37,15 @@ that FTP works so does it? - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test363 b/tests/data/test363 index d2d9661f7088..489d2cf6f188 100644 --- a/tests/data/test363 +++ b/tests/data/test363 @@ -74,14 +74,14 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -POST /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 27 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 27 +Content-Type: application/x-www-form-urlencoded + datatopost=ohthatsfunyesyes diff --git a/tests/data/test365 b/tests/data/test365 index 40f0540bcc13..847023011d6c 100644 --- a/tests/data/test365 +++ b/tests/data/test365 @@ -54,12 +54,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test366 b/tests/data/test366 index d2193ff14a5c..8fcdbc4d91de 100644 --- a/tests/data/test366 +++ b/tests/data/test366 @@ -37,12 +37,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 2 --retry-max-time 10 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test367 b/tests/data/test367 index bd3bc0a88783..fd3252f31e18 100644 --- a/tests/data/test367 +++ b/tests/data/test367 @@ -36,13 +36,13 @@ http://:example@%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[:example]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[:example]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test368 b/tests/data/test368 index 69b63e94f6c6..d49d1ccf3026 100644 --- a/tests/data/test368 +++ b/tests/data/test368 @@ -37,13 +37,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -r 4 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=4- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=4- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test369 b/tests/data/test369 index 17a6b4480adf..9810d0a5b9d2 100644 --- a/tests/data/test369 +++ b/tests/data/test369 @@ -36,12 +36,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/nowhere/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test37 b/tests/data/test37 index d5e79824c6e2..ee2ac76e2805 100644 --- a/tests/data/test37 +++ b/tests/data/test37 @@ -33,12 +33,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 52 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test371 b/tests/data/test371 index b58237f35960..d31454f07b09 100644 --- a/tests/data/test371 +++ b/tests/data/test371 @@ -42,12 +42,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/dump -o %LOGDIR/dump2 --no-progr # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + Warning: Got more output options than URLs diff --git a/tests/data/test372 b/tests/data/test372 index e1cf356ddd7a..fcc07822ed68 100644 --- a/tests/data/test372 +++ b/tests/data/test372 @@ -35,12 +35,12 @@ proxy - -GET /binary-zero-in-data-section/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /binary-zero-in-data-section/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 0 diff --git a/tests/data/test373 b/tests/data/test373 index 5a51fe968f13..99bfaf3ac95f 100644 --- a/tests/data/test373 +++ b/tests/data/test373 @@ -64,12 +64,12 @@ http://%HOSTIP:%HTTPPORT/chunked-transfer-encoding/%TESTNUMBER - -GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 0 diff --git a/tests/data/test374 b/tests/data/test374 index d85bb7855f6a..daec117af9e7 100644 --- a/tests/data/test374 +++ b/tests/data/test374 @@ -35,12 +35,12 @@ http://%HOSTIP:%HTTPPORT/gif/%TESTNUMBER - -GET /gif/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /gif/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 0 diff --git a/tests/data/test376 b/tests/data/test376 index 6913788a3b2d..d2affc1de533 100644 --- a/tests/data/test376 +++ b/tests/data/test376 @@ -45,12 +45,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save-%TESTNUMBER --remove-on-err 18 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # the file should be empty now diff --git a/tests/data/test379 b/tests/data/test379 index 0d727ccf26b5..d465e90901c3 100644 --- a/tests/data/test379 +++ b/tests/data/test379 @@ -48,12 +48,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save --remove-on-error --no-clob 18 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # this file should be untouched diff --git a/tests/data/test38 b/tests/data/test38 index abd2d3e362ae..3346f6cf6f1d 100644 --- a/tests/data/test38 +++ b/tests/data/test38 @@ -41,13 +41,13 @@ download on. 33 - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=78- -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=78- +User-Agent: curl/%VERSION +Accept: */* + # the download target file must remain untouched diff --git a/tests/data/test380 b/tests/data/test380 index f9ccafdabc28..6fe29288b641 100644 --- a/tests/data/test380 +++ b/tests/data/test380 @@ -48,14 +48,14 @@ machine %HOSTIP login mary password yram # # Verify data after the test has been "shot" - -USER mary -PASS yram -PWD -EPSV -TYPE A -LIST -QUIT + +USER mary +PASS yram +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test381 b/tests/data/test381 index 41b9eb779c74..9ec9b5a89ba9 100644 --- a/tests/data/test381 +++ b/tests/data/test381 @@ -52,14 +52,14 @@ machine %HOSTIP login mary password yram # # Verify data after the test has been "shot" - -USER mary -PASS drfrank -PWD -EPSV -TYPE A -LIST -QUIT + +USER mary +PASS drfrank +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test383 b/tests/data/test383 index 2094460db3ab..2f4191ad8dbc 100644 --- a/tests/data/test383 +++ b/tests/data/test383 @@ -42,14 +42,14 @@ HTTP with --json # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Content-Type: application/json -Accept: application/json -Content-Length: 21 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Content-Type: application/json +Accept: application/json +Content-Length: 21 + { "drink": "coffee" } diff --git a/tests/data/test385 b/tests/data/test385 index c28a9f08f6fd..fbcebc7ab4b3 100644 --- a/tests/data/test385 +++ b/tests/data/test385 @@ -42,14 +42,14 @@ HTTP with --json x 2 # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Content-Type: drinks/hot -Accept: application/json -Content-Length: 41 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Content-Type: drinks/hot +Accept: application/json +Content-Length: 41 + { "drink": "coffee", "crunch": "cookie" } diff --git a/tests/data/test386 b/tests/data/test386 index c49d75b2aa62..c267ef62ae13 100644 --- a/tests/data/test386 +++ b/tests/data/test386 @@ -56,19 +56,19 @@ HTTP with --json + --next # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Content-Type: application/json -Accept: application/json -Content-Length: 21 - -{ "drink": "coffee" }GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Content-Type: application/json +Accept: application/json +Content-Length: 21 + +{ "drink": "coffee" }GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test387 b/tests/data/test387 index a6d2ab03fcab..b07096263ece 100644 --- a/tests/data/test387 +++ b/tests/data/test387 @@ -38,14 +38,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -sS --tr-encoding # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -TE: gzip -Connection: TE - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +TE: gzip +Connection: TE + # CURLE_BAD_CONTENT_ENCODING is 61 diff --git a/tests/data/test389 b/tests/data/test389 index a38d70eef636..069515ac8092 100644 --- a/tests/data/test389 +++ b/tests/data/test389 @@ -46,12 +46,12 @@ local-http # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: curlmachine.localhost:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: curlmachine.localhost:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test391 b/tests/data/test391 index 279c562de317..55d540550232 100644 --- a/tests/data/test391 +++ b/tests/data/test391 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/../../%TESTNUMBER --path-as-is -L # # Verify data after the test has been "shot" - -GET /../../%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /../../%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test392 b/tests/data/test392 index a9f756d94828..be0a52640067 100644 --- a/tests/data/test392 +++ b/tests/data/test392 @@ -45,18 +45,18 @@ local-http # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: foobar=name - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: foobar=name + diff --git a/tests/data/test393 b/tests/data/test393 index a9cad7079205..11f273a6c7f4 100644 --- a/tests/data/test393 +++ b/tests/data/test393 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 2000000 63 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test394 b/tests/data/test394 index 3533447f578d..5f797d9794d2 100644 --- a/tests/data/test394 +++ b/tests/data/test394 @@ -46,12 +46,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 8 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test395 b/tests/data/test395 index 8dbd4e964d45..e3626eb82bde 100644 --- a/tests/data/test395 +++ b/tests/data/test395 @@ -42,12 +42,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test396 b/tests/data/test396 index f5606dde77a1..4e57778cf18e 100644 --- a/tests/data/test396 +++ b/tests/data/test396 @@ -171,13 +171,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test397 b/tests/data/test397 index f05fe21970b7..40f1495fc5a4 100644 --- a/tests/data/test397 +++ b/tests/data/test397 @@ -61,13 +61,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Accept-Encoding: xxx - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Accept-Encoding: xxx + diff --git a/tests/data/test398 b/tests/data/test398 index eab125272cac..6b52e0e558c0 100644 --- a/tests/data/test398 +++ b/tests/data/test398 @@ -46,12 +46,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 8 diff --git a/tests/data/test4 b/tests/data/test4 index 58e1650b0739..06012cca862b 100644 --- a/tests/data/test4 +++ b/tests/data/test4 @@ -37,25 +37,25 @@ Replaced internal and added custom HTTP headers # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -extra-header: here -Accept: replaced -X-Custom-Header: -X-Test: foo; -X-Test2: foo; - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -extra-header: here -Accept: replaced -X-Custom-Header: -X-Test: foo; -X-Test2: foo; - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +extra-header: here +Accept: replaced +X-Custom-Header: +X-Test: foo; +X-Test2: foo; + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +extra-header: here +Accept: replaced +X-Custom-Header: +X-Test: foo; +X-Test2: foo; + diff --git a/tests/data/test40 b/tests/data/test40 index 16e9426c865d..5d8d8c1e45b0 100644 --- a/tests/data/test40 +++ b/tests/data/test40 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/are/all/moo.html/?name=d+a+niel&testcase=/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/are/all/moo.html/?name=d+a+niel&testcase=/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test400 b/tests/data/test400 index 47fdd49e3ea7..32f85f856ef7 100644 --- a/tests/data/test400 +++ b/tests/data/test400 @@ -45,16 +45,16 @@ FTPS dir list PASV unencrypted data # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test4000 b/tests/data/test4000 index 0f9e0d528fa5..49382c9363da 100644 --- a/tests/data/test4000 +++ b/tests/data/test4000 @@ -40,12 +40,12 @@ HTTPS GET with ECH GREASE # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test401 b/tests/data/test401 index 8ff16a5c0dde..27752cd8d92b 100644 --- a/tests/data/test401 +++ b/tests/data/test401 @@ -42,16 +42,16 @@ that FTPS works so does it? - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -EPSV -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +EPSV +TYPE I +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test402 b/tests/data/test402 index a62267dd1523..a038efd3c88a 100644 --- a/tests/data/test402 +++ b/tests/data/test402 @@ -28,9 +28,9 @@ FTP SSL required on non-SSL server 64 - -AUTH SSL -AUTH TLS + +AUTH SSL +AUTH TLS diff --git a/tests/data/test403 b/tests/data/test403 index f451bf8f4335..20609c2d1360 100644 --- a/tests/data/test403 +++ b/tests/data/test403 @@ -47,17 +47,17 @@ FTPS with CCC not supported by server # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -CCC -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +CCC +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test406 b/tests/data/test406 index 9cd5047d85e7..0e1b70ebfc4a 100644 --- a/tests/data/test406 +++ b/tests/data/test406 @@ -50,16 +50,16 @@ FTPS dir list, PORT with specified IP ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -PORT 127,0,0,1,243,212 -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +PORT 127,0,0,1,243,212 +TYPE A +LIST +QUIT diff --git a/tests/data/test407 b/tests/data/test407 index 33a07cd12694..edbd188c6e9c 100644 --- a/tests/data/test407 +++ b/tests/data/test407 @@ -39,22 +39,22 @@ data blobb # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -CWD a -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +CWD a +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test408 b/tests/data/test408 index 13c9c51179c2..e60c771617bf 100644 --- a/tests/data/test408 +++ b/tests/data/test408 @@ -40,19 +40,19 @@ Moooooooooooo ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -CWD CWD -CWD STOR -CWD RETR -PORT 127,0,0,1,5,109 -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +CWD CWD +CWD STOR +CWD RETR +PORT 127,0,0,1,5,109 +TYPE I +STOR %TESTNUMBER +QUIT Moooooooooooo diff --git a/tests/data/test409 b/tests/data/test409 index f7a014248c82..872261b28f69 100644 --- a/tests/data/test409 +++ b/tests/data/test409 @@ -42,16 +42,16 @@ that FTP works so does it? - -USER anonymous -PASS ftp@example.com -PBSZ 0 -PROT C -PWD -EPSV -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PBSZ 0 +PROT C +PWD +EPSV +TYPE I +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test410 b/tests/data/test410 index f947fcdc1d4f..85885a4d895d 100644 --- a/tests/data/test410 +++ b/tests/data/test410 @@ -43,13 +43,13 @@ Long: %repeat[3500 x header content]% # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* -Long: %repeat[3500 x header content]% - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Long: %repeat[3500 x header content]% + diff --git a/tests/data/test412 b/tests/data/test412 index 4c90c98ec1e0..3a6c1836031f 100644 --- a/tests/data/test412 +++ b/tests/data/test412 @@ -52,13 +52,13 @@ h1 whohoo 12345 h1 %HOSTIP %HTTPPORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: whohoo.:12345 -User-Agent: curl/%VERSION -Accept: */* -Alt-Used: %HOSTIP:%HTTPPORT - + +GET /%TESTNUMBER HTTP/1.1 +Host: whohoo.:12345 +User-Agent: curl/%VERSION +Accept: */* +Alt-Used: %HOSTIP:%HTTPPORT + diff --git a/tests/data/test413 b/tests/data/test413 index 913a444d9ff2..392dbc16f027 100644 --- a/tests/data/test413 +++ b/tests/data/test413 @@ -52,13 +52,13 @@ h1 whohoo. 12345 h1 %HOSTIP %HTTPPORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: whohoo:12345 -User-Agent: curl/%VERSION -Accept: */* -Alt-Used: %HOSTIP:%HTTPPORT - + +GET /%TESTNUMBER HTTP/1.1 +Host: whohoo:12345 +User-Agent: curl/%VERSION +Accept: */* +Alt-Used: %HOSTIP:%HTTPPORT + diff --git a/tests/data/test414 b/tests/data/test414 index 8a697ae125c6..7e84a8c939a2 100644 --- a/tests/data/test414 +++ b/tests/data/test414 @@ -62,23 +62,23 @@ https://attack.invalid:%HTTPSPORT/a/b/%TESTNUMBER --insecure -c %LOGDIR/cookie%T # # Verify data after the test has been "shot" - -GET /a/b/%TESTNUMBER HTTP/1.1 -Host: attack.invalid:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /a/b/%TESTNUMBER0002 HTTP/1.1 -Host: attack.invalid:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /a/b/%TESTNUMBER0003 HTTP/1.1 -Host: attack.invalid:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: SESSIONID=originaltoken; second=originaltoken - + +GET /a/b/%TESTNUMBER HTTP/1.1 +Host: attack.invalid:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /a/b/%TESTNUMBER0002 HTTP/1.1 +Host: attack.invalid:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /a/b/%TESTNUMBER0003 HTTP/1.1 +Host: attack.invalid:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: SESSIONID=originaltoken; second=originaltoken + diff --git a/tests/data/test415 b/tests/data/test415 index f0cecd267f5f..0692dc54c9da 100644 --- a/tests/data/test415 +++ b/tests/data/test415 @@ -41,12 +41,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # built-in curl returns weird_server_reply diff --git a/tests/data/test416 b/tests/data/test416 index b6b10b3df2c0..50397a205236 100644 --- a/tests/data/test416 +++ b/tests/data/test416 @@ -38,14 +38,14 @@ FTP growing file support # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test417 b/tests/data/test417 index 5ac1755542db..c8f5997b6739 100644 --- a/tests/data/test417 +++ b/tests/data/test417 @@ -38,12 +38,12 @@ https - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + s/^(.*):(.*)[\r\n]*// diff --git a/tests/data/test42 b/tests/data/test42 index 85a4c88c65a2..36263e2987d6 100644 --- a/tests/data/test42 +++ b/tests/data/test42 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/are/all/m%20o%20o.html/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/are/all/m%20o%20o.html/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test43 b/tests/data/test43 index 1c36f1c60c67..57e22eba0fe2 100644 --- a/tests/data/test43 +++ b/tests/data/test43 @@ -63,19 +63,19 @@ proxy # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://%HOSTIP:%HTTPPORT/want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://%HOSTIP:%HTTPPORT/want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test430 b/tests/data/test430 index 377c2d48b9d2..fb68dcf3f79f 100644 --- a/tests/data/test430 +++ b/tests/data/test430 @@ -70,31 +70,31 @@ Three -K uses with --next and --data in each # # Verify data after the test has been "shot" - -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -a: a -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - -aPOST /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -b: b -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - -bPOST /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -c: c -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +a: a +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + +aPOST /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +b: b +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + +bPOST /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +c: c +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + c diff --git a/tests/data/test431 b/tests/data/test431 index 9622d64e1d26..54bf7ae6ecbd 100644 --- a/tests/data/test431 +++ b/tests/data/test431 @@ -64,31 +64,31 @@ Two -K uses with --next and then one on cmdline # # Verify data after the test has been "shot" - -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -a: a -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - -aPOST /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -b: b -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - -bPOST /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -c: c -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +a: a +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + +aPOST /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +b: b +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + +bPOST /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +c: c +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + c diff --git a/tests/data/test432 b/tests/data/test432 index 02a46111d324..5b0066f7d384 100644 --- a/tests/data/test432 +++ b/tests/data/test432 @@ -69,31 +69,31 @@ Use -K with --next and --config from within # # Verify data after the test has been "shot" - -POST /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -a: a -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - -aPOST /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -b: b -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - -bPOST /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -c: c -Content-Length: 1 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +a: a +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + +aPOST /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +b: b +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + +bPOST /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +c: c +Content-Length: 1 +Content-Type: application/x-www-form-urlencoded + c diff --git a/tests/data/test433 b/tests/data/test433 index d063c4316140..4d91fdce6b2f 100644 --- a/tests/data/test433 +++ b/tests/data/test433 @@ -44,15 +44,15 @@ Verify XDG_CONFIG_HOME use to find curlrc # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -a: a -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +a: a +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + curlrc read diff --git a/tests/data/test434 b/tests/data/test434 index 63d8ce7c6e28..274380dfa683 100644 --- a/tests/data/test434 +++ b/tests/data/test434 @@ -35,12 +35,12 @@ http # - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test435 b/tests/data/test435 index 4d13ebb81ea4..d5cdfbbbd7d5 100644 --- a/tests/data/test435 +++ b/tests/data/test435 @@ -33,17 +33,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w 'lo # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # replace the number with a fixed string since the port number is not diff --git a/tests/data/test436 b/tests/data/test436 index dfd39f2b3946..4371c84d48ad 100644 --- a/tests/data/test436 +++ b/tests/data/test436 @@ -44,15 +44,15 @@ Find .curlrc in .config/curlrc via CURL_HOME # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -a: a -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +a: a +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + curlrc read diff --git a/tests/data/test437 b/tests/data/test437 index 1322fb05946b..7611be8257ef 100644 --- a/tests/data/test437 +++ b/tests/data/test437 @@ -48,12 +48,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --alt-svc "%LOGDIR/altsvc-%TESTNUMBER" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # strip out the (dynamic) expire date from the file so that the rest diff --git a/tests/data/test440 b/tests/data/test440 index 7da9a8bd3cc8..238e3b3f4db9 100644 --- a/tests/data/test440 +++ b/tests/data/test440 @@ -52,12 +52,12 @@ test-duphandle # we let it CONNECT to the server to confirm HSTS but deny from there - -CONNECT this.hsts.example.:443 HTTP/1.1 -Host: this.hsts.example.:443 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT this.hsts.example.:443 HTTP/1.1 +Host: this.hsts.example.:443 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + HTTP/1.1 403 not OK at all diff --git a/tests/data/test441 b/tests/data/test441 index 02aca4d0e0f6..2cdd9f318c0b 100644 --- a/tests/data/test441 +++ b/tests/data/test441 @@ -51,12 +51,12 @@ test-duphandle # we let it CONNECT to the server to confirm HSTS but deny from there - -CONNECT this.hsts.example:443 HTTP/1.1 -Host: this.hsts.example:443 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT this.hsts.example:443 HTTP/1.1 +Host: this.hsts.example:443 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + HTTP/1.1 403 not OK at all diff --git a/tests/data/test442 b/tests/data/test442 index fb881d3b67f9..1f29ad3bc62a 100644 --- a/tests/data/test442 +++ b/tests/data/test442 @@ -201,13 +201,13 @@ cookies # # Verify data after the test has been "shot" - -GET /a/b/%TESTNUMBER HTTP/1.1 -Host: attack.invalid:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: name150=could-be-large-150; name149=could-be-large-149; name148=could-be-large-148; name147=could-be-large-147; name146=could-be-large-146; name145=could-be-large-145; name144=could-be-large-144; name143=could-be-large-143; name142=could-be-large-142; name141=could-be-large-141; name140=could-be-large-140; name139=could-be-large-139; name138=could-be-large-138; name137=could-be-large-137; name136=could-be-large-136; name135=could-be-large-135; name134=could-be-large-134; name133=could-be-large-133; name132=could-be-large-132; name131=could-be-large-131; name130=could-be-large-130; name129=could-be-large-129; name128=could-be-large-128; name127=could-be-large-127; name126=could-be-large-126; name125=could-be-large-125; name124=could-be-large-124; name123=could-be-large-123; name122=could-be-large-122; name121=could-be-large-121; name120=could-be-large-120; name119=could-be-large-119; name118=could-be-large-118; name117=could-be-large-117; name116=could-be-large-116; name115=could-be-large-115; name114=could-be-large-114; name113=could-be-large-113; name112=could-be-large-112; name111=could-be-large-111; name110=could-be-large-110; name109=could-be-large-109; name108=could-be-large-108; name107=could-be-large-107; name106=could-be-large-106; name105=could-be-large-105; name104=could-be-large-104; name103=could-be-large-103; name102=could-be-large-102; name101=could-be-large-101; name100=could-be-large-100; name99=could-be-large-99; name98=could-be-large-98; name97=could-be-large-97; name96=could-be-large-96; name95=could-be-large-95; name94=could-be-large-94; name93=could-be-large-93; name92=could-be-large-92; name91=could-be-large-91; name90=could-be-large-90; name89=could-be-large-89; name88=could-be-large-88; name87=could-be-large-87; name86=could-be-large-86; name85=could-be-large-85; name84=could-be-large-84; name83=could-be-large-83; name82=could-be-large-82; name81=could-be-large-81; name80=could-be-large-80; name79=could-be-large-79; name78=could-be-large-78; name77=could-be-large-77; name76=could-be-large-76; name75=could-be-large-75; name74=could-be-large-74; name73=could-be-large-73; name72=could-be-large-72; name71=could-be-large-71; name70=could-be-large-70; name69=could-be-large-69; name68=could-be-large-68; name67=could-be-large-67; name66=could-be-large-66; name65=could-be-large-65; name64=could-be-large-64; name63=could-be-large-63; name62=could-be-large-62; name61=could-be-large-61; name60=could-be-large-60; name59=could-be-large-59; name58=could-be-large-58; name57=could-be-large-57; name56=could-be-large-56; name55=could-be-large-55; name54=could-be-large-54; name53=could-be-large-53; name52=could-be-large-52; name51=could-be-large-51; name50=could-be-large-50; name49=could-be-large-49; name48=could-be-large-48; name47=could-be-large-47; name46=could-be-large-46; name45=could-be-large-45; name44=could-be-large-44; name43=could-be-large-43; name42=could-be-large-42; name41=could-be-large-41; name40=could-be-large-40; name39=could-be-large-39; name38=could-be-large-38; name37=could-be-large-37; name36=could-be-large-36; name35=could-be-large-35; name34=could-be-large-34; name33=could-be-large-33; name32=could-be-large-32; name31=could-be-large-31; name30=could-be-large-30; name29=could-be-large-29; name28=could-be-large-28; name27=could-be-large-27; name26=could-be-large-26; name25=could-be-large-25; name24=could-be-large-24; name23=could-be-large-23; name22=could-be-large-22; name21=could-be-large-21; name20=could-be-large-20; name19=could-be-large-19; name18=could-be-large-18; name17=could-be-large-17; name16=could-be-large-16; name15=could-be-large-15; name14=could-be-large-14; name13=could-be-large-13; name12=could-be-large-12; name11=could-be-large-11; name10=could-be-large-10; name9=could-be-large-9; name8=could-be-large-8; name7=could-be-large-7; name6=could-be-large-6; name5=could-be-large-5; name4=could-be-large-4; name3=could-be-large-3; name2=could-be-large-2; name1=could-be-large-1 - + +GET /a/b/%TESTNUMBER HTTP/1.1 +Host: attack.invalid:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: name150=could-be-large-150; name149=could-be-large-149; name148=could-be-large-148; name147=could-be-large-147; name146=could-be-large-146; name145=could-be-large-145; name144=could-be-large-144; name143=could-be-large-143; name142=could-be-large-142; name141=could-be-large-141; name140=could-be-large-140; name139=could-be-large-139; name138=could-be-large-138; name137=could-be-large-137; name136=could-be-large-136; name135=could-be-large-135; name134=could-be-large-134; name133=could-be-large-133; name132=could-be-large-132; name131=could-be-large-131; name130=could-be-large-130; name129=could-be-large-129; name128=could-be-large-128; name127=could-be-large-127; name126=could-be-large-126; name125=could-be-large-125; name124=could-be-large-124; name123=could-be-large-123; name122=could-be-large-122; name121=could-be-large-121; name120=could-be-large-120; name119=could-be-large-119; name118=could-be-large-118; name117=could-be-large-117; name116=could-be-large-116; name115=could-be-large-115; name114=could-be-large-114; name113=could-be-large-113; name112=could-be-large-112; name111=could-be-large-111; name110=could-be-large-110; name109=could-be-large-109; name108=could-be-large-108; name107=could-be-large-107; name106=could-be-large-106; name105=could-be-large-105; name104=could-be-large-104; name103=could-be-large-103; name102=could-be-large-102; name101=could-be-large-101; name100=could-be-large-100; name99=could-be-large-99; name98=could-be-large-98; name97=could-be-large-97; name96=could-be-large-96; name95=could-be-large-95; name94=could-be-large-94; name93=could-be-large-93; name92=could-be-large-92; name91=could-be-large-91; name90=could-be-large-90; name89=could-be-large-89; name88=could-be-large-88; name87=could-be-large-87; name86=could-be-large-86; name85=could-be-large-85; name84=could-be-large-84; name83=could-be-large-83; name82=could-be-large-82; name81=could-be-large-81; name80=could-be-large-80; name79=could-be-large-79; name78=could-be-large-78; name77=could-be-large-77; name76=could-be-large-76; name75=could-be-large-75; name74=could-be-large-74; name73=could-be-large-73; name72=could-be-large-72; name71=could-be-large-71; name70=could-be-large-70; name69=could-be-large-69; name68=could-be-large-68; name67=could-be-large-67; name66=could-be-large-66; name65=could-be-large-65; name64=could-be-large-64; name63=could-be-large-63; name62=could-be-large-62; name61=could-be-large-61; name60=could-be-large-60; name59=could-be-large-59; name58=could-be-large-58; name57=could-be-large-57; name56=could-be-large-56; name55=could-be-large-55; name54=could-be-large-54; name53=could-be-large-53; name52=could-be-large-52; name51=could-be-large-51; name50=could-be-large-50; name49=could-be-large-49; name48=could-be-large-48; name47=could-be-large-47; name46=could-be-large-46; name45=could-be-large-45; name44=could-be-large-44; name43=could-be-large-43; name42=could-be-large-42; name41=could-be-large-41; name40=could-be-large-40; name39=could-be-large-39; name38=could-be-large-38; name37=could-be-large-37; name36=could-be-large-36; name35=could-be-large-35; name34=could-be-large-34; name33=could-be-large-33; name32=could-be-large-32; name31=could-be-large-31; name30=could-be-large-30; name29=could-be-large-29; name28=could-be-large-28; name27=could-be-large-27; name26=could-be-large-26; name25=could-be-large-25; name24=could-be-large-24; name23=could-be-large-23; name22=could-be-large-22; name21=could-be-large-21; name20=could-be-large-20; name19=could-be-large-19; name18=could-be-large-18; name17=could-be-large-17; name16=could-be-large-16; name15=could-be-large-15; name14=could-be-large-14; name13=could-be-large-13; name12=could-be-large-12; name11=could-be-large-11; name10=could-be-large-10; name9=could-be-large-9; name8=could-be-large-8; name7=could-be-large-7; name6=could-be-large-6; name5=could-be-large-5; name4=could-be-large-4; name3=could-be-large-3; name2=could-be-large-2; name1=could-be-large-1 + Allocations: 1100 diff --git a/tests/data/test443 b/tests/data/test443 index cbc8685ac2b0..ae9218325aa9 100644 --- a/tests/data/test443 +++ b/tests/data/test443 @@ -70,13 +70,13 @@ cookies # # Verify data after the test has been "shot" - -GET /a/b/%TESTNUMBER HTTP/1.1 -Host: attack.invalid:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: huge-20=%repeat[500 x a]%-20; huge-19=%repeat[500 x a]%-19; huge-18=%repeat[500 x a]%-18; huge-17=%repeat[500 x a]%-17; huge-16=%repeat[500 x a]%-16; huge-15=%repeat[500 x a]%-15; huge-14=%repeat[500 x a]%-14; huge-13=%repeat[500 x a]%-13; huge-12=%repeat[500 x a]%-12; huge-11=%repeat[500 x a]%-11; huge-10=%repeat[500 x a]%-10; huge-9=%repeat[500 x a]%-9; huge-8=%repeat[500 x a]%-8; huge-7=%repeat[500 x a]%-7; huge-6=%repeat[500 x a]%-6 - + +GET /a/b/%TESTNUMBER HTTP/1.1 +Host: attack.invalid:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: huge-20=%repeat[500 x a]%-20; huge-19=%repeat[500 x a]%-19; huge-18=%repeat[500 x a]%-18; huge-17=%repeat[500 x a]%-17; huge-16=%repeat[500 x a]%-16; huge-15=%repeat[500 x a]%-15; huge-14=%repeat[500 x a]%-14; huge-13=%repeat[500 x a]%-13; huge-12=%repeat[500 x a]%-12; huge-11=%repeat[500 x a]%-11; huge-10=%repeat[500 x a]%-10; huge-9=%repeat[500 x a]%-9; huge-8=%repeat[500 x a]%-8; huge-7=%repeat[500 x a]%-7; huge-6=%repeat[500 x a]%-6 + diff --git a/tests/data/test444 b/tests/data/test444 index 8df990280a6c..a9759c73b043 100644 --- a/tests/data/test444 +++ b/tests/data/test444 @@ -126,12 +126,12 @@ cookies # # Verify data after the test has been "shot" - -GET /a/b/%TESTNUMBER HTTP/1.1 -Host: attack.invalid:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /a/b/%TESTNUMBER HTTP/1.1 +Host: attack.invalid:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test45 b/tests/data/test45 index e7c3b65926c9..254c3afe9716 100644 --- a/tests/data/test45 +++ b/tests/data/test45 @@ -59,17 +59,17 @@ simple HTTP Location: without protocol in initial URL # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/data.cgi?moo=http://&/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/data.cgi?moo=http://&/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test457 b/tests/data/test457 index aa391d7fd009..79175fcd4c6b 100644 --- a/tests/data/test457 +++ b/tests/data/test457 @@ -53,12 +53,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 143 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # curl: (63) Exceeded the maximum allowed file size (143) diff --git a/tests/data/test46 b/tests/data/test46 index cb4bc518dcc7..30d88b973d90 100644 --- a/tests/data/test46 +++ b/tests/data/test46 @@ -74,13 +74,13 @@ cookies # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: domain..tld:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: empty=; mooo2=indeed2; mooo=indeed - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: domain..tld:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: empty=; mooo2=indeed2; mooo=indeed + # Netscape HTTP Cookie File diff --git a/tests/data/test47 b/tests/data/test47 index 42086999b4de..addde5c39146 100644 --- a/tests/data/test47 +++ b/tests/data/test47 @@ -35,12 +35,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -0 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test471 b/tests/data/test471 index 4a08fed278d7..02e273ca3b23 100644 --- a/tests/data/test471 +++ b/tests/data/test471 @@ -54,17 +54,17 @@ Reject HTTP/1.1 to HTTP/2 switch on the same connection # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # curl: (1) Version mismatch (from HTTP/1 to HTTP/2) diff --git a/tests/data/test473 b/tests/data/test473 index 874813c4e691..8a1a10a6cdfa 100644 --- a/tests/data/test473 +++ b/tests/data/test473 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + W/"asdf" diff --git a/tests/data/test475 b/tests/data/test475 index 32ad8071f540..852dbcb44812 100644 --- a/tests/data/test475 +++ b/tests/data/test475 @@ -33,14 +33,14 @@ FTP PASV upload ASCII file %repeat[1750 x a line of text used for verifying this !%0a]% - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test476 b/tests/data/test476 index 792488fd174c..b53104b11626 100644 --- a/tests/data/test476 +++ b/tests/data/test476 @@ -29,14 +29,14 @@ FTP PASV upload ASCII file already using CRLF %repeat[1750 x a line of text used for verifying this !%0a]% - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test477 b/tests/data/test477 index 12843918efce..ab0eac0c81f0 100644 --- a/tests/data/test477 +++ b/tests/data/test477 @@ -51,17 +51,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 5 -L # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test478 b/tests/data/test478 index 6558363f508c..510eb1969699 100644 --- a/tests/data/test478 +++ b/tests/data/test478 @@ -60,14 +60,14 @@ login debbie - -GET http://github.com/ HTTP/1.1 -Host: github.com -Authorization: Basic %b64[debbie:second%0D]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://github.com/ HTTP/1.1 +Host: github.com +Authorization: Basic %b64[debbie:second%0D]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test479 b/tests/data/test479 index d7ce4652fae2..0dfa730ad463 100644 --- a/tests/data/test479 +++ b/tests/data/test479 @@ -87,21 +87,21 @@ default - -GET http://a.com/ HTTP/1.1 -Host: a.com -Authorization: Basic %b64[alice:alicespassword]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://b.com/%TESTNUMBER0002 HTTP/1.1 -Host: b.com -Authorization: Basic %b64[bob:]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://a.com/ HTTP/1.1 +Host: a.com +Authorization: Basic %b64[alice:alicespassword]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://b.com/%TESTNUMBER0002 HTTP/1.1 +Host: b.com +Authorization: Basic %b64[bob:]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test483 b/tests/data/test483 index 5d86f467d0d1..57fd10977805 100644 --- a/tests/data/test483 +++ b/tests/data/test483 @@ -12,10 +12,10 @@ cookies HTTP/1.1 200 OK -Set-Cookie: name=value; expires=Fri Feb 13 11:56:27 GMT 2132 -Set-Cookie: name2=value; expires=Fri Feb 13 11:56:27 ; 2132 -Set-Cookie: name3=value; expires=Fri Feb 13 11:56:27 ...................................................GMT 2132 -Set-Cookie: name4=value; expires=Fri Feb 13 11:56:27 ....................................................GMT 2132 +Set-Cookie: name=value; expires=Fri Feb 13 11:56:27 GMT 2132 +Set-Cookie: name2=value; expires=Fri Feb 13 11:56:27 ; 2132 +Set-Cookie: name3=value; expires=Fri Feb 13 11:56:27 ...................................................GMT 2132 +Set-Cookie: name4=value; expires=Fri Feb 13 11:56:27 ....................................................GMT 2132 Accept-Ranges: bytes Content-Length: 6 Connection: close diff --git a/tests/data/test486 b/tests/data/test486 index 53efae597a1b..0bcd045eb48a 100644 --- a/tests/data/test486 +++ b/tests/data/test486 @@ -86,20 +86,20 @@ default - -GET http://a.com/ HTTP/1.1 -Host: a.com -Authorization: Basic %b64[alice:alicespassword]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://b.com/%TESTNUMBER0002 HTTP/1.1 -Host: b.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://a.com/ HTTP/1.1 +Host: a.com +Authorization: Basic %b64[alice:alicespassword]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://b.com/%TESTNUMBER0002 HTTP/1.1 +Host: b.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test49 b/tests/data/test49 index 996cf018bde1..ff2f41b3c1bd 100644 --- a/tests/data/test49 +++ b/tests/data/test49 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/are/all/moo.html/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/are/all/moo.html/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test493 b/tests/data/test493 index d157f0355fa9..67083721d6b2 100644 --- a/tests/data/test493 +++ b/tests/data/test493 @@ -50,12 +50,12 @@ test-duphandle # we let it CONNECT to the server to confirm HSTS but deny from there - -CONNECT this.hsts.example:443 HTTP/1.1 -Host: this.hsts.example:443 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT this.hsts.example:443 HTTP/1.1 +Host: this.hsts.example:443 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + HTTP/1.1 403 not OK at all diff --git a/tests/data/test494 b/tests/data/test494 index 648318729d11..ed4717a4d5ef 100644 --- a/tests/data/test494 +++ b/tests/data/test494 @@ -46,15 +46,15 @@ machine %HOSTIP login user1 password passwd1 # # Verify data after the test has been "shot" - -USER user1 -PASS passwd1 -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER user1 +PASS passwd1 +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test495 b/tests/data/test495 index d7313bac3c8a..60b24b97ee25 100644 --- a/tests/data/test495 +++ b/tests/data/test495 @@ -44,13 +44,13 @@ http://foo%40bar:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --netrc-optional # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[foo@bar:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[foo@bar:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test5 b/tests/data/test5 index 8d4078fb77c7..25d887b496d6 100644 --- a/tests/data/test5 +++ b/tests/data/test5 @@ -39,13 +39,13 @@ proxy # # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test50 b/tests/data/test50 index ce4fd1660194..6b8f86a6c76f 100644 --- a/tests/data/test50 +++ b/tests/data/test50 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/are/moo.html/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/are/moo.html/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test500 b/tests/data/test500 index 7904110c7e0a..d09cc4fdbd05 100644 --- a/tests/data/test500 +++ b/tests/data/test500 @@ -48,11 +48,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER IP %HOSTIP - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + Allocations: 82 diff --git a/tests/data/test505 b/tests/data/test505 index 53a9d47927c0..d7ecebce187c 100644 --- a/tests/data/test505 +++ b/tests/data/test505 @@ -52,16 +52,16 @@ upload works? - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -STOR %TESTNUMBER -RNFR %TESTNUMBER -RNTO %TESTNUMBER-forreal -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +STOR %TESTNUMBER +RNFR %TESTNUMBER +RNTO %TESTNUMBER-forreal +QUIT diff --git a/tests/data/test51 b/tests/data/test51 index 277da000fbaf..d66df6744442 100644 --- a/tests/data/test51 +++ b/tests/data/test51 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test510 b/tests/data/test510 index ed16920dd756..7864293100ed 100644 --- a/tests/data/test510 +++ b/tests/data/test510 @@ -42,24 +42,24 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded -Expect: 100-continue - -3 -one -3 -two -5 -three -1d -and a final longer crap: four -0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded +Expect: 100-continue + +3 +one +3 +two +5 +three +1d +and a final longer crap: four +0 + diff --git a/tests/data/test511 b/tests/data/test511 index adcabe8bda6c..a07c9e43f8f9 100644 --- a/tests/data/test511 +++ b/tests/data/test511 @@ -39,14 +39,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 78 - -USER anonymous -PASS ftp@example.com -PWD -MDTM %TESTNUMBER -TYPE I -SIZE %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +QUIT diff --git a/tests/data/test512 b/tests/data/test512 index 8935a12c77ec..79e198af18c1 100644 --- a/tests/data/test512 +++ b/tests/data/test512 @@ -40,11 +40,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test514 b/tests/data/test514 index fcf1a07ca35a..2f3a01eb5d78 100644 --- a/tests/data/test514 +++ b/tests/data/test514 @@ -44,11 +44,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -HEAD /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +HEAD /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test515 b/tests/data/test515 index 9bf6131edd4e..1009900cc95b 100644 --- a/tests/data/test515 +++ b/tests/data/test515 @@ -39,13 +39,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + diff --git a/tests/data/test516 b/tests/data/test516 index e8b522c32dc9..fcadb706bc7b 100644 --- a/tests/data/test516 +++ b/tests/data/test516 @@ -44,12 +44,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 0 + diff --git a/tests/data/test518 b/tests/data/test518 index 2fa7bfb5ca51..0e730664cde4 100644 --- a/tests/data/test518 +++ b/tests/data/test518 @@ -54,11 +54,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + disable diff --git a/tests/data/test519 b/tests/data/test519 index 53f2f19487fa..2e38372b48d6 100644 --- a/tests/data/test519 +++ b/tests/data/test519 @@ -62,17 +62,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[monster:underbed]b64% -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[anothermonster:inwardrobe]b64% -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[monster:underbed]b64% +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[anothermonster:inwardrobe]b64% +Accept: */* + diff --git a/tests/data/test52 b/tests/data/test52 index e636ed959c9b..b86796636272 100644 --- a/tests/data/test52 +++ b/tests/data/test52 @@ -56,17 +56,17 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - -GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /we/are/all/twits/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /we/are/all/twits/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test520 b/tests/data/test520 index 6a27bb3f8e49..6709cef01f7f 100644 --- a/tests/data/test520 +++ b/tests/data/test520 @@ -38,16 +38,16 @@ ftp://%HOSTIP:%FTPPORT/520 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -MDTM 520 -EPSV -TYPE I -SIZE 520 -RETR 520 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM 520 +EPSV +TYPE I +SIZE 520 +RETR 520 +QUIT diff --git a/tests/data/test521 b/tests/data/test521 index 90473b33a0b7..c35c08967e0b 100644 --- a/tests/data/test521 +++ b/tests/data/test521 @@ -44,15 +44,15 @@ ftp://%HOSTIP/%TESTNUMBER/ %FTPPORT # # Verify data after the test has been "shot" - -USER xxx -PASS yyy -PWD -CWD %TESTNUMBER -EPSV -TYPE A -LIST -QUIT + +USER xxx +PASS yyy +PWD +CWD %TESTNUMBER +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test522 b/tests/data/test522 index cc849f47a66d..1c4b17968695 100644 --- a/tests/data/test522 +++ b/tests/data/test522 @@ -43,12 +43,12 @@ http://%HOSTIP/%TESTNUMBER %HTTPPORT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[xxx:yyy]b64% -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[xxx:yyy]b64% +Accept: */* + hello diff --git a/tests/data/test523 b/tests/data/test523 index f414bf81d924..fc4b5272e196 100644 --- a/tests/data/test523 +++ b/tests/data/test523 @@ -49,13 +49,13 @@ proxy # # Verify data after the test has been "shot" - -GET http://www.example.com:19999/%TESTNUMBER HTTP/1.1 -Host: www.example.com:19999 -Authorization: Basic %b64[xxx:yyy]b64% -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://www.example.com:19999/%TESTNUMBER HTTP/1.1 +Host: www.example.com:19999 +Authorization: Basic %b64[xxx:yyy]b64% +Accept: */* +Proxy-Connection: Keep-Alive + hello diff --git a/tests/data/test524 b/tests/data/test524 index 3b383003fb53..ca365c472242 100644 --- a/tests/data/test524 +++ b/tests/data/test524 @@ -32,10 +32,10 @@ ftp://%HOSTIP:%FTPPORT/path/to/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD # 3 is CURLE_URL_MALFORMAT diff --git a/tests/data/test525 b/tests/data/test525 index 2b96a7fd9673..f22f437e6155 100644 --- a/tests/data/test525 +++ b/tests/data/test525 @@ -41,15 +41,15 @@ Moooooooooooo ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD path -PORT 127,0,0,1,5,109 -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +PORT 127,0,0,1,5,109 +TYPE I +STOR %TESTNUMBER +QUIT Moooooooooooo diff --git a/tests/data/test526 b/tests/data/test526 index 85b24d5db924..e8b7c45a541e 100644 --- a/tests/data/test526 +++ b/tests/data/test526 @@ -39,25 +39,25 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test527 b/tests/data/test527 index 3cfe7998cc16..de764a5449e8 100644 --- a/tests/data/test527 +++ b/tests/data/test527 @@ -39,25 +39,25 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test528 b/tests/data/test528 index 7cb9e8b1149f..0889b69980a9 100644 --- a/tests/data/test528 +++ b/tests/data/test528 @@ -43,23 +43,23 @@ http://%HOSTIP:%HTTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -GET /path/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /path/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /path/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /path/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test529 b/tests/data/test529 index 1c21c15efe0d..1626af9ba043 100644 --- a/tests/data/test529 +++ b/tests/data/test529 @@ -41,15 +41,15 @@ Moooooooooooo ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD path -PORT 127,0,0,1,5,109 -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +PORT 127,0,0,1,5,109 +TYPE I +STOR %TESTNUMBER +QUIT Moooooooooooo diff --git a/tests/data/test53 b/tests/data/test53 index 0bbc5d63734e..5a018ab49257 100644 --- a/tests/data/test53 +++ b/tests/data/test53 @@ -43,13 +43,13 @@ cookies # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: mooo=indeed - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: mooo=indeed + diff --git a/tests/data/test530 b/tests/data/test530 index 42e27a0d838e..32ffbcab5a5f 100644 --- a/tests/data/test530 +++ b/tests/data/test530 @@ -43,7 +43,5 @@ http://%HOSTIP:%HTTPPORT/file%TESTNUMBER # Verify data after the test has been "shot" - - diff --git a/tests/data/test531 b/tests/data/test531 index 59501d5ead4e..e018d7d60cd9 100644 --- a/tests/data/test531 +++ b/tests/data/test531 @@ -44,15 +44,15 @@ don't upload this ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} ^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\| - -USER anonymous -PASS ftp@example.com -PWD -CWD path -PORT 127,0,0,1,5,109 -TYPE I -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +PORT 127,0,0,1,5,109 +TYPE I +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test532 b/tests/data/test532 index ac97e89b9cab..b65d6ead6215 100644 --- a/tests/data/test532 +++ b/tests/data/test532 @@ -39,25 +39,25 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test533 b/tests/data/test533 index 1dbceb6dd3b5..86554ba72635 100644 --- a/tests/data/test533 +++ b/tests/data/test533 @@ -37,19 +37,19 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test534 b/tests/data/test534 index 0e0f35abdd15..aa02dfbb3f0e 100644 --- a/tests/data/test534 +++ b/tests/data/test534 @@ -38,16 +38,16 @@ ftp://non-existing-host.haxx.se/path/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/%TE # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test535 b/tests/data/test535 index aa52197767e1..50dfcffd499b 100644 --- a/tests/data/test535 +++ b/tests/data/test535 @@ -55,15 +55,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test537 b/tests/data/test537 index c227a72cb15a..0fa0ef7cd89b 100644 --- a/tests/data/test537 +++ b/tests/data/test537 @@ -54,11 +54,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + Maximum allocated: 3200000 diff --git a/tests/data/test538 b/tests/data/test538 index e411db88f5cf..8f7b04f8e438 100644 --- a/tests/data/test538 +++ b/tests/data/test538 @@ -37,9 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER 41 - -USER anonymous -PASS ftp@example.com + +USER anonymous +PASS ftp@example.com diff --git a/tests/data/test539 b/tests/data/test539 index 7985a52347e0..b98fb4b908cd 100644 --- a/tests/data/test539 +++ b/tests/data/test539 @@ -43,21 +43,21 @@ ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path/to/the/file -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -SYST -CWD / -EPSV -SIZE path/to/the/file/%TESTNUMBER0001 -RETR path/to/the/file/%TESTNUMBER0001 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path/to/the/file +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +SYST +CWD / +EPSV +SIZE path/to/the/file/%TESTNUMBER0001 +RETR path/to/the/file/%TESTNUMBER0001 +QUIT diff --git a/tests/data/test54 b/tests/data/test54 index 8a463118ccd6..478e52a32cb6 100644 --- a/tests/data/test54 +++ b/tests/data/test54 @@ -32,12 +32,12 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test541 b/tests/data/test541 index 787faa3d98c5..f10ce2dadd93 100644 --- a/tests/data/test541 +++ b/tests/data/test541 @@ -43,16 +43,16 @@ works? - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -STOR %TESTNUMBER -EPSV -STOR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +STOR %TESTNUMBER +EPSV +STOR %TESTNUMBER +QUIT diff --git a/tests/data/test542 b/tests/data/test542 index b39b1b30d1a5..0974f0292c97 100644 --- a/tests/data/test542 +++ b/tests/data/test542 @@ -44,14 +44,14 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # There's no MTDM in the protocol here since this code doesn't ask for the # time/date of the file - -USER anonymous -PASS ftp@example.com -PWD -TYPE I -SIZE %TESTNUMBER -REST 0 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +TYPE I +SIZE %TESTNUMBER +REST 0 +QUIT diff --git a/tests/data/test546 b/tests/data/test546 index f8f01641a0aa..5fb7c0c096ee 100644 --- a/tests/data/test546 +++ b/tests/data/test546 @@ -44,19 +44,19 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT data diff --git a/tests/data/test549 b/tests/data/test549 index 95b2def5cf9e..070bfcdfd391 100644 --- a/tests/data/test549 +++ b/tests/data/test549 @@ -49,12 +49,12 @@ ftp://www.example.com/moo/%TESTNUMBER http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - -GET ftp://www.example.com/moo/%TESTNUMBER;type=i HTTP/1.1 -Host: www.example.com:21 -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://www.example.com/moo/%TESTNUMBER;type=i HTTP/1.1 +Host: www.example.com:21 +Accept: */* +Proxy-Connection: Keep-Alive + hello diff --git a/tests/data/test55 b/tests/data/test55 index ea014f4aaea4..dd8a9d4f6bd2 100644 --- a/tests/data/test55 +++ b/tests/data/test55 @@ -48,17 +48,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -L - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test550 b/tests/data/test550 index a4ee2b49b22f..e0d0b1b16f0b 100644 --- a/tests/data/test550 +++ b/tests/data/test550 @@ -49,12 +49,12 @@ ftp://www.example.com/moo/%TESTNUMBER http://%HOSTIP:%HTTPPORT ascii # # Verify data after the test has been "shot" - -GET ftp://www.example.com/moo/%TESTNUMBER;type=a HTTP/1.1 -Host: www.example.com:21 -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://www.example.com/moo/%TESTNUMBER;type=a HTTP/1.1 +Host: www.example.com:21 +Accept: */* +Proxy-Connection: Keep-Alive + hello diff --git a/tests/data/test556 b/tests/data/test556 index e531f012ea4b..d8abd149884a 100644 --- a/tests/data/test556 +++ b/tests/data/test556 @@ -38,10 +38,10 @@ http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: ninja - + +GET /%TESTNUMBER HTTP/1.1 +Host: ninja + diff --git a/tests/data/test56 b/tests/data/test56 index 32590f27c705..5ced385bb0cf 100644 --- a/tests/data/test56 +++ b/tests/data/test56 @@ -44,18 +44,18 @@ header "Transfer-Encoding: chunked" # Verify data after the test has been "shot" - -POST /that.site.com/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: %repeat[99999 x a]% -Accept: */* -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded - -c -we post this -0 - + +POST /that.site.com/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: %repeat[99999 x a]% +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded + +c +we post this +0 + diff --git a/tests/data/test560 b/tests/data/test560 index 30641a166858..cdcf674f8f45 100644 --- a/tests/data/test560 +++ b/tests/data/test560 @@ -43,11 +43,11 @@ https://%HOSTIP:%HTTPSPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +Accept: */* + diff --git a/tests/data/test561 b/tests/data/test561 index 09e381745c42..5bd07e49d1f6 100644 --- a/tests/data/test561 +++ b/tests/data/test561 @@ -50,12 +50,12 @@ FTP RETR with CURLOPT_PROXY_TRANSFER_MODE, ASCII transfer and type=i # # Verify data after the test has been "shot" - -GET ftp://www.example.com/moo/%TESTNUMBER;type=i HTTP/1.1 -Host: www.example.com:21 -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://www.example.com/moo/%TESTNUMBER;type=i HTTP/1.1 +Host: www.example.com:21 +Accept: */* +Proxy-Connection: Keep-Alive + hello diff --git a/tests/data/test562 b/tests/data/test562 index d1793891d077..d7871f18ec28 100644 --- a/tests/data/test562 +++ b/tests/data/test562 @@ -39,14 +39,14 @@ FTP a type=A URL and CURLOPT_PORT set # There's no MTDM in the protocol here since this code doesn't ask for the # time/date of the file - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test563 b/tests/data/test563 index b7c61db768b9..c109e9f80f79 100644 --- a/tests/data/test563 +++ b/tests/data/test563 @@ -48,12 +48,12 @@ ftp_proxy=http://%HOSTIP:%HTTPPORT/ # Verify data after the test has been "shot" - -GET ftp://%HOSTIP:%FTPPORT/%TESTNUMBER;type=A HTTP/1.1 -Host: %HOSTIP:%FTPPORT -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://%HOSTIP:%FTPPORT/%TESTNUMBER;type=A HTTP/1.1 +Host: %HOSTIP:%FTPPORT +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test564 b/tests/data/test564 index 96a6f9b1a6b7..6dad35318b31 100644 --- a/tests/data/test564 +++ b/tests/data/test564 @@ -45,16 +45,16 @@ proxy # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT data diff --git a/tests/data/test565 b/tests/data/test565 index b8e418ec7b9e..736946c86ae8 100644 --- a/tests/data/test565 +++ b/tests/data/test565 @@ -78,33 +78,33 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded - -0 - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="foo", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="877424f750af047634dbd94f9933217b" -Accept: */* -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded -Expect: 100-continue - -3 -one -3 -two -5 -three -1d -and a final longer crap: four -0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded + +0 + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="foo", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="877424f750af047634dbd94f9933217b" +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded +Expect: 100-continue + +3 +one +3 +two +5 +three +1d +and a final longer crap: four +0 + diff --git a/tests/data/test566 b/tests/data/test566 index 1ff92f4e21b8..ccfedd826cc3 100644 --- a/tests/data/test566 +++ b/tests/data/test566 @@ -47,11 +47,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER CL 0 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test567 b/tests/data/test567 index f6cdec42a1f6..940ac7d00134 100644 --- a/tests/data/test567 +++ b/tests/data/test567 @@ -37,12 +37,12 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER - -OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 -CSeq: 1 -User-Agent: test%TESTNUMBER -Test-Number: %TESTNUMBER - + +OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 +CSeq: 1 +User-Agent: test%TESTNUMBER +Test-Number: %TESTNUMBER + diff --git a/tests/data/test569 b/tests/data/test569 index b70e9083cade..103672bd0125 100644 --- a/tests/data/test569 +++ b/tests/data/test569 @@ -74,31 +74,31 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER %LOGDIR/idfile%TESTNUMBER.txt ^If-Modified-Since:.* - -SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 -CSeq: 1 -Transport: Fake/NotReal/JustATest;foo=baz - -TEARDOWN rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 -CSeq: 2 -Session: 00.+1-am-aSe55ion_id\$yes-i-am\$ - -SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 -CSeq: 3 -Transport: Fake/NotReal/JustATest;foo=baz - -TEARDOWN rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 -CSeq: 4 -Session: \$extraspaces - -SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0005 RTSP/1.0 -CSeq: 5 -Transport: Fake/NotReal/JustATest;foo=baz - -TEARDOWN rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0006 RTSP/1.0 -CSeq: 6 -Session: A - + +SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 +CSeq: 1 +Transport: Fake/NotReal/JustATest;foo=baz + +TEARDOWN rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 +CSeq: 2 +Session: 00.+1-am-aSe55ion_id\$yes-i-am\$ + +SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 +CSeq: 3 +Transport: Fake/NotReal/JustATest;foo=baz + +TEARDOWN rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 +CSeq: 4 +Session: \$extraspaces + +SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0005 RTSP/1.0 +CSeq: 5 +Transport: Fake/NotReal/JustATest;foo=baz + +TEARDOWN rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0006 RTSP/1.0 +CSeq: 6 +Session: A + Got Session ID: [00.+1-am-aSe55ion_id\$yes-i-am\$] diff --git a/tests/data/test57 b/tests/data/test57 index f177f08eb46c..d3360096b93d 100644 --- a/tests/data/test57 +++ b/tests/data/test57 @@ -35,12 +35,12 @@ HTTP content-type with spaces in text/html; charset=ISO-8859-4 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test570 b/tests/data/test570 index c1a03485590b..318beee09621 100644 --- a/tests/data/test570 +++ b/tests/data/test570 @@ -58,18 +58,18 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER ^If-Modified-Since:.* - -OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 -CSeq: 1 - -SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 -CSeq: 999 -Transport: RAW/RAW/UDP;unicast;client_port=3056-3057 - -PLAY rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 -CSeq: 1000 -Session: asdf - + +OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 +CSeq: 1 + +SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 +CSeq: 999 +Transport: RAW/RAW/UDP;unicast;client_port=3056-3057 + +PLAY rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 +CSeq: 1000 +Session: asdf + diff --git a/tests/data/test573 b/tests/data/test573 index 67e806dcdf66..82669b36f78e 100644 --- a/tests/data/test573 +++ b/tests/data/test573 @@ -45,11 +45,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test574 b/tests/data/test574 index 1b185e98a926..861b3072e312 100644 --- a/tests/data/test574 +++ b/tests/data/test574 @@ -37,45 +37,45 @@ ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*.txt 0 # THERE SHOULD NOT BE "SIZE"! and one "USER/PASS" - -USER anonymous -PASS ftp@example.com -PWD -CWD fully_simulated -CWD UNIX -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD fully_simulated +CWD UNIX +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +QUIT This file should have permissions 444 diff --git a/tests/data/test575 b/tests/data/test575 index b1725a9b2a73..c093c96c4f86 100644 --- a/tests/data/test575 +++ b/tests/data/test575 @@ -35,67 +35,67 @@ ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/* 0 - -USER anonymous -PASS ftp@example.com -PWD -CWD fully_simulated -CWD UNIX -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -QUIT -USER anonymous -PASS ftp@example.com -PWD -CWD fully_simulated -CWD UNIX -EPSV -TYPE A -LIST -EPSV -TYPE I -RETR chmod1 -EPSV -RETR chmod2 -EPSV -RETR chmod3 -EPSV -RETR empty_file.dat -EPSV -RETR file.txt -EPSV -RETR someothertext.txt -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD fully_simulated +CWD UNIX +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +QUIT +USER anonymous +PASS ftp@example.com +PWD +CWD fully_simulated +CWD UNIX +EPSV +TYPE A +LIST +EPSV +TYPE I +RETR chmod1 +EPSV +RETR chmod2 +EPSV +RETR chmod3 +EPSV +RETR empty_file.dat +EPSV +RETR file.txt +EPSV +RETR someothertext.txt +QUIT This file should have permissions 444 diff --git a/tests/data/test580 b/tests/data/test580 index c7f4bcfcd778..ad6b73b33d6f 100644 --- a/tests/data/test580 +++ b/tests/data/test580 @@ -53,11 +53,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + 8 diff --git a/tests/data/test581 b/tests/data/test581 index e784e72ea548..81844771fbdb 100644 --- a/tests/data/test581 +++ b/tests/data/test581 @@ -45,11 +45,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test584 b/tests/data/test584 index 81c9b8403771..56c72c72469f 100644 --- a/tests/data/test584 +++ b/tests/data/test584 @@ -62,23 +62,23 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/--------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=------------------------/ - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 156 -Content-Type: multipart/form-data; boundary=------------------------ - --------------------------- -Content-Disposition: form-data; name="fake" - -party ----------------------------- -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 156 +Content-Type: multipart/form-data; boundary=------------------------ + +-------------------------- +Content-Disposition: form-data; name="fake" + +party +---------------------------- +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 0 + diff --git a/tests/data/test585 b/tests/data/test585 index e5138cdb1755..a9d4f61d161c 100644 --- a/tests/data/test585 +++ b/tests/data/test585 @@ -56,11 +56,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test586 b/tests/data/test586 index d441ff5ecfce..85971a080036 100644 --- a/tests/data/test586 +++ b/tests/data/test586 @@ -45,15 +45,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test589 b/tests/data/test589 index c798c0eed926..0846661aa768 100644 --- a/tests/data/test589 +++ b/tests/data/test589 @@ -44,12 +44,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 0 + diff --git a/tests/data/test59 b/tests/data/test59 index b86b02d3d035..6ccb1ce37f32 100644 --- a/tests/data/test59 +++ b/tests/data/test59 @@ -34,12 +34,12 @@ HTTP URL with slash but with "parameter" # # Verify data after the test has been "shot" - -GET /?mooo/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /?mooo/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test590 b/tests/data/test590 index 00ef1b1901c1..09c2c065a277 100644 --- a/tests/data/test590 +++ b/tests/data/test590 @@ -90,24 +90,24 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAAAgACAHAAAAALAAsAcgAAAAAAAAAAAAAAhoIBAAQt1KW5CgG4YdWWcfXyfXBz1ZMCzYp37xYjBiAizmw58O6eQS7yR66eqYGWeSwl9W1lV09SS1NUQVRJT04= -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAAAgACAHAAAAALAAsAcgAAAAAAAAAAAAAAhoIBAAQt1KW5CgG4YdWWcfXyfXBz1ZMCzYp37xYjBiAizmw58O6eQS7yR66eqYGWeSwl9W1lV09SS1NUQVRJT04= +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test595 b/tests/data/test595 index 65f23f7ead51..969879ad359c 100644 --- a/tests/data/test595 +++ b/tests/data/test595 @@ -43,15 +43,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test597 b/tests/data/test597 index 5402d29b1ff9..6888e409738d 100644 --- a/tests/data/test597 +++ b/tests/data/test597 @@ -27,10 +27,10 @@ ftp://%HOSTIP:%FTPPORT # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD diff --git a/tests/data/test598 b/tests/data/test598 index 7a6601b9afc6..74ed46bac4de 100644 --- a/tests/data/test598 +++ b/tests/data/test598 @@ -66,18 +66,18 @@ cookies # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: the-moo agent next generation -Accept: */* -Referer: http://example.com/the-moo -Cookie: name=moo - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: the-moo agent next generation +Accept: */* +Referer: http://example.com/the-moo +Cookie: name=moo + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test6 b/tests/data/test6 index 9c5db36d990d..225c92833c1e 100644 --- a/tests/data/test6 +++ b/tests/data/test6 @@ -38,13 +38,13 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: name=contents;name2=content2;name3=content3 - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: name=contents;name2=content2;name3=content3 + diff --git a/tests/data/test61 b/tests/data/test61 index 2cb5963ff465..22d22c88a8b8 100644 --- a/tests/data/test61 +++ b/tests/data/test61 @@ -59,12 +59,12 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: www.host.foo.com -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: www.host.foo.com +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test62 b/tests/data/test62 index 97cef4afacce..ec47b60f072a 100644 --- a/tests/data/test62 +++ b/tests/data/test62 @@ -49,19 +49,19 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: www.host.foo.com -User-Agent: curl/%VERSION -Accept: */* -Cookie: test2=yes; test=yes - -GET /we/want/%TESTNUMBER?hoge=fuga HTTP/1.1 -Host: www.host.foo.com -User-Agent: curl/%VERSION -Accept: */* -Cookie: test2=yes; test=yes - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: www.host.foo.com +User-Agent: curl/%VERSION +Accept: */* +Cookie: test2=yes; test=yes + +GET /we/want/%TESTNUMBER?hoge=fuga HTTP/1.1 +Host: www.host.foo.com +User-Agent: curl/%VERSION +Accept: */* +Cookie: test2=yes; test=yes + diff --git a/tests/data/test627 b/tests/data/test627 index aab25791f24a..a8d3ed33722a 100644 --- a/tests/data/test627 +++ b/tests/data/test627 @@ -34,8 +34,6 @@ Dummy test file for remove test # # Verify data after the test has been "shot" - - %PERL %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/test%TESTNUMBER.txt diff --git a/tests/data/test63 b/tests/data/test63 index 81d6ffc7e672..6056edaedcf3 100644 --- a/tests/data/test63 +++ b/tests/data/test63 @@ -41,14 +41,14 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 -Host: we.want.that.site.com -Proxy-Authorization: Basic %b64[fake:user]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 +Host: we.want.that.site.com +Proxy-Authorization: Basic %b64[fake:user]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test64 b/tests/data/test64 index d56b2514c9e8..34f49b69ffcf 100644 --- a/tests/data/test64 +++ b/tests/data/test64 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="c55f7f30d83d774a3d2dcacf725abaca" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="c55f7f30d83d774a3d2dcacf725abaca" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test644 b/tests/data/test644 index b055763a398b..017b98d6e909 100644 --- a/tests/data/test644 +++ b/tests/data/test644 @@ -65,17 +65,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --xattr -L -o %LOGDIR/out%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + user.creator => curl diff --git a/tests/data/test646 b/tests/data/test646 index fe86e32775b5..67ef66498d2f 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -54,12 +54,12 @@ X-fileheader2: This is #a s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT Content-Type: multipart/mixed; boundary=---------------------------- diff --git a/tests/data/test647 b/tests/data/test647 index 8cac4577e1ee..0e3d242cd746 100644 --- a/tests/data/test647 +++ b/tests/data/test647 @@ -42,11 +42,11 @@ It may contain any type of data. s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -A001 CAPABILITY -A002 LOGIN user secret -A003 APPEND %TESTNUMBER (\Seen) {940} -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 APPEND %TESTNUMBER (\Seen) {940} +A004 LOGOUT Content-Type: multipart/mixed; boundary=---------------------------- diff --git a/tests/data/test648 b/tests/data/test648 index 992a3dbc5ed9..f472f9f876d3 100644 --- a/tests/data/test648 +++ b/tests/data/test648 @@ -46,33 +46,33 @@ It may contain any type of data and will be encoded in base64 for transfer. s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -Content-Type: multipart/mixed; boundary=---------------------------- -Mime-Version: 1.0 -From: different -To: another - ------------------------------- -Content-Transfer-Encoding: quoted-printable -Content-disposition: "inline" - -This is the email inline text with a very long line containing the special = -character =3D and that should be split by encoder. ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Transfer-Encoding: base64 - -VGhpcyBpcyBhbiBhdHRhY2hlZCBmaWxlLgoKSXQgbWF5IGNvbnRhaW4gYW55IHR5cGUgb2YgZGF0 -YSBhbmQgd2lsbCBiZSBlbmNvZGVkIGluIGJhc2U2NCBmb3IgdHJhbnNmZXIuCg== --------------------------------- -. + +Content-Type: multipart/mixed; boundary=---------------------------- +Mime-Version: 1.0 +From: different +To: another + +------------------------------ +Content-Transfer-Encoding: quoted-printable +Content-disposition: "inline" + +This is the email inline text with a very long line containing the special = +character =3D and that should be split by encoder. +------------------------------ +Content-Disposition: attachment; filename="test%TESTNUMBER.txt" +Content-Transfer-Encoding: base64 + +VGhpcyBpcyBhbiBhdHRhY2hlZCBmaWxlLgoKSXQgbWF5IGNvbnRhaW4gYW55IHR5cGUgb2YgZGF0 +YSBhbmQgd2lsbCBiZSBlbmNvZGVkIGluIGJhc2U2NCBmb3IgdHJhbnNmZXIuCg== +-------------------------------- +. diff --git a/tests/data/test649 b/tests/data/test649 index 371f00bfdc5c..ea3c9c344728 100644 --- a/tests/data/test649 +++ b/tests/data/test649 @@ -42,11 +42,11 @@ It contains at least an 8-bit byte value. # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA 26 diff --git a/tests/data/test65 b/tests/data/test65 index 8f82c92b4bde..300b9ad5cbaf 100644 --- a/tests/data/test65 +++ b/tests/data/test65 @@ -66,18 +66,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="66d68d3251f1839576ba7c766cf9205b" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/%TESTNUMBER", response="66d68d3251f1839576ba7c766cf9205b" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test650 b/tests/data/test650 index acd2c5f194a1..4c0107ae643a 100644 --- a/tests/data/test650 +++ b/tests/data/test650 @@ -10,14 +10,14 @@ FORM # # Server-side - -HTTP/1.1 301 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html + +HTTP/1.1 301 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html Location: /%TESTNUMBER0002 - + hello diff --git a/tests/data/test651 b/tests/data/test651 index cf19bfc34a27..a3691f88e9e4 100644 --- a/tests/data/test651 +++ b/tests/data/test651 @@ -58,18 +58,18 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # Note that the stripping above removes 12 bytes from every occurrence of the # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 17151 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="hello" - -%repeat[1000 x A]%%repeat[1000 x B]%%repeat[1000 x C]%%repeat[1000 x D]%%repeat[1000 x E]%%repeat[1000 x F]%%repeat[1000 x G]%%repeat[1000 x H]%%repeat[1000 x I]%%repeat[1000 x J]%%repeat[1000 x K]%%repeat[1000 x L]%%repeat[1000 x M]%%repeat[1000 x N]%%repeat[1000 x O]%%repeat[1000 x P]%%repeat[999 x Q]% --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 17151 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="hello" + +%repeat[1000 x A]%%repeat[1000 x B]%%repeat[1000 x C]%%repeat[1000 x D]%%repeat[1000 x E]%%repeat[1000 x F]%%repeat[1000 x G]%%repeat[1000 x H]%%repeat[1000 x I]%%repeat[1000 x J]%%repeat[1000 x K]%%repeat[1000 x L]%%repeat[1000 x M]%%repeat[1000 x N]%%repeat[1000 x O]%%repeat[1000 x P]%%repeat[999 x Q]% +-------------------------------- diff --git a/tests/data/test652 b/tests/data/test652 index 31ec7b821daa..25e5a6d9e3bb 100644 --- a/tests/data/test652 +++ b/tests/data/test652 @@ -39,323 +39,323 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -Content-Type: multipart/mixed; boundary=---------------------------- -Mime-Version: 1.0 - ------------------------------- -Content-Disposition: attachment; filename="myfile.jpg" -Content-Type: image/jpeg -Content-Transfer-Encoding: base64 - -QUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZG -RkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExM -TExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFS -UlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dX -V1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0ND -Q0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJ -SUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5O -Tk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRU -VFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpa -WlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVF -RkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tL -S0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFR -UVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZX -V1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJC -QkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhI -SEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5O -Tk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NT -U1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZ -WVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVF -RUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpK -S0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQ -UFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZW -VlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFC -QkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dH -R0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1N -TU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNT -U1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhY -WFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERERERE -REREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpK -SkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09P -UFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVV -VVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFB -QUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZH -R0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExM -TExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJS -UlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hY -WFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0ND -Q0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJ -SUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09P -T09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRU -VVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpa -WlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZG -RkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tM -TExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFR -UVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dX -V1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkND -Q0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhI -SElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5O -Tk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRU -VFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZ -WlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVF -RUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tL -S0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBR -UVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZW -VlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJC -QkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hI -SEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1N -TU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NT -U1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZ -WVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERE -RUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpK -SkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQ -UFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVW -VlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFB -QUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dH -R0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1N -TU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJS -UlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhY -WFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERE -REREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJ -SkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09P -T09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVV -VVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpB -QUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZG -RkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExM -TExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJS -UlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dX -V1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0ND -Q0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJ -SUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5O -T09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRU -VFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpa -WlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVG -RkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tL -S0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFR -UVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldX -V1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJC -QkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhI -SEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5O -Tk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NT -VFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZ -WVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVF -RUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpL -S0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQ -UFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZW -VlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJC -QkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dH -R0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1N -TU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NT -U1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhY -WVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERE -RERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpK -SkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09Q -UFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVV -VVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFB -QUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdH -R0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExM -TE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJS -UlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhY -WFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0ND -REREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJ -SUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09P -T09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRV -VVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpa -WlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZG -RkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xM -TExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFR -UVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dX -V1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0ND -Q0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhI -SUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5O -Tk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRU -VFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVla -WlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVF -RUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tL -S0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFR -UVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZW -VldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJC -QkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhI -SEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1N -Tk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NT -U1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZ -WVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERF -RUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpK -SkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQ -UFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZW -VlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFB -QUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dH -R0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1N -TU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJS -U1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhY -WFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERE -RERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlK -SkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09P -T09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVV -VVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFB -QUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZG -RkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExM -TExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJS -UlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dX -WFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0ND -Q0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJ -SUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5P -T09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRU -VFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpa -WlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZG -RkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tL -S0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFR -UVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dX -V1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJC -Q0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhI -SEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5O -Tk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NU -VFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZ -WVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVF -RUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktL -S0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQ -UFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZW -VlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJC -QkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dH -SEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1N -TU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NT -U1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZ -WVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERE -RERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpK -SkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQ -UFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVV -VVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFB -QUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dH -R0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExM -TU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJS -UlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhY -WFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NE -RERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJ -SUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09P -T09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVV -VVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpa -WkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZG -RkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExM -TExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFR -UlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dX -V1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0ND -Q0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJ -SUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5O -Tk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRU -VFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpa -WlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVF -RUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tL -S0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFR -UVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZW -V1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJC -QkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhI -SEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1O -Tk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NT -U1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZ -WVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVF -RUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpK -SktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQ -UFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZW -VlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFB -QkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dH -R0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1N -TU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJT -U1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhY -WFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERE -RERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpK -SkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09P -T1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVV -VVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFB -QUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZG -R0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExM -TExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJS -UlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dY -WFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0ND -Q0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJ -SUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9P -T09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRU -VFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpa -WlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZG -RkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tL -TExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFR -UVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dX -V1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJD -Q0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhI -SEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5O -Tk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RU -VFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZ -WVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVF -RUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tL -S0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQ -UVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZW -VlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJC -QkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dI -SEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1N -TU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NT -U1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZ -WVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERERERERERE -REVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpK -SkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQ -UFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVV -VlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFB -QUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dH -R0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExN -TU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJS -UlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhY -WFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RE -RERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJ -SUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09P -T09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVV -VVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpa -QUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZG -RkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExM -TExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFS -UlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dX -V1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0ND -Q0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJ -SUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5O -Tk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRU -VFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpa -WlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVF -RkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tL -S0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFR -UVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZX -V1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJC -QkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhI -SEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5O -Tk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NT -U1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZ -WVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVF -RUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpK -S0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQ -UFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZW -VlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFC -QkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dH -R0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1N -TU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNT -U1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhY -WFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERERERE -REREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpK -SkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09P -UFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVV -VVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFB -QUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZH -R0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExM -TExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJS -UlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hY -WFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0ND -Q0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJ -SUlJSUpKSkpKSkpKSko= --------------------------------- -. + +Content-Type: multipart/mixed; boundary=---------------------------- +Mime-Version: 1.0 + +------------------------------ +Content-Disposition: attachment; filename="myfile.jpg" +Content-Type: image/jpeg +Content-Transfer-Encoding: base64 + +QUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZG +RkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExM +TExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFS +UlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dX +V1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0ND +Q0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJ +SUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5O +Tk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRU +VFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpa +WlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVF +RkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tL +S0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFR +UVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZX +V1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJC +QkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhI +SEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5O +Tk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NT +U1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZ +WVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVF +RUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpK +S0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQ +UFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZW +VlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFC +QkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dH +R0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1N +TU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNT +U1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhY +WFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERERERE +REREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpK +SkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09P +UFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVV +VVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFB +QUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZH +R0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExM +TExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJS +UlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hY +WFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0ND +Q0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJ +SUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09P +T09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRU +VVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpa +WlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZG +RkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tM +TExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFR +UVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dX +V1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkND +Q0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhI +SElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5O +Tk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRU +VFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZ +WlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVF +RUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tL +S0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBR +UVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZW +VlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJC +QkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hI +SEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1N +TU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NT +U1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZ +WVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERE +RUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpK +SkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQ +UFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVW +VlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFB +QUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dH +R0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1N +TU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJS +UlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhY +WFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERE +REREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJ +SkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09P +T09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVV +VVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpB +QUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZG +RkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExM +TExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJS +UlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dX +V1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0ND +Q0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJ +SUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5O +T09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRU +VFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpa +WlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVG +RkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tL +S0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFR +UVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldX +V1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJC +QkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhI +SEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5O +Tk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NT +VFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZ +WVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVF +RUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpL +S0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQ +UFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZW +VlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJC +QkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dH +R0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1N +TU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NT +U1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhY +WVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERE +RERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpK +SkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09Q +UFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVV +VVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFB +QUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdH +R0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExM +TE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJS +UlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhY +WFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0ND +REREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJ +SUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09P +T09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRV +VVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpa +WlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZG +RkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xM +TExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFR +UVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dX +V1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0ND +Q0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhI +SUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5O +Tk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRU +VFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVla +WlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVF +RUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tL +S0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFR +UVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZW +VldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJC +QkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhI +SEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1N +Tk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NT +U1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZ +WVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERF +RUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpK +SkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQ +UFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZW +VlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFB +QUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dH +R0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1N +TU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJS +U1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhY +WFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERE +RERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlK +SkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09P +T09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVV +VVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFB +QUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZG +RkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExM +TExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJS +UlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dX +WFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0ND +Q0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJ +SUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5P +T09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRU +VFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpa +WlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZG +RkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tL +S0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFR +UVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dX +V1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJC +Q0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhI +SEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5O +Tk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NU +VFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZ +WVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVF +RUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktL +S0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQ +UFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZW +VlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJC +QkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dH +SEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1N +TU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NT +U1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZ +WVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERE +RERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpK +SkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQ +UFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVV +VVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFB +QUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dH +R0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExM +TU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJS +UlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhY +WFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NE +RERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJ +SUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09P +T09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVV +VVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpa +WkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZG +RkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExM +TExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFR +UlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dX +V1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0ND +Q0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJ +SUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5O +Tk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRU +VFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpa +WlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVF +RUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tL +S0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFR +UVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZW +V1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJC +QkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhI +SEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1O +Tk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NT +U1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZ +WVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVF +RUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpK +SktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQ +UFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZW +VlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFB +QkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dH +R0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1N +TU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJT +U1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhY +WFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERE +RERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpK +SkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09P +T1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVV +VVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFB +QUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZG +R0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExM +TExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJS +UlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dY +WFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0ND +Q0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJ +SUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9P +T09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRU +VFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpa +WlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZG +RkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tL +TExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFR +UVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dX +V1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJD +Q0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhI +SEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5O +Tk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RU +VFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZ +WVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVF +RUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tL +S0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQ +UVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZW +VlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJC +QkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dI +SEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1N +TU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NT +U1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZ +WVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERERERERERE +REVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpK +SkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQ +UFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVV +VlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFB +QUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dH +R0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExN +TU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJS +UlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhY +WFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RE +RERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJ +SUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09P +T09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVV +VVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpa +QUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZG +RkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExM +TExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFS +UlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dX +V1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0ND +Q0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJ +SUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5O +Tk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRU +VFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpa +WlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVF +RkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tL +S0tLTExMTExMTExMTE1NTU1NTU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFR +UVFRUVFRUlJSUlJSUlJSUlNTU1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZX +V1dXV1dXV1dXWFhYWFhYWFhYWFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJC +QkJDQ0NDQ0NDQ0NDREREREREREREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhI +SEhISEhJSUlJSUlJSUlJSkpKSkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5O +Tk5OTk5OTk5PT09PT09PT09PUFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NT +U1RUVFRUVFRUVFRVVVVVVVVVVVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZ +WVlZWVpaWlpaWlpaWlpBQUFBQUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVF +RUVFRUVFRUZGRkZGRkZGRkZHR0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpK +S0tLS0tLS0tLS0xMTExMTExMTExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQ +UFBQUVFRUVFRUVFRUVJSUlJSUlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZW +VlZWVlZWV1dXV1dXV1dXV1hYWFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFC +QkJCQkJCQkJCQ0NDQ0NDQ0NDQ0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dH +R0dISEhISEhISEhISUlJSUlJSUlJSUpKSkpKSkpKSkpLS0tLS0tLS0tLTExMTExMTExMTE1NTU1N +TU1NTU1OTk5OTk5OTk5OT09PT09PT09PT1BQUFBQUFBQUFBRUVFRUVFRUVFRUlJSUlJSUlJSUlNT +U1NTU1NTU1NUVFRUVFRUVFRUVVVVVVVVVVVVVVZWVlZWVlZWVlZXV1dXV1dXV1dXWFhYWFhYWFhY +WFlZWVlZWVlZWVlaWlpaWlpaWlpaQUFBQUFBQUFBQUJCQkJCQkJCQkJDQ0NDQ0NDQ0NDRERERERE +REREREVFRUVFRUVFRUVGRkZGRkZGRkZGR0dHR0dHR0dHR0hISEhISEhISEhJSUlJSUlJSUlJSkpK +SkpKSkpKSktLS0tLS0tLS0tMTExMTExMTExMTU1NTU1NTU1NTU5OTk5OTk5OTk5PT09PT09PT09P +UFBQUFBQUFBQUFFRUVFRUVFRUVFSUlJSUlJSUlJSU1NTU1NTU1NTU1RUVFRUVFRUVFRVVVVVVVVV +VVVVVlZWVlZWVlZWVldXV1dXV1dXV1dYWFhYWFhYWFhYWVlZWVlZWVlZWVpaWlpaWlpaWlpBQUFB +QUFBQUFBQkJCQkJCQkJCQkNDQ0NDQ0NDQ0NERERERERERERERUVFRUVFRUVFRUZGRkZGRkZGRkZH +R0dHR0dHR0dHSEhISEhISEhISElJSUlJSUlJSUlKSkpKSkpKSkpKS0tLS0tLS0tLS0xMTExMTExM +TExNTU1NTU1NTU1NTk5OTk5OTk5OTk9PT09PT09PT09QUFBQUFBQUFBQUVFRUVFRUVFRUVJSUlJS +UlJSUlJTU1NTU1NTU1NTVFRUVFRUVFRUVFVVVVVVVVVVVVVWVlZWVlZWVlZWV1dXV1dXV1dXV1hY +WFhYWFhYWFhZWVlZWVlZWVlZWlpaWlpaWlpaWkFBQUFBQUFBQUFCQkJCQkJCQkJCQ0NDQ0NDQ0ND +Q0RERERERERERERFRUVFRUVFRUVFRkZGRkZGRkZGRkdHR0dHR0dHR0dISEhISEhISEhISUlJSUlJ +SUlJSUpKSkpKSkpKSko= +-------------------------------- +. diff --git a/tests/data/test653 b/tests/data/test653 index 33885f17faaa..350f84bc3a09 100644 --- a/tests/data/test653 +++ b/tests/data/test653 @@ -68,29 +68,29 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # Note that the stripping above removes 12 bytes from every occurrence of the # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 162 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="name" - -short value --------------------------------- -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 179 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="name" - -long value for length change --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 162 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="name" + +short value +-------------------------------- +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 179 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="name" + +long value for length change +-------------------------------- diff --git a/tests/data/test658 b/tests/data/test658 index 32ca29db4978..e7889236f739 100644 --- a/tests/data/test658 +++ b/tests/data/test658 @@ -38,11 +38,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test659 b/tests/data/test659 index 5cad5eadcd5c..10adb147623f 100644 --- a/tests/data/test659 +++ b/tests/data/test659 @@ -42,12 +42,12 @@ proxy - -GET http://www.example.com/ HTTP/1.1 -Host: www.example.com -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://www.example.com/ HTTP/1.1 +Host: www.example.com +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test66 b/tests/data/test66 index d4e20c0fe460..0a255fe84433 100644 --- a/tests/data/test66 +++ b/tests/data/test66 @@ -29,12 +29,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http0.9 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test660 b/tests/data/test660 index 8fdf879d9ad2..db3db9bed88e 100644 --- a/tests/data/test660 +++ b/tests/data/test660 @@ -27,8 +27,8 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -A001 CAPABILITY + +A001 CAPABILITY diff --git a/tests/data/test661 b/tests/data/test661 index 5965bd8aeacb..2714e6fda362 100644 --- a/tests/data/test661 +++ b/tests/data/test661 @@ -33,41 +33,41 @@ ftp://%HOSTIP:%FTPPORT/ # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -CWD /folderA -EPSV -TYPE I -RETR %TESTNUMBER -CWD /folderB -EPSV -RETR %TESTNUMBER -QUIT -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -RETR /folderA/%TESTNUMBER -CWD /folderB -EPSV -RETR %TESTNUMBER -EPSV -RETR /folderA/%TESTNUMBER -QUIT -USER anonymous -PASS ftp@example.com -PWD -SYST -QUIT -USER anonymous -PASS ftp@example.com -PWD -SYST -SYST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD /folderA +EPSV +TYPE I +RETR %TESTNUMBER +CWD /folderB +EPSV +RETR %TESTNUMBER +QUIT +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +RETR /folderA/%TESTNUMBER +CWD /folderB +EPSV +RETR %TESTNUMBER +EPSV +RETR /folderA/%TESTNUMBER +QUIT +USER anonymous +PASS ftp@example.com +PWD +SYST +QUIT +USER anonymous +PASS ftp@example.com +PWD +SYST +SYST +QUIT diff --git a/tests/data/test662 b/tests/data/test662 index a1d501fd2d2c..29bbb589141d 100644 --- a/tests/data/test662 +++ b/tests/data/test662 @@ -60,19 +60,19 @@ proxy # # Verify data after the test has been "shot" - -GET http://example.com/please/gimme/%TESTNUMBER HTTP/1.1 -Host: example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://example.net/tes%20t%20case=/%TESTNUMBER0002 HTTP/1.1 -Host: example.net -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://example.com/please/gimme/%TESTNUMBER HTTP/1.1 +Host: example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://example.net/tes%20t%20case=/%TESTNUMBER0002 HTTP/1.1 +Host: example.net +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test663 b/tests/data/test663 index 313910aa6bc2..a6e9ef56e3fa 100644 --- a/tests/data/test663 +++ b/tests/data/test663 @@ -64,19 +64,19 @@ proxy # # Verify data after the test has been "shot" - -GET http://example.com/gimme/%TESTNUMBER?foobar HTTP/1.1 -Host: example.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://example.net/there/tes%20t%20case=/%TESTNUMBER0002?+yes+no HTTP/1.1 -Host: example.net -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://example.com/gimme/%TESTNUMBER?foobar HTTP/1.1 +Host: example.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://example.net/there/tes%20t%20case=/%TESTNUMBER0002?+yes+no HTTP/1.1 +Host: example.net +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test667 b/tests/data/test667 index e7298094d010..9164adbaed3b 100644 --- a/tests/data/test667 +++ b/tests/data/test667 @@ -61,28 +61,28 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # Note that the stripping above removes 12 bytes from every occurrence of the # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -85 ------------------------------- -Content-Disposition: form-data; name="field" -Content-Transfer-Encoding: base64 - - -4 -ZHVt -3a -bXk= --------------------------------- - -0 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Transfer-Encoding: chunked +Content-Type: multipart/form-data; boundary=---------------------------- +Expect: 100-continue + +85 +------------------------------ +Content-Disposition: form-data; name="field" +Content-Transfer-Encoding: base64 + + +4 +ZHVt +3a +bXk= +-------------------------------- + +0 + diff --git a/tests/data/test669 b/tests/data/test669 index 620aa3393d5d..8bc19f15bfcb 100644 --- a/tests/data/test669 +++ b/tests/data/test669 @@ -41,23 +41,23 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -H 'Content-type: multipart/form-da s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 260 -Content-Type: multipart/form-data; charset=utf-8; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="name" - -daniel ------------------------------- -Content-Disposition: form-data; name="tool" - -curl --------------------------------- + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 260 +Content-Type: multipart/form-data; charset=utf-8; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="name" + +daniel +------------------------------ +Content-Disposition: form-data; name="tool" + +curl +-------------------------------- diff --git a/tests/data/test67 b/tests/data/test67 index b2790099dd6a..48ba23689040 100644 --- a/tests/data/test67 +++ b/tests/data/test67 @@ -73,19 +73,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test670 b/tests/data/test670 index 94910b5362b7..bb06fbba8a89 100644 --- a/tests/data/test670 +++ b/tests/data/test670 @@ -58,18 +58,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 154 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="field" - -AB --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 154 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="field" + +AB +-------------------------------- diff --git a/tests/data/test671 b/tests/data/test671 index 310a902b147b..4a288c852ee1 100644 --- a/tests/data/test671 +++ b/tests/data/test671 @@ -58,18 +58,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 154 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="field" - -AB --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 154 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="field" + +AB +-------------------------------- diff --git a/tests/data/test672 b/tests/data/test672 index e295b2f07b5b..c57e030a335b 100644 --- a/tests/data/test672 +++ b/tests/data/test672 @@ -58,18 +58,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 154 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="field" - -AB --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 154 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="field" + +AB +-------------------------------- diff --git a/tests/data/test673 b/tests/data/test673 index e4db3cf83a01..c599647bb9ee 100644 --- a/tests/data/test673 +++ b/tests/data/test673 @@ -58,18 +58,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 154 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="field" - -AB --------------------------------- + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 154 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="field" + +AB +-------------------------------- diff --git a/tests/data/test674 b/tests/data/test674 index 2043b3d4ae11..315fe98b650a 100644 --- a/tests/data/test674 +++ b/tests/data/test674 @@ -39,15 +39,15 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + diff --git a/tests/data/test675 b/tests/data/test675 index 6688cacc940d..5d82c52f9bd8 100644 --- a/tests/data/test675 +++ b/tests/data/test675 @@ -37,19 +37,19 @@ proxy # Verify data after the test has been "shot" - -GET /user1/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user1:foo1]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /user2/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user2:foo2]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /user1/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user1:foo1]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /user2/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user2:foo2]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test676 b/tests/data/test676 index 031395eb8e29..d2f01d0e3131 100644 --- a/tests/data/test676 +++ b/tests/data/test676 @@ -69,18 +69,18 @@ cookies # # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: the-moo agent next generation -Accept: */* -Cookie: proven=yes - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: the-moo agent next generation -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: the-moo agent next generation +Accept: */* +Cookie: proven=yes + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: the-moo agent next generation +Accept: */* + diff --git a/tests/data/test677 b/tests/data/test677 index 166be89543fe..29f5af5d5c6a 100644 --- a/tests/data/test677 +++ b/tests/data/test677 @@ -35,9 +35,9 @@ imap://%HOSTIP:%IMAPPORT/677 # # Verify data after the test has been "shot" - -A001 CAPABILITY -A1 IDLE + +A001 CAPABILITY +A1 IDLE diff --git a/tests/data/test678 b/tests/data/test678 index ea91ae6aecd4..4f3ed70235e6 100644 --- a/tests/data/test678 +++ b/tests/data/test678 @@ -48,12 +48,12 @@ https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: localhost:%HTTPSPORT -User-Agent: CURLOPT_CAINFO_BLOB -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: CURLOPT_CAINFO_BLOB +Accept: */* + diff --git a/tests/data/test679 b/tests/data/test679 index e57401be46d3..2c739eebf3b5 100644 --- a/tests/data/test679 +++ b/tests/data/test679 @@ -44,13 +44,13 @@ machine %HOSTIP login user1 password "with spaces and \"\n\r\t\a" # # Verify data after the test has been "shot" - -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user1:with%20spaces%20and%20"%0a%0d%09a]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user1:with%20spaces%20and%20"%0a%0d%09a]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test68 b/tests/data/test68 index b6d8f67cb5bf..3a1a1593609e 100644 --- a/tests/data/test68 +++ b/tests/data/test68 @@ -72,19 +72,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test681 b/tests/data/test681 index d98393ddbfae..1640b900d3d4 100644 --- a/tests/data/test681 +++ b/tests/data/test681 @@ -37,12 +37,12 @@ http # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + -foo- diff --git a/tests/data/test682 b/tests/data/test682 index fc2189918525..748c39a3b6d4 100644 --- a/tests/data/test682 +++ b/tests/data/test682 @@ -41,13 +41,13 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user1:passwd1]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user1:passwd1]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test683 b/tests/data/test683 index 9eb250fbd7c1..4b4048a42e27 100644 --- a/tests/data/test683 +++ b/tests/data/test683 @@ -41,13 +41,13 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user2:passwd2]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user2:passwd2]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test684 b/tests/data/test684 index a63424e2509c..a64844b6bf36 100644 --- a/tests/data/test684 +++ b/tests/data/test684 @@ -40,13 +40,13 @@ machine %HOSTIP password 5up3r53cr37 # # Verify data after the test has been "shot" - -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[:5up3r53cr37]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[:5up3r53cr37]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test685 b/tests/data/test685 index bdb2124b4b00..f93fe644b1a3 100644 --- a/tests/data/test685 +++ b/tests/data/test685 @@ -40,13 +40,13 @@ machine %HOSTIP password 5up3r53cr37 # # Verify data after the test has been "shot" - + +GET / HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:5up3r53cr37]b64% +User-Agent: curl/%VERSION +Accept: */* + -GET / HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user:5up3r53cr37]b64% -User-Agent: curl/%VERSION -Accept: */* - diff --git a/tests/data/test687 b/tests/data/test687 index 28b8bee7eab7..516d670be23f 100644 --- a/tests/data/test687 +++ b/tests/data/test687 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --xattr -o %LOGDIR/out%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + user.creator => curl diff --git a/tests/data/test688 b/tests/data/test688 index 6fbd339fc007..e8e7852b2066 100644 --- a/tests/data/test688 +++ b/tests/data/test688 @@ -47,12 +47,12 @@ basic --xattr with -O # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + user.creator => curl diff --git a/tests/data/test689 b/tests/data/test689 index 31f81983d104..61e57fce4ab4 100644 --- a/tests/data/test689 +++ b/tests/data/test689 @@ -37,12 +37,12 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER - -OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 -CSeq: 1 -User-Agent: test567 -Test-Number: 567 - + +OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 +CSeq: 1 +User-Agent: test567 +Test-Number: 567 + # 85 == CURLE_RTSP_CSEQ_ERROR diff --git a/tests/data/test69 b/tests/data/test69 index 1df70f3d9c96..bfd4de8c121b 100644 --- a/tests/data/test69 +++ b/tests/data/test69 @@ -89,24 +89,24 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test693 b/tests/data/test693 index d7bd193ac2c8..dd2b3d3ce1bc 100644 --- a/tests/data/test693 +++ b/tests/data/test693 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/moo/boo/etag%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + W/"asdf" diff --git a/tests/data/test695 b/tests/data/test695 index 8910af077539..90bd0ede7826 100644 --- a/tests/data/test695 +++ b/tests/data/test695 @@ -42,37 +42,37 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 196 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="data" -Content-Type: text/html - -hello --------------------------------- -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 423 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data -Content-Type: multipart/mixed; boundary=---------------------------- - ------------------------------- -Content-Disposition: attachment; name="data" -Content-Type: text/html - -hello --------------------------------- - --------------------------------- + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 196 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="data" +Content-Type: text/html + +hello +-------------------------------- +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 423 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data +Content-Type: multipart/mixed; boundary=---------------------------- + +------------------------------ +Content-Disposition: attachment; name="data" +Content-Type: text/html + +hello +-------------------------------- + +-------------------------------- diff --git a/tests/data/test696 b/tests/data/test696 index 2b53c4fc9873..8862b163f23e 100644 --- a/tests/data/test696 +++ b/tests/data/test696 @@ -54,13 +54,13 @@ Connection: close -foo- - -GET /556 HTTP/1.1 -Host: ninja - -GET /556 HTTP/1.1 -Host: ninja - + +GET /556 HTTP/1.1 +Host: ninja + +GET /556 HTTP/1.1 +Host: ninja + diff --git a/tests/data/test698 b/tests/data/test698 index 10cf42cea941..3335e3875d6f 100644 --- a/tests/data/test698 +++ b/tests/data/test698 @@ -37,19 +37,19 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-account "one count" ftp://%HOSTIP:%FTPP # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -ACCT one count -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -EPSV -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +ACCT one count +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +EPSV +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test7 b/tests/data/test7 index e98d5f5b1b59..5bd0705c4127 100644 --- a/tests/data/test7 +++ b/tests/data/test7 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b none -D %LOGDIR/heads%TESTNUMBER # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test70 b/tests/data/test70 index 5d44a28e85cf..a4ea92b2c168 100644 --- a/tests/data/test70 +++ b/tests/data/test70 @@ -69,18 +69,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/%TESTNUMBER", response="2c9a6f00af0d86497b177b90e90c688a" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/%TESTNUMBER", response="2c9a6f00af0d86497b177b90e90c688a" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test700 b/tests/data/test700 index fb59098354c0..9a2160bbbcdc 100644 --- a/tests/data/test700 +++ b/tests/data/test700 @@ -47,12 +47,12 @@ HTTP GET via SOCKS4 proxy # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test701 b/tests/data/test701 index b7a9091a98d9..dcd9d442bfdc 100644 --- a/tests/data/test701 +++ b/tests/data/test701 @@ -47,12 +47,12 @@ HTTP GET via SOCKS5 proxy # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test706 b/tests/data/test706 index faafd903850d..ff57dcefc62c 100644 --- a/tests/data/test706 +++ b/tests/data/test706 @@ -47,14 +47,14 @@ FTP dir list PASV via SOCKS4 # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test707 b/tests/data/test707 index 2c41dfea70d2..3e411ce7acc5 100644 --- a/tests/data/test707 +++ b/tests/data/test707 @@ -47,14 +47,14 @@ FTP dir list PASV via SOCKS5 # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE A -LIST -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +LIST +QUIT diff --git a/tests/data/test708 b/tests/data/test708 index d6797dc65f3a..9fd664ff45a1 100644 --- a/tests/data/test708 +++ b/tests/data/test708 @@ -50,12 +50,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test709 b/tests/data/test709 index 2b2b952c18dd..72c7aec17c02 100644 --- a/tests/data/test709 +++ b/tests/data/test709 @@ -51,12 +51,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test710 b/tests/data/test710 index 02033831b68b..b9defa6f626e 100644 --- a/tests/data/test710 +++ b/tests/data/test710 @@ -47,12 +47,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy socks5://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test711 b/tests/data/test711 index 355ca0e51efe..9317adb8b89e 100644 --- a/tests/data/test711 +++ b/tests/data/test711 @@ -43,15 +43,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test712 b/tests/data/test712 index 7bcc2a1bbb40..e78767bc56aa 100644 --- a/tests/data/test712 +++ b/tests/data/test712 @@ -37,15 +37,15 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --proxy socks5://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test713 b/tests/data/test713 index 44820a78ffc7..b7ad8cdf0e9f 100644 --- a/tests/data/test713 +++ b/tests/data/test713 @@ -38,15 +38,15 @@ ftp://ftp.example.com/%TESTNUMBER --connect-to ::%HOSTIP:%FTPPORT --proxy socks5 # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test714 b/tests/data/test714 index a38400bb8098..b24af1e4af9a 100644 --- a/tests/data/test714 +++ b/tests/data/test714 @@ -57,15 +57,15 @@ ftp://ftp.example.com.%TESTNUMBER/%TESTNUMBER --connect-to ::connect.example.com # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test715 b/tests/data/test715 index 6f9670af54d7..0574030330fb 100644 --- a/tests/data/test715 +++ b/tests/data/test715 @@ -59,15 +59,15 @@ ftp://ftp.example.com.%TESTNUMBER/%TESTNUMBER --connect-to ::connect.example.com # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test717 b/tests/data/test717 index 54ab95568028..58e3045e5651 100644 --- a/tests/data/test717 +++ b/tests/data/test717 @@ -55,12 +55,12 @@ proxy # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:1 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:1 +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test718 b/tests/data/test718 index dcbf7d77a15c..95c81e1680a7 100644 --- a/tests/data/test718 +++ b/tests/data/test718 @@ -47,12 +47,12 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http:// # Verify data after the test has been "shot" - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + 56 diff --git a/tests/data/test719 b/tests/data/test719 index 454460983de2..366ea27ee458 100644 --- a/tests/data/test719 +++ b/tests/data/test719 @@ -49,12 +49,12 @@ http://[2200::33]:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: [2200::33]:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: [2200::33]:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + atyp 4 => 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 diff --git a/tests/data/test72 b/tests/data/test72 index 775642f8cd0f..ba7d137b2193 100644 --- a/tests/data/test72 +++ b/tests/data/test72 @@ -68,18 +68,18 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/%TESTNUMBER", response="9fcd1330377365a09bbcb33b2cbb25bd" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/%TESTNUMBER", response="9fcd1330377365a09bbcb33b2cbb25bd" +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test720 b/tests/data/test720 index 709656a28063..b146a2bf54f4 100644 --- a/tests/data/test720 +++ b/tests/data/test720 @@ -48,12 +48,12 @@ http://12.34.56.78:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: 12.34.56.78:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: 12.34.56.78:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + atyp 1 => 12.34.56.78 diff --git a/tests/data/test721 b/tests/data/test721 index db63a8f6b523..c70d5607225d 100644 --- a/tests/data/test721 +++ b/tests/data/test721 @@ -48,12 +48,12 @@ http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCK # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: this.is.a.host.name:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: this.is.a.host.name:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + atyp 3 => this.is.a.host.name diff --git a/tests/data/test73 b/tests/data/test73 index 1edcbdcb9017..e131ec6f0d32 100644 --- a/tests/data/test73 +++ b/tests/data/test73 @@ -38,12 +38,12 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: host.NOT_DISCLOSED.se -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: host.NOT_DISCLOSED.se +User-Agent: curl/%VERSION +Accept: */* + # Netscape HTTP Cookie File diff --git a/tests/data/test74 b/tests/data/test74 index d9316f0e6791..31179af990d7 100644 --- a/tests/data/test74 +++ b/tests/data/test74 @@ -50,17 +50,17 @@ HTTP, urlglob {}-retrieval and -o #[num] usage # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.0 200 OK diff --git a/tests/data/test742 b/tests/data/test742 index 5f56a1a500da..70720d7a498e 100644 --- a/tests/data/test742 +++ b/tests/data/test742 @@ -55,12 +55,12 @@ proxy # # Verify data after the test has been "shot" - -GET / HTTP/1.1 -Host: %repeat[254 x c]%:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET / HTTP/1.1 +Host: %repeat[254 x c]%:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test744 b/tests/data/test744 index fbb1cf951677..704a53a448dd 100644 --- a/tests/data/test744 +++ b/tests/data/test744 @@ -68,12 +68,12 @@ Host: foo.host:%HTTPPORT Proxy-Connection: Keep-Alive - -GET /%TESTNUMBER HTTP/1.1 -Host: foo.host:%HTTPPORT -Authorization: Basic %b64[foo:baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar]b64% -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: foo.host:%HTTPPORT +Authorization: Basic %b64[foo:baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar]b64% +Accept: */* + diff --git a/tests/data/test753 b/tests/data/test753 index 3913567205f5..250a80c506fb 100644 --- a/tests/data/test753 +++ b/tests/data/test753 @@ -30,16 +30,16 @@ CURL_FTP_PWD_STOP=1 # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE 753 -QUIT + +USER anonymous +PASS ftp@example.com +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE 753 +QUIT diff --git a/tests/data/test754 b/tests/data/test754 index 42234bab225e..2aa1e9db0cd6 100644 --- a/tests/data/test754 +++ b/tests/data/test754 @@ -42,20 +42,20 @@ ftp://%HOSTIP:%FTPPORT/path/ -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FAIL" -Q # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -NOOP 1 -FAIL -CWD path -EPSV -TYPE A -NOOP 2 -FAIL HARD -LIST -NOOP 3 -QUIT + +USER anonymous +PASS ftp@example.com +PWD +NOOP 1 +FAIL +CWD path +EPSV +TYPE A +NOOP 2 +FAIL HARD +LIST +NOOP 3 +QUIT diff --git a/tests/data/test756 b/tests/data/test756 index a205c1977241..56038a66d801 100644 --- a/tests/data/test756 +++ b/tests/data/test756 @@ -47,17 +47,17 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUM # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /want/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /want/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test757 b/tests/data/test757 index 9cf9b2c3b14b..c4f5566c1e31 100644 --- a/tests/data/test757 +++ b/tests/data/test757 @@ -42,37 +42,37 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 200 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="data" -Content-Type: text/html - -fun-times --------------------------------- -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 427 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data -Content-Type: multipart/mixed; boundary=---------------------------- - ------------------------------- -Content-Disposition: attachment; name="data" -Content-Type: text/html - -fun-times --------------------------------- - --------------------------------- + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 200 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="data" +Content-Type: text/html + +fun-times +-------------------------------- +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 427 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data +Content-Type: multipart/mixed; boundary=---------------------------- + +------------------------------ +Content-Disposition: attachment; name="data" +Content-Type: text/html + +fun-times +-------------------------------- + +-------------------------------- diff --git a/tests/data/test762 b/tests/data/test762 index 62ce9e632537..2d7aedcf7f49 100644 --- a/tests/data/test762 +++ b/tests/data/test762 @@ -38,12 +38,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O --remote-time --output-dir %LOGDIR # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + 12345 diff --git a/tests/data/test77 b/tests/data/test77 index baa9bfc36074..bde62adce37d 100644 --- a/tests/data/test77 +++ b/tests/data/test77 @@ -42,13 +42,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT + diff --git a/tests/data/test775 b/tests/data/test775 index 7b5c3696dc23..6a03ad8feee4 100644 --- a/tests/data/test775 +++ b/tests/data/test775 @@ -52,13 +52,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser%repeat[1100 x A]%:testpass --nt # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + 100 diff --git a/tests/data/test78 b/tests/data/test78 index d52fb1554800..545adca00108 100644 --- a/tests/data/test78 +++ b/tests/data/test78 @@ -54,13 +54,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 11:00:00 1999 GMT" # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -If-Modified-Since: Sun, 12 Dec 1999 11:00:00 GMT - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +If-Modified-Since: Sun, 12 Dec 1999 11:00:00 GMT + diff --git a/tests/data/test79 b/tests/data/test79 index e836b3bf5c3c..8a52c09f988b 100644 --- a/tests/data/test79 +++ b/tests/data/test79 @@ -42,13 +42,13 @@ ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - -GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test794 b/tests/data/test794 index b6af9677ad30..479f1b1be241 100644 --- a/tests/data/test794 +++ b/tests/data/test794 @@ -75,7 +75,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --no-progress-meter -X IGLOO -d moo --locat ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test796 b/tests/data/test796 index 2e0c4077b49c..bfef4bd07df7 100644 --- a/tests/data/test796 +++ b/tests/data/test796 @@ -75,7 +75,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -X IGLOO -d moo --follow ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test797 b/tests/data/test797 index b0602c1302f9..5c28f3ccd70a 100644 --- a/tests/data/test797 +++ b/tests/data/test797 @@ -75,7 +75,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -X IGLOO -d moo --follow ^User-Agent:.* - + IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test799 b/tests/data/test799 index e8563a598fe4..ec6d94ca8a4f 100644 --- a/tests/data/test799 +++ b/tests/data/test799 @@ -42,12 +42,12 @@ IMAP with --login-options 'AUTH=+LOGIN' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test8 b/tests/data/test8 index 5ed328bbedc8..ee1263eba4f1 100644 --- a/tests/data/test8 +++ b/tests/data/test8 @@ -88,13 +88,13 @@ cookies # Verify data after the test has been "shot" - -GET /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Cookie: name with space=is weird but; trailingspace=removed; cookie=perhaps; cookie=yes; foobar=name; blexp=yesyes; cookie9=junk-- - + +GET /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Cookie: name with space=is weird but; trailingspace=removed; cookie=perhaps; cookie=yes; foobar=name; blexp=yesyes; cookie9=junk-- + diff --git a/tests/data/test80 b/tests/data/test80 index 2ffcd8987f39..c840527bf108 100644 --- a/tests/data/test80 +++ b/tests/data/test80 @@ -70,12 +70,12 @@ Proxy-Authorization: Basic %b64[youare:yourself]b64% Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -Authorization: Basic %b64[iam:myself]b64% -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +Authorization: Basic %b64[iam:myself]b64% +Accept: */* + diff --git a/tests/data/test800 b/tests/data/test800 index a2daf240a700..11a3f877844f 100644 --- a/tests/data/test800 +++ b/tests/data/test800 @@ -38,12 +38,12 @@ IMAP FETCH message # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN "\"user" "sec\"ret{" -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN "\"user" "sec\"ret{" +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test801 b/tests/data/test801 index 9b68d62a86a7..0fda1c25044e 100644 --- a/tests/data/test801 +++ b/tests/data/test801 @@ -35,12 +35,12 @@ IMAP FETCH message by MAILINDEX and SECTION # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 123 BODY[1] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 123 BODY[1] +A005 LOGOUT diff --git a/tests/data/test802 b/tests/data/test802 index 1e2e35bfa01b..8d93c792253b 100644 --- a/tests/data/test802 +++ b/tests/data/test802 @@ -36,12 +36,12 @@ IMAP SELECT UIDVALIDITY Success # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 123 BODY[TEXT] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 123 BODY[TEXT] +A005 LOGOUT diff --git a/tests/data/test803 b/tests/data/test803 index 6fb00eb0a6a7..d5bd7b19f971 100644 --- a/tests/data/test803 +++ b/tests/data/test803 @@ -35,11 +35,11 @@ IMAP SELECT UIDVALIDITY Failure 78 - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 LOGOUT diff --git a/tests/data/test804 b/tests/data/test804 index 9d6c7e94e9db..f755a262aef2 100644 --- a/tests/data/test804 +++ b/tests/data/test804 @@ -35,13 +35,13 @@ IMAP doesn't perform SELECT if reusing the same mailbox # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 123 BODY[1] -A005 FETCH 456 BODY[2.3] -A006 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 123 BODY[1] +A005 FETCH 456 BODY[2.3] +A006 LOGOUT diff --git a/tests/data/test805 b/tests/data/test805 index 7370e63604b9..8953d586805d 100644 --- a/tests/data/test805 +++ b/tests/data/test805 @@ -41,22 +41,22 @@ Hello Joe, do you think we can meet at 3:30 tomorrow? # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 APPEND %TESTNUMBER (\Seen) {295} -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 APPEND %TESTNUMBER (\Seen) {295} +A004 LOGOUT - -Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar -Subject: afternoon meeting -To: joe@example.com -Message-Id: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; CHARSET=US-ASCII - -Hello Joe, do you think we can meet at 3:30 tomorrow? + +Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) +From: Fred Foobar +Subject: afternoon meeting +To: joe@example.com +Message-Id: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; CHARSET=US-ASCII + +Hello Joe, do you think we can meet at 3:30 tomorrow? diff --git a/tests/data/test806 b/tests/data/test806 index adfbc11212cf..6b7e6ff7fecc 100644 --- a/tests/data/test806 +++ b/tests/data/test806 @@ -34,11 +34,11 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 LIST "%TESTNUMBER" * -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 LIST "%TESTNUMBER" * +A004 LOGOUT diff --git a/tests/data/test807 b/tests/data/test807 index 80a1044da0f4..5da810591415 100644 --- a/tests/data/test807 +++ b/tests/data/test807 @@ -35,11 +35,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'LSUB "%TESTNUMBER" *' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 LSUB "%TESTNUMBER" * -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 LSUB "%TESTNUMBER" * +A004 LOGOUT diff --git a/tests/data/test808 b/tests/data/test808 index 542f87e6d6ab..6795143d4de4 100644 --- a/tests/data/test808 +++ b/tests/data/test808 @@ -39,11 +39,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'EXAMINE %TESTNUMBER' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 EXAMINE %TESTNUMBER -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 EXAMINE %TESTNUMBER +A004 LOGOUT diff --git a/tests/data/test809 b/tests/data/test809 index 25635d21f04f..af4c8084195f 100644 --- a/tests/data/test809 +++ b/tests/data/test809 @@ -33,11 +33,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'STATUS %TESTNUMBER (UIDNEXT MESSAGES # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 STATUS %TESTNUMBER (UIDNEXT MESSAGES) -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 STATUS %TESTNUMBER (UIDNEXT MESSAGES) +A004 LOGOUT diff --git a/tests/data/test81 b/tests/data/test81 index f692f34f46e8..27f1247a9715 100644 --- a/tests/data/test81 +++ b/tests/data/test81 @@ -73,21 +73,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy-user testuser:testpass -x http://%H # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test810 b/tests/data/test810 index 37d76f6ba0bc..af9a310f7ab5 100644 --- a/tests/data/test810 +++ b/tests/data/test810 @@ -32,12 +32,12 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER?NEW -u user:secret # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 SEARCH NEW -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 SEARCH NEW +A005 LOGOUT diff --git a/tests/data/test811 b/tests/data/test811 index e2520c331964..5f515022444e 100644 --- a/tests/data/test811 +++ b/tests/data/test811 @@ -30,11 +30,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'CREATE %TESTNUMBER' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 CREATE %TESTNUMBER -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 CREATE %TESTNUMBER +A004 LOGOUT diff --git a/tests/data/test812 b/tests/data/test812 index 0180e023e8d0..f51b71dad5dc 100644 --- a/tests/data/test812 +++ b/tests/data/test812 @@ -30,11 +30,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'DELETE %TESTNUMBER' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 DELETE %TESTNUMBER -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 DELETE %TESTNUMBER +A004 LOGOUT diff --git a/tests/data/test813 b/tests/data/test813 index 674d308fd7e9..741b4968fb48 100644 --- a/tests/data/test813 +++ b/tests/data/test813 @@ -30,11 +30,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'RENAME 666 %TESTNUMBER' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 RENAME 666 %TESTNUMBER -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 RENAME 666 %TESTNUMBER +A004 LOGOUT diff --git a/tests/data/test814 b/tests/data/test814 index e73b0e894a32..df10a65592d6 100644 --- a/tests/data/test814 +++ b/tests/data/test814 @@ -30,12 +30,12 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -u user:secret -X 'CHECK' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 CHECK -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 CHECK +A005 LOGOUT diff --git a/tests/data/test815 b/tests/data/test815 index 04daef90f0f5..57af869fa3fe 100644 --- a/tests/data/test815 +++ b/tests/data/test815 @@ -34,13 +34,13 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -X 'STORE 123 +Flags \Deleted' -u user:secr # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 STORE 123 +Flags \Deleted -A005 CLOSE -A006 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 STORE 123 +Flags \Deleted +A005 CLOSE +A006 LOGOUT diff --git a/tests/data/test816 b/tests/data/test816 index b6054cacfcd6..c45cc1172f15 100644 --- a/tests/data/test816 +++ b/tests/data/test816 @@ -37,13 +37,13 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -X 'STORE 123 +Flags \Deleted' -u user:secr # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 STORE 123 +Flags \Deleted -A005 EXPUNGE -A006 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 STORE 123 +Flags \Deleted +A005 EXPUNGE +A006 LOGOUT diff --git a/tests/data/test817 b/tests/data/test817 index c608f65b0fd0..ce5b0adb456d 100644 --- a/tests/data/test817 +++ b/tests/data/test817 @@ -30,11 +30,11 @@ imap://%HOSTIP:%IMAPPORT -u user:secret -X 'COPY 123 %TESTNUMBER' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 COPY 123 %TESTNUMBER -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 COPY 123 %TESTNUMBER +A004 LOGOUT diff --git a/tests/data/test818 b/tests/data/test818 index dd917ea3999e..e096b13fd486 100644 --- a/tests/data/test818 +++ b/tests/data/test818 @@ -36,11 +36,11 @@ imap://%HOSTIP:%IMAPPORT -X NOOP -u user:secret # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 NOOP -A004 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 NOOP +A004 LOGOUT diff --git a/tests/data/test819 b/tests/data/test819 index 50ff22669126..81f0277c4555 100644 --- a/tests/data/test819 +++ b/tests/data/test819 @@ -44,13 +44,13 @@ IMAP plain authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE PLAIN -AHVzZXIAc2VjcmV0 -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE PLAIN +AHVzZXIAc2VjcmV0 +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test82 b/tests/data/test82 index c343d0a2de5d..6974bc3a1f4b 100644 --- a/tests/data/test82 +++ b/tests/data/test82 @@ -41,14 +41,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy-user testuser:testpass -x http://%H # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: Basic %b64[testuser:testpass]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: Basic %b64[testuser:testpass]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test820 b/tests/data/test820 index 80ac25f27dc2..e617e241bfdd 100644 --- a/tests/data/test820 +++ b/tests/data/test820 @@ -44,14 +44,14 @@ IMAP login authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE LOGIN -dXNlcg== -c2VjcmV0 -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE LOGIN +dXNlcg== +c2VjcmV0 +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test821 b/tests/data/test821 index 4179220800ef..2b928fe1d063 100644 --- a/tests/data/test821 +++ b/tests/data/test821 @@ -48,13 +48,13 @@ IMAP CRAM-MD5 authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE CRAM-MD5 -dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE CRAM-MD5 +dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test822 b/tests/data/test822 index 61db77dc3c36..4f4859544d14 100644 --- a/tests/data/test822 +++ b/tests/data/test822 @@ -50,14 +50,14 @@ IMAP NTLM authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test823 b/tests/data/test823 index 91d75fed4a7b..aef99f0f0baa 100644 --- a/tests/data/test823 +++ b/tests/data/test823 @@ -54,14 +54,14 @@ IMAP DIGEST-MD5 authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE DIGEST-MD5 -dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJpbWFwLzEyNy4wLjAuMSIscmVzcG9uc2U9YmU2MzgyNDkzNjJkN2FhMGUzNTM4NTA3Njc1MWFiNDgscW9wPWF1dGg= - -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE DIGEST-MD5 +dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJpbWFwLzEyNy4wLjAuMSIscmVzcG9uc2U9YmU2MzgyNDkzNjJkN2FhMGUzNTM4NTA3Njc1MWFiNDgscW9wPWF1dGg= + +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test824 b/tests/data/test824 index 0abda22b0a29..b2d16dc9c860 100644 --- a/tests/data/test824 +++ b/tests/data/test824 @@ -44,13 +44,13 @@ IMAP OAuth 2.0 (XOAUTH2) authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE XOAUTH2 -dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE XOAUTH2 +dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test825 b/tests/data/test825 index 64d57f5feb30..9f5336e3775b 100644 --- a/tests/data/test825 +++ b/tests/data/test825 @@ -45,12 +45,12 @@ IMAP plain authentication with initial response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE PLAIN AHVzZXIAc2VjcmV0 -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE PLAIN AHVzZXIAc2VjcmV0 +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test826 b/tests/data/test826 index b3b0dc335f9a..9f49957e7da5 100644 --- a/tests/data/test826 +++ b/tests/data/test826 @@ -45,13 +45,13 @@ IMAP login authentication with initial response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE LOGIN dXNlcg== -c2VjcmV0 -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE LOGIN dXNlcg== +c2VjcmV0 +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test827 b/tests/data/test827 index 493775381f09..58a89015bb29 100644 --- a/tests/data/test827 +++ b/tests/data/test827 @@ -51,13 +51,13 @@ IMAP NTLM authentication with initial response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test828 b/tests/data/test828 index a3548464e881..cda2e33258eb 100644 --- a/tests/data/test828 +++ b/tests/data/test828 @@ -45,12 +45,12 @@ IMAP OAuth 2.0 (XOAUTH2) authentication with initial response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test83 b/tests/data/test83 index 1d138ce10a1b..b6e89a65fb30 100644 --- a/tests/data/test83 +++ b/tests/data/test83 @@ -67,13 +67,13 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -Authorization: Basic %b64[iam:my:;self]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +Authorization: Basic %b64[iam:my:;self]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test830 b/tests/data/test830 index 1465406e1b00..8124e1a13c9c 100644 --- a/tests/data/test830 +++ b/tests/data/test830 @@ -48,10 +48,10 @@ IMAP CRAM-MD5 graceful cancellation # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "LOGOUT" - -A001 CAPABILITY -A002 AUTHENTICATE CRAM-MD5 -* + +A001 CAPABILITY +A002 AUTHENTICATE CRAM-MD5 +* diff --git a/tests/data/test831 b/tests/data/test831 index 1ef3d45c4183..c095bcda5db6 100644 --- a/tests/data/test831 +++ b/tests/data/test831 @@ -49,11 +49,11 @@ IMAP NTLM graceful cancellation # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "LOGOUT" - -A001 CAPABILITY -A002 AUTHENTICATE NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -* + +A001 CAPABILITY +A002 AUTHENTICATE NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +* diff --git a/tests/data/test832 b/tests/data/test832 index 5787bbc797fd..f5a0323e3a58 100644 --- a/tests/data/test832 +++ b/tests/data/test832 @@ -50,10 +50,10 @@ IMAP DIGEST-MD5 graceful cancellation # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "LOGOUT" - -A001 CAPABILITY -A002 AUTHENTICATE DIGEST-MD5 -* + +A001 CAPABILITY +A002 AUTHENTICATE DIGEST-MD5 +* diff --git a/tests/data/test833 b/tests/data/test833 index bda66c514c92..f8a204deb266 100644 --- a/tests/data/test833 +++ b/tests/data/test833 @@ -52,15 +52,15 @@ IMAP CRAM-MD5 authentication with SASL downgrade # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE CRAM-MD5 -* -A003 AUTHENTICATE PLAIN -AHVzZXIAc2VjcmV0 -A004 SELECT %TESTNUMBER -A005 FETCH 1 BODY[] -A006 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE CRAM-MD5 +* +A003 AUTHENTICATE PLAIN +AHVzZXIAc2VjcmV0 +A004 SELECT %TESTNUMBER +A005 FETCH 1 BODY[] +A006 LOGOUT diff --git a/tests/data/test834 b/tests/data/test834 index ccdf0d1fdba0..fdfcde883461 100644 --- a/tests/data/test834 +++ b/tests/data/test834 @@ -53,16 +53,16 @@ IMAP NTLM authentication with SASL downgrade # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -* -A003 AUTHENTICATE PLAIN -AHVzZXIAc2VjcmV0 -A004 SELECT %TESTNUMBER -A005 FETCH 1 BODY[] -A006 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +* +A003 AUTHENTICATE PLAIN +AHVzZXIAc2VjcmV0 +A004 SELECT %TESTNUMBER +A005 FETCH 1 BODY[] +A006 LOGOUT diff --git a/tests/data/test835 b/tests/data/test835 index aa3a44670610..b1e0f3422598 100644 --- a/tests/data/test835 +++ b/tests/data/test835 @@ -54,15 +54,15 @@ IMAP DIGEST-MD5 authentication with SASL downgrade # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE DIGEST-MD5 -* -A003 AUTHENTICATE PLAIN -AHVzZXIAc2VjcmV0 -A004 SELECT %TESTNUMBER -A005 FETCH 1 BODY[] -A006 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE DIGEST-MD5 +* +A003 AUTHENTICATE PLAIN +AHVzZXIAc2VjcmV0 +A004 SELECT %TESTNUMBER +A005 FETCH 1 BODY[] +A006 LOGOUT diff --git a/tests/data/test836 b/tests/data/test836 index 821d5392bb8c..cdcb0e9a9b77 100644 --- a/tests/data/test836 +++ b/tests/data/test836 @@ -43,17 +43,17 @@ IMAP multiple connection authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user.one secret -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT -B001 CAPABILITY -B002 LOGIN user.two secret -B003 SELECT %TESTNUMBER -B004 FETCH 2 BODY[] -B005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user.one secret +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT +B001 CAPABILITY +B002 LOGIN user.two secret +B003 SELECT %TESTNUMBER +B004 FETCH 2 BODY[] +B005 LOGOUT diff --git a/tests/data/test837 b/tests/data/test837 index 74b575a6ed7f..b5735ea09913 100644 --- a/tests/data/test837 +++ b/tests/data/test837 @@ -44,13 +44,13 @@ IMAP external authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE EXTERNAL -dXNlcg== -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE EXTERNAL +dXNlcg== +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test838 b/tests/data/test838 index c6081fb6386f..bbd282289dcb 100644 --- a/tests/data/test838 +++ b/tests/data/test838 @@ -44,13 +44,13 @@ IMAP external authentication without credentials # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE EXTERNAL -= -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE EXTERNAL += +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test839 b/tests/data/test839 index 9f443b42aab4..8350c414bf87 100644 --- a/tests/data/test839 +++ b/tests/data/test839 @@ -45,12 +45,12 @@ IMAP external authentication with initial response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE EXTERNAL dXNlcg== -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE EXTERNAL dXNlcg== +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test84 b/tests/data/test84 index 2cbd8a575d47..9dca293375a6 100644 --- a/tests/data/test84 +++ b/tests/data/test84 @@ -41,14 +41,14 @@ proxy # # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test840 b/tests/data/test840 index 48fd32a34949..612e1119eb96 100644 --- a/tests/data/test840 +++ b/tests/data/test840 @@ -45,12 +45,12 @@ IMAP external authentication with initial response without credentials # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE EXTERNAL = -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE EXTERNAL = +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test841 b/tests/data/test841 index debf6cfb848b..eee632f55574 100644 --- a/tests/data/test841 +++ b/tests/data/test841 @@ -45,12 +45,12 @@ IMAP custom request doesn't check continuation data # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 123 BODY[1] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 123 BODY[1] +A005 LOGOUT diff --git a/tests/data/test842 b/tests/data/test842 index 1cea6e39d35f..e66d5b1aa6ab 100644 --- a/tests/data/test842 +++ b/tests/data/test842 @@ -47,13 +47,13 @@ IMAP OAuth 2.0 (OAUTHBEARER) authentication # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE OAUTHBEARER -%b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE OAUTHBEARER +%b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test843 b/tests/data/test843 index 774c4c5e74b4..fa8df84c8f67 100644 --- a/tests/data/test843 +++ b/tests/data/test843 @@ -46,12 +46,12 @@ IMAP OAuth 2.0 (OAUTHBEARER) authentication with initial response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test844 b/tests/data/test844 index fd65d750c634..caa324638a56 100644 --- a/tests/data/test844 +++ b/tests/data/test844 @@ -43,10 +43,10 @@ IMAP OAuth 2.0 (OAUTHBEARER) failure as continuation # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "LOGOUT" - -A001 CAPABILITY -A002 AUTHENTICATE OAUTHBEARER -%b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% + +A001 CAPABILITY +A002 AUTHENTICATE OAUTHBEARER +%b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% diff --git a/tests/data/test845 b/tests/data/test845 index c9cae6d65a2f..f68be7d67c51 100644 --- a/tests/data/test845 +++ b/tests/data/test845 @@ -45,10 +45,10 @@ IMAP OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "LOGOUT" - -A001 CAPABILITY -A002 AUTHENTICATE OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -%b64[%01]b64% + +A001 CAPABILITY +A002 AUTHENTICATE OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +%b64[%01]b64% diff --git a/tests/data/test846 b/tests/data/test846 index 49c391ffe9a7..bbbc92c51a09 100644 --- a/tests/data/test846 +++ b/tests/data/test846 @@ -40,11 +40,11 @@ IMAP PREAUTH response # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 SELECT %TESTNUMBER -A003 FETCH 1 BODY[] -A004 LOGOUT + +A001 CAPABILITY +A002 SELECT %TESTNUMBER +A003 FETCH 1 BODY[] +A004 LOGOUT diff --git a/tests/data/test847 b/tests/data/test847 index 6972f45fb129..b78cad118926 100644 --- a/tests/data/test847 +++ b/tests/data/test847 @@ -38,12 +38,12 @@ IMAP FETCH message # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN "\"user" "sec\"ret{" -A003 SELECT %TESTNUMBER -A004 UID FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN "\"user" "sec\"ret{" +A003 SELECT %TESTNUMBER +A004 UID FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test848 b/tests/data/test848 index a0d5a29e7de8..32f589d52588 100644 --- a/tests/data/test848 +++ b/tests/data/test848 @@ -44,13 +44,13 @@ IMAP plain authentication with alternative authorization identity # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 AUTHENTICATE PLAIN -c2hhcmVkLW1haWxib3gAdXNlcgBzZWNyZXQ= -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 AUTHENTICATE PLAIN +c2hhcmVkLW1haWxib3gAdXNlcgBzZWNyZXQ= +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test849 b/tests/data/test849 index e092da3904b0..3e771c2ffd79 100644 --- a/tests/data/test849 +++ b/tests/data/test849 @@ -42,10 +42,10 @@ IMAP plain auth with alt authorization identity (Not authorized) # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "LOGOUT" - -A001 CAPABILITY -A002 AUTHENTICATE PLAIN -dXJzZWwAa3VydAB4aXBqM3BsbXE= + +A001 CAPABILITY +A002 AUTHENTICATE PLAIN +dXJzZWwAa3VydAB4aXBqM3BsbXE= diff --git a/tests/data/test85 b/tests/data/test85 index 2acc87cb0617..ab9c2287db28 100644 --- a/tests/data/test85 +++ b/tests/data/test85 @@ -44,15 +44,15 @@ proxy # # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Proxy-Authorization: Basic %b64[testing:this]b64% -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Proxy-Authorization: Basic %b64[testing:this]b64% +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test850 b/tests/data/test850 index f0a9f17d65d8..c9cf2ffae6c1 100644 --- a/tests/data/test850 +++ b/tests/data/test850 @@ -38,12 +38,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -RETR %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test851 b/tests/data/test851 index 3f24c14b34e3..abecf7daa76d 100644 --- a/tests/data/test851 +++ b/tests/data/test851 @@ -33,12 +33,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -l -u user:secret # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -LIST %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +LIST %TESTNUMBER +QUIT diff --git a/tests/data/test852 b/tests/data/test852 index ed433862bfbe..87e47d67aef2 100644 --- a/tests/data/test852 +++ b/tests/data/test852 @@ -36,12 +36,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -l -u user:secret 8 - -CAPA -USER user -PASS secret -LIST %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +LIST %TESTNUMBER +QUIT diff --git a/tests/data/test853 b/tests/data/test853 index 3b57e7d08690..29c4580452dd 100644 --- a/tests/data/test853 +++ b/tests/data/test853 @@ -42,12 +42,12 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -LIST -QUIT + +CAPA +USER user +PASS secret +LIST +QUIT diff --git a/tests/data/test854 b/tests/data/test854 index acb32b01f387..4491153803cc 100644 --- a/tests/data/test854 +++ b/tests/data/test854 @@ -34,12 +34,12 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -LIST -QUIT + +CAPA +USER user +PASS secret +LIST +QUIT diff --git a/tests/data/test855 b/tests/data/test855 index c7c10be6517b..9e95cad27318 100644 --- a/tests/data/test855 +++ b/tests/data/test855 @@ -36,12 +36,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret 8 - -CAPA -USER user -PASS secret -RETR %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test856 b/tests/data/test856 index c107612deed0..4de4d7270fda 100644 --- a/tests/data/test856 +++ b/tests/data/test856 @@ -39,10 +39,10 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:wrong # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -USER user -PASS wrong + +CAPA +USER user +PASS wrong diff --git a/tests/data/test857 b/tests/data/test857 index 5868a2d57ffd..6d1e7daddcde 100644 --- a/tests/data/test857 +++ b/tests/data/test857 @@ -49,12 +49,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -RETR %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test858 b/tests/data/test858 index f119100ecdaf..0362bb81fe9a 100644 --- a/tests/data/test858 +++ b/tests/data/test858 @@ -30,12 +30,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret -X DELE -I # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -DELE %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +DELE %TESTNUMBER +QUIT diff --git a/tests/data/test859 b/tests/data/test859 index 11ffc068e542..0603d643ea2c 100644 --- a/tests/data/test859 +++ b/tests/data/test859 @@ -30,12 +30,12 @@ pop3://%HOSTIP:%POP3PORT -u user:secret -X STAT -I # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -STAT -QUIT + +CAPA +USER user +PASS secret +STAT +QUIT diff --git a/tests/data/test86 b/tests/data/test86 index ba9c90d7a8f7..a0e562736f0e 100644 --- a/tests/data/test86 +++ b/tests/data/test86 @@ -64,22 +64,22 @@ HTTP, urlglob []-retrieval and -o #[num] usage # # Verify data after the test has been "shot" - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + # we check the second file diff --git a/tests/data/test860 b/tests/data/test860 index 5e1f3f611b27..10e931f7f21b 100644 --- a/tests/data/test860 +++ b/tests/data/test860 @@ -30,12 +30,12 @@ pop3://%HOSTIP:%POP3PORT -u user:secret -X NOOP -I # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -NOOP -QUIT + +CAPA +USER user +PASS secret +NOOP +QUIT diff --git a/tests/data/test861 b/tests/data/test861 index 65b44c1cc0b8..c40d06af1440 100644 --- a/tests/data/test861 +++ b/tests/data/test861 @@ -41,12 +41,12 @@ pop3://%HOSTIP:%POP3PORT -u user:secret -X UIDL # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -UIDL -QUIT + +CAPA +USER user +PASS secret +UIDL +QUIT diff --git a/tests/data/test862 b/tests/data/test862 index ab0feaa4838a..73c50ff061d8 100644 --- a/tests/data/test862 +++ b/tests/data/test862 @@ -39,12 +39,12 @@ pop3://%HOSTIP:%POP3PORT -u user:secret -X 'TOP %TESTNUMBER 0' # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -TOP %TESTNUMBER 0 -QUIT + +CAPA +USER user +PASS secret +TOP %TESTNUMBER 0 +QUIT diff --git a/tests/data/test863 b/tests/data/test863 index f7b288baa607..a246652fd9cf 100644 --- a/tests/data/test863 +++ b/tests/data/test863 @@ -30,12 +30,12 @@ pop3://%HOSTIP:%POP3PORT -u user:secret -X RSET -I # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -RSET -QUIT + +CAPA +USER user +PASS secret +RSET +QUIT diff --git a/tests/data/test864 b/tests/data/test864 index 233764f64ec1..d2ddb8dee9fc 100644 --- a/tests/data/test864 +++ b/tests/data/test864 @@ -45,11 +45,11 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -APOP user 7501b4cdc224d469940e65e7b5e4d6eb -RETR %TESTNUMBER -QUIT + +CAPA +APOP user 7501b4cdc224d469940e65e7b5e4d6eb +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test865 b/tests/data/test865 index 59bf1c154b5b..f88ba45ed423 100644 --- a/tests/data/test865 +++ b/tests/data/test865 @@ -46,12 +46,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH PLAIN -AHVzZXIAc2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH PLAIN +AHVzZXIAc2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test866 b/tests/data/test866 index adab0d896036..2ea66bab3898 100644 --- a/tests/data/test866 +++ b/tests/data/test866 @@ -46,13 +46,13 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH LOGIN -dXNlcg== -c2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH LOGIN +dXNlcg== +c2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test867 b/tests/data/test867 index 76ad1aa57c22..4db0704c6443 100644 --- a/tests/data/test867 +++ b/tests/data/test867 @@ -50,12 +50,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH CRAM-MD5 -dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== -RETR %TESTNUMBER -QUIT + +CAPA +AUTH CRAM-MD5 +dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test868 b/tests/data/test868 index 6807fa56f170..59284154c957 100644 --- a/tests/data/test868 +++ b/tests/data/test868 @@ -52,13 +52,13 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u testuser:testpass # # Verify data after the test has been "shot" - -CAPA -AUTH NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -RETR %TESTNUMBER -QUIT + +CAPA +AUTH NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test869 b/tests/data/test869 index b6f91a266a02..588be6f3a140 100644 --- a/tests/data/test869 +++ b/tests/data/test869 @@ -56,13 +56,13 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH DIGEST-MD5 -dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvMTI3LjAuMC4xIixyZXNwb25zZT0xODMxNTU0OGM3ZjNhMzdlNzE2ZmE4ZTkwZGZhYjliNixxb3A9YXV0aA== - -RETR %TESTNUMBER -QUIT + +CAPA +AUTH DIGEST-MD5 +dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvMTI3LjAuMC4xIixyZXNwb25zZT0xODMxNTU0OGM3ZjNhMzdlNzE2ZmE4ZTkwZGZhYjliNixxb3A9YXV0aA== + +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test870 b/tests/data/test870 index b1329da9aa17..d0870d390981 100644 --- a/tests/data/test870 +++ b/tests/data/test870 @@ -46,12 +46,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user --oauth2-bearer mF_9.B5f-4.1JqM # # Verify data after the test has been "shot" - -CAPA -AUTH XOAUTH2 -dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -RETR %TESTNUMBER -QUIT + +CAPA +AUTH XOAUTH2 +dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test871 b/tests/data/test871 index 38335177d4d5..e0afbee00138 100644 --- a/tests/data/test871 +++ b/tests/data/test871 @@ -46,11 +46,11 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --sasl-ir # # Verify data after the test has been "shot" - -CAPA -AUTH PLAIN AHVzZXIAc2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH PLAIN AHVzZXIAc2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test872 b/tests/data/test872 index f6c5974262fd..439bbf6b148c 100644 --- a/tests/data/test872 +++ b/tests/data/test872 @@ -46,12 +46,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --sasl-ir # # Verify data after the test has been "shot" - -CAPA -AUTH LOGIN dXNlcg== -c2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH LOGIN dXNlcg== +c2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test873 b/tests/data/test873 index 0f5f3be9b138..e6ac4057d648 100644 --- a/tests/data/test873 +++ b/tests/data/test873 @@ -52,12 +52,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u testuser:testpass --sasl-ir # # Verify data after the test has been "shot" - -CAPA -AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -RETR %TESTNUMBER -QUIT + +CAPA +AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test874 b/tests/data/test874 index 810bc49d170b..cbb1fbe137b0 100644 --- a/tests/data/test874 +++ b/tests/data/test874 @@ -46,11 +46,11 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user --oauth2-bearer mF_9.B5f-4.1JqM --s # # Verify data after the test has been "shot" - -CAPA -AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -RETR %TESTNUMBER -QUIT + +CAPA +AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test876 b/tests/data/test876 index 3cbed8b5eeb0..85ea5fe3b19b 100644 --- a/tests/data/test876 +++ b/tests/data/test876 @@ -49,10 +49,10 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -AUTH CRAM-MD5 -* + +CAPA +AUTH CRAM-MD5 +* diff --git a/tests/data/test877 b/tests/data/test877 index e2cb4b376570..8f4ac37be1f4 100644 --- a/tests/data/test877 +++ b/tests/data/test877 @@ -50,11 +50,11 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u testuser:testpass # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -AUTH NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -* + +CAPA +AUTH NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +* diff --git a/tests/data/test878 b/tests/data/test878 index fe578c816f09..a12e96f02ead 100644 --- a/tests/data/test878 +++ b/tests/data/test878 @@ -51,10 +51,10 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -AUTH DIGEST-MD5 -* + +CAPA +AUTH DIGEST-MD5 +* diff --git a/tests/data/test879 b/tests/data/test879 index cdf25d02a143..75aed2ba3d4f 100644 --- a/tests/data/test879 +++ b/tests/data/test879 @@ -54,14 +54,14 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH CRAM-MD5 -* -AUTH PLAIN -AHVzZXIAc2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH CRAM-MD5 +* +AUTH PLAIN +AHVzZXIAc2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test880 b/tests/data/test880 index 21536d81f50b..bb92f7f296bc 100644 --- a/tests/data/test880 +++ b/tests/data/test880 @@ -55,15 +55,15 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -* -AUTH PLAIN -AHVzZXIAc2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +* +AUTH PLAIN +AHVzZXIAc2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test881 b/tests/data/test881 index a197cb1e603d..16caf49a312e 100644 --- a/tests/data/test881 +++ b/tests/data/test881 @@ -56,14 +56,14 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH DIGEST-MD5 -* -AUTH PLAIN -AHVzZXIAc2VjcmV0 -RETR %TESTNUMBER -QUIT + +CAPA +AUTH DIGEST-MD5 +* +AUTH PLAIN +AHVzZXIAc2VjcmV0 +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test882 b/tests/data/test882 index b4fa465340b8..bfecd4507076 100644 --- a/tests/data/test882 +++ b/tests/data/test882 @@ -42,17 +42,17 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER001 -u user.one:secret -: pop3://%HOSTIP:%PO # # Verify data after the test has been "shot" - -CAPA -USER user.one -PASS secret -RETR %TESTNUMBER001 -QUIT -CAPA -USER user.two -PASS secret -RETR %TESTNUMBER002 -QUIT + +CAPA +USER user.one +PASS secret +RETR %TESTNUMBER001 +QUIT +CAPA +USER user.two +PASS secret +RETR %TESTNUMBER002 +QUIT diff --git a/tests/data/test883 b/tests/data/test883 index 943d27824831..a82a762dc6f6 100644 --- a/tests/data/test883 +++ b/tests/data/test883 @@ -46,12 +46,12 @@ POP3 external authentication # # Verify data after the test has been "shot" - -CAPA -AUTH EXTERNAL -dXNlcg== -RETR %TESTNUMBER -QUIT + +CAPA +AUTH EXTERNAL +dXNlcg== +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test884 b/tests/data/test884 index 611649c2d292..ebe013fe27f9 100644 --- a/tests/data/test884 +++ b/tests/data/test884 @@ -46,12 +46,12 @@ POP3 external authentication without credentials # # Verify data after the test has been "shot" - -CAPA -AUTH EXTERNAL -= -RETR %TESTNUMBER -QUIT + +CAPA +AUTH EXTERNAL += +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test885 b/tests/data/test885 index 6d2383874f59..16c6810bcf01 100644 --- a/tests/data/test885 +++ b/tests/data/test885 @@ -46,11 +46,11 @@ POP3 external authentication with initial response # # Verify data after the test has been "shot" - -CAPA -AUTH EXTERNAL dXNlcg== -RETR %TESTNUMBER -QUIT + +CAPA +AUTH EXTERNAL dXNlcg== +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test886 b/tests/data/test886 index e926fe21a133..f6de7c1db11e 100644 --- a/tests/data/test886 +++ b/tests/data/test886 @@ -46,11 +46,11 @@ POP3 external authentication with initial response without credentials # # Verify data after the test has been "shot" - -CAPA -AUTH EXTERNAL = -RETR %TESTNUMBER -QUIT + +CAPA +AUTH EXTERNAL = +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test887 b/tests/data/test887 index ada1ce1a6b00..bb40d1b9ce52 100644 --- a/tests/data/test887 +++ b/tests/data/test887 @@ -47,12 +47,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user --oauth2-bearer mF_9.B5f-4.1JqM # # Verify data after the test has been "shot" - -CAPA -AUTH OAUTHBEARER -%b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -RETR %TESTNUMBER -QUIT + +CAPA +AUTH OAUTHBEARER +%b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test888 b/tests/data/test888 index 289f8137e153..2d89a3cf3b0b 100644 --- a/tests/data/test888 +++ b/tests/data/test888 @@ -47,11 +47,11 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user --oauth2-bearer mF_9.B5f-4.1JqM --s # # Verify data after the test has been "shot" - -CAPA -AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -RETR %TESTNUMBER -QUIT + +CAPA +AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test889 b/tests/data/test889 index 36d0e32d1f5d..c2982dc17de7 100644 --- a/tests/data/test889 +++ b/tests/data/test889 @@ -46,11 +46,11 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user --oauth2-bearer mF_9.B5f-4.1JqM # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -AUTH OAUTHBEARER -%b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -AQ== + +CAPA +AUTH OAUTHBEARER +%b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +AQ== diff --git a/tests/data/test89 b/tests/data/test89 index fb621ae2b951..f1a7a539e22c 100644 --- a/tests/data/test89 +++ b/tests/data/test89 @@ -106,31 +106,31 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -L # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - -GET /you/%TESTNUMBER0010 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /you/%TESTNUMBER0010 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + +GET /you/%TESTNUMBER0010 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /you/%TESTNUMBER0010 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test890 b/tests/data/test890 index 70ac50459732..9107a32e224d 100644 --- a/tests/data/test890 +++ b/tests/data/test890 @@ -46,10 +46,10 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user --oauth2-bearer mF_9.B5f-4.1JqM --s # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -AQ== + +CAPA +AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +AQ== diff --git a/tests/data/test891 b/tests/data/test891 index 6d0242800560..b0de3be183a0 100644 --- a/tests/data/test891 +++ b/tests/data/test891 @@ -35,10 +35,10 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret # # Verify data after the test has been "shot" - -CAPA -AUTH CRAM-MD5 -dXNlciA1YzhkYjAzZjA0Y2VjMGY0M2JjYjA2MDAyMzkxNDE5MA== + +CAPA +AUTH CRAM-MD5 +dXNlciA1YzhkYjAzZjA0Y2VjMGY0M2JjYjA2MDAyMzkxNDE5MA== # CURLE_LOGIN_DENIED diff --git a/tests/data/test892 b/tests/data/test892 index c77b35da8a7a..67f9711568cb 100644 --- a/tests/data/test892 +++ b/tests/data/test892 @@ -46,12 +46,12 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --sasl-authzid shared-mailbo # # Verify data after the test has been "shot" - -CAPA -AUTH PLAIN -c2hhcmVkLW1haWxib3gAdXNlcgBzZWNyZXQ= -RETR %TESTNUMBER -QUIT + +CAPA +AUTH PLAIN +c2hhcmVkLW1haWxib3gAdXNlcgBzZWNyZXQ= +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test893 b/tests/data/test893 index 021b4d52579d..3db486b0d0d8 100644 --- a/tests/data/test893 +++ b/tests/data/test893 @@ -44,10 +44,10 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u kurt:xipj3plmq --sasl-authzid ursel # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -CAPA -AUTH PLAIN -dXJzZWwAa3VydAB4aXBqM3BsbXE= + +CAPA +AUTH PLAIN +dXJzZWwAa3VydAB4aXBqM3BsbXE= diff --git a/tests/data/test895 b/tests/data/test895 index dbf17fdc40db..79f9a9984e9d 100644 --- a/tests/data/test895 +++ b/tests/data/test895 @@ -39,12 +39,12 @@ IMAP with --login-options 'AUTH=*' # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN "\"user" "sec\"ret{" -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN "\"user" "sec\"ret{" +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test897 b/tests/data/test897 index fe7e1e70a007..8e59d75d1486 100644 --- a/tests/data/test897 +++ b/tests/data/test897 @@ -38,12 +38,12 @@ IMAP and envelope meta data after body transfer # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN user secret -A003 SELECT %TESTNUMBER -A004 FETCH 123 BODY[1] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN user secret +A003 SELECT %TESTNUMBER +A004 FETCH 123 BODY[1] +A005 LOGOUT _ _ ____ _ diff --git a/tests/data/test898 b/tests/data/test898 index 4d22862d4a3d..78213414e534 100644 --- a/tests/data/test898 +++ b/tests/data/test898 @@ -74,21 +74,21 @@ HTTP with custom auth and cookies redirected to HTTP on a diff port # # Verify data after the test has been "shot" - -GET http://firsthost.com/ HTTP/1.1 -Host: firsthost.com -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Authorization: Basic %b64[joe:secret]b64% -Cookie: userpwd=am9lOnNlY3JldA== - -GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1 -Host: firsthost.com:9999 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://firsthost.com/ HTTP/1.1 +Host: firsthost.com +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Authorization: Basic %b64[joe:secret]b64% +Cookie: userpwd=am9lOnNlY3JldA== + +GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1 +Host: firsthost.com:9999 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test90 b/tests/data/test90 index b043ce0431b0..98c4073766c0 100644 --- a/tests/data/test90 +++ b/tests/data/test90 @@ -144,41 +144,41 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth -L # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - -GET /you/%TESTNUMBER0010 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /you/%TESTNUMBER0010 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /you/%TESTNUMBER0010 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + +GET /you/%TESTNUMBER0010 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /you/%TESTNUMBER0010 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /you/%TESTNUMBER0010 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test900 b/tests/data/test900 index f3aae4b6310f..14644401b3c5 100644 --- a/tests/data/test900 +++ b/tests/data/test900 @@ -35,12 +35,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT From: different diff --git a/tests/data/test901 b/tests/data/test901 index a97233d87166..043f3fad49ad 100644 --- a/tests/data/test901 +++ b/tests/data/test901 @@ -39,25 +39,25 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - - -.. -.. - -.. - -body -. + +From: different +To: another + + +.. +.. + +.. + +body +. diff --git a/tests/data/test902 b/tests/data/test902 index 961fc7bfbf82..809a15d03f6b 100644 --- a/tests/data/test902 +++ b/tests/data/test902 @@ -38,20 +38,20 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -HELO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +HELO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test903 b/tests/data/test903 index f4d616ec67b0..fb2ff012787a 100644 --- a/tests/data/test903 +++ b/tests/data/test903 @@ -39,18 +39,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH PLAIN -AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH PLAIN +AHVzZXIAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test904 b/tests/data/test904 index b5916ef41974..ee797b1600c5 100644 --- a/tests/data/test904 +++ b/tests/data/test904 @@ -39,19 +39,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH LOGIN -dXNlcg== -c2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH LOGIN +dXNlcg== +c2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test905 b/tests/data/test905 index 9f8d417a44cb..15114e5b5ae8 100644 --- a/tests/data/test905 +++ b/tests/data/test905 @@ -43,18 +43,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH CRAM-MD5 -dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH CRAM-MD5 +dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test906 b/tests/data/test906 index 863dce698c7b..5e3ea35ceb29 100644 --- a/tests/data/test906 +++ b/tests/data/test906 @@ -45,19 +45,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test907 b/tests/data/test907 index 9fddbc0de8e3..3bd4612dd825 100644 --- a/tests/data/test907 +++ b/tests/data/test907 @@ -49,19 +49,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH DIGEST-MD5 -dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJzbXRwLzEyNy4wLjAuMSIscmVzcG9uc2U9YTI3YzQzOTVmMzM4Njc0M2JlMTIyMDdiN2QxMTIxYzUscW9wPWF1dGg= - -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH DIGEST-MD5 +dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJzbXRwLzEyNy4wLjAuMSIscmVzcG9uc2U9YTI3YzQzOTVmMzM4Njc0M2JlMTIyMDdiN2QxMTIxYzUscW9wPWF1dGg= + +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test908 b/tests/data/test908 index 202977a64a1f..d1a1bdbdc72a 100644 --- a/tests/data/test908 +++ b/tests/data/test908 @@ -39,18 +39,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH XOAUTH2 -dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH XOAUTH2 +dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test909 b/tests/data/test909 index e054e49351de..2c543fe1af74 100644 --- a/tests/data/test909 +++ b/tests/data/test909 @@ -33,19 +33,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test91 b/tests/data/test91 index 37d8e4e36c0a..cd15c80e1c41 100644 --- a/tests/data/test91 +++ b/tests/data/test91 @@ -90,24 +90,24 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --anyauth -u mydomain\\myself:secret # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAgACABwAAAABgAGAHgAAAALAAsAfgAAAAAAAAAAAAAAhoIBAMIyJpR5mHpg2FZha5kRaFZ9436GAxPu0C5llxexSQ5QzVkiLSfkcpVyRgCXXqR+Am15ZG9tYWlubXlzZWxmV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAgACABwAAAABgAGAHgAAAALAAsAfgAAAAAAAAAAAAAAhoIBAMIyJpR5mHpg2FZha5kRaFZ9436GAxPu0C5llxexSQ5QzVkiLSfkcpVyRgCXXqR+Am15ZG9tYWlubXlzZWxmV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test910 b/tests/data/test910 index 521318ace546..21a3ef20447e 100644 --- a/tests/data/test910 +++ b/tests/data/test910 @@ -33,19 +33,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test911 b/tests/data/test911 index b0c5d0eb829d..0ee44f2b84cc 100644 --- a/tests/data/test911 +++ b/tests/data/test911 @@ -32,15 +32,15 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -. + +. diff --git a/tests/data/test912 b/tests/data/test912 index 4977a4e82170..b45d603f9d20 100644 --- a/tests/data/test912 +++ b/tests/data/test912 @@ -37,19 +37,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: SIZE=38 -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: SIZE=38 +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test913 b/tests/data/test913 index a0aed0072b2d..81a46ca2bd65 100644 --- a/tests/data/test913 +++ b/tests/data/test913 @@ -41,10 +41,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr 55 - -EHLO %TESTNUMBER -MAIL FROM: SIZE=38 -QUIT + +EHLO %TESTNUMBER +MAIL FROM: SIZE=38 +QUIT diff --git a/tests/data/test914 b/tests/data/test914 index 56ae524b0a3b..2595dbccffe9 100644 --- a/tests/data/test914 +++ b/tests/data/test914 @@ -40,10 +40,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr 55 - -EHLO %TESTNUMBER -MAIL FROM: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +QUIT diff --git a/tests/data/test915 b/tests/data/test915 index 9211c3407997..6b76e62f1339 100644 --- a/tests/data/test915 +++ b/tests/data/test915 @@ -33,19 +33,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com -T - # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM:<> -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM:<> +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test916 b/tests/data/test916 index 677a647fd3ba..138277d580f2 100644 --- a/tests/data/test916 +++ b/tests/data/test916 @@ -37,11 +37,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt invalid --mail-from sender@exam 55 - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +QUIT diff --git a/tests/data/test917 b/tests/data/test917 index d53fbd10c3a3..8607758aa5c0 100644 --- a/tests/data/test917 +++ b/tests/data/test917 @@ -33,23 +33,23 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mai # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test918 b/tests/data/test918 index c49128fa9169..54485cbb20e9 100644 --- a/tests/data/test918 +++ b/tests/data/test918 @@ -37,12 +37,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mai 55 - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +RCPT TO: +QUIT diff --git a/tests/data/test919 b/tests/data/test919 index 833a67c97b50..7448b8a17329 100644 --- a/tests/data/test919 +++ b/tests/data/test919 @@ -39,17 +39,17 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH PLAIN AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH PLAIN AHVzZXIAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test92 b/tests/data/test92 index f6250d196253..341f16b23044 100644 --- a/tests/data/test92 +++ b/tests/data/test92 @@ -10,32 +10,32 @@ Resume # Server-side - -HTTP/1.1 416 Requested Range Not Satisfiable -Date: Fri, 24 Oct 2003 21:33:12 GMT -Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 -Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT -ETag: "ab57a-507-3f9968f3" -Accept-Ranges: bytes -Content-Length: 4 -Content-Range: bytes */87 -Content-Type: image/gif - + +HTTP/1.1 416 Requested Range Not Satisfiable +Date: Fri, 24 Oct 2003 21:33:12 GMT +Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 +Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT +ETag: "ab57a-507-3f9968f3" +Accept-Ranges: bytes +Content-Length: 4 +Content-Range: bytes */87 +Content-Type: image/gif + bad # The body should be ignored. - -HTTP/1.1 416 Requested Range Not Satisfiable -Date: Fri, 24 Oct 2003 21:33:12 GMT -Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 -Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT -ETag: "ab57a-507-3f9968f3" -Accept-Ranges: bytes -Content-Length: 4 -Content-Range: bytes */87 -Content-Type: image/gif - + +HTTP/1.1 416 Requested Range Not Satisfiable +Date: Fri, 24 Oct 2003 21:33:12 GMT +Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 +Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT +ETag: "ab57a-507-3f9968f3" +Accept-Ranges: bytes +Content-Length: 4 +Content-Range: bytes */87 +Content-Type: image/gif + @@ -54,13 +54,13 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -C 87 # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=87- -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=87- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test920 b/tests/data/test920 index ac9af7d7bfb9..1445db2413d7 100644 --- a/tests/data/test920 +++ b/tests/data/test920 @@ -39,18 +39,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH LOGIN dXNlcg== -c2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH LOGIN dXNlcg== +c2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test921 b/tests/data/test921 index 36820ceb74c0..fbf338081e0d 100644 --- a/tests/data/test921 +++ b/tests/data/test921 @@ -45,18 +45,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test922 b/tests/data/test922 index 554c0965a5d6..76d891296f05 100644 --- a/tests/data/test922 +++ b/tests/data/test922 @@ -39,17 +39,17 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test923 b/tests/data/test923 index 19cdd9667e1f..85cc5be4e364 100644 --- a/tests/data/test923 +++ b/tests/data/test923 @@ -28,10 +28,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -VRFY recipient -QUIT + +EHLO %TESTNUMBER +VRFY recipient +QUIT diff --git a/tests/data/test924 b/tests/data/test924 index 3a37a5e3c86e..555425837061 100644 --- a/tests/data/test924 +++ b/tests/data/test924 @@ -34,10 +34,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt smith # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -VRFY smith -QUIT + +EHLO %TESTNUMBER +VRFY smith +QUIT diff --git a/tests/data/test925 b/tests/data/test925 index 073f1e3a9be9..7640230969bc 100644 --- a/tests/data/test925 +++ b/tests/data/test925 @@ -31,10 +31,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt user@example.net # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -VRFY user@example.net -QUIT + +EHLO %TESTNUMBER +VRFY user@example.net +QUIT diff --git a/tests/data/test926 b/tests/data/test926 index 4e9623ceb55c..8b76424a6f02 100644 --- a/tests/data/test926 +++ b/tests/data/test926 @@ -35,10 +35,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient 8 - -EHLO %TESTNUMBER -VRFY recipient -QUIT + +EHLO %TESTNUMBER +VRFY recipient +QUIT diff --git a/tests/data/test927 b/tests/data/test927 index fb86a1940147..f2edc050f98e 100644 --- a/tests/data/test927 +++ b/tests/data/test927 @@ -34,10 +34,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Friends -X EXPN # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -EXPN Friends -QUIT + +EHLO %TESTNUMBER +EXPN Friends +QUIT diff --git a/tests/data/test928 b/tests/data/test928 index 4c5ab9eafb5b..33ae7b7d00cb 100644 --- a/tests/data/test928 +++ b/tests/data/test928 @@ -32,10 +32,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -HELP -QUIT + +EHLO %TESTNUMBER +HELP +QUIT diff --git a/tests/data/test929 b/tests/data/test929 index 1274921f9bf3..956f5fc9b493 100644 --- a/tests/data/test929 +++ b/tests/data/test929 @@ -29,10 +29,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER -X NOOP -I # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -NOOP -QUIT + +EHLO %TESTNUMBER +NOOP +QUIT diff --git a/tests/data/test93 b/tests/data/test93 index 83d2b6102259..1d6cdcc95b9c 100644 --- a/tests/data/test93 +++ b/tests/data/test93 @@ -39,13 +39,13 @@ proxy # # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test930 b/tests/data/test930 index 94a92577617b..628777526dd2 100644 --- a/tests/data/test930 +++ b/tests/data/test930 @@ -29,10 +29,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER -X RSET -I # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -RSET -QUIT + +EHLO %TESTNUMBER +RSET +QUIT diff --git a/tests/data/test932 b/tests/data/test932 index e2c9b29a8bc1..2ea2b0910fe1 100644 --- a/tests/data/test932 +++ b/tests/data/test932 @@ -48,10 +48,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -EHLO %TESTNUMBER -AUTH CRAM-MD5 -* + +EHLO %TESTNUMBER +AUTH CRAM-MD5 +* diff --git a/tests/data/test933 b/tests/data/test933 index 3c25ffa5cafa..3c3a5c6be6ee 100644 --- a/tests/data/test933 +++ b/tests/data/test933 @@ -49,11 +49,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -EHLO %TESTNUMBER -AUTH NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -* + +EHLO %TESTNUMBER +AUTH NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +* diff --git a/tests/data/test934 b/tests/data/test934 index 891232e5b807..3f74a625e326 100644 --- a/tests/data/test934 +++ b/tests/data/test934 @@ -50,10 +50,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -EHLO %TESTNUMBER -AUTH DIGEST-MD5 -* + +EHLO %TESTNUMBER +AUTH DIGEST-MD5 +* diff --git a/tests/data/test935 b/tests/data/test935 index 57a4c36ca52a..dd13a6294bac 100644 --- a/tests/data/test935 +++ b/tests/data/test935 @@ -47,20 +47,20 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH CRAM-MD5 -* -AUTH PLAIN -AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH CRAM-MD5 +* +AUTH PLAIN +AHVzZXIAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test936 b/tests/data/test936 index 723cebca37bb..f829b25e9bfb 100644 --- a/tests/data/test936 +++ b/tests/data/test936 @@ -48,21 +48,21 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH NTLM -TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -* -AUTH PLAIN -AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH NTLM +TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +* +AUTH PLAIN +AHVzZXIAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test937 b/tests/data/test937 index ddd2037e8468..8a3bfcd4b6fb 100644 --- a/tests/data/test937 +++ b/tests/data/test937 @@ -49,20 +49,20 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH DIGEST-MD5 -* -AUTH PLAIN -AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH DIGEST-MD5 +* +AUTH PLAIN +AHVzZXIAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test938 b/tests/data/test938 index 475572b070c3..af1d4c834a25 100644 --- a/tests/data/test938 +++ b/tests/data/test938 @@ -41,25 +41,25 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER001 --mail-rcpt recipient@example.com --mail # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER001 -AUTH PLAIN -dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT -EHLO %TESTNUMBER002 -AUTH PLAIN -dXNlci50d28AdXNlci50d28Ac2VjcmV0 -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER001 +AUTH PLAIN +dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT +EHLO %TESTNUMBER002 +AUTH PLAIN +dXNlci50d28AdXNlci50d28Ac2VjcmV0 +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test939 b/tests/data/test939 index e1424d2ddbf4..d0e284574fc6 100644 --- a/tests/data/test939 +++ b/tests/data/test939 @@ -34,17 +34,17 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -HELO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +HELO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test94 b/tests/data/test94 index eb745d1df4c7..4840bd1f4287 100644 --- a/tests/data/test94 +++ b/tests/data/test94 @@ -45,12 +45,12 @@ https://test.anything.really.com:%TESTNUMBER --proxy1.0 %HOSTIP:%HTTPPORT 56 - -CONNECT test.anything.really.com:%TESTNUMBER HTTP/1.0 -Host: test.anything.really.com:%TESTNUMBER -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.anything.really.com:%TESTNUMBER HTTP/1.0 +Host: test.anything.really.com:%TESTNUMBER +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test940 b/tests/data/test940 index afc9da0c9374..eb9d4a6fb9b2 100644 --- a/tests/data/test940 +++ b/tests/data/test940 @@ -30,16 +30,16 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test941 b/tests/data/test941 index 7b7669fdd90f..36544e43c835 100644 --- a/tests/data/test941 +++ b/tests/data/test941 @@ -42,27 +42,27 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -email -headers and body -with Unix newlines -meant to be -converted -with -the ---crlf option -%repeat[650 x 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 %0a]% -. + +From: different +To: another + +email +headers and body +with Unix newlines +meant to be +converted +with +the +--crlf option +%repeat[650 x 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789%0d%0a]% +. diff --git a/tests/data/test942 b/tests/data/test942 index 2286c20e6fbf..ba9b9a19eb2c 100644 --- a/tests/data/test942 +++ b/tests/data/test942 @@ -39,18 +39,18 @@ mail body # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH EXTERNAL -dXNlcg== -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH EXTERNAL +dXNlcg== +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test943 b/tests/data/test943 index 80e935fede63..426beae6e648 100644 --- a/tests/data/test943 +++ b/tests/data/test943 @@ -39,18 +39,18 @@ mail body # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH EXTERNAL -= -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH EXTERNAL += +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test944 b/tests/data/test944 index 0dfaefb7169e..f87fb3b3e46a 100644 --- a/tests/data/test944 +++ b/tests/data/test944 @@ -39,17 +39,17 @@ mail body # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH EXTERNAL dXNlcg== -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH EXTERNAL dXNlcg== +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test945 b/tests/data/test945 index 5b6412764443..239c3270d31c 100644 --- a/tests/data/test945 +++ b/tests/data/test945 @@ -39,17 +39,17 @@ mail body # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH EXTERNAL = -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH EXTERNAL = +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test946 b/tests/data/test946 index b306180aaaca..6c1765bec405 100644 --- a/tests/data/test946 +++ b/tests/data/test946 @@ -40,18 +40,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH OAUTHBEARER -%b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH OAUTHBEARER +%b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test947 b/tests/data/test947 index 5ca2be671462..c7e4c2503757 100644 --- a/tests/data/test947 +++ b/tests/data/test947 @@ -40,17 +40,17 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test948 b/tests/data/test948 index 9b6aefdc63cc..c072b3a25c0e 100644 --- a/tests/data/test948 +++ b/tests/data/test948 @@ -48,11 +48,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -EHLO %TESTNUMBER -AUTH OAUTHBEARER -%b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -AQ== + +EHLO %TESTNUMBER +AUTH OAUTHBEARER +%b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +AQ== diff --git a/tests/data/test949 b/tests/data/test949 index 0a6be43b375f..24fdaa4e2a67 100644 --- a/tests/data/test949 +++ b/tests/data/test949 @@ -48,10 +48,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -EHLO %TESTNUMBER -AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -AQ== + +EHLO %TESTNUMBER +AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +AQ== diff --git a/tests/data/test950 b/tests/data/test950 index 6628f0043438..670cf8f7e526 100644 --- a/tests/data/test950 +++ b/tests/data/test950 @@ -34,10 +34,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient --request "vrfy" # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -vrfy recipient -QUIT + +EHLO %TESTNUMBER +vrfy recipient +QUIT diff --git a/tests/data/test951 b/tests/data/test951 index 2b9315047188..c703d3d6adc6 100644 --- a/tests/data/test951 +++ b/tests/data/test951 @@ -30,16 +30,16 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -..This first line starts with a dot -. + +..This first line starts with a dot +. diff --git a/tests/data/test952 b/tests/data/test952 index 716310df65dc..e78cd3569a71 100644 --- a/tests/data/test952 +++ b/tests/data/test952 @@ -30,16 +30,16 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -.. -. + +.. +. diff --git a/tests/data/test953 b/tests/data/test953 index f293f896e8cf..e5a1ad8d7920 100644 --- a/tests/data/test953 +++ b/tests/data/test953 @@ -39,18 +39,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH PLAIN -dXJzZWwAa3VydAB4aXBqM3BsbXE= -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH PLAIN +dXJzZWwAa3VydAB4aXBqM3BsbXE= +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test954 b/tests/data/test954 index b8376669ce59..58292372f3ce 100644 --- a/tests/data/test954 +++ b/tests/data/test954 @@ -46,10 +46,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # The multi interface considers a broken "CONNECT" as a prematurely broken # transfer and such a connection will not get a "QUIT" - -EHLO %TESTNUMBER -AUTH PLAIN -dXJzZWwAa3VydAB4aXBqM3BsbXE= + +EHLO %TESTNUMBER +AUTH PLAIN +dXJzZWwAa3VydAB4aXBqM3BsbXE= diff --git a/tests/data/test955 b/tests/data/test955 index 633c2e369d35..adb5558bc6c5 100644 --- a/tests/data/test955 +++ b/tests/data/test955 @@ -47,10 +47,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr 55 - -EHLO %TESTNUMBER -MAIL FROM: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +QUIT diff --git a/tests/data/test956 b/tests/data/test956 index 9472e96e1596..fb78275a91c3 100644 --- a/tests/data/test956 +++ b/tests/data/test956 @@ -44,11 +44,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt St%hex[%c3%b6]hex%dmottagaren@e 55 - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +QUIT diff --git a/tests/data/test957 b/tests/data/test957 index 671d73bbf218..1656416c8a9c 100644 --- a/tests/data/test957 +++ b/tests/data/test957 @@ -39,10 +39,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Anv%hex[%c3%a4]hex%ndaren 8 - -EHLO %TESTNUMBER -VRFY Anv%hex[%c3%a4]hex%ndaren -QUIT + +EHLO %TESTNUMBER +VRFY Anv%hex[%c3%a4]hex%ndaren +QUIT diff --git a/tests/data/test958 b/tests/data/test958 index 203254bfc2d2..4809f6bf2541 100644 --- a/tests/data/test958 +++ b/tests/data/test958 @@ -39,10 +39,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Anv%hex[%c3%a4]hex%ndaren@examp 8 - -EHLO %TESTNUMBER -VRFY Anv%hex[%c3%a4]hex%ndaren@example.com -QUIT + +EHLO %TESTNUMBER +VRFY Anv%hex[%c3%a4]hex%ndaren@example.com +QUIT diff --git a/tests/data/test959 b/tests/data/test959 index 5693e349449e..07736ff0a91c 100644 --- a/tests/data/test959 +++ b/tests/data/test959 @@ -48,10 +48,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr 55 - -EHLO %TESTNUMBER -MAIL FROM: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +QUIT diff --git a/tests/data/test960 b/tests/data/test960 index ced2ba0b54f5..52013ac5cf36 100644 --- a/tests/data/test960 +++ b/tests/data/test960 @@ -45,11 +45,11 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@%hex[%c3%a5%c3%a4%c3% 55 - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +QUIT diff --git a/tests/data/test961 b/tests/data/test961 index c52d5df34450..a78059450cc3 100644 --- a/tests/data/test961 +++ b/tests/data/test961 @@ -40,10 +40,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt user@%hex[%c3%a5%c3%a4%c3%b6]he 8 - -EHLO %TESTNUMBER -VRFY user@%hex[%c3%a5%c3%a4%c3%b6]hex%.se -QUIT + +EHLO %TESTNUMBER +VRFY user@%hex[%c3%a5%c3%a4%c3%b6]hex%.se +QUIT diff --git a/tests/data/test962 b/tests/data/test962 index 3f737b65ea8d..4625b01138e0 100644 --- a/tests/data/test962 +++ b/tests/data/test962 @@ -42,19 +42,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test963 b/tests/data/test963 index bce626c5e30e..06245f608054 100644 --- a/tests/data/test963 +++ b/tests/data/test963 @@ -42,19 +42,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@%hex[%c3%a5%c3%a4%c3% # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test964 b/tests/data/test964 index 04e5b1c15235..bf802faa0c51 100644 --- a/tests/data/test964 +++ b/tests/data/test964 @@ -37,10 +37,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt user@%hex[%c3%a5%c3%a4%c3%b6]he # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -VRFY user@xn--4cab6c.se -QUIT + +EHLO %TESTNUMBER +VRFY user@xn--4cab6c.se +QUIT diff --git a/tests/data/test965 b/tests/data/test965 index 601db62fe09a..0bf35b8357ab 100644 --- a/tests/data/test965 +++ b/tests/data/test965 @@ -45,19 +45,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: SMTPUTF8 -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: SMTPUTF8 +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test966 b/tests/data/test966 index 646e80758979..3a12b8bf967d 100644 --- a/tests/data/test966 +++ b/tests/data/test966 @@ -45,19 +45,19 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt St%hex[%c3%b6]hex%dmottagaren@% # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: SMTPUTF8 -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: SMTPUTF8 +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test967 b/tests/data/test967 index 7cacbcbdd200..b067e9684baa 100644 --- a/tests/data/test967 +++ b/tests/data/test967 @@ -43,10 +43,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Anv%hex[%c3%a4]hex%ndaren@%hex[ # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -VRFY Anv%hex[%c3%a4]hex%ndaren@xn--4cab6c.se SMTPUTF8 -QUIT + +EHLO %TESTNUMBER +VRFY Anv%hex[%c3%a4]hex%ndaren@xn--4cab6c.se SMTPUTF8 +QUIT diff --git a/tests/data/test968 b/tests/data/test968 index 4df600483be6..2ec5f76e9539 100644 --- a/tests/data/test968 +++ b/tests/data/test968 @@ -40,10 +40,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Anv%hex[%c3%a4]hex%ndaren # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -VRFY Anv%hex[%c3%a4]hex%ndaren SMTPUTF8 -QUIT + +EHLO %TESTNUMBER +VRFY Anv%hex[%c3%a4]hex%ndaren SMTPUTF8 +QUIT diff --git a/tests/data/test969 b/tests/data/test969 index c7bffb9b8f4b..00311d5f19b2 100644 --- a/tests/data/test969 +++ b/tests/data/test969 @@ -14,10 +14,10 @@ IDN CAPA SMTPUTF8 - -250-Joe Smith -250-Harry Smith -250 Melvin Smith + +250-Joe Smith +250-Harry Smith +250 Melvin Smith @@ -42,10 +42,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Friends -X EXPN # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -EXPN Friends SMTPUTF8 -QUIT + +EHLO %TESTNUMBER +EXPN Friends SMTPUTF8 +QUIT diff --git a/tests/data/test973 b/tests/data/test973 index edf2973ebeff..64e3702f2085 100644 --- a/tests/data/test973 +++ b/tests/data/test973 @@ -66,23 +66,23 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -L -u joe:secret # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[joe:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 -QUIT + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[joe:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER0002 +RETR %TESTNUMBER0002 +QUIT diff --git a/tests/data/test974 b/tests/data/test974 index d62933df56e7..04575181a3f9 100644 --- a/tests/data/test974 +++ b/tests/data/test974 @@ -72,20 +72,20 @@ HTTP with auth redirected to HTTP on a diff port w/o auth # # Verify data after the test has been "shot" - -GET http://firsthost.com/ HTTP/1.1 -Host: firsthost.com -Authorization: Basic %b64[joe:secret]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1 -Host: firsthost.com:9999 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://firsthost.com/ HTTP/1.1 +Host: firsthost.com +Authorization: Basic %b64[joe:secret]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1 +Host: firsthost.com:9999 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test975 b/tests/data/test975 index 971e35d34014..b29b2a929d9c 100644 --- a/tests/data/test975 +++ b/tests/data/test975 @@ -66,23 +66,23 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --location-trusted -u joe:secret # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[joe:secret]b64% -User-Agent: curl/%VERSION -Accept: */* - -USER joe -PASS secret -PWD -CWD a -CWD path -EPSV -TYPE I -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 -QUIT + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[joe:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + +USER joe +PASS secret +PWD +CWD a +CWD path +EPSV +TYPE I +SIZE %TESTNUMBER0002 +RETR %TESTNUMBER0002 +QUIT diff --git a/tests/data/test976 b/tests/data/test976 index 264444a56ee9..8150a90736e7 100644 --- a/tests/data/test976 +++ b/tests/data/test976 @@ -72,21 +72,21 @@ HTTP with auth redirected to HTTP on a diff port --location-trusted # # Verify data after the test has been "shot" - -GET http://firsthost.com/ HTTP/1.1 -Host: firsthost.com -Authorization: Basic %b64[joe:secret]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1 -Host: firsthost.com:9999 -Authorization: Basic %b64[joe:secret]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://firsthost.com/ HTTP/1.1 +Host: firsthost.com +Authorization: Basic %b64[joe:secret]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1 +Host: firsthost.com:9999 +Authorization: Basic %b64[joe:secret]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test980 b/tests/data/test980 index 8a52559472ba..9f35730ac2be 100644 --- a/tests/data/test980 +++ b/tests/data/test980 @@ -44,9 +44,9 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr 8 - -EHLO %TESTNUMBER -STARTTLS + +EHLO %TESTNUMBER +STARTTLS diff --git a/tests/data/test981 b/tests/data/test981 index 02a03fd2f95d..94de9dfbea47 100644 --- a/tests/data/test981 +++ b/tests/data/test981 @@ -51,9 +51,9 @@ Hello Joe, do you think we can meet at 3:30 tomorrow? 8 - -A001 CAPABILITY -A002 STARTTLS + +A001 CAPABILITY +A002 STARTTLS diff --git a/tests/data/test982 b/tests/data/test982 index 2f5eccc0a4af..6098b7255aa5 100644 --- a/tests/data/test982 +++ b/tests/data/test982 @@ -49,9 +49,9 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --ssl 8 - -CAPA -STLS + +CAPA +STLS diff --git a/tests/data/test983 b/tests/data/test983 index a4294495d062..7a05471a19ec 100644 --- a/tests/data/test983 +++ b/tests/data/test983 @@ -45,8 +45,8 @@ works 8 - -AUTH SSL + +AUTH SSL diff --git a/tests/data/test984 b/tests/data/test984 index 314a24e6cb5a..e79efdf84b97 100644 --- a/tests/data/test984 +++ b/tests/data/test984 @@ -49,8 +49,8 @@ Hello Joe, do you think we can meet at 3:30 tomorrow? 64 - -A001 CAPABILITY + +A001 CAPABILITY diff --git a/tests/data/test987 b/tests/data/test987 index c58ae77e1382..4a0a08b4296c 100644 --- a/tests/data/test987 +++ b/tests/data/test987 @@ -34,19 +34,19 @@ body # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +MAIL FROM: +RCPT TO: +DATA +QUIT - -From: different -To: another - -body -. + +From: different +To: another + +body +. diff --git a/tests/data/test988 b/tests/data/test988 index 46b09fff94d6..06ba311084b1 100644 --- a/tests/data/test988 +++ b/tests/data/test988 @@ -9,14 +9,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely @@ -37,12 +37,12 @@ IMAPS FETCH with redundant explicit SSL request # # Verify data after the test has been "shot" - -A001 CAPABILITY -A002 LOGIN "\"user" "sec\"ret{" -A003 SELECT %TESTNUMBER -A004 FETCH 1 BODY[] -A005 LOGOUT + +A001 CAPABILITY +A002 LOGIN "\"user" "sec\"ret{" +A003 SELECT %TESTNUMBER +A004 FETCH 1 BODY[] +A005 LOGOUT diff --git a/tests/data/test989 b/tests/data/test989 index c7bf2494604f..dad0291dfd8b 100644 --- a/tests/data/test989 +++ b/tests/data/test989 @@ -37,12 +37,12 @@ POP3S RETR with redundant explicit SSL request # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -RETR %TESTNUMBER -QUIT + +CAPA +USER user +PASS secret +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test99 b/tests/data/test99 index b0e769a7e31e..e9e887df2f53 100644 --- a/tests/data/test99 +++ b/tests/data/test99 @@ -55,13 +55,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 9999999999 33 - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=9999999999- -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=9999999999- +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test992 b/tests/data/test992 index a4b24376f393..2a5d15181edb 100644 --- a/tests/data/test992 +++ b/tests/data/test992 @@ -37,18 +37,18 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr # # Verify data after the test has been "shot" - -EHLO %TESTNUMBER -AUTH XOAUTH2 -dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -MAIL FROM: -RCPT TO: -DATA -QUIT + +EHLO %TESTNUMBER +AUTH XOAUTH2 +dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +MAIL FROM: +RCPT TO: +DATA +QUIT - -mail body -. + +mail body +. diff --git a/tests/data/test993 b/tests/data/test993 index 2f5607b67935..e0f0b9ebcfc4 100644 --- a/tests/data/test993 +++ b/tests/data/test993 @@ -31,12 +31,12 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -LIST -QUIT + +CAPA +USER user +PASS secret +LIST +QUIT Allocations: 2200 diff --git a/tests/data/test997 b/tests/data/test997 index 2883330f85c2..b17cde4d4d2a 100644 --- a/tests/data/test997 +++ b/tests/data/test997 @@ -12,11 +12,11 @@ RFC2449 # # Server-side - -CAPA TOP USER - - - + +CAPA TOP USER + + + # @@ -36,12 +36,12 @@ pop3://%HOSTIP:%POP3PORT -u user:secret -X 'STAT' # # Verify data after the test has been "shot" - -CAPA -USER user -PASS secret -STAT -QUIT + +CAPA +USER user +PASS secret +STAT +QUIT diff --git a/tests/data/test998 b/tests/data/test998 index efb03cac4c70..88d3cb55eaa9 100644 --- a/tests/data/test998 +++ b/tests/data/test998 @@ -69,21 +69,21 @@ HTTP with auth in URL redirected to another host # # Verify data after the test has been "shot" - -GET http://somewhere.example/998 HTTP/1.1 -Host: somewhere.example -Authorization: Basic %b64[alberto:einstein]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://somewhere.else.example/a/path/9980002 HTTP/1.1 -Host: somewhere.else.example -Authorization: Basic %b64[alberto:einstein]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://somewhere.example/998 HTTP/1.1 +Host: somewhere.example +Authorization: Basic %b64[alberto:einstein]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://somewhere.else.example/a/path/9980002 HTTP/1.1 +Host: somewhere.else.example +Authorization: Basic %b64[alberto:einstein]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test999 b/tests/data/test999 index c0dc52328def..cee697e3a29b 100644 --- a/tests/data/test999 +++ b/tests/data/test999 @@ -59,20 +59,20 @@ HTTP with auth in first URL but not second # # Verify data after the test has been "shot" - -GET http://somewhere.example/%TESTNUMBER HTTP/1.1 -Host: somewhere.example -Authorization: Basic %b64[alberto:einstein]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://somewhere.else.example/%TESTNUMBER HTTP/1.1 -Host: somewhere.else.example -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://somewhere.example/%TESTNUMBER HTTP/1.1 +Host: somewhere.example +Authorization: Basic %b64[alberto:einstein]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://somewhere.else.example/%TESTNUMBER HTTP/1.1 +Host: somewhere.else.example +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + From 2147de554d3408c6c563dd33f7b70d88fb728a9c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 30 Oct 2025 19:24:13 +0100 Subject: [PATCH 178/885] test429: use `%repeat[]%` Follow-up to eb22e37060a8f3ad4fd9511db136c1edbb3b2a85 #19281 Follow-up to 55d4767876eae8678ab069082aa7fe8fe316a021 #19279 Closes #19296 --- tests/data/test429 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/data/test429 b/tests/data/test429 index 4091d1be0d77..8dd75be04f86 100644 --- a/tests/data/test429 +++ b/tests/data/test429 @@ -33,13 +33,13 @@ Funny-head: yesyes http -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF=contents2023 +%repeat[129 x F]%=contents2023 Expand environment variable in config file - too long name ---expand-data {{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}} +--expand-data {{%repeat[129 x F]%}} http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd @@ -57,7 +57,7 @@ Accept: */* Content-Length: 133 Content-Type: application/x-www-form-urlencoded -{{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}} +{{%repeat[129 x F]%}} From 26e3f004696e59ec9021858da78cb26194cf264e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 14:35:32 +0100 Subject: [PATCH 179/885] test446, 1034, 1160: set US-ASCII encoding in XML header To match the ASCII-7 requirement for curl test data files. Follow-up to 9243ed59b387a90940fa4a16ebfd99ad7d6c2f63 #17329 Follow-up to 87ba80a6df1dfd7ceaaa52352c9f23afff0ed513 Closes #19297 --- tests/data/test1034 | 2 +- tests/data/test1160 | 2 +- tests/data/test446 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/data/test1034 b/tests/data/test1034 index 2dab1ab44110..b99368fb9fa0 100644 --- a/tests/data/test1034 +++ b/tests/data/test1034 @@ -1,4 +1,4 @@ - + diff --git a/tests/data/test1160 b/tests/data/test1160 index b5b55a4d29ab..eb0dad216e09 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -1,4 +1,4 @@ - + diff --git a/tests/data/test446 b/tests/data/test446 index 7f98912560a8..be7bad0e965b 100644 --- a/tests/data/test446 +++ b/tests/data/test446 @@ -1,4 +1,4 @@ - + From 1e85cb4b7b88c2b2a21ff425eee071128106b085 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 31 Oct 2025 13:46:18 +0100 Subject: [PATCH 180/885] scp/sftp: fix disconnect When a SCP/SFTP connection calls the protocol handler disconnect, it required the connections *and* the easy handles SSH meta data to be present. When the disconnect is called with an admin handle, the easy meta data is not present, which prevented the shutdown to run. The easy meta data is however not necessary to run the shutdown state machine. Calling it with a NULL `sshp` is fine. To avoid any mixups, check `sshp` in state operations that need it. Fixes #19293 Reported-by: And-yW on github Closes #19295 --- lib/vssh/libssh.c | 61 +++++++++++++++++------- lib/vssh/libssh2.c | 113 ++++++++++++++++++++++++++++++--------------- 2 files changed, 120 insertions(+), 54 deletions(-) diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index df466dac4c76..af3767ca7109 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1979,13 +1979,15 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, rc = myssh_in_SFTP_REALPATH(data, sshc); break; case SSH_SFTP_QUOTE_INIT: - rc = myssh_in_SFTP_QUOTE_INIT(data, sshc, sshp); + rc = sshp ? myssh_in_SFTP_QUOTE_INIT(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_POSTQUOTE_INIT: rc = myssh_in_SFTP_POSTQUOTE_INIT(data, sshc); break; case SSH_SFTP_QUOTE: - rc = myssh_in_SFTP_QUOTE(data, sshc, sshp); + rc = sshp ? myssh_in_SFTP_QUOTE(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_NEXT_QUOTE: rc = myssh_in_SFTP_NEXT_QUOTE(data, sshc); @@ -2115,7 +2117,10 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, case SSH_SFTP_FILETIME: { sftp_attributes attrs; - + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } attrs = sftp_stat(sshc->sftp_session, sshp->path); if(attrs) { data->info.filetime = attrs->mtime; @@ -2129,20 +2134,27 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, case SSH_SFTP_TRANS_INIT: if(data->state.upload) myssh_to(data, sshc, SSH_SFTP_UPLOAD_INIT); - else { + else if(sshp) { if(sshp->path[strlen(sshp->path)-1] == '/') myssh_to(data, sshc, SSH_SFTP_READDIR_INIT); else myssh_to(data, sshc, SSH_SFTP_DOWNLOAD_INIT); } + else + result = CURLE_FAILED_INIT; break; case SSH_SFTP_UPLOAD_INIT: - rc = myssh_in_UPLOAD_INIT(data, sshc, sshp); + rc = sshp ? myssh_in_UPLOAD_INIT(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_CREATE_DIRS_INIT: - if(strlen(sshp->path) > 1) { + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } + else if(strlen(sshp->path) > 1) { sshc->slash_pos = sshp->path + 1; /* ignore the leading '/' */ myssh_to(data, sshc, SSH_SFTP_CREATE_DIRS); } @@ -2153,7 +2165,11 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, case SSH_SFTP_CREATE_DIRS: sshc->slash_pos = strchr(sshc->slash_pos, '/'); - if(sshc->slash_pos) { + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } + else if(sshc->slash_pos) { *sshc->slash_pos = 0; infof(data, "Creating directory '%s'", sshp->path); @@ -2165,6 +2181,10 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, case SSH_SFTP_CREATE_DIRS_MKDIR: /* 'mode' - parameter is preliminary - default to 0644 */ + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } rc = sftp_mkdir(sshc->sftp_session, sshp->path, (mode_t)data->set.new_directory_perms); *sshc->slash_pos = '/'; @@ -2188,10 +2208,12 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, break; case SSH_SFTP_READDIR_INIT: - rc = myssh_in_SFTP_READDIR_INIT(data, sshc, sshp); + rc = sshp ? myssh_in_SFTP_READDIR_INIT(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_READDIR: - rc = myssh_in_SFTP_READDIR(data, sshc, sshp); + rc = sshp ? myssh_in_SFTP_READDIR(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_READDIR_LINK: rc = myssh_in_SFTP_READDIR_LINK(data, sshc); @@ -2203,19 +2225,25 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, rc = myssh_in_SFTP_READDIR_DONE(data, sshc); break; case SSH_SFTP_DOWNLOAD_INIT: - rc = myssh_in_SFTP_DOWNLOAD_INIT(data, sshc, sshp); + rc = sshp ? myssh_in_SFTP_DOWNLOAD_INIT(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_DOWNLOAD_STAT: rc = myssh_in_SFTP_DOWNLOAD_STAT(data, sshc); break; case SSH_SFTP_CLOSE: - rc = myssh_in_SFTP_CLOSE(data, sshc, sshp); + rc = sshp ? myssh_in_SFTP_CLOSE(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_SHUTDOWN: rc = myssh_in_SFTP_SHUTDOWN(data, sshc); break; case SSH_SCP_TRANS_INIT: + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } result = Curl_getworkingpath(data, sshc->homedir, &sshp->path); if(result) { sshc->actualcode = result; @@ -2252,7 +2280,10 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, break; case SSH_SCP_UPLOAD_INIT: - + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } rc = ssh_scp_init(sshc->scp_session); if(rc != SSH_OK) { err_msg = ssh_get_error(sshc->ssh_session); @@ -2832,11 +2863,9 @@ static CURLcode scp_disconnect(struct Curl_easy *data, struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); (void)dead_connection; - if(sshc && sshc->ssh_session && sshp) { + if(sshc && sshc->ssh_session) { /* only if there is a session still around to use! */ - myssh_to(data, sshc, SSH_SESSION_DISCONNECT); - result = myssh_block_statemach(data, sshc, sshp, TRUE); } @@ -3012,7 +3041,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, DEBUGF(infof(data, "SSH DISCONNECT starts now")); - if(sshc && sshc->ssh_session && sshp) { + if(sshc && sshc->ssh_session) { /* only if there is a session still around to use! */ myssh_to(data, sshc, SSH_SFTP_SHUTDOWN); result = myssh_block_statemach(data, sshc, sshp, TRUE); diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 18e3cdb1d560..5990da25bf41 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -826,7 +826,7 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data, char *errmsg = NULL; int errlen; libssh2_session_last_error(sshc->ssh_session, &errmsg, &errlen, 0); - failf(data, "libssh2: %s", errmsg); + failf(data, "libssh2 method '%s' failed: %s", hostkey_method, errmsg); result = libssh2_session_error_to_CURLE(rc); } } @@ -2721,11 +2721,13 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_REALPATH: - result = ssh_state_sftp_realpath(data, sshc, sshp); + result = sshp ? ssh_state_sftp_realpath(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_QUOTE_INIT: - result = ssh_state_sftp_quote_init(data, sshc, sshp); + result = sshp ? ssh_state_sftp_quote_init(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_POSTQUOTE_INIT: @@ -2733,7 +2735,8 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_QUOTE: - result = ssh_state_sftp_quote(data, sshc, sshp); + result = sshp ? ssh_state_sftp_quote(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_NEXT_QUOTE: @@ -2741,11 +2744,13 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_QUOTE_STAT: - result = ssh_state_sftp_quote_stat(data, sshc, sshp, block); + result = sshp ? ssh_state_sftp_quote_stat(data, sshc, sshp, block) : + CURLE_FAILED_INIT; break; case SSH_SFTP_QUOTE_SETSTAT: - result = ssh_state_sftp_quote_setstat(data, sshc, sshp); + result = sshp ? ssh_state_sftp_quote_setstat(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_QUOTE_SYMLINK: @@ -2784,10 +2789,15 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, case SSH_SFTP_FILETIME: { LIBSSH2_SFTP_ATTRIBUTES attrs; + int rc; - int rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, - curlx_uztoui(strlen(sshp->path)), - LIBSSH2_SFTP_STAT, &attrs); + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } + rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, + curlx_uztoui(strlen(sshp->path)), + LIBSSH2_SFTP_STAT, &attrs); if(rc == LIBSSH2_ERROR_EAGAIN) { result = CURLE_AGAIN; break; @@ -2803,16 +2813,19 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, case SSH_SFTP_TRANS_INIT: if(data->state.upload) myssh_state(data, sshc, SSH_SFTP_UPLOAD_INIT); - else { + else if(sshp) { if(sshp->path[strlen(sshp->path)-1] == '/') myssh_state(data, sshc, SSH_SFTP_READDIR_INIT); else myssh_state(data, sshc, SSH_SFTP_DOWNLOAD_INIT); } + else + result = CURLE_FAILED_INIT; break; case SSH_SFTP_UPLOAD_INIT: - result = sftp_upload_init(data, sshc, sshp, block); + result = sshp ? sftp_upload_init(data, sshc, sshp, block) : + CURLE_FAILED_INIT; if(result) { myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; @@ -2820,7 +2833,9 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_CREATE_DIRS_INIT: - if(strlen(sshp->path) > 1) { + if(!sshp) + result = CURLE_FAILED_INIT; + else if(strlen(sshp->path) > 1) { sshc->slash_pos = sshp->path + 1; /* ignore the leading '/' */ myssh_state(data, sshc, SSH_SFTP_CREATE_DIRS); } @@ -2830,6 +2845,10 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_CREATE_DIRS: + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } sshc->slash_pos = strchr(sshc->slash_pos, '/'); if(sshc->slash_pos) { *sshc->slash_pos = 0; @@ -2842,25 +2861,33 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_CREATE_DIRS_MKDIR: - result = ssh_state_sftp_create_dirs_mkdir(data, sshc, sshp); + result = sshp ? ssh_state_sftp_create_dirs_mkdir(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_READDIR_INIT: - result = ssh_state_sftp_readdir_init(data, sshc, sshp); + result = sshp ? ssh_state_sftp_readdir_init(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_READDIR: - result = sftp_readdir(data, sshc, sshp, block); + result = sshp ? sftp_readdir(data, sshc, sshp, block) : + CURLE_FAILED_INIT; if(result) { myssh_state(data, sshc, SSH_SFTP_CLOSE); } break; case SSH_SFTP_READDIR_LINK: - result = ssh_state_sftp_readdir_link(data, sshc, sshp); + result = sshp ? ssh_state_sftp_readdir_link(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_READDIR_BOTTOM: + if(!sshp) { + result = CURLE_FAILED_INIT; + break; + } result = curlx_dyn_addn(&sshp->readdir, "\n", 1); if(!result) result = Curl_client_write(data, CLIENTWRITE_BODY, @@ -2890,11 +2917,13 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_DOWNLOAD_INIT: - result = ssh_state_sftp_download_init(data, sshc, sshp); + result = sshp ? ssh_state_sftp_download_init(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_DOWNLOAD_STAT: - result = sftp_download_stat(data, sshc, sshp, block); + result = sshp ? sftp_download_stat(data, sshc, sshp, block) : + CURLE_FAILED_INIT; if(result) { myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; @@ -2902,7 +2931,8 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SFTP_CLOSE: - result = ssh_state_sftp_close(data, sshc, sshp); + result = sshp ? ssh_state_sftp_close(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SFTP_SHUTDOWN: @@ -2910,7 +2940,8 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SCP_TRANS_INIT: - result = Curl_getworkingpath(data, sshc->homedir, &sshp->path); + result = sshp ? Curl_getworkingpath(data, sshc->homedir, &sshp->path) : + CURLE_FAILED_INIT; if(result) { myssh_state(data, sshc, SSH_STOP); break; @@ -2931,11 +2962,13 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, break; case SSH_SCP_UPLOAD_INIT: - result = ssh_state_scp_upload_init(data, sshc, sshp); + result = sshp ? ssh_state_scp_upload_init(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SCP_DOWNLOAD_INIT: - result = ssh_state_scp_download_init(data, sshc, sshp); + result = sshp ? ssh_state_scp_download_init(data, sshc, sshp) : + CURLE_FAILED_INIT; break; case SSH_SCP_DONE: @@ -3559,9 +3592,6 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, if(sshc->ssh_agent) { rc = libssh2_agent_disconnect(sshc->ssh_agent); - if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) - return CURLE_AGAIN; - if((rc < 0) && data) { char *err_msg = NULL; (void)libssh2_session_last_error(sshc->ssh_session, @@ -3569,6 +3599,9 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, infof(data, "Failed to disconnect from libssh2 agent: %d %s", rc, err_msg); } + if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) + return CURLE_AGAIN; + libssh2_agent_free(sshc->ssh_agent); sshc->ssh_agent = NULL; @@ -3580,23 +3613,20 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, if(sshc->sftp_handle) { rc = libssh2_sftp_close(sshc->sftp_handle); - if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) - return CURLE_AGAIN; - if((rc < 0) && data) { char *err_msg = NULL; (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to close libssh2 file: %d %s", rc, err_msg); } + if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) + return CURLE_AGAIN; + sshc->sftp_handle = NULL; } if(sshc->ssh_channel) { rc = libssh2_channel_free(sshc->ssh_channel); - if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) - return CURLE_AGAIN; - if((rc < 0) && data) { char *err_msg = NULL; (void)libssh2_session_last_error(sshc->ssh_session, @@ -3604,30 +3634,37 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, infof(data, "Failed to free libssh2 scp subsystem: %d %s", rc, err_msg); } + if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) + return CURLE_AGAIN; + sshc->ssh_channel = NULL; } if(sshc->sftp_session) { rc = libssh2_sftp_shutdown(sshc->sftp_session); + if((rc < 0) && data) { + char *err_msg = NULL; + (void)libssh2_session_last_error(sshc->ssh_session, + &err_msg, NULL, 0); + infof(data, "Failed to stop libssh2 sftp subsystem: %d %s", rc, err_msg); + } if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) return CURLE_AGAIN; - if((rc < 0) && data) - infof(data, "Failed to stop libssh2 sftp subsystem"); sshc->sftp_session = NULL; } if(sshc->ssh_session) { rc = libssh2_session_free(sshc->ssh_session); - if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) - return CURLE_AGAIN; - if((rc < 0) && data) { char *err_msg = NULL; (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to free libssh2 session: %d %s", rc, err_msg); } + if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) + return CURLE_AGAIN; + sshc->ssh_session = NULL; } @@ -3661,7 +3698,7 @@ static CURLcode scp_disconnect(struct Curl_easy *data, struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); (void)dead_connection; - if(sshc && sshc->ssh_session && sshp) { + if(sshc && sshc->ssh_session) { /* only if there is a session still around to use! */ myssh_state(data, sshc, SSH_SESSION_DISCONNECT); result = ssh_block_statemach(data, sshc, sshp, TRUE); @@ -3834,7 +3871,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, (void)dead_connection; if(sshc) { - if(sshc->ssh_session && sshp) { + if(sshc->ssh_session) { /* only if there is a session still around to use! */ DEBUGF(infof(data, "SSH DISCONNECT starts now")); myssh_state(data, sshc, SSH_SFTP_SHUTDOWN); From c887a3f2f265b90e326efe140ff97dcd7280e180 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 25 Oct 2025 11:06:40 +0200 Subject: [PATCH 181/885] BINDINGS.md: point flaky URL to archive.org To avoid linkcheck CI fails. It was failing regularly in the last months. --- docs/BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/BINDINGS.md b/docs/BINDINGS.md index a72482cf8dfd..61652fc34f0d 100644 --- a/docs/BINDINGS.md +++ b/docs/BINDINGS.md @@ -100,7 +100,7 @@ Bailiff and Bálint Szilakszi, [PostgreSQL](https://github.com/RekGRpth/pg_curl) - cURL client for PostgreSQL -[PureBasic](https://www.purebasic.com/documentation/http/index.html) uses libcurl in its "native" HTTP subsystem +[PureBasic](https://web.archive.org/web/20250325015028/www.purebasic.com/documentation/http/index.html) uses libcurl in its "native" HTTP subsystem [Python](http://pycurl.io/) PycURL by Kjetil Jacobsen From 031322385310560ff5143078e9ddd4b434b358ca Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 31 Oct 2025 16:28:13 +0100 Subject: [PATCH 182/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 58 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 792ef742c682..c740a650296f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3531 + Contributors: 3533 This release includes the following changes: @@ -82,6 +82,7 @@ This release includes the following bugfixes: o cmdline-opts/_PROGRESS.md: explain the suffixes [154] o configure: add "-mt" for pthread support on HP-UX [52] o conn: fix hostname move on connection reuse [272] + o conncache: prevent integer overflow in maxconnects calculation [438] o connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply [404] o connect: remove redundant condition in shutdown start [289] o cookie: avoid saving a cookie file if no transfer was done [11] @@ -118,6 +119,7 @@ This release includes the following bugfixes: o easy_getinfo: check magic, Curl_close safety [3] o ECH.md: make OpenSSL branch clone instructions work [430] o examples/chkspeed: portable printing when outputting curl_off_t values [365] + o examples/http2-serverpush: fix file handle leaks [428] o examples/sessioninfo: cast printf string mask length to int [232] o examples/sessioninfo: do not disable security [255] o examples/synctime: fix null termination assumptions [297] @@ -128,6 +130,7 @@ This release includes the following bugfixes: o examples: check more errors, fix cleanups, scope variables [318] o examples: drop unused curl/mprintf.h includes [224] o examples: fix build issues in 'complicated' examples [243] + o examples: fix more potential resource leaks, and more [426] o examples: fix two build issues surfaced with WinCE [223] o examples: fix two issues found by CodeQL [35] o examples: fix two more cases of stat() TOCTOU [147] @@ -161,6 +164,8 @@ This release includes the following bugfixes: o http2: cleanup pushed newhandle on fail [260] o http2: ingress handling edge cases [259] o HTTP3: clarify the status for "old" OpenSSL, not current [394] + o http: fix `-Wunreachable-code` in !websockets !unity builds [443] + o http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds [442] o http: handle user-defined connection headers [165] o http: look for trailing 'type=' in ftp:// without strstr [315] o http: make Content-Length parser more WHATWG [183] @@ -168,6 +173,7 @@ This release includes the following bugfixes: o http: return error for a second Location: header [393] o http_proxy: fix adding custom proxy headers [424] o httpsrr: free old pointers when storing new [57] + o imap: fix custom FETCH commands to handle literal responses [441] o imap: parse and use UIDVALIDITY as a number [420] o imap: treat capabilities case insensitively [345] o INSTALL-CMAKE.md: add manual configuration examples [360] @@ -252,9 +258,11 @@ This release includes the following bugfixes: o ngtcp2: fix early return [131] o ngtcp2: fix handling of blocked stream data [236] o ngtcp2: fix returns when TLS verify failed [251] + o ngtcp2: overwrite rate-limits defaults [444] o noproxy: fix the IPV6 network mask pattern match [166] o NTLM: disable if DES support missing from OpenSSL or mbedTLS [399] o ntlm: improved error path on bad incoming NTLM TYPE3 message [412] + o openldap/ldap; check for binary attribute case insensitively [445] o openldap: avoid indexing the result at -1 for blank responses [44] o openldap: check ber_sockbuf_add_io() return code [163] o openldap: check ldap_get_option() return codes [119] @@ -283,6 +291,7 @@ This release includes the following bugfixes: o OS400: fix a use-after-free/double-free case [142] o osslq: set idle timeout to 0 [237] o pingpong: remove two old leftover debug infof() calls + o pop3: check for CAPA responses case insensitively [439] o pop3: fix CAPA response termination detection [427] o pop3: function could get the ->transfer field wrong [292] o pytest: skip specific tests for no-verbose builds [171] @@ -311,6 +320,7 @@ This release includes the following bugfixes: o schannel_verify: do not call infof with an appended \n [371] o schannel_verify: fix mem-leak in Curl_verify_host [208] o schannel_verify: use more human friendly error messages [96] + o scp/sftp: fix disconnect [350] o scripts: pass -- before passing xargs [349] o setopt: accept *_SSL_VERIFYHOST set to 2L [31] o setopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1 [257] @@ -343,6 +353,7 @@ This release includes the following bugfixes: o socks_sspi: use the correct free function [331] o socksd: remove --bindonly mention, there is no such option [305] o src/var: remove dead code [369] + o ssl-session-cache: check use on config and availability [448] o ssl-sessions.md: mark option experimental [12] o strerror: drop workaround for SalfordC win32 header bug [214] o sws: fix checking sscanf() return value [17] @@ -357,6 +368,7 @@ This release includes the following bugfixes: o telnet: return error on crazy TTYPE or XDISPLOC lengths [123] o telnet: send failure logged but not returned [175] o telnet: use pointer[0] for "unknown" option instead of pointer[i] [217] + o test1100: fix missing `` section [432] o tests/server: drop pointless memory allocation overrides [219] o tests/server: drop unsafe open() override in signal handler (Windows) [151] o tftp: check and act on tftp_set_timeouts() returning error [38] @@ -396,6 +408,7 @@ This release includes the following bugfixes: o tool_operate: improve wording in retry message [37] o tool_operate: keep failed partial download for retry auto-resume [210] o tool_operate: keep the progress meter for --out-null [33] + o tool_operate: move the checks that skip ca cert detection [449] o tool_operate: retry on HTTP response codes 522 and 524 [317] o tool_operate: return error on strdup() failure [336] o tool_paramhlp: remove outdated comment in str2tls_max() [367] @@ -461,21 +474,23 @@ This release would not have looked like this without help, code, reports and advice from friends like these: Adam Light, Alexander Blach, Alice Lee Poetics, Andrei Kurushin, - Andrew Kirillov, Andrew Olsen, BobodevMm on github, Christian Schmitz, - curl.stunt430, Dalei, Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, - dependabot[bot], divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, - Ethan Everett, Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, - Howard Chu, Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, - Jicea, jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, + Andrew Kirillov, Andrew Olsen, And-yW on github, BobodevMm on github, BohwaZ, + Christian Schmitz, curl.stunt430, Dalei, Dan Fandrich, Daniel Stenberg, + Daniel Terhorst-North, dependabot[bot], divinity76 on github, + Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, + Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, Howard Chu, + Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, Jicea, + jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, Jonathan Cardoso Machado, Joseph Birr-Pixton, Joshua Rogers, - kapsiR on github, kuchara on github, madoe on github, Marcel Raad, - Michael Osipov, Michał Petryka, Mitchell Blank Jr, Mohamed Daahir, - Nir Azkiel, Patrick Monnerat, Pavel P, plv1313 on github, Pocs Norbert, - Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, Samuel Dionne-Riel, - Samuel Henrique, Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, - TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, Viktor Szakatas, - Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 - (65 contributors) + kapsiR on github, kuchara on github, madoe on github, Marc Aldorasi, + Marcel Raad, Michael Osipov, Michał Petryka, Mitchell Blank Jr, + Mohamed Daahir, Nir Azkiel, Patrick Monnerat, Pavel P, plv1313 on github, + Pocs Norbert, Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, + Samuel Dionne-Riel, Samuel Henrique, Stanislav Fort, Stefan Eissing, + Tatsuhiro Tsujikawa, TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, + Viktor Szakatas, Viktor Szakats, WangDaLei on github, Xiaoke Wang, + Yedaya Katsman, 包布丁 + (68 contributors) References to bug reports and discussions on issues: @@ -828,6 +843,7 @@ References to bug reports and discussions on issues: [347] = https://issues.oss-fuzz.com/issues/432441303 [348] = https://curl.se/bug/?i=19086 [349] = https://curl.se/bug/?i=19076 + [350] = https://curl.se/bug/?i=19293 [351] = https://curl.se/bug/?i=19141 [352] = https://curl.se/bug/?i=19265 [353] = https://curl.se/bug/?i=19073 @@ -900,6 +916,18 @@ References to bug reports and discussions on issues: [423] = https://curl.se/bug/?i=19185 [424] = https://curl.se/bug/?i=19227 [425] = https://curl.se/bug/?i=19247 + [426] = https://curl.se/bug/?i=19292 [427] = https://curl.se/bug/?i=19228 + [428] = https://curl.se/bug/?i=19291 [429] = https://curl.se/bug/?i=19167 [430] = https://curl.se/bug/?i=19237 + [432] = https://curl.se/bug/?i=19288 + [438] = https://curl.se/bug/?i=19271 + [439] = https://curl.se/bug/?i=19278 + [441] = https://curl.se/bug/?i=18847 + [442] = https://curl.se/bug/?i=19276 + [443] = https://curl.se/bug/?i=19275 + [444] = https://curl.se/bug/?i=19274 + [445] = https://curl.se/bug/?i=19240 + [448] = https://curl.se/bug/?i=18983 + [449] = https://curl.se/bug/?i=19148 From 928363f28ca533d743adcb70597c3e30917c6cbd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 31 Oct 2025 14:42:30 +0100 Subject: [PATCH 183/885] examples: consistent variable naming across examples - 'CURL *' handles are called 'curl' - 'CURLM *' handles are called 'multi' - write callbacks are called 'write_cb' - read callbacs are called 'read_cb' - CURLcode variables are called 'res' It makes the examples look and feel more consistent. It allows for easier copy and pasting between examples. Closes #19299 --- docs/examples/10-at-a-time.c | 42 ++++++------ docs/examples/anyauthput.c | 4 +- docs/examples/cacertinmem.c | 54 +++++++-------- docs/examples/certinfo.c | 4 +- docs/examples/chkspeed.c | 28 ++++---- docs/examples/crawler.c | 90 ++++++++++++------------- docs/examples/debug.c | 4 +- docs/examples/ephiperfifo.c | 56 ++++++++------- docs/examples/evhiperfifo.c | 54 +++++++-------- docs/examples/externalsocket.c | 4 +- docs/examples/ftp-delete.c | 4 +- docs/examples/ftp-wildcard.c | 30 ++++----- docs/examples/ftpget.c | 4 +- docs/examples/ftpsget.c | 4 +- docs/examples/ftpupload.c | 4 +- docs/examples/ftpuploadfrommem.c | 4 +- docs/examples/ftpuploadresume.c | 71 ++++++++++--------- docs/examples/getinmemory.c | 20 +++--- docs/examples/ghiper.c | 56 +++++++-------- docs/examples/hiperfifo.c | 52 +++++++------- docs/examples/hsts-preload.c | 8 +-- docs/examples/htmltitle.cpp | 44 ++++++------ docs/examples/http2-download.c | 52 +++++++------- docs/examples/http2-pushinmemory.c | 34 +++++----- docs/examples/http2-serverpush.c | 62 ++++++++--------- docs/examples/http2-upload.c | 66 +++++++++--------- docs/examples/httpput.c | 4 +- docs/examples/imap-append.c | 4 +- docs/examples/imap-multi.c | 16 ++--- docs/examples/log_failed_transfers.c | 8 +-- docs/examples/multi-app.c | 32 ++++----- docs/examples/multi-debugcallback.c | 32 ++++----- docs/examples/multi-double.c | 41 ++++++----- docs/examples/multi-event.c | 50 +++++++------- docs/examples/multi-formadd.c | 14 ++-- docs/examples/multi-legacy.c | 34 +++++----- docs/examples/multi-post.c | 14 ++-- docs/examples/multi-single.c | 26 +++---- docs/examples/multi-uv.c | 28 ++++---- docs/examples/pop3-multi.c | 16 ++--- docs/examples/post-callback.c | 4 +- docs/examples/postinmemory.c | 4 +- docs/examples/sepheaders.c | 26 +++---- docs/examples/sessioninfo.c | 4 +- docs/examples/sftpget.c | 4 +- docs/examples/sftpuploadresume.c | 48 ++++++------- docs/examples/shared-connection-cache.c | 8 +-- docs/examples/smooth-gtk-thread.c | 4 +- docs/examples/smtp-authzid.c | 4 +- docs/examples/smtp-mail.c | 4 +- docs/examples/smtp-multi.c | 20 +++--- docs/examples/smtp-ssl.c | 4 +- docs/examples/smtp-tls.c | 4 +- docs/examples/synctime.c | 4 +- docs/examples/url2file.c | 22 +++--- docs/examples/usercertinmem.c | 40 +++++------ docs/examples/websocket-cb.c | 8 +-- docs/examples/websocket-updown.c | 38 +++++------ docs/examples/xmlstream.c | 18 ++--- 59 files changed, 716 insertions(+), 726 deletions(-) diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index ec385926711b..bddcd1563740 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -91,68 +91,68 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp) return n * l; } -static void add_transfer(CURLM *cm, unsigned int i, int *left) +static void add_transfer(CURLM *multi, unsigned int i, int *left) { - CURL *eh = curl_easy_init(); - if(eh) { - curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(eh, CURLOPT_URL, urls[i]); - curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]); - curl_multi_add_handle(cm, eh); + CURL *curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_URL, urls[i]); + curl_easy_setopt(curl, CURLOPT_PRIVATE, urls[i]); + curl_multi_add_handle(multi, curl); } (*left)++; } int main(void) { - CURLM *cm; + CURLM *multi; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - cm = curl_multi_init(); - if(cm) { + multi = curl_multi_init(); + if(multi) { CURLMsg *msg; unsigned int transfers = 0; int msgs_left = -1; int left = 0; /* Limit the amount of simultaneous connections curl should allow: */ - curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX_PARALLEL); + curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, (long)MAX_PARALLEL); for(transfers = 0; transfers < MAX_PARALLEL && transfers < NUM_URLS; transfers++) - add_transfer(cm, transfers, &left); + add_transfer(multi, transfers, &left); do { int still_alive = 1; - curl_multi_perform(cm, &still_alive); + curl_multi_perform(multi, &still_alive); /* !checksrc! disable EQUALSNULL 1 */ - while((msg = curl_multi_info_read(cm, &msgs_left)) != NULL) { + while((msg = curl_multi_info_read(multi, &msgs_left)) != NULL) { if(msg->msg == CURLMSG_DONE) { char *url; - CURL *e = msg->easy_handle; - curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &url); + CURL *curl = msg->easy_handle; + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &url); fprintf(stderr, "R: %d - %s <%s>\n", msg->data.result, curl_easy_strerror(msg->data.result), url); - curl_multi_remove_handle(cm, e); - curl_easy_cleanup(e); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); left--; } else { fprintf(stderr, "E: CURLMsg (%d)\n", msg->msg); } if(transfers < NUM_URLS) - add_transfer(cm, transfers++, &left); + add_transfer(multi, transfers++, &left); } if(left) - curl_multi_wait(cm, NULL, 0, 1000, NULL); + curl_multi_wait(multi, NULL, 0, 1000, NULL); } while(left); - curl_multi_cleanup(cm); + curl_multi_cleanup(multi); } curl_global_cleanup(); diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 8718ac98bbed..c905b8b45977 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -69,7 +69,7 @@ static int my_seek(void *userp, curl_off_t offset, int origin) } /* read callback function, fread() look alike */ -static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { size_t nread; @@ -124,7 +124,7 @@ int main(int argc, char **argv) curl = curl_easy_init(); if(curl) { /* we want to use our own read function */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, (void *) fp); diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c index 5855d872b658..15b11a3b6129 100644 --- a/docs/examples/cacertinmem.c +++ b/docs/examples/cacertinmem.c @@ -48,7 +48,7 @@ typedef size_t ossl_valsize_t; typedef int ossl_valsize_t; #endif -static size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr, size, nmemb, (FILE *)stream); return nmemb * size; @@ -115,37 +115,37 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) int main(void) { - CURL *ch; + CURL *curl; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - ch = curl_easy_init(); - if(ch) { - curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L); - curl_easy_setopt(ch, CURLOPT_HEADER, 0L); - curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L); - curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, writefunction); - curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout); - curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, writefunction); - curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr); - curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM"); - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L); - curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); + curl_easy_setopt(curl, CURLOPT_HEADER, 0L); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, stderr); + curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); /* Turn off the default CA locations, otherwise libcurl loads CA * certificates from the locations that were detected/specified at * build-time */ - curl_easy_setopt(ch, CURLOPT_CAINFO, NULL); - curl_easy_setopt(ch, CURLOPT_CAPATH, NULL); + curl_easy_setopt(curl, CURLOPT_CAINFO, NULL); + curl_easy_setopt(curl, CURLOPT_CAPATH, NULL); /* first try: retrieve page without ca certificates -> should fail * unless libcurl was built --with-ca-fallback enabled at build-time */ - res = curl_easy_perform(ch); + res = curl_easy_perform(curl); if(res == CURLE_OK) printf("*** transfer succeeded ***\n"); else @@ -155,24 +155,24 @@ int main(void) * performance of multiple transfers but it is necessary order to * demonstrate this example. recall that the ssl ctx callback is only * called _before_ an SSL connection is established, therefore it does not - * affect existing verified SSL connections already in the connection cache - * associated with this handle. normally you would set the ssl ctx function - * before making any transfers, and not use this option. + * affect existing verified SSL connections already in the connection + * cache associated with this handle. normally you would set the ssl ctx + * function before making any transfers, and not use this option. */ - curl_easy_setopt(ch, CURLOPT_FRESH_CONNECT, 1L); + curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1L); - /* second try: retrieve page using cacerts' certificate -> succeeds to load - * the certificate by installing a function doing the necessary + /* second try: retrieve page using cacerts' certificate -> succeeds to + * load the certificate by installing a function doing the necessary * "modifications" to the SSL CONTEXT just before link init */ - curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, sslctx_function); - res = curl_easy_perform(ch); + curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctx_function); + res = curl_easy_perform(curl); if(res == CURLE_OK) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); - curl_easy_cleanup(ch); + curl_easy_cleanup(curl); } curl_global_cleanup(); return (int)res; diff --git a/docs/examples/certinfo.c b/docs/examples/certinfo.c index 0443aa42f46c..3176d0a1fcfc 100644 --- a/docs/examples/certinfo.c +++ b/docs/examples/certinfo.c @@ -29,7 +29,7 @@ #include -static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { (void)stream; (void)ptr; @@ -49,7 +49,7 @@ int main(void) if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index 6cb1304c8703..ea71e6ad70a9 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -52,7 +52,7 @@ #define CHKSPEED_VERSION "1.0" -static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { /* we are not interested in the downloaded bytes itself, so we only return the size we would have saved ... */ @@ -63,7 +63,7 @@ static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data) int main(int argc, char *argv[]) { - CURL *curl_handle; + CURL *curl; CURLcode res; int prtall = 0, prtsep = 0, prttime = 0; const char *url = URL_1M; @@ -161,33 +161,33 @@ int main(int argc, char *argv[]) return (int)res; /* init the curl session */ - curl_handle = curl_easy_init(); - if(curl_handle) { + curl = curl_easy_init(); + if(curl) { /* specify URL to get */ - curl_easy_setopt(curl_handle, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_URL, url); /* send all data to this function */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* some servers do not like requests that are made without a user-agent field, so we provide one */ - curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-speedchecker/" CHKSPEED_VERSION); /* get it! */ - res = curl_easy_perform(curl_handle); + res = curl_easy_perform(curl); if(CURLE_OK == res) { curl_off_t val; /* check for bytes downloaded */ - res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD_T, &val); + res = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &val); if((CURLE_OK == res) && (val > 0)) printf("Data downloaded: %" CURL_FORMAT_CURL_OFF_T " bytes.\n", val); /* check for total download time */ - res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME_T, &val); + res = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &val); if((CURLE_OK == res) && (val > 0)) printf("Total download time: %" CURL_FORMAT_CURL_OFF_T ".%06" CURL_FORMAT_CURL_OFF_T " sec.\n", @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) val % 1000000); /* check for average download speed */ - res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD_T, &val); + res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &val); if((CURLE_OK == res) && (val > 0)) printf("Average download speed: " "%" CURL_FORMAT_CURL_OFF_T " kbyte/sec.\n", @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) if(prtall) { /* check for name resolution time */ - res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME_T, &val); + res = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T, &val); if((CURLE_OK == res) && (val > 0)) printf("Name lookup time: %" CURL_FORMAT_CURL_OFF_T ".%06" CURL_FORMAT_CURL_OFF_T " sec.\n", @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) val % 1000000); /* check for connect time */ - res = curl_easy_getinfo(curl_handle, CURLINFO_CONNECT_TIME_T, &val); + res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &val); if((CURLE_OK == res) && (val > 0)) printf("Connect time: %" CURL_FORMAT_CURL_OFF_T ".%06" CURL_FORMAT_CURL_OFF_T " sec.\n", @@ -225,7 +225,7 @@ int main(int argc, char *argv[]) } /* cleanup curl stuff */ - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); } /* we are done with libcurl, so clean it up */ diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index e8dbf244f91e..c56ad5ab3c8e 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -60,7 +60,7 @@ struct memory { size_t size; }; -static size_t grow_buffer(void *contents, size_t sz, size_t nmemb, void *ctx) +static size_t write_cb(void *contents, size_t sz, size_t nmemb, void *ctx) { size_t realsize = sz * nmemb; struct memory *mem = (struct memory*) ctx; @@ -78,48 +78,48 @@ static size_t grow_buffer(void *contents, size_t sz, size_t nmemb, void *ctx) static CURL *make_handle(const char *url) { - CURL *handle = curl_easy_init(); + CURL *curl = curl_easy_init(); struct memory *mem; /* Important: use HTTP2 over HTTPS */ - curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); - curl_easy_setopt(handle, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); + curl_easy_setopt(curl, CURLOPT_URL, url); /* buffer body */ mem = malloc(sizeof(*mem)); mem->size = 0; mem->buf = malloc(1); - curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, grow_buffer); - curl_easy_setopt(handle, CURLOPT_WRITEDATA, mem); - curl_easy_setopt(handle, CURLOPT_PRIVATE, mem); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, mem); + curl_easy_setopt(curl, CURLOPT_PRIVATE, mem); /* For completeness */ - curl_easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, ""); - curl_easy_setopt(handle, CURLOPT_TIMEOUT, 5L); - curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* only allow redirects to HTTP and HTTPS URLs */ - curl_easy_setopt(handle, CURLOPT_REDIR_PROTOCOLS_STR, "http,https"); - curl_easy_setopt(handle, CURLOPT_AUTOREFERER, 1L); - curl_easy_setopt(handle, CURLOPT_MAXREDIRS, 10L); + curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https"); + curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L); + curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 10L); /* each transfer needs to be done within 20 seconds! */ - curl_easy_setopt(handle, CURLOPT_TIMEOUT_MS, 20000L); + curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 20000L); /* connect fast or fail */ - curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT_MS, 2000L); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, 2000L); /* skip files larger than a gigabyte */ - curl_easy_setopt(handle, CURLOPT_MAXFILESIZE_LARGE, + curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, (curl_off_t)1024*1024*1024); - curl_easy_setopt(handle, CURLOPT_COOKIEFILE, ""); - curl_easy_setopt(handle, CURLOPT_FILETIME, 1L); - curl_easy_setopt(handle, CURLOPT_USERAGENT, "mini crawler"); - curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); - curl_easy_setopt(handle, CURLOPT_UNRESTRICTED_AUTH, 1L); - curl_easy_setopt(handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY); - curl_easy_setopt(handle, CURLOPT_EXPECT_100_TIMEOUT_MS, 0L); - return handle; + curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); + curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "mini crawler"); + curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L); + curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY); + curl_easy_setopt(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, 0L); + return curl; } /* HREF finder implemented in libxml2 but could be any HTML parser */ -static size_t follow_links(CURLM *multi_handle, struct memory *mem, +static size_t follow_links(CURLM *multi, struct memory *mem, const char *url) { int opts = HTML_PARSE_NOBLANKS | HTML_PARSE_NOERROR | \ @@ -160,7 +160,7 @@ static size_t follow_links(CURLM *multi_handle, struct memory *mem, if(!link || strlen(link) < 20) continue; if(!strncmp(link, "http://", 7) || !strncmp(link, "https://", 8)) { - curl_multi_add_handle(multi_handle, make_handle(link)); + curl_multi_add_handle(multi, make_handle(link)); if(count++ == max_link_per_page) break; } @@ -177,7 +177,7 @@ static int is_html(char *ctype) int main(void) { - CURLM *multi_handle; + CURLM *multi; int msgs_left; int pending; int complete; @@ -190,18 +190,18 @@ int main(void) signal(SIGINT, sighandler); LIBXML_TEST_VERSION - multi_handle = curl_multi_init(); - if(multi_handle) { - curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, max_con); - curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 6L); + multi = curl_multi_init(); + if(multi) { + curl_multi_setopt(multi, CURLMOPT_MAX_TOTAL_CONNECTIONS, max_con); + curl_multi_setopt(multi, CURLMOPT_MAX_HOST_CONNECTIONS, 6L); /* enables http/2 if available */ #ifdef CURLPIPE_MULTIPLEX - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); #endif /* sets html start page */ - curl_multi_add_handle(multi_handle, make_handle(start_page)); + curl_multi_add_handle(multi, make_handle(start_page)); pending = 0; complete = 0; @@ -210,29 +210,29 @@ int main(void) int numfds; CURLMsg *m; - curl_multi_wait(multi_handle, NULL, 0, 1000, &numfds); - curl_multi_perform(multi_handle, &still_running); + curl_multi_wait(multi, NULL, 0, 1000, &numfds); + curl_multi_perform(multi, &still_running); /* See how the transfers went */ m = NULL; - while((m = curl_multi_info_read(multi_handle, &msgs_left))) { + while((m = curl_multi_info_read(multi, &msgs_left))) { if(m->msg == CURLMSG_DONE) { - CURL *handle = m->easy_handle; + CURL *curl = m->easy_handle; char *url; struct memory *mem; - curl_easy_getinfo(handle, CURLINFO_PRIVATE, &mem); - curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url); + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &mem); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url); if(m->data.result == CURLE_OK) { long res_status; - curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &res_status); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &res_status); if(res_status == 200) { char *ctype; - curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &ctype); + curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ctype); printf("[%d] HTTP 200 (%s): %s\n", complete, ctype, url); if(is_html(ctype) && mem->size > 100) { if(pending < max_requests && (complete + pending) < max_total) { - pending += follow_links(multi_handle, mem, url); + pending += follow_links(multi_curl, mem, url); still_running = 1; } } @@ -244,8 +244,8 @@ int main(void) else { printf("[%d] Connection failure: %s\n", complete, url); } - curl_multi_remove_handle(multi_handle, handle); - curl_easy_cleanup(handle); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); free(mem->buf); free(mem); complete++; @@ -253,7 +253,7 @@ int main(void) } } } - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } curl_global_cleanup(); return 0; diff --git a/docs/examples/debug.c b/docs/examples/debug.c index 3c8355df05cf..ff522b0ce1ec 100644 --- a/docs/examples/debug.c +++ b/docs/examples/debug.c @@ -81,12 +81,12 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr, fflush(stream); } -static int my_trace(CURL *handle, curl_infotype type, +static int my_trace(CURL *curl, curl_infotype type, char *data, size_t size, void *userp) { struct data *config = (struct data *)userp; const char *text; - (void)handle; + (void)curl; switch(type) { case CURLINFO_TEXT: diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index c22a3601010e..026967f3eca5 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -90,7 +90,7 @@ struct GlobalInfo { /* Information associated with a specific easy handle */ struct ConnInfo { - CURL *easy; + CURL *curl; char *url; struct GlobalInfo *global; char error[CURL_ERROR_SIZE]; @@ -99,7 +99,7 @@ struct ConnInfo { /* Information associated with a specific socket */ struct SockInfo { curl_socket_t sockfd; - CURL *easy; + CURL *curl; int action; long timeout; struct GlobalInfo *global; @@ -172,20 +172,18 @@ static void check_multi_info(struct GlobalInfo *g) CURLMsg *msg; int msgs_left; struct ConnInfo *conn; - CURL *easy; - CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while((msg = curl_multi_info_read(g->multi, &msgs_left))) { if(msg->msg == CURLMSG_DONE) { - easy = msg->easy_handle; - res = msg->data.result; - curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); - curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); + CURL *curl = msg->easy_handle; + CURLcode res = msg->data.result; + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &conn); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &eff_url); fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error); - curl_multi_remove_handle(g->multi, easy); + curl_multi_remove_handle(g->multi, curl); free(conn->url); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); free(conn); } } @@ -270,7 +268,7 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, f->sockfd = s; f->action = act; - f->easy = e; + f->curl = e; ev.events = kind; ev.data.fd = s; @@ -280,13 +278,13 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, } /* Initialize a new SockInfo structure */ -static void addsock(curl_socket_t s, CURL *easy, int action, +static void addsock(curl_socket_t s, CURL *curl, int action, struct GlobalInfo *g) { struct SockInfo *fdp = (struct SockInfo*)calloc(1, sizeof(struct SockInfo)); fdp->global = g; - setsock(fdp, s, easy, action, g); + setsock(fdp, s, curl, action, g); curl_multi_assign(g->multi, s, fdp); } @@ -347,28 +345,28 @@ static void new_conn(const char *url, struct GlobalInfo *g) conn = (struct ConnInfo*)calloc(1, sizeof(*conn)); conn->error[0] = '\0'; - conn->easy = curl_easy_init(); - if(!conn->easy) { + conn->curl = curl_easy_init(); + if(!conn->curl) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = strdup(url); - curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); - curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); - curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); - curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb); - curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L); - curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L); + curl_easy_setopt(conn->curl, CURLOPT_URL, conn->url); + curl_easy_setopt(conn->curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(conn->curl, CURLOPT_WRITEDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(conn->curl, CURLOPT_ERRORBUFFER, conn->error); + curl_easy_setopt(conn->curl, CURLOPT_PRIVATE, conn); + curl_easy_setopt(conn->curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(conn->curl, CURLOPT_PROGRESSFUNCTION, prog_cb); + curl_easy_setopt(conn->curl, CURLOPT_PROGRESSDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_TIME, 3L); + curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_LIMIT, 10L); fprintf(MSG_OUT, - "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); - rc = curl_multi_add_handle(g->multi, conn->easy); + "Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that the add_handle() sets a timeout to trigger soon so that the diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 79dfd3452178..21f188549b99 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -90,7 +90,7 @@ struct GlobalInfo { /* Information associated with a specific easy handle */ struct ConnInfo { - CURL *easy; + CURL *curl; char *url; struct GlobalInfo *global; char error[CURL_ERROR_SIZE]; @@ -99,7 +99,7 @@ struct ConnInfo { /* Information associated with a specific socket */ struct SockInfo { curl_socket_t sockfd; - CURL *easy; + CURL *curl; int action; long timeout; struct ev_io ev; @@ -169,20 +169,18 @@ static void check_multi_info(struct GlobalInfo *g) CURLMsg *msg; int msgs_left; struct ConnInfo *conn; - CURL *easy; - CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while((msg = curl_multi_info_read(g->multi, &msgs_left))) { if(msg->msg == CURLMSG_DONE) { - easy = msg->easy_handle; - res = msg->data.result; - curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); - curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); + CURL *curl = msg->easy_handle; + CURLcode res = msg->data.result; + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &conn); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &eff_url); fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error); - curl_multi_remove_handle(g->multi, easy); + curl_multi_remove_handle(g->multi, curl); free(conn->url); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); free(conn); } } @@ -247,7 +245,7 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, f->sockfd = s; f->action = act; - f->easy = e; + f->curl = e; if(f->evset) ev_io_stop(g->loop, &f->ev); ev_io_init(&f->ev, event_cb, f->sockfd, kind); @@ -257,13 +255,13 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, } /* Initialize a new SockInfo structure */ -static void addsock(curl_socket_t s, CURL *easy, int action, +static void addsock(curl_socket_t s, CURL *curl, int action, struct GlobalInfo *g) { struct SockInfo *fdp = calloc(1, sizeof(struct SockInfo)); fdp->global = g; - setsock(fdp, s, easy, action, g); + setsock(fdp, s, curl, action, g); curl_multi_assign(g->multi, s, fdp); } @@ -330,28 +328,28 @@ static void new_conn(const char *url, struct GlobalInfo *g) conn = calloc(1, sizeof(*conn)); conn->error[0]='\0'; - conn->easy = curl_easy_init(); - if(!conn->easy) { + conn->curl = curl_easy_init(); + if(!conn->curl) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = strdup(url); - curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); - curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); - curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); - curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(conn->easy, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); - curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L); - curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L); + curl_easy_setopt(conn->curl, CURLOPT_URL, conn->url); + curl_easy_setopt(conn->curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(conn->curl, CURLOPT_WRITEDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(conn->curl, CURLOPT_ERRORBUFFER, conn->error); + curl_easy_setopt(conn->curl, CURLOPT_PRIVATE, conn); + curl_easy_setopt(conn->curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(conn->curl, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); + curl_easy_setopt(conn->curl, CURLOPT_PROGRESSDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_TIME, 3L); + curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_LIMIT, 10L); fprintf(MSG_OUT, - "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); - rc = curl_multi_add_handle(g->multi, conn->easy); + "Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that add_handle() sets a timeout to trigger soon so that the diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 99e719b74574..7415cff81f01 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -60,7 +60,7 @@ #define INADDR_NONE 0xffffffff #endif -static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { size_t written = fwrite(ptr, size, nmemb, (FILE *)stream); return written; @@ -143,7 +143,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); /* send all data to this function */ - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* call this function to get a socket */ curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket); diff --git a/docs/examples/ftp-delete.c b/docs/examples/ftp-delete.c index f5c553ff68ef..e43dd30f2f27 100644 --- a/docs/examples/ftp-delete.c +++ b/docs/examples/ftp-delete.c @@ -30,7 +30,7 @@ * */ -static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { (void)buffer; (void)stream; @@ -54,7 +54,7 @@ int main(void) */ curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/"); /* Define our callback to get called when there is data to be written */ - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* Switch on full protocol/debug output */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c index 0861f2f0487e..79386f98343d 100644 --- a/docs/examples/ftp-wildcard.c +++ b/docs/examples/ftp-wildcard.c @@ -78,7 +78,7 @@ static long file_is_downloaded(void *input) return CURL_CHUNK_END_FUNC_OK; } -static size_t write_it(char *buff, size_t size, size_t nmemb, +static size_t write_cb(char *buff, size_t size, size_t nmemb, void *cb_data) { struct callback_data *data = cb_data; @@ -94,7 +94,7 @@ static size_t write_it(char *buff, size_t size, size_t nmemb, int main(int argc, char **argv) { /* curl easy handle */ - CURL *handle; + CURL *curl; /* help data */ struct callback_data data = { 0 }; @@ -105,40 +105,40 @@ int main(int argc, char **argv) return (int)res; /* initialization of easy handle */ - handle = curl_easy_init(); - if(!handle) { + curl = curl_easy_init(); + if(!curl) { curl_global_cleanup(); return CURLE_OUT_OF_MEMORY; } /* turn on wildcard matching */ - curl_easy_setopt(handle, CURLOPT_WILDCARDMATCH, 1L); + curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 1L); /* callback is called before download of concrete file started */ - curl_easy_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, file_is_coming); + curl_easy_setopt(curl, CURLOPT_CHUNK_BGN_FUNCTION, file_is_coming); /* callback is called after data from the file have been transferred */ - curl_easy_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded); + curl_easy_setopt(curl, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded); /* this callback writes contents into files */ - curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_it); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* put transfer data into callbacks */ - curl_easy_setopt(handle, CURLOPT_CHUNK_DATA, &data); - curl_easy_setopt(handle, CURLOPT_WRITEDATA, &data); + curl_easy_setopt(curl, CURLOPT_CHUNK_DATA, &data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &data); - /* curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L); */ + /* curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); */ /* set a URL containing wildcard pattern (only in the last part) */ if(argc == 2) - curl_easy_setopt(handle, CURLOPT_URL, argv[1]); + curl_easy_setopt(curl, CURLOPT_URL, argv[1]); else - curl_easy_setopt(handle, CURLOPT_URL, "ftp://example.com/test/*"); + curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/test/*"); /* and start transfer! */ - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); - curl_easy_cleanup(handle); + curl_easy_cleanup(curl); curl_global_cleanup(); return (int)res; } diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c index f4ba1e52aa24..391324bf64cc 100644 --- a/docs/examples/ftpget.c +++ b/docs/examples/ftpget.c @@ -35,7 +35,7 @@ struct FtpFile { FILE *stream; }; -static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out = (struct FtpFile *)stream; if(!out->stream) { @@ -69,7 +69,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/curl/curl-7.9.2.tar.gz"); /* Define our callback to get called when there is data to be written */ - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); diff --git a/docs/examples/ftpsget.c b/docs/examples/ftpsget.c index c2aee89c8487..f39046885e4f 100644 --- a/docs/examples/ftpsget.c +++ b/docs/examples/ftpsget.c @@ -36,7 +36,7 @@ struct FtpFile { FILE *stream; }; -static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, +static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out = (struct FtpFile *)stream; @@ -73,7 +73,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "ftp://user@server/home/user/file.txt"); /* Define our callback to get called when there is data to be written */ - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index db3fbfde505e..0df41005f5c3 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -59,7 +59,7 @@ you MUST also provide a read callback with CURLOPT_READFUNCTION. Failing to do so might give you a crash since a DLL may not use the variable's memory when passed in to it from an app like this. */ -static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { unsigned long nread; /* in real-world cases, this would probably get this data differently @@ -123,7 +123,7 @@ int main(void) headerlist = curl_slist_append(headerlist, buf_2); /* we want to use our own read function */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* enable uploading */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/ftpuploadfrommem.c b/docs/examples/ftpuploadfrommem.c index 70242376ae17..3ae71fa4aba4 100644 --- a/docs/examples/ftpuploadfrommem.c +++ b/docs/examples/ftpuploadfrommem.c @@ -45,7 +45,7 @@ struct WriteThis { size_t sizeleft; }; -static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct WriteThis *upload = (struct WriteThis *)userp; size_t max = size*nmemb; @@ -99,7 +99,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* we want to use our own read function */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* pointer to pass to our read function */ curl_easy_setopt(curl, CURLOPT_READDATA, &upload); diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index 13df8541a2d6..ea972ec1931f 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -45,7 +45,7 @@ static size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, } /* discard downloaded data */ -static size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { (void)ptr; (void)stream; @@ -53,7 +53,7 @@ static size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) } /* read data to upload */ -static size_t readfunc(char *ptr, size_t size, size_t nmemb, void *stream) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { FILE *f = stream; size_t n; @@ -67,12 +67,12 @@ static size_t readfunc(char *ptr, size_t size, size_t nmemb, void *stream) } -static int upload(CURL *curlhandle, const char *remotepath, +static int upload(CURL *curl, const char *remotepath, const char *localpath, long timeout, long tries) { FILE *f; long uploaded_len = 0; - CURLcode r = CURLE_GOT_NOTHING; + CURLcode res = CURLE_GOT_NOTHING; int c; f = fopen(localpath, "rb"); @@ -83,32 +83,32 @@ static int upload(CURL *curlhandle, const char *remotepath, return 0; } - curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); - curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath); + curl_easy_setopt(curl, CURLOPT_URL, remotepath); if(timeout) - curl_easy_setopt(curlhandle, CURLOPT_SERVER_RESPONSE_TIMEOUT, timeout); + curl_easy_setopt(curl, CURLOPT_SERVER_RESPONSE_TIMEOUT, timeout); - curl_easy_setopt(curlhandle, CURLOPT_HEADERFUNCTION, getcontentlengthfunc); - curl_easy_setopt(curlhandle, CURLOPT_HEADERDATA, &uploaded_len); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, getcontentlengthfunc); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, &uploaded_len); - curl_easy_setopt(curlhandle, CURLOPT_WRITEFUNCTION, discardfunc); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc); - curl_easy_setopt(curlhandle, CURLOPT_READDATA, f); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); + curl_easy_setopt(curl, CURLOPT_READDATA, f); /* enable active mode */ - curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); + curl_easy_setopt(curl, CURLOPT_FTPPORT, "-"); /* allow the server no more than 7 seconds to connect back */ - curl_easy_setopt(curlhandle, CURLOPT_ACCEPTTIMEOUT_MS, 7000L); + curl_easy_setopt(curl, CURLOPT_ACCEPTTIMEOUT_MS, 7000L); - curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L); + curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L); - curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - for(c = 0; (r != CURLE_OK) && (c < tries); c++) { + for(c = 0; (res != CURLE_OK) && (c < tries); c++) { /* are we resuming? */ if(c) { /* yes */ /* determine the length of the file already written */ @@ -116,55 +116,52 @@ static int upload(CURL *curlhandle, const char *remotepath, /* * With NOBODY and NOHEADER, libcurl issues a SIZE command, but the only * way to retrieve the result is to parse the returned Content-Length - * header. Thus, getcontentlengthfunc(). We need discardfunc() above + * header. Thus, getcontentlengthfunc(). We need write_cb() above * because HEADER dumps the headers to stdout without it. */ - curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L); - curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L); + curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); + curl_easy_setopt(curl, CURLOPT_HEADER, 1L); - r = curl_easy_perform(curlhandle); - if(r != CURLE_OK) + res = curl_easy_perform(curl); + if(res != CURLE_OK) continue; - curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L); - curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0L); + curl_easy_setopt(curl, CURLOPT_NOBODY, 0L); + curl_easy_setopt(curl, CURLOPT_HEADER, 0L); fseek(f, uploaded_len, SEEK_SET); - curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L); + curl_easy_setopt(curl, CURLOPT_APPEND, 1L); } else { /* no */ - curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0L); + curl_easy_setopt(curl, CURLOPT_APPEND, 0L); } - r = curl_easy_perform(curlhandle); + res = curl_easy_perform(curl); } fclose(f); - if(r == CURLE_OK) + if(res == CURLE_OK) return 1; else { - fprintf(stderr, "%s\n", curl_easy_strerror(r)); + fprintf(stderr, "%s\n", curl_easy_strerror(res)); return 0; } } int main(void) { - CURL *curlhandle = NULL; + CURL *curl = NULL; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - curlhandle = curl_easy_init(); - if(curlhandle) { - - upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", - 0, 3); - - curl_easy_cleanup(curlhandle); + curl = curl_easy_init(); + if(curl) { + upload(curl, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c index aa31654c168a..025ebe67a553 100644 --- a/docs/examples/getinmemory.c +++ b/docs/examples/getinmemory.c @@ -38,7 +38,7 @@ struct MemoryStruct { size_t size; }; -static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, +static size_t write_cb(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; @@ -61,7 +61,7 @@ static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, int main(void) { - CURL *curl_handle; + CURL *curl; CURLcode res; struct MemoryStruct chunk; @@ -74,24 +74,24 @@ int main(void) chunk.size = 0; /* no data at this point */ /* init the curl session */ - curl_handle = curl_easy_init(); - if(curl_handle) { + curl = curl_easy_init(); + if(curl) { /* specify URL to get */ - curl_easy_setopt(curl_handle, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); /* send all data to this function */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* we pass our 'chunk' struct to the callback function */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); /* some servers do not like requests that are made without a user-agent field, so we provide one */ - curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); /* get it! */ - res = curl_easy_perform(curl_handle); + res = curl_easy_perform(curl); /* check for errors */ if(res != CURLE_OK) { @@ -110,7 +110,7 @@ int main(void) } /* cleanup curl stuff */ - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); } free(chunk.memory); diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index e9844fc89e01..61771c7ad7bb 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -78,7 +78,7 @@ struct GlobalInfo { /* Information associated with a specific easy handle */ struct ConnInfo { - CURL *easy; + CURL *curl; char *url; struct GlobalInfo *global; char error[CURL_ERROR_SIZE]; @@ -87,7 +87,7 @@ struct ConnInfo { /* Information associated with a specific socket */ struct SockInfo { curl_socket_t sockfd; - CURL *easy; + CURL *curl; int action; long timeout; GIOChannel *ch; @@ -124,16 +124,16 @@ static void check_multi_info(struct GlobalInfo *g) MSG_OUT("REMAINING: %d\n", g->still_running); while((msg = curl_multi_info_read(g->multi, &msgs_left))) { if(msg->msg == CURLMSG_DONE) { - CURL *easy = msg->easy_handle; + CURL *curl = msg->easy_handle; CURLcode res = msg->data.result; char *eff_url; struct ConnInfo *conn; - curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); - curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &conn); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &eff_url); MSG_OUT("DONE: %s => (%d) %s\n", eff_url, res, conn->error); - curl_multi_remove_handle(g->multi, easy); + curl_multi_remove_handle(g->multi, curl); free(conn->url); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); free(conn); } } @@ -223,7 +223,7 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, f->sockfd = s; f->action = act; - f->easy = e; + f->curl = e; if(f->ev) { g_source_remove(f->ev); } @@ -231,14 +231,14 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, } /* Initialize a new SockInfo structure */ -static void addsock(curl_socket_t s, CURL *easy, int action, +static void addsock(curl_socket_t s, CURL *curl, int action, struct GlobalInfo *g) { struct SockInfo *fdp = g_malloc0(sizeof(struct SockInfo)); fdp->global = g; fdp->ch = g_io_channel_unix_new(s); - setsock(fdp, s, easy, action, g); + setsock(fdp, s, curl, action, g); curl_multi_assign(g->multi, s, fdp); } @@ -301,29 +301,29 @@ static void new_conn(const char *url, struct GlobalInfo *g) conn = g_malloc0(sizeof(*conn)); conn->error[0] = '\0'; - conn->easy = curl_easy_init(); - if(!conn->easy) { + conn->curl = curl_easy_init(); + if(!conn->curl) { MSG_OUT("curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = g_strdup(url); - curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); - curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn); - curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, SHOW_VERBOSE); - curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); - curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); - curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS ? 0L : 1L); - curl_easy_setopt(conn->easy, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); - curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30L); - curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1L); - curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30L); - - MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); - rc = curl_multi_add_handle(g->multi, conn->easy); + curl_easy_setopt(conn->curl, CURLOPT_URL, conn->url); + curl_easy_setopt(conn->curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(conn->curl, CURLOPT_WRITEDATA, &conn); + curl_easy_setopt(conn->curl, CURLOPT_VERBOSE, SHOW_VERBOSE); + curl_easy_setopt(conn->curl, CURLOPT_ERRORBUFFER, conn->error); + curl_easy_setopt(conn->curl, CURLOPT_PRIVATE, conn); + curl_easy_setopt(conn->curl, CURLOPT_NOPROGRESS, SHOW_PROGRESS ? 0L : 1L); + curl_easy_setopt(conn->curl, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); + curl_easy_setopt(conn->curl, CURLOPT_PROGRESSDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(conn->curl, CURLOPT_CONNECTTIMEOUT, 30L); + curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_LIMIT, 1L); + curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_TIME, 30L); + + MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that add_handle() sets a timeout to trigger soon so that the diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index cc22e70abbe4..314d7dd9d95a 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -90,7 +90,7 @@ struct GlobalInfo { /* Information associated with a specific easy handle */ struct ConnInfo { - CURL *easy; + CURL *curl; char *url; struct GlobalInfo *global; char error[CURL_ERROR_SIZE]; @@ -99,7 +99,7 @@ struct ConnInfo { /* Information associated with a specific socket */ struct SockInfo { curl_socket_t sockfd; - CURL *easy; + CURL *curl; int action; long timeout; struct event ev; @@ -162,20 +162,18 @@ static void check_multi_info(struct GlobalInfo *g) CURLMsg *msg; int msgs_left; struct ConnInfo *conn; - CURL *easy; - CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while((msg = curl_multi_info_read(g->multi, &msgs_left))) { if(msg->msg == CURLMSG_DONE) { - easy = msg->easy_handle; - res = msg->data.result; - curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); - curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); + CURL *curl = msg->easy_handle; + CURLcode res = msg->data.result; + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &conn); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &eff_url); fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error); - curl_multi_remove_handle(g->multi, easy); + curl_multi_remove_handle(g->multi, curl); free(conn->url); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); free(conn); } } @@ -240,7 +238,7 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, f->sockfd = s; f->action = act; - f->easy = e; + f->curl = e; if(event_initialized(&f->ev)) { event_del(&f->ev); } @@ -249,13 +247,13 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, } /* Initialize a new SockInfo structure */ -static void addsock(curl_socket_t s, CURL *easy, int action, +static void addsock(curl_socket_t s, CURL *curl, int action, struct GlobalInfo *g) { struct SockInfo *fdp = calloc(1, sizeof(struct SockInfo)); fdp->global = g; - setsock(fdp, s, easy, action, g); + setsock(fdp, s, curl, action, g); curl_multi_assign(g->multi, s, fdp); } @@ -317,26 +315,26 @@ static void new_conn(const char *url, struct GlobalInfo *g) conn = calloc(1, sizeof(*conn)); conn->error[0] = '\0'; - conn->easy = curl_easy_init(); - if(!conn->easy) { + conn->curl = curl_easy_init(); + if(!conn->curl) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = strdup(url); - curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); - curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); - curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); - curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); - curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(conn->easy, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); - curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); - curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(conn->curl, CURLOPT_URL, conn->url); + curl_easy_setopt(conn->curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(conn->curl, CURLOPT_WRITEDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(conn->curl, CURLOPT_ERRORBUFFER, conn->error); + curl_easy_setopt(conn->curl, CURLOPT_PRIVATE, conn); + curl_easy_setopt(conn->curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(conn->curl, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); + curl_easy_setopt(conn->curl, CURLOPT_PROGRESSDATA, conn); + curl_easy_setopt(conn->curl, CURLOPT_FOLLOWLOCATION, 1L); fprintf(MSG_OUT, - "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); - rc = curl_multi_add_handle(g->multi, conn->easy); + "Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that the add_handle() sets a time-out to trigger soon so that diff --git a/docs/examples/hsts-preload.c b/docs/examples/hsts-preload.c index 303b17f52500..a775ec9778a7 100644 --- a/docs/examples/hsts-preload.c +++ b/docs/examples/hsts-preload.c @@ -46,13 +46,13 @@ struct state { /* "read" is from the point of the library, it wants data from us. One domain entry per invoke. */ -static CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *e, +static CURLSTScode hstsread(CURL *curl, struct curl_hstsentry *e, void *userp) { const char *host; const char *expire; struct state *s = (struct state *)userp; - (void)easy; + (void)curl; host = preload_hosts[s->index].name; expire = preload_hosts[s->index++].exp; @@ -67,10 +67,10 @@ static CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *e, return CURLSTS_OK; } -static CURLSTScode hstswrite(CURL *easy, struct curl_hstsentry *e, +static CURLSTScode hstswrite(CURL *curl, struct curl_hstsentry *e, struct curl_index *i, void *userp) { - (void)easy; + (void)curl; (void)userp; /* we have no custom input */ printf("[%u/%u] %s %s\n", (unsigned int)i->index, (unsigned int)i->total, e->name, e->expire); diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index e4979ee859d3..2251a215e8a5 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -86,43 +86,43 @@ static size_t writer(char *data, size_t size, size_t nmemb, // libcurl connection initialization // -static bool init(CURL *&conn, const char *url) +static bool init(CURL *&curl, const char *url) { - CURLcode code; + CURLcode res; - conn = curl_easy_init(); + curl = curl_easy_init(); - if(conn == NULL) { - fprintf(stderr, "Failed to create CURL connection\n"); + if(!curl) { + fprintf(stderr, "Failed to create CURL handle\n"); return false; } - code = curl_easy_setopt(conn, CURLOPT_ERRORBUFFER, errorBuffer); - if(code != CURLE_OK) { - fprintf(stderr, "Failed to set error buffer [%d]\n", code); + res = curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer); + if(res != CURLE_OK) { + fprintf(stderr, "Failed to set error buffer [%d]\n", res); return false; } - code = curl_easy_setopt(conn, CURLOPT_URL, url); - if(code != CURLE_OK) { + res = curl_easy_setopt(curl, CURLOPT_URL, url); + if(res != CURLE_OK) { fprintf(stderr, "Failed to set URL [%s]\n", errorBuffer); return false; } - code = curl_easy_setopt(conn, CURLOPT_FOLLOWLOCATION, 1L); - if(code != CURLE_OK) { + res = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + if(res != CURLE_OK) { fprintf(stderr, "Failed to set redirect option [%s]\n", errorBuffer); return false; } - code = curl_easy_setopt(conn, CURLOPT_WRITEFUNCTION, writer); - if(code != CURLE_OK) { + res = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer); + if(res != CURLE_OK) { fprintf(stderr, "Failed to set writer [%s]\n", errorBuffer); return false; } - code = curl_easy_setopt(conn, CURLOPT_WRITEDATA, &buffer); - if(code != CURLE_OK) { + res = curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); + if(res != CURLE_OK) { fprintf(stderr, "Failed to set write data [%s]\n", errorBuffer); return false; } @@ -262,7 +262,7 @@ static void parseHtml(const std::string &html, int main(int argc, char *argv[]) { - CURL *conn = NULL; + CURL *curl = NULL; CURLcode res; std::string title; @@ -277,18 +277,18 @@ int main(int argc, char *argv[]) if(res) return (int)res; - // Initialize CURL connection + // Initialize CURL handle - if(!init(conn, argv[1])) { - fprintf(stderr, "Connection initialization failed\n"); + if(!init(curl, argv[1])) { + fprintf(stderr, "Handle initialization failed\n"); curl_global_cleanup(); return EXIT_FAILURE; } // Retrieve content for the URL - res = curl_easy_perform(conn); - curl_easy_cleanup(conn); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); if(res != CURLE_OK) { fprintf(stderr, "Failed to get '%s' [%s]\n", argv[1], errorBuffer); diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 15bb9fa1a50d..efc747215371 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -50,7 +50,7 @@ struct transfer { FILE *out; - CURL *easy; + CURL *curl; int num; }; @@ -101,13 +101,13 @@ static void dump(const char *text, int num, unsigned char *ptr, } } -static int my_trace(CURL *handle, curl_infotype type, +static int my_trace(CURL *curl, curl_infotype type, char *data, size_t size, void *userp) { const char *text; struct transfer *t = (struct transfer *)userp; int num = t->num; - (void)handle; + (void)curl; switch(type) { case CURLINFO_TEXT: @@ -142,9 +142,9 @@ static int my_trace(CURL *handle, curl_infotype type, static int setup(struct transfer *t, int num) { char filename[128]; - CURL *easy; + CURL *curl; - easy = t->easy = NULL; + curl = t->curl = NULL; t->num = num; snprintf(filename, sizeof(filename), "dl-%d", num); @@ -155,29 +155,29 @@ static int setup(struct transfer *t, int num) return 1; } - easy = t->easy = curl_easy_init(); - if(easy) { + curl = t->curl = curl_easy_init(); + if(curl) { /* write to this file */ - curl_easy_setopt(easy, CURLOPT_WRITEDATA, t->out); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, t->out); /* set the same URL */ - curl_easy_setopt(easy, CURLOPT_URL, "https://localhost:8443/index.html"); + curl_easy_setopt(curl, CURLOPT_URL, "https://localhost:8443/index.html"); /* please be verbose */ - curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, my_trace); - curl_easy_setopt(easy, CURLOPT_DEBUGDATA, t); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(curl, CURLOPT_DEBUGDATA, t); /* enlarge the receive buffer for potentially higher transfer speeds */ - curl_easy_setopt(easy, CURLOPT_BUFFERSIZE, 100000L); + curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 100000L); /* HTTP/2 please */ - curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); #if (CURLPIPE_MULTIPLEX > 0) /* wait for pipe connection to confirm */ - curl_easy_setopt(easy, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); #endif } return 0; @@ -190,7 +190,7 @@ int main(int argc, char **argv) { CURLcode res; struct transfer *trans; - CURLM *multi_handle = NULL; + CURLM *multi = NULL; int i; int still_running = 0; /* keep number of running handles */ int num_transfers; @@ -215,8 +215,8 @@ int main(int argc, char **argv) } /* init a multi stack */ - multi_handle = curl_multi_init(); - if(!multi_handle) + multi = curl_multi_init(); + if(!multi) goto error; for(i = 0; i < num_transfers; i++) { @@ -225,17 +225,17 @@ int main(int argc, char **argv) } /* add the individual transfer */ - curl_multi_add_handle(multi_handle, trans[i].easy); + curl_multi_add_handle(multi, trans[i].curl); } - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -244,15 +244,15 @@ int main(int argc, char **argv) error: - if(multi_handle) { + if(multi) { for(i = 0; i < num_transfers; i++) { - curl_multi_remove_handle(multi_handle, trans[i].easy); - curl_easy_cleanup(trans[i].easy); + curl_multi_remove_handle(multi, trans[i].curl); + curl_easy_cleanup(trans[i].curl); if(trans[i].out) fclose(trans[i].out); } - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } free(trans); diff --git a/docs/examples/http2-pushinmemory.c b/docs/examples/http2-pushinmemory.c index 85bf0e34a745..e15f15169762 100644 --- a/docs/examples/http2-pushinmemory.c +++ b/docs/examples/http2-pushinmemory.c @@ -66,30 +66,30 @@ static void init_memory(struct Memory *chunk) chunk->size = 0; /* no data at this point */ } -static void setup(CURL *hnd) +static void setup(CURL *curl) { /* set the same URL */ - curl_easy_setopt(hnd, CURLOPT_URL, "https://localhost:8443/index.html"); + curl_easy_setopt(curl, CURLOPT_URL, "https://localhost:8443/index.html"); /* HTTP/2 please */ - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); /* we use a self-signed test server, skip verification during debugging */ - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); /* write data to a struct */ - curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); init_memory(&files[0]); - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, &files[0]); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &files[0]); /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); } /* called when there is an incoming push */ static int server_push_callback(CURL *parent, - CURL *easy, + CURL *curl, size_t num_headers, struct curl_pushheaders *headers, void *userp) @@ -105,7 +105,7 @@ static int server_push_callback(CURL *parent, /* write to this buffer */ init_memory(&files[pushindex]); - curl_easy_setopt(easy, CURLOPT_WRITEDATA, &files[pushindex]); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &files[pushindex]); pushindex++; headp = curl_pushheader_byname(headers, ":path"); @@ -122,7 +122,7 @@ static int server_push_callback(CURL *parent, */ int main(void) { - CURL *easy; + CURL *curl; CURLM *multi; int transfers = 1; /* we start with one */ int i; @@ -134,13 +134,13 @@ int main(void) /* init a multi stack */ multi = curl_multi_init(); - easy = curl_easy_init(); + curl = curl_easy_init(); /* set options */ - setup(easy); + setup(curl); /* add the easy transfer */ - curl_multi_add_handle(multi, easy); + curl_multi_add_handle(multi, curl); curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); curl_multi_setopt(multi, CURLMOPT_PUSHFUNCTION, server_push_callback); @@ -167,10 +167,10 @@ int main(void) int msgq = 0; m = curl_multi_info_read(multi, &msgq); if(m && (m->msg == CURLMSG_DONE)) { - CURL *e = m->easy_handle; + curl = m->easy_handle; transfers--; - curl_multi_remove_handle(multi, e); - curl_easy_cleanup(e); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); } } while(m); } diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index 8c261e9aed2b..d501f2419940 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -89,11 +89,11 @@ static void dump(const char *text, unsigned char *ptr, size_t size, char nohex) } } -static int my_trace(CURL *handle, curl_infotype type, +static int my_trace(CURL *curl, curl_infotype type, char *data, size_t size, void *userp) { const char *text; - (void)handle; + (void)curl; (void)userp; switch(type) { case CURLINFO_TEXT: @@ -127,32 +127,32 @@ static int my_trace(CURL *handle, curl_infotype type, #define OUTPUTFILE "dl" -static int setup(CURL *hnd, const char *url) +static int setup(CURL *curl, const char *url) { out_download = fopen(OUTPUTFILE, "wb"); if(!out_download) return 1; /* failed */ /* set the same URL */ - curl_easy_setopt(hnd, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_URL, url); /* HTTP/2 please */ - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); /* we use a self-signed test server, skip verification during debugging */ - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); /* write to this file */ - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out_download); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, out_download); /* please be verbose */ - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); #if CURLPIPE_MULTIPLEX > 0 /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); #endif return 0; /* all is good */ } @@ -161,7 +161,7 @@ static FILE *out_push; /* called when there is an incoming push */ static int server_push_callback(CURL *parent, - CURL *easy, + CURL *curl, size_t num_headers, struct curl_pushheaders *headers, void *userp) @@ -185,7 +185,7 @@ static int server_push_callback(CURL *parent, } /* write to this file */ - curl_easy_setopt(easy, CURLOPT_WRITEDATA, out_push); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, out_push); fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n", count, (unsigned long)num_headers); @@ -211,8 +211,8 @@ static int server_push_callback(CURL *parent, int main(int argc, char *argv[]) { CURLcode res; - CURL *easy; - CURLM *multi_handle; + CURL *curl; + CURLM *multi; int transfers = 1; /* we start with one */ const char *url = "https://localhost:8443/index.html"; @@ -224,33 +224,33 @@ int main(int argc, char *argv[]) return (int)res; /* init a multi stack */ - multi_handle = curl_multi_init(); - if(!multi_handle) + multi = curl_multi_init(); + if(!multi) goto error; - easy = curl_easy_init(); + curl = curl_easy_init(); /* set options */ - if(!easy || setup(easy, url)) { + if(!curl || setup(curl, url)) { fprintf(stderr, "failed\n"); goto error; } - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - curl_multi_setopt(multi_handle, CURLMOPT_PUSHFUNCTION, server_push_callback); - curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi, CURLMOPT_PUSHFUNCTION, server_push_callback); + curl_multi_setopt(multi, CURLMOPT_PUSHDATA, &transfers); /* add the easy transfer */ - curl_multi_add_handle(multi_handle, easy); + curl_multi_add_handle(multi, curl); do { struct CURLMsg *m; int still_running; /* keep number of running handles */ - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -262,12 +262,12 @@ int main(int argc, char *argv[]) */ do { int msgq = 0; - m = curl_multi_info_read(multi_handle, &msgq); + m = curl_multi_info_read(multi, &msgq); if(m && (m->msg == CURLMSG_DONE)) { - CURL *e = m->easy_handle; + curl = m->easy_handle; transfers--; - curl_multi_remove_handle(multi_handle, e); - curl_easy_cleanup(e); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); } } while(m); @@ -275,8 +275,8 @@ int main(int argc, char *argv[]) error: - if(multi_handle) - curl_multi_cleanup(multi_handle); + if(multi) + curl_multi_cleanup(multi); curl_global_cleanup(); diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index fda941c49f4d..2bff0d050602 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -88,7 +88,7 @@ struct input { FILE *in; FILE *out; size_t bytes_read; /* count up */ - CURL *easy; + CURL *curl; int num; }; @@ -139,7 +139,7 @@ static void dump(const char *text, int num, unsigned char *ptr, } } -static int my_trace(CURL *handle, curl_infotype type, +static int my_trace(CURL *curl, curl_infotype type, char *data, size_t size, void *userp) { char timebuf[60]; @@ -151,7 +151,7 @@ static int my_trace(CURL *handle, curl_infotype type, struct timeval tv; time_t secs; struct tm *now; - (void)handle; + (void)curl; gettimeofday(&tv, NULL); if(!known_offset) { @@ -193,7 +193,7 @@ static int my_trace(CURL *handle, curl_infotype type, return 0; } -static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct input *i = userp; size_t retcode = fread(ptr, size, nmemb, i->in); @@ -207,9 +207,9 @@ static int setup(struct input *t, int num, const char *upload) char filename[128]; struct stat file_info; curl_off_t uploadsize; - CURL *easy; + CURL *curl; - easy = t->easy = NULL; + curl = t->curl = NULL; t->num = num; snprintf(filename, sizeof(filename), "dl-%d", num); @@ -246,40 +246,40 @@ static int setup(struct input *t, int num, const char *upload) uploadsize = file_info.st_size; - easy = t->easy = curl_easy_init(); - if(easy) { + curl = t->curl = curl_easy_init(); + if(curl) { /* write to this file */ - curl_easy_setopt(easy, CURLOPT_WRITEDATA, t->out); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, t->out); /* we want to use our own read function */ - curl_easy_setopt(easy, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* read from this file */ - curl_easy_setopt(easy, CURLOPT_READDATA, t); + curl_easy_setopt(curl, CURLOPT_READDATA, t); /* provide the size of the upload */ - curl_easy_setopt(easy, CURLOPT_INFILESIZE_LARGE, uploadsize); + curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, uploadsize); /* send in the URL to store the upload as */ - curl_easy_setopt(easy, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_URL, url); /* upload please */ - curl_easy_setopt(easy, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* please be verbose */ - curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, my_trace); - curl_easy_setopt(easy, CURLOPT_DEBUGDATA, t); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(curl, CURLOPT_DEBUGDATA, t); /* HTTP/2 please */ - curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); /* we use a self-signed test server, skip verification during debugging */ - curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(easy, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); #if (CURLPIPE_MULTIPLEX > 0) /* wait for pipe connection to confirm */ - curl_easy_setopt(easy, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); #endif } return 0; @@ -292,7 +292,7 @@ int main(int argc, char **argv) { CURLcode res; struct input *trans; - CURLM *multi_handle = NULL; + CURLM *multi = NULL; int i; const char *filename = "index.html"; int still_running = 0; /* keep number of running handles */ @@ -322,8 +322,8 @@ int main(int argc, char **argv) } /* init a multi stack */ - multi_handle = curl_multi_init(); - if(!multi_handle) + multi = curl_multi_init(); + if(!multi) goto error; for(i = 0; i < num_transfers; i++) { @@ -332,20 +332,20 @@ int main(int argc, char **argv) } /* add the individual transfer */ - curl_multi_add_handle(multi_handle, trans[i].easy); + curl_multi_add_handle(multi, trans[i].curl); } - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); /* We do HTTP/2 so let's stick to one connection per host */ - curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 1L); + curl_multi_setopt(multi, CURLMOPT_MAX_HOST_CONNECTIONS, 1L); do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -354,17 +354,17 @@ int main(int argc, char **argv) error: - if(multi_handle) { + if(multi) { for(i = 0; i < num_transfers; i++) { - curl_multi_remove_handle(multi_handle, trans[i].easy); - curl_easy_cleanup(trans[i].easy); + curl_multi_remove_handle(multi, trans[i].curl); + curl_easy_cleanup(trans[i].curl); if(trans[i].in) fclose(trans[i].in); if(trans[i].out) fclose(trans[i].out); } - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } free(trans); diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 2aef62fc6713..794ea99ae582 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -48,7 +48,7 @@ * http://www.apacheweek.com/features/put */ -static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { size_t retcode; unsigned long nread; @@ -111,7 +111,7 @@ int main(int argc, char **argv) curl = curl_easy_init(); if(curl) { /* we want to use our own read function */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* enable uploading (implies PUT over HTTP) */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c index e8851ce97717..c78462a508cd 100644 --- a/docs/examples/imap-append.c +++ b/docs/examples/imap-append.c @@ -59,7 +59,7 @@ struct upload_status { size_t bytes_read; }; -static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; @@ -108,7 +108,7 @@ int main(void) /* In this case, we are using a callback function to specify the data. You * could just use the CURLOPT_READDATA option to specify a FILE pointer to * read from. */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/imap-multi.c b/docs/examples/imap-multi.c index e2d5dd4e9cc6..56a9147bc8a5 100644 --- a/docs/examples/imap-multi.c +++ b/docs/examples/imap-multi.c @@ -46,10 +46,10 @@ int main(void) curl = curl_easy_init(); if(curl) { - CURLM *mcurl; + CURLM *multi; - mcurl = curl_multi_init(); - if(mcurl) { + multi = curl_multi_init(); + if(multi) { int still_running = 1; /* Set username and password */ @@ -61,22 +61,22 @@ int main(void) "INBOX/;UID=1"); /* Tell the multi stack about our easy handle */ - curl_multi_add_handle(mcurl, curl); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(mcurl, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(mcurl, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; } while(still_running); /* Always cleanup */ - curl_multi_remove_handle(mcurl, curl); - curl_multi_cleanup(mcurl); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); } curl_easy_cleanup(curl); } diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index 9237f69b32ed..c9c0009763ac 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -172,14 +172,14 @@ static int mem_addf(struct mem *mem, const char *format, ...) return -1; } -static int mydebug(CURL *handle, curl_infotype type, +static int mydebug(CURL *curl, curl_infotype type, char *data, size_t size, void *userdata) { struct transfer *t = (struct transfer *)userdata; static const char s_infotype[CURLINFO_END][3] = { "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; - (void)handle; + (void)curl; switch(type) { case CURLINFO_TEXT: @@ -198,7 +198,7 @@ static int mydebug(CURL *handle, curl_infotype type, return 0; } -static size_t mywrite(char *ptr, size_t size, size_t nmemb, void *userdata) +static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) { struct transfer *t = (struct transfer *)userdata; @@ -258,7 +258,7 @@ int main(void) curl_easy_setopt(t->curl, CURLOPT_DEBUGDATA, t); /* Enable writing the body to a file */ - curl_easy_setopt(t->curl, CURLOPT_WRITEFUNCTION, mywrite); + curl_easy_setopt(t->curl, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(t->curl, CURLOPT_WRITEDATA, t); /* Enable immediate error on HTTP status codes >= 400 in most cases, diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index 7dab0b04f147..8c0d8b404152 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -43,8 +43,8 @@ int main(void) { - CURL *handles[HANDLECOUNT]; - CURLM *multi_handle; + CURL *curl[HANDLECOUNT]; + CURLM *multi; int i; @@ -54,17 +54,17 @@ int main(void) /* Allocate one curl handle per transfer */ for(i = 0; i < HANDLECOUNT; i++) - handles[i] = curl_easy_init(); + curl[i] = curl_easy_init(); /* set the options (I left out a few, you get the point anyway) */ - curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "https://example.com"); + curl_easy_setopt(curl[HTTP_HANDLE], CURLOPT_URL, "https://example.com"); - curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://example.com"); - curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl[FTP_HANDLE], CURLOPT_URL, "ftp://example.com"); + curl_easy_setopt(curl[FTP_HANDLE], CURLOPT_UPLOAD, 1L); /* init a multi stack */ - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { int still_running = 1; /* keep number of running handles */ @@ -73,14 +73,14 @@ int main(void) /* add the individual transfers */ for(i = 0; i < HANDLECOUNT; i++) - curl_multi_add_handle(multi_handle, handles[i]); + curl_multi_add_handle(multi, curl[i]); while(still_running) { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -88,13 +88,13 @@ int main(void) /* See how the transfers went */ /* !checksrc! disable EQUALSNULL 1 */ - while((msg = curl_multi_info_read(multi_handle, &msgs_left)) != NULL) { + while((msg = curl_multi_info_read(multi, &msgs_left)) != NULL) { if(msg->msg == CURLMSG_DONE) { int idx; /* Find out which handle this message is about */ for(idx = 0; idx < HANDLECOUNT; idx++) { - int found = (msg->easy_handle == handles[idx]); + int found = (msg->easy_handle == curl[idx]); if(found) break; } @@ -112,14 +112,14 @@ int main(void) /* remove the transfers */ for(i = 0; i < HANDLECOUNT; i++) - curl_multi_remove_handle(multi_handle, handles[i]); + curl_multi_remove_handle(multi, curl[i]); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } /* Free the curl handles */ for(i = 0; i < HANDLECOUNT; i++) - curl_easy_cleanup(handles[i]); + curl_easy_cleanup(curl[i]); curl_global_cleanup(); diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c index 278a5b4a2e1e..758cfca1de9d 100644 --- a/docs/examples/multi-debugcallback.c +++ b/docs/examples/multi-debugcallback.c @@ -83,14 +83,14 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr, fflush(stream); } -static int my_trace(CURL *handle, curl_infotype type, +static int my_trace(CURL *curl, curl_infotype type, unsigned char *data, size_t size, void *userp) { const char *text; (void)userp; - (void)handle; + (void)curl; switch(type) { case CURLINFO_TEXT: @@ -121,48 +121,48 @@ static int my_trace(CURL *handle, curl_infotype type, */ int main(void) { - CURL *http_handle; + CURL *curl; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - http_handle = curl_easy_init(); - if(http_handle) { + curl = curl_easy_init(); + if(curl) { - CURLM *multi_handle; + CURLM *multi; /* set the options (I left out a few, you get the point anyway) */ - curl_easy_setopt(http_handle, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace); - curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* init a multi stack */ - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { int still_running = 0; /* keep number of running handles */ /* add the individual transfers */ - curl_multi_add_handle(multi_handle, http_handle); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; } while(still_running); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } - curl_easy_cleanup(http_handle); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/docs/examples/multi-double.c b/docs/examples/multi-double.c index 71ac7422d6d2..1149f21b78d7 100644 --- a/docs/examples/multi-double.c +++ b/docs/examples/multi-double.c @@ -36,52 +36,51 @@ */ int main(void) { - CURL *http_handle; - CURL *http_handle2; + CURL *curl; + CURL *curl2; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - http_handle = curl_easy_init(); - http_handle2 = curl_easy_init(); + curl = curl_easy_init(); + curl2 = curl_easy_init(); - if(http_handle && - http_handle2) { + if(curl && curl2) { - CURLM *multi_handle; + CURLM *multi; /* set options */ - curl_easy_setopt(http_handle, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); /* set options */ - curl_easy_setopt(http_handle2, CURLOPT_URL, "http://localhost/"); + curl_easy_setopt(curl2, CURLOPT_URL, "http://localhost/"); /* init a multi stack */ - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { int still_running = 1; /* keep number of running handles */ /* add the individual transfers */ - curl_multi_add_handle(multi_handle, http_handle); - curl_multi_add_handle(multi_handle, http_handle2); + curl_multi_add_handle(multi, curl); + curl_multi_add_handle(multi, curl2); while(still_running) { CURLMsg *msg; int queued; - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; do { - msg = curl_multi_info_read(multi_handle, &queued); + msg = curl_multi_info_read(multi, &queued); if(msg) { if(msg->msg == CURLMSG_DONE) { /* a transfer ended */ @@ -91,15 +90,15 @@ int main(void) } while(msg); } - curl_multi_remove_handle(multi_handle, http_handle); - curl_multi_remove_handle(multi_handle, http_handle2); + curl_multi_remove_handle(multi, curl); + curl_multi_remove_handle(multi, curl2); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } } - curl_easy_cleanup(http_handle); - curl_easy_cleanup(http_handle2); + curl_easy_cleanup(curl); + curl_easy_cleanup(curl2); curl_global_cleanup(); diff --git a/docs/examples/multi-event.c b/docs/examples/multi-event.c index af77101b638a..abf907afe534 100644 --- a/docs/examples/multi-event.c +++ b/docs/examples/multi-event.c @@ -33,7 +33,7 @@ #include static struct event_base *base; -static CURLM *curl_handle; +static CURLM *multi; static struct event *timeout; struct curl_context { @@ -67,7 +67,7 @@ static void add_download(const char *url, int num) { char filename[50]; FILE *file; - CURL *handle; + CURL *curl; snprintf(filename, sizeof(filename), "%d.download", num); @@ -77,11 +77,11 @@ static void add_download(const char *url, int num) return; } - handle = curl_easy_init(); - curl_easy_setopt(handle, CURLOPT_WRITEDATA, file); - curl_easy_setopt(handle, CURLOPT_PRIVATE, file); - curl_easy_setopt(handle, CURLOPT_URL, url); - curl_multi_add_handle(curl_handle, handle); + curl = curl_easy_init(); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, file); + curl_easy_setopt(curl, CURLOPT_PRIVATE, file); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_multi_add_handle(multi, curl); fprintf(stderr, "Added download %s -> %s\n", url, filename); } @@ -90,10 +90,10 @@ static void check_multi_info(void) char *done_url; CURLMsg *message; int pending; - CURL *easy_handle; + CURL *curl; FILE *file; - while((message = curl_multi_info_read(curl_handle, &pending))) { + while((message = curl_multi_info_read(multi, &pending))) { switch(message->msg) { case CURLMSG_DONE: /* Do not use message data after calling curl_multi_remove_handle() and @@ -101,14 +101,14 @@ static void check_multi_info(void) "WARNING: The data the returned pointer points to does not survive calling curl_multi_cleanup, curl_multi_remove_handle or curl_easy_cleanup." */ - easy_handle = message->easy_handle; + curl = message->easy_handle; - curl_easy_getinfo(easy_handle, CURLINFO_EFFECTIVE_URL, &done_url); - curl_easy_getinfo(easy_handle, CURLINFO_PRIVATE, &file); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &done_url); + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &file); printf("%s DONE\n", done_url); - curl_multi_remove_handle(curl_handle, easy_handle); - curl_easy_cleanup(easy_handle); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); if(file) { fclose(file); } @@ -136,7 +136,7 @@ static void curl_perform(int fd, short event, void *arg) context = (struct curl_context *) arg; - curl_multi_socket_action(curl_handle, context->sockfd, flags, + curl_multi_socket_action(multi, context->sockfd, flags, &running_handles); check_multi_info(); @@ -148,7 +148,7 @@ static void on_timeout(evutil_socket_t fd, short events, void *arg) (void)fd; (void)events; (void)arg; - curl_multi_socket_action(curl_handle, CURL_SOCKET_TIMEOUT, 0, + curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); check_multi_info(); } @@ -172,13 +172,13 @@ static int start_timeout(CURLM *multi, long timeout_ms, void *userp) return 0; } -static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, +static int handle_socket(CURL *curl, curl_socket_t s, int action, void *userp, void *socketp) { struct curl_context *curl_context; int events = 0; - (void)easy; + (void)curl; (void)userp; switch(action) { @@ -188,7 +188,7 @@ static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, curl_context = socketp ? (struct curl_context *) socketp : create_curl_context(s); - curl_multi_assign(curl_handle, s, (void *) curl_context); + curl_multi_assign(multi, s, (void *) curl_context); if(action != CURL_POLL_IN) events |= EV_WRITE; @@ -207,7 +207,7 @@ static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, if(socketp) { event_del(((struct curl_context*) socketp)->event); destroy_curl_context((struct curl_context*) socketp); - curl_multi_assign(curl_handle, s, NULL); + curl_multi_assign(multi, s, NULL); } break; default: @@ -233,10 +233,10 @@ int main(int argc, char **argv) base = event_base_new(); timeout = evtimer_new(base, on_timeout, NULL); - curl_handle = curl_multi_init(); - if(curl_handle) { - curl_multi_setopt(curl_handle, CURLMOPT_SOCKETFUNCTION, handle_socket); - curl_multi_setopt(curl_handle, CURLMOPT_TIMERFUNCTION, start_timeout); + multi = curl_multi_init(); + if(multi) { + curl_multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, handle_socket); + curl_multi_setopt(multi, CURLMOPT_TIMERFUNCTION, start_timeout); while(argc-- > 1) { add_download(argv[argc], argc); @@ -244,7 +244,7 @@ int main(int argc, char **argv) event_base_dispatch(base); - curl_multi_cleanup(curl_handle); + curl_multi_cleanup(multi); } event_free(timeout); event_base_free(base); diff --git a/docs/examples/multi-formadd.c b/docs/examples/multi-formadd.c index 08d852ec6528..7a1b9eb95dec 100644 --- a/docs/examples/multi-formadd.c +++ b/docs/examples/multi-formadd.c @@ -79,10 +79,10 @@ int main(void) curl = curl_easy_init(); if(curl) { - CURLM *multi_handle; + CURLM *multi; - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { int still_running = 0; @@ -96,21 +96,21 @@ int main(void) curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); ) - curl_multi_add_handle(multi_handle, curl); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; } while(still_running); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } /* always cleanup */ diff --git a/docs/examples/multi-legacy.c b/docs/examples/multi-legacy.c index 19821ad6d327..93b50c169f4d 100644 --- a/docs/examples/multi-legacy.c +++ b/docs/examples/multi-legacy.c @@ -49,8 +49,8 @@ int main(void) { - CURL *handles[HANDLECOUNT]; - CURLM *multi_handle; + CURL *curl[HANDLECOUNT]; + CURLM *multi; int i; @@ -60,17 +60,17 @@ int main(void) /* Allocate one curl handle per transfer */ for(i = 0; i < HANDLECOUNT; i++) - handles[i] = curl_easy_init(); + curl[i] = curl_easy_init(); /* set the options (I left out a few, you get the point anyway) */ - curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "https://example.com"); + curl_easy_setopt(curl[HTTP_HANDLE], CURLOPT_URL, "https://example.com"); - curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://example.com"); - curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl[FTP_HANDLE], CURLOPT_URL, "ftp://example.com"); + curl_easy_setopt(curl[FTP_HANDLE], CURLOPT_UPLOAD, 1L); /* init a multi stack */ - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { int still_running = 0; /* keep number of running handles */ @@ -79,10 +79,10 @@ int main(void) /* add the individual transfers */ for(i = 0; i < HANDLECOUNT; i++) - curl_multi_add_handle(multi_handle, handles[i]); + curl_multi_add_handle(multi, curl[i]); /* we start some action by calling perform right away */ - curl_multi_perform(multi_handle, &still_running); + curl_multi_perform(multi, &still_running); while(still_running) { @@ -105,7 +105,7 @@ int main(void) timeout.tv_sec = 1; timeout.tv_usec = 0; - curl_multi_timeout(multi_handle, &curl_timeo); + curl_multi_timeout(multi, &curl_timeo); if(curl_timeo >= 0) { #if defined(MSDOS) || defined(__AMIGA__) timeout.tv_sec = (time_t)(curl_timeo / 1000); @@ -123,7 +123,7 @@ int main(void) } /* get file descriptors from the transfers */ - mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); + mc = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); if(mc != CURLM_OK) { fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); @@ -159,20 +159,20 @@ int main(void) break; case 0: /* timeout */ default: /* action */ - curl_multi_perform(multi_handle, &still_running); + curl_multi_perform(multi, &still_running); break; } } /* See how the transfers went */ /* !checksrc! disable EQUALSNULL 1 */ - while((msg = curl_multi_info_read(multi_handle, &msgs_left)) != NULL) { + while((msg = curl_multi_info_read(multi, &msgs_left)) != NULL) { if(msg->msg == CURLMSG_DONE) { int idx; /* Find out which handle this message is about */ for(idx = 0; idx < HANDLECOUNT; idx++) { - int found = (msg->easy_handle == handles[idx]); + int found = (msg->easy_handle == curl[idx]); if(found) break; } @@ -188,12 +188,12 @@ int main(void) } } - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } /* Free the curl handles */ for(i = 0; i < HANDLECOUNT; i++) - curl_easy_cleanup(handles[i]); + curl_easy_cleanup(curl[i]); curl_global_cleanup(); diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index ac7d2f525205..c6cb60e898b0 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -46,10 +46,10 @@ int main(void) curl = curl_easy_init(); if(curl) { - CURLM *multi_handle; + CURLM *multi; - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { int still_running = 0; /* Create the form */ @@ -82,20 +82,20 @@ int main(void) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_MIMEPOST, form); - curl_multi_add_handle(multi_handle, curl); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; } while(still_running); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } /* always cleanup */ diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index 50736c720112..ee2676bae3fe 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -37,34 +37,34 @@ */ int main(void) { - CURL *http_handle; + CURL *curl; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - http_handle = curl_easy_init(); - if(http_handle) { + curl = curl_easy_init(); + if(curl) { - CURLM *multi_handle; + CURLM *multi; int still_running = 1; /* keep number of running handles */ /* set the options (I left out a few, you get the point anyway) */ - curl_easy_setopt(http_handle, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); /* init a multi stack */ - multi_handle = curl_multi_init(); - if(multi_handle) { + multi = curl_multi_init(); + if(multi) { /* add the individual transfers */ - curl_multi_add_handle(multi_handle, http_handle); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(!mc) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) { fprintf(stderr, "curl_multi_poll() failed, code %d.\n", (int)mc); @@ -73,12 +73,12 @@ int main(void) } while(still_running); - curl_multi_remove_handle(multi_handle, http_handle); + curl_multi_remove_handle(multi, curl); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } - curl_easy_cleanup(http_handle); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index d2f18348e68a..de6beda2102c 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -85,7 +85,7 @@ static void add_download(const char *url, int num, CURLM *multi) { char filename[50]; FILE *file; - CURL *handle; + CURL *curl; snprintf(filename, sizeof(filename), "%d.download", num); @@ -95,11 +95,11 @@ static void add_download(const char *url, int num, CURLM *multi) return; } - handle = curl_easy_init(); - curl_easy_setopt(handle, CURLOPT_WRITEDATA, file); - curl_easy_setopt(handle, CURLOPT_PRIVATE, file); - curl_easy_setopt(handle, CURLOPT_URL, url); - curl_multi_add_handle(multi, handle); + curl = curl_easy_init(); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, file); + curl_easy_setopt(curl, CURLOPT_PRIVATE, file); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_multi_add_handle(multi, curl); fprintf(stderr, "Added download %s -> %s\n", url, filename); } @@ -108,7 +108,7 @@ static void check_multi_info(struct curl_context *context) char *done_url; CURLMsg *message; int pending; - CURL *easy_handle; + CURL *curl; FILE *file; while((message = curl_multi_info_read(context->uv->multi, &pending))) { @@ -119,14 +119,14 @@ static void check_multi_info(struct curl_context *context) "WARNING: The data the returned pointer points to does not survive calling curl_multi_cleanup, curl_multi_remove_handle or curl_easy_cleanup." */ - easy_handle = message->easy_handle; + curl = message->easy_handle; - curl_easy_getinfo(easy_handle, CURLINFO_EFFECTIVE_URL, &done_url); - curl_easy_getinfo(easy_handle, CURLINFO_PRIVATE, &file); + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &done_url); + curl_easy_getinfo(curl, CURLINFO_PRIVATE, &file); printf("%s DONE\n", done_url); - curl_multi_remove_handle(context->uv->multi, easy_handle); - curl_easy_cleanup(easy_handle); + curl_multi_remove_handle(context->uv->multi, curl); + curl_easy_cleanup(curl); if(file) { fclose(file); } @@ -186,13 +186,13 @@ static int cb_timeout(CURLM *multi, long timeout_ms, void *userp) } /* callback from libcurl to update socket activity to wait for */ -static int cb_socket(CURL *easy, curl_socket_t s, int action, +static int cb_socket(CURL *curl, curl_socket_t s, int action, void *userp, void *socketp) { struct datauv *uv = (struct datauv *)userp; struct curl_context *curl_context; int events = 0; - (void)easy; + (void)curl; switch(action) { case CURL_POLL_IN: diff --git a/docs/examples/pop3-multi.c b/docs/examples/pop3-multi.c index 4d418a7d09a7..d88d1193499d 100644 --- a/docs/examples/pop3-multi.c +++ b/docs/examples/pop3-multi.c @@ -47,10 +47,10 @@ int main(void) curl = curl_easy_init(); if(curl) { - CURLM *mcurl; + CURLM *multi; - mcurl = curl_multi_init(); - if(mcurl) { + multi = curl_multi_init(); + if(multi) { int still_running = 1; /* Set username and password */ @@ -61,14 +61,14 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1"); /* Tell the multi stack about our easy handle */ - curl_multi_add_handle(mcurl, curl); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(mcurl, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(mcurl, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -76,8 +76,8 @@ int main(void) } while(still_running); /* Always cleanup */ - curl_multi_remove_handle(mcurl, curl); - curl_multi_cleanup(mcurl); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); } curl_easy_cleanup(curl); } diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index 7c5a87e9acf7..ed5b4b197212 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -43,7 +43,7 @@ struct WriteThis { size_t sizeleft; }; -static size_t read_callback(char *dest, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *dest, size_t size, size_t nmemb, void *userp) { struct WriteThis *wt = (struct WriteThis *)userp; size_t buffer_size = size*nmemb; @@ -92,7 +92,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_POST, 1L); /* we want to use our own read function */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* pointer to pass to our read function */ curl_easy_setopt(curl, CURLOPT_READDATA, &wt); diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index 50b3b6fe7b27..a6ff7fa3770c 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -35,7 +35,7 @@ struct MemoryStruct { size_t size; }; -static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, +static size_t write_cb(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; @@ -75,7 +75,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.org/"); /* send all data to this function */ - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* we pass our 'chunk' struct to the callback function */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index cea07fd56698..85938dc223e4 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -30,7 +30,7 @@ #include -static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { size_t written = fwrite(ptr, size, nmemb, (FILE *)stream); return written; @@ -38,33 +38,33 @@ static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) int main(void) { - CURL *curl_handle; + CURL *curl; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; /* init the curl session */ - curl_handle = curl_easy_init(); - if(curl_handle) { + curl = curl_easy_init(); + if(curl) { static const char *headerfilename = "head.out"; FILE *headerfile; static const char *bodyfilename = "body.out"; FILE *bodyfile; /* set URL to get */ - curl_easy_setopt(curl_handle, CURLOPT_URL, "https://example.com"); + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); /* no progress meter please */ - curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); /* send all data to this function */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* open the header file */ headerfile = fopen(headerfilename, "wb"); if(!headerfile) { - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); curl_global_cleanup(); return -1; } @@ -72,20 +72,20 @@ int main(void) /* open the body file */ bodyfile = fopen(bodyfilename, "wb"); if(!bodyfile) { - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); fclose(headerfile); curl_global_cleanup(); return -1; } /* we want the headers be written to this file handle */ - curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, headerfile); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile); /* we want the body be written to this file handle instead of stdout */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, bodyfile); /* get it! */ - res = curl_easy_perform(curl_handle); + res = curl_easy_perform(curl); /* close the header file */ fclose(headerfile); @@ -94,7 +94,7 @@ int main(void) fclose(bodyfile); /* cleanup curl stuff */ - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index c7ea52ccc2e8..e90b387da06e 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -43,7 +43,7 @@ static CURL *curl; -static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { const struct curl_tlssessioninfo *info; CURLcode res; @@ -103,7 +103,7 @@ int main(void) curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); res = curl_easy_perform(curl); diff --git a/docs/examples/sftpget.c b/docs/examples/sftpget.c index 36653c5b828c..5eaf3416e8de 100644 --- a/docs/examples/sftpget.c +++ b/docs/examples/sftpget.c @@ -45,7 +45,7 @@ struct FtpFile { FILE *stream; }; -static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, +static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out = (struct FtpFile *)stream; @@ -79,7 +79,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "sftp://user@server/home/user/file.txt"); /* Define our callback to get called when there is data to be written */ - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index fa42859672b5..c15d103b5f0b 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -31,7 +31,7 @@ #include /* read data to upload */ -static size_t readfunc(char *ptr, size_t size, size_t nmemb, void *stream) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { FILE *f = (FILE *)stream; size_t n; @@ -50,36 +50,36 @@ static size_t readfunc(char *ptr, size_t size, size_t nmemb, void *stream) static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) { curl_off_t remoteFileSizeByte = -1; - CURL *curlHandlePtr = curl_easy_init(); + CURL *curl = curl_easy_init(); - if(curlHandlePtr) { + if(curl) { CURLcode result; - curl_easy_setopt(curlHandlePtr, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_URL, i_remoteFile); - curl_easy_setopt(curlHandlePtr, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_NOBODY, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_HEADER, 1L); - curl_easy_setopt(curlHandlePtr, CURLOPT_FILETIME, 1L); + curl_easy_setopt(curl, CURLOPT_URL, i_remoteFile); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); + curl_easy_setopt(curl, CURLOPT_HEADER, 1L); + curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); - result = curl_easy_perform(curlHandlePtr); + result = curl_easy_perform(curl); if(CURLE_OK == result) { - result = curl_easy_getinfo(curlHandlePtr, + result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &remoteFileSizeByte); if(result) return -1; printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); } - curl_easy_cleanup(curlHandlePtr); + curl_easy_cleanup(curl); } return remoteFileSizeByte; } -static int sftpResumeUpload(CURL *curlhandle, const char *remotepath, +static int sftpResumeUpload(CURL *curl, const char *remotepath, const char *localpath) { FILE *f = NULL; @@ -99,18 +99,18 @@ static int sftpResumeUpload(CURL *curlhandle, const char *remotepath, return 0; } - curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L); - curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath); - curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc); - curl_easy_setopt(curlhandle, CURLOPT_READDATA, f); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl, CURLOPT_URL, remotepath); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); + curl_easy_setopt(curl, CURLOPT_READDATA, f); #if defined(_WIN32) && !defined(UNDER_CE) _fseeki64(f, remoteFileSizeByte, SEEK_SET); #else fseek(f, (long)remoteFileSizeByte, SEEK_SET); #endif - curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L); - result = curl_easy_perform(curlhandle); + curl_easy_setopt(curl, CURLOPT_APPEND, 1L); + result = curl_easy_perform(curl); fclose(f); @@ -124,22 +124,22 @@ static int sftpResumeUpload(CURL *curlhandle, const char *remotepath, int main(void) { - CURL *curlhandle = NULL; + CURL *curl = NULL; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - curlhandle = curl_easy_init(); - if(curlhandle) { + curl = curl_easy_init(); + if(curl) { const char *remote = "sftp://user:pass@example.com/path/filename"; const char *filename = "filename"; - if(!sftpResumeUpload(curlhandle, remote, filename)) { + if(!sftpResumeUpload(curl, remote, filename)) { printf("resumed upload using curl %s failed\n", curl_version()); } - curl_easy_cleanup(curlhandle); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/docs/examples/shared-connection-cache.c b/docs/examples/shared-connection-cache.c index a8549d776668..4af62fee943c 100644 --- a/docs/examples/shared-connection-cache.c +++ b/docs/examples/shared-connection-cache.c @@ -28,19 +28,19 @@ #include #include -static void my_lock(CURL *handle, curl_lock_data data, +static void my_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, void *useptr) { - (void)handle; + (void)curl; (void)data; (void)laccess; (void)useptr; fprintf(stderr, "-> Mutex lock\n"); } -static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void my_unlock(CURL *curl, curl_lock_data data, void *useptr) { - (void)handle; + (void)curl; (void)data; (void)useptr; fprintf(stderr, "<- Mutex unlock\n"); diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 5a0bb2d05e97..0fcffe250188 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -60,7 +60,7 @@ const char * const urls[]= { "90030" }; -size_t write_file(void *ptr, size_t size, size_t nmemb, FILE *stream) +size_t write_cb(void *ptr, size_t size, size_t nmemb, FILE *stream) { return fwrite(ptr, size, nmemb, stream); } @@ -80,7 +80,7 @@ static void run_one(gchar *http, int j) /* Write to the file */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_file); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); (void)curl_easy_perform(curl); fclose(outfile); diff --git a/docs/examples/smtp-authzid.c b/docs/examples/smtp-authzid.c index 1fb1176b2a8b..539997d945de 100644 --- a/docs/examples/smtp-authzid.c +++ b/docs/examples/smtp-authzid.c @@ -67,7 +67,7 @@ struct upload_status { size_t bytes_read; }; -static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; @@ -133,7 +133,7 @@ int main(void) /* We are using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c index d41fc07b8014..39aa86a81828 100644 --- a/docs/examples/smtp-mail.c +++ b/docs/examples/smtp-mail.c @@ -64,7 +64,7 @@ struct upload_status { size_t bytes_read; }; -static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; @@ -121,7 +121,7 @@ int main(void) /* We are using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index 0973378e0f9b..3dabfbb9801e 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -57,7 +57,7 @@ struct upload_status { size_t bytes_read; }; -static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; @@ -89,10 +89,10 @@ int main(void) curl = curl_easy_init(); if(curl) { - CURLM *mcurl; + CURLM *multi; - mcurl = curl_multi_init(); - if(mcurl) { + multi = curl_multi_init(); + if(multi) { int still_running = 1; struct curl_slist *recipients = NULL; struct upload_status upload_ctx = { 0 }; @@ -119,19 +119,19 @@ int main(void) /* We are using a callback function to specify the payload (the headers * and body of the message). You could just use the CURLOPT_READDATA * option to specify a FILE pointer to read from. */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Tell the multi stack about our easy handle */ - curl_multi_add_handle(mcurl, curl); + curl_multi_add_handle(multi, curl); do { - CURLMcode mc = curl_multi_perform(mcurl, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(mcurl, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -142,8 +142,8 @@ int main(void) curl_slist_free_all(recipients); /* Always cleanup */ - curl_multi_remove_handle(mcurl, curl); - curl_multi_cleanup(mcurl); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); } curl_easy_cleanup(curl); } diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index 31ef81eae19a..5391f3e22297 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -61,7 +61,7 @@ struct upload_status { size_t bytes_read; }; -static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; @@ -143,7 +143,7 @@ int main(void) /* We are using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index 5d9214455e22..b2ea769b21f5 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -61,7 +61,7 @@ struct upload_status { size_t bytes_read; }; -static size_t payload_source(char *ptr, size_t size, size_t nmemb, void *userp) +static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; @@ -145,7 +145,7 @@ int main(void) /* We are using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index da2c7ea0f362..43fe5d312eca 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -117,7 +117,7 @@ static SYSTEMTIME LOCALTime; #define HTTP_COMMAND_HEAD 0 #define HTTP_COMMAND_GET 1 -static size_t SyncTime_CURL_WriteOutput(void *ptr, size_t size, size_t nmemb, +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr, size, nmemb, stream); @@ -187,7 +187,7 @@ static void SyncTime_CURL_Init(CURL *curl, const char *proxy_port, curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, proxy_user_password); curl_easy_setopt(curl, CURLOPT_USERAGENT, SYNCTIME_UA); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, SyncTime_CURL_WriteOutput); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, SyncTime_CURL_WriteHeader); } diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c index 8e9e01db15df..a0523f62db60 100644 --- a/docs/examples/url2file.c +++ b/docs/examples/url2file.c @@ -30,7 +30,7 @@ #include -static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { size_t written = fwrite(ptr, size, nmemb, (FILE *)stream); return written; @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) static const char *pagefilename = "page.out"; CURLcode res; - CURL *curl_handle; + CURL *curl; if(argc < 2) { printf("Usage: %s \n", argv[0]); @@ -55,38 +55,38 @@ int main(int argc, char *argv[]) } /* init the curl session */ - curl_handle = curl_easy_init(); - if(curl_handle) { + curl = curl_easy_init(); + if(curl) { FILE *pagefile; /* set URL to get here */ - curl_easy_setopt(curl_handle, CURLOPT_URL, argv[1]); + curl_easy_setopt(curl, CURLOPT_URL, argv[1]); /* Switch on full protocol/debug output while testing */ - curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* disable progress meter, set to 0L to enable it */ - curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); /* send all data to this function */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* open the file */ pagefile = fopen(pagefilename, "wb"); if(pagefile) { /* write the page body to this file handle */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, pagefile); /* get it! */ - res = curl_easy_perform(curl_handle); + res = curl_easy_perform(curl); /* close the header file */ fclose(pagefile); } /* cleanup curl stuff */ - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index 0fb5ab0de9de..175dae11514f 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -156,34 +156,34 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) int main(void) { - CURL *ch; + CURL *curl; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; - ch = curl_easy_init(); - if(ch) { - curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L); - curl_easy_setopt(ch, CURLOPT_HEADER, 0L); - curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L); - curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, writefunction); - curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout); - curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, writefunction); - curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr); - curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM"); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); + curl_easy_setopt(curl, CURLOPT_HEADER, 0L); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunction); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, writefunction); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, stderr); + curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); /* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is no CA certificate */ - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(ch, CURLOPT_SSLKEYTYPE, "PEM"); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM"); /* first try: retrieve page without user certificate and key -> fails */ - res = curl_easy_perform(ch); + res = curl_easy_perform(curl); if(res == CURLE_OK) printf("*** transfer succeeded ***\n"); else @@ -193,14 +193,14 @@ int main(void) * load the certificate and key by installing a function doing * the necessary "modifications" to the SSL CONTEXT just before link init */ - curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, sslctx_function); - res = curl_easy_perform(ch); + curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctx_function); + res = curl_easy_perform(curl); if(res == CURLE_OK) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); - curl_easy_cleanup(ch); + curl_easy_cleanup(curl); } curl_global_cleanup(); return (int)res; diff --git a/docs/examples/websocket-cb.c b/docs/examples/websocket-cb.c index aa81d89ab126..78899826fb53 100644 --- a/docs/examples/websocket-cb.c +++ b/docs/examples/websocket-cb.c @@ -28,11 +28,11 @@ #include #include -static size_t writecb(char *b, size_t size, size_t nitems, void *p) +static size_t write_cb(char *b, size_t size, size_t nitems, void *p) { - CURL *easy = p; + CURL *curl = p; size_t i; - const struct curl_ws_frame *frame = curl_ws_meta(easy); + const struct curl_ws_frame *frame = curl_ws_meta(curl); fprintf(stderr, "Type: %s\n", frame->flags & CURLWS_BINARY ? "binary" : "text"); fprintf(stderr, "Bytes: %u", (unsigned int)(nitems * size)); @@ -53,7 +53,7 @@ int main(void) if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "wss://example.com"); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* pass the easy handle to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); diff --git a/docs/examples/websocket-updown.c b/docs/examples/websocket-updown.c index f95c151cacd1..88d7b6e6e9f4 100644 --- a/docs/examples/websocket-updown.c +++ b/docs/examples/websocket-updown.c @@ -29,12 +29,12 @@ #include #include -static size_t writecb(char *b, size_t size, size_t nitems, void *p) +static size_t write_cb(char *b, size_t size, size_t nitems, void *p) { - CURL *easy = p; + CURL *curl = p; size_t i; unsigned int blen = (unsigned int)(nitems * size); - const struct curl_ws_frame *frame = curl_ws_meta(easy); + const struct curl_ws_frame *frame = curl_ws_meta(curl); fprintf(stderr, "Type: %s\n", frame->flags & CURLWS_BINARY ? "binary" : "text"); if(frame->flags & CURLWS_BINARY) { @@ -49,13 +49,13 @@ static size_t writecb(char *b, size_t size, size_t nitems, void *p) } struct read_ctx { - CURL *easy; + CURL *curl; char buf[1024]; size_t blen; size_t nsent; }; -static size_t readcb(char *buf, size_t nitems, size_t buflen, void *p) +static size_t read_cb(char *buf, size_t nitems, size_t buflen, void *p) { struct read_ctx *ctx = p; size_t len = nitems * buflen; @@ -65,7 +65,7 @@ static size_t readcb(char *buf, size_t nitems, size_t buflen, void *p) if(!ctx->nsent) { /* On first call, set the FRAME information to be used (it defaults * to CURLWS_BINARY otherwise). */ - result = curl_ws_start_frame(ctx->easy, CURLWS_TEXT, + result = curl_ws_start_frame(ctx->curl, CURLWS_TEXT, (curl_off_t)ctx->blen); if(result) { fprintf(stderr, "error starting frame: %d\n", result); @@ -85,7 +85,7 @@ static size_t readcb(char *buf, size_t nitems, size_t buflen, void *p) int main(int argc, const char *argv[]) { - CURL *easy; + CURL *curl; struct read_ctx rctx; const char *payload = "Hello, friend!"; @@ -95,33 +95,33 @@ int main(int argc, const char *argv[]) memset(&rctx, 0, sizeof(rctx)); - easy = curl_easy_init(); - if(easy) { + curl = curl_easy_init(); + if(curl) { if(argc == 2) - curl_easy_setopt(easy, CURLOPT_URL, argv[1]); + curl_easy_setopt(curl, CURLOPT_URL, argv[1]); else - curl_easy_setopt(easy, CURLOPT_URL, "wss://example.com"); + curl_easy_setopt(curl, CURLOPT_URL, "wss://example.com"); - curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, writecb); - curl_easy_setopt(easy, CURLOPT_WRITEDATA, easy); - curl_easy_setopt(easy, CURLOPT_READFUNCTION, readcb); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* tell curl that we want to send the payload */ - rctx.easy = easy; + rctx.curl = curl; rctx.blen = strlen(payload); memcpy(rctx.buf, payload, rctx.blen); - curl_easy_setopt(easy, CURLOPT_READDATA, &rctx); - curl_easy_setopt(easy, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl, CURLOPT_READDATA, &rctx); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Perform the request, res gets the return code */ - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); } curl_global_cleanup(); return (int)res; diff --git a/docs/examples/xmlstream.c b/docs/examples/xmlstream.c index 1131a3ce9e76..04fc3afd8580 100644 --- a/docs/examples/xmlstream.c +++ b/docs/examples/xmlstream.c @@ -95,8 +95,8 @@ static void endElement(void *userData, const XML_Char *name) printf("%5lu %10lu %s\n", state->depth, state->characters.size, name); } -static size_t parseStreamCallback(void *contents, size_t length, size_t nmemb, - void *userp) +static size_t write_cb(void *contents, size_t length, size_t nmemb, + void *userp) { XML_Parser parser = (XML_Parser) userp; size_t real_size = length * nmemb; @@ -116,14 +116,14 @@ static size_t parseStreamCallback(void *contents, size_t length, size_t nmemb, int main(void) { - CURL *curl_handle; + CURL *curl; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) return (int)res; /* Initialize a libcurl handle. */ - curl_handle = curl_easy_init(); + curl = curl_easy_init(); if(curl) { XML_Parser parser; struct ParserStruct state; @@ -138,15 +138,15 @@ int main(void) XML_SetElementHandler(parser, startElement, endElement); XML_SetCharacterDataHandler(parser, characterDataHandler); - curl_easy_setopt(curl_handle, CURLOPT_URL, + curl_easy_setopt(curl, CURLOPT_URL, "https://www.w3schools.com/xml/simple.xml"); - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, parseStreamCallback); - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)parser); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)parser); printf("Depth Characters Closing Tag\n"); /* Perform the request and any follow-up parsing. */ - res = curl_easy_perform(curl_handle); + res = curl_easy_perform(curl); if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); @@ -168,7 +168,7 @@ int main(void) free(state.characters.memory); XML_ParserFree(parser); - curl_easy_cleanup(curl_handle); + curl_easy_cleanup(curl); } curl_global_cleanup(); From d29f14b9cf0d38f3887b6eadc71af16903bc7f5b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 00:55:13 +0100 Subject: [PATCH 184/885] tests: replace significant invisible spaces with macros To make them explicit, visible, avoid being accidentally trimmed. Also prevents Git warnings, e.g. on `git am`. Also: - runtests: add support for `%spc%` and `%tab%` macros. - test59: delete non-significant line-ending space. - spacecheck.pl: drop line-ending whitespace exception for tests. Closes #19300 --- .github/scripts/spacecheck.pl | 7 +------ docs/tests/FILEFORMAT.md | 8 ++++++++ tests/data/test1029 | 2 +- tests/data/test1070 | 2 +- tests/data/test1185 | 8 ++++---- tests/data/test136 | 2 +- tests/data/test1461 | 4 ++-- tests/data/test1654 | 2 +- tests/data/test1664 | 2 +- tests/data/test17 | 2 +- tests/data/test188 | 4 ++-- tests/data/test189 | 4 ++-- tests/data/test1940 | 8 ++++---- tests/data/test1941 | 2 +- tests/data/test1942 | 2 +- tests/data/test1944 | 2 +- tests/data/test1945 | 2 +- tests/data/test1946 | 2 +- tests/data/test1947 | 2 +- tests/data/test1955 | 2 +- tests/data/test1958 | 2 +- tests/data/test2302 | 2 +- tests/data/test2306 | 2 +- tests/data/test2400 | 2 +- tests/data/test2403 | 2 +- tests/data/test2406 | 2 +- tests/data/test2500 | 2 +- tests/data/test2503 | 2 +- tests/data/test378 | 2 +- tests/data/test4 | 4 ++-- tests/data/test421 | 2 +- tests/data/test459 | 2 +- tests/data/test46 | 8 ++++---- tests/data/test54 | 2 +- tests/data/test57 | 2 +- tests/data/test59 | 2 +- tests/data/test689 | 4 ++-- tests/data/test769 | 2 +- tests/data/test792 | 2 +- tests/data/test793 | 2 +- tests/testutil.pm | 3 +++ 41 files changed, 64 insertions(+), 58 deletions(-) diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl index fbd064db3ba2..fc1bf8f76cd1 100755 --- a/.github/scripts/spacecheck.pl +++ b/.github/scripts/spacecheck.pl @@ -42,10 +42,6 @@ "\\.(bat|sln)\$", ); -my @space_at_eol = ( - "^tests/data/test", -); - my @non_ascii_allowed = ( '\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS ); @@ -129,8 +125,7 @@ sub eol_detect { push @err, "content: must use LF EOL for this file type"; } - if(!fn_match($filename, @space_at_eol) && - $content =~ /[ \t]\n/) { + if($content =~ /[ \t]\n/) { my $line; for my $l (split(/\n/, $content)) { $line++; diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 91aa9a587028..cbc922105667 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -76,6 +76,14 @@ For example, to insert the word hello 100 times: %repeat[100 x hello]% +## Whitespace + +To add significant whitespace characters at the end of the line, or to empty +lines: + + %spc% + %tab% + ## Insert capped epoch days Mostly to test capped cookie expire dates: `%days[NUM]` inserts the number of diff --git a/tests/data/test1029 b/tests/data/test1029 index f37146a74787..d019bff7b187 100644 --- a/tests/data/test1029 +++ b/tests/data/test1029 @@ -50,7 +50,7 @@ Content-Length: 62 Connection: close This server reply is for testing a simple Location: following -http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER 0 +http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER 0%spc% diff --git a/tests/data/test1070 b/tests/data/test1070 index 7f2b4fb09b3f..f199e71d4bd2 100644 --- a/tests/data/test1070 +++ b/tests/data/test1070 @@ -57,7 +57,7 @@ Expect: 100-continue Content-Length: 2313 Content-Type: application/x-www-form-urlencoded -This creates +This creates%spc% diff --git a/tests/data/test1185 b/tests/data/test1185 index 7323c59a0dce..c00e982301d2 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -91,7 +91,7 @@ void startfunc(int a, int b) { ./%LOGDIR/code1185.c:4:82: warning: Longer than 79 columns (LONGLINE) int hello; /*------------------------------------------------------------------*/ ./%LOGDIR/code1185.c:5:4: error: Contains TAB character (TABS) - int tab; + int%tab%tab; ^ ./%LOGDIR/code1185.c:7:13: warning: func with space (SPACEBEFOREPAREN) int a = func (); @@ -118,7 +118,7 @@ void startfunc(int a, int b) { } else { ^ ./%LOGDIR/code1185.c:24:11: warning: missing space after close paren (PARENBRACE) - if(a == 2){ + if(a == 2){%spc%%spc% ^ ./%LOGDIR/code1185.c:28:14: warning: no space before semicolon (SPACESEMICOLON) func_return() ; @@ -205,10 +205,10 @@ void startfunc(int a, int b) { // CPP comment ? ^ ./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT) - +%spc% ^ ./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT) - +%spc% ^ checksrc: 0 errors and 41 warnings diff --git a/tests/data/test136 b/tests/data/test136 index 949ae2ebb2d4..70537719cce8 100644 --- a/tests/data/test136 +++ b/tests/data/test136 @@ -30,7 +30,7 @@ FTP with user and no password USER user -PASS +PASS%spc% PWD EPSV TYPE I diff --git a/tests/data/test1461 b/tests/data/test1461 index 79b370bc1816..71de31772dd7 100644 --- a/tests/data/test1461 +++ b/tests/data/test1461 @@ -47,8 +47,8 @@ Usage: curl [options...] This is not the full help; this menu is split into categories. Use "--help category" to get an overview of all categories, which are: -auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap, -output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls, +auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap,%spc% +output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls,%spc% upload, verbose. Use "--help all" to list all options Use "--help [option]" to view documentation for a given option diff --git a/tests/data/test1654 b/tests/data/test1654 index 5659277ce3c1..3b8823644167 100644 --- a/tests/data/test1654 +++ b/tests/data/test1654 @@ -27,7 +27,7 @@ h2 example.com 443 h3 shiny.example.com 8443 "20191231 00:00:00" 0 0 # a comment h2 foo.example.com 443 h3 shiny.example.com 8443 "20291231 23:30:00" 0 0 h1 example.com 443 h3 shiny.example.com 8443 "20121231 00:00:01" 0 0 - h3 example.com 443 h3 shiny.example.com 8443 "20131231 00:00:00" 0 0 +%tab%h3 example.com 443 h3 shiny.example.com 8443 "20131231 00:00:00" 0 0 # also a comment bad example.com 443 h3 shiny.example.com 8443 "20191231 00:00:00" 0 0 rubbish diff --git a/tests/data/test1664 b/tests/data/test1664 index b36ef3597d1d..ea126a3be757 100644 --- a/tests/data/test1664 +++ b/tests/data/test1664 @@ -68,7 +68,7 @@ curlx_str_singlespace 3: ("b") 5, line 0 4: ("\") 5, line 0 5: (" ") 0, line 1 -6: (" ") 5, line 0 +6: ("%tab%") 5, line 0 7: (" ") 5, line 0 8: ("") 5, line 0 diff --git a/tests/data/test17 b/tests/data/test17 index 97a37d85cfd5..c8c0a19b77fc 100644 --- a/tests/data/test17 +++ b/tests/data/test17 @@ -46,7 +46,7 @@ request MOOO MOOO /that.site.com/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT -User-Agent: agent007 license to drill +User-Agent: agent007 license to drill%tab% Accept: */* diff --git a/tests/data/test188 b/tests/data/test188 index 43fa70e726f7..2fca25112904 100644 --- a/tests/data/test188 +++ b/tests/data/test188 @@ -19,7 +19,7 @@ Content-Length: 3 OK -HTTP/1.1 200 OK +HTTP/1.1 200 OK%spc% Connection: close Content-Length: 15 Content-Range: bytes 50- @@ -32,7 +32,7 @@ HTTP/1.1 301 OK swsbounce Location: /%TESTNUMBER Content-Length: 3 -HTTP/1.1 200 OK +HTTP/1.1 200 OK%spc% Connection: close Content-Length: 15 Content-Range: bytes 50- diff --git a/tests/data/test189 b/tests/data/test189 index 6ca4b66e1733..d3cd0f2b2c14 100644 --- a/tests/data/test189 +++ b/tests/data/test189 @@ -16,7 +16,7 @@ Content-Length: 3 OK -HTTP/1.1 200 OK +HTTP/1.1 200 OK%spc% Connection: close Content-Length: 15 @@ -28,7 +28,7 @@ HTTP/1.1 301 OK swsbounce Location: /%TESTNUMBER Content-Length: 3 -HTTP/1.1 200 OK +HTTP/1.1 200 OK%spc% Connection: close Content-Length: 15 diff --git a/tests/data/test1940 b/tests/data/test1940 index f4c6dd1a1a6b..d15bf1d5b60f 100644 --- a/tests/data/test1940 +++ b/tests/data/test1940 @@ -10,10 +10,10 @@ curl_easy_header HTTP/1.1 200 OK Date: Thu, 09 Nov 2010 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Fold: is - folding a + folding a%repeat[5 x ]% line Content-Length: 0 Set-Cookie: onecookie=data; @@ -59,8 +59,8 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - Set-Cookie == secondcookie=2data; (1/3) - Set-Cookie == cookie3=data3; (2/3) Fold == is folding a line - Blank == - Blank2 == + Blank ==%spc% + Blank2 ==%spc% diff --git a/tests/data/test1941 b/tests/data/test1941 index fe3f1de3917c..9ef4b3b1e4b6 100644 --- a/tests/data/test1941 +++ b/tests/data/test1941 @@ -11,7 +11,7 @@ CONNECT HTTP/1.1 200 OK Date: Thu, 09 Nov 2010 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Content-Length: 0 Set-Cookie: onecookie=data; diff --git a/tests/data/test1942 b/tests/data/test1942 index 907980099046..7729ff80e6fd 100644 --- a/tests/data/test1942 +++ b/tests/data/test1942 @@ -15,7 +15,7 @@ Server: maybe different HTTP/1.1 200 OK Date: Thu, 09 Nov 2010 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Content-Length: 0 Set-Cookie: onecookie=data; diff --git a/tests/data/test1944 b/tests/data/test1944 index ad0920d4ae76..a5c1673c7939 100644 --- a/tests/data/test1944 +++ b/tests/data/test1944 @@ -10,7 +10,7 @@ curl_easy_header HTTP/1.1 302 OK Date: Thu, 01 Nov 2001 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Content-Length: 0 Set-Cookie: onecookie=data; diff --git a/tests/data/test1945 b/tests/data/test1945 index 86fa147adcf0..1b30965f609c 100644 --- a/tests/data/test1945 +++ b/tests/data/test1945 @@ -11,7 +11,7 @@ CONNECT HTTP/1.1 200 OK Date: Thu, 09 Nov 2010 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Content-Length: 0 Set-Cookie: onecookie=data; diff --git a/tests/data/test1946 b/tests/data/test1946 index 20854e16bad8..35ca1672bd86 100644 --- a/tests/data/test1946 +++ b/tests/data/test1946 @@ -10,7 +10,7 @@ curl_easy_header HTTP/1.1 302 OK Date: Thu, 01 Nov 2001 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Content-Length: 0 Set-Cookie: onecookie=data; diff --git a/tests/data/test1947 b/tests/data/test1947 index f159e4d51cd8..49e28c14aafc 100644 --- a/tests/data/test1947 +++ b/tests/data/test1947 @@ -10,7 +10,7 @@ curl_easy_nextheader HTTP/1.1 302 OK Date: Thu, 01 Nov 2001 14:49:00 GMT -Server: test with trailing space +Server: test with trailing space%repeat[5 x ]% Content-Type: text/html Content-Length: 0 Set-Cookie: onecookie=data; diff --git a/tests/data/test1955 b/tests/data/test1955 index 2266529bbe36..be23a9d62841 100644 --- a/tests/data/test1955 +++ b/tests/data/test1955 @@ -66,7 +66,7 @@ Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, S X-Xxx-Date: 19700101T000000Z test3: 1234 test2: -test_space: t s m end +test_space: t%tab%s m%tab% end%repeat[4 x ]% tesMixCase: MixCase diff --git a/tests/data/test1958 b/tests/data/test1958 index 239a11eccb2f..23aa849444a6 100644 --- a/tests/data/test1958 +++ b/tests/data/test1958 @@ -64,7 +64,7 @@ GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff X-Xxx-Date: 19700101T000000Z -X-Xxx-Content-Sha256: arbitrary +X-Xxx-Content-Sha256: %tab%arbitrary%spc% diff --git a/tests/data/test2302 b/tests/data/test2302 index 117b5a7ebfed..0b3a7d524e43 100644 --- a/tests/data/test2302 +++ b/tests/data/test2302 @@ -66,7 +66,7 @@ Connection: Upgrade %hex[%8a%808321]hex% -68 65 6c 6c 6f +68 65 6c 6c 6f%spc% RECFLAGS: 1 diff --git a/tests/data/test2306 b/tests/data/test2306 index 0f7bd541dfac..c6bbdb0f2b5c 100644 --- a/tests/data/test2306 +++ b/tests/data/test2306 @@ -24,7 +24,7 @@ Funny-head: yesyes HTTP/1.1 200 OK swsclose - Access-Control-Allow-Origin: * +%tab%Access-Control-Allow-Origin: * Connection: Keep-Alive Content-Type: text/html; charset=utf-8 Date: Wed, 10 May 2023 14:58:08 GMT diff --git a/tests/data/test2400 b/tests/data/test2400 index 9d53f68b96c5..cb68a11e213f 100644 --- a/tests/data/test2400 +++ b/tests/data/test2400 @@ -50,7 +50,7 @@ HTTP/2 GET over HTTPS # Verify data after the test has been "shot" -HTTP/2 200 +HTTP/2 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test2403 b/tests/data/test2403 index 5901866265cb..dec03cd51ceb 100644 --- a/tests/data/test2403 +++ b/tests/data/test2403 @@ -51,7 +51,7 @@ HTTP/2 GET using %{header_json} # Verify data after the test has been "shot" -HTTP/2 200 +HTTP/2 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test2406 b/tests/data/test2406 index bc6cc41ad28d..a6db9233efcd 100644 --- a/tests/data/test2406 +++ b/tests/data/test2406 @@ -49,7 +49,7 @@ HTTP/2 over HTTPS with -f # Verify data after the test has been "shot" -HTTP/2 404 +HTTP/2 404%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test2500 b/tests/data/test2500 index 8bcb5e0c62f9..ad6f0b7e1adf 100644 --- a/tests/data/test2500 +++ b/tests/data/test2500 @@ -58,7 +58,7 @@ Accept: */* -HTTP/3 200 +HTTP/3 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT last-modified: Tue, 13 Jun 2000 12:10:00 GMT etag: "21025-dc7-39462498" diff --git a/tests/data/test2503 b/tests/data/test2503 index f95486ce0f97..28a1f973b506 100644 --- a/tests/data/test2503 +++ b/tests/data/test2503 @@ -50,7 +50,7 @@ HTTP/3 header-api # Verify data after the test has been "shot" -HTTP/3 200 +HTTP/3 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test378 b/tests/data/test378 index 9777b878b966..e15e97e6e02b 100644 --- a/tests/data/test378 +++ b/tests/data/test378 @@ -29,7 +29,7 @@ Reject using -T and -d at once 2 -Warning: You can only select one HTTP request method! You asked for both PUT +Warning: You can only select one HTTP request method! You asked for both PUT%spc% Warning: (-T, --upload-file) and POST (-d, --data). diff --git a/tests/data/test4 b/tests/data/test4 index 06012cca862b..4f57f8dd628c 100644 --- a/tests/data/test4 +++ b/tests/data/test4 @@ -44,7 +44,7 @@ User-Agent: curl/%VERSION extra-header: here Accept: replaced X-Custom-Header: -X-Test: foo; +X-Test: foo;%spc% X-Test2: foo; GET /%TESTNUMBER HTTP/1.1 @@ -53,7 +53,7 @@ User-Agent: curl/%VERSION extra-header: here Accept: replaced X-Custom-Header: -X-Test: foo; +X-Test: foo;%spc% X-Test2: foo; diff --git a/tests/data/test421 b/tests/data/test421 index 2c79c1f8f16d..b9483e6ba006 100644 --- a/tests/data/test421 +++ b/tests/data/test421 @@ -21,7 +21,7 @@ referrer-policy: strict-origin-when-cross-origin access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS access-control-max-age: 1728000 access-control-allow-headers: Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS -access-control-expose-headers: +access-control-expose-headers:%spc% vary: Accept etag: W/"2678f9ab2ba550d164e7cc014aefd31e" cache-control: max-age=0, private, must-revalidate diff --git a/tests/data/test459 b/tests/data/test459 index 198e67d2a3e0..d1f1ba261ce5 100644 --- a/tests/data/test459 +++ b/tests/data/test459 @@ -56,7 +56,7 @@ Content-Type: application/x-www-form-urlencoded arg -Warning: %LOGDIR/config:1: warning: 'data' uses unquoted whitespace. This may +Warning: %LOGDIR/config:1: warning: 'data' uses unquoted whitespace. This may%spc% Warning: cause side-effects. Consider double quotes. diff --git a/tests/data/test46 b/tests/data/test46 index 30d88b973d90..d426503fe7e4 100644 --- a/tests/data/test46 +++ b/tests/data/test46 @@ -65,7 +65,7 @@ www.loser.com FALSE / FALSE 2139150993 UID 99 domain..tld FALSE / FALSE 2139150993 mooo indeed #HttpOnly_domain..tld FALSE /want FALSE 2139150993 mooo2 indeed2 %endif -domain..tld FALSE /want FALSE 0 empty +domain..tld FALSE /want FALSE 0 empty%tab% cookies @@ -88,18 +88,18 @@ Cookie: empty=; mooo2=indeed2; mooo=indeed # This file was generated by libcurl! Edit at your own risk. domain..tld FALSE /want/ FALSE 0 simplyhuge %repeat[3998 x z]% -domain..tld FALSE / FALSE 0 justaname +domain..tld FALSE / FALSE 0 justaname%tab% domain..tld FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ GKNBDIFAAOFDPDAIEAKDIBKE domain..tld FALSE / FALSE 0 ckySession temporary domain..tld FALSE / FALSE %days[400] ckyPersistent permanent %if large-time -domain..tld FALSE /want FALSE 0 empty +domain..tld FALSE /want FALSE 0 empty%tab% #HttpOnly_domain..tld FALSE /want FALSE 22139150993 mooo2 indeed2 domain..tld FALSE / FALSE 22139150993 mooo indeed www.loser.com FALSE / FALSE 22139150993 UID 99 www.fake.come FALSE / FALSE 22147483647 cookiecliente si %else -domain..tld FALSE /want FALSE 0 empty +domain..tld FALSE /want FALSE 0 empty%tab% #HttpOnly_domain..tld FALSE /want FALSE 2139150993 mooo2 indeed2 domain..tld FALSE / FALSE 2139150993 mooo indeed www.loser.com FALSE / FALSE 2139150993 UID 99 diff --git a/tests/data/test54 b/tests/data/test54 index 478e52a32cb6..c0be2d624e28 100644 --- a/tests/data/test54 +++ b/tests/data/test54 @@ -11,7 +11,7 @@ followlocation HTTP/1.1 302 This is a weirdo text message swsclose Connection: close -Location: +Location:%spc% This server reply is for testing diff --git a/tests/data/test57 b/tests/data/test57 index d3360096b93d..a28d6321e2c3 100644 --- a/tests/data/test57 +++ b/tests/data/test57 @@ -12,7 +12,7 @@ HTTP GET HTTP/1.1 200 OK swsclose Funny-head: yesyes -Content-Type: text/html; charset=ISO-8859-4 +Content-Type: text/html; charset=ISO-8859-4%repeat[3 x ]% diff --git a/tests/data/test59 b/tests/data/test59 index 6ccb1ce37f32..4211b4e6d204 100644 --- a/tests/data/test59 +++ b/tests/data/test59 @@ -13,7 +13,7 @@ HTTP/1.0 200 OK swsclose Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake -hej +hej diff --git a/tests/data/test689 b/tests/data/test689 index 61e57fce4ab4..141e92a9e6a9 100644 --- a/tests/data/test689 +++ b/tests/data/test689 @@ -11,9 +11,9 @@ OPTIONS # Server-side -RTSP/1.0 786 +RTSP/1.0 786%repeat[10 x ]% -RTSP/ +RTSP/%repeat[10 x ]% diff --git a/tests/data/test769 b/tests/data/test769 index 773d741e3fee..189bf95d81a8 100644 --- a/tests/data/test769 +++ b/tests/data/test769 @@ -16,7 +16,7 @@ Server: test-server/fake Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT ETag: "21025-dc7-39462498" Accept-Ranges: bytes -Content-Length: 6 +Content-Length: 6%repeat[5 x ]% Connection: close Content-Type: text/html Funny-head: yesyes diff --git a/tests/data/test792 b/tests/data/test792 index a7656e4781c3..b3630b505852 100644 --- a/tests/data/test792 +++ b/tests/data/test792 @@ -36,7 +36,7 @@ machine %HOSTIP login username password%hex[%00]hex% hello USER username -PASS +PASS%spc% PWD EPSV TYPE I diff --git a/tests/data/test793 b/tests/data/test793 index ad68a0f4e19e..3a3e16e08775 100644 --- a/tests/data/test793 +++ b/tests/data/test793 @@ -36,7 +36,7 @@ machine %HOSTIP login username "password"%hex[%00]hex% hello USER username -PASS +PASS%spc% PWD EPSV TYPE I diff --git a/tests/testutil.pm b/tests/testutil.pm index 3477d5bb57f8..92f031ded343 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -147,6 +147,9 @@ sub subbase64 { $$thing =~ s/%%DAYS%%/%alternatives[$d,$d2]/; } + $$thing =~ s/%spc%/ /g; # space + $$thing =~ s/%tab%/\t/g; # horizontal tab + # include a file $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1)/ge; } From 70f240b2ed835a5f88968f1ea2e0239f9724c9f0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 17:36:27 +0100 Subject: [PATCH 185/885] tests/libtest/cli*: fix init/deinit, leaks, and more - add global init and deinit where missing. - check global init success. - improve cleaning up on error codepaths. - drop `CLI_ERR()` macro, that could quit. Also make error messages tell the reason. Closes #19309 --- tests/libtest/cli_h2_pausing.c | 73 ++++++++++++++++---------- tests/libtest/cli_h2_serverpush.c | 34 +++++++++--- tests/libtest/cli_h2_upgrade_extreme.c | 13 +++-- tests/libtest/cli_hx_download.c | 59 +++++++++++++-------- tests/libtest/cli_hx_upload.c | 67 ++++++++++++++--------- tests/libtest/cli_tls_session_reuse.c | 20 ++++--- tests/libtest/cli_upload_pausing.c | 41 +++++++++------ tests/libtest/cli_ws_data.c | 27 +++++----- tests/libtest/cli_ws_pingpong.c | 17 +++--- 9 files changed, 224 insertions(+), 127 deletions(-) diff --git a/tests/libtest/cli_h2_pausing.c b/tests/libtest/cli_h2_pausing.c index 8cc440daacfc..c3a51cf4da6d 100644 --- a/tests/libtest/cli_h2_pausing.c +++ b/tests/libtest/cli_h2_pausing.c @@ -80,21 +80,15 @@ static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) return realsize; } -#define CLI_ERR() \ - do { \ - curl_mfprintf(stderr, "something unexpected went wrong - bailing out!\n");\ - return (CURLcode)2; \ - } while(0) - static CURLcode test_cli_h2_pausing(const char *URL) { struct handle handles[2]; - CURLM *multi_handle; + CURLM *multi_handle = NULL; int still_running = 1, msgs_left, numfds; size_t i; CURLMsg *msg; int rounds = 0; - CURLcode rc = CURLE_OK; + CURLcode result = CURLE_OK; CURLU *cu; struct curl_slist *resolve = NULL; char resolve_buf[1024]; @@ -139,25 +133,35 @@ static CURLcode test_cli_h2_pausing(const char *URL) } url = test_argv[0]; - curl_global_init(CURL_GLOBAL_DEFAULT); + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } + curl_global_trace("ids,time,http/2,http/3"); + memset(handles, 0, sizeof(handles)); + cu = curl_url(); if(!cu) { curl_mfprintf(stderr, "out of memory\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_set(cu, CURLUPART_URL, url, 0)) { curl_mfprintf(stderr, "not a URL: '%s'\n", url); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) { curl_mfprintf(stderr, "could not get host of '%s'\n", url); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) { curl_mfprintf(stderr, "could not get port of '%s'\n", url); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } memset(&resolve, 0, sizeof(resolve)); curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", @@ -183,24 +187,35 @@ static CURLcode test_cli_h2_pausing(const char *URL) curl_easy_setopt(handles[i].h, CURLOPT_RESOLVE, resolve) != CURLE_OK || curl_easy_setopt(handles[i].h, CURLOPT_PIPEWAIT, 1L) || curl_easy_setopt(handles[i].h, CURLOPT_URL, url) != CURLE_OK) { - CLI_ERR(); + curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n"); + result = (CURLcode)2; + goto cleanup; } curl_easy_setopt(handles[i].h, CURLOPT_HTTP_VERSION, http_version); } multi_handle = curl_multi_init(); - if(!multi_handle) - CLI_ERR(); + if(!multi_handle) { + curl_mfprintf(stderr, "curl_multi_init() failed - bailing out\n"); + result = (CURLcode)2; + goto cleanup; + } for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { - if(curl_multi_add_handle(multi_handle, handles[i].h) != CURLM_OK) - CLI_ERR(); + if(curl_multi_add_handle(multi_handle, handles[i].h) != CURLM_OK) { + curl_mfprintf(stderr, "curl_multi_add_handle() failed - bailing out\n"); + result = (CURLcode)2; + goto cleanup; + } } for(rounds = 0;; rounds++) { curl_mfprintf(stderr, "INFO: multi_perform round %d\n", rounds); - if(curl_multi_perform(multi_handle, &still_running) != CURLM_OK) - CLI_ERR(); + if(curl_multi_perform(multi_handle, &still_running) != CURLM_OK) { + curl_mfprintf(stderr, "curl_multi_perform() failed - bailing out\n"); + result = (CURLcode)2; + goto cleanup; + } if(!still_running) { int as_expected = 1; @@ -228,13 +243,16 @@ static CURLcode test_cli_h2_pausing(const char *URL) if(!as_expected) { curl_mfprintf(stderr, "ERROR: handles not in expected state " "after %d rounds\n", rounds); - rc = (CURLcode)1; + result = (CURLcode)1; } break; } - if(curl_multi_poll(multi_handle, NULL, 0, 100, &numfds) != CURLM_OK) - CLI_ERR(); + if(curl_multi_poll(multi_handle, NULL, 0, 100, &numfds) != CURLM_OK) { + curl_mfprintf(stderr, "curl_multi_poll() failed - bailing out\n"); + result = (CURLcode)2; + goto cleanup; + } /* !checksrc! disable EQUALSNULL 1 */ while((msg = curl_multi_info_read(multi_handle, &msgs_left)) != NULL) { @@ -246,8 +264,8 @@ static CURLcode test_cli_h2_pausing(const char *URL) "resumed=%d, result %d - wtf?\n", i, handles[i].paused, handles[i].resumed, msg->data.result); - rc = (CURLcode)1; - goto out; + result = (CURLcode)1; + goto cleanup; } } } @@ -278,7 +296,8 @@ static CURLcode test_cli_h2_pausing(const char *URL) } } -out: +cleanup: + for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { curl_multi_remove_handle(multi_handle, handles[i].h); curl_easy_cleanup(handles[i].h); @@ -291,5 +310,5 @@ static CURLcode test_cli_h2_pausing(const char *URL) curl_multi_cleanup(multi_handle); curl_global_cleanup(); - return rc; + return result; } diff --git a/tests/libtest/cli_h2_serverpush.c b/tests/libtest/cli_h2_serverpush.c index 10d369faafe4..59688447b116 100644 --- a/tests/libtest/cli_h2_serverpush.c +++ b/tests/libtest/cli_h2_serverpush.c @@ -26,7 +26,7 @@ #include "testtrace.h" #include "memdebug.h" -static FILE *out_download; +static FILE *out_download = NULL; static int setup_h2_serverpush(CURL *hnd, const char *url) { @@ -52,7 +52,7 @@ static int setup_h2_serverpush(CURL *hnd, const char *url) return 0; /* all is good */ } -static FILE *out_push; +static FILE *out_push = NULL; /* called when there is an incoming push */ static int server_push_callback(CURL *parent, @@ -106,9 +106,10 @@ static int server_push_callback(CURL *parent, */ static CURLcode test_cli_h2_serverpush(const char *URL) { - CURL *easy; + CURL *easy = NULL; CURLM *multi_handle; int transfers = 1; /* we start with one */ + CURLcode result = CURLE_OK; debug_config.nohex = TRUE; debug_config.tracetime = FALSE; @@ -118,13 +119,27 @@ static CURLcode test_cli_h2_serverpush(const char *URL) return (CURLcode)2; } + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } + multi_handle = curl_multi_init(); + if(!multi_handle) { + result = (CURLcode)1; + goto cleanup; + } easy = curl_easy_init(); + if(!easy) { + result = (CURLcode)1; + goto cleanup; + } + if(setup_h2_serverpush(easy, URL)) { - curlx_fclose(out_download); curl_mfprintf(stderr, "failed\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); @@ -163,11 +178,16 @@ static CURLcode test_cli_h2_serverpush(const char *URL) } while(transfers); /* as long as we have transfers going */ +cleanup: + curl_multi_cleanup(multi_handle); - curlx_fclose(out_download); + if(out_download) + curlx_fclose(out_download); if(out_push) curlx_fclose(out_push); - return CURLE_OK; + curl_global_cleanup(); + + return result; } diff --git a/tests/libtest/cli_h2_upgrade_extreme.c b/tests/libtest/cli_h2_upgrade_extreme.c index f6b277424fd2..7dc8f67816a7 100644 --- a/tests/libtest/cli_h2_upgrade_extreme.c +++ b/tests/libtest/cli_h2_upgrade_extreme.c @@ -43,13 +43,18 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) CURLMsg *msg; int msgs_in_queue; char range[128]; - CURLcode exitcode = (CURLcode)1; + CURLcode result = (CURLcode)1; if(!URL) { curl_mfprintf(stderr, "need URL as argument\n"); return (CURLcode)2; } + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } + multi = curl_multi_init(); if(!multi) { curl_mfprintf(stderr, "curl_multi_init failed\n"); @@ -144,7 +149,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) } while(running_handles > 0 || start_count); curl_mfprintf(stderr, "exiting\n"); - exitcode = CURLE_OK; + result = CURLE_OK; cleanup: @@ -161,5 +166,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) curl_multi_cleanup(multi); } - return exitcode; + curl_global_cleanup(); + + return result; } diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index 5ab4db024c58..a12d0e95c286 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -278,9 +278,9 @@ static void usage_hx_download(const char *msg) */ static CURLcode test_cli_hx_download(const char *URL) { - CURLM *multi_handle; + CURLM *multi_handle = NULL; struct CURLMsg *m; - CURLSH *share; + CURLSH *share = NULL; const char *url; size_t i, n, max_parallel = 1; size_t active_transfers; @@ -288,7 +288,7 @@ static CURLcode test_cli_hx_download(const char *URL) size_t abort_offset = 0; size_t fail_offset = 0; int abort_paused = 0, use_earlydata = 0; - struct transfer_d *t; + struct transfer_d *t = NULL; long http_version = CURL_HTTP_VERSION_2_0; int ch; struct curl_slist *host = NULL; @@ -306,7 +306,7 @@ static CURLcode test_cli_hx_download(const char *URL) case 'h': usage_hx_download(NULL); result = (CURLcode)2; - goto cleanup; + goto optcleanup; case 'a': abort_paused = 1; break; @@ -354,29 +354,34 @@ static CURLcode test_cli_hx_download(const char *URL) else { usage_hx_download("invalid http version"); result = (CURLcode)1; - goto cleanup; + goto optcleanup; } break; } default: usage_hx_download("invalid option"); result = (CURLcode)1; - goto cleanup; + goto optcleanup; } } test_argc -= coptind; test_argv += coptind; - curl_global_init(CURL_GLOBAL_DEFAULT); curl_global_trace("ids,time,http/2,http/3"); if(test_argc != 1) { usage_hx_download("not enough arguments"); result = (CURLcode)2; - goto cleanup; + goto optcleanup; } url = test_argv[0]; + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + result = (CURLcode)3; + goto optcleanup; + } + if(resolve) host = curl_slist_append(NULL, resolve); @@ -525,28 +530,36 @@ static CURLcode test_cli_hx_download(const char *URL) } while(active_transfers); /* as long as we have transfers going */ +cleanup: + curl_multi_cleanup(multi_handle); - for(i = 0; i < transfer_count_d; ++i) { - t = &transfer_d[i]; - if(t->out) { - curlx_fclose(t->out); - t->out = NULL; - } - if(t->easy) { - curl_easy_cleanup(t->easy); - t->easy = NULL; + if(transfer_d) { + for(i = 0; i < transfer_count_d; ++i) { + t = &transfer_d[i]; + if(t->out) { + curlx_fclose(t->out); + t->out = NULL; + } + if(t->easy) { + curl_easy_cleanup(t->easy); + t->easy = NULL; + } + if(t->result) + result = t->result; + else /* on success we expect ssl to have been checked */ + assert(t->checked_ssl); } - if(t->result) - result = t->result; - else /* on success we expect ssl to have been checked */ - assert(t->checked_ssl); + free(transfer_d); } - free(transfer_d); curl_share_cleanup(share); curl_slist_free_all(host); -cleanup: + + curl_global_cleanup(); + +optcleanup: + free(resolve); return result; diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index 5d9c2f26f8b3..646836cb375b 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -241,11 +241,12 @@ static CURLcode test_cli_hx_upload(const char *URL) int reuse_easy = 0; int use_earlydata = 0; int announce_length = 0; - struct transfer_u *t; + struct transfer_u *t = NULL; long http_version = CURL_HTTP_VERSION_2_0; struct curl_slist *host = NULL; const char *resolve = NULL; int ch; + CURLcode result = CURLE_OK; (void)URL; @@ -320,22 +321,27 @@ static CURLcode test_cli_hx_upload(const char *URL) return (CURLcode)2; } - curl_global_init(CURL_GLOBAL_DEFAULT); - curl_global_trace("ids,time,http/2,http/3"); - if(test_argc != 1) { usage_hx_upload("not enough arguments"); return (CURLcode)2; } url = test_argv[0]; + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } + + curl_global_trace("ids,time,http/2,http/3"); + if(resolve) host = curl_slist_append(NULL, resolve); share = curl_share_init(); if(!share) { curl_mfprintf(stderr, "error allocating share\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); @@ -347,7 +353,8 @@ static CURLcode test_cli_hx_upload(const char *URL) transfer_u = calloc(transfer_count_u, sizeof(*transfer_u)); if(!transfer_u) { curl_mfprintf(stderr, "error allocating transfer structs\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } active_transfers = 0; @@ -363,18 +370,20 @@ static CURLcode test_cli_hx_upload(const char *URL) if(reuse_easy) { CURL *easy = curl_easy_init(); - CURLcode rc = CURLE_OK; if(!easy) { curl_mfprintf(stderr, "failed to init easy handle\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } for(i = 0; i < transfer_count_u; ++i) { + CURLcode rc; t = &transfer_u[i]; t->easy = easy; if(setup_hx_upload(t->easy, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } curl_mfprintf(stderr, "[t-%zu] STARTING\n", t->idx); @@ -396,7 +405,8 @@ static CURLcode test_cli_hx_upload(const char *URL) if(!t->easy || setup_hx_upload(t->easy, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } curl_multi_add_handle(multi_handle, t->easy); t->started = 1; @@ -482,7 +492,8 @@ static CURLcode test_cli_hx_upload(const char *URL) host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } curl_multi_add_handle(multi_handle, t->easy); t->started = 1; @@ -503,23 +514,29 @@ static CURLcode test_cli_hx_upload(const char *URL) curl_multi_cleanup(multi_handle); } - for(i = 0; i < transfer_count_u; ++i) { - t = &transfer_u[i]; - if(t->out) { - curlx_fclose(t->out); - t->out = NULL; - } - if(t->easy) { - curl_easy_cleanup(t->easy); - t->easy = NULL; - } - if(t->mime) { - curl_mime_free(t->mime); +cleanup: + + if(transfer_u) { + for(i = 0; i < transfer_count_u; ++i) { + t = &transfer_u[i]; + if(t->out) { + curlx_fclose(t->out); + t->out = NULL; + } + if(t->easy) { + curl_easy_cleanup(t->easy); + t->easy = NULL; + } + if(t->mime) { + curl_mime_free(t->mime); + } } + free(transfer_u); } - free(transfer_u); + curl_share_cleanup(share); curl_slist_free_all(host); + curl_global_cleanup(); - return CURLE_OK; + return result; } diff --git a/tests/libtest/cli_tls_session_reuse.c b/tests/libtest/cli_tls_session_reuse.c index b0b2456ce9d9..21f2c2da8004 100644 --- a/tests/libtest/cli_tls_session_reuse.c +++ b/tests/libtest/cli_tls_session_reuse.c @@ -109,13 +109,18 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) int add_more, waits, ongoing = 0; char *host = NULL, *port = NULL; long http_version = CURL_HTTP_VERSION_1_1; - CURLcode exitcode = (CURLcode)1; + CURLcode result = (CURLcode)1; if(!URL || !libtest_arg2) { curl_mfprintf(stderr, "need args: URL proto\n"); return (CURLcode)2; } + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } + if(!strcmp("h2", libtest_arg2)) http_version = CURL_HTTP_VERSION_2; else if(!strcmp("h3", libtest_arg2)) @@ -124,7 +129,8 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) cu = curl_url(); if(!cu) { curl_mfprintf(stderr, "out of memory\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_set(cu, CURLUPART_URL, URL, 0)) { curl_mfprintf(stderr, "not a URL: '%s'\n", URL); @@ -230,12 +236,12 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) if(!tse_found_tls_session) { curl_mfprintf(stderr, "CURLINFO_TLS_SSL_PTR not found during run\n"); - exitcode = CURLE_FAILED_INIT; + result = CURLE_FAILED_INIT; goto cleanup; } curl_mfprintf(stderr, "exiting\n"); - exitcode = CURLE_OK; + result = CURLE_OK; cleanup: @@ -255,7 +261,9 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) curl_slist_free_all(resolve); curl_free(host); curl_free(port); - curl_url_cleanup(cu); + if(cu) + curl_url_cleanup(cu); + curl_global_cleanup(); - return exitcode; + return result; } diff --git a/tests/libtest/cli_upload_pausing.c b/tests/libtest/cli_upload_pausing.c index a6a74eeaded3..971157c3138a 100644 --- a/tests/libtest/cli_upload_pausing.c +++ b/tests/libtest/cli_upload_pausing.c @@ -85,8 +85,8 @@ static void usage_upload_pausing(const char *msg) static CURLcode test_cli_upload_pausing(const char *URL) { - CURL *curl; - CURLcode rc = CURLE_OK; + CURL *curl = NULL; + CURLcode result = CURLE_OK; CURLU *cu; struct curl_slist *resolve = NULL; char resolve_buf[1024]; @@ -126,25 +126,33 @@ static CURLcode test_cli_upload_pausing(const char *URL) } url = test_argv[0]; - curl_global_init(CURL_GLOBAL_DEFAULT); + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } + curl_global_trace("ids,time"); cu = curl_url(); if(!cu) { curl_mfprintf(stderr, "out of memory\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_set(cu, CURLUPART_URL, url, 0)) { curl_mfprintf(stderr, "not a URL: '%s'\n", url); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) { curl_mfprintf(stderr, "could not get host of '%s'\n", url); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) { curl_mfprintf(stderr, "could not get port of '%s'\n", url); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } memset(&resolve, 0, sizeof(resolve)); curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", @@ -154,7 +162,8 @@ static CURLcode test_cli_upload_pausing(const char *URL) curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "out of memory\n"); - return (CURLcode)1; + result = (CURLcode)1; + goto cleanup; } /* We want to use our own read function. */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); @@ -181,23 +190,25 @@ static CURLcode test_cli_upload_pausing(const char *URL) curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb) != CURLE_OK || curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve) != CURLE_OK) { curl_mfprintf(stderr, "something unexpected went wrong - bailing out!\n"); - return (CURLcode)2; + result = (CURLcode)2; + goto cleanup; } curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version); - rc = curl_easy_perform(curl); + result = curl_easy_perform(curl); - if(curl) { - curl_easy_cleanup(curl); - } +cleanup: + if(curl) + curl_easy_cleanup(curl); curl_slist_free_all(resolve); curl_free(host); curl_free(port); - curl_url_cleanup(cu); + if(cu) + curl_url_cleanup(cu); curl_global_cleanup(); - return rc; + return result; } diff --git a/tests/libtest/cli_ws_data.c b/tests/libtest/cli_ws_data.c index 26cecc19fea3..7223f99c4f50 100644 --- a/tests/libtest/cli_ws_data.c +++ b/tests/libtest/cli_ws_data.c @@ -411,7 +411,7 @@ static void test_ws_data_usage(const char *msg) static CURLcode test_cli_ws_data(const char *URL) { #ifndef CURL_DISABLE_WEBSOCKETS - CURLcode res = CURLE_OK; + CURLcode result = CURLE_OK; const char *url; size_t plen_min = 0, plen_max = 0, count = 1; int ch, model = 2; @@ -428,8 +428,7 @@ static CURLcode test_cli_ws_data(const char *URL) break; case 'h': test_ws_data_usage(NULL); - res = CURLE_BAD_FUNCTION_ARGUMENT; - goto cleanup; + return CURLE_BAD_FUNCTION_ARGUMENT; case 'c': count = (size_t)atol(coptarg); break; @@ -441,8 +440,7 @@ static CURLcode test_cli_ws_data(const char *URL) break; default: test_ws_data_usage("invalid option"); - res = CURLE_BAD_FUNCTION_ARGUMENT; - goto cleanup; + return CURLE_BAD_FUNCTION_ARGUMENT; } } test_argc -= coptind; @@ -454,27 +452,28 @@ static CURLcode test_cli_ws_data(const char *URL) if(plen_max < plen_min) { curl_mfprintf(stderr, "maxlen must be >= minlen, got %zu-%zu\n", plen_min, plen_max); - res = CURLE_BAD_FUNCTION_ARGUMENT; - goto cleanup; + return CURLE_BAD_FUNCTION_ARGUMENT; } if(test_argc != 1) { test_ws_data_usage(NULL); - res = CURLE_BAD_FUNCTION_ARGUMENT; - goto cleanup; + return CURLE_BAD_FUNCTION_ARGUMENT; } url = test_argv[0]; - curl_global_init(CURL_GLOBAL_ALL); + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } if(model == 1) - res = test_ws_data_m1_echo(url, plen_min, plen_max); + result = test_ws_data_m1_echo(url, plen_min, plen_max); else - res = test_ws_data_m2_echo(url, count, plen_min, plen_max); + result = test_ws_data_m2_echo(url, count, plen_min, plen_max); -cleanup: curl_global_cleanup(); - return res; + + return result; #else /* !CURL_DISABLE_WEBSOCKETS */ (void)URL; diff --git a/tests/libtest/cli_ws_pingpong.c b/tests/libtest/cli_ws_pingpong.c index 80707c958521..995c1e3f7c40 100644 --- a/tests/libtest/cli_ws_pingpong.c +++ b/tests/libtest/cli_ws_pingpong.c @@ -56,7 +56,7 @@ static CURLcode test_cli_ws_pingpong(const char *URL) { #ifndef CURL_DISABLE_WEBSOCKETS CURL *curl; - CURLcode res = CURLE_OK; + CURLcode result = CURLE_OK; const char *payload; if(!URL || !libtest_arg2) { @@ -65,7 +65,10 @@ static CURLcode test_cli_ws_pingpong(const char *URL) } payload = libtest_arg2; - curl_global_init(CURL_GLOBAL_ALL); + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + curl_mfprintf(stderr, "curl_global_init() failed\n"); + return (CURLcode)3; + } curl = curl_easy_init(); if(curl) { @@ -75,16 +78,16 @@ static CURLcode test_cli_ws_pingpong(const char *URL) curl_easy_setopt(curl, CURLOPT_USERAGENT, "ws-pingpong"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ - res = curl_easy_perform(curl); - curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", res); - if(res == CURLE_OK) - res = pingpong(curl, payload); + result = curl_easy_perform(curl); + curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", result); + if(result == CURLE_OK) + result = pingpong(curl, payload); /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); - return res; + return result; #else /* !CURL_DISABLE_WEBSOCKETS */ (void)URL; From 9c0b239ec1e970c8da2806c0550eb09ad4478232 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 21:17:31 +0100 Subject: [PATCH 186/885] spelling: fix new finds by typos-cli 1.39.0 Closes #19312 --- lib/cfilters.h | 2 +- lib/ws.c | 2 +- tests/server/rtspd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cfilters.h b/lib/cfilters.h index 2fab300b211a..6cb4a6909c36 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -513,7 +513,7 @@ CURLcode Curl_cf_send(struct Curl_easy *data, int sockindex, /** * Receive bytes from connection filter `cf` into `bufq`. - * Convenience wrappter around `Curl_bufq_sipn()`, + * Convenience wrapper around `Curl_bufq_sipn()`, * so users do not have to implement a callback. */ CURLcode Curl_cf_recv_bufq(struct Curl_cfilter *cf, diff --git a/lib/ws.c b/lib/ws.c index ec7923555030..683841ecbbf1 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -990,7 +990,7 @@ static CURLcode ws_enc_add_pending(struct Curl_easy *data, (curl_off_t)ws->pending.payload_len, &ws->sendbuf); if(result) { - CURL_TRC_WS(data, "ws_enc_cntrl(), error addiong head: %d", + CURL_TRC_WS(data, "ws_enc_cntrl(), error adding head: %d", result); goto out; } diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 5e8bdc15cea3..d13b8ff9a96b 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -631,7 +631,7 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req) else { if(req->skip) /* we are instructed to not read the entire thing, so we make sure to - only read what we're supposed to and NOT read the enire thing the + only read what we're supposed to and NOT read the entire thing the client wants to send! */ got = sread(sock, reqbuf + req->offset, req->cl); else From d646d5a130993b8c438aa193463556e5efb2a54b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 31 Oct 2025 17:09:31 +0100 Subject: [PATCH 187/885] openssl: fix the ocsp len arg to Curl_vtls_apple_verify If it has no data, pass in a zero. Fixes #19303 Reported-by: Harry Sintonen Closes #19305 --- lib/vtls/openssl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 838c0242213b..a2b2da00e018 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5129,6 +5129,10 @@ static CURLcode ossl_apple_verify(struct Curl_cfilter *cf, if(conn_config->verifystatus && !octx->reused_session) ocsp_len = (long)SSL_get_tlsext_status_ocsp_resp(octx->ssl, &ocsp_data); + /* SSL_get_tlsext_status_ocsp_resp() returns the length of the OCSP + response data or -1 if there is no OCSP response data. */ + if(ocsp_len < 0) + ocsp_len = 0; /* no data available */ result = Curl_vtls_apple_verify(cf, data, peer, chain.num_certs, ossl_chain_get_der, &chain, ocsp_data, ocsp_len); From b4630ed8faef1834e2b64f30acc24e5101d4d2fb Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 31 Oct 2025 17:57:53 +0100 Subject: [PATCH 188/885] sectrust: fix verifystatus via sectrust When openssl does not verify the certificate, but apple sectrust does, we also pass it the ocsp stapled response when configured and available. When openssl does not verify the cert chain, it will also not be able to verify the ocsp stapling. Do not call it if sectrust is the verifier of the cert chain. Fixes #19307 Reported-by: Harry Sintonen Closes #19308 --- lib/vtls/openssl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index a2b2da00e018..5796960c6c84 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5155,6 +5155,9 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, bool strict = (conn_config->verifypeer || conn_config->verifyhost); X509 *server_cert; bool verified = FALSE; +#ifdef USE_APPLE_SECTRUST + bool sectrust_verified = FALSE; +#endif if(data->set.ssl.certinfo && !octx->reused_session) { /* asked to gather certificate info. Reused sessions don't have cert @@ -5207,6 +5210,7 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, if(verified) { infof(data, "SSL certificate verified via Apple SecTrust."); ssl_config->certverifyresult = X509_V_OK; + sectrust_verified = TRUE; } } #endif @@ -5222,7 +5226,13 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, } #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_OCSP) - if(conn_config->verifystatus && !octx->reused_session) { + if(conn_config->verifystatus && +#ifdef USE_APPLE_SECTRUST + !sectrust_verified && /* already verified via apple sectrust, cannot + * verifystate via OpenSSL in that case as it + * does not have the trust anchors */ +#endif + !octx->reused_session) { /* do not do this after Session ID reuse */ result = verifystatus(cf, data, octx); if(result) From d4d7139e70affc5f667d12d7e9c9d5bb71ae61ca Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 31 Oct 2025 17:22:36 +0100 Subject: [PATCH 189/885] openssl: combine all the x509-store flags ... intead of overwriting the previous ones in ossl_populate_x509_store() Pointed out by ZeroPath Closes #19306 --- lib/vtls/openssl.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 5796960c6c84..c8c33198c04f 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3496,6 +3496,7 @@ static CURLcode ossl_populate_x509_store(struct Curl_cfilter *cf, CURLcode result = CURLE_OK; X509_LOOKUP *lookup = NULL; const char * const ssl_crlfile = ssl_config->primary.CRLfile; + unsigned long x509flags = 0; CURL_TRC_CF(data, cf, "configuring OpenSSL's x509 trust store"); if(!store) @@ -3521,8 +3522,7 @@ static CURLcode ossl_populate_x509_store(struct Curl_cfilter *cf, failf(data, "error loading CRL file: %s", ssl_crlfile); return CURLE_SSL_CRL_BADFILE; } - X509_STORE_set_flags(store, - X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); + x509flags = X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL; infof(data, " CRLfile: %s", ssl_crlfile); } @@ -3532,18 +3532,20 @@ static CURLcode ossl_populate_x509_store(struct Curl_cfilter *cf, determine that in a reliable manner. https://web.archive.org/web/20190422050538/rt.openssl.org/Ticket/Display.html?id=3621 */ - X509_STORE_set_flags(store, X509_V_FLAG_TRUSTED_FIRST); + x509flags |= X509_V_FLAG_TRUSTED_FIRST; + if(!ssl_config->no_partialchain && !ssl_crlfile) { /* Have intermediate certificates in the trust store be treated as - trust-anchors, in the same way as self-signed root CA certificates - are. This allows users to verify servers using the intermediate cert - only, instead of needing the whole chain. + trust-anchors, in the same way as self-signed root CA certificates are. + This allows users to verify servers using the intermediate cert only, + instead of needing the whole chain. Due to OpenSSL bug https://github.com/openssl/openssl/issues/5081 we cannot do partial chains with a CRL check. */ - X509_STORE_set_flags(store, X509_V_FLAG_PARTIAL_CHAIN); + x509flags |= X509_V_FLAG_PARTIAL_CHAIN; } + (void)X509_STORE_set_flags(store, x509flags); return result; } From 27f55383fb9e3e8e84eaa06caaf164288a6b01ae Mon Sep 17 00:00:00 2001 From: x2018 Date: Fri, 31 Oct 2025 23:58:52 +0800 Subject: [PATCH 190/885] schannel: properly close the certfile on error Closes #19304 --- lib/vtls/schannel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 55a99b3b437c..50b81f672590 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -581,6 +581,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, " for %s", blob ? "(memory blob)" : data->set.ssl.primary.clientcert); curlx_unicodefree(cert_path); + if(fInCert) + curlx_fclose(fInCert); return CURLE_SSL_CERTPROBLEM; } From c35a87d7768716bb270f5b161cbdf7e664d74f4b Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 31 Oct 2025 16:44:38 +0100 Subject: [PATCH 191/885] scorecard: more params for upload tests Add --upload-parallel=n for controlling upload parallelism. Make upload processing similar to download processing. Closes #19302 --- tests/http/scorecard.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/http/scorecard.py b/tests/http/scorecard.py index d987fc586b3f..6afb9c74016a 100644 --- a/tests/http/scorecard.py +++ b/tests/http/scorecard.py @@ -194,6 +194,7 @@ def __init__(self, env: Env, verbose: int, curl_verbose: int, download_parallel: int = 0, + upload_parallel: int = 0, server_addr: Optional[str] = None, with_flame: bool = False, socks_args: Optional[List[str]] = None, @@ -206,6 +207,7 @@ def __init__(self, env: Env, self.server_port = server_port self._silent_curl = not curl_verbose self._download_parallel = download_parallel + self._upload_parallel = upload_parallel self._with_flame = with_flame self._socks_args = socks_args self._limit_rate = limit_rate @@ -472,11 +474,13 @@ def ul_parallel(self, url: str, fpath: str, count: int, nsamples: int = 1): def uploads(self, count: int, fsizes: List[int], meta: Dict[str, Any]) -> Dict[str, Any]: nsamples = meta['samples'] - max_parallel = self._download_parallel if self._download_parallel > 0 else count - url = f'https://{self.env.domain2}:{self.server_port}/curltest/put' - cols = ['size', 'single'] + max_parallel = self._upload_parallel if self._upload_parallel > 0 else count + cols = ['size'] + if not self._upload_parallel: + cols.append('single') + if count > 1: + cols.append(f'serial({count})') if count > 1: - cols.append(f'serial({count})') cols.append(f'parallel({count}x{max_parallel})') rows = [] for fsize in fsizes: @@ -484,14 +488,16 @@ def uploads(self, count: int, fsizes: List[int], meta: Dict[str, Any]) -> Dict[s 'val': fsize, 'sval': Card.fmt_size(fsize) }] + self.info(f'{row[0]["sval"]} uploads...') + url = f'https://{self.env.domain2}:{self.server_port}/curltest/put' fname = f'upload{row[0]["sval"]}.data' fpath = self._make_docs_file(docs_dir=self.env.gen_dir, fname=fname, fsize=fsize) - - self.info(f'{row[0]["sval"]} uploads...') - row.append(self.ul_single(url=url, fpath=fpath, nsamples=nsamples)) + if 'single' in cols: + row.append(self.ul_single(url=url, fpath=fpath, nsamples=nsamples)) if count > 1: - row.append(self.ul_serial(url=url, fpath=fpath, count=count, nsamples=nsamples)) + if 'single' in cols: + row.append(self.ul_serial(url=url, fpath=fpath, count=count, nsamples=nsamples)) row.append(self.ul_parallel(url=url, fpath=fpath, count=count, nsamples=nsamples)) rows.append(row) self.info('done.\n') @@ -723,6 +729,7 @@ def run_score(args, protocol): verbose=args.verbose, curl_verbose=args.curl_verbose, download_parallel=args.download_parallel, + upload_parallel=args.upload_parallel, with_flame=args.flame, socks_args=socks_args, limit_rate=args.limit_rate) @@ -750,6 +757,7 @@ def run_score(args, protocol): server_port=server_port, verbose=args.verbose, curl_verbose=args.curl_verbose, download_parallel=args.download_parallel, + upload_parallel=args.upload_parallel, with_flame=args.flame, socks_args=socks_args, limit_rate=args.limit_rate) @@ -777,6 +785,7 @@ def run_score(args, protocol): server_port=server_port, verbose=args.verbose, curl_verbose=args.curl_verbose, download_parallel=args.download_parallel, + upload_parallel=args.upload_parallel, with_flame=args.flame, socks_args=socks_args, limit_rate=args.limit_rate) @@ -887,6 +896,9 @@ def main(): parser.add_argument("--upload-count", action='store', type=int, metavar='number', default=50, help="perform that many uploads") + parser.add_argument("--upload-parallel", action='store', type=int, + metavar='number', default=0, + help="perform that many uploads in parallel (default all)") parser.add_argument("-r", "--requests", action='store_true', default=False, help="evaluate requests") From d2f0a0e7961301a2d1181ed7e3926201d60870a0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 18:36:43 +0100 Subject: [PATCH 192/885] tests/libtest: consistent variable naming for easy/multi/share handles Follow-up to 928363f28ca533d743adcb70597c3e30917c6cbd #19299 Closes #19311 --- tests/libtest/cli_h2_pausing.c | 56 +++++------ tests/libtest/cli_h2_serverpush.c | 60 ++++++------ tests/libtest/cli_h2_upgrade_extreme.c | 32 +++---- tests/libtest/cli_hx_download.c | 104 ++++++++++----------- tests/libtest/cli_hx_upload.c | 124 ++++++++++++------------- tests/libtest/cli_tls_session_reuse.c | 42 ++++----- tests/libtest/cli_ws_data.c | 36 +++---- tests/libtest/lib1485.c | 28 +++--- tests/libtest/lib1500.c | 12 +-- tests/libtest/lib1501.c | 24 ++--- tests/libtest/lib1502.c | 36 +++---- tests/libtest/lib1506.c | 16 ++-- tests/libtest/lib1507.c | 18 ++-- tests/libtest/lib1508.c | 6 +- tests/libtest/lib1515.c | 35 +++---- tests/libtest/lib1523.c | 28 +++--- tests/libtest/lib1531.c | 30 +++--- tests/libtest/lib1533.c | 6 +- tests/libtest/lib1540.c | 36 +++---- tests/libtest/lib1541.c | 58 ++++++------ tests/libtest/lib1542.c | 24 ++--- tests/libtest/lib1545.c | 14 +-- tests/libtest/lib1550.c | 10 +- tests/libtest/lib1552.c | 16 ++-- tests/libtest/lib1553.c | 32 +++---- tests/libtest/lib1554.c | 8 +- tests/libtest/lib1557.c | 18 ++-- tests/libtest/lib1565.c | 26 +++--- tests/libtest/lib1568.c | 26 +++--- tests/libtest/lib1569.c | 18 ++-- tests/libtest/lib1592.c | 12 +-- tests/libtest/lib1662.c | 34 +++---- tests/libtest/lib1900.c | 22 ++--- tests/libtest/lib1903.c | 22 ++--- tests/libtest/lib1905.c | 50 +++++----- tests/libtest/lib1908.c | 28 +++--- tests/libtest/lib1910.c | 18 ++-- tests/libtest/lib1911.c | 10 +- tests/libtest/lib1913.c | 16 ++-- tests/libtest/lib1915.c | 72 +++++++------- tests/libtest/lib1939.c | 14 +-- tests/libtest/lib1940.c | 34 +++---- tests/libtest/lib1945.c | 26 +++--- tests/libtest/lib2032.c | 38 ++++---- tests/libtest/lib2301.c | 4 +- tests/libtest/lib2302.c | 6 +- tests/libtest/lib2306.c | 16 ++-- tests/libtest/lib2402.c | 16 ++-- tests/libtest/lib2404.c | 16 ++-- tests/libtest/lib2405.c | 58 ++++++------ tests/libtest/lib2502.c | 16 ++-- tests/libtest/lib3027.c | 16 ++-- tests/libtest/lib3033.c | 18 ++-- tests/libtest/lib3105.c | 14 +-- tests/libtest/lib3207.c | 8 +- tests/libtest/lib502.c | 22 ++--- tests/libtest/lib503.c | 36 +++---- tests/libtest/lib504.c | 32 +++---- tests/libtest/lib506.c | 8 +- tests/libtest/lib507.c | 12 +-- tests/libtest/lib525.c | 18 ++-- tests/libtest/lib526.c | 24 ++--- tests/libtest/lib530.c | 46 ++++----- tests/libtest/lib533.c | 16 ++-- tests/libtest/lib540.c | 75 +++++++-------- tests/libtest/lib543.c | 14 +-- tests/libtest/lib544.c | 6 +- tests/libtest/lib547.c | 4 +- tests/libtest/lib552.c | 4 +- tests/libtest/lib555.c | 18 ++-- tests/libtest/lib560.c | 28 +++--- tests/libtest/lib564.c | 12 +-- tests/libtest/lib573.c | 32 +++---- tests/libtest/lib575.c | 40 ++++---- tests/libtest/lib576.c | 22 ++--- tests/libtest/lib582.c | 45 ++++----- tests/libtest/lib583.c | 12 +-- tests/libtest/lib586.c | 8 +- tests/libtest/lib591.c | 20 ++-- tests/libtest/lib597.c | 16 ++-- tests/libtest/lib643.c | 8 +- tests/libtest/lib653.c | 22 ++--- tests/libtest/lib654.c | 32 +++---- tests/libtest/lib658.c | 14 +-- tests/libtest/lib659.c | 14 +-- tests/libtest/lib667.c | 18 ++-- tests/libtest/lib668.c | 18 ++-- tests/libtest/lib670.c | 36 +++---- tests/libtest/lib674.c | 20 ++-- tests/libtest/lib678.c | 9 +- tests/libtest/lib751.c | 32 +++---- tests/libtest/lib753.c | 64 ++++++------- tests/libtest/lib758.c | 52 ++++++----- tests/libtest/lib766.c | 16 ++-- tests/libtest/testtrace.c | 12 +-- tests/libtest/testtrace.h | 4 +- 96 files changed, 1258 insertions(+), 1246 deletions(-) diff --git a/tests/libtest/cli_h2_pausing.c b/tests/libtest/cli_h2_pausing.c index c3a51cf4da6d..692b0a321103 100644 --- a/tests/libtest/cli_h2_pausing.c +++ b/tests/libtest/cli_h2_pausing.c @@ -46,7 +46,7 @@ struct handle int resumed; int errored; int fail_write; - CURL *h; + CURL *curl; }; static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) @@ -56,7 +56,7 @@ static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) curl_off_t totalsize; (void)data; - if(curl_easy_getinfo(handle->h, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, + if(curl_easy_getinfo(handle->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &totalsize) == CURLE_OK) curl_mfprintf(stderr, "INFO: [%zu] write, " "Content-Length %" CURL_FORMAT_CURL_OFF_T "\n", @@ -83,7 +83,7 @@ static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) static CURLcode test_cli_h2_pausing(const char *URL) { struct handle handles[2]; - CURLM *multi_handle = NULL; + CURLM *multi = NULL; int still_running = 1, msgs_left, numfds; size_t i; CURLMsg *msg; @@ -174,35 +174,39 @@ static CURLcode test_cli_h2_pausing(const char *URL) handles[i].resumed = 0; handles[i].errored = 0; handles[i].fail_write = 1; - handles[i].h = curl_easy_init(); - if(!handles[i].h || - curl_easy_setopt(handles[i].h, CURLOPT_WRITEFUNCTION, cb) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_WRITEDATA, &handles[i]) + handles[i].curl = curl_easy_init(); + if(!handles[i].curl || + curl_easy_setopt(handles[i].curl, CURLOPT_WRITEFUNCTION, cb) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_VERBOSE, 1L) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_DEBUGFUNCTION, cli_debug_cb) + curl_easy_setopt(handles[i].curl, CURLOPT_WRITEDATA, &handles[i]) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_SSL_VERIFYPEER, 0L) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_RESOLVE, resolve) != CURLE_OK || - curl_easy_setopt(handles[i].h, CURLOPT_PIPEWAIT, 1L) || - curl_easy_setopt(handles[i].h, CURLOPT_URL, url) != CURLE_OK) { + curl_easy_setopt(handles[i].curl, CURLOPT_FOLLOWLOCATION, 1L) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_VERBOSE, 1L) != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_SSL_VERIFYPEER, 0L) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_RESOLVE, resolve) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_PIPEWAIT, 1L) != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_URL, url) != CURLE_OK) { curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n"); result = (CURLcode)2; goto cleanup; } - curl_easy_setopt(handles[i].h, CURLOPT_HTTP_VERSION, http_version); + curl_easy_setopt(handles[i].curl, CURLOPT_HTTP_VERSION, http_version); } - multi_handle = curl_multi_init(); - if(!multi_handle) { + multi = curl_multi_init(); + if(!multi) { curl_mfprintf(stderr, "curl_multi_init() failed - bailing out\n"); result = (CURLcode)2; goto cleanup; } for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { - if(curl_multi_add_handle(multi_handle, handles[i].h) != CURLM_OK) { + if(curl_multi_add_handle(multi, handles[i].curl) != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_add_handle() failed - bailing out\n"); result = (CURLcode)2; goto cleanup; @@ -211,7 +215,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) for(rounds = 0;; rounds++) { curl_mfprintf(stderr, "INFO: multi_perform round %d\n", rounds); - if(curl_multi_perform(multi_handle, &still_running) != CURLM_OK) { + if(curl_multi_perform(multi, &still_running) != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_perform() failed - bailing out\n"); result = (CURLcode)2; goto cleanup; @@ -248,17 +252,17 @@ static CURLcode test_cli_h2_pausing(const char *URL) break; } - if(curl_multi_poll(multi_handle, NULL, 0, 100, &numfds) != CURLM_OK) { + if(curl_multi_poll(multi, NULL, 0, 100, &numfds) != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_poll() failed - bailing out\n"); result = (CURLcode)2; goto cleanup; } /* !checksrc! disable EQUALSNULL 1 */ - while((msg = curl_multi_info_read(multi_handle, &msgs_left)) != NULL) { + while((msg = curl_multi_info_read(multi, &msgs_left)) != NULL) { if(msg->msg == CURLMSG_DONE) { for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { - if(msg->easy_handle == handles[i].h) { + if(msg->easy_handle == handles[i].curl) { if(handles[i].paused != 1 || !handles[i].resumed) { curl_mfprintf(stderr, "ERROR: [%zu] done, paused=%d, " "resumed=%d, result %d - wtf?\n", i, @@ -291,7 +295,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { curl_mfprintf(stderr, "INFO: [%zu] resumed\n", i); handles[i].resumed = 1; - curl_easy_pause(handles[i].h, CURLPAUSE_CONT); + curl_easy_pause(handles[i].curl, CURLPAUSE_CONT); } } } @@ -299,15 +303,15 @@ static CURLcode test_cli_h2_pausing(const char *URL) cleanup: for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { - curl_multi_remove_handle(multi_handle, handles[i].h); - curl_easy_cleanup(handles[i].h); + curl_multi_remove_handle(multi, handles[i].curl); + curl_easy_cleanup(handles[i].curl); } curl_slist_free_all(resolve); curl_free(host); curl_free(port); curl_url_cleanup(cu); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); curl_global_cleanup(); return result; diff --git a/tests/libtest/cli_h2_serverpush.c b/tests/libtest/cli_h2_serverpush.c index 59688447b116..6936b3b0d65c 100644 --- a/tests/libtest/cli_h2_serverpush.c +++ b/tests/libtest/cli_h2_serverpush.c @@ -28,26 +28,26 @@ static FILE *out_download = NULL; -static int setup_h2_serverpush(CURL *hnd, const char *url) +static int setup_h2_serverpush(CURL *curl, const char *url) { out_download = curlx_fopen("download_0.data", "wb"); if(!out_download) return 1; /* failed */ - curl_easy_setopt(hnd, CURLOPT_URL, url); - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out_download); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, out_download); /* please be verbose */ - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - curl_easy_setopt(hnd, CURLOPT_DEBUGDATA, &debug_config); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); return 0; /* all is good */ } @@ -56,7 +56,7 @@ static FILE *out_push = NULL; /* called when there is an incoming push */ static int server_push_callback(CURL *parent, - CURL *easy, + CURL *curl, size_t num_headers, struct curl_pushheaders *headers, void *userp) @@ -80,7 +80,7 @@ static int server_push_callback(CURL *parent, } /* write to this file */ - curl_easy_setopt(easy, CURLOPT_WRITEDATA, out_push); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, out_push); curl_mfprintf(stderr, "**** push callback approves stream %u, " "got %zu headers!\n", count, num_headers); @@ -106,8 +106,8 @@ static int server_push_callback(CURL *parent, */ static CURLcode test_cli_h2_serverpush(const char *URL) { - CURL *easy = NULL; - CURLM *multi_handle; + CURL *curl = NULL; + CURLM *multi; int transfers = 1; /* we start with one */ CURLcode result = CURLE_OK; @@ -124,38 +124,38 @@ static CURLcode test_cli_h2_serverpush(const char *URL) return (CURLcode)3; } - multi_handle = curl_multi_init(); - if(!multi_handle) { + multi = curl_multi_init(); + if(!multi) { result = (CURLcode)1; goto cleanup; } - easy = curl_easy_init(); - if(!easy) { + curl = curl_easy_init(); + if(!curl) { result = (CURLcode)1; goto cleanup; } - if(setup_h2_serverpush(easy, URL)) { + if(setup_h2_serverpush(curl, URL)) { curl_mfprintf(stderr, "failed\n"); result = (CURLcode)1; goto cleanup; } - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - curl_multi_setopt(multi_handle, CURLMOPT_PUSHFUNCTION, server_push_callback); - curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi, CURLMOPT_PUSHFUNCTION, server_push_callback); + curl_multi_setopt(multi, CURLMOPT_PUSHDATA, &transfers); - curl_multi_add_handle(multi_handle, easy); + curl_multi_add_handle(multi, curl); do { struct CURLMsg *m; int still_running; /* keep number of running handles */ - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); if(mc) break; @@ -167,12 +167,12 @@ static CURLcode test_cli_h2_serverpush(const char *URL) */ do { int msgq = 0; - m = curl_multi_info_read(multi_handle, &msgq); + m = curl_multi_info_read(multi, &msgq); if(m && (m->msg == CURLMSG_DONE)) { - CURL *e = m->easy_handle; + CURL *easy = m->easy_handle; transfers--; - curl_multi_remove_handle(multi_handle, e); - curl_easy_cleanup(e); + curl_multi_remove_handle(multi, easy); + curl_easy_cleanup(easy); } } while(m); @@ -180,7 +180,7 @@ static CURLcode test_cli_h2_serverpush(const char *URL) cleanup: - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); if(out_download) curlx_fclose(out_download); diff --git a/tests/libtest/cli_h2_upgrade_extreme.c b/tests/libtest/cli_h2_upgrade_extreme.c index 7dc8f67816a7..eb0549380031 100644 --- a/tests/libtest/cli_h2_upgrade_extreme.c +++ b/tests/libtest/cli_h2_upgrade_extreme.c @@ -37,7 +37,7 @@ static size_t write_h2_upg_extreme_cb(char *ptr, size_t size, size_t nmemb, static CURLcode test_cli_h2_upgrade_extreme(const char *URL) { CURLM *multi = NULL; - CURL *easy; + CURL *curl; CURLMcode mc; int running_handles = 0, start_count, numfds; CURLMsg *msg; @@ -64,33 +64,33 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) start_count = 200; do { if(start_count) { - easy = curl_easy_init(); - if(!easy) { + curl = curl_easy_init(); + if(!curl) { curl_mfprintf(stderr, "curl_easy_init failed\n"); goto cleanup; } - curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, cli_debug_cb); - curl_easy_setopt(easy, CURLOPT_URL, URL); - curl_easy_setopt(easy, CURLOPT_NOSIGNAL, 1L); - curl_easy_setopt(easy, CURLOPT_AUTOREFERER, 1L); - curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1L); - curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); - curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, write_h2_upg_extreme_cb); - curl_easy_setopt(easy, CURLOPT_WRITEDATA, NULL); - curl_easy_setopt(easy, CURLOPT_HTTPGET, 1L); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); + curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L); + curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_h2_upg_extreme_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, NULL); + curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L); curl_msnprintf(range, sizeof(range), "%" CURL_FORMAT_CURL_OFF_TU "-" "%" CURL_FORMAT_CURL_OFF_TU, (curl_off_t)0, (curl_off_t)16384); - curl_easy_setopt(easy, CURLOPT_RANGE, range); + curl_easy_setopt(curl, CURLOPT_RANGE, range); - mc = curl_multi_add_handle(multi, easy); + mc = curl_multi_add_handle(multi, curl); if(mc != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_add_handle: %s\n", curl_multi_strerror(mc)); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); goto cleanup; } --start_count; diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index a12d0e95c286..b7ad5912a93b 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -51,7 +51,7 @@ static int verbose_d = 1; struct transfer_d { size_t idx; - CURL *easy; + CURL *curl; char filename[128]; FILE *out; curl_off_t recv_size; @@ -70,11 +70,11 @@ static size_t transfer_count_d = 1; static struct transfer_d *transfer_d; static int forbid_reuse_d = 0; -static struct transfer_d *get_transfer_for_easy_d(CURL *easy) +static struct transfer_d *get_transfer_for_easy_d(CURL *curl) { size_t i; for(i = 0; i < transfer_count_d; ++i) { - if(easy == transfer_d[i].easy) + if(curl == transfer_d[i].curl) return &transfer_d[i]; } return NULL; @@ -143,7 +143,7 @@ static int my_progress_d_cb(void *userdata, CURLcode res; t->checked_ssl = TRUE; - res = curl_easy_getinfo(t->easy, CURLINFO_TLS_SSL_PTR, &tls); + res = curl_easy_getinfo(t->curl, CURLINFO_TLS_SSL_PTR, &tls); if(res) { curl_mfprintf(stderr, "[t-%zu] info CURLINFO_TLS_SSL_PTR failed: %d\n", t->idx, res); @@ -212,40 +212,40 @@ static int my_progress_d_cb(void *userdata, return 0; } -static int setup_hx_download(CURL *hnd, const char *url, struct transfer_d *t, +static int setup_hx_download(CURL *curl, const char *url, struct transfer_d *t, long http_version, struct curl_slist *host, CURLSH *share, int use_earlydata, int fresh_connect) { - curl_easy_setopt(hnd, CURLOPT_SHARE, share); - curl_easy_setopt(hnd, CURLOPT_URL, url); - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, http_version); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(hnd, CURLOPT_ACCEPT_ENCODING, ""); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, (long)(128 * 1024)); - curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, my_write_d_cb); - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t); - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_d_cb); - curl_easy_setopt(hnd, CURLOPT_XFERINFODATA, t); + curl_easy_setopt(curl, CURLOPT_SHARE, share); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); + curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, (long)(128 * 1024)); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_d_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, t); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, my_progress_d_cb); + curl_easy_setopt(curl, CURLOPT_XFERINFODATA, t); if(use_earlydata) - curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); + curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); if(forbid_reuse_d) - curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L); + curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L); if(host) - curl_easy_setopt(hnd, CURLOPT_RESOLVE, host); + curl_easy_setopt(curl, CURLOPT_RESOLVE, host); if(fresh_connect) - curl_easy_setopt(hnd, CURLOPT_FRESH_CONNECT, 1L); + curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1L); /* please be verbose */ if(verbose_d) { - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, cli_debug_cb); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb); } /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); return 0; /* all is good */ } @@ -278,7 +278,7 @@ static void usage_hx_download(const char *msg) */ static CURLcode test_cli_hx_download(const char *URL) { - CURLM *multi_handle = NULL; + CURLM *multi = NULL; struct CURLMsg *m; CURLSH *share = NULL; const char *url; @@ -405,11 +405,11 @@ static CURLcode test_cli_hx_download(const char *URL) goto cleanup; } - multi_handle = curl_multi_init(); - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, + multi = curl_multi_init(); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + curl_multi_setopt(multi, CURLMOPT_MAX_TOTAL_CONNECTIONS, (long)max_total_conns); - curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, + curl_multi_setopt(multi, CURLMOPT_MAX_HOST_CONNECTIONS, (long)max_host_conns); active_transfers = 0; @@ -424,15 +424,15 @@ static CURLcode test_cli_hx_download(const char *URL) n = (max_parallel < transfer_count_d) ? max_parallel : transfer_count_d; for(i = 0; i < n; ++i) { t = &transfer_d[i]; - t->easy = curl_easy_init(); - if(!t->easy || - setup_hx_download(t->easy, url, t, http_version, host, share, + t->curl = curl_easy_init(); + if(!t->curl || + setup_hx_download(t->curl, url, t, http_version, host, share, use_earlydata, fresh_connect)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); result = (CURLcode)1; goto cleanup; } - curl_multi_add_handle(multi_handle, t->easy); + curl_multi_add_handle(multi, t->curl); t->started = 1; ++active_transfers; curl_mfprintf(stderr, "[t-%zu] STARTED\n", t->idx); @@ -440,11 +440,11 @@ static CURLcode test_cli_hx_download(const char *URL) do { int still_running; /* keep number of running handles */ - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); if(still_running) { /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); } if(mc) @@ -452,12 +452,12 @@ static CURLcode test_cli_hx_download(const char *URL) do { int msgq = 0; - m = curl_multi_info_read(multi_handle, &msgq); + m = curl_multi_info_read(multi, &msgq); if(m && (m->msg == CURLMSG_DONE)) { - CURL *e = m->easy_handle; + CURL *easy = m->easy_handle; --active_transfers; - curl_multi_remove_handle(multi_handle, e); - t = get_transfer_for_easy_d(e); + curl_multi_remove_handle(multi, easy); + t = get_transfer_for_easy_d(easy); if(t) { t->done = 1; t->result = m->data.result; @@ -465,13 +465,13 @@ static CURLcode test_cli_hx_download(const char *URL) t->idx, t->result); if(use_earlydata) { curl_off_t sent; - curl_easy_getinfo(e, CURLINFO_EARLYDATA_SENT_T, &sent); + curl_easy_getinfo(easy, CURLINFO_EARLYDATA_SENT_T, &sent); curl_mfprintf(stderr, "[t-%zu] EarlyData: " "%" CURL_FORMAT_CURL_OFF_T "\n", t->idx, sent); } } else { - curl_easy_cleanup(e); + curl_easy_cleanup(easy); curl_mfprintf(stderr, "unknown FINISHED???\n"); } } @@ -481,8 +481,8 @@ static CURLcode test_cli_hx_download(const char *URL) /* abort paused transfers */ for(i = 0; i < transfer_count_d; ++i) { t = &transfer_d[i]; - if(!t->done && t->paused && t->easy) { - curl_multi_remove_handle(multi_handle, t->easy); + if(!t->done && t->paused && t->curl) { + curl_multi_remove_handle(multi, t->curl); t->done = 1; active_transfers--; curl_mfprintf(stderr, "[t-%zu] ABORTED\n", t->idx); @@ -496,7 +496,7 @@ static CURLcode test_cli_hx_download(const char *URL) if(!t->done && t->paused) { t->resumed = 1; t->paused = 0; - curl_easy_pause(t->easy, CURLPAUSE_CONT); + curl_easy_pause(t->curl, CURLPAUSE_CONT); curl_mfprintf(stderr, "[t-%zu] RESUMED\n", t->idx); break; } @@ -507,15 +507,15 @@ static CURLcode test_cli_hx_download(const char *URL) for(i = 0; i < transfer_count_d; ++i) { t = &transfer_d[i]; if(!t->started) { - t->easy = curl_easy_init(); - if(!t->easy || - setup_hx_download(t->easy, url, t, http_version, host, share, + t->curl = curl_easy_init(); + if(!t->curl || + setup_hx_download(t->curl, url, t, http_version, host, share, use_earlydata, fresh_connect)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); result = (CURLcode)1; goto cleanup; } - curl_multi_add_handle(multi_handle, t->easy); + curl_multi_add_handle(multi, t->curl); t->started = 1; ++active_transfers; curl_mfprintf(stderr, "[t-%zu] STARTED\n", t->idx); @@ -532,7 +532,7 @@ static CURLcode test_cli_hx_download(const char *URL) cleanup: - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); if(transfer_d) { for(i = 0; i < transfer_count_d; ++i) { @@ -541,9 +541,9 @@ static CURLcode test_cli_hx_download(const char *URL) curlx_fclose(t->out); t->out = NULL; } - if(t->easy) { - curl_easy_cleanup(t->easy); - t->easy = NULL; + if(t->curl) { + curl_easy_cleanup(t->curl); + t->curl = NULL; } if(t->result) result = t->result; diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index 646836cb375b..5069bcab636e 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -30,7 +30,7 @@ static int verbose_u = 1; struct transfer_u { size_t idx; - CURL *easy; + CURL *curl; const char *method; char filename[128]; curl_mime *mime; @@ -51,11 +51,11 @@ static size_t transfer_count_u = 1; static struct transfer_u *transfer_u; static int forbid_reuse_u = 0; -static struct transfer_u *get_transfer_for_easy_u(CURL *easy) +static struct transfer_u *get_transfer_for_easy_u(CURL *curl) { size_t i; for(i = 0; i < transfer_count_u; ++i) { - if(easy == transfer_u[i].easy) + if(curl == transfer_u[i].curl) return &transfer_u[i]; } return NULL; @@ -142,62 +142,62 @@ static int my_progress_u_cb(void *userdata, return 0; } -static int setup_hx_upload(CURL *hnd, const char *url, struct transfer_u *t, +static int setup_hx_upload(CURL *curl, const char *url, struct transfer_u *t, long http_version, struct curl_slist *host, CURLSH *share, int use_earlydata, int announce_length) { - curl_easy_setopt(hnd, CURLOPT_SHARE, share); - curl_easy_setopt(hnd, CURLOPT_URL, url); - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, http_version); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, (long)(128 * 1024)); - curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, CURLFOLLOW_OBEYCODE); - curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, my_write_u_cb); - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t); + curl_easy_setopt(curl, CURLOPT_SHARE, share); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, (long)(128 * 1024)); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, CURLFOLLOW_OBEYCODE); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_u_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, t); if(use_earlydata) - curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); + curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); if(!strcmp("MIME", t->method)) { curl_mimepart *part; - t->mime = curl_mime_init(hnd); + t->mime = curl_mime_init(curl); part = curl_mime_addpart(t->mime); curl_mime_name(part, "file"); curl_mime_data_cb(part, -1, my_read_cb, NULL, NULL, t); - curl_easy_setopt(hnd, CURLOPT_MIMEPOST, t->mime); + curl_easy_setopt(curl, CURLOPT_MIMEPOST, t->mime); } else { if(!t->method || !strcmp("PUT", t->method)) - curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); else if(!strcmp("POST", t->method)) - curl_easy_setopt(hnd, CURLOPT_POST, 1L); + curl_easy_setopt(curl, CURLOPT_POST, 1L); else { curl_mfprintf(stderr, "unsupported method '%s'\n", t->method); return 1; } - curl_easy_setopt(hnd, CURLOPT_READFUNCTION, my_read_cb); - curl_easy_setopt(hnd, CURLOPT_READDATA, t); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_cb); + curl_easy_setopt(curl, CURLOPT_READDATA, t); if(announce_length) - curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, t->send_total); + curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, t->send_total); } - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_u_cb); - curl_easy_setopt(hnd, CURLOPT_XFERINFODATA, t); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, my_progress_u_cb); + curl_easy_setopt(curl, CURLOPT_XFERINFODATA, t); if(forbid_reuse_u) - curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L); + curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L); if(host) - curl_easy_setopt(hnd, CURLOPT_RESOLVE, host); + curl_easy_setopt(curl, CURLOPT_RESOLVE, host); /* please be verbose */ if(verbose_u) { - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, cli_debug_cb); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb); } /* wait for pipe connection to confirm */ - curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); + curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); return 0; /* all is good */ } @@ -227,7 +227,7 @@ static void usage_hx_upload(const char *msg) */ static CURLcode test_cli_hx_upload(const char *URL) { - CURLM *multi_handle; + CURLM *multi; CURLSH *share; const char *url; const char *method = "PUT"; @@ -369,8 +369,8 @@ static CURLcode test_cli_hx_upload(const char *URL) } if(reuse_easy) { - CURL *easy = curl_easy_init(); - if(!easy) { + CURL *curl = curl_easy_init(); + if(!curl) { curl_mfprintf(stderr, "failed to init easy handle\n"); result = (CURLcode)1; goto cleanup; @@ -378,8 +378,8 @@ static CURLcode test_cli_hx_upload(const char *URL) for(i = 0; i < transfer_count_u; ++i) { CURLcode rc; t = &transfer_u[i]; - t->easy = easy; - if(setup_hx_upload(t->easy, url, t, http_version, host, share, + t->curl = curl; + if(setup_hx_upload(t->curl, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); result = (CURLcode)1; @@ -387,28 +387,28 @@ static CURLcode test_cli_hx_upload(const char *URL) } curl_mfprintf(stderr, "[t-%zu] STARTING\n", t->idx); - rc = curl_easy_perform(easy); + rc = curl_easy_perform(curl); curl_mfprintf(stderr, "[t-%zu] DONE -> %d\n", t->idx, rc); - t->easy = NULL; - curl_easy_reset(easy); + t->curl = NULL; + curl_easy_reset(curl); } - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); } else { - multi_handle = curl_multi_init(); - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + multi = curl_multi_init(); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); n = (max_parallel < transfer_count_u) ? max_parallel : transfer_count_u; for(i = 0; i < n; ++i) { t = &transfer_u[i]; - t->easy = curl_easy_init(); - if(!t->easy || setup_hx_upload(t->easy, url, t, http_version, host, + t->curl = curl_easy_init(); + if(!t->curl || setup_hx_upload(t->curl, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); result = (CURLcode)1; goto cleanup; } - curl_multi_add_handle(multi_handle, t->easy); + curl_multi_add_handle(multi, t->curl); t->started = 1; ++active_transfers; curl_mfprintf(stderr, "[t-%zu] STARTED\n", t->idx); @@ -416,12 +416,12 @@ static CURLcode test_cli_hx_upload(const char *URL) do { int still_running; /* keep number of running handles */ - CURLMcode mc = curl_multi_perform(multi_handle, &still_running); + CURLMcode mc = curl_multi_perform(multi, &still_running); struct CURLMsg *m; if(still_running) { /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); } if(mc) @@ -429,28 +429,28 @@ static CURLcode test_cli_hx_upload(const char *URL) do { int msgq = 0; - m = curl_multi_info_read(multi_handle, &msgq); + m = curl_multi_info_read(multi, &msgq); if(m && (m->msg == CURLMSG_DONE)) { - CURL *e = m->easy_handle; + CURL *easy = m->easy_handle; --active_transfers; - curl_multi_remove_handle(multi_handle, e); - t = get_transfer_for_easy_u(e); + curl_multi_remove_handle(multi, easy); + t = get_transfer_for_easy_u(easy); if(t) { long res_status; - curl_easy_getinfo(e, CURLINFO_RESPONSE_CODE, &res_status); + curl_easy_getinfo(easy, CURLINFO_RESPONSE_CODE, &res_status); t->done = 1; curl_mfprintf(stderr, "[t-%zu] FINISHED, " "result=%d, response=%ld\n", t->idx, m->data.result, res_status); if(use_earlydata) { curl_off_t sent; - curl_easy_getinfo(e, CURLINFO_EARLYDATA_SENT_T, &sent); + curl_easy_getinfo(easy, CURLINFO_EARLYDATA_SENT_T, &sent); curl_mfprintf(stderr, "[t-%zu] EarlyData: " "%" CURL_FORMAT_CURL_OFF_T "\n", t->idx, sent); } } else { - curl_easy_cleanup(e); + curl_easy_cleanup(easy); curl_mfprintf(stderr, "unknown FINISHED???\n"); } } @@ -461,8 +461,8 @@ static CURLcode test_cli_hx_upload(const char *URL) /* abort paused transfers */ for(i = 0; i < transfer_count_u; ++i) { t = &transfer_u[i]; - if(!t->done && t->paused && t->easy) { - curl_multi_remove_handle(multi_handle, t->easy); + if(!t->done && t->paused && t->curl) { + curl_multi_remove_handle(multi, t->curl); t->done = 1; active_transfers--; curl_mfprintf(stderr, "[t-%zu] ABORTED\n", t->idx); @@ -476,7 +476,7 @@ static CURLcode test_cli_hx_upload(const char *URL) if(!t->done && t->paused) { t->resumed = 1; t->paused = 0; - curl_easy_pause(t->easy, CURLPAUSE_CONT); + curl_easy_pause(t->curl, CURLPAUSE_CONT); curl_mfprintf(stderr, "[t-%zu] RESUMED\n", t->idx); break; } @@ -487,15 +487,15 @@ static CURLcode test_cli_hx_upload(const char *URL) for(i = 0; i < transfer_count_u; ++i) { t = &transfer_u[i]; if(!t->started) { - t->easy = curl_easy_init(); - if(!t->easy || setup_hx_upload(t->easy, url, t, http_version, + t->curl = curl_easy_init(); + if(!t->curl || setup_hx_upload(t->curl, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); result = (CURLcode)1; goto cleanup; } - curl_multi_add_handle(multi_handle, t->easy); + curl_multi_add_handle(multi, t->curl); t->started = 1; ++active_transfers; curl_mfprintf(stderr, "[t-%zu] STARTED\n", t->idx); @@ -511,7 +511,7 @@ static CURLcode test_cli_hx_upload(const char *URL) } while(active_transfers); /* as long as we have transfers going */ curl_mfprintf(stderr, "all transfers done, cleanup multi\n"); - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); } cleanup: @@ -523,9 +523,9 @@ static CURLcode test_cli_hx_upload(const char *URL) curlx_fclose(t->out); t->out = NULL; } - if(t->easy) { - curl_easy_cleanup(t->easy); - t->easy = NULL; + if(t->curl) { + curl_easy_cleanup(t->curl); + t->curl = NULL; } if(t->mime) { curl_mime_free(t->mime); diff --git a/tests/libtest/cli_tls_session_reuse.c b/tests/libtest/cli_tls_session_reuse.c index 21f2c2da8004..2a6c0ea3bfab 100644 --- a/tests/libtest/cli_tls_session_reuse.c +++ b/tests/libtest/cli_tls_session_reuse.c @@ -30,13 +30,13 @@ static int tse_found_tls_session = FALSE; static size_t write_tse_cb(char *ptr, size_t size, size_t nmemb, void *opaque) { - CURL *easy = opaque; + CURL *curl = opaque; (void)ptr; if(!tse_found_tls_session) { struct curl_tlssessioninfo *tlssession; CURLcode rc; - rc = curl_easy_getinfo(easy, CURLINFO_TLS_SSL_PTR, &tlssession); + rc = curl_easy_getinfo(curl, CURLINFO_TLS_SSL_PTR, &tlssession); if(rc) { curl_mfprintf(stderr, "curl_easy_getinfo(CURLINFO_TLS_SSL_PTR) " "failed: %s\n", curl_easy_strerror(rc)); @@ -61,38 +61,38 @@ static CURL *tse_add_transfer(CURLM *multi, CURLSH *share, struct curl_slist *resolve, const char *url, long http_version) { - CURL *easy; + CURL *curl; CURLMcode mc; - easy = curl_easy_init(); - if(!easy) { + curl = curl_easy_init(); + if(!curl) { curl_mfprintf(stderr, "curl_easy_init failed\n"); return NULL; } - curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, cli_debug_cb); - curl_easy_setopt(easy, CURLOPT_URL, url); - curl_easy_setopt(easy, CURLOPT_SHARE, share); - curl_easy_setopt(easy, CURLOPT_NOSIGNAL, 1L); - curl_easy_setopt(easy, CURLOPT_AUTOREFERER, 1L); - curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1L); - curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, http_version); - curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, write_tse_cb); - curl_easy_setopt(easy, CURLOPT_WRITEDATA, easy); - curl_easy_setopt(easy, CURLOPT_HTTPGET, 1L); - curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_SHARE, share); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); + curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L); + curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_tse_cb); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); + curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); if(resolve) - curl_easy_setopt(easy, CURLOPT_RESOLVE, resolve); + curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve); - mc = curl_multi_add_handle(multi, easy); + mc = curl_multi_add_handle(multi, curl); if(mc != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_add_handle: %s\n", curl_multi_strerror(mc)); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); return NULL; } - return easy; + return curl; } static CURLcode test_cli_tls_session_reuse(const char *URL) diff --git a/tests/libtest/cli_ws_data.c b/tests/libtest/cli_ws_data.c index 7223f99c4f50..8b8b1fa0d1b8 100644 --- a/tests/libtest/cli_ws_data.c +++ b/tests/libtest/cli_ws_data.c @@ -190,7 +190,7 @@ static CURLcode test_ws_data_m2_echo(const char *url, } struct test_ws_m1_ctx { - CURL *easy; + CURL *curl; char *send_buf; char *recv_buf; size_t send_len, nsent; @@ -216,7 +216,7 @@ static size_t test_ws_data_m1_read(char *buf, size_t nitems, size_t buflen, goto out; if(!ctx->frame_reading) { - curl_ws_start_frame(ctx->easy, CURLWS_BINARY, ctx->send_len); + curl_ws_start_frame(ctx->curl, CURLWS_BINARY, ctx->send_len); ctx->frame_reading = TRUE; } @@ -310,8 +310,8 @@ static CURLcode test_ws_data_m1_echo(const char *url, goto out; } - m1_ctx.easy = curl_easy_init(); - if(!m1_ctx.easy) { + m1_ctx.curl = curl_easy_init(); + if(!m1_ctx.curl) { r = CURLE_OUT_OF_MEMORY; goto out; } @@ -330,22 +330,22 @@ static CURLcode test_ws_data_m1_echo(const char *url, m1_ctx.frames_read = 0; m1_ctx.frames_written = 0; memset(m1_ctx.recv_buf, 0, plen_max); - curl_easy_pause(m1_ctx.easy, CURLPAUSE_CONT); + curl_easy_pause(m1_ctx.curl, CURLPAUSE_CONT); - curl_easy_reset(m1_ctx.easy); - curl_easy_setopt(m1_ctx.easy, CURLOPT_URL, url); + curl_easy_reset(m1_ctx.curl); + curl_easy_setopt(m1_ctx.curl, CURLOPT_URL, url); /* use the callback style */ - curl_easy_setopt(m1_ctx.easy, CURLOPT_USERAGENT, "ws-data"); - curl_easy_setopt(m1_ctx.easy, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(m1_ctx.curl, CURLOPT_USERAGENT, "ws-data"); + curl_easy_setopt(m1_ctx.curl, CURLOPT_VERBOSE, 1L); /* we want to send */ - curl_easy_setopt(m1_ctx.easy, CURLOPT_UPLOAD, 1L); - curl_easy_setopt(m1_ctx.easy, CURLOPT_READFUNCTION, test_ws_data_m1_read); - curl_easy_setopt(m1_ctx.easy, CURLOPT_READDATA, &m1_ctx); - curl_easy_setopt(m1_ctx.easy, CURLOPT_WRITEFUNCTION, + curl_easy_setopt(m1_ctx.curl, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(m1_ctx.curl, CURLOPT_READFUNCTION, test_ws_data_m1_read); + curl_easy_setopt(m1_ctx.curl, CURLOPT_READDATA, &m1_ctx); + curl_easy_setopt(m1_ctx.curl, CURLOPT_WRITEFUNCTION, test_ws_data_m1_write); - curl_easy_setopt(m1_ctx.easy, CURLOPT_WRITEDATA, &m1_ctx); + curl_easy_setopt(m1_ctx.curl, CURLOPT_WRITEDATA, &m1_ctx); - curl_multi_add_handle(multi, m1_ctx.easy); + curl_multi_add_handle(multi, m1_ctx.curl); while(1) { int still_running; /* keep number of running handles */ @@ -366,7 +366,7 @@ static CURLcode test_ws_data_m1_echo(const char *url, } - curl_multi_remove_handle(multi, m1_ctx.easy); + curl_multi_remove_handle(multi, m1_ctx.curl); /* check results */ if(m1_ctx.frames_read < m1_ctx.nframes) { @@ -386,8 +386,8 @@ static CURLcode test_ws_data_m1_echo(const char *url, out: if(multi) curl_multi_cleanup(multi); - if(m1_ctx.easy) { - curl_easy_cleanup(m1_ctx.easy); + if(m1_ctx.curl) { + curl_easy_cleanup(m1_ctx.curl); } free(m1_ctx.send_buf); free(m1_ctx.recv_buf); diff --git a/tests/libtest/lib1485.c b/tests/libtest/lib1485.c index dd2b9728b735..36be7cd1e83b 100644 --- a/tests/libtest/lib1485.c +++ b/tests/libtest/lib1485.c @@ -26,7 +26,7 @@ #include "memdebug.h" struct t1485_transfer_status { - CURL *easy; + CURL *curl; curl_off_t out_len; size_t hd_line; CURLcode result; @@ -47,7 +47,7 @@ static size_t t1485_header_callback(char *ptr, size_t size, size_t nmemb, curl_off_t clen; long httpcode = 0; /* end of a response */ - result = curl_easy_getinfo(st->easy, CURLINFO_RESPONSE_CODE, &httpcode); + result = curl_easy_getinfo(st->curl, CURLINFO_RESPONSE_CODE, &httpcode); curl_mfprintf(stderr, "header_callback, get status: %ld, %d\n", httpcode, result); if(httpcode < 100 || httpcode >= 1000) { @@ -57,7 +57,7 @@ static size_t t1485_header_callback(char *ptr, size_t size, size_t nmemb, } st->http_status = (int)httpcode; if(st->http_status >= 200 && st->http_status < 300) { - result = curl_easy_getinfo(st->easy, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, + result = curl_easy_getinfo(st->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &clen); curl_mfprintf(stderr, "header_callback, info Content-Length: " "%" CURL_FORMAT_CURL_OFF_T ", %d\n", clen, result); @@ -87,7 +87,7 @@ static size_t t1485_write_cb(char *ptr, size_t size, size_t nmemb, void *userp) static CURLcode test_lib1485(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; struct t1485_transfer_status st; @@ -97,22 +97,22 @@ static CURLcode test_lib1485(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(curls); - st.easy = curls; /* to allow callbacks access */ + easy_init(curl); + st.curl = curl; /* to allow callbacks access */ - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_WRITEFUNCTION, t1485_write_cb); - easy_setopt(curls, CURLOPT_WRITEDATA, &st); - easy_setopt(curls, CURLOPT_HEADERFUNCTION, t1485_header_callback); - easy_setopt(curls, CURLOPT_HEADERDATA, &st); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1485_write_cb); + easy_setopt(curl, CURLOPT_WRITEDATA, &st); + easy_setopt(curl, CURLOPT_HEADERFUNCTION, t1485_header_callback); + easy_setopt(curl, CURLOPT_HEADERDATA, &st); - easy_setopt(curls, CURLOPT_NOPROGRESS, 1L); + easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); - res = curl_easy_perform(curls); + res = curl_easy_perform(curl); test_cleanup: - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; /* return the final return code */ diff --git a/tests/libtest/lib1500.c b/tests/libtest/lib1500.c index 8529f66a44eb..5fe8e7ab4faf 100644 --- a/tests/libtest/lib1500.c +++ b/tests/libtest/lib1500.c @@ -27,7 +27,7 @@ static CURLcode test_lib1500(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLM *multi = NULL; int still_running; CURLcode i = TEST_ERR_FAILURE; @@ -40,12 +40,12 @@ static CURLcode test_lib1500(const char *URL) multi_init(multi); - easy_init(curls); + easy_init(curl); - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); - multi_add_handle(multi, curls); + multi_add_handle(multi, curl); multi_perform(multi, &still_running); @@ -79,7 +79,7 @@ static CURLcode test_lib1500(const char *URL) /* undocumented cleanup sequence - type UA */ curl_multi_cleanup(multi); - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); if(res) diff --git a/tests/libtest/lib1501.c b/tests/libtest/lib1501.c index 61e586cd3dd9..feb775f136dc 100644 --- a/tests/libtest/lib1501.c +++ b/tests/libtest/lib1501.c @@ -32,8 +32,8 @@ static CURLcode test_lib1501(const char *URL) conservative to allow old and slow machines to run this test too */ static const int MAX_BLOCKED_TIME_MS = 500; - CURL *handle = NULL; - CURLM *mhandle = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; CURLcode res = CURLE_OK; int still_running = 0; @@ -41,16 +41,16 @@ static CURLcode test_lib1501(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(handle); + easy_init(curl); - easy_setopt(handle, CURLOPT_URL, URL); - easy_setopt(handle, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_init(mhandle); + multi_init(multi); - multi_add_handle(mhandle, handle); + multi_add_handle(multi, curl); - multi_perform(mhandle, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout_custom(HANG_TIMEOUT); @@ -71,7 +71,7 @@ static CURLcode test_lib1501(const char *URL) FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); - multi_fdset(mhandle, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -82,7 +82,7 @@ static CURLcode test_lib1501(const char *URL) curl_mfprintf(stderr, "ping\n"); before = curlx_now(); - multi_perform(mhandle, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout_custom(HANG_TIMEOUT); @@ -100,8 +100,8 @@ static CURLcode test_lib1501(const char *URL) /* undocumented cleanup sequence - type UA */ - curl_multi_cleanup(mhandle); - curl_easy_cleanup(handle); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1502.c b/tests/libtest/lib1502.c index 22ac6e7c80aa..527f969b116f 100644 --- a/tests/libtest/lib1502.c +++ b/tests/libtest/lib1502.c @@ -35,8 +35,8 @@ static CURLcode test_lib1502(const char *URL) { - CURL *easy = NULL; - CURL *dup; + CURL *curl = NULL; + CURL *curldupe; CURLM *multi = NULL; int still_running; CURLcode res = CURLE_OK; @@ -62,27 +62,27 @@ static CURLcode test_lib1502(const char *URL) return TEST_ERR_MAJOR_BAD; } - easy_init(easy); + easy_init(curl); - easy_setopt(easy, CURLOPT_URL, URL); - easy_setopt(easy, CURLOPT_HEADER, 1L); - easy_setopt(easy, CURLOPT_RESOLVE, dns_cache_list); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_RESOLVE, dns_cache_list); - dup = curl_easy_duphandle(easy); - if(dup) { - curl_easy_cleanup(easy); - easy = dup; + curldupe = curl_easy_duphandle(curl); + if(curldupe) { + curl_easy_cleanup(curl); + curl = curldupe; } else { curl_slist_free_all(dns_cache_list); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return CURLE_OUT_OF_MEMORY; } multi_init(multi); - multi_add_handle(multi, easy); + multi_add_handle(multi, curl); multi_perform(multi, &still_running); @@ -121,26 +121,26 @@ static CURLcode test_lib1502(const char *URL) default: /* undocumented cleanup sequence - type UA */ curl_multi_cleanup(multi); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); break; case 1503: /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(multi, easy); + curl_multi_remove_handle(multi, curl); curl_multi_cleanup(multi); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); break; case 1504: /* undocumented cleanup sequence - type UB */ - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_multi_cleanup(multi); curl_global_cleanup(); break; case 1505: /* proper cleanup sequence - type PB */ - curl_multi_remove_handle(multi, easy); - curl_easy_cleanup(easy); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); curl_multi_cleanup(multi); curl_global_cleanup(); break; diff --git a/tests/libtest/lib1506.c b/tests/libtest/lib1506.c index 66768f756379..5790f3baebad 100644 --- a/tests/libtest/lib1506.c +++ b/tests/libtest/lib1506.c @@ -30,7 +30,7 @@ static CURLcode test_lib1506(const char *URL) CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; - CURLM *m = NULL; + CURLM *multi = NULL; size_t i; char target_url[256]; char dnsentry[256]; @@ -57,9 +57,9 @@ static CURLcode test_lib1506(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_MAXCONNECTS, 3L); + multi_setopt(multi, CURLMOPT_MAXCONNECTS, 3L); /* get each easy handle */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { @@ -83,7 +83,7 @@ static CURLcode test_lib1506(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { /* add handle to multi */ - multi_add_handle(m, curl[i]); + multi_add_handle(multi, curl[i]); for(;;) { struct timeval interval; @@ -93,7 +93,7 @@ static CURLcode test_lib1506(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -104,7 +104,7 @@ static CURLcode test_lib1506(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -120,13 +120,13 @@ static CURLcode test_lib1506(const char *URL) /* proper cleanup sequence - type PB */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { - curl_multi_remove_handle(m, curl[i]); + curl_multi_remove_handle(multi, curl[i]); curl_easy_cleanup(curl[i]); } curl_slist_free_all(slist); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1507.c b/tests/libtest/lib1507.c index 8d96c6b3009d..a02a07e61b29 100644 --- a/tests/libtest/lib1507.c +++ b/tests/libtest/lib1507.c @@ -40,7 +40,7 @@ static CURLcode test_lib1507(const char *URL) CURLcode res = CURLE_OK; CURL *curl = NULL; - CURLM *mcurl = NULL; + CURLM *multi = NULL; int still_running = 1; struct curltime mp_start; struct curl_slist *rcpt_list = NULL; @@ -49,7 +49,7 @@ static CURLcode test_lib1507(const char *URL) easy_init(curl); - multi_init(mcurl); + multi_init(multi); rcpt_list = curl_slist_append(rcpt_list, "<1507-recipient@example.com>"); #if 0 @@ -66,12 +66,12 @@ static CURLcode test_lib1507(const char *URL) curl_easy_setopt(curl, CURLOPT_MAIL_FROM, "<1507-realuser@example.com>"); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt_list); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_add_handle(mcurl, curl); + multi_add_handle(multi, curl); mp_start = curlx_now(); /* we start some action by calling perform right away */ - curl_multi_perform(mcurl, &still_running); + curl_multi_perform(multi, &still_running); while(still_running) { struct timeval timeout; @@ -92,7 +92,7 @@ static CURLcode test_lib1507(const char *URL) timeout.tv_sec = 1; timeout.tv_usec = 0; - curl_multi_timeout(mcurl, &curl_timeo); + curl_multi_timeout(multi, &curl_timeo); if(curl_timeo >= 0) { curlx_mstotv(&timeout, curl_timeo); if(timeout.tv_sec > 1) { @@ -102,7 +102,7 @@ static CURLcode test_lib1507(const char *URL) } /* get file descriptors from the transfers */ - curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd); + curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be @@ -124,7 +124,7 @@ static CURLcode test_lib1507(const char *URL) break; case 0: /* timeout */ default: /* action */ - curl_multi_perform(mcurl, &still_running); + curl_multi_perform(multi, &still_running); break; } } @@ -132,8 +132,8 @@ static CURLcode test_lib1507(const char *URL) test_cleanup: curl_slist_free_all(rcpt_list); - curl_multi_remove_handle(mcurl, curl); - curl_multi_cleanup(mcurl); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); curl_easy_cleanup(curl); curl_global_cleanup(); diff --git a/tests/libtest/lib1508.c b/tests/libtest/lib1508.c index a305e652ff22..b7b47daa3f9e 100644 --- a/tests/libtest/lib1508.c +++ b/tests/libtest/lib1508.c @@ -28,19 +28,19 @@ static CURLcode test_lib1508(const char *URL) { CURLcode res = CURLE_OK; - CURLM *m = NULL; + CURLM *multi = NULL; (void)URL; global_init(CURL_GLOBAL_ALL); - multi_init(m); + multi_init(multi); test_cleanup: /* proper cleanup sequence - type PB */ - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); curl_mprintf("We are done\n"); diff --git a/tests/libtest/lib1515.c b/tests/libtest/lib1515.c index 02c3c99bf806..679a413c69a3 100644 --- a/tests/libtest/lib1515.c +++ b/tests/libtest/lib1515.c @@ -35,9 +35,10 @@ #define DNS_TIMEOUT 1L -static CURLcode do_one_request(CURLM *m, const char *URL, const char *resolve) +static CURLcode do_one_request(CURLM *multi, const char *URL, + const char *resolve) { - CURL *curls; + CURL *curl; struct curl_slist *resolve_list = NULL; int still_running; CURLcode res = CURLE_OK; @@ -46,20 +47,20 @@ static CURLcode do_one_request(CURLM *m, const char *URL, const char *resolve) resolve_list = curl_slist_append(resolve_list, resolve); - easy_init(curls); + easy_init(curl); - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_RESOLVE, resolve_list); - easy_setopt(curls, CURLOPT_DNS_CACHE_TIMEOUT, DNS_TIMEOUT); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_RESOLVE, resolve_list); + easy_setopt(curl, CURLOPT_DNS_CACHE_TIMEOUT, DNS_TIMEOUT); debug_config.nohex = TRUE; debug_config.tracetime = TRUE; - easy_setopt(curls, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(curls, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_add_handle(m, curls); - multi_perform(m, &still_running); + multi_add_handle(multi, curl); + multi_perform(multi, &still_running); abort_on_test_timeout(); @@ -74,18 +75,18 @@ static CURLcode do_one_request(CURLM *m, const char *URL, const char *resolve) timeout.tv_sec = 1; timeout.tv_usec = 0; - multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout); abort_on_test_timeout(); - multi_perform(m, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout(); } do { - msg = curl_multi_info_read(m, &msgs_left); - if(msg && msg->msg == CURLMSG_DONE && msg->easy_handle == curls) { + msg = curl_multi_info_read(multi, &msgs_left); + if(msg && msg->msg == CURLMSG_DONE && msg->easy_handle == curl) { res = msg->data.result; break; } @@ -93,8 +94,8 @@ static CURLcode do_one_request(CURLM *m, const char *URL, const char *resolve) test_cleanup: - curl_multi_remove_handle(m, curls); - curl_easy_cleanup(curls); + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); curl_slist_free_all(resolve_list); return res; diff --git a/tests/libtest/lib1523.c b/tests/libtest/lib1523.c index 77767b20bec6..36bdce8e83bc 100644 --- a/tests/libtest/lib1523.c +++ b/tests/libtest/lib1523.c @@ -46,37 +46,37 @@ static size_t t1523_write_cb(char *d, size_t n, size_t l, void *p) return n*l; } -static CURLcode run(CURL *hnd, long limit, long time) +static CURLcode run(CURL *curl, long limit, long time) { - curl_easy_setopt(hnd, CURLOPT_LOW_SPEED_LIMIT, limit); - curl_easy_setopt(hnd, CURLOPT_LOW_SPEED_TIME, time); - return curl_easy_perform(hnd); + curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, limit); + curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, time); + return curl_easy_perform(curl); } static CURLcode test_lib1523(const char *URL) { CURLcode ret; - CURL *hnd; + CURL *curl; char buffer[CURL_ERROR_SIZE]; curl_global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, t1523_write_cb); - curl_easy_setopt(hnd, CURLOPT_ERRORBUFFER, buffer); - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, dload_progress_cb); + curl = curl_easy_init(); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1523_write_cb); + curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, dload_progress_cb); - ret = run(hnd, 1, 2); + ret = run(curl, 1, 2); if(ret) curl_mfprintf(stderr, "error (%d) %s\n", ret, buffer); - ret = run(hnd, 12000, 1); + ret = run(curl, 12000, 1); if(ret != CURLE_OPERATION_TIMEDOUT) curl_mfprintf(stderr, "error (%d) %s\n", ret, buffer); else ret = CURLE_OK; - curl_easy_cleanup(hnd); + curl_easy_cleanup(curl); curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib1531.c b/tests/libtest/lib1531.c index 9d4cd7753993..6e69c5baee38 100644 --- a/tests/libtest/lib1531.c +++ b/tests/libtest/lib1531.c @@ -30,8 +30,8 @@ static CURLcode test_lib1531(const char *URL) static char const testData[] = ".abc\0xyz"; static curl_off_t const testDataSize = sizeof(testData) - 1; - CURL *easy; - CURLM *multi_handle; + CURL *curl; + CURLM *multi; int still_running; /* keep number of running handles */ CURLMsg *msg; /* for picking up messages with the transfer status */ int msgs_left; /* how many messages are left */ @@ -42,21 +42,21 @@ static CURLcode test_lib1531(const char *URL) global_init(CURL_GLOBAL_ALL); /* Allocate one curl handle per transfer */ - easy = curl_easy_init(); + curl = curl_easy_init(); /* init a multi stack */ - multi_handle = curl_multi_init(); + multi = curl_multi_init(); /* add the individual transfer */ - curl_multi_add_handle(multi_handle, easy); + curl_multi_add_handle(multi, curl); /* set the options (I left out a few, you'll get the point anyway) */ - curl_easy_setopt(easy, CURLOPT_URL, URL); - curl_easy_setopt(easy, CURLOPT_POSTFIELDSIZE_LARGE, testDataSize); - curl_easy_setopt(easy, CURLOPT_POSTFIELDS, testData); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, testDataSize); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, testData); /* we start some action by calling perform right away */ - curl_multi_perform(multi_handle, &still_running); + curl_multi_perform(multi, &still_running); abort_on_test_timeout(); @@ -80,7 +80,7 @@ static CURLcode test_lib1531(const char *URL) timeout.tv_sec = 1; timeout.tv_usec = 0; - curl_multi_timeout(multi_handle, &curl_timeo); + curl_multi_timeout(multi, &curl_timeo); if(curl_timeo >= 0) { curlx_mstotv(&timeout, curl_timeo); if(timeout.tv_sec > 1) { @@ -90,7 +90,7 @@ static CURLcode test_lib1531(const char *URL) } /* get file descriptors from the transfers */ - mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); + mc = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); if(mc != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); @@ -118,7 +118,7 @@ static CURLcode test_lib1531(const char *URL) break; case 0: /* timeout */ default: /* action */ - curl_multi_perform(multi_handle, &still_running); + curl_multi_perform(multi, &still_running); break; } @@ -127,7 +127,7 @@ static CURLcode test_lib1531(const char *URL) /* See how the transfers went */ do { - msg = curl_multi_info_read(multi_handle, &msgs_left); + msg = curl_multi_info_read(multi, &msgs_left); if(msg && msg->msg == CURLMSG_DONE) { curl_mprintf("HTTP transfer completed with status %d\n", msg->data.result); @@ -138,10 +138,10 @@ static CURLcode test_lib1531(const char *URL) } while(msg); test_cleanup: - curl_multi_cleanup(multi_handle); + curl_multi_cleanup(multi); /* Free the curl handles */ - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1533.c b/tests/libtest/lib1533.c index ff5c83cc8201..1c6017273410 100644 --- a/tests/libtest/lib1533.c +++ b/tests/libtest/lib1533.c @@ -34,7 +34,7 @@ #include "memdebug.h" struct cb_data { - CURL *easy_handle; + CURL *curl; int response_received; int paused; size_t remaining_bytes; @@ -42,7 +42,7 @@ struct cb_data { static void reset_data(struct cb_data *data, CURL *curl) { - data->easy_handle = curl; + data->curl = curl; data->response_received = 0; data->paused = 0; data->remaining_bytes = 3; @@ -85,7 +85,7 @@ static size_t t1533_write_cb(char *ptr, size_t size, size_t nmemb, void *userp) if(data->paused) { /* continue to send request body data */ data->paused = 0; - curl_easy_pause(data->easy_handle, CURLPAUSE_CONT); + curl_easy_pause(data->curl, CURLPAUSE_CONT); } return totalsize; diff --git a/tests/libtest/lib1540.c b/tests/libtest/lib1540.c index 55195b6ba834..7f9123435632 100644 --- a/tests/libtest/lib1540.c +++ b/tests/libtest/lib1540.c @@ -27,7 +27,7 @@ #include "memdebug.h" struct t1540_transfer_status { - CURL *easy; + CURL *curl; int halted; int counter; /* count write callback invokes */ int please; /* number of times xferinfo is called while halted */ @@ -48,7 +48,7 @@ static int please_continue(void *userp, st->please++; if(st->please == 2) { /* waited enough, unpause! */ - curl_easy_pause(st->easy, CURLPAUSE_CONT); + curl_easy_pause(st->curl, CURLPAUSE_CONT); } } curl_mfprintf(stderr, "xferinfo: paused %d\n", st->halted); @@ -83,7 +83,7 @@ static size_t t1540_write_cb(char *ptr, size_t size, size_t nmemb, void *userp) static CURLcode test_lib1540(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; struct t1540_transfer_status st; @@ -93,30 +93,30 @@ static CURLcode test_lib1540(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(curls); - st.easy = curls; /* to allow callbacks access */ + easy_init(curl); + st.curl = curl; /* to allow callbacks access */ - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_WRITEFUNCTION, t1540_write_cb); - easy_setopt(curls, CURLOPT_WRITEDATA, &st); - easy_setopt(curls, CURLOPT_HEADERFUNCTION, t1540_header_callback); - easy_setopt(curls, CURLOPT_HEADERDATA, &st); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1540_write_cb); + easy_setopt(curl, CURLOPT_WRITEDATA, &st); + easy_setopt(curl, CURLOPT_HEADERFUNCTION, t1540_header_callback); + easy_setopt(curl, CURLOPT_HEADERDATA, &st); - easy_setopt(curls, CURLOPT_XFERINFOFUNCTION, please_continue); - easy_setopt(curls, CURLOPT_XFERINFODATA, &st); - easy_setopt(curls, CURLOPT_NOPROGRESS, 0L); + easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, please_continue); + easy_setopt(curl, CURLOPT_XFERINFODATA, &st); + easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); debug_config.nohex = TRUE; debug_config.tracetime = TRUE; - test_setopt(curls, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(curls, CURLOPT_VERBOSE, 1L); + test_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(curls); + res = curl_easy_perform(curl); test_cleanup: - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; /* return the final return code */ diff --git a/tests/libtest/lib1541.c b/tests/libtest/lib1541.c index 9e7b2d436528..a2caaef8c3fc 100644 --- a/tests/libtest/lib1541.c +++ b/tests/libtest/lib1541.c @@ -26,7 +26,7 @@ #include "memdebug.h" struct t1541_transfer_status { - CURL *easy; + CURL *curl; int hd_count; int bd_count; CURLcode result; @@ -50,11 +50,11 @@ static void report_time(const char *key, const char *where, curl_off_t time, key, where, time); } -static void check_time(CURL *easy, int key, const char *name, +static void check_time(CURL *curl, int key, const char *name, const char *where) { curl_off_t tval; - CURLcode res = curl_easy_getinfo(easy, (CURLINFO)key, &tval); + CURLcode res = curl_easy_getinfo(curl, (CURLINFO)key, &tval); if(res) { t1541_geterr(name, res, __LINE__); } @@ -62,11 +62,11 @@ static void check_time(CURL *easy, int key, const char *name, report_time(name, where, tval, tval > 0); } -static void check_time0(CURL *easy, int key, const char *name, +static void check_time0(CURL *curl, int key, const char *name, const char *where) { curl_off_t tval; - CURLcode res = curl_easy_getinfo(easy, (CURLINFO)key, &tval); + CURLcode res = curl_easy_getinfo(curl, (CURLINFO)key, &tval); if(res) { t1541_geterr(name, res, __LINE__); } @@ -83,15 +83,15 @@ static size_t t1541_header_callback(char *ptr, size_t size, size_t nmemb, (void)ptr; if(!st->hd_count++) { /* first header, check some CURLINFO value to be reported. See #13125 */ - check_time(st->easy, KN(CURLINFO_CONNECT_TIME_T), "1st header"); - check_time(st->easy, KN(CURLINFO_PRETRANSFER_TIME_T), "1st header"); - check_time(st->easy, KN(CURLINFO_STARTTRANSFER_TIME_T), "1st header"); + check_time(st->curl, KN(CURLINFO_CONNECT_TIME_T), "1st header"); + check_time(st->curl, KN(CURLINFO_PRETRANSFER_TIME_T), "1st header"); + check_time(st->curl, KN(CURLINFO_STARTTRANSFER_TIME_T), "1st header"); /* continuously updated */ - check_time(st->easy, KN(CURLINFO_TOTAL_TIME_T), "1st header"); + check_time(st->curl, KN(CURLINFO_TOTAL_TIME_T), "1st header"); /* no SSL, must be 0 */ - check_time0(st->easy, KN(CURLINFO_APPCONNECT_TIME_T), "1st header"); + check_time0(st->curl, KN(CURLINFO_APPCONNECT_TIME_T), "1st header"); /* download not really started */ - check_time0(st->easy, KN(CURLINFO_SPEED_DOWNLOAD_T), "1st header"); + check_time0(st->curl, KN(CURLINFO_SPEED_DOWNLOAD_T), "1st header"); } (void)fwrite(ptr, size, nmemb, stdout); return len; @@ -109,7 +109,7 @@ static size_t t1541_write_cb(char *ptr, size_t size, size_t nmemb, void *userp) static CURLcode test_lib1541(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; struct t1541_transfer_status st; @@ -119,31 +119,31 @@ static CURLcode test_lib1541(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(curls); - st.easy = curls; /* to allow callbacks access */ + easy_init(curl); + st.curl = curl; /* to allow callbacks access */ - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_WRITEFUNCTION, t1541_write_cb); - easy_setopt(curls, CURLOPT_WRITEDATA, &st); - easy_setopt(curls, CURLOPT_HEADERFUNCTION, t1541_header_callback); - easy_setopt(curls, CURLOPT_HEADERDATA, &st); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1541_write_cb); + easy_setopt(curl, CURLOPT_WRITEDATA, &st); + easy_setopt(curl, CURLOPT_HEADERFUNCTION, t1541_header_callback); + easy_setopt(curl, CURLOPT_HEADERDATA, &st); - easy_setopt(curls, CURLOPT_NOPROGRESS, 0L); + easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); - res = curl_easy_perform(curls); + res = curl_easy_perform(curl); - check_time(curls, KN(CURLINFO_CONNECT_TIME_T), "done"); - check_time(curls, KN(CURLINFO_PRETRANSFER_TIME_T), "done"); - check_time(curls, KN(CURLINFO_POSTTRANSFER_TIME_T), "done"); - check_time(curls, KN(CURLINFO_STARTTRANSFER_TIME_T), "done"); + check_time(curl, KN(CURLINFO_CONNECT_TIME_T), "done"); + check_time(curl, KN(CURLINFO_PRETRANSFER_TIME_T), "done"); + check_time(curl, KN(CURLINFO_POSTTRANSFER_TIME_T), "done"); + check_time(curl, KN(CURLINFO_STARTTRANSFER_TIME_T), "done"); /* no SSL, must be 0 */ - check_time0(curls, KN(CURLINFO_APPCONNECT_TIME_T), "done"); - check_time(curls, KN(CURLINFO_SPEED_DOWNLOAD_T), "done"); - check_time(curls, KN(CURLINFO_TOTAL_TIME_T), "done"); + check_time0(curl, KN(CURLINFO_APPCONNECT_TIME_T), "done"); + check_time(curl, KN(CURLINFO_SPEED_DOWNLOAD_T), "done"); + check_time(curl, KN(CURLINFO_TOTAL_TIME_T), "done"); test_cleanup: - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; /* return the final return code */ diff --git a/tests/libtest/lib1542.c b/tests/libtest/lib1542.c index b8edbcb79710..9fc9f17efb46 100644 --- a/tests/libtest/lib1542.c +++ b/tests/libtest/lib1542.c @@ -37,26 +37,26 @@ static CURLcode test_lib1542(const char *URL) { - CURL *easy = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); - res_easy_init(easy); + res_easy_init(curl); - easy_setopt(easy, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); debug_config.nohex = TRUE; debug_config.tracetime = FALSE; - easy_setopt(easy, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(easy, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(easy, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res) goto test_cleanup; @@ -64,19 +64,19 @@ static CURLcode test_lib1542(const char *URL) * seconds old */ curlx_wait_ms(2000); - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - easy_setopt(easy, CURLOPT_MAXLIFETIME_CONN, 1L); + easy_setopt(curl, CURLOPT_MAXLIFETIME_CONN, 1L); - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res) goto test_cleanup; test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1545.c b/tests/libtest/lib1545.c index ac59d028c01d..7bb851f36e18 100644 --- a/tests/libtest/lib1545.c +++ b/tests/libtest/lib1545.c @@ -25,27 +25,27 @@ static CURLcode test_lib1545(const char *URL) { - CURL *eh = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; struct curl_httppost *lastptr = NULL; struct curl_httppost *m_formpost = NULL; global_init(CURL_GLOBAL_ALL); - easy_init(eh); + easy_init(curl); - easy_setopt(eh, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file", CURLFORM_FILE, "missing-file", CURLFORM_END); - curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost); + curl_easy_setopt(curl, CURLOPT_HTTPPOST, m_formpost); - (void)curl_easy_perform(eh); - (void)curl_easy_perform(eh); + (void)curl_easy_perform(curl); + (void)curl_easy_perform(curl); test_cleanup: curl_formfree(m_formpost); - curl_easy_cleanup(eh); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1550.c b/tests/libtest/lib1550.c index 11583aec4728..566cbfa1928a 100644 --- a/tests/libtest/lib1550.c +++ b/tests/libtest/lib1550.c @@ -29,7 +29,7 @@ static CURLcode test_lib1550(const char *URL) { - CURLM *handle; + CURLM *multi; CURLcode res = CURLE_OK; static const char * const bl_servers[] = {"Microsoft-IIS/6.0", "nginx/0.8.54", NULL}; @@ -37,12 +37,12 @@ static CURLcode test_lib1550(const char *URL) {"curl.se:443", "example.com:80", NULL}; global_init(CURL_GLOBAL_ALL); - handle = curl_multi_init(); + multi = curl_multi_init(); (void)URL; - curl_multi_setopt(handle, CURLMOPT_PIPELINING_SERVER_BL, bl_servers); - curl_multi_setopt(handle, CURLMOPT_PIPELINING_SITE_BL, bl_sites); - curl_multi_cleanup(handle); + curl_multi_setopt(multi, CURLMOPT_PIPELINING_SERVER_BL, bl_servers); + curl_multi_setopt(multi, CURLMOPT_PIPELINING_SITE_BL, bl_sites); + curl_multi_cleanup(multi); curl_global_cleanup(); return CURLE_OK; } diff --git a/tests/libtest/lib1552.c b/tests/libtest/lib1552.c index a5b23fbd8b65..d0c3469d4cea 100644 --- a/tests/libtest/lib1552.c +++ b/tests/libtest/lib1552.c @@ -27,7 +27,7 @@ static CURLcode test_lib1552(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLM *multi = NULL; int still_running; CURLcode i = CURLE_OK; @@ -41,14 +41,14 @@ static CURLcode test_lib1552(const char *URL) multi_init(multi); - easy_init(curls); + easy_init(curl); - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_HEADER, 1L); - easy_setopt(curls, CURLOPT_VERBOSE, 1L); - easy_setopt(curls, CURLOPT_USERPWD, "u:s"); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_USERPWD, "u:s"); - multi_add_handle(multi, curls); + multi_add_handle(multi, curl); multi_perform(multi, &still_running); @@ -82,7 +82,7 @@ static CURLcode test_lib1552(const char *URL) /* undocumented cleanup sequence - type UA */ curl_multi_cleanup(multi); - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); if(res) diff --git a/tests/libtest/lib1553.c b/tests/libtest/lib1553.c index 5d35adac5c82..fa753ac23102 100644 --- a/tests/libtest/lib1553.c +++ b/tests/libtest/lib1553.c @@ -41,7 +41,7 @@ static int t1553_xferinfo(void *p, static CURLcode test_lib1553(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLM *multi = NULL; int still_running; CURLcode i = CURLE_OK; @@ -56,28 +56,28 @@ static CURLcode test_lib1553(const char *URL) multi_init(multi); - easy_init(curls); + easy_init(curl); - mime = curl_mime_init(curls); + mime = curl_mime_init(curl); field = curl_mime_addpart(mime); curl_mime_name(field, "name"); curl_mime_data(field, "value", CURL_ZERO_TERMINATED); - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_HEADER, 1L); - easy_setopt(curls, CURLOPT_VERBOSE, 1L); - easy_setopt(curls, CURLOPT_MIMEPOST, mime); - easy_setopt(curls, CURLOPT_USERPWD, "u:s"); - easy_setopt(curls, CURLOPT_XFERINFOFUNCTION, t1553_xferinfo); - easy_setopt(curls, CURLOPT_NOPROGRESS, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_MIMEPOST, mime); + easy_setopt(curl, CURLOPT_USERPWD, "u:s"); + easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, t1553_xferinfo); + easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); debug_config.nohex = TRUE; debug_config.tracetime = TRUE; - test_setopt(curls, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(curls, CURLOPT_VERBOSE, 1L); + test_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_add_handle(multi, curls); + multi_add_handle(multi, curl); multi_perform(multi, &still_running); @@ -103,9 +103,9 @@ static CURLcode test_lib1553(const char *URL) test_cleanup: curl_mime_free(mime); - curl_multi_remove_handle(multi, curls); + curl_multi_remove_handle(multi, curl); curl_multi_cleanup(multi); - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); if(res) diff --git a/tests/libtest/lib1554.c b/tests/libtest/lib1554.c index 240fea657791..050075df3f34 100644 --- a/tests/libtest/lib1554.c +++ b/tests/libtest/lib1554.c @@ -37,19 +37,19 @@ static const char *ldata_names[] = { "NULL", }; -static void t1554_test_lock(CURL *handle, curl_lock_data data, +static void t1554_test_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, void *useptr) { - (void)handle; + (void)curl; (void)data; (void)laccess; (void)useptr; curl_mprintf("-> Mutex lock %s\n", ldata_names[data]); } -static void t1554_test_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void t1554_test_unlock(CURL *curl, curl_lock_data data, void *useptr) { - (void)handle; + (void)curl; (void)data; (void)useptr; curl_mprintf("<- Mutex unlock %s\n", ldata_names[data]); diff --git a/tests/libtest/lib1557.c b/tests/libtest/lib1557.c index 0e33f48fbb17..1c2785dbe33e 100644 --- a/tests/libtest/lib1557.c +++ b/tests/libtest/lib1557.c @@ -27,7 +27,7 @@ static CURLcode test_lib1557(const char *URL) { - CURLM *curlm = NULL; + CURLM *multi = NULL; CURL *curl1 = NULL; CURL *curl2 = NULL; int running_handles = 0; @@ -35,28 +35,28 @@ static CURLcode test_lib1557(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(curlm); - multi_setopt(curlm, CURLMOPT_MAX_HOST_CONNECTIONS, 1L); + multi_init(multi); + multi_setopt(multi, CURLMOPT_MAX_HOST_CONNECTIONS, 1L); easy_init(curl1); easy_setopt(curl1, CURLOPT_URL, URL); - multi_add_handle(curlm, curl1); + multi_add_handle(multi, curl1); easy_init(curl2); easy_setopt(curl2, CURLOPT_URL, URL); - multi_add_handle(curlm, curl2); + multi_add_handle(multi, curl2); - multi_perform(curlm, &running_handles); + multi_perform(multi, &running_handles); - multi_remove_handle(curlm, curl2); + multi_remove_handle(multi, curl2); /* If curl2 is still in the connect-pending list, this will crash */ - multi_remove_handle(curlm, curl1); + multi_remove_handle(multi, curl1); test_cleanup: curl_easy_cleanup(curl1); curl_easy_cleanup(curl2); - curl_multi_cleanup(curlm); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib1565.c b/tests/libtest/lib1565.c index 1b218d37a773..893950b90d23 100644 --- a/tests/libtest/lib1565.c +++ b/tests/libtest/lib1565.c @@ -32,7 +32,7 @@ #define TIME_BETWEEN_START_SECS 2 static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -static CURL *pending_handles[CONN_NUM]; +static CURL *pending_curls[CONN_NUM]; static int pending_num = 0; static CURLcode t1565_test_failure = CURLE_OK; @@ -41,7 +41,7 @@ static const char *t1565_url; static void *t1565_run_thread(void *ptr) { - CURL *easy = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; int i; @@ -50,10 +50,10 @@ static void *t1565_run_thread(void *ptr) for(i = 0; i < CONN_NUM; i++) { curlx_wait_ms(TIME_BETWEEN_START_SECS * 1000); - easy_init(easy); + easy_init(curl); - easy_setopt(easy, CURLOPT_URL, t1565_url); - easy_setopt(easy, CURLOPT_VERBOSE, 0L); + easy_setopt(curl, CURLOPT_URL, t1565_url); + easy_setopt(curl, CURLOPT_VERBOSE, 0L); pthread_mutex_lock(&lock); @@ -62,9 +62,9 @@ static void *t1565_run_thread(void *ptr) goto test_cleanup; } - pending_handles[pending_num] = easy; + pending_curls[pending_num] = curl; pending_num++; - easy = NULL; + curl = NULL; pthread_mutex_unlock(&lock); @@ -73,7 +73,7 @@ static void *t1565_run_thread(void *ptr) test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); pthread_mutex_lock(&lock); @@ -92,7 +92,7 @@ static CURLcode test_lib1565(const char *URL) int i; int result; CURLcode res = CURLE_OK; - CURL *started_handles[CONN_NUM]; + CURL *started_curls[CONN_NUM]; int started_num = 0; int finished_num = 0; pthread_t tid = 0; @@ -150,13 +150,13 @@ static CURLcode test_lib1565(const char *URL) pthread_mutex_lock(&lock); while(pending_num > 0) { - res_multi_add_handle(testmulti, pending_handles[pending_num - 1]); + res_multi_add_handle(testmulti, pending_curls[pending_num - 1]); if(res) { pthread_mutex_unlock(&lock); goto test_cleanup; } - started_handles[started_num] = pending_handles[pending_num - 1]; + started_curls[started_num] = pending_curls[pending_num - 1]; started_num++; pending_num--; } @@ -190,9 +190,9 @@ static CURLcode test_lib1565(const char *URL) curl_multi_cleanup(testmulti); for(i = 0; i < pending_num; i++) - curl_easy_cleanup(pending_handles[i]); + curl_easy_cleanup(pending_curls[i]); for(i = 0; i < started_num; i++) - curl_easy_cleanup(started_handles[i]); + curl_easy_cleanup(started_curls[i]); curl_global_cleanup(); return t1565_test_failure; diff --git a/tests/libtest/lib1568.c b/tests/libtest/lib1568.c index 695badc85ce2..9e73029d510a 100644 --- a/tests/libtest/lib1568.c +++ b/tests/libtest/lib1568.c @@ -28,23 +28,23 @@ static CURLcode test_lib1568(const char *URL) { CURLcode ret; - CURL *hnd; + CURL *curl; curl_global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_HEADER, 1L); - curl_easy_setopt(hnd, CURLOPT_USERPWD, "testuser:testpass"); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "lib1568"); - curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_PORT, atol(libtest_arg2)); + curl = curl_easy_init(); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_HEADER, 1L); + curl_easy_setopt(curl, CURLOPT_USERPWD, "testuser:testpass"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "lib1568"); + curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); + curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(curl, CURLOPT_PORT, atol(libtest_arg2)); - ret = curl_easy_perform(hnd); + ret = curl_easy_perform(curl); - curl_easy_cleanup(hnd); - hnd = NULL; + curl_easy_cleanup(curl); + curl = NULL; curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib1569.c b/tests/libtest/lib1569.c index 2846909e88f3..c2fd27bfe195 100644 --- a/tests/libtest/lib1569.c +++ b/tests/libtest/lib1569.c @@ -28,23 +28,23 @@ static CURLcode test_lib1569(const char *URL) { CURLcode res = CURLE_OK; - CURL *hnd; + CURL *curl; global_init(CURL_GLOBAL_ALL); - easy_init(hnd); - easy_setopt(hnd, CURLOPT_URL, URL); - easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - easy_setopt(hnd, CURLOPT_HEADER, 1L); + easy_init(curl); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_HEADER, 1L); - res = curl_easy_perform(hnd); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - curl_easy_setopt(hnd, CURLOPT_URL, libtest_arg2); - res = curl_easy_perform(hnd); + curl_easy_setopt(curl, CURLOPT_URL, libtest_arg2); + res = curl_easy_perform(curl); test_cleanup: - curl_easy_cleanup(hnd); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib1592.c b/tests/libtest/lib1592.c index 3f76a19c4f50..7e23d576bf2b 100644 --- a/tests/libtest/lib1592.c +++ b/tests/libtest/lib1592.c @@ -41,7 +41,7 @@ static CURLcode test_lib1592(const char *URL) { int stillRunning; - CURLM *multiHandle = NULL; + CURLM *multi = NULL; CURL *curl = NULL; CURLcode res = CURLE_OK; CURLMcode mres; @@ -49,7 +49,7 @@ static CURLcode test_lib1592(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(multiHandle); + multi_init(multi); easy_init(curl); @@ -88,17 +88,17 @@ static CURLcode test_lib1592(const char *URL) this. */ easy_setopt(curl, CURLOPT_TIMEOUT_MS, timeout); - multi_add_handle(multiHandle, curl); + multi_add_handle(multi, curl); /* This should move the handle from INIT => CONNECT => WAITRESOLVE. */ curl_mfprintf(stderr, "curl_multi_perform()...\n"); - multi_perform(multiHandle, &stillRunning); + multi_perform(multi, &stillRunning); curl_mfprintf(stderr, "curl_multi_perform() succeeded\n"); /* Start measuring how long it takes to remove the handle. */ curl_mfprintf(stderr, "curl_multi_remove_handle()...\n"); start_test_timing(); - mres = curl_multi_remove_handle(multiHandle, curl); + mres = curl_multi_remove_handle(multi, curl); if(mres) { curl_mfprintf(stderr, "curl_multi_remove_handle() failed, with code %d\n", mres); @@ -114,7 +114,7 @@ static CURLcode test_lib1592(const char *URL) test_cleanup: curl_easy_cleanup(curl); - curl_multi_cleanup(multiHandle); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1662.c b/tests/libtest/lib1662.c index b0ca4c5094c9..41a1bc0bd4bb 100644 --- a/tests/libtest/lib1662.c +++ b/tests/libtest/lib1662.c @@ -49,7 +49,7 @@ static size_t t1662_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) static CURLcode test_lib1662(const char *URL) { CURLcode res = CURLE_OK; - CURL *hnd; + CURL *curl; curl_mime *mime1; curl_mimepart *part1; struct t1662_WriteThis pooh = { 1 }; @@ -58,30 +58,30 @@ static CURLcode test_lib1662(const char *URL) global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - if(hnd) { - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L); - mime1 = curl_mime_init(hnd); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + mime1 = curl_mime_init(curl); if(mime1) { part1 = curl_mime_addpart(mime1); curl_mime_data_cb(part1, -1, t1662_read_cb, NULL, NULL, &pooh); curl_mime_filename(part1, "poetry.txt"); curl_mime_name(part1, "content"); - curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime1); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/2000"); - curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - res = curl_easy_perform(hnd); + curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime1); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/2000"); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L); + curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); + res = curl_easy_perform(curl); } } - curl_easy_cleanup(hnd); + curl_easy_cleanup(curl); curl_mime_free(mime1); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1900.c b/tests/libtest/lib1900.c index 3e9c60f4a8e0..2f0954bb6c52 100644 --- a/tests/libtest/lib1900.c +++ b/tests/libtest/lib1900.c @@ -28,26 +28,26 @@ static CURLcode test_lib1900(const char *URL) { CURLcode res = CURLE_OK; - CURL *hnd = NULL; - CURL *second = NULL; + CURL *curl1 = NULL; + CURL *curl2 = NULL; global_init(CURL_GLOBAL_ALL); - easy_init(hnd); - easy_setopt(hnd, CURLOPT_URL, URL); - easy_setopt(hnd, CURLOPT_HSTS, "first-hsts.txt"); - easy_setopt(hnd, CURLOPT_HSTS, "second-hsts.txt"); + easy_init(curl1); + easy_setopt(curl1, CURLOPT_URL, URL); + easy_setopt(curl1, CURLOPT_HSTS, "first-hsts.txt"); + easy_setopt(curl1, CURLOPT_HSTS, "second-hsts.txt"); - second = curl_easy_duphandle(hnd); + curl2 = curl_easy_duphandle(curl1); - curl_easy_cleanup(hnd); - curl_easy_cleanup(second); + curl_easy_cleanup(curl1); + curl_easy_cleanup(curl2); curl_global_cleanup(); return CURLE_OK; test_cleanup: - curl_easy_cleanup(hnd); - curl_easy_cleanup(second); + curl_easy_cleanup(curl1); + curl_easy_cleanup(curl2); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib1903.c b/tests/libtest/lib1903.c index af21e946b924..fc2858d5eecb 100644 --- a/tests/libtest/lib1903.c +++ b/tests/libtest/lib1903.c @@ -28,26 +28,26 @@ static CURLcode test_lib1903(const char *URL) { CURLcode res = CURLE_OK; - CURL *ch = NULL; + CURL *curl = NULL; global_init(CURL_GLOBAL_ALL); - easy_init(ch); + easy_init(curl); - easy_setopt(ch, CURLOPT_URL, URL); - easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2); - res = curl_easy_perform(ch); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_COOKIEFILE, libtest_arg2); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - curl_easy_reset(ch); + curl_easy_reset(curl); - easy_setopt(ch, CURLOPT_URL, URL); - easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2); - easy_setopt(ch, CURLOPT_COOKIEJAR, libtest_arg3); - res = curl_easy_perform(ch); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_COOKIEFILE, libtest_arg2); + easy_setopt(curl, CURLOPT_COOKIEJAR, libtest_arg3); + res = curl_easy_perform(curl); test_cleanup: - curl_easy_cleanup(ch); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib1905.c b/tests/libtest/lib1905.c index a227a09beb43..600e6962383e 100644 --- a/tests/libtest/lib1905.c +++ b/tests/libtest/lib1905.c @@ -27,35 +27,35 @@ static CURLcode test_lib1905(const char *URL) { - CURLSH *sh = NULL; - CURL *ch = NULL; + CURLSH *share = NULL; + CURL *curl = NULL; int unfinished; - CURLM *cm; + CURLM *multi; curl_global_init(CURL_GLOBAL_ALL); - cm = curl_multi_init(); - if(!cm) { + multi = curl_multi_init(); + if(!multi) { curl_global_cleanup(); return TEST_ERR_MULTI; } - sh = curl_share_init(); - if(!sh) + share = curl_share_init(); + if(!share) goto cleanup; - curl_share_setopt(sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); - curl_share_setopt(sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); + curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); + curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); - ch = curl_easy_init(); - if(!ch) + curl = curl_easy_init(); + if(!curl) goto cleanup; - curl_easy_setopt(ch, CURLOPT_SHARE, sh); - curl_easy_setopt(ch, CURLOPT_URL, URL); - curl_easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2); - curl_easy_setopt(ch, CURLOPT_COOKIEJAR, libtest_arg2); + curl_easy_setopt(curl, CURLOPT_SHARE, share); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_COOKIEFILE, libtest_arg2); + curl_easy_setopt(curl, CURLOPT_COOKIEJAR, libtest_arg2); - curl_multi_add_handle(cm, ch); + curl_multi_add_handle(multi, curl); unfinished = 1; while(unfinished) { @@ -67,10 +67,10 @@ static CURLcode test_lib1905(const char *URL) FD_ZERO(&R); FD_ZERO(&W); FD_ZERO(&E); - curl_multi_perform(cm, &unfinished); + curl_multi_perform(multi, &unfinished); - curl_multi_fdset(cm, &R, &W, &E, &MAX); - curl_multi_timeout(cm, &max_tout); + curl_multi_fdset(multi, &R, &W, &E, &MAX); + curl_multi_timeout(multi, &max_tout); if(max_tout > 0) { curlx_mstotv(&timeout, max_tout); @@ -83,14 +83,14 @@ static CURLcode test_lib1905(const char *URL) select(MAX + 1, &R, &W, &E, &timeout); } - curl_easy_setopt(ch, CURLOPT_COOKIELIST, "FLUSH"); - curl_easy_setopt(ch, CURLOPT_SHARE, NULL); + curl_easy_setopt(curl, CURLOPT_COOKIELIST, "FLUSH"); + curl_easy_setopt(curl, CURLOPT_SHARE, NULL); - curl_multi_remove_handle(cm, ch); + curl_multi_remove_handle(multi, curl); cleanup: - curl_easy_cleanup(ch); - curl_share_cleanup(sh); - curl_multi_cleanup(cm); + curl_easy_cleanup(curl); + curl_share_cleanup(share); + curl_multi_cleanup(multi); curl_global_cleanup(); return CURLE_OK; diff --git a/tests/libtest/lib1908.c b/tests/libtest/lib1908.c index 98e01fac9a08..500120066ed2 100644 --- a/tests/libtest/lib1908.c +++ b/tests/libtest/lib1908.c @@ -28,34 +28,34 @@ static CURLcode test_lib1908(const char *URL) { CURLcode ret = CURLE_OK; - CURL *hnd; + CURL *curl; start_test_timing(); curl_global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - if(hnd) { - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(hnd, CURLOPT_ALTSVC, libtest_arg2); - ret = curl_easy_perform(hnd); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_ALTSVC, libtest_arg2); + ret = curl_easy_perform(curl); if(!ret) { /* make a copy and check that this also has alt-svc activated */ - CURL *also = curl_easy_duphandle(hnd); - if(also) { - ret = curl_easy_perform(also); + CURL *curldupe = curl_easy_duphandle(curl); + if(curldupe) { + ret = curl_easy_perform(curldupe); /* we close the second handle first, which makes it store the alt-svc file only to get overwritten when the next handle is closed! */ - curl_easy_cleanup(also); + curl_easy_cleanup(curldupe); } } - curl_easy_reset(hnd); + curl_easy_reset(curl); /* using the same file name for the alt-svc cache, this clobbers the - content just written from the 'also' handle */ - curl_easy_cleanup(hnd); + content just written from the 'curldupe' handle */ + curl_easy_cleanup(curl); } curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib1910.c b/tests/libtest/lib1910.c index 6164d595459b..425598bf8833 100644 --- a/tests/libtest/lib1910.c +++ b/tests/libtest/lib1910.c @@ -28,19 +28,19 @@ static CURLcode test_lib1910(const char *URL) { CURLcode ret = CURLE_OK; - CURL *hnd; + CURL *curl; start_test_timing(); curl_global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - if(hnd) { - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(hnd, CURLOPT_USERPWD, "user\nname:pass\nword"); - ret = curl_easy_perform(hnd); - curl_easy_cleanup(hnd); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_USERPWD, "user\nname:pass\nword"); + ret = curl_easy_perform(curl); + curl_easy_cleanup(curl); } curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib1911.c b/tests/libtest/lib1911.c index 4ffc8085dc12..7add65ec48c6 100644 --- a/tests/libtest/lib1911.c +++ b/tests/libtest/lib1911.c @@ -34,13 +34,13 @@ static CURLcode test_lib1911(const char *URL) static char testbuf[MAX_INPUT_LENGTH + 2]; const struct curl_easyoption *o; - CURL *easy; + CURL *curl; int error = 0; (void)URL; curl_global_init(CURL_GLOBAL_ALL); - easy = curl_easy_init(); - if(!easy) { + curl = curl_easy_init(); + if(!curl) { curl_global_cleanup(); return TEST_ERR_EASY_INIT; } @@ -72,7 +72,7 @@ static CURLcode test_lib1911(const char *URL) /* This is a string. Make sure that passing in a string longer CURL_MAX_INPUT_LENGTH returns an error */ - result = curl_easy_setopt(easy, o->id, testbuf); + result = curl_easy_setopt(curl, o->id, testbuf); switch(result) { case CURLE_BAD_FUNCTION_ARGUMENT: /* the most normal */ case CURLE_UNKNOWN_OPTION: /* left out from the build */ @@ -88,7 +88,7 @@ static CURLcode test_lib1911(const char *URL) } } } - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return error == 0 ? CURLE_OK : TEST_ERR_FAILURE; } diff --git a/tests/libtest/lib1913.c b/tests/libtest/lib1913.c index e0519aef296d..94a319f0c745 100644 --- a/tests/libtest/lib1913.c +++ b/tests/libtest/lib1913.c @@ -28,20 +28,20 @@ static CURLcode test_lib1913(const char *URL) { CURLcode ret = CURLE_OK; - CURL *hnd; + CURL *curl; start_test_timing(); curl_global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - if(hnd) { - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_NOBODY, 1L); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); if(libtest_arg2) /* test1914 sets this extra arg */ - curl_easy_setopt(hnd, CURLOPT_FILETIME, 1L); - ret = curl_easy_perform(hnd); - curl_easy_cleanup(hnd); + curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); + ret = curl_easy_perform(curl); + curl_easy_cleanup(curl); } curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib1915.c b/tests/libtest/lib1915.c index c4cc39455feb..e47ae9ee8028 100644 --- a/tests/libtest/lib1915.c +++ b/tests/libtest/lib1915.c @@ -31,7 +31,7 @@ struct state { }; /* "read" is from the point of the library, it wants data from us */ -static CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *e, +static CURLSTScode hstsread(CURL *curl, struct curl_hstsentry *e, void *userp) { struct entry { @@ -56,7 +56,7 @@ static CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *e, const char *host; const char *expire; struct state *s = (struct state *)userp; - (void)easy; + (void)curl; host = preload_hosts[s->index].name; expire = preload_hosts[s->index++].exp; @@ -72,20 +72,20 @@ static CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *e, } /* verify error from callback */ -static CURLSTScode hstsreadfail(CURL *easy, struct curl_hstsentry *e, +static CURLSTScode hstsreadfail(CURL *curl, struct curl_hstsentry *e, void *userp) { - (void)easy; + (void)curl; (void)e; (void)userp; return CURLSTS_FAIL; } /* check that we get the hosts back in the save */ -static CURLSTScode hstswrite(CURL *easy, struct curl_hstsentry *e, +static CURLSTScode hstswrite(CURL *curl, struct curl_hstsentry *e, struct curl_index *i, void *userp) { - (void)easy; + (void)curl; (void)userp; curl_mprintf("[%zu/%zu] %s %s\n", i->index, i->total, e->name, e->expire); return CURLSTS_OK; @@ -98,7 +98,7 @@ static CURLSTScode hstswrite(CURL *easy, struct curl_hstsentry *e, static CURLcode test_lib1915(const char *URL) { CURLcode res = CURLE_OK; - CURL *hnd; + CURL *curl; struct state st = {0}; global_init(CURL_GLOBAL_ALL); @@ -106,43 +106,43 @@ static CURLcode test_lib1915(const char *URL) debug_config.nohex = TRUE; debug_config.tracetime = TRUE; - easy_init(hnd); - easy_setopt(hnd, CURLOPT_URL, URL); - easy_setopt(hnd, CURLOPT_CONNECTTIMEOUT, 1L); - easy_setopt(hnd, CURLOPT_HSTSREADFUNCTION, hstsread); - easy_setopt(hnd, CURLOPT_HSTSREADDATA, &st); - easy_setopt(hnd, CURLOPT_HSTSWRITEFUNCTION, hstswrite); - easy_setopt(hnd, CURLOPT_HSTSWRITEDATA, &st); - easy_setopt(hnd, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE); - easy_setopt(hnd, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(hnd); - curl_easy_cleanup(hnd); - hnd = NULL; + easy_init(curl); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1L); + easy_setopt(curl, CURLOPT_HSTSREADFUNCTION, hstsread); + easy_setopt(curl, CURLOPT_HSTSREADDATA, &st); + easy_setopt(curl, CURLOPT_HSTSWRITEFUNCTION, hstswrite); + easy_setopt(curl, CURLOPT_HSTSWRITEDATA, &st); + easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + curl = NULL; if(res == CURLE_OPERATION_TIMEDOUT) /* we expect that on Windows */ res = CURLE_COULDNT_CONNECT; curl_mprintf("First request returned %d\n", res); res = CURLE_OK; - easy_init(hnd); - easy_setopt(hnd, CURLOPT_URL, URL); - easy_setopt(hnd, CURLOPT_CONNECTTIMEOUT, 1L); - easy_setopt(hnd, CURLOPT_HSTSREADFUNCTION, hstsreadfail); - easy_setopt(hnd, CURLOPT_HSTSREADDATA, &st); - easy_setopt(hnd, CURLOPT_HSTSWRITEFUNCTION, hstswrite); - easy_setopt(hnd, CURLOPT_HSTSWRITEDATA, &st); - easy_setopt(hnd, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE); - easy_setopt(hnd, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(hnd); - curl_easy_cleanup(hnd); - hnd = NULL; + easy_init(curl); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1L); + easy_setopt(curl, CURLOPT_HSTSREADFUNCTION, hstsreadfail); + easy_setopt(curl, CURLOPT_HSTSREADDATA, &st); + easy_setopt(curl, CURLOPT_HSTSWRITEFUNCTION, hstswrite); + easy_setopt(curl, CURLOPT_HSTSWRITEDATA, &st); + easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + curl = NULL; curl_mprintf("Second request returned %d\n", res); test_cleanup: - curl_easy_cleanup(hnd); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib1939.c b/tests/libtest/lib1939.c index 61199900df49..5a10db96b138 100644 --- a/tests/libtest/lib1939.c +++ b/tests/libtest/lib1939.c @@ -28,29 +28,29 @@ static CURLcode test_lib1939(const char *URL) { CURLM *multi; - CURL *easy; + CURL *curl; int running_handles; curl_global_init(CURL_GLOBAL_DEFAULT); multi = curl_multi_init(); if(multi) { - easy = curl_easy_init(); - if(easy) { + curl = curl_easy_init(); + if(curl) { CURLcode c; CURLMcode m; /* Crash only happens when using HTTPS */ - c = curl_easy_setopt(easy, CURLOPT_URL, URL); + c = curl_easy_setopt(curl, CURLOPT_URL, URL); if(!c) /* Any old HTTP tunneling proxy will do here */ - c = curl_easy_setopt(easy, CURLOPT_PROXY, libtest_arg2); + c = curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); if(!c) { /* We're going to drive the transfer using multi interface here, because we want to stop during the middle. */ - m = curl_multi_add_handle(multi, easy); + m = curl_multi_add_handle(multi, curl); if(!m) /* Run the multi handle once, just enough to start establishing an @@ -62,7 +62,7 @@ static CURLcode test_lib1939(const char *URL) } /* Close the easy handle *before* the multi handle. Doing it the other way around avoids the issue. */ - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); } curl_multi_cleanup(multi); /* double-free happens here */ } diff --git a/tests/libtest/lib1940.c b/tests/libtest/lib1940.c index 50f4010e94eb..117afecf2fdc 100644 --- a/tests/libtest/lib1940.c +++ b/tests/libtest/lib1940.c @@ -33,7 +33,7 @@ static size_t t1940_write_cb(char *data, size_t n, size_t l, void *userp) return n*l; } -static void t1940_showem(CURL *easy, int header_request, unsigned int type) +static void t1940_showem(CURL *curl, int header_request, unsigned int type) { static const char *testdata[] = { "daTE", @@ -52,7 +52,7 @@ static void t1940_showem(CURL *easy, int header_request, unsigned int type) int i; struct curl_header *header; for(i = 0; testdata[i]; i++) { - if(CURLHE_OK == curl_easy_header(easy, testdata[i], 0, + if(CURLHE_OK == curl_easy_header(curl, testdata[i], 0, type, header_request, &header)) { if(header->amount > 1) { /* more than one, iterate over them */ @@ -64,7 +64,7 @@ static void t1940_showem(CURL *easy, int header_request, unsigned int type) if(++index == amount) break; - if(CURLHE_OK != curl_easy_header(easy, testdata[i], index, + if(CURLHE_OK != curl_easy_header(curl, testdata[i], index, type, header_request, &header)) break; } while(1); @@ -79,7 +79,7 @@ static void t1940_showem(CURL *easy, int header_request, unsigned int type) static CURLcode test_lib1940(const char *URL) { - CURL *easy = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; int header_request; @@ -91,32 +91,32 @@ static CURLcode test_lib1940(const char *URL) } global_init(CURL_GLOBAL_DEFAULT); - easy_init(easy); - easy_setopt(easy, CURLOPT_URL, URL); - easy_setopt(easy, CURLOPT_VERBOSE, 1L); - easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L); + easy_init(curl); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* ignores any content */ - easy_setopt(easy, CURLOPT_WRITEFUNCTION, t1940_write_cb); + easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1940_write_cb); /* if there's a proxy set, use it */ if(libtest_arg2 && *libtest_arg2) { - easy_setopt(easy, CURLOPT_PROXY, libtest_arg2); - easy_setopt(easy, CURLOPT_HTTPPROXYTUNNEL, 1L); + easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); + easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); } - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - t1940_showem(easy, header_request, CURLH_HEADER); + t1940_showem(curl, header_request, CURLH_HEADER); if(libtest_arg2 && *libtest_arg2) { /* now show connect headers only */ - t1940_showem(easy, header_request, CURLH_CONNECT); + t1940_showem(curl, header_request, CURLH_CONNECT); } - t1940_showem(easy, header_request, CURLH_1XX); - t1940_showem(easy, header_request, CURLH_TRAILER); + t1940_showem(curl, header_request, CURLH_1XX); + t1940_showem(curl, header_request, CURLH_TRAILER); test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib1945.c b/tests/libtest/lib1945.c index 6e693bda625d..f0a92d6033e2 100644 --- a/tests/libtest/lib1945.c +++ b/tests/libtest/lib1945.c @@ -25,13 +25,13 @@ #include "memdebug.h" -static void t1945_showem(CURL *easy, unsigned int type) +static void t1945_showem(CURL *curl, unsigned int type) { struct curl_header *header = NULL; struct curl_header *prev = NULL; /* !checksrc! disable EQUALSNULL 1 */ - while((header = curl_easy_nextheader(easy, type, 0, prev)) != NULL) { + while((header = curl_easy_nextheader(curl, type, 0, prev)) != NULL) { curl_mprintf(" %s == %s (%zu/%zu)\n", header->name, header->value, header->index, header->amount); prev = header; @@ -48,31 +48,31 @@ static size_t t1945_write_cb(char *data, size_t n, size_t l, void *userp) static CURLcode test_lib1945(const char *URL) { - CURL *easy; + CURL *curl; CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_DEFAULT); - easy_init(easy); - curl_easy_setopt(easy, CURLOPT_URL, URL); - curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L); + easy_init(curl); + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* ignores any content */ - curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, t1945_write_cb); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1945_write_cb); /* if there's a proxy set, use it */ if(libtest_arg2 && *libtest_arg2) { - curl_easy_setopt(easy, CURLOPT_PROXY, libtest_arg2); - curl_easy_setopt(easy, CURLOPT_HTTPPROXYTUNNEL, 1L); + curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); + curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); } - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res) { curl_mprintf("badness: %d\n", res); } - t1945_showem(easy, CURLH_CONNECT|CURLH_HEADER|CURLH_TRAILER|CURLH_1XX); + t1945_showem(curl, CURLH_CONNECT|CURLH_HEADER|CURLH_TRAILER|CURLH_1XX); test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib2032.c b/tests/libtest/lib2032.c index 25de34d53024..81c949ab4488 100644 --- a/tests/libtest/lib2032.c +++ b/tests/libtest/lib2032.c @@ -28,13 +28,13 @@ #define MAX_EASY_HANDLES 3 static int ntlm_counter[MAX_EASY_HANDLES]; -static CURL *ntlm_easy[MAX_EASY_HANDLES]; +static CURL *ntlm_curls[MAX_EASY_HANDLES]; static curl_socket_t ntlm_sockets[MAX_EASY_HANDLES]; static CURLcode ntlmcb_res = CURLE_OK; static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) { - ssize_t idx = ((CURL **) data) - ntlm_easy; + ssize_t idx = ((CURL **) data) - ntlm_curls; curl_socket_t sock; long longdata; CURLcode code; @@ -44,7 +44,7 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) ntlm_counter[idx] += (int)(size * nmemb); /* Get socket being used for this easy handle, otherwise CURL_SOCKET_BAD */ - code = curl_easy_getinfo(ntlm_easy[idx], CURLINFO_LASTSOCKET, &longdata); + code = curl_easy_getinfo(ntlm_curls[idx], CURLINFO_LASTSOCKET, &longdata); if(CURLE_OK != code) { curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed, " @@ -102,7 +102,7 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ } for(i = 0; i < MAX_EASY_HANDLES; ++i) { - ntlm_easy[i] = NULL; + ntlm_curls[i] = NULL; ntlm_sockets[i] = CURL_SOCKET_BAD; } @@ -125,28 +125,28 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ /* Start a new handle if we aren't at the max */ if(state == ReadyForNewHandle) { - easy_init(ntlm_easy[num_handles]); + easy_init(ntlm_curls[num_handles]); if(num_handles % 3 == 2) { curl_msnprintf(full_url, urllen, "%s0200", URL); - easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); + easy_setopt(ntlm_curls[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); } else { curl_msnprintf(full_url, urllen, "%s0100", URL); - easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + easy_setopt(ntlm_curls[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); } - easy_setopt(ntlm_easy[num_handles], CURLOPT_FRESH_CONNECT, 1L); - easy_setopt(ntlm_easy[num_handles], CURLOPT_URL, full_url); - easy_setopt(ntlm_easy[num_handles], CURLOPT_VERBOSE, 1L); - easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPGET, 1L); - easy_setopt(ntlm_easy[num_handles], CURLOPT_USERPWD, + easy_setopt(ntlm_curls[num_handles], CURLOPT_FRESH_CONNECT, 1L); + easy_setopt(ntlm_curls[num_handles], CURLOPT_URL, full_url); + easy_setopt(ntlm_curls[num_handles], CURLOPT_VERBOSE, 1L); + easy_setopt(ntlm_curls[num_handles], CURLOPT_HTTPGET, 1L); + easy_setopt(ntlm_curls[num_handles], CURLOPT_USERPWD, "testuser:testpass"); - easy_setopt(ntlm_easy[num_handles], CURLOPT_WRITEFUNCTION, callback); - easy_setopt(ntlm_easy[num_handles], CURLOPT_WRITEDATA, - (void *)(ntlm_easy + num_handles)); - easy_setopt(ntlm_easy[num_handles], CURLOPT_HEADER, 1L); + easy_setopt(ntlm_curls[num_handles], CURLOPT_WRITEFUNCTION, callback); + easy_setopt(ntlm_curls[num_handles], CURLOPT_WRITEDATA, + (void *)(ntlm_curls + num_handles)); + easy_setopt(ntlm_curls[num_handles], CURLOPT_HEADER, 1L); - multi_add_handle(multi, ntlm_easy[num_handles]); + multi_add_handle(multi, ntlm_curls[num_handles]); num_handles += 1; state = NeedSocketForNewHandle; res = ntlmcb_res; @@ -223,8 +223,8 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ for(i = 0; i < MAX_EASY_HANDLES; i++) { curl_mprintf("Data connection %d: %d\n", i, ntlm_counter[i]); - curl_multi_remove_handle(multi, ntlm_easy[i]); - curl_easy_cleanup(ntlm_easy[i]); + curl_multi_remove_handle(multi, ntlm_curls[i]); + curl_easy_cleanup(ntlm_curls[i]); } curl_multi_cleanup(multi); diff --git a/tests/libtest/lib2301.c b/tests/libtest/lib2301.c index cc6c00a1d439..40e357a3bafd 100644 --- a/tests/libtest/lib2301.c +++ b/tests/libtest/lib2301.c @@ -42,7 +42,7 @@ static void t2301_websocket(CURL *curl) static size_t t2301_write_cb(char *b, size_t size, size_t nitems, void *p) { - CURL *easy = p; + CURL *curl = p; unsigned char *buffer = (unsigned char *)b; size_t i; size_t sent; @@ -59,7 +59,7 @@ static size_t t2301_write_cb(char *b, size_t size, size_t nitems, void *p) if(buffer[0] == 0x89) { CURLcode result; curl_mfprintf(stderr, "send back a simple PONG\n"); - result = curl_ws_send(easy, pong, 2, &sent, 0, 0); + result = curl_ws_send(curl, pong, 2, &sent, 0, 0); if(result) nitems = 0; } diff --git a/tests/libtest/lib2302.c b/tests/libtest/lib2302.c index d72761a8510b..47276197bb08 100644 --- a/tests/libtest/lib2302.c +++ b/tests/libtest/lib2302.c @@ -26,7 +26,7 @@ #ifndef CURL_DISABLE_WEBSOCKETS struct ws_data { - CURL *easy; + CURL *curl; char *buf; size_t blen; size_t nwrites; @@ -83,7 +83,7 @@ static size_t t2302_write_cb(char *buffer, size_t size, size_t nitems, void *p) const struct curl_ws_frame *meta; (void)size; - meta = curl_ws_meta(ws_data->easy); + meta = curl_ws_meta(ws_data->curl); incoming = add_data(ws_data, buffer, incoming, meta); if(nitems != incoming) @@ -106,7 +106,7 @@ static CURLcode test_lib2302(const char *URL) if(ws_data.buf) { curl = curl_easy_init(); if(curl) { - ws_data.easy = curl; + ws_data.curl = curl; curl_easy_setopt(curl, CURLOPT_URL, URL); /* use the callback style */ diff --git a/tests/libtest/lib2306.c b/tests/libtest/lib2306.c index d2832e1cb21b..6b60ea637609 100644 --- a/tests/libtest/lib2306.c +++ b/tests/libtest/lib2306.c @@ -26,24 +26,24 @@ static CURLcode test_lib2306(const char *URL) { /* first a fine GET response, then a bad one */ - CURL *cl; + CURL *curl; CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); - easy_init(cl); - easy_setopt(cl, CURLOPT_URL, URL); - easy_setopt(cl, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(cl); + easy_init(curl); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + res = curl_easy_perform(curl); if(res) goto test_cleanup; /* reuse handle, do a second transfer */ - easy_setopt(cl, CURLOPT_URL, libtest_arg2); - res = curl_easy_perform(cl); + easy_setopt(curl, CURLOPT_URL, libtest_arg2); + res = curl_easy_perform(curl); test_cleanup: - curl_easy_cleanup(cl); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib2402.c b/tests/libtest/lib2402.c index ef3dc226a09b..1695208716b1 100644 --- a/tests/libtest/lib2402.c +++ b/tests/libtest/lib2402.c @@ -30,7 +30,7 @@ static CURLcode test_lib2402(const char *URL) CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; - CURLM *m = NULL; + CURLM *multi = NULL; size_t i; char target_url[256]; char dnsentry[256]; @@ -53,9 +53,9 @@ static CURLcode test_lib2402(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_MAXCONNECTS, 1L); + multi_setopt(multi, CURLMOPT_MAXCONNECTS, 1L); /* get each easy handle */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { @@ -86,7 +86,7 @@ static CURLcode test_lib2402(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { /* add handle to multi */ - multi_add_handle(m, curl[i]); + multi_add_handle(multi, curl[i]); for(;;) { struct timeval interval; @@ -96,7 +96,7 @@ static CURLcode test_lib2402(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -107,7 +107,7 @@ static CURLcode test_lib2402(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -123,13 +123,13 @@ static CURLcode test_lib2402(const char *URL) /* proper cleanup sequence - type PB */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { - curl_multi_remove_handle(m, curl[i]); + curl_multi_remove_handle(multi, curl[i]); curl_easy_cleanup(curl[i]); } curl_slist_free_all(slist); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib2404.c b/tests/libtest/lib2404.c index 8551957e0b4f..42d81d8d4ae6 100644 --- a/tests/libtest/lib2404.c +++ b/tests/libtest/lib2404.c @@ -30,7 +30,7 @@ static CURLcode test_lib2404(const char *URL) CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; - CURLM *m = NULL; + CURLM *multi = NULL; size_t i; char target_url[256]; char dnsentry[256]; @@ -53,9 +53,9 @@ static CURLcode test_lib2404(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_MAXCONNECTS, 1L); + multi_setopt(multi, CURLMOPT_MAXCONNECTS, 1L); /* get each easy handle */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { @@ -88,7 +88,7 @@ static CURLcode test_lib2404(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { /* add handle to multi */ - multi_add_handle(m, curl[i]); + multi_add_handle(multi, curl[i]); for(;;) { struct timeval interval; @@ -98,7 +98,7 @@ static CURLcode test_lib2404(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -109,7 +109,7 @@ static CURLcode test_lib2404(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -125,13 +125,13 @@ static CURLcode test_lib2404(const char *URL) /* proper cleanup sequence - type PB */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { - curl_multi_remove_handle(m, curl[i]); + curl_multi_remove_handle(multi, curl[i]); curl_easy_cleanup(curl[i]); } curl_slist_free_all(slist); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib2405.c b/tests/libtest/lib2405.c index 571a0bcaa80d..8d7f9056ff05 100644 --- a/tests/libtest/lib2405.c +++ b/tests/libtest/lib2405.c @@ -74,43 +74,43 @@ static size_t emptyWriteFunc(void *ptr, size_t size, size_t nmemb, return size * nmemb; } -static CURLcode set_easy(const char *URL, CURL *easy, long option) +static CURLcode set_easy(const char *URL, CURL *curl, long option) { CURLcode res = CURLE_OK; /* First set the URL that is about to receive our POST. */ - easy_setopt(easy, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); /* get verbose debug output please */ - easy_setopt(easy, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); switch(option) { case TEST_USE_HTTP1: /* go http1 */ - easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); break; case TEST_USE_HTTP2: /* go http2 */ - easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); break; case TEST_USE_HTTP2_MPLEX: /* go http2 with multiplexing */ - easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); - easy_setopt(easy, CURLOPT_PIPEWAIT, 1L); + easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + easy_setopt(curl, CURLOPT_PIPEWAIT, 1L); break; } /* no peer verify */ - easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L); - easy_setopt(easy, CURLOPT_SSL_VERIFYHOST, 0L); + easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); /* include headers */ - easy_setopt(easy, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_HEADER, 1L); /* empty write function */ - easy_setopt(easy, CURLOPT_WRITEFUNCTION, emptyWriteFunc); + easy_setopt(curl, CURLOPT_WRITEFUNCTION, emptyWriteFunc); test_cleanup: return res; @@ -123,8 +123,8 @@ static CURLcode test_run(const char *URL, long option, CURLM *multi = NULL; CURLM *multi1 = NULL; - CURL *easy1 = NULL; - CURL *easy2 = NULL; + CURL *curl1 = NULL; + CURL *curl2 = NULL; unsigned int max_count = 0; @@ -139,13 +139,13 @@ static CURLcode test_run(const char *URL, long option, struct curl_waitfd ufds1[10]; int numfds; - easy_init(easy1); - easy_init(easy2); + easy_init(curl1); + easy_init(curl2); - if(set_easy(URL, easy1, option) != CURLE_OK) + if(set_easy(URL, curl1, option) != CURLE_OK) goto test_cleanup; - if(set_easy(URL, easy2, option) != CURLE_OK) + if(set_easy(URL, curl2, option) != CURLE_OK) goto test_cleanup; multi_init(multi); @@ -154,8 +154,8 @@ static CURLcode test_run(const char *URL, long option, if(option == TEST_USE_HTTP2_MPLEX) multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - multi_add_handle(multi, easy1); - multi_add_handle(multi, easy2); + multi_add_handle(multi, curl1); + multi_add_handle(multi, curl2); while(!mc) { /* get the count of file descriptors from the transfers */ @@ -293,12 +293,12 @@ static CURLcode test_run(const char *URL, long option, } } - curl_multi_remove_handle(multi, easy1); - curl_multi_remove_handle(multi, easy2); + curl_multi_remove_handle(multi, curl1); + curl_multi_remove_handle(multi, curl2); test_cleanup: - curl_easy_cleanup(easy1); - curl_easy_cleanup(easy2); + curl_easy_cleanup(curl1); + curl_easy_cleanup(curl2); curl_multi_cleanup(multi); curl_multi_cleanup(multi1); @@ -313,7 +313,7 @@ static CURLcode empty_multi_test(void) { CURLMcode mc = CURLM_OK; CURLM *multi = NULL; - CURL *easy = NULL; + CURL *curl = NULL; struct curl_waitfd ufds[10]; @@ -338,12 +338,12 @@ static CURLcode empty_multi_test(void) } /* calling curl_multi_waitfds() on multi handle with added easy handle. */ - easy_init(easy); + easy_init(curl); - if(set_easy("http://example.com", easy, TEST_USE_HTTP1) != CURLE_OK) + if(set_easy("http://example.com", curl, TEST_USE_HTTP1) != CURLE_OK) goto test_cleanup; - multi_add_handle(multi, easy); + multi_add_handle(multi, curl); mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); @@ -359,10 +359,10 @@ static CURLcode empty_multi_test(void) goto test_cleanup; } - curl_multi_remove_handle(multi, easy); + curl_multi_remove_handle(multi, curl); test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_multi_cleanup(multi); return res; } diff --git a/tests/libtest/lib2502.c b/tests/libtest/lib2502.c index ba7da99a0706..b9a2cabd798c 100644 --- a/tests/libtest/lib2502.c +++ b/tests/libtest/lib2502.c @@ -31,7 +31,7 @@ static CURLcode test_lib2502(const char *URL) CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; - CURLM *m = NULL; + CURLM *multi = NULL; size_t i; char target_url[256]; char dnsentry[256]; @@ -54,9 +54,9 @@ static CURLcode test_lib2502(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_MAXCONNECTS, 1L); + multi_setopt(multi, CURLMOPT_MAXCONNECTS, 1L); /* get each easy handle */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { @@ -90,7 +90,7 @@ static CURLcode test_lib2502(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { /* add handle to multi */ - multi_add_handle(m, curl[i]); + multi_add_handle(multi, curl[i]); for(;;) { struct timeval interval; @@ -100,7 +100,7 @@ static CURLcode test_lib2502(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -111,7 +111,7 @@ static CURLcode test_lib2502(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -127,13 +127,13 @@ static CURLcode test_lib2502(const char *URL) /* proper cleanup sequence - type PB */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { - curl_multi_remove_handle(m, curl[i]); + curl_multi_remove_handle(multi, curl[i]); curl_easy_cleanup(curl[i]); } curl_slist_free_all(slist); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib3027.c b/tests/libtest/lib3027.c index 735f4c96e964..5cd2bd757d86 100644 --- a/tests/libtest/lib3027.c +++ b/tests/libtest/lib3027.c @@ -28,26 +28,26 @@ static CURLcode test_lib3027(const char *URL) { CURLcode ret = CURLE_OK; - CURL *hnd; + CURL *curl; start_test_timing(); curl_global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - if(hnd) { - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_FILETIME, 1L); - ret = curl_easy_perform(hnd); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); + ret = curl_easy_perform(curl); if(CURLE_OK == ret) { long filetime; - ret = curl_easy_getinfo(hnd, CURLINFO_FILETIME, &filetime); + ret = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); /* MTDM fails with 550, so filetime should be -1 */ if((CURLE_OK == ret) && (filetime != -1)) { /* we just need to return something which is not CURLE_OK */ ret = CURLE_UNSUPPORTED_PROTOCOL; } } - curl_easy_cleanup(hnd); + curl_easy_cleanup(curl); } curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib3033.c b/tests/libtest/lib3033.c index 1c0b9856fceb..b00bba9e7466 100644 --- a/tests/libtest/lib3033.c +++ b/tests/libtest/lib3033.c @@ -27,7 +27,7 @@ #include "memdebug.h" -static CURLcode t3033_req_test(CURLM *multi, CURL *easy, +static CURLcode t3033_req_test(CURLM *multi, CURL *curl, const char *URL, int index) { CURLMsg *msg = NULL; @@ -43,13 +43,13 @@ static CURLcode t3033_req_test(CURLM *multi, CURL *easy, curl_mprintf("[%d] no network change\n", index); } - curl_easy_reset(easy); - curl_easy_setopt(easy, CURLOPT_URL, URL); - easy_setopt(easy, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(easy, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(easy, CURLOPT_VERBOSE, 1L); + curl_easy_reset(curl); + curl_easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - curl_multi_add_handle(multi, easy); + curl_multi_add_handle(multi, curl); do { CURLMcode mres; @@ -76,7 +76,7 @@ static CURLcode t3033_req_test(CURLM *multi, CURL *easy, goto test_cleanup; } - curl_easy_getinfo(easy, CURLINFO_NUM_CONNECTS, &num_connects); + curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &num_connects); if(index == 1 && num_connects == 0) { curl_mprintf("[1] should not reuse connection in pool\n"); res = TEST_ERR_MAJOR_BAD; @@ -92,7 +92,7 @@ static CURLcode t3033_req_test(CURLM *multi, CURL *easy, test_cleanup: - curl_multi_remove_handle(multi, easy); + curl_multi_remove_handle(multi, curl); return res; } diff --git a/tests/libtest/lib3105.c b/tests/libtest/lib3105.c index 29dfdae00c37..808fd98ca4de 100644 --- a/tests/libtest/lib3105.c +++ b/tests/libtest/lib3105.c @@ -27,7 +27,7 @@ static CURLcode test_lib3105(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLM *multi = NULL; CURLcode i = CURLE_OK; CURLcode res = CURLE_OK; @@ -37,14 +37,14 @@ static CURLcode test_lib3105(const char *URL) multi_init(multi); - easy_init(curls); + easy_init(curl); - easy_setopt(curls, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); - multi_add_handle(multi, curls); + multi_add_handle(multi, curl); - mc = curl_multi_remove_handle(multi, curls); - mc += curl_multi_remove_handle(multi, curls); + mc = curl_multi_remove_handle(multi, curl); + mc += curl_multi_remove_handle(multi, curl); if(mc) { curl_mfprintf(stderr, "%d was unexpected\n", mc); @@ -53,7 +53,7 @@ static CURLcode test_lib3105(const char *URL) test_cleanup: curl_multi_cleanup(multi); - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); if(res) diff --git a/tests/libtest/lib3207.c b/tests/libtest/lib3207.c index e3b50ff40ff2..316258c86e93 100644 --- a/tests/libtest/lib3207.c +++ b/tests/libtest/lib3207.c @@ -115,19 +115,19 @@ static unsigned int test_thread(void *ptr) #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) -static void t3207_test_lock(CURL *handle, curl_lock_data data, +static void t3207_test_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, void *useptr) { curl_mutex_t *mutexes = (curl_mutex_t*) useptr; - (void)handle; + (void)curl; (void)laccess; Curl_mutex_acquire(&mutexes[data]); } -static void t3207_test_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void t3207_test_unlock(CURL *curl, curl_lock_data data, void *useptr) { curl_mutex_t *mutexes = (curl_mutex_t*) useptr; - (void)handle; + (void)curl; Curl_mutex_release(&mutexes[data]); } diff --git a/tests/libtest/lib502.c b/tests/libtest/lib502.c index 9a51267aae03..c33783ea687a 100644 --- a/tests/libtest/lib502.c +++ b/tests/libtest/lib502.c @@ -31,8 +31,8 @@ static CURLcode test_lib502(const char *URL) { - CURL *c = NULL; - CURLM *m = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; CURLcode res = CURLE_OK; int running; @@ -40,13 +40,13 @@ static CURLcode test_lib502(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(c); + easy_init(curl); - easy_setopt(c, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); - multi_init(m); + multi_init(multi); - multi_add_handle(m, c); + multi_add_handle(multi, curl); for(;;) { struct timeval timeout; @@ -56,7 +56,7 @@ static CURLcode test_lib502(const char *URL) timeout.tv_sec = 0; timeout.tv_usec = 100000L; /* 100 ms */ - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -67,7 +67,7 @@ static CURLcode test_lib502(const char *URL) FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); - multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -80,9 +80,9 @@ static CURLcode test_lib502(const char *URL) /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(m, c); - curl_multi_cleanup(m); - curl_easy_cleanup(c); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib503.c b/tests/libtest/lib503.c index f7529d47b79f..34a6105bf7ae 100644 --- a/tests/libtest/lib503.c +++ b/tests/libtest/lib503.c @@ -35,8 +35,8 @@ static CURLcode test_lib503(const char *URL) { - CURL *c = NULL; - CURLM *m = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; CURLcode res = CURLE_OK; int running; @@ -44,20 +44,20 @@ static CURLcode test_lib503(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(c); + easy_init(curl); - easy_setopt(c, CURLOPT_PROXY, libtest_arg2); /* set in first.c */ - easy_setopt(c, CURLOPT_URL, URL); - easy_setopt(c, CURLOPT_USERPWD, "test:ing"); - easy_setopt(c, CURLOPT_PROXYUSERNAME, "test%20"); - easy_setopt(c, CURLOPT_PROXYPASSWORD, "ing%41"); - easy_setopt(c, CURLOPT_HTTPPROXYTUNNEL, 1L); - easy_setopt(c, CURLOPT_HEADER, 1L); - easy_setopt(c, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */ + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_USERPWD, "test:ing"); + easy_setopt(curl, CURLOPT_PROXYUSERNAME, "test%20"); + easy_setopt(curl, CURLOPT_PROXYPASSWORD, "ing%41"); + easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_init(m); + multi_init(multi); - multi_add_handle(m, c); + multi_add_handle(multi, curl); for(;;) { struct timeval interval; @@ -67,7 +67,7 @@ static CURLcode test_lib503(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -78,7 +78,7 @@ static CURLcode test_lib503(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -91,9 +91,9 @@ static CURLcode test_lib503(const char *URL) /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(m, c); - curl_multi_cleanup(m); - curl_easy_cleanup(c); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c index 07b46345bbf8..fa9338f262ec 100644 --- a/tests/libtest/lib504.c +++ b/tests/libtest/lib504.c @@ -34,9 +34,9 @@ */ static CURLcode test_lib504(const char *URL) { - CURL *c = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; - CURLM *m = NULL; + CURLM *multi = NULL; fd_set rd, wr, exc; int running; @@ -44,18 +44,18 @@ static CURLcode test_lib504(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(c); + easy_init(curl); /* The point here is that there must not be anything running on the given proxy port */ if(libtest_arg2) - easy_setopt(c, CURLOPT_PROXY, libtest_arg2); - easy_setopt(c, CURLOPT_URL, URL); - easy_setopt(c, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_init(m); + multi_init(multi); - multi_add_handle(m, c); + multi_add_handle(multi, curl); for(;;) { struct timeval interval; @@ -66,12 +66,12 @@ static CURLcode test_lib504(const char *URL) curl_mfprintf(stderr, "curl_multi_perform()\n"); - multi_perform(m, &running); + multi_perform(multi, &running); while(running) { CURLMcode mres; int num; - mres = curl_multi_wait(m, NULL, 0, TEST_HANG_TIMEOUT, &num); + mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); if(mres != CURLM_OK) { curl_mprintf("curl_multi_wait() returned %d\n", mres); res = TEST_ERR_MAJOR_BAD; @@ -79,7 +79,7 @@ static CURLcode test_lib504(const char *URL) } abort_on_test_timeout(); - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); } @@ -88,7 +88,7 @@ static CURLcode test_lib504(const char *URL) if(!running) { /* This is where this code is expected to reach */ int numleft; - CURLMsg *msg = curl_multi_info_read(m, &numleft); + CURLMsg *msg = curl_multi_info_read(multi, &numleft); curl_mfprintf(stderr, "Expected: not running\n"); if(msg && !numleft) res = TEST_ERR_SUCCESS; /* this is where we should be */ @@ -104,7 +104,7 @@ static CURLcode test_lib504(const char *URL) curl_mfprintf(stderr, "curl_multi_fdset()\n"); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -117,9 +117,9 @@ static CURLcode test_lib504(const char *URL) /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(m, c); - curl_multi_cleanup(m); - curl_easy_cleanup(c); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index 4b6eb05f814f..7971fbeb17d6 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -42,14 +42,14 @@ struct t506_userdata { static int locks[3]; /* lock callback */ -static void t506_test_lock(CURL *handle, curl_lock_data data, +static void t506_test_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, void *useptr) { const char *what; struct t506_userdata *user = (struct t506_userdata *)useptr; int locknum; - (void)handle; + (void)curl; (void)laccess; switch(data) { @@ -82,12 +82,12 @@ static void t506_test_lock(CURL *handle, curl_lock_data data, } /* unlock callback */ -static void t506_test_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void t506_test_unlock(CURL *curl, curl_lock_data data, void *useptr) { const char *what; struct t506_userdata *user = (struct t506_userdata *)useptr; int locknum; - (void)handle; + (void)curl; switch(data) { case CURL_LOCK_DATA_SHARE: what = "share"; diff --git a/tests/libtest/lib507.c b/tests/libtest/lib507.c index de23b02f0a3b..9a306d39a656 100644 --- a/tests/libtest/lib507.c +++ b/tests/libtest/lib507.c @@ -27,7 +27,7 @@ static CURLcode test_lib507(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLM *multi = NULL; int still_running; CURLcode i = TEST_ERR_MAJOR_BAD; @@ -40,12 +40,12 @@ static CURLcode test_lib507(const char *URL) multi_init(multi); - easy_init(curls); + easy_init(curl); - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); - multi_add_handle(multi, curls); + multi_add_handle(multi, curl); multi_perform(multi, &still_running); @@ -88,7 +88,7 @@ static CURLcode test_lib507(const char *URL) /* undocumented cleanup sequence - type UA */ curl_multi_cleanup(multi); - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); if(res) diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c index 55224eb76e05..4c33973ec9f7 100644 --- a/tests/libtest/lib525.c +++ b/tests/libtest/lib525.c @@ -33,7 +33,7 @@ static CURLcode test_lib525(const char *URL) FILE *hd_src = NULL; int hd; struct_stat file_info; - CURLM *m = NULL; + CURLM *multi = NULL; int running; start_test_timing(); @@ -101,9 +101,9 @@ static CURLcode test_lib525(const char *URL) make sure that to pass in a type 'long' argument. */ easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); - multi_init(m); + multi_init(multi); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); for(;;) { struct timeval interval; @@ -113,7 +113,7 @@ static CURLcode test_lib525(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -124,7 +124,7 @@ static CURLcode test_lib525(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -137,16 +137,16 @@ static CURLcode test_lib525(const char *URL) if(testnum == 529) { /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(m, curl); - curl_multi_cleanup(m); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); curl_easy_cleanup(curl); curl_global_cleanup(); } else { /* testnum == 525 */ /* proper cleanup sequence - type PB */ - curl_multi_remove_handle(m, curl); + curl_multi_remove_handle(multi, curl); curl_easy_cleanup(curl); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); } diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c index 963181713b27..6f586c5a3e54 100644 --- a/tests/libtest/lib526.c +++ b/tests/libtest/lib526.c @@ -49,7 +49,7 @@ static CURLcode test_lib526(const char *URL) CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES]; int running; - CURLM *m = NULL; + CURLM *multi = NULL; size_t current = 0; size_t i; @@ -69,9 +69,9 @@ static CURLcode test_lib526(const char *URL) easy_setopt(curl[i], CURLOPT_VERBOSE, 1L); } - multi_init(m); + multi_init(multi); - multi_add_handle(m, curl[current]); + multi_add_handle(multi, curl[current]); curl_mfprintf(stderr, "Start at URL 0\n"); @@ -83,7 +83,7 @@ static CURLcode test_lib526(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -99,7 +99,7 @@ static CURLcode test_lib526(const char *URL) curl_mfprintf(stderr, "Advancing to URL %zu\n", current); if(testnum == 532) { /* first remove the only handle we use */ - curl_multi_remove_handle(m, curl[0]); + curl_multi_remove_handle(multi, curl[0]); /* make us reuse the same handle all the time, and try resetting the handle first too */ @@ -109,10 +109,10 @@ static CURLcode test_lib526(const char *URL) easy_setopt(curl[0], CURLOPT_VERBOSE, 1L); /* re-add it */ - multi_add_handle(m, curl[0]); + multi_add_handle(multi, curl[0]); } else { - multi_add_handle(m, curl[current]); + multi_add_handle(multi, curl[current]); } } else { @@ -124,7 +124,7 @@ static CURLcode test_lib526(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -139,10 +139,10 @@ static CURLcode test_lib526(const char *URL) /* proper cleanup sequence - type PB */ for(i = 0; i < CURL_ARRAYSIZE(curl); i++) { - curl_multi_remove_handle(m, curl[i]); + curl_multi_remove_handle(multi, curl[i]); curl_easy_cleanup(curl[i]); } - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); } else if(testnum == 527) { @@ -155,7 +155,7 @@ static CURLcode test_lib526(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(curl); i++) curl_easy_cleanup(curl[i]); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); } @@ -164,7 +164,7 @@ static CURLcode test_lib526(const char *URL) for(i = 0; i < CURL_ARRAYSIZE(curl); i++) curl_easy_cleanup(curl[i]); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); } diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index 7d8cc3cbcb2d..5558487122c1 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -131,12 +131,12 @@ static int t530_addFd(struct t530_Sockets *sockets, curl_socket_t fd, /** * Callback invoked by curl to poll reading / writing of a socket. */ -static int t530_curlSocketCallback(CURL *easy, curl_socket_t s, int action, +static int t530_curlSocketCallback(CURL *curl, curl_socket_t s, int action, void *userp, void *socketp) { struct t530_ReadWriteSockets *sockets = userp; - (void)easy; + (void)curl; (void)socketp; t530_ctx.socket_calls++; @@ -189,13 +189,13 @@ static int t530_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) /** * Check for curl completion. */ -static int t530_checkForCompletion(CURLM *curl, int *success) +static int t530_checkForCompletion(CURLM *multi, int *success) { int result = 0; *success = 0; while(1) { int numMessages; - CURLMsg *message = curl_multi_info_read(curl, &numMessages); + CURLMsg *message = curl_multi_info_read(multi, &numMessages); if(!message) break; if(message->msg == CURLMSG_DONE) { @@ -250,11 +250,12 @@ static void t530_updateFdSet(struct t530_Sockets *sockets, fd_set* fdset, } } -static CURLMcode socket_action(CURLM *curl, curl_socket_t s, int evBitmask, +static CURLMcode socket_action(CURLM *multi, curl_socket_t s, int evBitmask, const char *info) { int numhandles = 0; - CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); + CURLMcode result = curl_multi_socket_action(multi, s, evBitmask, + &numhandles); if(result != CURLM_OK) { curl_mfprintf(stderr, "%s Curl error on %s (%i) %s\n", t530_tag(), info, result, curl_multi_strerror(result)); @@ -265,7 +266,7 @@ static CURLMcode socket_action(CURLM *curl, curl_socket_t s, int evBitmask, /** * Invoke curl when a file descriptor is set. */ -static CURLMcode t530_checkFdSet(CURLM *curl, struct t530_Sockets *sockets, +static CURLMcode t530_checkFdSet(CURLM *multi, struct t530_Sockets *sockets, fd_set *fdset, int evBitmask, const char *name) { @@ -273,7 +274,7 @@ static CURLMcode t530_checkFdSet(CURLM *curl, struct t530_Sockets *sockets, CURLMcode result = CURLM_OK; for(i = 0; i < sockets->count; ++i) { if(FD_ISSET(sockets->sockets[i], fdset)) { - result = socket_action(curl, sockets->sockets[i], evBitmask, name); + result = socket_action(multi, sockets->sockets[i], evBitmask, name); if(result) break; } @@ -284,7 +285,8 @@ static CURLMcode t530_checkFdSet(CURLM *curl, struct t530_Sockets *sockets, static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) { CURLcode res = CURLE_OK; - CURL *curl = NULL; CURLM *m = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; struct t530_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; int success = 0; struct curltime timeout = {0}; @@ -310,22 +312,22 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) /* go verbose */ easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_SOCKETFUNCTION, t530_curlSocketCallback); - multi_setopt(m, CURLMOPT_SOCKETDATA, &sockets); + multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, t530_curlSocketCallback); + multi_setopt(multi, CURLMOPT_SOCKETDATA, &sockets); - multi_setopt(m, CURLMOPT_TIMERFUNCTION, t530_curlTimerCallback); - multi_setopt(m, CURLMOPT_TIMERDATA, &timeout); + multi_setopt(multi, CURLMOPT_TIMERFUNCTION, t530_curlTimerCallback); + multi_setopt(multi, CURLMOPT_TIMERDATA, &timeout); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); - if(socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + if(socket_action(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } - while(!t530_checkForCompletion(m, &success)) { + while(!t530_checkForCompletion(multi, &success)) { fd_set readSet, writeSet; curl_socket_t maxFd = 0; struct timeval tv = {0}; @@ -350,12 +352,12 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) select_test((int)maxFd, &readSet, &writeSet, NULL, &tv); /* Check the sockets for reading / writing */ - if(t530_checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, + if(t530_checkFdSet(multi, &sockets.read, &readSet, CURL_CSELECT_IN, "read")) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } - if(t530_checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, + if(t530_checkFdSet(multi, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write")) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; @@ -364,7 +366,7 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) if(timeout.tv_sec != (time_t)-1 && t530_getMicroSecondTimeout(&timeout) == 0) { /* Curl's timer has elapsed. */ - if(socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + if(socket_action(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { res = TEST_ERR_BAD_TIMEOUT; goto test_cleanup; } @@ -382,9 +384,9 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) /* proper cleanup sequence */ t530_msg("cleanup"); - curl_multi_remove_handle(m, curl); + curl_multi_remove_handle(multi, curl); curl_easy_cleanup(curl); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); /* free local memory */ diff --git a/tests/libtest/lib533.c b/tests/libtest/lib533.c index adba324f669f..8f3b0f1474c0 100644 --- a/tests/libtest/lib533.c +++ b/tests/libtest/lib533.c @@ -32,7 +32,7 @@ static CURLcode test_lib533(const char *URL) CURLcode res = CURLE_OK; CURL *curl = NULL; int running; - CURLM *m = NULL; + CURLM *multi = NULL; int current = 0; start_test_timing(); @@ -45,9 +45,9 @@ static CURLcode test_lib533(const char *URL) easy_setopt(curl, CURLOPT_VERBOSE, 1L); easy_setopt(curl, CURLOPT_FAILONERROR, 1L); - multi_init(m); + multi_init(multi); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); curl_mfprintf(stderr, "Start at URL 0\n"); @@ -59,7 +59,7 @@ static CURLcode test_lib533(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -67,7 +67,7 @@ static CURLcode test_lib533(const char *URL) if(!current++) { curl_mfprintf(stderr, "Advancing to URL 1\n"); /* remove the handle we use */ - curl_multi_remove_handle(m, curl); + curl_multi_remove_handle(multi, curl); /* make us reuse the same handle all the time, and try resetting the handle first too */ @@ -77,7 +77,7 @@ static CURLcode test_lib533(const char *URL) easy_setopt(curl, CURLOPT_FAILONERROR, 1L); /* re-add it */ - multi_add_handle(m, curl); + multi_add_handle(multi, curl); } else break; /* done */ @@ -87,7 +87,7 @@ static CURLcode test_lib533(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -101,7 +101,7 @@ static CURLcode test_lib533(const char *URL) /* undocumented cleanup sequence - type UB */ curl_easy_cleanup(curl); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index f544dec48d3f..9eb7e407c0f5 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -34,48 +34,49 @@ #include "memdebug.h" -static CURL *testeh[2]; +static CURL *t540_curl[2]; -static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd, - struct curl_slist *headers) +static CURLcode init(int num, CURLM *multi, const char *url, + const char *userpwd, struct curl_slist *headers) { CURLcode res = CURLE_OK; const char *proxy = libtest_arg2; - res_easy_init(testeh[num]); + res_easy_init(t540_curl[num]); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_URL, url); + res_easy_setopt(t540_curl[num], CURLOPT_URL, url); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_PROXY, proxy); + res_easy_setopt(t540_curl[num], CURLOPT_PROXY, proxy); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_PROXYUSERPWD, userpwd); + res_easy_setopt(t540_curl[num], CURLOPT_PROXYUSERPWD, userpwd); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, CURLAUTH_ANY); + res_easy_setopt(t540_curl[num], CURLOPT_PROXYAUTH, CURLAUTH_ANY); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_VERBOSE, 1L); + res_easy_setopt(t540_curl[num], CURLOPT_VERBOSE, 1L); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_HEADER, 1L); + res_easy_setopt(t540_curl[num], CURLOPT_HEADER, 1L); if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_HTTPHEADER, headers); /* custom Host: */ + /* custom Host: */ + res_easy_setopt(t540_curl[num], CURLOPT_HTTPHEADER, headers); if(res) goto init_failed; - res_multi_add_handle(cm, testeh[num]); + res_multi_add_handle(multi, t540_curl[num]); if(res) goto init_failed; @@ -83,14 +84,14 @@ static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd, init_failed: - curl_easy_cleanup(testeh[num]); - testeh[num] = NULL; + curl_easy_cleanup(t540_curl[num]); + t540_curl[num] = NULL; return res; /* failure */ } -static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, - struct curl_slist *headers) +static CURLcode loop(int num, CURLM *multi, const char *url, + const char *userpwd, struct curl_slist *headers) { CURLMsg *msg; long L; @@ -99,7 +100,7 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, struct timeval T; CURLcode res = CURLE_OK; - res = init(num, cm, url, userpwd, headers); + res = init(num, multi, url, userpwd, headers); if(res) return res; @@ -107,7 +108,7 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, int M = -99; - res_multi_perform(cm, &U); + res_multi_perform(multi, &U); if(res) return res; @@ -120,13 +121,13 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, FD_ZERO(&W); FD_ZERO(&E); - res_multi_fdset(cm, &R, &W, &E, &M); + res_multi_fdset(multi, &R, &W, &E, &M); if(res) return res; /* At this point, M is guaranteed to be greater or equal than -1. */ - res_multi_timeout(cm, &L); + res_multi_timeout(multi, &L); if(res) return res; @@ -153,19 +154,19 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, } while(1) { - msg = curl_multi_info_read(cm, &Q); + msg = curl_multi_info_read(multi, &Q); if(!msg) break; if(msg->msg == CURLMSG_DONE) { size_t i; - CURL *e = msg->easy_handle; + CURL *curl = msg->easy_handle; curl_mfprintf(stderr, "R: %d - %s\n", msg->data.result, curl_easy_strerror(msg->data.result)); - curl_multi_remove_handle(cm, e); - curl_easy_cleanup(e); - for(i = 0; i < CURL_ARRAYSIZE(testeh); i++) { - if(testeh[i] == e) { - testeh[i] = NULL; + curl_multi_remove_handle(multi, curl); + curl_easy_cleanup(curl); + for(i = 0; i < CURL_ARRAYSIZE(t540_curl); i++) { + if(t540_curl[i] == curl) { + t540_curl[i] = NULL; break; } } @@ -184,7 +185,7 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, static CURLcode test_lib540(const char *URL) { - CURLM *cm = NULL; + CURLM *multi = NULL; struct curl_slist *headers = NULL; char buffer[246]; /* naively fixed-size */ CURLcode res = CURLE_OK; @@ -193,8 +194,8 @@ static CURLcode test_lib540(const char *URL) const char *proxyuserpws = libtest_arg3; const char *host; - for(i = 0; i < CURL_ARRAYSIZE(testeh); i++) - testeh[i] = NULL; + for(i = 0; i < CURL_ARRAYSIZE(t540_curl); i++) + t540_curl[i] = NULL; start_test_timing(); @@ -217,31 +218,31 @@ static CURLcode test_lib540(const char *URL) return res; } - res_multi_init(cm); + res_multi_init(multi); if(res) { curl_global_cleanup(); curl_slist_free_all(headers); return res; } - res = loop(0, cm, URL, proxyuserpws, headers); + res = loop(0, multi, URL, proxyuserpws, headers); if(res) goto test_cleanup; curl_mfprintf(stderr, "lib540: now we do the request again\n"); - res = loop(1, cm, URL, proxyuserpws, headers); + res = loop(1, multi, URL, proxyuserpws, headers); test_cleanup: /* proper cleanup sequence - type PB */ - for(i = 0; i < CURL_ARRAYSIZE(testeh); i++) { - curl_multi_remove_handle(cm, testeh[i]); - curl_easy_cleanup(testeh[i]); + for(i = 0; i < CURL_ARRAYSIZE(t540_curl); i++) { + curl_multi_remove_handle(multi, t540_curl[i]); + curl_easy_cleanup(t540_curl[i]); } - curl_multi_cleanup(cm); + curl_multi_cleanup(multi); curl_global_cleanup(); curl_slist_free_all(headers); diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c index d3653dbccd2f..579a71a6117c 100644 --- a/tests/libtest/lib543.c +++ b/tests/libtest/lib543.c @@ -34,37 +34,37 @@ static CURLcode test_lib543(const char *URL) 0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa, 0x1d, 0x57, 0xe1}; - CURL *easy; + CURL *curl; CURLcode res = CURLE_OK; (void)URL; global_init(CURL_GLOBAL_ALL); - easy = curl_easy_init(); - if(!easy) { + curl = curl_easy_init(); + if(!curl) { curl_mfprintf(stderr, "curl_easy_init() failed\n"); res = TEST_ERR_MAJOR_BAD; } else { int asize = (int)sizeof(a); - char *s = curl_easy_escape(easy, (const char *)a, asize); + char *s = curl_easy_escape(curl, (const char *)a, asize); if(s) { curl_mprintf("%s\n", s); curl_free(s); } - s = curl_easy_escape(easy, "", 0); + s = curl_easy_escape(curl, "", 0); if(s) { curl_mprintf("IN: '' OUT: '%s'\n", s); curl_free(s); } - s = curl_easy_escape(easy, " 123", 3); + s = curl_easy_escape(curl, " 123", 3); if(s) { curl_mprintf("IN: ' 12' OUT: '%s'\n", s); curl_free(s); } - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); } curl_global_cleanup(); diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c index c49a8e54b8f4..d0ed914051ed 100644 --- a/tests/libtest/lib544.c +++ b/tests/libtest/lib544.c @@ -67,11 +67,11 @@ static CURLcode test_lib544(const char *URL) strcpy(teststring, "FAIL"); { - CURL *handle2; - handle2 = curl_easy_duphandle(curl); + CURL *curl2; + curl2 = curl_easy_duphandle(curl); curl_easy_cleanup(curl); - curl = handle2; + curl = curl2; } /* Now, this is a POST request with binary 0 embedded in POST data. */ diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index 6114d57aab27..9184d933a882 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -53,10 +53,10 @@ static size_t t547_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp) return 0; } -static curlioerr t547_ioctl_callback(CURL *handle, int cmd, void *clientp) +static curlioerr t547_ioctl_callback(CURL *curl, int cmd, void *clientp) { int *counter = (int *)clientp; - (void)handle; + (void)curl; if(cmd == CURLIOCMD_RESTARTREAD) { curl_mfprintf(stderr, "REWIND!\n"); *counter = 0; /* clear counter to make the read callback restart */ diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index 198ba6aa8868..3d5b09c1ec3f 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -54,7 +54,7 @@ static size_t t552_write_cb(char *ptr, size_t size, size_t nmemb, void *stream) return amount; } -static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp) +static curlioerr ioctl_callback(CURL *curl, int cmd, void *clientp) { (void)clientp; if(cmd == CURLIOCMD_RESTARTREAD) { @@ -63,7 +63,7 @@ static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp) current_offset = 0; return CURLIOE_OK; } - (void)handle; + (void)curl; return CURLIOE_UNKNOWNCMD; } diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index fe3b6921174a..19e0480e2a51 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -57,10 +57,10 @@ static size_t t555_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp) return 0; } -static curlioerr t555_ioctl_callback(CURL *handle, int cmd, void *clientp) +static curlioerr t555_ioctl_callback(CURL *curl, int cmd, void *clientp) { int *counter = (int *)clientp; - (void)handle; + (void)curl; if(cmd == CURLIOCMD_RESTARTREAD) { curl_mfprintf(stderr, "REWIND!\n"); *counter = 0; /* clear counter to make the read callback restart */ @@ -73,7 +73,7 @@ static CURLcode test_lib555(const char *URL) CURLcode res = CURLE_OK; CURL *curl = NULL; int counter = 0; - CURLM *m = NULL; + CURLM *multi = NULL; int running = 1; start_test_timing(); @@ -102,9 +102,9 @@ static CURLcode test_lib555(const char *URL) easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM); - multi_init(m); + multi_init(multi); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); while(running) { struct timeval timeout; @@ -114,7 +114,7 @@ static CURLcode test_lib555(const char *URL) timeout.tv_sec = 0; timeout.tv_usec = 100000L; /* 100 ms */ - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -125,7 +125,7 @@ static CURLcode test_lib555(const char *URL) FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); - multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -138,8 +138,8 @@ static CURLcode test_lib555(const char *URL) /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(m, curl); - curl_multi_cleanup(m); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); curl_easy_cleanup(curl); curl_global_cleanup(); diff --git a/tests/libtest/lib560.c b/tests/libtest/lib560.c index 060e27eea059..bbdb7990e426 100644 --- a/tests/libtest/lib560.c +++ b/tests/libtest/lib560.c @@ -37,8 +37,8 @@ */ static CURLcode test_lib560(const char *URL) { - CURL *http_handle = NULL; - CURLM *multi_handle = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; CURLcode res = CURLE_OK; int still_running; /* keep number of running handles */ @@ -49,22 +49,22 @@ static CURLcode test_lib560(const char *URL) ** curl_global_init called indirectly from curl_easy_init. */ - easy_init(http_handle); + easy_init(curl); /* set options */ - easy_setopt(http_handle, CURLOPT_URL, URL); - easy_setopt(http_handle, CURLOPT_HEADER, 1L); - easy_setopt(http_handle, CURLOPT_SSL_VERIFYPEER, 0L); - easy_setopt(http_handle, CURLOPT_SSL_VERIFYHOST, 0L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); /* init a multi stack */ - multi_init(multi_handle); + multi_init(multi); /* add the individual transfers */ - multi_add_handle(multi_handle, http_handle); + multi_add_handle(multi, curl); /* we start some action by calling perform right away */ - multi_perform(multi_handle, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout(); @@ -85,7 +85,7 @@ static CURLcode test_lib560(const char *URL) timeout.tv_usec = 0; /* get file descriptors from the transfers */ - multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -94,7 +94,7 @@ static CURLcode test_lib560(const char *URL) abort_on_test_timeout(); /* timeout or readable/writable sockets */ - multi_perform(multi_handle, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout(); } @@ -103,8 +103,8 @@ static CURLcode test_lib560(const char *URL) /* undocumented cleanup sequence - type UA */ - curl_multi_cleanup(multi_handle); - curl_easy_cleanup(http_handle); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib564.c b/tests/libtest/lib564.c index 3fc86015044b..b105fc710e6b 100644 --- a/tests/libtest/lib564.c +++ b/tests/libtest/lib564.c @@ -31,7 +31,7 @@ static CURLcode test_lib564(const char *URL) CURLcode res = CURLE_OK; CURL *curl = NULL; int running; - CURLM *m = NULL; + CURLM *multi = NULL; debug_config.nohex = TRUE; debug_config.tracetime = TRUE; @@ -49,9 +49,9 @@ static CURLcode test_lib564(const char *URL) easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); - multi_init(m); + multi_init(multi); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); curl_mfprintf(stderr, "Start at URL 0\n"); @@ -63,7 +63,7 @@ static CURLcode test_lib564(const char *URL) interval.tv_sec = 1; interval.tv_usec = 0; - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -74,7 +74,7 @@ static CURLcode test_lib564(const char *URL) FD_ZERO(&wr); FD_ZERO(&exc); - multi_fdset(m, &rd, &wr, &exc, &maxfd); + multi_fdset(multi, &rd, &wr, &exc, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -88,7 +88,7 @@ static CURLcode test_lib564(const char *URL) /* undocumented cleanup sequence - type UB */ curl_easy_cleanup(curl); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c index 572bfa0cd12c..38612df7b58c 100644 --- a/tests/libtest/lib573.c +++ b/tests/libtest/lib573.c @@ -32,8 +32,8 @@ static CURLcode test_lib573(const char *URL) { - CURL *c = NULL; - CURLM *m = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; CURLcode res = CURLE_OK; int running = 1; double connect_time = 0.0; @@ -48,20 +48,20 @@ static CURLcode test_lib573(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(c); + easy_init(curl); - easy_setopt(c, CURLOPT_HEADER, 1L); - easy_setopt(c, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_URL, URL); debug_config.nohex = TRUE; debug_config.tracetime = TRUE; - easy_setopt(c, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(c, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(c, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - multi_init(m); + multi_init(multi); - multi_add_handle(m, c); + multi_add_handle(multi, curl); while(running) { struct timeval timeout; @@ -71,7 +71,7 @@ static CURLcode test_lib573(const char *URL) timeout.tv_sec = 0; timeout.tv_usec = 100000L; /* 100 ms */ - multi_perform(m, &running); + multi_perform(multi, &running); abort_on_test_timeout(); @@ -82,7 +82,7 @@ static CURLcode test_lib573(const char *URL) FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); - multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -91,7 +91,7 @@ static CURLcode test_lib573(const char *URL) abort_on_test_timeout(); } - curl_easy_getinfo(c, CURLINFO_CONNECT_TIME, &connect_time); + curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &connect_time); if(connect_time < dbl_epsilon) { curl_mfprintf(stderr, "connect time %e is < epsilon %e\n", connect_time, dbl_epsilon); @@ -102,9 +102,9 @@ static CURLcode test_lib573(const char *URL) /* proper cleanup sequence - type PA */ - curl_multi_remove_handle(m, c); - curl_multi_cleanup(m); - curl_easy_cleanup(c); + curl_multi_remove_handle(multi, curl); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib575.c b/tests/libtest/lib575.c index a0ac02f85212..36efe6ef5a66 100644 --- a/tests/libtest/lib575.c +++ b/tests/libtest/lib575.c @@ -33,9 +33,9 @@ static CURLcode test_lib575(const char *URL) { - CURL *handle = NULL; - CURL *duphandle = NULL; - CURLM *mhandle = NULL; + CURL *curl = NULL; + CURL *curldupe = NULL; + CURLM *multi = NULL; CURLcode res = CURLE_OK; int still_running = 0; @@ -43,31 +43,31 @@ static CURLcode test_lib575(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(handle); + easy_init(curl); - easy_setopt(handle, CURLOPT_URL, URL); - easy_setopt(handle, CURLOPT_WILDCARDMATCH, 1L); - easy_setopt(handle, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_WILDCARDMATCH, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); if(res) goto test_cleanup; - duphandle = curl_easy_duphandle(handle); - if(!duphandle) + curldupe = curl_easy_duphandle(curl); + if(!curldupe) goto test_cleanup; - curl_easy_cleanup(handle); - handle = duphandle; + curl_easy_cleanup(curl); + curl = curldupe; - multi_init(mhandle); + multi_init(multi); - multi_add_handle(mhandle, handle); + multi_add_handle(multi, curl); - multi_perform(mhandle, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout(); @@ -85,7 +85,7 @@ static CURLcode test_lib575(const char *URL) FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); - multi_fdset(mhandle, &fdread, &fdwrite, &fdexcep, &maxfd); + multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); /* At this point, maxfd is guaranteed to be greater or equal than -1. */ @@ -93,7 +93,7 @@ static CURLcode test_lib575(const char *URL) abort_on_test_timeout(); - multi_perform(mhandle, &still_running); + multi_perform(multi, &still_running); abort_on_test_timeout(); } @@ -102,8 +102,8 @@ static CURLcode test_lib575(const char *URL) /* undocumented cleanup sequence - type UA */ - curl_multi_cleanup(mhandle); - curl_easy_cleanup(handle); + curl_multi_cleanup(multi); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib576.c b/tests/libtest/lib576.c index a054dba3fa91..11c0f76d1390 100644 --- a/tests/libtest/lib576.c +++ b/tests/libtest/lib576.c @@ -98,27 +98,27 @@ static long chunk_end(void *ptr) static CURLcode test_lib576(const char *URL) { - CURL *handle = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; struct chunk_data chunk_data = {0, 0}; curl_global_init(CURL_GLOBAL_ALL); - handle = curl_easy_init(); - if(!handle) { + curl = curl_easy_init(); + if(!curl) { res = CURLE_OUT_OF_MEMORY; goto test_cleanup; } - test_setopt(handle, CURLOPT_URL, URL); - test_setopt(handle, CURLOPT_WILDCARDMATCH, 1L); - test_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, chunk_bgn); - test_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, chunk_end); - test_setopt(handle, CURLOPT_CHUNK_DATA, &chunk_data); + test_setopt(curl, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_WILDCARDMATCH, 1L); + test_setopt(curl, CURLOPT_CHUNK_BGN_FUNCTION, chunk_bgn); + test_setopt(curl, CURLOPT_CHUNK_END_FUNCTION, chunk_end); + test_setopt(curl, CURLOPT_CHUNK_DATA, &chunk_data); - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); test_cleanup: - if(handle) - curl_easy_cleanup(handle); + if(curl) + curl_easy_cleanup(curl); curl_global_cleanup(); return res; } diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index 187432ac0cb8..e013daedff8a 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -92,12 +92,12 @@ static void t582_addFd(struct t582_Sockets *sockets, curl_socket_t fd, /** * Callback invoked by curl to poll reading / writing of a socket. */ -static int t582_curlSocketCallback(CURL *easy, curl_socket_t s, int action, +static int t582_curlSocketCallback(CURL *curl, curl_socket_t s, int action, void *userp, void *socketp) { struct t582_ReadWriteSockets *sockets = userp; - (void)easy; + (void)curl; (void)socketp; if(action == CURL_POLL_IN || action == CURL_POLL_INOUT) @@ -135,13 +135,13 @@ static int t582_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) /** * Check for curl completion. */ -static int t582_checkForCompletion(CURLM *curl, int *success) +static int t582_checkForCompletion(CURLM *multi, int *success) { int result = 0; *success = 0; while(1) { int numMessages; - CURLMsg *message = curl_multi_info_read(curl, &numMessages); + CURLMsg *message = curl_multi_info_read(multi, &numMessages); if(!message) break; if(message->msg == CURLMSG_DONE) { @@ -196,11 +196,12 @@ static void t582_updateFdSet(struct t582_Sockets *sockets, fd_set* fdset, } } -static void notifyCurl(CURLM *curl, curl_socket_t s, int evBitmask, +static void notifyCurl(CURLM *multi, curl_socket_t s, int evBitmask, const char *info) { int numhandles = 0; - CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); + CURLMcode result = curl_multi_socket_action(multi, s, evBitmask, + &numhandles); if(result != CURLM_OK) { curl_mfprintf(stderr, "Curl error on %s (%i) %s\n", info, result, curl_multi_strerror(result)); @@ -210,13 +211,13 @@ static void notifyCurl(CURLM *curl, curl_socket_t s, int evBitmask, /** * Invoke curl when a file descriptor is set. */ -static void t582_checkFdSet(CURLM *curl, struct t582_Sockets *sockets, +static void t582_checkFdSet(CURLM *multi, struct t582_Sockets *sockets, fd_set *fdset, int evBitmask, const char *name) { int i; for(i = 0; i < sockets->count; ++i) { if(FD_ISSET(sockets->sockets[i], fdset)) { - notifyCurl(curl, sockets->sockets[i], evBitmask, name); + notifyCurl(multi, sockets->sockets[i], evBitmask, name); } } } @@ -229,7 +230,7 @@ static CURLcode test_lib582(const char *URL) FILE *hd_src = NULL; int hd; struct_stat file_info; - CURLM *m = NULL; + CURLM *multi = NULL; struct t582_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; int success = 0; struct curltime timeout = {0}; @@ -297,17 +298,17 @@ static CURLcode test_lib582(const char *URL) easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_SOCKETFUNCTION, t582_curlSocketCallback); - multi_setopt(m, CURLMOPT_SOCKETDATA, &sockets); + multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, t582_curlSocketCallback); + multi_setopt(multi, CURLMOPT_SOCKETDATA, &sockets); - multi_setopt(m, CURLMOPT_TIMERFUNCTION, t582_curlTimerCallback); - multi_setopt(m, CURLMOPT_TIMERDATA, &timeout); + multi_setopt(multi, CURLMOPT_TIMERFUNCTION, t582_curlTimerCallback); + multi_setopt(multi, CURLMOPT_TIMERDATA, &timeout); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); - while(!t582_checkForCompletion(m, &success)) { + while(!t582_checkForCompletion(multi, &success)) { fd_set readSet, writeSet; curl_socket_t maxFd = 0; struct timeval tv = {0}; @@ -331,13 +332,15 @@ static CURLcode test_lib582(const char *URL) select_test((int)maxFd, &readSet, &writeSet, NULL, &tv); /* Check the sockets for reading / writing */ - t582_checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, "read"); - t582_checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write"); + t582_checkFdSet(multi, &sockets.read, &readSet, CURL_CSELECT_IN, + "read"); + t582_checkFdSet(multi, &sockets.write, &writeSet, CURL_CSELECT_OUT, + "write"); if(timeout.tv_sec != (time_t)-1 && t582_getMicroSecondTimeout(&timeout) == 0) { /* Curl's timer has elapsed. */ - notifyCurl(m, CURL_SOCKET_TIMEOUT, 0, "timeout"); + notifyCurl(multi, CURL_SOCKET_TIMEOUT, 0, "timeout"); } abort_on_test_timeout(); @@ -352,9 +355,9 @@ static CURLcode test_lib582(const char *URL) /* proper cleanup sequence - type PB */ - curl_multi_remove_handle(m, curl); + curl_multi_remove_handle(multi, curl); curl_easy_cleanup(curl); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); /* close the local file */ diff --git a/tests/libtest/lib583.c b/tests/libtest/lib583.c index 9950e8b402b7..510c5a3bdcf6 100644 --- a/tests/libtest/lib583.c +++ b/tests/libtest/lib583.c @@ -33,7 +33,7 @@ static CURLcode test_lib583(const char *URL) { int stillRunning; - CURLM *multiHandle = NULL; + CURLM *multi = NULL; CURL *curl = NULL; CURLcode res = CURLE_OK; CURLMcode mres; @@ -42,7 +42,7 @@ static CURLcode test_lib583(const char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(multiHandle); + multi_init(multi); easy_init(curl); @@ -56,19 +56,19 @@ static CURLcode test_lib583(const char *URL) easy_setopt(curl, CURLOPT_URL, URL); easy_setopt(curl, CURLOPT_INFILESIZE, 5L); - multi_add_handle(multiHandle, curl); + multi_add_handle(multi, curl); /* this tests if removing an easy handle immediately after multi perform has been called succeeds or not. */ curl_mfprintf(stderr, "curl_multi_perform()...\n"); - multi_perform(multiHandle, &stillRunning); + multi_perform(multi, &stillRunning); curl_mfprintf(stderr, "curl_multi_perform() succeeded\n"); curl_mfprintf(stderr, "curl_multi_remove_handle()...\n"); - mres = curl_multi_remove_handle(multiHandle, curl); + mres = curl_multi_remove_handle(multi, curl); if(mres) { curl_mfprintf(stderr, "curl_multi_remove_handle() failed, with code %d\n", mres); @@ -82,7 +82,7 @@ static CURLcode test_lib583(const char *URL) /* undocumented cleanup sequence - type UB */ curl_easy_cleanup(curl); - curl_multi_cleanup(multiHandle); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib586.c b/tests/libtest/lib586.c index 439c92bf3522..5ee1582a8eb2 100644 --- a/tests/libtest/lib586.c +++ b/tests/libtest/lib586.c @@ -39,13 +39,13 @@ struct t586_userdata { }; /* lock callback */ -static void t586_test_lock(CURL *handle, curl_lock_data data, +static void t586_test_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, void *useptr) { const char *what; struct t586_userdata *user = (struct t586_userdata *)useptr; - (void)handle; + (void)curl; (void)laccess; switch(data) { @@ -70,11 +70,11 @@ static void t586_test_lock(CURL *handle, curl_lock_data data, } /* unlock callback */ -static void t586_test_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void t586_test_unlock(CURL *curl, curl_lock_data data, void *useptr) { const char *what; struct t586_userdata *user = (struct t586_userdata *)useptr; - (void)handle; + (void)curl; switch(data) { case CURL_LOCK_DATA_SHARE: what = "share"; diff --git a/tests/libtest/lib591.c b/tests/libtest/lib591.c index c0d5b1a43686..0b7a0b4e855e 100644 --- a/tests/libtest/lib591.c +++ b/tests/libtest/lib591.c @@ -29,7 +29,7 @@ static CURLcode test_lib591(const char *URL) { - CURL *easy = NULL; + CURL *curl = NULL; CURLM *multi = NULL; CURLcode res = CURLE_OK; int running; @@ -54,29 +54,29 @@ static CURLcode test_lib591(const char *URL) return res; } - easy_init(easy); + easy_init(curl); /* go verbose */ - easy_setopt(easy, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* specify target */ - easy_setopt(easy, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); /* enable uploading */ - easy_setopt(easy, CURLOPT_UPLOAD, 1L); + easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* data pointer for the file read function */ - easy_setopt(easy, CURLOPT_READDATA, upload); + easy_setopt(curl, CURLOPT_READDATA, upload); /* use active mode FTP */ - easy_setopt(easy, CURLOPT_FTPPORT, "-"); + easy_setopt(curl, CURLOPT_FTPPORT, "-"); /* server connection timeout */ - easy_setopt(easy, CURLOPT_ACCEPTTIMEOUT_MS, atol(libtest_arg2)*1000); + easy_setopt(curl, CURLOPT_ACCEPTTIMEOUT_MS, atol(libtest_arg2)*1000); multi_init(multi); - multi_add_handle(multi, easy); + multi_add_handle(multi, curl); for(;;) { struct timeval interval; @@ -134,7 +134,7 @@ static CURLcode test_lib591(const char *URL) /* undocumented cleanup sequence - type UA */ curl_multi_cleanup(multi); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); /* close the local file */ diff --git a/tests/libtest/lib597.c b/tests/libtest/lib597.c index 126ce74f3853..e82d061a222e 100644 --- a/tests/libtest/lib597.c +++ b/tests/libtest/lib597.c @@ -36,7 +36,7 @@ static CURLcode test_lib597(const char *URL) { - CURL *easy = NULL; + CURL *curl = NULL; CURLM *multi = NULL; CURLcode res = CURLE_OK; int running; @@ -47,19 +47,19 @@ static CURLcode test_lib597(const char *URL) global_init(CURL_GLOBAL_ALL); - easy_init(easy); + easy_init(curl); multi_init(multi); /* go verbose */ - easy_setopt(easy, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* specify target */ - easy_setopt(easy, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_URL, URL); - easy_setopt(easy, CURLOPT_CONNECT_ONLY, 1L); + easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L); - multi_add_handle(multi, easy); + multi_add_handle(multi, curl); for(;;) { struct timeval interval; @@ -113,14 +113,14 @@ static CURLcode test_lib597(const char *URL) if(msg) res = msg->data.result; - multi_remove_handle(multi, easy); + multi_remove_handle(multi, curl); test_cleanup: /* undocumented cleanup sequence - type UA */ curl_multi_cleanup(multi); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib643.c b/tests/libtest/lib643.c index 612f0b566c88..a0fef02dda90 100644 --- a/tests/libtest/lib643.c +++ b/tests/libtest/lib643.c @@ -225,13 +225,13 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) static CURLcode t643_cyclic_add(void) { - CURL *easy = curl_easy_init(); - curl_mime *mime = curl_mime_init(easy); + CURL *curl = curl_easy_init(); + curl_mime *mime = curl_mime_init(curl); curl_mimepart *part = curl_mime_addpart(mime); CURLcode a1 = curl_mime_subparts(part, mime); if(a1 == CURLE_BAD_FUNCTION_ARGUMENT) { - curl_mime *submime = curl_mime_init(easy); + curl_mime *submime = curl_mime_init(curl); curl_mimepart *subpart = curl_mime_addpart(submime); curl_mime_subparts(part, submime); @@ -239,7 +239,7 @@ static CURLcode t643_cyclic_add(void) } curl_mime_free(mime); - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); if(a1 != CURLE_BAD_FUNCTION_ARGUMENT) /* that should have failed */ return TEST_ERR_FAILURE; diff --git a/tests/libtest/lib653.c b/tests/libtest/lib653.c index 4f20865e269d..21948a5720e6 100644 --- a/tests/libtest/lib653.c +++ b/tests/libtest/lib653.c @@ -27,36 +27,36 @@ static CURLcode test_lib653(const char *URL) { - CURL *curls = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; curl_mimepart *field = NULL; curl_mime *mime = NULL; global_init(CURL_GLOBAL_ALL); - easy_init(curls); + easy_init(curl); - mime = curl_mime_init(curls); + mime = curl_mime_init(curl); field = curl_mime_addpart(mime); curl_mime_name(field, "name"); curl_mime_data(field, "short value", CURL_ZERO_TERMINATED); - easy_setopt(curls, CURLOPT_URL, URL); - easy_setopt(curls, CURLOPT_HEADER, 1L); - easy_setopt(curls, CURLOPT_VERBOSE, 1L); - easy_setopt(curls, CURLOPT_MIMEPOST, mime); - easy_setopt(curls, CURLOPT_NOPROGRESS, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_HEADER, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_MIMEPOST, mime); + easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); - res = curl_easy_perform(curls); + res = curl_easy_perform(curl); if(res) goto test_cleanup; /* Alter form and resubmit. */ curl_mime_data(field, "long value for length change", CURL_ZERO_TERMINATED); - res = curl_easy_perform(curls); + res = curl_easy_perform(curl); test_cleanup: curl_mime_free(mime); - curl_easy_cleanup(curls); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; /* return the final return code */ } diff --git a/tests/libtest/lib654.c b/tests/libtest/lib654.c index a808e24a0acd..5b2236ebb044 100644 --- a/tests/libtest/lib654.c +++ b/tests/libtest/lib654.c @@ -63,8 +63,8 @@ static CURLcode test_lib654(const char *URL) { static const char testdata[] = "dummy\n"; - CURL *easy = NULL; - CURL *easy2 = NULL; + CURL *curl = NULL; + CURL *curl2 = NULL; curl_mime *mime = NULL; curl_mimepart *part; struct curl_slist *hdrs = NULL; @@ -81,16 +81,16 @@ static CURLcode test_lib654(const char *URL) return TEST_ERR_MAJOR_BAD; } - easy = curl_easy_init(); + curl = curl_easy_init(); /* First set the URL that is about to receive our POST. */ - test_setopt(easy, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_URL, URL); /* get verbose debug output please */ - test_setopt(easy, CURLOPT_VERBOSE, 1L); + test_setopt(curl, CURLOPT_VERBOSE, 1L); /* include headers in the output */ - test_setopt(easy, CURLOPT_HEADER, 1L); + test_setopt(curl, CURLOPT_HEADER, 1L); /* Prepare the callback structure. */ pooh.readptr = testdata; @@ -98,7 +98,7 @@ static CURLcode test_lib654(const char *URL) pooh.freecount = 0; /* Build the mime tree. */ - mime = curl_mime_init(easy); + mime = curl_mime_init(curl); part = curl_mime_addpart(mime); curl_mime_data(part, "hello", CURL_ZERO_TERMINATED); curl_mime_name(part, "greeting"); @@ -113,11 +113,11 @@ static CURLcode test_lib654(const char *URL) free_callback, &pooh); /* Bind mime data to its easy handle. */ - test_setopt(easy, CURLOPT_MIMEPOST, mime); + test_setopt(curl, CURLOPT_MIMEPOST, mime); /* Duplicate the handle. */ - easy2 = curl_easy_duphandle(easy); - if(!easy2) { + curl2 = curl_easy_duphandle(curl); + if(!curl2) { curl_mfprintf(stderr, "curl_easy_duphandle() failed\n"); res = TEST_ERR_FAILURE; goto test_cleanup; @@ -129,7 +129,7 @@ static CURLcode test_lib654(const char *URL) mime = NULL; /* Already cleaned up. */ /* Perform on the first handle: should not send any data. */ - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res != CURLE_OK) { curl_mfprintf(stderr, "curl_easy_perform(original) failed\n"); goto test_cleanup; @@ -137,7 +137,7 @@ static CURLcode test_lib654(const char *URL) /* Perform on the second handle: if the bound mime structure has not been duplicated properly, it should cause a valgrind error. */ - res = curl_easy_perform(easy2); + res = curl_easy_perform(curl2); if(res != CURLE_OK) { curl_mfprintf(stderr, "curl_easy_perform(duplicated) failed\n"); goto test_cleanup; @@ -146,8 +146,8 @@ static CURLcode test_lib654(const char *URL) /* Free the duplicated handle: it should call free_callback again. If the mime copy was bad or not automatically released, valgrind will signal it. */ - curl_easy_cleanup(easy2); - easy2 = NULL; /* Already cleaned up. */ + curl_easy_cleanup(curl2); + curl2 = NULL; /* Already cleaned up. */ if(pooh.freecount != 2) { curl_mfprintf(stderr, "free_callback() called %d times instead of 2\n", @@ -157,8 +157,8 @@ static CURLcode test_lib654(const char *URL) } test_cleanup: - curl_easy_cleanup(easy); - curl_easy_cleanup(easy2); + curl_easy_cleanup(curl); + curl_easy_cleanup(curl2); curl_mime_free(mime); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib658.c b/tests/libtest/lib658.c index 00a2a35906b9..4f0f867d65de 100644 --- a/tests/libtest/lib658.c +++ b/tests/libtest/lib658.c @@ -31,13 +31,13 @@ static CURLcode test_lib658(const char *URL) { - CURL *handle = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; CURLU *urlp = NULL; CURLUcode uc = CURLUE_OK; global_init(CURL_GLOBAL_ALL); - easy_init(handle); + easy_init(curl); urlp = curl_url(); @@ -54,12 +54,12 @@ static CURLcode test_lib658(const char *URL) } /* demonstrate override behavior */ - easy_setopt(handle, CURLOPT_URL, "http://www.example.com"); + easy_setopt(curl, CURLOPT_URL, "http://www.example.com"); - easy_setopt(handle, CURLOPT_CURLU, urlp); - easy_setopt(handle, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_CURLU, urlp); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed " @@ -71,7 +71,7 @@ static CURLcode test_lib658(const char *URL) test_cleanup: curl_url_cleanup(urlp); - curl_easy_cleanup(handle); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib659.c b/tests/libtest/lib659.c index 70a630758c14..44fe7b0c49e1 100644 --- a/tests/libtest/lib659.c +++ b/tests/libtest/lib659.c @@ -31,12 +31,12 @@ static CURLcode test_lib659(const char *URL) { - CURL *handle = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; CURLU *urlp = NULL; global_init(CURL_GLOBAL_ALL); - easy_init(handle); + easy_init(curl); urlp = curl_url(); @@ -53,11 +53,11 @@ static CURLcode test_lib659(const char *URL) goto test_cleanup; } - easy_setopt(handle, CURLOPT_CURLU, urlp); - easy_setopt(handle, CURLOPT_VERBOSE, 1L); - easy_setopt(handle, CURLOPT_PROXY, URL); + easy_setopt(curl, CURLOPT_CURLU, urlp); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_PROXY, URL); - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed " @@ -69,7 +69,7 @@ static CURLcode test_lib659(const char *URL) test_cleanup: curl_url_cleanup(urlp); - curl_easy_cleanup(handle); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib667.c b/tests/libtest/lib667.c index a46d1b8cdd76..2827d0051194 100644 --- a/tests/libtest/lib667.c +++ b/tests/libtest/lib667.c @@ -55,7 +55,7 @@ static CURLcode test_lib667(const char *URL) { static const char testdata[] = "dummy"; - CURL *easy = NULL; + CURL *curl = NULL; curl_mime *mime = NULL; curl_mimepart *part; CURLcode res = TEST_ERR_FAILURE; @@ -71,23 +71,23 @@ static CURLcode test_lib667(const char *URL) return TEST_ERR_MAJOR_BAD; } - easy = curl_easy_init(); + curl = curl_easy_init(); /* First set the URL that is about to receive our POST. */ - test_setopt(easy, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_URL, URL); /* get verbose debug output please */ - test_setopt(easy, CURLOPT_VERBOSE, 1L); + test_setopt(curl, CURLOPT_VERBOSE, 1L); /* include headers in the output */ - test_setopt(easy, CURLOPT_HEADER, 1L); + test_setopt(curl, CURLOPT_HEADER, 1L); /* Prepare the callback structure. */ pooh.readptr = testdata; pooh.sizeleft = (curl_off_t) strlen(testdata); /* Build the mime tree. */ - mime = curl_mime_init(easy); + mime = curl_mime_init(curl); part = curl_mime_addpart(mime); curl_mime_name(part, "field"); curl_mime_encoder(part, "base64"); @@ -96,16 +96,16 @@ static CURLcode test_lib667(const char *URL) NULL, NULL, &pooh); /* Bind mime data to its easy handle. */ - test_setopt(easy, CURLOPT_MIMEPOST, mime); + test_setopt(curl, CURLOPT_MIMEPOST, mime); /* Send data. */ - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res != CURLE_OK) { curl_mfprintf(stderr, "curl_easy_perform() failed\n"); } test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_mime_free(mime); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib668.c b/tests/libtest/lib668.c index 87cf19bbe4b7..488f86215247 100644 --- a/tests/libtest/lib668.c +++ b/tests/libtest/lib668.c @@ -50,7 +50,7 @@ static CURLcode test_lib668(const char *URL) { static const char testdata[] = "dummy"; - CURL *easy = NULL; + CURL *curl = NULL; curl_mime *mime = NULL; curl_mimepart *part; CURLcode res = TEST_ERR_FAILURE; @@ -65,16 +65,16 @@ static CURLcode test_lib668(const char *URL) return TEST_ERR_MAJOR_BAD; } - easy = curl_easy_init(); + curl = curl_easy_init(); /* First set the URL that is about to receive our POST. */ - test_setopt(easy, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_URL, URL); /* get verbose debug output please */ - test_setopt(easy, CURLOPT_VERBOSE, 1L); + test_setopt(curl, CURLOPT_VERBOSE, 1L); /* include headers in the output */ - test_setopt(easy, CURLOPT_HEADER, 1L); + test_setopt(curl, CURLOPT_HEADER, 1L); /* Prepare the callback structures. */ pooh1.readptr = testdata; @@ -82,7 +82,7 @@ static CURLcode test_lib668(const char *URL) pooh2 = pooh1; /* Build the mime tree. */ - mime = curl_mime_init(easy); + mime = curl_mime_init(curl); part = curl_mime_addpart(mime); curl_mime_name(part, "field1"); /* Early end of data detection can be done because the data size is known. */ @@ -101,16 +101,16 @@ static CURLcode test_lib668(const char *URL) curl_mime_filedata(part, libtest_arg2); /* Bind mime data to its easy handle. */ - test_setopt(easy, CURLOPT_MIMEPOST, mime); + test_setopt(curl, CURLOPT_MIMEPOST, mime); /* Send data. */ - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); if(res != CURLE_OK) { curl_mfprintf(stderr, "curl_easy_perform() failed\n"); } test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_mime_free(mime); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index 9dcdd7fd45e8..b30d097f68ff 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -28,7 +28,7 @@ #define PAUSE_TIME 5 struct t670_ReadThis { - CURL *easy; + CURL *curl; time_t origin; int count; }; @@ -79,7 +79,7 @@ static int t670_xferinfo(void *clientp, } if(delta >= PAUSE_TIME) - curl_easy_pause(pooh->easy, CURLPAUSE_CONT); + curl_easy_pause(pooh->curl, CURLPAUSE_CONT); } return 0; @@ -106,21 +106,21 @@ static CURLcode test_lib670(const char *URL) pooh.origin = (time_t) 0; pooh.count = 0; - pooh.easy = curl_easy_init(); + pooh.curl = curl_easy_init(); /* First set the URL that is about to receive our POST. */ - test_setopt(pooh.easy, CURLOPT_URL, URL); + test_setopt(pooh.curl, CURLOPT_URL, URL); /* get verbose debug output please */ - test_setopt(pooh.easy, CURLOPT_VERBOSE, 1L); + test_setopt(pooh.curl, CURLOPT_VERBOSE, 1L); /* include headers in the output */ - test_setopt(pooh.easy, CURLOPT_HEADER, 1L); + test_setopt(pooh.curl, CURLOPT_HEADER, 1L); if(testnum == 670 || testnum == 671) { curl_mimepart *part; /* Build the mime tree. */ - mime = curl_mime_init(pooh.easy); + mime = curl_mime_init(pooh.curl); part = curl_mime_addpart(mime); res = curl_mime_name(part, testname); if(res != CURLE_OK) { @@ -135,7 +135,7 @@ static CURLcode test_lib670(const char *URL) /* Bind mime data to its easy handle. */ if(res == CURLE_OK) - test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime); + test_setopt(pooh.curl, CURLOPT_MIMEPOST, mime); } else { struct curl_httppost *lastptr = NULL; @@ -152,10 +152,10 @@ static CURLcode test_lib670(const char *URL) } /* We want to use our own read function. */ - test_setopt(pooh.easy, CURLOPT_READFUNCTION, t670_read_cb); + test_setopt(pooh.curl, CURLOPT_READFUNCTION, t670_read_cb); /* Send a multi-part formpost. */ - test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost); + test_setopt(pooh.curl, CURLOPT_HTTPPOST, formpost); } if(testnum == 670 || testnum == 672) { @@ -163,7 +163,7 @@ static CURLcode test_lib670(const char *URL) CURLM *multi; /* Use the multi interface. */ multi = curl_multi_init(); - mres = curl_multi_add_handle(multi, pooh.easy); + mres = curl_multi_add_handle(multi, pooh.curl); while(!mres) { struct timeval timeout; int rc = 0; @@ -187,7 +187,7 @@ static CURLcode test_lib670(const char *URL) } if(delta >= PAUSE_TIME) - curl_easy_pause(pooh.easy, CURLPAUSE_CONT); + curl_easy_pause(pooh.curl, CURLPAUSE_CONT); } FD_ZERO(&fdread); @@ -222,19 +222,19 @@ static CURLcode test_lib670(const char *URL) } } - curl_multi_remove_handle(multi, pooh.easy); + curl_multi_remove_handle(multi, pooh.curl); curl_multi_cleanup(multi); } else { /* Use the easy interface. */ - test_setopt(pooh.easy, CURLOPT_XFERINFODATA, &pooh); - test_setopt(pooh.easy, CURLOPT_XFERINFOFUNCTION, t670_xferinfo); - test_setopt(pooh.easy, CURLOPT_NOPROGRESS, 0L); - res = curl_easy_perform(pooh.easy); + test_setopt(pooh.curl, CURLOPT_XFERINFODATA, &pooh); + test_setopt(pooh.curl, CURLOPT_XFERINFOFUNCTION, t670_xferinfo); + test_setopt(pooh.curl, CURLOPT_NOPROGRESS, 0L); + res = curl_easy_perform(pooh.curl); } test_cleanup: - curl_easy_cleanup(pooh.easy); + curl_easy_cleanup(pooh.curl); if(testnum == 670 || testnum == 671) { curl_mime_free(mime); diff --git a/tests/libtest/lib674.c b/tests/libtest/lib674.c index a46f2be6eb14..668ecdf32d14 100644 --- a/tests/libtest/lib674.c +++ b/tests/libtest/lib674.c @@ -31,14 +31,14 @@ static CURLcode test_lib674(const char *URL) { - CURL *handle = NULL; - CURL *handle2; + CURL *curl = NULL; + CURL *curl2; CURLcode res = CURLE_OK; CURLU *urlp = NULL; CURLUcode uc = CURLUE_OK; global_init(CURL_GLOBAL_ALL); - easy_init(handle); + easy_init(curl); urlp = curl_url(); @@ -56,10 +56,10 @@ static CURLcode test_lib674(const char *URL) /* demonstrate override behavior */ - easy_setopt(handle, CURLOPT_CURLU, urlp); - easy_setopt(handle, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_CURLU, urlp); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - res = curl_easy_perform(handle); + res = curl_easy_perform(curl); if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed " @@ -68,14 +68,14 @@ static CURLcode test_lib674(const char *URL) goto test_cleanup; } - handle2 = curl_easy_duphandle(handle); - res = curl_easy_perform(handle2); - curl_easy_cleanup(handle2); + curl2 = curl_easy_duphandle(curl); + res = curl_easy_perform(curl2); + curl_easy_cleanup(curl2); test_cleanup: curl_url_cleanup(urlp); - curl_easy_cleanup(handle); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib678.c b/tests/libtest/lib678.c index 5fdabdda9609..2a2e21321f79 100644 --- a/tests/libtest/lib678.c +++ b/tests/libtest/lib678.c @@ -99,15 +99,14 @@ static CURLcode test_lib678(const char *URL) CURLcode res = CURLE_OK; curl_global_init(CURL_GLOBAL_DEFAULT); if(!strcmp("check", URL)) { - CURL *e; CURLcode w = CURLE_OK; struct curl_blob blob = {0}; - e = curl_easy_init(); - if(e) { - w = curl_easy_setopt(e, CURLOPT_CAINFO_BLOB, &blob); + CURL *curl = curl_easy_init(); + if(curl) { + w = curl_easy_setopt(curl, CURLOPT_CAINFO_BLOB, &blob); if(w) curl_mprintf("CURLOPT_CAINFO_BLOB is not supported\n"); - curl_easy_cleanup(e); + curl_easy_cleanup(curl); } res = w; } diff --git a/tests/libtest/lib751.c b/tests/libtest/lib751.c index 0e0a1968e68e..42c1aeb1176e 100644 --- a/tests/libtest/lib751.c +++ b/tests/libtest/lib751.c @@ -31,37 +31,37 @@ static CURLcode test_lib751(const char *URL) { - CURL *easies[1000]; - CURLM *m; + CURL *curls[1000]; + CURLM *multi; CURLcode res = CURLE_FAILED_INIT; CURLMcode mres; int i; (void)URL; - memset(easies, 0, sizeof(easies)); + memset(curls, 0, sizeof(curls)); curl_global_init(CURL_GLOBAL_DEFAULT); - m = curl_multi_init(); - if(!m) { + multi = curl_multi_init(); + if(!multi) { res = CURLE_OUT_OF_MEMORY; goto test_cleanup; } for(i = 0; i < 1000; i++) { - CURL *e = curl_easy_init(); - if(!e) { + CURL *curl = curl_easy_init(); + if(!curl) { res = CURLE_OUT_OF_MEMORY; goto test_cleanup; } - easies[i] = e; + curls[i] = curl; - res = curl_easy_setopt(e, CURLOPT_URL, "https://www.example.com/"); + res = curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); if(!res) - res = curl_easy_setopt(e, CURLOPT_VERBOSE, 1L); + res = curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); if(res) goto test_cleanup; - mres = curl_multi_add_handle(m, e); + mres = curl_multi_add_handle(multi, curl); if(mres != CURLM_OK) { curl_mfprintf(stderr, "MULTI ERROR: %s\n", curl_multi_strerror(mres)); res = CURLE_FAILED_INIT; @@ -75,13 +75,13 @@ static CURLcode test_lib751(const char *URL) curl_mfprintf(stderr, "ERROR: %s\n", curl_easy_strerror(res)); for(i = 0; i < 1000; i++) { - if(easies[i]) { - curl_multi_add_handle(m, easies[i]); - curl_easy_cleanup(easies[i]); - easies[i] = NULL; + if(curls[i]) { + curl_multi_add_handle(multi, curls[i]); + curl_easy_cleanup(curls[i]); + curls[i] = NULL; } } - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); return res; diff --git a/tests/libtest/lib753.c b/tests/libtest/lib753.c index ea3f0268af01..19194c4646a5 100644 --- a/tests/libtest/lib753.c +++ b/tests/libtest/lib753.c @@ -27,7 +27,7 @@ #include "memdebug.h" struct t753_transfer_status { - CURL *easy; + CURL *curl; const char *name; bool pause; bool is_paused; @@ -56,49 +56,49 @@ static size_t t753_hd_cb(char *ptr, size_t size, size_t nmemb, void *userp) curl_mfprintf(stderr, "[%s] hd_cb '%.*s'\n", st->name, (int)len, ptr); if(!strcmp("230 Welcome you silly person\r\n", ptr)) { st->seen_welcome = TRUE; - st->easy = NULL; + st->curl = NULL; } return len; } static bool t753_setup(const char *URL, const char *name, - CURL **peasy, + CURL **pcurl, struct t753_transfer_status *st) { - CURL *easy = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; - *peasy = NULL; + *pcurl = NULL; memset(st, 0, sizeof(*st)); st->name = name; - st->easy = easy; + st->curl = curl; st->pause = TRUE; - easy_init(easy); + easy_init(curl); - easy_setopt(easy, CURLOPT_URL, URL); - easy_setopt(easy, CURLOPT_WRITEFUNCTION, t753_write_cb); - easy_setopt(easy, CURLOPT_WRITEDATA, st); - easy_setopt(easy, CURLOPT_HEADERFUNCTION, t753_hd_cb); - easy_setopt(easy, CURLOPT_HEADERDATA, st); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_WRITEFUNCTION, t753_write_cb); + easy_setopt(curl, CURLOPT_WRITEDATA, st); + easy_setopt(curl, CURLOPT_HEADERFUNCTION, t753_hd_cb); + easy_setopt(curl, CURLOPT_HEADERDATA, st); - easy_setopt(easy, CURLOPT_NOPROGRESS, 1L); - easy_setopt(easy, CURLOPT_DEBUGDATA, &debug_config); - easy_setopt(easy, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); - easy_setopt(easy, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + easy_setopt(curl, CURLOPT_DEBUGDATA, &debug_config); + easy_setopt(curl, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); - *peasy = easy; + *pcurl = curl; return TRUE; test_cleanup: - if(easy) - curl_easy_cleanup(easy); + if(curl) + curl_easy_cleanup(curl); return FALSE; } static CURLcode test_lib753(const char *URL) { - CURL *easy1 = NULL, *easy2 = NULL; + CURL *curl1 = NULL, *curl2 = NULL; CURLM *multi = NULL; struct t753_transfer_status st1, st2; CURLcode res = CURLE_OK; @@ -119,10 +119,10 @@ static CURLcode test_lib753(const char *URL) goto test_cleanup; } - if(!t753_setup(URL, "EASY1", &easy1, &st1)) + if(!t753_setup(URL, "EASY1", &curl1, &st1)) goto test_cleanup; - multi_add_handle(multi, easy1); + multi_add_handle(multi, curl1); multi_perform(multi, &still_running); abort_on_test_timeout(); @@ -142,14 +142,14 @@ static CURLcode test_lib753(const char *URL) * that the connection is NOT reused, e.g. all FTP commands * are sent again on the new connection. */ - if(easy1 && st1.seen_welcome) { - curl_easy_cleanup(easy1); - easy1 = NULL; - if(!easy2) { - if(!t753_setup(URL, "EASY2", &easy2, &st2)) + if(curl1 && st1.seen_welcome) { + curl_easy_cleanup(curl1); + curl1 = NULL; + if(!curl2) { + if(!t753_setup(URL, "EASY2", &curl2, &st2)) goto test_cleanup; st2.pause = FALSE; - multi_add_handle(multi, easy2); + multi_add_handle(multi, curl2); } } @@ -173,10 +173,10 @@ static CURLcode test_lib753(const char *URL) if(res) curl_mfprintf(stderr, "ERROR: %s\n", curl_easy_strerror(res)); - if(easy1) - curl_easy_cleanup(easy1); - if(easy2) - curl_easy_cleanup(easy2); + if(curl1) + curl_easy_cleanup(curl1); + if(curl2) + curl_easy_cleanup(curl2); curl_multi_cleanup(multi); curl_global_cleanup(); diff --git a/tests/libtest/lib758.c b/tests/libtest/lib758.c index e9fe4ea2c98b..35e60cc04f50 100644 --- a/tests/libtest/lib758.c +++ b/tests/libtest/lib758.c @@ -146,12 +146,12 @@ static int t758_addFd(struct t758_Sockets *sockets, curl_socket_t fd, /** * Callback invoked by curl to poll reading / writing of a socket. */ -static int t758_curlSocketCallback(CURL *easy, curl_socket_t s, int action, +static int t758_curlSocketCallback(CURL *curl, curl_socket_t s, int action, void *userp, void *socketp) { struct t758_ReadWriteSockets *sockets = userp; - (void)easy; + (void)curl; (void)socketp; t758_ctx.socket_calls++; @@ -235,13 +235,13 @@ t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *clientp) /** * Check for curl completion. */ -static int t758_checkForCompletion(CURLM *curl, int *success) +static int t758_checkForCompletion(CURLM *multi, int *success) { int result = 0; *success = 0; while(1) { int numMessages; - CURLMsg *message = curl_multi_info_read(curl, &numMessages); + CURLMsg *message = curl_multi_info_read(multi, &numMessages); if(!message) break; if(message->msg == CURLMSG_DONE) { @@ -296,11 +296,12 @@ static void t758_updateFdSet(struct t758_Sockets *sockets, fd_set* fdset, } } -static CURLMcode t758_saction(CURLM *curl, curl_socket_t s, +static CURLMcode t758_saction(CURLM *multi, curl_socket_t s, int evBitmask, const char *info) { int numhandles = 0; - CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); + CURLMcode result = curl_multi_socket_action(multi, s, evBitmask, + &numhandles); if(result != CURLM_OK) { curl_mfprintf(stderr, "%s Curl error on %s (%i) %s\n", t758_tag(), info, result, curl_multi_strerror(result)); @@ -311,7 +312,7 @@ static CURLMcode t758_saction(CURLM *curl, curl_socket_t s, /** * Invoke curl when a file descriptor is set. */ -static CURLMcode t758_checkFdSet(CURLM *curl, struct t758_Sockets *sockets, +static CURLMcode t758_checkFdSet(CURLM *multi, struct t758_Sockets *sockets, fd_set *fdset, int evBitmask, const char *name) { @@ -319,7 +320,7 @@ static CURLMcode t758_checkFdSet(CURLM *curl, struct t758_Sockets *sockets, CURLMcode result = CURLM_OK; for(i = 0; i < sockets->count; ++i) { if(FD_ISSET(sockets->sockets[i], fdset)) { - result = t758_saction(curl, sockets->sockets[i], evBitmask, name); + result = t758_saction(multi, sockets->sockets[i], evBitmask, name); if(result) break; } @@ -331,7 +332,8 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, int socket_fail_at) { CURLcode res = CURLE_OK; - CURL *curl = NULL; CURLM *m = NULL; + CURL *curl = NULL; + CURLM *multi = NULL; struct t758_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; int success = 0; struct curltime timeout = {0}; @@ -373,28 +375,28 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, t758_set_ssl_ctx_callback); - multi_init(m); + multi_init(multi); - multi_setopt(m, CURLMOPT_SOCKETFUNCTION, t758_curlSocketCallback); - multi_setopt(m, CURLMOPT_SOCKETDATA, &sockets); + multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, t758_curlSocketCallback); + multi_setopt(multi, CURLMOPT_SOCKETDATA, &sockets); - multi_setopt(m, CURLMOPT_TIMERFUNCTION, t758_curlTimerCallback); - multi_setopt(m, CURLMOPT_TIMERDATA, &timeout); + multi_setopt(multi, CURLMOPT_TIMERFUNCTION, t758_curlTimerCallback); + multi_setopt(multi, CURLMOPT_TIMERDATA, &timeout); - multi_add_handle(m, curl); + multi_add_handle(multi, curl); - if(t758_saction(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + if(t758_saction(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } - while(!t758_checkForCompletion(m, &success)) { + while(!t758_checkForCompletion(multi, &success)) { fd_set readSet, writeSet; curl_socket_t maxFd = 0; struct timeval tv = {0}; tv.tv_sec = 10; if(t758_ctx.fake_async_cert_verification_pending && - !t758_ctx.fake_async_cert_verification_finished) { + !t758_ctx.fake_async_cert_verification_finished) { if(sockets.read.count || sockets.write.count) { t758_msg("during verification there should be no sockets scheduled"); res = TEST_ERR_MAJOR_BAD; @@ -406,13 +408,13 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, goto test_cleanup; } t758_ctx.fake_async_cert_verification_finished = 1; - if(t758_saction(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + if(t758_saction(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { t758_msg("spurious retry cert action"); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } curl_easy_pause(curl, CURLPAUSE_CONT); - if(t758_saction(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + if(t758_saction(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { t758_msg("unblocking transfer after cert verification finished"); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; @@ -442,12 +444,12 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, select_test((int)maxFd, &readSet, &writeSet, NULL, &tv); /* Check the sockets for reading / writing */ - if(t758_checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, + if(t758_checkFdSet(multi, &sockets.read, &readSet, CURL_CSELECT_IN, "read")) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } - if(t758_checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, + if(t758_checkFdSet(multi, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write")) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; @@ -456,7 +458,7 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, if(timeout.tv_sec != (time_t)-1 && t758_getMicroSecondTimeout(&timeout) == 0) { /* Curl's timer has elapsed. */ - if(t758_saction(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + if(t758_saction(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { res = TEST_ERR_BAD_TIMEOUT; goto test_cleanup; } @@ -479,9 +481,9 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, /* proper cleanup sequence */ t758_msg("cleanup"); - curl_multi_remove_handle(m, curl); + curl_multi_remove_handle(multi, curl); curl_easy_cleanup(curl); - curl_multi_cleanup(m); + curl_multi_cleanup(multi); curl_global_cleanup(); /* free local memory */ diff --git a/tests/libtest/lib766.c b/tests/libtest/lib766.c index 5cfc6bb270f3..53f1dd97b551 100644 --- a/tests/libtest/lib766.c +++ b/tests/libtest/lib766.c @@ -42,24 +42,24 @@ static int sockopt_766(void *clientp, static CURLcode test_lib766(const char *URL) { - CURL *easy = NULL; + CURL *curl = NULL; CURLcode res = CURLE_OK; start_test_timing(); res_global_init(CURL_GLOBAL_ALL); - easy_init(easy); - easy_setopt(easy, CURLOPT_VERBOSE, 1L); - easy_setopt(easy, CURLOPT_URL, URL); - easy_setopt(easy, CURLOPT_FTPPORT, "-"); - easy_setopt(easy, CURLOPT_SOCKOPTFUNCTION, sockopt_766); + easy_init(curl); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_FTPPORT, "-"); + easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_766); - res = curl_easy_perform(easy); + res = curl_easy_perform(curl); test_cleanup: - curl_easy_cleanup(easy); + curl_easy_cleanup(curl); curl_global_cleanup(); return res; diff --git a/tests/libtest/testtrace.c b/tests/libtest/testtrace.c index 8aa377fb0c31..092aca8385bf 100644 --- a/tests/libtest/testtrace.c +++ b/tests/libtest/testtrace.c @@ -81,7 +81,7 @@ void debug_dump(const char *timebuf, const char *text, fflush(stream); } -int libtest_debug_cb(CURL *handle, curl_infotype type, +int libtest_debug_cb(CURL *curl, curl_infotype type, char *data, size_t size, void *userp) { struct libtest_trace_cfg *trace_cfg = userp; @@ -89,7 +89,7 @@ int libtest_debug_cb(CURL *handle, curl_infotype type, char timebuf[20]; char *timestr; - (void)handle; + (void)curl; timebuf[0] = '\0'; timestr = &timebuf[0]; @@ -157,7 +157,7 @@ static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) } /* callback for CURLOPT_DEBUGFUNCTION (used in client tests) */ -int cli_debug_cb(CURL *handle, curl_infotype type, +int cli_debug_cb(CURL *curl, curl_infotype type, char *data, size_t size, void *userp) { FILE *output = stderr; @@ -166,11 +166,11 @@ int cli_debug_cb(CURL *handle, curl_infotype type, char idsbuf[60]; curl_off_t xfer_id, conn_id; - (void)handle; + (void)curl; (void)userp; - if(!curl_easy_getinfo(handle, CURLINFO_XFER_ID, &xfer_id) && xfer_id >= 0) { - if(!curl_easy_getinfo(handle, CURLINFO_CONN_ID, &conn_id) && + if(!curl_easy_getinfo(curl, CURLINFO_XFER_ID, &xfer_id) && xfer_id >= 0) { + if(!curl_easy_getinfo(curl, CURLINFO_CONN_ID, &conn_id) && conn_id >= 0) { curl_msnprintf(idsbuf, sizeof(idsbuf), "[%" CURL_FORMAT_CURL_OFF_T "-" diff --git a/tests/libtest/testtrace.h b/tests/libtest/testtrace.h index 79d2f8529d96..e066595b2cef 100644 --- a/tests/libtest/testtrace.h +++ b/tests/libtest/testtrace.h @@ -36,11 +36,11 @@ struct libtest_trace_cfg { extern struct libtest_trace_cfg debug_config; -int libtest_debug_cb(CURL *handle, curl_infotype type, +int libtest_debug_cb(CURL *curl, curl_infotype type, char *data, size_t size, void *userp); /* callback for CURLOPT_DEBUGFUNCTION (client tests) */ -int cli_debug_cb(CURL *handle, curl_infotype type, +int cli_debug_cb(CURL *curl, curl_infotype type, char *data, size_t size, void *userp); #endif /* HEADER_LIBTEST_TESTTRACE_H */ From 2e408aa5ccafedd3dec3197b8a29d1dd8477f50a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 23:25:17 +0100 Subject: [PATCH 193/885] tests: replace standalone significant tabs with macro Follow-up to d29f14b9cf0d38f3887b6eadc71af16903bc7f5b #19300 Closes #19315 --- tests/data/test1105 | 6 +++--- tests/data/test1185 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/data/test1105 b/tests/data/test1105 index cb828bf0488e..78bed7524e88 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -19,9 +19,9 @@ Funny-head: yesyes swsclose Set-Cookie: foobar=name; Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; Set-Cookie: partmatch=present; domain=.0.0.1; path=/; -Set-Cookie: foo bar=barfoo -Set-Cookie: bar foo= -Set-Cookie: bar=foo bar +Set-Cookie: foo%tab%bar=barfoo +Set-Cookie: bar%tab%foo= +Set-Cookie: bar=foo%tab%bar diff --git a/tests/data/test1185 b/tests/data/test1185 index c00e982301d2..64eef418005e 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -20,7 +20,7 @@ checksrc * Violate each rule at least once. **/ int hello; /*------------------------------------------------------------------*/ -int tab; +int%tab%tab; int trailing_space; int a = func (); int b = func( b); From cf4a62725d641ff0879f6a145e6131665f6761e4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 1 Nov 2025 00:47:21 +0100 Subject: [PATCH 194/885] CI: two display name tweaks - use `AM`/`CM` where missing. In GHA/linux-old and AppVeyor CI. To denote autotools and CMake, and to align with rest of the jobs. - rename `Old Linux` to `Linux Old` to align with the rest of Linux jobs on GitHub web views sorted by name. Closes #19316 --- .github/workflows/linux-old.yml | 48 ++++++++++++++++----------------- appveyor.yml | 28 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index 198f90c538ef..7cba9243cbe9 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -16,7 +16,7 @@ # httrack is one of the smallest downloaders, needed to bootstrap ELTS, # and won't conflict with the curl we're building. -name: 'Old Linux' +name: 'Linux Old' 'on': push: @@ -56,7 +56,7 @@ env: jobs: cmake-autotools: - name: 'cmake & autotools' + name: 'autotools & cmake' runs-on: 'ubuntu-latest' container: 'debian:stretch' @@ -84,31 +84,31 @@ jobs: with: persist-credentials: false - - name: 'cmake build-only configure (out-of-tree)' + - name: 'CM build-only configure (out-of-tree)' run: | mkdir bld-1 cd bld-1 cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ -DCURL_USE_GNUTLS=ON -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON - - name: 'cmake build-only build' + - name: 'CM build-only build' run: VERBOSE=1 make -C bld-1 install - - name: 'cmake build-only curl -V' + - name: 'CM build-only curl -V' run: bld-1/src/curl --disable --version - - name: 'cmake build-only configure log' + - name: 'CM build-only configure log' if: ${{ !cancelled() }} run: cat bld-1/CMakeFiles/CMake*.log 2>/dev/null || true - - name: 'cmake build-only curl_config.h' + - name: 'CM build-only curl_config.h' run: | echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld-1/lib/curl_config.h | sort || true # when this job can get a libssh version 0.9.0 or later, this should get # that enabled again - - name: 'cmake configure (out-of-tree, c-ares, zstd, gssapi)' + - name: 'CM configure (out-of-tree, c-ares, zstd, gssapi)' run: | mkdir bld-cares cd bld-cares @@ -116,37 +116,37 @@ jobs: -DCURL_USE_GNUTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \ -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON - - name: 'cmake configure log' + - name: 'CM configure log' if: ${{ !cancelled() }} run: cat bld-cares/CMakeFiles/CMake*.log 2>/dev/null || true - - name: 'cmake curl_config.h' + - name: 'CM curl_config.h' run: | echo '::group::raw'; cat bld-cares/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld-cares/lib/curl_config.h | sort || true - - name: 'cmake build' + - name: 'CM build' run: make -C bld-cares - - name: 'cmake curl -V' + - name: 'CM curl -V' run: bld-cares/src/curl --disable --version - - name: 'cmake install' + - name: 'CM install' run: make -C bld-cares install - - name: 'cmake build tests' + - name: 'CM build tests' run: make -C bld-cares testdeps - - name: 'cmake run tests' + - name: 'CM run tests' run: make -C bld-cares test-ci - - name: 'cmake build examples' + - name: 'CM build examples' run: make -C bld-cares curl-examples-build - - name: 'autoreconf' + - name: 'AM autoreconf' run: autoreconf -fi - - name: 'autotools configure (out-of-tree, c-ares, zstd, gssapi)' + - name: 'AM configure (out-of-tree, c-ares, zstd, gssapi)' run: | mkdir bld-am cd bld-am @@ -154,23 +154,23 @@ jobs: --with-gnutls --enable-ares --without-libssh2 --with-zstd --with-gssapi --with-librtmp \ --prefix="$PWD"/../curl-install-am - - name: 'autotools configure log' + - name: 'AM configure log' if: ${{ !cancelled() }} run: cat bld-am/config.log 2>/dev/null || true - - name: 'autotools curl_config.h' + - name: 'AM curl_config.h' run: | echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld-am/lib/curl_config.h | sort || true - - name: 'autotools build' + - name: 'AM build' run: make -C bld-am - - name: 'autotools curl -V' + - name: 'AM curl -V' run: bld-am/src/curl --disable --version - - name: 'autotools install' + - name: 'AM install' run: make -C bld-am install - - name: 'autotools build tests' + - name: 'AM build tests' run: make -C bld-am/tests all diff --git a/appveyor.yml b/appveyor.yml index af6ecd2c159b..98e6e516091a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -46,14 +46,14 @@ environment: # generated CMake-based Visual Studio builds - - job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.5, Shared, Build-tests' + - job_name: 'CM VS2022, Release, x64, OpenSSL 3.5, Shared, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' PRJ_CFG: Release OPENSSL: 'ON' SHARED: 'ON' - - job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-tests' + - job_name: 'CM VS2022, Release, arm64, Schannel, Static, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A ARM64' @@ -61,7 +61,7 @@ environment: SCHANNEL: 'ON' DEBUG: 'OFF' CURLDEBUG: 'ON' - - job_name: 'CMake, VS2010, Debug, x64, Schannel, Shared, Build-tests & examples, XP' + - job_name: 'CM VS2010, Debug, x64, Schannel, Shared, Build-tests & examples, XP' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' PRJ_GEN: 'Visual Studio 10 2010' TARGET: '-A x64' @@ -70,7 +70,7 @@ environment: SCHANNEL: 'ON' SHARED: 'ON' EXAMPLES: 'ON' - - job_name: 'CMake, VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests' + - job_name: 'CM VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PRJ_GEN: 'Visual Studio 11 2012' TARGET: '-A Win32' @@ -78,7 +78,7 @@ environment: OPENSSL: 'ON' SCHANNEL: 'ON' SHARED: 'ON' - - job_name: 'CMake, VS2013, Debug, x64, OpenSSL 1.1.1, Shared, Build-only' + - job_name: 'CM VS2013, Debug, x64, OpenSSL 1.1.1, Shared, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PRJ_GEN: 'Visual Studio 12 2013' TARGET: '-A x64' @@ -86,14 +86,14 @@ environment: OPENSSL: 'ON' SHARED: 'ON' TFLAGS: 'skipall' - - job_name: 'CMake, VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only' + - job_name: 'CM VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PRJ_GEN: 'Visual Studio 14 2015' TARGET: '-A x64' PRJ_CFG: Debug OPENSSL: 'ON' TFLAGS: 'skipall' - - job_name: 'CMake, VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only' + - job_name: 'CM VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PRJ_GEN: 'Visual Studio 15 2017' TARGET: '-A x64' @@ -101,7 +101,7 @@ environment: OPENSSL: 'ON' SHARED: 'ON' TFLAGS: 'skipall' - - job_name: 'CMake, VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, Build-tests' + - job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019' PRJ_GEN: 'Visual Studio 16 2019' TARGET: '-A x64' @@ -109,7 +109,7 @@ environment: OPENSSL: 'ON' SCHANNEL: 'ON' SHARED: 'ON' - - job_name: 'CMake, VS2022, Debug, x64, OpenSSL 3.5 + Schannel, Static, Unicode, Build-tests & examples, clang-cl' + - job_name: 'CM VS2022, Debug, x64, OpenSSL 3.5 + Schannel, Static, Unicode, Build-tests & examples, clang-cl' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' @@ -119,14 +119,14 @@ environment: ENABLE_UNICODE: 'ON' EXAMPLES: 'ON' TOOLSET: 'ClangCl' - - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests' + - job_name: 'CM VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' PRJ_CFG: Debug SCHANNEL: 'ON' ENABLE_UNICODE: 'ON' - - job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBUILD, no-CURLDEBUG, Build-tests' + - job_name: 'CM VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBUILD, no-CURLDEBUG, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' @@ -135,12 +135,12 @@ environment: ENABLE_UNICODE: 'ON' SHARED: 'ON' CURLDEBUG: 'OFF' - - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests' + - job_name: 'CM VS2022, Debug, x64, no SSL, Static, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' PRJ_CFG: Debug - - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests' + - job_name: 'CM VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' @@ -149,7 +149,7 @@ environment: # generated VisualStudioSolution-based builds - - job_name: 'VisualStudioSolution, VS2013, Debug, x86, Schannel, Build-only' + - job_name: 'VisualStudioSolution VS2013, Debug, x86, Schannel, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: VisualStudioSolution PRJ_CFG: 'DLL Debug - DLL Windows SSPI - DLL WinIDN' From 6a97bc2c97b54dc981f9a5d5ab542c30ea0acaad Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 1 Nov 2025 04:02:13 +0100 Subject: [PATCH 195/885] tests/data: delete stray CRLFs in markup lines Closes #19317 --- tests/data/test1406 | 4 ++-- tests/data/test816 | 4 ++-- tests/data/test861 | 8 ++++---- tests/data/test862 | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/data/test1406 b/tests/data/test1406 index bee4b337a4c9..ba7a325dd9eb 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -11,9 +11,9 @@ SMTP # # Server-side - + CAPA SIZE - + # diff --git a/tests/data/test816 b/tests/data/test816 index c45cc1172f15..ff6546ec52b4 100644 --- a/tests/data/test816 +++ b/tests/data/test816 @@ -15,9 +15,9 @@ CUSTOMREQUEST * 123 FETCH (FLAGS (\Seen \Deleted)) - + * 123 EXPUNGE - + # diff --git a/tests/data/test861 b/tests/data/test861 index c40d06af1440..dbcee53287f6 100644 --- a/tests/data/test861 +++ b/tests/data/test861 @@ -12,16 +12,16 @@ RFC2449 # # Server-side - + CAPA UIDL USER - + # When doing UIDL, we get the default list output hard-coded in the test # POP3 server - + 1 1 2 2 3 4 - + # diff --git a/tests/data/test862 b/tests/data/test862 index 73c50ff061d8..2484c8e98ca4 100644 --- a/tests/data/test862 +++ b/tests/data/test862 @@ -12,14 +12,14 @@ RFC2449 # # Server-side - + CAPA TOP USER - - + + From: me@somewhere To: fake@nowhere - + # From 8d0bfe74fba1e8394e73d2577c8a30b65f86b86f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 1 Nov 2025 20:21:25 +0100 Subject: [PATCH 196/885] httpsrr: send HTTPS query to the right target When the target host is on a different port than 443, the name "_[port]._https.[name]" shall be used. Fixes #19301 Reported-by: Gunni on github Closes #19324 --- lib/asyn-ares.c | 19 +++++++++++++++++-- lib/asyn-thrdd.c | 13 ++++++++++--- lib/httpsrr.c | 2 ++ lib/httpsrr.h | 1 + tests/data/test2100 | 1 + 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 094d703ec0c0..09c94f97b8f1 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -730,6 +730,9 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, int *waitp) { struct async_ares_ctx *ares = &data->state.async.ares; +#ifdef USE_HTTPSRR + char *rrname = NULL; +#endif *waitp = 0; /* default to synchronous response */ if(async_ares_init_lazy(data)) @@ -742,6 +745,15 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, data->state.async.hostname = strdup(hostname); if(!data->state.async.hostname) return NULL; +#ifdef USE_HTTPSRR + if(port != 443) { + rrname = curl_maprintf("_%d_.https.%s", port, hostname); + if(!rrname) { + free(data->state.async.hostname); + return NULL; + } + } +#endif /* initial status - failed */ ares->ares_status = ARES_ENOTFOUND; @@ -814,11 +826,14 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, #endif #ifdef USE_HTTPSRR { - CURL_TRC_DNS(data, "asyn-ares: fire off query for HTTPSRR"); + CURL_TRC_DNS(data, "asyn-ares: fire off query for HTTPSRR: %s", + rrname ? rrname : data->state.async.hostname); memset(&ares->hinfo, 0, sizeof(ares->hinfo)); ares->hinfo.port = -1; + ares->hinfo.rrname = rrname; ares->num_pending++; /* one more */ - ares_query_dnsrec(ares->channel, data->state.async.hostname, + ares_query_dnsrec(ares->channel, + rrname ? rrname : data->state.async.hostname, ARES_CLASS_IN, ARES_REC_TYPE_HTTPS, async_ares_rr_done, data, NULL); } diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index cb19f8645254..da83cca87a76 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -361,12 +361,18 @@ static void async_thrdd_rr_done(void *user_data, ares_status_t status, thrdd->rr.result = Curl_httpsrr_from_ares(data, dnsrec, &thrdd->rr.hinfo); } -static CURLcode async_rr_start(struct Curl_easy *data) +static CURLcode async_rr_start(struct Curl_easy *data, int port) { struct async_thrdd_ctx *thrdd = &data->state.async.thrdd; int status; + char *rrname = NULL; DEBUGASSERT(!thrdd->rr.channel); + if(port != 443) { + rrname = curl_maprintf("_%d_.https.%s", port, data->conn->host.name); + if(!rrname) + return CURLE_OUT_OF_MEMORY; + } status = ares_init_options(&thrdd->rr.channel, NULL, 0); if(status != ARES_SUCCESS) { thrdd->rr.channel = NULL; @@ -383,8 +389,9 @@ static CURLcode async_rr_start(struct Curl_easy *data) memset(&thrdd->rr.hinfo, 0, sizeof(thrdd->rr.hinfo)); thrdd->rr.hinfo.port = -1; + thrdd->rr.hinfo.rrname = rrname; ares_query_dnsrec(thrdd->rr.channel, - data->conn->host.name, ARES_CLASS_IN, + rrname ? rrname : data->conn->host.name, ARES_CLASS_IN, ARES_REC_TYPE_HTTPS, async_thrdd_rr_done, data, NULL); CURL_TRC_DNS(data, "Issued HTTPS-RR request for %s", data->conn->host.name); @@ -454,7 +461,7 @@ static bool async_thrdd_init(struct Curl_easy *data, } #ifdef USE_HTTPSRR_ARES - if(async_rr_start(data)) + if(async_rr_start(data, port)) infof(data, "Failed HTTPS RR operation"); #endif CURL_TRC_DNS(data, "resolve thread started for of %s:%d", hostname, port); diff --git a/lib/httpsrr.c b/lib/httpsrr.c index ae2c106bcef2..f0d7ea14f141 100644 --- a/lib/httpsrr.c +++ b/lib/httpsrr.c @@ -152,6 +152,7 @@ void Curl_httpsrr_cleanup(struct Curl_https_rrinfo *rrinfo) Curl_safefree(rrinfo->echconfiglist); Curl_safefree(rrinfo->ipv4hints); Curl_safefree(rrinfo->ipv6hints); + Curl_safefree(rrinfo->rrname); } @@ -206,6 +207,7 @@ CURLcode Curl_httpsrr_from_ares(struct Curl_easy *data, } } out: + Curl_safefree(hinfo->rrname); return result; } diff --git a/lib/httpsrr.h b/lib/httpsrr.h index 563d1c8e515b..9b7831f75cbc 100644 --- a/lib/httpsrr.h +++ b/lib/httpsrr.h @@ -38,6 +38,7 @@ struct Curl_easy; struct Curl_https_rrinfo { + char *rrname; /* if NULL, the same as the URL hostname */ /* * Fields from HTTPS RR. The only mandatory fields are priority and target. * See https://datatracker.ietf.org/doc/html/rfc9460#section-14.3.2 diff --git a/tests/data/test2100 b/tests/data/test2100 index a5e809c6eff3..9d75e72b8176 100644 --- a/tests/data/test2100 +++ b/tests/data/test2100 @@ -4,6 +4,7 @@ HTTP HTTP GET DOH +httpsrr From f6bbc2b3be510a3c7e469cd697132ca1046290b5 Mon Sep 17 00:00:00 2001 From: x2018 Date: Sat, 1 Nov 2025 03:43:26 +0800 Subject: [PATCH 197/885] doh: cleanup resources on error paths Closes #19310 --- lib/doh.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/doh.c b/lib/doh.c index 8cdecf465720..ec97bd73336b 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -1219,8 +1219,9 @@ UNITTEST void doh_print_httpsrr(struct Curl_easy *data, CURLcode Curl_doh_is_resolved(struct Curl_easy *data, struct Curl_dns_entry **dnsp) { - CURLcode result; + CURLcode result = CURLE_OK; struct doh_probes *dohp = data->state.async.doh; + struct dohentry de; *dnsp = NULL; /* defaults to no response */ if(!dohp) return CURLE_OUT_OF_MEMORY; @@ -1233,7 +1234,6 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, } else if(!dohp->pending) { DOHcode rc[DOH_SLOT_COUNT]; - struct dohentry de; int slot; /* Clear any result the might still be there */ @@ -1265,17 +1265,14 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, struct Curl_dns_entry *dns; struct Curl_addrinfo *ai; - if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)) { CURL_TRC_DNS(data, "hostname: %s", dohp->host); doh_show(data, &de); } result = doh2ai(&de, dohp->host, dohp->port, &ai); - if(result) { - de_cleanup(&de); - return result; - } + if(result) + goto error; /* we got a response, create a dns entry. */ dns = Curl_dnscache_mk_entry(data, ai, dohp->host, 0, dohp->port, FALSE); @@ -1288,7 +1285,8 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, de.https_rrs->len, &hrr); if(result) { infof(data, "Failed to decode HTTPS RR"); - return result; + Curl_resolv_unlink(data, &dns); + goto error; } infof(data, "Some HTTPS RR to process"); # ifdef DEBUGBUILD @@ -1306,14 +1304,15 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, /* All done */ data->state.async.done = TRUE; - de_cleanup(&de); - Curl_doh_cleanup(data); - return result; - } /* !dohp->pending */ + else + /* wait for pending DoH transactions to complete */ + return CURLE_OK; - /* else wait for pending DoH transactions to complete */ - return CURLE_OK; +error: + de_cleanup(&de); + Curl_doh_cleanup(data); + return result; } void Curl_doh_close(struct Curl_easy *data) From e2a12fcbdbe9fa515e0389995318f02f898a4b0b Mon Sep 17 00:00:00 2001 From: x2018 Date: Sat, 1 Nov 2025 23:28:07 +0800 Subject: [PATCH 198/885] vtls: properly handle SSL shutdown timeout Closes #19323 --- lib/vtls/vtls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 22d820b1602e..df0449cbeee6 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1858,7 +1858,8 @@ static CURLcode vtls_shutdown_blocking(struct Curl_cfilter *cf, if(timeout_ms < 0) { /* no need to continue if time is already up */ failf(data, "SSL shutdown timeout"); - return CURLE_OPERATION_TIMEDOUT; + result = CURLE_OPERATION_TIMEDOUT; + goto out; } result = connssl->ssl_impl->shut_down(cf, data, send_shutdown, done); From 6cf3d7b1b161bc45501d17b401225befe3c43943 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 1 Nov 2025 01:28:55 +0100 Subject: [PATCH 199/885] tests: avoid more hard-coded CRLFs in `protocol` sections - fix regex to not catch CR (from CRLF), in `PORT`, `EPRT` commands, allowing to use `crlf="yes"` more. - add `crlf="headers"` mode for `protocol` sections. To call `subnewlines()` without its force option. This is the mode used in `data` sections when `crlf="yes"`. (This confusion may be subject to a future commit.) - subnewlines: apply CRLF to `HEAD` and `CONNECT` HTTP requests. - subnewlines: apply CRLF to RTSP requests. - delete remaining empty `protocol` sections. Reducing the number of `tests/data/test*`: - CRLF newlines from 11325 to 10295. (119984 lines total) - files with mixed newlines from 707 to 656. (1890 files total) Follow-up to 4d2a05d3fe8ba4db9168b03057029ea5ce7dab77 #19284 Closes #19318 --- docs/tests/FILEFORMAT.md | 6 +++- tests/data/test10 | 14 ++++---- tests/data/test1001 | 36 ++++++++++----------- tests/data/test1002 | 70 ++++++++++++++++++++-------------------- tests/data/test1008 | 36 ++++++++++----------- tests/data/test1030 | 28 ++++++++-------- tests/data/test1041 | 16 ++++----- tests/data/test1050 | 16 ++++----- tests/data/test1051 | 26 +++++++-------- tests/data/test1052 | 26 +++++++-------- tests/data/test1064 | 26 +++++++-------- tests/data/test1065 | 24 +++++++------- tests/data/test1071 | 28 ++++++++-------- tests/data/test1075 | 28 ++++++++-------- tests/data/test1098 | 26 +++++++-------- tests/data/test1134 | 26 +++++++-------- tests/data/test116 | 14 ++++---- tests/data/test1206 | 18 +++++------ tests/data/test1207 | 18 +++++------ tests/data/test1208 | 16 ++++----- tests/data/test1209 | 16 ++++----- tests/data/test1211 | 16 ++++----- tests/data/test125 | 12 +++---- tests/data/test1285 | 28 ++++++++-------- tests/data/test1414 | 20 ++++++------ tests/data/test1418 | 46 +++++++++++++------------- tests/data/test1419 | 22 ++++++------- tests/data/test1421 | 26 +++++++-------- tests/data/test1509 | 10 +++--- tests/data/test1524 | 24 +++++++------- tests/data/test1525 | 14 ++++---- tests/data/test1526 | 14 ++++---- tests/data/test1527 | 16 ++++----- tests/data/test154 | 28 ++++++++-------- tests/data/test155 | 42 ++++++++++++------------ tests/data/test156 | 14 ++++---- tests/data/test1590 | 2 -- tests/data/test1671 | 12 +++---- tests/data/test18 | 32 +++++++++--------- tests/data/test180 | 14 ++++---- tests/data/test181 | 16 ++++----- tests/data/test1938 | 14 ++++---- tests/data/test194 | 14 ++++---- tests/data/test1948 | 24 +++++++------- tests/data/test1973 | 16 ++++----- tests/data/test2000 | 18 +++++------ tests/data/test2001 | 28 ++++++++-------- tests/data/test2058 | 36 ++++++++++----------- tests/data/test2059 | 36 ++++++++++----------- tests/data/test206 | 34 +++++++++---------- tests/data/test2060 | 36 ++++++++++----------- tests/data/test212 | 30 ++++++++--------- tests/data/test253 | 16 ++++----- tests/data/test255 | 16 ++++----- tests/data/test272 | 12 +++---- tests/data/test275 | 26 +++++++-------- tests/data/test281 | 14 ++++---- tests/data/test32 | 12 +++---- tests/data/test33 | 16 ++++----- tests/data/test338 | 22 ++++++------- tests/data/test35 | 16 ++++----- tests/data/test357 | 28 ++++++++-------- tests/data/test364 | 14 ++++---- tests/data/test384 | 16 ++++----- tests/data/test388 | 58 ++++++++++++++++----------------- tests/data/test425 | 14 ++++---- tests/data/test48 | 22 ++++++------- tests/data/test490 | 26 +++++++-------- tests/data/test491 | 14 ++++---- tests/data/test492 | 58 ++++++++++++++++----------------- tests/data/test503 | 12 +++---- tests/data/test508 | 14 ++++---- tests/data/test513 | 2 -- tests/data/test540 | 46 +++++++++++++------------- tests/data/test544 | 14 ++++---- tests/data/test545 | 14 ++++---- tests/data/test547 | 48 +++++++++++++-------------- tests/data/test548 | 48 +++++++++++++-------------- tests/data/test551 | 32 +++++++++--------- tests/data/test553 | 30 ++++++++--------- tests/data/test555 | 48 +++++++++++++-------------- tests/data/test568 | 36 ++++++++++----------- tests/data/test572 | 50 ++++++++++++++-------------- tests/data/test577 | 12 +++---- tests/data/test58 | 14 ++++---- tests/data/test582 | 2 -- tests/data/test588 | 20 ++++++------ tests/data/test591 | 20 ++++++------ tests/data/test592 | 20 ++++++------ tests/data/test593 | 20 ++++++------ tests/data/test594 | 20 ++++++------ tests/data/test596 | 18 +++++------ tests/data/test758 | 2 -- tests/data/test766 | 12 +++---- tests/data/test785 | 16 ++++----- tests/data/test786 | 16 ++++----- tests/data/test88 | 28 ++++++++-------- tests/data/test95 | 16 ++++----- tests/data/test97 | 16 ++++----- tests/data/test970 | 12 +++---- tests/data/test972 | 12 +++---- tests/data/test977 | 14 ++++---- tests/data/test98 | 16 ++++----- tests/data/test985 | 4 +-- tests/data/test986 | 6 ++-- tests/runtests.pl | 5 ++- tests/testutil.pm | 3 +- 107 files changed, 1163 insertions(+), 1163 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index cbc922105667..bc82aa8c0026 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -663,7 +663,7 @@ command exists with a non-zero status code, the test is considered failed. A list of directory entries that are checked for after the test has completed and that must not exist. A listed entry existing causes the test to fail. -### `` +### `` the protocol dump curl should transmit, if `nonewline` is set, we cut off the trailing newline of this given data before comparing with the one actually @@ -673,6 +673,10 @@ comparisons are made. `crlf=yes` forces the newlines to become CRLF even if not written so in the test. +`crlf=headers` forces *header* newlines to become CRLF even if not written so +in the source file. Note that this makes runtests.pl parse and "guess" what is +a header and what is not in order to apply the CRLF line endings appropriately. + ### `` The protocol dump curl should transmit to an HTTP proxy (when the http-proxy diff --git a/tests/data/test10 b/tests/data/test10 index ac1486ec0911..89cc509bc41a 100644 --- a/tests/data/test10 +++ b/tests/data/test10 @@ -43,13 +43,13 @@ the # Verify data after the test has been "shot" - -PUT /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - + +PUT /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 78 + Weird file to diff --git a/tests/data/test1001 b/tests/data/test1001 index 6755e7a1ec3f..ab2b045e9ce9 100644 --- a/tests/data/test1001 +++ b/tests/data/test1001 @@ -82,24 +82,24 @@ test # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="6af4d89c952f4dd4cc215a6878dc499d" -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 3 - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="6af4d89c952f4dd4cc215a6878dc499d" +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 3 + st diff --git a/tests/data/test1002 b/tests/data/test1002 index de08c0e72283..94124e2ea075 100644 --- a/tests/data/test1002 +++ b/tests/data/test1002 @@ -81,42 +81,42 @@ test # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload1 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload1 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER.upload1", response="198aa9b6acb4b0c71d02a197a5e41f54" -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 3 - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload1 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload1 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER.upload1", response="198aa9b6acb4b0c71d02a197a5e41f54" +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 3 + st -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload2 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload2 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER.upload2", response="d711f0d2042786d930de635ba0d1a1d0" -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 3 - +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload2 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER.upload2 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER.upload2", response="d711f0d2042786d930de635ba0d1a1d0" +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 3 + st diff --git a/tests/data/test1008 b/tests/data/test1008 index 4535d65076b3..a1705d106637 100644 --- a/tests/data/test1008 +++ b/tests/data/test1008 @@ -101,24 +101,24 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test1030 b/tests/data/test1030 index 200bd72b3c0f..28c6e4b2937a 100644 --- a/tests/data/test1030 +++ b/tests/data/test1030 @@ -80,24 +80,24 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three four is the number of lines -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="01cb59db1ddaac246b072d5f5f0716d9" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="01cb59db1ddaac246b072d5f5f0716d9" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test1041 b/tests/data/test1041 index bb793d51ead8..22822e49c98f 100644 --- a/tests/data/test1041 +++ b/tests/data/test1041 @@ -52,14 +52,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T%LOGDIR/test%TESTNUMBER.txt -C - # curl doesn't do a HEAD request on the remote file so it has no idea whether # it can skip part of the file or not. Instead, it sends the entire file. - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 0-99/100 -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 100 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 0-99/100 +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 100 + 012345678 012345678 012345678 diff --git a/tests/data/test1050 b/tests/data/test1050 index 3aa2f017e37f..4accd71baa46 100644 --- a/tests/data/test1050 +++ b/tests/data/test1050 @@ -46,16 +46,16 @@ FTP-IPv6 dir list, EPRT with specified IP # Strip all valid kinds of EPRT that curl can send -s/^(EPRT \|2\|::1\|)(.*)/$1/ +s/^(EPRT \|2\|::1\|)(\S*)/$1/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |2|::1| -TYPE A -LIST -QUIT +TYPE A +LIST +QUIT diff --git a/tests/data/test1051 b/tests/data/test1051 index 921aaeb780c1..70a714cde757 100644 --- a/tests/data/test1051 +++ b/tests/data/test1051 @@ -79,13 +79,13 @@ the # including the full request-body before it responds. So in this test the # server says 301 and 100 _after_ the entire PUT body has been sent. - -PUT /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - + +PUT /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 78 + Weird file to @@ -95,12 +95,12 @@ for the PUT feature -PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - +PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 78 + Weird file to diff --git a/tests/data/test1052 b/tests/data/test1052 index ade77bde5568..ec92d479dffc 100644 --- a/tests/data/test1052 +++ b/tests/data/test1052 @@ -74,13 +74,13 @@ the # the test HTTP server is blocking until it has read the entire request, # including the full request-body before it responds. So in this test the # server says 301 and 200 _after_ the entire PUT body has been sent. - -PUT /want/%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - + +PUT /want/%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 78 + Weird file to @@ -90,12 +90,12 @@ for the PUT feature -PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - +PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 78 + Weird file to diff --git a/tests/data/test1064 b/tests/data/test1064 index 55eeb38dac4a..0d3536c15b6c 100644 --- a/tests/data/test1064 +++ b/tests/data/test1064 @@ -44,20 +44,20 @@ test # Verify data after the test has been "shot" - -PUT /%TESTNUMBER.upload1 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 5 - + +PUT /%TESTNUMBER.upload1 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 5 + test -PUT /%TESTNUMBER0002.upload2 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 5 - +PUT /%TESTNUMBER0002.upload2 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 5 + test diff --git a/tests/data/test1065 b/tests/data/test1065 index 3b1c652b585e..b66ed29ed26c 100644 --- a/tests/data/test1065 +++ b/tests/data/test1065 @@ -45,19 +45,19 @@ test # Verify data after the test has been "shot" - -PUT /%TESTNUMBER.upload1 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 5 - + +PUT /%TESTNUMBER.upload1 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 5 + test -GET /%TESTNUMBER0002.url2 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - +GET /%TESTNUMBER0002.url2 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 A OK diff --git a/tests/data/test1071 b/tests/data/test1071 index 1b320c2bfa02..c98a8cd4aa1c 100644 --- a/tests/data/test1071 +++ b/tests/data/test1071 @@ -86,24 +86,24 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three four is the number of lines -PUT /%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="df4cef6b52a30e65d472dd848d2055a1" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - +PUT /%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="df4cef6b52a30e65d472dd848d2055a1" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test1075 b/tests/data/test1075 index 37230e1aa10a..0a6e6d3c199a 100644 --- a/tests/data/test1075 +++ b/tests/data/test1075 @@ -64,24 +64,24 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three four is the number of lines -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[testuser:testpass]b64% -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[testuser:testpass]b64% +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test1098 b/tests/data/test1098 index dac208949aca..4746b5fde9d3 100644 --- a/tests/data/test1098 +++ b/tests/data/test1098 @@ -43,19 +43,19 @@ ftp://ftp-site/moo/%TESTNUMBER ftp://ftp-site/moo/%TESTNUMBER --proxy http://%HO # # Verify data after the test has been "shot" - -GET ftp://ftp-site/moo/%TESTNUMBER HTTP/1.1 -Host: ftp-site:21 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET ftp://ftp-site/moo/%TESTNUMBER HTTP/1.1 -Host: ftp-site:21 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET ftp://ftp-site/moo/%TESTNUMBER HTTP/1.1 +Host: ftp-site:21 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET ftp://ftp-site/moo/%TESTNUMBER HTTP/1.1 +Host: ftp-site:21 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + HTTP/1.1 200 OK diff --git a/tests/data/test1134 b/tests/data/test1134 index 4b488fbbe904..1090a23b3286 100644 --- a/tests/data/test1134 +++ b/tests/data/test1134 @@ -45,19 +45,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u user1:password1 --next http://%HOSTIP:%H # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[user1:password1]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Basic %b64[2user:password2]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user1:password1]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[2user:password2]b64% +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test116 b/tests/data/test116 index 0ab00aae91f3..7a29f181e40d 100644 --- a/tests/data/test116 +++ b/tests/data/test116 @@ -43,13 +43,13 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P 1.2.3.4 s/^(PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},)\d{1,3},\d{1,3}/$1/ s/^(EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|)\d{1,5}\|/$1/ - -USER anonymous -PASS ftp@example.com -PWD -EPRT |1|1.2.3.4| -PORT 1,2,3,4, -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPRT |1|1.2.3.4| +PORT 1,2,3,4, +QUIT diff --git a/tests/data/test1206 b/tests/data/test1206 index 228df4adb773..796ea44dfb71 100644 --- a/tests/data/test1206 +++ b/tests/data/test1206 @@ -34,17 +34,17 @@ FTP PORT and 425 on download # Verify data after the test has been "shot" -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT 10 is CURLE_FTP_ACCEPT_FAILED diff --git a/tests/data/test1207 b/tests/data/test1207 index 612c42b0d6dc..0d77dfb3ccfa 100644 --- a/tests/data/test1207 +++ b/tests/data/test1207 @@ -34,17 +34,17 @@ FTP PORT and 421 on download # Verify data after the test has been "shot" -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT 10 diff --git a/tests/data/test1208 b/tests/data/test1208 index 055a0a58c63b..8acf3c1cd716 100644 --- a/tests/data/test1208 +++ b/tests/data/test1208 @@ -38,21 +38,21 @@ FTP PORT download, no data conn and no transient negative reply # Verify data after the test has been "shot" -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ # This test doesn't send a QUIT because the main state machine in multi.c # triggers the timeout and sets the CURLE_OPERATION_TIMEDOUT error (28) for # which the FTP disconnect code generically has to assume could mean the # control the connection and thus it cannot send any command. - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER # 28 is CURLE_OPERATION_TIMEDOUT diff --git a/tests/data/test1209 b/tests/data/test1209 index 38e1003c9042..7c3ec3f94f3d 100644 --- a/tests/data/test1209 +++ b/tests/data/test1209 @@ -36,7 +36,7 @@ FTP PORT download, no data conn and no positive preliminary reply # Verify data after the test has been "shot" -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ # The protocol part does not include QUIT simply because the error is @@ -44,14 +44,14 @@ s/^EPRT \|1\|(.*)/EPRT \|1\|/ # specifically saying for which connection it concerns, and for timeouts libcurl # marks the control channel as "invalid". As this test case times out for the # data connection it could still use the control channel. - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER 28 diff --git a/tests/data/test1211 b/tests/data/test1211 index 6ca7eaea917f..d2919fb456e4 100644 --- a/tests/data/test1211 +++ b/tests/data/test1211 @@ -36,17 +36,17 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P - # Verify data after the test has been "shot" -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER 28 diff --git a/tests/data/test125 b/tests/data/test125 index 8de97c14e530..568bf130953e 100644 --- a/tests/data/test125 +++ b/tests/data/test125 @@ -30,12 +30,12 @@ ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER 9 - -USER anonymous -PASS ftp@example.com -PWD -CWD path -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD path +QUIT diff --git a/tests/data/test1285 b/tests/data/test1285 index 1b65245521ed..9b7f0a0474df 100644 --- a/tests/data/test1285 +++ b/tests/data/test1285 @@ -73,20 +73,20 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="dc185587d5e8391b347eef194c2a3cd6" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="dc185587d5e8391b347eef194c2a3cd6" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test1414 b/tests/data/test1414 index 4be9b54222a7..e448956fc932 100644 --- a/tests/data/test1414 +++ b/tests/data/test1414 @@ -39,19 +39,19 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P - # Verify data after the test has been "shot" -s/^(EPRT \|1\|)(.*)/$1/ -s/^(PORT)(.*)/$1/ +s/^(EPRT \|1\|)(\S*)/$1/ +s/^(PORT) *(\S*)/$1/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| PORT -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test1418 b/tests/data/test1418 index 9fff0b63a33c..bbbd5858987e 100644 --- a/tests/data/test1418 +++ b/tests/data/test1418 @@ -94,29 +94,29 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth http://%HOST # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/%TESTNUMBER", response="986238b7e0077754944c966f56d9bc77" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/%TESTNUMBER0003", response="1c6390a67bac3283a9b023402f3b3540" -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/%TESTNUMBER", response="986238b7e0077754944c966f56d9bc77" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/%TESTNUMBER0003", response="1c6390a67bac3283a9b023402f3b3540" +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test1419 b/tests/data/test1419 index aada395f8a3c..45807f01bc55 100644 --- a/tests/data/test1419 +++ b/tests/data/test1419 @@ -51,17 +51,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --anyauth http://%HOSTIP:%HTTPPORT/%TESTNUM # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test1421 b/tests/data/test1421 index 6c36eb191692..3cab703b4a68 100644 --- a/tests/data/test1421 +++ b/tests/data/test1421 @@ -55,19 +55,19 @@ Content-Length: 6 -foo- - -GET http://test.remote.haxx.se.%TESTNUMBER:8990/ HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://different.remote.haxx.se.%TESTNUMBER:8990/ HTTP/1.1 -Host: different.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.haxx.se.%TESTNUMBER:8990/ HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://different.remote.haxx.se.%TESTNUMBER:8990/ HTTP/1.1 +Host: different.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + [DISCONNECT] diff --git a/tests/data/test1509 b/tests/data/test1509 index d7a7519c0820..37614bda7d20 100644 --- a/tests/data/test1509 +++ b/tests/data/test1509 @@ -80,11 +80,11 @@ Proxy-Connection: Keep-Alive [DISCONNECT] - -GET /%TESTNUMBER HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Accept: */* + [DISCONNECT] diff --git a/tests/data/test1524 b/tests/data/test1524 index 8756ec630663..05433d47c274 100644 --- a/tests/data/test1524 +++ b/tests/data/test1524 @@ -55,19 +55,19 @@ moo # # Verify data after the test has been "shot" - -PUT /blah/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 4 - + +PUT /blah/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 4 + moo -GET /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - +GET /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test1525 b/tests/data/test1525 index 2778c3f56482..1e143b3e6fa9 100644 --- a/tests/data/test1525 +++ b/tests/data/test1525 @@ -65,13 +65,13 @@ Proxy-Connection: Keep-Alive User-Agent: Http Agent - -PUT /%TESTNUMBER HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Accept: */* -User-Agent: Http Agent -Content-Length: 13 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Accept: */* +User-Agent: Http Agent +Content-Length: 13 + Hello Cloud! diff --git a/tests/data/test1526 b/tests/data/test1526 index cd4a4f48b032..45d95811b771 100644 --- a/tests/data/test1526 +++ b/tests/data/test1526 @@ -67,13 +67,13 @@ Proxy-Connection: Keep-Alive User-Agent: Proxy Agent - -PUT /%TESTNUMBER HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Accept: */* -User-Agent: Http Agent -Content-Length: 13 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Accept: */* +User-Agent: Http Agent +Content-Length: 13 + Hello Cloud! diff --git a/tests/data/test1527 b/tests/data/test1527 index 1f422362b398..3540a3bfb863 100644 --- a/tests/data/test1527 +++ b/tests/data/test1527 @@ -67,14 +67,14 @@ User-Agent: Http Agent Expect: 100-continue - -PUT /%TESTNUMBER HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Accept: */* -User-Agent: Http Agent -Expect: 100-continue -Content-Length: 13 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Accept: */* +User-Agent: Http Agent +Expect: 100-continue +Content-Length: 13 + Hello Cloud! diff --git a/tests/data/test154 b/tests/data/test154 index 7612ce05ff76..5435ac9e9d11 100644 --- a/tests/data/test154 +++ b/tests/data/test154 @@ -80,24 +80,24 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three four is the number of lines -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="b71551e12d1c456e47d8388ecb2edeca" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="b71551e12d1c456e47d8388ecb2edeca" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test155 b/tests/data/test155 index 83aed115f8f8..90bb18dc5b75 100644 --- a/tests/data/test155 +++ b/tests/data/test155 @@ -96,31 +96,31 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three four is the number of lines -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test156 b/tests/data/test156 index 877c215b9391..743fe1816ef7 100644 --- a/tests/data/test156 +++ b/tests/data/test156 @@ -40,13 +40,13 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test1590 b/tests/data/test1590 index ea860215fed7..f07f82ddd626 100644 --- a/tests/data/test1590 +++ b/tests/data/test1590 @@ -51,7 +51,5 @@ imap://localhost:%IMAPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - - diff --git a/tests/data/test1671 b/tests/data/test1671 index 43753b527de3..e452eafd9c99 100644 --- a/tests/data/test1671 +++ b/tests/data/test1671 @@ -50,12 +50,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{header_json}\n' -o %LOGDIR/%TESTNUMBE # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + {"date":["Tue, 09 Nov 2010 14:49:00 GMT"], diff --git a/tests/data/test18 b/tests/data/test18 index ae31da29e758..d32ba17a173f 100644 --- a/tests/data/test18 +++ b/tests/data/test18 @@ -47,22 +47,22 @@ multiple requests using {} in URL # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0003 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 200 OK diff --git a/tests/data/test180 b/tests/data/test180 index 62a505d5fa97..1e15e64c9791 100644 --- a/tests/data/test180 +++ b/tests/data/test180 @@ -44,13 +44,13 @@ the # Verify data after the test has been "shot" - -PUT /we/want/%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - + +PUT /we/want/%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 78 + Weird file to diff --git a/tests/data/test181 b/tests/data/test181 index 685b24412948..6d1fd25e5d66 100644 --- a/tests/data/test181 +++ b/tests/data/test181 @@ -44,14 +44,14 @@ the # Verify data after the test has been "shot" - -POST /we/want/%TESTNUMBER HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 79 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/%TESTNUMBER HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 79 +Content-Type: application/x-www-form-urlencoded + Weird file to diff --git a/tests/data/test1938 b/tests/data/test1938 index c06306c4ca1e..e2ed9837e86f 100644 --- a/tests/data/test1938 +++ b/tests/data/test1938 @@ -60,13 +60,13 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - -POST /%TESTNUMBER/testapi/test HTTP/1.1 -Host: 127.0.0.1:9000 -Authorization: PROVIDER14-HMAC-SHA256 Credential=keyId/19700101/region/service/provider14_request, SignedHeaders=content-type;host;x-provider2-date, Signature=3436256c7c23adeb66dc15984eaa527edc4a504def61da2e0bf4b01ace4f3c0b -X-Provider2-Date: 19700101T000000Z -Content-Length: 9 - + +POST /%TESTNUMBER/testapi/test HTTP/1.1 +Host: 127.0.0.1:9000 +Authorization: PROVIDER14-HMAC-SHA256 Credential=keyId/19700101/region/service/provider14_request, SignedHeaders=content-type;host;x-provider2-date, Signature=3436256c7c23adeb66dc15984eaa527edc4a504def61da2e0bf4b01ace4f3c0b +X-Provider2-Date: 19700101T000000Z +Content-Length: 9 + %hex[post%00Data]hex% diff --git a/tests/data/test194 b/tests/data/test194 index 074348950a94..ef7b24aae3ff 100644 --- a/tests/data/test194 +++ b/tests/data/test194 @@ -56,13 +56,13 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -C 87 --fail # Verify data after the test has been "shot" - -GET /want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Range: bytes=87- -User-Agent: curl/%VERSION -Accept: */* - + +GET /want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Range: bytes=87- +User-Agent: curl/%VERSION +Accept: */* + 0 diff --git a/tests/data/test1948 b/tests/data/test1948 index 4c50b02acd71..39be768c0b4c 100644 --- a/tests/data/test1948 +++ b/tests/data/test1948 @@ -53,19 +53,19 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 22 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 22 + This is test PUT data -POST /1948 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 22 -Content-Type: application/x-www-form-urlencoded - +POST /1948 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 22 +Content-Type: application/x-www-form-urlencoded + This is test PUT data diff --git a/tests/data/test1973 b/tests/data/test1973 index 094810cf13eb..8b10e9ec484c 100644 --- a/tests/data/test1973 +++ b/tests/data/test1973 @@ -59,14 +59,14 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - -POST /aws_sigv4/testapi/test HTTP/1.1 -Host: exam.ple.com:9000 -Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=7eb34202214384872221b99a9c671b7517891ac6af56b0aff24ec51adf62b10a -X-Amz-Date: 19700101T000000Z -x-amz-content-sha256: 4b02e333ccf7cf530ddee3e10ebe54e935500b5e570e68650d63d743e8bbc045 -Content-Length: 12 - + +POST /aws_sigv4/testapi/test HTTP/1.1 +Host: exam.ple.com:9000 +Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=7eb34202214384872221b99a9c671b7517891ac6af56b0aff24ec51adf62b10a +X-Amz-Date: 19700101T000000Z +x-amz-content-sha256: 4b02e333ccf7cf530ddee3e10ebe54e935500b5e570e68650d63d743e8bbc045 +Content-Length: 12 + post fields diff --git a/tests/data/test2000 b/tests/data/test2000 index 032bf5b1b453..9e4d2acdb1a3 100644 --- a/tests/data/test2000 +++ b/tests/data/test2000 @@ -46,15 +46,15 @@ moo # # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT data diff --git a/tests/data/test2001 b/tests/data/test2001 index de1673531322..e9b9ae6f70ad 100644 --- a/tests/data/test2001 +++ b/tests/data/test2001 @@ -63,20 +63,20 @@ moo # # Verify data after the test has been "shot" - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 -QUIT + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE %TESTNUMBER0002 +RETR %TESTNUMBER0002 +QUIT -foo- diff --git a/tests/data/test2058 b/tests/data/test2058 index a797f9648bdb..f840c6e5f61a 100644 --- a/tests/data/test2058 +++ b/tests/data/test2058 @@ -82,24 +82,24 @@ test # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="fbed69f9f3fd304c8f1acb1a43eb32688b933c0e28055c16b926cbcec070aeed", algorithm=SHA-256 -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 3 - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="fbed69f9f3fd304c8f1acb1a43eb32688b933c0e28055c16b926cbcec070aeed", algorithm=SHA-256 +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 3 + st diff --git a/tests/data/test2059 b/tests/data/test2059 index 79f71713936a..dbd890431301 100644 --- a/tests/data/test2059 +++ b/tests/data/test2059 @@ -82,24 +82,24 @@ test # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="fddc3bc7b753b73ab0848fd83cb20cbbca971258eb8d20c941dd5e0b010d66be", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="22d200df1fd02a9d3a7269ef5bbb5bf8f16f184a74907df9b64a3755489c0b42", algorithm=SHA-256, userhash=true -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 3 - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="fddc3bc7b753b73ab0848fd83cb20cbbca971258eb8d20c941dd5e0b010d66be", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="22d200df1fd02a9d3a7269ef5bbb5bf8f16f184a74907df9b64a3755489c0b42", algorithm=SHA-256, userhash=true +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 3 + st diff --git a/tests/data/test206 b/tests/data/test206 index 2ff05075c77b..82585f720cea 100644 --- a/tests/data/test206 +++ b/tests/data/test206 @@ -86,23 +86,23 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy=http:// # Verify data after the test has been "shot" - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se.%TESTNUMBER:8990", response="003e36decb4dbf6366b3ecb9b87c24ec" -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -GET /path/%TESTNUMBER0002 HTTP/1.1 -Host: test.remote.haxx.se.%TESTNUMBER:8990 -User-Agent: curl/%VERSION -Accept: */* - + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se.%TESTNUMBER:8990", response="003e36decb4dbf6366b3ecb9b87c24ec" +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +GET /path/%TESTNUMBER0002 HTTP/1.1 +Host: test.remote.haxx.se.%TESTNUMBER:8990 +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test2060 b/tests/data/test2060 index 4a754b168880..4c0c52e914f1 100644 --- a/tests/data/test2060 +++ b/tests/data/test2060 @@ -82,24 +82,24 @@ test # Verify data after the test has been "shot" - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 - -GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="691867f4a06c79fd0a175c1857e3df7015f6fff3ce8676497d2f1f805b5a8eca", algorithm=SHA-512-256 -Content-Range: bytes 2-4/5 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 3 - + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 + +GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="691867f4a06c79fd0a175c1857e3df7015f6fff3ce8676497d2f1f805b5a8eca", algorithm=SHA-512-256 +Content-Range: bytes 2-4/5 +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 3 + st diff --git a/tests/data/test212 b/tests/data/test212 index 045ad3769a07..c7fba5f8b93a 100644 --- a/tests/data/test212 +++ b/tests/data/test212 @@ -44,21 +44,21 @@ data blobb s/^(EPRT \|1\|)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|/$1/ s/^(PORT )\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}/$1/ - -USER anonymous -PASS ftp@example.com -PWD -CWD a -CWD path -EPRT |1| -PORT -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -PORT -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +CWD a +CWD path +EPRT |1| +PORT%spc% +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +PORT%spc% +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test253 b/tests/data/test253 index 01ec416ac62e..cde0b2f8d1eb 100644 --- a/tests/data/test253 +++ b/tests/data/test253 @@ -46,16 +46,16 @@ FTP IPv6 dir list with EPRT # Verify data after the test has been "shot" -s/^(EPRT \|2\|::1\|)(.*)/$1/ +s/^(EPRT \|2\|::1\|)(\S*)/$1/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |2|::1| -TYPE A -LIST -QUIT +TYPE A +LIST +QUIT diff --git a/tests/data/test255 b/tests/data/test255 index 1a1526a10caf..ef7b08e0608a 100644 --- a/tests/data/test255 +++ b/tests/data/test255 @@ -47,16 +47,16 @@ FTP IPv6 dir list with EPRT and --disable-eprt # Verify data after the test has been "shot" -s/^(EPRT \|2\|::1\|)(.*)/$1/ +s/^(EPRT \|2\|::1\|)(\S*)/$1/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |2|::1| -TYPE A -LIST -QUIT +TYPE A +LIST +QUIT diff --git a/tests/data/test272 b/tests/data/test272 index 2857c3eac3a1..36f472f173ff 100644 --- a/tests/data/test272 +++ b/tests/data/test272 @@ -29,12 +29,12 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -z "2004 jan 1 12:12:12 UTC" # Verify data after the test has been "shot" - -USER anonymous -PASS ftp@example.com -PWD -MDTM %TESTNUMBER -QUIT + +USER anonymous +PASS ftp@example.com +PWD +MDTM %TESTNUMBER +QUIT diff --git a/tests/data/test275 b/tests/data/test275 index d3a68a4211cf..05260b91b87f 100644 --- a/tests/data/test275 +++ b/tests/data/test275 @@ -72,19 +72,19 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: remotesite.com.%TESTNUMBER:%HTTPPORT -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* - -GET /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: remotesite.com.%TESTNUMBER:%HTTPPORT -Authorization: Basic %b64[iam:myself]b64% -User-Agent: curl/%VERSION -Accept: */* - + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: remotesite.com.%TESTNUMBER:%HTTPPORT +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* + +GET /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: remotesite.com.%TESTNUMBER:%HTTPPORT +Authorization: Basic %b64[iam:myself]b64% +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test281 b/tests/data/test281 index 23af513a02a7..b02486e6432f 100644 --- a/tests/data/test281 +++ b/tests/data/test281 @@ -43,13 +43,13 @@ Weird 22 - -PUT /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 38 - + +PUT /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 38 + Weird file to diff --git a/tests/data/test32 b/tests/data/test32 index f61369304170..e2980fc3dcc8 100644 --- a/tests/data/test32 +++ b/tests/data/test32 @@ -42,12 +42,12 @@ HTTP with -d and -G # # Verify data after the test has been "shot" - -GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + diff --git a/tests/data/test33 b/tests/data/test33 index 34afff35b705..e2ba7da4c6f3 100644 --- a/tests/data/test33 +++ b/tests/data/test33 @@ -42,14 +42,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T%LOGDIR/test%TESTNUMBER.txt -C 50 # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Content-Range: bytes 50-99/100 -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 50 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Content-Range: bytes 50-99/100 +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 50 + 012345678 012345678 012345678 diff --git a/tests/data/test338 b/tests/data/test338 index d3acd5f098df..384320d89fb2 100644 --- a/tests/data/test338 +++ b/tests/data/test338 @@ -45,17 +45,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --next http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test35 b/tests/data/test35 index 8abf22a301c2..f53117f036d6 100644 --- a/tests/data/test35 +++ b/tests/data/test35 @@ -35,14 +35,14 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --data-binary @%LOGDIR/test%TESTNUM # Verify data after the test has been "shot" - -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 47 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 47 +Content-Type: application/x-www-form-urlencoded + %hex[This%00 is binary data with an embedded NUL byte]hex% diff --git a/tests/data/test357 b/tests/data/test357 index 8883cfffe80e..d0b7b7325f4a 100644 --- a/tests/data/test357 +++ b/tests/data/test357 @@ -61,20 +61,20 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt --ex # Verify data after the test has been "shot" - -PUT /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1053701 -Expect: 100-continue - -PUT /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1053701 - + +PUT /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 1053701 +Expect: 100-continue + +PUT /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 1053701 + %repeat[1053700 x x]% diff --git a/tests/data/test364 b/tests/data/test364 index 5a02d7022741..8ee8969c5048 100644 --- a/tests/data/test364 +++ b/tests/data/test364 @@ -37,13 +37,13 @@ HTTPS PUT of small file # Verify data after the test has been "shot" - -PUT /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1201 - + +PUT /we/want/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 1201 + %repeat[200 x banana]% diff --git a/tests/data/test384 b/tests/data/test384 index 50f94c009c9d..33cd9f5da082 100644 --- a/tests/data/test384 +++ b/tests/data/test384 @@ -45,14 +45,14 @@ HTTP with --json from stdin # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: foobar/* -Content-Type: application/json -Content-Length: 22 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: foobar/* +Content-Type: application/json +Content-Length: 22 + { "drink": "coffee" } diff --git a/tests/data/test388 b/tests/data/test388 index 23a5cc7c4252..f7158ec2daa6 100644 --- a/tests/data/test388 +++ b/tests/data/test388 @@ -91,35 +91,35 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u testuser:testpass --digest http://%H ^Authorization.*cnonce - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0001", response="ea598bbfdb5c54b7352c977e3885e44d" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0002", response="921a8e6db782d6359db1f40d9ed7e6a6" -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/%TESTNUMBER0002", cnonce="MTA4MzIr", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm=MD5 -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0001", response="ea598bbfdb5c54b7352c977e3885e44d" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0002", response="921a8e6db782d6359db1f40d9ed7e6a6" +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/%TESTNUMBER0002", cnonce="MTA4MzIr", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm=MD5 +User-Agent: curl/%VERSION +Accept: */* + HTTP/1.1 401 Authorization Required swsclose diff --git a/tests/data/test425 b/tests/data/test425 index 399ca1983f8c..1b211d1db358 100644 --- a/tests/data/test425 +++ b/tests/data/test425 @@ -40,13 +40,13 @@ content # # Verify data after the test has been "shot" - -PUT /%TESTNUMBER/?fullpath HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 8 - + +PUT /%TESTNUMBER/?fullpath HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 8 + content diff --git a/tests/data/test48 b/tests/data/test48 index 24fa0abbb38b..564e8f3a7419 100644 --- a/tests/data/test48 +++ b/tests/data/test48 @@ -36,17 +36,17 @@ HTTP with -d and -G and -I # # Verify data after the test has been "shot" - -HEAD /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -HEAD /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +HEAD /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +HEAD /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + [DISCONNECT] diff --git a/tests/data/test490 b/tests/data/test490 index a0bc8f353963..f691ae0abd9a 100644 --- a/tests/data/test490 +++ b/tests/data/test490 @@ -45,20 +45,20 @@ surprise! # # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 + surprise! -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 - +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 + surprise! diff --git a/tests/data/test491 b/tests/data/test491 index 15bb756b55b6..f6ae7d5bcf3a 100644 --- a/tests/data/test491 +++ b/tests/data/test491 @@ -45,13 +45,13 @@ surprise! # # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 10 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 10 + surprise! diff --git a/tests/data/test492 b/tests/data/test492 index d576cca1cfdb..bc52e305cf3a 100644 --- a/tests/data/test492 +++ b/tests/data/test492 @@ -48,38 +48,38 @@ second %TESTNUMBER contents # # Verify data after the test has been "shot" - -PUT /one/first%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER -Content-Length: 19 - + +PUT /one/first%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER +Content-Length: 19 + first %TESTNUMBER contents -PUT /two/first%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER -Content-Length: 19 - +PUT /two/first%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER +Content-Length: 19 + first %TESTNUMBER contents -PUT /one/second%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER -Content-Length: 20 - +PUT /one/second%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER +Content-Length: 20 + second %TESTNUMBER contents -PUT /two/second%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Testno: %TESTNUMBER -Content-Length: 20 - +PUT /two/second%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Testno: %TESTNUMBER +Content-Length: 20 + second %TESTNUMBER contents diff --git a/tests/data/test503 b/tests/data/test503 index ea2dfcd7f468..8aefb0d86fc3 100644 --- a/tests/data/test503 +++ b/tests/data/test503 @@ -78,12 +78,12 @@ Proxy-Connection: Keep-Alive [DISCONNECT] - -GET /%TESTNUMBER HTTP/1.1 -Host: machine.%TESTNUMBER:%HTTPPORT -Authorization: Basic %b64[test:ing]b64% -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: machine.%TESTNUMBER:%HTTPPORT +Authorization: Basic %b64[test:ing]b64% +Accept: */* + [DISCONNECT] diff --git a/tests/data/test508 b/tests/data/test508 index cc1932a35f65..b3c528983444 100644 --- a/tests/data/test508 +++ b/tests/data/test508 @@ -41,13 +41,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 45 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 45 +Content-Type: application/x-www-form-urlencoded + this is what we post to the silly web server diff --git a/tests/data/test513 b/tests/data/test513 index cc97336105c5..d61d2be4a5c0 100644 --- a/tests/data/test513 +++ b/tests/data/test513 @@ -33,8 +33,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - - # 42 - aborted by callback 42 diff --git a/tests/data/test540 b/tests/data/test540 index 977996a2fad0..161e986488f8 100644 --- a/tests/data/test540 +++ b/tests/data/test540 @@ -80,29 +80,29 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT silly:p # Verify data after the test has been "shot" - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: custom.set.host.name -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: custom.set.host.name -Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="/path/%TESTNUMBER", response="ca507dcf189196b6a5374d3233042261" -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: custom.set.host.name -Accept: */* -Proxy-Connection: Keep-Alive - -GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: custom.set.host.name -Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="/path/%TESTNUMBER", response="ca507dcf189196b6a5374d3233042261" -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: custom.set.host.name +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: custom.set.host.name +Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="/path/%TESTNUMBER", response="ca507dcf189196b6a5374d3233042261" +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: custom.set.host.name +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: custom.set.host.name +Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="/path/%TESTNUMBER", response="ca507dcf189196b6a5374d3233042261" +Accept: */* +Proxy-Connection: Keep-Alive + [DISCONNECT] diff --git a/tests/data/test544 b/tests/data/test544 index a35c9cf70721..38a7da064077 100644 --- a/tests/data/test544 +++ b/tests/data/test544 @@ -40,13 +40,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 4 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 4 +Content-Type: application/x-www-form-urlencoded + This diff --git a/tests/data/test545 b/tests/data/test545 index 0bdb6281536e..b8993c01f145 100644 --- a/tests/data/test545 +++ b/tests/data/test545 @@ -43,13 +43,13 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ^User-Agent:.* - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 46 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 46 +Content-Type: application/x-www-form-urlencoded + %hex[This%00 is test binary data with an embedded NUL]hex% diff --git a/tests/data/test547 b/tests/data/test547 index de07800814a8..d18639ae8a6b 100644 --- a/tests/data/test547 +++ b/tests/data/test547 @@ -91,31 +91,31 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT testuse # Verify data after the test has been "shot" - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload diff --git a/tests/data/test548 b/tests/data/test548 index 2ad40e4589df..1a8d5e16e9dc 100644 --- a/tests/data/test548 +++ b/tests/data/test548 @@ -91,31 +91,31 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT testuse # Verify data after the test has been "shot" - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload diff --git a/tests/data/test551 b/tests/data/test551 index 74ed90754540..cd85900530cb 100644 --- a/tests/data/test551 +++ b/tests/data/test551 @@ -76,23 +76,23 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT s1lly:p # Verify data after the test has been "shot" - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="%repeat[400 x A]%", uri="/path/%TESTNUMBER", response="3325240726fbdaf1e61f3a0dd40b930c" -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="%repeat[400 x A]%", uri="/path/%TESTNUMBER", response="3325240726fbdaf1e61f3a0dd40b930c" +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload diff --git a/tests/data/test553 b/tests/data/test553 index 4500751a1232..bbe364b1fb54 100644 --- a/tests/data/test553 +++ b/tests/data/test553 @@ -41,21 +41,21 @@ http://%HOSTIP:%HTTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - -POST /path/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Header0: %repeat[5000 x A]% -Header1: %repeat[5000 x A]% -Header2: %repeat[5000 x A]% -Header3: %repeat[5000 x A]% -Header4: %repeat[5000 x A]% -Header5: %repeat[5000 x A]% -Header6: %repeat[5000 x A]% -Header7: %repeat[5000 x A]% -Content-Length: 40960 -Content-Type: application/x-www-form-urlencoded - + +POST /path/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Header0: %repeat[5000 x A]% +Header1: %repeat[5000 x A]% +Header2: %repeat[5000 x A]% +Header3: %repeat[5000 x A]% +Header4: %repeat[5000 x A]% +Header5: %repeat[5000 x A]% +Header6: %repeat[5000 x A]% +Header7: %repeat[5000 x A]% +Content-Length: 40960 +Content-Type: application/x-www-form-urlencoded + %repeat[40960 x A]% diff --git a/tests/data/test555 b/tests/data/test555 index f3633f0b1c64..5b286395ad8f 100644 --- a/tests/data/test555 +++ b/tests/data/test555 @@ -96,31 +96,31 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT testuse # Verify data after the test has been "shot" - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 0 -Content-Type: application/x-www-form-urlencoded - -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 36 -Content-Type: application/x-www-form-urlencoded - +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 0 +Content-Type: application/x-www-form-urlencoded + +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 +Host: test.remote.example.com +Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 36 +Content-Type: application/x-www-form-urlencoded + this is the blurb we want to upload diff --git a/tests/data/test568 b/tests/data/test568 index 700fd44bfe49..8aa659201db2 100644 --- a/tests/data/test568 +++ b/tests/data/test568 @@ -80,12 +80,12 @@ m=video 2232 RTP/AVP 31 ^If-Modified-Since:.* - -ANNOUNCE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 -CSeq: 1 -Content-Length: 306 -Content-Type: application/sdp - + +ANNOUNCE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 +CSeq: 1 +Content-Length: 306 +Content-Type: application/sdp + v=0 o=mhandley 2890844526 2890845468 IN IP4 126.16.64.4 s=SDP Seminar @@ -97,19 +97,19 @@ t=2873397496 2873404696 a=recvonly m=audio 3456 RTP/AVP 0 m=video 2232 RTP/AVP 31 -DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 -CSeq: 2 -Accept: application/sdp - -ANNOUNCE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 -CSeq: 3 -Content-Type: posty goodness -Content-Length: 35 - +DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 +CSeq: 2 +Accept: application/sdp + +ANNOUNCE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 +CSeq: 3 +Content-Type: posty goodness +Content-Length: 35 + postyfield=postystuff&project=curl -OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 -CSeq: 4 - +OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 +CSeq: 4 + diff --git a/tests/data/test572 b/tests/data/test572 index 4ac86bc9bf57..8b702a680179 100644 --- a/tests/data/test572 +++ b/tests/data/test572 @@ -86,35 +86,35 @@ speed ^If-Modified-Since:.* - -SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 -CSeq: 1 -Transport: Planes/Trains/Automobiles - -GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 -CSeq: 2 -Session: getparams-test -Content-Length: 12 -Content-Type: text/parameters - + +SETUP rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0001 RTSP/1.0 +CSeq: 1 +Transport: Planes/Trains/Automobiles + +GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0002 RTSP/1.0 +CSeq: 2 +Session: getparams-test +Content-Length: 12 +Content-Type: text/parameters + scale speed -GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 -CSeq: 3 -Session: getparams-test - -GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 -CSeq: 4 -Session: getparams-test -Content-Length: 24 -Content-Type: text/parameters - +GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0003 RTSP/1.0 +CSeq: 3 +Session: getparams-test + +GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 +CSeq: 4 +Session: getparams-test +Content-Length: 24 +Content-Type: text/parameters + packets_received jitter -OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0005 RTSP/1.0 -CSeq: 5 -Session: getparams-test - +OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0005 RTSP/1.0 +CSeq: 5 +Session: getparams-test + diff --git a/tests/data/test577 b/tests/data/test577 index d880f282d994..bf31db7595d0 100644 --- a/tests/data/test577 +++ b/tests/data/test577 @@ -39,12 +39,12 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER - -OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 -CSeq: 1 -User-Agent: test567 -Test-Number: 567 - + +OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 +CSeq: 1 +User-Agent: test567 +Test-Number: 567 + # 8 == CURLE_WEIRD_SERVER_REPLY diff --git a/tests/data/test58 b/tests/data/test58 index fd4beac00f47..9e3e619b98e9 100644 --- a/tests/data/test58 +++ b/tests/data/test58 @@ -35,13 +35,13 @@ a few bytes # Verify data after the test has been "shot" - -PUT /we/want/%TESTNUMBERte%5b%5dst.txt HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 12 - + +PUT /we/want/%TESTNUMBERte%5b%5dst.txt HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 12 + a few bytes diff --git a/tests/data/test582 b/tests/data/test582 index cc3fe526545d..ad1182c234b6 100644 --- a/tests/data/test582 +++ b/tests/data/test582 @@ -34,8 +34,6 @@ Moooooooooooo # Verify data after the test has been "shot" - - Moooooooooooo upload this diff --git a/tests/data/test588 b/tests/data/test588 index 9c8c5f320242..5c53e0455472 100644 --- a/tests/data/test588 +++ b/tests/data/test588 @@ -47,19 +47,19 @@ Moooooooooooo # Strip off parts of the PORT and EPRT commands that might differ -s/^PORT (.*)/PORT/ -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ +s/^PORT (\S*)/PORT/ - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path EPRT |1| PORT -TYPE I -STOR %TESTNUMBER -QUIT +TYPE I +STOR %TESTNUMBER +QUIT Moooooooooooo diff --git a/tests/data/test591 b/tests/data/test591 index d1cbf082a4fa..32ce2707a17c 100644 --- a/tests/data/test591 +++ b/tests/data/test591 @@ -49,19 +49,19 @@ Moooooooooooo for %TESTNUMBER # Strip off parts of the PORT and EPRT commands that might differ -s/^PORT (.*)/PORT/ -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^PORT (\S*)/PORT/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path EPRT |1| PORT -TYPE I -STOR %TESTNUMBER -QUIT +TYPE I +STOR %TESTNUMBER +QUIT # CURLE_FTP_ACCEPT_FAILED = 10 diff --git a/tests/data/test592 b/tests/data/test592 index f77eb9a87069..d0445f341904 100644 --- a/tests/data/test592 +++ b/tests/data/test592 @@ -49,20 +49,20 @@ Moooooooooooo for %TESTNUMBER # Strip off parts of the PORT and EPRT commands that might differ -s/^PORT (.*)/PORT/ -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^PORT (\S*)/PORT/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ # a 421 response must prevent further commands from being sent - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path EPRT |1| PORT -TYPE I -STOR %TESTNUMBER -QUIT +TYPE I +STOR %TESTNUMBER +QUIT # CURLE_FTP_ACCEPT_FAILED = 10 diff --git a/tests/data/test593 b/tests/data/test593 index 9a15a5184e92..7c93ebaa42d2 100644 --- a/tests/data/test593 +++ b/tests/data/test593 @@ -49,19 +49,19 @@ Moooooooooooo for %TESTNUMBER # Strip off parts of the PORT and EPRT commands that might differ -s/^PORT (.*)/PORT/ -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^PORT (\S*)/PORT/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path EPRT |1| PORT -TYPE I -STOR %TESTNUMBER -QUIT +TYPE I +STOR %TESTNUMBER +QUIT 12 diff --git a/tests/data/test594 b/tests/data/test594 index cd98f0b9d8a4..d4ceca8ca1fa 100644 --- a/tests/data/test594 +++ b/tests/data/test594 @@ -51,19 +51,19 @@ Moooooooooooo for %TESTNUMBER # Strip off parts of the PORT and EPRT commands that might differ -s/^PORT (.*)/PORT/ -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^PORT (\S*)/PORT/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path EPRT |1| PORT -TYPE I -STOR %TESTNUMBER -QUIT +TYPE I +STOR %TESTNUMBER +QUIT 28 diff --git a/tests/data/test596 b/tests/data/test596 index 2c257a704adb..0a99ceafadba 100644 --- a/tests/data/test596 +++ b/tests/data/test596 @@ -44,17 +44,17 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER activeftp # Verify data after the test has been "shot" -s/^(EPRT \|1\|)(.*)/$1/ +s/^(EPRT \|1\|)(\S*)/$1/ - -USER anonymous -PASS ftp@example.com -PWD + +USER anonymous +PASS ftp@example.com +PWD EPRT |1| -TYPE I -SIZE %TESTNUMBER -RETR %TESTNUMBER -QUIT +TYPE I +SIZE %TESTNUMBER +RETR %TESTNUMBER +QUIT diff --git a/tests/data/test758 b/tests/data/test758 index a807ae9c85bb..a2b67e1c5d81 100644 --- a/tests/data/test758 +++ b/tests/data/test758 @@ -47,7 +47,5 @@ https://localhost:%HTTPSPORT/file%TESTNUMBER # Verify data after the test has been "shot" - - diff --git a/tests/data/test766 b/tests/data/test766 index 9db96b7c0535..a65ad156b929 100644 --- a/tests/data/test766 +++ b/tests/data/test766 @@ -34,18 +34,18 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Strip off parts of the EPRT command that might differ -s/^EPRT \|1\|(.*)/EPRT \|1\|/ +s/^EPRT \|1\|(\S*)/EPRT \|1\|/ # The TYPE command might get sent so we ignore that ^TYPE - -USER anonymous -PASS ftp@example.com -PWD -CWD path + +USER anonymous +PASS ftp@example.com +PWD +CWD path EPRT |1| diff --git a/tests/data/test785 b/tests/data/test785 index 6c8ae5dabb20..b3213643c5bf 100644 --- a/tests/data/test785 +++ b/tests/data/test785 @@ -45,14 +45,14 @@ On the first Monday of the month of April, 1625, the market town of Meung # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 69 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 69 +Content-Type: application/x-www-form-urlencoded + e first Monday of the month of April, 1625, the market town of Meung diff --git a/tests/data/test786 b/tests/data/test786 index bc5cca28d079..10ce170e262c 100644 --- a/tests/data/test786 +++ b/tests/data/test786 @@ -45,14 +45,14 @@ On the first Monday of the month of April, 1625, the market town of Meung # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 11 -Content-Type: application/x-www-form-urlencoded - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 11 +Content-Type: application/x-www-form-urlencoded + e first Mon diff --git a/tests/data/test88 b/tests/data/test88 index c483649804dd..db3eb6cd5a9c 100644 --- a/tests/data/test88 +++ b/tests/data/test88 @@ -76,20 +76,20 @@ four is the number of lines # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 0 - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="78a49fa53d0c228778297687d4168e71" -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 85 - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 0 + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="78a49fa53d0c228778297687d4168e71" +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 85 + This is data we upload with PUT a second line line three diff --git a/tests/data/test95 b/tests/data/test95 index 339c02ae4bcb..c30bb2f7197d 100644 --- a/tests/data/test95 +++ b/tests/data/test95 @@ -67,14 +67,14 @@ User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -POST /we/want/that/page/%TESTNUMBER HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 27 -Content-Type: application/x-www-form-urlencoded - + +POST /we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 27 +Content-Type: application/x-www-form-urlencoded + datatopost=ohthatsfunyesyes diff --git a/tests/data/test97 b/tests/data/test97 index cc0cf676be51..fffb0be84073 100644 --- a/tests/data/test97 +++ b/tests/data/test97 @@ -36,14 +36,14 @@ HTTP POST with custom content-type # # Verify data after the test has been "shot" - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Type: silly/type -Content-Length: 14 - + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Type: silly/type +Content-Length: 14 + hejsanallabarn diff --git a/tests/data/test970 b/tests/data/test970 index 824f1534104b..562a6c34f5a7 100644 --- a/tests/data/test970 +++ b/tests/data/test970 @@ -51,12 +51,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --write-out '%{json}' -o %LOGDIR/out%TESTNU # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + {"certs":"","conn_id":0,"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out%TESTNUMBER","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"http","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_posttransfer":0.000013,"time_pretransfer":0.000013,"time_queue":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"tls_earlydata":0,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.fragment":null,"url.host":"127.0.0.1","url.options":null,"url.password":null,"url.path":"/%TESTNUMBER","url.port":"%HTTPPORT","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urle.fragment":null,"urle.host":"127.0.0.1","urle.options":null,"urle.password":null,"urle.path":"/%TESTNUMBER","urle.port":"%HTTPPORT","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"} diff --git a/tests/data/test972 b/tests/data/test972 index 45fc2b18ef4d..a0ba77580874 100644 --- a/tests/data/test972 +++ b/tests/data/test972 @@ -52,12 +52,12 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -s --write-out '%{json}\n' -o %LOGDIR/out97 # # Verify data after the test has been "shot" - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + {"certs":"","conn_id":0,"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out%TESTNUMBER","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"http","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_posttransfer":0.000013,"time_pretransfer":0.000013,"time_queue":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"tls_earlydata":0,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.fragment":null,"url.host":"127.0.0.1","url.options":null,"url.password":null,"url.path":"/%TESTNUMBER","url.port":"%HTTPPORT","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urle.fragment":null,"urle.host":"127.0.0.1","urle.options":null,"urle.password":null,"urle.path":"/%TESTNUMBER","urle.port":"%HTTPPORT","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"} diff --git a/tests/data/test977 b/tests/data/test977 index 4f52850a0e8b..352f4a859e56 100644 --- a/tests/data/test977 +++ b/tests/data/test977 @@ -44,13 +44,13 @@ URL with trailing dot and receiving a cookie for the TLD with dot # # Verify data after the test has been "shot" - -GET http://firsthost.me./ HTTP/1.1 -Host: firsthost.me. -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://firsthost.me./ HTTP/1.1 +Host: firsthost.me. +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + # Netscape HTTP Cookie File diff --git a/tests/data/test98 b/tests/data/test98 index ced184b39060..f9ff6dd64ae1 100644 --- a/tests/data/test98 +++ b/tests/data/test98 @@ -39,14 +39,14 @@ data on stdin # # Verify data after the test has been "shot" - -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 14 -Expect: 100-continue - + +PUT /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 14 +Expect: 100-continue + data on stdin diff --git a/tests/data/test985 b/tests/data/test985 index 0b3cd29ff114..816730c7f11a 100644 --- a/tests/data/test985 +++ b/tests/data/test985 @@ -47,8 +47,8 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --ssl-reqd 64 - -CAPA + +CAPA diff --git a/tests/data/test986 b/tests/data/test986 index 0ed30452af09..d83a8962f97f 100644 --- a/tests/data/test986 +++ b/tests/data/test986 @@ -45,9 +45,9 @@ works 64 - -AUTH SSL -AUTH TLS + +AUTH SSL +AUTH TLS diff --git a/tests/runtests.pl b/tests/runtests.pl index d836841a296d..bb881d987d54 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1403,7 +1403,10 @@ sub singletest_check { } } - if($hash{'crlf'}) { + if($hash{'crlf'} eq "headers") { + subnewlines(0, \$_) for @protocol; + } + elsif($hash{'crlf'}) { subnewlines(1, \$_) for @protocol; } diff --git a/tests/testutil.pm b/tests/testutil.pm index 92f031ded343..cc7c2c778aa9 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -165,7 +165,8 @@ sub subnewlines { } if(($$thing =~ /^HTTP\/(1.1|1.0|2|3) [1-5][^\x0d]*\z/) || - ($$thing =~ /^(GET|POST|PUT|DELETE) \S+ HTTP\/\d+(\.\d+)?/) || + ($$thing =~ /^(GET|HEAD|POST|PUT|DELETE|CONNECT) \S+ HTTP\/\d+(\.\d+)?/) || + ($$thing =~ /^(SETUP|GET_PARAMETER|OPTIONS|ANNOUNCE|DESCRIBE) \S+ RTSP\/\d+(\.\d+)?/) || (($$thing =~ /^[a-z0-9_-]+: [^\x0d]*\z/i) && # skip curl error messages ($$thing !~ /^curl: \(\d+\) /))) { From 986ef778332e0faec74fabc92a622ba5f68e8d4b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 2 Nov 2025 04:45:05 +0100 Subject: [PATCH 200/885] runtests: fix Perl warning after recent patch ``` Use of uninitialized value $hash{"crlf"} in string eq at tests/runtests.pl line 1406. ``` Follow-up to 6cf3d7b1b161bc45501d17b401225befe3c43943 #19318 Closes #19327 --- tests/runtests.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index bb881d987d54..5fd9819b1772 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1403,11 +1403,13 @@ sub singletest_check { } } - if($hash{'crlf'} eq "headers") { - subnewlines(0, \$_) for @protocol; - } - elsif($hash{'crlf'}) { - subnewlines(1, \$_) for @protocol; + if($hash{'crlf'}) { + if($hash{'crlf'} eq "headers") { + subnewlines(0, \$_) for @protocol; + } + else { + subnewlines(1, \$_) for @protocol; + } } if((!$out[0] || ($out[0] eq "")) && $protocol[0]) { From 428faf6d479fd8800e38d46535296a212cf322ad Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 2 Nov 2025 17:10:00 +0100 Subject: [PATCH 201/885] GHA/dependabot: fix update group names --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e9126e58d3d8..735fdd107b9a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,7 +11,7 @@ updates: cooldown: default-days: 7 groups: - actions-deps: + gha-dependencies: patterns: - '*' commit-message: @@ -29,7 +29,7 @@ updates: semver-minor-days: 7 semver-patch-days: 3 groups: - actions-deps: + pip-dependencies: patterns: - '*' commit-message: From 7203498c6a07fbe83eb55d4808d2ebd1b68e14c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Nov 2025 14:19:58 +0000 Subject: [PATCH 202/885] GHA: bump the pip-dependencies group across 2 directories with 3 updates Closes #19321 --- .github/scripts/requirements.txt | 2 +- tests/http/requirements.txt | 2 +- tests/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index a0c5c4d4be68..8cb1d11d0af5 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -6,4 +6,4 @@ cmakelang==0.6.13 codespell==2.4.1 pytype==2024.10.11 reuse==6.2.0 -ruff==0.14.1 +ruff==0.14.2 diff --git a/tests/http/requirements.txt b/tests/http/requirements.txt index bc872085c680..a27bf48ea196 100644 --- a/tests/http/requirements.txt +++ b/tests/http/requirements.txt @@ -4,7 +4,7 @@ cryptography==46.0.3 filelock==3.20.0 -psutil==7.1.1 +psutil==7.1.2 pytest==8.4.2 pytest-xdist==3.8.0 websockets==15.0.1 diff --git a/tests/requirements.txt b/tests/requirements.txt index 501c1fc69359..0d08837bd745 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: curl -impacket>=0.11.0,<=0.12.0 +impacket>=0.11.0,<=0.13.0 From 2ffa8307b507a30a7b6f1761f442eb27b2b1ccc9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 2 Nov 2025 17:45:33 +0100 Subject: [PATCH 203/885] GHA/dependabot: tidy-ups --- .github/dependabot.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 735fdd107b9a..c68d6301ef4f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: curl +# https://docs.github.com/code-security/dependabot/working-with-dependabot/dependabot-options-reference + version: 2 updates: - package-ecosystem: 'github-actions' @@ -19,8 +21,8 @@ updates: - package-ecosystem: 'pip' directories: - - '/.github/scripts' - - '/tests' + - '.github/scripts' + - 'tests' schedule: interval: 'monthly' cooldown: From c898da26c6fc107ba090e5af28f066f51ecbc296 Mon Sep 17 00:00:00 2001 From: x2018 Date: Sun, 2 Nov 2025 13:28:34 +0800 Subject: [PATCH 204/885] http_aws_sigv4: check the return value of curl_maprintf() Closes #9328 --- lib/http_aws_sigv4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index f592f3844feb..bb88a0f8ce7b 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -329,6 +329,8 @@ static CURLcode make_headers(struct Curl_easy *data, goto fail; head = tmp_head; *date_header = curl_maprintf("%s: %s\r\n", date_hdr_key, timestamp); + if(!*date_header) + goto fail; } else { const char *value; From 306049583017c6205e7452354169ae0080432f44 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 2 Nov 2025 23:09:54 +0100 Subject: [PATCH 205/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c740a650296f..7f536c16aeab 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3533 + Contributors: 3534 This release includes the following changes: @@ -115,6 +115,7 @@ This release includes the following bugfixes: o docs/libcurl: use lowercase must [5] o docs: expand on quoting rules for file names in SFTP quote [300] o docs: fix/tidy code fences [87] + o doh: cleanup resources on error paths [434] o doswin: CloseHandle the thread on shutdown [307] o easy_getinfo: check magic, Curl_close safety [3] o ECH.md: make OpenSSL branch clone instructions work [430] @@ -171,8 +172,10 @@ This release includes the following bugfixes: o http: make Content-Length parser more WHATWG [183] o http: only accept ';' as a separator for custom headers [407] o http: return error for a second Location: header [393] + o http_aws_sigv4: check the return value of curl_maprintf() [381] o http_proxy: fix adding custom proxy headers [424] o httpsrr: free old pointers when storing new [57] + o httpsrr: send HTTPS query to the right target [435] o imap: fix custom FETCH commands to handle literal responses [441] o imap: parse and use UIDVALIDITY as a number [420] o imap: treat capabilities case insensitively [345] @@ -276,6 +279,7 @@ This release includes the following bugfixes: o openssl: better return code checks when logging cert data [342] o openssl: call SSL_get_error() with proper error [207] o openssl: clear retry flag on x509 error [130] + o openssl: combine all the x509-store flags [451] o openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs [339] o openssl: fail the transfer if ossl_certchain() fails [23] o openssl: fix build for v1.0.2 [225] @@ -317,6 +321,7 @@ This release includes the following bugfixes: o schannel: fix memory leak [363] o schannel: handle Curl_conn_cf_send() errors better [352] o schannel: lower the maximum allowed time to block to 7 seconds [333] + o schannel: properly close the certfile on error [450] o schannel_verify: do not call infof with an appended \n [371] o schannel_verify: fix mem-leak in Curl_verify_host [208] o schannel_verify: use more human friendly error messages [96] @@ -352,6 +357,7 @@ This release includes the following bugfixes: o socks_sspi: restore non-blocking socket on error paths [48] o socks_sspi: use the correct free function [331] o socksd: remove --bindonly mention, there is no such option [305] + o spelling: fix new finds by typos-cli 1.39.0 [454] o src/var: remove dead code [369] o ssl-session-cache: check use on config and availability [448] o ssl-sessions.md: mark option experimental [12] @@ -369,6 +375,7 @@ This release includes the following bugfixes: o telnet: send failure logged but not returned [175] o telnet: use pointer[0] for "unknown" option instead of pointer[i] [217] o test1100: fix missing `` section [432] + o tests/libtest/cli*: fix init/deinit, leaks, and more [455] o tests/server: drop pointless memory allocation overrides [219] o tests/server: drop unsafe open() override in signal handler (Windows) [151] o tftp: check and act on tftp_set_timeouts() returning error [38] @@ -432,6 +439,7 @@ This release includes the following bugfixes: o vquic: sending non-gso packets fix for EAGAIN [265] o vtls: alpn setting, check proto parameter [134] o vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition [387] + o vtls: properly handle SSL shutdown timeout [433] o vtls: remove call to PKCS12_PBE_add() [408] o vtls: unify the error handling in ssl_cf_connect(). [413] o vtls_int.h: clarify data_pending [124] @@ -478,9 +486,9 @@ advice from friends like these: Christian Schmitz, curl.stunt430, Dalei, Dan Fandrich, Daniel Stenberg, Daniel Terhorst-North, dependabot[bot], divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, - Evgeny Grin (Karlson2k), fds242 on github, Harry Sintonen, Howard Chu, - Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, Jicea, - jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, + Evgeny Grin (Karlson2k), fds242 on github, Gunni on github, Harry Sintonen, + Howard Chu, Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, + Jicea, jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, Jonathan Cardoso Machado, Joseph Birr-Pixton, Joshua Rogers, kapsiR on github, kuchara on github, madoe on github, Marc Aldorasi, Marcel Raad, Michael Osipov, Michał Petryka, Mitchell Blank Jr, @@ -490,7 +498,7 @@ advice from friends like these: Tatsuhiro Tsujikawa, TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, Viktor Szakatas, Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 - (68 contributors) + (69 contributors) References to bug reports and discussions on issues: @@ -874,6 +882,7 @@ References to bug reports and discussions on issues: [378] = https://curl.se/bug/?i=19169 [379] = https://curl.se/bug/?i=19163 [380] = https://curl.se/bug/?i=19168 + [381] = https://curl.se/bug/?i=9328 [382] = https://curl.se/bug/?i=19170 [383] = https://curl.se/bug/?i=19226 [384] = https://curl.se/bug/?i=19225 @@ -922,6 +931,9 @@ References to bug reports and discussions on issues: [429] = https://curl.se/bug/?i=19167 [430] = https://curl.se/bug/?i=19237 [432] = https://curl.se/bug/?i=19288 + [433] = https://curl.se/bug/?i=19323 + [434] = https://curl.se/bug/?i=19310 + [435] = https://curl.se/bug/?i=19301 [438] = https://curl.se/bug/?i=19271 [439] = https://curl.se/bug/?i=19278 [441] = https://curl.se/bug/?i=18847 @@ -931,3 +943,7 @@ References to bug reports and discussions on issues: [445] = https://curl.se/bug/?i=19240 [448] = https://curl.se/bug/?i=18983 [449] = https://curl.se/bug/?i=19148 + [450] = https://curl.se/bug/?i=19304 + [451] = https://curl.se/bug/?i=19306 + [454] = https://curl.se/bug/?i=19312 + [455] = https://curl.se/bug/?i=19309 From c1e3a760ba082762041a999bc98f21ea295d7cf4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Nov 2025 08:05:35 +0100 Subject: [PATCH 206/885] imap: avoid integer overflow Follow-up to e64c28e243d797da4ef76d6e8959 Spotted by OSS-Fuzz Closes #19332 --- lib/imap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index 1902619a6ffa..d23076a48f85 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1265,15 +1265,22 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data, pp->overflow = 0; } - if(data->req.bytecount == size + (curl_off_t)len) + if((CURL_OFF_T_MAX - size) < (curl_off_t)len) + /* unlikely to actually be a transfer this big, but avoid integer + overflow */ + size = CURL_OFF_T_MAX; + else + size += len; + + if(data->req.bytecount == size) /* All data already transferred (header + literal body) */ Curl_xfer_setup_nop(data); else { /* Setup to receive the literal body data. maxdownload and transfer size include both header line and literal body */ - data->req.maxdownload = size + len; - Curl_xfer_setup_recv(data, FIRSTSOCKET, size + len); + data->req.maxdownload = size; + Curl_xfer_setup_recv(data, FIRSTSOCKET, size); } /* End of DO phase */ imap_state(data, imapc, IMAP_STOP); From aaf9522a2c28e5142c7f5640da4e24b65b47dc53 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 2 Nov 2025 16:00:24 +0100 Subject: [PATCH 207/885] test696: decouple from test556 data Test 696 and 556 share the same libtest code. Make sure to issue the `GET` request to the correct runtime test number instead of using the hard-wired "556". It makes the `sws` test server read the response string from `test696` `` section, instead of reading it from `test556`. To avoid this hidden interaction between test data. AFAICS there is no other similar hard-coded string in reused libtests. Ref: https://github.com/curl/curl/pull/19313#issuecomment-3477448933 Follow-up to be82a3605a4b539580b3de776ffcca25b8770e43 #16003 Closes #19329 --- tests/data/test696 | 4 ++-- tests/libtest/lib556.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/data/test696 b/tests/data/test696 index 8862b163f23e..c0c316111dad 100644 --- a/tests/data/test696 +++ b/tests/data/test696 @@ -55,10 +55,10 @@ Connection: close -foo- -GET /556 HTTP/1.1 +GET /%TESTNUMBER HTTP/1.1 Host: ninja -GET /556 HTTP/1.1 +GET /%TESTNUMBER HTTP/1.1 Host: ninja diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index 8239d2603480..78b89975e8ac 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -53,13 +53,15 @@ static CURLcode test_lib556(const char *URL) if(!res) { /* we are connected, now get an HTTP document the raw way */ - static const char *request = - "GET /556 HTTP/1.1\r\n" - "Host: ninja\r\n\r\n"; + char request[64]; const char *sbuf = request; - size_t sblen = strlen(request); + size_t sblen; size_t nwritten = 0, nread = 0; + sblen = curl_msnprintf(request, sizeof(request), + "GET /%d HTTP/1.1\r\n" + "Host: ninja\r\n\r\n", testnum); + do { char buf[1024]; From 254e04b702e96b637b647241e4edea7ee4c24b70 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 2 Nov 2025 23:25:27 +0100 Subject: [PATCH 208/885] ftpserver.pl: fix newlines in 227/229 replies, adjust tests The test FTP server returned LF newlines for 227/229 replies, instead of the CRLF used for the rest. Test data added later were explicitly made to expect an LF in these response lines. After this patch the FTP server returns CRLF newlines, allowing to delete this special case in test data. Follow-up to 3bfff57e1f604ef0b2bc84243014eb9c9a1e6acc Follow-up to a7937ed49c8f201444323b8a721e1d04e0306105 Closes #19330 --- tests/data/test1349 | 2 +- tests/data/test1350 | 2 +- tests/data/test1351 | 2 +- tests/data/test1352 | 2 +- tests/data/test1353 | 2 +- tests/data/test1354 | 2 +- tests/data/test1357 | 2 +- tests/data/test1358 | 2 +- tests/data/test1359 | 2 +- tests/data/test1360 | 2 +- tests/data/test1361 | 2 +- tests/data/test1362 | 2 +- tests/data/test1379 | 2 +- tests/data/test1380 | 2 +- tests/data/test1381 | 2 +- tests/data/test1382 | 2 +- tests/data/test1383 | 2 +- tests/data/test1384 | 2 +- tests/data/test1387 | 2 +- tests/data/test1388 | 2 +- tests/data/test1389 | 2 +- tests/data/test1390 | 2 +- tests/data/test1391 | 2 +- tests/data/test1392 | 2 +- tests/ftpserver.pl | 4 ++-- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/data/test1349 b/tests/data/test1349 index 63c06e2983df..9c74aed958df 100644 --- a/tests/data/test1349 +++ b/tests/data/test1349 @@ -58,7 +58,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1350 b/tests/data/test1350 index 5d7a36539419..fcf78744b305 100644 --- a/tests/data/test1350 +++ b/tests/data/test1350 @@ -58,7 +58,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1351 b/tests/data/test1351 index d05f9b026c38..c1ed52d4a542 100644 --- a/tests/data/test1351 +++ b/tests/data/test1351 @@ -59,7 +59,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1352 b/tests/data/test1352 index db093ab72b7d..c54ca4a217d0 100644 --- a/tests/data/test1352 +++ b/tests/data/test1352 @@ -59,7 +59,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1353 b/tests/data/test1353 index 45308f1cf150..2b6af8cf0151 100644 --- a/tests/data/test1353 +++ b/tests/data/test1353 @@ -58,7 +58,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1354 b/tests/data/test1354 index dfba8ba3a5ac..3bf6ddde1650 100644 --- a/tests/data/test1354 +++ b/tests/data/test1354 @@ -56,7 +56,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1357 b/tests/data/test1357 index 25ce6b24b763..7e83e87feb18 100644 --- a/tests/data/test1357 +++ b/tests/data/test1357 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 214 150 Binary data connection for %TESTNUMBER () (214 bytes). diff --git a/tests/data/test1358 b/tests/data/test1358 index c5e3ce80fb1c..3eb623cb6b6c 100644 --- a/tests/data/test1358 +++ b/tests/data/test1358 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 214 150 Binary data connection for %TESTNUMBER () (214 bytes). diff --git a/tests/data/test1359 b/tests/data/test1359 index e7d005860073..98765b285d0e 100644 --- a/tests/data/test1359 +++ b/tests/data/test1359 @@ -72,7 +72,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 214 150 Binary data connection for %TESTNUMBER () (214 bytes). diff --git a/tests/data/test1360 b/tests/data/test1360 index 794ba6453671..117ef84b375e 100644 --- a/tests/data/test1360 +++ b/tests/data/test1360 @@ -72,7 +72,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 214 150 Binary data connection for %TESTNUMBER () (214 bytes). diff --git a/tests/data/test1361 b/tests/data/test1361 index 13138941d703..9215c23ca293 100644 --- a/tests/data/test1361 +++ b/tests/data/test1361 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 214 150 Binary data connection for %TESTNUMBER () (214 bytes). diff --git a/tests/data/test1362 b/tests/data/test1362 index 1ffa1a2e9aad..9ad0fa742416 100644 --- a/tests/data/test1362 +++ b/tests/data/test1362 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 214 150 Binary data connection for %TESTNUMBER () (214 bytes). diff --git a/tests/data/test1379 b/tests/data/test1379 index 5faf44ac1bb3..953c9b6cd8c7 100644 --- a/tests/data/test1379 +++ b/tests/data/test1379 @@ -56,7 +56,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1380 b/tests/data/test1380 index 02db86ac271f..b106b3c7fcb5 100644 --- a/tests/data/test1380 +++ b/tests/data/test1380 @@ -56,7 +56,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1381 b/tests/data/test1381 index 4ae53c38cb35..7d4ef7ba333c 100644 --- a/tests/data/test1381 +++ b/tests/data/test1381 @@ -57,7 +57,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1382 b/tests/data/test1382 index bce914faa682..7c4cc6e290d7 100644 --- a/tests/data/test1382 +++ b/tests/data/test1382 @@ -57,7 +57,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1383 b/tests/data/test1383 index 23a9ec55bae8..c8b1d119b978 100644 --- a/tests/data/test1383 +++ b/tests/data/test1383 @@ -56,7 +56,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1384 b/tests/data/test1384 index 459a4e0236b1..3f99d28bfe6a 100644 --- a/tests/data/test1384 +++ b/tests/data/test1384 @@ -56,7 +56,7 @@ mooo 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 10 150 Binary data connection for %TESTNUMBER () (10 bytes). diff --git a/tests/data/test1387 b/tests/data/test1387 index 44b7d8aea2c5..a5531aa20146 100644 --- a/tests/data/test1387 +++ b/tests/data/test1387 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 222 150 Binary data connection for %TESTNUMBER () (222 bytes). diff --git a/tests/data/test1388 b/tests/data/test1388 index 6bb799727956..8630be7877b5 100644 --- a/tests/data/test1388 +++ b/tests/data/test1388 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 222 150 Binary data connection for %TESTNUMBER () (222 bytes). diff --git a/tests/data/test1389 b/tests/data/test1389 index 5c6979bd3195..53fda6cd590e 100644 --- a/tests/data/test1389 +++ b/tests/data/test1389 @@ -72,7 +72,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 222 150 Binary data connection for %TESTNUMBER () (222 bytes). diff --git a/tests/data/test1390 b/tests/data/test1390 index e263fef96966..b86e099d7592 100644 --- a/tests/data/test1390 +++ b/tests/data/test1390 @@ -72,7 +72,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 222 150 Binary data connection for %TESTNUMBER () (222 bytes). diff --git a/tests/data/test1391 b/tests/data/test1391 index 063294b8e7b6..d9350b86773c 100644 --- a/tests/data/test1391 +++ b/tests/data/test1391 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 222 150 Binary data connection for %TESTNUMBER () (222 bytes). diff --git a/tests/data/test1392 b/tests/data/test1392 index 824cc214c2d9..572841e5b5b9 100644 --- a/tests/data/test1392 +++ b/tests/data/test1392 @@ -71,7 +71,7 @@ MOOOO 230 Welcome you silly person 257 "/" is current directory 250 CWD command successful. -229 Entering Passive Mode (stripped) +229 Entering Passive Mode (stripped) 200 I modify TYPE as you wanted 213 222 150 Binary data connection for %TESTNUMBER () (222 bytes). diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 71d6774fd1ea..f70fa0d0ee7e 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -2566,12 +2566,12 @@ sub PASV_ftp { if($pasvbadip) { $p="1,2,3,4"; } - sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\n", + sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\r\n", int($pasvport/256), int($pasvport%256)); } else { # EPSV reply - sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\n", $pasvport); + sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\r\n", $pasvport); } logmsg "Client has been notified that DATA conn ". From 1021c52c9288877ba911eca4c795703db0b6291d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 3 Nov 2025 15:24:27 +0100 Subject: [PATCH 209/885] REUSE: add copyright header to two files `.mailmap` supports comments and empty lines since at least 2.31.0: https://git-scm.com/docs/gitmailmap/2.31.0 Closes #19339 --- .mailmap | 4 ++++ GIT-INFO.md | 5 +++++ REUSE.toml | 2 -- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index e89e3860561e..d04408efa2ea 100644 --- a/.mailmap +++ b/.mailmap @@ -1,3 +1,7 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + Guenter Knauf Gisle Vanem Gisle Vanem diff --git a/GIT-INFO.md b/GIT-INFO.md index 1ff22010cbda..ee912560fd5a 100644 --- a/GIT-INFO.md +++ b/GIT-INFO.md @@ -1,3 +1,8 @@ + _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | diff --git a/REUSE.toml b/REUSE.toml index 40531913af3b..fff538016477 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -13,7 +13,6 @@ SPDX-PackageDownloadLocation = "https://curl.se/" [[annotations]] path = [ - ".mailmap", "docs/FAQ", "docs/INSTALL", "docs/KNOWN_BUGS", @@ -22,7 +21,6 @@ path = [ "docs/options-in-versions", "docs/THANKS", "docs/TODO", - "GIT-INFO.md", "lib/libcurl.vers.in", "lib/libcurl.def", "packages/OS400/README.OS400", From 7e91f24c73256af59ac9061c41b73a184c4690aa Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 3 Nov 2025 15:07:57 +0100 Subject: [PATCH 210/885] cw-out: fix EAGAIN handling on pause The interim CURLE_AGAIN result was not always converted to a CURLE_OK and then caused write callers to report a failure. Fixes #19334 Reported-by: pennae on github Closes #19338 --- lib/cw-out.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cw-out.c b/lib/cw-out.c index 1f4031649267..9c0a36e7e5e2 100644 --- a/lib/cw-out.c +++ b/lib/cw-out.c @@ -302,6 +302,7 @@ static CURLcode cw_out_buf_flush(struct cw_out_ctx *ctx, &consumed); if(result && (result != CURLE_AGAIN)) return result; + result = CURLE_OK; if(consumed) { if(consumed == curlx_dyn_len(&cwbuf->b)) { From cccc65f05190adc8276d6f7a8071c8a45ca7f779 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 3 Nov 2025 16:01:56 +0100 Subject: [PATCH 211/885] openssl: check CURL_SSLVERSION_MAX_DEFAULT properly The definition of these constants does not give a numeric ordering and MAX_DEFAULT needs to be checked in addition of ciphers and QUIC checks to apply correctly. Fixes #19340 Reported-by: Peter Piekarski Closes #19341 --- lib/vtls/openssl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index c8c33198c04f..f1c9e8bbd633 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4050,6 +4050,7 @@ static CURLcode ossl_init_method(struct Curl_cfilter *cf, case TRNSPRT_QUIC: *pssl_version_min = CURL_SSLVERSION_TLSv1_3; if(conn_config->version_max && + (conn_config->version_max != CURL_SSLVERSION_MAX_DEFAULT) && (conn_config->version_max != CURL_SSLVERSION_MAX_TLSv1_3)) { failf(data, "QUIC needs at least TLS version 1.3"); return CURLE_SSL_CONNECT_ERROR; @@ -4245,6 +4246,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, const char *ciphers13 = conn_config->cipher_list13; if(ciphers13 && (!conn_config->version_max || + (conn_config->version_max == CURL_SSLVERSION_MAX_DEFAULT) || (conn_config->version_max >= CURL_SSLVERSION_MAX_TLSv1_3))) { if(!SSL_CTX_set_ciphersuites(octx->ssl_ctx, ciphers13)) { failf(data, "failed setting TLS 1.3 cipher suite: %s", ciphers13); From 8616e5aada9c78fb611c60d913c999c8e78c14ba Mon Sep 17 00:00:00 2001 From: Devdatta Talele Date: Mon, 20 Oct 2025 20:51:43 +0530 Subject: [PATCH 212/885] gssapi: make channel binding conditional on GSS_C_CHANNEL_BOUND_FLAG Fixes #19109 - GSSAPI authentication fails on macOS with Apple's Heimdal implementation which lacks GSS_C_CHANNEL_BOUND_FLAG support for TLS channel binding. Commit 0a5ea09a910e introduced TLS channel binding for SPNEGO/GSSAPI authentication unconditionally, but Apple's Heimdal fork (used on macOS) does not support this feature, causing "unsupported mechanism" errors when authenticating to corporate HTTP services with Kerberos. Solution: - Add CURL_GSSAPI_HAS_CHANNEL_BINDING detection in curl_gssapi.h based on GSS_C_CHANNEL_BOUND_FLAG presence (MIT Kerberos >= 1.19) - Make negotiatedata.channel_binding_data field conditional in vauth.h - Guard channel binding collection/cleanup in http_negotiate.c - Guard channel binding usage in spnego_gssapi.c This follows the same pattern as GSS_C_DELEG_POLICY_FLAG detection and ensures graceful degradation when channel binding is unavailable while maintaining full support for implementations that have it. Changes: - lib/curl_gssapi.h: Add feature detection macro - lib/vauth/vauth.h: Make struct field conditional - lib/http_negotiate.c: Conditional init/cleanup (2 locations) - lib/vauth/spnego_gssapi.c: Conditional channel binding usage Tested on macOS with Apple Heimdal (no channel binding) and Linux with MIT Kerberos (with channel binding). Both configurations authenticate successfully without errors. Closes #19164 --- lib/curl_gssapi.h | 5 +++++ lib/http_negotiate.c | 6 +++--- lib/vauth/spnego_gssapi.c | 4 ++++ lib/vauth/vauth.h | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/curl_gssapi.h b/lib/curl_gssapi.h index 6df7e059d325..1a2bbabdf516 100644 --- a/lib/curl_gssapi.h +++ b/lib/curl_gssapi.h @@ -28,6 +28,11 @@ #include "urldata.h" #ifdef HAVE_GSSAPI + +#ifdef GSS_C_CHANNEL_BOUND_FLAG /* MIT Kerberos 1.19+, missing from GNU GSS */ +#define CURL_GSSAPI_HAS_CHANNEL_BINDING +#endif + extern gss_OID_desc Curl_spnego_mech_oid; extern gss_OID_desc Curl_krb5_mech_oid; diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index 8a19c1ad8738..136cb07641c4 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -124,7 +124,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, neg_ctx->sslContext = conn->sslContext; #endif /* Check if the connection is using SSL and get the channel binding data */ -#ifdef HAVE_GSSAPI +#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING #ifdef USE_SSL curlx_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1); if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) { @@ -138,13 +138,13 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, #else curlx_dyn_init(&neg_ctx->channel_binding_data, 1); #endif /* USE_SSL */ -#endif /* HAVE_GSSAPI */ +#endif /* CURL_GSSAPI_HAS_CHANNEL_BINDING */ /* Initialize the security context and decode our challenge */ result = Curl_auth_decode_spnego_message(data, userp, passwdp, service, host, header, neg_ctx); -#ifdef HAVE_GSSAPI +#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING curlx_dyn_free(&neg_ctx->channel_binding_data); #endif diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index 4ed02a398ca3..4e9125ba4400 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -96,7 +96,9 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; gss_channel_bindings_t chan_bindings = GSS_C_NO_CHANNEL_BINDINGS; +#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING struct gss_channel_bindings_struct chan; +#endif (void)user; (void)password; @@ -157,12 +159,14 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, } /* Set channel binding data if available */ +#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING if(curlx_dyn_len(&nego->channel_binding_data)) { memset(&chan, 0, sizeof(struct gss_channel_bindings_struct)); chan.application_data.length = curlx_dyn_len(&nego->channel_binding_data); chan.application_data.value = curlx_dyn_ptr(&nego->channel_binding_data); chan_bindings = &chan; } +#endif /* Generate our challenge-response message */ major_status = Curl_gss_init_sec_context(data, diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h index 9a33ca0c2317..2ba8e471dc00 100644 --- a/lib/vauth/vauth.h +++ b/lib/vauth/vauth.h @@ -306,7 +306,9 @@ struct negotiatedata { gss_ctx_id_t context; gss_name_t spn; gss_buffer_desc output_token; +#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING struct dynbuf channel_binding_data; +#endif #else #ifdef USE_WINDOWS_SSPI #ifdef SECPKG_ATTR_ENDPOINT_BINDINGS From 0d5e24281dc7b49c396fda0d61126a05916fdda1 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sat, 25 Oct 2025 03:49:58 +0800 Subject: [PATCH 213/885] vtls: check final cfilter node in find_ssl_filter find_ssl_filter used while(cf && cf->next) and skipped the last node. If the SSL filter was last, channel binding lookup failed and we returned CURLE_BAD_FUNCTION_ARGUMENT. Switch to while(cf) so the tail is examined. This bug was found with ZeroPath. Closes #19229 --- lib/vtls/openssl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f1c9e8bbd633..764d82932553 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5684,10 +5684,8 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex, break; } - if(cf->next) - cf = cf->next; - - } while(cf->next); + cf = cf->next; + } while(cf); if(!octx) { failf(data, "Failed to find the SSL filter"); From 231f0a2eecedd3cdb04463fb95754ebdfb0c8cb1 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 4 Nov 2025 00:47:36 +0800 Subject: [PATCH 214/885] http: check the return value of strdup Closes #19343 --- lib/http.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index 16d619951fb0..529c3c907d60 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4039,9 +4039,13 @@ static CURLcode http_on_response(struct Curl_easy *data, goto out; } data->state.disableexpect = TRUE; + Curl_req_abort_sending(data); DEBUGASSERT(!data->req.newurl); data->req.newurl = strdup(data->state.url); - Curl_req_abort_sending(data); + if(!data->req.newurl) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } } else if(data->set.http_keep_sending_on_error) { infof(data, "HTTP error before end of send, keep sending"); From 6adefe8ad08606c94d2bcb27eceface8aa556519 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 4 Nov 2025 01:12:42 +0800 Subject: [PATCH 215/885] multi: check the return value of strdup() Closes #19344 --- lib/multi.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/multi.c b/lib/multi.c index ca7c1bdd9542..c27e8bdad8b3 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1990,11 +1990,16 @@ static CURLMcode state_performing(struct Curl_easy *data, if(!newurl) /* typically for HTTP_1_1_REQUIRED error on first flight */ newurl = strdup(data->state.url); - /* if we are to retry, set the result to OK and consider the request - as done */ - retry = TRUE; - result = CURLE_OK; - data->req.done = TRUE; + if(!newurl) { + result = CURLE_OUT_OF_MEMORY; + } + else { + /* if we are to retry, set the result to OK and consider the request + as done */ + retry = TRUE; + result = CURLE_OK; + data->req.done = TRUE; + } } else result = ret; From 63e9721b63d01518db83a664bc1e8373c352879e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2025 15:50:01 +0100 Subject: [PATCH 216/885] tests: avoid hard-coded CRLFs in more sections - `reply/data*`, `verify/stdout`, `verify/stderr`, `verify/file*`, `verify/proxy`: - make `crlf="yes"` force CRLF to all lines, instead of just applying to HTTP protocol headers. - add support for `crlf="headers"` that only converts HTTP protocol header lines to CRLF. (previously done via `crlf="yes"`.) - use `crlf="headers"` where possible. - `reply/connect*`: - add support for `crlf="yes"` and `crlf="headers"`. - use them where possible. - `client/file*`, `client/stdin`: - add support for `crlf="yes"`. - use it where possible. - `reply/data*`, `verify/protocol`: - replace existing uses of `crlf="yes"` with `crlf="headers`" where it does not change the result. Reducing the number of `tests/data/test*`: - CRLF newlines from 10295 to 1985. (119985 lines total) - files with mixed newlines from 656 to 113. (1890 files total) After this patch there remain 141 sections with mixed newlines, where the mixing is not split between headers/non-headers. There is no obvious pattern here. Some of the CRLF uses might be accidental, or non-significant. They will be tackled in a future patch. Follow-up to 6cf3d7b1b161bc45501d17b401225befe3c43943 #19318 Follow-up to 4d2a05d3fe8ba4db9168b03057029ea5ce7dab77 #19284 Closes #19313 --- docs/tests/FILEFORMAT.md | 59 +++++-- tests/data/test1 | 4 +- tests/data/test1001 | 70 ++++----- tests/data/test1002 | 70 ++++----- tests/data/test1004 | 2 +- tests/data/test1008 | 32 ++-- tests/data/test1011 | 46 +++--- tests/data/test1012 | 46 +++--- tests/data/test1015 | 10 +- tests/data/test1021 | 34 ++-- tests/data/test1024 | 86 +++++------ tests/data/test1025 | 86 +++++------ tests/data/test1028 | 40 ++--- tests/data/test1029 | 26 ++-- tests/data/test1030 | 62 ++++---- tests/data/test1031 | 2 +- tests/data/test1032 | 2 +- tests/data/test1033 | 2 +- tests/data/test1040 | 12 +- tests/data/test1041 | 18 +-- tests/data/test1042 | 14 +- tests/data/test1043 | 18 +-- tests/data/test1044 | 8 +- tests/data/test1045 | 18 +-- tests/data/test1046 | 18 +-- tests/data/test1051 | 62 ++++---- tests/data/test1052 | 54 +++---- tests/data/test1053 | 58 +++---- tests/data/test1054 | 42 ++--- tests/data/test1055 | 18 +-- tests/data/test1056 | 44 +++--- tests/data/test1058 | 20 +-- tests/data/test1059 | 14 +- tests/data/test1060 | 14 +- tests/data/test1061 | 2 +- tests/data/test1064 | 46 +++--- tests/data/test1065 | 46 +++--- tests/data/test1066 | 26 ++-- tests/data/test1067 | 2 +- tests/data/test1068 | 10 +- tests/data/test1070 | 14 +- tests/data/test1071 | 66 ++++---- tests/data/test1072 | 20 +-- tests/data/test1073 | 16 +- tests/data/test1074 | 44 +++--- tests/data/test1075 | 52 +++---- tests/data/test1077 | 38 ++--- tests/data/test1078 | 80 +++++----- tests/data/test1079 | 30 ++-- tests/data/test1080 | 36 ++--- tests/data/test1081 | 48 +++--- tests/data/test1082 | 18 +-- tests/data/test1083 | 18 +-- tests/data/test1087 | 94 +++++------ tests/data/test1088 | 94 +++++------ tests/data/test1089 | 60 +++---- tests/data/test1090 | 72 ++++----- tests/data/test1092 | 2 +- tests/data/test1094 | 10 +- tests/data/test1095 | 52 +++---- tests/data/test1097 | 34 ++-- tests/data/test1098 | 30 ++-- tests/data/test11 | 2 +- tests/data/test1100 | 68 ++++---- tests/data/test1101 | 16 +- tests/data/test1104 | 2 +- tests/data/test1105 | 26 ++-- tests/data/test1106 | 16 +- tests/data/test1109 | 2 +- tests/data/test1110 | 2 +- tests/data/test1111 | 2 +- tests/data/test1115 | 24 +-- tests/data/test1116 | 66 ++++---- tests/data/test1117 | 56 +++---- tests/data/test1118 | 2 +- tests/data/test1121 | 14 +- tests/data/test1122 | 38 ++--- tests/data/test1123 | 2 +- tests/data/test1124 | 42 ++--- tests/data/test1125 | 42 ++--- tests/data/test1126 | 2 +- tests/data/test1127 | 2 +- tests/data/test1128 | 2 +- tests/data/test1129 | 2 +- tests/data/test1130 | 2 +- tests/data/test1131 | 2 +- tests/data/test1133 | 12 +- tests/data/test1138 | 8 +- tests/data/test1141 | 2 +- tests/data/test1142 | 2 +- tests/data/test1143 | 2 +- tests/data/test1144 | 2 +- tests/data/test1148 | 2 +- tests/data/test1150 | 2 +- tests/data/test1151 | 2 +- tests/data/test1154 | 2 +- tests/data/test1155 | 14 +- tests/data/test1156 | 44 +++--- tests/data/test1157 | 2 +- tests/data/test1158 | 12 +- tests/data/test1159 | 26 ++-- tests/data/test1160 | 14 +- tests/data/test1161 | 14 +- tests/data/test1164 | 2 +- tests/data/test1166 | 16 +- tests/data/test1168 | 2 +- tests/data/test1170 | 42 ++--- tests/data/test1171 | 42 ++--- tests/data/test1172 | 2 +- tests/data/test1174 | 2 +- tests/data/test1176 | 50 +++--- tests/data/test1178 | 2 +- tests/data/test1180 | 2 +- tests/data/test1181 | 14 +- tests/data/test1183 | 14 +- tests/data/test1184 | 98 ++++++------ tests/data/test1186 | 12 +- tests/data/test1187 | 10 +- tests/data/test1188 | 12 +- tests/data/test1189 | 12 +- tests/data/test1197 | 58 +++---- tests/data/test12 | 26 ++-- tests/data/test1200 | 8 +- tests/data/test1201 | 8 +- tests/data/test1202 | 10 +- tests/data/test1203 | 8 +- tests/data/test1204 | 52 +++---- tests/data/test1205 | 2 +- tests/data/test1210 | 2 +- tests/data/test1212 | 2 +- tests/data/test1213 | 18 +-- tests/data/test1214 | 18 +-- tests/data/test1215 | 2 +- tests/data/test1216 | 8 +- tests/data/test1218 | 8 +- tests/data/test1221 | 10 +- tests/data/test1223 | 2 +- tests/data/test1228 | 2 +- tests/data/test1229 | 52 +++---- tests/data/test1230 | 36 ++--- tests/data/test1231 | 2 +- tests/data/test1232 | 2 +- tests/data/test1235 | 56 +++---- tests/data/test1237 | 2 +- tests/data/test1239 | 2 +- tests/data/test1240 | 2 +- tests/data/test1241 | 2 +- tests/data/test1244 | 2 +- tests/data/test1245 | 18 +-- tests/data/test1246 | 2 +- tests/data/test1248 | 2 +- tests/data/test1249 | 2 +- tests/data/test1250 | 2 +- tests/data/test1251 | 2 +- tests/data/test1252 | 2 +- tests/data/test1253 | 2 +- tests/data/test1254 | 2 +- tests/data/test1255 | 2 +- tests/data/test1256 | 2 +- tests/data/test1257 | 2 +- tests/data/test1258 | 14 +- tests/data/test1259 | 14 +- tests/data/test1261 | 26 ++-- tests/data/test1265 | 2 +- tests/data/test1266 | 2 +- tests/data/test1267 | 2 +- tests/data/test1270 | 50 +++--- tests/data/test1271 | 12 +- tests/data/test1273 | 12 +- tests/data/test1274 | 26 ++-- tests/data/test1277 | 2 +- tests/data/test1278 | 2 +- tests/data/test1280 | 14 +- tests/data/test1283 | 26 ++-- tests/data/test1284 | 50 +++--- tests/data/test1285 | 50 +++--- tests/data/test1286 | 78 +++++----- tests/data/test1287 | 64 ++++---- tests/data/test1288 | 40 ++--- tests/data/test129 | 2 +- tests/data/test1290 | 2 +- tests/data/test1296 | 2 +- tests/data/test1297 | 22 +-- tests/data/test1298 | 2 +- tests/data/test13 | 12 +- tests/data/test1310 | 2 +- tests/data/test1311 | 2 +- tests/data/test1312 | 2 +- tests/data/test1313 | 2 +- tests/data/test1314 | 2 +- tests/data/test1316 | 8 +- tests/data/test1317 | 2 +- tests/data/test1318 | 2 +- tests/data/test1319 | 20 +-- tests/data/test1320 | 30 ++-- tests/data/test1321 | 52 +++---- tests/data/test1322 | 2 +- tests/data/test1324 | 2 +- tests/data/test1325 | 46 +++--- tests/data/test1326 | 8 +- tests/data/test1327 | 14 +- tests/data/test1328 | 2 +- tests/data/test1331 | 56 +++---- tests/data/test1334 | 34 ++-- tests/data/test1335 | 34 ++-- tests/data/test1336 | 38 ++--- tests/data/test1337 | 38 ++--- tests/data/test1338 | 34 ++-- tests/data/test1339 | 34 ++-- tests/data/test1340 | 38 ++--- tests/data/test1341 | 38 ++--- tests/data/test1342 | 50 +++--- tests/data/test1343 | 50 +++--- tests/data/test1344 | 56 +++---- tests/data/test1345 | 56 +++---- tests/data/test1346 | 34 ++-- tests/data/test1347 | 38 ++--- tests/data/test1349 | 30 ++-- tests/data/test1350 | 30 ++-- tests/data/test1351 | 30 ++-- tests/data/test1352 | 30 ++-- tests/data/test1353 | 30 ++-- tests/data/test1354 | 30 ++-- tests/data/test1356 | 36 ++--- tests/data/test1357 | 30 ++-- tests/data/test1358 | 30 ++-- tests/data/test1359 | 30 ++-- tests/data/test1360 | 30 ++-- tests/data/test1361 | 30 ++-- tests/data/test1362 | 30 ++-- tests/data/test1363 | 36 ++--- tests/data/test1364 | 34 ++-- tests/data/test1365 | 34 ++-- tests/data/test1366 | 38 ++--- tests/data/test1367 | 38 ++--- tests/data/test1368 | 34 ++-- tests/data/test1369 | 34 ++-- tests/data/test1370 | 38 ++--- tests/data/test1371 | 38 ++--- tests/data/test1372 | 50 +++--- tests/data/test1373 | 50 +++--- tests/data/test1374 | 56 +++---- tests/data/test1375 | 38 ++--- tests/data/test1376 | 18 +-- tests/data/test1377 | 20 +-- tests/data/test1379 | 30 ++-- tests/data/test1380 | 30 ++-- tests/data/test1381 | 30 ++-- tests/data/test1382 | 30 ++-- tests/data/test1383 | 30 ++-- tests/data/test1384 | 30 ++-- tests/data/test1386 | 36 ++--- tests/data/test1387 | 66 ++++---- tests/data/test1388 | 66 ++++---- tests/data/test1389 | 68 ++++---- tests/data/test1390 | 66 ++++---- tests/data/test1391 | 66 ++++---- tests/data/test1392 | 66 ++++---- tests/data/test1393 | 36 ++--- tests/data/test14 | 2 +- tests/data/test1400 | 2 +- tests/data/test1401 | 2 +- tests/data/test1403 | 2 +- tests/data/test1406 | 12 +- tests/data/test1407 | 2 +- tests/data/test1408 | 2 +- tests/data/test141 | 8 +- tests/data/test1411 | 2 +- tests/data/test1412 | 96 ++++++------ tests/data/test1413 | 48 +++--- tests/data/test1415 | 2 +- tests/data/test1416 | 2 +- tests/data/test1417 | 18 +-- tests/data/test1418 | 76 ++++----- tests/data/test1419 | 26 ++-- tests/data/test1420 | 18 +-- tests/data/test1422 | 20 +-- tests/data/test1423 | 18 +-- tests/data/test1424 | 2 +- tests/data/test1425 | 2 +- tests/data/test1426 | 2 +- tests/data/test1428 | 22 +-- tests/data/test1429 | 26 ++-- tests/data/test1430 | 2 +- tests/data/test1431 | 2 +- tests/data/test1432 | 2 +- tests/data/test1433 | 2 +- tests/data/test1434 | 2 +- tests/data/test1435 | 2 +- tests/data/test1436 | 2 +- tests/data/test1437 | 52 +++---- tests/data/test1438 | 2 +- tests/data/test1439 | 2 +- tests/data/test1443 | 2 +- tests/data/test1448 | 2 +- tests/data/test1457 | 2 +- tests/data/test1458 | 2 +- tests/data/test1466 | 2 +- tests/data/test1467 | 2 +- tests/data/test1468 | 2 +- tests/data/test1470 | 2 +- tests/data/test1473 | 18 +-- tests/data/test1475 | 2 +- tests/data/test1476 | 4 +- tests/data/test1479 | 18 +-- tests/data/test1480 | 16 +- tests/data/test1481 | 2 +- tests/data/test1482 | 18 +-- tests/data/test1483 | 20 +-- tests/data/test1484 | 22 +-- tests/data/test1485 | 22 +-- tests/data/test1487 | 2 +- tests/data/test1489 | 6 +- tests/data/test1492 | 2 +- tests/data/test1493 | 18 +-- tests/data/test1494 | 4 +- tests/data/test1495 | 4 +- tests/data/test1496 | 4 +- tests/data/test1497 | 2 +- tests/data/test1498 | 10 +- tests/data/test1499 | 2 +- tests/data/test15 | 30 ++-- tests/data/test150 | 52 +++---- tests/data/test1500 | 16 +- tests/data/test1502 | 26 ++-- tests/data/test1503 | 26 ++-- tests/data/test1504 | 26 ++-- tests/data/test1505 | 26 ++-- tests/data/test1506 | 10 +- tests/data/test1509 | 52 +++---- tests/data/test151 | 2 +- tests/data/test1510 | 50 +++--- tests/data/test1511 | 52 +++---- tests/data/test1512 | 50 +++--- tests/data/test1513 | 6 +- tests/data/test1514 | 12 +- tests/data/test1517 | 2 +- tests/data/test152 | 2 +- tests/data/test1520 | 22 +-- tests/data/test1525 | 18 +-- tests/data/test1526 | 54 +++---- tests/data/test1527 | 56 +++---- tests/data/test1528 | 40 ++--- tests/data/test1529 | 8 +- tests/data/test153 | 126 +++++++-------- tests/data/test1532 | 10 +- tests/data/test1533 | 10 +- tests/data/test1534 | 12 +- tests/data/test1535 | 2 +- tests/data/test1536 | 2 +- tests/data/test1539 | 10 +- tests/data/test154 | 62 ++++---- tests/data/test1540 | 2 +- tests/data/test1541 | 2 +- tests/data/test1542 | 10 +- tests/data/test1543 | 2 +- tests/data/test1546 | 26 ++-- tests/data/test1549 | 4 +- tests/data/test155 | 84 +++++----- tests/data/test1551 | 2 +- tests/data/test1552 | 16 +- tests/data/test1553 | 16 +- tests/data/test1555 | 6 +- tests/data/test1556 | 28 ++-- tests/data/test156 | 12 +- tests/data/test1561 | 2 +- tests/data/test1562 | 2 +- tests/data/test1563 | 2 +- tests/data/test1566 | 2 +- tests/data/test1567 | 2 +- tests/data/test1568 | 52 +++---- tests/data/test157 | 14 +- tests/data/test1571 | 6 +- tests/data/test1572 | 6 +- tests/data/test1573 | 6 +- tests/data/test1574 | 6 +- tests/data/test1575 | 6 +- tests/data/test1576 | 6 +- tests/data/test1577 | 6 +- tests/data/test1578 | 6 +- tests/data/test1579 | 6 +- tests/data/test158 | 8 +- tests/data/test1580 | 6 +- tests/data/test1581 | 6 +- tests/data/test1582 | 4 +- tests/data/test159 | 34 ++-- tests/data/test1590 | 16 +- tests/data/test1593 | 2 +- tests/data/test1594 | 2 +- tests/data/test1595 | 2 +- tests/data/test1596 | 2 +- tests/data/test16 | 18 +-- tests/data/test160 | 40 ++--- tests/data/test1613 | 18 +-- tests/data/test1617 | 42 ++--- tests/data/test162 | 2 +- tests/data/test1630 | 32 ++-- tests/data/test1631 | 34 ++-- tests/data/test1632 | 42 ++--- tests/data/test1634 | 2 +- tests/data/test1635 | 2 +- tests/data/test164 | 2 +- tests/data/test165 | 16 +- tests/data/test167 | 28 ++-- tests/data/test1670 | 2 +- tests/data/test1671 | 2 +- tests/data/test168 | 42 ++--- tests/data/test169 | 78 +++++----- tests/data/test170 | 2 +- tests/data/test1700 | 82 +++++----- tests/data/test1701 | 54 +++---- tests/data/test1702 | 56 +++---- tests/data/test1704 | 16 +- tests/data/test171 | 18 +-- tests/data/test1711 | 10 +- tests/data/test172 | 12 +- tests/data/test174 | 14 +- tests/data/test175 | 46 +++--- tests/data/test176 | 46 +++--- tests/data/test177 | 14 +- tests/data/test178 | 2 +- tests/data/test179 | 2 +- tests/data/test18 | 58 +++---- tests/data/test1800 | 2 +- tests/data/test1801 | 2 +- tests/data/test1802 | 6 +- tests/data/test183 | 12 +- tests/data/test184 | 40 ++--- tests/data/test185 | 44 +++--- tests/data/test187 | 2 +- tests/data/test188 | 2 +- tests/data/test189 | 2 +- tests/data/test1901 | 2 +- tests/data/test1903 | 2 +- tests/data/test1904 | 20 +-- tests/data/test1905 | 2 +- tests/data/test1906 | 2 +- tests/data/test1907 | 2 +- tests/data/test1908 | 2 +- tests/data/test1909 | 2 +- tests/data/test1910 | 2 +- tests/data/test1919 | 2 +- tests/data/test192 | 2 +- tests/data/test193 | 2 +- tests/data/test1933 | 2 +- tests/data/test1934 | 2 +- tests/data/test1935 | 2 +- tests/data/test1936 | 2 +- tests/data/test194 | 50 +++--- tests/data/test1941 | 20 +-- tests/data/test1945 | 20 +-- tests/data/test1948 | 34 ++-- tests/data/test1956 | 2 +- tests/data/test1957 | 2 +- tests/data/test1958 | 2 +- tests/data/test1959 | 2 +- tests/data/test1960 | 4 +- tests/data/test1964 | 2 +- tests/data/test197 | 2 +- tests/data/test1970 | 2 +- tests/data/test1974 | 2 +- tests/data/test1976 | 2 +- tests/data/test1977 | 2 +- tests/data/test198 | 2 +- tests/data/test1981 | 4 +- tests/data/test199 | 2 +- tests/data/test2 | 4 +- tests/data/test2001 | 24 +-- tests/data/test2002 | 24 +-- tests/data/test2003 | 24 +-- tests/data/test2005 | 2 +- tests/data/test2023 | 126 +++++++-------- tests/data/test2024 | 138 ++++++++--------- tests/data/test2025 | 264 +++++++++++++++---------------- tests/data/test2026 | 198 ++++++++++++------------ tests/data/test2027 | 218 +++++++++++++------------- tests/data/test2028 | 324 +++++++++++++++++++------------------- tests/data/test2029 | 222 +++++++++++++------------- tests/data/test2030 | 284 +++++++++++++++++----------------- tests/data/test2031 | 326 +++++++++++++++++++-------------------- tests/data/test2032 | 60 +++---- tests/data/test2033 | 2 +- tests/data/test2034 | 2 +- tests/data/test2037 | 2 +- tests/data/test2040 | 2 +- tests/data/test2041 | 2 +- tests/data/test2046 | 2 +- tests/data/test2047 | 2 +- tests/data/test2049 | 2 +- tests/data/test2050 | 14 +- tests/data/test2051 | 2 +- tests/data/test2052 | 2 +- tests/data/test2053 | 2 +- tests/data/test2054 | 2 +- tests/data/test2055 | 14 +- tests/data/test2056 | 2 +- tests/data/test2057 | 2 +- tests/data/test2058 | 70 ++++----- tests/data/test2059 | 70 ++++----- tests/data/test206 | 10 +- tests/data/test2060 | 70 ++++----- tests/data/test2061 | 52 +++---- tests/data/test2062 | 52 +++---- tests/data/test2063 | 52 +++---- tests/data/test2064 | 56 +++---- tests/data/test2065 | 56 +++---- tests/data/test2066 | 56 +++---- tests/data/test2067 | 50 +++--- tests/data/test2068 | 50 +++--- tests/data/test2069 | 50 +++--- tests/data/test207 | 2 +- tests/data/test2070 | 2 +- tests/data/test2074 | 2 +- tests/data/test2076 | 36 ++--- tests/data/test2077 | 8 +- tests/data/test2078 | 8 +- tests/data/test2079 | 2 +- tests/data/test2081 | 40 ++--- tests/data/test2087 | 2 +- tests/data/test2088 | 2 +- tests/data/test2089 | 2 +- tests/data/test209 | 22 +-- tests/data/test2102 | 4 +- tests/data/test213 | 20 +-- tests/data/test214 | 2 +- tests/data/test217 | 14 +- tests/data/test218 | 12 +- tests/data/test22 | 10 +- tests/data/test220 | 38 ++--- tests/data/test221 | 38 ++--- tests/data/test222 | 20 +-- tests/data/test223 | 38 ++--- tests/data/test224 | 38 ++--- tests/data/test230 | 20 +-- tests/data/test2300 | 16 +- tests/data/test2301 | 16 +- tests/data/test2302 | 16 +- tests/data/test2303 | 14 +- tests/data/test2304 | 2 +- tests/data/test2306 | 24 +-- tests/data/test2308 | 24 +-- tests/data/test2309 | 4 +- tests/data/test232 | 20 +-- tests/data/test233 | 2 +- tests/data/test234 | 2 +- tests/data/test239 | 42 ++--- tests/data/test24 | 2 +- tests/data/test240 | 2 +- tests/data/test2400 | 18 +-- tests/data/test2401 | 30 ++-- tests/data/test2402 | 50 +++--- tests/data/test2403 | 4 +- tests/data/test2404 | 10 +- tests/data/test2406 | 18 +-- tests/data/test241 | 2 +- tests/data/test242 | 2 +- tests/data/test243 | 76 ++++----- tests/data/test245 | 50 +++--- tests/data/test246 | 70 ++++----- tests/data/test249 | 2 +- tests/data/test25 | 2 +- tests/data/test2500 | 6 +- tests/data/test2501 | 28 ++-- tests/data/test2502 | 10 +- tests/data/test2503 | 4 +- tests/data/test256 | 2 +- tests/data/test257 | 2 +- tests/data/test258 | 12 +- tests/data/test259 | 12 +- tests/data/test26 | 2 +- tests/data/test260 | 2 +- tests/data/test262 | 2 +- tests/data/test263 | 2 +- tests/data/test264 | 14 +- tests/data/test265 | 22 +-- tests/data/test266 | 18 +-- tests/data/test267 | 50 +++--- tests/data/test268 | 2 +- tests/data/test269 | 2 +- tests/data/test27 | 2 +- tests/data/test273 | 52 +++---- tests/data/test274 | 2 +- tests/data/test275 | 24 +-- tests/data/test276 | 2 +- tests/data/test278 | 16 +- tests/data/test279 | 16 +- tests/data/test28 | 2 +- tests/data/test282 | 2 +- tests/data/test287 | 14 +- tests/data/test29 | 12 +- tests/data/test292 | 2 +- tests/data/test293 | 2 +- tests/data/test299 | 2 +- tests/data/test3 | 24 +-- tests/data/test30 | 2 +- tests/data/test300 | 2 +- tests/data/test3000 | 2 +- tests/data/test3001 | 2 +- tests/data/test3002 | 10 +- tests/data/test3003 | 10 +- tests/data/test3004 | 10 +- tests/data/test3005 | 10 +- tests/data/test3006 | 10 +- tests/data/test3007 | 10 +- tests/data/test3008 | 2 +- tests/data/test3009 | 2 +- tests/data/test301 | 2 +- tests/data/test3011 | 2 +- tests/data/test3012 | 2 +- tests/data/test3013 | 2 +- tests/data/test3014 | 2 +- tests/data/test3015 | 18 +-- tests/data/test302 | 6 +- tests/data/test3023 | 2 +- tests/data/test3024 | 2 +- tests/data/test3028 | 12 +- tests/data/test303 | 12 +- tests/data/test3031 | 6 +- tests/data/test3032 | 92 +++++------ tests/data/test3035 | 48 +++--- tests/data/test306 | 2 +- tests/data/test307 | 2 +- tests/data/test309 | 52 +++---- tests/data/test31 | 2 +- tests/data/test310 | 2 +- tests/data/test3100 | 72 ++++----- tests/data/test3101 | 60 +++---- tests/data/test3102 | 2 +- tests/data/test3103 | 4 +- tests/data/test3104 | 4 +- tests/data/test314 | 20 +-- tests/data/test315 | 38 ++--- tests/data/test316 | 38 ++--- tests/data/test317 | 2 +- tests/data/test318 | 2 +- tests/data/test319 | 18 +-- tests/data/test32 | 2 +- tests/data/test320 | 14 +- tests/data/test3204 | 2 +- tests/data/test3208 | 26 ++-- tests/data/test3215 | 10 +- tests/data/test325 | 2 +- tests/data/test326 | 2 +- tests/data/test327 | 2 +- tests/data/test328 | 2 +- tests/data/test329 | 32 ++-- tests/data/test330 | 2 +- tests/data/test331 | 2 +- tests/data/test334 | 2 +- tests/data/test335 | 2 +- tests/data/test339 | 2 +- tests/data/test34 | 2 +- tests/data/test341 | 2 +- tests/data/test342 | 2 +- tests/data/test343 | 2 +- tests/data/test344 | 2 +- tests/data/test345 | 2 +- tests/data/test346 | 2 +- tests/data/test347 | 2 +- tests/data/test349 | 2 +- tests/data/test355 | 2 +- tests/data/test356 | 2 +- tests/data/test358 | 60 +++---- tests/data/test359 | 60 +++---- tests/data/test36 | 2 +- tests/data/test360 | 2 +- tests/data/test361 | 2 +- tests/data/test363 | 18 +-- tests/data/test365 | 2 +- tests/data/test366 | 2 +- tests/data/test367 | 2 +- tests/data/test368 | 2 +- tests/data/test369 | 2 +- tests/data/test37 | 2 +- tests/data/test371 | 2 +- tests/data/test372 | 18 +-- tests/data/test373 | 18 +-- tests/data/test374 | 16 +- tests/data/test376 | 2 +- tests/data/test379 | 2 +- tests/data/test38 | 2 +- tests/data/test387 | 4 +- tests/data/test388 | 126 +++++++-------- tests/data/test389 | 2 +- tests/data/test39 | 12 +- tests/data/test391 | 2 +- tests/data/test392 | 20 +-- tests/data/test393 | 2 +- tests/data/test394 | 2 +- tests/data/test395 | 2 +- tests/data/test396 | 20 +-- tests/data/test397 | 38 ++--- tests/data/test398 | 2 +- tests/data/test40 | 48 +++--- tests/data/test4000 | 2 +- tests/data/test410 | 2 +- tests/data/test412 | 2 +- tests/data/test413 | 2 +- tests/data/test414 | 2 +- tests/data/test415 | 2 +- tests/data/test417 | 2 +- tests/data/test418 | 2 +- tests/data/test42 | 48 +++--- tests/data/test420 | 4 +- tests/data/test421 | 4 +- tests/data/test423 | 2 +- tests/data/test424 | 4 +- tests/data/test425 | 2 +- tests/data/test427 | 6 +- tests/data/test428 | 2 +- tests/data/test429 | 2 +- tests/data/test43 | 2 +- tests/data/test434 | 2 +- tests/data/test435 | 24 +-- tests/data/test436 | 10 +- tests/data/test437 | 2 +- tests/data/test438 | 52 +++---- tests/data/test439 | 4 +- tests/data/test440 | 34 ++-- tests/data/test441 | 34 ++-- tests/data/test442 | 2 +- tests/data/test443 | 2 +- tests/data/test444 | 2 +- tests/data/test446 | 12 +- tests/data/test447 | 2 +- tests/data/test448 | 2 +- tests/data/test449 | 2 +- tests/data/test45 | 2 +- tests/data/test450 | 2 +- tests/data/test451 | 2 +- tests/data/test455 | 2 +- tests/data/test457 | 2 +- tests/data/test458 | 6 +- tests/data/test459 | 2 +- tests/data/test46 | 30 ++-- tests/data/test461 | 4 +- tests/data/test468 | 4 +- tests/data/test469 | 2 +- tests/data/test47 | 2 +- tests/data/test470 | 2 +- tests/data/test471 | 2 +- tests/data/test472 | 4 +- tests/data/test473 | 2 +- tests/data/test474 | 4 +- tests/data/test477 | 2 +- tests/data/test478 | 4 +- tests/data/test479 | 8 +- tests/data/test483 | 4 +- tests/data/test486 | 8 +- tests/data/test487 | 4 +- tests/data/test488 | 4 +- tests/data/test489 | 4 +- tests/data/test49 | 2 +- tests/data/test493 | 34 ++-- tests/data/test495 | 2 +- tests/data/test497 | 2 +- tests/data/test499 | 6 +- tests/data/test5 | 2 +- tests/data/test50 | 2 +- tests/data/test500 | 26 ++-- tests/data/test503 | 18 +-- tests/data/test508 | 14 +- tests/data/test51 | 2 +- tests/data/test510 | 14 +- tests/data/test512 | 14 +- tests/data/test514 | 26 ++-- tests/data/test515 | 14 +- tests/data/test516 | 14 +- tests/data/test518 | 26 ++-- tests/data/test519 | 48 +++--- tests/data/test52 | 2 +- tests/data/test522 | 20 +-- tests/data/test523 | 20 +-- tests/data/test528 | 14 +- tests/data/test53 | 18 +-- tests/data/test535 | 32 ++-- tests/data/test536 | 20 +-- tests/data/test537 | 26 ++-- tests/data/test54 | 2 +- tests/data/test540 | 54 +++---- tests/data/test542 | 6 +- tests/data/test544 | 12 +- tests/data/test545 | 12 +- tests/data/test547 | 76 ++++----- tests/data/test548 | 76 ++++----- tests/data/test549 | 20 +-- tests/data/test55 | 2 +- tests/data/test550 | 20 +-- tests/data/test551 | 50 +++--- tests/data/test552 | 26 ++-- tests/data/test553 | 10 +- tests/data/test554 | 40 ++--- tests/data/test555 | 76 ++++----- tests/data/test556 | 16 +- tests/data/test560 | 14 +- tests/data/test561 | 20 +-- tests/data/test563 | 16 +- tests/data/test565 | 70 ++++----- tests/data/test566 | 26 ++-- tests/data/test567 | 14 +- tests/data/test568 | 34 ++-- tests/data/test57 | 2 +- tests/data/test570 | 42 ++--- tests/data/test571 | 52 +++---- tests/data/test572 | 70 ++++----- tests/data/test573 | 26 ++-- tests/data/test577 | 14 +- tests/data/test578 | 24 +-- tests/data/test579 | 70 ++++----- tests/data/test580 | 34 ++-- tests/data/test581 | 20 +-- tests/data/test584 | 34 ++-- tests/data/test585 | 18 +-- tests/data/test589 | 14 +- tests/data/test59 | 2 +- tests/data/test590 | 74 ++++----- tests/data/test598 | 42 ++--- tests/data/test599 | 50 +++--- tests/data/test6 | 2 +- tests/data/test60 | 10 +- tests/data/test61 | 36 ++--- tests/data/test62 | 12 +- tests/data/test63 | 12 +- tests/data/test64 | 52 +++---- tests/data/test643 | 40 ++--- tests/data/test644 | 2 +- tests/data/test645 | 40 ++--- tests/data/test646 | 12 +- tests/data/test648 | 10 +- tests/data/test649 | 10 +- tests/data/test65 | 56 +++---- tests/data/test650 | 4 +- tests/data/test651 | 14 +- tests/data/test653 | 40 ++--- tests/data/test654 | 40 ++--- tests/data/test655 | 14 +- tests/data/test658 | 2 +- tests/data/test659 | 2 +- tests/data/test66 | 2 +- tests/data/test662 | 48 +++--- tests/data/test663 | 48 +++--- tests/data/test666 | 24 +-- tests/data/test667 | 28 ++-- tests/data/test668 | 28 ++-- tests/data/test67 | 52 +++---- tests/data/test670 | 28 ++-- tests/data/test671 | 28 ++-- tests/data/test672 | 28 ++-- tests/data/test673 | 28 ++-- tests/data/test674 | 2 +- tests/data/test675 | 14 +- tests/data/test676 | 42 ++--- tests/data/test678 | 2 +- tests/data/test679 | 2 +- tests/data/test68 | 56 +++---- tests/data/test681 | 2 +- tests/data/test682 | 2 +- tests/data/test683 | 2 +- tests/data/test684 | 2 +- tests/data/test685 | 2 +- tests/data/test687 | 2 +- tests/data/test688 | 2 +- tests/data/test689 | 2 +- tests/data/test69 | 86 +++++------ tests/data/test690 | 6 +- tests/data/test691 | 6 +- tests/data/test692 | 6 +- tests/data/test693 | 36 ++--- tests/data/test694 | 92 +++++------ tests/data/test696 | 42 ++--- tests/data/test699 | 4 +- tests/data/test7 | 2 +- tests/data/test70 | 56 +++---- tests/data/test700 | 2 +- tests/data/test701 | 2 +- tests/data/test708 | 2 +- tests/data/test709 | 2 +- tests/data/test710 | 2 +- tests/data/test717 | 2 +- tests/data/test718 | 18 +-- tests/data/test719 | 2 +- tests/data/test72 | 56 +++---- tests/data/test720 | 2 +- tests/data/test721 | 2 +- tests/data/test722 | 2 +- tests/data/test724 | 2 +- tests/data/test727 | 2 +- tests/data/test728 | 2 +- tests/data/test73 | 16 +- tests/data/test730 | 2 +- tests/data/test731 | 2 +- tests/data/test732 | 2 +- tests/data/test733 | 2 +- tests/data/test734 | 2 +- tests/data/test735 | 2 +- tests/data/test736 | 2 +- tests/data/test737 | 2 +- tests/data/test74 | 2 +- tests/data/test740 | 2 +- tests/data/test742 | 2 +- tests/data/test743 | 2 +- tests/data/test744 | 18 +-- tests/data/test747 | 2 +- tests/data/test749 | 12 +- tests/data/test750 | 2 +- tests/data/test752 | 6 +- tests/data/test755 | 2 +- tests/data/test756 | 2 +- tests/data/test76 | 10 +- tests/data/test762 | 2 +- tests/data/test767 | 4 +- tests/data/test768 | 4 +- tests/data/test769 | 4 +- tests/data/test77 | 2 +- tests/data/test770 | 4 +- tests/data/test771 | 4 +- tests/data/test772 | 4 +- tests/data/test773 | 4 +- tests/data/test775 | 30 ++-- tests/data/test776 | 4 +- tests/data/test78 | 2 +- tests/data/test780 | 8 +- tests/data/test781 | 8 +- tests/data/test782 | 8 +- tests/data/test783 | 8 +- tests/data/test784 | 2 +- tests/data/test785 | 2 +- tests/data/test786 | 2 +- tests/data/test788 | 2 +- tests/data/test789 | 4 +- tests/data/test79 | 2 +- tests/data/test790 | 2 +- tests/data/test791 | 2 +- tests/data/test794 | 6 +- tests/data/test796 | 6 +- tests/data/test797 | 6 +- tests/data/test799 | 16 +- tests/data/test8 | 2 +- tests/data/test80 | 20 +-- tests/data/test800 | 16 +- tests/data/test801 | 10 +- tests/data/test802 | 10 +- tests/data/test804 | 10 +- tests/data/test805 | 20 +-- tests/data/test806 | 8 +- tests/data/test807 | 8 +- tests/data/test808 | 16 +- tests/data/test809 | 4 +- tests/data/test81 | 52 +++---- tests/data/test810 | 4 +- tests/data/test815 | 4 +- tests/data/test816 | 8 +- tests/data/test818 | 10 +- tests/data/test819 | 16 +- tests/data/test82 | 14 +- tests/data/test820 | 16 +- tests/data/test821 | 16 +- tests/data/test822 | 16 +- tests/data/test823 | 16 +- tests/data/test824 | 16 +- tests/data/test825 | 16 +- tests/data/test826 | 16 +- tests/data/test827 | 16 +- tests/data/test828 | 16 +- tests/data/test83 | 20 +-- tests/data/test833 | 16 +- tests/data/test834 | 16 +- tests/data/test835 | 16 +- tests/data/test836 | 20 +-- tests/data/test837 | 16 +- tests/data/test838 | 16 +- tests/data/test839 | 16 +- tests/data/test84 | 2 +- tests/data/test840 | 16 +- tests/data/test841 | 26 ++-- tests/data/test842 | 16 +- tests/data/test843 | 16 +- tests/data/test846 | 16 +- tests/data/test847 | 16 +- tests/data/test848 | 16 +- tests/data/test85 | 2 +- tests/data/test850 | 16 +- tests/data/test853 | 8 +- tests/data/test857 | 36 ++--- tests/data/test86 | 2 +- tests/data/test861 | 14 +- tests/data/test862 | 10 +- tests/data/test864 | 16 +- tests/data/test865 | 16 +- tests/data/test866 | 16 +- tests/data/test867 | 16 +- tests/data/test868 | 18 +-- tests/data/test869 | 16 +- tests/data/test87 | 30 ++-- tests/data/test870 | 16 +- tests/data/test871 | 16 +- tests/data/test872 | 16 +- tests/data/test873 | 16 +- tests/data/test874 | 16 +- tests/data/test879 | 16 +- tests/data/test88 | 50 +++--- tests/data/test880 | 16 +- tests/data/test881 | 16 +- tests/data/test882 | 18 +-- tests/data/test883 | 16 +- tests/data/test884 | 16 +- tests/data/test885 | 16 +- tests/data/test886 | 16 +- tests/data/test887 | 16 +- tests/data/test888 | 16 +- tests/data/test89 | 100 ++++++------ tests/data/test892 | 16 +- tests/data/test895 | 16 +- tests/data/test897 | 50 +++--- tests/data/test898 | 2 +- tests/data/test899 | 6 +- tests/data/test90 | 168 ++++++++++---------- tests/data/test901 | 22 +-- tests/data/test902 | 10 +- tests/data/test903 | 4 +- tests/data/test904 | 4 +- tests/data/test905 | 4 +- tests/data/test906 | 6 +- tests/data/test907 | 4 +- tests/data/test908 | 4 +- tests/data/test909 | 10 +- tests/data/test91 | 90 +++++------ tests/data/test910 | 8 +- tests/data/test912 | 10 +- tests/data/test913 | 10 +- tests/data/test914 | 10 +- tests/data/test915 | 10 +- tests/data/test916 | 10 +- tests/data/test917 | 10 +- tests/data/test918 | 10 +- tests/data/test919 | 4 +- tests/data/test92 | 6 +- tests/data/test920 | 4 +- tests/data/test921 | 6 +- tests/data/test922 | 4 +- tests/data/test924 | 10 +- tests/data/test925 | 4 +- tests/data/test926 | 2 +- tests/data/test927 | 8 +- tests/data/test928 | 6 +- tests/data/test93 | 2 +- tests/data/test935 | 4 +- tests/data/test936 | 4 +- tests/data/test937 | 4 +- tests/data/test938 | 6 +- tests/data/test939 | 4 +- tests/data/test94 | 2 +- tests/data/test940 | 4 +- tests/data/test942 | 4 +- tests/data/test943 | 4 +- tests/data/test944 | 4 +- tests/data/test945 | 4 +- tests/data/test946 | 4 +- tests/data/test947 | 4 +- tests/data/test948 | 4 +- tests/data/test949 | 4 +- tests/data/test95 | 18 +-- tests/data/test950 | 4 +- tests/data/test951 | 4 +- tests/data/test952 | 4 +- tests/data/test953 | 4 +- tests/data/test955 | 10 +- tests/data/test956 | 10 +- tests/data/test959 | 10 +- tests/data/test960 | 10 +- tests/data/test962 | 10 +- tests/data/test963 | 10 +- tests/data/test965 | 10 +- tests/data/test966 | 10 +- tests/data/test967 | 4 +- tests/data/test97 | 12 +- tests/data/test970 | 2 +- tests/data/test972 | 2 +- tests/data/test974 | 2 +- tests/data/test976 | 2 +- tests/data/test977 | 2 +- tests/data/test978 | 4 +- tests/data/test979 | 6 +- tests/data/test98 | 12 +- tests/data/test987 | 10 +- tests/data/test989 | 16 +- tests/data/test99 | 2 +- tests/data/test990 | 4 +- tests/data/test991 | 4 +- tests/data/test992 | 4 +- tests/data/test995 | 4 +- tests/data/test998 | 2 +- tests/data/test999 | 2 +- tests/runner.pm | 36 +++-- tests/runtests.pl | 42 ++++- tests/testutil.pm | 2 +- 1096 files changed, 10495 insertions(+), 10422 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index bc82aa8c0026..070735836e5f 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -241,7 +241,7 @@ similar. ## `` -### `` +### `` data to be sent to the client on its request and later verified that it arrived safely. Set `nocheck="yes"` to prevent the test script from verifying @@ -269,16 +269,19 @@ used as "raw" data. `nonewline=yes` means that the last byte (the trailing newline character) should be cut off from the data before sending or comparing it. -`crlf=yes` forces *header* newlines to become CRLF even if not written so in -the source file. Note that this makes runtests.pl parse and "guess" what is a -header and what is not in order to apply the CRLF line endings appropriately. +`crlf=yes` forces the newlines to become CRLF even if not written so in the +test. + +`crlf=headers` forces *header* newlines to become CRLF even if not written so +in the source file. Note that this makes runtests.pl parse and "guess" what is +a header and what is not in order to apply the CRLF line endings appropriately. For FTP file listings, the `` section is be used *only* if you make sure that there has been a CWD done first to a directory named `test-[NUM]` where `NUM` is the test case number. Otherwise the ftp server cannot know from which test file to load the list content. -### `` +### `` Send back this contents instead of the `` one. The `NUM` is set by: @@ -297,15 +300,22 @@ to complete a transfer. The response to each request is found in its own data section. Validating the entire negotiation sequence can be done by specifying a `datacheck` section. -### `` +### `` The connect section is used instead of the 'data' for all CONNECT requests. The remainder of the rules for the data section then apply but with a connect prefix. +`crlf=yes` forces the newlines to become CRLF even if not written so in the +test. + +`crlf=headers` forces *header* newlines to become CRLF even if not written so +in the source file. Note that this makes runtests.pl parse and "guess" what is +a header and what is not in order to apply the CRLF line endings appropriately. + ### `` Address type and address details as logged by the SOCKS proxy. -### `` +### `` if the data is sent but this is what should be checked afterwards. If `nonewline=yes` is set, runtests cuts off the trailing newline from the data before comparing with the one actually received by the client. @@ -313,7 +323,7 @@ before comparing with the one actually received by the client. Use the `mode="text"` attribute if the output is in text mode on platforms that have a text/binary difference. -### `` +### `` The contents of numbered `datacheck` sections are appended to the non-numbered one. @@ -613,13 +623,16 @@ parameter is the not negative integer number of seconds for the delay. This 'delay' attribute is intended for specific test cases, and normally not needed. -### `` +### `` This creates the named file with this content before the test case is run, which is useful if the test case needs a file to act on. If `nonewline="yes"` is used, the created file gets the final newline stripped off. +`crlf=yes` forces the newlines to become CRLF even if not written so in the +test. + ### `` 1 to 4 can be appended to 'file' to create more files. @@ -629,12 +642,15 @@ off. ### `` -### `` +### `` Pass this given data on stdin to the tool. If `nonewline` is set, we cut off the trailing newline of this given data before comparing with the one actually received by the client +`crlf=yes` forces the newlines to become CRLF even if not written so in the +test. + ## `` If `test-duphandle` is a listed item here, this is not run when @@ -677,14 +693,14 @@ test. in the source file. Note that this makes runtests.pl parse and "guess" what is a header and what is not in order to apply the CRLF line endings appropriately. -### `` +### `` The protocol dump curl should transmit to an HTTP proxy (when the http-proxy server is used), if `nonewline` is set, we cut off the trailing newline of this given data before comparing with the one actually sent by the client The `` and `` rules are applied before comparisons are made. -### `` +### `` This verifies that this data was passed to stderr. Use the mode="text" attribute if the output is in text mode on platforms that @@ -693,10 +709,14 @@ have a text/binary difference. `crlf=yes` forces the newlines to become CRLF even if not written so in the test. +`crlf=headers` forces *header* newlines to become CRLF even if not written so +in the source file. Note that this makes runtests.pl parse and "guess" what is +a header and what is not in order to apply the CRLF line endings appropriately. + If `nonewline` is set, we cut off the trailing newline of this given data before comparing with the one actually received by the client -### `` +### `` This verifies that this data was passed to stdout. Use the mode="text" attribute if the output is in text mode on platforms that @@ -708,6 +728,10 @@ before comparing with the one actually received by the client `crlf=yes` forces the newlines to become CRLF even if not written so in the test. +`crlf=headers` forces *header* newlines to become CRLF even if not written so +in the source file. Note that this makes runtests.pl parse and "guess" what is +a header and what is not in order to apply the CRLF line endings appropriately. + `loadfile="filename"` makes loading the data from an external file. ### `` @@ -718,11 +742,18 @@ that the set limits are not exceeded. Supported limits: Allocations: [number of allocation calls] Maximum allocated: [maximum concurrent memory allocated] -### `` +### `` The file's contents must be identical to this after the test is complete. Use the mode="text" attribute if the output is in text mode on platforms that have a text/binary difference. +`crlf=yes` forces the newlines to become CRLF even if not written so in the +test. + +`crlf=headers` forces *header* newlines to become CRLF even if not written so +in the source file. Note that this makes runtests.pl parse and "guess" what is +a header and what is not in order to apply the CRLF line endings appropriately. + ### `` 1 to 4 can be appended to 'file' to compare more files. diff --git a/tests/data/test1 b/tests/data/test1 index 5c3c318be533..ee0b63404884 100644 --- a/tests/data/test1 +++ b/tests/data/test1 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1001 b/tests/data/test1001 index ab2b045e9ce9..6359b145446a 100644 --- a/tests/data/test1001 +++ b/tests/data/test1001 @@ -13,45 +13,45 @@ CUSTOMREQUEST # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test1002 b/tests/data/test1002 index 94124e2ea075..20e878db562e 100644 --- a/tests/data/test1002 +++ b/tests/data/test1002 @@ -12,45 +12,45 @@ CUSTOMREQUEST - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test1004 b/tests/data/test1004 index d7c0ae51760a..f7c25cafdd80 100644 --- a/tests/data/test1004 +++ b/tests/data/test1004 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy "" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1008 b/tests/data/test1008 index a1705d106637..be858d0038bc 100644 --- a/tests/data/test1008 +++ b/tests/data/test1008 @@ -18,26 +18,26 @@ connection-monitor # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Transfer-Encoding: chunked - -20 -And you should ignore this data. -FA0 -%repeat[4000 x X]% -0 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Transfer-Encoding: chunked + +20 +And you should ignore this data. +FA0 +%repeat[4000 x X]% +0 + # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 Things are fine in proxy land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 + # this is returned when we get a GET! diff --git a/tests/data/test1011 b/tests/data/test1011 index 0ef87ae1a6b8..f4de4df6a20a 100644 --- a/tests/data/test1011 +++ b/tests/data/test1011 @@ -9,32 +9,32 @@ followlocation # # Server-side - -HTTP/1.1 301 OK -Location: moo.html&testcase=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 - + +HTTP/1.1 301 OK +Location: moo.html&testcase=/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 + - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body - -HTTP/1.1 301 OK -Location: moo.html&testcase=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 301 OK +Location: moo.html&testcase=/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body diff --git a/tests/data/test1012 b/tests/data/test1012 index 5ced62b24d48..d15e10f28e19 100644 --- a/tests/data/test1012 +++ b/tests/data/test1012 @@ -9,32 +9,32 @@ followlocation # # Server-side - -HTTP/1.1 301 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 301 OK swsclose +Location: moo.html&testcase=/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body - -HTTP/1.1 301 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 301 OK swsclose +Location: moo.html&testcase=/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body diff --git a/tests/data/test1015 b/tests/data/test1015 index 52a7d3e9572e..beabcd1b9017 100644 --- a/tests/data/test1015 +++ b/tests/data/test1015 @@ -10,11 +10,11 @@ HTTP POST # # Server-side - -HTTP/1.1 200 I am cool swsclose -Server: Cool server/10.0 -Content-Length: 0 - + +HTTP/1.1 200 I am cool swsclose +Server: Cool server/10.0 +Content-Length: 0 + diff --git a/tests/data/test1021 b/tests/data/test1021 index 25fb2bfc3c1d..4d85468e8dd2 100644 --- a/tests/data/test1021 +++ b/tests/data/test1021 @@ -13,31 +13,31 @@ NTLM # Server-side - -HTTP/1.1 407 Authorization Required to proxy me my dear swsclose -Proxy-Authenticate: NTLM -Content-Length: 16 -Connection: close - + +HTTP/1.1 407 Authorization Required to proxy me my dear swsclose +Proxy-Authenticate: NTLM +Content-Length: 16 +Connection: close + data to discard # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 28 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 28 + 27 bytes and newline to ign # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 Things are fine in proxy land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 + # this is returned when we get a GET! @@ -106,7 +106,7 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - + CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1024 b/tests/data/test1024 index 24c5e6ca67eb..7e7f20aa7407 100644 --- a/tests/data/test1024 +++ b/tests/data/test1024 @@ -10,57 +10,57 @@ cookies # Server-side - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../data/%TESTNUMBER0002.txt -Set-Cookie: firstcookie=want; path=/want/ -Content-Length: 69 - + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../data/%TESTNUMBER0002.txt +Set-Cookie: firstcookie=want; path=/want/ +Content-Length: 69 + This server reply is for testing a Location: following with cookies - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../want/%TESTNUMBER0003.txt -Set-Cookie: nextcookie=data; path=/data/ -Content-Length: 69 - + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../want/%TESTNUMBER0003.txt +Set-Cookie: nextcookie=data; path=/data/ +Content-Length: 69 + This server reply is for testing a Location: following with cookies - -HTTP/1.1 200 Followed here fine -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 52 - + +HTTP/1.1 200 Followed here fine +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 52 + If this is received, the location following worked - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../data/%TESTNUMBER0002.txt -Set-Cookie: firstcookie=want; path=/want/ -Content-Length: 69 - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../want/%TESTNUMBER0003.txt -Set-Cookie: nextcookie=data; path=/data/ -Content-Length: 69 - -HTTP/1.1 200 Followed here fine -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 52 - + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../data/%TESTNUMBER0002.txt +Set-Cookie: firstcookie=want; path=/want/ +Content-Length: 69 + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../want/%TESTNUMBER0003.txt +Set-Cookie: nextcookie=data; path=/data/ +Content-Length: 69 + +HTTP/1.1 200 Followed here fine +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 52 + If this is received, the location following worked @@ -84,7 +84,7 @@ cookies # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1025 b/tests/data/test1025 index c08a157d570c..fb1787605554 100644 --- a/tests/data/test1025 +++ b/tests/data/test1025 @@ -10,57 +10,57 @@ cookies # Server-side - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../data/%TESTNUMBER0002.txt -Set-Cookie: firstcookie=want; path=/want/ -Content-Length: 69 - + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../data/%TESTNUMBER0002.txt +Set-Cookie: firstcookie=want; path=/want/ +Content-Length: 69 + This server reply is for testing a Location: following with cookies - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../want/%TESTNUMBER0003.txt -Set-Cookie: nextcookie=data; path=/data/ -Content-Length: 69 - + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../want/%TESTNUMBER0003.txt +Set-Cookie: nextcookie=data; path=/data/ +Content-Length: 69 + This server reply is for testing a Location: following with cookies - -HTTP/1.1 200 Followed here fine -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 52 - + +HTTP/1.1 200 Followed here fine +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 52 + If this is received, the location following worked - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../data/%TESTNUMBER0002.txt -Set-Cookie: firstcookie=want; path=/want/ -Content-Length: 69 - -HTTP/1.1 301 This is a weirdo text message -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: ../want/%TESTNUMBER0003.txt -Set-Cookie: nextcookie=data; path=/data/ -Content-Length: 69 - -HTTP/1.1 200 Followed here fine -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 52 - + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../data/%TESTNUMBER0002.txt +Set-Cookie: firstcookie=want; path=/want/ +Content-Length: 69 + +HTTP/1.1 301 This is a weirdo text message +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: ../want/%TESTNUMBER0003.txt +Set-Cookie: nextcookie=data; path=/data/ +Content-Length: 69 + +HTTP/1.1 200 Followed here fine +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 52 + If this is received, the location following worked @@ -84,7 +84,7 @@ cookies # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1028 b/tests/data/test1028 index 81728c686467..30dafb720d8d 100644 --- a/tests/data/test1028 +++ b/tests/data/test1028 @@ -13,16 +13,16 @@ FILE # # Server-side - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/html -Funny-head: yesyes -Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 +Content-Length: 0 +Connection: close + data @@ -67,16 +67,16 @@ SIZE %TESTNUMBER0002 RETR %TESTNUMBER0002 QUIT - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/html -Funny-head: yesyes -Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 +Content-Length: 0 +Connection: close + data to see diff --git a/tests/data/test1029 b/tests/data/test1029 index d019bff7b187..ac636449cb40 100644 --- a/tests/data/test1029 +++ b/tests/data/test1029 @@ -11,12 +11,12 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following @@ -36,19 +36,19 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url} %{url} %{ex # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER 0%spc% diff --git a/tests/data/test1030 b/tests/data/test1030 index 28c6e4b2937a..3265e60ba644 100644 --- a/tests/data/test1030 +++ b/tests/data/test1030 @@ -10,45 +10,45 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Length: 26 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Length: 26 +Content-Type: text/html; charset=iso-8859-1 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Length: 26 -Content-Type: text/html; charset=iso-8859-1 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Length: 26 +Content-Type: text/html; charset=iso-8859-1 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! diff --git a/tests/data/test1031 b/tests/data/test1031 index 39f374b05807..6ae80e789bbc 100644 --- a/tests/data/test1031 +++ b/tests/data/test1031 @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTPPORT/want/this/%TESTNUMBER -L # Verify data after the test has been "shot" - + GET /want/this/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1032 b/tests/data/test1032 index d6d4f9ec4c64..48832de9618a 100644 --- a/tests/data/test1032 +++ b/tests/data/test1032 @@ -42,7 +42,7 @@ HTTP HEAD with --range # # Verify data after the test has been "shot" - + HEAD /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=1-3 diff --git a/tests/data/test1033 b/tests/data/test1033 index 460e7f8806ba..179d36cf79dc 100644 --- a/tests/data/test1033 +++ b/tests/data/test1033 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1040 b/tests/data/test1040 index 18dab6c5782e..f5202949e645 100644 --- a/tests/data/test1040 +++ b/tests/data/test1040 @@ -10,11 +10,11 @@ Resume # Server-side - -HTTP/1.1 416 Invalid range -Connection: close -Content-Length: 0 - + +HTTP/1.1 416 Invalid range +Connection: close +Content-Length: 0 + # The file data that exists at the start of the test must be included in @@ -65,7 +65,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=100- diff --git a/tests/data/test1041 b/tests/data/test1041 index 22822e49c98f..68ec259d6fbc 100644 --- a/tests/data/test1041 +++ b/tests/data/test1041 @@ -11,15 +11,15 @@ Content-Range # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Accept-Ranges: bytes -Content-Length: 0 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Accept-Ranges: bytes +Content-Length: 0 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1042 b/tests/data/test1042 index 3fb798048f18..a21a2c92f477 100644 --- a/tests/data/test1042 +++ b/tests/data/test1042 @@ -11,12 +11,12 @@ FAILURE # Server-side # Some servers (e.g. Apache 1.2) respond this way to an invalid byte range - -HTTP/1.1 200 OK -Connection: close -Content-Length: 100 -Content-Type: text/plain - + +HTTP/1.1 200 OK +Connection: close +Content-Length: 100 +Content-Type: text/plain + 012345678 012345678 012345678 @@ -80,7 +80,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 200 33 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=200- diff --git a/tests/data/test1043 b/tests/data/test1043 index d3ca56b0377d..74a76e2ad0d9 100644 --- a/tests/data/test1043 +++ b/tests/data/test1043 @@ -9,14 +9,14 @@ Resume # Server-side - -HTTP/1.1 206 Partial Content -Date: Mon, 13 Nov 2007 13:41:09 GMT -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -Accept-Ranges: bytes -Content-Length: 60 -Content-Range: bytes 40-99/100 - + +HTTP/1.1 206 Partial Content +Date: Mon, 13 Nov 2007 13:41:09 GMT +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +Accept-Ranges: bytes +Content-Length: 60 +Content-Range: bytes 40-99/100 + 012345678 012345678 012345678 @@ -70,7 +70,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=40- diff --git a/tests/data/test1044 b/tests/data/test1044 index 5486b344eda1..38ca5f007d50 100644 --- a/tests/data/test1044 +++ b/tests/data/test1044 @@ -49,10 +49,10 @@ SIZE %TESTNUMBER REST 0 QUIT - -Last-Modified: Sat, 26 Jul 2008 10:26:59 GMT -Content-Length: 9999999999 -Accept-ranges: bytes + +Last-Modified: Sat, 26 Jul 2008 10:26:59 GMT +Content-Length: 9999999999 +Accept-ranges: bytes diff --git a/tests/data/test1045 b/tests/data/test1045 index 6fdfbfe2059b..f7d019f0d201 100644 --- a/tests/data/test1045 +++ b/tests/data/test1045 @@ -10,14 +10,14 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 28 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/plain - + +HTTP/1.1 200 OK +Date: Mon, 28 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/plain + -foo- @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --interface %CLIENTIP # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1046 b/tests/data/test1046 index 3cf9d57bca3e..77b924e3f241 100644 --- a/tests/data/test1046 +++ b/tests/data/test1046 @@ -11,14 +11,14 @@ IPv6 # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 28 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/plain - + +HTTP/1.1 200 OK +Date: Mon, 28 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/plain + -foo- @@ -43,7 +43,7 @@ HTTP-IPv6 GET with numeric localhost --interface # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOST6IP:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test1051 b/tests/data/test1051 index 70a714cde757..56db0655f295 100644 --- a/tests/data/test1051 +++ b/tests/data/test1051 @@ -9,40 +9,40 @@ followlocation # Server-side - -HTTP/1.1 301 Redirect swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 0 -Connection: close - + +HTTP/1.1 301 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 0 +Connection: close + - -HTTP/1.1 100 Continue - -HTTP/1.1 200 Followed here fine swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 51 - + +HTTP/1.1 100 Continue + +HTTP/1.1 200 Followed here fine swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 51 + If this is received, the location following worked - -HTTP/1.1 301 Redirect swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 0 -Connection: close - -HTTP/1.1 100 Continue - -HTTP/1.1 200 Followed here fine swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 51 - + +HTTP/1.1 301 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 0 +Connection: close + +HTTP/1.1 100 Continue + +HTTP/1.1 200 Followed here fine swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 51 + If this is received, the location following worked diff --git a/tests/data/test1052 b/tests/data/test1052 index ec92d479dffc..c3b62cc12f40 100644 --- a/tests/data/test1052 +++ b/tests/data/test1052 @@ -9,36 +9,36 @@ followlocation # Server-side - -HTTP/1.0 301 Redirect swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 0 -Connection: close - + +HTTP/1.0 301 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 0 +Connection: close + - -HTTP/1.0 200 Followed here fine swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 51 - + +HTTP/1.0 200 Followed here fine swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 51 + If this is received, the location following worked - -HTTP/1.0 301 Redirect swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 0 -Connection: close - -HTTP/1.0 200 Followed here fine swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 51 - + +HTTP/1.0 301 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 0 +Connection: close + +HTTP/1.0 200 Followed here fine swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 51 + If this is received, the location following worked diff --git a/tests/data/test1053 b/tests/data/test1053 index 30ca83ab2d67..171d4647a828 100644 --- a/tests/data/test1053 +++ b/tests/data/test1053 @@ -11,39 +11,39 @@ followlocation # Server-side - -HTTP/1.1 307 Redirect swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 0 -Connection: close - + +HTTP/1.1 307 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 0 +Connection: close + - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 11 -Connection: close - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 11 +Connection: close + blablabla - -HTTP/1.1 307 Redirect swsclose -Date: Thu, 29 Jul 2008 14:49:00 GMT -Server: test-server/fake -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 0 -Connection: close - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 11 -Connection: close - + +HTTP/1.1 307 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 0 +Connection: close + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 11 +Connection: close + blablabla diff --git a/tests/data/test1054 b/tests/data/test1054 index 49ca87ba33c0..be45c816c847 100644 --- a/tests/data/test1054 +++ b/tests/data/test1054 @@ -10,30 +10,30 @@ followlocation # # Server-side - -HTTP/1.1 301 OK swsclose -Location: moo/testcase/%TESTNUMBER0002 -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - + +HTTP/1.1 301 OK swsclose +Location: moo/testcase/%TESTNUMBER0002 +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + body - -HTTP/1.1 301 OK swsclose -Location: moo/testcase/%TESTNUMBER0002 -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - + +HTTP/1.1 301 OK swsclose +Location: moo/testcase/%TESTNUMBER0002 +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + body diff --git a/tests/data/test1055 b/tests/data/test1055 index 2d1c604b4dc0..c09561a4f0b0 100644 --- a/tests/data/test1055 +++ b/tests/data/test1055 @@ -13,15 +13,15 @@ STOR # # Server-side - -HTTP/1.1 307 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/html -Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Content-Length: 0 -Connection: close - + +HTTP/1.1 307 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER +Content-Length: 0 +Connection: close + diff --git a/tests/data/test1056 b/tests/data/test1056 index c0b74ec83f56..babb2d6e02d7 100644 --- a/tests/data/test1056 +++ b/tests/data/test1056 @@ -11,30 +11,30 @@ IPv6 # # Server-side - -HTTP/1.1 302 OK swsclose -Location: http://[::1%259999]:%HTTP6PORT/moo/%TESTNUMBER0002 -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: http://[::1%259999]:%HTTP6PORT/moo/%TESTNUMBER0002 +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + body - -HTTP/1.1 302 OK swsclose -Location: http://[::1%259999]:%HTTP6PORT/moo/%TESTNUMBER0002 -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Date: Thu, 31 Jul 2008 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: http://[::1%259999]:%HTTP6PORT/moo/%TESTNUMBER0002 +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + body @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1058 b/tests/data/test1058 index ec7a59c80b47..38234e2a957c 100644 --- a/tests/data/test1058 +++ b/tests/data/test1058 @@ -9,15 +9,15 @@ Content-Range # Server-side - -HTTP/1.1 206 Partial Content -Date: Thu, 31 Jul 2008 13:41:09 GMT -Accept-Ranges: bytes -Content-Length: 101 -Content-Range: bytes 100-200/201 -Connection: close -Content-Type: text/html - + +HTTP/1.1 206 Partial Content +Date: Thu, 31 Jul 2008 13:41:09 GMT +Accept-Ranges: bytes +Content-Length: 101 +Content-Range: bytes 100-200/201 +Connection: close +Content-Type: text/html + ..partial data returned from the server as a result of setting an explicit byte range in the request @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -r -101 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=-101 diff --git a/tests/data/test1059 b/tests/data/test1059 index 44a3ed8a5348..688b92850a43 100644 --- a/tests/data/test1059 +++ b/tests/data/test1059 @@ -12,12 +12,12 @@ FAILURE # # Server-side - -HTTP/1.1 501 Method not implemented swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close -Content-Length: 0 - + +HTTP/1.1 501 Method not implemented swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close +Content-Length: 0 + @@ -46,7 +46,7 @@ ftp://test-number:%TESTNUMBER/wanted/page -p -x %HOSTIP:%HTTPPORT 56 - + CONNECT test-number:%TESTNUMBER HTTP/1.1 Host: test-number:%TESTNUMBER User-Agent: curl/%VERSION diff --git a/tests/data/test1060 b/tests/data/test1060 index d87124a7f547..6e557a1c5fbb 100644 --- a/tests/data/test1060 +++ b/tests/data/test1060 @@ -14,12 +14,12 @@ HTTP proxy Digest auth # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 35701 -X-tra-long-header: %repeat[16080 x a]% - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" +Content-Length: 35701 +X-tra-long-header: %repeat[16080 x a]% + %repeat[700 x And you should ignore this data. aaaaaaaaaaaaaaaa %0a]% @@ -83,7 +83,7 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http:// # Verify data after the test has been "shot" - + CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 Host: test.remote.haxx.se.%TESTNUMBER:8990 User-Agent: curl/%VERSION diff --git a/tests/data/test1061 b/tests/data/test1061 index 46ad8f98f73b..74e2c44d00a0 100644 --- a/tests/data/test1061 +++ b/tests/data/test1061 @@ -88,7 +88,7 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http:// # Verify data after the test has been "shot" - + CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 Host: test.remote.haxx.se.%TESTNUMBER:8990 User-Agent: curl/%VERSION diff --git a/tests/data/test1064 b/tests/data/test1064 index 0d3536c15b6c..e3872a8dfc40 100644 --- a/tests/data/test1064 +++ b/tests/data/test1064 @@ -7,20 +7,20 @@ HTTP PUT - -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 9 - + +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 9 + still ok @@ -60,18 +60,18 @@ Content-Length: 5 test - -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 9 - +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 9 + still ok diff --git a/tests/data/test1065 b/tests/data/test1065 index b66ed29ed26c..bcdabbb39403 100644 --- a/tests/data/test1065 +++ b/tests/data/test1065 @@ -8,20 +8,20 @@ HTTP GET - -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 9 - + +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 9 + still ok @@ -59,18 +59,18 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok -HTTP/1.1 200 A OK -Server: curl test -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 9 - +HTTP/1.1 200 A OK +Server: curl test +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 9 + still ok diff --git a/tests/data/test1066 b/tests/data/test1066 index 7ac4903d1f81..3cb465c1078d 100644 --- a/tests/data/test1066 +++ b/tests/data/test1066 @@ -8,20 +8,20 @@ HTTP GET # Server-side - -HTTP/1.1 200 OK -Server: thebest/1.0 -Content-Type: text/plain -Content-Length: 6 - + +HTTP/1.1 200 OK +Server: thebest/1.0 +Content-Type: text/plain +Content-Length: 6 + first - -HTTP/1.1 200 OK -Server: thebest/1.0 -Content-Type: text/plain -Content-Length: 7 - + +HTTP/1.1 200 OK +Server: thebest/1.0 +Content-Type: text/plain +Content-Length: 7 + second @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUM # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1067 b/tests/data/test1067 index 85a5f8bc3fdb..7085c6012146 100644 --- a/tests/data/test1067 +++ b/tests/data/test1067 @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER --silent --location --referer "firston # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1068 b/tests/data/test1068 index 982385400ed6..7c0406236f56 100644 --- a/tests/data/test1068 +++ b/tests/data/test1068 @@ -10,11 +10,11 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + blablabla diff --git a/tests/data/test1070 b/tests/data/test1070 index f199e71d4bd2..39e2d408f8a8 100644 --- a/tests/data/test1070 +++ b/tests/data/test1070 @@ -8,13 +8,13 @@ HTTP POST # # Server-side - -HTTP/1.1 403 Go away and swsclose -Server: test-server/fake -Content-Type: text/html -Content-Length: 55 -Connection: close - + +HTTP/1.1 403 Go away and swsclose +Server: test-server/fake +Content-Type: text/html +Content-Length: 55 +Connection: close + you are not supposed to be allowed to send things here diff --git a/tests/data/test1071 b/tests/data/test1071 index c98a8cd4aa1c..50b8a460ebbf 100644 --- a/tests/data/test1071 +++ b/tests/data/test1071 @@ -14,47 +14,47 @@ HTTP/1.0 # Server-side - -HTTP/1.0 401 Authorization Required swsclose -Server: testcurl -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/plain -Content-Length: 35 -Connection: close - + +HTTP/1.0 401 Authorization Required swsclose +Server: testcurl +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/plain +Content-Length: 35 +Connection: close + Try again on this HTTP 1.0 server! # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.0 200 OK swsclose -Server: testcurl -Content-Type: text/plain -Content-Length: 23 -Connection: close - + +HTTP/1.0 200 OK swsclose +Server: testcurl +Content-Type: text/plain +Content-Length: 23 +Connection: close + This IS the real page! - -HTTP/1.0 401 Authorization Required swsclose -Server: testcurl -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/plain -Content-Length: 35 -Connection: close - -HTTP/1.0 200 OK swsclose -Server: testcurl -Content-Type: text/plain -Content-Length: 23 -Connection: close - + +HTTP/1.0 401 Authorization Required swsclose +Server: testcurl +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/plain +Content-Length: 35 +Connection: close + +HTTP/1.0 200 OK swsclose +Server: testcurl +Content-Type: text/plain +Content-Length: 23 +Connection: close + This IS the real page! diff --git a/tests/data/test1072 b/tests/data/test1072 index 49d2c4f9feb3..42729a4f8fa2 100644 --- a/tests/data/test1072 +++ b/tests/data/test1072 @@ -15,16 +15,16 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.0 401 Authorization Required swsclose -Server: testcurl -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/plain -Content-Length: 0 -Connection: close - + +HTTP/1.0 401 Authorization Required swsclose +Server: testcurl +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/plain +Content-Length: 0 +Connection: close + diff --git a/tests/data/test1073 b/tests/data/test1073 index f415f0b271e1..cd41e789e08a 100644 --- a/tests/data/test1073 +++ b/tests/data/test1073 @@ -14,14 +14,14 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.0 301 Redirect swsclose -Server: testcurl -Content-Type: text/plain -Location: /newlocation/%TESTNUMBER0002 -Content-Length: 0 -Connection: close - + +HTTP/1.0 301 Redirect swsclose +Server: testcurl +Content-Type: text/plain +Location: /newlocation/%TESTNUMBER0002 +Content-Length: 0 +Connection: close + diff --git a/tests/data/test1074 b/tests/data/test1074 index 77d4caac7262..cbdd5cafacde 100644 --- a/tests/data/test1074 +++ b/tests/data/test1074 @@ -10,19 +10,19 @@ DELAY # Server-side - -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 9 -Connection: Keep-Alive - + +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 +Connection: Keep-Alive + surprise - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + surprise2 @@ -46,21 +46,21 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/wantmore/%TES # Verify data after the test has been "shot" - -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 9 -Connection: Keep-Alive - + +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 +Connection: Keep-Alive + surprise -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + surprise2 - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1075 b/tests/data/test1075 index 0a6e6d3c199a..8ab8e21cf4c6 100644 --- a/tests/data/test1075 +++ b/tests/data/test1075 @@ -13,33 +13,33 @@ HTTP Basic auth # The test server provides no way to respond differently to a subsequent # Basic authenticated request (we really want to respond with 200 for # the second), so just respond with 401 for both and let curl deal with it. - -HTTP/1.1 401 Authorization Required -Server: testcurl -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts" -Content-Type: text/plain -Content-Length: 0 - + +HTTP/1.1 401 Authorization Required +Server: testcurl +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts" +Content-Type: text/plain +Content-Length: 0 + - -HTTP/1.1 401 Authorization Required -Server: testcurl -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts" -Content-Type: text/plain -Content-Length: 0 - -HTTP/1.1 401 Authorization Required -Server: testcurl -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts" -Content-Type: text/plain -Content-Length: 0 - + +HTTP/1.1 401 Authorization Required +Server: testcurl +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts" +Content-Type: text/plain +Content-Length: 0 + +HTTP/1.1 401 Authorization Required +Server: testcurl +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts" +Content-Type: text/plain +Content-Length: 0 + diff --git a/tests/data/test1077 b/tests/data/test1077 index 847aa013d23f..fd2d5fcd6cc5 100644 --- a/tests/data/test1077 +++ b/tests/data/test1077 @@ -12,26 +12,26 @@ HTTP proxy # # Server-side - -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/plain -Content-Length: 9 -Funny-head: yesyes -Proxy-Connection: Keep-Alive - + +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/plain +Content-Length: 9 +Funny-head: yesyes +Proxy-Connection: Keep-Alive + contents - -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/plain -Content-Length: 9 -Funny-head: yesyes -Proxy-Connection: Keep-Alive - + +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/plain +Content-Length: 9 +Funny-head: yesyes +Proxy-Connection: Keep-Alive + contents @@ -57,7 +57,7 @@ FTP over HTTP proxy with downgrade to HTTP 1.0 # # Verify data after the test has been "shot" - + GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1078 b/tests/data/test1078 index 9ec0f44eec01..58923ee5218a 100644 --- a/tests/data/test1078 +++ b/tests/data/test1078 @@ -13,21 +13,21 @@ proxytunnel # # Server-side - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + - -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 -Connection: keep-alive - + +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 +Connection: keep-alive + contents @@ -53,14 +53,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT %HOSTIP:%HTTPPORT HTTP/1.0 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT %HOSTIP:%HTTPPORT HTTP/1.0 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -72,27 +72,27 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 -Connection: keep-alive - + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 +Connection: keep-alive + contents -HTTP/1.0 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 -Connection: keep-alive - +HTTP/1.0 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 +Connection: keep-alive + contents diff --git a/tests/data/test1079 b/tests/data/test1079 index 418a25db0ac9..2ed82bd65073 100644 --- a/tests/data/test1079 +++ b/tests/data/test1079 @@ -9,13 +9,13 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/plain; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/plain; charset=iso-8859-1 +Content-Length: 26 + This is not the real page @@ -25,13 +25,13 @@ This is not the real page - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/plain; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/plain; charset=iso-8859-1 +Content-Length: 26 + @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest 52 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1080 b/tests/data/test1080 index 6848f61bf0eb..504f3651d347 100644 --- a/tests/data/test1080 +++ b/tests/data/test1080 @@ -11,12 +11,12 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/wan # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -48,19 +48,19 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes diff --git a/tests/data/test1081 b/tests/data/test1081 index 418804d33003..3059b0acfcdc 100644 --- a/tests/data/test1081 +++ b/tests/data/test1081 @@ -11,20 +11,20 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0099.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0099.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following - -HTTP/1.1 200 Followed here fine swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 41 - + +HTTP/1.1 200 Followed here fine swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 41 + This second URL does not have a location @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/wan # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -56,19 +56,19 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0099.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0099.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0099.txt?coolsite=yes -HTTP/1.1 200 Followed here fine swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 41 - +HTTP/1.1 200 Followed here fine swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 41 + This second URL does not have a location diff --git a/tests/data/test1082 b/tests/data/test1082 index cc9d461cfe09..cf2cb09ca4b7 100644 --- a/tests/data/test1082 +++ b/tests/data/test1082 @@ -10,14 +10,14 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 28 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/plain - + +HTTP/1.1 200 OK +Date: Mon, 28 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/plain + -foo- @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -4 --interface 127.0.0.1 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1083 b/tests/data/test1083 index eb3fc7cfc305..b2bf5c01f95f 100644 --- a/tests/data/test1083 +++ b/tests/data/test1083 @@ -11,14 +11,14 @@ IPv6 # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 28 Jul 2008 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/plain - + +HTTP/1.1 200 OK +Date: Mon, 28 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/plain + -foo- @@ -46,7 +46,7 @@ HTTP-IPv6 GET with ip6-localhost --interface # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOST6IP:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test1087 b/tests/data/test1087 index 6891fd1b8490..fe1b1f753a0f 100644 --- a/tests/data/test1087 +++ b/tests/data/test1087 @@ -13,57 +13,57 @@ followlocation # # Server-side - -HTTP/1.1 401 Authorization Required -WWW-Authenticate: Basic -Content-Type: text/plain -Content-Length: 0 - + +HTTP/1.1 401 Authorization Required +WWW-Authenticate: Basic +Content-Type: text/plain +Content-Length: 0 + - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Location: http://goto.second.host.now/%TESTNUMBER1002 -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Location: http://goto.second.host.now/%TESTNUMBER1002 +Content-Length: 0 +Connection: close + - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Content-Length: 9 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Content-Length: 9 + contents - -HTTP/1.1 401 Authorization Required -WWW-Authenticate: Basic -Content-Type: text/plain -Content-Length: 0 - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Location: http://goto.second.host.now/%TESTNUMBER1002 -Content-Length: 0 -Connection: close - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Content-Length: 9 - + +HTTP/1.1 401 Authorization Required +WWW-Authenticate: Basic +Content-Type: text/plain +Content-Length: 0 + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Location: http://goto.second.host.now/%TESTNUMBER1002 +Content-Length: 0 +Connection: close + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Content-Length: 9 + contents @@ -88,7 +88,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 Host: first.host.it.is User-Agent: curl/%VERSION diff --git a/tests/data/test1088 b/tests/data/test1088 index 08d418a72eca..8b262052ee6a 100644 --- a/tests/data/test1088 +++ b/tests/data/test1088 @@ -14,57 +14,57 @@ followlocation # # Server-side - -HTTP/1.1 401 Authorization Required -WWW-Authenticate: Basic -Content-Type: text/plain -Content-Length: 0 - + +HTTP/1.1 401 Authorization Required +WWW-Authenticate: Basic +Content-Type: text/plain +Content-Length: 0 + - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Location: http://goto.second.host.now/%TESTNUMBER1002 -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Location: http://goto.second.host.now/%TESTNUMBER1002 +Content-Length: 0 +Connection: close + - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Content-Length: 9 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Content-Length: 9 + contents - -HTTP/1.1 401 Authorization Required -WWW-Authenticate: Basic -Content-Type: text/plain -Content-Length: 0 - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Location: http://goto.second.host.now/%TESTNUMBER1002 -Content-Length: 0 -Connection: close - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/plain -Funny-head: yesyes -Content-Length: 9 - + +HTTP/1.1 401 Authorization Required +WWW-Authenticate: Basic +Content-Type: text/plain +Content-Length: 0 + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Location: http://goto.second.host.now/%TESTNUMBER1002 +Content-Length: 0 +Connection: close + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/plain +Funny-head: yesyes +Content-Length: 9 + contents @@ -89,7 +89,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1 Host: first.host.it.is User-Agent: curl/%VERSION diff --git a/tests/data/test1089 b/tests/data/test1089 index b65f0ddd4f7c..82ff880ff0bf 100644 --- a/tests/data/test1089 +++ b/tests/data/test1089 @@ -11,23 +11,23 @@ followlocation # # Server-side - -HTTP/1.1 302 OK swsbounce swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - + +HTTP/1.1 302 OK swsbounce swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + monster - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 15 -Connection: close -Content-Type: text/plain; charset=us-ascii - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 15 +Connection: close +Content-Type: text/plain; charset=us-ascii + bigger monster @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n%{num_redirects}\n%{si # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -63,20 +63,20 @@ Accept: */* - -HTTP/1.1 302 OK swsbounce swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 15 -Connection: close -Content-Type: text/plain; charset=us-ascii - + +HTTP/1.1 302 OK swsbounce swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 15 +Connection: close +Content-Type: text/plain; charset=us-ascii + bigger monster 2 1 diff --git a/tests/data/test1090 b/tests/data/test1090 index 454913ac1be7..ad3c59d1136f 100644 --- a/tests/data/test1090 +++ b/tests/data/test1090 @@ -12,30 +12,30 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.1 302 OK swsbounce swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - + +HTTP/1.1 302 OK swsbounce swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + monster - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Transfer-Encoding: chunked -Connection: close -Content-Type: text/plain; charset=us-ascii - -0007 -bigger -0008 + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Transfer-Encoding: chunked +Connection: close +Content-Type: text/plain; charset=us-ascii + +0007 +bigger%spc% +0008 monster - -0 - + +0 + @@ -57,7 +57,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n%{num_redirects}\n%{si # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -70,20 +70,20 @@ Accept: */* - -HTTP/1.1 302 OK swsbounce swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Transfer-Encoding: chunked -Connection: close -Content-Type: text/plain; charset=us-ascii - + +HTTP/1.1 302 OK swsbounce swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Transfer-Encoding: chunked +Connection: close +Content-Type: text/plain; charset=us-ascii + bigger monster 2 1 diff --git a/tests/data/test1092 b/tests/data/test1092 index 2c5fbb81cdc0..34dffac34ebb 100644 --- a/tests/data/test1092 +++ b/tests/data/test1092 @@ -43,7 +43,7 @@ FTP with type=i over HTTP proxy # # Verify data after the test has been "shot" - + GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER;type=i HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1094 b/tests/data/test1094 index ec1728976bdc..32e09309639c 100644 --- a/tests/data/test1094 +++ b/tests/data/test1094 @@ -16,11 +16,11 @@ data returned to client - -a chunk of -data -returned - to client + +a chunk of +data +returned + to client diff --git a/tests/data/test1095 b/tests/data/test1095 index 942aa0e10cc8..86cab2c8fbaf 100644 --- a/tests/data/test1095 +++ b/tests/data/test1095 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1097 b/tests/data/test1097 index 84b9300d49b9..4405ba0883e2 100644 --- a/tests/data/test1097 +++ b/tests/data/test1097 @@ -11,29 +11,29 @@ HTTP proxy NTLM auth # Server-side - -HTTP/1.1 200 We are fine and cool -Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 -Content-Length: 27 - + +HTTP/1.1 200 We are fine and cool +Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 +Content-Length: 27 + This is all fine and dandy # This is the CONNECT response - -HTTP/1.1 200 We are fine and cool -Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 - + +HTTP/1.1 200 We are fine and cool +Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 + - -HTTP/1.1 200 We are fine and cool -Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 - -HTTP/1.1 200 We are fine and cool -Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 -Content-Length: 27 - + +HTTP/1.1 200 We are fine and cool +Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 + +HTTP/1.1 200 We are fine and cool +Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2 +Content-Length: 27 + This is all fine and dandy diff --git a/tests/data/test1098 b/tests/data/test1098 index 4746b5fde9d3..6249587c1792 100644 --- a/tests/data/test1098 +++ b/tests/data/test1098 @@ -10,11 +10,11 @@ CURLOPT_PROXY # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 + hello @@ -43,7 +43,7 @@ ftp://ftp-site/moo/%TESTNUMBER ftp://ftp-site/moo/%TESTNUMBER --proxy http://%HO # # Verify data after the test has been "shot" - + GET ftp://ftp-site/moo/%TESTNUMBER HTTP/1.1 Host: ftp-site:21 User-Agent: curl/%VERSION @@ -57,16 +57,16 @@ Accept: */* Proxy-Connection: Keep-Alive - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 + hello -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 + hello diff --git a/tests/data/test11 b/tests/data/test11 index 60164d6d62f2..6f4d82f73d60 100644 --- a/tests/data/test11 +++ b/tests/data/test11 @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1100 b/tests/data/test1100 index 500a05b31a57..8ba9bbf53531 100644 --- a/tests/data/test1100 +++ b/tests/data/test1100 @@ -9,51 +9,51 @@ HTTP NTLM auth # Server-side - -HTTP/1.1 200 Thanks for this! swsclose -Content-Length: 25 - + +HTTP/1.1 200 Thanks for this! swsclose +Content-Length: 25 + This is the final page ! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 302 Thanks for this, but we want to redir you! -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Location: /%TESTNUMBER -Content-Length: 34 - + +HTTP/1.1 302 Thanks for this, but we want to redir you! +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Location: /%TESTNUMBER +Content-Length: 34 + This is not the real page either! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 302 Thanks for this, but we want to redir you! -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Location: /%TESTNUMBER -Content-Length: 34 - -HTTP/1.1 200 Thanks for this! swsclose -Content-Length: 25 - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 302 Thanks for this, but we want to redir you! +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Location: /%TESTNUMBER +Content-Length: 34 + +HTTP/1.1 200 Thanks for this! swsclose +Content-Length: 25 + This is the final page ! diff --git a/tests/data/test1101 b/tests/data/test1101 index 9e2dff25be6e..a6471a4a6488 100644 --- a/tests/data/test1101 +++ b/tests/data/test1101 @@ -11,13 +11,13 @@ NO_PROXY # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 4 -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 4 +Content-Type: text/html + boo @@ -42,7 +42,7 @@ http://user:secret@%HOSTIP:%HTTPPORT/gimme/%TESTNUMBER # Verify data after the test has been "shot" - + GET /gimme/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:secret]b64% diff --git a/tests/data/test1104 b/tests/data/test1104 index c0fabfc1d586..e4dcf803669c 100644 --- a/tests/data/test1104 +++ b/tests/data/test1104 @@ -69,7 +69,7 @@ proxy # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1105 b/tests/data/test1105 index 78bed7524e88..aa84c862cb11 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -10,19 +10,19 @@ cookiejar # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes swsclose -Set-Cookie: foobar=name; -Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; -Set-Cookie: partmatch=present; domain=.0.0.1; path=/; -Set-Cookie: foo%tab%bar=barfoo -Set-Cookie: bar%tab%foo= -Set-Cookie: bar=foo%tab%bar - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes swsclose +Set-Cookie: foobar=name; +Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; +Set-Cookie: partmatch=present; domain=.0.0.1; path=/; +Set-Cookie: foo%tab%bar=barfoo +Set-Cookie: bar%tab%foo= +Set-Cookie: bar=foo%tab%bar + diff --git a/tests/data/test1106 b/tests/data/test1106 index e8bb0a52afa2..32d73ef5f6b1 100644 --- a/tests/data/test1106 +++ b/tests/data/test1106 @@ -9,13 +9,13 @@ HTTP proxy # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -44,7 +44,7 @@ ftp://%HOSTIP:23456/%TESTNUMBER # Verify data after the test has been "shot" - + GET ftp://%HOSTIP:23456/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:23456 User-Agent: curl/%VERSION diff --git a/tests/data/test1109 b/tests/data/test1109 index da640789f7b9..043e22cd0829 100644 --- a/tests/data/test1109 +++ b/tests/data/test1109 @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER#test # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1110 b/tests/data/test1110 index d2dfcc4f350c..2d57e49d61e1 100644 --- a/tests/data/test1110 +++ b/tests/data/test1110 @@ -34,7 +34,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?q=foobar#fragment # Verify data after the test has been "shot" - + GET /%TESTNUMBER?q=foobar HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1111 b/tests/data/test1111 index f68668a520a4..8cf705afe7e1 100644 --- a/tests/data/test1111 +++ b/tests/data/test1111 @@ -34,7 +34,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?q=foobar#fragment#fragment2 # Verify data after the test has been "shot" - + GET /%TESTNUMBER?q=foobar HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1115 b/tests/data/test1115 index 176570992ee4..15a4785672a9 100644 --- a/tests/data/test1115 +++ b/tests/data/test1115 @@ -8,17 +8,17 @@ HTTP 1xx response code # Server-side - -HTTP/1.1 104 Experiment -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 200 OK swsbounce -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 104 Experiment +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 200 OK swsbounce +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1116 b/tests/data/test1116 index 0775bb42db3f..c92b6255310e 100644 --- a/tests/data/test1116 +++ b/tests/data/test1116 @@ -10,33 +10,33 @@ DELAY # # Server-side - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Connection: mooo + +40 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +30 +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +21;heresatest=moooo cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data -another-header: yes - + +0 +chunky-trailer: header data +another-header: yes + - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Connection: mooo - + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Connection: mooo + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data -another-header: yes +chunky-trailer: header data +another-header: yes writedelay: 10 @@ -60,21 +60,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Connection: mooo - -chunky-trailer: header data -another-header: yes + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Connection: mooo + +chunky-trailer: header data +another-header: yes diff --git a/tests/data/test1117 b/tests/data/test1117 index c133501027c5..1558cc7b05d0 100644 --- a/tests/data/test1117 +++ b/tests/data/test1117 @@ -10,24 +10,24 @@ DELAY # Server-side - -HTTP/1.1 416 Requested Range Not Satisfiable -Date: Tue, 09 Sep 2010 14:49:00 GMT -Accept-Ranges: bytes -Content-Length: 115 - + +HTTP/1.1 416 Requested Range Not Satisfiable +Date: Tue, 09 Sep 2010 14:49:00 GMT +Accept-Ranges: bytes +Content-Length: 115 + This is a long error message that is large enough that the test server is guaranteed to split it into two packets. - -HTTP/1.1 206 Partial Content -Date: Tue, 09 Sep 2010 14:49:01 GMT -Accept-Ranges: bytes -Content-Range: bytes 10-18/155 -Content-Length: 13 -Content-Type: text/plain - + +HTTP/1.1 206 Partial Content +Date: Tue, 09 Sep 2010 14:49:01 GMT +Accept-Ranges: bytes +Content-Range: bytes 10-18/155 +Content-Length: 13 +Content-Type: text/plain + partial body @@ -51,25 +51,25 @@ HTTP with invalid range then another URL # Verify data after the test has been "shot" - -HTTP/1.1 416 Requested Range Not Satisfiable -Date: Tue, 09 Sep 2010 14:49:00 GMT -Accept-Ranges: bytes -Content-Length: 115 - + +HTTP/1.1 416 Requested Range Not Satisfiable +Date: Tue, 09 Sep 2010 14:49:00 GMT +Accept-Ranges: bytes +Content-Length: 115 + This is a long error message that is large enough that the test server is guaranteed to split it into two packets. -HTTP/1.1 206 Partial Content -Date: Tue, 09 Sep 2010 14:49:01 GMT -Accept-Ranges: bytes -Content-Range: bytes 10-18/155 -Content-Length: 13 -Content-Type: text/plain - +HTTP/1.1 206 Partial Content +Date: Tue, 09 Sep 2010 14:49:01 GMT +Accept-Ranges: bytes +Content-Range: bytes 10-18/155 +Content-Length: 13 +Content-Type: text/plain + partial body - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=10-22 diff --git a/tests/data/test1118 b/tests/data/test1118 index 13f686f4034c..e188bc31eb4f 100644 --- a/tests/data/test1118 +++ b/tests/data/test1118 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT?email=name@example.com/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /?email=name@example.com/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1121 b/tests/data/test1121 index 0804c59e26a8..1e17f95e204d 100644 --- a/tests/data/test1121 +++ b/tests/data/test1121 @@ -7,12 +7,12 @@ HTTP # # Server-side - -HTTP/1.0 200 OK -Server: test-server/fake -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.0 200 OK +Server: test-server/fake +Content-Type: text/html +Content-Length: 6 + blaha @@ -34,7 +34,7 @@ HTTP multiple provided Host: headers # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: host1 User-Agent: curl/%VERSION diff --git a/tests/data/test1122 b/tests/data/test1122 index cbd74b2ea90a..684b6f8dc6f5 100644 --- a/tests/data/test1122 +++ b/tests/data/test1122 @@ -10,30 +10,30 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip -Content-Length: 44 - + +HTTP/1.1 200 OK swsclose +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip +Content-Length: 44 + %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% %hex[%02%71%60%18%00%00%00]hex% # This ignore Content-Length - -HTTP/1.1 200 OK swsclose -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip -Content-Length: 44 - + +HTTP/1.1 200 OK swsclose +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip +Content-Length: 44 + line 1 line 2 line 3 @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1123 b/tests/data/test1123 index 2a1b10605fce..594ff668cdc5 100644 --- a/tests/data/test1123 +++ b/tests/data/test1123 @@ -171,7 +171,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1124 b/tests/data/test1124 index 33415aab798d..78e640dd64c7 100644 --- a/tests/data/test1124 +++ b/tests/data/test1124 @@ -11,30 +11,30 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2024 21:56:53 GMT -Server: Something-TE-friendly/0.1 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - -2c + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2024 21:56:53 GMT +Server: Something-TE-friendly/0.1 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + +2c %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% -%hex[%02%71%60%18%00%00%00]hex% -0 - +%hex[%02%71%60%18%00%00%00]hex% +0 + - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2024 21:56:53 GMT -Server: Something-TE-friendly/0.1 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2024 21:56:53 GMT +Server: Something-TE-friendly/0.1 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + line 1 line 2 line 3 @@ -62,7 +62,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1125 b/tests/data/test1125 index 1f1f15383589..caaa0b284977 100644 --- a/tests/data/test1125 +++ b/tests/data/test1125 @@ -10,30 +10,30 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - -2c + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + +2c %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% -%hex[%02%71%60%18%00%00%00]hex% -0 - +%hex[%02%71%60%18%00%00%00]hex% +0 + - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + line 1 line 2 line 3 @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection: close" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1126 b/tests/data/test1126 index 9fb7c5a832d2..5ad2df621556 100644 --- a/tests/data/test1126 +++ b/tests/data/test1126 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1127 b/tests/data/test1127 index 8f2b6b1103ec..126073e4df9c 100644 --- a/tests/data/test1127 +++ b/tests/data/test1127 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1128 b/tests/data/test1128 index 977ed4d8be42..2932cabcad6b 100644 --- a/tests/data/test1128 +++ b/tests/data/test1128 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -z # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1129 b/tests/data/test1129 index 44b0f3ab8268..9a81043b1771 100644 --- a/tests/data/test1129 +++ b/tests/data/test1129 @@ -74,7 +74,7 @@ Content-Type: text/html -foo- - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1130 b/tests/data/test1130 index 59ca8c52eb62..1057d06d722e 100644 --- a/tests/data/test1130 +++ b/tests/data/test1130 @@ -75,7 +75,7 @@ Content-Type: text/html -foo- - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1131 b/tests/data/test1131 index e9c37395e573..51601c03adb8 100644 --- a/tests/data/test1131 +++ b/tests/data/test1131 @@ -75,7 +75,7 @@ Content-Type: text/html FAILURE2 - + PUT /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1133 b/tests/data/test1133 index 9582fc4d08fb..4b7cb321bceb 100644 --- a/tests/data/test1133 +++ b/tests/data/test1133 @@ -7,12 +7,12 @@ HTTP FORMPOST # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 10 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 10 + blablabla diff --git a/tests/data/test1138 b/tests/data/test1138 index ec7048c4adaf..7579fcd21dd2 100644 --- a/tests/data/test1138 +++ b/tests/data/test1138 @@ -9,14 +9,14 @@ followlocation # # Server-side - + HTTP/1.1 302 OK swsclose Location: ../moo.html/?name=%hex[%d8%a2%d8%ba%d8%a7%d8%b2%2d%d8%b3%d9%85%2d%d8%b2%d8%af%d8%a7%db%8c%db%8c%2d%d8%a7%d8%b2%2d%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1%2d%d9%be%d9%88%d9%84]hex%&testcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close - + HTTP/1.1 200 OK swsclose Location: this should be ignored Date: Tue, 09 Nov 2010 14:49:00 GMT @@ -24,7 +24,7 @@ Connection: close body - + HTTP/1.1 302 OK swsclose Location: ../moo.html/?name=%hex[%d8%a2%d8%ba%d8%a7%d8%b2%2d%d8%b3%d9%85%2d%d8%b2%d8%af%d8%a7%db%8c%db%8c%2d%d8%a7%d8%b2%2d%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1%2d%d9%be%d9%88%d9%84]hex%&testcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1141 b/tests/data/test1141 index 68eea75dc22b..c0d6122c2db6 100644 --- a/tests/data/test1141 +++ b/tests/data/test1141 @@ -54,7 +54,7 @@ proxy # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1142 b/tests/data/test1142 index 64793147cc09..d42dddf31ac0 100644 --- a/tests/data/test1142 +++ b/tests/data/test1142 @@ -49,7 +49,7 @@ proxy # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1143 b/tests/data/test1143 index b845a6576260..9157433b6319 100644 --- a/tests/data/test1143 +++ b/tests/data/test1143 @@ -37,7 +37,7 @@ MSYS2_ARG_CONV_EXCL=http:/ # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1144 b/tests/data/test1144 index 7915cb610bd3..3d5cb0b1d3eb 100644 --- a/tests/data/test1144 +++ b/tests/data/test1144 @@ -54,7 +54,7 @@ HTTP HEAD, receive no headers only body # # Verify data after the test has been "shot" - + HEAD /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1148 b/tests/data/test1148 index ba37c8dd30a8..c1ad7fe8844c 100644 --- a/tests/data/test1148 +++ b/tests/data/test1148 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -# --stderr %LOGDIR/stderrlog%TESTNUMBER # - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1150 b/tests/data/test1150 index e4d0ed01a673..d93fc630966b 100644 --- a/tests/data/test1150 +++ b/tests/data/test1150 @@ -39,7 +39,7 @@ proxy # Verify data after the test has been "shot" - + GET http://test.remote.example.com.%TESTNUMBER:150/path HTTP/1.1 Host: test.remote.example.com.%TESTNUMBER:150 User-Agent: curl/%VERSION diff --git a/tests/data/test1151 b/tests/data/test1151 index f8b14ebb4eec..eb94e9243206 100644 --- a/tests/data/test1151 +++ b/tests/data/test1151 @@ -48,7 +48,7 @@ cookies # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1154 b/tests/data/test1154 index 27bfc17ae4a9..5ffd512380a9 100644 --- a/tests/data/test1154 +++ b/tests/data/test1154 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1155 b/tests/data/test1155 index 195028a4d47c..ba73600fa69e 100644 --- a/tests/data/test1155 +++ b/tests/data/test1155 @@ -10,12 +10,12 @@ cookies # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 -Set-Cookie: domain=value;path=/ - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 +Set-Cookie: domain=value;path=/ + @@ -37,7 +37,7 @@ cookies # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1156 b/tests/data/test1156 index 349269427318..c81a9dce323c 100644 --- a/tests/data/test1156 +++ b/tests/data/test1156 @@ -11,37 +11,37 @@ Range # Server-side - -HTTP/1.1 200 OK -Content-Type: text/html -Content-Length: 5 - + +HTTP/1.1 200 OK +Content-Type: text/html +Content-Length: 5 + body - -HTTP/1.1 200 OK -Content-Type: text/html -Content-Length: 5 -Content-Range: bytes 3/7 - + +HTTP/1.1 200 OK +Content-Type: text/html +Content-Length: 5 +Content-Range: bytes 3/7 + body - -HTTP/1.1 416 Requested Range Not Satisfiable -Content-Type: text/html -Content-Length: 5 - + +HTTP/1.1 416 Requested Range Not Satisfiable +Content-Type: text/html +Content-Length: 5 + body - -HTTP/1.1 416 Requested Range Not Satisfiable -Content-Type: text/html -Content-Length: 5 -Content-Range: bytes */2 - + +HTTP/1.1 416 Requested Range Not Satisfiable +Content-Type: text/html +Content-Length: 5 +Content-Range: bytes */2 + body diff --git a/tests/data/test1157 b/tests/data/test1157 index b13536773f7f..91fea7437c74 100644 --- a/tests/data/test1157 +++ b/tests/data/test1157 @@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -H @%LOGDIR/heads%TESTNUMBER.txt # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1158 b/tests/data/test1158 index 34845a74f315..61394311ee19 100644 --- a/tests/data/test1158 +++ b/tests/data/test1158 @@ -7,12 +7,12 @@ HTTP FORMPOST # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 10 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 10 + blablabla diff --git a/tests/data/test1159 b/tests/data/test1159 index 769e84db3c32..3f7fa338936a 100644 --- a/tests/data/test1159 +++ b/tests/data/test1159 @@ -11,12 +11,12 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: ht3p://localhost/ -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: ht3p://localhost/ +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following @@ -36,19 +36,19 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: ht3p://localhost/ -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: ht3p://localhost/ +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following ht3p://localhost/ diff --git a/tests/data/test1160 b/tests/data/test1160 index eb0dad216e09..6b7c904cebca 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -11,12 +11,12 @@ cookies # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 -Set-Cookie: ____________%hex[%ff]hex%= ;%repeat[117 x %20]%%hex[%ff]hex%%repeat[2602 x %20]%%repeat[434 x z]%%hex[%86%85%85%80]hex%%repeat[49 x z]%%hex[%fa]hex%%repeat[540 x z]%%hex[%f3%a0%81%96]hex%zzzzzzzzzzzz~%repeat[82 x z]%%hex[%b6]hex%%repeat[364 x z]% - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 +Set-Cookie: ____________%hex[%ff]hex%= ;%repeat[117 x %20]%%hex[%ff]hex%%repeat[2602 x %20]%%repeat[434 x z]%%hex[%86%85%85%80]hex%%repeat[49 x z]%%hex[%fa]hex%%repeat[540 x z]%%hex[%f3%a0%81%96]hex%zzzzzzzzzzzz~%repeat[82 x z]%%hex[%b6]hex%%repeat[364 x z]% + @@ -38,7 +38,7 @@ cookies # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1161 b/tests/data/test1161 index 4dbb0a4a7b6d..8e30f414dc2a 100644 --- a/tests/data/test1161 +++ b/tests/data/test1161 @@ -10,12 +10,12 @@ cookies # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 -Set-Cookie: ckyPersistent=permanent;path=;path=/ - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 +Set-Cookie: ckyPersistent=permanent;path=;path=/ + @@ -37,7 +37,7 @@ cookies # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1164 b/tests/data/test1164 index c5c25d339db9..27934a7b7597 100644 --- a/tests/data/test1164 +++ b/tests/data/test1164 @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{size_download}\n' --http0.9 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1166 b/tests/data/test1166 index 6720c09d31f7..05bb1e3eaf0c 100644 --- a/tests/data/test1166 +++ b/tests/data/test1166 @@ -10,13 +10,13 @@ cookies # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Set-Cookie: trackyou=want; path=/ -Content-Length: 68 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Set-Cookie: trackyou=want; path=/ +Content-Length: 68 + This server reply is for testing a Location: following with cookies @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUM # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1168 b/tests/data/test1168 index 04403597de8a..855e50f0338d 100644 --- a/tests/data/test1168 +++ b/tests/data/test1168 @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L -u "catmai#d:#DZaRJYrixKE*gFY" # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[catmai#d:#DZaRJYrixKE*gFY]b64% diff --git a/tests/data/test1170 b/tests/data/test1170 index 499044e39902..6a89c26e257d 100644 --- a/tests/data/test1170 +++ b/tests/data/test1170 @@ -10,30 +10,30 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - -2c + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + +2c %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% -%hex[%02%71%60%18%00%00%00]hex% -0 - +%hex[%02%71%60%18%00%00%00]hex% +0 + - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + line 1 line 2 line 3 @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection:" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1171 b/tests/data/test1171 index 5dd570add8d2..545b79f77fbc 100644 --- a/tests/data/test1171 +++ b/tests/data/test1171 @@ -10,30 +10,30 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - -2c + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + +2c %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% -%hex[%02%71%60%18%00%00%00]hex% -0 - +%hex[%02%71%60%18%00%00%00]hex% +0 + - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + line 1 line 2 line 3 @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection;" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1172 b/tests/data/test1172 index 6afe814c0489..8060a592c416 100644 --- a/tests/data/test1172 +++ b/tests/data/test1172 @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --no-http0.9 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1174 b/tests/data/test1174 index 21dd5d54b659..f8f064a5430d 100644 --- a/tests/data/test1174 +++ b/tests/data/test1174 @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1176 b/tests/data/test1176 index 6bfe6a6f6a62..6d38e8689f08 100644 --- a/tests/data/test1176 +++ b/tests/data/test1176 @@ -8,18 +8,18 @@ globbing # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -41,25 +41,25 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o '%LOGDIR/base-#0' # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- diff --git a/tests/data/test1178 b/tests/data/test1178 index 6f5fdd7161ab..faf93eadb6d6 100644 --- a/tests/data/test1178 +++ b/tests/data/test1178 @@ -40,7 +40,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Proxy-Authorization: Basic %b64[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB]b64% diff --git a/tests/data/test1180 b/tests/data/test1180 index 8607f825525d..4b2577e75a5f 100644 --- a/tests/data/test1180 +++ b/tests/data/test1180 @@ -36,7 +36,7 @@ HTTP GET request with proxy and -H "Proxy-Connection: keep-alive" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1181 b/tests/data/test1181 index 8fe4587dfcb0..26b924e98682 100644 --- a/tests/data/test1181 +++ b/tests/data/test1181 @@ -8,12 +8,12 @@ HTTP proxy # Server-side - -HTTP/1.1 200 OK -Server: Blafasel/5.0 -Date: Sat, 16 Jan 2021 14:48:30 GMT -Content-Length: 12 - + +HTTP/1.1 200 OK +Server: Blafasel/5.0 +Date: Sat, 16 Jan 2021 14:48:30 GMT +Content-Length: 12 + Bla bla bla @@ -36,7 +36,7 @@ HTTP GET request with proxy and "Proxy-Connection: Keep-Alive" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1183 b/tests/data/test1183 index 34cba4aa5187..fc5eb2eb00cd 100644 --- a/tests/data/test1183 +++ b/tests/data/test1183 @@ -8,12 +8,12 @@ HTTP GET # Server-side - -HTTP/1.1 200 OK -Server: Blafasel/5.0 -Date: Sat, 16 Jan 2021 14:48:30 GMT -Content-Length: 12 - + +HTTP/1.1 200 OK +Server: Blafasel/5.0 +Date: Sat, 16 Jan 2021 14:48:30 GMT +Content-Length: 12 + Bla bla bla @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify that the %TESTNUMBER has been resolved to %TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1184 b/tests/data/test1184 index 0f5d8c91f0d2..0fa1c38e3def 100644 --- a/tests/data/test1184 +++ b/tests/data/test1184 @@ -11,29 +11,29 @@ proxytunnel # # Server-side - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + - -HTTP/1.1 302 OK -Location: http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 -Connection: close - + +HTTP/1.1 302 OK +Location: http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 +Connection: close + contents - -HTTP/1.1 200 OK -Content-Length: 7 - + +HTTP/1.1 200 OK +Content-Length: 7 + second @@ -59,19 +59,19 @@ proxy # # Verify data after the test has been "shot" - -CONNECT %HOSTIP.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: %HOSTIP.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - -CONNECT %HOSTIP.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: %HOSTIP.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT %HOSTIP.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: %HOSTIP.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + +CONNECT %HOSTIP.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: %HOSTIP.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP.%TESTNUMBER:%HTTPPORT Accept: */* @@ -83,25 +83,25 @@ Accept: */* User-Agent: %TESTNUMBER-agent - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - -HTTP/1.1 302 OK -Location: http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 -Connection: close - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - -HTTP/1.1 200 OK -Content-Length: 7 - + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + +HTTP/1.1 302 OK +Location: http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 +Connection: close + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + +HTTP/1.1 200 OK +Content-Length: 7 + second diff --git a/tests/data/test1186 b/tests/data/test1186 index dabe270968b1..668459f8c53e 100644 --- a/tests/data/test1186 +++ b/tests/data/test1186 @@ -7,12 +7,12 @@ HTTP FORMPOST # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 10 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 10 + blablabla diff --git a/tests/data/test1187 b/tests/data/test1187 index 5fbf4efd3472..3cae202eb193 100644 --- a/tests/data/test1187 +++ b/tests/data/test1187 @@ -23,11 +23,11 @@ smtp SMTP multipart with file name escaping - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=This is the mail text" -F '=File content;filename="strange\file\"name"' diff --git a/tests/data/test1188 b/tests/data/test1188 index 6c7f8261e209..042e68255837 100644 --- a/tests/data/test1188 +++ b/tests/data/test1188 @@ -9,11 +9,11 @@ HTTP GET # Server-side - -HTTP/1.1 404 Not Found -Content-Length: 0 -Connection: close - + +HTTP/1.1 404 Not Found +Content-Length: 0 +Connection: close + @@ -32,7 +32,7 @@ http # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1189 b/tests/data/test1189 index 0c19e70f77d6..d1f4a6a80d5a 100644 --- a/tests/data/test1189 +++ b/tests/data/test1189 @@ -7,12 +7,12 @@ HTTP FORMPOST # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 10 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 10 + blablabla diff --git a/tests/data/test1197 b/tests/data/test1197 index 2daf7939d856..5ec9c19d4569 100644 --- a/tests/data/test1197 +++ b/tests/data/test1197 @@ -11,23 +11,23 @@ followlocation # # Server-side - -HTTP/1.1 302 OK swsbounce swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - + +HTTP/1.1 302 OK swsbounce swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + monster - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 15 -Connection: close -Content-Type: text/plain; charset=us-ascii - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 15 +Connection: close +Content-Type: text/plain; charset=us-ascii + bigger monster @@ -65,20 +65,20 @@ Accept: */* - -HTTP/1.1 302 OK swsbounce swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 15 -Connection: close -Content-Type: text/plain; charset=us-ascii - + +HTTP/1.1 302 OK swsbounce swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 15 +Connection: close +Content-Type: text/plain; charset=us-ascii + bigger monster GET diff --git a/tests/data/test12 b/tests/data/test12 index 71cfdb6e6827..ac8309e5dffa 100644 --- a/tests/data/test12 +++ b/tests/data/test12 @@ -9,18 +9,18 @@ Content-Range # Server-side - -HTTP/1.1 206 Partial Content -Date: Mon, 13 Nov 2000 13:41:09 GMT -Server: Apache/1.3.11 (Unix) PHP/3.0.14 -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 101 -Content-Range: bytes 100-200/3527 -Connection: close -Content-Type: text/html - + +HTTP/1.1 206 Partial Content +Date: Mon, 13 Nov 2000 13:41:09 GMT +Server: Apache/1.3.11 (Unix) PHP/3.0.14 +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 101 +Content-Range: bytes 100-200/3527 +Connection: close +Content-Type: text/html + ..partial data returned from the server as a result of setting an explicit byte range in the request @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -r 100-200 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=100-200 diff --git a/tests/data/test1200 b/tests/data/test1200 index bf40f1c8a493..c61884668f0e 100644 --- a/tests/data/test1200 +++ b/tests/data/test1200 @@ -9,10 +9,10 @@ INDEX # # Server-side - -iMenu results error.host 1 -0Selector /bar bar.foo.invalid 70 -. + +iMenu results error.host 1 +0Selector /bar bar.foo.invalid 70 +. diff --git a/tests/data/test1201 b/tests/data/test1201 index aec07681e133..f87d9215d03d 100644 --- a/tests/data/test1201 +++ b/tests/data/test1201 @@ -9,10 +9,10 @@ SELECTOR # # Server-side - -iMenu results error.host 1 -0Selector /selector/SELECTOR /bar bar.foo.invalid 70 -. + +iMenu results error.host 1 +0Selector /selector/SELECTOR /bar bar.foo.invalid 70 +. diff --git a/tests/data/test1202 b/tests/data/test1202 index 586e658d66d0..f307eae371ee 100644 --- a/tests/data/test1202 +++ b/tests/data/test1202 @@ -9,11 +9,11 @@ QUERY # # Server-side - -iSearch results error.host 1 -0Query query succeeded /foo foo.bar.invalid 70 -0Selector /the/search/engine /bar bar.foo.invalid 70 -. + +iSearch results error.host 1 +0Query query succeeded /foo foo.bar.invalid 70 +0Selector /the/search/engine /bar bar.foo.invalid 70 +. diff --git a/tests/data/test1203 b/tests/data/test1203 index 29f9bed0ad18..51000e106c7a 100644 --- a/tests/data/test1203 +++ b/tests/data/test1203 @@ -10,10 +10,10 @@ INDEX # # Server-side - -iMenu results error.host 1 -0Selector /bar bar.foo.invalid 70 -. + +iMenu results error.host 1 +0Selector /bar bar.foo.invalid 70 +. diff --git a/tests/data/test1204 b/tests/data/test1204 index 89d14ad1f87d..bc1a201d1d73 100644 --- a/tests/data/test1204 +++ b/tests/data/test1204 @@ -9,38 +9,38 @@ HTTP Basic auth # Server-side - -HTTP/1.1 401 Authorization Required swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: X-MobileMe-AuthToken realm="Newcastle", Basic realm="fun fun fun" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: X-MobileMe-AuthToken realm="Newcastle", Basic realm="fun fun fun" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets the second request - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: X-MobileMe-AuthToken realm="Newcastle", Basic realm="fun fun fun" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: X-MobileMe-AuthToken realm="Newcastle", Basic realm="fun fun fun" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1205 b/tests/data/test1205 index 6fa833893a9d..ebd691cd3c41 100644 --- a/tests/data/test1205 +++ b/tests/data/test1205 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1210 b/tests/data/test1210 index d709a6f72a5f..ade12a2dddf6 100644 --- a/tests/data/test1210 +++ b/tests/data/test1210 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?junk -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER?junk HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1212 b/tests/data/test1212 index fa7add16774e..a9a1dfccc8b8 100644 --- a/tests/data/test1212 +++ b/tests/data/test1212 @@ -40,7 +40,7 @@ http://user:secret@%HOSTIP:%HTTPPORT/ulion/%TESTNUMBER --socks5 non-existing-hos # Verify data after the test has been "shot" - + GET /ulion/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:secret]b64% diff --git a/tests/data/test1213 b/tests/data/test1213 index 9a511c002294..662ca54728a2 100644 --- a/tests/data/test1213 +++ b/tests/data/test1213 @@ -9,14 +9,14 @@ HTTP proxy # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 22 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 22 + the content goes here @@ -42,7 +42,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com.%TESTNUMBER/ HTTP/1.1 Host: we.want.that.site.com.%TESTNUMBER User-Agent: curl/%VERSION diff --git a/tests/data/test1214 b/tests/data/test1214 index b80d0071c25d..70ed712d3360 100644 --- a/tests/data/test1214 +++ b/tests/data/test1214 @@ -9,14 +9,14 @@ HTTP proxy # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 22 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 22 + the content goes here @@ -42,7 +42,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com.%TESTNUMBER/?moo=foo HTTP/1.1 Host: we.want.that.site.com.%TESTNUMBER User-Agent: curl/%VERSION diff --git a/tests/data/test1215 b/tests/data/test1215 index c405ce04d08c..54c52808f820 100644 --- a/tests/data/test1215 +++ b/tests/data/test1215 @@ -76,7 +76,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm --proxy http:// # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test1216 b/tests/data/test1216 index 7301aa571c21..bb8e043b81ad 100644 --- a/tests/data/test1216 +++ b/tests/data/test1216 @@ -10,14 +10,14 @@ cookies # Server-side - + HTTP/1.1 200 OK Server: Microsoft-IIS/4.0 Date: Tue, 25 Sep 2001 19:37:44 GMT Content-Type: text/html Connection: close -Content-Length: 21 - +Content-Length: 21 + This server says moo @@ -47,7 +47,7 @@ proxy # Verify data after the test has been "shot" - + GET http://example.fake/c/%TESTNUMBER HTTP/1.1 Host: example.fake User-Agent: curl/%VERSION diff --git a/tests/data/test1218 b/tests/data/test1218 index 8b0aa9cf5874..e66d84e1ebd6 100644 --- a/tests/data/test1218 +++ b/tests/data/test1218 @@ -11,12 +11,12 @@ cookies # This test is very similar to 1216, only that it sets the cookies from the # first site instead of reading from a file - + HTTP/1.1 200 OK Date: Tue, 25 Sep 2001 19:37:44 GMT Set-Cookie: bug=fixed; domain=.example.fake; -Content-Length: 21 - +Content-Length: 21 + This server says moo @@ -40,7 +40,7 @@ proxy # Verify data after the test has been "shot" - + GET http://example.fake/c/%TESTNUMBER HTTP/1.1 Host: example.fake User-Agent: curl/%VERSION diff --git a/tests/data/test1221 b/tests/data/test1221 index 565e83073a1b..6a410d95b898 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -11,11 +11,11 @@ HTTP POST # # Server-side - -HTTP/1.1 200 I am cool swsclose -Server: Cool server/10.0 -Content-Length: 0 - + +HTTP/1.1 200 I am cool swsclose +Server: Cool server/10.0 +Content-Length: 0 + diff --git a/tests/data/test1223 b/tests/data/test1223 index 11b0206ee18a..2ce956b82984 100644 --- a/tests/data/test1223 +++ b/tests/data/test1223 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w 'IP %{remote_ip} and PORT %{remote_port} # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1228 b/tests/data/test1228 index 64f49257afa0..721d637f3978 100644 --- a/tests/data/test1228 +++ b/tests/data/test1228 @@ -39,7 +39,7 @@ proxy # Verify data after the test has been "shot" - + GET http://example.fake/hoge/%TESTNUMBER HTTP/1.1 Host: example.fake User-Agent: curl/%VERSION diff --git a/tests/data/test1229 b/tests/data/test1229 index c225e7d4723e..781fa61b7a0b 100644 --- a/tests/data/test1229 +++ b/tests/data/test1229 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%5cuser%22:password@%HOSTIP:%HTTPPORT/%TESTNUMBER --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1230 b/tests/data/test1230 index 507580d1c3fd..464cca3c7c2d 100644 --- a/tests/data/test1230 +++ b/tests/data/test1230 @@ -12,28 +12,28 @@ IPv6 # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 9 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 + mooooooo - -HTTP/1.1 200 welcome dear -Date: Tue, 09 Nov 2010 14:49:00 GMT - + +HTTP/1.1 200 welcome dear +Date: Tue, 09 Nov 2010 14:49:00 GMT + - -HTTP/1.1 200 welcome dear -Date: Tue, 09 Nov 2010 14:49:00 GMT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 9 - + +HTTP/1.1 200 welcome dear +Date: Tue, 09 Nov 2010 14:49:00 GMT + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 + mooooooo @@ -62,7 +62,7 @@ http://[1234:1234:1234::4ce]:%HTTPPORT/wanted/page/%TESTNUMBER -p -x %HOSTIP:%HT # # Verify data after the test has been "shot" - + CONNECT [1234:1234:1234::4ce]:%HTTPPORT HTTP/1.1 Host: [1234:1234:1234::4ce]:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1231 b/tests/data/test1231 index 5573bfc1ae66..608b8529fc51 100644 --- a/tests/data/test1231 +++ b/tests/data/test1231 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/../../hej/but/who/../%TESTNUMBER?stupid=me/../%TESTNUMB # # Verify data after the test has been "shot" - + GET /hej/but/%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1232 b/tests/data/test1232 index 278c4e4bd9fb..3d56afac40a0 100644 --- a/tests/data/test1232 +++ b/tests/data/test1232 @@ -49,7 +49,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://test.remote.haxx.se.%TESTNUMBER:8990/hej/but/%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 Host: test.remote.haxx.se.%TESTNUMBER:8990 User-Agent: curl/%VERSION diff --git a/tests/data/test1235 b/tests/data/test1235 index 553d59779539..836a7a97c55a 100644 --- a/tests/data/test1235 +++ b/tests/data/test1235 @@ -9,18 +9,18 @@ globbing # Server-side - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 15 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 15 + the number one - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 16 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 16 + two is nice too @@ -40,7 +40,7 @@ multiple requests using {}{} in the URL # Verify data after the test has been "shot" - + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -62,26 +62,26 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 15 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 15 + the number one -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 16 - +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 16 + two is nice too -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 15 - +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 15 + the number one -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 16 - +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 16 + two is nice too diff --git a/tests/data/test1237 b/tests/data/test1237 index 2dec456bb472..2c572ace2743 100644 --- a/tests/data/test1237 +++ b/tests/data/test1237 @@ -33,7 +33,7 @@ URL with 1000+ letter user name + password # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB]b64% diff --git a/tests/data/test1239 b/tests/data/test1239 index 5f430220f3f9..9092d56dd083 100644 --- a/tests/data/test1239 +++ b/tests/data/test1239 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "-dec 12 12:00:00 1999 GMT" -w '%{respon # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1240 b/tests/data/test1240 index 59656d6ca1c5..a700bb70fcd0 100644 --- a/tests/data/test1240 +++ b/tests/data/test1240 @@ -31,7 +31,7 @@ glob [0-1] with stuff after range (7.33.0 regression) # Verify data after the test has been "shot" - + GET /00/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1241 b/tests/data/test1241 index d6ea187601bf..94125ea8b929 100644 --- a/tests/data/test1241 +++ b/tests/data/test1241 @@ -48,7 +48,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://test.remote.haxx.se.%TESTNUMBER:8990/../../hej/but/who/../%TESTNUMBER?stupid=me/../%TESTNUMBER HTTP/1.1 Host: test.remote.haxx.se.%TESTNUMBER:8990 User-Agent: curl/%VERSION diff --git a/tests/data/test1244 b/tests/data/test1244 index 238c0c609f3c..d0bd7286dd5c 100644 --- a/tests/data/test1244 +++ b/tests/data/test1244 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -x %HOSTIP:%HTTPPORT --next http://%HOSTIP: 56 - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1245 b/tests/data/test1245 index ad096eaca575..b7a2bda98f65 100644 --- a/tests/data/test1245 +++ b/tests/data/test1245 @@ -13,14 +13,14 @@ followlocation # # Server-side - -HTTP/1.1 301 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 0 -Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Connection: close - + +HTTP/1.1 301 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Location: ftp://%HOSTIP:%FTPPORT/%TESTNUMBER +Connection: close + @@ -42,7 +42,7 @@ ftp # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1246 b/tests/data/test1246 index 33859c469512..e1f11cef5bd9 100644 --- a/tests/data/test1246 +++ b/tests/data/test1246 @@ -48,7 +48,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://test.remote.haxx.se.%TESTNUMBER:%HTTPPORT/ HTTP/1.1 Host: test.remote.haxx.se.%TESTNUMBER:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1248 b/tests/data/test1248 index 4e9a5ae483bb..1d3ed18032d0 100644 --- a/tests/data/test1248 +++ b/tests/data/test1248 @@ -38,7 +38,7 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://dummy:%NOLISTENP # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:secret]b64% diff --git a/tests/data/test1249 b/tests/data/test1249 index 00ffa64aee0d..25a1b01f48d8 100644 --- a/tests/data/test1249 +++ b/tests/data/test1249 @@ -41,7 +41,7 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://dummy:%NOLISTENP # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:secret]b64% diff --git a/tests/data/test1250 b/tests/data/test1250 index cc82fe9f5711..aa9e1645065a 100644 --- a/tests/data/test1250 +++ b/tests/data/test1250 @@ -39,7 +39,7 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --noproxy %HOSTIP --max-time 5 # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:secret]b64% diff --git a/tests/data/test1251 b/tests/data/test1251 index 4703d6a4347a..8946dec3c3ac 100644 --- a/tests/data/test1251 +++ b/tests/data/test1251 @@ -40,7 +40,7 @@ http://user:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --max-time 5 # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:secret]b64% diff --git a/tests/data/test1252 b/tests/data/test1252 index 6daa4b167189..27eb6b0369a6 100644 --- a/tests/data/test1252 +++ b/tests/data/test1252 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --noproxy # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1253 b/tests/data/test1253 index 615a5c0d991f..36676c281e24 100644 --- a/tests/data/test1253 +++ b/tests/data/test1253 @@ -42,7 +42,7 @@ proxy # Verify data after the test has been "shot" - + GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 Host: somewhere.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1254 b/tests/data/test1254 index 56299ffac2e2..6f2e0b0baa65 100644 --- a/tests/data/test1254 +++ b/tests/data/test1254 @@ -42,7 +42,7 @@ proxy # Verify data after the test has been "shot" - + GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 Host: somewhere.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1255 b/tests/data/test1255 index 78f0b47cffc7..648ec1f5030e 100644 --- a/tests/data/test1255 +++ b/tests/data/test1255 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --noproxy %HOSTIP # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1256 b/tests/data/test1256 index 312b3ad6be16..525b13235441 100644 --- a/tests/data/test1256 +++ b/tests/data/test1256 @@ -44,7 +44,7 @@ proxy # Verify data after the test has been "shot" - + GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 Host: somewhere.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1257 b/tests/data/test1257 index 2812b9f0328a..0934e1b4332e 100644 --- a/tests/data/test1257 +++ b/tests/data/test1257 @@ -44,7 +44,7 @@ proxy # Verify data after the test has been "shot" - + GET http://somewhere.example.com/%TESTNUMBER HTTP/1.1 Host: somewhere.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1258 b/tests/data/test1258 index 81518de97eff..c9b4523e3d3b 100644 --- a/tests/data/test1258 +++ b/tests/data/test1258 @@ -11,12 +11,12 @@ httponly # Server-side - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Set-Cookie: I-am=here; domain=localhost; - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Set-Cookie: I-am=here; domain=localhost; + boo @@ -39,7 +39,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: localhost User-Agent: curl/%VERSION diff --git a/tests/data/test1259 b/tests/data/test1259 index 4b98a5e467f6..eb8cff604158 100644 --- a/tests/data/test1259 +++ b/tests/data/test1259 @@ -8,12 +8,12 @@ HTTP GET # Server-side - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Set-Cookie: I-am=here; domain=localhost; - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Set-Cookie: I-am=here; domain=localhost; + boo @@ -33,7 +33,7 @@ HTTP URL with semicolon in password # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:pass]b64%O3dvcmQ= diff --git a/tests/data/test1261 b/tests/data/test1261 index 7cfb8d762c09..e67392918f40 100644 --- a/tests/data/test1261 +++ b/tests/data/test1261 @@ -11,12 +11,12 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/10290002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/10290002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' --locati # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -47,12 +47,12 @@ Accept: */* 47 - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/10290002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/10290002.txt?coolsite=yes +Content-Length: 62 +Connection: close + http://%HOSTIP:%HTTPPORT/we/want/our/data/10290002.txt?coolsite=yes diff --git a/tests/data/test1265 b/tests/data/test1265 index 05dea240638e..d4e060cd7f97 100644 --- a/tests/data/test1265 +++ b/tests/data/test1265 @@ -46,7 +46,7 @@ http://%HOST6IP:%HTTP6PORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOST6IP:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test1266 b/tests/data/test1266 index 733724c75a3d..0d997180abb1 100644 --- a/tests/data/test1266 +++ b/tests/data/test1266 @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http0.9 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1267 b/tests/data/test1267 index b94ea3dc2e85..055d86b5555e 100644 --- a/tests/data/test1267 +++ b/tests/data/test1267 @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http0.9 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1270 b/tests/data/test1270 index 22e056d9c802..6e21d3b2ba81 100644 --- a/tests/data/test1270 +++ b/tests/data/test1270 @@ -11,18 +11,18 @@ followlocation # Server-side - -HTTP/1.1 302 Captive Portal -Server: ohlala/2000 -Date: Tue, 17 Dec 2019 13:08:30 GMT -Cache-Control: no-cache,no-store,must-revalidate,post-check=0,pre-check=0 -Location: https://moo.moo.moo -Content-Type: text/html; charset=utf-8 -X-Frame-Options: SAMEORIGIN -Strict-Transport-Security: max-age=604800 -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 Captive Portal +Server: ohlala/2000 +Date: Tue, 17 Dec 2019 13:08:30 GMT +Cache-Control: no-cache,no-store,must-revalidate,post-check=0,pre-check=0 +Location: https://moo.moo.moo +Content-Type: text/html; charset=utf-8 +X-Frame-Options: SAMEORIGIN +Strict-Transport-Security: max-age=604800 +Content-Length: 0 +Connection: close + @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' -s # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -49,18 +49,18 @@ Accept: */* - -HTTP/1.1 302 Captive Portal -Server: ohlala/2000 -Date: Tue, 17 Dec 2019 13:08:30 GMT -Cache-Control: no-cache,no-store,must-revalidate,post-check=0,pre-check=0 -Location: https://moo.moo.moo -Content-Type: text/html; charset=utf-8 -X-Frame-Options: SAMEORIGIN -Strict-Transport-Security: max-age=604800 -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 Captive Portal +Server: ohlala/2000 +Date: Tue, 17 Dec 2019 13:08:30 GMT +Cache-Control: no-cache,no-store,must-revalidate,post-check=0,pre-check=0 +Location: https://moo.moo.moo +Content-Type: text/html; charset=utf-8 +X-Frame-Options: SAMEORIGIN +Strict-Transport-Security: max-age=604800 +Content-Length: 0 +Connection: close + https://moo.moo.moo/ diff --git a/tests/data/test1271 b/tests/data/test1271 index 2e3f3128a2c5..d2e2cae9cb49 100644 --- a/tests/data/test1271 +++ b/tests/data/test1271 @@ -9,11 +9,11 @@ HTTP GET # Server-side - -HTTP/1.1 200 This is a weirdo text message swsclose -Content-Length: 4 -Connection: close - + +HTTP/1.1 200 This is a weirdo text message swsclose +Content-Length: 4 +Connection: close + Moo @@ -35,7 +35,7 @@ http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w @%LOGDIR/blank%TESTNUMBER # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1273 b/tests/data/test1273 index c78ea0294324..b813b6435a6d 100644 --- a/tests/data/test1273 +++ b/tests/data/test1273 @@ -11,11 +11,11 @@ Resume # Server-side - -HTTP/1.1 416 Invalid range -Connection: close -Content-Length: 0 - + +HTTP/1.1 416 Invalid range +Connection: close +Content-Length: 0 + # The file data that exists at the start of the test must be included in @@ -69,7 +69,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - -f # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=100- diff --git a/tests/data/test1274 b/tests/data/test1274 index dd53c1596430..1445cd265e4a 100644 --- a/tests/data/test1274 +++ b/tests/data/test1274 @@ -43,25 +43,25 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/out%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/ - fake - folded -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Content-Length: 6 -Connection: - close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/ + fake + folded +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Content-Length: 6 +Connection:%repeat[46 x ]% + close + diff --git a/tests/data/test1277 b/tests/data/test1277 index 7c7554bf0f92..1e841b2d093f 100644 --- a/tests/data/test1277 +++ b/tests/data/test1277 @@ -178,7 +178,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1278 b/tests/data/test1278 index 951644637407..6e337dfe416f 100644 --- a/tests/data/test1278 +++ b/tests/data/test1278 @@ -8,7 +8,7 @@ # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1280 b/tests/data/test1280 index 5d2023357ef3..f25252c82b95 100644 --- a/tests/data/test1280 +++ b/tests/data/test1280 @@ -8,12 +8,12 @@ globbing # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close + bytes @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/[a-d]/%TESTNUMBER # Verify data after the test has been "shot" - + GET /a/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1283 b/tests/data/test1283 index 93bca79a1cea..402e45def29a 100644 --- a/tests/data/test1283 +++ b/tests/data/test1283 @@ -11,12 +11,12 @@ globbing # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close + bytes @@ -36,19 +36,19 @@ http://%HOSTIP:%HTTPPORT/[a-a][1-1][b-b:1][2-2:1]/%TESTNUMBER -o "%LOGDIR/outfil # Verify data after the test has been "shot" - + GET /a1b2/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close + bytes diff --git a/tests/data/test1284 b/tests/data/test1284 index a319b0cf4792..b1a51009da1f 100644 --- a/tests/data/test1284 +++ b/tests/data/test1284 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test1285 b/tests/data/test1285 index 9b7f0a0474df..bc8b89273240 100644 --- a/tests/data/test1285 +++ b/tests/data/test1285 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test1286 b/tests/data/test1286 index 90f5e40be70a..ab4c98089150 100644 --- a/tests/data/test1286 +++ b/tests/data/test1286 @@ -10,48 +10,48 @@ followlocation # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 302 Thanks for this, but we want to redir you! -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Location: /%TESTNUMBER0001 -Content-Length: 0 - + +HTTP/1.1 302 Thanks for this, but we want to redir you! +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Location: /%TESTNUMBER0001 +Content-Length: 0 + - -HTTP/1.1 404 Not Found -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 404 Not Found +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 302 Thanks for this, but we want to redir you! -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Location: /%TESTNUMBER0001 -Content-Length: 0 - -HTTP/1.1 404 Not Found -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 302 Thanks for this, but we want to redir you! +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Location: /%TESTNUMBER0001 +Content-Length: 0 + +HTTP/1.1 404 Not Found +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + @@ -89,7 +89,7 @@ HTTP GET --digest increasing nonce-count if(s/^(Authorization: Digest )([^\r\n]+)(\r?\n)$//) { $_ = $1 . join(', ', map { s/^(cnonce=)"[a-zA-Z0-9+\/=]+"$/$1REMOVED/; s/^(response=)"[a-f0-9]{32}"$/$1REMOVED/; s/^qop="auth"$/qop=auth/; $_ } sort split(/, */, $2)) . $3; } - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1287 b/tests/data/test1287 index 314f1efe037e..d2600b4978c2 100644 --- a/tests/data/test1287 +++ b/tests/data/test1287 @@ -11,38 +11,38 @@ verbose logs # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 + contents # The purpose of this test is to make sure curl ignores headers # Content-Length and Transfer-Encoding in a successful CONNECT 2xx reply. - -HTTP/1.1 200 Mighty fine indeed -Content-Length: 123 -Transfer-Encoding: chunked - + +HTTP/1.1 200 Mighty fine indeed +Content-Length: 123 +Transfer-Encoding: chunked + - -HTTP/1.1 200 Mighty fine indeed -Content-Length: 123 -Transfer-Encoding: chunked - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 - + +HTTP/1.1 200 Mighty fine indeed +Content-Length: 123 +Transfer-Encoding: chunked + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 + contents @@ -69,14 +69,14 @@ verbose-strings # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: test.%TESTNUMBER:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1288 b/tests/data/test1288 index 0581d0e7b07d..b14bf8aae752 100644 --- a/tests/data/test1288 +++ b/tests/data/test1288 @@ -12,21 +12,21 @@ proxytunnel # # Server-side - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 9 -Connection: keep-alive - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 +Connection: keep-alive + contents @@ -52,14 +52,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT %HOSTIP:%HTTPPORT HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT %HOSTIP:%HTTPPORT HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test129 b/tests/data/test129 index c01842f07d00..944d42bc7e12 100644 --- a/tests/data/test129 +++ b/tests/data/test129 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1290 b/tests/data/test1290 index 293a2131c857..3c6f8743d476 100644 --- a/tests/data/test1290 +++ b/tests/data/test1290 @@ -35,7 +35,7 @@ Verify URL globbing ignores [] # Verify data after the test has been "shot" - + GET /we/want/[]/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1296 b/tests/data/test1296 index 253c8c6c7a50..50179aa7bf47 100644 --- a/tests/data/test1296 +++ b/tests/data/test1296 @@ -41,7 +41,7 @@ http://user%0aname:password@%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user%0aname:password]b64% diff --git a/tests/data/test1297 b/tests/data/test1297 index eda49ba5f92e..47ad52597d15 100644 --- a/tests/data/test1297 +++ b/tests/data/test1297 @@ -12,10 +12,10 @@ proxytunnel # # Server-side - -HTTP/1.1 200 Mighty fine indeed -Server: test tunnel 2000 - + +HTTP/1.1 200 Mighty fine indeed +Server: test tunnel 2000 + @@ -43,14 +43,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT %HOSTIP:%HTTPPORT HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT %HOSTIP:%HTTPPORT HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1298 b/tests/data/test1298 index 60c1b7b17e3d..39ec4d98ca27 100644 --- a/tests/data/test1298 +++ b/tests/data/test1298 @@ -42,7 +42,7 @@ HTTP GET special path with --request-target # # Verify data after the test has been "shot" - + GET XXX HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test13 b/tests/data/test13 index 90c53724d8a1..6e1a1d019ca5 100644 --- a/tests/data/test13 +++ b/tests/data/test13 @@ -7,11 +7,11 @@ HTTP custom request # Server-side - -HTTP/1.1 200 Read you -Content-Length: 29 -Deleted: suppose we got a header like this! ;-) - + +HTTP/1.1 200 Read you +Content-Length: 29 +Deleted: suppose we got a header like this! ;-) + blabla custom request result @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -X DELETE # Verify data after the test has been "shot" - + DELETE /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1310 b/tests/data/test1310 index 4d164596c9d2..ec55eabf9b64 100644 --- a/tests/data/test1310 +++ b/tests/data/test1310 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/junk -J -O --show-headers --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /junk HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1311 b/tests/data/test1311 index e5942fe1d657..24d6195b3d65 100644 --- a/tests/data/test1311 +++ b/tests/data/test1311 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1312 b/tests/data/test1312 index fcf3cbc0a113..28d9eb68ae2c 100644 --- a/tests/data/test1312 +++ b/tests/data/test1312 @@ -39,7 +39,7 @@ HTTP GET with -J, Content-Disposition and ; in filename # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1313 b/tests/data/test1313 index 16ce2bbf1008..1df13ea092ac 100644 --- a/tests/data/test1313 +++ b/tests/data/test1313 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1314 b/tests/data/test1314 index 3043466de3a9..3511d45139bd 100644 --- a/tests/data/test1314 +++ b/tests/data/test1314 @@ -63,7 +63,7 @@ proxy # Verify data after the test has been "shot" - + GET http://firstplace.example.com/want/%TESTNUMBER HTTP/1.1 Host: firstplace.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1316 b/tests/data/test1316 index 08d9ec7b8509..b5cce9ba2fe7 100644 --- a/tests/data/test1316 +++ b/tests/data/test1316 @@ -13,10 +13,10 @@ HTTP proxy # Server-side - -HTTP/1.1 200 Mighty fine indeed -Magic: sure you can FTP me - + +HTTP/1.1 200 Mighty fine indeed +Magic: sure you can FTP me + diff --git a/tests/data/test1317 b/tests/data/test1317 index d81358997e30..6b74e60fa650 100644 --- a/tests/data/test1317 +++ b/tests/data/test1317 @@ -43,7 +43,7 @@ HTTP with --resolve # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: example.com:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1318 b/tests/data/test1318 index 18188785d287..27e0d80c135e 100644 --- a/tests/data/test1318 +++ b/tests/data/test1318 @@ -43,7 +43,7 @@ HTTP with --resolve and same host name using different cases # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: MiXeDcAsE.cOm:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1319 b/tests/data/test1319 index a4b32eec2103..94fc74d4a031 100644 --- a/tests/data/test1319 +++ b/tests/data/test1319 @@ -12,10 +12,10 @@ HTTP proxy # Server-side - -HTTP/1.1 200 Mighty fine indeed -pop3: sure hit me - + +HTTP/1.1 200 Mighty fine indeed +pop3: sure hit me + # When doing LIST, we get the default list output hard-coded in the test @@ -70,12 +70,12 @@ PASS secret RETR %TESTNUMBER QUIT - -CONNECT pop.%TESTNUMBER:%POP3PORT HTTP/1.1 -Host: pop.%TESTNUMBER:%POP3PORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT pop.%TESTNUMBER:%POP3PORT HTTP/1.1 +Host: pop.%TESTNUMBER:%POP3PORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1320 b/tests/data/test1320 index 5061e8bed730..92a23a4e9f4e 100644 --- a/tests/data/test1320 +++ b/tests/data/test1320 @@ -11,10 +11,10 @@ HTTP proxy # # Server-side - -HTTP/1.1 200 Mighty fine indeed -smtp: sure hit me - + +HTTP/1.1 200 Mighty fine indeed +smtp: sure hit me + @@ -32,11 +32,11 @@ proxy SMTP send tunneled through HTTP proxy - -From: different -To: another - -body + +From: different +To: another + +body smtp://smtp.%TESTNUMBER:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T - -p -x %HOSTIP:%PROXYPORT @@ -60,12 +60,12 @@ To: another body . - -CONNECT smtp.%TESTNUMBER:%SMTPPORT HTTP/1.1 -Host: smtp.%TESTNUMBER:%SMTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT smtp.%TESTNUMBER:%SMTPPORT HTTP/1.1 +Host: smtp.%TESTNUMBER:%SMTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1321 b/tests/data/test1321 index 0ccd858c0d86..8acb5c69fe5a 100644 --- a/tests/data/test1321 +++ b/tests/data/test1321 @@ -12,28 +12,28 @@ HTTP proxy # # Server-side - -HTTP/1.1 200 Mighty fine indeed -imap: sure hit me - + +HTTP/1.1 200 Mighty fine indeed +imap: sure hit me + - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely @@ -66,12 +66,12 @@ A003 SELECT %TESTNUMBER A004 FETCH 1 BODY[] A005 LOGOUT - -CONNECT imap.%TESTNUMBER:%IMAPPORT HTTP/1.1 -Host: imap.%TESTNUMBER:%IMAPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT imap.%TESTNUMBER:%IMAPPORT HTTP/1.1 +Host: imap.%TESTNUMBER:%IMAPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1322 b/tests/data/test1322 index 6f87503432e2..a58891f95d41 100644 --- a/tests/data/test1322 +++ b/tests/data/test1322 @@ -44,7 +44,7 @@ HTTP with --resolve and hostname with trailing dot # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: example.com.:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1324 b/tests/data/test1324 index 30b404fe23a6..d31deee2bd1c 100644 --- a/tests/data/test1324 +++ b/tests/data/test1324 @@ -48,7 +48,7 @@ HTTP with --resolve and [ipv6address] # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: example.com:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test1325 b/tests/data/test1325 index 622981bd455c..4037cf98c16a 100644 --- a/tests/data/test1325 +++ b/tests/data/test1325 @@ -11,32 +11,32 @@ followlocation # # Server-side - -HTTP/1.1 308 OK swsclose -Location: %TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 308 OK swsclose +Location: %TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body - -HTTP/1.1 308 OK swsclose -Location: %TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 308 OK swsclose +Location: %TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body diff --git a/tests/data/test1326 b/tests/data/test1326 index c712faea6fbc..eb3005b2c105 100644 --- a/tests/data/test1326 +++ b/tests/data/test1326 @@ -28,9 +28,9 @@ telnet TELNET to HTTP server - -GET /we/want/%TESTNUMBER HTTP/1.0 - + +GET /we/want/%TESTNUMBER HTTP/1.0 + telnet://%HOSTIP:%HTTPPORT --upload-file - @@ -40,7 +40,7 @@ telnet://%HOSTIP:%HTTPPORT --upload-file - # # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.0 diff --git a/tests/data/test1327 b/tests/data/test1327 index cf1c9c7fbd4c..1a4ac898753b 100644 --- a/tests/data/test1327 +++ b/tests/data/test1327 @@ -23,13 +23,13 @@ telnet TELNET check of upload with stdout redirected - -GET /ignore/for/%TESTNUMBER HTTP/1.0 - + +GET /ignore/for/%TESTNUMBER HTTP/1.0 + - -GET /we/want/%TESTNUMBER HTTP/1.0 - + +GET /we/want/%TESTNUMBER HTTP/1.0 + telnet://%HOSTIP:%HTTPPORT -T %LOGDIR/%TESTNUMBER.txt @@ -39,7 +39,7 @@ telnet://%HOSTIP:%HTTPPORT -T %LOGDIR/%TESTNUMBER.txt # # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.0 diff --git a/tests/data/test1328 b/tests/data/test1328 index b650946a419c..5acfdcf97c4b 100644 --- a/tests/data/test1328 +++ b/tests/data/test1328 @@ -54,7 +54,7 @@ HTTP GET a globbed range with -f # # Verify data after the test has been "shot" - + GET /%TESTNUMBER0000 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1331 b/tests/data/test1331 index 9c211cf36663..7f8ff7868001 100644 --- a/tests/data/test1331 +++ b/tests/data/test1331 @@ -14,39 +14,39 @@ cookies # Server-side - -HTTP/1.1 407 Me not know you swsbounce -Date: Tue, 25 Sep 2001 19:37:44 GMT -Content-Type: text/html -Set-Cookie: proxycookie=weirdo; Path=/ -Cache-control: private -Content-Length: 62 -Proxy-Authenticate: Basic realm="moo on you" - + +HTTP/1.1 407 Me not know you swsbounce +Date: Tue, 25 Sep 2001 19:37:44 GMT +Content-Type: text/html +Set-Cookie: proxycookie=weirdo; Path=/ +Cache-control: private +Content-Length: 62 +Proxy-Authenticate: Basic realm="moo on you" + This server reply is for testing a simple cookie test case... - -HTTP/1.1 200 Fine! -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.1 200 Fine! +Content-Type: text/html +Content-Length: 6 + hello - -HTTP/1.1 407 Me not know you swsbounce -Date: Tue, 25 Sep 2001 19:37:44 GMT -Content-Type: text/html -Set-Cookie: proxycookie=weirdo; Path=/ -Cache-control: private -Content-Length: 62 -Proxy-Authenticate: Basic realm="moo on you" - -HTTP/1.1 200 Fine! -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.1 407 Me not know you swsbounce +Date: Tue, 25 Sep 2001 19:37:44 GMT +Content-Type: text/html +Set-Cookie: proxycookie=weirdo; Path=/ +Cache-control: private +Content-Length: 62 +Proxy-Authenticate: Basic realm="moo on you" + +HTTP/1.1 200 Fine! +Content-Type: text/html +Content-Length: 6 + hello @@ -72,7 +72,7 @@ proxy # Verify data after the test has been "shot" - + GET http://z.x.com/%TESTNUMBER HTTP/1.1 Host: z.x.com User-Agent: curl/%VERSION diff --git a/tests/data/test1334 b/tests/data/test1334 index 2c12a7ce7a35..c0f8508321f6 100644 --- a/tests/data/test1334 +++ b/tests/data/test1334 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -49,14 +49,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1335 b/tests/data/test1335 index f98e879d41f0..e4a11368eaa3 100644 --- a/tests/data/test1335 +++ b/tests/data/test1335 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir="%LOGDIR" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -49,14 +49,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1336 b/tests/data/test1336 index fabb3cf06856..4f5aea491248 100644 --- a/tests/data/test1336 +++ b/tests/data/test1336 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,15 +50,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1337 b/tests/data/test1337 index 97815624200e..71af37b3da53 100644 --- a/tests/data/test1337 +++ b/tests/data/test1337 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,15 +50,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + > %LOGDIR/name%TESTNUMBER diff --git a/tests/data/test1338 b/tests/data/test1338 index beb58447cd67..0d9caf171d88 100644 --- a/tests/data/test1338 +++ b/tests/data/test1338 @@ -9,14 +9,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER --output- # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,14 +50,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1339 b/tests/data/test1339 index f6ee7ac0570d..647c5afb5f6e 100644 --- a/tests/data/test1339 +++ b/tests/data/test1339 @@ -9,14 +9,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,14 +50,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1340 b/tests/data/test1340 index 91072c0aac6f..81af4685444a 100644 --- a/tests/data/test1340 +++ b/tests/data/test1340 @@ -9,15 +9,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER -w "curl # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -51,15 +51,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1341 b/tests/data/test1341 index 0dcd2d03a8a7..0d1787dbcf2c 100644 --- a/tests/data/test1341 +++ b/tests/data/test1341 @@ -9,15 +9,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - -w "curl saved to filename %{fil # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -51,15 +51,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + curl saved to filename %LOGDIR/name%TESTNUMBER diff --git a/tests/data/test1342 b/tests/data/test1342 index 15e1f8ece0df..baa0945eaa98 100644 --- a/tests/data/test1342 +++ b/tests/data/test1342 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER --output- # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -45,25 +45,25 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1343 b/tests/data/test1343 index 66401d14153c..d9df0c44d712 100644 --- a/tests/data/test1343 +++ b/tests/data/test1343 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -45,25 +45,25 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1344 b/tests/data/test1344 index 50d9456932ca..e9f878b76496 100644 --- a/tests/data/test1344 +++ b/tests/data/test1344 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER --output- # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -46,27 +46,27 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1345 b/tests/data/test1345 index ac5cb063dd58..ebf4f9c53cb1 100644 --- a/tests/data/test1345 +++ b/tests/data/test1345 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -46,27 +46,27 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + %LOGDIR/name%TESTNUMBER diff --git a/tests/data/test1346 b/tests/data/test1346 index 81b170ecb96f..5a9606b4bb9b 100644 --- a/tests/data/test1346 +++ b/tests/data/test1346 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -45,14 +45,14 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 diff --git a/tests/data/test1347 b/tests/data/test1347 index e1e14cf568ae..b173086c567b 100644 --- a/tests/data/test1347 +++ b/tests/data/test1347 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -46,15 +46,15 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 diff --git a/tests/data/test1349 b/tests/data/test1349 index 9c74aed958df..da34bcf87c16 100644 --- a/tests/data/test1349 +++ b/tests/data/test1349 @@ -48,21 +48,21 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1350 b/tests/data/test1350 index fcf78744b305..a795a0bd3268 100644 --- a/tests/data/test1350 +++ b/tests/data/test1350 @@ -48,21 +48,21 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1351 b/tests/data/test1351 index c1ed52d4a542..99625533ec3b 100644 --- a/tests/data/test1351 +++ b/tests/data/test1351 @@ -49,21 +49,21 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1352 b/tests/data/test1352 index c54ca4a217d0..0d48522dd6bc 100644 --- a/tests/data/test1352 +++ b/tests/data/test1352 @@ -49,21 +49,21 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1353 b/tests/data/test1353 index 2b6af8cf0151..d8ad1c7760d5 100644 --- a/tests/data/test1353 +++ b/tests/data/test1353 @@ -48,21 +48,21 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1354 b/tests/data/test1354 index 3bf6ddde1650..cde07f4605fd 100644 --- a/tests/data/test1354 +++ b/tests/data/test1354 @@ -46,21 +46,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1356 b/tests/data/test1356 index 55161e143784..e68f9322d66b 100644 --- a/tests/data/test1356 +++ b/tests/data/test1356 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,15 +49,15 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO diff --git a/tests/data/test1357 b/tests/data/test1357 index 7e83e87feb18..e81c5b46adb9 100644 --- a/tests/data/test1357 +++ b/tests/data/test1357 @@ -61,21 +61,21 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 214 -150 Binary data connection for %TESTNUMBER () (214 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 214 +150 Binary data connection for %TESTNUMBER () (214 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1358 b/tests/data/test1358 index 3eb623cb6b6c..1bb1053cf913 100644 --- a/tests/data/test1358 +++ b/tests/data/test1358 @@ -61,21 +61,21 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 214 -150 Binary data connection for %TESTNUMBER () (214 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 214 +150 Binary data connection for %TESTNUMBER () (214 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1359 b/tests/data/test1359 index 98765b285d0e..574720655267 100644 --- a/tests/data/test1359 +++ b/tests/data/test1359 @@ -62,21 +62,21 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 214 -150 Binary data connection for %TESTNUMBER () (214 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 214 +150 Binary data connection for %TESTNUMBER () (214 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1360 b/tests/data/test1360 index 117ef84b375e..acd4f8f6c3c4 100644 --- a/tests/data/test1360 +++ b/tests/data/test1360 @@ -62,21 +62,21 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 214 -150 Binary data connection for %TESTNUMBER () (214 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 214 +150 Binary data connection for %TESTNUMBER () (214 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1361 b/tests/data/test1361 index 9215c23ca293..390366817c2a 100644 --- a/tests/data/test1361 +++ b/tests/data/test1361 @@ -61,21 +61,21 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 214 -150 Binary data connection for %TESTNUMBER () (214 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 214 +150 Binary data connection for %TESTNUMBER () (214 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1362 b/tests/data/test1362 index 9ad0fa742416..f4ea6917565e 100644 --- a/tests/data/test1362 +++ b/tests/data/test1362 @@ -61,21 +61,21 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 214 -150 Binary data connection for %TESTNUMBER () (214 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 214 +150 Binary data connection for %TESTNUMBER () (214 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1363 b/tests/data/test1363 index 876304a39cfd..ab4a8b1101cd 100644 --- a/tests/data/test1363 +++ b/tests/data/test1363 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,15 +49,15 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO diff --git a/tests/data/test1364 b/tests/data/test1364 index 05b10105bb64..008283dee4d7 100644 --- a/tests/data/test1364 +++ b/tests/data/test1364 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/he # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -49,14 +49,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1365 b/tests/data/test1365 index 8643199f2dbc..b332778c515e 100644 --- a/tests/data/test1365 +++ b/tests/data/test1365 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -49,14 +49,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1366 b/tests/data/test1366 index 2b8d65ed2015..f2727c32aac9 100644 --- a/tests/data/test1366 +++ b/tests/data/test1366 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/he # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,15 +50,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1367 b/tests/data/test1367 index d665b770d102..ed86946a1616 100644 --- a/tests/data/test1367 +++ b/tests/data/test1367 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,15 +50,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1368 b/tests/data/test1368 index cbe8d64d6b42..c8930106faf1 100644 --- a/tests/data/test1368 +++ b/tests/data/test1368 @@ -9,14 +9,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,14 +50,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1369 b/tests/data/test1369 index bc818ce774d4..2dc5999c4fab 100644 --- a/tests/data/test1369 +++ b/tests/data/test1369 @@ -9,14 +9,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -50,14 +50,14 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1370 b/tests/data/test1370 index 0a08c0b8e3bb..ceaa90168daa 100644 --- a/tests/data/test1370 +++ b/tests/data/test1370 @@ -9,15 +9,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -51,15 +51,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1371 b/tests/data/test1371 index 145a0a7a535f..293b105210b4 100644 --- a/tests/data/test1371 +++ b/tests/data/test1371 @@ -9,15 +9,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -51,15 +51,15 @@ Accept: */* 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1372 b/tests/data/test1372 index c005a39a74bf..1ac567f91f79 100644 --- a/tests/data/test1372 +++ b/tests/data/test1372 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -45,25 +45,25 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1373 b/tests/data/test1373 index 33634c92fbab..e722bb11ba9c 100644 --- a/tests/data/test1373 +++ b/tests/data/test1373 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -45,25 +45,25 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1374 b/tests/data/test1374 index 6dda00478881..a093fc948bae 100644 --- a/tests/data/test1374 +++ b/tests/data/test1374 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -46,27 +46,27 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1375 b/tests/data/test1375 index c226dc566f7a..2fc12d564870 100644 --- a/tests/data/test1375 +++ b/tests/data/test1375 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -46,27 +46,27 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + diff --git a/tests/data/test1376 b/tests/data/test1376 index ce11a423b774..dd920d813eb1 100644 --- a/tests/data/test1376 +++ b/tests/data/test1376 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -45,14 +45,14 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 diff --git a/tests/data/test1377 b/tests/data/test1377 index 52495d524b74..d8e623b21c6f 100644 --- a/tests/data/test1377 +++ b/tests/data/test1377 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -46,15 +46,15 @@ Accept: */* - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 diff --git a/tests/data/test1379 b/tests/data/test1379 index 953c9b6cd8c7..f938ba659ebc 100644 --- a/tests/data/test1379 +++ b/tests/data/test1379 @@ -46,21 +46,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1380 b/tests/data/test1380 index b106b3c7fcb5..d6dc739d82af 100644 --- a/tests/data/test1380 +++ b/tests/data/test1380 @@ -46,21 +46,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1381 b/tests/data/test1381 index 7d4ef7ba333c..520d0a066b2a 100644 --- a/tests/data/test1381 +++ b/tests/data/test1381 @@ -47,21 +47,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1382 b/tests/data/test1382 index 7c4cc6e290d7..c9f53dd06579 100644 --- a/tests/data/test1382 +++ b/tests/data/test1382 @@ -47,21 +47,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1383 b/tests/data/test1383 index c8b1d119b978..24e339d9789f 100644 --- a/tests/data/test1383 +++ b/tests/data/test1383 @@ -46,21 +46,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1384 b/tests/data/test1384 index 3f99d28bfe6a..490d9a5e8be7 100644 --- a/tests/data/test1384 +++ b/tests/data/test1384 @@ -46,21 +46,21 @@ fooo mooo - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 10 -150 Binary data connection for %TESTNUMBER () (10 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 10 +150 Binary data connection for %TESTNUMBER () (10 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1386 b/tests/data/test1386 index 622afb41c0d4..e4e3b7b946dc 100644 --- a/tests/data/test1386 +++ b/tests/data/test1386 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,15 +49,15 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO diff --git a/tests/data/test1387 b/tests/data/test1387 index a5531aa20146..4002c28e01ad 100644 --- a/tests/data/test1387 +++ b/tests/data/test1387 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,33 +49,33 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 222 -150 Binary data connection for %TESTNUMBER () (222 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 222 +150 Binary data connection for %TESTNUMBER () (222 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1388 b/tests/data/test1388 index 8630be7877b5..21491ab40f59 100644 --- a/tests/data/test1388 +++ b/tests/data/test1388 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,33 +49,33 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 222 -150 Binary data connection for %TESTNUMBER () (222 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 222 +150 Binary data connection for %TESTNUMBER () (222 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1389 b/tests/data/test1389 index 53fda6cd590e..2f247d45dc82 100644 --- a/tests/data/test1389 +++ b/tests/data/test1389 @@ -10,15 +10,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -50,36 +50,36 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 222 -150 Binary data connection for %TESTNUMBER () (222 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 222 +150 Binary data connection for %TESTNUMBER () (222 bytes). +226 File transfer complete -s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ +s/^(229 Entering Passive Mode \().*(\)\S*)/${1}stripped${2}/ diff --git a/tests/data/test1390 b/tests/data/test1390 index b86e099d7592..9c180b65a61b 100644 --- a/tests/data/test1390 +++ b/tests/data/test1390 @@ -10,15 +10,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -50,33 +50,33 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 222 -150 Binary data connection for %TESTNUMBER () (222 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 222 +150 Binary data connection for %TESTNUMBER () (222 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1391 b/tests/data/test1391 index d9350b86773c..f29e02859279 100644 --- a/tests/data/test1391 +++ b/tests/data/test1391 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,33 +49,33 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 222 -150 Binary data connection for %TESTNUMBER () (222 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 222 +150 Binary data connection for %TESTNUMBER () (222 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1392 b/tests/data/test1392 index 572841e5b5b9..598facd1561a 100644 --- a/tests/data/test1392 +++ b/tests/data/test1392 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,33 +49,33 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO - -220- _ _ ____ _ -220- ___| | | | _ \| | -220- / __| | | | |_) | | -220- | (__| |_| | _ {| |___ -220 \___|\___/|_| \_\_____| -331 We are happy you popped in! -230 Welcome you silly person -257 "/" is current directory -250 CWD command successful. -229 Entering Passive Mode (stripped) -200 I modify TYPE as you wanted -213 222 -150 Binary data connection for %TESTNUMBER () (222 bytes). -226 File transfer complete + +220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% +220- ___| | | | _ \| |%spc%%spc%%spc%%spc% +220- / __| | | | |_) | |%spc%%spc%%spc%%spc% +220- | (__| |_| | _ {| |___%spc% +220 \___|\___/|_| \_\_____| +331 We are happy you popped in! +230 Welcome you silly person +257 "/" is current directory +250 CWD command successful. +229 Entering Passive Mode (stripped) +200 I modify TYPE as you wanted +213 222 +150 Binary data connection for %TESTNUMBER () (222 bytes). +226 File transfer complete s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1393 b/tests/data/test1393 index 08946ee9ec9f..b436439e35f1 100644 --- a/tests/data/test1393 +++ b/tests/data/test1393 @@ -9,15 +9,15 @@ RETR # Server-side # file%TESTNUMBER contents... - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO @@ -49,15 +49,15 @@ RETR file%TESTNUMBER QUIT - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + MOOOO diff --git a/tests/data/test14 b/tests/data/test14 index 32ff62746e2a..dde6c8880ad9 100644 --- a/tests/data/test14 +++ b/tests/data/test14 @@ -30,7 +30,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -i --head # Verify data after the test has been "shot" - + HEAD /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1400 b/tests/data/test1400 index 1ff85505ca28..5ed32360d995 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1401 b/tests/data/test1401 index 5cb90eeacb4b..a24c81cb94d3 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[fake:user]b64% diff --git a/tests/data/test1403 b/tests/data/test1403 index a6e56d9ff05a..96328168940c 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER?foo=bar&baz=quux HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1406 b/tests/data/test1406 index ba7a325dd9eb..bdd142159d9c 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -12,7 +12,7 @@ SMTP # Server-side -CAPA SIZE +CAPA SIZE @@ -28,11 +28,11 @@ smtp SSL_CERT_FILE - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-from sender@example.com -T %LOGDIR/test%TESTNUMBER.eml --libcurl %LOGDIR/test%TESTNUMBER.c diff --git a/tests/data/test1407 b/tests/data/test1407 index cb838fc06715..fad62abd062c 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -3,7 +3,7 @@ POP3 -Clear Text +Clear Text LIST --libcurl diff --git a/tests/data/test1408 b/tests/data/test1408 index d46634ebee34..1ae279c34887 100644 --- a/tests/data/test1408 +++ b/tests/data/test1408 @@ -56,7 +56,7 @@ HTTP receive cookies over IPV6 # # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER0001 HTTP/1.1 Host: %HOST6IP:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test141 b/tests/data/test141 index 7a7b4f648bc8..c33349fa8011 100644 --- a/tests/data/test141 +++ b/tests/data/test141 @@ -43,10 +43,10 @@ SIZE %TESTNUMBER REST 0 QUIT - -Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT -Content-Length: 42 -Accept-ranges: bytes + +Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT +Content-Length: 42 +Accept-ranges: bytes diff --git a/tests/data/test1411 b/tests/data/test1411 index f70cfa48563a..ae58242f22f0 100644 --- a/tests/data/test1411 +++ b/tests/data/test1411 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T %LOGDIR/empty%TESTNUMBER # # Verify data after the test has been "shot" - + PUT /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1412 b/tests/data/test1412 index 7b665f12abcd..d2e2be88e4c5 100644 --- a/tests/data/test1412 +++ b/tests/data/test1412 @@ -13,69 +13,69 @@ HTTP Digest auth auth_required - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # The second URL will get this response - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! # This is the second request - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the second real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! @@ -101,7 +101,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth http://%HOST # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1413 b/tests/data/test1413 index c88f769824bd..ece40f75b2ec 100644 --- a/tests/data/test1413 +++ b/tests/data/test1413 @@ -9,32 +9,32 @@ followlocation # # Server-side - -HTTP/1.1 302 OK swsclose -Location: moo.html/%TESTNUMBER0002#fragmentpart -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: moo.html/%TESTNUMBER0002#fragmentpart +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body - -HTTP/1.1 302 OK swsclose -Location: moo.html/%TESTNUMBER0002#fragmentpart -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: moo.html/%TESTNUMBER0002#fragmentpart +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/this/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /this/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1415 b/tests/data/test1415 index cfccdf397478..80e32aac98e8 100644 --- a/tests/data/test1415 +++ b/tests/data/test1415 @@ -64,7 +64,7 @@ proxy # Verify data after the test has been "shot" - + GET http://example.com/we/want/%TESTNUMBER HTTP/1.1 Host: example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1416 b/tests/data/test1416 index d0efdf665d95..14d52475fb3e 100644 --- a/tests/data/test1416 +++ b/tests/data/test1416 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1417 b/tests/data/test1417 index 558da7da1eb1..9af0a5b61f36 100644 --- a/tests/data/test1417 +++ b/tests/data/test1417 @@ -56,21 +56,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - -chunky-trailer: header data + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Trailer: chunky-trailer +Connection: mooo + +chunky-trailer: header data diff --git a/tests/data/test1418 b/tests/data/test1418 index bbbd5858987e..6f9119cdc9dc 100644 --- a/tests/data/test1418 +++ b/tests/data/test1418 @@ -13,62 +13,62 @@ connection reuse connection-monitor - -HTTP/1.1 401 Authentication please! -Content-Length: 20 -WWW-Authenticate: Digest realm="loonie", nonce="314156592" -WWW-Authenticate: Basic - + +HTTP/1.1 401 Authentication please! +Content-Length: 20 +WWW-Authenticate: Digest realm="loonie", nonce="314156592" +WWW-Authenticate: Basic + Please auth with me - -HTTP/1.1 401 Authentication please! -Content-Length: 20 -WWW-Authenticate: Digest realm="loonie", nonce="314156592" -WWW-Authenticate: Basic - + +HTTP/1.1 401 Authentication please! +Content-Length: 20 +WWW-Authenticate: Digest realm="loonie", nonce="314156592" +WWW-Authenticate: Basic + Please auth with me # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Length: 4 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Length: 4 + moo - -HTTP/1.1 200 OK -Server: Another one/1.0 -Content-Length: 4 - + +HTTP/1.1 200 OK +Server: Another one/1.0 +Content-Length: 4 + boo # This is the first reply after the redirection - -HTTP/1.1 200 OK -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - + +HTTP/1.1 200 OK +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + This is not the real page either! - -HTTP/1.1 401 Authentication please! -Content-Length: 20 -WWW-Authenticate: Digest realm="loonie", nonce="314156592" -WWW-Authenticate: Basic - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Length: 4 - + +HTTP/1.1 401 Authentication please! +Content-Length: 20 +WWW-Authenticate: Digest realm="loonie", nonce="314156592" +WWW-Authenticate: Basic + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Length: 4 + moo diff --git a/tests/data/test1419 b/tests/data/test1419 index 45807f01bc55..6ebb4531a727 100644 --- a/tests/data/test1419 +++ b/tests/data/test1419 @@ -13,25 +13,25 @@ connection reuse connection-monitor - -HTTP/1.1 200 fine! -Content-Length: 20 - + +HTTP/1.1 200 fine! +Content-Length: 20 + Feel free to get it - -HTTP/1.1 200 OK -Server: Another one/1.0 -Content-Length: 4 - + +HTTP/1.1 200 OK +Server: Another one/1.0 +Content-Length: 4 + boo - -HTTP/1.1 200 fine! -Content-Length: 20 - + +HTTP/1.1 200 fine! +Content-Length: 20 + Feel free to get it diff --git a/tests/data/test1420 b/tests/data/test1420 index c3c3f6ffc8f7..dbd671b1aa67 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -3,7 +3,7 @@ IMAP -Clear Text +Clear Text FETCH --libcurl @@ -12,14 +12,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test1422 b/tests/data/test1422 index 3d57e77d2f73..410734f4fbe6 100644 --- a/tests/data/test1422 +++ b/tests/data/test1422 @@ -9,15 +9,15 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 0 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=str//nge - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=str//nge + @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O file://%FILE_PWD/%LOGDIR/name%TESTNUM # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1423 b/tests/data/test1423 index a49a04cbdd38..787bc409d21b 100644 --- a/tests/data/test1423 +++ b/tests/data/test1423 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 0 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Connection: close +Content-Type: text/html + @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER file://%FILE_ # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1424 b/tests/data/test1424 index 806906a63392..8f03c18affa4 100644 --- a/tests/data/test1424 +++ b/tests/data/test1424 @@ -57,7 +57,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 11:00:00 1999 GMT" -o %LOGDIR/ou # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1425 b/tests/data/test1425 index 681b06f6a606..51a38cc01c23 100644 --- a/tests/data/test1425 +++ b/tests/data/test1425 @@ -49,7 +49,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1426 b/tests/data/test1426 index 407a499dab08..7a711b324b25 100644 --- a/tests/data/test1426 +++ b/tests/data/test1426 @@ -49,7 +49,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --output - # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1428 b/tests/data/test1428 index 5636f04710e7..3a6253a56954 100644 --- a/tests/data/test1428 +++ b/tests/data/test1428 @@ -21,9 +21,9 @@ Content-Length: 9 contents - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 Mighty fine indeed @@ -60,15 +60,15 @@ proxy # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive -header-type: proxy - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive +header-type: proxy + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: test.%TESTNUMBER:%HTTPPORT Authorization: Basic %b64[iam:my:;self]b64% diff --git a/tests/data/test1429 b/tests/data/test1429 index d313bc4b89e8..b9372aca2aa3 100644 --- a/tests/data/test1429 +++ b/tests/data/test1429 @@ -42,22 +42,22 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --write-out '%{response_code}' # # Verify data after the test has been "shot" - -HTTP/1.1 999 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 999 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- 999 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1430 b/tests/data/test1430 index ebf025101ee9..5ac407519fc7 100644 --- a/tests/data/test1430 +++ b/tests/data/test1430 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1431 b/tests/data/test1431 index b8a1b01dd41c..009c1b0dde0f 100644 --- a/tests/data/test1431 +++ b/tests/data/test1431 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1432 b/tests/data/test1432 index 971e85417843..4b707ee1e056 100644 --- a/tests/data/test1432 +++ b/tests/data/test1432 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1433 b/tests/data/test1433 index 852e056f70a3..08388f64afd3 100644 --- a/tests/data/test1433 +++ b/tests/data/test1433 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1434 b/tests/data/test1434 index 92e7dbaa8549..b811510ee347 100644 --- a/tests/data/test1434 +++ b/tests/data/test1434 @@ -76,7 +76,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 100 # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=100- diff --git a/tests/data/test1435 b/tests/data/test1435 index 01726bad2fb9..bb08e35a8fee 100644 --- a/tests/data/test1435 +++ b/tests/data/test1435 @@ -33,7 +33,7 @@ simple HTTP GET over Unix socket - + GET /%TESTNUMBER HTTP/1.1 Host: server-interpreted.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1436 b/tests/data/test1436 index dbb00f5ee0c2..5a5491e33fb9 100644 --- a/tests/data/test1436 +++ b/tests/data/test1436 @@ -47,7 +47,7 @@ HTTP requests with multiple connections over Unix socket - + GET /%TESTNUMBER0001 HTTP/1.1 Host: one.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1437 b/tests/data/test1437 index 9d1183908756..4eb5e04dc2e5 100644 --- a/tests/data/test1437 +++ b/tests/data/test1437 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, algorithm=MD5, nonce=1, nonce=2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, algorithm=MD5, nonce=1, nonce=2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, algorithm=MD5, nonce=1, nonce=2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, algorithm=MD5, nonce=1, nonce=2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1438 b/tests/data/test1438 index d099d9182413..a16b7fb291e3 100644 --- a/tests/data/test1438 +++ b/tests/data/test1438 @@ -46,7 +46,7 @@ Content-Type: text/plain testdata http - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1439 b/tests/data/test1439 index 17776a452b45..020b6812344a 100644 --- a/tests/data/test1439 +++ b/tests/data/test1439 @@ -45,7 +45,7 @@ Content-Type: text/plain testdata 1.1 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1443 b/tests/data/test1443 index 125627043d52..57ac1591de47 100644 --- a/tests/data/test1443 +++ b/tests/data/test1443 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O --remote-time --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1448 b/tests/data/test1448 index dfc761ee84c4..aed178fc5854 100644 --- a/tests/data/test1448 +++ b/tests/data/test1448 @@ -57,7 +57,7 @@ http://%hex[%c3%a5%c3%a4%c3%b6]hex%.se:%HTTPPORT/%TESTNUMBER --resolve xn--4cab6 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: xn--4cab6c.se:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1457 b/tests/data/test1457 index c25133a964c6..527e704645e6 100644 --- a/tests/data/test1457 +++ b/tests/data/test1457 @@ -49,7 +49,7 @@ line1line3 line2 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1458 b/tests/data/test1458 index 45ff971b0a1f..300f3ec22661 100644 --- a/tests/data/test1458 +++ b/tests/data/test1458 @@ -43,7 +43,7 @@ HTTP with wildcard --resolve # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: example.com:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1466 b/tests/data/test1466 index dda651ff4623..9a880d31b04b 100644 --- a/tests/data/test1466 +++ b/tests/data/test1466 @@ -34,7 +34,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1467 b/tests/data/test1467 index cf77bcbb4e13..69b04d8bf485 100644 --- a/tests/data/test1467 +++ b/tests/data/test1467 @@ -49,7 +49,7 @@ HTTP GET via SOCKS5 proxy via Unix sockets # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1468 b/tests/data/test1468 index a39e1e64a6fd..ec004b368bd4 100644 --- a/tests/data/test1468 +++ b/tests/data/test1468 @@ -50,7 +50,7 @@ http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://localhost%SOC # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: this.is.a.host.name:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1470 b/tests/data/test1470 index 54adeb6138de..2a8e0ea2955e 100644 --- a/tests/data/test1470 +++ b/tests/data/test1470 @@ -51,7 +51,7 @@ https://this.is.a.host.name:%HTTPSPORT/%TESTNUMBER --insecure --proxy socks5h:// # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: this.is.a.host.name:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1473 b/tests/data/test1473 index 1e21534c29b3..fa0bb0f7d33e 100644 --- a/tests/data/test1473 +++ b/tests/data/test1473 @@ -10,14 +10,14 @@ header line folding # # Server-side - -HTTP/1.1 200 OK - Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/ -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Content-Length: 6 - + +HTTP/1.1 200 OK + Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/ +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Content-Length: 6 + -foo- @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1475 b/tests/data/test1475 index 2b483cb0ae36..3c43dda13e41 100644 --- a/tests/data/test1475 +++ b/tests/data/test1475 @@ -71,7 +71,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C - -f # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=100- diff --git a/tests/data/test1476 b/tests/data/test1476 index 101fa95b0103..5915b9fc58d0 100644 --- a/tests/data/test1476 +++ b/tests/data/test1476 @@ -10,7 +10,7 @@ cookies # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 @@ -40,7 +40,7 @@ cookies # Verify data after the test has been "shot" - + GET http://curl.co.UK/ HTTP/1.1 Host: curl.co.UK User-Agent: curl/%VERSION diff --git a/tests/data/test1479 b/tests/data/test1479 index 68dc2b758ce1..3fe61c8cef91 100644 --- a/tests/data/test1479 +++ b/tests/data/test1479 @@ -9,16 +9,16 @@ HTTP/0.9 # # Server-side - -HTTP/1.1 200 OK -Content-Length: 5 - + +HTTP/1.1 200 OK +Content-Length: 5 + Data - -Data -Data -Data + +Data +Data +Data @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1480 b/tests/data/test1480 index 6eea7504837c..d487398cc713 100644 --- a/tests/data/test1480 +++ b/tests/data/test1480 @@ -8,13 +8,13 @@ HTTP # # Server-side - -HTTP/1.1 100 Continue -Foo: Bar - -Data -Data -Data + +HTTP/1.1 100 Continue +Foo: Bar + +Data +Data +Data @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1481 b/tests/data/test1481 index 8f63141b8727..3121ae536978 100644 --- a/tests/data/test1481 +++ b/tests/data/test1481 @@ -42,7 +42,7 @@ http://moo/ --libcurl %LOGDIR/test%TESTNUMBER.c --tls-max 1.3 --proxy-tlsv1 -x h # Verify data after the test has been "shot" - + GET http://moo/ HTTP/1.1 Host: moo User-Agent: curl/%VERSION diff --git a/tests/data/test1482 b/tests/data/test1482 index 30353e290957..8b0a245c28d3 100644 --- a/tests/data/test1482 +++ b/tests/data/test1482 @@ -60,21 +60,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked, chunked -Connection: mooo - -chunky-trailer: header data -another-header: yes + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked, chunked +Connection: mooo + +chunky-trailer: header data +another-header: yes diff --git a/tests/data/test1483 b/tests/data/test1483 index 88827a2cc8c3..82ef88a84d53 100644 --- a/tests/data/test1483 +++ b/tests/data/test1483 @@ -62,22 +62,22 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Transfer-Encoding: chunked -Connection: mooo - -chunky-trailer: header data -another-header: yes + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Transfer-Encoding: chunked +Connection: mooo + +chunky-trailer: header data +another-header: yes diff --git a/tests/data/test1484 b/tests/data/test1484 index 7cdce889dd2c..eaf3e9808c50 100644 --- a/tests/data/test1484 +++ b/tests/data/test1484 @@ -9,19 +9,19 @@ HTTP HEAD # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Transfer-Encoding: chunked - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Transfer-Encoding: chunked + HEAD response with content # make sure no data is written - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Transfer-Encoding: chunked - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Transfer-Encoding: chunked + @@ -42,7 +42,7 @@ HTTP HEAD with response body to ignore # # Verify data after the test has been "shot" - + HEAD /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1485 b/tests/data/test1485 index d36705bbf1ec..c036900ed280 100644 --- a/tests/data/test1485 +++ b/tests/data/test1485 @@ -8,18 +8,18 @@ HTTP GET # Server-side - -HTTP/1.1 200 OK -Server: Someone -Content-Length: 7 - + +HTTP/1.1 200 OK +Server: Someone +Content-Length: 7 + 123456 - -HTTP/1.1 200 OK -Server: Someone -Content-Length: 7 - + +HTTP/1.1 200 OK +Server: Someone +Content-Length: 7 + 123456 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1487 b/tests/data/test1487 index 3a0c8e83560b..88f17fa2b7fa 100644 --- a/tests/data/test1487 +++ b/tests/data/test1487 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1489 b/tests/data/test1489 index e1460bf5c778..7bc6fcd7bd8e 100644 --- a/tests/data/test1489 +++ b/tests/data/test1489 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,14 +42,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D % -s # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1492 b/tests/data/test1492 index b2ef8f50d5f6..96911bc9f642 100644 --- a/tests/data/test1492 +++ b/tests/data/test1492 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/junk%TESTNUMBER -J -O --show-headers --output-dir %LOGD # # Verify data after the test has been "shot" - + GET /junk%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1493 b/tests/data/test1493 index 91797378117c..07821676a780 100644 --- a/tests/data/test1493 +++ b/tests/data/test1493 @@ -57,21 +57,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: identity, chunked -Connection: mooo - -chunky-trailer: header data -another-header: yes + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: identity, chunked +Connection: mooo + +chunky-trailer: header data +another-header: yes diff --git a/tests/data/test1494 b/tests/data/test1494 index 67b8dc33226d..34072063aaf3 100644 --- a/tests/data/test1494 +++ b/tests/data/test1494 @@ -10,7 +10,7 @@ DELAY # # Server-side - + HTTP/1.1 200 funky chunky! Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: identity, identity @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1495 b/tests/data/test1495 index de725b7b4e1a..37e729bedeb4 100644 --- a/tests/data/test1495 +++ b/tests/data/test1495 @@ -10,7 +10,7 @@ DELAY # # Server-side - + HTTP/1.1 200 funky chunky! Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked, identity @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1496 b/tests/data/test1496 index d669dedaa9da..a70a256f8805 100644 --- a/tests/data/test1496 +++ b/tests/data/test1496 @@ -10,7 +10,7 @@ DELAY # # Server-side - + HTTP/1.1 200 funky chunky! Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: gzip, chunked @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1497 b/tests/data/test1497 index 6e8caef8d602..138f8ee8eae8 100644 --- a/tests/data/test1497 +++ b/tests/data/test1497 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 3 -o /dev/null # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1498 b/tests/data/test1498 index b7e15b1a1dc9..f26b790f8ce6 100644 --- a/tests/data/test1498 +++ b/tests/data/test1498 @@ -10,11 +10,11 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + blablabla diff --git a/tests/data/test1499 b/tests/data/test1499 index cb432f7c53e7..a3f28b008433 100644 --- a/tests/data/test1499 +++ b/tests/data/test1499 @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LO # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test15 b/tests/data/test15 index ec065e38fa5d..69755c85dd4d 100644 --- a/tests/data/test15 +++ b/tests/data/test15 @@ -8,13 +8,13 @@ HTTP GET # Server-side - -HTTP/1.1 200 OK -Fake: yes -Fake: yes -Fake: yes -Content-Length: 26 - + +HTTP/1.1 200 OK +Fake: yes +Fake: yes +Fake: yes +Content-Length: 26 + Repeated nonsense-headers @@ -34,17 +34,17 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER --write-out "%{url_effective} %{http_c # Verify data after the test has been "shot" - -HTTP/1.1 200 OK -Fake: yes -Fake: yes -Fake: yes -Content-Length: 26 - + +HTTP/1.1 200 OK +Fake: yes +Fake: yes +Fake: yes +Content-Length: 26 + Repeated nonsense-headers http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER 200 26 - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test150 b/tests/data/test150 index a06c6421dad3..f0f6fcb7f32f 100644 --- a/tests/data/test150 +++ b/tests/data/test150 @@ -16,39 +16,39 @@ NTLM This is supposed to be returned when the server gets a first Authorization: NTLM line passed-in from the client --> - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -74,7 +74,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm --fail # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test1500 b/tests/data/test1500 index 0454f8ecbee4..b29c5216f208 100644 --- a/tests/data/test1500 +++ b/tests/data/test1500 @@ -9,14 +9,14 @@ multi # Server-side - -HTTP/1.1 200 all good! -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Content-Length: 12 -Connection: close - + +HTTP/1.1 200 all good! +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Content-Length: 12 +Connection: close + Hello World diff --git a/tests/data/test1502 b/tests/data/test1502 index c4c378c59e57..01220d659d94 100644 --- a/tests/data/test1502 +++ b/tests/data/test1502 @@ -9,18 +9,18 @@ CURLOPT_RESOLVE - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -45,7 +45,7 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: google.com:%HTTPPORT Accept: */* diff --git a/tests/data/test1503 b/tests/data/test1503 index fe5783e31120..2338ccf725fa 100644 --- a/tests/data/test1503 +++ b/tests/data/test1503 @@ -9,18 +9,18 @@ CURLOPT_RESOLVE - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -45,7 +45,7 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: google.com:%HTTPPORT Accept: */* diff --git a/tests/data/test1504 b/tests/data/test1504 index 3a9de6804e4b..326a190558a2 100644 --- a/tests/data/test1504 +++ b/tests/data/test1504 @@ -9,18 +9,18 @@ CURLOPT_RESOLVE - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -45,7 +45,7 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: google.com:%HTTPPORT Accept: */* diff --git a/tests/data/test1505 b/tests/data/test1505 index 500abdf1279f..1f62045b98bb 100644 --- a/tests/data/test1505 +++ b/tests/data/test1505 @@ -9,18 +9,18 @@ CURLOPT_RESOLVE - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -45,7 +45,7 @@ http://google.com:%HTTPPORT/%TESTNUMBER %HTTPPORT %HOSTIP # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: google.com:%HTTPPORT Accept: */* diff --git a/tests/data/test1506 b/tests/data/test1506 index b08d1aeadf1c..98af4b19fe32 100644 --- a/tests/data/test1506 +++ b/tests/data/test1506 @@ -9,7 +9,7 @@ verbose logs # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -17,7 +17,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -25,7 +25,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -33,7 +33,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -64,7 +64,7 @@ HTTP GET connection cache limit (CURLMOPT_MAXCONNECTS) # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1509 b/tests/data/test1509 index 37614bda7d20..4712c52959a3 100644 --- a/tests/data/test1509 +++ b/tests/data/test1509 @@ -14,30 +14,30 @@ proxytunnel connection-monitor - -HTTP/1.1 200 Mighty fine indeed -Server: the beast that eats naughty clients - + +HTTP/1.1 200 Mighty fine indeed +Server: the beast that eats naughty clients + - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" + - -HTTP/1.1 200 Mighty fine indeed -Server: the beast that eats naughty clients - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" - + +HTTP/1.1 200 Mighty fine indeed +Server: the beast that eats naughty clients + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" + header length is ........: 245 header length should be..: 245 @@ -73,11 +73,11 @@ moo # Verify data after the test has been "shot" - -CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Proxy-Connection: Keep-Alive - + +CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Proxy-Connection: Keep-Alive + [DISCONNECT] diff --git a/tests/data/test151 b/tests/data/test151 index f50672cf19c5..727a7e910015 100644 --- a/tests/data/test151 +++ b/tests/data/test151 @@ -34,7 +34,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1510 b/tests/data/test1510 index 447f6d00d856..c4fca7251afa 100644 --- a/tests/data/test1510 +++ b/tests/data/test1510 @@ -9,36 +9,36 @@ flaky # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file @@ -61,7 +61,7 @@ HTTP GET connection cache limit (CURLOPT_MAXCONNECTS) # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1511 b/tests/data/test1511 index 82ed483b8558..5fc25c7113bd 100644 --- a/tests/data/test1511 +++ b/tests/data/test1511 @@ -8,35 +8,35 @@ CURLOPT_TIMECONDITION # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fakem -Last-Modified: Mon, 22 Apr 2013 17:45:05 GMT -Content-Type: text/html -Content-Length: 12 -Connection: close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fakem +Last-Modified: Mon, 22 Apr 2013 17:45:05 GMT +Content-Type: text/html +Content-Length: 12 +Connection: close + Hello World - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fakem -Last-Modified: Mon, 22 Apr 2013 17:45:05 GMT -Content-Type: text/html -Content-Length: 12 -Connection: close - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fakem -Last-Modified: Mon, 22 Apr 2013 17:45:05 GMT -Content-Type: text/html -Content-Length: 12 -Connection: close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fakem +Last-Modified: Mon, 22 Apr 2013 17:45:05 GMT +Content-Type: text/html +Content-Length: 12 +Connection: close + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fakem +Last-Modified: Mon, 22 Apr 2013 17:45:05 GMT +Content-Type: text/html +Content-Length: 12 +Connection: close + Hello World diff --git a/tests/data/test1512 b/tests/data/test1512 index ff21e11aba36..cb1d8f72f1c9 100644 --- a/tests/data/test1512 +++ b/tests/data/test1512 @@ -8,36 +8,36 @@ GLOBAL DNS CACHE # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file @@ -60,7 +60,7 @@ GLOBAL CACHE test over two easy performs # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1513 b/tests/data/test1513 index 6957761af9fb..ff8c03f279d5 100644 --- a/tests/data/test1513 +++ b/tests/data/test1513 @@ -8,9 +8,9 @@ DELAY # Server-side - -HTTP/1.1 204 PARTIAL -X-Comment: partial response to keep the client waiting + +HTTP/1.1 204 PARTIAL +X-Comment: partial response to keep the client waiting wait 10 diff --git a/tests/data/test1514 b/tests/data/test1514 index 571ee6daa6d4..2f23abb28eec 100644 --- a/tests/data/test1514 +++ b/tests/data/test1514 @@ -10,12 +10,12 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.1 200 OK -Date: Sun, 19 Jan 2014 18:50:58 GMT -Server: test-server/fake swsclose -Connection: close - + +HTTP/1.1 200 OK +Date: Sun, 19 Jan 2014 18:50:58 GMT +Server: test-server/fake swsclose +Connection: close + diff --git a/tests/data/test1517 b/tests/data/test1517 index d2c477593c96..2703c1eefaa0 100644 --- a/tests/data/test1517 +++ b/tests/data/test1517 @@ -62,7 +62,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER s/^(this is what we post to the silly web server)(\r)?\n// - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test152 b/tests/data/test152 index aa5cf971decc..2f4ee6938d45 100644 --- a/tests/data/test152 +++ b/tests/data/test152 @@ -35,7 +35,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1520 b/tests/data/test1520 index eb398f414a46..f49b9147799c 100644 --- a/tests/data/test1520 +++ b/tests/data/test1520 @@ -19,17 +19,17 @@ lib%TESTNUMBER SMTP with CRLF-dot-CRLF in data - -From: different -To: another - - -. -. - -. - -body + +From: different +To: another + + +. +. + +. + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER diff --git a/tests/data/test1525 b/tests/data/test1525 index 1e143b3e6fa9..cfcdfb2bbd82 100644 --- a/tests/data/test1525 +++ b/tests/data/test1525 @@ -12,9 +12,9 @@ CURLOPT_PROXYHEADER # Server-side - -HTTP/1.1 200 OK - + +HTTP/1.1 200 OK + HTTP/1.1 200 OK swsclose @@ -58,12 +58,12 @@ proxy # Verify data after the test has been "shot" - -CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Proxy-Connection: Keep-Alive -User-Agent: Http Agent - + +CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Proxy-Connection: Keep-Alive +User-Agent: Http Agent + PUT /%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test1526 b/tests/data/test1526 index 45d95811b771..5a43efe37d96 100644 --- a/tests/data/test1526 +++ b/tests/data/test1526 @@ -12,29 +12,29 @@ CURLOPT_PROXYHEADER # Server-side - -HTTP/1.1 200 OK -Server: present - + +HTTP/1.1 200 OK +Server: present + - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" + - -HTTP/1.1 200 OK -Server: present - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" - + +HTTP/1.1 200 OK +Server: present + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" + @@ -60,12 +60,12 @@ proxy # Verify data after the test has been "shot" - -CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Proxy-Connection: Keep-Alive -User-Agent: Proxy Agent - + +CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Proxy-Connection: Keep-Alive +User-Agent: Proxy Agent + PUT /%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test1527 b/tests/data/test1527 index 3540a3bfb863..8a106b5d42db 100644 --- a/tests/data/test1527 +++ b/tests/data/test1527 @@ -11,29 +11,29 @@ proxytunnel # Server-side - -HTTP/1.1 200 OK -We-are: good - + +HTTP/1.1 200 OK +We-are: good + - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" + - -HTTP/1.1 200 OK -We-are: good - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" - + +HTTP/1.1 200 OK +We-are: good + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" + @@ -59,13 +59,13 @@ proxy # Verify data after the test has been "shot" - -CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: the.old.moo.%TESTNUMBER:%HTTPPORT -Proxy-Connection: Keep-Alive -User-Agent: Http Agent -Expect: 100-continue - + +CONNECT the.old.moo.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: the.old.moo.%TESTNUMBER:%HTTPPORT +Proxy-Connection: Keep-Alive +User-Agent: Http Agent +Expect: 100-continue + PUT /%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test1528 b/tests/data/test1528 index 8c0209ce8092..eb80570d409f 100644 --- a/tests/data/test1528 +++ b/tests/data/test1528 @@ -11,19 +11,19 @@ proxytunnel # Server-side - -HTTP/1.1 200 OK -We-are: good - + +HTTP/1.1 200 OK +We-are: good + - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Content-Length: 5 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Content-Length: 5 + stop @@ -50,14 +50,14 @@ proxy # Verify data after the test has been "shot" - -GET http://the.old.moo:%HTTPPORT/%TESTNUMBER HTTP/1.1 -Host: the.old.moo:%HTTPPORT -Accept: */* -Proxy-Connection: Keep-Alive -User-Agent: Http Agent -Proxy-User-Agent: Http Agent2 - + +GET http://the.old.moo:%HTTPPORT/%TESTNUMBER HTTP/1.1 +Host: the.old.moo:%HTTPPORT +Accept: */* +Proxy-Connection: Keep-Alive +User-Agent: Http Agent +Proxy-User-Agent: Http Agent2 + diff --git a/tests/data/test1529 b/tests/data/test1529 index a06ce75db949..5d8be40b4518 100644 --- a/tests/data/test1529 +++ b/tests/data/test1529 @@ -9,10 +9,10 @@ HTTP proxy # Server-side - -HTTP/1.1 200 OK -We-are: good - + +HTTP/1.1 200 OK +We-are: good + diff --git a/tests/data/test153 b/tests/data/test153 index 44c06ca5b549..b70061f01f52 100644 --- a/tests/data/test153 +++ b/tests/data/test153 @@ -10,35 +10,35 @@ HTTP Digest auth # Server-side # First reply back and ask for Digest auth - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # second reply back - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -46,24 +46,24 @@ This IS the real page! # This is the second request, and this sends back a response saying that # the request contained stale data. We want an update. Set swsbounce to # bounce on to data1003 on the second request. - -HTTP/1.1 401 Authorization re-negotiation please swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization re-negotiation please swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # The second request to the 1002 section will bounce this one back instead # thanks to the swsbounce keyword up there - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 30 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 30 + This IS the second real page! @@ -91,7 +91,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u testuser:testpass --digest http://%H ^Authorization.*cnonce - + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -121,36 +121,36 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Authorization re-negotiation please swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 30 - +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Authorization re-negotiation please swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 30 + This IS the second real page! diff --git a/tests/data/test1532 b/tests/data/test1532 index fddfe5675de5..fc3f71a00f2d 100644 --- a/tests/data/test1532 +++ b/tests/data/test1532 @@ -9,10 +9,10 @@ HTTP GET # # Server-side - -HTTP/1.0 200 OK swsclose -Content-Length: 0 - + +HTTP/1.0 200 OK swsclose +Content-Length: 0 + @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1533 b/tests/data/test1533 index e0d85669efa5..389baa543695 100644 --- a/tests/data/test1533 +++ b/tests/data/test1533 @@ -12,11 +12,11 @@ CURLOPT_KEEP_SENDING_ON_ERROR auth_required - -HTTP/1.1 401 Authorization Required -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 15 + +HTTP/1.1 401 Authorization Required +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 15 Early Response diff --git a/tests/data/test1534 b/tests/data/test1534 index d35b5cb1c5d7..ef4f8b886e34 100644 --- a/tests/data/test1534 +++ b/tests/data/test1534 @@ -10,11 +10,11 @@ CURLINFO_FILETIME # # Server-side - -HTTP/1.0 200 OK swsclose -Last-Modified: Thu, 01 Jan 1970 00:00:30 GMT -Content-Length: 0 - + +HTTP/1.0 200 OK swsclose +Last-Modified: Thu, 01 Jan 1970 00:00:30 GMT +Content-Length: 0 + @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1535 b/tests/data/test1535 index dac9b2c85c46..8bfd2d6ada79 100644 --- a/tests/data/test1535 +++ b/tests/data/test1535 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1536 b/tests/data/test1536 index 111e07766f1d..63d71731e63e 100644 --- a/tests/data/test1536 +++ b/tests/data/test1536 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1539 b/tests/data/test1539 index 0431ba670b59..884e70066539 100644 --- a/tests/data/test1539 +++ b/tests/data/test1539 @@ -10,11 +10,11 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.1 200 OK -Date: Sun, 19 Jan 2014 18:50:58 GMT -Server: test-server/fake swsclose -Connection: close + +HTTP/1.1 200 OK +Date: Sun, 19 Jan 2014 18:50:58 GMT +Server: test-server/fake swsclose +Connection: close diff --git a/tests/data/test154 b/tests/data/test154 index 5435ac9e9d11..19791a1f42b3 100644 --- a/tests/data/test154 +++ b/tests/data/test154 @@ -10,45 +10,45 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! diff --git a/tests/data/test1540 b/tests/data/test1540 index c3d918b4dac0..fa3b157190f9 100644 --- a/tests/data/test1540 +++ b/tests/data/test1540 @@ -57,7 +57,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1541 b/tests/data/test1541 index 9b7a479d5b63..9aaa90dddacf 100644 --- a/tests/data/test1541 +++ b/tests/data/test1541 @@ -64,7 +64,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1542 b/tests/data/test1542 index cdde885ce7f5..dad66aff3d45 100644 --- a/tests/data/test1542 +++ b/tests/data/test1542 @@ -11,10 +11,10 @@ verbose logs # Server-side - -HTTP/1.1 200 OK -Content-Length: 0 - + +HTTP/1.1 200 OK +Content-Length: 0 + @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1543 b/tests/data/test1543 index 798b273e321e..202cce5434a1 100644 --- a/tests/data/test1543 +++ b/tests/data/test1543 @@ -52,7 +52,7 @@ CURLOPT_CURLU, URL with space and CURLINFO_EFFECTIVE_URL # # Verify data after the test has been "shot" - + GET /%20/with/%20space/%20/file HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1546 b/tests/data/test1546 index facd30947500..5c7fdeb8803c 100644 --- a/tests/data/test1546 +++ b/tests/data/test1546 @@ -9,20 +9,20 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache -Transfer-Encoding: chunked, gzip - -0 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache +Transfer-Encoding: chunked, gzip + +0 + - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1549 b/tests/data/test1549 index bc821e5ebaeb..9346d2f0e3d6 100644 --- a/tests/data/test1549 +++ b/tests/data/test1549 @@ -9,7 +9,7 @@ cookies # # Server-side - + HTTP/1.1 200 OK Content-Length: 6 Content-Type: text/plain @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test155 b/tests/data/test155 index 90bb18dc5b75..f3517a9f2c9b 100644 --- a/tests/data/test155 +++ b/tests/data/test155 @@ -10,61 +10,61 @@ NTLM # Server-side - -HTTP/1.1 401 NTLM Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 401 NTLM Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + moo # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 Type-1 received, send back type-2 -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Type-1 received, send back type-2 +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Type-3 Received and all Things are fine swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Type-3 Received and all Things are fine swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 NTLM Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 401 Type-1 received, send back type-2 -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Type-3 Received and all Things are fine swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 NTLM Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 401 Type-1 received, send back type-2 +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Type-3 Received and all Things are fine swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! diff --git a/tests/data/test1551 b/tests/data/test1551 index 78999e883365..a2c752226cbb 100644 --- a/tests/data/test1551 +++ b/tests/data/test1551 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1552 b/tests/data/test1552 index 6e89c9c1e825..995584c4d4d5 100644 --- a/tests/data/test1552 +++ b/tests/data/test1552 @@ -10,14 +10,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test1553 b/tests/data/test1553 index 10863307374d..5b4f11e55496 100644 --- a/tests/data/test1553 +++ b/tests/data/test1553 @@ -10,14 +10,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test1555 b/tests/data/test1555 index b224f7c0edd0..75e1e5c258bc 100644 --- a/tests/data/test1555 +++ b/tests/data/test1555 @@ -8,9 +8,9 @@ DELAY # Server-side - -HTTP/1.1 204 PARTIAL -X-Comment: partial response to keep the client waiting + +HTTP/1.1 204 PARTIAL +X-Comment: partial response to keep the client waiting wait 10 diff --git a/tests/data/test1556 b/tests/data/test1556 index 49ca0d90ade7..8d9073774fe3 100644 --- a/tests/data/test1556 +++ b/tests/data/test1556 @@ -9,19 +9,19 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes -Long: %repeat[100001 x A]% - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes +Long: %repeat[100001 x A]% + -foo- @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test156 b/tests/data/test156 index 743fe1816ef7..d5df473ee56d 100644 --- a/tests/data/test156 +++ b/tests/data/test156 @@ -9,12 +9,12 @@ HTTP PUT # Server-side - -HTTP/1.1 200 No Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 200 No Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Connection: close + PUT received fine. Thank you very much diff --git a/tests/data/test1561 b/tests/data/test1561 index aea133c628cf..5af47edce0b2 100644 --- a/tests/data/test1561 +++ b/tests/data/test1561 @@ -76,7 +76,7 @@ Cookies set over HTTP can't override secure ones - + GET /%TESTNUMBER0001 HTTP/1.1 Host: www.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1562 b/tests/data/test1562 index cfcc430985d0..382339a84fec 100644 --- a/tests/data/test1562 +++ b/tests/data/test1562 @@ -48,7 +48,7 @@ Expire secure cookies over HTTPS - + GET /%TESTNUMBER0001 HTTP/1.1 Host: www.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1563 b/tests/data/test1563 index ab089213f33e..b682b8a72760 100644 --- a/tests/data/test1563 +++ b/tests/data/test1563 @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -L -H "Host: www.example.com" 1 - + GET /%TESTNUMBER0001 HTTP/1.1 Host: www.example.com User-Agent: curl/%VERSION diff --git a/tests/data/test1566 b/tests/data/test1566 index b348352ebb13..ba1b609a0eda 100644 --- a/tests/data/test1566 +++ b/tests/data/test1566 @@ -46,7 +46,7 @@ downloaded already # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1567 b/tests/data/test1567 index 486d3eb9fbcc..82680ab560e5 100644 --- a/tests/data/test1567 +++ b/tests/data/test1567 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1568 b/tests/data/test1568 index 896077517aa2..abdd94d2500c 100644 --- a/tests/data/test1568 +++ b/tests/data/test1568 @@ -10,39 +10,39 @@ HTTP Digest auth - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -71,7 +71,7 @@ http://%HOSTIP/%TESTNUMBER %HTTPPORT # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: lib%TESTNUMBER diff --git a/tests/data/test157 b/tests/data/test157 index a29112175ab1..da66cd4cf76a 100644 --- a/tests/data/test157 +++ b/tests/data/test157 @@ -9,12 +9,12 @@ HTTP GET # Server-side - -HTTP/1.1 200 No Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 200 No Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Connection: close + GET received and served just fine. Thank you very much @@ -34,7 +34,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1571 b/tests/data/test1571 index 440711b39e01..622ec5ad15c4 100644 --- a/tests/data/test1571 +++ b/tests/data/test1571 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1572 b/tests/data/test1572 index 968f76a9b889..36f3eef6e645 100644 --- a/tests/data/test1572 +++ b/tests/data/test1572 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1573 b/tests/data/test1573 index 0e36d620f8ff..62f5a0e88e59 100644 --- a/tests/data/test1573 +++ b/tests/data/test1573 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1574 b/tests/data/test1574 index 6afc24b2abaf..501c40538956 100644 --- a/tests/data/test1574 +++ b/tests/data/test1574 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1575 b/tests/data/test1575 index 5e44ca5ad488..d02080b2da95 100644 --- a/tests/data/test1575 +++ b/tests/data/test1575 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1576 b/tests/data/test1576 index 459218fecce1..8048e1329db7 100644 --- a/tests/data/test1576 +++ b/tests/data/test1576 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1577 b/tests/data/test1577 index e26d1c44eef3..42d26ae46da3 100644 --- a/tests/data/test1577 +++ b/tests/data/test1577 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1578 b/tests/data/test1578 index ede98d89cfe4..a8c9e7925a9c 100644 --- a/tests/data/test1578 +++ b/tests/data/test1578 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1579 b/tests/data/test1579 index 3cd067e424ab..309f17a8bb2a 100644 --- a/tests/data/test1579 +++ b/tests/data/test1579 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 303 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 303 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test158 b/tests/data/test158 index 89def179cccc..8c9737e273bc 100644 --- a/tests/data/test158 +++ b/tests/data/test158 @@ -8,10 +8,10 @@ HTTP POST # Server-side - -HTTP/1.1 100 Continue swsclose -Silly-header: yeeeees - + +HTTP/1.1 100 Continue swsclose +Silly-header: yeeeees + diff --git a/tests/data/test1580 b/tests/data/test1580 index 70b0f512f7e7..e67164a4276f 100644 --- a/tests/data/test1580 +++ b/tests/data/test1580 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1581 b/tests/data/test1581 index c2f800c18f6d..5dac5229f432 100644 --- a/tests/data/test1581 +++ b/tests/data/test1581 @@ -8,7 +8,7 @@ CURLOPT_FOLLOWLOCATION # # Server-side - + HTTP/1.1 301 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 301 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1582 b/tests/data/test1582 index e446c7508f02..d2c4ada1f0c8 100644 --- a/tests/data/test1582 +++ b/tests/data/test1582 @@ -8,7 +8,7 @@ GSS-API # Server-side - + HTTP/1.1 401 OK Date: Tue, 09 Nov 2030 14:49:00 GMT Server: test-server/fake @@ -42,7 +42,7 @@ https://%HOSTIP:%HTTPSPORT/ - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPSPORT Accept: */* diff --git a/tests/data/test159 b/tests/data/test159 index b81faa17ac14..f7af28a272be 100644 --- a/tests/data/test159 +++ b/tests/data/test159 @@ -15,25 +15,25 @@ HTTP NTLM auth This is supposed to be returned when the server gets a first Authorization: NTLM line passed-in from the client --> - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Connection: close - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Connection: close + This is not the real page either! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Connection: close - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Connection: close + This is not the real page either! @@ -60,7 +60,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -0 # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.0 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test1590 b/tests/data/test1590 index f07f82ddd626..8d459601be8a 100644 --- a/tests/data/test1590 +++ b/tests/data/test1590 @@ -10,14 +10,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test1593 b/tests/data/test1593 index daf70afa4e0c..3c753f10057c 100644 --- a/tests/data/test1593 +++ b/tests/data/test1593 @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Note here the lack of If-Modified-Since - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1594 b/tests/data/test1594 index 24128d257f56..e69da53a0bfd 100644 --- a/tests/data/test1594 +++ b/tests/data/test1594 @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1595 b/tests/data/test1595 index 6b11a8d7b828..2094713224d0 100644 --- a/tests/data/test1595 +++ b/tests/data/test1595 @@ -35,7 +35,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1596 b/tests/data/test1596 index 376fb5ebb8fb..c296ed7a6b97 100644 --- a/tests/data/test1596 +++ b/tests/data/test1596 @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test16 b/tests/data/test16 index 5184c202ea01..e32c8a0f48e7 100644 --- a/tests/data/test16 +++ b/tests/data/test16 @@ -10,14 +10,14 @@ HTTP proxy Basic auth # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 22 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 22 + the content goes here @@ -40,7 +40,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 Host: we.want.that.site.com Proxy-Authorization: Basic %b64[fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]b64% diff --git a/tests/data/test160 b/tests/data/test160 index 957dbd7fa294..1645a09853b6 100644 --- a/tests/data/test160 +++ b/tests/data/test160 @@ -9,18 +9,18 @@ DELAY # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 9 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 + surprise - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + surprise2 @@ -44,20 +44,20 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/wantmore/%TES # Verify data after the test has been "shot" - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 9 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 + surprise -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + surprise2 - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1613 b/tests/data/test1613 index fce1cb370a60..7135788f3578 100644 --- a/tests/data/test1613 +++ b/tests/data/test1613 @@ -10,15 +10,15 @@ HTTP proxy # # Server-side - -HTTP/1.1 200 OK -Date: Sat, 29 Feb 2020 16:10:44 GMT -Server: Blafasel/1.1 -Last-Modified: Sat, 29 Feb 2020 16:10:44 GMT -Content-Length: 0 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Sat, 29 Feb 2020 16:10:44 GMT +Server: Blafasel/1.1 +Last-Modified: Sat, 29 Feb 2020 16:10:44 GMT +Content-Length: 0 +Connection: close +Content-Type: text/html + diff --git a/tests/data/test1617 b/tests/data/test1617 index 623dd84a4462..446e6707ca4a 100644 --- a/tests/data/test1617 +++ b/tests/data/test1617 @@ -10,30 +10,30 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - -2c + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + +2c %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% -%hex[%02%71%60%18%00%00%00]hex% -0 - +%hex[%02%71%60%18%00%00%00]hex% +0 + - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gzip, chunked + line 1 line 2 line 3 @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --tr-encoding -H "Connection: this" -H "Con # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test162 b/tests/data/test162 index 8de635b04496..02809e812757 100644 --- a/tests/data/test162 +++ b/tests/data/test162 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --proxy-us # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test1630 b/tests/data/test1630 index 019928e9f077..ea538851a7c4 100644 --- a/tests/data/test1630 +++ b/tests/data/test1630 @@ -10,14 +10,14 @@ HTTPS proxy Basic auth # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 22 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 22 + the content goes here @@ -41,14 +41,14 @@ proxy # Verify data after the test has been "shot" - -GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 -Host: we.want.that.site.com -Proxy-Authorization: Basic %b64[fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive - + +GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 +Host: we.want.that.site.com +Proxy-Authorization: Basic %b64[fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test1631 b/tests/data/test1631 index 161952caadb9..7c2f81c3ee50 100644 --- a/tests/data/test1631 +++ b/tests/data/test1631 @@ -11,14 +11,14 @@ flaky # This is the HTTPS proxy response - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 0 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 0 + # This is the FTP server response. The Life and Adventures of Robinson Crusoe @@ -61,17 +61,17 @@ proxy s/((https.proxy):(\d+))/$2:12345/ s/^(User-Agent: curl).*/$1/ - -CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 -Host: ftp.site.thru.https.proxy:12345 + +CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 +Host: ftp.site.thru.https.proxy:12345 User-Agent: curl -Proxy-Connection: Keep-Alive - -CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 -Host: ftp.site.thru.https.proxy:12345 +Proxy-Connection: Keep-Alive + +CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 +Host: ftp.site.thru.https.proxy:12345 User-Agent: curl -Proxy-Connection: Keep-Alive - +Proxy-Connection: Keep-Alive + USER anonymous diff --git a/tests/data/test1632 b/tests/data/test1632 index 81be0800638e..90cb56f616e4 100644 --- a/tests/data/test1632 +++ b/tests/data/test1632 @@ -11,14 +11,14 @@ flaky # This is the HTTPS proxy response - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Content-Length: 0 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Content-Length: 0 + # This is the FTP server response. The Life and Adventures of Robinson Crusoe @@ -71,22 +71,22 @@ proxy s/((https.proxy):(\d+))/$2:12345/ s/^(User-Agent: curl).*/$1/ - -CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 -Host: ftp.site.thru.https.proxy:12345 + +CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 +Host: ftp.site.thru.https.proxy:12345 User-Agent: curl -Proxy-Connection: Keep-Alive - -CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 -Host: ftp.site.thru.https.proxy:12345 +Proxy-Connection: Keep-Alive + +CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 +Host: ftp.site.thru.https.proxy:12345 User-Agent: curl -Proxy-Connection: Keep-Alive - -CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 -Host: ftp.site.thru.https.proxy:12345 +Proxy-Connection: Keep-Alive + +CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 +Host: ftp.site.thru.https.proxy:12345 User-Agent: curl -Proxy-Connection: Keep-Alive - +Proxy-Connection: Keep-Alive + USER anonymous diff --git a/tests/data/test1634 b/tests/data/test1634 index 50dfec7fcca0..4ce7d754200a 100644 --- a/tests/data/test1634 +++ b/tests/data/test1634 @@ -55,7 +55,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1 --fail # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1635 b/tests/data/test1635 index a3a1c82e4791..a0344062393b 100644 --- a/tests/data/test1635 +++ b/tests/data/test1635 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1 --fail-with-body # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test164 b/tests/data/test164 index b68876dbde2d..527c2919bfad 100644 --- a/tests/data/test164 +++ b/tests/data/test164 @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -r 0-10,12-15 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=0-10,12-15 diff --git a/tests/data/test165 b/tests/data/test165 index 9c686b685d36..0d1c2ebdd0e5 100644 --- a/tests/data/test165 +++ b/tests/data/test165 @@ -11,13 +11,13 @@ IDN # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes + @@ -46,7 +46,7 @@ http://www.%hex[%c3%a5%c3%a4%c3%b6]hex%.se/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET http://www.xn--4cab6c.se/page/%TESTNUMBER HTTP/1.1 Host: www.xn--4cab6c.se User-Agent: curl/%VERSION diff --git a/tests/data/test167 b/tests/data/test167 index cf5358bc214c..f3f17897c1d4 100644 --- a/tests/data/test167 +++ b/tests/data/test167 @@ -11,28 +11,28 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -WWW-Authenticate: Digest realm="weirdorealm", nonce="12345" - + +HTTP/1.1 401 Authorization Required swsclose +WWW-Authenticate: Digest realm="weirdorealm", nonce="12345" + - -HTTP/1.1 200 OK swsclose + +HTTP/1.1 200 OK swsclose Server: no Content-Length: 15 - + Nice auth sir! - -HTTP/1.1 401 Authorization Required swsclose -WWW-Authenticate: Digest realm="weirdorealm", nonce="12345" - -HTTP/1.1 200 OK swsclose + +HTTP/1.1 401 Authorization Required swsclose +WWW-Authenticate: Digest realm="weirdorealm", nonce="12345" + +HTTP/1.1 200 OK swsclose Server: no Content-Length: 15 - + Nice auth sir! @@ -58,7 +58,7 @@ http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --proxy http://% # Verify data after the test has been "shot" - + GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 Host: data.from.server.requiring.digest.hohoho.com Proxy-Authorization: Basic %b64[foo:bar]b64% diff --git a/tests/data/test1670 b/tests/data/test1670 index ba46bda1bdc8..887a9b36a494 100644 --- a/tests/data/test1670 +++ b/tests/data/test1670 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%header{etag} %header{nope} %header{DAT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1671 b/tests/data/test1671 index e452eafd9c99..08ea2b1787b6 100644 --- a/tests/data/test1671 +++ b/tests/data/test1671 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{header_json}\n' -o %LOGDIR/%TESTNUMBE # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test168 b/tests/data/test168 index 4a6ea11b5ef3..167bab4d2843 100644 --- a/tests/data/test168 +++ b/tests/data/test168 @@ -13,40 +13,40 @@ HTTP Digest auth # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear swsclose -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" - + +HTTP/1.1 407 Authorization Required to proxy me my dear swsclose +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" + And you should ignore this data. # then this is returned since we get no server-auth - -HTTP/1.1 401 Authorization to the remote host as well swsbounce swsclose -WWW-Authenticate: Digest realm="realmweirdo", nonce="123456" - + +HTTP/1.1 401 Authorization to the remote host as well swsbounce swsclose +WWW-Authenticate: Digest realm="realmweirdo", nonce="123456" + you should ignore this data too - -HTTP/1.1 200 OK swsclose + +HTTP/1.1 200 OK swsclose Server: no Content-Length: 15 - + Nice auth sir! - -HTTP/1.1 407 Authorization Required to proxy me my dear swsclose -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" - -HTTP/1.1 401 Authorization to the remote host as well swsbounce swsclose -WWW-Authenticate: Digest realm="realmweirdo", nonce="123456" - -HTTP/1.1 200 OK swsclose + +HTTP/1.1 407 Authorization Required to proxy me my dear swsclose +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" + +HTTP/1.1 401 Authorization to the remote host as well swsbounce swsclose +WWW-Authenticate: Digest realm="realmweirdo", nonce="123456" + +HTTP/1.1 200 OK swsclose Server: no Content-Length: 15 - + Nice auth sir! @@ -72,7 +72,7 @@ http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --proxy http://% # Verify data after the test has been "shot" - + GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 Host: data.from.server.requiring.digest.hohoho.com User-Agent: curl/%VERSION diff --git a/tests/data/test169 b/tests/data/test169 index 0b296a496eae..100668d9bd4b 100644 --- a/tests/data/test169 +++ b/tests/data/test169 @@ -14,59 +14,59 @@ NTLM # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear swsclose -Proxy-Authenticate: NTLM - + +HTTP/1.1 407 Authorization Required to proxy me my dear swsclose +Proxy-Authenticate: NTLM + And you should ignore this data. # then this is returned since we get no server-auth - -HTTP/1.1 200 Authorizated fine -Content-Length: 27 - + +HTTP/1.1 200 Authorizated fine +Content-Length: 27 + Welcome to the end station - -HTTP/1.1 407 NTLM type-1 received sending back type-2 -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 407 NTLM type-1 received sending back type-2 +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 You now need to authenticate with the host -Server: Microsoft-IIS/5.0 -WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef" -Content-Length: 46 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 401 You now need to authenticate with the host +Server: Microsoft-IIS/5.0 +WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef" +Content-Length: 46 +Content-Type: text/html; charset=iso-8859-1 + We have not authenticated with the server yet - -HTTP/1.1 407 NTLM type-1 received sending back type-2 -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 401 You now need to authenticate with the host -Server: Microsoft-IIS/5.0 -WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef" -Content-Length: 46 -Content-Type: text/html; charset=iso-8859-1 - -HTTP/1.1 200 Authorizated fine -Content-Length: 27 - + +HTTP/1.1 407 NTLM type-1 received sending back type-2 +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 401 You now need to authenticate with the host +Server: Microsoft-IIS/5.0 +WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef" +Content-Length: 46 +Content-Type: text/html; charset=iso-8859-1 + +HTTP/1.1 200 Authorizated fine +Content-Length: 27 + Welcome to the end station @@ -93,7 +93,7 @@ http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --proxy http://% # Verify data after the test has been "shot" - + GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 Host: data.from.server.requiring.digest.hohoho.com Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test170 b/tests/data/test170 index 7bfb06fcb81f..05c2091ba264 100644 --- a/tests/data/test170 +++ b/tests/data/test170 @@ -34,7 +34,7 @@ http://a.galaxy.far.far.away/%TESTNUMBER --proxy http://%HOSTIP:%HTTPPORT --prox # Verify data after the test has been "shot" - + POST http://a.galaxy.far.far.away/%TESTNUMBER HTTP/1.1 Host: a.galaxy.far.far.away Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test1700 b/tests/data/test1700 index 7ebc98790ed7..6d26e1b0114a 100644 --- a/tests/data/test1700 +++ b/tests/data/test1700 @@ -10,27 +10,27 @@ HTTP/2 # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -maa- @@ -59,7 +59,7 @@ http://%HOSTIP:%HTTP2PORT/%TESTNUMBER --http2 http://%HOSTIP:%HTTP2PORT/%TESTNUM ^X-Forwarded-Proto:.* ^Via:.* - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTP2PORT User-Agent: curl/%VERSION @@ -71,28 +71,28 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 101 Switching Protocols -Connection: Upgrade -Upgrade: h2c - -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -last-modified: Tue, 13 Jun 2000 12:10:00 GMT -etag: "21025-dc7-39462498" -accept-ranges: bytes -content-length: 6 -content-type: text/html -funny-head: yesyes -via: 1.1 nghttpx - + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +last-modified: Tue, 13 Jun 2000 12:10:00 GMT +etag: "21025-dc7-39462498" +accept-ranges: bytes +content-length: 6 +content-type: text/html +funny-head: yesyes +via: 1.1 nghttpx + -foo- -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 6 -content-type: text/html -via: 1.1 nghttpx - +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +via: 1.1 nghttpx + -maa- diff --git a/tests/data/test1701 b/tests/data/test1701 index 4af318b7eaee..44780df19799 100644 --- a/tests/data/test1701 +++ b/tests/data/test1701 @@ -10,18 +10,18 @@ HTTP/2 # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -60,21 +60,21 @@ Content-Type: application/x-www-form-urlencoded datatosend - -HTTP/1.1 101 Switching Protocols -Connection: Upgrade -Upgrade: h2c - -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -last-modified: Tue, 13 Jun 2000 12:10:00 GMT -etag: "21025-dc7-39462498" -accept-ranges: bytes -content-length: 6 -content-type: text/html -funny-head: yesyes -via: 1.1 nghttpx - + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +last-modified: Tue, 13 Jun 2000 12:10:00 GMT +etag: "21025-dc7-39462498" +accept-ranges: bytes +content-length: 6 +content-type: text/html +funny-head: yesyes +via: 1.1 nghttpx + -foo- diff --git a/tests/data/test1702 b/tests/data/test1702 index 6b7496c1b56a..9f1b16776180 100644 --- a/tests/data/test1702 +++ b/tests/data/test1702 @@ -10,18 +10,18 @@ HTTP/2 # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + @@ -49,28 +49,28 @@ http://%HOSTIP:%HTTP2PORT/%TESTNUMBER --http2 --head ^X-Forwarded-Proto:.* ^Via:.* - + HEAD /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTP2PORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 101 Switching Protocols -Connection: Upgrade -Upgrade: h2c - -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -last-modified: Tue, 13 Jun 2000 12:10:00 GMT -etag: "21025-dc7-39462498" -accept-ranges: bytes -content-length: 6 -content-type: text/html -funny-head: yesyes -via: 1.1 nghttpx - + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +last-modified: Tue, 13 Jun 2000 12:10:00 GMT +etag: "21025-dc7-39462498" +accept-ranges: bytes +content-length: 6 +content-type: text/html +funny-head: yesyes +via: 1.1 nghttpx + s/^server: nghttpx.*\r?\n// diff --git a/tests/data/test1704 b/tests/data/test1704 index 8fd7ee57b597..2a5a942e7187 100644 --- a/tests/data/test1704 +++ b/tests/data/test1704 @@ -10,15 +10,15 @@ HTTP/2 # # Server-side - -HTTP/2 101 OK + +HTTP/2 101 OK HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -maa- @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http2 ^X-Forwarded-Proto:.* ^Via:.* - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test171 b/tests/data/test171 index d913d1191e51..bfdde56baafa 100644 --- a/tests/data/test171 +++ b/tests/data/test171 @@ -10,14 +10,14 @@ cookies # Server-side - -HTTP/1.1 200 OK -Date: Tue, 25 Sep 2001 19:37:44 GMT -Content-Type: text/html -Set-Cookie: XToken=xt;Domain=.z.x.com;Path=/ -Cache-control: private -Content-Length: 62 - + +HTTP/1.1 200 OK +Date: Tue, 25 Sep 2001 19:37:44 GMT +Content-Type: text/html +Set-Cookie: XToken=xt;Domain=.z.x.com;Path=/ +Cache-control: private +Content-Length: 62 + This server reply is for testing a simple cookie test case... @@ -41,7 +41,7 @@ proxy # Verify data after the test has been "shot" - + GET http://z.x.com/%TESTNUMBER HTTP/1.1 Host: z.x.com User-Agent: curl/%VERSION diff --git a/tests/data/test1711 b/tests/data/test1711 index 72016e3557a4..709266eac619 100644 --- a/tests/data/test1711 +++ b/tests/data/test1711 @@ -19,11 +19,11 @@ smtp Send >64K over SMTP - -From: different -To: another - -%repeat[5000 x test in body... ]% + +From: different +To: another + +%repeat[5000 x test in body... ]% smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T %LOGDIR/email%TESTNUMBER diff --git a/tests/data/test172 b/tests/data/test172 index 5bdfbebcf83b..cbf91d0bcec7 100644 --- a/tests/data/test172 +++ b/tests/data/test172 @@ -9,11 +9,11 @@ cookies # Server-side - -HTTP/1.1 200 OK -Content-Length: 4 -Connection: close - + +HTTP/1.1 200 OK +Content-Length: 4 +Connection: close + boo @@ -45,7 +45,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test174 b/tests/data/test174 index f07db6ac2263..80a5141dd49a 100644 --- a/tests/data/test174 +++ b/tests/data/test174 @@ -8,13 +8,13 @@ HTTP POST # Server-side - -HTTP/1.1 200 foobar swsclose -Server: Microsoft-IIS/6.0 -Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 200 foobar swsclose +Server: Microsoft-IIS/6.0 +Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page diff --git a/tests/data/test175 b/tests/data/test175 index 1b5bb7fa9b25..d74f7de6f1a1 100644 --- a/tests/data/test175 +++ b/tests/data/test175 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 200 foobar swsclose swsbounce -Server: Microsoft-IIS/6.0 -Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 foobar swsclose swsbounce +Server: Microsoft-IIS/6.0 +Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth +Content-Type: text/html; charset=iso-8859-1 + This is not the real page - -HTTP/1.1 200 moo swsclose -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 16 - + +HTTP/1.1 200 moo swsclose +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 16 + content for you - -HTTP/1.1 200 foobar swsclose swsbounce -Server: Microsoft-IIS/6.0 -Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth -Content-Type: text/html; charset=iso-8859-1 - -HTTP/1.1 200 moo swsclose -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 16 - + +HTTP/1.1 200 foobar swsclose swsbounce +Server: Microsoft-IIS/6.0 +Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth +Content-Type: text/html; charset=iso-8859-1 + +HTTP/1.1 200 moo swsclose +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 16 + content for you diff --git a/tests/data/test176 b/tests/data/test176 index 3d34b38b8824..ad2f61422bff 100644 --- a/tests/data/test176 +++ b/tests/data/test176 @@ -10,35 +10,35 @@ HTTP NTLM auth # Server-side # the first request has NTLM type-1 included, and then the 1001 is returned - -HTTP/1.1 200 foobar swsclose -Server: Microsoft-IIS/6.0 -Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 foobar swsclose +Server: Microsoft-IIS/6.0 +Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth +Content-Type: text/html; charset=iso-8859-1 + # the second request should be auth-less and then this is returned. - -HTTP/1.1 200 moo swsclose -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 16 - + +HTTP/1.1 200 moo swsclose +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 16 + content for you - -HTTP/1.1 200 foobar swsclose -Server: Microsoft-IIS/6.0 -Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth -Content-Type: text/html; charset=iso-8859-1 - -HTTP/1.1 200 moo swsclose -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 16 - + +HTTP/1.1 200 foobar swsclose +Server: Microsoft-IIS/6.0 +Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth +Content-Type: text/html; charset=iso-8859-1 + +HTTP/1.1 200 moo swsclose +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 16 + content for you diff --git a/tests/data/test177 b/tests/data/test177 index 27bbfd83d4bc..2825c81c7a1f 100644 --- a/tests/data/test177 +++ b/tests/data/test177 @@ -10,12 +10,12 @@ followlocation # Server-side - -HTTP/1.1 302 *MOVED* swsclose swsbounce -Server: Microsoft-IIS/6.0 -Location: /mooooo/%TESTNUMBER -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 302 *MOVED* swsclose swsbounce +Server: Microsoft-IIS/6.0 +Location: /mooooo/%TESTNUMBER +Content-Type: text/html; charset=iso-8859-1 + @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u auser:apasswd --digest -d "junkelijunk" # Verify data after the test has been "shot" - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test178 b/tests/data/test178 index 60f93bf92fcc..b7a13f278cb6 100644 --- a/tests/data/test178 +++ b/tests/data/test178 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test179 b/tests/data/test179 index 7a91b34fc678..312b3d2981c9 100644 --- a/tests/data/test179 +++ b/tests/data/test179 @@ -46,7 +46,7 @@ proxy # Verify data after the test has been "shot" - + GET http://supertrooper.fake/c/%TESTNUMBER HTTP/1.1 Host: supertrooper.fake User-Agent: curl/%VERSION diff --git a/tests/data/test18 b/tests/data/test18 index d32ba17a173f..3a92136d2136 100644 --- a/tests/data/test18 +++ b/tests/data/test18 @@ -9,25 +9,25 @@ globbing # Server-side - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + moo - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + foo - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + hoo @@ -47,7 +47,7 @@ multiple requests using {} in URL # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -64,21 +64,21 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + moo -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + foo -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + hoo diff --git a/tests/data/test1800 b/tests/data/test1800 index 56a40806db7a..459bbd9701a0 100644 --- a/tests/data/test1800 +++ b/tests/data/test1800 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http2 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1801 b/tests/data/test1801 index d5499b3cb9b5..0d48cf23437b 100644 --- a/tests/data/test1801 +++ b/tests/data/test1801 @@ -49,7 +49,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http2 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1802 b/tests/data/test1802 index 61f6426a9020..c8a2a5a193a9 100644 --- a/tests/data/test1802 +++ b/tests/data/test1802 @@ -7,7 +7,7 @@ HTTP CONNECT - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Accept-Ranges: bytes @@ -17,7 +17,7 @@ Content-Type: text/html -foo- - + HTTP/1.1 200 fine Connection: close Content-Length: 0 @@ -47,7 +47,7 @@ http://hello/wanted/page -p -x %HOSTIP:%HTTPPORT --header "User-Agent: myapp/1.0 # Verify data after the test has been "shot" - + CONNECT hello:80 HTTP/1.1 Proxy-Connection: Keep-Alive User-Agent: Benjamin/2 diff --git a/tests/data/test183 b/tests/data/test183 index f13ff2af4349..11e89967b2d8 100644 --- a/tests/data/test183 +++ b/tests/data/test183 @@ -10,11 +10,11 @@ persistent connection # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 + moo @@ -37,7 +37,7 @@ proxy # Verify data after the test has been "shot" - + GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 Host: deathstar.another.galaxy User-Agent: curl/%VERSION diff --git a/tests/data/test184 b/tests/data/test184 index 19d81cb03a7a..6686ba844f93 100644 --- a/tests/data/test184 +++ b/tests/data/test184 @@ -10,31 +10,31 @@ followlocation # Server-side - -HTTP/1.1 301 OK swsbounce -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 + +HTTP/1.1 301 OK swsbounce +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 Location: http://yet.another.host/%TESTNUMBER - + moo - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 + moo - -HTTP/1.1 301 OK swsbounce -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 + +HTTP/1.1 301 OK swsbounce +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 Location: http://yet.another.host/%TESTNUMBER - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 + moo @@ -57,7 +57,7 @@ proxy # Verify data after the test has been "shot" - + GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 Host: another.visitor.stay.a.while.stay.foreeeeeever User-Agent: curl/%VERSION diff --git a/tests/data/test185 b/tests/data/test185 index 66bba00bf70d..04ceb45534a0 100644 --- a/tests/data/test185 +++ b/tests/data/test185 @@ -10,31 +10,31 @@ followlocation # Server-side - -HTTP/1.1 301 OK swsbounce -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 -Location: go/west/%TESTNUMBER - + +HTTP/1.1 301 OK swsbounce +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 +Location: go/west/%TESTNUMBER + moo - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 + moo - -HTTP/1.1 301 OK swsbounce -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 -Location: go/west/%TESTNUMBER - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 4 - + +HTTP/1.1 301 OK swsbounce +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 +Location: go/west/%TESTNUMBER + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 4 + moo @@ -57,7 +57,7 @@ proxy # Verify data after the test has been "shot" - + GET http://deathstar.another.galaxy/%TESTNUMBER HTTP/1.1 Host: another.visitor.stay.a.while.stay.foreeeeeever User-Agent: curl/%VERSION diff --git a/tests/data/test187 b/tests/data/test187 index 823bcdc47183..c3d1199a2311 100644 --- a/tests/data/test187 +++ b/tests/data/test187 @@ -60,7 +60,7 @@ http://%HOSTIP:%HTTPPORT?oh=what-weird=test/%TESTNUMBER -L # Verify data after the test has been "shot" - + GET /?oh=what-weird=test/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test188 b/tests/data/test188 index 2fca25112904..79a7f5f84a05 100644 --- a/tests/data/test188 +++ b/tests/data/test188 @@ -57,7 +57,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 50 -L # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=50- diff --git a/tests/data/test189 b/tests/data/test189 index d3cd0f2b2c14..8d92ef578b81 100644 --- a/tests/data/test189 +++ b/tests/data/test189 @@ -51,7 +51,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 50 -L # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=50- diff --git a/tests/data/test1901 b/tests/data/test1901 index 143a5f165ab1..196dde2c840d 100644 --- a/tests/data/test1901 +++ b/tests/data/test1901 @@ -9,7 +9,7 @@ CURLOPT_READFUNCTION # Server-side - + HTTP/1.1 200 OK Content-Length: 6 Content-Type: text/html diff --git a/tests/data/test1903 b/tests/data/test1903 index 6c879de961f0..228b4d6ae46f 100644 --- a/tests/data/test1903 +++ b/tests/data/test1903 @@ -9,7 +9,7 @@ CURLOPT_COOKIEFILE # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1904 b/tests/data/test1904 index 4d359e4200b3..586948511601 100644 --- a/tests/data/test1904 +++ b/tests/data/test1904 @@ -22,9 +22,9 @@ Content-Length: 9 contents - -HTTP/1.1 204 Sure go ahead - + +HTTP/1.1 204 Sure go ahead + HTTP/1.1 204 Sure go ahead @@ -61,14 +61,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: test.%TESTNUMBER:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1905 b/tests/data/test1905 index f335a0113bb2..690e8553ec0f 100644 --- a/tests/data/test1905 +++ b/tests/data/test1905 @@ -42,7 +42,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1906 b/tests/data/test1906 index 5a6eb7132662..3aaca0b05d81 100644 --- a/tests/data/test1906 +++ b/tests/data/test1906 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1907 b/tests/data/test1907 index d92427ccedf9..a1210516f9a3 100644 --- a/tests/data/test1907 +++ b/tests/data/test1907 @@ -37,7 +37,7 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1908 b/tests/data/test1908 index a49c49db2245..0294b48e2bdc 100644 --- a/tests/data/test1908 +++ b/tests/data/test1908 @@ -57,7 +57,7 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1909 b/tests/data/test1909 index bcce977df63c..a7be2d307676 100644 --- a/tests/data/test1909 +++ b/tests/data/test1909 @@ -43,7 +43,7 @@ HTTP GET --retry-all-errors to overcome partial transfer # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1910 b/tests/data/test1910 index 8485119e6544..ba5a0d74b914 100644 --- a/tests/data/test1910 +++ b/tests/data/test1910 @@ -49,7 +49,7 @@ lib%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user%0aname:pass%0aword]b64% diff --git a/tests/data/test1919 b/tests/data/test1919 index ad2f851db85d..bad31585e0b0 100644 --- a/tests/data/test1919 +++ b/tests/data/test1919 @@ -35,7 +35,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Bearer c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1 diff --git a/tests/data/test192 b/tests/data/test192 index 76912d227a34..4bda64c4772f 100644 --- a/tests/data/test192 +++ b/tests/data/test192 @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test193 b/tests/data/test193 index 398127d5224a..2af00524beef 100644 --- a/tests/data/test193 +++ b/tests/data/test193 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" -L # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1933 b/tests/data/test1933 index 15bbb9af733e..a26d29585cae 100644 --- a/tests/data/test1933 +++ b/tests/data/test1933 @@ -59,7 +59,7 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H ^Content-Type:.* ^Accept:.* - + GET /%TESTNUMBER/testapi/test HTTP/1.1 Host: 127.0.0.1:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-xxx-date, Signature=3d8e00a02e437211a596143dcd590fcc805b731365c68f7f48951ea6eda39c4f diff --git a/tests/data/test1934 b/tests/data/test1934 index 7aa3575e9f69..9520c8193ec8 100644 --- a/tests/data/test1934 +++ b/tests/data/test1934 @@ -59,7 +59,7 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - + GET /%TESTNUMBER/testapi/test HTTP/1.1 Host: 127.0.0.1:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=cf8dc9a4af903a1a9bb1385d8e2366d780afb501e266436598438395e502d58c diff --git a/tests/data/test1935 b/tests/data/test1935 index 26c9425376a4..4e0f11cb4fdf 100644 --- a/tests/data/test1935 +++ b/tests/data/test1935 @@ -59,7 +59,7 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - + GET /%TESTNUMBER/testapi/test HTTP/1.1 Host: 127.0.0.1:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/rrr/127/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=a0b11b97b54689428d4188b788ed32865d607822d85d3e91cf06141f479dac0b diff --git a/tests/data/test1936 b/tests/data/test1936 index 2628b9230559..d57b8161efa3 100644 --- a/tests/data/test1936 +++ b/tests/data/test1936 @@ -59,7 +59,7 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT ^Content-Type:.* ^Accept:.* - + GET /%TESTNUMBER/testapi/test HTTP/1.1 Host: 127.0.0.1:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/rrr/sss/xxx4_request, SignedHeaders=content-type;host;x-yyy-date, Signature=026b713d76b0789bd224c5e41322f74eed088f8a22fd15183ca68376c575c5b0 diff --git a/tests/data/test194 b/tests/data/test194 index ef7b24aae3ff..2d01a147edae 100644 --- a/tests/data/test194 +++ b/tests/data/test194 @@ -10,33 +10,33 @@ Resume # Server-side - -HTTP/1.1 416 Requested Range Not Satisfiable swsclose -Date: Fri, 24 Oct 2003 21:33:12 GMT -Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 -Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT -ETag: "ab57a-507-3f9968f3" -Accept-Ranges: bytes -Content-Length: 4 -Content-Range: bytes */87 -Content-Type: image/gif -Connection: close - + +HTTP/1.1 416 Requested Range Not Satisfiable swsclose +Date: Fri, 24 Oct 2003 21:33:12 GMT +Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 +Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT +ETag: "ab57a-507-3f9968f3" +Accept-Ranges: bytes +Content-Length: 4 +Content-Range: bytes */87 +Content-Type: image/gif +Connection: close + bad - -HTTP/1.1 416 Requested Range Not Satisfiable swsclose -Date: Fri, 24 Oct 2003 21:33:12 GMT -Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 -Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT -ETag: "ab57a-507-3f9968f3" -Accept-Ranges: bytes -Content-Length: 4 -Content-Range: bytes */87 -Content-Type: image/gif -Connection: close - + +HTTP/1.1 416 Requested Range Not Satisfiable swsclose +Date: Fri, 24 Oct 2003 21:33:12 GMT +Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 +Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT +ETag: "ab57a-507-3f9968f3" +Accept-Ranges: bytes +Content-Length: 4 +Content-Range: bytes */87 +Content-Type: image/gif +Connection: close + @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -C 87 --fail # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=87- diff --git a/tests/data/test1941 b/tests/data/test1941 index 9ef4b3b1e4b6..faa4b390055d 100644 --- a/tests/data/test1941 +++ b/tests/data/test1941 @@ -20,11 +20,11 @@ Set-Cookie: cookie3=data3; Location: /%TESTNUMBER0002 - -HTTP/1.1 200 Sure go ahead -Server: from the connect -Silly-thing: yes yes - + +HTTP/1.1 200 Sure go ahead +Server: from the connect +Silly-thing: yes yes + @@ -54,11 +54,11 @@ http://hello:%HTTPPORT/%TESTNUMBER %HOSTIP:%PROXYPORT # Verify data after the test has been "shot" - -CONNECT hello:%HTTPPORT HTTP/1.1 -Host: hello:%HTTPPORT -Proxy-Connection: Keep-Alive - + +CONNECT hello:%HTTPPORT HTTP/1.1 +Host: hello:%HTTPPORT +Proxy-Connection: Keep-Alive + Date == Thu, 09 Nov 2010 14:49:00 GMT diff --git a/tests/data/test1945 b/tests/data/test1945 index 1b30965f609c..06ab2c0f92a7 100644 --- a/tests/data/test1945 +++ b/tests/data/test1945 @@ -20,11 +20,11 @@ Set-Cookie: cookie3=data3; Location: /%TESTNUMBER0002 - -HTTP/1.1 200 Sure go ahead -Server: from the connect -Silly-thing: yes yes - + +HTTP/1.1 200 Sure go ahead +Server: from the connect +Silly-thing: yes yes + @@ -54,11 +54,11 @@ http://hello:%HTTPPORT/%TESTNUMBER %HOSTIP:%PROXYPORT # Verify data after the test has been "shot" - -CONNECT hello:%HTTPPORT HTTP/1.1 -Host: hello:%HTTPPORT -Proxy-Connection: Keep-Alive - + +CONNECT hello:%HTTPPORT HTTP/1.1 +Host: hello:%HTTPPORT +Proxy-Connection: Keep-Alive + Server == from the connect (0/2) diff --git a/tests/data/test1948 b/tests/data/test1948 index 39be768c0b4c..1f4c3c8ac465 100644 --- a/tests/data/test1948 +++ b/tests/data/test1948 @@ -9,26 +9,26 @@ HTTP PUT # Server-side - -HTTP/1.1 200 OK -Date: Thu, 01 Nov 2001 14:49:00 GMT -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.1 200 OK +Date: Thu, 01 Nov 2001 14:49:00 GMT +Content-Type: text/html +Content-Length: 6 + hello - -HTTP/1.1 200 OK -Date: Thu, 01 Nov 2001 14:49:00 GMT -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.1 200 OK +Date: Thu, 01 Nov 2001 14:49:00 GMT +Content-Type: text/html +Content-Length: 6 + hello -HTTP/1.1 200 OK -Date: Thu, 01 Nov 2001 14:49:00 GMT -Content-Type: text/html -Content-Length: 6 - +HTTP/1.1 200 OK +Date: Thu, 01 Nov 2001 14:49:00 GMT +Content-Type: text/html +Content-Length: 6 + hello diff --git a/tests/data/test1956 b/tests/data/test1956 index a53e57c44d48..324de3391370 100644 --- a/tests/data/test1956 +++ b/tests/data/test1956 @@ -59,7 +59,7 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - + GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=dfe78c8846a9b7d65d1eb4c1d6ea7bc886650d03f3568088cb8d5b4c3778287f diff --git a/tests/data/test1957 b/tests/data/test1957 index b30d9acdd366..5a3c914b5bc6 100644 --- a/tests/data/test1957 +++ b/tests/data/test1957 @@ -59,7 +59,7 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - + GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff diff --git a/tests/data/test1958 b/tests/data/test1958 index 23aa849444a6..220f49aa5e8c 100644 --- a/tests/data/test1958 +++ b/tests/data/test1958 @@ -59,7 +59,7 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - + GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff diff --git a/tests/data/test1959 b/tests/data/test1959 index 46ef85a678cf..e91a3128e886 100644 --- a/tests/data/test1959 +++ b/tests/data/test1959 @@ -59,7 +59,7 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - + GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=7b343a4aa55d73ffc05005d84480bc705a3367373ed8cae1a1c0fbd2b3aa0483 diff --git a/tests/data/test1960 b/tests/data/test1960 index cf36b175921b..ce0a2cfc7a0a 100644 --- a/tests/data/test1960 +++ b/tests/data/test1960 @@ -9,7 +9,7 @@ CURL_SOCKOPT_ALREADY_CONNECTED # Server-side - + HTTP/1.1 200 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/file %HOSTIP %HTTPPORT # Verify data after the test has been "shot" - + GET /file HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test1964 b/tests/data/test1964 index b005bbf932be..9b7e2c968b1b 100644 --- a/tests/data/test1964 +++ b/tests/data/test1964 @@ -58,7 +58,7 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H ^Content-Type:.* ^Accept:.* - + GET /%TESTNUMBER/testapi/test HTTP/1.1 Host: 127.0.0.1:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/0/127/xxx4_request, SignedHeaders=content-type;host;x-xxx-date, Signature=35da102c1df68f2ef85ade08ecc212fa663a66e3a973146f6578a5c5426e9669 diff --git a/tests/data/test197 b/tests/data/test197 index 31f132f8fde1..29a6a29ba378 100644 --- a/tests/data/test197 +++ b/tests/data/test197 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1000 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1970 b/tests/data/test1970 index b3d3a36a0e30..43df45e31f5d 100644 --- a/tests/data/test1970 +++ b/tests/data/test1970 @@ -59,7 +59,7 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - + PUT /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=a028756f42a859122e9609c1f90cae4b272d6b03bf60d9fd354138176dfa2260 diff --git a/tests/data/test1974 b/tests/data/test1974 index f91606e362be..74213d0ab694 100644 --- a/tests/data/test1974 +++ b/tests/data/test1974 @@ -59,7 +59,7 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP ^Content-Type:.* ^Accept:.* - + GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=e6270423932feafe9b00ca5d60c9ed566be649f9ca9676144288273945153021 diff --git a/tests/data/test1976 b/tests/data/test1976 index 4abd45780265..51e3b242b866 100644 --- a/tests/data/test1976 +++ b/tests/data/test1976 @@ -47,7 +47,7 @@ HTTP AWS_SIGV4 canonical request header sorting test # Strip the actual signature. We only care about header order in this test s/Signature=[a-f0-9]{64}/Signature=stripped/ - + PUT /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-meta-test;x-amz-meta-test-two, Signature=stripped diff --git a/tests/data/test1977 b/tests/data/test1977 index f2c1ead98614..b8e2bb4f2b54 100644 --- a/tests/data/test1977 +++ b/tests/data/test1977 @@ -44,7 +44,7 @@ effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo&bar - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test198 b/tests/data/test198 index e1e81aee51f6..42feffe7d2fb 100644 --- a/tests/data/test198 +++ b/tests/data/test198 @@ -53,7 +53,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 1000 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test1981 b/tests/data/test1981 index faf061c1d183..3aa0419f87e7 100644 --- a/tests/data/test1981 +++ b/tests/data/test1981 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --write-out='Time: %time{%d/%b/%Y %H:%M:%S. # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test199 b/tests/data/test199 index 4965d3ce935a..763e7bf49ed8 100644 --- a/tests/data/test199 +++ b/tests/data/test199 @@ -42,7 +42,7 @@ HTTP with -d, -G and {} # # Verify data after the test has been "shot" - + GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2 b/tests/data/test2 index 79d2cf9b7c2a..12e99b81479b 100644 --- a/tests/data/test2 +++ b/tests/data/test2 @@ -9,7 +9,7 @@ HTTP Basic auth # # Server-side - + HTTP/1.1 200 Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose @@ -36,7 +36,7 @@ HTTP GET with user and password # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[fake:user]b64% diff --git a/tests/data/test2001 b/tests/data/test2001 index e9b9ae6f70ad..8792f8dbb60c 100644 --- a/tests/data/test2001 +++ b/tests/data/test2001 @@ -13,18 +13,18 @@ multiprotocol # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- diff --git a/tests/data/test2002 b/tests/data/test2002 index 4b2b4fef6942..8fea4c110ec7 100644 --- a/tests/data/test2002 +++ b/tests/data/test2002 @@ -15,18 +15,18 @@ multiprotocol # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- diff --git a/tests/data/test2003 b/tests/data/test2003 index 5ab3e41ac6dd..58a9d9580ca8 100644 --- a/tests/data/test2003 +++ b/tests/data/test2003 @@ -15,18 +15,18 @@ multiprotocol # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- diff --git a/tests/data/test2005 b/tests/data/test2005 index 51e90782a91e..c027f53c633f 100644 --- a/tests/data/test2005 +++ b/tests/data/test2005 @@ -43,7 +43,7 @@ machine example.com # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[:5up3r53cr37]b64% diff --git a/tests/data/test2023 b/tests/data/test2023 index 3626499be107..f0e43d0ed23c 100644 --- a/tests/data/test2023 +++ b/tests/data/test2023 @@ -10,91 +10,91 @@ HTTP Basic auth - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -119,7 +119,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic basic # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[testuser:wrongpass]b64% diff --git a/tests/data/test2024 b/tests/data/test2024 index b2d6f729ae28..7838aeb2eb2a 100644 --- a/tests/data/test2024 +++ b/tests/data/test2024 @@ -14,97 +14,97 @@ HTTP Digest auth ensure that the order doesn't matter. --> - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="1" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="3" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="1" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="3" -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -134,7 +134,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[testuser:wrongpass]b64% diff --git a/tests/data/test2025 b/tests/data/test2025 index 9f6dd4176da9..2b2c6f33f82e 100644 --- a/tests/data/test2025 +++ b/tests/data/test2025 @@ -15,178 +15,178 @@ NTLM ensure that the order doesn't matter. --> - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 401 Need Basic or NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Basic or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 401 Need Basic or NTLM auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Basic or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 401 Need Basic or NTLM auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Basic or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -216,7 +216,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic ntlm # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[testuser:wrongpass]b64% diff --git a/tests/data/test2026 b/tests/data/test2026 index e3b5e946cce6..d576725c4c4c 100644 --- a/tests/data/test2026 +++ b/tests/data/test2026 @@ -14,133 +14,133 @@ HTTP Digest auth ensure that the order doesn't matter. --> - -HTTP/1.1 401 Need Basic or Digest auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="1" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Need Basic or Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + This is not the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: Digest realm="testrealm", nonce="2" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="2" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Basic or Digest auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="3" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Need Basic or Digest auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + This is not the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: Digest realm="testrealm", nonce="4" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="4" + This is a bad password page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="5" -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Basic or Digest auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="1" -WWW-Authenticate: Basic realm="testrealm" - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: Digest realm="testrealm", nonce="2" - + +HTTP/1.1 401 Need Basic or Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="2" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 Need Basic or Digest auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="3" -WWW-Authenticate: Basic realm="testrealm" - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: Digest realm="testrealm", nonce="4" - +HTTP/1.1 401 Need Basic or Digest auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="4" + This is a bad password page! -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="5" -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -170,7 +170,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest basic # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2027 b/tests/data/test2027 index b4ca0e327ddc..bff987e1cc50 100644 --- a/tests/data/test2027 +++ b/tests/data/test2027 @@ -21,149 +21,149 @@ HTTP Digest auth --> - -HTTP/1.1 401 Need Digest auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="1" - + +HTTP/1.1 401 Need Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" + This is not the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" + This is a bad password page! - -HTTP/1.1 401 Need Digest auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="3" - + +HTTP/1.1 401 Need Digest auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="3" + This is not the real page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Digest auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="4" - + +HTTP/1.1 401 Need Digest auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" + This is not the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="5" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" + This is a bad password page! - -HTTP/1.1 401 Need Digest auth (4) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="6" - + +HTTP/1.1 401 Need Digest auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="6" + This is not the real page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="7" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="7" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Digest auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="1" - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" - + +HTTP/1.1 401 Need Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 Need Digest auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="4" - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="5" - +HTTP/1.1 401 Need Digest auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" + This is a bad password page! -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="7" - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="7" - +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="7" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -193,7 +193,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2028 b/tests/data/test2028 index ef87640ac80b..7f71f0549c79 100644 --- a/tests/data/test2028 +++ b/tests/data/test2028 @@ -15,214 +15,214 @@ NTLM ensure that the order doesn't matter. --> - -HTTP/1.1 401 Need Digest or NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="1" - + +HTTP/1.1 401 Need Digest or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="1" + This is not the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 401 Need Digest or NTLM auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="3" - + +HTTP/1.1 401 Need Digest or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="3" + This is not the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Digest or NTLM auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="4" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="5" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + This is a bad password page! - -HTTP/1.1 401 Need Digest or NTLM auth (4) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="6" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="6" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="7" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + This is a bad password page! - -HTTP/1.1 401 Need Digest or NTLM auth (5) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="8" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="8" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Digest or NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="1" - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 Need Digest or NTLM auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="4" -WWW-Authenticate: NTLM - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="5" - +HTTP/1.1 401 Need Digest or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" +WWW-Authenticate: NTLM + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="7" - +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -253,7 +253,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest ntlm # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2029 b/tests/data/test2029 index 9b43d0f87f7a..08a955fed7cd 100644 --- a/tests/data/test2029 +++ b/tests/data/test2029 @@ -15,151 +15,151 @@ NTLM ensure that the order doesn't matter. --> - -HTTP/1.1 401 Need Basic or NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Need Basic or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is not the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Basic or NTLM auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Need Basic or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Basic realm="testrealm" -WWW-Authenticate: NTLM - +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -189,7 +189,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ntlm basic # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test2030 b/tests/data/test2030 index 2baee6731193..b02d219201f2 100644 --- a/tests/data/test2030 +++ b/tests/data/test2030 @@ -27,191 +27,191 @@ ensure that the order doesn't matter. --> - -HTTP/1.1 401 Need Digest or NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="1" - + +HTTP/1.1 401 Need Digest or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="1" + This is not the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 401 Need Digest or NTLM auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="3" - + +HTTP/1.1 401 Need Digest or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="3" + This is not the real page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need Digest or NTLM auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="4" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="5" - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + This is a bad password page! - -HTTP/1.1 401 Need Digest or NTLM auth (4) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="6" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="6" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="7" - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + This is a bad password page! - -HTTP/1.1 401 Need Digest or NTLM auth (5) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: Digest realm="testrealm", nonce="8" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need Digest or NTLM auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="8" +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: Digest realm="testrealm", nonce="2" -WWW-Authenticate: NTLM - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="5" - +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + This is a bad password page! -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="7" - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Digest realm="testrealm", nonce="7" - +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + This is a bad password page! -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -242,7 +242,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ntlm digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test2031 b/tests/data/test2031 index 1d3b168e5f43..249660f2095a 100644 --- a/tests/data/test2031 +++ b/tests/data/test2031 @@ -11,221 +11,221 @@ NTLM - -HTTP/1.1 401 Need NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 401 Need NTLM auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Need NTLM auth (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 401 Need NTLM auth (4) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need NTLM auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (4) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + This is a bad password page! - -HTTP/1.1 401 Need NTLM auth (5) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 Need NTLM auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (5) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 NTLM intermediate -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM - + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! -HTTP/1.1 401 NTLM intermediate (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM - +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (4) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 401 Sorry wrong password (3) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM - +HTTP/1.1 401 NTLM intermediate (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + This is a bad password page! -HTTP/1.1 401 NTLM intermediate (5) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - -HTTP/1.1 200 Things are fine in server land (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - +HTTP/1.1 401 NTLM intermediate (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -255,7 +255,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER ntlm ntlm # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test2032 b/tests/data/test2032 index 403ca153638c..85018987c5dc 100644 --- a/tests/data/test2032 +++ b/tests/data/test2032 @@ -14,45 +14,45 @@ timing-dependent - -HTTP/1.1 401 Need Basic or NTLM auth -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 29 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Need Basic or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is a bad password page! - -HTTP/1.1 401 Need Basic or NTLM auth (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 27 -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="testrealm" - + +HTTP/1.1 401 Need Basic or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + This is not the real page! - -HTTP/1.1 401 NTLM intermediate (2) -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 33 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= - + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + This is still not the real page! - -HTTP/1.1 200 Things are fine in server land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -88,7 +88,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[testuser:testpass]b64% diff --git a/tests/data/test2033 b/tests/data/test2033 index 447e8c533052..32c9edc67c47 100644 --- a/tests/data/test2033 +++ b/tests/data/test2033 @@ -47,7 +47,7 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2034 b/tests/data/test2034 index a2ecffdb412b..a165bd9e83b9 100644 --- a/tests/data/test2034 +++ b/tests/data/test2034 @@ -43,7 +43,7 @@ simple HTTPS GET with DER public key pinning # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2037 b/tests/data/test2037 index 138f573004f6..facc52898b70 100644 --- a/tests/data/test2037 +++ b/tests/data/test2037 @@ -43,7 +43,7 @@ simple HTTPS GET with PEM public key pinning # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2040 b/tests/data/test2040 index ab7987cb2be1..d95eb91a91b4 100644 --- a/tests/data/test2040 +++ b/tests/data/test2040 @@ -47,7 +47,7 @@ HTTP Basic authorization, then without authorization # Verify data after the test has been "shot" - + GET /%TESTNUMBER0100 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[testuser:testpass]b64% diff --git a/tests/data/test2041 b/tests/data/test2041 index 75da98ba9efe..25c7612fdcb9 100644 --- a/tests/data/test2041 +++ b/tests/data/test2041 @@ -43,7 +43,7 @@ simple HTTPS GET with base64-sha256 public key pinning # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2046 b/tests/data/test2046 index 4eb6ce69999e..aa57535ed2e6 100644 --- a/tests/data/test2046 +++ b/tests/data/test2046 @@ -57,7 +57,7 @@ http://%hex[%c3%a5%c3%a4%c3%b6]hex%.se:%HTTPPORT/%TESTNUMBER --resolve xn--4cab6 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: xn--4cab6c.se:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2047 b/tests/data/test2047 index ac934a6f7671..ee987ec69bb2 100644 --- a/tests/data/test2047 +++ b/tests/data/test2047 @@ -58,7 +58,7 @@ http://%hex[%c3%a5%c3%a4%c3%b6]hex%.se/%TESTNUMBER -x %HOSTIP:%HTTPPORT -w "%{nu # # Verify data after the test has been "shot" - + GET http://xn--4cab6c.se/%TESTNUMBER HTTP/1.1 Host: xn--4cab6c.se User-Agent: curl/%VERSION diff --git a/tests/data/test2049 b/tests/data/test2049 index 31513551accb..0fd0d94d77de 100644 --- a/tests/data/test2049 +++ b/tests/data/test2049 @@ -38,7 +38,7 @@ http://www1.example.com:8081/%TESTNUMBER --connect-to ::%HOSTIP:%HTTPPORT --next # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: www1.example.com:8081 User-Agent: curl/%VERSION diff --git a/tests/data/test2050 b/tests/data/test2050 index 202ea39106b6..96e7253c1e7c 100644 --- a/tests/data/test2050 +++ b/tests/data/test2050 @@ -61,14 +61,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT connect.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: connect.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT connect.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: connect.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /%TESTNUMBER HTTP/1.1 Host: www.example.com.%TESTNUMBER User-Agent: curl/%VERSION diff --git a/tests/data/test2051 b/tests/data/test2051 index b11d3c452b3c..8523652f0249 100644 --- a/tests/data/test2051 +++ b/tests/data/test2051 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" --next --connect-to # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2052 b/tests/data/test2052 index 60b45402b2d6..891912dde109 100644 --- a/tests/data/test2052 +++ b/tests/data/test2052 @@ -39,7 +39,7 @@ http://www.example.com:%HTTPPORT/%TESTNUMBER --resolve www.example.com:%HTTPPORT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: www.example.com:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2053 b/tests/data/test2053 index ac35ed37e54d..8322f79e72ff 100644 --- a/tests/data/test2053 +++ b/tests/data/test2053 @@ -38,7 +38,7 @@ http://10.0.0.1:8081/%TESTNUMBER --connect-to 10.0.0.1:8081:%HOSTIP:%HTTPPORT -- # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: 10.0.0.1:8081 User-Agent: curl/%VERSION diff --git a/tests/data/test2054 b/tests/data/test2054 index 59ec523bb76b..350e55634e38 100644 --- a/tests/data/test2054 +++ b/tests/data/test2054 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --connect-to foo::bar: --connect-to :123::4 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2055 b/tests/data/test2055 index dca5630263df..44458b504474 100644 --- a/tests/data/test2055 +++ b/tests/data/test2055 @@ -62,14 +62,14 @@ http://www.example.com.%TESTNUMBER/%TESTNUMBER --connect-to ::connect.example.co # # Verify data after the test has been "shot" - -CONNECT connect.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: connect.example.com.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT connect.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: connect.example.com.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /%TESTNUMBER HTTP/1.1 Host: www.example.com.%TESTNUMBER User-Agent: curl/%VERSION diff --git a/tests/data/test2056 b/tests/data/test2056 index 9d0db1d747bc..474050e64cef 100644 --- a/tests/data/test2056 +++ b/tests/data/test2056 @@ -51,7 +51,7 @@ CURL_STUB_GSS_CREDS="KRB5_Alice" # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Negotiate %b64["KRB5_Alice":HTTP@127.0.0.1:1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% diff --git a/tests/data/test2057 b/tests/data/test2057 index e9b613334312..4b567ec9b2d7 100644 --- a/tests/data/test2057 +++ b/tests/data/test2057 @@ -67,7 +67,7 @@ CURL_STUB_GSS_CREDS="NTLM_Alice" # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Negotiate %b64["NTLM_Alice":HTTP@127.0.0.1:2:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64% diff --git a/tests/data/test2058 b/tests/data/test2058 index f840c6e5f61a..6dce07107f9e 100644 --- a/tests/data/test2058 +++ b/tests/data/test2058 @@ -13,45 +13,45 @@ CUSTOMREQUEST # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test2059 b/tests/data/test2059 index dbd890431301..6ec6089ca197 100644 --- a/tests/data/test2059 +++ b/tests/data/test2059 @@ -13,45 +13,45 @@ CUSTOMREQUEST # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test206 b/tests/data/test206 index 82585f720cea..36bb5391d86e 100644 --- a/tests/data/test206 +++ b/tests/data/test206 @@ -19,11 +19,11 @@ auth_required # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 33 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" +Content-Length: 33 + And you should ignore this data. diff --git a/tests/data/test2060 b/tests/data/test2060 index 4c0c52e914f1..4f8480363225 100644 --- a/tests/data/test2060 +++ b/tests/data/test2060 @@ -13,45 +13,45 @@ CUSTOMREQUEST # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test2061 b/tests/data/test2061 index 26a2869712c3..718de8a3b604 100644 --- a/tests/data/test2061 +++ b/tests/data/test2061 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2062 b/tests/data/test2062 index 3f8eedc7b471..0899e6a540ae 100644 --- a/tests/data/test2062 +++ b/tests/data/test2062 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-512-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-512-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-512-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-512-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2063 b/tests/data/test2063 index cc4c4c2fb07e..ee377d2c89ed 100644 --- a/tests/data/test2063 +++ b/tests/data/test2063 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145", algorithm="SHA-256", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2064 b/tests/data/test2064 index 54102887e324..ec47a2a8cf84 100644 --- a/tests/data/test2064 +++ b/tests/data/test2064 @@ -8,40 +8,40 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2065 b/tests/data/test2065 index c15341049a6f..27a61e7f77b1 100644 --- a/tests/data/test2065 +++ b/tests/data/test2065 @@ -8,40 +8,40 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-512-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-512-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-512-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-512-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2066 b/tests/data/test2066 index 3a43fbb2bed8..bf609edb59eb 100644 --- a/tests/data/test2066 +++ b/tests/data/test2066 @@ -8,40 +8,40 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145", algorithm="SHA-256", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2067 b/tests/data/test2067 index 12f2ff18e63d..654bda7c054f 100644 --- a/tests/data/test2067 +++ b/tests/data/test2067 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test2068 b/tests/data/test2068 index a19faf2f878c..8a89fb87189b 100644 --- a/tests/data/test2068 +++ b/tests/data/test2068 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test2069 b/tests/data/test2069 index 06e444f17a44..6ed1aafe440d 100644 --- a/tests/data/test2069 +++ b/tests/data/test2069 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test207 b/tests/data/test207 index 193926f08b31..6d7e5c382bb8 100644 --- a/tests/data/test207 +++ b/tests/data/test207 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2070 b/tests/data/test2070 index 0769d1af0f7a..0dfa5db7277d 100644 --- a/tests/data/test2070 +++ b/tests/data/test2070 @@ -46,7 +46,7 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2074 b/tests/data/test2074 index 9e3d26d4da8d..c6c7e92b61c9 100644 --- a/tests/data/test2074 +++ b/tests/data/test2074 @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --oauth2-bearer mF_9.B5f-4.1JqM # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Bearer mF_9.B5f-4.1JqM diff --git a/tests/data/test2076 b/tests/data/test2076 index cb5e911da990..b99a0ed65bdd 100644 --- a/tests/data/test2076 +++ b/tests/data/test2076 @@ -8,31 +8,31 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -WWW-Authenticate: Digest realm="testrealm", nonce="1" -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +WWW-Authenticate: Digest realm="testrealm", nonce="1" +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -WWW-Authenticate: Digest realm="testrealm", nonce="1" -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +WWW-Authenticate: Digest realm="testrealm", nonce="1" +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Content-Length: 23 + This IS the real page! @@ -58,7 +58,7 @@ HTTP with digest auth and URI contains query # Verify data after the test has been "shot" - + GET /%TESTNUMBER?query HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2077 b/tests/data/test2077 index b244b9466cf1..7f6458f895b4 100644 --- a/tests/data/test2077 +++ b/tests/data/test2077 @@ -9,10 +9,10 @@ GSS-API # Server-side - -HTTP/1.1 200 OK swsclose -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Content-Length: 23 + This IS the real page! diff --git a/tests/data/test2078 b/tests/data/test2078 index de1f1cf5c22d..07342b71e3a1 100644 --- a/tests/data/test2078 +++ b/tests/data/test2078 @@ -9,10 +9,10 @@ GSS-API # Server-side - -HTTP/1.1 200 OK swsclose -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Content-Length: 23 + This IS the real page! diff --git a/tests/data/test2079 b/tests/data/test2079 index 0e2cf01a248b..78709f3a2cda 100644 --- a/tests/data/test2079 +++ b/tests/data/test2079 @@ -47,7 +47,7 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2081 b/tests/data/test2081 index 421b47588660..29af09d0be30 100644 --- a/tests/data/test2081 +++ b/tests/data/test2081 @@ -11,18 +11,18 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + This server reply is for testing a simple Location: following - -HTTP/1.1 200 This is another weirdo text message swsclose -Connection: close - + +HTTP/1.1 200 This is another weirdo text message swsclose +Connection: close + Thanks for following. @@ -42,7 +42,7 @@ http://user:pass@%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER#anchor --location --r # Verify data after the test has been "shot" - + GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:pass]b64% @@ -57,15 +57,15 @@ Accept: */* Referer: http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER - -HTTP/1.1 301 This is a weirdo text message swsclose -Location: data/%TESTNUMBER0002.txt?coolsite=yes -Content-Length: 62 -Connection: close - -HTTP/1.1 200 This is another weirdo text message swsclose -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Location: data/%TESTNUMBER0002.txt?coolsite=yes +Content-Length: 62 +Connection: close + +HTTP/1.1 200 This is another weirdo text message swsclose +Connection: close + Thanks for following. http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER diff --git a/tests/data/test2087 b/tests/data/test2087 index bffab46fa2c4..7c7176723412 100644 --- a/tests/data/test2087 +++ b/tests/data/test2087 @@ -47,7 +47,7 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2088 b/tests/data/test2088 index b318e674c9fd..ea8d42a17a62 100644 --- a/tests/data/test2088 +++ b/tests/data/test2088 @@ -42,7 +42,7 @@ HTTPS GET with client authentication (mtls) # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPS-MTLSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2089 b/tests/data/test2089 index 5a64225d9129..f3a497a97a56 100644 --- a/tests/data/test2089 +++ b/tests/data/test2089 @@ -42,7 +42,7 @@ HTTPS GET with client authentication (mtls) and --insecure # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPS-MTLSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test209 b/tests/data/test209 index 3a9c1218a8b0..48ccde271c38 100644 --- a/tests/data/test209 +++ b/tests/data/test209 @@ -14,21 +14,21 @@ NTLM # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 33 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 33 + And you should ignore this data. # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 Things are fine in proxy land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 + # this is returned when we get a GET! @@ -92,7 +92,7 @@ http://test.remote.example.com.%TESTNUMBER:%HTTPPORT/path/%TESTNUMBER0002 --prox # Verify data after the test has been "shot" - + CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test2102 b/tests/data/test2102 index 5ee35bdf6e4e..037931fb8586 100644 --- a/tests/data/test2102 +++ b/tests/data/test2102 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -53,7 +53,7 @@ http://examplehost.example:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: examplehost.example:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test213 b/tests/data/test213 index 7780b231c175..909c84780712 100644 --- a/tests/data/test213 +++ b/tests/data/test213 @@ -14,21 +14,21 @@ NTLM # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 33 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 33 + And you should ignore this data. # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 Things are fine in proxy land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 + # this is returned when we get a GET! diff --git a/tests/data/test214 b/tests/data/test214 index 76c328ac98cb..f473ea0b9740 100644 --- a/tests/data/test214 +++ b/tests/data/test214 @@ -40,7 +40,7 @@ MSYS2_ARG_CONV_EXCL=http:// # # Verify data after the test has been "shot" - + GET /{}\/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test217 b/tests/data/test217 index 07bbeac46fdc..5f400b0c0fef 100644 --- a/tests/data/test217 +++ b/tests/data/test217 @@ -15,9 +15,9 @@ followlocation # this is returned first since we get no proxy-auth - -HTTP/1.1 405 Method Not Allowed swsclose - + +HTTP/1.1 405 Method Not Allowed swsclose + And you should ignore this data. @@ -41,7 +41,7 @@ proxy # Verify data after the test has been "shot" - + CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT User-Agent: curl/%VERSION @@ -52,9 +52,9 @@ Proxy-Connection: Keep-Alive 56 - -HTTP/1.1 405 Method Not Allowed swsclose - + +HTTP/1.1 405 Method Not Allowed swsclose + 000 405 diff --git a/tests/data/test218 b/tests/data/test218 index b5e2b08b2fb6..8d1a673ca43b 100644 --- a/tests/data/test218 +++ b/tests/data/test218 @@ -9,12 +9,12 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.0 200 OK -Server: test-server/fake -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.0 200 OK +Server: test-server/fake +Content-Type: text/html +Content-Length: 6 + blaha diff --git a/tests/data/test22 b/tests/data/test22 index 2141182295d7..539ef4bc5d8b 100644 --- a/tests/data/test22 +++ b/tests/data/test22 @@ -7,11 +7,11 @@ long URL # Server-side - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 27 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 27 + This is the proof it works diff --git a/tests/data/test220 b/tests/data/test220 index 48cd0af3bebb..a7f89ff885bd 100644 --- a/tests/data/test220 +++ b/tests/data/test220 @@ -9,28 +9,28 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: GZIP -Content-Length: 44 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: GZIP +Content-Length: 44 + %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c%0a%10%86%31%17%00]hex% %hex[%02%71%60%18%00%00%00]hex% - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: GZIP -Content-Length: 44 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: GZIP +Content-Length: 44 + line 1 line 2 line 3 @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test221 b/tests/data/test221 index d51d730f7552..d514a688e16a 100644 --- a/tests/data/test221 +++ b/tests/data/test221 @@ -10,30 +10,30 @@ FAILURE # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: gzip -Content-Length: 41 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: gzip +Content-Length: 41 + %hex[%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c%0a%10%86%31%17%00]hex% %hex[%02%71%60%18%00%00%00]hex% # I removed the first three bytes of the gzip compressed contents - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: gzip -Content-Length: 41 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: gzip +Content-Length: 41 + @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test222 b/tests/data/test222 index f01c017f83c4..edcc3488d72c 100644 --- a/tests/data/test222 +++ b/tests/data/test222 @@ -9,15 +9,15 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate -Content-Length: 1305 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: deflate +Content-Length: 1305 + %hex[%78%9c%dc%58%db%6e%e3%36%10%7d%37%90%7f%60%fd%d4%02%b6%6e%b6%13%39%70%b4%28%72%d9%04%cd%36%c1%da%05%ba%4f%06%2d%d1%36%1b%49%14%48%ca%b9%3c%f4%db%3b%94%28%89%b1%1c%af%77%83%be%04%48%62%72%e6%9c%c3%e1%0c%49%93%99%7c%7a%4a%62%b4%21%5c%50%96%9e%75%5d%cb%e9%22%92%86%2c%a2%e9%ea%ac%7b%33%bd%eb%fb%fe%68%dc%77%bb%9f%82%ce%e4%97%8b%bb%f3%d9%b7%fb%4b%94%71%f6%0f%09%65%3f%a6%42%02%10%4d%bf%4d%67%97%5f%50%77%2d%65%76%6a%db%4b%4e%c4%3a%21%58%5a%29%91%f6%02%87%0f%24%8d%ec%65%d2%d7%3c%d1%77%ac%a1%15%c9%a8%0b%a2%5b%5a%41%07%a1%ca%a6%da%4d%6f%4e%a3%c0%3d%76%bd%89%6d%18%4a%44%84%25%99%e3%28%22%80%18%8f%fd%be%e3%f7%3d%17%39%c3%53%c7%3d%f5%c6%13%db%f0%1b%84%3c%53%1f%51%e0%39%ce%b0%ef%3a%7d%d7%47%8e%77%ea%c1%cf%40%53%2a%c4%ab%38%52%9c%90%b9%58%33%2e%83%30%e7%71%1d%8e%61%6f%e3%97%79%1c%17%70%84%d3%08%c5%74%d1%a6%16%10%1d%1e%11%a1%96%3a%67%49%52%52%52%82%24%63%b5%00%c7%fc%19%2d%19%47%61%4c%49%2a%fb%82%46%04%fd%f5%f5%16%49%8e%53%b1%84%8a%5a%30%8b%46%c8%50%de%19%0c%a2%02%e1%72%04%a5%5a%a9%70%55%df%25%8d%89%38%ea%e4%42%75%d4%18%e2%39%95%f8%c9%42%37%12%89%3c%cb%40%5f%a0%eb%d9%ec%be%57%fc%9d%f6%d0%15%b4%8f%3a%57%45%fb%e2%e6%7c%d6%43%b3%cb%db%3f%2f%e1%f3%f6%e2%77%80%5d%dd%dc%5e%f6%8a%e1%3f%df%dd%5f%5f%7e%85%36%0c%f0%48%62%88%a9%94%ea%67%4c%c8%9e%6e%e6%d0]hex% %hex[%19%7b%a0%44%14%da%28%cf%62%86%23%18%02%96%5a%9e%90%a8%99%75%0f%65%58%88%47%c6%23%d5%84%c8%d2%3c%59%14%f6%e9%f4%f6%a8%13%12%2e%e9%92%86%50%57%30%fd%41%38%f8%98%28%43%81%6a%3c%c1%08%c5%b4%20%1b%19%7b%24%9c%44%47%9d%c5%73%95%a4%1e%92%6b%f2%66%c6%ab%b2%58%47%9d%d9%1a%a8%08%c3%ef%82%a6%6a%33%09%48%6d%9d%6a%95%60%06%9b%0e%79%ce%51%27%c6%e9%2a%c7%2b%22%8a%18%48%ba%a1%9c%a5%09%0c%20%40%47%97%d0%58%1b%1b%2a%71%4c%e5%f3%5c%84%8c%93%60%74%e2%0f%ad%d1%c9%c4%de%b2%6f%81%33%c2%43%90%0c%06%96%7b%6c%60%2b%f3%16%1a%e6%f3%00%7b%6d%6c%20%0b%93%5e%d7%2c%cb%63%cc%9b%b1%8e%47%63%88%61%08%cb%79%db%d3%22%54%03%ba%03%cb%77%5f%11%5e%87%62%38%ca%60%9c%d1%2b%b4%11%0e%c7%c5%b9%e1%5b%23%67%62%eb%8e%e9%99%87%2c%07%5d%cf%ad%bc%da%f0]hex% %hex[%53%0e%e2%0f%6a%8c%31%80%c8%17%22%e4%34%93%70%44%8a%60%a0%4e%87%d7%a6%12%06%a5%4f%c3%f5%5c%ed%e5%e0%82%2c%71%1e%cb%89%6d%1a%4b%18%d4%7f%5e%1d%60%19%94%3d%d8%79%68%56%27%a5%ad%d6%8b%3d%b1%5b%ac%46%6c%cd%12%f2%b6%10%2c%60%ca%4b%15%75%78%da%26%43%eb%d6%02%8d%a6%5c%bd%1c%2e%07%60%ad%a4%68%8d%c8%e2%c5%3b%5c%04%c0%5a%44%d1%1a%91%17%9a%1d%2e%02%60%2d%a2%68%8d%48%b8%86%3d%46%62%b6%3a%5c%aa%a6%68%c1%46%a2%91%e5%59%72%b8%20%80%b5%94%a2%35%22%11%59%1c%2e%02%60%2d%a2%68%8d%08%13%4f%87%8b%00%58%8b%28%9a%51%2f%11%a9%f3%f2%07%6a%56%12%aa%ba%69%ba%b1%cc%73%0e%69%13%24%d0%eb%b7%ea%1a%85%d9%88%1f%28%c9%46%54%c5%d8%08%43%44%dd%1c%0e%57%51%68%2d%53%10%1b%9d%84%72%ce%f8%e1%4a%25%5e%6b%69%b2%59%d7%84%05%55%ad%a0%59%7a%62]hex% @@ -172,7 +172,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test223 b/tests/data/test223 index bcdc415d18b0..06f2638dd0ff 100644 --- a/tests/data/test223 +++ b/tests/data/test223 @@ -12,27 +12,27 @@ FAILURE # this deflate chunk has three bytes removed from the beginning and is cut # short - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate -Content-Length: 1305 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: deflate +Content-Length: 1305 + %hex[%58%db%6e%e3%36%10%7d%37%90%7f%60%fd%d4%02%b6%6e%b6%13%39%70%b4%28%72%d9%04%cd%36%c1%da%05%ba%4f%06%2d%d1%36%1b%49%14%48%ca%b9%3c%f4%db%3b%94%28%89%b1%1c%af%77%83%be%04%48%62%72%e6%9c%c3%e1%0c%49%93%99%7c%7a%4a%62%b4%21%5c%50%96%9e%75%5d%cb%e9%22%92%86%2c%a2%e9%ea%ac%7b%33%bd%eb%fb%fe%68%dc%77%bb%9f%82%ce%e4%97%8b%bb%f3%d9%b7%fb%4b%94%71%f6%0f%09%65%3f%a6%42%02%10%4d%bf%4d%67%97%5f%50%77%2d%65%76%6a%db%4b%4e%c4%3a%21%58%5a%29%91%f6%02%87%0f%24%8d%ec%65%d2%d7%3c%d1%77%ac%a1%15%c9%a8%0b%a2%5b%5a%41%07%a1%ca%a6%da%4d%6f%4e%a3%c0%3d%76%bd%89%6d%18%4a%44%84%25%99%e3%28%22%80%18%8f%fd%be%e3%f7%3d%17%39%c3%53%c7%3d%f5%c6%13%db%f0%1b%84%3c%53%1f%51%e0%39%ce%b0%ef%3a%7d%d7%47%8e%77%ea%c1%cf%40%53%2a%c4%ab%38%52%9c%90%b9%58%33%2e%83%30%e7%71%1d%8e%61%6f%e3%97%79%1c%17%70%84%d3%08%c5%74%d1%a6%16%10%1d%1e%11%a1%96%3a%67%49%52%52%52%82%24%63%b5%00%c7%fc%19%2d%19%47%61%4c%49%2a%fb%82%46%04%fd%f5%f5%16%49%8e%53%b1%84%8a%5a%30%8b%46%c8%50%de%19%0c%a2%02%e1%72%04%a5%5a%a9%70%55%df%25%8d%89%38%ea%e4%42%75%d4%18%e2%39%95%f8%c9%42%37%12%89%3c%cb%40%5f%a0%eb%d9%ec%be%57%fc%9d%f6%d0%15%b4%8f%3a%57%45%fb%e2%e6%7c%d6%43%b3%cb%db%3f%2f%e1%f3%f6%e2%77%80%5d%dd%dc%5e%f6%8a%e1%3f%df%dd%5f%5f%7e%85%36%0c%f0%48%62%88%a9%94%ea%67%4c%c8%9e%6e%e6%d0]hex% - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate -Content-Length: 1305 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: deflate +Content-Length: 1305 + @@ -60,7 +60,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test224 b/tests/data/test224 index cf8673111318..2067e7a1857f 100644 --- a/tests/data/test224 +++ b/tests/data/test224 @@ -9,27 +9,27 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: gzip -Content-Length: 2186 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: gzip +Content-Length: 2186 + %hex[%1f%8b%08%1c%bf%bc%ab%41%02%03%30%00%74%68%69%73%20%69%73%20%61%6e%20%65%78%74%72%61%20%66%69%65%6c%64%20%74%68%61%74%20%6d%75%73%74%20%62%65%20%72%65%6d%6f%76%65%64%5f%5f%5f%5f%5f%6c%6f%6e%67%2d%66%69%6c%65%6e%61%6d%65%2dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%00%74%68%69%73%20%69%73%20%61%20%63%6f%6d%6d%65%6e%74%20%74%68%61%74%20%6d%75%73%74%20%62%65%20%73%6b%69%70%70%65%64%00%2b%cd%4b%ce%cf%2d%28%4a%2d%2e%4e%4d%51%48%af%ca%2c%50%48%49%2c%49%54%28%cf%2c%c9%50%c8%c9%cf%4b%87%88%65%a4%26%a6%a4%16%71%01%00%b8%50%9e%cb%2d%00%00%00]hex% - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: gzip -Content-Length: 2186 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: gzip +Content-Length: 2186 + uncompressed gzip data with long gzip header @@ -58,7 +58,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test230 b/tests/data/test230 index 3dc478fc99d6..0a14e4c15f8e 100644 --- a/tests/data/test230 +++ b/tests/data/test230 @@ -9,15 +9,15 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate, identity, gzip -Content-Length: 1328 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: deflate, identity, gzip +Content-Length: 1328 + %hex[%1f%8b%08%00%fa%65%fa%59%00%03%01%19%05%e6%fa%78%9c%dc%58%db%6e%e3%36%10%7d%37%90%7f%60%fd%d4%02%b6%6e%b6%13%39%70%b4%28%72%d9%04%cd%36%c1%da%05%ba%4f%06%2d%d1%36%1b%49%14%48%ca%b9%3c%f4%db%3b%94%28%89%b1%1c%af%77%83%be%04%48%62%72%e6%9c%c3%e1%0c%49%93%99%7c%7a%4a%62%b4%21%5c%50%96%9e%75%5d%cb%e9%22%92%86%2c%a2%e9%ea%ac%7b%33%bd%eb%fb%fe%68%dc%77%bb%9f%82%ce%e4%97%8b%bb%f3%d9%b7%fb%4b%94%71%f6%0f%09%65%3f%a6%42%02%10%4d%bf%4d%67%97%5f%50%77%2d%65%76%6a%db%4b%4e%c4%3a%21%58%5a%29%91%f6%02%87%0f%24%8d%ec%65%d2%d7%3c%d1%77%ac%a1%15%c9%a8%0b%a2%5b%5a%41%07%a1%ca%a6%da%4d%6f%4e%a3%c0%3d%76%bd%89%6d%18%4a%44%84%25%99%e3%28%22%80%18%8f%fd%be%e3%f7%3d%17%39%c3%53%c7%3d%f5%c6%13%db%f0%1b%84%3c%53%1f%51%e0%39%ce%b0%ef%3a%7d%d7%47%8e%77%ea%c1%cf%40%53%2a%c4%ab%38%52%9c%90%b9%58%33%2e%83%30%e7%71%1d%8e%61%6f%e3%97%79%1c%17%70%84%d3%08%c5%74%d1%a6%16%10%1d%1e%11%a1%96%3a%67%49%52%52%52%82%24%63%b5%00%c7%fc%19%2d%19%47%61%4c%49%2a%fb%82%46%04%fd%f5%f5%16%49%8e%53%b1%84%8a%5a%30%8b%46%c8%50%de%19%0c%a2%02%e1%72%04%a5%5a%a9%70%55%df%25%8d%89%38%ea%e4%42%75%d4%18%e2%39%95%f8%c9%42%37%12%89%3c%cb%40%5f%a0%eb%d9%ec%be%57%fc%9d%f6%d0%15%b4%8f%3a%57%45%fb%e2%e6%7c%d6%43%b3%cb%db%3f%2f%e1%f3%f6%e2%77%80%5d%dd%dc%5e%f6%8a%e1%3f%df%dd%5f%5f%7e%85%36%0c%f0%48%62%88%a9%94%ea%67%4c%c8%9e%6e%e6%d0]hex% %hex[%19%7b%a0%44%14%da%28%cf%62%86%23%18%02%96%5a%9e%90%a8%99%75%0f%65%58%88%47%c6%23%d5%84%c8%d2%3c%59%14%f6%e9%f4%f6%a8%13%12%2e%e9%92%86%50%57%30%fd%41%38%f8%98%28%43%81%6a%3c%c1%08%c5%b4%20%1b%19%7b%24%9c%44%47%9d%c5%73%95%a4%1e%92%6b%f2%66%c6%ab%b2%58%47%9d%d9%1a%a8%08%c3%ef%82%a6%6a%33%09%48%6d%9d%6a%95%60%06%9b%0e%79%ce%51%27%c6%e9%2a%c7%2b%22%8a%18%48%ba%a1%9c%a5%09%0c%20%40%47%97%d0%58%1b%1b%2a%71%4c%e5%f3%5c%84%8c%93%60%74%e2%0f%ad%d1%c9%c4%de%b2%6f%81%33%c2%43%90%0c%06%96%7b%6c%60%2b%f3%16%1a%e6%f3%00%7b%6d%6c%20%0b%93%5e%d7%2c%cb%63%cc%9b%b1%8e%47%63%88%61%08%cb%79%db%d3%22%54%03%ba%03%cb%77%5f%11%5e%87%62%38%ca%60%9c%d1%2b%b4%11%0e%c7%c5%b9%e1%5b%23%67%62%eb%8e%e9%99%87%2c%07%5d%cf%ad%bc%da%f0]hex% %hex[%53%0e%e2%0f%6a%8c%31%80%c8%17%22%e4%34%93%70%44%8a%60%a0%4e%87%d7%a6%12%06%a5%4f%c3%f5%5c%ed%e5%e0%82%2c%71%1e%cb%89%6d%1a%4b%18%d4%7f%5e%1d%60%19%94%3d%d8%79%68%56%27%a5%ad%d6%8b%3d%b1%5b%ac%46%6c%cd%12%f2%b6%10%2c%60%ca%4b%15%75%78%da%26%43%eb%d6%02%8d%a6%5c%bd%1c%2e%07%60%ad%a4%68%8d%c8%e2%c5%3b%5c%04%c0%5a%44%d1%1a%91%17%9a%1d%2e%02%60%2d%a2%68%8d%48%b8%86%3d%46%62%b6%3a%5c%aa%a6%68%c1%46%a2%91%e5%59%72%b8%20%80%b5%94%a2%35%22%11%59%1c%2e%02%60%2d%a2%68%8d%08%13%4f%87%8b%00%58%8b%28%9a%51%2f%11%a9%f3%f2%07%6a%56%12%aa%ba%69%ba%b1%cc%73%0e%69%13%24%d0%eb%b7%ea%1a%85%d9%88%1f%28%c9%46%54%c5%d8%08%43%44%dd%1c%0e%57%51%68%2d%53%10%1b%9d%84%72%ce%f8%e1%4a%25%5e%6b%69%b2%59%d7%84%05%55%ad%a0%59%7a%62]hex% @@ -172,7 +172,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2300 b/tests/data/test2300 index 33460cdd4b68..e9ceb65f0479 100644 --- a/tests/data/test2300 +++ b/tests/data/test2300 @@ -8,13 +8,13 @@ WebSockets # # Server-side - -HTTP/1.1 101 Switching to WebSockets swsclose -Server: test-server/fake -Upgrade: websocket -Connection: Upgrade -Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= - + +HTTP/1.1 101 Switching to WebSockets swsclose +Server: test-server/fake +Upgrade: websocket +Connection: Upgrade +Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= + # allow upgrade @@ -47,7 +47,7 @@ WebSockets upgrade only # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2301 b/tests/data/test2301 index 1762a2c57f1b..a0fe4f1dec97 100644 --- a/tests/data/test2301 +++ b/tests/data/test2301 @@ -8,14 +8,14 @@ WebSockets # # Server-side - -HTTP/1.1 101 Switching to WebSockets -Server: test-server/fake -Upgrade: websocket -Connection: Upgrade -Something: else -Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= - + +HTTP/1.1 101 Switching to WebSockets +Server: test-server/fake +Upgrade: websocket +Connection: Upgrade +Something: else +Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= + %hex[%89%00]hex% # allow upgrade diff --git a/tests/data/test2302 b/tests/data/test2302 index 0b3a7d524e43..ab88d9e162c0 100644 --- a/tests/data/test2302 +++ b/tests/data/test2302 @@ -8,14 +8,14 @@ WebSockets # # Sends a PING + a 5 byte hello TEXT - -HTTP/1.1 101 Switching to WebSockets -Server: test-server/fake -Upgrade: websocket -Connection: Upgrade -Something: else -Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= - + +HTTP/1.1 101 Switching to WebSockets +Server: test-server/fake +Upgrade: websocket +Connection: Upgrade +Something: else +Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= + %hex[%89%00%81%05hello]hex% # allow upgrade diff --git a/tests/data/test2303 b/tests/data/test2303 index cfb1f0d6cd38..5c68deaff177 100644 --- a/tests/data/test2303 +++ b/tests/data/test2303 @@ -7,12 +7,12 @@ WebSockets # - -HTTP/1.1 200 Oblivious -Server: test-server/fake -Something: else -Content-Length: 6 - + +HTTP/1.1 200 Oblivious +Server: test-server/fake +Something: else +Content-Length: 6 + hello @@ -43,7 +43,7 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: webbie-sox/3 diff --git a/tests/data/test2304 b/tests/data/test2304 index 47c81b2a96e7..fda6186f6353 100644 --- a/tests/data/test2304 +++ b/tests/data/test2304 @@ -52,7 +52,7 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER # PONG with no data and the 32 bit mask # - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: websocket/%TESTNUMBER diff --git a/tests/data/test2306 b/tests/data/test2306 index c6bbdb0f2b5c..233905fc7915 100644 --- a/tests/data/test2306 +++ b/tests/data/test2306 @@ -9,17 +9,17 @@ HTTP GET # This reproduces the #11101 issue, when the second response comes back # with the first header being "folded" - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2308 b/tests/data/test2308 index c4e35ad8cc2a..dfbe0db82e0a 100644 --- a/tests/data/test2308 +++ b/tests/data/test2308 @@ -8,17 +8,17 @@ HTTP GET # # This reproduces the #13669 issue - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2309 b/tests/data/test2309 index 3763822d0e8f..88d4b03affd7 100644 --- a/tests/data/test2309 +++ b/tests/data/test2309 @@ -8,7 +8,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -54,7 +54,7 @@ password $y$j9T$WUVjiVvDbRAWafDLs6cab1$01NX.oaZKf5lw8MR2Nk9Yaxv4CqbE0IaDF.GpGxPu - + GET http://github.com/ HTTP/1.1 Host: github.com Authorization: Basic %b64[daniel:$y$j9T$WUVjiVvDbRAWafDLs6cab1$01NX.oaZKf5lw8MR2Nk9Yaxv4CqbE0IaDF.GpGxPul1]b64% diff --git a/tests/data/test232 b/tests/data/test232 index 25cab8372bbe..5b0cdb3015e7 100644 --- a/tests/data/test232 +++ b/tests/data/test232 @@ -9,15 +9,15 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate -Content-Length: 1287 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: deflate +Content-Length: 1287 + %hex[%dd%58%db%6e%e3%36%10%7d%37%90%7f%60%fd%d4%02%b6%6e%b6%13%39%70%b4%28%72%d9%04%cd%36%c1%da%05%ba%4f%06%2d%d1%36%1b%49%14%48%ca%b9%3c%f4%db%3b%94%28%89%b1%1c%af%77%83%be%04%48%62%72%e6%9c%c3%e1%0c%49%93%99%7c%7a%4a%62%b4%21%5c%50%96%9e%75%5d%cb%e9%22%92%86%2c%a2%e9%ea%ac%7b%33%bd%eb%fb%fe%68%dc%77%bb%9f%82%ce%e4%97%8b%bb%f3%d9%b7%fb%4b%94%71%f6%0f%09%65%3f%a6%42%02%10%4d%bf%4d%67%97%5f%50%77%2d%65%76%6a%db%4b%4e%c4%3a%21%58%5a%29%91%f6%02%87%0f%24%8d%ec%65%d2%d7%3c%d1%77%ac%a1%15%c9%a8%0b%a2%5b%5a%41%07%a1%ca%a6%da%4d%6f%4e%a3%c0%3d%76%bd%89%6d%18%4a%44%84%25%99%e3%28%22%80%18%8f%fd%be%e3%f7%3d%17%39%c3%53%c7%3d%f5%c6%13%db%f0%1b%84%3c%53%1f%51%e0%39%ce%b0%ef%3a%7d%d7%47%8e%77%ea%c1%cf%40%53%2a%c4%ab%38%52%9c%90%b9%58%33%2e%83%30%e7%71%1d%8e%61%6f%e3%97%79%1c%17%70%84%d3%08%c5%74%d1%a6%16%10%1d%1e%11%a1%96%3a%67%49%52%52%52%82%24%63%b5%00%c7%fc%19%2d%19%47%61%4c%49%2a%fb%82%46%04%fd%f5%f5%16%49%8e%53%b1%84%8a%5a%30%8b%46%c8%50%de%19%0c%a2%02%e1%72%04%a5%5a%a9%70%55%df%25%8d%89%38%ea%e4%42%75%d4%18%e2%39%95%f8%c9%42%37%12%89%3c%cb%40%5f%a0%eb%d9%ec%be%57%fc%9d%f6%d0%15%b4%8f%3a%57%45%fb%e2%e6%7c%d6%43%b3%cb%db%3f%2f%e1%f3%f6%e2%77%80%5d%dd%dc%5e%f6%8a%e1%3f%df%dd%5f%5f%7e%85%36%0c%f0%48%62%88%a9%94%ea%67%4c%c8%9e%6e%e6%d0]hex% %hex[%19%7b%a0%44%14%da%28%cf%62%86%23%18%02%96%5a%9e%90%a8%99%75%0f%65%58%88%47%c6%23%d5%84%c8%d2%3c%59%14%f6%e9%f4%f6%a8%13%12%2e%e9%92%86%50%57%30%fd%41%38%f8%98%28%43%81%6a%3c%c1%08%c5%b4%20%1b%19%7b%24%9c%44%47%9d%c5%73%95%a4%1e%92%6b%f2%66%c6%ab%b2%58%47%9d%d9%1a%a8%08%c3%ef%82%a6%6a%33%09%48%6d%9d%6a%95%60%06%9b%0e%79%ce%51%27%c6%e9%2a%c7%2b%22%8a%18%48%ba%a1%9c%a5%09%0c%20%40%47%97%d0%58%1b%1b%2a%71%4c%e5%f3%5c%84%8c%93%60%74%e2%0f%ad%d1%c9%c4%de%b2%6f%81%33%c2%43%90%0c%06%96%7b%6c%60%2b%f3%16%1a%e6%f3%00%7b%6d%6c%20%0b%93%5e%d7%2c%cb%63%cc%9b%b1%8e%47%63%88%61%08%cb%79%db%d3%22%54%03%ba%03%cb%77%5f%11%5e%87%62%38%ca%60%9c%d1%2b%b4%11%0e%c7%c5%b9%e1%5b%23%67%62%eb%8e%e9%99%87%2c%07%5d%cf%ad%bc%da%f0]hex% %hex[%53%0e%e2%0f%6a%8c%31%80%c8%17%22%e4%34%93%70%44%8a%60%a0%4e%87%d7%a6%12%06%a5%4f%c3%f5%5c%ed%e5%e0%82%2c%71%1e%cb%89%6d%1a%4b%18%d4%7f%5e%1d%60%19%94%3d%d8%79%68%56%27%a5%ad%d6%8b%3d%b1%5b%ac%46%6c%cd%12%f2%b6%10%2c%60%ca%4b%15%75%78%da%26%43%eb%d6%02%8d%a6%5c%bd%1c%2e%07%60%ad%a4%68%8d%c8%e2%c5%3b%5c%04%c0%5a%44%d1%1a%91%17%9a%1d%2e%02%60%2d%a2%68%8d%48%b8%86%3d%46%62%b6%3a%5c%aa%a6%68%c1%46%a2%91%e5%59%72%b8%20%80%b5%94%a2%35%22%11%59%1c%2e%02%60%2d%a2%68%8d%08%13%4f%87%8b%00%58%8b%28%9a%51%2f%11%a9%f3%f2%07%6a%56%12%aa%ba%69%ba%b1%cc%73%0e%69%13%24%d0%eb%b7%ea%1a%85%d9%88%1f%28%c9%46%54%c5%d8%08%43%44%dd%1c%0e%57%51%68%2d%53%10%1b%9d%84%72%ce%f8%e1%4a%25%5e%6b%69%b2%59%d7%84%05%55%ad%a0%59%7a%62]hex% @@ -172,7 +172,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test233 b/tests/data/test233 index 3b55200e2008..f802232fb0f5 100644 --- a/tests/data/test233 +++ b/tests/data/test233 @@ -75,7 +75,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: first.host.it.is Proxy-Authorization: Basic %b64[testing:this]b64% diff --git a/tests/data/test234 b/tests/data/test234 index b3b06cc6be01..601580b7fd96 100644 --- a/tests/data/test234 +++ b/tests/data/test234 @@ -77,7 +77,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: first.host.it.is Proxy-Authorization: Basic %b64[testing:this]b64% diff --git a/tests/data/test239 b/tests/data/test239 index 6bd571b7e2b3..7985c877bbd2 100644 --- a/tests/data/test239 +++ b/tests/data/test239 @@ -13,35 +13,35 @@ NTLM # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test24 b/tests/data/test24 index ae343baa5949..eba34b5772d0 100644 --- a/tests/data/test24 +++ b/tests/data/test24 @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail --silent --show-error # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test240 b/tests/data/test240 index d4d3551b8256..9941df77ac17 100644 --- a/tests/data/test240 +++ b/tests/data/test240 @@ -45,7 +45,7 @@ HTTP-IPv6 GET # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOST6IP:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test2400 b/tests/data/test2400 index cb68a11e213f..8478681fbd4c 100644 --- a/tests/data/test2400 +++ b/tests/data/test2400 @@ -11,14 +11,14 @@ HTTPS # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -49,7 +49,7 @@ HTTP/2 GET over HTTPS # # Verify data after the test has been "shot" - + HTTP/2 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 diff --git a/tests/data/test2401 b/tests/data/test2401 index 979a8b235687..a10715ff80a8 100644 --- a/tests/data/test2401 +++ b/tests/data/test2401 @@ -11,13 +11,13 @@ HTTPS # # Server-side - -HTTP/1.1 201 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close -Content-Length: 0 -Funny-head: yesyes - + +HTTP/1.1 201 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close +Content-Length: 0 +Funny-head: yesyes + @@ -46,14 +46,14 @@ HTTP/2 POST over HTTPS # # Verify data after the test has been "shot" - -HTTP/2 201 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 0 -funny-head: yesyes -server: nghttpx -via: 1.1 nghttpx - + +HTTP/2 201%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 0 +funny-head: yesyes +server: nghttpx +via: 1.1 nghttpx + POST /%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test2402 b/tests/data/test2402 index 5133a0944a83..1903534dc81a 100644 --- a/tests/data/test2402 +++ b/tests/data/test2402 @@ -10,36 +10,36 @@ verbose logs # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: server.example.com -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: server.example.com +Content-Length: 47 + file contents should appear once for each file @@ -67,7 +67,7 @@ HTTP GET multiple files over HTTP/2 using HTTPS # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2403 b/tests/data/test2403 index dec03cd51ceb..b23b1e6760e4 100644 --- a/tests/data/test2403 +++ b/tests/data/test2403 @@ -13,7 +13,7 @@ HTTPS # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 6 @@ -50,7 +50,7 @@ HTTP/2 GET using %{header_json} # # Verify data after the test has been "shot" - + HTTP/2 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 diff --git a/tests/data/test2404 b/tests/data/test2404 index 3a5901e8f3aa..1ed03968dbac 100644 --- a/tests/data/test2404 +++ b/tests/data/test2404 @@ -10,7 +10,7 @@ verbose logs # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -18,7 +18,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -26,7 +26,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -34,7 +34,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -67,7 +67,7 @@ HTTP/2 using STREAM_WEIGHTs # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2406 b/tests/data/test2406 index a6db9233efcd..adf39dbd7e50 100644 --- a/tests/data/test2406 +++ b/tests/data/test2406 @@ -11,14 +11,14 @@ HTTPS # # Server-side - -HTTP/1.1 404 nope -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 404 nope +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -48,7 +48,7 @@ HTTP/2 over HTTPS with -f # # Verify data after the test has been "shot" - + HTTP/2 404%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 diff --git a/tests/data/test241 b/tests/data/test241 index 66161f6569c0..2188722ecc73 100644 --- a/tests/data/test241 +++ b/tests/data/test241 @@ -43,7 +43,7 @@ HTTP-IPv6 GET (using ip6-localhost) # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: ip6-localhost:%HTTP6PORT User-Agent: curl/%VERSION diff --git a/tests/data/test242 b/tests/data/test242 index 62be5173cce1..43b07f8cea5d 100644 --- a/tests/data/test242 +++ b/tests/data/test242 @@ -40,7 +40,7 @@ HTTP-IPv6 GET with username+password in URL # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOST6IP:%HTTP6PORT Authorization: Basic %b64[foobar:barfoo]b64% diff --git a/tests/data/test243 b/tests/data/test243 index 273bd05492d2..b8e62f050308 100644 --- a/tests/data/test243 +++ b/tests/data/test243 @@ -13,56 +13,56 @@ NTLM # Server-side - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test245 b/tests/data/test245 index da95cc5a6ba1..8abef87e3a41 100644 --- a/tests/data/test245 +++ b/tests/data/test245 @@ -9,35 +9,35 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test246 b/tests/data/test246 index 9f2ab7435315..9227dfe6a431 100644 --- a/tests/data/test246 +++ b/tests/data/test246 @@ -9,45 +9,45 @@ HTTP Digest auth # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test249 b/tests/data/test249 index 6f671080c10b..30eb4dbcce01 100644 --- a/tests/data/test249 +++ b/tests/data/test249 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test25 b/tests/data/test25 index f641da93bbae..3cfcb14190d5 100644 --- a/tests/data/test25 +++ b/tests/data/test25 @@ -73,7 +73,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L --max-redirs 5 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test2500 b/tests/data/test2500 index ad6f0b7e1adf..c774bf805a5c 100644 --- a/tests/data/test2500 +++ b/tests/data/test2500 @@ -10,7 +10,7 @@ HTTP/3 # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT @@ -50,14 +50,14 @@ HTTP/3 GET: ^X-Forwarded-Proto:.* ^Via:.* - + GET https://localhost:%HTTP3PORT/%TESTNUMBER HTTP/1.1 Host: localhost:%HTTP3PORT User-Agent: curl/%VERSION Accept: */* - + HTTP/3 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT last-modified: Tue, 13 Jun 2000 12:10:00 GMT diff --git a/tests/data/test2501 b/tests/data/test2501 index 6de5b755c1a7..8d68a582c105 100644 --- a/tests/data/test2501 +++ b/tests/data/test2501 @@ -11,13 +11,13 @@ HTTPS # # Server-side - -HTTP/1.1 201 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close -Content-Length: 0 -Funny-head: yesyes - + +HTTP/1.1 201 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close +Content-Length: 0 +Funny-head: yesyes + @@ -46,13 +46,13 @@ HTTP/3 POST # # Verify data after the test has been "shot" - -HTTP/3 201 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 0 -funny-head: yesyes -via: 1.1 nghttpx - + +HTTP/3 201%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 0 +funny-head: yesyes +via: 1.1 nghttpx + POST https://%HOSTIP:%HTTP3PORT/2501 HTTP/1.1 diff --git a/tests/data/test2502 b/tests/data/test2502 index b878e2c9ece6..ab460c29d534 100644 --- a/tests/data/test2502 +++ b/tests/data/test2502 @@ -10,7 +10,7 @@ verbose logs # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -18,7 +18,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -26,7 +26,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -34,7 +34,7 @@ Content-Length: 47 file contents should appear once for each file - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: server.example.com @@ -66,7 +66,7 @@ HTTP GET multiple over HTTP/3 # Verify data after the test has been "shot" - + GET https://localhost:%HTTP3PORT/path/%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test2503 b/tests/data/test2503 index 28a1f973b506..6c4b100bedbc 100644 --- a/tests/data/test2503 +++ b/tests/data/test2503 @@ -12,7 +12,7 @@ HTTPS # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 6 @@ -49,7 +49,7 @@ HTTP/3 header-api # # Verify data after the test has been "shot" - + HTTP/3 200%spc% date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 diff --git a/tests/data/test256 b/tests/data/test256 index e8ac36b5aa1e..ca76e738612e 100644 --- a/tests/data/test256 +++ b/tests/data/test256 @@ -45,7 +45,7 @@ proxy 33 - + GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Proxy-Authorization: Basic %b64[daniel:stenberg]b64% diff --git a/tests/data/test257 b/tests/data/test257 index 4ffb7a6f3205..4c3a24620043 100644 --- a/tests/data/test257 +++ b/tests/data/test257 @@ -85,7 +85,7 @@ machine anotherone.com login user2 password passwd2 # Verify data after the test has been "shot" - + GET http://supersite.com/want/%TESTNUMBER HTTP/1.1 Host: supersite.com Authorization: Basic %b64[user1:passwd1]b64% diff --git a/tests/data/test258 b/tests/data/test258 index 23acb0200655..5501ce9f8ed0 100644 --- a/tests/data/test258 +++ b/tests/data/test258 @@ -24,12 +24,12 @@ Proxy-Connection: close Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test259 b/tests/data/test259 index 2b65e5076b18..25ed26c98eab 100644 --- a/tests/data/test259 +++ b/tests/data/test259 @@ -21,12 +21,12 @@ Proxy-Authenticate: Digest realm="many secrets", nonce="911" Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test26 b/tests/data/test26 index 438109516d67..80a63378b76a 100644 --- a/tests/data/test26 +++ b/tests/data/test26 @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -o - -o - # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test260 b/tests/data/test260 index 41a8a7a6341c..46f6e0f5178b 100644 --- a/tests/data/test260 +++ b/tests/data/test260 @@ -42,7 +42,7 @@ HTTP GET URL without slash but with question mark # # Verify data after the test has been "shot" - + GET /?%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test262 b/tests/data/test262 index 6b5ad6204ee8..442d04e387f8 100644 --- a/tests/data/test262 +++ b/tests/data/test262 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test263 b/tests/data/test263 index e1fbe036caa8..396d811f9497 100644 --- a/tests/data/test263 +++ b/tests/data/test263 @@ -41,7 +41,7 @@ HTTP-IPv6 GET with proxy specified using IPv6-numerical address # # Verify data after the test has been "shot" - + GET http://veryveryremotesite.com/%TESTNUMBER HTTP/1.1 Host: veryveryremotesite.com User-Agent: curl/%VERSION diff --git a/tests/data/test264 b/tests/data/test264 index cb1ad053b310..2bc54db5aa17 100644 --- a/tests/data/test264 +++ b/tests/data/test264 @@ -9,12 +9,12 @@ HTTP proxy Basic auth # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Content-Length: 26 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Content-Length: 26 + the content would go here @@ -37,7 +37,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 Host: we.want.that.site.com Proxy-Authorization: Basic %b64[fake:user]b64% diff --git a/tests/data/test265 b/tests/data/test265 index 75d943f0f7ac..fd17359b1ce1 100644 --- a/tests/data/test265 +++ b/tests/data/test265 @@ -14,23 +14,23 @@ NTLM # this is returned first since we get no proxy-auth - -HTTP/1.0 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Connection: Keep-Alive -Content-Length: 1033 - + +HTTP/1.0 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Connection: Keep-Alive +Content-Length: 1033 + And you should ignore this data. %repeat[999 x Q]% # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 200 Things are fine in proxy land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 + # this is returned when we get a GET! diff --git a/tests/data/test266 b/tests/data/test266 index aa974b628be6..ca5705955ce0 100644 --- a/tests/data/test266 +++ b/tests/data/test266 @@ -60,21 +60,21 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - -chunky-trailer: header data + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Trailer: chunky-trailer +Connection: mooo + +chunky-trailer: header data diff --git a/tests/data/test267 b/tests/data/test267 index 60f8878cbf7f..393c186e05a5 100644 --- a/tests/data/test267 +++ b/tests/data/test267 @@ -15,39 +15,39 @@ NTLM This is supposed to be returned when the server gets a first Authorization: NTLM line passed-in from the client --> - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! diff --git a/tests/data/test268 b/tests/data/test268 index 0d205fe73462..cd3c75a39e56 100644 --- a/tests/data/test268 +++ b/tests/data/test268 @@ -9,7 +9,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test269 b/tests/data/test269 index 1533ef7eebf0..1c68b339b2dd 100644 --- a/tests/data/test269 +++ b/tests/data/test269 @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --ignore-content-length # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test27 b/tests/data/test27 index f9ec0cf051c0..4bf293787cff 100644 --- a/tests/data/test27 +++ b/tests/data/test27 @@ -36,7 +36,7 @@ cookies # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test273 b/tests/data/test273 index e3629c1843e4..2573020e047d 100644 --- a/tests/data/test273 +++ b/tests/data/test273 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test274 b/tests/data/test274 index 685bd0854adb..8ac515252c9a 100644 --- a/tests/data/test274 +++ b/tests/data/test274 @@ -34,7 +34,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L --max-redirs 0 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test275 b/tests/data/test275 index 05260b91b87f..124510d3b3d3 100644 --- a/tests/data/test275 +++ b/tests/data/test275 @@ -14,10 +14,10 @@ proxytunnel # # Server-side - -HTTP/1.1 200 OK -Connected-fine: sure - + +HTTP/1.1 200 OK +Connected-fine: sure + @@ -64,15 +64,15 @@ proxy # # Verify data after the test has been "shot" - -CONNECT remotesite.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: remotesite.com.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: Basic %b64[youare:yourself]b64% -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT remotesite.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: remotesite.com.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: Basic %b64[youare:yourself]b64% +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: remotesite.com.%TESTNUMBER:%HTTPPORT Authorization: Basic %b64[iam:myself]b64% diff --git a/tests/data/test276 b/tests/data/test276 index f71a2de427ec..18daa52711ee 100644 --- a/tests/data/test276 +++ b/tests/data/test276 @@ -59,7 +59,7 @@ HTTP Location: following with multiple question marks in URLs # Verify data after the test has been "shot" - + GET /want?uri=http://anything/%TESTNUMBER?secondq/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test278 b/tests/data/test278 index 102815aae08d..46515b3c363d 100644 --- a/tests/data/test278 +++ b/tests/data/test278 @@ -9,13 +9,13 @@ HTTP proxy Basic auth # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Content-Length: 27 - -the content would go here + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Content-Length: 27 + +the content would go here @@ -37,7 +37,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 Host: we.want.that.site.com Proxy-Authorization: Basic %b64[fake:]b64% diff --git a/tests/data/test279 b/tests/data/test279 index 579e13f8097c..e0383b2aaef5 100644 --- a/tests/data/test279 +++ b/tests/data/test279 @@ -10,13 +10,13 @@ HTTP proxy Basic auth # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Content-Length: 27 - -the content would go here + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Content-Length: 27 + +the content would go here @@ -38,7 +38,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 Host: we.want.that.site.com Proxy-Authorization: Basic %b64[fake:]b64% diff --git a/tests/data/test28 b/tests/data/test28 index 979868cea3bd..3d6b7ca13636 100644 --- a/tests/data/test28 +++ b/tests/data/test28 @@ -58,7 +58,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test282 b/tests/data/test282 index e5b1321be2d2..96bd16eab4de 100644 --- a/tests/data/test282 +++ b/tests/data/test282 @@ -32,7 +32,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test287 b/tests/data/test287 index 1bc6654ba3d1..92407c994fa8 100644 --- a/tests/data/test287 +++ b/tests/data/test287 @@ -11,9 +11,9 @@ proxytunnel # Server-side - -HTTP/1.1 405 Method Not Allowed swsclose - + +HTTP/1.1 405 Method Not Allowed swsclose + And you should ignore this data. @@ -37,7 +37,7 @@ proxy # Verify data after the test has been "shot" - + CONNECT test.remote.example.com.%TESTNUMBER:%HTTPPORT HTTP/1.1 Host: test.remote.example.com.%TESTNUMBER:%HTTPPORT Proxy-Connection: Keep-Alive @@ -48,9 +48,9 @@ User-Agent: looser/2007 56 - -HTTP/1.1 405 Method Not Allowed swsclose - + +HTTP/1.1 405 Method Not Allowed swsclose + diff --git a/tests/data/test29 b/tests/data/test29 index b99b02f04cfb..b20e8fe6290d 100644 --- a/tests/data/test29 +++ b/tests/data/test29 @@ -9,11 +9,11 @@ FAILURE # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + _data_result_data_ @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -m 2 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test292 b/tests/data/test292 index 02159882e404..1bbe98d836f7 100644 --- a/tests/data/test292 +++ b/tests/data/test292 @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 1000 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test293 b/tests/data/test293 index 3b2fc4d9ee37..129fb5b32f70 100644 --- a/tests/data/test293 +++ b/tests/data/test293 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 2 63 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test299 b/tests/data/test299 index 6de5234d2bd3..a5ecd4f5f1b1 100644 --- a/tests/data/test299 +++ b/tests/data/test299 @@ -39,7 +39,7 @@ FTP over HTTP proxy with user:pass not in url # Verify data after the test has been "shot" - + GET ftp://michal:aybabtu@host.com/we/want/%TESTNUMBER HTTP/1.1 Host: host.com:21 Authorization: Basic %b64[michal:aybabtu]b64% diff --git a/tests/data/test3 b/tests/data/test3 index fbf60558c0a4..3f4b4ee9e2c0 100644 --- a/tests/data/test3 +++ b/tests/data/test3 @@ -9,20 +9,20 @@ HTTP Basic auth # # Server-side - -HTTP/1.0 200 OK -Server: test-server/fake -Content-Type: text/html -Content-Length: 0 - + +HTTP/1.0 200 OK +Server: test-server/fake +Content-Type: text/html +Content-Length: 0 + this is data even though Content-Length is set to zero - -HTTP/1.0 200 OK -Server: test-server/fake -Content-Type: text/html -Content-Length: 0 - + +HTTP/1.0 200 OK +Server: test-server/fake +Content-Type: text/html +Content-Length: 0 + diff --git a/tests/data/test30 b/tests/data/test30 index 5facba61b398..c76b3bafbbaa 100644 --- a/tests/data/test30 +++ b/tests/data/test30 @@ -27,7 +27,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test300 b/tests/data/test300 index 53c945033715..7a56f9cc7e06 100644 --- a/tests/data/test300 +++ b/tests/data/test300 @@ -40,7 +40,7 @@ simple HTTPS GET # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3000 b/tests/data/test3000 index 9fd21ec507b9..558c216b5ba4 100644 --- a/tests/data/test3000 +++ b/tests/data/test3000 @@ -42,7 +42,7 @@ HTTPS localhost, first subaltname matches, CN does not match # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3001 b/tests/data/test3001 index e4732d1cba68..11c0efd6d86a 100644 --- a/tests/data/test3001 +++ b/tests/data/test3001 @@ -42,7 +42,7 @@ HTTPS localhost, last subject alt name matches, CN does not match # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3002 b/tests/data/test3002 index 21d799b183f3..95d454dee1b0 100644 --- a/tests/data/test3002 +++ b/tests/data/test3002 @@ -19,11 +19,11 @@ smtp SMTP multiple and invalid (first) --mail-rcpt and --mail-rcpt-allowfails - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test3003 b/tests/data/test3003 index a0b4d67202ca..0a90820ad73d 100644 --- a/tests/data/test3003 +++ b/tests/data/test3003 @@ -19,11 +19,11 @@ smtp SMTP multiple and invalid (last) --mail-rcpt and --mail-rcpt-allowfails - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt invalid.five --mail-from sender@example.com -T - diff --git a/tests/data/test3004 b/tests/data/test3004 index 30f67cbc74d8..80261f67030d 100644 --- a/tests/data/test3004 +++ b/tests/data/test3004 @@ -19,11 +19,11 @@ smtp SMTP multiple and invalid (middle) --mail-rcpt and --mail-rcpt-allowfails - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt invalid.three --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test3005 b/tests/data/test3005 index cfe63acdfbea..ef417a9cd592 100644 --- a/tests/data/test3005 +++ b/tests/data/test3005 @@ -19,11 +19,11 @@ smtp SMTP multiple invalid (all but one) --mail-rcpt and --mail-rcpt-allowfails - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt recipient.two@example.com --mail-rcpt invalid.three --mail-rcpt invalid.four --mail-rcpt invalid.five --mail-from sender@example.com -T - diff --git a/tests/data/test3006 b/tests/data/test3006 index 0d0449d9134d..4cb13ba17d43 100644 --- a/tests/data/test3006 +++ b/tests/data/test3006 @@ -19,11 +19,11 @@ smtp SMTP with multiple invalid (all) --mail-rcpt and --mail-rcpt-allowfails - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt invalid.two --mail-rcpt invalid.three --mail-rcpt invalid.four --mail-rcpt invalid.five --mail-from sender@example.com -T - diff --git a/tests/data/test3007 b/tests/data/test3007 index 2cbc4f9a6f71..d6222408852d 100644 --- a/tests/data/test3007 +++ b/tests/data/test3007 @@ -19,11 +19,11 @@ smtp SMTP with invalid --mail-rcpt and --mail-rcpt-allowfails - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-from sender@example.com -T - diff --git a/tests/data/test3008 b/tests/data/test3008 index 7701a2c33c56..67bad12e8588 100644 --- a/tests/data/test3008 +++ b/tests/data/test3008 @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/%LOGDIR # # Verify data after the test has been "shot" - + GET /this/is/the/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3009 b/tests/data/test3009 index 96e9d8035f72..55497fcaec21 100644 --- a/tests/data/test3009 +++ b/tests/data/test3009 @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/not-there # # Verify data after the test has been "shot" - + GET /this/is/the/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test301 b/tests/data/test301 index 76a5a61ade6d..3db2f0e2fe0c 100644 --- a/tests/data/test301 +++ b/tests/data/test301 @@ -40,7 +40,7 @@ HTTPS GET with user and password # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT Authorization: Basic %b64[fake:user]b64% diff --git a/tests/data/test3011 b/tests/data/test3011 index 6933b584ab1e..afd7bf4c41c9 100644 --- a/tests/data/test3011 +++ b/tests/data/test3011 @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/%LOGDIR/tm # # Verify data after the test has been "shot" - + GET /this/is/the/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3012 b/tests/data/test3012 index 5b98c0c4e21e..f987e393d554 100644 --- a/tests/data/test3012 +++ b/tests/data/test3012 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -OJR --output-dir %PWD/%LOGDIR # # Verify data after the test has been "shot" - + GET /this/is/the/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3013 b/tests/data/test3013 index 305e435eb56b..1a4e29ae874f 100644 --- a/tests/data/test3013 +++ b/tests/data/test3013 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -O --output-dir %PWD/%LOGDIR ht # # Verify data after the test has been "shot" - + GET /this/is/the/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3014 b/tests/data/test3014 index 7a6686495d2d..e1e6471a4a8d 100644 --- a/tests/data/test3014 +++ b/tests/data/test3014 @@ -45,7 +45,7 @@ Content-Type: text/plain testdata 4 - + GET /1439 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3015 b/tests/data/test3015 index b2697aa3e0cd..7391d9164305 100644 --- a/tests/data/test3015 +++ b/tests/data/test3015 @@ -12,14 +12,14 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.1 302 OK -Date: Sun, 13 Sep 2020 15:00 GMT -Content-Length: 8 -Connection: close -Content-Type: text/plain -Location: ./%TESTNUMBER0001 - + +HTTP/1.1 302 OK +Date: Sun, 13 Sep 2020 15:00 GMT +Content-Length: 8 +Connection: close +Content-Type: text/plain +Location: ./%TESTNUMBER0001 + monster @@ -57,7 +57,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_headers}\n" -L -o%DEV_NULL # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test302 b/tests/data/test302 index 3f235b201bb2..dae1437da32c 100644 --- a/tests/data/test302 +++ b/tests/data/test302 @@ -12,9 +12,9 @@ FAILURE # Server-side - -HTTP/1.1 405 Method Not Allowed swsclose - + +HTTP/1.1 405 Method Not Allowed swsclose + And you should ignore this data. diff --git a/tests/data/test3023 b/tests/data/test3023 index c5ee22f7d722..6afe91b67a47 100644 --- a/tests/data/test3023 +++ b/tests/data/test3023 @@ -46,7 +46,7 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3024 b/tests/data/test3024 index 76bd4481a55f..88a6e625629e 100644 --- a/tests/data/test3024 +++ b/tests/data/test3024 @@ -46,7 +46,7 @@ CURL_SSL_BACKEND=schannel # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3028 b/tests/data/test3028 index 7929f52c0758..6f4f45014a92 100644 --- a/tests/data/test3028 +++ b/tests/data/test3028 @@ -52,12 +52,12 @@ proxy s/^PROXY TCP4 %CLIENTIP %HOSTIP (\d*) %PROXYPORT/proxy-line/ - -CONNECT %HOSTIP:%HTTPPORT HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT %HOSTIP:%HTTPPORT HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + diff --git a/tests/data/test303 b/tests/data/test303 index c5c6613cb2e4..7be81b7dc9dd 100644 --- a/tests/data/test303 +++ b/tests/data/test303 @@ -10,11 +10,11 @@ FAILURE # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + _data_result_data_ @@ -43,7 +43,7 @@ HTTPS with 8 secs timeout # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3031 b/tests/data/test3031 index b8da69e5fde2..fc9b525458d2 100644 --- a/tests/data/test3031 +++ b/tests/data/test3031 @@ -7,7 +7,7 @@ # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -43,14 +43,14 @@ http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER --dump-header %PWD/%LOGDIR/tmp/ # # Verify data after the test has been "shot" - + GET /this/is/the/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test3032 b/tests/data/test3032 index 067e43c02ae3..470a1196670f 100644 --- a/tests/data/test3032 +++ b/tests/data/test3032 @@ -9,60 +9,60 @@ HTTP # Server-side - -HTTP/1.1 301 redirect swsbounce -Content-Length: 0 -Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Part: data - + +HTTP/1.1 301 redirect swsbounce +Content-Length: 0 +Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER +Part: data + - -HTTP/1.1 301 redirect swsbounce -Content-Length: 0 -Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Part: data1 - + +HTTP/1.1 301 redirect swsbounce +Content-Length: 0 +Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER +Part: data1 + - -HTTP/1.1 301 redirect swsbounce -Content-Length: 0 -Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Part: data2 - + +HTTP/1.1 301 redirect swsbounce +Content-Length: 0 +Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER +Part: data2 + - -HTTP/1.1 200 OK -Content-Type: text/html -Content-Length: 30 -Part: data3 - + +HTTP/1.1 200 OK +Content-Type: text/html +Content-Length: 30 +Part: data3 + XXXXXXXXXXXXXXXXXXXXXXXXXXXXX - -HTTP/1.1 301 redirect swsbounce -Content-Length: 0 -Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Part: data - -HTTP/1.1 301 redirect swsbounce -Content-Length: 0 -Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Part: data1 - -HTTP/1.1 301 redirect swsbounce -Content-Length: 0 -Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Part: data2 - -HTTP/1.1 200 OK -Content-Type: text/html -Content-Length: 30 -Part: data3 - + +HTTP/1.1 301 redirect swsbounce +Content-Length: 0 +Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER +Part: data + +HTTP/1.1 301 redirect swsbounce +Content-Length: 0 +Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER +Part: data1 + +HTTP/1.1 301 redirect swsbounce +Content-Length: 0 +Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER +Part: data2 + +HTTP/1.1 200 OK +Content-Type: text/html +Content-Length: 30 +Part: data3 + XXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -86,7 +86,7 @@ HTTP redirect loop 3x swsbounce test # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3035 b/tests/data/test3035 index 98fe7c5fd0c9..a7c2148b1211 100644 --- a/tests/data/test3035 +++ b/tests/data/test3035 @@ -15,47 +15,47 @@ retry # # the first chunk # - -HTTP/1.1 200 OK swsbounce swsclose -Accept-Ranges: bytes -Content-Type: text/html -Content-Length: 26 - + +HTTP/1.1 200 OK swsbounce swsclose +Accept-Ranges: bytes +Content-Type: text/html +Content-Length: 26 + abcde # # the second chunk # - -HTTP/1.1 206 Partial Content swsbounce swsclose -Content-Type: text/html -Content-Length: 21 -Content-Range: bytes 5-25/26 - + +HTTP/1.1 206 Partial Content swsbounce swsclose +Content-Type: text/html +Content-Length: 21 +Content-Range: bytes 5-25/26 + fghijk # # some nonsense that curl should ignore as unresumable # - -HTTP/1.1 404 Not Found swsbounce -Content-Type: text/html -Content-Length: 5 - + +HTTP/1.1 404 Not Found swsbounce +Content-Type: text/html +Content-Length: 5 + body # # some more nonsense that curl should ignore as unresumable # - -HTTP/1.1 200 OK swsbounce -Accept-Ranges: bytes -Content-Type: text/html -Content-Length: 30 - + +HTTP/1.1 200 OK swsbounce +Accept-Ranges: bytes +Content-Type: text/html +Content-Length: 30 + XXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -87,7 +87,7 @@ HTTP retry failed download with keep data and auto-resume # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test306 b/tests/data/test306 index 6fac104547f7..ff7a07707ebc 100644 --- a/tests/data/test306 +++ b/tests/data/test306 @@ -52,7 +52,7 @@ HTTPS GET, receive no headers only data! # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test307 b/tests/data/test307 index 3d796bfc01c4..d327e88351bf 100644 --- a/tests/data/test307 +++ b/tests/data/test307 @@ -43,7 +43,7 @@ simple HTTPS GET with openssl engine # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test309 b/tests/data/test309 index 33e36fce00a5..0a9e9a89ca45 100644 --- a/tests/data/test309 +++ b/tests/data/test309 @@ -10,37 +10,37 @@ followlocation # Server-side - -HTTP/1.1 301 This is a weirdo text message swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: https://%HOSTIP:%HTTPSPORT/data/%TESTNUMBER0002.txt?coolsite=yes -Connection: close - + +HTTP/1.1 301 This is a weirdo text message swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: https://%HOSTIP:%HTTPSPORT/data/%TESTNUMBER0002.txt?coolsite=yes +Connection: close + This server reply is for testing a simple Location: following to HTTPS URL - -HTTP/1.1 200 Followed here fine swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 52 - + +HTTP/1.1 200 Followed here fine swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 52 + If this is received, the location following worked - -HTTP/1.1 301 This is a weirdo text message swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: https://%HOSTIP:%HTTPSPORT/data/%TESTNUMBER0002.txt?coolsite=yes -Connection: close - -HTTP/1.1 200 Followed here fine swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 52 - + +HTTP/1.1 301 This is a weirdo text message swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: https://%HOSTIP:%HTTPSPORT/data/%TESTNUMBER0002.txt?coolsite=yes +Connection: close + +HTTP/1.1 200 Followed here fine swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 52 + If this is received, the location following worked @@ -65,7 +65,7 @@ HTTP Location: redirect to HTTPS URL # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test31 b/tests/data/test31 index b8b09b8d0fe0..e4d5e4cad773 100644 --- a/tests/data/test31 +++ b/tests/data/test31 @@ -99,7 +99,7 @@ local-http # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: test31.curl:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test310 b/tests/data/test310 index f58b673782d2..7021462febf3 100644 --- a/tests/data/test310 +++ b/tests/data/test310 @@ -42,7 +42,7 @@ simple HTTPS GET # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3100 b/tests/data/test3100 index cd8dd0a3a1fb..83aedb11318d 100644 --- a/tests/data/test3100 +++ b/tests/data/test3100 @@ -10,43 +10,43 @@ RTSP Basic auth # Server-side - -RTSP/1.0 401 Unauthorized please swsbounce -Server: RTSPD/libcurl-test -CSeq: 1 -WWW-Authenticate: Basic realm="please-auth-me" - + +RTSP/1.0 401 Unauthorized please swsbounce +Server: RTSPD/libcurl-test +CSeq: 1 +WWW-Authenticate: Basic realm="please-auth-me" + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -CSeq: 2 -Content-Base: rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER -Content-Length: 80 -Curl-private: swsclose - -v=0 -s=rtspd SDP -i=A fake SDP reply -u=http://www.curl.example.com/fakesdp.ps + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +CSeq: 2 +Content-Base: rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER +Content-Length: 80 +Curl-private: swsclose + +v=0 +s=rtspd SDP +i=A fake SDP reply +u=http://www.curl.example.com/fakesdp.ps - -RTSP/1.0 401 Unauthorized please swsbounce -Server: RTSPD/libcurl-test -CSeq: 1 -WWW-Authenticate: Basic realm="please-auth-me" - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -CSeq: 2 -Content-Base: rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER -Content-Length: 80 -Curl-private: swsclose - -v=0 -s=rtspd SDP -i=A fake SDP reply -u=http://www.curl.example.com/fakesdp.ps + +RTSP/1.0 401 Unauthorized please swsbounce +Server: RTSPD/libcurl-test +CSeq: 1 +WWW-Authenticate: Basic realm="please-auth-me" + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +CSeq: 2 +Content-Base: rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER +Content-Length: 80 +Curl-private: swsclose + +v=0 +s=rtspd SDP +i=A fake SDP reply +u=http://www.curl.example.com/fakesdp.ps @@ -69,7 +69,7 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + DESCRIBE rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 CSeq: 1 Accept: application/sdp diff --git a/tests/data/test3101 b/tests/data/test3101 index 7d4dae7f64f2..5989e7ea46cd 100644 --- a/tests/data/test3101 +++ b/tests/data/test3101 @@ -8,43 +8,43 @@ HTTP Basic auth # Server-side - -HTTP/1.1 401 Authorization Required swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -Content-Length: 26 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 401 Authorization Required swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +Content-Length: 26 +Content-Type: text/html; charset=iso-8859-1 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! - -HTTP/1.1 401 Authorization Required swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" -Content-Length: 26 -Content-Type: text/html; charset=iso-8859-1 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 -Connection: close - + +HTTP/1.1 401 Authorization Required swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +WWW-Authenticate: Basic realm="gimme all yer s3cr3ts" +Content-Length: 26 +Content-Type: text/html; charset=iso-8859-1 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 +Connection: close + This IS the real page! @@ -72,7 +72,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test3102 b/tests/data/test3102 index 779642fbb0bf..5b20a67d5042 100644 --- a/tests/data/test3102 +++ b/tests/data/test3102 @@ -38,7 +38,7 @@ https://%HOSTIP:%HTTPSPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT Accept: */* diff --git a/tests/data/test3103 b/tests/data/test3103 index 423c4adaacf3..c0075aab3931 100644 --- a/tests/data/test3103 +++ b/tests/data/test3103 @@ -8,7 +8,7 @@ cookies # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET http://localhost/ HTTP/1.1 Host: localhost Accept: */* diff --git a/tests/data/test3104 b/tests/data/test3104 index 296bdc1dc172..42a91b00e6d5 100644 --- a/tests/data/test3104 +++ b/tests/data/test3104 @@ -8,7 +8,7 @@ cookies # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET http://example.com/ HTTP/1.1 Host: example.com Accept: */* diff --git a/tests/data/test314 b/tests/data/test314 index 5970391cc538..61ea85095c01 100644 --- a/tests/data/test314 +++ b/tests/data/test314 @@ -9,15 +9,15 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: br -Content-Length: 1056 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: br +Content-Length: 1056 + %hex[%1b%b0%13%00%9c%05%76%1b%5d%81%a4%3c%8b%e9%99%06%83%bf%97]hex% %hex[%20%3c%ab%aa%1e%97%8f%df%c8%d5%e5%30%c8%4d%30%7b%fe%82%55%09%2e%bd%14%50%ca%58%35%6d%32%4f%32%e1%27%cc%4a%ef%da%f6%fb%cb%c5%63%f0%78%30%8a%78%f1%ff%db%2f%55%22%46%c5%f8%48%02%61%23%6c%f6%fe%77%27%c4%13%20%74%f8%66%e7%07%08%24%50%89%74%5d%4f%a5%dd%13%ad]hex% %hex[%4a%56%c8%be%86%eb%e6%b2%50%b1%19%fb%8a%92%23%31%53%2a%dc%6a%3e%fd%45%ed%63%67%74%c8%fd%6a%69%a1%92%c4%29%fc%9d%9b%94%34%68%7b%e0%a3%88%ec%41%24%80%59%75%b6%36%32%b6%4a%5c%f6%62%49%cb%d2%7e%c1%34%c8%f8%7a%e8%51%03%f6%55%1d%83%62%43%68%50%40%aa%82%d3%8b%94%67%15%12%59%f8%f9%e5%73%11%67%2b%6f%c7%cd%ad%ca%d5%c4%b0%2b%24%1a%52%77%c1%57%f1%e6%6c%f1%e6%c9%50%ee%da%05%9e%5e%a4%7c%fa%cd%e9%7b%96%12%e5%7c%7a%10%22%41%a1%df%8a%e2%69%25%6b%ed%54%c6%0e%69%8e%e8%78%d2%0b%32%8e%db%b2%f2%6d%9f%48%dc%2b%4c%48%3d%88%97%89%81%d7%7d%53%95%c6%ee%b7%50%5d%cc%be%17%53%80%d9%60%c2%c1%37%88%f0%55%91%28%1e%98%f3%1d%7f%af%43%7a%6b%9e%b3%70%e2%80%7b%39%63%ab%fd%f0%73%8e%f7%e3%0e%e3%b6%e1%6c%70%cc%fa%8f%a3%e5%7a%54%d7%2d%87%3d%69%7c%5d%7e%b0%c2%b8%c9%66%3b%1d%ed%f7%9b%7d%84%b9%08%10%15%26%77%6b%95%ae%e0%5c%90%70%06%f8%e5%9f%b0%53%13%39%5c%29%97%e7%66%26%75%44%76%61%3b%3e%5b%e6%cd%c3%61%19%49%f3%11%70%fd%c2%8a%7c%89%23%f7%13%4f%e2%6e%6c%bd%d3%e0%23%a4%87%3d%11%7d%f7%a8%87%fd%c4%e1%cf%fa%ba%09%9a%d6%e6%e1%a2%46%1e%71%7a%7c%1c%1c%26%78%32%f8%f1%de%b6%1f%6e%ae%eb%d0%ce%c8%c8%60%d4%f1%63%fa%85%43%5a%72%b8%2b%e2%f9%02%54%6b%d2%6a%49%2e%aa%06%1e%bc%df%94%c2%d0%ea%a2%f6%a0%8a%3d%84%de%aa%09%e6%44%12%a5%cc%fb%f2%ae%9d%56%29%59%57%93%63%e8%6d%84%0d%32%e6%9e%51%2c%b4%d3%4b%87%1e%85%a2%4e%a5%b1%72%01%5c%59%39%aa%dd%22%42%40%57%1d%0d%b2%13%99%63%88%43%6e%db%3d%05%7b%17%cc%51%0e%82%c1%61%ac%84%18%82%1d%38%4a%d6%73%96%52%11%31%50%e9%b5%89%70%1a%6a%59%08%71%e6%54%40%9d%1a%21%48%7c%48%64%43%62%0d%4b%03%02%ba%e2%a9%6b%27%20%48%e3%bd%84%90%3d%50%52%83%05%dc%d3%88%b2%41%3f%da%14%56%42%8b%6c%78%f0%89%c2%02]hex% @@ -174,7 +174,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test315 b/tests/data/test315 index 4b1c443c3f65..d13b4236cf01 100644 --- a/tests/data/test315 +++ b/tests/data/test315 @@ -11,28 +11,28 @@ FAILURE # Server-side # this brotli chunk has three bytes removed from the beginning and is cut off - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: br -Content-Length: 1056 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: br +Content-Length: 1056 + %hex[%00%9c%05%76%1b%5d%81%a4%3c%8b%e9%99%06%83%bf%97]hex% %hex[%20%3c%ab%aa%1e%97%8f%df%c8%d5%e5%30%c8%4d%30%7b%fe%82%55%09%2e%bd%14%50%ca%58%35%6d%32%4f%32%e1%27%cc%4a%ef%da%f6%fb%cb%c5%63%f0%78%30%8a%78%f1%ff%db%2f%55%22%46%c5%f8%48%02%61%23%6c%f6%fe%77%27%c4%13%20%74%f8%66%e7%07%08%24%50%89%74%5d%4f%a5%dd%13%ad]hex% - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: br -Content-Length: 1056 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: br +Content-Length: 1056 + @@ -60,7 +60,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test316 b/tests/data/test316 index 12b9fd378d2d..520414f1ba1c 100644 --- a/tests/data/test316 +++ b/tests/data/test316 @@ -11,27 +11,27 @@ compressed # Length of not-encoded content is 16512 what is greater than default value of # CURL_MAX_WRITE_SIZE (16384) - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: br -Content-Length: 31 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: br +Content-Length: 31 + %hex[%1b%7f%40%00%64%f1%98%cf%28%1a%eb%af%c7%12%ac%41%ab%42%62%51%f3%c8%ea%d9%7b%9f%dc%1b%00%48%00%0a]hex% - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: br -Content-Length: 31 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: br +Content-Length: 31 + %repeat[128 x 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF%0a]% @@ -60,7 +60,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test317 b/tests/data/test317 index 435b99d970be..fb19620cd2d6 100644 --- a/tests/data/test317 +++ b/tests/data/test317 @@ -75,7 +75,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: first.host.it.is Proxy-Authorization: Basic %b64[testing:this]b64% diff --git a/tests/data/test318 b/tests/data/test318 index cdbde8a105bd..990b6371a011 100644 --- a/tests/data/test318 +++ b/tests/data/test318 @@ -75,7 +75,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: first.host.it.is Proxy-Authorization: Basic %b64[testing:this]b64% diff --git a/tests/data/test319 b/tests/data/test319 index 12da8ecbedf9..6258a12720e0 100644 --- a/tests/data/test319 +++ b/tests/data/test319 @@ -10,14 +10,14 @@ Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gobbledigook -Content-Length: 44 - + +HTTP/1.1 200 OK swsclose +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Content-Type: text/html; charset=ISO-8859-1 +Transfer-Encoding: gobbledigook +Content-Length: 44 + %hex[%1f%8b%08%08%79%9e%ab%41%00%03%6c%61%6c%61%6c%61%00%cb%c9%cc%4b%55%30%e4%52%c8%01%d1%46%5c]hex% %hex[%10%86%31%17%00]hex% %hex[%02%71%60%18%00%00%00]hex% @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --raw # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test32 b/tests/data/test32 index e2980fc3dcc8..d02a541ae3d2 100644 --- a/tests/data/test32 +++ b/tests/data/test32 @@ -42,7 +42,7 @@ HTTP with -d and -G # # Verify data after the test has been "shot" - + GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test320 b/tests/data/test320 index 60290b835f1b..93c1d1fd14a3 100644 --- a/tests/data/test320 +++ b/tests/data/test320 @@ -56,14 +56,14 @@ simple TLS-SRP HTTPS GET, check user in response # Verify data after the test has been "shot" - -HTTP/1.0 200 OK -Content-type: text/html - + +HTTP/1.0 200 OK +Content-type: text/html + FINE -User-Agent: curl-test-suite -Accept: */* - +User-Agent: curl-test-suite +Accept: */* + s/^

Connected as user 'jsmith'.*/FINE/ diff --git a/tests/data/test3204 b/tests/data/test3204 index 25450cb00ab8..925919977868 100644 --- a/tests/data/test3204 +++ b/tests/data/test3204 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # Verify that the file still exists with the correct etag value. - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test3208 b/tests/data/test3208 index 04b3c00413bf..e87f95333114 100644 --- a/tests/data/test3208 +++ b/tests/data/test3208 @@ -9,18 +9,18 @@ libtest # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -46,7 +46,7 @@ https://%HOSTIP:%HTTPSPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT Accept: */* diff --git a/tests/data/test3215 b/tests/data/test3215 index 8eab081f5201..97183c21d487 100644 --- a/tests/data/test3215 +++ b/tests/data/test3215 @@ -24,11 +24,11 @@ smtp SMTP DSN - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt " NOTIFY=SUCCESS,FAILURE" --mail-from " RET=HDRS" -T - diff --git a/tests/data/test325 b/tests/data/test325 index c18f6dfe2063..aba1fccaf94d 100644 --- a/tests/data/test325 +++ b/tests/data/test325 @@ -49,7 +49,7 @@ HTTPS with attempted redirect to denied HTTP # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test326 b/tests/data/test326 index 656fbf8b722f..d8c912a99b0f 100644 --- a/tests/data/test326 +++ b/tests/data/test326 @@ -53,7 +53,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --raw # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test327 b/tests/data/test327 index 91849746c4f1..6fcc4669a29d 100644 --- a/tests/data/test327 +++ b/tests/data/test327 @@ -52,7 +52,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test328 b/tests/data/test328 index 2cde3b22fb7b..602b6efa19ae 100644 --- a/tests/data/test328 +++ b/tests/data/test328 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/hello/%TESTNUMBER --compressed ^Accept-Encoding:.* - + GET /hello/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test329 b/tests/data/test329 index 4d3b721e2233..d47566f1b25a 100644 --- a/tests/data/test329 +++ b/tests/data/test329 @@ -8,23 +8,23 @@ cookies # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes -Set-Cookie: testn1=yes; path=/we/want/; domain=.host.foo.com; Max-Age=-1; -Set-Cookie: test=yes; path=/we/want/; domain=.host.foo.com; Max-Age=0; -Content-Length: 4 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes +Set-Cookie: testn1=yes; path=/we/want/; domain=.host.foo.com; Max-Age=-1; +Set-Cookie: test=yes; path=/we/want/; domain=.host.foo.com; Max-Age=0; +Content-Length: 4 + boo - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 4 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 4 + moo @@ -59,7 +59,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: host.foo.com User-Agent: curl/%VERSION diff --git a/tests/data/test330 b/tests/data/test330 index 0e6d21defb13..04cc67cd7cff 100644 --- a/tests/data/test330 +++ b/tests/data/test330 @@ -74,7 +74,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: first.host.it.is User-Agent: curl/%VERSION diff --git a/tests/data/test331 b/tests/data/test331 index 6d656ac73414..4b613c5e1356 100644 --- a/tests/data/test331 +++ b/tests/data/test331 @@ -50,7 +50,7 @@ proxy # Verify data after the test has been "shot" - + GET http://moo/we/want/%TESTNUMBER HTTP/1.1 Host: moo User-Agent: curl/%VERSION diff --git a/tests/data/test334 b/tests/data/test334 index b6194e09be86..3bbf85eae7bb 100644 --- a/tests/data/test334 +++ b/tests/data/test334 @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test335 b/tests/data/test335 index c4057953d288..9266d0006de0 100644 --- a/tests/data/test335 +++ b/tests/data/test335 @@ -74,7 +74,7 @@ http://digest:a-lot@data.from.server.requiring.digest.hohoho.com/%TESTNUMBER --p # Verify data after the test has been "shot" - + GET http://data.from.server.requiring.digest.hohoho.com/%TESTNUMBER HTTP/1.1 Host: data.from.server.requiring.digest.hohoho.com User-Agent: curl/%VERSION diff --git a/tests/data/test339 b/tests/data/test339 index 29205e0431d9..e915548351f7 100644 --- a/tests/data/test339 +++ b/tests/data/test339 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test34 b/tests/data/test34 index bda5a23fc568..175e537034b3 100644 --- a/tests/data/test34 +++ b/tests/data/test34 @@ -52,7 +52,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test341 b/tests/data/test341 index 3a5f82ea24e3..54f0da74a573 100644 --- a/tests/data/test341 +++ b/tests/data/test341 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test342 b/tests/data/test342 index 14d343998db0..e442bd77deef 100644 --- a/tests/data/test342 +++ b/tests/data/test342 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test343 b/tests/data/test343 index c23c3080538e..0d244ebfb2da 100644 --- a/tests/data/test343 +++ b/tests/data/test343 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test344 b/tests/data/test344 index 06e70c8597a8..4621dd6a9f91 100644 --- a/tests/data/test344 +++ b/tests/data/test344 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test345 b/tests/data/test345 index 5fbd2dfd9f56..9009beac670a 100644 --- a/tests/data/test345 +++ b/tests/data/test345 @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --et # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test346 b/tests/data/test346 index 0f67cfb33945..816177ebc9d3 100644 --- a/tests/data/test346 +++ b/tests/data/test346 @@ -44,7 +44,7 @@ HTTP GET over proxy with credentials using blank passwords # - + GET http://remote.example/%TESTNUMBER HTTP/1.1 Host: remote.example Proxy-Authorization: Basic %b64[puser:]b64% diff --git a/tests/data/test347 b/tests/data/test347 index dae91d3ca274..29790730b009 100644 --- a/tests/data/test347 +++ b/tests/data/test347 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test349 b/tests/data/test349 index 6dc32dbbf550..07d9d07a0087 100644 --- a/tests/data/test349 +++ b/tests/data/test349 @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail-with-body # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test355 b/tests/data/test355 index ffb7cbc3c1d0..5a5e7e70f388 100644 --- a/tests/data/test355 +++ b/tests/data/test355 @@ -44,7 +44,7 @@ h1 example.com 80 h1 %HOSTIP %HTTPPORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test356 b/tests/data/test356 index d723b3953db3..1162a4743394 100644 --- a/tests/data/test356 +++ b/tests/data/test356 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --alt-svc "%LOGDIR/altsvc-%TESTNUMBER" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test358 b/tests/data/test358 index 327662b41ba8..d29b09f956bc 100644 --- a/tests/data/test358 +++ b/tests/data/test358 @@ -11,15 +11,15 @@ HTTP/2 # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes -Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes +Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0 + -foo- @@ -55,28 +55,28 @@ h2 %HOSTIP %HTTPPORT h2 %HOSTIP %HTTP2PORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - -HTTP/1.1 101 Switching Protocols -Connection: Upgrade -Upgrade: h2c - -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 6 -content-type: text/html -funny-head: yesyes -alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 -via: 1.1 nghttpx - + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 +via: 1.1 nghttpx + -foo- -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 6 -content-type: text/html -funny-head: yesyes -alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 -via: 1.1 nghttpx - +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 +via: 1.1 nghttpx + -foo- diff --git a/tests/data/test359 b/tests/data/test359 index 2dd898118fa9..cc2b27b2ff61 100644 --- a/tests/data/test359 +++ b/tests/data/test359 @@ -11,15 +11,15 @@ HTTP/2 # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes -Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes +Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0 + -foo- @@ -55,28 +55,28 @@ h2 %HOSTIP %HTTPSPORT h2 %HOSTIP %HTTP2PORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - -HTTP/1.1 101 Switching Protocols -Connection: Upgrade -Upgrade: h2c - -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 6 -content-type: text/html -funny-head: yesyes -alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 -via: 1.1 nghttpx - + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 +via: 1.1 nghttpx + -foo- -HTTP/2 200 -date: Tue, 09 Nov 2010 14:49:00 GMT -content-length: 6 -content-type: text/html -funny-head: yesyes -alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 -via: 1.1 nghttpx - +HTTP/2 200%spc% +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 +via: 1.1 nghttpx + -foo- diff --git a/tests/data/test36 b/tests/data/test36 index efe23719a808..ad819cc0ba68 100644 --- a/tests/data/test36 +++ b/tests/data/test36 @@ -52,7 +52,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 56 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test360 b/tests/data/test360 index f98d03a036cc..471f0c0f3dab 100644 --- a/tests/data/test360 +++ b/tests/data/test360 @@ -7,7 +7,7 @@ - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test361 b/tests/data/test361 index c9642fbbfa81..c333a8ce0848 100644 --- a/tests/data/test361 +++ b/tests/data/test361 @@ -31,7 +31,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER --fail # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test363 b/tests/data/test363 index 489d2cf6f188..57bb6d40f585 100644 --- a/tests/data/test363 +++ b/tests/data/test363 @@ -21,9 +21,9 @@ Content-Length: 9 contents - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 Mighty fine indeed @@ -67,12 +67,12 @@ http://test.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER -p -x %HOSTIP:%P # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + POST /we/want/that/page/%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test365 b/tests/data/test365 index 847023011d6c..39143aa199e9 100644 --- a/tests/data/test365 +++ b/tests/data/test365 @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test366 b/tests/data/test366 index 8fcdbc4d91de..03fd9933cfcb 100644 --- a/tests/data/test366 +++ b/tests/data/test366 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --retry 2 --retry-max-time 10 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test367 b/tests/data/test367 index fd3252f31e18..335d59e6627e 100644 --- a/tests/data/test367 +++ b/tests/data/test367 @@ -36,7 +36,7 @@ http://:example@%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[:example]b64% diff --git a/tests/data/test368 b/tests/data/test368 index d49d1ccf3026..188aeb990250 100644 --- a/tests/data/test368 +++ b/tests/data/test368 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -r 4 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=4- diff --git a/tests/data/test369 b/tests/data/test369 index 9810d0a5b9d2..b86f582a05a7 100644 --- a/tests/data/test369 +++ b/tests/data/test369 @@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/nowhere/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test37 b/tests/data/test37 index ee2ac76e2805..c6fbd1076eaf 100644 --- a/tests/data/test37 +++ b/tests/data/test37 @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 52 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test371 b/tests/data/test371 index d31454f07b09..e1fbd894a68d 100644 --- a/tests/data/test371 +++ b/tests/data/test371 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/dump -o %LOGDIR/dump2 --no-progr # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test372 b/tests/data/test372 index fcc07822ed68..f399f93cd0a4 100644 --- a/tests/data/test372 +++ b/tests/data/test372 @@ -7,14 +7,14 @@ HTTP GET - -HTTP/1.1 200 OK -Date: Thu, 22 Jul 2010 11:22:33 GMT -Connection: close -Content-Type: text/html -X-Control: swsclose -Content-Length: 2 - + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 2 + %hex[%00]hex% @@ -35,7 +35,7 @@ proxy - + GET /binary-zero-in-data-section/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test373 b/tests/data/test373 index 99bfaf3ac95f..4b282d0f0ba0 100644 --- a/tests/data/test373 +++ b/tests/data/test373 @@ -32,14 +32,14 @@ X-Control: swsclose - -HTTP/1.1 200 OK -Date: Thu, 22 Jul 2010 11:22:33 GMT -Connection: close -Content-Type: text/html -Transfer-Encoding: chunked -X-Control: swsclose - + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +Transfer-Encoding: chunked +X-Control: swsclose + %repeat[255 x %00]% %repeat[255 x %00]% %repeat[255 x %00]% @@ -64,7 +64,7 @@ http://%HOSTIP:%HTTPPORT/chunked-transfer-encoding/%TESTNUMBER - + GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test374 b/tests/data/test374 index daec117af9e7..6f10edfe3808 100644 --- a/tests/data/test374 +++ b/tests/data/test374 @@ -8,13 +8,13 @@ gif data - -HTTP/1.1 200 OK -Date: Thu, 22 Jul 2010 11:22:33 GMT -Connection: close -Content-Type: image/gif -X-Control: swsclose - + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: image/gif +X-Control: swsclose + %hex[%47%49%46%38%39%61%14%00%14%00%a1%04%00%fe%00%00%ff%00%00%1e%42%ee%1f%42%ef%21%ff%0b%4e%45%54%53%43%41%50%45%32%2e%30%03%01%00%00%00%21%fe%24%43%72%65%61%74%65%64%20%62%79%20%46%61%62%69%61%6e%20%4b%65%69%6c%20%77%69%74%68%20%54%68%65%20%47%49%4d%50%00%21%f9%04%00%0a%00%ff%00%2c%00%00%00%00%14%00%14%00%00%02%11%8c%8f%a9%cb%ed%0f%a3%9c%b4%da%8b%b3%de%bc%fb%af%15%00%21%f9%04%01%0a%00%02%00%2c%00%00%00%00%14%00%14%00%00%02%11%9c%8f%a9%cb%ed%0f%a3%9c%b4%da%8b%b3%de%bc%fb%af%15%00%21%f9%04%00%0a%00%ff%00%2c%00%00%00%00%14%00%14%00%00%02%11%94%8f%a9%cb%ed%0f%a3%9c%b4%da%8b%b3%de%bc%fb%af%15%00%21%f9%04%00%0a%00%ff%00%2c%00%00%00%00%14%00%14%00%00%02%11%84%8f%a9%cb%ed%0f%a3%9c%b4%da%8b%b3%de%bc%fb%af%15%00%3b]hex% @@ -35,7 +35,7 @@ http://%HOSTIP:%HTTPPORT/gif/%TESTNUMBER - + GET /gif/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test376 b/tests/data/test376 index d2affc1de533..16c28002d6aa 100644 --- a/tests/data/test376 +++ b/tests/data/test376 @@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save-%TESTNUMBER --remove-on-err 18 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test379 b/tests/data/test379 index d465e90901c3..3e452f1d3063 100644 --- a/tests/data/test379 +++ b/tests/data/test379 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save --remove-on-error --no-clob 18 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test38 b/tests/data/test38 index 3346f6cf6f1d..d48e743a4600 100644 --- a/tests/data/test38 +++ b/tests/data/test38 @@ -41,7 +41,7 @@ download on. 33 - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=78- diff --git a/tests/data/test387 b/tests/data/test387 index b07096263ece..d068be96b859 100644 --- a/tests/data/test387 +++ b/tests/data/test387 @@ -9,7 +9,7 @@ gzip # # Server-side - + HTTP/1.1 200 OK Content-Length: 6 Transfer-Encoding: gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -sS --tr-encoding # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test388 b/tests/data/test388 index f7158ec2daa6..b8e426f906f3 100644 --- a/tests/data/test388 +++ b/tests/data/test388 @@ -10,35 +10,35 @@ HTTP Digest auth # Server-side # First reply back and ask for Digest auth - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # second reply back - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -46,24 +46,24 @@ This IS the real page! # This is the second request, and this sends back a response saying that # the request contained stale data. We want an update. Set swsbounce to # bounce on to data1003 on the second request. - -HTTP/1.1 401 Authorization re-negotiation please swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="crazy, auth" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization re-negotiation please swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="crazy, auth" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # The second request to the 1002 section will bounce this one back instead # thanks to the swsbounce keyword up there - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 30 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 30 + This IS the second real page! @@ -91,7 +91,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u testuser:testpass --digest http://%H ^Authorization.*cnonce - + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -121,36 +121,36 @@ User-Agent: curl/%VERSION Accept: */* - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Authorization re-negotiation please swsbounce -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="crazy, auth" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 30 - +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Authorization re-negotiation please swsbounce +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="crazy, auth" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 30 + This IS the second real page! diff --git a/tests/data/test389 b/tests/data/test389 index 069515ac8092..65bf1e9ad964 100644 --- a/tests/data/test389 +++ b/tests/data/test389 @@ -46,7 +46,7 @@ local-http # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: curlmachine.localhost:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test39 b/tests/data/test39 index 1829617499f7..d01fd3c95fa4 100644 --- a/tests/data/test39 +++ b/tests/data/test39 @@ -7,12 +7,12 @@ HTTP FORMPOST # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 10 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 10 + blablabla diff --git a/tests/data/test391 b/tests/data/test391 index 55d540550232..9989debe3e82 100644 --- a/tests/data/test391 +++ b/tests/data/test391 @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/../../%TESTNUMBER --path-as-is -L # # Verify data after the test has been "shot" - + GET /../../%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test392 b/tests/data/test392 index be0a52640067..a6b20cb6c6d3 100644 --- a/tests/data/test392 +++ b/tests/data/test392 @@ -9,15 +9,15 @@ secure - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 4 -Content-Type: text/html -Funny-head: yesyes -Set-Cookie: foobar=name; path=/; secure - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 4 +Content-Type: text/html +Funny-head: yesyes +Set-Cookie: foobar=name; path=/; secure + boo @@ -45,7 +45,7 @@ local-http # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test393 b/tests/data/test393 index 11f273a6c7f4..ddd44aae528b 100644 --- a/tests/data/test393 +++ b/tests/data/test393 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 2000000 63 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test394 b/tests/data/test394 index 5f797d9794d2..c6b4556330ff 100644 --- a/tests/data/test394 +++ b/tests/data/test394 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 8 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test395 b/tests/data/test395 index e3626eb82bde..e787397e4f83 100644 --- a/tests/data/test395 +++ b/tests/data/test395 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test396 b/tests/data/test396 index 4e57778cf18e..77bffc3c2001 100644 --- a/tests/data/test396 +++ b/tests/data/test396 @@ -9,15 +9,15 @@ compressed # # Server-side - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: zstd -Content-Length: 1309 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: zstd +Content-Length: 1309 + %hex[%28%b5%2f%fd%64%b1%12%7d%28%00%86%3f%bd%28%e0%d0%ba%01%b0%03%b6%72%a6%27%9f%a8%20%8c%5a%e1%02%85%fd%81%fe%40%32%f0%ef%9a%08%df%c9%f3%9b%10%a3%65%98%a1%8d%c0%cc%0b%b7%00%b3%00%ac%00%f3%21%b7%f6%a4%da%73%bb%79%1a%1e%dd%da%fb%ba%6e%9b%3d%d0%be%b3%49%9f%ac%f1%51%da%6d%18%52%ef%34%ec%ba%ed%bc%a6%b7%58%19%46%aa%81%aa%1a%a8%a6%77%51%90%89%82%58%d3%54%61%92%eb%18%56%aa%01%6a%1a%b0%a6%47%55%90%6b%82%5c%95]hex% %hex[%85%c9%96%32%6a%fa%46%c9%b0%a2%26%14%26%a7%e6%3d%08%83%10%f6%90%57%4a%96%34%41%1e%b2%6d%58%d6%be%d0%62%c6%b7%ab%74%63%6f%9d%6f%df%30%0f%70%f7%76%1e%cf%c1%92%c1%54%60%1e%a7%ce%fb%93%42%ae%d6%16%d6%b9%67%89%a8%c8%1c%40%20%00%40%08%2b%78%50%90%8a%e4%ba%20%10%18%86%07%01%a7%4e%69%b5%da%ef%31%49%d4%83%a0%da%f9%de%9e%47%b7%8c%02%18%d3%53%fb%9b%13%3b%4e%8d%14%72%4c%d5%f3%f6%58%7b%df%d7%99%bd%f6%f8%da%bb%93%81%1c%52%77%ee%8b%34%32%c8%21%db%1b%c3%72%ef%e7%f7%cc%b0%ce%bd%f5%ce%bc%1b%6e%d4%e6%66%5e%6f%0d%72%5c%30%98%6c%eb%ea%75%2b%dd%62%fc%47%ee%45%b2%b7%ee%db%21%47%24%a3%a5%5c%f7%be%e7%85%b5%da%8b%6e%17%dd%b7%1c%24%3e%4a%1b%03%72%7c%7c%91%84%65%21%02%42%21%b2%5c%18%12%5e%14%61%80%70%79%51%c6%f2%70%b1%64%5e%94%39%60%40%48%80%1c%51%44%26%e1%45%98%28%22%93%59%78%7f%dd%72%5c%f7%ef%32%3c%29%23%de%aa%f1%df%41%8e%6f%3a%37%1e%df%cf%c7%50%7a%ef%cd%d7%e8%f7%5d%24%26%5e%cb%b5%b5%49%ed%06%d9%ad%fb%dc%20%bf%e7%3d%ef%61%88%f5%c7%8e%e6%1d%64%f9%59%c6%db%8c%b7%59%cb%ac%e5%c6%f9%c6%39%64%8e%a5%cd%a9%b1%a3%71%f3%c3%cd%4f%f5%c9%aa%4f%f6%e1%dc%0f%e7%42%66%9f%b2%bd%37%db%61%c8%fc%58%73%22%a7%a1%de%31%bc%b4%8b%9b%46%c0%34%1d%ad%46%cf%22%d8%57%3b%2f%37%5d%fb%ac%7b%86%91%8b%21%55%61%b7%76%56%d3%30%9c%24%d2%15%9d%a1%64%62%48%5d%52%84%62%68%49%24%ab%22%99%78%a4%1d%67%39%86%95%09%85%5d%d4%e8%0c%27%94%14%c1%6e%6d%cd%9b%63%48%91%48%d6%45%91%60%ed%56%7b%8d%c6%9d%34%de%e9%61%08%39%a4%bf%b5%b7%6a%3d%0c%21%8c%e1%b7%47%88%56%45%24%96%45%a3%dc%66%2f%50%ac%a9%8a%64%93%7e%28%49%a4%a2%22%d6%44%a3%65%28%10%f0%2e%18%4c%6d%ee%ce%cb%d0%9a%58%14%4c%4e%86%d3%43%6e%9b%d5%da%1f%04%cd%69%dc%a7%d1%53%ab%2d%6b%73%2d%21%c3%88%84%9a%2a%57%c5%9a%50%d3%34%55%d4%75%51%91%49%55%31%ac%3c%d6%ef%8d%75%6e%d3%19%32%43%ef%8a%01%81%35%b5%ce%90%bd%25%27%66%1b%d4%3b%86%1c%ef%ac%f6%c5%3c%da%b3%c6%77%db%b9%5d%64%88%65%5b%d7%b9%9a%6b%3b%5f%bb%5d%7b%c8%72%4a%ae%69%42%61%58%49%15%25%51%30%4d%d3%76%cd%65%78%79%5b%37%af%db%af%f6%e0%51%70%86%c1%01%eb%0f%80%e8%a0%81%95%73%68%66%40%06%00%20%80%41%01%40%42%c2%20%23%4a%03%21%f3%e7%0c%f9%1a%bf%b7%48%ca]hex% %hex[%ce%88%93%e0%97%05%94%c4%49%f0%4d%01%55%d0%62%92%5f%16%24%63%8d%05%9e%44%ae%c1%39%87%63%a3%bb%91%d6%0e%76%79%d0%b6%68%7d%bb%9c%a8%a4%7c%aa%58%ff%82%f3%36%a4%ff%09%b4%c5%f5%7f%85%c7%bf%8b%32%f9%3f%72%50%30%87%b3%d6%26%26%6c%39%86%71%96%a3%02%d9%5a%00%b4%fe%3e%eb%4c%cc%89%46%76%37%2a%bc%11%76%3f%f0%5d%31%66%8e%71%6e%71%f6%6e%ff%de%03%99%f8%de%10%33%85%cf%40%b4%7f%76%20%61%65%2c%23%ed%98%3b%d6%15%5c%6b%62%33%70%09%4c%db%32%e6%3e%8a%f6%39%00%28%b7%b0%e5%b4%42%44%9a%8c%62%a9%68%19%5c%36%33%42%47%7f%86%65%49%e7%89%68%1b%31%e8%0d%b8%b8%8c%ad%84%2d%b8%26%c4%d6%19%4e%dc%34%13%f4%34%bd%ea%6c%d3%cc%22%59%64%8e%3d%67%f7%92%1f%d9%6d%1c%42%86%e9%60%36%86%17%68%da%d5%b8%e0%e4%c0%1e%c4%16%b9%19%64%89%63%69%06%4e%c4%46%c2%41%1d%dc%07%79%aa%21%b7%cd%64%a6%5d%01%9b%ed%5c%07%cc%fb%ec%91%49%43%c8%bb%9e%9d%73%e6%94%61%1a%8c%8c%b2%bd%c6%75%0e%7b%3d%4b%64%6e%d8%6d%d8%3b%93%87%10%76%4d%bb%86%99%4b%c3%2e%1b%91%8f%ad%99%01%35%bb%13%0c%c0%d0%06%0d%2b%af%f1%0c%d8%65%b9%00%a7%fd%81%98%91%94%83%40%cc%f4%39%96%da%a0%05%21%42%18%d3%88%1d%81%83%32%38%39%30%da%61%8b%5b%08%99%1d%d6%70%62%81%88%80%3c%b0%ce%b8%99%d0%10%d2%cc%44%6f%ce%17%48%11%73%a6%5c%7c%37%68%f3%d0%ee%60%b9%2f%c6%78%d7%da%aa%0e%eb%c8%ba%ce%cd%2a%09%2a%ad%9a%25%46%9d%2d%08%05%b4%b5%7a%51%c7%f3%3b%0d%bd%ea%90%6b%d3%f9%ac%fa%b1%e6%9d%3b%39%8e%79%82%d1%ea%8b%50%a5%7b%da%5e%18%9b%71%d8%92%49%e6%70%4b%18%40%fe%75%35%44%19%1a%4b%5c%8e%dd%b8%f3%9c%a8%6c%d2%5e%5e%ff%d2%f6%9c%c7%de%78%2e%3a%86%25%df%a9%80%6e%38%8c%8d%85%c3%90%8c%08%fb%b3%74%24%c8%87%ce%bb%3b%cb%75%af%48%e1%59]hex% @@ -171,7 +171,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test397 b/tests/data/test397 index 40f1495fc5a4..9048087a185c 100644 --- a/tests/data/test397 +++ b/tests/data/test397 @@ -11,28 +11,28 @@ compressed # Length of not-encoded content is 16512 what is greater than default value of # CURL_MAX_WRITE_SIZE (16384) - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: zstd -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: zstd +Content-Length: 47 + %hex[%28%b5%2f%fd%64%80%3f%0d%01%00%88%30%31%32%33%34%35%36%37%38%39%41%42%43%44%45%46]hex% %hex[%04%00%7c%9f%60%78%00%04%1a%1d%d2%ab%4d%3a%97%82%af%b9%9c]hex% - -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: zstd -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Mon, 29 Nov 2004 21:56:53 GMT +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 +Vary: Accept-Encoding +Content-Type: text/html; charset=ISO-8859-1 +Content-Encoding: zstd +Content-Length: 47 + %repeat[128 x 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF%0a]% @@ -61,7 +61,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/ - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test398 b/tests/data/test398 index 6b52e0e558c0..2f0971165231 100644 --- a/tests/data/test398 +++ b/tests/data/test398 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test40 b/tests/data/test40 index 5d8d8c1e45b0..959a7505dc08 100644 --- a/tests/data/test40 +++ b/tests/data/test40 @@ -9,32 +9,32 @@ followlocation # # Server-side - -HTTP/1.1 302 OK swsclose -Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002%repeat[4 x ]% +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body - -HTTP/1.1 302 OK swsclose -Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002%repeat[4 x ]% +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test4000 b/tests/data/test4000 index 49382c9363da..147757526bc1 100644 --- a/tests/data/test4000 +++ b/tests/data/test4000 @@ -40,7 +40,7 @@ HTTPS GET with ECH GREASE # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test410 b/tests/data/test410 index 85885a4d895d..3eb4eb4c8b07 100644 --- a/tests/data/test410 +++ b/tests/data/test410 @@ -43,7 +43,7 @@ Long: %repeat[3500 x header content]% # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test412 b/tests/data/test412 index 3a6c1836031f..7a8e83e68524 100644 --- a/tests/data/test412 +++ b/tests/data/test412 @@ -52,7 +52,7 @@ h1 whohoo 12345 h1 %HOSTIP %HTTPPORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: whohoo.:12345 User-Agent: curl/%VERSION diff --git a/tests/data/test413 b/tests/data/test413 index 392dbc16f027..e365b1dfea0a 100644 --- a/tests/data/test413 +++ b/tests/data/test413 @@ -52,7 +52,7 @@ h1 whohoo. 12345 h1 %HOSTIP %HTTPPORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: whohoo:12345 User-Agent: curl/%VERSION diff --git a/tests/data/test414 b/tests/data/test414 index 7e84a8c939a2..936cf72b05fa 100644 --- a/tests/data/test414 +++ b/tests/data/test414 @@ -62,7 +62,7 @@ https://attack.invalid:%HTTPSPORT/a/b/%TESTNUMBER --insecure -c %LOGDIR/cookie%T # # Verify data after the test has been "shot" - + GET /a/b/%TESTNUMBER HTTP/1.1 Host: attack.invalid:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test415 b/tests/data/test415 index 0692dc54c9da..c0e8a92d08c6 100644 --- a/tests/data/test415 +++ b/tests/data/test415 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test417 b/tests/data/test417 index c8f5997b6739..5acd91a5b13b 100644 --- a/tests/data/test417 +++ b/tests/data/test417 @@ -38,7 +38,7 @@ https - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT User-Agent: curl/%VERSION diff --git a/tests/data/test418 b/tests/data/test418 index fa502f1b5627..4bcbd57c2eb7 100644 --- a/tests/data/test418 +++ b/tests/data/test418 @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -sS --tr-encoding # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test42 b/tests/data/test42 index 36263e2987d6..007f83e2474b 100644 --- a/tests/data/test42 +++ b/tests/data/test42 @@ -9,32 +9,32 @@ followlocation # # Server-side - -HTTP/1.1 302 OK swsclose -Location: ../m o o.html/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: ../m o o.html/%TESTNUMBER0002%repeat[4 x ]% +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body - -HTTP/1.1 302 OK swsclose -Location: ../m o o.html/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - -HTTP/1.1 200 OK swsclose -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Connection: close - + +HTTP/1.1 302 OK swsclose +Location: ../m o o.html/%TESTNUMBER0002%repeat[4 x ]% +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Connection: close + body @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test420 b/tests/data/test420 index c635264da7f9..c1d6173f4fea 100644 --- a/tests/data/test420 +++ b/tests/data/test420 @@ -10,7 +10,7 @@ cookies # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Accept-Ranges: bytes @@ -56,7 +56,7 @@ cookies # # Verify data after the test has been "shot" - + GET /func_test/del_cookie HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test421 b/tests/data/test421 index b9483e6ba006..7b41703fb57e 100644 --- a/tests/data/test421 +++ b/tests/data/test421 @@ -8,7 +8,7 @@ header_json # # Server-side - + HTTP/1.1 200 OK server: nginx date: Tue, 07 Mar 2023 15:14:41 GMT @@ -53,7 +53,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{stderr}%{header_json}\n' -s # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test423 b/tests/data/test423 index 6c6e725b0119..01313a9655e0 100644 --- a/tests/data/test423 +++ b/tests/data/test423 @@ -9,7 +9,7 @@ # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test424 b/tests/data/test424 index 9ae6b1fab960..ff3509650542 100644 --- a/tests/data/test424 +++ b/tests/data/test424 @@ -9,7 +9,7 @@ # # Server-side - + HTTP/1.1 301 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes Location: http://anotherhost.example:2023/%TESTNUMBER0002?moo.html - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test425 b/tests/data/test425 index 1b211d1db358..3ff4c0b0b7ac 100644 --- a/tests/data/test425 +++ b/tests/data/test425 @@ -9,7 +9,7 @@ HTTP PUT # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 6 diff --git a/tests/data/test427 b/tests/data/test427 index 1e08810ebdfb..e7e09e98fc23 100644 --- a/tests/data/test427 +++ b/tests/data/test427 @@ -10,7 +10,7 @@ cookies # # Server-side - + HTTP/1.1 301 move along Date: Tue, 09 Nov 2010 14:49:00 GMT Accept-Ranges: bytes @@ -25,7 +25,7 @@ Location: %TESTNUMBER0002 -foo- - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Accept-Ranges: bytes @@ -59,7 +59,7 @@ cookies # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test428 b/tests/data/test428 index 4c5c7edc358f..a066e7c09053 100644 --- a/tests/data/test428 +++ b/tests/data/test428 @@ -10,7 +10,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test429 b/tests/data/test429 index 8dd75be04f86..302263cc2f00 100644 --- a/tests/data/test429 +++ b/tests/data/test429 @@ -10,7 +10,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test43 b/tests/data/test43 index 57e22eba0fe2..37545fe524db 100644 --- a/tests/data/test43 +++ b/tests/data/test43 @@ -63,7 +63,7 @@ proxy # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test434 b/tests/data/test434 index 274380dfa683..16445746c1b8 100644 --- a/tests/data/test434 +++ b/tests/data/test434 @@ -35,7 +35,7 @@ http # - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test435 b/tests/data/test435 index d5cdfbbbd7d5..46ef5166741f 100644 --- a/tests/data/test435 +++ b/tests/data/test435 @@ -9,10 +9,10 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Content-Length: 0 - + +HTTP/1.1 200 OK +Content-Length: 0 + @@ -33,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w 'lo # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION @@ -51,17 +51,17 @@ Accept: */* s/local port == (\d+)/local port == [digits]/ - -HTTP/1.1 200 OK -Content-Length: 0 - + +HTTP/1.1 200 OK +Content-Length: 0 + local port == [digits] local ip == 127.0.0.1 remote_ip == %HOSTIP remote_port == %HTTPPORT -HTTP/1.1 200 OK -Content-Length: 0 - +HTTP/1.1 200 OK +Content-Length: 0 + local port == [digits] local ip == 127.0.0.1 remote_ip == %HOSTIP diff --git a/tests/data/test436 b/tests/data/test436 index 4371c84d48ad..e3e39c5fdc90 100644 --- a/tests/data/test436 +++ b/tests/data/test436 @@ -8,11 +8,11 @@ # # Server-side - -HTTP/1.1 200 OK -Content-Length: 6 -Content-Type: text/1 - + +HTTP/1.1 200 OK +Content-Length: 6 +Content-Type: text/1 + -foo- diff --git a/tests/data/test437 b/tests/data/test437 index 7611be8257ef..b5f3988b8269 100644 --- a/tests/data/test437 +++ b/tests/data/test437 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --alt-svc "%LOGDIR/altsvc-%TESTNUMBER" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test438 b/tests/data/test438 index b07b4ccd827e..23d43f7a0808 100644 --- a/tests/data/test438 +++ b/tests/data/test438 @@ -11,15 +11,15 @@ HTTP/2 # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-Head: yesyes -Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-Head: yesyes +Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 + -foo- @@ -55,24 +55,24 @@ h1 %HOSTIP %HTTPPORT h1 %HOST6IP %HTTP6PORT "20290222 22:19:28" 0 0 # # Verify data after the test has been "shot" - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-Head: yesyes -Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-Head: yesyes +Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 + -foo- -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-Head: yesyes -Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-Head: yesyes +Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 + -foo- diff --git a/tests/data/test439 b/tests/data/test439 index dc1ae43f9e01..9a5b0522af6e 100644 --- a/tests/data/test439 +++ b/tests/data/test439 @@ -9,7 +9,7 @@ aws-sigv4 # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -46,7 +46,7 @@ aws-sigv4 with query # # Verify data after the test has been "shot" - + GET /439/?name=me&noval&aim=b%aad&&&weirdo=*.//- HTTP/1.1 Host: fake.fake.fake:8000 Authorization: AWS4-HMAC-SHA256 Credential=user/19700101/us-east-2/es/aws4_request, SignedHeaders=host;x-amz-date, Signature=9dd8592929306832a6673d10063491391e486e5f50de4647ea7c2c797277e0a6 diff --git a/tests/data/test440 b/tests/data/test440 index 238e3b3f4db9..161e6e3d9a98 100644 --- a/tests/data/test440 +++ b/tests/data/test440 @@ -11,14 +11,14 @@ trailing-dot # we use this as response to a CONNECT - -HTTP/1.1 403 not OK at all -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Funny-head: yesyes - + +HTTP/1.1 403 not OK at all +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Funny-head: yesyes + -foo- @@ -52,21 +52,21 @@ test-duphandle # we let it CONNECT to the server to confirm HSTS but deny from there - + CONNECT this.hsts.example.:443 HTTP/1.1 Host: this.hsts.example.:443 User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -HTTP/1.1 403 not OK at all -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Funny-head: yesyes - + +HTTP/1.1 403 not OK at all +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Funny-head: yesyes + https://this.hsts.example./%TESTNUMBER # Proxy CONNECT aborted diff --git a/tests/data/test441 b/tests/data/test441 index 2cdd9f318c0b..033c5343041b 100644 --- a/tests/data/test441 +++ b/tests/data/test441 @@ -11,14 +11,14 @@ trailing-dot # we use this as response to a CONNECT - -HTTP/1.1 403 not OK at all -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Funny-head: yesyes - + +HTTP/1.1 403 not OK at all +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Funny-head: yesyes + -foo- @@ -51,21 +51,21 @@ test-duphandle # we let it CONNECT to the server to confirm HSTS but deny from there - + CONNECT this.hsts.example:443 HTTP/1.1 Host: this.hsts.example:443 User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -HTTP/1.1 403 not OK at all -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Funny-head: yesyes - + +HTTP/1.1 403 not OK at all +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Funny-head: yesyes + https://this.hsts.example/%TESTNUMBER # Proxy CONNECT aborted diff --git a/tests/data/test442 b/tests/data/test442 index 1f29ad3bc62a..77bf4f2cb970 100644 --- a/tests/data/test442 +++ b/tests/data/test442 @@ -201,7 +201,7 @@ cookies # # Verify data after the test has been "shot" - + GET /a/b/%TESTNUMBER HTTP/1.1 Host: attack.invalid:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test443 b/tests/data/test443 index ae9218325aa9..13b8bad87d5c 100644 --- a/tests/data/test443 +++ b/tests/data/test443 @@ -70,7 +70,7 @@ cookies # # Verify data after the test has been "shot" - + GET /a/b/%TESTNUMBER HTTP/1.1 Host: attack.invalid:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test444 b/tests/data/test444 index a9759c73b043..4c092bef1b94 100644 --- a/tests/data/test444 +++ b/tests/data/test444 @@ -126,7 +126,7 @@ cookies # # Verify data after the test has been "shot" - + GET /a/b/%TESTNUMBER HTTP/1.1 Host: attack.invalid:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test446 b/tests/data/test446 index be7bad0e965b..ceae26b7e77a 100644 --- a/tests/data/test446 +++ b/tests/data/test446 @@ -12,18 +12,18 @@ trailing-dot # we use this as response to a CONNECT - -HTTP/1.1 200 OK - + +HTTP/1.1 200 OK + - + HTTP/1.1 200 OK Content-Length: 6 Strict-Transport-Security: max-age=604800 -foo- - + HTTP/1.1 200 OK Content-Length: 6 Strict-Transport-Security: max-age=6048000 @@ -58,7 +58,7 @@ HSTS with two URLs # we let it CONNECT to the server to confirm HSTS but deny from there - + GET http://this.hsts.example./%TESTNUMBER HTTP/1.1 Host: this.hsts.example. User-Agent: curl/%VERSION diff --git a/tests/data/test447 b/tests/data/test447 index 2783b750b61d..f3966f7d2766 100644 --- a/tests/data/test447 +++ b/tests/data/test447 @@ -10,7 +10,7 @@ growing file # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test448 b/tests/data/test448 index 108ead9b5955..fae30bd533d4 100644 --- a/tests/data/test448 +++ b/tests/data/test448 @@ -10,7 +10,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test449 b/tests/data/test449 index 73c96772811e..9c5f5cfede34 100644 --- a/tests/data/test449 +++ b/tests/data/test449 @@ -10,7 +10,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test45 b/tests/data/test45 index 254c3afe9716..54c41dec92bd 100644 --- a/tests/data/test45 +++ b/tests/data/test45 @@ -59,7 +59,7 @@ simple HTTP Location: without protocol in initial URL # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test450 b/tests/data/test450 index 5dcfb85ce67c..61d181b00d86 100644 --- a/tests/data/test450 +++ b/tests/data/test450 @@ -9,7 +9,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test451 b/tests/data/test451 index 7c8fe7d93bb8..503a77835e7c 100644 --- a/tests/data/test451 +++ b/tests/data/test451 @@ -9,7 +9,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test455 b/tests/data/test455 index 7e468e75243b..5a5e42f6d67a 100644 --- a/tests/data/test455 +++ b/tests/data/test455 @@ -8,7 +8,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test457 b/tests/data/test457 index 79175fcd4c6b..d9f945ebda3b 100644 --- a/tests/data/test457 +++ b/tests/data/test457 @@ -53,7 +53,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 143 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test458 b/tests/data/test458 index 58e705226486..66027b087e53 100644 --- a/tests/data/test458 +++ b/tests/data/test458 @@ -9,7 +9,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -50,14 +50,14 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test459 b/tests/data/test459 index d1f1ba261ce5..42398bd35fdb 100644 --- a/tests/data/test459 +++ b/tests/data/test459 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test46 b/tests/data/test46 index d426503fe7e4..007861b4fb5b 100644 --- a/tests/data/test46 +++ b/tests/data/test46 @@ -11,23 +11,23 @@ cookiejar # Server-side - -HTTP/1.1 200 OK -Server: Microsoft-IIS/4.0 -Date: Tue, 25 Sep 2001 19:37:44 GMT -Content-Type: text/html + +HTTP/1.1 200 OK +Server: Microsoft-IIS/4.0 +Date: Tue, 25 Sep 2001 19:37:44 GMT +Content-Type: text/html %if large-time -Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2525 11:56:27 GMT; path=/ +Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2525 11:56:27 GMT; path=/ %else -Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2037 11:56:27 GMT; path=/ +Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2037 11:56:27 GMT; path=/ %endif -Set-Cookie: ckySession=temporary; path=/ -Set-Cookie: ASPSESSIONIDQGGQQSJJ=GKNBDIFAAOFDPDAIEAKDIBKE; path=/ -Set-Cookie: justaname=; path=/; -Set-Cookie: simplyhuge=%repeat[3998 x z]% -Cache-control: private -Content-Length: 41 - +Set-Cookie: ckySession=temporary; path=/ +Set-Cookie: ASPSESSIONIDQGGQQSJJ=GKNBDIFAAOFDPDAIEAKDIBKE; path=/ +Set-Cookie: justaname=; path=/; +Set-Cookie: simplyhuge=%repeat[3998 x z]% +Cache-control: private +Content-Length: 41 + This server reply is for testing cookies @@ -74,7 +74,7 @@ cookies # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: domain..tld:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test461 b/tests/data/test461 index 03d7c7a22cb7..a8e917640a02 100644 --- a/tests/data/test461 +++ b/tests/data/test461 @@ -10,7 +10,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 6 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -H host: # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test468 b/tests/data/test468 index 0b06a4d32eef..8242b309fdd1 100644 --- a/tests/data/test468 +++ b/tests/data/test468 @@ -10,7 +10,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd%TESTNUMBER -w "" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test469 b/tests/data/test469 index 87754a264654..1be56737492f 100644 --- a/tests/data/test469 +++ b/tests/data/test469 @@ -8,7 +8,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test47 b/tests/data/test47 index addde5c39146..11775d3c43ee 100644 --- a/tests/data/test47 +++ b/tests/data/test47 @@ -35,7 +35,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -0 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.0 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test470 b/tests/data/test470 index 547121d11a8a..b0b720f91efd 100644 --- a/tests/data/test470 +++ b/tests/data/test470 @@ -8,7 +8,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test471 b/tests/data/test471 index 02e273ca3b23..e434198ad131 100644 --- a/tests/data/test471 +++ b/tests/data/test471 @@ -54,7 +54,7 @@ Reject HTTP/1.1 to HTTP/2 switch on the same connection # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test472 b/tests/data/test472 index d624760040d7..61d72e30d7b3 100644 --- a/tests/data/test472 +++ b/tests/data/test472 @@ -9,7 +9,7 @@ aws-sigv4 # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -47,7 +47,7 @@ aws-sigv4 with query # # Verify data after the test has been "shot" - + GET /472/a=%E3%81%82 HTTP/1.1 Host: fake.fake.fake:8000 Authorization: AWS4-HMAC-SHA256 Credential=user/19700101/us-east-2/es/aws4_request, SignedHeaders=host;x-amz-date, Signature=b8783c8387a5249b084642126fe1f8e07e12a2847820fd5b6cd64b2047149da4 diff --git a/tests/data/test473 b/tests/data/test473 index 8a1a10a6cdfa..c4caa11a626c 100644 --- a/tests/data/test473 +++ b/tests/data/test473 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test474 b/tests/data/test474 index fc5575d71b8f..ffc3c0339dc9 100644 --- a/tests/data/test474 +++ b/tests/data/test474 @@ -9,7 +9,7 @@ # # Server-side - + HTTP/1.1 301 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 @@ -18,7 +18,7 @@ Content-Type: text/html Location: https://%HOSTIP:%HTTPSPORT/%TESTNUMBER0002 - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 diff --git a/tests/data/test477 b/tests/data/test477 index ab0eac0c81f0..5e083360ce76 100644 --- a/tests/data/test477 +++ b/tests/data/test477 @@ -51,7 +51,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-filesize 5 -L # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test478 b/tests/data/test478 index 510eb1969699..b1fb2299c0dd 100644 --- a/tests/data/test478 +++ b/tests/data/test478 @@ -8,7 +8,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -60,7 +60,7 @@ login debbie - + GET http://github.com/ HTTP/1.1 Host: github.com Authorization: Basic %b64[debbie:second%0D]b64% diff --git a/tests/data/test479 b/tests/data/test479 index 0dfa730ad463..46f62846985d 100644 --- a/tests/data/test479 +++ b/tests/data/test479 @@ -8,7 +8,7 @@ HTTP # # Server-side - + HTTP/1.1 301 Follow this you fool Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -22,7 +22,7 @@ Location: http://b.com/%TESTNUMBER0002 -foo- - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -35,7 +35,7 @@ Connection: close target - + HTTP/1.1 301 Follow this you fool Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -87,7 +87,7 @@ default - + GET http://a.com/ HTTP/1.1 Host: a.com Authorization: Basic %b64[alice:alicespassword]b64% diff --git a/tests/data/test483 b/tests/data/test483 index 57fd10977805..7c3251004e2c 100644 --- a/tests/data/test483 +++ b/tests/data/test483 @@ -10,7 +10,7 @@ cookies # # Server-side - + HTTP/1.1 200 OK Set-Cookie: name=value; expires=Fri Feb 13 11:56:27 GMT 2132 Set-Cookie: name2=value; expires=Fri Feb 13 11:56:27 ; 2132 @@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -c %LOGDIR/c%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test486 b/tests/data/test486 index 0bcd045eb48a..068b94dd3e6d 100644 --- a/tests/data/test486 +++ b/tests/data/test486 @@ -8,7 +8,7 @@ HTTP # # Server-side - + HTTP/1.1 301 Follow this you fool Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -22,7 +22,7 @@ Location: http://b.com/%TESTNUMBER0002 -foo- - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -35,7 +35,7 @@ Connection: close target - + HTTP/1.1 301 Follow this you fool Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -86,7 +86,7 @@ default - + GET http://a.com/ HTTP/1.1 Host: a.com Authorization: Basic %b64[alice:alicespassword]b64% diff --git a/tests/data/test487 b/tests/data/test487 index 3ac508b2e54f..f7ed37245aa6 100644 --- a/tests/data/test487 +++ b/tests/data/test487 @@ -8,7 +8,7 @@ variables # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -41,7 +41,7 @@ Variable using 64dec with bad base64 # # Verify data after the test has been "shot" - + GET /[64dec-fail]/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test488 b/tests/data/test488 index ec32810bb5d4..bb9838836194 100644 --- a/tests/data/test488 +++ b/tests/data/test488 @@ -10,7 +10,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/b # # Verify data after the test has been "shot" - + GET /a HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test489 b/tests/data/test489 index 03c42c5d1e43..d610d5c50a16 100644 --- a/tests/data/test489 +++ b/tests/data/test489 @@ -10,7 +10,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/b # # Verify data after the test has been "shot" - + GET /a HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test49 b/tests/data/test49 index ff2f41b3c1bd..6e0061cd2bdb 100644 --- a/tests/data/test49 +++ b/tests/data/test49 @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test493 b/tests/data/test493 index 67083721d6b2..bc2f20b0685c 100644 --- a/tests/data/test493 +++ b/tests/data/test493 @@ -11,14 +11,14 @@ url_effective # we use this as response to a CONNECT - -HTTP/1.1 403 not OK at all -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Funny-head: yesyes - + +HTTP/1.1 403 not OK at all +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Funny-head: yesyes + -foo- @@ -50,21 +50,21 @@ test-duphandle # we let it CONNECT to the server to confirm HSTS but deny from there - + CONNECT this.hsts.example:443 HTTP/1.1 Host: this.hsts.example:443 User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive - -HTTP/1.1 403 not OK at all -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Funny-head: yesyes - + +HTTP/1.1 403 not OK at all +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Funny-head: yesyes + https://this.hsts.example/%TESTNUMBER # Proxy CONNECT aborted diff --git a/tests/data/test495 b/tests/data/test495 index 60b24b97ee25..e3c60664798c 100644 --- a/tests/data/test495 +++ b/tests/data/test495 @@ -44,7 +44,7 @@ http://foo%40bar:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER --netrc-optional # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[foo@bar:secret]b64% diff --git a/tests/data/test497 b/tests/data/test497 index 02ec8e802f8e..e71370251da5 100644 --- a/tests/data/test497 +++ b/tests/data/test497 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test499 b/tests/data/test499 index d4040b07ce99..07433871ac0c 100644 --- a/tests/data/test499 +++ b/tests/data/test499 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -I # # Verify data after the test has been "shot" - + HEAD /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test5 b/tests/data/test5 index 25d887b496d6..807eb55929a8 100644 --- a/tests/data/test5 +++ b/tests/data/test5 @@ -39,7 +39,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test50 b/tests/data/test50 index 6b8f86a6c76f..a468ad656e46 100644 --- a/tests/data/test50 +++ b/tests/data/test50 @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test500 b/tests/data/test500 index d09cc4fdbd05..df964293dc02 100644 --- a/tests/data/test500 +++ b/tests/data/test500 @@ -8,18 +8,18 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER IP %HOSTIP - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test503 b/tests/data/test503 index 8aefb0d86fc3..ba071c24ff6c 100644 --- a/tests/data/test503 +++ b/tests/data/test503 @@ -16,9 +16,9 @@ multi connection-monitor - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 OK swsclose @@ -70,12 +70,12 @@ moo # Verify data after the test has been "shot" - -CONNECT machine.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: machine.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: Basic %b64[test%2520:ing%2541]b64% -Proxy-Connection: Keep-Alive - + +CONNECT machine.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: machine.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: Basic %b64[test%2520:ing%2541]b64% +Proxy-Connection: Keep-Alive + [DISCONNECT] diff --git a/tests/data/test508 b/tests/data/test508 index b3c528983444..69079a365a57 100644 --- a/tests/data/test508 +++ b/tests/data/test508 @@ -9,13 +9,13 @@ POST callback # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test51 b/tests/data/test51 index d66df6744442..f2a7d00f17b0 100644 --- a/tests/data/test51 +++ b/tests/data/test51 @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test510 b/tests/data/test510 index 7864293100ed..ede81fb8e647 100644 --- a/tests/data/test510 +++ b/tests/data/test510 @@ -10,13 +10,13 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test512 b/tests/data/test512 index 79e198af18c1..55436fd1c786 100644 --- a/tests/data/test512 +++ b/tests/data/test512 @@ -9,12 +9,12 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: yes -Connection: close - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: yes +Connection: close + hello @@ -40,7 +40,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test514 b/tests/data/test514 index 2f3a01eb5d78..9ab14de7c643 100644 --- a/tests/data/test514 +++ b/tests/data/test514 @@ -8,18 +8,18 @@ HTTP HEAD # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + HEAD /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test515 b/tests/data/test515 index 1009900cc95b..75817365ff13 100644 --- a/tests/data/test515 +++ b/tests/data/test515 @@ -8,12 +8,12 @@ HTTP POST # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test516 b/tests/data/test516 index fcadb706bc7b..dbd6352aa939 100644 --- a/tests/data/test516 +++ b/tests/data/test516 @@ -10,12 +10,12 @@ FORM # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test518 b/tests/data/test518 index 0e730664cde4..0da7360d98a9 100644 --- a/tests/data/test518 +++ b/tests/data/test518 @@ -9,18 +9,18 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test519 b/tests/data/test519 index 2e38372b48d6..6121c12e3ed7 100644 --- a/tests/data/test519 +++ b/tests/data/test519 @@ -9,34 +9,34 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK swsbounce -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 8 - + +HTTP/1.1 200 OK swsbounce +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 8 + content - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 9 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 9 + content2 - -HTTP/1.1 200 OK swsbounce -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 8 - + +HTTP/1.1 200 OK swsbounce +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 8 + content -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 9 - +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 9 + content2 @@ -62,7 +62,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[monster:underbed]b64% diff --git a/tests/data/test52 b/tests/data/test52 index b86796636272..39e7d68f7732 100644 --- a/tests/data/test52 +++ b/tests/data/test52 @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /we/are/all/twits/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test522 b/tests/data/test522 index 1c4b17968695..2134e98c8113 100644 --- a/tests/data/test522 +++ b/tests/data/test522 @@ -10,15 +10,15 @@ CURLOPT_PORT # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -43,7 +43,7 @@ http://%HOSTIP/%TESTNUMBER %HTTPPORT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[xxx:yyy]b64% diff --git a/tests/data/test523 b/tests/data/test523 index fc4b5272e196..4c67bc6d4b28 100644 --- a/tests/data/test523 +++ b/tests/data/test523 @@ -12,15 +12,15 @@ CURLOPT_PROXY # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -49,7 +49,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://www.example.com:19999/%TESTNUMBER HTTP/1.1 Host: www.example.com:19999 Authorization: Basic %b64[xxx:yyy]b64% diff --git a/tests/data/test528 b/tests/data/test528 index 0889b69980a9..7daf4d5f13b4 100644 --- a/tests/data/test528 +++ b/tests/data/test528 @@ -9,12 +9,12 @@ multi # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 47 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 47 + file contents should appear once for each file @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" - + GET /path/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test53 b/tests/data/test53 index 5a018ab49257..0c044a109279 100644 --- a/tests/data/test53 +++ b/tests/data/test53 @@ -8,14 +8,14 @@ cookies # Server-side - -HTTP/1.1 200 OK -Server: Microsoft-IIS/4.0 -Date: Tue, 25 Sep 2001 19:37:44 GMT -Content-Type: text/html -Connection: close -Content-Length: 21 - + +HTTP/1.1 200 OK +Server: Microsoft-IIS/4.0 +Date: Tue, 25 Sep 2001 19:37:44 GMT +Content-Type: text/html +Connection: close +Content-Length: 21 + This server says moo @@ -43,7 +43,7 @@ cookies # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test535 b/tests/data/test535 index 50dfcffd499b..986ffb3bc5e9 100644 --- a/tests/data/test535 +++ b/tests/data/test535 @@ -8,23 +8,23 @@ multi - -HTTP/1.1 404 Badness -Date: Tue, 09 Nov 2010 14:49:00 GMT -ETag: "21025-dc7-39462498" -Content-Length: 6 -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 404 Badness +Date: Tue, 09 Nov 2010 14:49:00 GMT +ETag: "21025-dc7-39462498" +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + hejsan - -HTTP/1.1 200 Fine -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 13 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 Fine +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 13 +Connection: close +Content-Type: text/html + fine content @@ -55,7 +55,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test536 b/tests/data/test536 index dc78f2a6513f..58a9ede4f483 100644 --- a/tests/data/test536 +++ b/tests/data/test536 @@ -13,15 +13,15 @@ CURLINFO_USED_PROXY # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -55,7 +55,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://usingproxy.com/ HTTP/1.1 Host: usingproxy.com Accept: */* diff --git a/tests/data/test537 b/tests/data/test537 index 0fa0ef7cd89b..5cac2ed91794 100644 --- a/tests/data/test537 +++ b/tests/data/test537 @@ -9,18 +9,18 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test54 b/tests/data/test54 index c0be2d624e28..167542fbf097 100644 --- a/tests/data/test54 +++ b/tests/data/test54 @@ -32,7 +32,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test540 b/tests/data/test540 index 161e986488f8..c3238e33053f 100644 --- a/tests/data/test540 +++ b/tests/data/test540 @@ -16,41 +16,41 @@ connection-monitor # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 33 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" +Content-Length: 33 + And you should ignore this data. # then this is returned when we get proxy-auth - -HTTP/1.1 200 OK -Content-Length: 21 -Server: no - + +HTTP/1.1 200 OK +Content-Length: 21 +Server: no + Nice proxy auth sir! - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 33 - -HTTP/1.1 200 OK -Content-Length: 21 -Server: no - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" +Content-Length: 33 + +HTTP/1.1 200 OK +Content-Length: 21 +Server: no + Nice proxy auth sir! -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 33 - -HTTP/1.1 200 OK -Content-Length: 21 -Server: no - +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" +Content-Length: 33 + +HTTP/1.1 200 OK +Content-Length: 21 +Server: no + Nice proxy auth sir! diff --git a/tests/data/test542 b/tests/data/test542 index 0974f0292c97..8f6bdf89453e 100644 --- a/tests/data/test542 +++ b/tests/data/test542 @@ -16,9 +16,9 @@ that FTP works so does it? - -Content-Length: 51 -Accept-ranges: bytes + +Content-Length: 51 +Accept-ranges: bytes diff --git a/tests/data/test544 b/tests/data/test544 index 38a7da064077..adfeadcf09ff 100644 --- a/tests/data/test544 +++ b/tests/data/test544 @@ -9,12 +9,12 @@ HTTP POST # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK diff --git a/tests/data/test545 b/tests/data/test545 index b8993c01f145..363fe4dd7f37 100644 --- a/tests/data/test545 +++ b/tests/data/test545 @@ -9,12 +9,12 @@ HTTP POST # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK diff --git a/tests/data/test547 b/tests/data/test547 index d18639ae8a6b..764a23130190 100644 --- a/tests/data/test547 +++ b/tests/data/test547 @@ -12,56 +12,56 @@ NTLM # Server-side - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test548 b/tests/data/test548 index 1a8d5e16e9dc..d75c49559ef5 100644 --- a/tests/data/test548 +++ b/tests/data/test548 @@ -12,56 +12,56 @@ NTLM # Server-side - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test549 b/tests/data/test549 index 070bfcdfd391..6fc17603f5b3 100644 --- a/tests/data/test549 +++ b/tests/data/test549 @@ -11,15 +11,15 @@ HTTP proxy # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -49,7 +49,7 @@ ftp://www.example.com/moo/%TESTNUMBER http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET ftp://www.example.com/moo/%TESTNUMBER;type=i HTTP/1.1 Host: www.example.com:21 Accept: */* diff --git a/tests/data/test55 b/tests/data/test55 index dd8a9d4f6bd2..73e474fd3b2b 100644 --- a/tests/data/test55 +++ b/tests/data/test55 @@ -48,7 +48,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -L - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test550 b/tests/data/test550 index e0d0b1b16f0b..ae87565aea3a 100644 --- a/tests/data/test550 +++ b/tests/data/test550 @@ -11,15 +11,15 @@ CURLOPT_PROXY # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -49,7 +49,7 @@ ftp://www.example.com/moo/%TESTNUMBER http://%HOSTIP:%HTTPPORT ascii # # Verify data after the test has been "shot" - + GET ftp://www.example.com/moo/%TESTNUMBER;type=a HTTP/1.1 Host: www.example.com:21 Accept: */* diff --git a/tests/data/test551 b/tests/data/test551 index cd85900530cb..87579d48f81c 100644 --- a/tests/data/test551 +++ b/tests/data/test551 @@ -14,39 +14,39 @@ HTTP proxy Digest auth # as a bonus, ww use an excessive nonce length - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # This is supposed to be returned when the server gets the Digest # Authorization: line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test552 b/tests/data/test552 index 114fe5e0dcc9..2d36d56ab18d 100644 --- a/tests/data/test552 +++ b/tests/data/test552 @@ -16,24 +16,24 @@ HTTP proxy Digest auth # as a bonus, ww use an excessive nonce length - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Digest realm="something fun to read", nonce="%repeat[400 x A]%" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # This is supposed to be returned when the server gets the Digest # Authorization: line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test553 b/tests/data/test553 index bbe364b1fb54..69f822033062 100644 --- a/tests/data/test553 +++ b/tests/data/test553 @@ -10,11 +10,11 @@ huge request header # Server-side - -HTTP/1.1 200 Fine! -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Length: 6 - + +HTTP/1.1 200 Fine! +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Length: 6 + hello diff --git a/tests/data/test554 b/tests/data/test554 index 1e2fc5f6b58a..cf37ebe76d2d 100644 --- a/tests/data/test554 +++ b/tests/data/test554 @@ -10,29 +10,29 @@ FORM # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test555 b/tests/data/test555 index 5b286395ad8f..1d42c8da2f92 100644 --- a/tests/data/test555 +++ b/tests/data/test555 @@ -17,56 +17,56 @@ NTLM # Server-side - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts" +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. diff --git a/tests/data/test556 b/tests/data/test556 index d8abd149884a..88d8ce84c858 100644 --- a/tests/data/test556 +++ b/tests/data/test556 @@ -7,13 +7,13 @@ HTTP GET - -HTTP/1.1 200 OK swsclose -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -Content-Length: 6 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +Content-Length: 6 +Connection: close + -foo- @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: ninja diff --git a/tests/data/test560 b/tests/data/test560 index cdcf674f8f45..316baf48fbfc 100644 --- a/tests/data/test560 +++ b/tests/data/test560 @@ -10,12 +10,12 @@ multi # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 7 - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 7 + MooMoo @@ -43,7 +43,7 @@ https://%HOSTIP:%HTTPSPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPSPORT Accept: */* diff --git a/tests/data/test561 b/tests/data/test561 index 5bd07e49d1f6..d3ad14111934 100644 --- a/tests/data/test561 +++ b/tests/data/test561 @@ -12,15 +12,15 @@ type= # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -50,7 +50,7 @@ FTP RETR with CURLOPT_PROXY_TRANSFER_MODE, ASCII transfer and type=i # # Verify data after the test has been "shot" - + GET ftp://www.example.com/moo/%TESTNUMBER;type=i HTTP/1.1 Host: www.example.com:21 Accept: */* diff --git a/tests/data/test563 b/tests/data/test563 index c109e9f80f79..12f0368d58d8 100644 --- a/tests/data/test563 +++ b/tests/data/test563 @@ -9,13 +9,13 @@ HTTP proxy # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Accept-Ranges: bytes -Content-Length: 6 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Accept-Ranges: bytes +Content-Length: 6 + hello @@ -48,7 +48,7 @@ ftp_proxy=http://%HOSTIP:%HTTPPORT/ # Verify data after the test has been "shot" - + GET ftp://%HOSTIP:%FTPPORT/%TESTNUMBER;type=A HTTP/1.1 Host: %HOSTIP:%FTPPORT Accept: */* diff --git a/tests/data/test565 b/tests/data/test565 index 736946c86ae8..fc1c9c310f17 100644 --- a/tests/data/test565 +++ b/tests/data/test565 @@ -10,44 +10,44 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please swsbounce -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please swsbounce +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please swsbounce -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please swsbounce +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test566 b/tests/data/test566 index ccfedd826cc3..0b2e5e23a3e1 100644 --- a/tests/data/test566 +++ b/tests/data/test566 @@ -8,18 +8,18 @@ HTTP GET # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 0 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 0 +Connection: close +Content-Type: text/html +Funny-head: yesyes + @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER CL 0 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test567 b/tests/data/test567 index 940ac7d00134..05f1cfeb4e61 100644 --- a/tests/data/test567 +++ b/tests/data/test567 @@ -10,12 +10,12 @@ OPTIONS # Server-side - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -CSeq: 1 -Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE -Curl-Private: swsclose + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +CSeq: 1 +Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE +Curl-Private: swsclose @@ -37,7 +37,7 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER - + OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 CSeq: 1 User-Agent: test%TESTNUMBER diff --git a/tests/data/test568 b/tests/data/test568 index 8aa659201db2..e4161762570d 100644 --- a/tests/data/test568 +++ b/tests/data/test568 @@ -10,11 +10,11 @@ ANNOUNCE # Server-side - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Cseq: 1 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Cseq: 1 + @@ -29,19 +29,19 @@ s=rtspd SDP i=A fake SDP reply u=http://www.curl.example.com/fakesdp.ps - -RTSP/1.0 200 Okie Dokie -Server: RTSPD/libcurl-test -Cseq: 3 - + +RTSP/1.0 200 Okie Dokie +Server: RTSPD/libcurl-test +Cseq: 3 + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -CSeq: 4 -Curl-private: swsclose -Informational: Empty Options Response - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +CSeq: 4 +Curl-private: swsclose +Informational: Empty Options Response + diff --git a/tests/data/test57 b/tests/data/test57 index a28d6321e2c3..69d1f78dd2a6 100644 --- a/tests/data/test57 +++ b/tests/data/test57 @@ -35,7 +35,7 @@ HTTP content-type with spaces in text/html; charset=ISO-8859-4 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test570 b/tests/data/test570 index 318beee09621..565282053d34 100644 --- a/tests/data/test570 +++ b/tests/data/test570 @@ -10,29 +10,29 @@ Mismatch checking # Server-side - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -CSeq: 2 -Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE -Informational: CSeq Mismatch - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +CSeq: 2 +Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE +Informational: CSeq Mismatch + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: asdf -CSeq: 999 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: asdf +CSeq: 999 + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: asdfWRONG -Informational: Session ID mismatch -Curl-Private: swsclose -CSeq: 1000 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: asdfWRONG +Informational: Session ID mismatch +Curl-Private: swsclose +CSeq: 1000 + diff --git a/tests/data/test571 b/tests/data/test571 index bae97d418080..ca97c1b04919 100644 --- a/tests/data/test571 +++ b/tests/data/test571 @@ -14,39 +14,39 @@ RTP # Server-side - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: asdf -CSeq: 1 -Transport: RTP/AVP/TCP;unicast;interleaved=0-1 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: asdf +CSeq: 1 +Transport: RTP/AVP/TCP;unicast;interleaved=0-1 + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -CSeq: 2 -Session: asdf - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +CSeq: 2 +Session: asdf + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Cseq: 3 -Content-Length: 4 -Content-Type: fake/evil - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Cseq: 3 +Content-Length: 4 +Content-Type: fake/evil + $99 - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: asdf -CSeq: 4 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: asdf +CSeq: 4 + diff --git a/tests/data/test572 b/tests/data/test572 index 8b702a680179..ac0bdf3b97fb 100644 --- a/tests/data/test572 +++ b/tests/data/test572 @@ -10,53 +10,53 @@ GET_PARAMETER # Server-side - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: getparams-test -CSeq: 1 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: getparams-test +CSeq: 1 + - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: getparams-test -Content-Type: text/parameters -Content-Length: 32 -Cseq: 2 - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: getparams-test +Content-Type: text/parameters +Content-Length: 32 +Cseq: 2 + scale=enormous speed=ludicrous - -RTSP/1.0 204 OK -Server: RTSPD/libcurl-test -Session: getparams-test -Cseq: 3 - + +RTSP/1.0 204 OK +Server: RTSPD/libcurl-test +Session: getparams-test +Cseq: 3 + - -RTSP/1.0 200 Okie Dokie -Server: RTSPD/libcurl-test -Session: getparams-test -Cseq: 4 -Content-Length: 37 - + +RTSP/1.0 200 Okie Dokie +Server: RTSPD/libcurl-test +Session: getparams-test +Cseq: 4 +Content-Length: 37 + packets_received: 1000 jitter: 0.314 - -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Session: getparams-test -CSeq: 5 -Curl-private: swsclose -Informational: Empty Options Response - + +RTSP/1.0 200 OK +Server: RTSPD/libcurl-test +Session: getparams-test +CSeq: 5 +Curl-private: swsclose +Informational: Empty Options Response + diff --git a/tests/data/test573 b/tests/data/test573 index 82669b36f78e..738d27661b9c 100644 --- a/tests/data/test573 +++ b/tests/data/test573 @@ -9,18 +9,18 @@ flaky # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- @@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test577 b/tests/data/test577 index bf31db7595d0..6abbf070fe23 100644 --- a/tests/data/test577 +++ b/tests/data/test577 @@ -10,12 +10,12 @@ OPTIONS # Server-side - -RTSP/1.1234567 200 OK -Server: RTSPD/libcurl-test -CSeq: 1 -Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE -Curl-Private: swsclose + +RTSP/1.1234567 200 OK +Server: RTSPD/libcurl-test +CSeq: 1 +Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE +Curl-Private: swsclose @@ -39,7 +39,7 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER - + OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 CSeq: 1 User-Agent: test567 diff --git a/tests/data/test578 b/tests/data/test578 index d909de87baa7..7561283ab819 100644 --- a/tests/data/test578 +++ b/tests/data/test578 @@ -8,18 +8,18 @@ HTTP POST # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- diff --git a/tests/data/test579 b/tests/data/test579 index c8e1700b81a5..a4e63b612d62 100644 --- a/tests/data/test579 +++ b/tests/data/test579 @@ -9,44 +9,44 @@ HTTP Digest auth # # Server-side - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please swsbounce -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please swsbounce +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok - -HTTP/1.1 100 Continue -Server: Microsoft-IIS/5.0 -Date: Sun, 03 Apr 2005 14:57:45 GMT -X-Powered-By: ASP.NET - -HTTP/1.1 401 authentication please swsbounce -Server: Microsoft-IIS/6.0 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 - -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - + +HTTP/1.1 100 Continue +Server: Microsoft-IIS/5.0 +Date: Sun, 03 Apr 2005 14:57:45 GMT +X-Powered-By: ASP.NET + +HTTP/1.1 401 authentication please swsbounce +Server: Microsoft-IIS/6.0 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604144" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 + +HTTP/1.1 200 A OK +Server: Microsoft-IIS/6.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 3 + ok diff --git a/tests/data/test580 b/tests/data/test580 index ad6b73b33d6f..8a8e14d28a2a 100644 --- a/tests/data/test580 +++ b/tests/data/test580 @@ -10,23 +10,23 @@ Duplicate-header # Server-side - -HTTP/1.1 302 eat this! -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: this-is-the-first.html -Content-Length: 0 -Connection: close -Location: and there's a second one too! / moo.html - + +HTTP/1.1 302 eat this! +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: this-is-the-first.html +Content-Length: 0 +Connection: close +Location: and there's a second one too! / moo.html + - -HTTP/1.1 302 eat this! -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: this-is-the-first.html -Content-Length: 0 -Connection: close + +HTTP/1.1 302 eat this! +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: this-is-the-first.html +Content-Length: 0 +Connection: close @@ -53,7 +53,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test581 b/tests/data/test581 index 81844771fbdb..e4e32f63044a 100644 --- a/tests/data/test581 +++ b/tests/data/test581 @@ -10,15 +10,15 @@ Duplicate-header # Server-side - -HTTP/1.1 200 all good! -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Content-Length: 0 -Connection: close -Content-Type: changed/my/mind - + +HTTP/1.1 200 all good! +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Content-Length: 0 +Connection: close +Content-Type: changed/my/mind + @@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test584 b/tests/data/test584 index 56c72c72469f..efc261534396 100644 --- a/tests/data/test584 +++ b/tests/data/test584 @@ -10,26 +10,26 @@ HTTP MIME # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK diff --git a/tests/data/test585 b/tests/data/test585 index a9d4f61d161c..5a50587b9492 100644 --- a/tests/data/test585 +++ b/tests/data/test585 @@ -11,14 +11,14 @@ CURLOPT_CLOSESOCKETFUNCTION # Server-side - -HTTP/1.1 302 eat this! -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: this-is-the-first.html -Content-Length: 0 -Connection: close - + +HTTP/1.1 302 eat this! +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: this-is-the-first.html +Content-Length: 0 +Connection: close + [OPEN] counter: 1 @@ -56,7 +56,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test589 b/tests/data/test589 index 0846661aa768..a0cadd32d7bc 100644 --- a/tests/data/test589 +++ b/tests/data/test589 @@ -10,12 +10,12 @@ HTTP MIME # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK @@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test59 b/tests/data/test59 index 4211b4e6d204..f3df61538615 100644 --- a/tests/data/test59 +++ b/tests/data/test59 @@ -34,7 +34,7 @@ HTTP URL with slash but with "parameter" # # Verify data after the test has been "shot" - + GET /?mooo/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test590 b/tests/data/test590 index 09c2c065a277..a6662c5565dd 100644 --- a/tests/data/test590 +++ b/tests/data/test590 @@ -12,54 +12,54 @@ NTLM # Server-side - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Negotiate -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Negotiate +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. - -HTTP/1.1 407 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Proxy-Authenticate: Negotiate -Proxy-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine in proxy land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 407 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Proxy-Authenticate: Negotiate +Proxy-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 407 Authorization Required to proxy me my dear +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine in proxy land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. @@ -90,7 +90,7 @@ http://test.remote.example.com/path/%TESTNUMBER http://%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" - + GET http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 Host: test.remote.example.com Accept: */* diff --git a/tests/data/test598 b/tests/data/test598 index 74ed46bac4de..945b3ea669cd 100644 --- a/tests/data/test598 +++ b/tests/data/test598 @@ -12,31 +12,31 @@ curl_easy_reset # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- # since the request runs twice - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- @@ -66,7 +66,7 @@ cookies # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: the-moo agent next generation diff --git a/tests/data/test599 b/tests/data/test599 index 5d334e070b2d..f06773a60679 100644 --- a/tests/data/test599 +++ b/tests/data/test599 @@ -9,15 +9,15 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: %TESTNUMBER0001 -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: %TESTNUMBER0001 +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- @@ -35,22 +35,22 @@ this data is slightly larger than the first piece - -HTTP/1.1 302 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: %TESTNUMBER0001 -Content-Length: 6 -Connection: close -Content-Type: text/html - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Transfer-Encoding: chunked -Connection: close -Content-Type: text/html - + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: %TESTNUMBER0001 +Content-Length: 6 +Connection: close +Content-Type: text/html + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Transfer-Encoding: chunked +Connection: close +Content-Type: text/html + this data is slightly larger than the first piece diff --git a/tests/data/test6 b/tests/data/test6 index 225c92833c1e..8c14309f0451 100644 --- a/tests/data/test6 +++ b/tests/data/test6 @@ -38,7 +38,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test60 b/tests/data/test60 index 164b2189e3b1..4d9b8b541bb5 100644 --- a/tests/data/test60 +++ b/tests/data/test60 @@ -9,11 +9,11 @@ chunked Transfer-Encoding # Server-side - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + blablabla diff --git a/tests/data/test61 b/tests/data/test61 index 22d22c88a8b8..cd38c000051b 100644 --- a/tests/data/test61 +++ b/tests/data/test61 @@ -11,26 +11,26 @@ httponly # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Type: text/html -Funny-head: yesyes + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes %if large-time -Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2525 -SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2525 +Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2525 +SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2525 %else -Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2037 -SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2037 +Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2037 +SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2037 %endif -Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure -Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure -Set-Cookie: test5=name; domain=anything.com; path=/ ; secure -Set-Cookie: fake=fooledyou; domain=..com; path=/; -Set-Cookie: supercookie=fooledyou; domain=.com; path=/; -Content-Length: 4 - +Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure +Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure +Set-Cookie: test5=name; domain=anything.com; path=/ ; secure +Set-Cookie: fake=fooledyou; domain=..com; path=/; +Set-Cookie: supercookie=fooledyou; domain=.com; path=/; +Content-Length: 4 + boo @@ -59,7 +59,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: www.host.foo.com User-Agent: curl/%VERSION diff --git a/tests/data/test62 b/tests/data/test62 index ec47b60f072a..d072e34ca898 100644 --- a/tests/data/test62 +++ b/tests/data/test62 @@ -11,11 +11,11 @@ httponly # Server-side - -HTTP/1.0 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html - + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html + boo @@ -49,7 +49,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: www.host.foo.com User-Agent: curl/%VERSION diff --git a/tests/data/test63 b/tests/data/test63 index 6056edaedcf3..234abb474111 100644 --- a/tests/data/test63 +++ b/tests/data/test63 @@ -10,12 +10,12 @@ http_proxy # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html Content-Length: 26 - + the content would go here @@ -41,7 +41,7 @@ proxy # Verify data after the test has been "shot" - + GET http://we.want.that.site.com/%TESTNUMBER HTTP/1.1 Host: we.want.that.site.com Proxy-Authorization: Basic %b64[fake:user]b64% diff --git a/tests/data/test64 b/tests/data/test64 index 34f49b69ffcf..bc6b50e006a3 100644 --- a/tests/data/test64 +++ b/tests/data/test64 @@ -8,39 +8,39 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test643 b/tests/data/test643 index 400d1b9ca528..fc4e639a012d 100644 --- a/tests/data/test643 +++ b/tests/data/test643 @@ -10,29 +10,29 @@ HTTP MIME POST # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test644 b/tests/data/test644 index 017b98d6e909..85bfc0eb226d 100644 --- a/tests/data/test644 +++ b/tests/data/test644 @@ -65,7 +65,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --xattr -L -o %LOGDIR/out%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test645 b/tests/data/test645 index c198cbbaeb73..4d8857780a67 100644 --- a/tests/data/test645 +++ b/tests/data/test645 @@ -10,29 +10,29 @@ HTTP MIME POST # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test646 b/tests/data/test646 index 67ef66498d2f..5f7f8e7605e6 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -23,11 +23,11 @@ smtp SMTP multipart using mime API - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=(;type=multipart/alternative" -F "= This is the html version;headers=X-test1: this is a header;type=text/html;headers=X-test2: this is another header " -F "=This is the plain text version;headers=@%LOGDIR/headers%TESTNUMBER" -F "=)" -F "=@%LOGDIR/test%TESTNUMBER.txt;headers=<%LOGDIR/headers%TESTNUMBER" -H "From: different" -H "To: another" -H "Reply-To: " @@ -39,7 +39,7 @@ It may contain any type of data. # This line is a comment -X-fileheader1: This is a header from a file +X-fileheader1: This is a header from a file%spc% # This line is another comment. It precedes a folded header. X-fileheader2: This is #a diff --git a/tests/data/test648 b/tests/data/test648 index f472f9f876d3..739a61ac210f 100644 --- a/tests/data/test648 +++ b/tests/data/test648 @@ -23,11 +23,11 @@ smtp SMTP multipart with transfer content encoders - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F '=This is the email inline text with a very long line containing the special character = and that should be split by encoder.;headers=Content-disposition: "inline";encoder=quoted-printable' -F "=@%LOGDIR/test%TESTNUMBER.txt;encoder=base64" -H "From: different" -H "To: another" diff --git a/tests/data/test649 b/tests/data/test649 index ea3c9c344728..97f4f099ca1a 100644 --- a/tests/data/test649 +++ b/tests/data/test649 @@ -23,11 +23,11 @@ smtp SMTP multipart with 7bit encoder error - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F '=This is valid;encoder=7bit' -F "=@%LOGDIR/test%TESTNUMBER.txt;encoder=7bit" -H "From: different" -H "To: another" diff --git a/tests/data/test65 b/tests/data/test65 index 300b9ad5cbaf..72839e0f7367 100644 --- a/tests/data/test65 +++ b/tests/data/test65 @@ -8,40 +8,40 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="2053604145" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Still a bad password you moron -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 - -This is not the real page either + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="2053604145" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Still a bad password you moron +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either @@ -66,7 +66,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:test2pass --digest # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test650 b/tests/data/test650 index 4c0107ae643a..e1ac811dde20 100644 --- a/tests/data/test650 +++ b/tests/data/test650 @@ -10,7 +10,7 @@ FORM # # Server-side - + HTTP/1.1 301 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose @@ -20,7 +20,7 @@ Location: /%TESTNUMBER0002 hello - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test651 b/tests/data/test651 index a3691f88e9e4..533167a800e4 100644 --- a/tests/data/test651 +++ b/tests/data/test651 @@ -10,13 +10,13 @@ FORM # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test653 b/tests/data/test653 index 350f84bc3a09..256d94fac08e 100644 --- a/tests/data/test653 +++ b/tests/data/test653 @@ -10,29 +10,29 @@ MIME # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test654 b/tests/data/test654 index df960f29e14e..10a914205af5 100644 --- a/tests/data/test654 +++ b/tests/data/test654 @@ -10,29 +10,29 @@ HTTP MIME POST # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test655 b/tests/data/test655 index 3cf5bd88505f..2e48598f3c56 100644 --- a/tests/data/test655 +++ b/tests/data/test655 @@ -8,13 +8,13 @@ HTTP # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test658 b/tests/data/test658 index e7889236f739..ccf757673c34 100644 --- a/tests/data/test658 +++ b/tests/data/test658 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test659 b/tests/data/test659 index 10adb147623f..fa7d02891ee9 100644 --- a/tests/data/test659 +++ b/tests/data/test659 @@ -42,7 +42,7 @@ proxy - + GET http://www.example.com/ HTTP/1.1 Host: www.example.com Accept: */* diff --git a/tests/data/test66 b/tests/data/test66 index 0a255fe84433..974a3fe0f1aa 100644 --- a/tests/data/test66 +++ b/tests/data/test66 @@ -29,7 +29,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http0.9 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test662 b/tests/data/test662 index 29bbb589141d..b7586fe824d1 100644 --- a/tests/data/test662 +++ b/tests/data/test662 @@ -10,32 +10,32 @@ followlocation # # Server-side - -HTTP/1.1 302 OK -Location: http://example.net/tes t case=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 - + +HTTP/1.1 302 OK +Location: http://example.net/tes t case=/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 + - -HTTP/1.1 200 OK -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 5 - + +HTTP/1.1 200 OK +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 5 + body - -HTTP/1.1 302 OK -Location: http://example.net/tes t case=/%TESTNUMBER0002 -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 - -HTTP/1.1 200 OK -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 5 - + +HTTP/1.1 302 OK +Location: http://example.net/tes t case=/%TESTNUMBER0002 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 + +HTTP/1.1 200 OK +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 5 + body @@ -60,7 +60,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://example.com/please/gimme/%TESTNUMBER HTTP/1.1 Host: example.com User-Agent: curl/%VERSION diff --git a/tests/data/test663 b/tests/data/test663 index a6e9ef56e3fa..b905583f7c7a 100644 --- a/tests/data/test663 +++ b/tests/data/test663 @@ -14,32 +14,32 @@ followlocation # # Server-side - -HTTP/1.1 302 OK -Location: http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 - + +HTTP/1.1 302 OK +Location: http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 + - -HTTP/1.1 200 OK -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 5 - + +HTTP/1.1 200 OK +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 5 + body - -HTTP/1.1 302 OK -Location: http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 0 - -HTTP/1.1 200 OK -Location: this should be ignored -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 5 - + +HTTP/1.1 302 OK +Location: http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 + +HTTP/1.1 200 OK +Location: this should be ignored +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 5 + body @@ -64,7 +64,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://example.com/gimme/%TESTNUMBER?foobar HTTP/1.1 Host: example.com User-Agent: curl/%VERSION diff --git a/tests/data/test666 b/tests/data/test666 index ecb35ec37221..6e65768e3dc8 100644 --- a/tests/data/test666 +++ b/tests/data/test666 @@ -11,20 +11,20 @@ MIME # # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 3 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 3 + OK diff --git a/tests/data/test667 b/tests/data/test667 index 9164adbaed3b..55d6214717a7 100644 --- a/tests/data/test667 +++ b/tests/data/test667 @@ -10,22 +10,22 @@ HTTP MIME POST # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test668 b/tests/data/test668 index e71475b682f3..412aa5bd7994 100644 --- a/tests/data/test668 +++ b/tests/data/test668 @@ -10,22 +10,22 @@ HTTP MIME POST # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:4f:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:4f:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:4f:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:4f:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test67 b/tests/data/test67 index 48ba23689040..0e2e32643e46 100644 --- a/tests/data/test67 +++ b/tests/data/test67 @@ -15,39 +15,39 @@ NTLM This is supposed to be returned when the server gets a first Authorization: NTLM line passed-in from the client --> - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -73,7 +73,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test670 b/tests/data/test670 index bb06fbba8a89..2f16c9d5b093 100644 --- a/tests/data/test670 +++ b/tests/data/test670 @@ -10,22 +10,22 @@ MIME # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test671 b/tests/data/test671 index 4a288c852ee1..0c5f3c474621 100644 --- a/tests/data/test671 +++ b/tests/data/test671 @@ -10,22 +10,22 @@ MIME # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test672 b/tests/data/test672 index c57e030a335b..96b1066d212c 100644 --- a/tests/data/test672 +++ b/tests/data/test672 @@ -10,22 +10,22 @@ FORM # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test673 b/tests/data/test673 index c599647bb9ee..029e0bbdfe7d 100644 --- a/tests/data/test673 +++ b/tests/data/test673 @@ -10,22 +10,22 @@ FORM # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake swsclose -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + hello diff --git a/tests/data/test674 b/tests/data/test674 index 315fe98b650a..2cd2f0a0bda5 100644 --- a/tests/data/test674 +++ b/tests/data/test674 @@ -39,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test675 b/tests/data/test675 index 5d82c52f9bd8..dca8a6b7c403 100644 --- a/tests/data/test675 +++ b/tests/data/test675 @@ -8,12 +8,12 @@ HTTP Basic auth # Server-side - -HTTP/1.1 200 OK swsclose -Date: Thu, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Content-Length: 26 - + +HTTP/1.1 200 OK swsclose +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Content-Length: 26 + the content would go here @@ -37,7 +37,7 @@ proxy # Verify data after the test has been "shot" - + GET /user1/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user1:foo1]b64% diff --git a/tests/data/test676 b/tests/data/test676 index d2f01d0e3131..c08ab29b7be2 100644 --- a/tests/data/test676 +++ b/tests/data/test676 @@ -12,31 +12,31 @@ curl_easy_reset # # Server-side - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- # since the request runs twice - -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: 6 -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + -foo- @@ -69,7 +69,7 @@ cookies # # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: the-moo agent next generation diff --git a/tests/data/test678 b/tests/data/test678 index 4f3ed70235e6..48b65076b0a2 100644 --- a/tests/data/test678 +++ b/tests/data/test678 @@ -48,7 +48,7 @@ https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: localhost:%HTTPSPORT User-Agent: CURLOPT_CAINFO_BLOB diff --git a/tests/data/test679 b/tests/data/test679 index 2c739eebf3b5..59dfab61355d 100644 --- a/tests/data/test679 +++ b/tests/data/test679 @@ -44,7 +44,7 @@ machine %HOSTIP login user1 password "with spaces and \"\n\r\t\a" # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user1:with%20spaces%20and%20"%0a%0d%09a]b64% diff --git a/tests/data/test68 b/tests/data/test68 index 3a1a1593609e..e206dc1438c3 100644 --- a/tests/data/test68 +++ b/tests/data/test68 @@ -12,41 +12,41 @@ NTLM # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 You give me wrong password -Server: Microsoft-IIS/5.0 -WWW-Authenticate: NTLM -Content-Length: 46 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 401 You give me wrong password +Server: Microsoft-IIS/5.0 +WWW-Authenticate: NTLM +Content-Length: 46 +Content-Type: text/html; charset=iso-8859-1 + Wrong password dude. Get it fixed and return. - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 401 You give me wrong password -Server: Microsoft-IIS/5.0 -WWW-Authenticate: NTLM -Content-Length: 46 -Content-Type: text/html; charset=iso-8859-1 - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 401 You give me wrong password +Server: Microsoft-IIS/5.0 +WWW-Authenticate: NTLM +Content-Length: 46 +Content-Type: text/html; charset=iso-8859-1 + Wrong password dude. Get it fixed and return. @@ -72,7 +72,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test681 b/tests/data/test681 index 1640b900d3d4..e08997f8f618 100644 --- a/tests/data/test681 +++ b/tests/data/test681 @@ -37,7 +37,7 @@ http # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test682 b/tests/data/test682 index 748c39a3b6d4..3b0709d46048 100644 --- a/tests/data/test682 +++ b/tests/data/test682 @@ -41,7 +41,7 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user1:passwd1]b64% diff --git a/tests/data/test683 b/tests/data/test683 index 4b4048a42e27..580cddb2ee5f 100644 --- a/tests/data/test683 +++ b/tests/data/test683 @@ -41,7 +41,7 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user2:passwd2]b64% diff --git a/tests/data/test684 b/tests/data/test684 index a64844b6bf36..87af6569b693 100644 --- a/tests/data/test684 +++ b/tests/data/test684 @@ -40,7 +40,7 @@ machine %HOSTIP password 5up3r53cr37 # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[:5up3r53cr37]b64% diff --git a/tests/data/test685 b/tests/data/test685 index f93fe644b1a3..c6aeb921ab3a 100644 --- a/tests/data/test685 +++ b/tests/data/test685 @@ -40,7 +40,7 @@ machine %HOSTIP password 5up3r53cr37 # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user:5up3r53cr37]b64% diff --git a/tests/data/test687 b/tests/data/test687 index 516d670be23f..124b7a44ddf8 100644 --- a/tests/data/test687 +++ b/tests/data/test687 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --xattr -o %LOGDIR/out%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test688 b/tests/data/test688 index e8e7852b2066..939751541120 100644 --- a/tests/data/test688 +++ b/tests/data/test688 @@ -47,7 +47,7 @@ basic --xattr with -O # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test689 b/tests/data/test689 index 141e92a9e6a9..a0bc35b1d70e 100644 --- a/tests/data/test689 +++ b/tests/data/test689 @@ -37,7 +37,7 @@ rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER - + OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0 CSeq: 1 User-Agent: test567 diff --git a/tests/data/test69 b/tests/data/test69 index bfd4de8c121b..2a0fa5796b79 100644 --- a/tests/data/test69 +++ b/tests/data/test69 @@ -9,61 +9,61 @@ NTLM # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic -WWW-Authenticate: Wild-and-crazy -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic +WWW-Authenticate: Wild-and-crazy +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic -WWW-Authenticate: Wild-and-crazy -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic +WWW-Authenticate: Wild-and-crazy +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -89,7 +89,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test690 b/tests/data/test690 index 6f333381c0e8..3d960b02975a 100644 --- a/tests/data/test690 +++ b/tests/data/test690 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,14 +42,14 @@ http://%HOSTIP:%HTTPPORT/ -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test691 b/tests/data/test691 index b8a9a08af3ae..7f5ddfffa811 100644 --- a/tests/data/test691 +++ b/tests/data/test691 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,14 +42,14 @@ http://%HOSTIP:%HTTPPORT/path/to/here/ -O --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /path/to/here/ HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test692 b/tests/data/test692 index e3e49a018532..d287e95f2236 100644 --- a/tests/data/test692 +++ b/tests/data/test692 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,14 +42,14 @@ http://%HOSTIP:%HTTPPORT/ -JO --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* - + -foo- diff --git a/tests/data/test693 b/tests/data/test693 index dd2b3d3ce1bc..f5454646d3ef 100644 --- a/tests/data/test693 +++ b/tests/data/test693 @@ -9,24 +9,24 @@ etag # # Server-side - -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo -ETag: W/"asdf" - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Trailer: chunky-trailer +Connection: mooo +ETag: W/"asdf" + +40 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +30 +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +21;heresatest=moooo cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data - + +0 +chunky-trailer: header data + @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-save %LOGDIR/moo/boo/etag%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test694 b/tests/data/test694 index bdb3e0440df7..64a0b10b7841 100644 --- a/tests/data/test694 +++ b/tests/data/test694 @@ -12,69 +12,69 @@ NTLM # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Negotiate -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Negotiate +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # this is returned first since we get no proxy-auth - -HTTP/1.1 401 Authorization Required -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - + +HTTP/1.1 401 Authorization Required +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + Hey you, authenticate or go away! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 200 Things are fine +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. # This is supposed to be returned when the server gets the second # request. - -HTTP/1.1 200 Things are fine -Content-Type: yeah/maybe -Content-Length: 42 - + +HTTP/1.1 200 Things are fine +Content-Type: yeah/maybe +Content-Length: 42 + Contents of that second request. Differn. - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Negotiate -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Authorization Required -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 34 - -HTTP/1.1 200 Things are fine -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 42 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Negotiate +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Authorization Required +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +Content-Length: 34 + +HTTP/1.1 200 Things are fine +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 42 + Contents of that page you requested, sir. -HTTP/1.1 200 Things are fine -Content-Type: yeah/maybe -Content-Length: 42 - +HTTP/1.1 200 Things are fine +Content-Type: yeah/maybe +Content-Length: 42 + Contents of that second request. Differn. @@ -103,7 +103,7 @@ http://%HOSTIP:%HTTPPORT/path/mine http://%HOSTIP:%HTTPPORT/path/%TESTNUMBER0010 # Verify data after the test has been "shot" - + GET /path/mine HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test696 b/tests/data/test696 index c0c316111dad..0afaa1777569 100644 --- a/tests/data/test696 +++ b/tests/data/test696 @@ -7,13 +7,13 @@ HTTP GET - -HTTP/1.1 200 OK swsclose -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -Content-Length: 6 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +Content-Length: 6 +Connection: close + -foo- @@ -38,23 +38,23 @@ http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - -HTTP/1.1 200 OK swsclose -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -Content-Length: 6 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +Content-Length: 6 +Connection: close + -foo- -HTTP/1.1 200 OK swsclose -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -Content-Length: 6 -Connection: close - +HTTP/1.1 200 OK swsclose +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +Content-Length: 6 +Connection: close + -foo- - + GET /%TESTNUMBER HTTP/1.1 Host: ninja diff --git a/tests/data/test699 b/tests/data/test699 index 9725a8dcaeb9..a79911bf3ae3 100644 --- a/tests/data/test699 +++ b/tests/data/test699 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[hej:you]b64% diff --git a/tests/data/test7 b/tests/data/test7 index 5bd0705c4127..e299d5be2c24 100644 --- a/tests/data/test7 +++ b/tests/data/test7 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b none -D %LOGDIR/heads%TESTNUMBER # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test70 b/tests/data/test70 index a4ea92b2c168..e462382a23cd 100644 --- a/tests/data/test70 +++ b/tests/data/test70 @@ -9,41 +9,41 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -69,7 +69,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test700 b/tests/data/test700 index 9a2160bbbcdc..57ee2f51df49 100644 --- a/tests/data/test700 +++ b/tests/data/test700 @@ -47,7 +47,7 @@ HTTP GET via SOCKS4 proxy # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test701 b/tests/data/test701 index dcd9d442bfdc..34c14a1f9024 100644 --- a/tests/data/test701 +++ b/tests/data/test701 @@ -47,7 +47,7 @@ HTTP GET via SOCKS5 proxy # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test708 b/tests/data/test708 index 9fd664ff45a1..6724f8f861b9 100644 --- a/tests/data/test708 +++ b/tests/data/test708 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test709 b/tests/data/test709 index 72c7aec17c02..b339d877a9c7 100644 --- a/tests/data/test709 +++ b/tests/data/test709 @@ -51,7 +51,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test710 b/tests/data/test710 index b9defa6f626e..3530d6d9b0c0 100644 --- a/tests/data/test710 +++ b/tests/data/test710 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy socks5://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test717 b/tests/data/test717 index 58e3045e5651..ca377a4bceba 100644 --- a/tests/data/test717 +++ b/tests/data/test717 @@ -55,7 +55,7 @@ proxy # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:1 User-Agent: curl/%VERSION diff --git a/tests/data/test718 b/tests/data/test718 index 95c81e1680a7..ae061d848886 100644 --- a/tests/data/test718 +++ b/tests/data/test718 @@ -14,16 +14,16 @@ HTTP proxy Digest auth # this is returned first since we get no proxy-auth - -HTTP/1.1 407 Authorization Required to proxy me swsclose -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" - + +HTTP/1.1 407 Authorization Required to proxy me swsclose +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" + - -HTTP/1.1 407 Authorization Required to proxy me swsclose -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" - + +HTTP/1.1 407 Authorization Required to proxy me swsclose +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" + @@ -47,7 +47,7 @@ http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http:// # Verify data after the test has been "shot" - + CONNECT test.remote.haxx.se.%TESTNUMBER:8990 HTTP/1.1 Host: test.remote.haxx.se.%TESTNUMBER:8990 User-Agent: curl/%VERSION diff --git a/tests/data/test719 b/tests/data/test719 index 366ea27ee458..51ae33762110 100644 --- a/tests/data/test719 +++ b/tests/data/test719 @@ -49,7 +49,7 @@ http://[2200::33]:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: [2200::33]:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test72 b/tests/data/test72 index ba7d137b2193..090720bdfddb 100644 --- a/tests/data/test72 +++ b/tests/data/test72 @@ -8,41 +8,41 @@ HTTP Digest auth # Server-side - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic realm="foothis" -WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic realm="foothis" +WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! - -HTTP/1.1 401 Authorization Required -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic realm="foothis" -WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 200 OK -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 23 - + +HTTP/1.1 401 Authorization Required +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic realm="foothis" +WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 200 OK +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 23 + This IS the real page! @@ -68,7 +68,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test720 b/tests/data/test720 index b146a2bf54f4..0495d682b512 100644 --- a/tests/data/test720 +++ b/tests/data/test720 @@ -48,7 +48,7 @@ http://12.34.56.78:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: 12.34.56.78:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test721 b/tests/data/test721 index c70d5607225d..23878f5b2f59 100644 --- a/tests/data/test721 +++ b/tests/data/test721 @@ -48,7 +48,7 @@ http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCK # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: this.is.a.host.name:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test722 b/tests/data/test722 index bff6c33e9392..44691f94c693 100644 --- a/tests/data/test722 +++ b/tests/data/test722 @@ -44,7 +44,7 @@ IPFS # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test724 b/tests/data/test724 index 85cf07d141e7..2de7c355e615 100644 --- a/tests/data/test724 +++ b/tests/data/test724 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test727 b/tests/data/test727 index 3f9a91e7d905..a12a09203927 100644 --- a/tests/data/test727 +++ b/tests/data/test727 @@ -44,7 +44,7 @@ IPNS # # Verify data after the test has been "shot" - + GET /ipns/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test728 b/tests/data/test728 index 05bcf2883357..3be19113906a 100644 --- a/tests/data/test728 +++ b/tests/data/test728 @@ -44,7 +44,7 @@ SOCKS5h with HTTP redirect to hostname too long # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test73 b/tests/data/test73 index e131ec6f0d32..7fe470df0afa 100644 --- a/tests/data/test73 +++ b/tests/data/test73 @@ -9,13 +9,13 @@ cookiejar # Server-side - -HTTP/1.1 200 OK swsclose -Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Type: text/html -Set-Cookie: IPCZQX01af0fca5c=000010008168c200d25dfc4b; path=/; domain=.NOT_DISCLOSED.se -Content-Length: 4 - + +HTTP/1.1 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Set-Cookie: IPCZQX01af0fca5c=000010008168c200d25dfc4b; path=/; domain=.NOT_DISCLOSED.se +Content-Length: 4 + boo @@ -38,7 +38,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: host.NOT_DISCLOSED.se User-Agent: curl/%VERSION diff --git a/tests/data/test730 b/tests/data/test730 index ba18888c33db..152974663238 100644 --- a/tests/data/test730 +++ b/tests/data/test730 @@ -44,7 +44,7 @@ IPFS arg gateway with path # # Verify data after the test has been "shot" - + GET /foo/bar/ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test731 b/tests/data/test731 index a2e0ee8a635a..b3358baaa4cc 100644 --- a/tests/data/test731 +++ b/tests/data/test731 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER/ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test732 b/tests/data/test732 index 3a4e0e81920d..f31e3802af13 100644 --- a/tests/data/test732 +++ b/tests/data/test732 @@ -44,7 +44,7 @@ IPFS with path # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test733 b/tests/data/test733 index e6a4693b1102..ffe058bf3486 100644 --- a/tests/data/test733 +++ b/tests/data/test733 @@ -44,7 +44,7 @@ IPFS with path and query args # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar&aaa=bbb HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test734 b/tests/data/test734 index 1545551ad093..e8d40141a3d7 100644 --- a/tests/data/test734 +++ b/tests/data/test734 @@ -44,7 +44,7 @@ IPFS with path, query args and gateway with path # # Verify data after the test has been "shot" - + GET /some/path/ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar&aaa=bbb HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test735 b/tests/data/test735 index 8d9fa156f0e2..d78c3cc99642 100644 --- a/tests/data/test735 +++ b/tests/data/test735 @@ -44,7 +44,7 @@ IPNS with path, query args and gateway with path # # Verify data after the test has been "shot" - + GET /some/path/ipns/fancy.tld/a/b?foo=bar&aaa=bbb HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test736 b/tests/data/test736 index b239b259fc71..dd8c7347b24a 100644 --- a/tests/data/test736 +++ b/tests/data/test736 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test737 b/tests/data/test737 index 0dc4b6882535..56859888d09b 100644 --- a/tests/data/test737 +++ b/tests/data/test737 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test74 b/tests/data/test74 index 31179af990d7..0d10f20587d0 100644 --- a/tests/data/test74 +++ b/tests/data/test74 @@ -50,7 +50,7 @@ HTTP, urlglob {}-retrieval and -o #[num] usage # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test740 b/tests/data/test740 index 599adece2bff..3c8108dcbd62 100644 --- a/tests/data/test740 +++ b/tests/data/test740 @@ -52,7 +52,7 @@ bar # # Verify data after the test has been "shot" - + GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test742 b/tests/data/test742 index 70720d7a498e..4cffe4d33dc6 100644 --- a/tests/data/test742 +++ b/tests/data/test742 @@ -55,7 +55,7 @@ proxy # # Verify data after the test has been "shot" - + GET / HTTP/1.1 Host: %repeat[254 x c]%:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test743 b/tests/data/test743 index fa86a1388320..76e568da7e12 100644 --- a/tests/data/test743 +++ b/tests/data/test743 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test744 b/tests/data/test744 index 704a53a448dd..f725a29c3a70 100644 --- a/tests/data/test744 +++ b/tests/data/test744 @@ -20,9 +20,9 @@ Content-Length: 9 contents - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 Mighty fine indeed @@ -62,13 +62,13 @@ proxy # # Verify data after the test has been "shot" - -CONNECT foo.host:%HTTPPORT HTTP/1.0 -Host: foo.host:%HTTPPORT -Proxy-Connection: Keep-Alive - + +CONNECT foo.host:%HTTPPORT HTTP/1.0 +Host: foo.host:%HTTPPORT +Proxy-Connection: Keep-Alive + - + GET /%TESTNUMBER HTTP/1.1 Host: foo.host:%HTTPPORT Authorization: Basic %b64[foo:baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar]b64% diff --git a/tests/data/test747 b/tests/data/test747 index 4397c7741ce7..59b8033144ee 100644 --- a/tests/data/test747 +++ b/tests/data/test747 @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test749 b/tests/data/test749 index 68439f90cba1..efd9933914b7 100644 --- a/tests/data/test749 +++ b/tests/data/test749 @@ -13,13 +13,13 @@ proxytunnel # this is returned first since we get no proxy-auth - -HTTP/1.1 400 Bad request -Connection: close - + +HTTP/1.1 400 Bad request +Connection: close + - + HTTP/1.1 400 Bad request Connection: close @@ -44,7 +44,7 @@ http://test.example --proxy http://%HOSTIP:%HTTPPORT --proxytunnel -sS # Verify data after the test has been "shot" - + CONNECT test.example:80 HTTP/1.1 Host: test.example:80 User-Agent: curl/%VERSION diff --git a/tests/data/test750 b/tests/data/test750 index 7acc8d318180..963f373a7158 100644 --- a/tests/data/test750 +++ b/tests/data/test750 @@ -40,7 +40,7 @@ http://test.example --proxy http://%HOSTIP:%HTTPPORT --proxytunnel -sS # Verify data after the test has been "shot" - + CONNECT test.example:80 HTTP/1.1 Host: test.example:80 User-Agent: curl/%VERSION diff --git a/tests/data/test752 b/tests/data/test752 index 00f14909d125..28866bc31288 100644 --- a/tests/data/test752 +++ b/tests/data/test752 @@ -11,7 +11,7 @@ HTTP GET # # Server-side - + HTTP/1.1 404 nopes Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -26,7 +26,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 404 nopes Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -58,7 +58,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -f --retry 1 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test755 b/tests/data/test755 index 0e0840be45a0..4f53105381cb 100644 --- a/tests/data/test755 +++ b/tests/data/test755 @@ -47,7 +47,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://foo.host/%TESTNUMBER HTTP/1.1 Host: foo.host Authorization: Basic %b64[foo:alone-in-the-dark]b64% diff --git a/tests/data/test756 b/tests/data/test756 index 56038a66d801..47c0f287185a 100644 --- a/tests/data/test756 +++ b/tests/data/test756 @@ -47,7 +47,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUM # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test76 b/tests/data/test76 index 2300a38d0043..0870d5ba602c 100644 --- a/tests/data/test76 +++ b/tests/data/test76 @@ -9,7 +9,7 @@ NTLM # Server-side - + HTTP/1.1 401 Authorization Required swsclose Server: Apache/1.3.27 (Darwin) PHP/4.1.2 WWW-Authenticate: Basic, Wild-and-crazy, NTLM @@ -21,7 +21,7 @@ This is not the real page # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - + HTTP/1.1 401 Now gimme that second request of crap Server: Microsoft-IIS/5.0 Content-Length: 34 @@ -33,7 +33,7 @@ This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - + HTTP/1.1 200 Things are fine in server land swsclose Server: Microsoft-IIS/5.0 Content-Type: text/html; charset=iso-8859-1 @@ -42,7 +42,7 @@ Content-Length: 32 Finally, this is the real page! - + HTTP/1.1 401 Authorization Required swsclose Server: Apache/1.3.27 (Darwin) PHP/4.1.2 WWW-Authenticate: Basic, Wild-and-crazy, NTLM @@ -85,7 +85,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test762 b/tests/data/test762 index 2d7aedcf7f49..343145b654ee 100644 --- a/tests/data/test762 +++ b/tests/data/test762 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O --remote-time --output-dir %LOGDIR # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test767 b/tests/data/test767 index 2695e3bffa6c..83d68841b010 100644 --- a/tests/data/test767 +++ b/tests/data/test767 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test768 b/tests/data/test768 index ced4353c30f4..cfa7ddd2a669 100644 --- a/tests/data/test768 +++ b/tests/data/test768 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test769 b/tests/data/test769 index 189bf95d81a8..f74a9e67ef1d 100644 --- a/tests/data/test769 +++ b/tests/data/test769 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test77 b/tests/data/test77 index bde62adce37d..beb8d904a008 100644 --- a/tests/data/test77 +++ b/tests/data/test77 @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 12:00:00 1999 GMT" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test770 b/tests/data/test770 index 89ba5b1a8052..b4a5f83672b2 100644 --- a/tests/data/test770 +++ b/tests/data/test770 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test771 b/tests/data/test771 index b57c87c88bfc..a7524b359748 100644 --- a/tests/data/test771 +++ b/tests/data/test771 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test772 b/tests/data/test772 index f3b1d954e8d9..0596c7b982c8 100644 --- a/tests/data/test772 +++ b/tests/data/test772 @@ -10,7 +10,7 @@ Location # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test773 b/tests/data/test773 index 42d28dadd30f..bb0196c40b95 100644 --- a/tests/data/test773 +++ b/tests/data/test773 @@ -10,7 +10,7 @@ Location # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 @@ -38,7 +38,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test775 b/tests/data/test775 index 6a03ad8feee4..aa016a0955fd 100644 --- a/tests/data/test775 +++ b/tests/data/test775 @@ -11,23 +11,23 @@ NTLM # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + @@ -52,7 +52,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser%repeat[1100 x A]%:testpass --nt # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test776 b/tests/data/test776 index fc4f06d6f7c0..9798a18f3a9b 100644 --- a/tests/data/test776 +++ b/tests/data/test776 @@ -10,7 +10,7 @@ flaky - + HTTP/1.1 401 Authorization Required swsclose WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAAAAAAAABAIgAAQIDBAUGBwgAAAAAAAAAAP////8wAAAAAgD3/0F%repeat[21841 x BQUF]%BQUEAAAAA Content-Length: 0 @@ -37,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u user:pass --ntlm # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test78 b/tests/data/test78 index 545adca00108..3b4d69a2230a 100644 --- a/tests/data/test78 +++ b/tests/data/test78 @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -z "dec 12 11:00:00 1999 GMT" # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test780 b/tests/data/test780 index f65f793c7d09..085b2845bd0c 100644 --- a/tests/data/test780 +++ b/tests/data/test780 @@ -10,10 +10,10 @@ HSTS # we use this as response to a CONNECT - -HTTP/1.1 200 OK -Server: fake - + +HTTP/1.1 200 OK +Server: fake + diff --git a/tests/data/test781 b/tests/data/test781 index 20db3852bc81..6423fe7e477f 100644 --- a/tests/data/test781 +++ b/tests/data/test781 @@ -10,10 +10,10 @@ HSTS # we use this as response to a CONNECT - -HTTP/1.1 200 OK -Server: fake - + +HTTP/1.1 200 OK +Server: fake + diff --git a/tests/data/test782 b/tests/data/test782 index 61b4a0b8c27e..8e1b2918c689 100644 --- a/tests/data/test782 +++ b/tests/data/test782 @@ -10,10 +10,10 @@ HSTS # we use this as response to a CONNECT - -HTTP/1.1 200 OK -Server: fake - + +HTTP/1.1 200 OK +Server: fake + diff --git a/tests/data/test783 b/tests/data/test783 index be7004ed8a0f..62ff5c23dda9 100644 --- a/tests/data/test783 +++ b/tests/data/test783 @@ -10,10 +10,10 @@ HSTS # we use this as response to a CONNECT - -HTTP/1.1 200 OK -Server: fake - + +HTTP/1.1 200 OK +Server: fake + diff --git a/tests/data/test784 b/tests/data/test784 index 845a3acfc7f4..d847a79b1f6a 100644 --- a/tests/data/test784 +++ b/tests/data/test784 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test785 b/tests/data/test785 index b3213643c5bf..370a97060e0d 100644 --- a/tests/data/test785 +++ b/tests/data/test785 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test786 b/tests/data/test786 index 10ce170e262c..e94faf472f96 100644 --- a/tests/data/test786 +++ b/tests/data/test786 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test788 b/tests/data/test788 index 544732f7adb0..c863edacc6a8 100644 --- a/tests/data/test788 +++ b/tests/data/test788 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test789 b/tests/data/test789 index ce15967a0a00..d348ad397ceb 100644 --- a/tests/data/test789 +++ b/tests/data/test789 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -45,7 +45,7 @@ On the first Monday of the month of April, 1625, the market town of Meung # # Verify data after the test has been "shot" - + POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test79 b/tests/data/test79 index 8a52c09f988b..973484004035 100644 --- a/tests/data/test79 +++ b/tests/data/test79 @@ -42,7 +42,7 @@ ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" - + GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test790 b/tests/data/test790 index 1c7827bcd71f..7e557f250b4a 100644 --- a/tests/data/test790 +++ b/tests/data/test790 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test791 b/tests/data/test791 index 6dcdc172aa34..300af27e7ab6 100644 --- a/tests/data/test791 +++ b/tests/data/test791 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test794 b/tests/data/test794 index 479f1b1be241..63d3d36ba02f 100644 --- a/tests/data/test794 +++ b/tests/data/test794 @@ -8,7 +8,7 @@ # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test796 b/tests/data/test796 index bfef4bd07df7..e87505881008 100644 --- a/tests/data/test796 +++ b/tests/data/test796 @@ -8,7 +8,7 @@ # # Server-side - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 302 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test797 b/tests/data/test797 index 5c28f3ccd70a..f1f1a1ff183b 100644 --- a/tests/data/test797 +++ b/tests/data/test797 @@ -8,7 +8,7 @@ # # Server-side - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -23,7 +23,7 @@ Funny-head: yesyes -foo- - + HTTP/1.1 200 OK Content-Length: 6 Connection: close @@ -31,7 +31,7 @@ Content-Type: text/html -bar- - + HTTP/1.1 308 OK Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test799 b/tests/data/test799 index ec6d94ca8a4f..06e50a6d9a38 100644 --- a/tests/data/test799 +++ b/tests/data/test799 @@ -14,14 +14,14 @@ SASL AUTH +LOGIN AUTH PLAIN REPLY LOGIN A002 OK LOGIN completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test8 b/tests/data/test8 index ee1263eba4f1..eaeb7656990c 100644 --- a/tests/data/test8 +++ b/tests/data/test8 @@ -88,7 +88,7 @@ cookies # Verify data after the test has been "shot" - + GET /we/want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test80 b/tests/data/test80 index c840527bf108..2e41c87a0d41 100644 --- a/tests/data/test80 +++ b/tests/data/test80 @@ -24,9 +24,9 @@ Content-Length: 9 contents - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 Mighty fine indeed @@ -63,14 +63,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.0 -Host: test.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: Basic %b64[youare:yourself]b64% -Proxy-Connection: Keep-Alive - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.0 +Host: test.%TESTNUMBER:%HTTPPORT +Proxy-Authorization: Basic %b64[youare:yourself]b64% +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: test.%TESTNUMBER:%HTTPPORT Authorization: Basic %b64[iam:myself]b64% diff --git a/tests/data/test800 b/tests/data/test800 index 11a3f877844f..35ae22ad93d9 100644 --- a/tests/data/test800 +++ b/tests/data/test800 @@ -10,14 +10,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test801 b/tests/data/test801 index 0fda1c25044e..fd3c8c5fc6e6 100644 --- a/tests/data/test801 +++ b/tests/data/test801 @@ -10,11 +10,11 @@ FETCH # # Server-side - -body - --- - yours sincerely + +body + +-- + yours sincerely diff --git a/tests/data/test802 b/tests/data/test802 index 8d93c792253b..e43ad816060f 100644 --- a/tests/data/test802 +++ b/tests/data/test802 @@ -11,11 +11,11 @@ UIDVALIDITY # # Server-side - -body - --- - yours sincerely + +body + +-- + yours sincerely diff --git a/tests/data/test804 b/tests/data/test804 index f755a262aef2..9df5decafee8 100644 --- a/tests/data/test804 +++ b/tests/data/test804 @@ -10,11 +10,11 @@ SELECT # # Server-side - -body - --- - yours sincerely + +body + +-- + yours sincerely diff --git a/tests/data/test805 b/tests/data/test805 index 8953d586805d..eadd8a4cb7b4 100644 --- a/tests/data/test805 +++ b/tests/data/test805 @@ -25,16 +25,16 @@ IMAP APPEND message imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -u user:secret - -Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar -Subject: afternoon meeting -To: joe@example.com -Message-Id: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; CHARSET=US-ASCII - -Hello Joe, do you think we can meet at 3:30 tomorrow? + +Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) +From: Fred Foobar +Subject: afternoon meeting +To: joe@example.com +Message-Id: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; CHARSET=US-ASCII + +Hello Joe, do you think we can meet at 3:30 tomorrow? diff --git a/tests/data/test806 b/tests/data/test806 index 6b7e6ff7fecc..1423c3059b73 100644 --- a/tests/data/test806 +++ b/tests/data/test806 @@ -10,10 +10,10 @@ LIST # # Server-side - -* LIST () "/" /%TESTNUMBER/blurdybloop -* LIST (\Noselect) "/" /%TESTNUMBER/foo -* LIST () "/" /%TESTNUMBER/foo/bar + +* LIST () "/" /%TESTNUMBER/blurdybloop +* LIST (\Noselect) "/" /%TESTNUMBER/foo +* LIST () "/" /%TESTNUMBER/foo/bar diff --git a/tests/data/test807 b/tests/data/test807 index 5da810591415..216170418a09 100644 --- a/tests/data/test807 +++ b/tests/data/test807 @@ -11,10 +11,10 @@ CUSTOMREQUEST # # Server-side - -* LSUB () "/" /%TESTNUMBER/blurdybloop -* LSUB (\Noselect) "/" /%TESTNUMBER/foo -* LSUB () "/" /%TESTNUMBER/foo/bar + +* LSUB () "/" /%TESTNUMBER/blurdybloop +* LSUB (\Noselect) "/" /%TESTNUMBER/foo +* LSUB () "/" /%TESTNUMBER/foo/bar diff --git a/tests/data/test808 b/tests/data/test808 index 6795143d4de4..f8c84fd380de 100644 --- a/tests/data/test808 +++ b/tests/data/test808 @@ -11,14 +11,14 @@ CUSTOMREQUEST # # Server-side - -* 17 EXISTS -* 2 RECENT -* OK [UNSEEN 8] Message 8 is first unseen -* OK [UIDVALIDITY 3857529045] UIDs valid -* OK [UIDNEXT 4392] Predicted next UID -* FLAGS (\Answered \Flagged \Deleted \Seen \Draft) -* OK [PERMANENTFLAGS ()] No permanent flags permitted + +* 17 EXISTS +* 2 RECENT +* OK [UNSEEN 8] Message 8 is first unseen +* OK [UIDVALIDITY 3857529045] UIDs valid +* OK [UIDNEXT 4392] Predicted next UID +* FLAGS (\Answered \Flagged \Deleted \Seen \Draft) +* OK [PERMANENTFLAGS ()] No permanent flags permitted diff --git a/tests/data/test809 b/tests/data/test809 index af4c8084195f..8d1a7ddaa387 100644 --- a/tests/data/test809 +++ b/tests/data/test809 @@ -11,8 +11,8 @@ CUSTOMREQUEST # # Server-side - -* STATUS %TESTNUMBER (MESSAGES 231 UIDNEXT 44292) + +* STATUS %TESTNUMBER (MESSAGES 231 UIDNEXT 44292) diff --git a/tests/data/test81 b/tests/data/test81 index 27f1247a9715..ffbb67f3d3f8 100644 --- a/tests/data/test81 +++ b/tests/data/test81 @@ -14,39 +14,39 @@ NTLM # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 407 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 407 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 407 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 407 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -73,7 +73,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy-user testuser:testpass -x http://%H # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test810 b/tests/data/test810 index af9a310f7ab5..74ec4be2a454 100644 --- a/tests/data/test810 +++ b/tests/data/test810 @@ -10,8 +10,8 @@ SEARCH # # Server-side - -* SEARCH 1 123 456 %TESTNUMBER + +* SEARCH 1 123 456 %TESTNUMBER diff --git a/tests/data/test815 b/tests/data/test815 index 57af869fa3fe..58a926c4c295 100644 --- a/tests/data/test815 +++ b/tests/data/test815 @@ -12,8 +12,8 @@ CUSTOMREQUEST # # Server-side - -* 123 FETCH (FLAGS (\Seen \Deleted)) + +* 123 FETCH (FLAGS (\Seen \Deleted)) diff --git a/tests/data/test816 b/tests/data/test816 index ff6546ec52b4..5d98f752862a 100644 --- a/tests/data/test816 +++ b/tests/data/test816 @@ -12,11 +12,11 @@ CUSTOMREQUEST # # Server-side - -* 123 FETCH (FLAGS (\Seen \Deleted)) + +* 123 FETCH (FLAGS (\Seen \Deleted)) - -* 123 EXPUNGE + +* 123 EXPUNGE diff --git a/tests/data/test818 b/tests/data/test818 index e096b13fd486..d57bc29f9a65 100644 --- a/tests/data/test818 +++ b/tests/data/test818 @@ -11,11 +11,11 @@ CUSTOMREQUEST # # Server-side - -* 22 EXPUNGE -* 23 EXISTS -* 3 RECENT -* 14 FETCH (FLAGS (\Seen \Deleted)) + +* 22 EXPUNGE +* 23 EXISTS +* 3 RECENT +* 14 FETCH (FLAGS (\Seen \Deleted)) diff --git a/tests/data/test819 b/tests/data/test819 index 81f0277c4555..259263fa3125 100644 --- a/tests/data/test819 +++ b/tests/data/test819 @@ -16,14 +16,14 @@ AUTH PLAIN REPLY AUTHENTICATE + REPLY AHVzZXIAc2VjcmV0 A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test82 b/tests/data/test82 index 6974bc3a1f4b..b3db39438bda 100644 --- a/tests/data/test82 +++ b/tests/data/test82 @@ -11,13 +11,13 @@ HTTP proxy NTLM auth # Server-side - -HTTP/1.1 407 We only deal with NTLM my friend -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 + +HTTP/1.1 407 We only deal with NTLM my friend +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 Proxy-Authenticate: NTLM - + This is not the real page either! @@ -41,7 +41,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --proxy-user testuser:testpass -x http://%H # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Proxy-Authorization: Basic %b64[testuser:testpass]b64% diff --git a/tests/data/test820 b/tests/data/test820 index e617e241bfdd..cbcc3a32da7c 100644 --- a/tests/data/test820 +++ b/tests/data/test820 @@ -16,14 +16,14 @@ REPLY AUTHENTICATE + VXNlcm5hbWU6 REPLY dXNlcg== + UGFzc3dvcmQ6 REPLY c2VjcmV0 A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test821 b/tests/data/test821 index 2b928fe1d063..df48cfbdd980 100644 --- a/tests/data/test821 +++ b/tests/data/test821 @@ -16,14 +16,14 @@ AUTH CRAM-MD5 REPLY AUTHENTICATE + PDE5NzIuOTg3NjU0MzIxQGN1cmw+ REPLY dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test822 b/tests/data/test822 index 4f4859544d14..99cc323a7c65 100644 --- a/tests/data/test822 +++ b/tests/data/test822 @@ -17,14 +17,14 @@ REPLY AUTHENTICATE + REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test823 b/tests/data/test823 index aef99f0f0baa..b249958de190 100644 --- a/tests/data/test823 +++ b/tests/data/test823 @@ -17,14 +17,14 @@ REPLY AUTHENTICATE + cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJpbWFwLzEyNy4wLjAuMSIscmVzcG9uc2U9YmU2MzgyNDkzNjJkN2FhMGUzNTM4NTA3Njc1MWFiNDgscW9wPWF1dGg= + cnNwYXV0aD04MWY5MDNlYjQ4MjNhZTkyMmRiNWYwNGNiNThjY2RlYg== REPLY A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test824 b/tests/data/test824 index b2d16dc9c860..e88245fbe8a7 100644 --- a/tests/data/test824 +++ b/tests/data/test824 @@ -16,14 +16,14 @@ AUTH XOAUTH2 REPLY AUTHENTICATE + REPLY dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test825 b/tests/data/test825 index 9f5336e3775b..39a8d317e28e 100644 --- a/tests/data/test825 +++ b/tests/data/test825 @@ -17,14 +17,14 @@ AUTH PLAIN CAPA SASL-IR REPLY AUTHENTICATE A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test826 b/tests/data/test826 index 9f49957e7da5..d137d57c9e1a 100644 --- a/tests/data/test826 +++ b/tests/data/test826 @@ -17,14 +17,14 @@ CAPA SASL-IR REPLY AUTHENTICATE + UGFzc3dvcmQ6 REPLY c2VjcmV0 A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test827 b/tests/data/test827 index 58a89015bb29..87a4963552ef 100644 --- a/tests/data/test827 +++ b/tests/data/test827 @@ -18,14 +18,14 @@ CAPA SASL-IR REPLY AUTHENTICATE + TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test828 b/tests/data/test828 index cda2e33258eb..a397fccf02d0 100644 --- a/tests/data/test828 +++ b/tests/data/test828 @@ -17,14 +17,14 @@ AUTH XOAUTH2 CAPA SASL-IR REPLY AUTHENTICATE A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test83 b/tests/data/test83 index b6e89a65fb30..4bf191e9ec47 100644 --- a/tests/data/test83 +++ b/tests/data/test83 @@ -21,9 +21,9 @@ Content-Length: 9 contents - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 Mighty fine indeed @@ -60,14 +60,14 @@ proxy # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + - + GET /we/want/that/page/%TESTNUMBER HTTP/1.1 Host: test.%TESTNUMBER:%HTTPPORT Authorization: Basic %b64[iam:my:;self]b64% diff --git a/tests/data/test833 b/tests/data/test833 index f8a204deb266..6ff9354f8ca7 100644 --- a/tests/data/test833 +++ b/tests/data/test833 @@ -20,14 +20,14 @@ REPLY * A002 NO AUTH exchange cancelled by client REPLY "AUTHENTICATE PLAIN" + REPLY AHVzZXIAc2VjcmV0 A003 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test834 b/tests/data/test834 index fdfcde883461..501768a21168 100644 --- a/tests/data/test834 +++ b/tests/data/test834 @@ -20,14 +20,14 @@ REPLY * A002 NO AUTH exchange cancelled by client REPLY "AUTHENTICATE PLAIN" + REPLY AHVzZXIAc2VjcmV0 A003 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test835 b/tests/data/test835 index b1e0f3422598..7d2aa2bac3ad 100644 --- a/tests/data/test835 +++ b/tests/data/test835 @@ -20,14 +20,14 @@ REPLY * A002 NO AUTH exchange cancelled by client REPLY "AUTHENTICATE PLAIN" + REPLY AHVzZXIAc2VjcmV0 A003 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test836 b/tests/data/test836 index cdcb0e9a9b77..14e805dcb657 100644 --- a/tests/data/test836 +++ b/tests/data/test836 @@ -12,17 +12,17 @@ connection reuse # Server-side -REPLY "LOGIN user.one secret" A002 OK LOGIN completed -REPLY "LOGIN user.two secret" B002 OK LOGIN completed +REPLY "LOGIN user.one secret" A002 OK LOGIN completed +REPLY "LOGIN user.two secret" B002 OK LOGIN completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test837 b/tests/data/test837 index b5735ea09913..ef10c571513e 100644 --- a/tests/data/test837 +++ b/tests/data/test837 @@ -16,14 +16,14 @@ AUTH EXTERNAL REPLY AUTHENTICATE + REPLY dXNlcg== A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test838 b/tests/data/test838 index bbd282289dcb..5811c019f442 100644 --- a/tests/data/test838 +++ b/tests/data/test838 @@ -16,14 +16,14 @@ AUTH EXTERNAL REPLY AUTHENTICATE + REPLY = A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test839 b/tests/data/test839 index 8350c414bf87..14a60ca22d0c 100644 --- a/tests/data/test839 +++ b/tests/data/test839 @@ -17,14 +17,14 @@ AUTH EXTERNAL CAPA SASL-IR REPLY AUTHENTICATE A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test84 b/tests/data/test84 index 9dca293375a6..b6d54a98a072 100644 --- a/tests/data/test84 +++ b/tests/data/test84 @@ -41,7 +41,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[iam:myself]b64% diff --git a/tests/data/test840 b/tests/data/test840 index 612e1119eb96..ad8a22d11aae 100644 --- a/tests/data/test840 +++ b/tests/data/test840 @@ -17,14 +17,14 @@ AUTH EXTERNAL CAPA SASL-IR REPLY AUTHENTICATE A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test841 b/tests/data/test841 index eee632f55574..321512431c59 100644 --- a/tests/data/test841 +++ b/tests/data/test841 @@ -11,20 +11,20 @@ CUSTOMREQUEST # # Server-side - -body - -+ Curl did not used to like this line --- - yours sincerely + +body + ++ Curl did not used to like this line +-- + yours sincerely - -* 123 FETCH (BODY[1] {70} -body - -+ Curl did not used to like this line --- - yours sincerely + +* 123 FETCH (BODY[1] {70} +body + ++ Curl did not used to like this line +-- + yours sincerely diff --git a/tests/data/test842 b/tests/data/test842 index e66d5b1aa6ab..cc0dcd9c0017 100644 --- a/tests/data/test842 +++ b/tests/data/test842 @@ -17,14 +17,14 @@ AUTH OAUTHBEARER REPLY AUTHENTICATE + REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test843 b/tests/data/test843 index fa8df84c8f67..934c6f7d92c5 100644 --- a/tests/data/test843 +++ b/tests/data/test843 @@ -18,14 +18,14 @@ AUTH OAUTHBEARER CAPA SASL-IR REPLY AUTHENTICATE A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test846 b/tests/data/test846 index bbbc92c51a09..0ec5313e577f 100644 --- a/tests/data/test846 +++ b/tests/data/test846 @@ -12,14 +12,14 @@ IMAP REPLY welcome * PREAUTH ready to serve already! REPLY CAPABILITY * CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ IDLE UIDPLUS NAMESPACE CHILDREN MAILBOX-REFERRALS BINARY UNSELECT ESEARCH WITHIN SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND SASL-IR LOGIN-REFERRALS STARTTLS LOGINDISABLED\r\nA001 OK CAPABILITY completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test847 b/tests/data/test847 index b78cad118926..ed6cc1089172 100644 --- a/tests/data/test847 +++ b/tests/data/test847 @@ -10,14 +10,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test848 b/tests/data/test848 index 32f589d52588..e233630d6fd1 100644 --- a/tests/data/test848 +++ b/tests/data/test848 @@ -16,14 +16,14 @@ AUTH PLAIN REPLY AUTHENTICATE + REPLY c2hhcmVkLW1haWxib3gAdXNlcgBzZWNyZXQ= A002 OK AUTHENTICATE completed - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test85 b/tests/data/test85 index ab9c2287db28..0ffb07ab27cd 100644 --- a/tests/data/test85 +++ b/tests/data/test85 @@ -44,7 +44,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/we/want/that/page/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Proxy-Authorization: Basic %b64[testing:this]b64% diff --git a/tests/data/test850 b/tests/data/test850 index c9cf2ffae6c1..dcf337977002 100644 --- a/tests/data/test850 +++ b/tests/data/test850 @@ -10,14 +10,14 @@ RETR # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test853 b/tests/data/test853 index 29c4580452dd..ecdf7dd27e38 100644 --- a/tests/data/test853 +++ b/tests/data/test853 @@ -18,10 +18,10 @@ SLOWDOWN # When doing LIST, we get the default list output hard-coded in the test # POP3 server - -1 100 -2 4294967400 -3 200 + +1 100 +2 4294967400 +3 200 diff --git a/tests/data/test857 b/tests/data/test857 index 6d1e7daddcde..7b30182bcd68 100644 --- a/tests/data/test857 +++ b/tests/data/test857 @@ -10,25 +10,25 @@ RETR # # Server-side - -From: me@somewhere -To: fake@nowhere - -..body with a single dot first -...triple dots... - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +..body with a single dot first +...triple dots... + +-- + yours sincerely - -From: me@somewhere -To: fake@nowhere - -.body with a single dot first -..triple dots... - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +.body with a single dot first +..triple dots... + +-- + yours sincerely diff --git a/tests/data/test86 b/tests/data/test86 index a0e562736f0e..ecd1f632141d 100644 --- a/tests/data/test86 +++ b/tests/data/test86 @@ -64,7 +64,7 @@ HTTP, urlglob []-retrieval and -o #[num] usage # # Verify data after the test has been "shot" - + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test861 b/tests/data/test861 index dbcee53287f6..e1806eec775a 100644 --- a/tests/data/test861 +++ b/tests/data/test861 @@ -13,14 +13,14 @@ RFC2449 # Server-side -CAPA UIDL USER +CAPA UIDL USER -# When doing UIDL, we get the default list output hard-coded in the test -# POP3 server - -1 1 -2 2 -3 4 +# When doing UIDL, we get the default list output hard-coded in the test +# POP3 server + +1 1 +2 2 +3 4 diff --git a/tests/data/test862 b/tests/data/test862 index 2484c8e98ca4..83a58fe35093 100644 --- a/tests/data/test862 +++ b/tests/data/test862 @@ -13,12 +13,12 @@ RFC2449 # Server-side -CAPA TOP USER +CAPA TOP USER - -From: me@somewhere -To: fake@nowhere - + +From: me@somewhere +To: fake@nowhere + diff --git a/tests/data/test864 b/tests/data/test864 index d2ddb8dee9fc..a21fc2517582 100644 --- a/tests/data/test864 +++ b/tests/data/test864 @@ -13,14 +13,14 @@ APOP CAPA APOP REPLY welcome +OK curl POP3 server ready to serve <1972.987654321\@curl> - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test865 b/tests/data/test865 index f88ba45ed423..0a9cd25d0130 100644 --- a/tests/data/test865 +++ b/tests/data/test865 @@ -18,14 +18,14 @@ AUTH PLAIN REPLY AUTH + REPLY AHVzZXIAc2VjcmV0 +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test866 b/tests/data/test866 index 2ea66bab3898..7d3459dfe509 100644 --- a/tests/data/test866 +++ b/tests/data/test866 @@ -18,14 +18,14 @@ REPLY AUTH + VXNlcm5hbWU6 REPLY dXNlcg== + UGFzc3dvcmQ6 REPLY c2VjcmV0 +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test867 b/tests/data/test867 index 4db0704c6443..e05b332ad757 100644 --- a/tests/data/test867 +++ b/tests/data/test867 @@ -18,14 +18,14 @@ AUTH CRAM-MD5 REPLY AUTH + PDE5NzIuOTg3NjU0MzIxQGN1cmw+ REPLY dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test868 b/tests/data/test868 index 59284154c957..c2c8aa96429a 100644 --- a/tests/data/test868 +++ b/tests/data/test868 @@ -16,17 +16,17 @@ NTLM AUTH NTLM REPLY AUTH + -REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test869 b/tests/data/test869 index 588be6f3a140..d10c6afb5322 100644 --- a/tests/data/test869 +++ b/tests/data/test869 @@ -19,14 +19,14 @@ REPLY AUTH + cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk2Zjk1NDh REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvMTI3LjAuMC4xIixyZXNwb25zZT0xODMxNTU0OGM3ZjNhMzdlNzE2ZmE4ZTkwZGZhYjliNixxb3A9YXV0aA== + cnNwYXV0aD1mZWNiMzZiNzA4NmUwYjk1ZDkwNjQ1OWVmYThjYzI5ZQ== REPLY +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test87 b/tests/data/test87 index f5d689d45d3b..6bbb35a4f00d 100644 --- a/tests/data/test87 +++ b/tests/data/test87 @@ -11,18 +11,18 @@ FAILURE # # Server-side - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 15 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 15 + the number one - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 16 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 16 + two is nice too @@ -50,11 +50,11 @@ urlglob with out of range -o #[num] usage # survives # - -HTTP/1.1 200 OK -Funny-head: yesyes -Content-Length: 16 - + +HTTP/1.1 200 OK +Funny-head: yesyes +Content-Length: 16 + two is nice too diff --git a/tests/data/test870 b/tests/data/test870 index d0870d390981..402cb69f978d 100644 --- a/tests/data/test870 +++ b/tests/data/test870 @@ -18,14 +18,14 @@ AUTH XOAUTH2 REPLY AUTH + REPLY dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test871 b/tests/data/test871 index e0afbee00138..7a2e2603d4cc 100644 --- a/tests/data/test871 +++ b/tests/data/test871 @@ -18,14 +18,14 @@ RFC5034 AUTH PLAIN REPLY AUTH +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test872 b/tests/data/test872 index 439bbf6b148c..6407a663e565 100644 --- a/tests/data/test872 +++ b/tests/data/test872 @@ -18,14 +18,14 @@ AUTH LOGIN REPLY AUTH + UGFzc3dvcmQ6 REPLY c2VjcmV0 +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test873 b/tests/data/test873 index e6ac4057d648..30a733e4efbf 100644 --- a/tests/data/test873 +++ b/tests/data/test873 @@ -19,14 +19,14 @@ AUTH NTLM REPLY AUTH + TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test874 b/tests/data/test874 index cbb1fbe137b0..40942d7965d6 100644 --- a/tests/data/test874 +++ b/tests/data/test874 @@ -18,14 +18,14 @@ RFC6749 AUTH XOAUTH2 REPLY AUTH +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test879 b/tests/data/test879 index 75aed2ba3d4f..ad37486d29e6 100644 --- a/tests/data/test879 +++ b/tests/data/test879 @@ -22,14 +22,14 @@ REPLY * -ERR AUTH exchange cancelled by client REPLY "AUTH PLAIN" + REPLY AHVzZXIAc2VjcmV0 +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test88 b/tests/data/test88 index db3eb6cd5a9c..39c2fb82e0b1 100644 --- a/tests/data/test88 +++ b/tests/data/test88 @@ -12,39 +12,39 @@ HTTP Digest auth auth_required - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This is not the real page # This is supposed to be returned when the server gets a # Authorization: Digest line passed-in from the client - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This IS the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" -Content-Type: text/html; charset=iso-8859-1 -Connection: close - -HTTP/1.1 200 OK swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -Content-Type: text/html; charset=iso-8859-1 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" +Content-Type: text/html; charset=iso-8859-1 +Connection: close + +HTTP/1.1 200 OK swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +Content-Type: text/html; charset=iso-8859-1 +Connection: close + This IS the real page! diff --git a/tests/data/test880 b/tests/data/test880 index bb92f7f296bc..d7fc29676374 100644 --- a/tests/data/test880 +++ b/tests/data/test880 @@ -22,14 +22,14 @@ REPLY * -ERR AUTH exchange cancelled by client REPLY "AUTH PLAIN" + REPLY AHVzZXIAc2VjcmV0 +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test881 b/tests/data/test881 index 16caf49a312e..7dbbd21a41be 100644 --- a/tests/data/test881 +++ b/tests/data/test881 @@ -22,14 +22,14 @@ REPLY * -ERR AUTH exchange cancelled by client REPLY "AUTH PLAIN" + REPLY AHVzZXIAc2VjcmV0 +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test882 b/tests/data/test882 index bfecd4507076..b6fecd61164c 100644 --- a/tests/data/test882 +++ b/tests/data/test882 @@ -12,16 +12,16 @@ connection reuse # Server-side -REPLY "PASS secret" +OK Login successful +REPLY "PASS secret" +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test883 b/tests/data/test883 index a82a762dc6f6..2ca23c1e7a27 100644 --- a/tests/data/test883 +++ b/tests/data/test883 @@ -18,14 +18,14 @@ AUTH EXTERNAL REPLY AUTH + REPLY dXNlcg== +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test884 b/tests/data/test884 index ebe013fe27f9..98b311c024d0 100644 --- a/tests/data/test884 +++ b/tests/data/test884 @@ -18,14 +18,14 @@ AUTH EXTERNAL REPLY AUTH + REPLY = +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test885 b/tests/data/test885 index 16c6810bcf01..ab452732d19e 100644 --- a/tests/data/test885 +++ b/tests/data/test885 @@ -18,14 +18,14 @@ RFC5034 AUTH EXTERNAL REPLY AUTH +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test886 b/tests/data/test886 index f6de7c1db11e..1c463ef829c6 100644 --- a/tests/data/test886 +++ b/tests/data/test886 @@ -18,14 +18,14 @@ RFC5034 AUTH EXTERNAL REPLY AUTH +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test887 b/tests/data/test887 index bb40d1b9ce52..5075a6fe3a5d 100644 --- a/tests/data/test887 +++ b/tests/data/test887 @@ -19,14 +19,14 @@ AUTH OAUTHBEARER REPLY AUTH + REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test888 b/tests/data/test888 index 2d89a3cf3b0b..b6e222477450 100644 --- a/tests/data/test888 +++ b/tests/data/test888 @@ -19,14 +19,14 @@ RFC7628 AUTH OAUTHBEARER REPLY AUTH +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test89 b/tests/data/test89 index f1a7a539e22c..049b2b0b698f 100644 --- a/tests/data/test89 +++ b/tests/data/test89 @@ -16,71 +16,71 @@ NTLM This is supposed to be returned when the server gets a first Authorization: NTLM line passed-in from the client --> - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 301 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Connection: close -Location: /you/%TESTNUMBER0010 - + +HTTP/1.1 301 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Connection: close +Location: /you/%TESTNUMBER0010 + # This is the first reply after the redirection - -HTTP/1.1 401 Now gimme that second round of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second round of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 301 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Connection: close -Location: /you/%TESTNUMBER0010 - -HTTP/1.1 401 Now gimme that second round of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 301 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Connection: close +Location: /you/%TESTNUMBER0010 + +HTTP/1.1 401 Now gimme that second round of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -106,7 +106,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -L # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/tests/data/test892 b/tests/data/test892 index 67f9711568cb..0b19c744e341 100644 --- a/tests/data/test892 +++ b/tests/data/test892 @@ -18,14 +18,14 @@ AUTH PLAIN REPLY AUTH + REPLY c2hhcmVkLW1haWxib3gAdXNlcgBzZWNyZXQ= +OK Login successful - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test895 b/tests/data/test895 index 79f9a9984e9d..d165572088e5 100644 --- a/tests/data/test895 +++ b/tests/data/test895 @@ -11,14 +11,14 @@ FETCH # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test897 b/tests/data/test897 index 8e59d75d1486..e7119cf34dc1 100644 --- a/tests/data/test897 +++ b/tests/data/test897 @@ -10,11 +10,11 @@ FETCH # # Server-side - -body - --- - yours sincerely + +body + +-- + yours sincerely POSTFETCH extra stuff sent in the envelope after the body @@ -45,26 +45,26 @@ A003 SELECT %TESTNUMBER A004 FETCH 123 BODY[1] A005 LOGOUT - - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ {| |___ - \___|\___/|_| \_\_____| -* OK curl IMAP server ready to serve -A001 BAD Command -A002 OK LOGIN completed -* 172 EXISTS -* 1 RECENT -* OK [UNSEEN 12] Message 12 is first unseen -* OK [UIDVALIDITY 3857529045] UIDs valid -* OK [UIDNEXT 4392] Predicted next UID -* FLAGS (\Answered \Flagged \Deleted \Seen \Draft) -* OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited -A003 OK [READ-WRITE] SELECT completed -* 123 FETCH (BODY[1] {31} -extra stuff sent in the envelope after the body) -A004 OK FETCH completed + + _ _ ____ _%spc%%spc%%spc%%spc%%spc% + ___| | | | _ \| |%spc%%spc%%spc%%spc% + / __| | | | |_) | |%spc%%spc%%spc%%spc% + | (__| |_| | _ {| |___%spc% + \___|\___/|_| \_\_____| +* OK curl IMAP server ready to serve +A001 BAD Command +A002 OK LOGIN completed +* 172 EXISTS +* 1 RECENT +* OK [UNSEEN 12] Message 12 is first unseen +* OK [UIDVALIDITY 3857529045] UIDs valid +* OK [UIDNEXT 4392] Predicted next UID +* FLAGS (\Answered \Flagged \Deleted \Seen \Draft) +* OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited +A003 OK [READ-WRITE] SELECT completed +* 123 FETCH (BODY[1] {31} +extra stuff sent in the envelope after the body) +A004 OK FETCH completed diff --git a/tests/data/test898 b/tests/data/test898 index 78213414e534..1e4211207c0c 100644 --- a/tests/data/test898 +++ b/tests/data/test898 @@ -74,7 +74,7 @@ HTTP with custom auth and cookies redirected to HTTP on a diff port # # Verify data after the test has been "shot" - + GET http://firsthost.com/ HTTP/1.1 Host: firsthost.com User-Agent: curl/%VERSION diff --git a/tests/data/test899 b/tests/data/test899 index e1d70920c2cb..cb244876cc1f 100644 --- a/tests/data/test899 +++ b/tests/data/test899 @@ -10,7 +10,7 @@ HTTP Basic auth # # Server-side - + HTTP/1.1 302 go go go Content-Length: 8 Location: http://user:pass@%HOSTIP:%HTTPPORT/basic-auth/user/%TESTNUMBER0002 @@ -19,7 +19,7 @@ Funny-head: yesyes notreal - + HTTP/1.1 200 OK Content-Length: 6 Content-Type: text/html @@ -46,7 +46,7 @@ http://first:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER -L # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[first:secret]b64% diff --git a/tests/data/test90 b/tests/data/test90 index 98c4073766c0..25b8d10555dc 100644 --- a/tests/data/test90 +++ b/tests/data/test90 @@ -12,113 +12,113 @@ NTLM # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic -WWW-Authenticate: Wild-and-crazy -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic +WWW-Authenticate: Wild-and-crazy +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 301 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Connection: close -Location: /you/%TESTNUMBER0010 - + +HTTP/1.1 301 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Connection: close +Location: /you/%TESTNUMBER0010 + # This is the first reply after the redirection - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic -WWW-Authenticate: Wild-and-crazy -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic +WWW-Authenticate: Wild-and-crazy +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + This is not the real page - -HTTP/1.1 401 Now gimme that second round of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second round of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic -WWW-Authenticate: Wild-and-crazy -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 301 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Connection: close -Location: /you/%TESTNUMBER0010 - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Basic -WWW-Authenticate: Wild-and-crazy -WWW-Authenticate: NTLM -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 26 - -HTTP/1.1 401 Now gimme that second round of crap -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 34 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic +WWW-Authenticate: Wild-and-crazy +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 301 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Connection: close +Location: /you/%TESTNUMBER0010 + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Basic +WWW-Authenticate: Wild-and-crazy +WWW-Authenticate: NTLM +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 26 + +HTTP/1.1 401 Now gimme that second round of crap +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -144,7 +144,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth -L # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test901 b/tests/data/test901 index 043f3fad49ad..7e0b7034acd4 100644 --- a/tests/data/test901 +++ b/tests/data/test901 @@ -19,17 +19,17 @@ smtp SMTP with CRLF-dot-CRLF in data - -From: different -To: another - - -. -. - -. - -body + +From: different +To: another + + +. +. + +. + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test902 b/tests/data/test902 index 809a15d03f6b..b913e4fcc8ba 100644 --- a/tests/data/test902 +++ b/tests/data/test902 @@ -24,11 +24,11 @@ smtp RFC821-only SMTP server (EHLO not supported) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test903 b/tests/data/test903 index fb2ff012787a..07c2cd3d3a79 100644 --- a/tests/data/test903 +++ b/tests/data/test903 @@ -28,8 +28,8 @@ smtp SMTP plain authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test904 b/tests/data/test904 index ee797b1600c5..1c60c28fe52f 100644 --- a/tests/data/test904 +++ b/tests/data/test904 @@ -28,8 +28,8 @@ smtp SMTP login authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test905 b/tests/data/test905 index 15114e5b5ae8..2c6f6e7c576f 100644 --- a/tests/data/test905 +++ b/tests/data/test905 @@ -32,8 +32,8 @@ digest SMTP CRAM-MD5 authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test906 b/tests/data/test906 index 5e3ea35ceb29..4b99598e3744 100644 --- a/tests/data/test906 +++ b/tests/data/test906 @@ -15,7 +15,7 @@ NTLM AUTH NTLM REPLY AUTH 334 NTLM supported -REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 334 TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 334 TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= 235 Authenticated @@ -34,8 +34,8 @@ SSL SMTP NTLM authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u testuser:testpass -T - diff --git a/tests/data/test907 b/tests/data/test907 index 3bd4612dd825..48ae320b81d3 100644 --- a/tests/data/test907 +++ b/tests/data/test907 @@ -38,8 +38,8 @@ CURL_ENTROPY=12345678 SMTP DIGEST-MD5 authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test908 b/tests/data/test908 index d1a1bdbdc72a..7bd4d5190b3b 100644 --- a/tests/data/test908 +++ b/tests/data/test908 @@ -28,8 +28,8 @@ smtp SMTP OAuth 2.0 (XOAUTH2) authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T - diff --git a/tests/data/test909 b/tests/data/test909 index 2c543fe1af74..91b720725769 100644 --- a/tests/data/test909 +++ b/tests/data/test909 @@ -19,11 +19,11 @@ smtp SMTP without SIZE support - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T %LOGDIR/test%TESTNUMBER.eml diff --git a/tests/data/test91 b/tests/data/test91 index cd15c80e1c41..cb68194ae03f 100644 --- a/tests/data/test91 +++ b/tests/data/test91 @@ -9,62 +9,62 @@ NTLM # Server-side - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Magic-Negotiate -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="daniel" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 -Connection: close - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Magic-Negotiate +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="daniel" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 +Connection: close + # This is supposed to be returned when the server gets a first # Authorization: NTLM line passed-in from the client - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + This is not the real page either! # This is supposed to be returned when the server gets the second # Authorization: NTLM line passed-in from the client - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! - -HTTP/1.1 401 Authorization Required swsclose -Server: Apache/1.3.27 (Darwin) PHP/4.1.2 -WWW-Authenticate: Magic-Negotiate -WWW-Authenticate: NTLM -WWW-Authenticate: Basic realm="daniel" -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 0 -Connection: close - -HTTP/1.1 401 Now gimme that second request of crap -Server: Microsoft-IIS/5.0 -Content-Length: 34 -Content-Type: text/html; charset=iso-8859-1 -WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -HTTP/1.1 200 Things are fine in server land swsclose -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 32 - + +HTTP/1.1 401 Authorization Required swsclose +Server: Apache/1.3.27 (Darwin) PHP/4.1.2 +WWW-Authenticate: Magic-Negotiate +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="daniel" +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 0 +Connection: close + +HTTP/1.1 401 Now gimme that second request of crap +Server: Microsoft-IIS/5.0 +Content-Length: 34 +Content-Type: text/html; charset=iso-8859-1 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== + +HTTP/1.1 200 Things are fine in server land swsclose +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + Finally, this is the real page! @@ -90,7 +90,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --anyauth -u mydomain\\myself:secret # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test910 b/tests/data/test910 index 21a3ef20447e..bc572a36ee7a 100644 --- a/tests/data/test910 +++ b/tests/data/test910 @@ -19,10 +19,10 @@ smtp SMTP without terminating CRLF - -From: different -To: another - + +From: different +To: another + body diff --git a/tests/data/test912 b/tests/data/test912 index b45d603f9d20..a5e284c7e69e 100644 --- a/tests/data/test912 +++ b/tests/data/test912 @@ -23,11 +23,11 @@ smtp SMTP with SIZE support - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T %LOGDIR/test%TESTNUMBER.eml diff --git a/tests/data/test913 b/tests/data/test913 index 81a46ca2bd65..20373cf183b2 100644 --- a/tests/data/test913 +++ b/tests/data/test913 @@ -23,11 +23,11 @@ smtp SMTP with large message SIZE - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T %LOGDIR/test%TESTNUMBER.eml diff --git a/tests/data/test914 b/tests/data/test914 index 2595dbccffe9..a4a617a8bea6 100644 --- a/tests/data/test914 +++ b/tests/data/test914 @@ -22,11 +22,11 @@ smtp SMTP invalid --mail-from - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from invalid -T %LOGDIR/test%TESTNUMBER.eml diff --git a/tests/data/test915 b/tests/data/test915 index 6b76e62f1339..5243da9003c4 100644 --- a/tests/data/test915 +++ b/tests/data/test915 @@ -19,11 +19,11 @@ smtp SMTP without --mail-from - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com -T - diff --git a/tests/data/test916 b/tests/data/test916 index 138277d580f2..9d25ccae3ddc 100644 --- a/tests/data/test916 +++ b/tests/data/test916 @@ -19,11 +19,11 @@ smtp SMTP with invalid --mail-rcpt - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt invalid --mail-from sender@example.com -T - diff --git a/tests/data/test917 b/tests/data/test917 index 8607758aa5c0..5f009c772083 100644 --- a/tests/data/test917 +++ b/tests/data/test917 @@ -19,11 +19,11 @@ smtp SMTP with multiple --mail-rcpt - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test918 b/tests/data/test918 index 54485cbb20e9..491e8be195c7 100644 --- a/tests/data/test918 +++ b/tests/data/test918 @@ -19,11 +19,11 @@ smtp SMTP with multiple and invalid --mail-rcpt - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mail-rcpt invalid --mail-rcpt recipient.three@example.com --mail-rcpt sTrAnGe --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test919 b/tests/data/test919 index 7448b8a17329..0d2ff8e1195e 100644 --- a/tests/data/test919 +++ b/tests/data/test919 @@ -28,8 +28,8 @@ smtp SMTP plain authentication with initial response - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret --sasl-ir -T - diff --git a/tests/data/test92 b/tests/data/test92 index 341f16b23044..509bfe75dd09 100644 --- a/tests/data/test92 +++ b/tests/data/test92 @@ -10,7 +10,7 @@ Resume # Server-side - + HTTP/1.1 416 Requested Range Not Satisfiable Date: Fri, 24 Oct 2003 21:33:12 GMT Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 @@ -25,7 +25,7 @@ bad # The body should be ignored. - + HTTP/1.1 416 Requested Range Not Satisfiable Date: Fri, 24 Oct 2003 21:33:12 GMT Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1 @@ -54,7 +54,7 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -C 87 # Verify data after the test has been "shot" - + GET /want/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=87- diff --git a/tests/data/test920 b/tests/data/test920 index 1445db2413d7..872038666211 100644 --- a/tests/data/test920 +++ b/tests/data/test920 @@ -28,8 +28,8 @@ smtp SMTP login authentication with initial response - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret --sasl-ir -T - diff --git a/tests/data/test921 b/tests/data/test921 index fbf338081e0d..664b98d80c9f 100644 --- a/tests/data/test921 +++ b/tests/data/test921 @@ -15,7 +15,7 @@ NTLM AUTH NTLM -REPLY AUTH 334 TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== +REPLY AUTH 334 TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= 235 Authenticated @@ -34,8 +34,8 @@ SSL SMTP NTLM authentication with initial response - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u testuser:testpass --sasl-ir -T - diff --git a/tests/data/test922 b/tests/data/test922 index 76d891296f05..a8b1e20a44e2 100644 --- a/tests/data/test922 +++ b/tests/data/test922 @@ -28,8 +28,8 @@ smtp SMTP OAuth 2.0 (XOAUTH2) authentication with initial response - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T - diff --git a/tests/data/test924 b/tests/data/test924 index 555425837061..986b4e9956ca 100644 --- a/tests/data/test924 +++ b/tests/data/test924 @@ -9,11 +9,11 @@ VRFY # # Server-side - -553-Ambiguous; Possibilities are: -553-Joe Smith -553-Harry Smith -553 Melvin Smith + +553-Ambiguous; Possibilities are: +553-Joe Smith +553-Harry Smith +553 Melvin Smith diff --git a/tests/data/test925 b/tests/data/test925 index 7640230969bc..43ef4089e673 100644 --- a/tests/data/test925 +++ b/tests/data/test925 @@ -9,8 +9,8 @@ VRFY # # Server-side - -252 Send some mail and I'll try my best + +252 Send some mail and I'll try my best diff --git a/tests/data/test926 b/tests/data/test926 index 8b76424a6f02..5aaee45e3422 100644 --- a/tests/data/test926 +++ b/tests/data/test926 @@ -10,7 +10,7 @@ VRFY # Server-side -REPLY VRFY 550 Unknown user +REPLY VRFY 550 Unknown user diff --git a/tests/data/test927 b/tests/data/test927 index f2edc050f98e..7c81632d9bea 100644 --- a/tests/data/test927 +++ b/tests/data/test927 @@ -10,10 +10,10 @@ CUSTOMREQUEST # # Server-side - -250-Joe Smith -250-Harry Smith -250 Melvin Smith + +250-Joe Smith +250-Harry Smith +250 Melvin Smith diff --git a/tests/data/test928 b/tests/data/test928 index 33ae7b7d00cb..a8f4032b4c04 100644 --- a/tests/data/test928 +++ b/tests/data/test928 @@ -9,9 +9,9 @@ HELP # # Server-side - -214-This server supports the following commands: -214 HELO EHLO RCPT DATA RSET MAIL VRFY EXPN QUIT HELP + +214-This server supports the following commands: +214 HELO EHLO RCPT DATA RSET MAIL VRFY EXPN QUIT HELP diff --git a/tests/data/test93 b/tests/data/test93 index 1d6cdcc95b9c..d7da311f1e84 100644 --- a/tests/data/test93 +++ b/tests/data/test93 @@ -39,7 +39,7 @@ proxy # # Verify data after the test has been "shot" - + GET http://%HOSTIP:%HTTPPORT/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test935 b/tests/data/test935 index dd13a6294bac..5f0dc9b0d3a0 100644 --- a/tests/data/test935 +++ b/tests/data/test935 @@ -36,8 +36,8 @@ digest SMTP CRAM-MD5 authentication with SASL downgrade - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test936 b/tests/data/test936 index f829b25e9bfb..cd0fe30e3f15 100644 --- a/tests/data/test936 +++ b/tests/data/test936 @@ -37,8 +37,8 @@ SSL SMTP NTLM authentication with SASL downgrade - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test937 b/tests/data/test937 index 8a3bfcd4b6fb..8060d8e94056 100644 --- a/tests/data/test937 +++ b/tests/data/test937 @@ -38,8 +38,8 @@ digest SMTP DIGEST-MD5 authentication with SASL downgrade - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test938 b/tests/data/test938 index af1d4c834a25..d539b7cb80d2 100644 --- a/tests/data/test938 +++ b/tests/data/test938 @@ -17,7 +17,7 @@ RFC4954 AUTH PLAIN REPLY AUTH 334 PLAIN supported REPLY dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 235 Authenticated -REPLY dXNlci50d28AdXNlci50d28Ac2VjcmV0 235 Authenticated +REPLY dXNlci50d28AdXNlci50d28Ac2VjcmV0 235 Authenticated @@ -30,8 +30,8 @@ smtp SMTP multiple connection authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER001 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.one:secret -T %LOGDIR/upload%TESTNUMBER -: smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER002 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.two:secret -T %LOGDIR/upload%TESTNUMBER diff --git a/tests/data/test939 b/tests/data/test939 index d0e284574fc6..68fc9f87c7ec 100644 --- a/tests/data/test939 +++ b/tests/data/test939 @@ -23,8 +23,8 @@ smtp RFC821-only SMTP with username and password - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test94 b/tests/data/test94 index 4840bd1f4287..6c6aeb2e82aa 100644 --- a/tests/data/test94 +++ b/tests/data/test94 @@ -45,7 +45,7 @@ https://test.anything.really.com:%TESTNUMBER --proxy1.0 %HOSTIP:%HTTPPORT 56 - + CONNECT test.anything.really.com:%TESTNUMBER HTTP/1.0 Host: test.anything.really.com:%TESTNUMBER User-Agent: curl/%VERSION diff --git a/tests/data/test940 b/tests/data/test940 index eb9d4a6fb9b2..fa64163bd945 100644 --- a/tests/data/test940 +++ b/tests/data/test940 @@ -19,8 +19,8 @@ smtp SMTP with username and password but no AUTH capability - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - diff --git a/tests/data/test942 b/tests/data/test942 index ba9b9a19eb2c..664ba4ea7d68 100644 --- a/tests/data/test942 +++ b/tests/data/test942 @@ -28,8 +28,8 @@ smtp SMTP external authentication - -mail body + +mail body 'smtp://user;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/%TESTNUMBER' --mail-rcpt recipient@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test943 b/tests/data/test943 index 426beae6e648..2003caf90404 100644 --- a/tests/data/test943 +++ b/tests/data/test943 @@ -28,8 +28,8 @@ smtp SMTP external authentication without credentials - -mail body + +mail body 'smtp://;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/%TESTNUMBER' --mail-rcpt recipient@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test944 b/tests/data/test944 index f87fb3b3e46a..a00a44e635d2 100644 --- a/tests/data/test944 +++ b/tests/data/test944 @@ -28,8 +28,8 @@ smtp SMTP external authentication with initial response - -mail body + +mail body 'smtp://user;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/%TESTNUMBER' --mail-rcpt recipient@example.com --mail-from sender@example.com --sasl-ir -T - diff --git a/tests/data/test945 b/tests/data/test945 index 239c3270d31c..5f34e31ab730 100644 --- a/tests/data/test945 +++ b/tests/data/test945 @@ -28,8 +28,8 @@ smtp SMTP external authentication with initial response without credentials - -mail body + +mail body 'smtp://;AUTH=EXTERNAL@%HOSTIP:%SMTPPORT/%TESTNUMBER' --mail-rcpt recipient@example.com --mail-from sender@example.com --sasl-ir -T - diff --git a/tests/data/test946 b/tests/data/test946 index 6c1765bec405..f463bfc4eb9a 100644 --- a/tests/data/test946 +++ b/tests/data/test946 @@ -29,8 +29,8 @@ smtp SMTP OAuth 2.0 (OAUTHBEARER) authentication - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T - diff --git a/tests/data/test947 b/tests/data/test947 index c7e4c2503757..995e54ed28ca 100644 --- a/tests/data/test947 +++ b/tests/data/test947 @@ -29,8 +29,8 @@ smtp SMTP OAuth 2.0 (OAUTHBEARER) authentication with initial response - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T - diff --git a/tests/data/test948 b/tests/data/test948 index c072b3a25c0e..5360f0650937 100644 --- a/tests/data/test948 +++ b/tests/data/test948 @@ -30,8 +30,8 @@ smtp SMTP OAuth 2.0 (OAUTHBEARER) failure as continuation - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T - diff --git a/tests/data/test949 b/tests/data/test949 index 24fdaa4e2a67..2aec4feb9bdd 100644 --- a/tests/data/test949 +++ b/tests/data/test949 @@ -30,8 +30,8 @@ smtp SMTP OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T - diff --git a/tests/data/test95 b/tests/data/test95 index c30bb2f7197d..d7e2151361fa 100644 --- a/tests/data/test95 +++ b/tests/data/test95 @@ -21,9 +21,9 @@ Content-Length: 9 contents - -HTTP/1.1 200 Mighty fine indeed - + +HTTP/1.1 200 Mighty fine indeed + HTTP/1.1 200 Mighty fine indeed @@ -60,12 +60,12 @@ proxy # # Verify data after the test has been "shot" - -CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 -Host: test.%TESTNUMBER:%HTTPPORT -User-Agent: curl/%VERSION -Proxy-Connection: Keep-Alive - + +CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1 +Host: test.%TESTNUMBER:%HTTPPORT +User-Agent: curl/%VERSION +Proxy-Connection: Keep-Alive + POST /we/want/that/page/%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test950 b/tests/data/test950 index 670cf8f7e526..6f18037370b9 100644 --- a/tests/data/test950 +++ b/tests/data/test950 @@ -10,8 +10,8 @@ VRFY # # Server-side - -250 + +250 diff --git a/tests/data/test951 b/tests/data/test951 index c703d3d6adc6..616c6cd5235e 100644 --- a/tests/data/test951 +++ b/tests/data/test951 @@ -19,8 +19,8 @@ smtp SMTP data with dot as first character - -.This first line starts with a dot + +.This first line starts with a dot smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test952 b/tests/data/test952 index e78cd3569a71..f2a90bfbbd9e 100644 --- a/tests/data/test952 +++ b/tests/data/test952 @@ -19,8 +19,8 @@ smtp SMTP data with single dot-only line - -. + +. smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test953 b/tests/data/test953 index e5a1ad8d7920..04ebe214666e 100644 --- a/tests/data/test953 +++ b/tests/data/test953 @@ -28,8 +28,8 @@ smtp SMTP plain authentication with alternative authorization identity - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u kurt:xipj3plmq --sasl-authzid ursel -T - diff --git a/tests/data/test955 b/tests/data/test955 index adb5558bc6c5..be0565842f7f 100644 --- a/tests/data/test955 +++ b/tests/data/test955 @@ -29,11 +29,11 @@ LC_ALL=C.UTF-8 SMTP without SMTPUTF8 support - UTF-8 based sender (local part only) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from Avs%hex[%c3%a4]hex%ndaren@example.com -T - diff --git a/tests/data/test956 b/tests/data/test956 index fb78275a91c3..aaae3544d071 100644 --- a/tests/data/test956 +++ b/tests/data/test956 @@ -26,11 +26,11 @@ LC_ALL=C.UTF-8 SMTP without SMTPUTF8 support - UTF-8 based recipient (local part only) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt St%hex[%c3%b6]hex%dmottagaren@example.com --mail-from sender@example.com -T - diff --git a/tests/data/test959 b/tests/data/test959 index 07736ff0a91c..3ee988c57f8e 100644 --- a/tests/data/test959 +++ b/tests/data/test959 @@ -30,11 +30,11 @@ LC_ALL=C.UTF-8 SMTP without SMTPUTF8 support - UTF-8 based sender (host part only) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@%hex[%c3%a5%c3%a4%c3%b6]hex%.se -T - diff --git a/tests/data/test960 b/tests/data/test960 index 52013ac5cf36..64d5050a30b2 100644 --- a/tests/data/test960 +++ b/tests/data/test960 @@ -27,11 +27,11 @@ LC_ALL=C.UTF-8 SMTP without SMTPUTF8 support - UTF-8 based recipient (host part only) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@%hex[%c3%a5%c3%a4%c3%b6]hex%.se --mail-from sender@example.com -T - diff --git a/tests/data/test962 b/tests/data/test962 index 4625b01138e0..59ced3bc7736 100644 --- a/tests/data/test962 +++ b/tests/data/test962 @@ -28,11 +28,11 @@ LC_ALL=C.UTF-8 SMTP without SMTPUTF8 support - UTF-8 based sender (host part only) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@%hex[%c3%a5%c3%a4%c3%b6]hex%.se -T - diff --git a/tests/data/test963 b/tests/data/test963 index 06245f608054..8b411458c6a9 100644 --- a/tests/data/test963 +++ b/tests/data/test963 @@ -28,11 +28,11 @@ LC_ALL=C.UTF-8 SMTP without SMTPUTF8 support (IDN) - UTF-8 recipient (host part only) - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@%hex[%c3%a5%c3%a4%c3%b6]hex%.se --mail-from sender@example.com -T - diff --git a/tests/data/test965 b/tests/data/test965 index 0bf35b8357ab..b4ccc70425fa 100644 --- a/tests/data/test965 +++ b/tests/data/test965 @@ -31,11 +31,11 @@ LC_ALL=C.UTF-8 SMTP with SMTPUTF8 support - UTF-8 based sender - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from Avs%hex[%c3%a4]hex%ndaren@%hex[%c3%a5%c3%a4%c3%b6]hex%.se -T - diff --git a/tests/data/test966 b/tests/data/test966 index 3a12b8bf967d..24ef5597665c 100644 --- a/tests/data/test966 +++ b/tests/data/test966 @@ -31,11 +31,11 @@ LC_ALL=C.UTF-8 SMTP with SMTPUTF8 support - UTF-8 based recipient - -From: different -To: another - -body + +From: different +To: another + +body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt St%hex[%c3%b6]hex%dmottagaren@%hex[%c3%a5%c3%a4%c3%b6]hex%.se --mail-from sender@example.com -T - diff --git a/tests/data/test967 b/tests/data/test967 index b067e9684baa..678e112cecfe 100644 --- a/tests/data/test967 +++ b/tests/data/test967 @@ -13,8 +13,8 @@ IDN CAPA SMTPUTF8 - -252 Send some mail and I'll try my best + +252 Send some mail and I'll try my best diff --git a/tests/data/test97 b/tests/data/test97 index fffb0be84073..3029b2d46f8f 100644 --- a/tests/data/test97 +++ b/tests/data/test97 @@ -9,12 +9,12 @@ HTTP replaced headers # # Server-side - -HTTP/1.0 200 OK -Server: test-server/fake -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.0 200 OK +Server: test-server/fake +Content-Type: text/html +Content-Length: 6 + blaha diff --git a/tests/data/test970 b/tests/data/test970 index 562a6c34f5a7..b5a809771064 100644 --- a/tests/data/test970 +++ b/tests/data/test970 @@ -51,7 +51,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --write-out '%{json}' -o %LOGDIR/out%TESTNU # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test972 b/tests/data/test972 index a0ba77580874..241c25bed846 100644 --- a/tests/data/test972 +++ b/tests/data/test972 @@ -52,7 +52,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -s --write-out '%{json}\n' -o %LOGDIR/out97 # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test974 b/tests/data/test974 index 04575181a3f9..db1b2c6880c1 100644 --- a/tests/data/test974 +++ b/tests/data/test974 @@ -72,7 +72,7 @@ HTTP with auth redirected to HTTP on a diff port w/o auth # # Verify data after the test has been "shot" - + GET http://firsthost.com/ HTTP/1.1 Host: firsthost.com Authorization: Basic %b64[joe:secret]b64% diff --git a/tests/data/test976 b/tests/data/test976 index 8150a90736e7..400f7b45b926 100644 --- a/tests/data/test976 +++ b/tests/data/test976 @@ -72,7 +72,7 @@ HTTP with auth redirected to HTTP on a diff port --location-trusted # # Verify data after the test has been "shot" - + GET http://firsthost.com/ HTTP/1.1 Host: firsthost.com Authorization: Basic %b64[joe:secret]b64% diff --git a/tests/data/test977 b/tests/data/test977 index 352f4a859e56..4777a514faad 100644 --- a/tests/data/test977 +++ b/tests/data/test977 @@ -44,7 +44,7 @@ URL with trailing dot and receiving a cookie for the TLD with dot # # Verify data after the test has been "shot" - + GET http://firsthost.me./ HTTP/1.1 Host: firsthost.me. User-Agent: curl/%VERSION diff --git a/tests/data/test978 b/tests/data/test978 index 810ffbb04e14..343b68137211 100644 --- a/tests/data/test978 +++ b/tests/data/test978 @@ -9,7 +9,7 @@ HTTP # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --stderr %LOGDIR/redir --silent -w '%{stder # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test979 b/tests/data/test979 index 3cfc33a7e89b..fe75d1e2972a 100644 --- a/tests/data/test979 +++ b/tests/data/test979 @@ -10,7 +10,7 @@ HTTP Basic auth # # Server-side - + HTTP/1.1 302 go go go Content-Length: 8 Location: http://%HOSTIP:%HTTPPORT/user/%TESTNUMBER0002 @@ -19,7 +19,7 @@ Funny-head: yesyes notreal - + HTTP/1.1 200 OK Content-Length: 6 Content-Type: text/html @@ -46,7 +46,7 @@ http://first:secret@%HOSTIP:%HTTPPORT/%TESTNUMBER -L -u smith:doggie # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[smith:doggie]b64% diff --git a/tests/data/test98 b/tests/data/test98 index f9ff6dd64ae1..9074b1d60b64 100644 --- a/tests/data/test98 +++ b/tests/data/test98 @@ -9,12 +9,12 @@ chunked Transfer-Encoding # # Server-side - -HTTP/1.0 200 OK -Server: test-server/fake -Content-Type: text/html -Content-Length: 6 - + +HTTP/1.0 200 OK +Server: test-server/fake +Content-Type: text/html +Content-Length: 6 + blaha diff --git a/tests/data/test987 b/tests/data/test987 index 4a0a08b4296c..312c406a70f3 100644 --- a/tests/data/test987 +++ b/tests/data/test987 @@ -20,11 +20,11 @@ smtps SMTPS with redundant explicit SSL request - -From: different -To: another - -body + +From: different +To: another + +body --insecure --ssl-reqd --mail-rcpt recipient@example.com --mail-from sender@example.com -T - smtps://%HOSTIP:%SMTPSPORT/%TESTNUMBER diff --git a/tests/data/test989 b/tests/data/test989 index dad0291dfd8b..5938cd818b15 100644 --- a/tests/data/test989 +++ b/tests/data/test989 @@ -9,14 +9,14 @@ RETR # # Server-side - -From: me@somewhere -To: fake@nowhere - -body - --- - yours sincerely + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely diff --git a/tests/data/test99 b/tests/data/test99 index e9e887df2f53..04de595ada29 100644 --- a/tests/data/test99 +++ b/tests/data/test99 @@ -55,7 +55,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 9999999999 33 - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Range: bytes=9999999999- diff --git a/tests/data/test990 b/tests/data/test990 index 5ddb57f3ddc9..194b56bd18ac 100644 --- a/tests/data/test990 +++ b/tests/data/test990 @@ -10,7 +10,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -43,7 +43,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%output{%LOGDIR/output}%{http_code}\n' # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test991 b/tests/data/test991 index 5a2cc62f30ef..8b3ac2b00daf 100644 --- a/tests/data/test991 +++ b/tests/data/test991 @@ -10,7 +10,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -46,7 +46,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%output{>>%LOGDIR/output}%{http_code}' # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test992 b/tests/data/test992 index 2a5d15181edb..772ad91e79b2 100644 --- a/tests/data/test992 +++ b/tests/data/test992 @@ -26,8 +26,8 @@ smtp SASL verify default mechanisms are reset by login options - -mail body + +mail body smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --login-options "AUTH=XOAUTH2" -T - diff --git a/tests/data/test995 b/tests/data/test995 index f2ec85ea7a8b..92bd716c7a2b 100644 --- a/tests/data/test995 +++ b/tests/data/test995 @@ -9,7 +9,7 @@ HTTP GET # # Server-side - + HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake @@ -42,7 +42,7 @@ http # # Verify data after the test has been "shot" - + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION diff --git a/tests/data/test998 b/tests/data/test998 index 88d3cb55eaa9..647eebc73217 100644 --- a/tests/data/test998 +++ b/tests/data/test998 @@ -69,7 +69,7 @@ HTTP with auth in URL redirected to another host # # Verify data after the test has been "shot" - + GET http://somewhere.example/998 HTTP/1.1 Host: somewhere.example Authorization: Basic %b64[alberto:einstein]b64% diff --git a/tests/data/test999 b/tests/data/test999 index cee697e3a29b..9731843f2dc4 100644 --- a/tests/data/test999 +++ b/tests/data/test999 @@ -59,7 +59,7 @@ HTTP with auth in first URL but not second # # Verify data after the test has been "shot" - + GET http://somewhere.example/%TESTNUMBER HTTP/1.1 Host: somewhere.example Authorization: Basic %b64[alberto:einstein]b64% diff --git a/tests/runner.pm b/tests/runner.pm index 1eef1f5b9d3f..328857e5219b 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -299,7 +299,7 @@ sub prepro { my (@entiretest) = @_; my $show = 1; my @out; - my $data_crlf; + my $data_crlf = ""; my @pshow; my @altshow; my $plvl; @@ -351,21 +351,26 @@ sub prepro { next; } if($show) { - # The processor does CRLF replacements in the sections if - # necessary since those parts might be read by separate servers. - if($s =~ /^ */) { - if($1 =~ /crlf="yes"/) { - $data_crlf = 1; + # The processor does CRLF replacements in the and + # sections if necessary since those parts might be read by separate + # servers. + if($s =~ /^ *<(data|connect)(.*)\>/) { + if($2 =~ /crlf="yes"/) { + $data_crlf = "yes"; + } + elsif($2 =~ /crlf="headers"/) { + $data_crlf = "headers"; } } - elsif(($s =~ /^ *<\/data/) && $data_crlf) { - $data_crlf = 0; + elsif(($s =~ /^ *<\/(data|connect)/) && $data_crlf ne "") { + $data_crlf = ""; } subvariables(\$s, $testnum, "%"); subbase64(\$s); subsha256base64file(\$s); substrippemfile(\$s); - subnewlines(0, \$s) if($data_crlf); + subnewlines(1, \$s) if($data_crlf eq "yes"); + subnewlines(0, \$s) if($data_crlf eq "headers"); push @out, $s; } } @@ -758,7 +763,6 @@ sub singletest_prepare { logmsg " $testnum: IGNORED: Section client=>file has no name attribute\n"; return -1; } - my $fileContent = join('', @inputfile); # make directories if needed my $path = dirname($filename); @@ -775,11 +779,15 @@ sub singletest_prepare { } if(open(my $outfile, ">", "$filename")) { binmode $outfile; # for crapage systems, use binary + if($fileattr{'nonewline'}) { # cut off the final newline - chomp($fileContent); + chomp($inputfile[-1]); + } + if($fileattr{'crlf'}) { + subnewlines(1, \$_) for @inputfile; } - print $outfile $fileContent; + print $outfile join('', @inputfile); close($outfile); } else { logmsg "ERROR: cannot write $filename\n"; @@ -947,6 +955,10 @@ sub singletest_run { chomp($stdintest[-1]); } + if($hash{'crlf'}) { + subnewlines(1, \$_) for @stdintest; + } + writearray($stdinfile, \@stdintest); $cmdargs .= " <$stdinfile"; diff --git a/tests/runtests.pl b/tests/runtests.pl index 5fd9819b1772..ac74869543e3 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1306,7 +1306,12 @@ sub singletest_check { } if($hash{'crlf'}) { - subnewlines(0, \$_) for @validstdout; + if($hash{'crlf'} eq "headers") { + subnewlines(0, \$_) for @validstdout; + } + else { + subnewlines(1, \$_) for @validstdout; + } } $res = compare($runnerid, $testnum, $testname, "stdout", \@actual, \@validstdout); @@ -1355,7 +1360,12 @@ sub singletest_check { } if($hash{'crlf'}) { - subnewlines(0, \$_) for @validstderr; + if($hash{'crlf'} eq "headers") { + subnewlines(0, \$_) for @validstderr; + } + else { + subnewlines(1, \$_) for @validstderr; + } } $res = compare($runnerid, $testnum, $testname, "stderr", \@actual, \@validstderr); @@ -1451,7 +1461,12 @@ sub singletest_check { chomp($replycheckpart[-1]); } if($replycheckpartattr{'crlf'}) { - subnewlines(0, \$_) for @replycheckpart; + if($replycheckpartattr{'crlf'} eq "headers") { + subnewlines(0, \$_) for @replycheckpart; + } + else { + subnewlines(1, \$_) for @replycheckpart; + } } push(@reply, @replycheckpart); } @@ -1472,7 +1487,12 @@ sub singletest_check { normalize_text(\@reply); } if($replyattr{'crlf'}) { - subnewlines(0, \$_) for @reply; + if($replyattr{'crlf'} eq "headers") { + subnewlines(0, \$_) for @reply; + } + else { + subnewlines(1, \$_) for @reply; + } } } @@ -1565,7 +1585,12 @@ sub singletest_check { } if($hash{'crlf'}) { - subnewlines(0, \$_) for @proxyprot; + if($hash{'crlf'} eq "headers") { + subnewlines(0, \$_) for @proxyprot; + } + else { + subnewlines(1, \$_) for @proxyprot; + } } $res = compare($runnerid, $testnum, $testname, "proxy", \@out, \@proxyprot); @@ -1623,7 +1648,12 @@ sub singletest_check { normalize_text(\@generated); } if($hash{'crlf'}) { - subnewlines(0, \$_) for @outfile; + if($hash{'crlf'} eq "headers") { + subnewlines(0, \$_) for @outfile; + } + else { + subnewlines(1, \$_) for @outfile; + } } for my $strip (@stripfilepar) { diff --git a/tests/testutil.pm b/tests/testutil.pm index cc7c2c778aa9..f139516cfa08 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -164,7 +164,7 @@ sub subnewlines { return; } - if(($$thing =~ /^HTTP\/(1.1|1.0|2|3) [1-5][^\x0d]*\z/) || + if(($$thing =~ /^HTTP\/(1.1|1.0|2|3) ([1-5]|9)[^\x0d]*\z/) || ($$thing =~ /^(GET|HEAD|POST|PUT|DELETE|CONNECT) \S+ HTTP\/\d+(\.\d+)?/) || ($$thing =~ /^(SETUP|GET_PARAMETER|OPTIONS|ANNOUNCE|DESCRIBE) \S+ RTSP\/\d+(\.\d+)?/) || (($$thing =~ /^[a-z0-9_-]+: [^\x0d]*\z/i) && From feab3901241b0eef0724b38785ece4a7b99abb0c Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Tue, 4 Nov 2025 00:15:22 +0800 Subject: [PATCH 217/885] rtsp: use explicit postfieldsize if specified Signed-off-by: Joshua Rogers Closes #19345 --- lib/rtsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rtsp.c b/lib/rtsp.c index 1f952a07cccb..95215b8d4bfa 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -298,7 +298,8 @@ static CURLcode rtsp_setup_body(struct Curl_easy *data, } else { if(data->set.postfields) { - size_t plen = strlen(data->set.postfields); + size_t plen = (data->set.postfieldsize >= 0) ? + (size_t)data->set.postfieldsize : strlen(data->set.postfields); req_clen = (curl_off_t)plen; result = Curl_creader_set_buf(data, data->set.postfields, plen); } From 5ec87346a9bfad1a24f97c378595df8b7c68bda7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Nov 2025 20:25:43 +0100 Subject: [PATCH 218/885] CURLOPT_POSTFIELDSIZE*: these also work for MQTT and RTSP Closes #19346 --- docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md | 2 ++ docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md index 5871e91d9b30..10414e7eea7b 100644 --- a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md +++ b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md @@ -9,6 +9,8 @@ See-also: - CURLOPT_POSTFIELDSIZE_LARGE (3) Protocol: - HTTP + - MQTT + - RTSP Added-in: 7.2 --- diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md index 16e874b667ed..e3d983e25338 100644 --- a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md +++ b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md @@ -10,6 +10,8 @@ See-also: - CURLOPT_POSTFIELDSIZE (3) Protocol: - HTTP + - MQTT + - RTSP Added-in: 7.11.1 --- From e5299a1b878807d58f7ae0f829f0c2992c3aa2e1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Nov 2025 14:40:36 +0100 Subject: [PATCH 219/885] README.md: use the first paragraph from the man page Which also mentions all protocols Closes #19335 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 32a3c34fb0f2..e61924673a98 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ SPDX-License-Identifier: curl # [![curl logo](https://curl.se/logo/curl-logo.svg)](https://curl.se/) -curl is a command-line tool for transferring data specified with URL syntax. +curl is a command-line tool for transferring data from or to a server using +URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, +HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, +SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + Learn how to use curl by reading [the manpage](https://curl.se/docs/manpage.html) or [everything curl](https://everything.curl.dev/). From f8e7b1377bad3ab64dd2cd80a7761b8e524dc1c1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Nov 2025 08:50:11 +0100 Subject: [PATCH 220/885] BINDINGS: change dead link to archive.org version The Hollywood binding host name www.hollywood-mal.com does not seem to work anymore. Closes #19352 --- docs/BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/BINDINGS.md b/docs/BINDINGS.md index 61652fc34f0d..b7074a22756a 100644 --- a/docs/BINDINGS.md +++ b/docs/BINDINGS.md @@ -61,7 +61,7 @@ Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang [Haskell](https://hackage.haskell.org/package/curl) Written by Galois, Inc -[Hollywood](https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn +[Hollywood](https://web.archive.org/web/20250116185836/https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn [Java](https://github.com/covers1624/curl4j) From 70a11c6f06dbe47fa6045eec00d594ed4397dbef Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Nov 2025 08:44:28 +0100 Subject: [PATCH 221/885] CURLOPT_COPYPOSTFIELDS.md: used with MQTT and RTSP as well Follow-up to 5ec87346a9bfad1a24f97c3785 Closes #19351 --- docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md b/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md index de3dd1b70b03..837fd2de1aaa 100644 --- a/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md +++ b/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md @@ -11,6 +11,8 @@ See-also: - CURLOPT_UPLOAD (3) Protocol: - HTTP + - MQTT + - RTSP Added-in: 7.17.1 --- From 0783ef2348f46cd57ce8848e5dc7008d33b70a05 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Nov 2025 11:22:32 +0100 Subject: [PATCH 222/885] tests: remove most user-agent filters Use the %VERSION instead. The user-agent stripping was introduced at the time before we had %VERSION (introduced in e6b21d4). The tests would then remove the user-agent header to make them possible to be compared in a version independent way. Fixes #19355 Reported-by: Stefan Eissing Closes #19356 --- tests/data/test1571 | 3 --- tests/data/test1572 | 3 --- tests/data/test1573 | 3 --- tests/data/test1574 | 3 --- tests/data/test1575 | 3 --- tests/data/test1576 | 3 --- tests/data/test1577 | 3 --- tests/data/test1578 | 3 --- tests/data/test1579 | 3 --- tests/data/test1580 | 3 --- tests/data/test1581 | 3 --- tests/data/test1631 | 5 ++--- tests/data/test1632 | 7 +++---- tests/data/test1933 | 1 - tests/data/test1934 | 1 - tests/data/test1935 | 1 - tests/data/test1936 | 1 - tests/data/test1937 | 1 - tests/data/test1938 | 1 - tests/data/test1955 | 1 - tests/data/test1956 | 1 - tests/data/test1957 | 1 - tests/data/test1958 | 1 - tests/data/test1959 | 1 - tests/data/test1964 | 1 - tests/data/test1970 | 1 - tests/data/test1971 | 1 - tests/data/test1972 | 1 - tests/data/test1973 | 1 - tests/data/test1974 | 1 - tests/data/test1975 | 1 - tests/data/test1976 | 2 +- tests/data/test1978 | 1 - tests/data/test545 | 3 --- tests/data/test794 | 5 ++--- tests/data/test796 | 5 ++--- tests/data/test797 | 5 ++--- 37 files changed, 12 insertions(+), 72 deletions(-) diff --git a/tests/data/test1571 b/tests/data/test1571 index 622ec5ad15c4..8a2bfb46167e 100644 --- a/tests/data/test1571 +++ b/tests/data/test1571 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1572 b/tests/data/test1572 index 36f3eef6e645..53683ed88faa 100644 --- a/tests/data/test1572 +++ b/tests/data/test1572 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1573 b/tests/data/test1573 index 62f5a0e88e59..e13522964f81 100644 --- a/tests/data/test1573 +++ b/tests/data/test1573 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1574 b/tests/data/test1574 index 501c40538956..fe4d7688c589 100644 --- a/tests/data/test1574 +++ b/tests/data/test1574 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1575 b/tests/data/test1575 index d02080b2da95..53452af2c2de 100644 --- a/tests/data/test1575 +++ b/tests/data/test1575 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1576 b/tests/data/test1576 index 8048e1329db7..fc24dd3e5e8e 100644 --- a/tests/data/test1576 +++ b/tests/data/test1576 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1577 b/tests/data/test1577 index 42d26ae46da3..eeb3119fdcfa 100644 --- a/tests/data/test1577 +++ b/tests/data/test1577 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1578 b/tests/data/test1578 index a8c9e7925a9c..b8e7c308c000 100644 --- a/tests/data/test1578 +++ b/tests/data/test1578 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1579 b/tests/data/test1579 index 309f17a8bb2a..c835eaf70ef2 100644 --- a/tests/data/test1579 +++ b/tests/data/test1579 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1580 b/tests/data/test1580 index e67164a4276f..99626c53a243 100644 --- a/tests/data/test1580 +++ b/tests/data/test1580 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1578 # Verify data after the test has been "shot" - -^User-Agent:.* - CURL /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1581 b/tests/data/test1581 index 5dac5229f432..f3f29757a215 100644 --- a/tests/data/test1581 +++ b/tests/data/test1581 @@ -75,9 +75,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test1631 b/tests/data/test1631 index 7c2f81c3ee50..6e28263b3df9 100644 --- a/tests/data/test1631 +++ b/tests/data/test1631 @@ -59,17 +59,16 @@ proxy # opens for us, so we can't compare with a known pre-existing number! s/((https.proxy):(\d+))/$2:12345/ -s/^(User-Agent: curl).*/$1/ CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 Host: ftp.site.thru.https.proxy:12345 -User-Agent: curl +User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 Host: ftp.site.thru.https.proxy:12345 -User-Agent: curl +User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive diff --git a/tests/data/test1632 b/tests/data/test1632 index 90cb56f616e4..ebf91098d5f8 100644 --- a/tests/data/test1632 +++ b/tests/data/test1632 @@ -69,22 +69,21 @@ proxy s/((https.proxy):(\d+))/$2:12345/ -s/^(User-Agent: curl).*/$1/ CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 Host: ftp.site.thru.https.proxy:12345 -User-Agent: curl +User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 Host: ftp.site.thru.https.proxy:12345 -User-Agent: curl +User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1 Host: ftp.site.thru.https.proxy:12345 -User-Agent: curl +User-Agent: curl/%VERSION Proxy-Connection: Keep-Alive diff --git a/tests/data/test1933 b/tests/data/test1933 index a26d29585cae..57706dcf92ab 100644 --- a/tests/data/test1933 +++ b/tests/data/test1933 @@ -55,7 +55,6 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1934 b/tests/data/test1934 index 9520c8193ec8..a5bead447b44 100644 --- a/tests/data/test1934 +++ b/tests/data/test1934 @@ -55,7 +55,6 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1935 b/tests/data/test1935 index 4e0f11cb4fdf..64f0c21e062a 100644 --- a/tests/data/test1935 +++ b/tests/data/test1935 @@ -55,7 +55,6 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1936 b/tests/data/test1936 index d57b8161efa3..3ee3788f2c5b 100644 --- a/tests/data/test1936 +++ b/tests/data/test1936 @@ -55,7 +55,6 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1937 b/tests/data/test1937 index 816b9c18d766..72fce57c5424 100644 --- a/tests/data/test1937 +++ b/tests/data/test1937 @@ -56,7 +56,6 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1938 b/tests/data/test1938 index e2ed9837e86f..7f719376e26f 100644 --- a/tests/data/test1938 +++ b/tests/data/test1938 @@ -56,7 +56,6 @@ http://127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%HTTPPORT # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1955 b/tests/data/test1955 index be23a9d62841..93d1422e8bf9 100644 --- a/tests/data/test1955 +++ b/tests/data/test1955 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1956 b/tests/data/test1956 index 324de3391370..b8c4710f982a 100644 --- a/tests/data/test1956 +++ b/tests/data/test1956 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1957 b/tests/data/test1957 index 5a3c914b5bc6..0036b606447e 100644 --- a/tests/data/test1957 +++ b/tests/data/test1957 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1958 b/tests/data/test1958 index 220f49aa5e8c..f5e38868c64b 100644 --- a/tests/data/test1958 +++ b/tests/data/test1958 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1959 b/tests/data/test1959 index e91a3128e886..8f43ed625c34 100644 --- a/tests/data/test1959 +++ b/tests/data/test1959 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1964 b/tests/data/test1964 index 9b7e2c968b1b..5cadbee5bc6b 100644 --- a/tests/data/test1964 +++ b/tests/data/test1964 @@ -54,7 +54,6 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1970 b/tests/data/test1970 index 43df45e31f5d..af15223599e8 100644 --- a/tests/data/test1970 +++ b/tests/data/test1970 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1971 b/tests/data/test1971 index 57cb834e9524..52320d434472 100644 --- a/tests/data/test1971 +++ b/tests/data/test1971 @@ -48,7 +48,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1972 b/tests/data/test1972 index 7b4168d119a3..d16ed4f77593 100644 --- a/tests/data/test1972 +++ b/tests/data/test1972 @@ -58,7 +58,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1973 b/tests/data/test1973 index 8b10e9ec484c..7c45ceb5d68b 100644 --- a/tests/data/test1973 +++ b/tests/data/test1973 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1974 b/tests/data/test1974 index 74213d0ab694..bac259715e21 100644 --- a/tests/data/test1974 +++ b/tests/data/test1974 @@ -55,7 +55,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1975 b/tests/data/test1975 index 92fd563da868..e5a29d293623 100644 --- a/tests/data/test1975 +++ b/tests/data/test1975 @@ -48,7 +48,6 @@ http://exam.ple.com:9000/aws_sigv4/testapi/test exam.ple.com:9000:%HOSTIP:%HTTPP # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Type:.* ^Accept:.* diff --git a/tests/data/test1976 b/tests/data/test1976 index 51e3b242b866..b573bf7deddd 100644 --- a/tests/data/test1976 +++ b/tests/data/test1976 @@ -39,7 +39,6 @@ HTTP AWS_SIGV4 canonical request header sorting test # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Length:.* ^Accept:.* @@ -53,6 +52,7 @@ Host: %HOSTIP:%HTTPPORT Authorization: AWS4-HMAC-SHA256 Credential=xxx/19700101/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-meta-test;x-amz-meta-test-two, Signature=stripped X-Amz-Date: 19700101T000000Z x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +User-Agent: curl/%VERSION X-Amz-Meta-Test-Two: test2 x-amz-meta-test: test diff --git a/tests/data/test1978 b/tests/data/test1978 index 007bbac55ce3..a6c1272d9aa1 100644 --- a/tests/data/test1978 +++ b/tests/data/test1978 @@ -42,7 +42,6 @@ http://xxx:yyy@127.0.0.1:9000/%TESTNUMBER/testapi/test 127.0.0.1:9000:%HOSTIP:%H # Verify data after the test has been "shot" -^User-Agent:.* ^Content-Length:.* ^Accept:.* diff --git a/tests/data/test545 b/tests/data/test545 index 363fe4dd7f37..99bf04685187 100644 --- a/tests/data/test545 +++ b/tests/data/test545 @@ -40,9 +40,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -^User-Agent:.* - POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/tests/data/test794 b/tests/data/test794 index 63d3d36ba02f..5fd1f76a06ef 100644 --- a/tests/data/test794 +++ b/tests/data/test794 @@ -72,18 +72,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --no-progress-meter -X IGLOO -d moo --locat # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded mooGET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test796 b/tests/data/test796 index e87505881008..b945556a4611 100644 --- a/tests/data/test796 +++ b/tests/data/test796 @@ -72,18 +72,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -X IGLOO -d moo --follow # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded mooGET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test797 b/tests/data/test797 index f1f1a1ff183b..2033829d145a 100644 --- a/tests/data/test797 +++ b/tests/data/test797 @@ -72,18 +72,17 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -X IGLOO -d moo --follow # Verify data after the test has been "shot" - -^User-Agent:.* - IGLOO /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded mooIGLOO /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded From 11683f121d42f8a18b3385d41f89d2285f90f4e6 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 4 Nov 2025 16:49:28 +0800 Subject: [PATCH 223/885] tool_ipfs: check the return value of curl_url_get for gwpath Closes #19358 --- src/tool_ipfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index 1f77dad47fcc..8e98d23242ee 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -176,7 +176,9 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, } curl_url_get(gatewayurl, CURLUPART_PORT, &gwport, CURLU_URLDECODE); - curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE); + + if(curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE)) + goto clean; /* get the path from user input */ curl_url_get(uh, CURLUPART_PATH, &inputpath, CURLU_URLDECODE); @@ -192,7 +194,6 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, if(inputpath && (inputpath[0] == '/') && !inputpath[1]) *inputpath = '\0'; - pathbuffer = curl_maprintf("%s%s%s/%s%s", gwpath, has_trailing_slash(gwpath) ? "" : "/", protocol, cid, From 913c1f28c9cc3417cd38e52eec470a0e103b4e97 Mon Sep 17 00:00:00 2001 From: Samuel Henrique Date: Tue, 4 Nov 2025 08:33:28 +0000 Subject: [PATCH 224/885] wcurl: import v2025.11.04 Closes #19353 --- docs/wcurl.md | 8 ++++---- scripts/wcurl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/wcurl.md b/docs/wcurl.md index ab5f956fc029..7d1200b2ea70 100644 --- a/docs/wcurl.md +++ b/docs/wcurl.md @@ -40,7 +40,7 @@ should be using curl directly if your use case is not covered. By default, **wcurl** does: -## * Percent-encode whitespaces in URLs; +## * Percent-encode whitespace in URLs; ## * Download multiple URLs in parallel if the installed curl's version is \>= 7.66.0 (--parallel); @@ -88,7 +88,7 @@ last value is considered. ## --no-decode-filename Don't percent-decode the output filename, even if the percent-encoding in the -URL was done by **wcurl**, e.g.: The URL contained whitespaces. +URL was done by **wcurl**, e.g.: The URL contained whitespace. ## --dry-run @@ -110,7 +110,7 @@ is instead forwarded to the curl invocation. # URL URL to be downloaded. Anything that is not a parameter is considered -an URL. Whitespaces are percent-encoded and the URL is passed to curl, which +an URL. Whitespace is percent-encoded and the URL is passed to curl, which then performs the parsing. May be specified more than once. # EXAMPLES @@ -144,7 +144,7 @@ Download multiple files without a limit of concurrent connections per host (the # REPORTING BUGS If you experience any problems with **wcurl** that you do not experience with -curl, submit an issue on Github: https://github.com/curl/wcurl +curl, submit an issue on GitHub: https://github.com/curl/wcurl # COPYRIGHT diff --git a/scripts/wcurl b/scripts/wcurl index b1a06efe584d..56c04ba9a4ee 100755 --- a/scripts/wcurl +++ b/scripts/wcurl @@ -29,7 +29,7 @@ # Stop on errors and on usage of unset variables. set -eu -VERSION="2025.09.27+dev" +VERSION="2025.11.04" PROGRAM_NAME="$(basename "$0")" readonly PROGRAM_NAME From 775add6e901e7ea16799118c9581a328031e4594 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Nov 2025 16:10:09 +0100 Subject: [PATCH 225/885] HISTORY: extend With recent events and some more in the past Closes #19361 --- docs/HISTORY.md | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/docs/HISTORY.md b/docs/HISTORY.md index 21df56f85fa2..41284d8fc611 100644 --- a/docs/HISTORY.md +++ b/docs/HISTORY.md @@ -223,6 +223,9 @@ March: security vulnerability: libcurl TFTP Packet Buffer Overflow September: The major SONAME number for libcurl was bumped to 4 due to the removal of ftp third party transfer support. +October: we started to offer the Mozilla CA cert bundle as a PEM file on the +curl website. + November: Added SCP and SFTP support 2007 @@ -326,6 +329,10 @@ April: added the cyassl backend (later renamed to wolfSSL) August: support for HTTP/2 server push + September: started "everything curl". A separate stand-alone book documenting + curl and related info in perhaps a more tutorial style rather than just a + reference, + December: Public Suffix List 2016 @@ -340,6 +347,8 @@ April: added the cyassl backend (later renamed to wolfSSL) 2017 ---- + May: Fastly starts hosting the curl website + July: OSS-Fuzz started fuzzing libcurl September: Added MultiSSL support @@ -390,6 +399,8 @@ April: added the cyassl backend (later renamed to wolfSSL) 2019 ---- + January: Daniel started working full-time on curl, employed by wolfSSL + March: added experimental alt-svc support August: the first HTTP/3 requests with curl. @@ -404,7 +415,8 @@ April: added the cyassl backend (later renamed to wolfSSL) January: added BearSSL support - March: removed support for PolarSSL, added wolfSSH support + March: removed support for PolarSSL, added wolfSSH support. Created the first + dashboard on the website. April: experimental MQTT support @@ -437,6 +449,8 @@ March: added --json, removed mesalink support The curl.se website serves 16,500 GB/month over 462M requests, the official docker image has been pulled 4,098,015,431 times. +April: added support for msh3 as another HTTP/3 backend + October: initial WebSocket support 2023 @@ -447,7 +461,8 @@ March: remove support for curl_off_t < 8 bytes March 31: we started working on a new command line tool for URL parsing and manipulations: trurl. -May: added support for HTTP/2 over HTTPS proxy. Refuse to resolve .onion. +May: added support for HTTP/2 over HTTPS proxy. Refuse to resolve .onion. The +curl GitHub repository reaches 30,000 stars. August: Dropped support for the NSS library @@ -482,5 +497,25 @@ February 5: first 0RTT for QUIC, ssl session import/export February: experimental HTTPS RR support -February 22: The website served 62.95 TB/month; 12.43 billion requests - The docker image has been pulled 6373501745 times. +February 22: The website served 62.95 TB/month; 12.43 billion requests. The +docker image has been pulled 6373501745 times. + +June: we removed support for BearSSL, Secure Transport and msh3 + +October: Daniel gets awarded a gold medal by the Swedish Royal Academy of +Engineering Sciences for his work on curl. + +We counted curl having been installed on 110 operating systems and 28 CPU +architectures. + +November: + + Public curl releases: 271 + Command line options: 273 + curl_easy_setopt() options: 308 + Public functions in libcurl: 100 + Contributors: 3534 + +We drop support for krb-ftp, Heimdal, wolfSSH and the winbuild build system. + +Add support for Apple SecTrust, native CA certs on Apple systems. From 3806fd914b7091cbf2d420bd50eb6a3005971e6e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2025 15:26:29 +0100 Subject: [PATCH 226/885] cmake: fix `HAVE_GNUTLS_SRP` detection after adding local FindGnuTLS module When GnuTLS is detected via pkg-config on a non-default path, e.g. with Homebrew arm64 (`/opt/homebrew/`). This was a regression from a commit made in this release cycle. The Find module doesn't return an absolute path to the detected library (as the former solution did), but a bare libname and a libpath. We thus need to explicitly use the libpath while detecting a feature in GnuTLS found this way. Syncing this with other dependencies. Follow-up to 1966c86d71eb90beeeb3ccbefd6321bd64992553 #19163 Closes #19360 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index da3b99cff44a..4772a6219ae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -933,6 +933,7 @@ if(CURL_USE_GNUTLS) cmake_push_check_state() list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}") + curl_required_libpaths("${GNUTLS_LIBRARY_DIRS}") check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP) cmake_pop_check_state() endif() From 8d4530537aa6223f5f7360da2dbe5a94660821ed Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 4 Nov 2025 23:27:49 +0800 Subject: [PATCH 227/885] gtls: check the return value of gnutls_pubkey_init() Closes #19362 --- lib/vtls/gtls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index c79f192e823f..40d8ad5b45e0 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1291,8 +1291,10 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, do { int ret; - /* Begin Gyrations to get the public key */ - gnutls_pubkey_init(&key); + /* Begin Gyrations to get the public key */ + ret = gnutls_pubkey_init(&key); + if(ret < 0) + break; /* failed */ ret = gnutls_pubkey_import_x509(key, cert, 0); if(ret < 0) From e5cc5640b37672bd18d7561bc45c5dd91271753a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:41:30 +0000 Subject: [PATCH 228/885] GHA: update cross-platform-actions/action action to v0.30.0 Closes #19367 --- .github/workflows/non-native.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 71829ec302bd..523a6761e6fd 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -51,7 +51,7 @@ jobs: with: persist-credentials: false - name: 'cmake' - uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0 + uses: cross-platform-actions/action@46e8d7fb25520a8d6c64fd2b7a1192611da98eda # v0.30.0 env: MATRIX_ARCH: '${{ matrix.arch }}' with: @@ -96,7 +96,7 @@ jobs: with: persist-credentials: false - name: 'cmake' - uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0 + uses: cross-platform-actions/action@46e8d7fb25520a8d6c64fd2b7a1192611da98eda # v0.30.0 env: MATRIX_ARCH: '${{ matrix.arch }}' with: @@ -146,7 +146,7 @@ jobs: with: persist-credentials: false - name: '${{ matrix.build }}' - uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0 + uses: cross-platform-actions/action@46e8d7fb25520a8d6c64fd2b7a1192611da98eda # v0.30.0 env: CC: '${{ matrix.compiler }}' MATRIX_ARCH: '${{ matrix.arch }}' From c3b890b2c005401e18b54dacf9e63d33412e2b4f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2025 21:01:32 +0100 Subject: [PATCH 229/885] GHA/non-native: bump to OpenBSD 7.8 Follow-up to e5cc5640b37672bd18d7561bc45c5dd91271753a #19367 Closes #19368 --- .github/workflows/non-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 523a6761e6fd..19ff552c912e 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -102,7 +102,7 @@ jobs: with: environment_variables: MATRIX_ARCH operating_system: 'openbsd' - version: '7.7' + version: '7.8' architecture: ${{ matrix.arch }} run: | # https://openbsd.app/ From 7872ec968f2f56aa75e713d67d6b948e268324d6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Nov 2025 07:57:10 +0100 Subject: [PATCH 230/885] THANKS: add contributors from 8.17.0 --- docs/THANKS | 34 ++++++++++++++++++++++++++++++++++ docs/THANKS-filter | 1 + 2 files changed, 35 insertions(+) diff --git a/docs/THANKS b/docs/THANKS index 97f9999b080a..fd4015468e4a 100644 --- a/docs/THANKS +++ b/docs/THANKS @@ -88,6 +88,7 @@ Alessandro Vesely Alex aka WindEagle Alexander Bartel Alexander Beedie +Alexander Blach Alexander Chuykov Alexander Dyagilev Alexander Elgert @@ -221,6 +222,7 @@ Andrew Krieger Andrew Kurushin Andrew Lambert Andrew Moise +Andrew Olsen Andrew Potter Andrew Robbins Andrew Wansink @@ -238,6 +240,7 @@ Andy Reitz Andy Serpa Andy Stamp Andy Tsouladze +And-yW on github Angus Mackay anio on github annalee @@ -411,6 +414,7 @@ Bob Richmond Bob Schader Bodo Bergmann Bogdan Nicula +BohwaZ boilingoden Boris Kuschel Boris Okunskiy @@ -636,6 +640,7 @@ Cristian Greco Cristian Morales Vega Cristian Rodríguez CueXXIII on github +curl.stunt430 Curt Bogmine Cynthia Coan Cyril B @@ -649,6 +654,7 @@ Dagfinn Ilmari Mannsåker Dagobert Michelsen Daiki Ueno Dair Grant +Dalei Dambaev Alexander Damian Dixon Damien Adant @@ -694,6 +700,7 @@ Daniel Silverstone Daniel Steinberg Daniel Stenberg Daniel Szmulewicz +Daniel Terhorst-North Daniel Theron Daniel Valenzuela Daniel Woelfel @@ -804,6 +811,7 @@ Derzsi Dániel Desmond O. Chang destman on github Detlef Schmier +Devdatta Talele devgs on github Dexter Gerig dfdity on github @@ -948,10 +956,12 @@ Emil Engler Emiliano Ida Emilio Cobos Álvarez Emilio López +Emilio Pozuelo Monfort Emil Lerner Emil Österlund Emil Romanus Emmanuel Tychon +Emre Çalışkan Enno Boland Enrico Scholz Enrik Berkhan @@ -1200,6 +1210,7 @@ Guillaume Algis Guillaume Arluison guitared on github Gunamoi Software +Gunni on github Gunter Knauf guoxinvmware on github Gustaf Hui @@ -1303,6 +1314,7 @@ IcedCoffeee on github iconoclasthero icy17 on github Ignacio Vazquez-Abrams +Ignat Loskutov Igor Franchuk Igor Khristophorov Igor Makarov @@ -1367,6 +1379,7 @@ jakirkham on github Jakob Hirsch Jakub Bochenski Jakub Jelen +Jakub Stasiak Jakub Wilk Jakub Zakrzewski James Abbatiello @@ -1503,6 +1516,7 @@ jhoyla on github Jiacai Liu Jiang Wenjian Jiawen Geng +Jicea Jie He Jiehong on github Jilayne Lovejoy @@ -1524,6 +1538,7 @@ Jishan Shaikh Jiwoo Park Jixinqi jkamp-aws on github +jmaggard10 on github jmdavitt on github jnbr on github Jocelyn Jaubert @@ -1635,6 +1650,7 @@ Jose Alf Josef Wolf José Joaquín Atria Jose Kahan +Joseph Birr-Pixton Joseph Chen Joseph Tharayil Josh Bialkowski @@ -1645,6 +1661,7 @@ Josh Kapell Josh McCullough Josh Soref Joshua Kwan +Joshua Rogers Joshua Root Joshua Swink Josie Huddleston @@ -1709,6 +1726,7 @@ Kane York Kang-Jin Lee Kang Lin Kantanat Wannapaka +kapsiR on github Kareem Kari Pahula Karl Chen @@ -1800,6 +1818,7 @@ Kristoffer Gleditsch kriztalz K. R. Walker Kuan-Wei Chiu +kuchara on github Kunal Chandarana Kunal Ekawde kupavcevdenis on github @@ -1948,6 +1967,7 @@ Maciej Puzio Maciej W. Rozycki MacKenzie madblobfish on github +madoe on github MaeIsBad on github magisterquis on hackerone Mahmoud Samir Fayed @@ -2241,6 +2261,7 @@ Mingtao Yang Miroslav Franc Miroslav Spousta Mischa Salle +Mitchell Blank Jr Mitz Wark mkzero on github modbw on github @@ -2363,6 +2384,7 @@ Ning Dong NINIKA Niracler Li Niranjan Hasabnis +Nir Azkiel Nir Soffer Nis Jorgensen nk @@ -2489,6 +2511,7 @@ Pavel Kropachev Pavel Löbl Pavel Mayorov Pavel Orehov +Pavel P Pavel Pavlov Pavel Raiskup Pavel Rochnyak @@ -2507,6 +2530,7 @@ Pedro Neves pendrek at hackerone Peng Li Peng-Yu Chen +pennae on github Per Jensen Per Lundberg Per Malmberg @@ -2586,7 +2610,9 @@ Piotr Dobrogost Piotr Komborski Piotr Nakraszewicz PleaseJustDont +plv1313 on github Po-Chuan Hsieh +Pocs Norbert Pontakorn Prasertsuk Pontus Lundkvist Pooyan McSporran @@ -2738,6 +2764,7 @@ Rider Linden Rikard Falkeborn rilysh Rinku Das +rinsuki on github rl1987 on github rmg-x on github rm-rmonaghan on github @@ -2843,6 +2870,7 @@ rzrymiak on github s0urc3_ on hackerone saimen Sai Ram Kunala +Sakthi SK Salah-Eddin Shaban Saleem Abdulrasool SaltyMilk @@ -3007,6 +3035,7 @@ sspiri on github sstruchtrup on github Stadler Stephan Stan Hu +Stanislav Fort Stanislav Ivochkin Stanislav Lange Stanislav Osipov @@ -3121,9 +3150,11 @@ Terri Oda Terry Wu thanhchungbtc on github TheAssassin on github +TheBitBrine The Infinnovation team TheKnarf on github Theo +Theo Buehler Theodore A. Roth Theodore Dubois therealhirudo on github @@ -3162,6 +3193,7 @@ Till Wegmüller Tim Ansell Tim Baker Tim Bartley +Tim Becker Tim Chen Tim Costello Tim Harder @@ -3363,6 +3395,7 @@ w0x42 on hackerone Waldek Kozba Waldemar Kornewald Walter J. Mack +WangDaLei on github wangzhikun Ward Willats Warren Menzer @@ -3499,6 +3532,7 @@ zzq1015 on github ウさん 不确定 加藤郁之 +包布丁 南宫雪珊 左潇峰 李四 diff --git a/docs/THANKS-filter b/docs/THANKS-filter index fd8722da8bcc..2adf52c9e81a 100644 --- a/docs/THANKS-filter +++ b/docs/THANKS-filter @@ -160,3 +160,4 @@ s/jethrogb$/jethrogb on github/ s/on github/on github/i s/Maksim Sciepanienka/Maksim Ściepanienka/ s/Qriist.*/Qriist on github/ +s/Viktor Szakatas/Viktor Szakats From 668737938998869c494b9431c0f820b8bcc77725 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Nov 2025 07:59:38 +0100 Subject: [PATCH 231/885] VERSIONS: 8.18.0 is now pending --- docs/VERSIONS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 35267f829484..b910374eab9c 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -69,7 +69,8 @@ dates. The tool was called `httpget` before 2.0, `urlget` before 4.0 then `curl` since 4.0. `libcurl` and `curl` are always released in sync, using the same version numbers. -- 8.17.0: pending +- 8.18.0: pending +- 8.17.0: November 5, 2025 - 8.16.0: September 10, 2025 - 8.15.0: July 16, 2025 - 8.14.1: June 4 2025 From 400fffa90f30c7a2dc762fa33009d24851bd2016 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Nov 2025 22:41:16 +0100 Subject: [PATCH 232/885] RELEASE-NOTES: synced version 8.17.0 relese --- RELEASE-NOTES | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7f536c16aeab..76e47f0f728b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.17.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3534 + Contributors: 3536 This release includes the following changes: @@ -17,7 +17,7 @@ This release includes the following changes: o ssl: support Apple SecTrust configurations [240] o tool_getparam: add --knownhosts [204] o vssh: drop support for wolfSSH [58] - o wcurl: import v2025.09.27 [182] + o wcurl: import v2025.11.04 [431] o write-out: make %header{} able to output *all* occurrences of a header [25] This release includes the following bugfixes: @@ -69,6 +69,7 @@ This release includes the following bugfixes: o cmake: build the "all" examples source list dynamically [245] o cmake: clang detection tidy-ups [116] o cmake: drop exclamation in comment looking like a name [160] + o cmake: fix `HAVE_GNUTLS_SRP` detection after adding local FindGnuTLS module [458] o cmake: fix building docs when the base directory contains .3 [18] o cmake: fix Linux pre-fill `HAVE_POSIX_STRERROR_R` (when `_CURL_PREFILL=ON`) o cmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`) [372] @@ -101,11 +102,14 @@ This release includes the following bugfixes: o curl_threads: delete WinCE fallback branch [233] o CURLINFO_FTP_ENTRY_PATH.md: this is for SFTP as well [8] o CURLOPT_COOKIEFILE.md: clarify when the cookies are loaded [159] + o CURLOPT_COPYPOSTFIELDS.md: used with MQTT and RTSP as well [457] o CURLOPT_HEADER/WRITEFUNCTION.md: drop '* size' since size is always 1 [63] o CURLOPT_MAXLIFETIME_CONN: make default 24 hours [10] + o CURLOPT_POSTFIELDSIZE*: these also work for MQTT and RTSP [395] o CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also [397] o CURLOPT_SSL_VERIFYHOST.md: add see-also to two other VERIFYHOST options [32] o CURLOPT_TIMECONDITION.md: works for FILE and FTP as well [27] + o cw-out: fix EAGAIN handling on pause [452] o cw-out: unify the error handling pattern in cw_out_do_write [414] o digest_sspi: fix two memory leaks in error branches [77] o dist: do not distribute CI.md [29] @@ -155,7 +159,9 @@ This release includes the following bugfixes: o ftp: simplify the 150/126 size scanner [288] o gnutls: check conversion of peer cert chain [275] o gnutls: fix re-handshake comments [422] + o gssapi: make channel binding conditional on GSS_C_CHANNEL_BOUND_FLAG [446] o gtls: avoid potential use of uninitialized variable in trace output [83] + o gtls: check the return value of gnutls_pubkey_init() [456] o header.md: see-also --proxy-header and vice versa [396] o hmac: free memory properly on errors [377] o hostip: don't store negative resolves due unrelated errors [256] @@ -165,6 +171,7 @@ This release includes the following bugfixes: o http2: cleanup pushed newhandle on fail [260] o http2: ingress handling edge cases [259] o HTTP3: clarify the status for "old" OpenSSL, not current [394] + o http: check the return value of strdup [437] o http: fix `-Wunreachable-code` in !websockets !unity builds [443] o http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds [442] o http: handle user-defined connection headers [165] @@ -250,6 +257,7 @@ This release includes the following bugfixes: o mime: fix unpausing of readers [375] o mime: fix use of fseek() [334] o multi.h: add CURLMINFO_LASTENTRY [51] + o multi: check the return value of strdup() [436] o multi_ev: remove unnecessary data check that confuses analysers [167] o netrc: when the cached file is discarded, unmark it as loaded [409] o nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header [227] @@ -278,6 +286,7 @@ This release includes the following bugfixes: o openssl-quic: ignore unexpected streams opened by server [176] o openssl: better return code checks when logging cert data [342] o openssl: call SSL_get_error() with proper error [207] + o openssl: check CURL_SSLVERSION_MAX_DEFAULT properly [447] o openssl: clear retry flag on x509 error [130] o openssl: combine all the x509-store flags [451] o openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs [339] @@ -307,6 +316,7 @@ This release includes the following bugfixes: o quiche: fix verbose message when ip quadruple cannot be obtained. [128] o quiche: handle tls fail correctly [266] o quiche: when ingress processing fails, return that error code [103] + o rtsp: use explicit postfieldsize if specified [401] o runtests: tag tests that require curl verbose strings [172] o rustls: exit on error [335] o rustls: fix clang-tidy warning [107] @@ -410,6 +420,7 @@ This release includes the following bugfixes: o tool_getparam: always disable "lib-ids" for tracing [169] o tool_getparam: make --fail and --fail-with-body override each other [293] o tool_getparam: warn if provided header looks malformed [179] + o tool_ipfs: check the return value of curl_url_get for gwpath [453] o tool_ipfs: simplify the ipfs gateway logic [337] o tool_msgs: make errorf() show if --show-error [294] o tool_operate: improve wording in retry message [37] @@ -438,6 +449,7 @@ This release includes the following bugfixes: o vquic: handling of io improvements [239] o vquic: sending non-gso packets fix for EAGAIN [265] o vtls: alpn setting, check proto parameter [134] + o vtls: check final cfilter node in find_ssl_filter [440] o vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition [387] o vtls: properly handle SSL shutdown timeout [433] o vtls: remove call to PKCS12_PBE_add() [408] @@ -484,21 +496,21 @@ advice from friends like these: Adam Light, Alexander Blach, Alice Lee Poetics, Andrei Kurushin, Andrew Kirillov, Andrew Olsen, And-yW on github, BobodevMm on github, BohwaZ, Christian Schmitz, curl.stunt430, Dalei, Dan Fandrich, Daniel Stenberg, - Daniel Terhorst-North, dependabot[bot], divinity76 on github, - Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, + Daniel Terhorst-North, dependabot[bot], Devdatta Talele, + divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, Evgeny Grin (Karlson2k), fds242 on github, Gunni on github, Harry Sintonen, Howard Chu, Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, Jicea, jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, Jonathan Cardoso Machado, Joseph Birr-Pixton, Joshua Rogers, kapsiR on github, kuchara on github, madoe on github, Marc Aldorasi, Marcel Raad, Michael Osipov, Michał Petryka, Mitchell Blank Jr, - Mohamed Daahir, Nir Azkiel, Patrick Monnerat, Pavel P, plv1313 on github, - Pocs Norbert, Ray Satiro, renovate[bot], rinsuki on github, Sakthi SK, - Samuel Dionne-Riel, Samuel Henrique, Stanislav Fort, Stefan Eissing, - Tatsuhiro Tsujikawa, TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, - Viktor Szakatas, Viktor Szakats, WangDaLei on github, Xiaoke Wang, - Yedaya Katsman, 包布丁 - (69 contributors) + Mohamed Daahir, Nir Azkiel, Patrick Monnerat, Pavel P, pennae on github, + Peter Piekarski, plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], + rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, + Sergio Durigan Junior, Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, + TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, Viktor Szakatas, + Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 + (73 contributors) References to bug reports and discussions on issues: @@ -683,7 +695,6 @@ References to bug reports and discussions on issues: [179] = https://curl.se/bug/?i=18793 [180] = https://curl.se/bug/?i=18886 [181] = https://curl.se/bug/?i=18884 - [182] = https://curl.se/bug/?i=18754 [183] = https://curl.se/bug/?i=18921 [184] = https://curl.se/bug/?i=18878 [185] = https://curl.se/bug/?i=18875 @@ -896,11 +907,13 @@ References to bug reports and discussions on issues: [392] = https://curl.se/bug/?i=19266 [393] = https://curl.se/bug/?i=19130 [394] = https://curl.se/bug/?i=19153 + [395] = https://curl.se/bug/?i=19346 [396] = https://curl.se/bug/?i=19259 [397] = https://curl.se/bug/?i=19258 [398] = https://curl.se/bug/?i=19252 [399] = https://curl.se/bug/?i=19206 [400] = https://curl.se/bug/?i=19208 + [401] = https://curl.se/bug/?i=19345 [402] = https://curl.se/bug/?i=19211 [403] = https://curl.se/bug/?i=19213 [404] = https://curl.se/bug/?i=18991 @@ -930,20 +943,31 @@ References to bug reports and discussions on issues: [428] = https://curl.se/bug/?i=19291 [429] = https://curl.se/bug/?i=19167 [430] = https://curl.se/bug/?i=19237 + [431] = https://curl.se/bug/?i=19353 [432] = https://curl.se/bug/?i=19288 [433] = https://curl.se/bug/?i=19323 [434] = https://curl.se/bug/?i=19310 [435] = https://curl.se/bug/?i=19301 + [436] = https://curl.se/bug/?i=19344 + [437] = https://curl.se/bug/?i=19343 [438] = https://curl.se/bug/?i=19271 [439] = https://curl.se/bug/?i=19278 + [440] = https://curl.se/bug/?i=19229 [441] = https://curl.se/bug/?i=18847 [442] = https://curl.se/bug/?i=19276 [443] = https://curl.se/bug/?i=19275 [444] = https://curl.se/bug/?i=19274 [445] = https://curl.se/bug/?i=19240 + [446] = https://curl.se/bug/?i=19109 + [447] = https://curl.se/bug/?i=19340 [448] = https://curl.se/bug/?i=18983 [449] = https://curl.se/bug/?i=19148 [450] = https://curl.se/bug/?i=19304 [451] = https://curl.se/bug/?i=19306 + [452] = https://curl.se/bug/?i=19334 + [453] = https://curl.se/bug/?i=19358 [454] = https://curl.se/bug/?i=19312 [455] = https://curl.se/bug/?i=19309 + [456] = https://curl.se/bug/?i=19362 + [457] = https://curl.se/bug/?i=19351 + [458] = https://curl.se/bug/?i=19360 From a39ff61a7bbccd237c0aeae43db68b2a9ff6fd94 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 5 Nov 2025 00:57:21 +0100 Subject: [PATCH 233/885] GHA/windows: switch a dl-mingw job to skeeto/w64devkit gcc 15.1.0 To add another, so far untested standalone toolchain variant to the mix. This distro is a fairly compact, GCC mingw-w64. Replacing an existing 15.0.1 snapshot toolchain build job. Ref: https://github.com/skeeto/w64devkit/releases Closes #19369 --- .github/workflows/windows.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1090857fe2bf..145d4813af40 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -418,14 +418,16 @@ jobs: matrix: include: - name: 'schannel' # mingw-w64 12.0 - dir: 'mingw64' + sys: 'mingw64' + dir: 'w64devkit' env: 'x86_64' - ver: '15.0.1' - url: 'https://github.com/brechtsanders/winlibs_mingw/releases/download/15.0.1-snapshot20250406posix-12.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-15.0.1-snapshot20250406-mingw-w64ucrt-12.0.0-r1.7z' + ver: '15.1.0' + url: 'https://github.com/skeeto/w64devkit/releases/download/v2.2.0/w64devkit-x64-2.2.0.7z.exe' config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF' type: 'Release' tflags: 'skiprun' - name: 'schannel' # mingw-w64 10.0 + sys: 'mingw64' dir: 'mingw64' env: 'x86_64' ver: '9.5.0' @@ -433,6 +435,7 @@ jobs: config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF' type: 'Release' - name: 'schannel mbedtls U' # mingw-w64 6.0 + sys: 'mingw64' dir: 'mingw64' env: 'x86_64' ver: '7.3.0' @@ -442,6 +445,7 @@ jobs: type: 'Release' tflags: 'skiprun' - name: 'schannel !unity' # mingw-w64 5.0 + sys: 'mingw32' dir: 'mingw32' env: 'i686' ver: '6.4.0' @@ -450,6 +454,7 @@ jobs: type: 'Debug' tflags: 'skiprun' - name: 'schannel !examples' # mingw-w64 3.0 + sys: 'mingw64' dir: 'mingw64' env: 'x86_64' ver: '4.8.1' @@ -461,7 +466,7 @@ jobs: steps: - uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0 with: - msystem: ${{ matrix.dir }} + msystem: ${{ matrix.sys }} release: false update: false cache: false From 8d00e28136baf661455f1fe5980a0d18c4d872e3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 5 Nov 2025 10:18:32 +0100 Subject: [PATCH 234/885] GHA/non-native: revert to OpenBSD 7.7 due to test hangs with 7.8 test 701 (SOCKS5) and 708 (SOCKS4) started hanging occasionally, and most likely others too. https://github.com/curl/curl/actions/runs/19081279902/job/54510279013 (701 hangs) https://github.com/curl/curl/actions/runs/19095657593/job/54555001348?pr=19370 (708 hangs) https://github.com/curl/curl/actions/runs/19097996671/job/54562669865?pr=19371 (unknown test hangs) Reverts c3b890b2c005401e18b54dacf9e63d33412e2b4f #19368 Closes #19372 --- .github/workflows/non-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 19ff552c912e..523a6761e6fd 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -102,7 +102,7 @@ jobs: with: environment_variables: MATRIX_ARCH operating_system: 'openbsd' - version: '7.8' + version: '7.7' architecture: ${{ matrix.arch }} run: | # https://openbsd.app/ From 2e770b33e883ee34c45b4e29a9e4134f2629f938 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Wed, 5 Nov 2025 10:10:03 +0100 Subject: [PATCH 235/885] m4/sectrust: fix test(1) operator '=' is the operator defined by POSIX, only bash supports '==' Closes #19371 --- m4/curl-apple-sectrust.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/curl-apple-sectrust.m4 b/m4/curl-apple-sectrust.m4 index 7ed2aa1e5bff..d42fe860a5fa 100644 --- a/m4/curl-apple-sectrust.m4 +++ b/m4/curl-apple-sectrust.m4 @@ -41,10 +41,10 @@ if test "x$OPT_APPLE_SECTRUST" = xyes; then ],[ build_for_apple="no" ]) - if test "x$build_for_apple" == "xno"; then + if test "x$build_for_apple" = "xno"; then AC_MSG_ERROR([Apple SecTrust can only be enabled for Apple OS targets]) fi - if test "x$OPENSSL_ENABLED" == "x1" -o "x$GNUTLS_ENABLED" == "x1"; then + if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_APPLE_SECTRUST, 1, [enable Apple OS certificate validation]) APPLE_SECTRUST_ENABLED=1 From dd71f61ea224e135b7ac3e16c8c83b2ca7d01b15 Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 5 Nov 2025 15:28:56 +0800 Subject: [PATCH 236/885] lib: cleanup for some typos about spaces and code style Closes #19370 --- lib/asyn-base.c | 2 -- lib/asyn-thrdd.c | 2 +- lib/cf-h1-proxy.c | 4 ++-- lib/cf-h2-proxy.c | 5 ++--- lib/cf-ip-happy.c | 2 +- lib/conncache.c | 2 +- lib/curl_addrinfo.c | 2 +- lib/curl_fnmatch.c | 2 +- lib/curl_gssapi.c | 3 ++- lib/curl_ntlm_core.c | 8 ++++---- lib/curl_sasl.c | 4 ++-- lib/curl_sha512_256.c | 3 +-- lib/cw-out.c | 2 +- lib/doh.c | 10 +++++----- lib/escape.c | 2 +- lib/formdata.c | 4 ++-- lib/ftp.c | 3 --- lib/http.c | 2 +- lib/http1.c | 4 ++-- lib/http2.c | 6 +++--- lib/http_aws_sigv4.c | 4 ++-- lib/httpsrr.c | 2 +- lib/mime.c | 1 - lib/multi.c | 2 +- lib/openldap.c | 1 - lib/parsedate.c | 2 +- lib/pingpong.c | 2 +- lib/request.c | 4 ++-- lib/setopt.c | 3 +-- lib/smtp.c | 2 +- lib/socks.c | 2 +- lib/socks_gssapi.c | 1 - lib/socks_sspi.c | 5 ++--- lib/tftp.c | 2 +- lib/url.c | 1 - lib/vauth/spnego_sspi.c | 1 - lib/vquic/curl_ngtcp2.c | 3 ++- lib/vquic/curl_osslq.c | 3 ++- lib/vquic/curl_quiche.c | 1 - lib/vquic/vquic.c | 1 - lib/vssh/libssh.c | 2 -- lib/vssh/libssh2.c | 4 ++-- lib/vtls/gtls.c | 4 ++-- lib/vtls/mbedtls.c | 1 - lib/vtls/rustls.c | 6 ++++-- lib/vtls/schannel.c | 1 - lib/vtls/vtls.c | 2 +- lib/vtls/wolfssl.c | 2 +- lib/vtls/x509asn1.c | 2 +- lib/ws.c | 1 - packages/vms/curl_crtl_init.c | 7 +++---- src/tool_operate.c | 1 - src/tool_progress.c | 1 - 53 files changed, 65 insertions(+), 84 deletions(-) diff --git a/lib/asyn-base.c b/lib/asyn-base.c index eb2240b816c9..a49e1752a57a 100644 --- a/lib/asyn-base.c +++ b/lib/asyn-base.c @@ -77,8 +77,6 @@ * * Returns: sockets-in-use-bitmap */ - - CURLcode Curl_ares_pollset(struct Curl_easy *data, ares_channel channel, struct easy_pollset *ps) diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index da83cca87a76..b25745ee1b3b 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -666,7 +666,7 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, /* Start at 1ms poll interval */ thrdd->addr->poll_interval = 1; else if(elapsed >= thrdd->addr->interval_end) - /* Back-off exponentially if last interval expired */ + /* Back-off exponentially if last interval expired */ thrdd->addr->poll_interval *= 2; if(thrdd->addr->poll_interval > 250) diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index e65aa74ddb87..f46cc09616b6 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -126,7 +126,7 @@ static CURLcode tunnel_init(struct Curl_cfilter *cf, curlx_dyn_init(&ts->request_data, DYN_HTTP_REQUEST); Curl_httpchunk_init(data, &ts->ch, TRUE); - *pts = ts; + *pts = ts; connkeep(cf->conn, "HTTP proxy CONNECT"); return tunnel_reinit(cf, data, ts); } @@ -350,7 +350,7 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) && !ISDIGIT(header[12])) { /* store the HTTP code from the proxy */ - data->info.httpproxycode = k->httpcode = (header[9] - '0') * 100 + + data->info.httpproxycode = k->httpcode = (header[9] - '0') * 100 + (header[10] - '0') * 10 + (header[11] - '0'); } return result; diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index 8baa227aac22..f9bd827374fa 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -365,7 +365,6 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf, goto out; } - /* all set, traffic will be send on connect */ result = CURLE_OK; @@ -468,8 +467,8 @@ static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf, /* Receive data from the "lower" filters, e.g. network until * it is time to stop or we have enough data for this stream */ - while(!ctx->conn_closed && /* not closed the connection */ - !ctx->tunnel.closed && /* nor the tunnel */ + while(!ctx->conn_closed && /* not closed the connection */ + !ctx->tunnel.closed && /* nor the tunnel */ Curl_bufq_is_empty(&ctx->inbufq) && /* and we consumed our input */ !Curl_bufq_is_full(&ctx->tunnel.recvbuf)) { diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 6b7130be83f5..22ae260ce047 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -237,7 +237,7 @@ static CURLcode cf_ip_attempt_connect(struct cf_ip_attempt *a, bool *connected) { *connected = a->connected; - if(!a->result && !*connected) { + if(!a->result && !*connected) { /* evaluate again */ a->result = Curl_conn_cf_connect(a->cf, data, connected); diff --git a/lib/conncache.c b/lib/conncache.c index 5c4bc357cc7a..d5770ef9164c 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -375,7 +375,7 @@ int Curl_cpool_check_limits(struct Curl_easy *data, bundle = cpool_find_bundle(cpool, conn); live = bundle ? Curl_llist_count(&bundle->conns) : 0; shutdowns = Curl_cshutdn_dest_count(data, conn->destination); - while((live + shutdowns) >= dest_limit) { + while((live + shutdowns) >= dest_limit) { if(shutdowns) { /* close one connection in shutdown right away, if we can */ if(!Curl_cshutdn_close_oldest(data, conn->destination)) diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index e26ee656bda4..fc26bef8333d 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -68,7 +68,7 @@ */ #if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \ - defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__) + defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__) /* workaround icc 9.1 optimizer issue */ # define vqualifier volatile #else diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c index 66b9739f3c03..3148c472e299 100644 --- a/lib/curl_fnmatch.c +++ b/lib/curl_fnmatch.c @@ -243,7 +243,7 @@ static int setcharset(const unsigned char **p, unsigned char *charset) case CURLFNM_SCHS_RIGHTBRLEFTBR: if(c == ']') return SETCHARSET_OK; - state = CURLFNM_SCHS_DEFAULT; + state = CURLFNM_SCHS_DEFAULT; charset[c] = 1; (*p)++; break; diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index 74128559c172..947bb9c00631 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -392,7 +392,8 @@ OM_uint32 Curl_gss_delete_sec_context(OM_uint32 *min, #define GSS_LOG_BUFFER_LEN 1024 static size_t display_gss_error(OM_uint32 status, int type, - char *buf, size_t len) { + char *buf, size_t len) +{ OM_uint32 maj_stat; OM_uint32 min_stat; OM_uint32 msg_ctx = 0; diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index 9c5e8047795b..28ae16d187a5 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -650,10 +650,10 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, * * Returns CURLE_OK on success. */ -CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash, - unsigned char *challenge_client, - unsigned char *challenge_server, - unsigned char *lmresp) +CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash, + unsigned char *challenge_client, + unsigned char *challenge_server, + unsigned char *lmresp) { unsigned char data[16]; unsigned char hmac_output[16]; diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 043786f73fa1..b04e9582689d 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -932,10 +932,10 @@ CURLcode Curl_sasl_is_blocked(struct SASL *sasl, struct Curl_easy *data) CURL_SASL_DIGEST, TRUE, NULL); sasl_unchosen(data, SASL_MECH_NTLM, enabledmechs, CURL_SASL_NTLM, Curl_auth_is_ntlm_supported(), NULL); - sasl_unchosen(data, SASL_MECH_OAUTHBEARER, enabledmechs, TRUE, TRUE, + sasl_unchosen(data, SASL_MECH_OAUTHBEARER, enabledmechs, TRUE, TRUE, data->set.str[STRING_BEARER] ? NULL : "CURLOPT_XOAUTH2_BEARER"); - sasl_unchosen(data, SASL_MECH_XOAUTH2, enabledmechs, TRUE, TRUE, + sasl_unchosen(data, SASL_MECH_XOAUTH2, enabledmechs, TRUE, TRUE, data->set.str[STRING_BEARER] ? NULL : "CURLOPT_XOAUTH2_BEARER"); } diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index 7e9b223387e0..0d2cd3c3f966 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -344,7 +344,7 @@ static CURL_FORCEINLINE curl_uint64_t Curl_rotr64(curl_uint64_t value, * Size of the SHA-512/256 resulting digest in words. * This is the final digest size, not intermediate hash. */ -#define SHA512_256_DIGEST_SIZE_WORDS (SHA512_256_HASH_SIZE_WORDS / 2) +#define SHA512_256_DIGEST_SIZE_WORDS (SHA512_256_HASH_SIZE_WORDS / 2) /** * Size of the SHA-512/256 resulting digest in bytes @@ -760,7 +760,6 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) #endif /* Local SHA-512/256 code */ - /** * Compute SHA-512/256 hash for the given data in one function call * @param[out] output the pointer to put the hash diff --git a/lib/cw-out.c b/lib/cw-out.c index 9c0a36e7e5e2..36cfc36aca04 100644 --- a/lib/cw-out.c +++ b/lib/cw-out.c @@ -252,7 +252,7 @@ static CURLcode cw_out_ptr_flush(struct cw_out_ctx *ctx, size_t wlen, nwritten; CURLcode result; - /* If we errored once, we do not invoke the client callback again */ + /* If we errored once, we do not invoke the client callback again */ if(ctx->errored) return CURLE_WRITE_ERROR; diff --git a/lib/doh.c b/lib/doh.c index ec97bd73336b..3552cba7b554 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -79,7 +79,7 @@ static const char *doh_strerror(DOHcode code) UNITTEST DOHcode doh_req_encode(const char *host, DNStype dnstype, unsigned char *dnsp, /* buffer */ - size_t len, /* buffer size */ + size_t len, /* buffer size */ size_t *olen) /* output length */ { const size_t hostlen = strlen(host); @@ -158,9 +158,9 @@ UNITTEST DOHcode doh_req_encode(const char *host, *dnsp++ = 0; /* append zero-length label for root */ - /* There are assigned TYPE codes beyond 255: use range [1..65535] */ + /* There are assigned TYPE codes beyond 255: use range [1..65535] */ *dnsp++ = (unsigned char)(255 & (dnstype >> 8)); /* upper 8 bit TYPE */ - *dnsp++ = (unsigned char)(255 & dnstype); /* lower 8 bit TYPE */ + *dnsp++ = (unsigned char)(255 & dnstype); /* lower 8 bit TYPE */ *dnsp++ = '\0'; /* upper 8 bit CLASS */ *dnsp++ = DNS_CLASS_IN; /* IN - "the Internet" */ @@ -677,7 +677,7 @@ static DOHcode doh_rdata(const unsigned char *doh, struct dohentry *d) { /* RDATA - - A (TYPE 1): 4 bytes + - A (TYPE 1): 4 bytes - AAAA (TYPE 28): 16 bytes - NS (TYPE 2): N bytes - HTTPS (TYPE 65): N bytes */ @@ -707,7 +707,7 @@ static DOHcode doh_rdata(const unsigned char *doh, return rc; break; case CURL_DNS_TYPE_DNAME: - /* explicit for clarity; just skip; rely on synthesized CNAME */ + /* explicit for clarity; just skip; rely on synthesized CNAME */ break; default: /* unsupported type, just skip it */ diff --git a/lib/escape.c b/lib/escape.c index 2064f4d05fb3..fdc6e438ab3e 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -23,7 +23,7 @@ ***************************************************************************/ /* Escape and unescape URL encoding in strings. The functions return a new - * allocated string or NULL if an error occurred. */ + * allocated string or NULL if an error occurred. */ #include "curl_setup.h" diff --git a/lib/formdata.c b/lib/formdata.c index 74a73028cd8c..416bcad4f57d 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -289,7 +289,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | HTTPPOST_CALLBACK)) && form->value) { /* copy value (without strdup; possibly contains null characters) */ - size_t clen = (size_t) form->contentslength; + size_t clen = (size_t) form->contentslength; if(!clen) clen = strlen(form->value) + 1; @@ -547,7 +547,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, retval = CURL_FORMADD_OPTION_TWICE; else { if(!array_state) - avalue = va_arg(params, char *); + avalue = va_arg(params, char *); if(avalue) { curr->userp = avalue; curr->value = avalue; /* this is not strictly true but we derive a diff --git a/lib/ftp.c b/lib/ftp.c index 4858ae230f14..819fab462b93 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1115,7 +1115,6 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, port++; } - /* get the name again after the bind() so that we can extract the port number it uses now */ sslen = sizeof(ss); @@ -1976,7 +1975,6 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, goto error; } - /* * When this is used from the multi interface, this might've returned with * the 'connected' set to FALSE and thus we are now awaiting a non-blocking @@ -2488,7 +2486,6 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, data->req.size = -1; /* default unknown size */ - /* * It appears that there are FTP-servers that return size 0 for files when * SIZE is used on the file while being in BINARY mode. To work around diff --git a/lib/http.c b/lib/http.c index 529c3c907d60..f3cf228bf274 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4081,7 +4081,7 @@ static CURLcode http_on_response(struct Curl_easy *data, k->download_done = TRUE; /* If max download size is *zero* (nothing) we already have - nothing and can safely return ok now! But for HTTP/2, we would + nothing and can safely return ok now! But for HTTP/2, we would like to call http2_handle_stream_close to properly close a stream. In order to do this, we keep reading until we close the stream. */ diff --git a/lib/http1.c b/lib/http1.c index 098dd7cd64f8..0403e95ba20b 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -84,7 +84,7 @@ static ssize_t detect_line(struct h1_req_parser *parser, const char *buf, const size_t buflen, CURLcode *err) { - const char *line_end; + const char *line_end; DEBUGASSERT(!parser->line); line_end = memchr(buf, '\n', buflen); @@ -136,7 +136,7 @@ static ssize_t next_line(struct h1_req_parser *parser, static CURLcode start_req(struct h1_req_parser *parser, const char *scheme_default, int options) { - const char *p, *m, *target, *hv, *scheme, *authority, *path; + const char *p, *m, *target, *hv, *scheme, *authority, *path; size_t m_len, target_len, hv_len, scheme_len, authority_len, path_len; size_t i; CURLU *url = NULL; diff --git a/lib/http2.c b/lib/http2.c index 36bfd6103339..de1113c1e45f 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -796,7 +796,7 @@ static ssize_t send_callback(nghttp2_session *h2, ctx->nw_out_blocked = 1; return NGHTTP2_ERR_WOULDBLOCK; } - return (nwritten > SSIZE_MAX) ? + return (nwritten > SSIZE_MAX) ? NGHTTP2_ERR_CALLBACK_FAILURE : (ssize_t)nwritten; } @@ -2558,7 +2558,7 @@ static CURLcode cf_h2_connect(struct Curl_cfilter *cf, } /* Send out our SETTINGS and ACKs and such. If that blocks, we - * have it buffered and can count this filter as being connected */ + * have it buffered and can count this filter as being connected */ result = h2_progress_egress(cf, data); if(result && (result != CURLE_AGAIN)) goto out; @@ -2945,7 +2945,7 @@ CURLcode Curl_http2_upgrade(struct Curl_easy *data, struct cf_h2_ctx *ctx; CURLcode result; - DEBUGASSERT(Curl_conn_http_version(data, conn) < 20); + DEBUGASSERT(Curl_conn_http_version(data, conn) < 20); result = http2_cfilter_add(&cf, data, conn, sockindex, TRUE); if(result) diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index bb88a0f8ce7b..b5601f45a2cb 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -274,7 +274,6 @@ static CURLcode make_headers(struct Curl_easy *data, } } - if(*content_sha256_header) { tmp_head = curl_slist_append(head, content_sha256_header); if(!tmp_head) @@ -412,7 +411,8 @@ static CURLcode make_headers(struct Curl_easy *data, static const char *parse_content_sha_hdr(struct Curl_easy *data, const char *provider1, size_t plen, - size_t *value_len) { + size_t *value_len) +{ char key[CONTENT_SHA256_KEY_LEN]; size_t key_len; const char *value; diff --git a/lib/httpsrr.c b/lib/httpsrr.c index f0d7ea14f141..c0392d16c451 100644 --- a/lib/httpsrr.c +++ b/lib/httpsrr.c @@ -167,7 +167,7 @@ static CURLcode httpsrr_opt(struct Curl_easy *data, unsigned short code; size_t len = 0; - code = ares_dns_rr_get_opt(rr, key, idx, &val, &len); + code = ares_dns_rr_get_opt(rr, key, idx, &val, &len); return Curl_httpsrr_set(data, hinfo, code, val, len); } diff --git a/lib/mime.c b/lib/mime.c index 0a56b07bc51b..b1f432c0b044 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -1966,7 +1966,6 @@ static CURLcode cr_mime_read(struct Curl_easy *data, size_t nread; char tmp[256]; - /* Once we have errored, we will return the same error forever */ if(ctx->errored) { CURL_TRC_READ(data, "cr_mime_read(len=%zu) is errored -> %d, eos=0", diff --git a/lib/multi.c b/lib/multi.c index c27e8bdad8b3..efc240b4facc 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2584,7 +2584,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, DEBUGASSERT(data->conn); if(data->conn->bits.multiplex) /* Check if we can move pending requests to send pipe */ - process_pending_handles(multi); /* multiplexed */ + process_pending_handles(multi); /* multiplexed */ /* Only perform the transfer if there is a good socket to work with. Having both BAD is a signal to skip immediately to DONE */ diff --git a/lib/openldap.c b/lib/openldap.c index f06587f01724..9d6174defe37 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -1235,7 +1235,6 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, break; } - if(!result) result = client_write(data, STRCONST("\n"), NULL, 0, NULL, 0); if(!result) diff --git a/lib/parsedate.c b/lib/parsedate.c index b9429db7f67b..3fa5919c0536 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -362,7 +362,7 @@ static int parsedate(const char *date, time_t *output) time_t t = 0; int wdaynum = -1; /* day of the week number, 0-6 (mon-sun) */ int monnum = -1; /* month of the year number, 0-11 */ - int mdaynum = -1; /* day of month, 1 - 31 */ + int mdaynum = -1; /* day of month, 1 - 31 */ int hournum = -1; int minnum = -1; int secnum = -1; diff --git a/lib/pingpong.c b/lib/pingpong.c index 470199a6ff84..d0959470bea5 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -284,7 +284,7 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, size_t full = curlx_dyn_len(&pp->recvbuf); /* trim off the "final" leading part */ - curlx_dyn_tail(&pp->recvbuf, full - pp->nfinal); + curlx_dyn_tail(&pp->recvbuf, full - pp->nfinal); pp->nfinal = 0; /* now gone */ } diff --git a/lib/request.c b/lib/request.c index 1fa568325bbf..9778a0c95372 100644 --- a/lib/request.c +++ b/lib/request.c @@ -64,7 +64,7 @@ CURLcode Curl_req_soft_reset(struct SingleRequest *req, req->header = FALSE; req->headerline = 0; req->headerbytecount = 0; - req->allheadercount = 0; + req->allheadercount = 0; req->deductheadercount = 0; req->httpversion_sent = 0; req->httpversion = 0; @@ -132,7 +132,7 @@ void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data) req->writebytecount = 0; req->start = t0; req->headerbytecount = 0; - req->allheadercount = 0; + req->allheadercount = 0; req->deductheadercount = 0; req->headerline = 0; req->offset = 0; diff --git a/lib/setopt.c b/lib/setopt.c index 3c3adb06a9cb..3f385ed8a54a 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1159,7 +1159,6 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, s->connect_only_ws = (arg == 2); break; - #ifdef USE_SSH case CURLOPT_SSH_AUTH_TYPES: s->ssh_auth_types = (int)arg; @@ -1683,7 +1682,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* * A string with POST data. Makes curl HTTP POST. Even if it is NULL. * If needed, CURLOPT_POSTFIELDSIZE must have been set prior to - * CURLOPT_COPYPOSTFIELDS and not altered later. + * CURLOPT_COPYPOSTFIELDS and not altered later. */ if(!ptr || s->postfieldsize == -1) result = Curl_setstropt(&s->str[STRING_COPYPOSTFIELDS], ptr); diff --git a/lib/smtp.c b/lib/smtp.c index 3d4f36364bfa..f36459634ebb 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1881,7 +1881,7 @@ static CURLcode smtp_parse_address(const char *fqma, char **address, /* Duplicate the fully qualified email address so we can manipulate it, ensuring it does not contain the delimiters if specified */ - char *dup = strdup(fqma[0] == '<' ? fqma + 1 : fqma); + char *dup = strdup(fqma[0] == '<' ? fqma + 1 : fqma); if(!dup) return CURLE_OUT_OF_MEMORY; diff --git a/lib/socks.c b/lib/socks.c index 9936aaf5bb15..5daf5393cd14 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -528,7 +528,7 @@ static CURLproxycode socks4_connect(struct Curl_cfilter *cf, /* socks4a, not resolving locally, sends the hostname. * add an invalid address + user + hostname */ unsigned char buf[4] = { 0, 0, 0, 1 }; - size_t hlen = strlen(sx->hostname) + 1; /* including NUL */ + size_t hlen = strlen(sx->hostname) + 1; /* including NUL */ if(hlen > 255) { failf(data, "SOCKS4: too long hostname"); diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 929132f570a3..30fefa5a6d3c 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -132,7 +132,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, const size_t serviceptr_length = strlen(serviceptr); gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT; - /* GSS-API request looks like * +----+------+-----+----------------+ * |VER | MTYP | LEN | TOKEN | diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index a7aa81b75d8e..31645527a36f 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -87,7 +87,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, unsigned long qop; unsigned char socksreq[4]; /* room for GSS-API exchange header only */ const char *service = data->set.str[STRING_PROXY_SERVICE_NAME] ? - data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd"; + data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd"; char *etbuf; size_t etbuf_size; @@ -156,7 +156,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, (void)curlx_nonblock(sock, FALSE); /* As long as we need to keep sending some context info, and there is no */ - /* errors, keep sending it... */ + /* errors, keep sending it... */ for(;;) { TCHAR *sname; @@ -505,7 +505,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, goto error; } - if(!data->set.socks5_gssapi_nec) { wrap_desc.cBuffers = 2; sspi_w_token[0].BufferType = SECBUFFER_STREAM; diff --git a/lib/tftp.c b/lib/tftp.c index d9d978c24e90..ffea60f62190 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -477,7 +477,7 @@ static CURLcode tftp_send_first(struct tftp_conn *state, curl_msnprintf((char *)state->spacket.data + 2, state->blksize, - "%s%c%s%c", filename, '\0', mode, '\0'); + "%s%c%s%c", filename, '\0', mode, '\0'); sbytes = 4 + strlen(filename) + strlen(mode); /* optional addition of TFTP options */ diff --git a/lib/url.c b/lib/url.c index f0fe7d3d4135..e816da442a16 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2187,7 +2187,6 @@ static CURLcode parse_proxy(struct Curl_easy *data, bool is_unix_proxy = FALSE; #endif - if(!uhp) { result = CURLE_OUT_OF_MEMORY; goto error; diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 935468f3a65e..9cf554d3b061 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -66,7 +66,6 @@ bool Curl_auth_is_spnego_supported(void) Curl_pSecFn->FreeContextBuffer(SecurityPackage); } - return status == SEC_E_OK; } diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index f72f6630f523..36bd28926d1e 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1214,7 +1214,8 @@ static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id, static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t sid, uint64_t app_error_code, void *user_data, - void *stream_user_data) { + void *stream_user_data) +{ struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; curl_int64_t stream_id = (curl_int64_t)sid; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index e30cfc648a30..50051041df36 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -951,7 +951,8 @@ static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t sid, static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t sid, uint64_t app_error_code, void *user_data, - void *stream_user_data) { + void *stream_user_data) +{ struct Curl_cfilter *cf = user_data; struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index a2ab24bae73c..fc1c55526e47 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -869,7 +869,6 @@ static CURLcode cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(!stream) return CURLE_RECV_ERROR; - if(!Curl_bufq_is_empty(&stream->recvbuf)) { result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] read recvbuf(len=%zu) " diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 7533001eaf2e..33f7fe092ba0 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -155,7 +155,6 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, } #endif - while((sent = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR) ; diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index af3767ca7109..f5de9f3e84fb 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -297,7 +297,6 @@ static void myssh_set_state(struct Curl_easy *data, "QUIT" }; - if(sshc->state != nowstate) { infof(data, "SSH %p state change from %s to %s (line %d)", (void *) sshc, names[sshc->state], names[nowstate], @@ -2439,7 +2438,6 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, } } while(!rc && (sshc->state != SSH_STOP)); - if(rc == SSH_AGAIN) { /* we would block, we need to wait for the socket to be ready (in the right direction too)! */ diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 5990da25bf41..ee82396753c9 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3573,9 +3573,9 @@ static CURLcode ssh_do(struct Curl_easy *data, bool *done) Curl_pgrsSetDownloadSize(data, -1); if(conn->handler->protocol & CURLPROTO_SCP) - result = scp_perform(data, &connected, done); + result = scp_perform(data, &connected, done); else - result = sftp_perform(data, &connected, done); + result = sftp_perform(data, &connected, done); return result; } diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 40d8ad5b45e0..754a5f2f898d 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -636,7 +636,6 @@ CURLcode Curl_gtls_client_trust_setup(struct Curl_cfilter *cf, CURLcode result; int rc; - /* Consider the X509 store cacheable if it comes exclusively from a CAfile, or no source is provided and we are falling back to OpenSSL's built-in default. */ @@ -1969,7 +1968,8 @@ static CURLcode gtls_send_earlydata(struct Curl_cfilter *cf, */ static CURLcode gtls_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, - bool *done) { + bool *done) +{ struct ssl_connect_data *connssl = cf->ctx; struct gtls_ssl_backend_data *backend = (struct gtls_ssl_backend_data *)connssl->backend; diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index ea8981b3cda9..4e8a0c3cf799 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -847,7 +847,6 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) mbedtls_ssl_list_ciphersuites()); } - #ifdef MBEDTLS_SSL_RENEGOTIATION mbedtls_ssl_conf_renegotiation(&backend->config, MBEDTLS_SSL_RENEGOTIATION_ENABLED); diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 2173b3be88ba..ecf4d0315253 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -657,7 +657,8 @@ init_config_builder(struct Curl_easy *data, static void init_config_builder_alpn(struct Curl_easy *data, const struct ssl_connect_data *connssl, - struct rustls_client_config_builder *config_builder) { + struct rustls_client_config_builder *config_builder) +{ struct alpn_proto_buf proto; rustls_slice_bytes alpn[ALPN_ENTRIES_MAX]; size_t i; @@ -709,7 +710,8 @@ init_config_builder_verifier(struct Curl_easy *data, struct rustls_client_config_builder *builder, const struct ssl_primary_config *conn_config, const struct curl_blob *ca_info_blob, - const char * const ssl_cafile) { + const char * const ssl_cafile) +{ const struct rustls_root_cert_store *roots = NULL; struct rustls_root_cert_store_builder *roots_builder = NULL; struct rustls_web_pki_server_cert_verifier_builder *verifier_builder = NULL; diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 50b81f672590..f9d697bbb844 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -2646,7 +2646,6 @@ static CURLcode schannel_pkp_pin_peer_pubkey(struct Curl_cfilter *cf, break; /* failed */ } - if(!(((pCertContextServer->dwCertEncodingType & X509_ASN_ENCODING) != 0) && (pCertContextServer->cbCertEncoded > 0))) break; diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index df0449cbeee6..3b7a095c8b75 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1952,7 +1952,7 @@ CURLcode Curl_alpn_to_proto_buf(struct alpn_proto_buf *buf, len = strlen(spec->entries[i]); if(len >= ALPN_NAME_MAX) return CURLE_FAILED_INIT; - blen = (unsigned char)len; + blen = (unsigned char)len; if(off + blen + 1 >= (int)sizeof(buf->data)) return CURLE_FAILED_INIT; buf->data[off++] = blen; diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 9639709fdbe0..19e8c5558aec 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -578,7 +578,7 @@ wssl_setup_session(struct Curl_cfilter *cf, if(sess_reuse_cb) { result = sess_reuse_cb(cf, data, alpns, scs, &do_early_data); if(result) - goto out; + goto out; } #ifdef WOLFSSL_EARLY_DATA if(do_early_data) { diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index c5fc86351524..96eb512b9038 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -191,7 +191,7 @@ static const char *getASN1Element_(struct Curl_asn1Element *elem, if an error occurs. */ if(!beg || !end || beg >= end || !*beg || ((size_t)(end - beg) > CURL_ASN1_MAX) || - lvl >= CURL_ASN1_MAX_RECURSIONS) + lvl >= CURL_ASN1_MAX_RECURSIONS) return NULL; /* Process header byte. */ diff --git a/lib/ws.c b/lib/ws.c index 683841ecbbf1..891a53dbb458 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -1560,7 +1560,6 @@ CURLcode curl_ws_recv(CURL *d, void *buffer, return CURLE_BAD_FUNCTION_ARGUMENT; } - memset(&ctx, 0, sizeof(ctx)); ctx.data = data; ctx.ws = ws; diff --git a/packages/vms/curl_crtl_init.c b/packages/vms/curl_crtl_init.c index 90bcb4c3599c..1c90847cd25d 100644 --- a/packages/vms/curl_crtl_init.c +++ b/packages/vms/curl_crtl_init.c @@ -173,7 +173,7 @@ static int sys_crelnm(const char *logname, } - /* Start of DECC RTL Feature handling */ +/* Start of DECC RTL Feature handling */ /* ** Sets default value for a feature @@ -213,7 +213,6 @@ static void set_features(void) /* We always want the new parse style */ set_feature_default("DECC$ARGV_PARSE_STYLE", ENABLE); - /* Unless we are in POSIX compliant mode, we want the old POSIX root * enabled. */ @@ -244,7 +243,7 @@ static void set_features(void) /* Gets rid of output logs with single character lines in them. */ set_feature_default("DECC$STDIO_CTX_EOL", ENABLE); - /* Fix mv aa.bb aa */ + /* Fix mv aa.bb aa */ set_feature_default("DECC$RENAME_NO_INHERIT", ENABLE); if(use_unix_settings) { @@ -283,7 +282,7 @@ static void set_features(void) /* Set strtol to proper behavior */ set_feature_default("DECC$STRTOL_ERANGE", ENABLE); - /* Commented here to prevent future bugs: A program or user should */ + /* Commented here to prevent future bugs: A program or user should */ /* never ever enable DECC$POSIX_STYLE_UID. */ /* It will probably break all code that accesses UIDs */ /* do_not_set_default ("DECC$POSIX_STYLE_UID", TRUE); */ diff --git a/src/tool_operate.c b/src/tool_operate.c index f290a288dee7..46a3f200bb3d 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2194,7 +2194,6 @@ static CURLcode run_all_transfers(CURLSH *share, global->noprogress = orig_noprogress; global->isatty = orig_isatty; - return result; } diff --git a/src/tool_progress.c b/src/tool_progress.c index 2fcc7ff85e3d..ad4cd98eb7f5 100644 --- a/src/tool_progress.c +++ b/src/tool_progress.c @@ -253,7 +253,6 @@ bool progress_meter(CURLM *multi, speed = dls > uls ? dls : uls; } - if(dlknown && speed) { curl_off_t est = all_dltotal / speed; curl_off_t left = (all_dltotal - all_dlnow) / speed; From 2db36f11b8e2c3de99552fc9db830ac22f248a64 Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 5 Nov 2025 02:16:54 +0800 Subject: [PATCH 237/885] gtls: add return checks and optimize the code This commit does the following things: 1. Update the description of gtls_init() 2. In gtls_client_init(), check the invaild SSLVERSION at first. Note that this part refactors the duplicate/incompatible checks and removes the useless local variable `sni`. 3. Check the return value of gnutls_ocsp_resp_init(). Although the original code is safe because gnutls_ocsp_resp_import() will check the validity of `ocsp_resp`, it is better to catch the error in time and record the proper message to output log. Closes #19366 --- lib/vtls/gtls.c | 59 +++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 754a5f2f898d..6c1fe63b5ebb 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -72,7 +72,6 @@ static void tls_log_func(int level, const char *str) curl_mfprintf(stderr, "|<%d>| %s", level, str); } #endif -static bool gtls_inited = FALSE; #if !defined(GNUTLS_VERSION_NUMBER) || (GNUTLS_VERSION_NUMBER < 0x03010a) #error "too old GnuTLS version" @@ -149,33 +148,31 @@ static ssize_t gtls_pull(void *s, void *buf, size_t blen) return (ssize_t)nread; } -/* gtls_init() +/** + * gtls_init() * * Global GnuTLS init, called from Curl_ssl_init(). This calls functions that - * are not thread-safe and thus this function itself is not thread-safe and - * must only be called from within curl_global_init() to keep the thread - * situation under control! + * are not thread-safe (It is thread safe since GnuTLS 3.3.0) and thus this + * function itself is not thread-safe and must only be called from within + * curl_global_init() to keep the thread situation under control! + * + * @retval 0 error initializing SSL + * @retval 1 SSL initialized successfully */ static int gtls_init(void) { int ret = 1; - if(!gtls_inited) { - ret = gnutls_global_init() ? 0 : 1; + ret = gnutls_global_init() ? 0 : 1; #ifdef GTLSDEBUG - gnutls_global_set_log_function(tls_log_func); - gnutls_global_set_log_level(2); + gnutls_global_set_log_function(tls_log_func); + gnutls_global_set_log_level(2); #endif - gtls_inited = TRUE; - } return ret; } static void gtls_cleanup(void) { - if(gtls_inited) { - gnutls_global_deinit(); - gtls_inited = FALSE; - } + gnutls_global_deinit(); } #ifndef CURL_DISABLE_VERBOSE_STRINGS @@ -860,20 +857,15 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf, struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); unsigned int init_flags; int rc; - bool sni = TRUE; /* default is SNI enabled */ const char *prioritylist; bool tls13support; CURLcode result; - if(!gtls_inited) - gtls_init(); - - if(config->version == CURL_SSLVERSION_SSLv2) { - failf(data, "GnuTLS does not support SSLv2"); + if(config->version == CURL_SSLVERSION_SSLv2 || + config->version == CURL_SSLVERSION_SSLv3) { + failf(data, "GnuTLS does not support SSLv2 or SSLv3"); return CURLE_SSL_CONNECT_ERROR; } - else if(config->version == CURL_SSLVERSION_SSLv3) - sni = FALSE; /* SSLv3 has no SNI */ /* allocate a shared creds struct */ result = Curl_gtls_shared_creds_create(data, >ls->shared_creds); @@ -940,7 +932,7 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf, return CURLE_SSL_CONNECT_ERROR; } - if(sni && peer->sni) { + if(peer->sni) { if(gnutls_server_name_set(gtls->session, GNUTLS_NAME_DNS, peer->sni, strlen(peer->sni)) < 0) { failf(data, "Failed to set SNI"); @@ -956,16 +948,6 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf, /* "In GnuTLS 3.6.5, TLS 1.3 is enabled by default" */ tls13support = !!gnutls_check_version("3.6.5"); - /* Ensure +SRP comes at the *end* of all relevant strings so that it can be - * removed if a runtime error indicates that SRP is not supported by this - * GnuTLS version */ - - if(config->version == CURL_SSLVERSION_SSLv2 || - config->version == CURL_SSLVERSION_SSLv3) { - failf(data, "GnuTLS does not support SSLv2 or SSLv3"); - return CURLE_SSL_CONNECT_ERROR; - } - if(config->version == CURL_SSLVERSION_TLSv1_3) { if(!tls13support) { failf(data, "This GnuTLS installation does not support TLS 1.3"); @@ -1159,7 +1141,7 @@ CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx, if(sess_reuse_cb) { result = sess_reuse_cb(cf, data, &alpns, scs, &do_early_data); if(result) - goto out; + goto out; } if(do_early_data) { /* We only try the ALPN protocol the session used before, @@ -1452,7 +1434,12 @@ static CURLcode gtls_verify_ocsp_status(struct Curl_easy *data, goto out; } - gnutls_ocsp_resp_init(&ocsp_resp); + rc = gnutls_ocsp_resp_init(&ocsp_resp); + if(rc < 0) { + failf(data, "Failed to initialize OCSP response object"); + result = CURLE_SSL_INVALIDCERTSTATUS; + goto out; + } rc = gnutls_ocsp_resp_import(ocsp_resp, &status_request); if(rc < 0) { From 33e7745eef3b9f537715b228c53f8ed6be553f3f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Nov 2025 14:12:23 +0100 Subject: [PATCH 238/885] RELEASE-NOTES: synced bumped to 8.17.1 for now fixed typo in THANKS-filter --- RELEASE-NOTES | 946 +---------------------------------------- docs/THANKS-filter | 2 +- include/curl/curlver.h | 6 +- 3 files changed, 14 insertions(+), 940 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 76e47f0f728b..f5e85c224800 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,6 +1,6 @@ -curl and libcurl 8.17.0 +curl and libcurl 8.17.1 - Public curl releases: 271 + Public curl releases: 272 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 @@ -8,468 +8,12 @@ curl and libcurl 8.17.0 This release includes the following changes: - o build: drop Heimdal support [267] - o build: drop the winbuild build system [81] - o krb5: drop support for Kerberos FTP [43] - o libssh2: up the minimum requirement to 1.9.0 [85] - o multi: add notifications API [250] - o progress: expand to use 6 characters per size [234] - o ssl: support Apple SecTrust configurations [240] - o tool_getparam: add --knownhosts [204] - o vssh: drop support for wolfSSH [58] - o wcurl: import v2025.11.04 [431] - o write-out: make %header{} able to output *all* occurrences of a header [25] This release includes the following bugfixes: - o ares: fix leak in tracing [91] - o asyn-ares: remove wrong comment about the callback argument [306] - o asyn-ares: use the duped hostname pointer for all calls [158] - o asyn-thrdd resolver: clear timeout when done [97] - o asyn-thrdd: drop pthread_cancel [30] - o autotools: add support for libgsasl auto-detection via pkg-config [112] - o autotools: capitalize Rustls in the log output [106] - o autotools: drop detection of ancient OpenSSL libs RSAglue and rsaref [354] - o autotools: fix duplicate UNIX and BSD flags in buildinfo.txt [113] - o autotools: fix silly mistake in clang detection for buildinfo.txt [114] - o autotools: make --enable-code-coverage support llvm/clang [79] - o autotools: merge `if`s in GnuTLS/OpenSSL feature detection [385] - o aws-lc: re-enable large read-ahead with v1.61.0 again [16] - o base64: accept zero length argument to base64_encode [82] - o build: address some -Weverything warnings, update picky warnings [74] - o build: avoid overriding system open and stat symbols [141] - o build: avoid overriding system symbols for fopen functions [150] - o build: avoid overriding system symbols for socket functions [68] - o build: show llvm/clang in platform flags and buildinfo.txt [126] - o c-ares: when resolving failed, persist error [270] - o cf-h2-proxy: break loop on edge case [140] - o cf-ip-happy: mention unix domain path, not port number [161] - o cf-socket: always check Curl_cf_socket_peek() return code [198] - o cf-socket: check params and remove accept procondition [197] - o cf-socket: make set_local_ip void, and remove failf() [390] - o cf-socket: set FD_CLOEXEC on all sockets opened [273] - o cf-socket: tweak a memcpy() to read better [177] - o cf-socket: use the right byte order for ports in bindlocal [61] - o cfilter: unlink and discard [46] - o cfilters: check return code from Curl_pollset_set_out_only() [402] - o checksrc: allow disabling warnings on FIXME/TODO comments [324] - o checksrc: catch banned functions when preceded by ( [146] - o checksrc: fix possible endless loop when detecting BANNEDFUNC [149] - o checksrc: fix possible endless loops in the banned function logic [220] - o checksrc: fix to handle ) predecing a banned function [229] - o checksrc: reduce directory-specific exceptions [228] - o CI.md: refresh [280] - o cmake/FindGSS: dedupe pkg-config module strings [277] - o cmake/FindGSS: drop wrong header check for GNU GSS [278] - o cmake/FindGSS: fix pkg-config fallback logic for CMake <3.16 [189] - o cmake/FindGSS: simplify/de-dupe lib setup [253] - o cmake/FindGSS: whitespace/formatting [268] - o cmake: add and use local FindGnuTLS module [379] - o cmake: add CURL_CODE_COVERAGE option [78] - o cmake: build the "all" examples source list dynamically [245] - o cmake: clang detection tidy-ups [116] - o cmake: drop exclamation in comment looking like a name [160] - o cmake: fix `HAVE_GNUTLS_SRP` detection after adding local FindGnuTLS module [458] - o cmake: fix building docs when the base directory contains .3 [18] - o cmake: fix Linux pre-fill `HAVE_POSIX_STRERROR_R` (when `_CURL_PREFILL=ON`) - o cmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`) [372] - o cmake: minor Heimdal flavour detection fix [269] - o cmake: pre-fill three more type sizes on Windows [244] - o cmake: say 'absolute path' in option descriptions and docs [378] - o cmake: support building some complicated examples, build them in CI [235] - o cmake: use modern alternatives for get_filename_component() [102] - o cmake: use more COMPILER_OPTIONS, LINK_OPTIONS / LINK_FLAGS [152] - o cmdline-docs: extended, clarified, refreshed [28] - o cmdline-opts/_PROGRESS.md: explain the suffixes [154] - o configure: add "-mt" for pthread support on HP-UX [52] - o conn: fix hostname move on connection reuse [272] - o conncache: prevent integer overflow in maxconnects calculation [438] - o connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply [404] - o connect: remove redundant condition in shutdown start [289] - o cookie: avoid saving a cookie file if no transfer was done [11] - o cookie: only count accepted cookies in Curl_cookie_add [364] - o cookie: remove the temporary file on (all) errors [356] - o cpool: make bundle->dest an array; fix UB [218] - o curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY [320] - o curl_easy_getinfo: error code on NULL arg [2] - o curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS [319] - o curl_mem_undef.h: limit to CURLDEBUG for non-memalloc overrides [19] - o curl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang [383] - o curl_osslq: error out properly if BIO_ADDR_rawmake() fails [184] - o curl_path: make sure just whitespace is illegal [351] - o Curl_resolv: fix comment. 'entry' argument is not optional [187] - o curl_slist_append.md: clarify that a NULL pointer is not acceptable [72] - o curl_threads: delete WinCE fallback branch [233] - o CURLINFO_FTP_ENTRY_PATH.md: this is for SFTP as well [8] - o CURLOPT_COOKIEFILE.md: clarify when the cookies are loaded [159] - o CURLOPT_COPYPOSTFIELDS.md: used with MQTT and RTSP as well [457] - o CURLOPT_HEADER/WRITEFUNCTION.md: drop '* size' since size is always 1 [63] - o CURLOPT_MAXLIFETIME_CONN: make default 24 hours [10] - o CURLOPT_POSTFIELDSIZE*: these also work for MQTT and RTSP [395] - o CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also [397] - o CURLOPT_SSL_VERIFYHOST.md: add see-also to two other VERIFYHOST options [32] - o CURLOPT_TIMECONDITION.md: works for FILE and FTP as well [27] - o cw-out: fix EAGAIN handling on pause [452] - o cw-out: unify the error handling pattern in cw_out_do_write [414] - o digest_sspi: fix two memory leaks in error branches [77] - o dist: do not distribute CI.md [29] - o docs/cmdline-opts: drop double quotes from GLOBBING and URL examples [238] - o docs/libcurl: clarify some timeout option behavior [15] - o docs/libcurl: remove ancient version references [7] - o docs/libcurl: use lowercase must [5] - o docs: expand on quoting rules for file names in SFTP quote [300] - o docs: fix/tidy code fences [87] - o doh: cleanup resources on error paths [434] - o doswin: CloseHandle the thread on shutdown [307] - o easy_getinfo: check magic, Curl_close safety [3] - o ECH.md: make OpenSSL branch clone instructions work [430] - o examples/chkspeed: portable printing when outputting curl_off_t values [365] - o examples/http2-serverpush: fix file handle leaks [428] - o examples/sessioninfo: cast printf string mask length to int [232] - o examples/sessioninfo: do not disable security [255] - o examples/synctime: fix null termination assumptions [297] - o examples/synctime: make the sscanf not overflow the local buffer [252] - o examples/usercertinmem: avoid stripping const [247] - o examples/websocket: fix use of uninitialized rlen [346] - o examples: call curl_global_cleanup() where missing [323] - o examples: check more errors, fix cleanups, scope variables [318] - o examples: drop unused curl/mprintf.h includes [224] - o examples: fix build issues in 'complicated' examples [243] - o examples: fix more potential resource leaks, and more [426] - o examples: fix two build issues surfaced with WinCE [223] - o examples: fix two issues found by CodeQL [35] - o examples: fix two more cases of stat() TOCTOU [147] - o examples: improve global init, error checks and returning errors [321] - o examples: replace casts with `curl_off_t` printf masks [358] - o examples: return curl_easy_perform() results [322] - o firefox-db2pem.sh: add macOS support, tidy-ups [348] - o form.md: drop reference to MANUAL [178] - o ftp: add extra buffer length check [195] - o ftp: check errors on remote ip for data connection [423] - o ftp: fix ftp_do_more returning with *completep unset [122] - o ftp: fix port number range loop for PORT commands [66] - o ftp: fix the 213 scanner memchr buffer limit argument [196] - o ftp: improve fragile check for first digit > 3 [194] - o ftp: reduce size of some struct fields [418] - o ftp: remove 'newhost' and 'newport' from the ftp_conn struct [419] - o ftp: remove misleading comments [193] - o ftp: remove the retr_size_saved struct field [416] - o ftp: remove the state_saved struct field [417] - o ftp: replace strstr() in ;type= handling [313] - o ftp: simplify the 150/126 size scanner [288] - o gnutls: check conversion of peer cert chain [275] - o gnutls: fix re-handshake comments [422] - o gssapi: make channel binding conditional on GSS_C_CHANNEL_BOUND_FLAG [446] - o gtls: avoid potential use of uninitialized variable in trace output [83] - o gtls: check the return value of gnutls_pubkey_init() [456] - o header.md: see-also --proxy-header and vice versa [396] - o hmac: free memory properly on errors [377] - o hostip: don't store negative resolves due unrelated errors [256] - o hostip: fix infof() output for non-ipv6 builds using IPv6 address [338] - o hostip: remove leftover INT_MAX check in Curl_dnscache_prune [88] - o http2: check push header names by length first [261] - o http2: cleanup pushed newhandle on fail [260] - o http2: ingress handling edge cases [259] - o HTTP3: clarify the status for "old" OpenSSL, not current [394] - o http: check the return value of strdup [437] - o http: fix `-Wunreachable-code` in !websockets !unity builds [443] - o http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds [442] - o http: handle user-defined connection headers [165] - o http: look for trailing 'type=' in ftp:// without strstr [315] - o http: make Content-Length parser more WHATWG [183] - o http: only accept ';' as a separator for custom headers [407] - o http: return error for a second Location: header [393] - o http_aws_sigv4: check the return value of curl_maprintf() [381] - o http_proxy: fix adding custom proxy headers [424] - o httpsrr: free old pointers when storing new [57] - o httpsrr: send HTTPS query to the right target [435] - o imap: fix custom FETCH commands to handle literal responses [441] - o imap: parse and use UIDVALIDITY as a number [420] - o imap: treat capabilities case insensitively [345] - o INSTALL-CMAKE.md: add manual configuration examples [360] - o INSTALL-CMAKE.md: document useful build targets [215] - o INSTALL-CMAKE.md: fix descriptions for LDAP dependency options [382] - o INSTALL: update the list of known operating systems [325] - o INTERNALS: drop Winsock 2.2 from the dependency list [162] - o ip-happy: do not set unnecessary timeout [95] - o ip-happy: prevent event-based stall on retry [155] - o kerberos: bump minimum to 1.3 (2003-07-08), drop legacy logic [279] - o kerberos: drop logic for MIT Kerberos <1.2.3 (pre-2002) versions [285] - o kerberos: stop including gssapi/gssapi_generic.h [282] - o krb5: fix output_token allocators in the GSS debug stub (Windows) [326] - o krb5: return appropriate error on send failures [22] - o krb5_gssapi: fix memory leak on error path [190] - o krb5_sspi: the chlg argument is NOT optional [200] - o ldap: avoid null ptr deref on failure [284] - o ldap: do not base64 encode zero length string [42] - o ldap: do not pass a \n to failf() [370] - o ldap: tidy-up types, fix error code confusion [191] - o lib1514: fix return code mixup [304] - o lib: delete unused crypto header includes [384] - o lib: drop unused include and duplicate guards [226] - o lib: fix build error with verbose strings disabled [173] - o lib: remove newlines from failf() calls [366] - o lib: remove personal names from comments [168] - o lib: SSL connection reuse [301] - o lib: stop NULL-checking conn->passwd and ->user [309] - o lib: upgrade/multiplex handling [136] - o libcurl-multi.md: added curl_multi_get_offt mention [53] - o libcurl-security.md: mention long-running connections [6] - o libssh/libssh2: reject quote command lines with too much data [299] - o libssh/sftp: fix resume corruption by avoiding O_APPEND with rresume [263] - o libssh2/sftp: fix resume corruption by avoiding O_APPEND with rresume [262] - o libssh2/sftp_realpath: change state consistently [185] - o libssh2: avoid risking using an uninitialized local struct field [209] - o libssh2: bail out on chgrp and chown number parsing errors [202] - o libssh2: clarify that sshp->path is always at least one byte [201] - o libssh2: drop two redundant null-terminations [26] - o libssh2: error check and null-terminate in ssh_state_sftp_readdir_link() [34] - o libssh2: fix EAGAIN return in ssh_state_auth_agent [290] - o libssh2: fix return code for EAGAIN [186] - o libssh2: use sockindex consistently [302] - o libssh: acknowledge SSH_AGAIN in the SFTP state machine [89] - o libssh: catch a resume point larger than the size [281] - o libssh: clarify myssh_block2waitfor [92] - o libssh: drop two unused assignments [104] - o libssh: error on bad chgrp number [71] - o libssh: error on bad chown number and store the value [64] - o libssh: fix range parsing error handling mistake [120] - o libssh: make atime and mtime cap the timestamp instead of wrap [283] - o libssh: react on errors from ssh_scp_read [24] - o libssh: return out of memory correctly if aprintf fails [60] - o libssh: return the proper error for readdir problems [355] - o Makefile.example: bump default example from FTP to HTTPS [389] - o Makefile.example: fix option order [231] - o Makefile.example: make default options more likely to work [388] - o Makefile.example: simplify and make it configurable [20] - o managen: ignore version mentions < 7.66.0 [55] - o managen: render better manpage references/links [54] - o managen: strict protocol check [109] - o managen: verify the options used in example lines [181] - o mbedtls: add support for 4.0.0 [344] - o mbedtls: check result of setting ALPN [127] - o mbedtls: fix building with <3.6.1 [400] - o mbedtls: fix building with sha-256 missing from PSA [391] - o mbedtls: handle WANT_WRITE from mbedtls_ssl_read() [145] - o md4: drop mbedtls implementation (not available in mbedtls v3+) [406] - o mdlinkcheck: reject URLs containing quotes [174] - o memdup0: handle edge case [241] - o mime: fix unpausing of readers [375] - o mime: fix use of fseek() [334] - o multi.h: add CURLMINFO_LASTENTRY [51] - o multi: check the return value of strdup() [436] - o multi_ev: remove unnecessary data check that confuses analysers [167] - o netrc: when the cached file is discarded, unmark it as loaded [409] - o nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header [227] - o ngtcp2: add a comment explaining write result handling [340] - o ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available [362] - o ngtcp2: check error code on connect failure [13] - o ngtcp2: close just-opened QUIC stream when submit_request fails [222] - o ngtcp2: compare idle timeout in ms to avoid overflow [248] - o ngtcp2: fix early return [131] - o ngtcp2: fix handling of blocked stream data [236] - o ngtcp2: fix returns when TLS verify failed [251] - o ngtcp2: overwrite rate-limits defaults [444] - o noproxy: fix the IPV6 network mask pattern match [166] - o NTLM: disable if DES support missing from OpenSSL or mbedTLS [399] - o ntlm: improved error path on bad incoming NTLM TYPE3 message [412] - o openldap/ldap; check for binary attribute case insensitively [445] - o openldap: avoid indexing the result at -1 for blank responses [44] - o openldap: check ber_sockbuf_add_io() return code [163] - o openldap: check ldap_get_option() return codes [119] - o openldap: do not pass newline to infof() [368] - o openldap: fix memory-leak in error path [287] - o openldap: fix memory-leak on oldap_do's exit path [286] - o openldap: limit max incoming size [347] - o openssl-quic: check results better [132] - o openssl-quic: handle error in SSL_get_stream_read_error_code [129] - o openssl-quic: ignore unexpected streams opened by server [176] - o openssl: better return code checks when logging cert data [342] - o openssl: call SSL_get_error() with proper error [207] - o openssl: check CURL_SSLVERSION_MAX_DEFAULT properly [447] - o openssl: clear retry flag on x509 error [130] - o openssl: combine all the x509-store flags [451] - o openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs [339] - o openssl: fail the transfer if ossl_certchain() fails [23] - o openssl: fix build for v1.0.2 [225] - o openssl: fix peer certificate leak in channel binding [258] - o openssl: fix resource leak in provider error path [376] - o openssl: fix unable do typo in failf() calls [341] - o openssl: free UI_METHOD on exit path [373] - o openssl: make the asn1_object_dump name null terminated [56] - o openssl: only try engine/provider if a cert file/name is provided [415] - o openssl: set io_need always [99] - o openssl: skip session resumption when verifystatus is set [230] - o os400: document threads handling in code. [254] - o OS400: fix a use-after-free/double-free case [142] - o osslq: set idle timeout to 0 [237] - o pingpong: remove two old leftover debug infof() calls - o pop3: check for CAPA responses case insensitively [439] - o pop3: fix CAPA response termination detection [427] - o pop3: function could get the ->transfer field wrong [292] - o pytest: skip specific tests for no-verbose builds [171] - o quic: fix min TLS version handling [14] - o quic: ignore EMSGSIZE on receive [4] - o quic: improve UDP GRO receives [330] - o quic: remove data_idle handling [311] - o quiche: fix possible leaks on teardown [205] - o quiche: fix verbose message when ip quadruple cannot be obtained. [128] - o quiche: handle tls fail correctly [266] - o quiche: when ingress processing fails, return that error code [103] - o rtsp: use explicit postfieldsize if specified [401] - o runtests: tag tests that require curl verbose strings [172] - o rustls: exit on error [335] - o rustls: fix clang-tidy warning [107] - o rustls: fix comment describing cr_recv() [117] - o rustls: limit snprintf proper in cr_keylog_log_cb() [343] - o rustls: make read_file_into not reject good files [328] - o rustls: pass the correct result to rustls_failf [242] - o rustls: typecast variable for safer trace output [69] - o rustls: use %zu for size_t in failf() format string [121] - o sasl: clear canceled mechanism instead of toggling it [41] - o schannel: assign result before using it [62] - o schannel: fix memory leak [363] - o schannel: handle Curl_conn_cf_send() errors better [352] - o schannel: lower the maximum allowed time to block to 7 seconds [333] - o schannel: properly close the certfile on error [450] - o schannel_verify: do not call infof with an appended \n [371] - o schannel_verify: fix mem-leak in Curl_verify_host [208] - o schannel_verify: use more human friendly error messages [96] - o scp/sftp: fix disconnect [350] - o scripts: pass -- before passing xargs [349] - o setopt: accept *_SSL_VERIFYHOST set to 2L [31] - o setopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1 [257] - o setopt: fix unused variable warning in minimal build [332] - o setopt: make CURLOPT_MAXREDIRS accept -1 (again) [1] - o singleuse.pl: fix string warning [392] - o smb: adjust buffer size checks [45] - o smb: transfer debugassert to real check [303] - o smtp: check EHLO responses case insensitively [50] - o smtp: fix EOB handling [410] - o smtp: return value ignored [357] - o socks: advance iobuf instead of reset [276] - o socks: avoid UAF risk in error path [359] - o socks: deny server basic-auth if not configured [264] - o socks: handle error in verbose trace gracefully [94] - o socks: handle premature close [246] - o socks: make Curl_blockread_all return CURLcode [67] - o socks: properly maintain the status of 'done' [405] - o socks: rewwork, cleaning up socks state handling [135] - o socks_gssapi: also reset buffer length after free [429] - o socks_gssapi: make the gss_context a local variable [144] - o socks_gssapi: reject too long tokens [90] - o socks_gssapi: remove superfluous releases of the gss_recv_token [139] - o socks_gssapi: remove the forced "no protection" [143] - o socks_gssapi: replace `gss_release_buffer()` with curl free [386] - o socks_sspi: bail out on too long fields [137] - o socks_sspi: fix memory cleanup calls [40] - o socks_sspi: remove the enforced mode clearing [291] - o socks_sspi: restore non-blocking socket on error paths [48] - o socks_sspi: use the correct free function [331] - o socksd: remove --bindonly mention, there is no such option [305] - o spelling: fix new finds by typos-cli 1.39.0 [454] - o src/var: remove dead code [369] - o ssl-session-cache: check use on config and availability [448] - o ssl-sessions.md: mark option experimental [12] - o strerror: drop workaround for SalfordC win32 header bug [214] - o sws: fix checking sscanf() return value [17] - o sws: pass in socket reference to allow function to close it [298] - o tcp-nodelay.md: expand the documentation [153] - o telnet: ignore empty suboptions [86] - o telnet: make bad_option() consider NULL a bad option too [192] - o telnet: make printsub require another byte input [21] - o telnet: print DISPlay LOCation in printsub without mutating buffer [216] - o telnet: refuse IAC codes in content [111] - o telnet: return error if WSAEventSelect fails [180] - o telnet: return error on crazy TTYPE or XDISPLOC lengths [123] - o telnet: send failure logged but not returned [175] - o telnet: use pointer[0] for "unknown" option instead of pointer[i] [217] - o test1100: fix missing `` section [432] - o tests/libtest/cli*: fix init/deinit, leaks, and more [455] - o tests/server: drop pointless memory allocation overrides [219] - o tests/server: drop unsafe open() override in signal handler (Windows) [151] - o tftp: check and act on tftp_set_timeouts() returning error [38] - o tftp: check for trailing ";mode=" in URL without strstr [312] - o tftp: default timeout per block is now 15 seconds [156] - o tftp: error requests for blank filenames [296] - o tftp: handle tftp_multi_statemach() return code [65] - o tftp: pin the first used address [110] - o tftp: propagate expired timer from tftp_state_timeout() [39] - o tftp: return error if it hits an illegal state [138] - o tftp: return error when sendto() fails [59] - o thread: errno on thread creation [271] - o tidy-up: assortment of small fixes [115] - o tidy-up: avoid using the reserved macro namespace [76] - o tidy-up: fcntl.h includes [98] - o tidy-up: update MS links, allow long URLs via checksrc [73] - o tidy-up: URLs [101] - o time-cond.md: refer to the singular curl_getdate man page [148] - o TLS: IP address verification, extend test [398] - o TODO: fix a typo [93] - o TODO: remove already implemented or bad items [36] - o tool: fix exponential retry delay [47] - o tool_cb_hdr: fix fwrite check in header callback [49] - o tool_cb_hdr: size is always 1 [70] - o tool_cb_rea: use poll instead of select if available [329] - o tool_cfgable: remove superfluous free calls [403] - o tool_doswin: fix to use curl socket functions [108] - o tool_filetime: cap crazy file times instead of erroring [327] - o tool_filetime: replace cast with the fitting printf mask (Windows) [212] - o tool_formparse: rewrite the headers file parser [374] - o tool_getparam/set_rate: skip the multiplication on overflow [84] - o tool_getparam: always disable "lib-ids" for tracing [169] - o tool_getparam: make --fail and --fail-with-body override each other [293] - o tool_getparam: warn if provided header looks malformed [179] - o tool_ipfs: check the return value of curl_url_get for gwpath [453] - o tool_ipfs: simplify the ipfs gateway logic [337] - o tool_msgs: make errorf() show if --show-error [294] - o tool_operate: improve wording in retry message [37] - o tool_operate: keep failed partial download for retry auto-resume [210] - o tool_operate: keep the progress meter for --out-null [33] - o tool_operate: move the checks that skip ca cert detection [449] - o tool_operate: retry on HTTP response codes 522 and 524 [317] - o tool_operate: return error on strdup() failure [336] - o tool_paramhlp: remove outdated comment in str2tls_max() [367] - o tool_parsecfg: detect and error on recursive --config use [380] - o tool_progress: handle possible integer overflows [164] - o tool_progress: make max5data() use an algorithm [170] - o transfer: avoid busy loop with tiny speed limit [100] - o transfer: fix retry for empty downloads on reuse [411] - o transfer: reset retry count on each request [310] - o unit1323: sync time types and printf masks, drop casts [211] - o unit1664: drop casts, expand masks to full values [221] - o url: make Curl_init_userdefined return void [213] - o urldata: FILE is not a list-only protocol [9] - o urldata: make 'retrycount' a single byte [308] - o urldata: make redirect counter 16 bit [295] - o vauth/digest: improve the digest parser [203] - o version: add GSS backend name and version [353] - o vquic: fix idle-timeout checks (ms<-->ns), 64-bit log & honor 0=no-timeout [249] - o vquic: fix recvmsg loop for max_pkts [421] - o vquic: handling of io improvements [239] - o vquic: sending non-gso packets fix for EAGAIN [265] - o vtls: alpn setting, check proto parameter [134] - o vtls: check final cfilter node in find_ssl_filter [440] - o vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition [387] - o vtls: properly handle SSL shutdown timeout [433] - o vtls: remove call to PKCS12_PBE_add() [408] - o vtls: unify the error handling in ssl_cf_connect(). [413] - o vtls_int.h: clarify data_pending [124] - o vtls_scache: fix race condition [157] - o wcurl: sync to +dev snapshot [425] - o windows: replace _beginthreadex() with CreateThread() [80] - o windows: stop passing unused, optional argument for Win9x compatibility [75] - o windows: use consistent format when showing error codes [199] - o windows: use native error code types more [206] - o wolfssl: check BIO read parameters [133] - o wolfssl: clear variable to avoid uninitialized use [361] - o wolfssl: fix error check in shutdown [105] - o wolfssl: fix resource leak in verify_pinned error paths [314] - o wolfssl: no double get_error() detail [188] - o ws: clarify an error message [125] - o ws: fix some edge cases [274] - o ws: fix type conversion check [316] - o ws: reject curl_ws_recv called with NULL buffer with a buflen [118] + o gtls: add return checks and optimize the code [2] + o lib: cleanup for some typos about spaces and code style [3] + o m4/sectrust: fix test(1) operator [4] This release includes the following known bugs: @@ -493,481 +37,11 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Adam Light, Alexander Blach, Alice Lee Poetics, Andrei Kurushin, - Andrew Kirillov, Andrew Olsen, And-yW on github, BobodevMm on github, BohwaZ, - Christian Schmitz, curl.stunt430, Dalei, Dan Fandrich, Daniel Stenberg, - Daniel Terhorst-North, dependabot[bot], Devdatta Talele, - divinity76 on github, Emilio Pozuelo Monfort, Emre Çalışkan, Ethan Everett, - Evgeny Grin (Karlson2k), fds242 on github, Gunni on github, Harry Sintonen, - Howard Chu, Ignat Loskutov, Jakub Stasiak, James Fuller, Javier Blazquez, - Jicea, jmaggard10 on github, Jochen Sprickerhof, Johannes Schindelin, - Jonathan Cardoso Machado, Joseph Birr-Pixton, Joshua Rogers, - kapsiR on github, kuchara on github, madoe on github, Marc Aldorasi, - Marcel Raad, Michael Osipov, Michał Petryka, Mitchell Blank Jr, - Mohamed Daahir, Nir Azkiel, Patrick Monnerat, Pavel P, pennae on github, - Peter Piekarski, plv1313 on github, Pocs Norbert, Ray Satiro, renovate[bot], - rinsuki on github, Sakthi SK, Samuel Dionne-Riel, Samuel Henrique, - Sergio Durigan Junior, Stanislav Fort, Stefan Eissing, Tatsuhiro Tsujikawa, - TheBitBrine, Theo Buehler, Tim Becker, tkzv on github, Viktor Szakatas, - Viktor Szakats, WangDaLei on github, Xiaoke Wang, Yedaya Katsman, 包布丁 - (73 contributors) + Daniel Stenberg, Thomas Klausner, Viktor Szakats, Xiaoke Wang + (4 contributors) References to bug reports and discussions on issues: - [1] = https://curl.se/bug/?i=18571 - [2] = https://curl.se/bug/?i=18512 - [3] = https://curl.se/bug/?i=18511 - [4] = https://curl.se/bug/?i=18505 - [5] = https://curl.se/bug/?i=18570 - [6] = https://curl.se/bug/?i=18533 - [7] = https://curl.se/bug/?i=18530 - [8] = https://curl.se/bug/?i=18531 - [9] = https://curl.se/bug/?i=18525 - [10] = https://curl.se/bug/?i=18527 - [11] = https://curl.se/bug/?i=18621 - [12] = https://curl.se/bug/?i=18523 - [13] = https://curl.se/bug/?i=18521 - [14] = https://curl.se/bug/?i=18518 - [15] = https://curl.se/bug/?i=18569 - [16] = https://curl.se/bug/?i=18568 - [17] = https://curl.se/bug/?i=18565 - [18] = https://curl.se/bug/?i=18560 - [19] = https://curl.se/bug/?i=18510 - [20] = https://curl.se/bug/?i=18554 - [21] = https://curl.se/bug/?i=18618 - [22] = https://curl.se/bug/?i=18561 - [23] = https://curl.se/bug/?i=18646 - [24] = https://curl.se/bug/?i=18616 - [25] = https://curl.se/bug/?i=18491 - [26] = https://curl.se/bug/?i=18606 - [27] = https://curl.se/bug/?i=18551 - [28] = https://curl.se/bug/?i=18550 - [29] = https://curl.se/bug/?i=18549 - [30] = https://curl.se/bug/?i=18532 - [31] = https://curl.se/mail/lib-2025-09/0031.html - [32] = https://curl.se/bug/?i=18548 - [33] = https://curl.se/bug/?i=18607 - [34] = https://curl.se/bug/?i=18598 - [35] = https://curl.se/bug/?i=18605 - [36] = https://curl.se/bug/?i=18542 - [37] = https://curl.se/bug/?i=18604 - [38] = https://curl.se/bug/?i=18603 - [39] = https://curl.se/bug/?i=18574 - [40] = https://curl.se/bug/?i=18587 - [41] = https://curl.se/bug/?i=18573 - [42] = https://curl.se/bug/?i=18602 - [43] = https://curl.se/bug/?i=18577 - [44] = https://curl.se/bug/?i=18600 - [45] = https://curl.se/bug/?i=18599 - [46] = https://curl.se/bug/?i=18596 - [47] = https://curl.se/bug/?i=18591 - [48] = https://curl.se/bug/?i=18592 - [49] = https://curl.se/bug/?i=18593 - [50] = https://curl.se/bug/?i=18588 - [51] = https://curl.se/bug/?i=18578 - [52] = https://curl.se/bug/?i=18585 - [53] = https://curl.se/bug/?i=18579 - [54] = https://curl.se/bug/?i=18580 - [55] = https://curl.se/bug/?i=18583 - [56] = https://curl.se/bug/?i=18647 - [57] = https://curl.se/bug/?i=18631 - [58] = https://curl.se/bug/?i=18700 - [59] = https://curl.se/bug/?i=18643 - [60] = https://curl.se/bug/?i=18637 - [61] = https://curl.se/bug/?i=18641 - [62] = https://curl.se/bug/?i=18642 - [63] = https://curl.se/bug/?i=18640 - [64] = https://curl.se/bug/?i=18639 - [65] = https://curl.se/bug/?i=18638 - [66] = https://curl.se/bug/?i=18636 - [67] = https://curl.se/bug/?i=18635 - [68] = https://curl.se/bug/?i=18503 - [69] = https://curl.se/bug/?i=18628 - [70] = https://curl.se/bug/?i=18630 - [71] = https://curl.se/bug/?i=18629 - [72] = https://curl.se/bug/?i=18627 - [73] = https://curl.se/bug/?i=18626 - [74] = https://curl.se/bug/?i=18477 - [75] = https://curl.se/bug/?i=18490 - [76] = https://curl.se/bug/?i=18482 - [77] = https://curl.se/bug/?i=18488 - [78] = https://curl.se/bug/?i=18468 - [79] = https://curl.se/bug/?i=18473 - [80] = https://curl.se/bug/?i=18451 - [81] = https://curl.se/bug/?i=18040 - [82] = https://curl.se/bug/?i=18617 - [83] = https://curl.se/bug/?i=18620 - [84] = https://curl.se/bug/?i=18624 - [85] = https://curl.se/bug/?i=18612 - [86] = https://curl.se/bug/?i=18899 - [87] = https://curl.se/bug/?i=18707 - [88] = https://curl.se/bug/?i=18680 - [89] = https://curl.se/bug/?i=18740 - [90] = https://curl.se/bug/?i=18681 - [91] = https://curl.se/bug/?i=18251 - [92] = https://curl.se/bug/?i=18739 - [93] = https://curl.se/bug/?i=18788 - [94] = https://curl.se/bug/?i=18722 - [95] = https://curl.se/bug/?i=18767 - [96] = https://curl.se/bug/?i=18737 - [97] = https://curl.se/bug/?i=18769 - [98] = https://curl.se/bug/?i=18782 - [99] = https://curl.se/bug/?i=18733 - [100] = https://curl.se/bug/?i=18732 - [101] = https://curl.se/bug/?i=18689 - [102] = https://curl.se/bug/?i=18688 - [103] = https://curl.se/bug/?i=18730 - [104] = https://curl.se/bug/?i=18684 - [105] = https://curl.se/bug/?i=18729 - [106] = https://curl.se/bug/?i=18671 - [107] = https://curl.se/bug/?i=18670 - [108] = https://curl.se/bug/?i=18633 - [109] = https://curl.se/bug/?i=18675 - [110] = https://curl.se/bug/?i=18658 - [111] = https://curl.se/bug/?i=18657 - [112] = https://curl.se/bug/?i=18669 - [113] = https://curl.se/bug/?i=18667 - [114] = https://curl.se/bug/?i=18666 - [115] = https://curl.se/bug/?i=18664 - [116] = https://curl.se/bug/?i=18659 - [117] = https://curl.se/bug/?i=18728 - [118] = https://curl.se/bug/?i=18656 - [119] = https://curl.se/bug/?i=18653 - [120] = https://curl.se/bug/?i=18652 - [121] = https://curl.se/bug/?i=18651 - [122] = https://curl.se/bug/?i=18650 - [123] = https://curl.se/bug/?i=18648 - [124] = https://curl.se/bug/?i=18644 - [125] = https://curl.se/bug/?i=18654 - [126] = https://curl.se/bug/?i=18645 - [127] = https://curl.se/bug/?i=18727 - [128] = https://curl.se/bug/?i=18726 - [129] = https://curl.se/bug/?i=18725 - [130] = https://curl.se/bug/?i=18724 - [131] = https://curl.se/bug/?i=18723 - [132] = https://curl.se/bug/?i=18720 - [133] = https://curl.se/bug/?i=18718 - [134] = https://curl.se/bug/?i=18717 - [135] = https://curl.se/bug/?i=18401 - [136] = https://curl.se/bug/?i=18227 - [137] = https://curl.se/bug/?i=18719 - [138] = https://curl.se/bug/?i=18894 - [139] = https://curl.se/bug/?i=18714 - [140] = https://curl.se/bug/?i=18715 - [141] = https://curl.se/bug/?i=18776 - [142] = https://curl.se/bug/?i=18713 - [143] = https://curl.se/bug/?i=18712 - [144] = https://curl.se/bug/?i=18711 - [145] = https://curl.se/bug/?i=18682 - [146] = https://curl.se/bug/?i=18779 - [147] = https://curl.se/bug/?i=18778 - [148] = https://curl.se/bug/?i=18816 - [149] = https://curl.se/bug/?i=18775 - [150] = https://curl.se/bug/?i=18510 - [151] = https://curl.se/bug/?i=18774 - [152] = https://curl.se/bug/?i=18762 - [153] = https://curl.se/bug/?i=18811 - [154] = https://curl.se/bug/?i=18817 - [155] = https://curl.se/bug/?i=18815 - [156] = https://curl.se/bug/?i=18893 - [157] = https://curl.se/bug/?i=18806 - [158] = https://curl.se/bug/?i=18980 - [159] = https://curl.se/bug/?i=18924 - [160] = https://curl.se/bug/?i=18810 - [161] = https://curl.se/bug/?i=18749 - [162] = https://curl.se/bug/?i=18808 - [163] = https://curl.se/bug/?i=18747 - [164] = https://curl.se/bug/?i=18744 - [165] = https://curl.se/bug/?i=18662 - [166] = https://curl.se/bug/?i=18891 - [167] = https://curl.se/bug/?i=18804 - [168] = https://curl.se/bug/?i=18803 - [169] = https://curl.se/bug/?i=18805 - [170] = https://curl.se/bug/?i=18807 - [171] = https://curl.se/bug/?i=18801 - [172] = https://curl.se/bug/?i=18800 - [173] = https://curl.se/bug/?i=18799 - [174] = https://curl.se/bug/?i=18889 - [175] = https://curl.se/bug/?i=18887 - [176] = https://curl.se/bug/?i=18780 - [177] = https://curl.se/bug/?i=18787 - [178] = https://curl.se/bug/?i=18790 - [179] = https://curl.se/bug/?i=18793 - [180] = https://curl.se/bug/?i=18886 - [181] = https://curl.se/bug/?i=18884 - [183] = https://curl.se/bug/?i=18921 - [184] = https://curl.se/bug/?i=18878 - [185] = https://curl.se/bug/?i=18875 - [186] = https://curl.se/bug/?i=18874 - [187] = https://curl.se/bug/?i=18979 - [188] = https://curl.se/bug/?i=18940 - [189] = https://curl.se/bug/?i=18932 - [190] = https://curl.se/bug/?i=18976 - [191] = https://curl.se/bug/?i=18888 - [192] = https://curl.se/bug/?i=18873 - [193] = https://curl.se/bug/?i=18871 - [194] = https://curl.se/bug/?i=18870 - [195] = https://curl.se/bug/?i=18869 - [196] = https://curl.se/bug/?i=18867 - [197] = https://curl.se/bug/?i=18882 - [198] = https://curl.se/bug/?i=18862 - [199] = https://curl.se/bug/?i=18877 - [200] = https://curl.se/bug/?i=18865 - [201] = https://curl.se/bug/?i=18864 - [202] = https://curl.se/bug/?i=18863 - [203] = https://curl.se/bug/?i=18975 - [204] = https://curl.se/bug/?i=18859 - [205] = https://curl.se/bug/?i=18880 - [206] = https://curl.se/bug/?i=18868 - [207] = https://curl.se/bug/?i=18872 - [208] = https://curl.se/bug/?i=18972 - [209] = https://curl.se/bug/?i=19043 - [210] = https://curl.se/bug/?i=18035 - [211] = https://curl.se/bug/?i=18860 - [212] = https://curl.se/bug/?i=18858 - [213] = https://curl.se/bug/?i=18855 - [214] = https://curl.se/bug/?i=18857 - [215] = https://curl.se/bug/?i=18927 - [216] = https://curl.se/bug/?i=18852 - [217] = https://curl.se/bug/?i=18851 - [218] = https://curl.se/bug/?i=18850 - [219] = https://curl.se/bug/?i=18922 - [220] = https://curl.se/bug/?i=18845 - [221] = https://curl.se/bug/?i=18838 - [222] = https://curl.se/bug/?i=18904 - [223] = https://curl.se/bug/?i=18843 - [224] = https://curl.se/bug/?i=18842 - [225] = https://curl.se/bug/?i=18841 - [226] = https://curl.se/bug/?i=18839 - [227] = https://curl.se/bug/?i=18904 - [228] = https://curl.se/bug/?i=18823 - [229] = https://curl.se/bug/?i=18836 - [230] = https://curl.se/bug/?i=18902 - [231] = https://curl.se/bug/?i=18835 - [232] = https://curl.se/bug/?i=18918 - [233] = https://curl.se/bug/?i=19015 - [234] = https://curl.se/bug/?i=18828 - [235] = https://curl.se/bug/?i=18909 - [236] = https://curl.se/bug/?i=18905 - [237] = https://curl.se/bug/?i=18907 - [238] = https://curl.se/bug/?i=18829 - [239] = https://curl.se/bug/?i=18812 - [240] = https://curl.se/bug/?i=18703 - [241] = https://curl.se/bug/?i=18966 - [242] = https://curl.se/bug/?i=18961 - [243] = https://curl.se/bug/?i=18914 - [244] = https://curl.se/bug/?i=19013 - [245] = https://curl.se/bug/?i=18911 - [246] = https://curl.se/bug/?i=18883 - [247] = https://curl.se/bug/?i=18908 - [248] = https://curl.se/bug/?i=18903 - [249] = https://curl.se/bug/?i=18903 - [250] = https://curl.se/bug/?i=18432 - [251] = https://curl.se/bug/?i=18881 - [252] = https://curl.se/bug/?i=18890 - [253] = https://curl.se/bug/?i=19012 - [254] = https://curl.se/bug/?i=18967 - [255] = https://curl.se/bug/?i=18969 - [256] = https://curl.se/bug/?i=18953 - [257] = https://curl.se/bug/?i=18959 - [258] = https://hackerone.com/reports/3373640 - [259] = https://curl.se/bug/?i=18933 - [260] = https://curl.se/bug/?i=18931 - [261] = https://curl.se/bug/?i=18930 - [262] = https://curl.se/bug/?i=18952 - [263] = https://curl.se/bug/?i=18952 - [264] = https://curl.se/bug/?i=18937 - [265] = https://curl.se/bug/?i=18936 - [266] = https://curl.se/bug/?i=18934 - [267] = https://curl.se/bug/?i=18928 - [268] = https://curl.se/bug/?i=18957 - [269] = https://curl.se/bug/?i=18951 - [270] = https://curl.se/bug/?i=18999 - [271] = https://curl.se/bug/?i=18998 - [272] = https://curl.se/bug/?i=18995 - [273] = https://curl.se/bug/?i=18968 - [274] = https://curl.se/bug/?i=18965 - [275] = https://curl.se/bug/?i=18964 - [276] = https://curl.se/bug/?i=18938 - [277] = https://curl.se/bug/?i=18994 - [278] = https://curl.se/bug/?i=18993 - [279] = https://curl.se/bug/?i=18992 - [280] = https://curl.se/bug/?i=18973 - [281] = https://curl.se/bug/?i=19044 - [282] = https://curl.se/bug/?i=18990 - [283] = https://curl.se/bug/?i=18989 - [284] = https://curl.se/bug/?i=18988 - [285] = https://curl.se/bug/?i=18978 - [286] = https://curl.se/bug/?i=18986 - [287] = https://curl.se/bug/?i=18985 - [288] = https://curl.se/bug/?i=18984 - [289] = https://curl.se/bug/?i=19079 - [290] = https://curl.se/bug/?i=19042 - [291] = https://curl.se/bug/?i=19040 - [292] = https://curl.se/bug/?i=19039 - [293] = https://curl.se/bug/?i=19029 - [294] = https://curl.se/bug/?i=19035 - [295] = https://curl.se/bug/?i=19072 - [296] = https://curl.se/bug/?i=19033 - [297] = https://curl.se/bug/?i=19032 - [298] = https://curl.se/bug/?i=19031 - [299] = https://curl.se/bug/?i=19030 - [300] = https://curl.se/bug/?i=19025 - [301] = https://curl.se/bug/?i=19006 - [302] = https://curl.se/bug/?i=19004 - [303] = https://curl.se/bug/?i=19003 - [304] = https://curl.se/bug/?i=19027 - [305] = https://curl.se/bug/?i=19026 - [306] = https://curl.se/bug/?i=19014 - [307] = https://curl.se/bug/?i=18996 - [308] = https://curl.se/bug/?i=19071 - [309] = https://curl.se/bug/?i=19059 - [310] = https://curl.se/bug/?i=18926 - [311] = https://curl.se/bug/?i=19060 - [312] = https://curl.se/bug/?i=19070 - [313] = https://curl.se/bug/?i=19069 - [314] = https://curl.se/bug/?i=19110 - [315] = https://curl.se/bug/?i=19065 - [316] = https://curl.se/bug/?i=19017 - [317] = https://curl.se/bug/?i=16143 - [318] = https://curl.se/bug/?i=19055 - [319] = https://curl.se/bug/?i=19151 - [320] = https://curl.se/mail/lib-2025-10/0018.html - [321] = https://curl.se/bug/?i=19053 - [322] = https://curl.se/bug/?i=19052 - [323] = https://curl.se/bug/?i=19051 - [324] = https://curl.se/bug/?i=19048 - [325] = https://curl.se/bug/?i=19106 - [326] = https://curl.se/bug/?i=19064 - [327] = https://curl.se/bug/?i=19147 - [328] = https://curl.se/bug/?i=19104 - [329] = https://curl.se/bug/?i=19143 - [330] = https://curl.se/bug/?i=19101 - [331] = https://curl.se/bug/?i=19046 - [332] = https://curl.se/bug/?i=19102 - [333] = https://curl.se/bug/?i=19205 - [334] = https://curl.se/bug/?i=19100 - [335] = https://curl.se/bug/?i=19125 - [336] = https://curl.se/bug/?i=19145 - [337] = https://curl.se/bug/?i=19097 - [338] = https://curl.se/bug/?i=19184 - [339] = https://curl.se/bug/?i=19091 - [340] = https://curl.se/bug/?i=19093 - [341] = https://curl.se/bug/?i=19149 - [342] = https://curl.se/bug/?i=19094 - [343] = https://curl.se/bug/?i=19095 - [344] = https://curl.se/bug/?i=19077 - [345] = https://curl.se/bug/?i=19089 - [346] = https://curl.se/bug/?i=19088 - [347] = https://issues.oss-fuzz.com/issues/432441303 - [348] = https://curl.se/bug/?i=19086 - [349] = https://curl.se/bug/?i=19076 - [350] = https://curl.se/bug/?i=19293 - [351] = https://curl.se/bug/?i=19141 - [352] = https://curl.se/bug/?i=19265 - [353] = https://curl.se/bug/?i=19073 - [354] = https://curl.se/bug/?i=19078 - [355] = https://curl.se/bug/?i=19135 - [356] = https://curl.se/bug/?i=19267 - [357] = https://curl.se/bug/?i=19136 - [358] = https://curl.se/bug/?i=19133 - [359] = https://curl.se/bug/?i=19139 - [360] = https://curl.se/bug/?i=19179 - [361] = https://curl.se/bug/?i=19126 - [362] = https://curl.se/bug/?i=19132 - [363] = https://curl.se/bug/?i=19118 - [364] = https://curl.se/bug/?i=19157 - [365] = https://curl.se/bug/?i=19112 - [366] = https://curl.se/bug/?i=19124 - [367] = https://curl.se/bug/?i=19115 - [368] = https://curl.se/bug/?i=19120 - [369] = https://curl.se/bug/?i=19119 - [370] = https://curl.se/bug/?i=19122 - [371] = https://curl.se/bug/?i=19123 - [372] = https://curl.se/bug/?i=19116 - [373] = https://curl.se/bug/?i=19114 - [374] = https://curl.se/bug/?i=19113 - [375] = https://curl.se/bug/?i=18848 - [376] = https://curl.se/bug/?i=19111 - [377] = https://curl.se/bug/?i=19176 - [378] = https://curl.se/bug/?i=19169 - [379] = https://curl.se/bug/?i=19163 - [380] = https://curl.se/bug/?i=19168 - [381] = https://curl.se/bug/?i=9328 - [382] = https://curl.se/bug/?i=19170 - [383] = https://curl.se/bug/?i=19226 - [384] = https://curl.se/bug/?i=19225 - [385] = https://curl.se/bug/?i=19222 - [386] = https://curl.se/bug/?i=19018 - [387] = https://curl.se/bug/?i=19224 - [388] = https://curl.se/bug/?i=19161 - [389] = https://curl.se/bug/?i=19160 - [390] = https://curl.se/bug/?i=19137 - [391] = https://curl.se/bug/?i=19223 - [392] = https://curl.se/bug/?i=19266 - [393] = https://curl.se/bug/?i=19130 - [394] = https://curl.se/bug/?i=19153 - [395] = https://curl.se/bug/?i=19346 - [396] = https://curl.se/bug/?i=19259 - [397] = https://curl.se/bug/?i=19258 - [398] = https://curl.se/bug/?i=19252 - [399] = https://curl.se/bug/?i=19206 - [400] = https://curl.se/bug/?i=19208 - [401] = https://curl.se/bug/?i=19345 - [402] = https://curl.se/bug/?i=19211 - [403] = https://curl.se/bug/?i=19213 - [404] = https://curl.se/bug/?i=18991 - [405] = https://curl.se/bug/?i=19255 - [406] = https://curl.se/bug/?i=19202 - [407] = https://curl.se/bug/?i=19200 - [408] = https://curl.se/bug/?i=19201 - [409] = https://curl.se/bug/?i=19199 - [410] = https://curl.se/bug/?i=18798 - [411] = https://curl.se/bug/?i=19165 - [412] = https://curl.se/bug/?i=19198 - [413] = https://curl.se/bug/?i=19196 - [414] = https://curl.se/bug/?i=19195 - [415] = https://issues.oss-fuzz.com/issues/435278402 - [416] = https://curl.se/bug/?i=19194 - [417] = https://curl.se/bug/?i=19192 - [418] = https://curl.se/bug/?i=19191 - [419] = https://curl.se/bug/?i=19190 - [420] = https://curl.se/bug/?i=19188 - [421] = https://curl.se/bug/?i=19186 - [422] = https://curl.se/bug/?i=19187 - [423] = https://curl.se/bug/?i=19185 - [424] = https://curl.se/bug/?i=19227 - [425] = https://curl.se/bug/?i=19247 - [426] = https://curl.se/bug/?i=19292 - [427] = https://curl.se/bug/?i=19228 - [428] = https://curl.se/bug/?i=19291 - [429] = https://curl.se/bug/?i=19167 - [430] = https://curl.se/bug/?i=19237 - [431] = https://curl.se/bug/?i=19353 - [432] = https://curl.se/bug/?i=19288 - [433] = https://curl.se/bug/?i=19323 - [434] = https://curl.se/bug/?i=19310 - [435] = https://curl.se/bug/?i=19301 - [436] = https://curl.se/bug/?i=19344 - [437] = https://curl.se/bug/?i=19343 - [438] = https://curl.se/bug/?i=19271 - [439] = https://curl.se/bug/?i=19278 - [440] = https://curl.se/bug/?i=19229 - [441] = https://curl.se/bug/?i=18847 - [442] = https://curl.se/bug/?i=19276 - [443] = https://curl.se/bug/?i=19275 - [444] = https://curl.se/bug/?i=19274 - [445] = https://curl.se/bug/?i=19240 - [446] = https://curl.se/bug/?i=19109 - [447] = https://curl.se/bug/?i=19340 - [448] = https://curl.se/bug/?i=18983 - [449] = https://curl.se/bug/?i=19148 - [450] = https://curl.se/bug/?i=19304 - [451] = https://curl.se/bug/?i=19306 - [452] = https://curl.se/bug/?i=19334 - [453] = https://curl.se/bug/?i=19358 - [454] = https://curl.se/bug/?i=19312 - [455] = https://curl.se/bug/?i=19309 - [456] = https://curl.se/bug/?i=19362 - [457] = https://curl.se/bug/?i=19351 - [458] = https://curl.se/bug/?i=19360 + [2] = https://curl.se/bug/?i=19366 + [3] = https://curl.se/bug/?i=19370 + [4] = https://curl.se/bug/?i=19371 diff --git a/docs/THANKS-filter b/docs/THANKS-filter index 2adf52c9e81a..501b649f7632 100644 --- a/docs/THANKS-filter +++ b/docs/THANKS-filter @@ -160,4 +160,4 @@ s/jethrogb$/jethrogb on github/ s/on github/on github/i s/Maksim Sciepanienka/Maksim Ściepanienka/ s/Qriist.*/Qriist on github/ -s/Viktor Szakatas/Viktor Szakats +s/Viktor Szakatas/Viktor Szakats/ diff --git a/include/curl/curlver.h b/include/curl/curlver.h index 19b2bf87521b..8977d9eb410d 100644 --- a/include/curl/curlver.h +++ b/include/curl/curlver.h @@ -32,13 +32,13 @@ /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "8.17.0-DEV" +#define LIBCURL_VERSION "8.17.1-DEV" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 8 #define LIBCURL_VERSION_MINOR 17 -#define LIBCURL_VERSION_PATCH 0 +#define LIBCURL_VERSION_PATCH 1 /* This is the numeric version of the libcurl version number, meant for easier parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will always follow this syntax: @@ -58,7 +58,7 @@ CURL_VERSION_BITS() macro since curl's own configure script greps for it and needs it to contain the full number. */ -#define LIBCURL_VERSION_NUM 0x081100 +#define LIBCURL_VERSION_NUM 0x081101 /* * This is the date and time when the full source package was created. The From a8bef390360518d6e89e17d975ac0210cb3b9a8c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Nov 2025 10:17:28 +0100 Subject: [PATCH 239/885] openssl: remove code handling default version Since it is no longer actually kept as default internally, that's just dead code. Follow-up to 9d8998c99408e1adf8eba629fad9f Closes #19354 --- lib/vtls/openssl.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 764d82932553..87b00cc252a9 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2904,6 +2904,8 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, long ossl_ssl_version_min = 0; long ossl_ssl_version_max = 0; #endif + /* it cannot be default here */ + DEBUGASSERT(curl_ssl_version_min != CURL_SSLVERSION_DEFAULT); switch(curl_ssl_version_min) { case CURL_SSLVERSION_TLSv1: /* TLS 1.x */ case CURL_SSLVERSION_TLSv1_0: @@ -2924,18 +2926,6 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, #endif } - /* CURL_SSLVERSION_DEFAULT means that no option was selected. - We do not want to pass 0 to SSL_CTX_set_min_proto_version as - it would enable all versions down to the lowest supported by - the library. - So we skip this, and stay with the library default - */ - if(curl_ssl_version_min != CURL_SSLVERSION_DEFAULT) { - if(!SSL_CTX_set_min_proto_version(ctx, ossl_ssl_version_min)) { - return CURLE_SSL_CONNECT_ERROR; - } - } - /* ... then, TLS max version */ curl_ssl_version_max = (long)conn_config->version_max; @@ -2965,9 +2955,9 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, break; } - if(!SSL_CTX_set_max_proto_version(ctx, ossl_ssl_version_max)) { + if(!SSL_CTX_set_min_proto_version(ctx, ossl_ssl_version_min) || + !SSL_CTX_set_max_proto_version(ctx, ossl_ssl_version_max)) return CURLE_SSL_CONNECT_ERROR; - } return CURLE_OK; } From c12a1fdd0e8151e2d36fb695ea96959c2aa85f07 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Nov 2025 14:30:41 +0100 Subject: [PATCH 240/885] tests: remove trailing spaces in server responses Allows us to drop lots of %spc% from test cases making them easier on the eye. Closes #19374 --- tests/data/test1349 | 8 ++++---- tests/data/test1350 | 8 ++++---- tests/data/test1351 | 8 ++++---- tests/data/test1352 | 8 ++++---- tests/data/test1353 | 8 ++++---- tests/data/test1354 | 8 ++++---- tests/data/test1357 | 8 ++++---- tests/data/test1358 | 8 ++++---- tests/data/test1359 | 8 ++++---- tests/data/test1360 | 8 ++++---- tests/data/test1361 | 8 ++++---- tests/data/test1362 | 8 ++++---- tests/data/test1379 | 8 ++++---- tests/data/test1380 | 8 ++++---- tests/data/test1381 | 8 ++++---- tests/data/test1382 | 8 ++++---- tests/data/test1383 | 8 ++++---- tests/data/test1384 | 8 ++++---- tests/data/test1387 | 8 ++++---- tests/data/test1388 | 8 ++++---- tests/data/test1389 | 8 ++++---- tests/data/test1390 | 8 ++++---- tests/data/test1391 | 8 ++++---- tests/data/test1392 | 8 ++++---- tests/data/test897 | 8 ++++---- tests/ftpserver.pl | 32 ++++++++++++++++---------------- 26 files changed, 116 insertions(+), 116 deletions(-) diff --git a/tests/data/test1349 b/tests/data/test1349 index da34bcf87c16..faf1260c2824 100644 --- a/tests/data/test1349 +++ b/tests/data/test1349 @@ -49,10 +49,10 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1350 b/tests/data/test1350 index a795a0bd3268..9fd7f897857a 100644 --- a/tests/data/test1350 +++ b/tests/data/test1350 @@ -49,10 +49,10 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1351 b/tests/data/test1351 index 99625533ec3b..139537e378c6 100644 --- a/tests/data/test1351 +++ b/tests/data/test1351 @@ -50,10 +50,10 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1352 b/tests/data/test1352 index 0d48522dd6bc..cba83dc6640c 100644 --- a/tests/data/test1352 +++ b/tests/data/test1352 @@ -50,10 +50,10 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1353 b/tests/data/test1353 index d8ad1c7760d5..d454b02501bc 100644 --- a/tests/data/test1353 +++ b/tests/data/test1353 @@ -49,10 +49,10 @@ mooo # The final "221 bye bye baby" response to QUIT will not be recorded # since that is not considered part of this particular transfer! -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1354 b/tests/data/test1354 index cde07f4605fd..94cc34453352 100644 --- a/tests/data/test1354 +++ b/tests/data/test1354 @@ -47,10 +47,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1357 b/tests/data/test1357 index e81c5b46adb9..a83605b88706 100644 --- a/tests/data/test1357 +++ b/tests/data/test1357 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1358 b/tests/data/test1358 index 1bb1053cf913..f5bda613bec3 100644 --- a/tests/data/test1358 +++ b/tests/data/test1358 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1359 b/tests/data/test1359 index 574720655267..a4c98addd509 100644 --- a/tests/data/test1359 +++ b/tests/data/test1359 @@ -63,10 +63,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1360 b/tests/data/test1360 index acd4f8f6c3c4..d2108ef7a6aa 100644 --- a/tests/data/test1360 +++ b/tests/data/test1360 @@ -63,10 +63,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1361 b/tests/data/test1361 index 390366817c2a..242162c8eee8 100644 --- a/tests/data/test1361 +++ b/tests/data/test1361 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1362 b/tests/data/test1362 index f4ea6917565e..6695b740e570 100644 --- a/tests/data/test1362 +++ b/tests/data/test1362 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1379 b/tests/data/test1379 index f938ba659ebc..6630161e568c 100644 --- a/tests/data/test1379 +++ b/tests/data/test1379 @@ -47,10 +47,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1380 b/tests/data/test1380 index d6dc739d82af..b4f5dccd877c 100644 --- a/tests/data/test1380 +++ b/tests/data/test1380 @@ -47,10 +47,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1381 b/tests/data/test1381 index 520d0a066b2a..cf635ffe464f 100644 --- a/tests/data/test1381 +++ b/tests/data/test1381 @@ -48,10 +48,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1382 b/tests/data/test1382 index c9f53dd06579..8c270ad7ae4e 100644 --- a/tests/data/test1382 +++ b/tests/data/test1382 @@ -48,10 +48,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1383 b/tests/data/test1383 index 24e339d9789f..319b6ca7d207 100644 --- a/tests/data/test1383 +++ b/tests/data/test1383 @@ -47,10 +47,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1384 b/tests/data/test1384 index 490d9a5e8be7..a36a11eee72c 100644 --- a/tests/data/test1384 +++ b/tests/data/test1384 @@ -47,10 +47,10 @@ mooo -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1387 b/tests/data/test1387 index 4002c28e01ad..dc28f4ccd54a 100644 --- a/tests/data/test1387 +++ b/tests/data/test1387 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1388 b/tests/data/test1388 index 21491ab40f59..3706fe14340a 100644 --- a/tests/data/test1388 +++ b/tests/data/test1388 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1389 b/tests/data/test1389 index 2f247d45dc82..e9566cca844e 100644 --- a/tests/data/test1389 +++ b/tests/data/test1389 @@ -63,10 +63,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1390 b/tests/data/test1390 index 9c180b65a61b..0a3cdce5683c 100644 --- a/tests/data/test1390 +++ b/tests/data/test1390 @@ -63,10 +63,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1391 b/tests/data/test1391 index f29e02859279..daa22eabc6ed 100644 --- a/tests/data/test1391 +++ b/tests/data/test1391 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test1392 b/tests/data/test1392 index 598facd1561a..6678c67000bd 100644 --- a/tests/data/test1392 +++ b/tests/data/test1392 @@ -62,10 +62,10 @@ MOOOO -220- _ _ ____ _%spc%%spc%%spc%%spc%%spc% -220- ___| | | | _ \| |%spc%%spc%%spc%%spc% -220- / __| | | | |_) | |%spc%%spc%%spc%%spc% -220- | (__| |_| | _ {| |___%spc% +220- _ _ ____ _ +220- ___| | | | _ \| | +220- / __| | | | |_) | | +220- | (__| |_| | _ {| |___ 220 \___|\___/|_| \_\_____| 331 We are happy you popped in! 230 Welcome you silly person diff --git a/tests/data/test897 b/tests/data/test897 index e7119cf34dc1..acf1cd5fe4d7 100644 --- a/tests/data/test897 +++ b/tests/data/test897 @@ -46,10 +46,10 @@ A004 FETCH 123 BODY[1] A005 LOGOUT - _ _ ____ _%spc%%spc%%spc%%spc%%spc% - ___| | | | _ \| |%spc%%spc%%spc%%spc% - / __| | | | |_) | |%spc%%spc%%spc%%spc% - | (__| |_| | _ {| |___%spc% + _ _ ____ _ + ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ {| |___ \___|\___/|_| \_\_____| * OK curl IMAP server ready to serve A001 BAD Command diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index f70fa0d0ee7e..cd725fccfdb9 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -573,10 +573,10 @@ sub protocolsetup { 'PBSZ' => '500 PBSZ not implemented', 'PROT' => '500 PROT not implemented', 'welcome' => join("", - '220- _ _ ____ _ '."\r\n", - '220- ___| | | | _ \| | '."\r\n", - '220- / __| | | | |_) | | '."\r\n", - '220- | (__| |_| | _ {| |___ '."\r\n", + '220- _ _ ____ _'."\r\n", + '220- ___| | | | _ \| |'."\r\n", + '220- / __| | | | |_) | |'."\r\n", + '220- | (__| |_| | _ {| |___'."\r\n", '220 \___|\___/|_| \_\_____|'."\r\n") ); } @@ -599,10 +599,10 @@ sub protocolsetup { ); %displaytext = ( 'welcome' => join("", - ' _ _ ____ _ '."\r\n", - ' ___| | | | _ \| | '."\r\n", - ' / __| | | | |_) | | '."\r\n", - ' | (__| |_| | _ {| |___ '."\r\n", + ' _ _ ____ _'."\r\n", + ' ___| | | | _ \| |'."\r\n", + ' / __| | | | |_) | |'."\r\n", + ' | (__| |_| | _ {| |___'."\r\n", ' \___|\___/|_| \_\_____|'."\r\n", '+OK curl POP3 server ready to serve '."\r\n") ); @@ -634,10 +634,10 @@ sub protocolsetup { ); %displaytext = ( 'welcome' => join("", - ' _ _ ____ _ '."\r\n", - ' ___| | | | _ \| | '."\r\n", - ' / __| | | | |_) | | '."\r\n", - ' | (__| |_| | _ {| |___ '."\r\n", + ' _ _ ____ _'."\r\n", + ' ___| | | | _ \| |'."\r\n", + ' / __| | | | |_) | |'."\r\n", + ' | (__| |_| | _ {| |___'."\r\n", ' \___|\___/|_| \_\_____|'."\r\n", '* OK curl IMAP server ready to serve'."\r\n") ); @@ -658,10 +658,10 @@ sub protocolsetup { ); %displaytext = ( 'welcome' => join("", - '220- _ _ ____ _ '."\r\n", - '220- ___| | | | _ \| | '."\r\n", - '220- / __| | | | |_) | | '."\r\n", - '220- | (__| |_| | _ {| |___ '."\r\n", + '220- _ _ ____ _'."\r\n", + '220- ___| | | | _ \| |'."\r\n", + '220- / __| | | | |_) | |'."\r\n", + '220- | (__| |_| | _ {| |___'."\r\n", '220 \___|\___/|_| \_\_____|'."\r\n") ); } From 6d7e924e80096a7e2cebad16235674fd3d3012af Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Nov 2025 14:40:18 +0100 Subject: [PATCH 241/885] checksrc.pl: detect assign followed by more than one space And fix some code previously doing this. Closes #19375 --- lib/cf-h2-proxy.c | 6 +++--- scripts/checksrc.pl | 7 +++++++ tests/libtest/lib557.c | 16 ++++++++-------- tests/server/tftpd.c | 2 +- tests/unit/unit1303.c | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index f9bd827374fa..b0638c664287 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -99,9 +99,9 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf, if(result) return result; - ts->authority = /* host:port with IPv6 support */ - curl_maprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname, - ipv6_ip ? "]" : "", port); + /* host:port with IPv6 support */ + ts->authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname, + ipv6_ip ? "]" : "", port); if(!ts->authority) return CURLE_OUT_OF_MEMORY; diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 7059d6857500..5dcad3e31526 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -131,6 +131,7 @@ 'DOBRACE' => 'A single space between do and open brace', 'EMPTYLINEBRACE' => 'Empty line before the open brace', 'EQUALSNOSPACE' => 'equals sign without following space', + 'EQUALSPACE' => 'equals sign with too many spaces following', 'EQUALSNULL' => 'if/while comparison with == NULL', 'ERRNOVAR' => 'use of bare errno define', 'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression', @@ -1039,6 +1040,12 @@ sub scanfile { $line, length($1)+1, $file, $ol, "no space before equals sign"); } + # check for equals sign with more than one space after it + elsif($l =~ /(.*)[a-z0-9] \= /i) { + checkwarn("EQUALSPACE", + $line, length($1)+3, $file, $ol, + "more than one space after equals sign"); + } # check for plus signs without spaces next to it if($nostr =~ /(.*)[^+]\+[a-z0-9]/i) { diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index f831c9bfc252..84f61202117c 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -205,7 +205,7 @@ static int test_signed_short_formatting(void) i++; ss_test[i].num = -0x0050 -1; ss_test[i].expected = "-81"; i++; ss_test[i].num = -0x0005 -1; ss_test[i].expected = "-6"; - i++; ss_test[i].num = 0x0000 -1; ss_test[i].expected = "-1"; + i++; ss_test[i].num = 0x0000 -1; ss_test[i].expected = "-1"; num_sshort_tests = i; @@ -431,7 +431,7 @@ static int test_signed_int_formatting(void) i++; si_test[i].num = -0x0050 -1; si_test[i].expected = "-81"; i++; si_test[i].num = -0x0005 -1; si_test[i].expected = "-6"; - i++; si_test[i].num = 0x0000 -1; si_test[i].expected = "-1"; + i++; si_test[i].num = 0x0000 -1; si_test[i].expected = "-1"; num_sint_tests = i; @@ -498,7 +498,7 @@ static int test_signed_int_formatting(void) i++; si_test[i].num = -0x00000050 -1; si_test[i].expected = "-81"; i++; si_test[i].num = -0x00000005 -1; si_test[i].expected = "-6"; - i++; si_test[i].num = 0x00000000 -1; si_test[i].expected = "-1"; + i++; si_test[i].num = 0x00000000 -1; si_test[i].expected = "-1"; num_sint_tests = i; @@ -581,7 +581,7 @@ static int test_signed_int_formatting(void) i++; si_test[i].num = -0x0000000000000070 -1; si_test[i].expected = "-113"; i++; si_test[i].num = -0x0000000000000007 -1; si_test[i].expected = "-8"; - i++; si_test[i].num = 0x0000000000000000 -1; si_test[i].expected = "-1"; + i++; si_test[i].num = 0x0000000000000000 -1; si_test[i].expected = "-1"; num_sint_tests = i; @@ -808,7 +808,7 @@ static int test_signed_long_formatting(void) i++; sl_test[i].num = -0x0050L -1L; sl_test[i].expected = "-81"; i++; sl_test[i].num = -0x0005L -1L; sl_test[i].expected = "-6"; - i++; sl_test[i].num = 0x0000L -1L; sl_test[i].expected = "-1"; + i++; sl_test[i].num = 0x0000L -1L; sl_test[i].expected = "-1"; num_slong_tests = i; @@ -875,7 +875,7 @@ static int test_signed_long_formatting(void) i++; sl_test[i].num = -0x00000050L -1L; sl_test[i].expected = "-81"; i++; sl_test[i].num = -0x00000005L -1L; sl_test[i].expected = "-6"; - i++; sl_test[i].num = 0x00000000L -1L; sl_test[i].expected = "-1"; + i++; sl_test[i].num = 0x00000000L -1L; sl_test[i].expected = "-1"; num_slong_tests = i; @@ -958,7 +958,7 @@ static int test_signed_long_formatting(void) i++; sl_test[i].num = -0x0000000000000070L -1L; sl_test[i].expected = "-113"; i++; sl_test[i].num = -0x0000000000000007L -1L; sl_test[i].expected = "-8"; - i++; sl_test[i].num = 0x0000000000000000L -1L; sl_test[i].expected = "-1"; + i++; sl_test[i].num = 0x0000000000000000L -1L; sl_test[i].expected = "-1"; num_slong_tests = i; @@ -1074,7 +1074,7 @@ static int test_curl_off_t_formatting(void) i++; co_test[i].num = -0x0000000000000070 -1; co_test[i].expected = "-113"; i++; co_test[i].num = -0x0000000000000007 -1; co_test[i].expected = "-8"; - i++; co_test[i].num = 0x0000000000000000 -1; co_test[i].expected = "-1"; + i++; co_test[i].num = 0x0000000000000000 -1; co_test[i].expected = "-1"; num_cofft_tests = i; diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 64f005dfe5f4..31ae5c8a3943 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -310,7 +310,7 @@ static struct tftphdr *rw_init(int x) { newline = 0; /* init crlf flag */ prevchar = -1; - bfs[0].counter = BF_ALLOC; /* pass out the first buffer */ + bfs[0].counter = BF_ALLOC; /* pass out the first buffer */ current = 0; bfs[1].counter = BF_FREE; nextone = x; /* ahead or behind? */ diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c index 49ff3e69f2ce..1ce367b6a796 100644 --- a/tests/unit/unit1303.c +++ b/tests/unit/unit1303.c @@ -148,7 +148,7 @@ static CURLcode test_unit1303(const char *arg) timediff_t timeout; NOW(run[i].now_s, run[i].now_us); TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms); - timeout = Curl_timeleft(easy, &now, run[i].connecting); + timeout = Curl_timeleft(easy, &now, run[i].connecting); if(timeout != run[i].result) fail(run[i].comment); } From 87f448ed525c88515dfdf6f055eee744a6180e6a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 10:52:26 +0000 Subject: [PATCH 242/885] Dockerfile: update debian:bookworm-slim digest to 936abff Closes #19348 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fc5bf9e1ef6d..3d2e942cdff4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ # $ ./scripts/maketgz 8.7.1 # To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags -FROM debian:bookworm-slim@sha256:78d2f66e0fec9e5a39fb2c72ea5e052b548df75602b5215ed01a17171529f706 +FROM debian:bookworm-slim@sha256:936abff852736f951dab72d91a1b6337cf04217b2a77a5eaadc7c0f2f1ec1758 RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \ build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \ From 403a2c2b06eb1ab483f7140f43f062865248269d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2025 04:05:19 +0100 Subject: [PATCH 243/885] tests: shorten space and tab macro names Easier to write and read. Follow-up to d29f14b9cf0d38f3887b6eadc71af16903bc7f5b #19300 Closes #19349 --- docs/tests/FILEFORMAT.md | 4 ++-- tests/data/test1029 | 2 +- tests/data/test1070 | 2 +- tests/data/test1090 | 2 +- tests/data/test1105 | 6 +++--- tests/data/test1185 | 10 +++++----- tests/data/test136 | 2 +- tests/data/test1461 | 4 ++-- tests/data/test1654 | 2 +- tests/data/test1664 | 2 +- tests/data/test17 | 2 +- tests/data/test1700 | 4 ++-- tests/data/test1701 | 2 +- tests/data/test1702 | 2 +- tests/data/test188 | 4 ++-- tests/data/test189 | 4 ++-- tests/data/test1940 | 4 ++-- tests/data/test1955 | 2 +- tests/data/test1958 | 2 +- tests/data/test212 | 4 ++-- tests/data/test2302 | 2 +- tests/data/test2306 | 2 +- tests/data/test2400 | 2 +- tests/data/test2401 | 2 +- tests/data/test2403 | 2 +- tests/data/test2406 | 2 +- tests/data/test2500 | 2 +- tests/data/test2501 | 2 +- tests/data/test2503 | 2 +- tests/data/test358 | 4 ++-- tests/data/test359 | 4 ++-- tests/data/test378 | 2 +- tests/data/test4 | 4 ++-- tests/data/test421 | 2 +- tests/data/test459 | 2 +- tests/data/test46 | 8 ++++---- tests/data/test54 | 2 +- tests/data/test646 | 2 +- tests/data/test792 | 2 +- tests/data/test793 | 2 +- tests/testutil.pm | 4 ++-- 41 files changed, 61 insertions(+), 61 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 070735836e5f..9703df9aa832 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -81,8 +81,8 @@ For example, to insert the word hello 100 times: To add significant whitespace characters at the end of the line, or to empty lines: - %spc% - %tab% + %SP - space + %TAB - horizontal tab ## Insert capped epoch days diff --git a/tests/data/test1029 b/tests/data/test1029 index ac636449cb40..2004791cd847 100644 --- a/tests/data/test1029 +++ b/tests/data/test1029 @@ -50,7 +50,7 @@ Content-Length: 62 Connection: close This server reply is for testing a simple Location: following -http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER 0%spc% +http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER 0%SP diff --git a/tests/data/test1070 b/tests/data/test1070 index 39e2d408f8a8..3305b7b2b2a8 100644 --- a/tests/data/test1070 +++ b/tests/data/test1070 @@ -57,7 +57,7 @@ Expect: 100-continue Content-Length: 2313 Content-Type: application/x-www-form-urlencoded -This creates%spc% +This creates%SP diff --git a/tests/data/test1090 b/tests/data/test1090 index ad3c59d1136f..0e3879c68c8f 100644 --- a/tests/data/test1090 +++ b/tests/data/test1090 @@ -30,7 +30,7 @@ Connection: close Content-Type: text/plain; charset=us-ascii 0007 -bigger%spc% +bigger%SP 0008 monster diff --git a/tests/data/test1105 b/tests/data/test1105 index aa84c862cb11..d23b92f560f5 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -19,9 +19,9 @@ Funny-head: yesyes swsclose Set-Cookie: foobar=name; Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; Set-Cookie: partmatch=present; domain=.0.0.1; path=/; -Set-Cookie: foo%tab%bar=barfoo -Set-Cookie: bar%tab%foo= -Set-Cookie: bar=foo%tab%bar +Set-Cookie: foo%TABbar=barfoo +Set-Cookie: bar%TABfoo= +Set-Cookie: bar=foo%TABbar diff --git a/tests/data/test1185 b/tests/data/test1185 index 64eef418005e..26852a641835 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -20,7 +20,7 @@ checksrc * Violate each rule at least once. **/ int hello; /*------------------------------------------------------------------*/ -int%tab%tab; +int%TABtab; int trailing_space; int a = func (); int b = func( b); @@ -91,7 +91,7 @@ void startfunc(int a, int b) { ./%LOGDIR/code1185.c:4:82: warning: Longer than 79 columns (LONGLINE) int hello; /*------------------------------------------------------------------*/ ./%LOGDIR/code1185.c:5:4: error: Contains TAB character (TABS) - int%tab%tab; + int%TABtab; ^ ./%LOGDIR/code1185.c:7:13: warning: func with space (SPACEBEFOREPAREN) int a = func (); @@ -118,7 +118,7 @@ void startfunc(int a, int b) { } else { ^ ./%LOGDIR/code1185.c:24:11: warning: missing space after close paren (PARENBRACE) - if(a == 2){%spc%%spc% + if(a == 2){%SP%SP ^ ./%LOGDIR/code1185.c:28:14: warning: no space before semicolon (SPACESEMICOLON) func_return() ; @@ -205,10 +205,10 @@ void startfunc(int a, int b) { // CPP comment ? ^ ./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT) -%spc% +%SP ^ ./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT) -%spc% +%SP ^ checksrc: 0 errors and 41 warnings diff --git a/tests/data/test136 b/tests/data/test136 index 70537719cce8..c869c612bf13 100644 --- a/tests/data/test136 +++ b/tests/data/test136 @@ -30,7 +30,7 @@ FTP with user and no password USER user -PASS%spc% +PASS%SP PWD EPSV TYPE I diff --git a/tests/data/test1461 b/tests/data/test1461 index 71de31772dd7..4ee109a12299 100644 --- a/tests/data/test1461 +++ b/tests/data/test1461 @@ -47,8 +47,8 @@ Usage: curl [options...] This is not the full help; this menu is split into categories. Use "--help category" to get an overview of all categories, which are: -auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap,%spc% -output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls,%spc% +auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap,%SP +output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls,%SP upload, verbose. Use "--help all" to list all options Use "--help [option]" to view documentation for a given option diff --git a/tests/data/test1654 b/tests/data/test1654 index 3b8823644167..8f3cae15569e 100644 --- a/tests/data/test1654 +++ b/tests/data/test1654 @@ -27,7 +27,7 @@ h2 example.com 443 h3 shiny.example.com 8443 "20191231 00:00:00" 0 0 # a comment h2 foo.example.com 443 h3 shiny.example.com 8443 "20291231 23:30:00" 0 0 h1 example.com 443 h3 shiny.example.com 8443 "20121231 00:00:01" 0 0 -%tab%h3 example.com 443 h3 shiny.example.com 8443 "20131231 00:00:00" 0 0 +%TABh3 example.com 443 h3 shiny.example.com 8443 "20131231 00:00:00" 0 0 # also a comment bad example.com 443 h3 shiny.example.com 8443 "20191231 00:00:00" 0 0 rubbish diff --git a/tests/data/test1664 b/tests/data/test1664 index ea126a3be757..fa0b3a377c0d 100644 --- a/tests/data/test1664 +++ b/tests/data/test1664 @@ -68,7 +68,7 @@ curlx_str_singlespace 3: ("b") 5, line 0 4: ("\") 5, line 0 5: (" ") 0, line 1 -6: ("%tab%") 5, line 0 +6: ("%TAB") 5, line 0 7: (" ") 5, line 0 8: ("") 5, line 0 diff --git a/tests/data/test17 b/tests/data/test17 index c8c0a19b77fc..31e2a8e53648 100644 --- a/tests/data/test17 +++ b/tests/data/test17 @@ -46,7 +46,7 @@ request MOOO MOOO /that.site.com/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT -User-Agent: agent007 license to drill%tab% +User-Agent: agent007 license to drill%TAB Accept: */* diff --git a/tests/data/test1700 b/tests/data/test1700 index 6d26e1b0114a..e75c1f3d1a43 100644 --- a/tests/data/test1700 +++ b/tests/data/test1700 @@ -76,7 +76,7 @@ HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT last-modified: Tue, 13 Jun 2000 12:10:00 GMT etag: "21025-dc7-39462498" @@ -87,7 +87,7 @@ funny-head: yesyes via: 1.1 nghttpx -foo- -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test1701 b/tests/data/test1701 index 44780df19799..ecc5f6f17ce0 100644 --- a/tests/data/test1701 +++ b/tests/data/test1701 @@ -65,7 +65,7 @@ HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT last-modified: Tue, 13 Jun 2000 12:10:00 GMT etag: "21025-dc7-39462498" diff --git a/tests/data/test1702 b/tests/data/test1702 index 9f1b16776180..96acf700d3ed 100644 --- a/tests/data/test1702 +++ b/tests/data/test1702 @@ -61,7 +61,7 @@ HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT last-modified: Tue, 13 Jun 2000 12:10:00 GMT etag: "21025-dc7-39462498" diff --git a/tests/data/test188 b/tests/data/test188 index 79a7f5f84a05..d5796c7318bd 100644 --- a/tests/data/test188 +++ b/tests/data/test188 @@ -19,7 +19,7 @@ Content-Length: 3 OK -HTTP/1.1 200 OK%spc% +HTTP/1.1 200 OK%SP Connection: close Content-Length: 15 Content-Range: bytes 50- @@ -32,7 +32,7 @@ HTTP/1.1 301 OK swsbounce Location: /%TESTNUMBER Content-Length: 3 -HTTP/1.1 200 OK%spc% +HTTP/1.1 200 OK%SP Connection: close Content-Length: 15 Content-Range: bytes 50- diff --git a/tests/data/test189 b/tests/data/test189 index 8d92ef578b81..e8e8044049a5 100644 --- a/tests/data/test189 +++ b/tests/data/test189 @@ -16,7 +16,7 @@ Content-Length: 3 OK -HTTP/1.1 200 OK%spc% +HTTP/1.1 200 OK%SP Connection: close Content-Length: 15 @@ -28,7 +28,7 @@ HTTP/1.1 301 OK swsbounce Location: /%TESTNUMBER Content-Length: 3 -HTTP/1.1 200 OK%spc% +HTTP/1.1 200 OK%SP Connection: close Content-Length: 15 diff --git a/tests/data/test1940 b/tests/data/test1940 index d15bf1d5b60f..b5ddd4c2b976 100644 --- a/tests/data/test1940 +++ b/tests/data/test1940 @@ -59,8 +59,8 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER - Set-Cookie == secondcookie=2data; (1/3) - Set-Cookie == cookie3=data3; (2/3) Fold == is folding a line - Blank ==%spc% - Blank2 ==%spc% + Blank ==%SP + Blank2 ==%SP diff --git a/tests/data/test1955 b/tests/data/test1955 index 93d1422e8bf9..3a4310037317 100644 --- a/tests/data/test1955 +++ b/tests/data/test1955 @@ -65,7 +65,7 @@ Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, S X-Xxx-Date: 19700101T000000Z test3: 1234 test2: -test_space: t%tab%s m%tab% end%repeat[4 x ]% +test_space: t%TABs m%TAB end%repeat[4 x ]% tesMixCase: MixCase diff --git a/tests/data/test1958 b/tests/data/test1958 index f5e38868c64b..90dd1d131bc1 100644 --- a/tests/data/test1958 +++ b/tests/data/test1958 @@ -63,7 +63,7 @@ GET /aws_sigv4/testapi/test HTTP/1.1 Host: exam.ple.com:9000 Authorization: XXX4-HMAC-SHA256 Credential=xxx/19700101/ple/exam/xxx4_request, SignedHeaders=content-type;host;x-xxx-content-sha256;x-xxx-date, Signature=25b4cac711ea8f65010c485d3778885f5f3870d0b8ff0b3ab58a8d7eeab991ff X-Xxx-Date: 19700101T000000Z -X-Xxx-Content-Sha256: %tab%arbitrary%spc% +X-Xxx-Content-Sha256: %TABarbitrary%SP diff --git a/tests/data/test212 b/tests/data/test212 index c7fba5f8b93a..6f1d747b5808 100644 --- a/tests/data/test212 +++ b/tests/data/test212 @@ -51,11 +51,11 @@ PWD CWD a CWD path EPRT |1| -PORT%spc% +PORT%SP TYPE I SIZE %TESTNUMBER RETR %TESTNUMBER -PORT%spc% +PORT%SP SIZE %TESTNUMBER RETR %TESTNUMBER QUIT diff --git a/tests/data/test2302 b/tests/data/test2302 index ab88d9e162c0..889d014e2d85 100644 --- a/tests/data/test2302 +++ b/tests/data/test2302 @@ -66,7 +66,7 @@ Connection: Upgrade %hex[%8a%808321]hex% -68 65 6c 6c 6f%spc% +68 65 6c 6c 6f%SP RECFLAGS: 1 diff --git a/tests/data/test2306 b/tests/data/test2306 index 233905fc7915..713cc27c9301 100644 --- a/tests/data/test2306 +++ b/tests/data/test2306 @@ -24,7 +24,7 @@ Funny-head: yesyes HTTP/1.1 200 OK swsclose -%tab%Access-Control-Allow-Origin: * +%TABAccess-Control-Allow-Origin: * Connection: Keep-Alive Content-Type: text/html; charset=utf-8 Date: Wed, 10 May 2023 14:58:08 GMT diff --git a/tests/data/test2400 b/tests/data/test2400 index 8478681fbd4c..1fed4b71e643 100644 --- a/tests/data/test2400 +++ b/tests/data/test2400 @@ -50,7 +50,7 @@ HTTP/2 GET over HTTPS # Verify data after the test has been "shot" -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test2401 b/tests/data/test2401 index a10715ff80a8..94787f1c6fda 100644 --- a/tests/data/test2401 +++ b/tests/data/test2401 @@ -47,7 +47,7 @@ HTTP/2 POST over HTTPS # Verify data after the test has been "shot" -HTTP/2 201%spc% +HTTP/2 201%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 0 funny-head: yesyes diff --git a/tests/data/test2403 b/tests/data/test2403 index b23b1e6760e4..34141d6780e1 100644 --- a/tests/data/test2403 +++ b/tests/data/test2403 @@ -51,7 +51,7 @@ HTTP/2 GET using %{header_json} # Verify data after the test has been "shot" -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test2406 b/tests/data/test2406 index adf39dbd7e50..6426b2cc846a 100644 --- a/tests/data/test2406 +++ b/tests/data/test2406 @@ -49,7 +49,7 @@ HTTP/2 over HTTPS with -f # Verify data after the test has been "shot" -HTTP/2 404%spc% +HTTP/2 404%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test2500 b/tests/data/test2500 index c774bf805a5c..f92cabfd32b6 100644 --- a/tests/data/test2500 +++ b/tests/data/test2500 @@ -58,7 +58,7 @@ Accept: */* -HTTP/3 200%spc% +HTTP/3 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT last-modified: Tue, 13 Jun 2000 12:10:00 GMT etag: "21025-dc7-39462498" diff --git a/tests/data/test2501 b/tests/data/test2501 index 8d68a582c105..99167ec48e86 100644 --- a/tests/data/test2501 +++ b/tests/data/test2501 @@ -47,7 +47,7 @@ HTTP/3 POST # Verify data after the test has been "shot" -HTTP/3 201%spc% +HTTP/3 201%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 0 funny-head: yesyes diff --git a/tests/data/test2503 b/tests/data/test2503 index 6c4b100bedbc..722d0ceb7adf 100644 --- a/tests/data/test2503 +++ b/tests/data/test2503 @@ -50,7 +50,7 @@ HTTP/3 header-api # Verify data after the test has been "shot" -HTTP/3 200%spc% +HTTP/3 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test358 b/tests/data/test358 index d29b09f956bc..3bdd5b4b325e 100644 --- a/tests/data/test358 +++ b/tests/data/test358 @@ -60,7 +60,7 @@ HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html @@ -69,7 +69,7 @@ alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 via: 1.1 nghttpx -foo- -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test359 b/tests/data/test359 index cc2b27b2ff61..1a2f9d73a892 100644 --- a/tests/data/test359 +++ b/tests/data/test359 @@ -60,7 +60,7 @@ HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html @@ -69,7 +69,7 @@ alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0 via: 1.1 nghttpx -foo- -HTTP/2 200%spc% +HTTP/2 200%SP date: Tue, 09 Nov 2010 14:49:00 GMT content-length: 6 content-type: text/html diff --git a/tests/data/test378 b/tests/data/test378 index e15e97e6e02b..09279fc1d714 100644 --- a/tests/data/test378 +++ b/tests/data/test378 @@ -29,7 +29,7 @@ Reject using -T and -d at once 2 -Warning: You can only select one HTTP request method! You asked for both PUT%spc% +Warning: You can only select one HTTP request method! You asked for both PUT%SP Warning: (-T, --upload-file) and POST (-d, --data). diff --git a/tests/data/test4 b/tests/data/test4 index 4f57f8dd628c..8b0479c1f8b4 100644 --- a/tests/data/test4 +++ b/tests/data/test4 @@ -44,7 +44,7 @@ User-Agent: curl/%VERSION extra-header: here Accept: replaced X-Custom-Header: -X-Test: foo;%spc% +X-Test: foo;%SP X-Test2: foo; GET /%TESTNUMBER HTTP/1.1 @@ -53,7 +53,7 @@ User-Agent: curl/%VERSION extra-header: here Accept: replaced X-Custom-Header: -X-Test: foo;%spc% +X-Test: foo;%SP X-Test2: foo; diff --git a/tests/data/test421 b/tests/data/test421 index 7b41703fb57e..6cc2bc27637d 100644 --- a/tests/data/test421 +++ b/tests/data/test421 @@ -21,7 +21,7 @@ referrer-policy: strict-origin-when-cross-origin access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS access-control-max-age: 1728000 access-control-allow-headers: Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS -access-control-expose-headers:%spc% +access-control-expose-headers:%SP vary: Accept etag: W/"2678f9ab2ba550d164e7cc014aefd31e" cache-control: max-age=0, private, must-revalidate diff --git a/tests/data/test459 b/tests/data/test459 index 42398bd35fdb..539aa0729dc1 100644 --- a/tests/data/test459 +++ b/tests/data/test459 @@ -56,7 +56,7 @@ Content-Type: application/x-www-form-urlencoded arg -Warning: %LOGDIR/config:1: warning: 'data' uses unquoted whitespace. This may%spc% +Warning: %LOGDIR/config:1: warning: 'data' uses unquoted whitespace. This may%SP Warning: cause side-effects. Consider double quotes. diff --git a/tests/data/test46 b/tests/data/test46 index 007861b4fb5b..715616e23c23 100644 --- a/tests/data/test46 +++ b/tests/data/test46 @@ -65,7 +65,7 @@ www.loser.com FALSE / FALSE 2139150993 UID 99 domain..tld FALSE / FALSE 2139150993 mooo indeed #HttpOnly_domain..tld FALSE /want FALSE 2139150993 mooo2 indeed2 %endif -domain..tld FALSE /want FALSE 0 empty%tab% +domain..tld FALSE /want FALSE 0 empty%TAB cookies @@ -88,18 +88,18 @@ Cookie: empty=; mooo2=indeed2; mooo=indeed # This file was generated by libcurl! Edit at your own risk. domain..tld FALSE /want/ FALSE 0 simplyhuge %repeat[3998 x z]% -domain..tld FALSE / FALSE 0 justaname%tab% +domain..tld FALSE / FALSE 0 justaname%TAB domain..tld FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ GKNBDIFAAOFDPDAIEAKDIBKE domain..tld FALSE / FALSE 0 ckySession temporary domain..tld FALSE / FALSE %days[400] ckyPersistent permanent %if large-time -domain..tld FALSE /want FALSE 0 empty%tab% +domain..tld FALSE /want FALSE 0 empty%TAB #HttpOnly_domain..tld FALSE /want FALSE 22139150993 mooo2 indeed2 domain..tld FALSE / FALSE 22139150993 mooo indeed www.loser.com FALSE / FALSE 22139150993 UID 99 www.fake.come FALSE / FALSE 22147483647 cookiecliente si %else -domain..tld FALSE /want FALSE 0 empty%tab% +domain..tld FALSE /want FALSE 0 empty%TAB #HttpOnly_domain..tld FALSE /want FALSE 2139150993 mooo2 indeed2 domain..tld FALSE / FALSE 2139150993 mooo indeed www.loser.com FALSE / FALSE 2139150993 UID 99 diff --git a/tests/data/test54 b/tests/data/test54 index 167542fbf097..901620fa62d6 100644 --- a/tests/data/test54 +++ b/tests/data/test54 @@ -11,7 +11,7 @@ followlocation HTTP/1.1 302 This is a weirdo text message swsclose Connection: close -Location:%spc% +Location:%SP This server reply is for testing diff --git a/tests/data/test646 b/tests/data/test646 index 5f7f8e7605e6..a8d8ff2b6f2f 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -39,7 +39,7 @@ It may contain any type of data. # This line is a comment -X-fileheader1: This is a header from a file%spc% +X-fileheader1: This is a header from a file%SP # This line is another comment. It precedes a folded header. X-fileheader2: This is #a diff --git a/tests/data/test792 b/tests/data/test792 index b3630b505852..fb20874d1d61 100644 --- a/tests/data/test792 +++ b/tests/data/test792 @@ -36,7 +36,7 @@ machine %HOSTIP login username password%hex[%00]hex% hello USER username -PASS%spc% +PASS%SP PWD EPSV TYPE I diff --git a/tests/data/test793 b/tests/data/test793 index 3a3e16e08775..f6e77e91167d 100644 --- a/tests/data/test793 +++ b/tests/data/test793 @@ -36,7 +36,7 @@ machine %HOSTIP login username "password"%hex[%00]hex% hello USER username -PASS%spc% +PASS%SP PWD EPSV TYPE I diff --git a/tests/testutil.pm b/tests/testutil.pm index f139516cfa08..30ac782a99a2 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -147,8 +147,8 @@ sub subbase64 { $$thing =~ s/%%DAYS%%/%alternatives[$d,$d2]/; } - $$thing =~ s/%spc%/ /g; # space - $$thing =~ s/%tab%/\t/g; # horizontal tab + $$thing =~ s/%SP/ /g; # space + $$thing =~ s/%TAB/\t/g; # horizontal tab # include a file $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1)/ge; From 60dd72b1be7b06110922f5f0690de0b88592667c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 5 Nov 2025 02:50:42 +0100 Subject: [PATCH 244/885] GHA/checksrc: add actionlint, fix or silence issues found It also does shellcheck on `run:` elements, overlapping with the homegrown `shellcheck-ci.sh` with the same purpose. But it also does more and perhaps could replace the script too, especially in curl sub-repos. Also: - GHA/macos: delete potentially useful, but commented, and ultimately unused, non-default Xcode-testing logic. It's causing unused matrix exceptions, upsetting actionlint. Ref: https://github.com/rhysd/actionlint Closes #19373 --- .github/workflows/checksrc.yml | 9 ++++++++- .github/workflows/http3-linux.yml | 2 -- .github/workflows/macos.yml | 33 ++++--------------------------- .github/workflows/windows.yml | 1 + 4 files changed, 13 insertions(+), 32 deletions(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index c5b918aa8e0a..8557ec708ccf 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -124,7 +124,7 @@ jobs: timeout-minutes: 5 steps: - name: 'install prereqs' - run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install shellcheck zizmor + run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: @@ -137,6 +137,13 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" zizmor --pedantic .github/workflows/*.yml .github/dependabot.yml + - name: 'actionlint' + run: | + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + export SHELLCHECK_OPTS='--exclude=1090,1091,2086,2153 --enable=avoid-nullary-conditions,deprecate-which' + actionlint --version + actionlint --ignore matrix .github/workflows/*.yml + - name: 'shellcheck CI' run: | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index ff24d0fa4b68..29d0fe6eaff4 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -666,8 +666,6 @@ jobs: - name: 'run tests' if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }} - env: - TFLAGS: '${{ matrix.build.tflags }}' run: | source ~/venv/bin/activate if [ "${MATRIX_BUILD}" = 'cmake' ]; then diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 00d8fabcbb05..20585e7b7db4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -54,7 +54,7 @@ jobs: timeout-minutes: 10 env: DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" - CC: ${{ matrix.build.compiler || 'clang' }} + CC: 'clang' LDFLAGS: '' MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }} MATRIX_OPTIONS: ${{ matrix.build.options }} @@ -81,6 +81,7 @@ jobs: - name: 'libressl' install_steps: libressl generator: Xcode + xcode: '' # default Xcode. Set it once to silence actionlint. options: --config Debug generate: >- -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF @@ -223,6 +224,7 @@ jobs: compiler: clang install: brotli zstd configure: --without-ssl --with-brotli --with-zstd + xcode: '' # default Xcode. Set it once to silence actionlint. - name: '!ssl !debug' compiler: gcc-12 configure: --without-ssl @@ -538,7 +540,7 @@ jobs: fi combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, built tool, combinations - name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }} ${{ matrix.config }}" + name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }}" runs-on: ${{ matrix.image }} timeout-minutes: 10 env: @@ -566,37 +568,11 @@ jobs: # https://github.com/actions/runner-images/tree/main/images/macos # https://en.wikipedia.org/wiki/MacOS_version_history image: [macos-14, macos-15, macos-26] - # Can skip these to reduce jobs: - # 15.1 has the same default macOS SDK as 15.2 and identical test results. - # 15.4 not revealing new fallouts. - #xcode: ['15.0.1', '15.1', '15.2', '15.3', '15.4', '16.0', '16.1'] # all Xcode - #xcode: ['15.0.1' , '15.2', '15.3', '15.4', '16.0', '16.1'] # all SDK - #xcode: ['15.0.1' , '15.2', '15.3' , '16.0' ] # coverage xcode: [''] # default Xcodes macos-version-min: [''] build: [autotools, cmake] exclude: # Combinations not covered by runner images: - - { image: macos-14, xcode: '16.0' } - - { image: macos-14, xcode: '16.1' } - - { image: macos-14, xcode: '16.2' } - - { image: macos-14, xcode: '16.3' } - - { image: macos-14, xcode: '16.4' } - - { image: macos-14, xcode: '26.0' } - - { image: macos-15, xcode: '15.0.1' } - - { image: macos-15, xcode: '15.1' } - - { image: macos-15, xcode: '15.2' } - - { image: macos-15, xcode: '15.3' } - - { image: macos-15, xcode: '15.4' } - - { image: macos-26, xcode: '15.0.1' } - - { image: macos-26, xcode: '15.1' } - - { image: macos-26, xcode: '15.2' } - - { image: macos-26, xcode: '15.3' } - - { image: macos-26, xcode: '15.4' } - - { image: macos-26, xcode: '16.0' } - - { image: macos-26, xcode: '16.1' } - - { image: macos-26, xcode: '16.2' } - - { image: macos-26, xcode: '16.3' } - { image: macos-14, compiler: 'llvm@18' } - { image: macos-14, compiler: 'llvm@20' } - { image: macos-15, compiler: 'llvm@15' } @@ -606,7 +582,6 @@ jobs: - { image: macos-26, compiler: 'gcc-12' } # Reduce build combinations, by dropping less interesting ones - { compiler: gcc-13, build: cmake } - - { compiler: gcc-14, build: autotools } - { compiler: gcc-15, build: autotools } steps: - name: 'install autotools' diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 145d4813af40..8214cbb3101a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -462,6 +462,7 @@ jobs: config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON' type: 'Debug' tflags: 'skipall' + chkprefill: '' # Set it once to silence actionlint fail-fast: false steps: - uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0 From e6e1899b6e35466343f17a41ceabfcfb65bf11ce Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 4 Nov 2025 08:25:41 -0800 Subject: [PATCH 245/885] tests: Add tests to validate that path is ignored with -J curl is correctly dropping the Content-Disposition: filename path, but there was no test ensuring that. Ref: https://hackerone.com/reports/3408126 --- tests/data/Makefile.am | 2 +- tests/data/test1584 | 55 ++++++++++++++++++++++++++++++++++++++++++ tests/data/test1585 | 55 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 tests/data/test1584 create mode 100644 tests/data/test1585 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 22d6eca2356b..bbd97853a33b 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -209,7 +209,7 @@ test1548 test1549 test1550 test1551 test1552 test1553 test1554 test1555 \ test1556 test1557 test1558 test1559 test1560 test1561 test1562 test1563 \ test1564 test1565 test1566 test1567 test1568 test1569 test1570 test1571 \ test1572 test1573 test1574 test1575 test1576 test1577 test1578 test1579 \ -test1580 test1581 test1582 test1583 \ +test1580 test1581 test1582 test1583 test1584 test1585 \ \ test1590 test1591 test1592 test1593 test1594 test1595 test1596 test1597 \ test1598 test1599 test1600 test1601 test1602 test1603 test1604 test1605 \ diff --git a/tests/data/test1584 b/tests/data/test1584 new file mode 100644 index 000000000000..ab8ba1ecb3c0 --- /dev/null +++ b/tests/data/test1584 @@ -0,0 +1,55 @@ + + + + +HTTP +HTTP GET +-J + + + +# + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=log/server/name%TESTNUMBER + +12345 + + + +# +# Client-side + + +http + + +HTTP GET with -J and Content-Disposition including path + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +12345 + + + + diff --git a/tests/data/test1585 b/tests/data/test1585 new file mode 100644 index 000000000000..6875ac860326 --- /dev/null +++ b/tests/data/test1585 @@ -0,0 +1,55 @@ + + + + +HTTP +HTTP GET +-J + + + +# + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=log\server\name%TESTNUMBER + +12345 + + + +# +# Client-side + + +http + + +HTTP GET with -J and Content-Disposition including DOS path + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +12345 + + + + From d7d4de07c29d9c945800be05c63d78a0c2072d1b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Nov 2025 15:16:00 +0100 Subject: [PATCH 246/885] tests/Makefile.am: fix 'checksrc' target Skip the http and client subdirs as they contain no code to check. The http clients are in libtests/ now. Closes #19376 --- tests/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 639da3380960..45cfc0f88faa 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -178,8 +178,6 @@ checksrc: (cd unit && $(MAKE) checksrc) (cd tunit && $(MAKE) checksrc) (cd server && $(MAKE) checksrc) - (cd client && $(MAKE) checksrc) - (cd http && $(MAKE) checksrc) all-local: $(MANFILES) build-certs From 58023ba52273b05deb36ec1d395df18ba29b3bde Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 5 Nov 2025 21:21:34 +0100 Subject: [PATCH 247/885] docs: fix checksrc `EQUALSPACE` warnings ``` docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md:86:16 docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md:139:16 ``` Also sync `CURL *` and result variable names with rest of docs. Follow-up to 6d7e924e80096a7e2cebad16235674fd3d3012af #19375 Closes #19379 --- docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md | 27 ++++++++++--------- docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md | 27 ++++++++++--------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md b/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md index 6dc81a086710..7cc94bdfb9da 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md +++ b/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md @@ -81,9 +81,10 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) int main(void) { - CURL *ch; - CURLcode rv; - char *mypem = /* CA cert in PEM format, replace the XXXs */ + CURL *curl; + CURLcode res; + /* CA cert in PEM format, replace the XXXs */ + char *mypem = "-----BEGIN CERTIFICATE-----\n" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" @@ -94,23 +95,23 @@ int main(void) "-----END CERTIFICATE-----\n"; curl_global_init(CURL_GLOBAL_ALL); - ch = curl_easy_init(); + curl = curl_easy_init(); - curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM"); - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L); - curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); - curl_easy_setopt(ch, CURLOPT_SSL_CTX_DATA, mypem); - rv = curl_easy_perform(ch); - if(!rv) + curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); + curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, mypem); + res = curl_easy_perform(curl); + if(!res) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); - curl_easy_cleanup(ch); + curl_easy_cleanup(curl); curl_global_cleanup(); - return rv; + return (int)res; } ~~~ diff --git a/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md b/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md index 75e1dc8edb9d..01688ef3ea90 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md @@ -134,9 +134,10 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) int main(void) { - CURL *ch; - CURLcode rv; - char *mypem = /* CA cert in PEM format, replace the XXXs */ + CURL *curl; + CURLcode res; + /* CA cert in PEM format, replace the XXXs */ + char *mypem = "-----BEGIN CERTIFICATE-----\n" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" @@ -147,23 +148,23 @@ int main(void) "-----END CERTIFICATE-----\n"; curl_global_init(CURL_GLOBAL_ALL); - ch = curl_easy_init(); + curl = curl_easy_init(); - curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM"); - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L); - curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); + curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); - curl_easy_setopt(ch, CURLOPT_SSL_CTX_DATA, mypem); - rv = curl_easy_perform(ch); - if(!rv) + curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); + curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, mypem); + res = curl_easy_perform(curl); + if(!res) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); - curl_easy_cleanup(ch); + curl_easy_cleanup(curl); curl_global_cleanup(); - return rv; + return (int)res; } ~~~ From 56129718b80b5bd5a551522086901b2feb906505 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Nov 2025 10:00:52 +0100 Subject: [PATCH 248/885] tool_ipfs: check return codes better Closes #19382 --- src/tool_ipfs.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index 8e98d23242ee..89d12fc1c6a5 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -165,23 +165,15 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, } /* get gateway parts */ - if(curl_url_get(gatewayurl, CURLUPART_HOST, - &gwhost, CURLU_URLDECODE)) { - goto clean; - } - - if(curl_url_get(gatewayurl, CURLUPART_SCHEME, - &gwscheme, CURLU_URLDECODE)) { - goto clean; - } - - curl_url_get(gatewayurl, CURLUPART_PORT, &gwport, CURLU_URLDECODE); - - if(curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE)) + if(curl_url_get(gatewayurl, CURLUPART_HOST, &gwhost, CURLU_URLDECODE) || + curl_url_get(gatewayurl, CURLUPART_SCHEME, &gwscheme, CURLU_URLDECODE) || + curl_url_get(gatewayurl, CURLUPART_PORT, &gwport, CURLU_URLDECODE) || + curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE)) goto clean; /* get the path from user input */ - curl_url_get(uh, CURLUPART_PATH, &inputpath, CURLU_URLDECODE); + if(curl_url_get(uh, CURLUPART_PATH, &inputpath, CURLU_URLDECODE)) + goto clean; /* inputpath might be NULL or a valid pointer now */ /* set gateway parts in input url */ @@ -198,13 +190,9 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, has_trailing_slash(gwpath) ? "" : "/", protocol, cid, inputpath ? inputpath : ""); - if(!pathbuffer) { - goto clean; - } - - if(curl_url_set(uh, CURLUPART_PATH, pathbuffer, CURLU_URLENCODE)) { + if(!pathbuffer || + curl_url_set(uh, CURLUPART_PATH, pathbuffer, CURLU_URLENCODE)) goto clean; - } /* Free whatever it has now, rewriting is next */ tool_safefree(*url); From 66a66c596b023d0502aae19787300579338850fa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Nov 2025 09:52:30 +0100 Subject: [PATCH 249/885] tool_operate: remove redundant condition And avoid an early return. Pointed out by CodeSonar Closes #19381 --- src/tool_operate.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 46a3f200bb3d..74f5da5fa915 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2116,22 +2116,21 @@ static CURLcode transfer_per_config(struct OperationConfig *config, bool *added, bool *skipped) { - CURLcode result = CURLE_OK; + CURLcode result; *added = FALSE; /* Check we have a url */ if(!config->url_list || !config->url_list->url) { helpf("(%d) no URL specified", CURLE_FAILED_INIT); - return CURLE_FAILED_INIT; + result = CURLE_FAILED_INIT; } - - if(!result) + else { result = cacertpaths(config); - - if(!result) { - result = single_transfer(config, share, added, skipped); - if(!*added || result) - single_transfer_cleanup(); + if(!result) { + result = single_transfer(config, share, added, skipped); + if(!*added || result) + single_transfer_cleanup(); + } } return result; From 8e6149598b57e9904b0ff31b2b83bbcc57b39953 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2025 18:37:49 +0100 Subject: [PATCH 250/885] gnutls: report accurate error when TLS-SRP is not built-in With GnuTLS 3.8.0+ the build-time SRP feature detection always succeeds. It's also disabled by default in these GnuTLS versions. When using TLS-SRP without it being available in GnuTLS, report the correct error code `CURLE_NOT_BUILT_IN`, replacing the out of memory error reported before this patch. Also add comments to autotools and cmake scripts about this feature detection property. Detecting it at build-time would need to run code which doesn't work in cross-builds. Once curl requires 3.8.0 as minimum, the build-time checks can be deleted. ``` # before: curl: (27) gnutls_srp_allocate_client_cred() failed: An unimplemented or disabled feature has been requested. # after: curl: (4) GnuTLS: TLS-SRP support not built in: An unimplemented or disabled feature has been requested. ``` Ref: https://github.com/gnutls/gnutls/commit/dab063fca2eecb9ff1db73234108315c5b713756 Ref: https://github.com/gnutls/gnutls/commit/a21e89edacfe4ec3c501b030fff59c11fd20dcf0 Closes #19365 --- CMakeLists.txt | 2 ++ lib/vtls/gtls.c | 7 ++++++- m4/curl-gnutls.m4 | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4772a6219ae8..7b442ac7041d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -934,6 +934,8 @@ if(CURL_USE_GNUTLS) list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}") curl_required_libpaths("${GNUTLS_LIBRARY_DIRS}") + # In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds. + # Detecting actual TLS-SRP support needs poking the API at runtime. check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP) cmake_pop_check_state() endif() diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 6c1fe63b5ebb..f3d6abb23cac 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -877,7 +877,12 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf, infof(data, "Using TLS-SRP username: %s", config->username); rc = gnutls_srp_allocate_client_credentials(>ls->srp_client_cred); - if(rc != GNUTLS_E_SUCCESS) { + if(rc == GNUTLS_E_UNIMPLEMENTED_FEATURE) { + failf(data, "GnuTLS: TLS-SRP support not built in: %s", + gnutls_strerror(rc)); + return CURLE_NOT_BUILT_IN; + } + else if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_srp_allocate_client_cred() failed: %s", gnutls_strerror(rc)); return CURLE_OUT_OF_MEMORY; diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index 0872ee52b683..e934f870dd6b 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -156,6 +156,9 @@ if test "$GNUTLS_ENABLED" = "1"; then dnl --- dnl We require GnuTLS with SRP support. + dnl + dnl In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds. + dnl Detecting actual TLS-SRP support needs poking the API at runtime. dnl --- AC_CHECK_LIB(gnutls, gnutls_srp_verifier, [ From ede6a8e08762321d95864ad384b8ff5ac44ac459 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 5 Nov 2025 19:53:30 +0100 Subject: [PATCH 251/885] conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 A false positive that appeared after a recent patch for no reason. Seen in curl-for-win unity native Linux builds on debian:testing and debian:trixie with gcc 14.3.0 and 14.2.0 respectively: ``` -- curl version=[8.17.1-DEV] -- The C compiler identification is GNU 14.2.0 -- Cross-compiling: Linux/x86_64 -> Linux/riscv64 [...] lib/conncache.c: In function 'Curl_cpool_conn_now_idle': lib/conncache.c:539:11: error: null pointer dereference [-Werror=null-dereference] 539 | if(!data->multi->maxconnects) { | ~~~~^~~~~~~ ``` Ref: https://github.com/curl/curl-for-win/actions/runs/19111497271/job/54609512969#step:3:5788 ``` -- The C compiler identification is GNU 14.3.0 ``` Ref: https://github.com/curl/curl-for-win/actions/runs/19111497271/job/54609512899#step:3:5801 Patch confirmed silencing: https://github.com/curl/curl-for-win/actions/runs/19112580362/job/54613288202 Follow-up to fbc4d59151dc4a56052f3a92da3682dc97b32148 #19271 Closes #19378 --- lib/conncache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/conncache.c b/lib/conncache.c index d5770ef9164c..7dc21d967adc 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -536,6 +536,9 @@ bool Curl_cpool_conn_now_idle(struct Curl_easy *data, struct cpool *cpool = cpool_get_instance(data); bool kept = TRUE; + if(!data) + return kept; + if(!data->multi->maxconnects) { unsigned int running = Curl_multi_xfers_running(data->multi); maxconnects = (running <= UINT_MAX / 4) ? running * 4 : UINT_MAX; From 9825a3b708222be2e753d4c4a1ea0388cbfa334f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 6 Nov 2025 02:20:12 +0100 Subject: [PATCH 252/885] cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` Syncing behavior with `CURL_CA_BUNDLE` and autotools. `/etc/ssl/certs` is empty by default on macOS systems, thus no likely auto-detection finds something there. Follow-up to eefd03c572996e5de4dec4fe295ad6f103e0eefc #18703 Closes #19380 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b442ac7041d..068d97d49b95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1551,7 +1551,7 @@ if(_curl_ca_bundle_supported) unset(CURL_CA_PATH CACHE) elseif(CURL_CA_PATH STREQUAL "auto") unset(CURL_CA_PATH CACHE) - if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32) + if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32 AND NOT USE_APPLE_SECTRUST) set(_curl_ca_path_autodetect TRUE) endif() else() From f12a81de4f34bf0f8055d264a432f0f3befe7921 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 6 Nov 2025 12:47:33 +0100 Subject: [PATCH 253/885] curl: fix progress meter in parallel mode With `check_finished()` triggered by notifications now, the `progress_meter()` was no longer called at regular intervals. Move `progress_meter()` out of `check_finished()` into the perform loop and event callbacks. Closes #19383 --- src/tool_operate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 74f5da5fa915..e1f61a2ba519 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1549,6 +1549,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events) curl_multi_socket_action(c->uv->s->multi, c->sockfd, flags, &c->uv->s->still_running); + progress_meter(c->uv->s->multi, &c->uv->s->start, FALSE); } /* callback from libuv when timeout expires */ @@ -1561,6 +1562,7 @@ static void on_uv_timeout(uv_timer_t *req) if(uv && uv->s) { curl_multi_socket_action(uv->s->multi, CURL_SOCKET_TIMEOUT, 0, &uv->s->still_running); + progress_meter(uv->s->multi, &uv->s->start, FALSE); } } @@ -1733,7 +1735,6 @@ static CURLcode check_finished(struct parastate *s) int rc; CURLMsg *msg; bool checkmore = FALSE; - progress_meter(s->multi, &s->start, FALSE); do { msg = curl_multi_info_read(s->multi, &rc); if(msg) { @@ -1875,6 +1876,8 @@ static CURLcode parallel_transfers(CURLSH *share) s->mcode = curl_multi_poll(s->multi, NULL, 0, 1000, NULL); if(!s->mcode) s->mcode = curl_multi_perform(s->multi, &s->still_running); + + progress_meter(s->multi, &s->start, FALSE); } (void)progress_meter(s->multi, &s->start, TRUE); From 69622ff37db03ed818aa9141cdbe874267a6d61d Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 5 Nov 2025 23:50:51 +0800 Subject: [PATCH 254/885] tool_help: add checks to avoid unsigned wrap around Closes #19377 --- src/tool_help.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tool_help.c b/src/tool_help.c index 7a3a4a3bf430..4509fa2b949d 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -87,14 +87,18 @@ static void print_category(unsigned int category, unsigned int cols) if(len > longdesc) longdesc = len; } - if(longopt + longdesc > cols) + + if(longdesc > cols) + longopt = 0; /* avoid wrap-around */ + else if(longopt + longdesc > cols) longopt = cols - longdesc; for(i = 0; helptext[i].opt; ++i) if(helptext[i].categories & category) { size_t opt = longopt; size_t desclen = strlen(helptext[i].desc); - if(opt + desclen >= (cols - 2)) { + /* avoid wrap-around */ + if(cols >= 2 && opt + desclen >= (cols - 2)) { if(desclen < (cols - 2)) opt = (cols - 3) - desclen; else From 672886f734fc205f92e0cba3c6dcd5c43abb2b11 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 4 Nov 2025 18:39:43 +0100 Subject: [PATCH 255/885] wolfSSL: able to differentiate between IP and DNS in alt names Fix implemented in https://github.com/wolfSSL/wolfssl/pull/9380 Closes #19364 --- tests/http/test_17_ssl_use.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index d0af093af0b6..57e1c014042b 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -195,8 +195,9 @@ def test_17_05_very_bad_ip_addr(self, env: Env, proto, pytest.skip("h3 not supported") if env.curl_uses_lib('mbedtls'): pytest.skip("mbedtls falsely verifies a DNS: altname as IP address") - if env.curl_uses_lib('wolfssl'): - pytest.skip("wolfSSL falsely verifies a DNS: altname as IP address") + if env.curl_uses_lib('wolfssl') and \ + env.curl_lib_version_before('wolfssl', '5.8.4'): + pytest.skip("wolfSSL falsely verifies a DNS: altname as IP address in 5.8.2 and before") httpd.set_domain1_cred_name('domain1-very-bad') httpd.reload_if_config_changed() if proto == 'h3': From 904e7ecb66519951681377758fe6b07dde28ce36 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 3 Nov 2025 21:38:35 +0100 Subject: [PATCH 256/885] tests: replace remaining CR bytes with the new macro `%CR` There is no more mixed-newline file in the repository after this patch. Except for`.bat` and `.sln` files (4 in total), all files use LF newlines. Also: - `spacecheck.pl`: drop mixed-EOL exception for test data. - runtests: add option `-w` to check if test data has stray CR bytes in them. - build: enable the option above in test targets, except the CI-specific one where `spacecheck.pl` does this job already. - tested OK (with expected failures) in CI with stray CRs added. - cmake: enable option `-a` for the `tests` target. To continue testing after a failed test. Follow-up to 63e9721b63d01518db83a664bc1e8373c352879e #19313 Follow-up to 6cf3d7b1b161bc45501d17b401225befe3c43943 #19318 Follow-up to 4d2a05d3fe8ba4db9168b03057029ea5ce7dab77 #19284 Closes #19347 --- .github/scripts/spacecheck.pl | 10 +- docs/runtests.md | 4 + docs/tests/FILEFORMAT.md | 4 + tests/CMakeLists.txt | 14 +- tests/Makefile.am | 16 +- tests/data/test1008 | 20 +-- tests/data/test1021 | 30 ++-- tests/data/test1040 | 8 +- tests/data/test1042 | 10 +- tests/data/test1043 | 14 +- tests/data/test1053 | 84 +++++------ tests/data/test1055 | 26 ++-- tests/data/test1060 | 18 +-- tests/data/test1061 | 36 ++--- tests/data/test1066 | 40 ++--- tests/data/test1068 | 22 +-- tests/data/test1072 | 22 +-- tests/data/test1073 | 22 +-- tests/data/test1123 | 52 +++---- tests/data/test1133 | 76 +++++----- tests/data/test1158 | 62 ++++---- tests/data/test1186 | 62 ++++---- tests/data/test1189 | 88 +++++------ tests/data/test1273 | 8 +- tests/data/test1274 | 22 +-- tests/data/test1277 | 56 +++---- tests/data/test1288 | 32 ++-- tests/data/test1315 | 64 ++++---- tests/data/test1319 | 4 +- tests/data/test1375 | 16 +- tests/data/test1376 | 14 +- tests/data/test1377 | 16 +- tests/data/test1404 | 70 ++++----- tests/data/test1416 | 16 +- tests/data/test1417 | 26 ++-- tests/data/test1428 | 4 +- tests/data/test1429 | 22 +-- tests/data/test1434 | 20 +-- tests/data/test1475 | 16 +- tests/data/test1482 | 44 +++--- tests/data/test1483 | 48 +++--- tests/data/test1493 | 44 +++--- tests/data/test1498 | 22 +-- tests/data/test1499 | 44 +++--- tests/data/test1525 | 4 +- tests/data/test1540 | 32 ++-- tests/data/test1541 | 24 +-- tests/data/test163 | 36 ++--- tests/data/test164 | 40 ++--- tests/data/test166 | 26 ++-- tests/data/test173 | 34 ++--- tests/data/test1904 | 4 +- tests/data/test1940 | 2 +- tests/data/test1943 | 30 ++-- tests/data/test2002 | 26 ++-- tests/data/test2003 | 42 +++--- tests/data/test206 | 16 +- tests/data/test207 | 4 +- tests/data/test208 | 16 +- tests/data/test209 | 20 +-- tests/data/test213 | 20 +-- tests/data/test218 | 20 +-- tests/data/test222 | 34 ++--- tests/data/test230 | 34 ++--- tests/data/test232 | 34 ++--- tests/data/test258 | 100 ++++++------- tests/data/test259 | 104 ++++++------- tests/data/test265 | 22 +-- tests/data/test266 | 44 +++--- tests/data/test275 | 6 +- tests/data/test3015 | 24 +-- tests/data/test304 | 42 +++--- tests/data/test31 | 106 +++++++------- tests/data/test314 | 34 ++--- tests/data/test320 | 14 +- tests/data/test3206 | 2 +- tests/data/test326 | 28 ++-- tests/data/test339 | 32 ++-- tests/data/test34 | 16 +- tests/data/test341 | 14 +- tests/data/test347 | 32 ++-- tests/data/test36 | 8 +- tests/data/test363 | 4 +- tests/data/test365 | 8 +- tests/data/test373 | 34 ++--- tests/data/test39 | 88 +++++------ tests/data/test396 | 34 ++--- tests/data/test415 | 2 +- tests/data/test433 | 8 +- tests/data/test44 | 42 +++--- tests/data/test457 | 16 +- tests/data/test473 | 32 ++-- tests/data/test503 | 4 +- tests/data/test552 | 30 ++-- tests/data/test554 | 116 +++++++-------- tests/data/test568 | 12 +- tests/data/test585 | 14 +- tests/data/test599 | 22 +-- tests/data/test60 | 24 +-- tests/data/test643 | 112 +++++++------- tests/data/test645 | 236 +++++++++++++++--------------- tests/data/test646 | 64 ++++---- tests/data/test647 | 52 +++---- tests/data/test650 | 268 +++++++++++++++++----------------- tests/data/test654 | 94 ++++++------ tests/data/test666 | 26 ++-- tests/data/test668 | 62 ++++---- tests/data/test71 | 40 ++--- tests/data/test744 | 4 +- tests/data/test780 | 6 +- tests/data/test781 | 6 +- tests/data/test782 | 6 +- tests/data/test783 | 6 +- tests/data/test80 | 4 +- tests/data/test83 | 4 +- tests/data/test9 | 42 +++--- tests/data/test900 | 20 +-- tests/data/test95 | 4 +- tests/getpart.pm | 13 ++ tests/globalconfig.pm | 2 + tests/runner.pm | 9 ++ tests/runtests.pl | 9 ++ tests/testutil.pm | 1 + 123 files changed, 2045 insertions(+), 2009 deletions(-) diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl index fc1bf8f76cd1..e2da2cec5d60 100755 --- a/.github/scripts/spacecheck.pl +++ b/.github/scripts/spacecheck.pl @@ -34,10 +34,6 @@ "^tests/data/test", ); -my @mixed_eol = ( - "^tests/data/test", -); - my @need_crlf = ( "\\.(bat|sln)\$", ); @@ -109,8 +105,7 @@ sub eol_detect { my $eol = eol_detect($content); - if($eol eq "" && - !fn_match($filename, @mixed_eol)) { + if($eol eq "") { push @err, "content: has mixed EOL types"; } @@ -120,8 +115,7 @@ sub eol_detect { } if($eol ne "lf" && $content ne "" && - !fn_match($filename, @need_crlf) && - !fn_match($filename, @mixed_eol)) { + !fn_match($filename, @need_crlf)) { push @err, "content: must use LF EOL for this file type"; } diff --git a/docs/runtests.md b/docs/runtests.md index 4a7ddf5c0bdf..373f07618d5e 100644 --- a/docs/runtests.md +++ b/docs/runtests.md @@ -289,6 +289,10 @@ Enable verbose output. Speaks more than by default. If used in conjunction with parallel testing, it is difficult to associate the logs with the specific test being run. +## `-w` + +Verify test data. + ## `-vc \` Provide a path to a custom curl binary to run when verifying that the servers diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 9703df9aa832..f100adcf89b3 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -78,6 +78,10 @@ For example, to insert the word hello 100 times: ## Whitespace +To force CRLF newline, add this macro to the end of the line: + + %CR - carriage return + To add significant whitespace characters at the end of the line, or to empty lines: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2b12cef83b21..dd8c274a33ad 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -120,15 +120,15 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/configurehelp.pm.in" "${CMAKE_CURRENT_BINARY_DIR}/configurehelp.pm" @ONLY) -curl_add_runtests(tests "") # Avoid 'test', which is a reserved target name in CMake -curl_add_runtests(test-quiet "-a -s") -curl_add_runtests(test-am "-a -am") -curl_add_runtests(test-full "-a -p -r") +curl_add_runtests(tests "-a -w") # Avoid 'test', which is a reserved target name in CMake +curl_add_runtests(test-quiet "-a -w -s") +curl_add_runtests(test-am "-a -w -am") +curl_add_runtests(test-full "-a -w -p -r") # ~flaky means that it ignores results of tests using the flaky keyword -curl_add_runtests(test-nonflaky "-a -p ~flaky ~timing-dependent") +curl_add_runtests(test-nonflaky "-a -w -p ~flaky ~timing-dependent") curl_add_runtests(test-ci "-a -p ~flaky ~timing-dependent -r --retry=5 -j20 --buildinfo") -curl_add_runtests(test-torture "-a -t -j20") -curl_add_runtests(test-event "-a -e") +curl_add_runtests(test-torture "-a -w -t -j20") +curl_add_runtests(test-event "-a -w -e") curl_add_pytests(curl-pytest "-n auto") curl_add_pytests(curl-pytest-ci "-n auto -v") diff --git a/tests/Makefile.am b/tests/Makefile.am index 45cfc0f88faa..12fdc29cdaec 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -118,18 +118,18 @@ TEST_COMMON += !documentation endif TEST = srcdir=$(srcdir) @PERL@ $(PERLFLAGS) $(srcdir)/runtests.pl $(TEST_COMMON) -TEST_Q = -a -s -TEST_AM = -a -am -TEST_F = -a -p -r -TEST_T = -a -t -j20 -TEST_E = -a -e +TEST_Q = -a -w -s +TEST_AM = -a -w -am +TEST_F = -a -w -p -r +TEST_T = -a -w -t -j20 +TEST_E = -a -w -e # ~ means that it will run all tests matching the keyword, but will # ignore their results (since these ones are likely to fail for no good reason) -TEST_NF = -a -p ~flaky ~timing-dependent +TEST_NF = -a -w -p ~flaky ~timing-dependent -# special CI target derived from nonflaky with CI-specific flags -TEST_CI = $(TEST_NF) -r --retry=5 -j20 --buildinfo +# special target for CI use +TEST_CI = -a -p ~flaky ~timing-dependent -r --retry=5 -j20 --buildinfo PYTEST = pytest endif diff --git a/tests/data/test1008 b/tests/data/test1008 index be858d0038bc..6d4d80079a8f 100644 --- a/tests/data/test1008 +++ b/tests/data/test1008 @@ -54,21 +54,21 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK swsbounce +HTTP/1.1 200 OK swsbounce%CR Server: no - +%CR Nice proxy auth sir! -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Transfer-Encoding: chunked - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==%CR +Transfer-Encoding: chunked%CR +%CR +HTTP/1.1 200 Things are fine in proxy land%CR +Server: Microsoft-IIS/5.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test1021 b/tests/data/test1021 index 4d85468e8dd2..87a4432645db 100644 --- a/tests/data/test1021 +++ b/tests/data/test1021 @@ -54,26 +54,26 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK swsbounce +HTTP/1.1 200 OK swsbounce%CR Server: no - +%CR Nice proxy auth sir! -HTTP/1.1 407 Authorization Required to proxy me my dear swsclose -Proxy-Authenticate: NTLM -Content-Length: 16 -Connection: close - -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 28 - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - +HTTP/1.1 407 Authorization Required to proxy me my dear swsclose%CR +Proxy-Authenticate: NTLM%CR +Content-Length: 16%CR +Connection: close%CR +%CR +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==%CR +Content-Length: 28%CR +%CR +HTTP/1.1 200 Things are fine in proxy land%CR +Server: Microsoft-IIS/5.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test1040 b/tests/data/test1040 index f5202949e645..9c06cc11ab82 100644 --- a/tests/data/test1040 +++ b/tests/data/test1040 @@ -30,10 +30,10 @@ Content-Length: 0 012345678 012345678 012345678 -HTTP/1.1 416 Invalid range -Connection: close -Content-Length: 0 - +HTTP/1.1 416 Invalid range%CR +Connection: close%CR +Content-Length: 0%CR +%CR diff --git a/tests/data/test1042 b/tests/data/test1042 index a21a2c92f477..53fe88e0feed 100644 --- a/tests/data/test1042 +++ b/tests/data/test1042 @@ -42,11 +42,11 @@ Content-Type: text/plain 012345678 012345678 012345678 -HTTP/1.1 200 OK -Connection: close -Content-Length: 100 -Content-Type: text/plain - +HTTP/1.1 200 OK%CR +Connection: close%CR +Content-Length: 100%CR +Content-Type: text/plain%CR +%CR diff --git a/tests/data/test1043 b/tests/data/test1043 index 74a76e2ad0d9..66de6eb81a41 100644 --- a/tests/data/test1043 +++ b/tests/data/test1043 @@ -32,13 +32,13 @@ Content-Range: bytes 40-99/100 012345678 012345678 012345678 -HTTP/1.1 206 Partial Content -Date: Mon, 13 Nov 2007 13:41:09 GMT -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -Accept-Ranges: bytes -Content-Length: 60 -Content-Range: bytes 40-99/100 - +HTTP/1.1 206 Partial Content%CR +Date: Mon, 13 Nov 2007 13:41:09 GMT%CR +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT%CR +Accept-Ranges: bytes%CR +Content-Length: 60%CR +Content-Range: bytes 40-99/100%CR +%CR 012345678 012345678 012345678 diff --git a/tests/data/test1053 b/tests/data/test1053 index 171d4647a828..4f6266d196cc 100644 --- a/tests/data/test1053 +++ b/tests/data/test1053 @@ -77,54 +77,54 @@ bar ^(Content-Type: multipart/form-data;|------------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 434 -Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 - -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="name" - -daniel -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="tool" - -curl -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 434%CR +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763%CR +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------9ef8d6205763-- -POST /we/want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 434 -Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 - -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="name" - -daniel -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="tool" - -curl -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +%CR +------------------------------9ef8d6205763--%CR +POST /we/want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 434%CR +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763%CR +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------9ef8d6205763-- +%CR +------------------------------9ef8d6205763--%CR diff --git a/tests/data/test1055 b/tests/data/test1055 index c09561a4f0b0..6305ff017b37 100644 --- a/tests/data/test1055 +++ b/tests/data/test1055 @@ -55,12 +55,12 @@ the # Verify data after the test has been "shot" -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 78 - +PUT /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 78%CR +%CR Weird file to @@ -70,13 +70,13 @@ for the PUT feature -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -STOR %TESTNUMBER -QUIT +USER anonymous%CR +PASS ftp@example.com%CR +PWD%CR +EPSV%CR +TYPE I%CR +STOR %TESTNUMBER%CR +QUIT%CR Weird diff --git a/tests/data/test1060 b/tests/data/test1060 index 6e557a1c5fbb..25abe3622557 100644 --- a/tests/data/test1060 +++ b/tests/data/test1060 @@ -37,20 +37,20 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK +HTTP/1.1 200 OK%CR Server: no - +%CR -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 35701 -X-tra-long-header: %repeat[16080 x a]% - -HTTP/1.1 200 OK +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"%CR +Content-Length: 35701%CR +X-tra-long-header: %repeat[16080 x a]%%CR +%CR +HTTP/1.1 200 OK%CR Server: no - +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test1061 b/tests/data/test1061 index 74e2c44d00a0..94e0c205ade8 100644 --- a/tests/data/test1061 +++ b/tests/data/test1061 @@ -16,16 +16,16 @@ HTTP proxy Digest auth # this is returned first since we get no proxy-auth -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Transfer-Encoding: chunked -X-tra-long-header: %repeat[16080 x a]% - -9c41 +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"%CR +Transfer-Encoding: chunked%CR +X-tra-long-header: %repeat[16080 x a]%%CR +%CR +9c41%CR %repeat[800 x And you should ignore this data. aaaaaaaaaaaaaaa %0a]% - -0 - +%CR +0%CR +%CR # this is returned when we get a GET! @@ -42,20 +42,20 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK +HTTP/1.1 200 OK%CR Server: no - +%CR -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Transfer-Encoding: chunked -X-tra-long-header: %repeat[16080 x a]% - -HTTP/1.1 200 OK +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"%CR +Transfer-Encoding: chunked%CR +X-tra-long-header: %repeat[16080 x a]%%CR +%CR +HTTP/1.1 200 OK%CR Server: no - +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test1066 b/tests/data/test1066 index 3cb465c1078d..fbd74c40af0e 100644 --- a/tests/data/test1066 +++ b/tests/data/test1066 @@ -54,27 +54,27 @@ Accept: */* -HTTP/1.1 200 OK -HTTP/1.1 200 OK -Server: thebest/1.0 -Server: thebest/1.0 -Content-Type: text/plain -Content-Type: text/plain -Content-Length: 6 -Content-Length: 6 - - +HTTP/1.1 200 OK%CR +HTTP/1.1 200 OK%CR +Server: thebest/1.0%CR +Server: thebest/1.0%CR +Content-Type: text/plain%CR +Content-Type: text/plain%CR +Content-Length: 6%CR +Content-Length: 6%CR +%CR +%CR first -HTTP/1.1 200 OK -HTTP/1.1 200 OK -Server: thebest/1.0 -Server: thebest/1.0 -Content-Type: text/plain -Content-Type: text/plain -Content-Length: 7 -Content-Length: 7 - - +HTTP/1.1 200 OK%CR +HTTP/1.1 200 OK%CR +Server: thebest/1.0%CR +Server: thebest/1.0%CR +Content-Type: text/plain%CR +Content-Type: text/plain%CR +Content-Length: 7%CR +Content-Length: 7%CR +%CR +%CR second diff --git a/tests/data/test1068 b/tests/data/test1068 index 7c0406236f56..7c1be009ac18 100644 --- a/tests/data/test1068 +++ b/tests/data/test1068 @@ -39,18 +39,18 @@ more than one byte # Verify data after the test has been "shot" -PUT /bzz/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked -Expect: 100-continue - -13 +PUT /bzz/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Expect: 100-continue%CR +%CR +13%CR more than one byte - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test1072 b/tests/data/test1072 index 42729a4f8fa2..7f8bba0d3505 100644 --- a/tests/data/test1072 +++ b/tests/data/test1072 @@ -56,21 +56,21 @@ which is impossible in HTTP/1.0 25 -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked -Expect: 100-continue - -7a +PUT /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Expect: 100-continue%CR +%CR +7a%CR This is data we upload with PUT it comes from stdin so MUST be sent with chunked encoding which is impossible in HTTP/1.0 - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test1073 b/tests/data/test1073 index cd41e789e08a..0f79a81fae36 100644 --- a/tests/data/test1073 +++ b/tests/data/test1073 @@ -50,21 +50,21 @@ which is impossible in HTTP/1.0 25 -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked -Expect: 100-continue - -7a +PUT /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Expect: 100-continue%CR +%CR +7a%CR This is data we upload with PUT it comes from stdin so MUST be sent with chunked encoding which is impossible in HTTP/1.0 - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test1123 b/tests/data/test1123 index 594ff668cdc5..d0fc9fb0665b 100644 --- a/tests/data/test1123 +++ b/tests/data/test1123 @@ -11,30 +11,30 @@ Transfer-Encoding # Server-side -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: deflate, chunked - -519 +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Transfer-Encoding: deflate, chunked%CR +%CR +519%CR %hex[%78%9c%dc%58%db%6e%e3%36%10%7d%37%90%7f%60%fd%d4%02%b6%6e%b6%13%39%70%b4%28%72%d9%04%cd%36%c1%da%05%ba%4f%06%2d%d1%36%1b%49%14%48%ca%b9%3c%f4%db%3b%94%28%89%b1%1c%af%77%83%be%04%48%62%72%e6%9c%c3%e1%0c%49%93%99%7c%7a%4a%62%b4%21%5c%50%96%9e%75%5d%cb%e9%22%92%86%2c%a2%e9%ea%ac%7b%33%bd%eb%fb%fe%68%dc%77%bb%9f%82%ce%e4%97%8b%bb%f3%d9%b7%fb%4b%94%71%f6%0f%09%65%3f%a6%42%02%10%4d%bf%4d%67%97%5f%50%77%2d%65%76%6a%db%4b%4e%c4%3a%21%58%5a%29%91%f6%02%87%0f%24%8d%ec%65%d2%d7%3c%d1%77%ac%a1%15%c9%a8%0b%a2%5b%5a%41%07%a1%ca%a6%da%4d%6f%4e%a3%c0%3d%76%bd%89%6d%18%4a%44%84%25%99%e3%28%22%80%18%8f%fd%be%e3%f7%3d%17%39%c3%53%c7%3d%f5%c6%13%db%f0%1b%84%3c%53%1f%51%e0%39%ce%b0%ef%3a%7d%d7%47%8e%77%ea%c1%cf%40%53%2a%c4%ab%38%52%9c%90%b9%58%33%2e%83%30%e7%71%1d%8e%61%6f%e3%97%79%1c%17%70%84%d3%08%c5%74%d1%a6%16%10%1d%1e%11%a1%96%3a%67%49%52%52%52%82%24%63%b5%00%c7%fc%19%2d%19%47%61%4c%49%2a%fb%82%46%04%fd%f5%f5%16%49%8e%53%b1%84%8a%5a%30%8b%46%c8%50%de%19%0c%a2%02%e1%72%04%a5%5a%a9%70%55%df%25%8d%89%38%ea%e4%42%75%d4%18%e2%39%95%f8%c9%42%37%12%89%3c%cb%40%5f%a0%eb%d9%ec%be%57%fc%9d%f6%d0%15%b4%8f%3a%57%45%fb%e2%e6%7c%d6%43%b3%cb%db%3f%2f%e1%f3%f6%e2%77%80%5d%dd%dc%5e%f6%8a%e1%3f%df%dd%5f%5f%7e%85%36%0c%f0%48%62%88%a9%94%ea%67%4c%c8%9e%6e%e6%d0]hex% %hex[%19%7b%a0%44%14%da%28%cf%62%86%23%18%02%96%5a%9e%90%a8%99%75%0f%65%58%88%47%c6%23%d5%84%c8%d2%3c%59%14%f6%e9%f4%f6%a8%13%12%2e%e9%92%86%50%57%30%fd%41%38%f8%98%28%43%81%6a%3c%c1%08%c5%b4%20%1b%19%7b%24%9c%44%47%9d%c5%73%95%a4%1e%92%6b%f2%66%c6%ab%b2%58%47%9d%d9%1a%a8%08%c3%ef%82%a6%6a%33%09%48%6d%9d%6a%95%60%06%9b%0e%79%ce%51%27%c6%e9%2a%c7%2b%22%8a%18%48%ba%a1%9c%a5%09%0c%20%40%47%97%d0%58%1b%1b%2a%71%4c%e5%f3%5c%84%8c%93%60%74%e2%0f%ad%d1%c9%c4%de%b2%6f%81%33%c2%43%90%0c%06%96%7b%6c%60%2b%f3%16%1a%e6%f3%00%7b%6d%6c%20%0b%93%5e%d7%2c%cb%63%cc%9b%b1%8e%47%63%88%61%08%cb%79%db%d3%22%54%03%ba%03%cb%77%5f%11%5e%87%62%38%ca%60%9c%d1%2b%b4%11%0e%c7%c5%b9%e1%5b%23%67%62%eb%8e%e9%99%87%2c%07%5d%cf%ad%bc%da%f0]hex% %hex[%53%0e%e2%0f%6a%8c%31%80%c8%17%22%e4%34%93%70%44%8a%60%a0%4e%87%d7%a6%12%06%a5%4f%c3%f5%5c%ed%e5%e0%82%2c%71%1e%cb%89%6d%1a%4b%18%d4%7f%5e%1d%60%19%94%3d%d8%79%68%56%27%a5%ad%d6%8b%3d%b1%5b%ac%46%6c%cd%12%f2%b6%10%2c%60%ca%4b%15%75%78%da%26%43%eb%d6%02%8d%a6%5c%bd%1c%2e%07%60%ad%a4%68%8d%c8%e2%c5%3b%5c%04%c0%5a%44%d1%1a%91%17%9a%1d%2e%02%60%2d%a2%68%8d%48%b8%86%3d%46%62%b6%3a%5c%aa%a6%68%c1%46%a2%91%e5%59%72%b8%20%80%b5%94%a2%35%22%11%59%1c%2e%02%60%2d%a2%68%8d%08%13%4f%87%8b%00%58%8b%28%9a%51%2f%11%a9%f3%f2%07%6a%56%12%aa%ba%69%ba%b1%cc%73%0e%69%13%24%d0%eb%b7%ea%1a%85%d9%88%1f%28%c9%46%54%c5%d8%08%43%44%dd%1c%0e%57%51%68%2d%53%10%1b%9d%84%72%ce%f8%e1%4a%25%5e%6b%69%b2%59%d7%84%05%55%ad%a0%59%7a%62]hex% %hex[%87%1c%a4%e0%cb%cd%cc%fe%1b%9d%c3%e9%01%29%a3%79%82%6e%4b%c7%c4%ae%10%1a%af%be%a7%e4%9c%93%98%d4%99%6b%99%e7%fa%fe%16%9c%58%ae%67%c1%05%e9%0d%f7%1b%6c%75%af%3a%39%76%fc%51%8b%58%5d%b0%da%1c%75%2f%da%7d%71%da%05%2c%e7%62%ef%9a%cc%04%ce%51%02%13%5e%33%39%97%6b%f8%aa%86%9c%b5%4c%25%12%e7%12%6e%32%a2%0e%a9%ec%57%dd%da%a0%4f%60%9c%52%12%a3%a9%24%29%7c%c3%af%26%b6%e9%6c%51%a0%4a%bb%eb%fe%ef%02%af%22%a2%8a%6c%20%5b%74%ce%62%12%dc%3d%a6%84%d7%b8%c2%54%45%6a%9b%a1%56%bd%6a%09%ab%2f%78%4e%13%9a%62%69%ce%4e%72%b8%21%14%b5%81%82%d6%9d%96%d7%f3%8e%f7%b9%07%7b%b9%fb%9c%ae%ef%ef%e5%ba%7b%c7%85%a5%b1%3f%ea%bd%6e%f7%78%b8%cf%3d%de%4b%f6%c7%7b%bd%ce%5e%b7%3b%fa%4e%dc%df%09%6c%7f%64%83%d6%d8%e5%fd%6e%bb%fc%b0%26%32%78%32%c1%43%0c%ae%a3%b5%4e%6d%7c%46%f2%39%23%67%5d%4e%42%78%1d%28%9b%7a%49%d5%8b%b2%c1%99%1b%d9%51%43%ed%72%ec%24%ea%7b%0b%b8%4f%86%aa%18%3b%5d%3b%99%c6%e3%ac%45%dd%7e%b8%bd%c5%95%54%aa%0d%05%76%b8%b3%a3%5f%f5%6d%ea%b7%9d%5a%25%b6%de%69%0d%e2%ed%bc%b1%e2%de%86%e3%ff%2f%69%ce%4f%67%6c%38%78%67%c6%d4%fb%ea%e3%27%ca%f5%06%23%f7%1d%99%7a%81%a7%d8%c7%cf%d2%c0%73%86%27%ef%c8%d2%35%a1%49%84%e3%8f%9f%a8%e1%70%34%f0%de%91%a8%b0%0f%4f%7d%f1%33%79%32%2c%fa%ac%af%ff%2b%14%74%fe%03%00%00%ff%ff%82%33%11%a3%63%00%00%00%00%ff%ff%03%00%dd%38%8e%d1%0d]hex% -0 - +0%CR +%CR -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: deflate, chunked - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Transfer-Encoding: deflate, chunked%CR +%CR @@ -45,15 +45,15 @@ Transfer-Encoding: deflate, chunked curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test1133 b/tests/data/test1133 index 4b7cb321bceb..a14dbe8ee9ac 100644 --- a/tests/data/test1133 +++ b/tests/data/test1133 @@ -46,60 +46,60 @@ foo ^(Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1324 -Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file"; filename="faker,and;.txt" -Content-Type: mo/foo - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 1324%CR +Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32%CR +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file"; filename="faker,and;.txt"%CR +Content-Type: mo/foo%CR +%CR foo bar This is a bar foo bar foo - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER,and;.txt" -Content-Type: text/plain - +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER,and;.txt"%CR +Content-Type: text/plain%CR +%CR foo bar This is a bar foo bar foo - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file3" -Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b - -Content-Disposition: attachment; filename="test%TESTNUMBER,and;.txt" -Content-Type: m/f - +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file3"%CR +Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b%CR +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER,and;.txt"%CR +Content-Type: m/f%CR +%CR foo bar This is a bar foo bar foo - -Content-Disposition: attachment; filename="test%TESTNUMBER,and;.txt" -Content-Type: text/plain - +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER,and;.txt"%CR +Content-Type: text/plain%CR +%CR foo bar This is a bar foo bar foo - - -Content-Disposition: form-data; name="a" - -{"field1":"value1","field2":"value2"} -Content-Disposition: form-data; name="b"; filename="param_b" -Content-Type: text/foo; charset=utf-8 - - \value1;type="whatever" -------------------------------24e78000bd32-- +%CR +%CR +Content-Disposition: form-data; name="a"%CR +%CR +{"field1":"value1","field2":"value2"}%CR +Content-Disposition: form-data; name="b"; filename="param_b"%CR +Content-Type: text/foo; charset=utf-8%CR +%CR + \value1;type="whatever" %CR +------------------------------24e78000bd32--%CR diff --git a/tests/data/test1158 b/tests/data/test1158 index 61394311ee19..bc9f2d571995 100644 --- a/tests/data/test1158 +++ b/tests/data/test1158 @@ -47,53 +47,53 @@ foo ^(Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1006 -Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER%22.txt" -Content-Type: mo/foo - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 1006%CR +Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32%CR +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER%22.txt"%CR +Content-Type: mo/foo%CR +%CR foo bar This is a bar foo bar foo - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER%22.txt" -Content-Type: text/plain - +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER%22.txt"%CR +Content-Type: text/plain%CR +%CR foo bar This is a bar foo bar foo - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file3" -Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b - -Content-Disposition: attachment; filename="test%TESTNUMBER%22.txt" -Content-Type: m/f - +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file3"%CR +Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b%CR +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER%22.txt"%CR +Content-Type: m/f%CR +%CR foo bar This is a bar foo bar foo - -Content-Disposition: attachment; filename="test%TESTNUMBER%22.txt" -Content-Type: text/plain - +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER%22.txt"%CR +Content-Type: text/plain%CR +%CR foo bar This is a bar foo bar foo - - -------------------------------24e78000bd32-- +%CR +%CR +------------------------------24e78000bd32--%CR diff --git a/tests/data/test1186 b/tests/data/test1186 index 668459f8c53e..e3157f36ca54 100644 --- a/tests/data/test1186 +++ b/tests/data/test1186 @@ -47,53 +47,53 @@ foo ^(Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1002 -Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER\".txt" -Content-Type: mo/foo - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 1002%CR +Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32%CR +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER\".txt"%CR +Content-Type: mo/foo%CR +%CR foo bar This is a bar foo bar foo - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER\".txt" -Content-Type: text/plain - +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER\".txt"%CR +Content-Type: text/plain%CR +%CR foo bar This is a bar foo bar foo - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="file3" -Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b - -Content-Disposition: attachment; filename="test%TESTNUMBER\".txt" -Content-Type: m/f - +%CR +------------------------------24e78000bd32%CR +Content-Disposition: form-data; name="file3"%CR +Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b%CR +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER\".txt"%CR +Content-Type: m/f%CR +%CR foo bar This is a bar foo bar foo - -Content-Disposition: attachment; filename="test%TESTNUMBER\".txt" -Content-Type: text/plain - +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER\".txt"%CR +Content-Type: text/plain%CR +%CR foo bar This is a bar foo bar foo - - -------------------------------24e78000bd32-- +%CR +%CR +------------------------------24e78000bd32--%CR diff --git a/tests/data/test1189 b/tests/data/test1189 index d1f4a6a80d5a..3e5748eafdce 100644 --- a/tests/data/test1189 +++ b/tests/data/test1189 @@ -46,66 +46,66 @@ foo ^(Content-Type: multipart/form-data;|-------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1240 -Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="name" - -daniel -------------------------------24e78000bd32 -Content-Disposition: form-data; name="tool" - -curl -------------------------------24e78000bd32 -Content-Disposition: form-data; name="str1" - -@literal -------------------------------24e78000bd32 -Content-Disposition: form-data; name="str2" - - diff --git a/tests/data/test1273 b/tests/data/test1273 index b813b6435a6d..34708e10c5f0 100644 --- a/tests/data/test1273 +++ b/tests/data/test1273 @@ -31,10 +31,10 @@ Content-Length: 0 012345678 012345678 012345678 -HTTP/1.1 416 Invalid range -Connection: close -Content-Length: 0 - +HTTP/1.1 416 Invalid range%CR +Connection: close%CR +Content-Length: 0%CR +%CR diff --git a/tests/data/test1274 b/tests/data/test1274 index 1445cd265e4a..46e5f8999907 100644 --- a/tests/data/test1274 +++ b/tests/data/test1274 @@ -11,17 +11,17 @@ header line folding # Server-side -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/ - fake - folded -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Content-Length: 6 -Connection: - close - +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/%CR + fake%CR + folded%CR +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT%CR +ETag: "21025-dc7-39462498"%CR +Content-Length: 6%CR +Connection: %CR + close%CR +%CR -foo- diff --git a/tests/data/test1277 b/tests/data/test1277 index 1e841b2d093f..b229a0e1c252 100644 --- a/tests/data/test1277 +++ b/tests/data/test1277 @@ -12,33 +12,33 @@ Content-Encoding # Server-side -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked -Content-Encoding: deflate - -522 +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Transfer-Encoding: gzip, chunked%CR +Content-Encoding: deflate%CR +%CR +522%CR %hex[%1f%8b%08%00%07%81%b0%63%02%ff%01%0b%05%f4%fa%78%da%dd%58%db%6e%e3%36%10%7d%37%90%7f%60%fd%d4%02%b6%6e%b6%13%39%70%b4%28%72%d9%04%cd%36%c1%da%05%ba%4f%06%2d%d1%36%1b%49%14%48%ca%b9%3c%f4%db%3b%94%28%89%b1%1c%af%77%83%be%04%48%62%72%e6%9c%c3%e1%0c%49%93%99%7c%7a%4a%62%b4%21%5c%50%96%9e%75%5d%cb%e9%22%92%86%2c%a2%e9%ea%ac%7b%33%bd%eb%fb%fe%68%dc%77%bb%9f%82%ce%e4%97%8b%bb%f3%d9%b7%fb%4b%94%71%f6%0f%09%65%3f%a6%42%02%10%4d%bf%4d%67%97%5f%50%77%2d%65%76%6a%db%4b%4e%c4%3a%21%58%5a%29%91%f6%02%87%0f%24%8d%ec%65%d2%d7%3c%d1%77%ac%a1%15%c9%a8%0b%a2%5b%5a%41%07%a1%ca%a6%da%4d%6f%4e%a3%c0%3d%76%bd%89%6d%18%4a%44%84%25%99%e3%28%22%80%18%8f%fd%be%e3%f7%3d%17%39%c3%53%c7%3d%f5%c6%13%db%f0%1b%84%3c%53%1f%51%e0%39%ce%b0%ef%3a%7d%d7%47%8e%77%ea%c1%cf%40%53%2a%c4%ab%38%52%9c%90%b9%58%33%2e%83%30%e7%71%1d%8e%61%6f%e3%97%79%1c%17%70%84%d3%08%c5%74%d1%a6%16%10%1d%1e%11%a1%96%3a%67%49%52%52%52%82%24%63%b5%00%c7%fc%19%2d%19%47%61%4c%49%2a%fb%82%46%04%fd%f5%f5%16%49%8e%53%b1%84%8a%5a%30%8b%46%c8%50%de%19%0c%a2%02%e1%72%04%a5%5a%a9%70%55%df%25%8d%89%38%ea%e4%42%75%d4%18%e2%39%95%f8%c9%42%37%12%89%3c%cb%40%5f%a0%eb%d9%ec%be%57%fc%9d%f6%d0%15%b4%8f%3a%57%45%fb%e2%e6%7c%d6%43%b3%cb%db%3f%2f%e1%f3%f6%e2%77%80%5d%dd%dc%5e%f6%8a%e1%3f%df%dd%5f%5f%7e%85%36%0c%f0%48%62%88%a9%94%ea%67%4c%c8%9e%6e%e6%d0]hex% %hex[%19%7b%a0%44%14%da%28%cf%62%86%23%18%02%96%5a%9e%90%a8%99%75%0f%65%58%88%47%c6%23%d5%84%c8%d2%3c%59%14%f6%e9%f4%f6%a8%13%12%2e%e9%92%86%50%57%30%fd%41%38%f8%98%28%43%81%6a%3c%c1%08%c5%b4%20%1b%19%7b%24%9c%44%47%9d%c5%73%95%a4%1e%92%6b%f2%66%c6%ab%b2%58%47%9d%d9%1a%a8%08%c3%ef%82%a6%6a%33%09%48%6d%9d%6a%95%60%06%9b%0e%79%ce%51%27%c6%e9%2a%c7%2b%22%8a%18%48%ba%a1%9c%a5%09%0c%20%40%47%97%d0%58%1b%1b%2a%71%4c%e5%f3%5c%84%8c%93%60%74%e2%0f%ad%d1%c9%c4%de%b2%6f%81%33%c2%43%90%0c%06%96%7b%6c%60%2b%f3%16%1a%e6%f3%00%7b%6d%6c%20%0b%93%5e%d7%2c%cb%63%cc%9b%b1%8e%47%63%88%61%08%cb%79%db%d3%22%54%03%ba%03%cb%77%5f%11%5e%87%62%38%ca%60%9c%d1%2b%b4%11%0e%c7%c5%b9%e1%5b%23%67%62%eb%8e%e9%99%87%2c%07%5d%cf%ad%bc%da%f0]hex% %hex[%53%0e%e2%0f%6a%8c%31%80%c8%17%22%e4%34%93%70%44%8a%60%a0%4e%87%d7%a6%12%06%a5%4f%c3%f5%5c%ed%e5%e0%82%2c%71%1e%cb%89%6d%1a%4b%18%d4%7f%5e%1d%60%19%94%3d%d8%79%68%56%27%a5%ad%d6%8b%3d%b1%5b%ac%46%6c%cd%12%f2%b6%10%2c%60%ca%4b%15%75%78%da%26%43%eb%d6%02%8d%a6%5c%bd%1c%2e%07%60%ad%a4%68%8d%c8%e2%c5%3b%5c%04%c0%5a%44%d1%1a%91%17%9a%1d%2e%02%60%2d%a2%68%8d%48%b8%86%3d%46%62%b6%3a%5c%aa%a6%68%c1%46%a2%91%e5%59%72%b8%20%80%b5%94%a2%35%22%11%59%1c%2e%02%60%2d%a2%68%8d%08%13%4f%87%8b%00%58%8b%28%9a%51%2f%11%a9%f3%f2%07%6a%56%12%aa%ba%69%ba%b1%cc%73%0e%69%13%24%d0%eb%b7%ea%1a%85%d9%88%1f%28%c9%46%54%c5%d8%08%43%44%dd%1c%0e%57%51%68%2d%53%10%1b%9d%84%72%ce%f8%e1%4a%25%5e%6b%69%b2%59%d7%84%05%55%ad%a0%59%7a%62]hex% %hex[%87%1c%a4%e0%cb%cd%cc%fe%1b%9d%c3%e9%01%29%a3%79%82%6e%4b%c7%c4%ae%10%1a%af%be%a7%e4%9c%93%98%d4%99%6b%99%e7%fa%fe%16%9c%58%ae%67%c1%05%e9%0d%f7%1b%6c%75%af%3a%39%76%fc%51%8b%58%5d%b0%da%1c%75%2f%da%7d%71%da%05%2c%e7%62%ef%9a%cc%04%ce%51%02%13%5e%33%39%97%6b%f8%aa%86%9c%b5%4c%25%12%e7%12%6e%32%a2%0e%a9%ec%57%dd%da%a0%4f%60%9c%52%12%a3%a9%24%29%7c%c3%af%26%b6%e9%6c%51%a0%4a%bb%eb%fe%ef%02%af%22%a2%8a%6c%20%5b%74%ce%62%12%dc%3d%a6%84%d7%b8%c2%54%45%6a%9b%a1%56%3d%61%5c%c9%38%4d%68%8a%a5%39%3b%c9%e1%86%50%d4%06]hex% %hex[%5a%77%5a%5e%cf%3b%de%e7%1e%ec%e5%ee%73%ba%be%bf%97%eb%ee%1d%17%96%c6%fe%a8%f7%ba%dd%e3%e1%3e%f7%78%2f%d9%1f%ef%f5%3a%7b%dd%ee%e8%3b%71%7f%27%b0%fd%91%0d%5a%63%97%f7%bb%ed%f2%c3%9a%c8%e0%c9%04%0f%31%b8%8e%d6%3a%b5%f1%19%c9%e7%8c%9c%75%39%09%e1%75%a0%6c%ea%25%55%2f%ca%06%67%6e%64%47%0d%b5%cb%b1%93%a8%ef%2d%e0%3e%19%aa%62%ec%74%ed%64%1a%8f%b3%16%75%fb%e1%f6%16%57%52%a9%36%14%d8%e1%ce%8e%7e%d5%b7%a9%df%76%6a%95%d8%7a%a7%35%88%b7%f3%c6%8a%7b%1b%8e%ff%bf%a4%39%3f%9d%b1%e1%e0%9d%19%53%ef%ab%8f%9f%28%d7%1b%8c%dc%77%64%ea%05%9e%62%1f%3f%4b%03%cf%19%9e%bc%23%4b%d7%84%26%11%8e%3f%7e%a2%86%c3%d1%c0%7b%47%a2%c2%3e%3c%f5%c5%cf%e4%c9%b0%e8%b3%be%fe%af%50%d0%a9%9b%cd%7f%c7%fe%03%dd%38%8e%d1%d3%ef%e8%18%0b%05%00%00%0d]hex% -0 - +0%CR +%CR -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: gzip, chunked -Content-Encoding: deflate - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Transfer-Encoding: gzip, chunked%CR +Content-Encoding: deflate%CR +%CR @@ -49,15 +49,15 @@ Content-Encoding: deflate curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test1288 b/tests/data/test1288 index b14bf8aae752..4cb90520b3fc 100644 --- a/tests/data/test1288 +++ b/tests/data/test1288 @@ -73,22 +73,22 @@ Accept: */* # Must not suppress in --verbose and --trace # Must not suppress in statistics (eg received header byte total) -HTTP/1.1 200 OK -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Server: test-server/fake -Content-Type: text/html -Content-Type: text/html -Funny-head: yesyes -Funny-head: yesyes -Content-Length: 9 -Content-Length: 9 -Connection: keep-alive -Connection: keep-alive - - +HTTP/1.1 200 OK%CR +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Server: test-server/fake%CR +Content-Type: text/html%CR +Content-Type: text/html%CR +Funny-head: yesyes%CR +Funny-head: yesyes%CR +Content-Length: 9%CR +Content-Length: 9%CR +Connection: keep-alive%CR +Connection: keep-alive%CR +%CR +%CR contents CONNECT CODE: 200 diff --git a/tests/data/test1315 b/tests/data/test1315 index 94b3c4897098..01fd8d64247e 100644 --- a/tests/data/test1315 +++ b/tests/data/test1315 @@ -46,41 +46,41 @@ dummy data -----+\w+ -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 845 -Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 - -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="name" - -value -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="file" -Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa - -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 845%CR +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763%CR +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="name"%CR +%CR +value%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="file"%CR +Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa%CR +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR dummy data - -------------------------------9ef8d6205763 -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Type: magic/content - +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +Content-Type: magic/content%CR +%CR dummy data - -------------------------------9ef8d6205763 -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR dummy data - -------------------------------aaaaaaaaaaaa-- - -------------------------------9ef8d6205763-- +%CR +------------------------------aaaaaaaaaaaa--%CR +%CR +------------------------------9ef8d6205763--%CR diff --git a/tests/data/test1319 b/tests/data/test1319 index 94fc74d4a031..6e9aeff5c03a 100644 --- a/tests/data/test1319 +++ b/tests/data/test1319 @@ -27,7 +27,7 @@ To: fake@nowhere body -- - yours sincerely + yours sincerely%CR @@ -37,7 +37,7 @@ To: fake@nowhere body -- - yours sincerely + yours sincerely%CR diff --git a/tests/data/test1375 b/tests/data/test1375 index 2fc12d564870..9af026ba2e92 100644 --- a/tests/data/test1375 +++ b/tests/data/test1375 @@ -9,14 +9,14 @@ HTTP GET # -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Content-Length: 6%CR +Connection: close%CR +Content-Type: text/html%CR +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange%CR +%CR 12345 diff --git a/tests/data/test1376 b/tests/data/test1376 index dd920d813eb1..d673bd73539a 100644 --- a/tests/data/test1376 +++ b/tests/data/test1376 @@ -9,13 +9,13 @@ HTTP GET # -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html - +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Content-Length: 6%CR +Connection: close%CR +Content-Type: text/html%CR +%CR 12345 diff --git a/tests/data/test1377 b/tests/data/test1377 index d8e623b21c6f..c2ade403d29f 100644 --- a/tests/data/test1377 +++ b/tests/data/test1377 @@ -9,14 +9,14 @@ HTTP GET # -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 6 -Connection: close -Content-Type: text/html -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Content-Length: 6%CR +Connection: close%CR +Content-Type: text/html%CR +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange%CR +%CR 12345 diff --git a/tests/data/test1404 b/tests/data/test1404 index f3b31be1e568..1cf0c676eaaf 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -51,44 +51,44 @@ dummy data -----+\w+ -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 930 -Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 - -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="name" - -value -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="file" -Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa - -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 930%CR +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763%CR +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="name"%CR +%CR +value%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="file"%CR +Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa%CR +%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR dummy data - -------------------------------9ef8d6205763 -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Type: magic/content -Content-Transfer-Encoding: 8bit - +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +Content-Type: magic/content%CR +Content-Transfer-Encoding: 8bit%CR +%CR dummy data - -------------------------------9ef8d6205763 -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Type: text/plain -X-testheader-1: header 1 -X-testheader-2: header 2 - +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +X-testheader-1: header 1%CR +X-testheader-2: header 2%CR +%CR dummy data - -------------------------------aaaaaaaaaaaa-- - -------------------------------9ef8d6205763-- +%CR +------------------------------aaaaaaaaaaaa--%CR +%CR +------------------------------9ef8d6205763--%CR # curl's default user-agent varies with version, libraries etc. diff --git a/tests/data/test1416 b/tests/data/test1416 index 14d52475fb3e..e9983bebadab 100644 --- a/tests/data/test1416 +++ b/tests/data/test1416 @@ -15,15 +15,15 @@ Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked Connection: mooo -12345678123456789 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +12345678123456789%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test1417 b/tests/data/test1417 index 9af0a5b61f36..e998724dd99e 100644 --- a/tests/data/test1417 +++ b/tests/data/test1417 @@ -10,12 +10,12 @@ chunked Transfer-Encoding # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +%CR 40 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 30 @@ -28,14 +28,14 @@ chunky-trailer: header data -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data +chunky-trailer: header data%CR diff --git a/tests/data/test1428 b/tests/data/test1428 index 3a6253a56954..0004b2135412 100644 --- a/tests/data/test1428 +++ b/tests/data/test1428 @@ -26,8 +26,8 @@ HTTP/1.1 200 Mighty fine indeed -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test1429 b/tests/data/test1429 index b9372aca2aa3..b9c6bd126d60 100644 --- a/tests/data/test1429 +++ b/tests/data/test1429 @@ -9,17 +9,17 @@ HTTP/0.9 -HTTP/1.1 999 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT -ETag: "21025-dc7-39462498" -Accept-Ranges: bytes -Content-Length: 6 -Connection: close -Content-Type: text/html -Funny-head: yesyes - +HTTP/1.1 999 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT%CR +ETag: "21025-dc7-39462498"%CR +Accept-Ranges: bytes%CR +Content-Length: 6%CR +Connection: close%CR +Content-Type: text/html%CR +Funny-head: yesyes%CR +%CR -foo- diff --git a/tests/data/test1434 b/tests/data/test1434 index b811510ee347..567fa56b5b54 100644 --- a/tests/data/test1434 +++ b/tests/data/test1434 @@ -11,11 +11,11 @@ Resume # Some servers (e.g. Apache 1.2) respond this way to an invalid byte range -HTTP/1.1 200 OK -Connection: close -Content-Length: 100 -Content-Type: text/plain - +HTTP/1.1 200 OK%CR +Connection: close%CR +Content-Length: 100%CR +Content-Type: text/plain%CR +%CR 012345678 012345678 012345678 @@ -41,11 +41,11 @@ Content-Type: text/plain 012345678 012345678 012345678 -HTTP/1.1 200 OK -Connection: close -Content-Length: 100 -Content-Type: text/plain - +HTTP/1.1 200 OK%CR +Connection: close%CR +Content-Length: 100%CR +Content-Type: text/plain%CR +%CR diff --git a/tests/data/test1475 b/tests/data/test1475 index 3c43dda13e41..1f11829d72e4 100644 --- a/tests/data/test1475 +++ b/tests/data/test1475 @@ -12,11 +12,11 @@ Resume # Server-side -HTTP/1.1 416 Invalid range -Connection: close -Content-Length: 0 +HTTP/1.1 416 Invalid range%CR +Connection: close%CR +Content-Length: 0%CR Content-Range: */100 - +%CR # The file data that exists at the start of the test must be included in @@ -32,11 +32,11 @@ Content-Range: */100 012345678 012345678 012345678 -HTTP/1.1 416 Invalid range -Connection: close -Content-Length: 0 +HTTP/1.1 416 Invalid range%CR +Connection: close%CR +Content-Length: 0%CR Content-Range: */100 - +%CR diff --git a/tests/data/test1482 b/tests/data/test1482 index 8b0a245c28d3..ab615f6c127b 100644 --- a/tests/data/test1482 +++ b/tests/data/test1482 @@ -11,32 +11,32 @@ DELAY # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked, chunked -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked, chunked%CR +Connection: mooo%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data -another-header: yes - +%CR +0%CR +chunky-trailer: header data%CR +another-header: yes%CR +%CR -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked, chunked -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked, chunked%CR +Connection: mooo%CR +%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data -another-header: yes +chunky-trailer: header data%CR +another-header: yes%CR writedelay: 10 diff --git a/tests/data/test1483 b/tests/data/test1483 index 82ef88a84d53..fee3c5e3f02d 100644 --- a/tests/data/test1483 +++ b/tests/data/test1483 @@ -11,34 +11,34 @@ DELAY # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Transfer-Encoding: chunked -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Transfer-Encoding: chunked%CR +Connection: mooo%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data -another-header: yes - +%CR +0%CR +chunky-trailer: header data%CR +another-header: yes%CR +%CR -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Transfer-Encoding: chunked -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Transfer-Encoding: chunked%CR +Connection: mooo%CR +%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data -another-header: yes +chunky-trailer: header data%CR +another-header: yes%CR writedelay: 10 diff --git a/tests/data/test1493 b/tests/data/test1493 index 07821676a780..eaf67dc19d86 100644 --- a/tests/data/test1493 +++ b/tests/data/test1493 @@ -11,32 +11,32 @@ DELAY # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: identity, chunked -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: identity, chunked%CR +Connection: mooo%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data -another-header: yes - +%CR +0%CR +chunky-trailer: header data%CR +another-header: yes%CR +%CR -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: identity, chunked -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: identity, chunked%CR +Connection: mooo%CR +%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data -another-header: yes +chunky-trailer: header data%CR +another-header: yes%CR diff --git a/tests/data/test1498 b/tests/data/test1498 index f26b790f8ce6..467730d3a5a8 100644 --- a/tests/data/test1498 +++ b/tests/data/test1498 @@ -39,18 +39,18 @@ http://%HOSTIP:%HTTPPORT/bzz/%TESTNUMBER -T . # Verify data after the test has been "shot" -PUT /bzz/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked -Expect: 100-continue - -1771 +PUT /bzz/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Expect: 100-continue%CR +%CR +1771%CR %repeat[2000 x hej]% - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test1499 b/tests/data/test1499 index a3f28b008433..54fec7104998 100644 --- a/tests/data/test1499 +++ b/tests/data/test1499 @@ -10,32 +10,32 @@ chunked Transfer-Encoding # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data - +%CR +0%CR +chunky-trailer: header data%CR +%CR -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data +chunky-trailer: header data%CR writedelay: 10 diff --git a/tests/data/test1525 b/tests/data/test1525 index cfcdfb2bbd82..e9dbe67f2db7 100644 --- a/tests/data/test1525 +++ b/tests/data/test1525 @@ -25,8 +25,8 @@ ETag: "21025-dc7-39462498" -HTTP/1.1 200 OK - +HTTP/1.1 200 OK%CR +%CR HTTP/1.1 200 OK swsclose Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test1540 b/tests/data/test1540 index fa3b157190f9..6533eac3a12f 100644 --- a/tests/data/test1540 +++ b/tests/data/test1540 @@ -13,27 +13,27 @@ DELAY # Server-side -HTTP/1.1 200 OK swsclose -Transfer-Encoding: chunked -Trailer: MyCoolTrailerHeader - -4 -data -5 +HTTP/1.1 200 OK swsclose%CR +Transfer-Encoding: chunked%CR +Trailer: MyCoolTrailerHeader%CR +%CR +4%CR +data%CR +5%CR d474 - -0 -MyCoolTrailerHeader: amazingtrailer - +%CR +0%CR +MyCoolTrailerHeader: amazingtrailer%CR +%CR -HTTP/1.1 200 OK swsclose -Transfer-Encoding: chunked -Trailer: MyCoolTrailerHeader - +HTTP/1.1 200 OK swsclose%CR +Transfer-Encoding: chunked%CR +Trailer: MyCoolTrailerHeader%CR +%CR Got bytes but pausing! datad474 -MyCoolTrailerHeader: amazingtrailer +MyCoolTrailerHeader: amazingtrailer%CR writedelay: 10 diff --git a/tests/data/test1541 b/tests/data/test1541 index 9aaa90dddacf..1f3e534dc739 100644 --- a/tests/data/test1541 +++ b/tests/data/test1541 @@ -12,16 +12,16 @@ DELAY # Server-side -HTTP/1.1 200 OK swsclose -Transfer-Encoding: chunked - -4 -data -5 +HTTP/1.1 200 OK swsclose%CR +Transfer-Encoding: chunked%CR +%CR +4%CR +data%CR +5%CR d474 - -0 - +%CR +0%CR +%CR CURLINFO_CONNECT_TIME_T on 1st header is OK @@ -30,9 +30,9 @@ CURLINFO_STARTTRANSFER_TIME_T on 1st header is OK CURLINFO_TOTAL_TIME_T on 1st header is OK CURLINFO_APPCONNECT_TIME_T on 1st header is OK CURLINFO_SPEED_DOWNLOAD_T on 1st header is OK -HTTP/1.1 200 OK swsclose -Transfer-Encoding: chunked - +HTTP/1.1 200 OK swsclose%CR +Transfer-Encoding: chunked%CR +%CR datad474 CURLINFO_CONNECT_TIME_T on done is OK CURLINFO_PRETRANSFER_TIME_T on done is OK diff --git a/tests/data/test163 b/tests/data/test163 index a3bf37530994..14332c16c72e 100644 --- a/tests/data/test163 +++ b/tests/data/test163 @@ -41,7 +41,7 @@ file newlinens? yes please - + %CR [tab][CR] too @@ -52,16 +52,16 @@ yes please ^(Content-Type: multipart/form-data;|------------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 322 -Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac - -------------------------------c2d1767eb6ac -Content-Disposition: form-data; name="name" - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 322%CR +Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac%CR +%CR +------------------------------c2d1767eb6ac%CR +Content-Disposition: form-data; name="name"%CR +%CR contents from a @@ -69,14 +69,14 @@ file newlinens? yes please - + %CR [tab][CR] too - -------------------------------c2d1767eb6ac -Content-Disposition: form-data; name="tool" - -curl -------------------------------c2d1767eb6ac-- +%CR +------------------------------c2d1767eb6ac%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------c2d1767eb6ac--%CR diff --git a/tests/data/test164 b/tests/data/test164 index 527c2919bfad..978376e17fef 100644 --- a/tests/data/test164 +++ b/tests/data/test164 @@ -12,30 +12,30 @@ HTTP GET # to avoid XML escaping problems). -HTTP/1.1 206 Partial Content swsclose -Date: Sat, 24 Apr 2004 09:24:49 GMT -Server: Apache/1.3.29 (Unix) mod_throttle/3.1.2 PHP/4.3.4 mod_fastcgi/2.4.0 -Last-Modified: Tue, 23 Mar 2004 08:23:14 GMT -ETag: "53814a-ec5-405ff3f2" -Accept-Ranges: bytes -Content-Length: 187 -Content-Type: multipart/byteranges; boundary=408a326132c - ---408a326132c -Content-type: text/html -Content-range: bytes 0-10/3781 - +HTTP/1.1 206 Partial Content swsclose%CR +Date: Sat, 24 Apr 2004 09:24:49 GMT%CR +Server: Apache/1.3.29 (Unix) mod_throttle/3.1.2 PHP/4.3.4 mod_fastcgi/2.4.0%CR +Last-Modified: Tue, 23 Mar 2004 08:23:14 GMT%CR +ETag: "53814a-ec5-405ff3f2"%CR +Accept-Ranges: bytes%CR +Content-Length: 187%CR +Content-Type: multipart/byteranges; boundary=408a326132c%CR +%CR +--408a326132c%CR +Content-type: text/html%CR +Content-range: bytes 0-10/3781%CR +%CR {html} {hea - ---408a326132c -Content-type: text/html -Content-range: bytes 12-15/3781 - +%CR +--408a326132c%CR +Content-type: text/html%CR +Content-range: bytes 12-15/3781%CR +%CR } {t - ---408a326132c-- +%CR +--408a326132c--%CR diff --git a/tests/data/test166 b/tests/data/test166 index 0951b2359dce..86f6a6058427 100644 --- a/tests/data/test166 +++ b/tests/data/test166 @@ -44,20 +44,20 @@ data inside the file ^(Content-Type: multipart/form-data;|------------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 235 -Content-Type: multipart/form-data; boundary=----------------------------b0b3d6d23991 - -------------------------------b0b3d6d23991 -Content-Disposition: form-data; name="name"; filename="fie ld %TESTNUMBER" -Content-Type: application/octet-stream - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 235%CR +Content-Type: multipart/form-data; boundary=----------------------------b0b3d6d23991%CR +%CR +------------------------------b0b3d6d23991%CR +Content-Disposition: form-data; name="name"; filename="fie ld %TESTNUMBER"%CR +Content-Type: application/octet-stream%CR +%CR data inside the file - -------------------------------b0b3d6d23991-- +%CR +------------------------------b0b3d6d23991--%CR diff --git a/tests/data/test173 b/tests/data/test173 index 5e6f75169766..e31f6d22dd38 100644 --- a/tests/data/test173 +++ b/tests/data/test173 @@ -52,21 +52,21 @@ line8 ^(Content-Type: multipart/form-data;|------------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 378 -Content-Type: multipart/form-data; boundary=----------------------------5dbea401cd8c - -------------------------------5dbea401cd8c -Content-Disposition: form-data; name="field1" - -contents1 -------------------------------5dbea401cd8c -Content-Disposition: form-data; name="fileupload"; filename="%DEV_NULL" -Content-Type: text/x-null;format=x-curl - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 378%CR +Content-Type: multipart/form-data; boundary=----------------------------5dbea401cd8c%CR +%CR +------------------------------5dbea401cd8c%CR +Content-Disposition: form-data; name="field1"%CR +%CR +contents1%CR +------------------------------5dbea401cd8c%CR +Content-Disposition: form-data; name="fileupload"; filename="%DEV_NULL"%CR +Content-Type: text/x-null;format=x-curl%CR +%CR line1 line2 line3 @@ -75,8 +75,8 @@ line5 line6 line7 line8 - -------------------------------5dbea401cd8c-- +%CR +------------------------------5dbea401cd8c--%CR diff --git a/tests/data/test1904 b/tests/data/test1904 index 586948511601..7fb82e44d006 100644 --- a/tests/data/test1904 +++ b/tests/data/test1904 @@ -27,8 +27,8 @@ HTTP/1.1 204 Sure go ahead -HTTP/1.1 204 Sure go ahead - +HTTP/1.1 204 Sure go ahead%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test1940 b/tests/data/test1940 index b5ddd4c2b976..be2347e2d613 100644 --- a/tests/data/test1940 +++ b/tests/data/test1940 @@ -20,7 +20,7 @@ Set-Cookie: onecookie=data; Set-Cookie: secondcookie=2data; Set-Cookie: cookie3=data3; Blank: -Blank2: +Blank2:%CR Location: /%TESTNUMBER0002 diff --git a/tests/data/test1943 b/tests/data/test1943 index 194ff111be9d..c6c06d332dd9 100644 --- a/tests/data/test1943 +++ b/tests/data/test1943 @@ -9,23 +9,23 @@ CONNECT # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR Date: Thu, 09 Nov 2010 14:49:00 GMT -Transfer-Encoding: chunked -Trailer: server -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +Transfer-Encoding: chunked%CR +Trailer: server%CR +Connection: mooo%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -Server: sent-as-trailer - +%CR +0%CR +Server: sent-as-trailer%CR +%CR diff --git a/tests/data/test2002 b/tests/data/test2002 index 8fea4c110ec7..660901103cc9 100644 --- a/tests/data/test2002 +++ b/tests/data/test2002 @@ -76,24 +76,24 @@ moo ^timeout = [5-6]$ -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 +GET /%TESTNUMBER0001 HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +%CR +USER anonymous%CR +PASS ftp@example.com%CR +PWD%CR +EPSV%CR +TYPE I%CR +SIZE %TESTNUMBER0002%CR +RETR %TESTNUMBER0002%CR opcode = 1 mode = octet tsize = 0 blksize = 512 filename = /%TESTNUMBER0003 -QUIT +QUIT%CR -foo- diff --git a/tests/data/test2003 b/tests/data/test2003 index 58a9d9580ca8..ce5fcbcb6f0c 100644 --- a/tests/data/test2003 +++ b/tests/data/test2003 @@ -76,18 +76,18 @@ moo ^timeout = [5-6]$ -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -USER anonymous -PASS ftp@example.com -PWD -EPSV -TYPE I -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 +GET /%TESTNUMBER0001 HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +%CR +USER anonymous%CR +PASS ftp@example.com%CR +PWD%CR +EPSV%CR +TYPE I%CR +SIZE %TESTNUMBER0002%CR +RETR %TESTNUMBER0002%CR opcode = 1 mode = octet tsize = 0 @@ -98,15 +98,15 @@ mode = octet tsize = 0 blksize = 512 filename = /%TESTNUMBER0003 -EPSV -SIZE %TESTNUMBER0002 -RETR %TESTNUMBER0002 -GET /%TESTNUMBER0001 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* - -QUIT +EPSV%CR +SIZE %TESTNUMBER0002%CR +RETR %TESTNUMBER0002%CR +GET /%TESTNUMBER0001 HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +%CR +QUIT%CR -foo- diff --git a/tests/data/test206 b/tests/data/test206 index 36bb5391d86e..7a2acac7005f 100644 --- a/tests/data/test206 +++ b/tests/data/test206 @@ -41,19 +41,19 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK +HTTP/1.1 200 OK%CR Server: no - +%CR -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345" -Content-Length: 33 - -HTTP/1.1 200 OK +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"%CR +Content-Length: 33%CR +%CR +HTTP/1.1 200 OK%CR Server: no - +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test207 b/tests/data/test207 index 6d7e5c382bb8..afbd44f10e8c 100644 --- a/tests/data/test207 +++ b/tests/data/test207 @@ -17,9 +17,9 @@ Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked Connection: mooo -41 +41%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - +%CR HTTP/1.1 200 funky chunky! swsclose diff --git a/tests/data/test208 b/tests/data/test208 index d66f5cd17a32..9d10a14d02c8 100644 --- a/tests/data/test208 +++ b/tests/data/test208 @@ -51,14 +51,14 @@ the # Verify data after the test has been "shot" -PUT ftp://daniel:mysecret@host.com/we/want/%TESTNUMBER HTTP/1.1 -Host: host.com:21 -Authorization: Basic %b64[daniel:mysecret]b64% -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 78 - +PUT ftp://daniel:mysecret@host.com/we/want/%TESTNUMBER HTTP/1.1%CR +Host: host.com:21%CR +Authorization: Basic %b64[daniel:mysecret]b64%%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Content-Length: 78%CR +%CR Weird file to diff --git a/tests/data/test209 b/tests/data/test209 index 48ccde271c38..e856cb098aa2 100644 --- a/tests/data/test209 +++ b/tests/data/test209 @@ -45,21 +45,21 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK swsbounce +HTTP/1.1 200 OK swsbounce%CR Server: no - +%CR Nice proxy auth sir! -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 33 - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==%CR +Content-Length: 33%CR +%CR +HTTP/1.1 200 Things are fine in proxy land%CR +Server: Microsoft-IIS/5.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test213 b/tests/data/test213 index 909c84780712..81b2122bdf8e 100644 --- a/tests/data/test213 +++ b/tests/data/test213 @@ -45,21 +45,21 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK swsbounce +HTTP/1.1 200 OK swsbounce%CR Server: no - +%CR Nice proxy auth sir! -HTTP/1.1 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Content-Length: 33 - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - +HTTP/1.1 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==%CR +Content-Length: 33%CR +%CR +HTTP/1.1 200 Things are fine in proxy land%CR +Server: Microsoft-IIS/5.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test218 b/tests/data/test218 index 8d1a673ca43b..656450c3410d 100644 --- a/tests/data/test218 +++ b/tests/data/test218 @@ -40,17 +40,17 @@ just some tiny teeny contents # Verify data after the test has been "shot" -PUT /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked - -1e +PUT /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +%CR +1e%CR just some tiny teeny contents - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test222 b/tests/data/test222 index edcc3488d72c..e1b3bceb3ad3 100644 --- a/tests/data/test222 +++ b/tests/data/test222 @@ -25,14 +25,14 @@ Content-Length: 1305 -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate -Content-Length: 1305 - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Content-Encoding: deflate%CR +Content-Length: 1305%CR +%CR @@ -43,15 +43,15 @@ Content-Length: 1305 curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test230 b/tests/data/test230 index 0a14e4c15f8e..45f0a7f884c7 100644 --- a/tests/data/test230 +++ b/tests/data/test230 @@ -25,14 +25,14 @@ Content-Length: 1328 -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate, identity, gzip -Content-Length: 1328 - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Content-Encoding: deflate, identity, gzip%CR +Content-Length: 1328%CR +%CR @@ -43,15 +43,15 @@ Content-Length: 1328 curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test232 b/tests/data/test232 index 5b0cdb3015e7..94cb1b9f99d9 100644 --- a/tests/data/test232 +++ b/tests/data/test232 @@ -25,14 +25,14 @@ Content-Length: 1287 -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: deflate -Content-Length: 1287 - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Content-Encoding: deflate%CR +Content-Length: 1287%CR +%CR @@ -43,15 +43,15 @@ Content-Length: 1287 curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test258 b/tests/data/test258 index 5501ce9f8ed0..d361a3ade4c3 100644 --- a/tests/data/test258 +++ b/tests/data/test258 @@ -40,11 +40,11 @@ Proxy-Authenticate: Digest realm="many secrets", nonce="911" Proxy-Connection: close Content-Length: 0 -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - +HTTP/1.1 200 A OK%CR +Server: Microsoft-IIS/6.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +Content-Length: 3%CR +%CR ok @@ -82,57 +82,57 @@ bar ^(Content-Type: multipart/form-data;|------).* -POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1 -Host: remotehost:54321 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 433 -Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce - -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="name" - -daniel -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="tool" - -curl -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1%CR +Host: remotehost:54321%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Content-Length: 433%CR +Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce%CR +%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------7c633d5c27ce-- -POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1 -Host: remotehost:54321 -Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/%TESTNUMBER", response="2501654ca391f0b5c8c12a1da77e34cd" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 433 -Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce - -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="name" - -daniel -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="tool" - -curl -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +%CR +------------------------------7c633d5c27ce--%CR +POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1%CR +Host: remotehost:54321%CR +Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/%TESTNUMBER", response="2501654ca391f0b5c8c12a1da77e34cd"%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Content-Length: 433%CR +Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce%CR +%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------7c633d5c27ce-- +%CR +------------------------------7c633d5c27ce--%CR diff --git a/tests/data/test259 b/tests/data/test259 index 25ed26c98eab..adf7c2f5f3f4 100644 --- a/tests/data/test259 +++ b/tests/data/test259 @@ -36,11 +36,11 @@ Server: test-server/fake Proxy-Authenticate: Digest realm="many secrets", nonce="911" Content-Length: 0 -HTTP/1.1 200 A OK -Server: Microsoft-IIS/6.0 -Content-Type: text/html; charset=iso-8859-1 -Content-Length: 3 - +HTTP/1.1 200 A OK%CR +Server: Microsoft-IIS/6.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +Content-Length: 3%CR +%CR ok @@ -78,59 +78,59 @@ bar ^(Content-Type: multipart/form-data;|------).* -POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1 -Host: remotehost:54321 -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Expect: 100-continue -Content-Length: 433 -Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce - -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="name" - -daniel -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="tool" - -curl -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1%CR +Host: remotehost:54321%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Expect: 100-continue%CR +Content-Length: 433%CR +Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce%CR +%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------7c633d5c27ce-- -POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1 -Host: remotehost:54321 -Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/%TESTNUMBER", response="b479994d13e60f3aa192a67c5892ddc5" -User-Agent: curl/%VERSION -Accept: */* -Proxy-Connection: Keep-Alive -Expect: 100-continue -Content-Length: 433 -Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce - -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="name" - -daniel -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="tool" - -curl -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +%CR +------------------------------7c633d5c27ce--%CR +POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1%CR +Host: remotehost:54321%CR +Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/%TESTNUMBER", response="b479994d13e60f3aa192a67c5892ddc5"%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Expect: 100-continue%CR +Content-Length: 433%CR +Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce%CR +%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------7c633d5c27ce-- +%CR +------------------------------7c633d5c27ce--%CR diff --git a/tests/data/test265 b/tests/data/test265 index fd17359b1ce1..3068c05f87cf 100644 --- a/tests/data/test265 +++ b/tests/data/test265 @@ -47,22 +47,22 @@ daniel # then this is returned when we get proxy-auth -HTTP/1.1 200 OK swsbounce +HTTP/1.1 200 OK swsbounce%CR Server: no - +%CR Nice proxy auth sir! -HTTP/1.0 407 Authorization Required to proxy me my dear -Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== -Connection: Keep-Alive -Content-Length: 1033 - -HTTP/1.1 200 Things are fine in proxy land -Server: Microsoft-IIS/5.0 -Content-Type: text/html; charset=iso-8859-1 - +HTTP/1.0 407 Authorization Required to proxy me my dear%CR +Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==%CR +Connection: Keep-Alive%CR +Content-Length: 1033%CR +%CR +HTTP/1.1 200 Things are fine in proxy land%CR +Server: Microsoft-IIS/5.0%CR +Content-Type: text/html; charset=iso-8859-1%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 7 diff --git a/tests/data/test266 b/tests/data/test266 index ca5705955ce0..5190abe00470 100644 --- a/tests/data/test266 +++ b/tests/data/test266 @@ -11,32 +11,32 @@ DELAY # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data - +%CR +0%CR +chunky-trailer: header data%CR +%CR -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +%CR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc -chunky-trailer: header data +chunky-trailer: header data%CR writedelay: 10 diff --git a/tests/data/test275 b/tests/data/test275 index 124510d3b3d3..deec548ae855 100644 --- a/tests/data/test275 +++ b/tests/data/test275 @@ -30,9 +30,9 @@ Content-Length: 9 contents -HTTP/1.1 200 OK -Connected-fine: sure - +HTTP/1.1 200 OK%CR +Connected-fine: sure%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test3015 b/tests/data/test3015 index 7391d9164305..cf535a29a28c 100644 --- a/tests/data/test3015 +++ b/tests/data/test3015 @@ -23,19 +23,19 @@ Location: ./%TESTNUMBER0001 monster -HTTP/1.1 200 OK -Date: Sun, 13 Sep 2020 15:00 GMT -Transfer-Encoding: chunked -Connection: close -Content-Type: text/plain; charset=us-ascii - -0007 -bigger -0008 +HTTP/1.1 200 OK%CR +Date: Sun, 13 Sep 2020 15:00 GMT%CR +Transfer-Encoding: chunked%CR +Connection: close%CR +Content-Type: text/plain; charset=us-ascii%CR +%CR +0007%CR +bigger %CR +0008%CR monster - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test304 b/tests/data/test304 index b7f7588c25c9..06feb3a382b0 100644 --- a/tests/data/test304 +++ b/tests/data/test304 @@ -45,28 +45,28 @@ HTTPS multipart formpost ^(Content-Type: multipart/form-data;|------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPSPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1410 -Content-Type: multipart/form-data; boundary=----------------------------qrstuvwxyz0123456789AB - -------------------------------qrstuvwxyz0123456789AB -Content-Disposition: form-data; name="name" - -daniel -------------------------------qrstuvwxyz0123456789AB -Content-Disposition: form-data; name="tool" - -curl -------------------------------qrstuvwxyz0123456789AB -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPSPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 1410%CR +Content-Type: multipart/form-data; boundary=----------------------------qrstuvwxyz0123456789AB%CR +%CR +------------------------------qrstuvwxyz0123456789AB%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------qrstuvwxyz0123456789AB%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------qrstuvwxyz0123456789AB%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR %repeat[1000 x a]% - -------------------------------qrstuvwxyz0123456789AB-- +%CR +------------------------------qrstuvwxyz0123456789AB--%CR diff --git a/tests/data/test31 b/tests/data/test31 index e4d5e4cad773..8d99df6da8af 100644 --- a/tests/data/test31 +++ b/tests/data/test31 @@ -12,64 +12,64 @@ cookiejar -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Content-Length: 4 -Content-Type: text/html -Funny-head: yesyes +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Content-Length: 4%CR +Content-Type: text/html%CR +Funny-head: yesyes%CR Set-Cookie: blankdomain=sure; domain=; path=/ -Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure -Set-Cookie:ismatch=this ; domain=test31.curl; path=/silly/ -Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/ -Set-Cookie: overwrite=this ; domain=test31.curl; path=/overwrite/ -Set-Cookie: overwrite=this2 ; domain=test31.curl; path=/overwrite -Set-Cookie: sec1value=secure1 ; domain=test31.curl; path=/secure1/ ; secure -Set-Cookie: sec2value=secure2 ; domain=test31.curl; path=/secure2/ ; secure= -Set-Cookie: sec3value=secure3 ; domain=test31.curl; path=/secure3/ ; secure= -Set-Cookie: sec4value=secure4 ; secure=; domain=test31.curl; path=/secure4/ ; -Set-Cookie: sec5value=secure5 ; secure; domain=test31.curl; path=/secure5/ ; -Set-Cookie: sec6value=secure6 ; secure ; domain=test31.curl; path=/secure6/ ; -Set-Cookie: sec7value=secure7 ; secure ; domain=test31.curl; path=/secure7/ ; -Set-Cookie: sec8value=secure8 ; secure= ; domain=test31.curl; path=/secure8/ ; -Set-Cookie: secure=very1 ; secure=; domain=test31.curl; path=/secure9/; -Set-Cookie: httpo1=value1 ; domain=test31.curl; path=/p1/; httponly -Set-Cookie: httpo2=value2 ; domain=test31.curl; path=/p2/; httponly= -Set-Cookie: httpo3=value3 ; httponly; domain=test31.curl; path=/p3/; -Set-Cookie: httpo4=value4 ; httponly=; domain=test31.curl; path=/p4/; -Set-Cookie: httponly=myvalue1 ; domain=test31.curl; path=/p4/; httponly -Set-Cookie: httpandsec=myvalue2 ; domain=test31.curl; path=/p4/; httponly; secure -Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure -Set-Cookie: httpandsec3=myvalue4 ; domain=test31.curl; path=/p4/; httponly; secure= -Set-Cookie: httpandsec4=myvalue5 ; domain=test31.curl; path=/p4/; httponly=; secure= -Set-Cookie: httpandsec5=myvalue6 ; domain=test31.curl; path=/p4/; secure; httponly= -Set-Cookie: httpandsec6=myvalue7 ; domain=test31.curl; path=/p4/; secure=; httponly= -Set-Cookie: httpandsec7=myvalue8 ; domain=test31.curl; path=/p4/; secure; httponly -Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly -Set-Cookie: partmatch=present; domain=test31.curl ; path=/; -Set-Cookie:eat=this; domain=moo.foo.moo; -Set-Cookie: eat=this-too; domain=.foo.moo; -Set-Cookie: nodomainnovalue +Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure%CR +Set-Cookie:ismatch=this ; domain=test31.curl; path=/silly/%CR +Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/%CR +Set-Cookie: overwrite=this ; domain=test31.curl; path=/overwrite/%CR +Set-Cookie: overwrite=this2 ; domain=test31.curl; path=/overwrite%CR +Set-Cookie: sec1value=secure1 ; domain=test31.curl; path=/secure1/ ; secure%CR +Set-Cookie: sec2value=secure2 ; domain=test31.curl; path=/secure2/ ; secure=%CR +Set-Cookie: sec3value=secure3 ; domain=test31.curl; path=/secure3/ ; secure=%CR +Set-Cookie: sec4value=secure4 ; secure=; domain=test31.curl; path=/secure4/ ; %CR +Set-Cookie: sec5value=secure5 ; secure; domain=test31.curl; path=/secure5/ ; %CR +Set-Cookie: sec6value=secure6 ; secure ; domain=test31.curl; path=/secure6/ ; %CR +Set-Cookie: sec7value=secure7 ; secure ; domain=test31.curl; path=/secure7/ ; %CR +Set-Cookie: sec8value=secure8 ; secure= ; domain=test31.curl; path=/secure8/ ; %CR +Set-Cookie: secure=very1 ; secure=; domain=test31.curl; path=/secure9/; %CR +Set-Cookie: httpo1=value1 ; domain=test31.curl; path=/p1/; httponly%CR +Set-Cookie: httpo2=value2 ; domain=test31.curl; path=/p2/; httponly=%CR +Set-Cookie: httpo3=value3 ; httponly; domain=test31.curl; path=/p3/;%CR +Set-Cookie: httpo4=value4 ; httponly=; domain=test31.curl; path=/p4/; %CR +Set-Cookie: httponly=myvalue1 ; domain=test31.curl; path=/p4/; httponly%CR +Set-Cookie: httpandsec=myvalue2 ; domain=test31.curl; path=/p4/; httponly; secure%CR +Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure%CR +Set-Cookie: httpandsec3=myvalue4 ; domain=test31.curl; path=/p4/; httponly; secure=%CR +Set-Cookie: httpandsec4=myvalue5 ; domain=test31.curl; path=/p4/; httponly=; secure=%CR +Set-Cookie: httpandsec5=myvalue6 ; domain=test31.curl; path=/p4/; secure; httponly=%CR +Set-Cookie: httpandsec6=myvalue7 ; domain=test31.curl; path=/p4/; secure=; httponly=%CR +Set-Cookie: httpandsec7=myvalue8 ; domain=test31.curl; path=/p4/; secure; httponly%CR +Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly%CR +Set-Cookie: partmatch=present; domain=test31.curl ; path=/;%CR +Set-Cookie:eat=this; domain=moo.foo.moo;%CR +Set-Cookie: eat=this-too; domain=.foo.moo;%CR +Set-Cookie: nodomainnovalue%CR %if large-time -Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525 -Set-Cookie: novalue; domain=reallysilly -Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525 -Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525 +Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525%CR +Set-Cookie: novalue; domain=reallysilly%CR +Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525%CR +Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525%CR %else -Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037 -Set-Cookie: novalue; domain=reallysilly -Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030 -Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030 +Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037%CR +Set-Cookie: novalue; domain=reallysilly%CR +Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030%CR +Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030%CR %endif -Set-Cookie: magic=yessir; path=/silly/; HttpOnly -Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad; -Set-Cookie: partialip=nono; domain=.0.0.1; -Set-Cookie: withspaces= yes within and around ; -Set-Cookie: withspaces2 =before equals; -Set-Cookie: prespace= yes before; -Set-Cookie: securewithspace=after ; secure = +Set-Cookie: magic=yessir; path=/silly/; HttpOnly%CR +Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;%CR +Set-Cookie: partialip=nono; domain=.0.0.1;%CR +Set-Cookie: withspaces= yes within and around ;%CR +Set-Cookie: withspaces2 =before equals;%CR +Set-Cookie: prespace= yes before;%CR +Set-Cookie: securewithspace=after ; secure =%CR Set-Cookie: %hex[%c3%82%c2%b3%c3%83%5c%78%39%32%c3%83%5c%78%39%61%c3%83%5c%78%38%64%c3%83%5c%78%39%37]hex%=%96%A6g%9Ay%B0%A5g%A7tm%7C%95%9A - +%CR boo diff --git a/tests/data/test314 b/tests/data/test314 index 61ea85095c01..4f14957a432d 100644 --- a/tests/data/test314 +++ b/tests/data/test314 @@ -27,14 +27,14 @@ Content-Length: 1056 -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: br -Content-Length: 1056 - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Content-Encoding: br%CR +Content-Length: 1056%CR +%CR @@ -45,15 +45,15 @@ Content-Length: 1056 curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test320 b/tests/data/test320 index 93c1d1fd14a3..00615e5d71e3 100644 --- a/tests/data/test320 +++ b/tests/data/test320 @@ -10,9 +10,9 @@ TLS-SRP # Server-side -HTTP/1.0 200 OK -Content-type: text/html - +HTTP/1.0 200 OK%CR +Content-type: text/html%CR +%CR

This is GnuTLS

@@ -28,10 +28,10 @@ Content-type: text/html CipherAES-NNN-CBC MACSHA1 CiphersuiteSRP_SHA_AES_NNN_CBC_SHA1

-

Your HTTP header was:

Host: localhost:9011
-User-Agent: curl-test-suite
-Accept: */*
-
+

Your HTTP header was:

Host: localhost:9011%CR
+User-Agent: curl-test-suite%CR
+Accept: */*%CR
+%CR
 

diff --git a/tests/data/test3206 b/tests/data/test3206 index 1acc2c729d81..676b85592b21 100644 --- a/tests/data/test3206 +++ b/tests/data/test3206 @@ -15,7 +15,7 @@ CUSTOMREQUEST %repeat[120 x Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX%0d]% -* 456 FETCH (BODY[TEXT] {7201} +* 456 FETCH (BODY[TEXT] {7201}%CR %repeat[120 x Testing large IMAP literal with custom FETCH. XXXXXXXXXXXXX%0d]% diff --git a/tests/data/test326 b/tests/data/test326 index d8c912a99b0f..4c3ed3e08524 100644 --- a/tests/data/test326 +++ b/tests/data/test326 @@ -9,29 +9,29 @@ HTTP GET # Server-side -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Content-Type: text/html; charset=ISO-8859-1 -Transfer-Encoding: chunked - -18 +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Transfer-Encoding: chunked%CR +%CR +18%CR line 1 line 2 line 3 - -0 - +%CR +0%CR +%CR -18 +18%CR line 1 line 2 line 3 - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test339 b/tests/data/test339 index e915548351f7..ce191e09cf13 100644 --- a/tests/data/test339 +++ b/tests/data/test339 @@ -9,23 +9,23 @@ HTTP GET # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo -ETag: W/"asdf" - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +ETag: W/"asdf"%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data - +%CR +0%CR +chunky-trailer: header data%CR +%CR diff --git a/tests/data/test34 b/tests/data/test34 index 175e537034b3..2af255cfee8d 100644 --- a/tests/data/test34 +++ b/tests/data/test34 @@ -15,15 +15,15 @@ Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked Connection: mooo -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 - +%CR +0%CR +%CR HTTP/1.1 200 funky chunky! diff --git a/tests/data/test341 b/tests/data/test341 index 54f0da74a573..5b715c74a7b2 100644 --- a/tests/data/test341 +++ b/tests/data/test341 @@ -9,13 +9,13 @@ HTTP GET # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo -ETag: "asdf" - +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +ETag: "asdf"%CR +%CR 40 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 30 diff --git a/tests/data/test347 b/tests/data/test347 index 29790730b009..4940f0cc17d8 100644 --- a/tests/data/test347 +++ b/tests/data/test347 @@ -9,23 +9,23 @@ HTTP GET # Server-side -HTTP/1.1 200 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo -ETag: - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +HTTP/1.1 200 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +ETag: %CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data - +%CR +0%CR +chunky-trailer: header data%CR +%CR diff --git a/tests/data/test36 b/tests/data/test36 index ad819cc0ba68..5ca66c8d4683 100644 --- a/tests/data/test36 +++ b/tests/data/test36 @@ -16,11 +16,11 @@ Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked Connection: mooo -2 +2%CR a - -ILLEGAL -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +%CR +ILLEGAL%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR HTTP/1.1 200 funky chunky! diff --git a/tests/data/test363 b/tests/data/test363 index 57bb6d40f585..82d86f2de250 100644 --- a/tests/data/test363 +++ b/tests/data/test363 @@ -26,8 +26,8 @@ HTTP/1.1 200 Mighty fine indeed -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test365 b/tests/data/test365 index 39143aa199e9..0add463decc2 100644 --- a/tests/data/test365 +++ b/tests/data/test365 @@ -19,10 +19,10 @@ Transfer-Encoding: chunked Content-Type: text/html Funny-head: yesyes -10 -chunked data fun -0 - +10%CR +chunked data fun%CR +0%CR +%CR HTTP/1.1 200 OK diff --git a/tests/data/test373 b/tests/data/test373 index 4b282d0f0ba0..10f8404e0f33 100644 --- a/tests/data/test373 +++ b/tests/data/test373 @@ -9,27 +9,27 @@ chunked Transfer-Encoding -HTTP/1.1 200 OK -Date: Thu, 22 Jul 2010 11:22:33 GMT -Connection: close -Content-Type: text/html -Transfer-Encoding: chunked -X-Control: swsclose - -100 +HTTP/1.1 200 OK%CR +Date: Thu, 22 Jul 2010 11:22:33 GMT%CR +Connection: close%CR +Content-Type: text/html%CR +Transfer-Encoding: chunked%CR +X-Control: swsclose%CR +%CR +100%CR %repeat[255 x %00]% - -100 +%CR +100%CR %repeat[255 x %00]% - -100 +%CR +100%CR %repeat[255 x %00]% - -100 +%CR +100%CR %repeat[255 x %00]% - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test39 b/tests/data/test39 index d01fd3c95fa4..1ca61c80874c 100644 --- a/tests/data/test39 +++ b/tests/data/test39 @@ -46,66 +46,66 @@ foo ^(Content-Type: multipart/form-data;|-------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 1234 -Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 - -------------------------------24e78000bd32 -Content-Disposition: form-data; name="name" - -daniel -------------------------------24e78000bd32 -Content-Disposition: form-data; name="tool" - -curl -------------------------------24e78000bd32 -Content-Disposition: form-data; name="str1" - -@literal -------------------------------24e78000bd32 -Content-Disposition: form-data; name="str2" - - diff --git a/tests/data/test396 b/tests/data/test396 index 77bffc3c2001..5dd3faed1352 100644 --- a/tests/data/test396 +++ b/tests/data/test396 @@ -24,14 +24,14 @@ Content-Length: 1309 -HTTP/1.1 200 OK -Date: Mon, 29 Nov 2004 21:56:53 GMT -Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29 -Vary: Accept-Encoding -Content-Type: text/html; charset=ISO-8859-1 -Content-Encoding: zstd -Content-Length: 1309 - +HTTP/1.1 200 OK%CR +Date: Mon, 29 Nov 2004 21:56:53 GMT%CR +Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29%CR +Vary: Accept-Encoding%CR +Content-Type: text/html; charset=ISO-8859-1%CR +Content-Encoding: zstd%CR +Content-Length: 1309%CR +%CR @@ -42,15 +42,15 @@ Content-Length: 1309 curl curl and libcurl Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files -using URL syntax. It supports HTTP, HTTPS, FTP, -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as -well as HTTP-post, HTTP-put, cookies, FTP upload, -resumed transfers, passwords, portnumbers, SSL -certificates, Kerberos, and proxies. It is powered -by libcurl, the client-side URL transfer library. -There are bindings to libcurl for over 20 -languages and environments. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR 5784.57 3.16 diff --git a/tests/data/test415 b/tests/data/test415 index c0e8a92d08c6..93172299f9e7 100644 --- a/tests/data/test415 +++ b/tests/data/test415 @@ -12,7 +12,7 @@ HTTP GET HTTP/1.1 200 OK swsclose Date: Tue, 09 Nov 2010 14:49:00 GMT -Content-Length: -6 +Content-Length: %CR-6 Content-Type: text/html Funny-head: yesyes diff --git a/tests/data/test433 b/tests/data/test433 index 4d91fdce6b2f..c6c77d90bb97 100644 --- a/tests/data/test433 +++ b/tests/data/test433 @@ -9,10 +9,10 @@ # Server-side -HTTP/1.1 200 OK -Content-Length: 6 -Content-Type: text/1 - +HTTP/1.1 200 OK%CR +Content-Length: 6%CR +Content-Type: text/1%CR +%CR -foo- diff --git a/tests/data/test44 b/tests/data/test44 index bc103e031b34..02823b93ee97 100644 --- a/tests/data/test44 +++ b/tests/data/test44 @@ -46,30 +46,30 @@ bar ^(Content-Type: multipart/form-data;|------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 432 -Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce - -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="name" - -daniel -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="tool" - -curl -------------------------------7c633d5c27ce -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 432%CR +Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce%CR +%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------7c633d5c27ce%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------7c633d5c27ce-- +%CR +------------------------------7c633d5c27ce--%CR diff --git a/tests/data/test457 b/tests/data/test457 index d9f945ebda3b..39b050464cd6 100644 --- a/tests/data/test457 +++ b/tests/data/test457 @@ -15,16 +15,16 @@ Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked Connection: mooo -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccc c - -0 - +%CR +0%CR +%CR HTTP/1.1 200 funky chunky! diff --git a/tests/data/test473 b/tests/data/test473 index c4caa11a626c..315f50006aa9 100644 --- a/tests/data/test473 +++ b/tests/data/test473 @@ -9,24 +9,24 @@ HTTP GET # Server-side -HTTP/1.1 301 funky chunky! -Server: fakeit/0.9 fakeitbad/1.0 +HTTP/1.1 301 funky chunky!%CR +Server: fakeit/0.9 fakeitbad/1.0%CR Location: /redirected -Transfer-Encoding: chunked -Trailer: chunky-trailer -Connection: mooo -ETag: W/"asdf" - -40 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -30 -bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -21;heresatest=moooo +Transfer-Encoding: chunked%CR +Trailer: chunky-trailer%CR +Connection: mooo%CR +ETag: W/"asdf"%CR +%CR +40%CR +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%CR +30%CR +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%CR +21;heresatest=moooo%CR cccccccccccccccccccccccccccccccc - -0 -chunky-trailer: header data - +%CR +0%CR +chunky-trailer: header data%CR +%CR diff --git a/tests/data/test503 b/tests/data/test503 index ba071c24ff6c..dc008ebd8113 100644 --- a/tests/data/test503 +++ b/tests/data/test503 @@ -29,8 +29,8 @@ ETag: "21025-dc7-39462498" -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK swsclose Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake diff --git a/tests/data/test552 b/tests/data/test552 index 2d36d56ab18d..32b877bf82e1 100644 --- a/tests/data/test552 +++ b/tests/data/test552 @@ -70,21 +70,21 @@ http://test.remote.example.com/path/%TESTNUMBER http://s1lly:pers0n@%HOSTIP:%HTT # Verify data after the test has been "shot" -POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 70000 -Content-Type: application/x-www-form-urlencoded - -%repeat[7000 x test data%00]%POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1 -Host: test.remote.example.com -Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="%repeat[400 x A]%", uri="/path/%TESTNUMBER", response="be7aedc47d821b6d847c445ded782c43" -Accept: */* -Proxy-Connection: Keep-Alive -Content-Length: 70000 -Content-Type: application/x-www-form-urlencoded - +POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1%CR +Host: test.remote.example.com%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Content-Length: 70000%CR +Content-Type: application/x-www-form-urlencoded%CR +%CR +%repeat[7000 x test data%00]%POST http://test.remote.example.com/path/%TESTNUMBER HTTP/1.1%CR +Host: test.remote.example.com%CR +Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="%repeat[400 x A]%", uri="/path/%TESTNUMBER", response="be7aedc47d821b6d847c445ded782c43"%CR +Accept: */*%CR +Proxy-Connection: Keep-Alive%CR +Content-Length: 70000%CR +Content-Type: application/x-www-form-urlencoded%CR +%CR %repeat[7000 x test data%00]% diff --git a/tests/data/test554 b/tests/data/test554 index cf37ebe76d2d..9336930f920e 100644 --- a/tests/data/test554 +++ b/tests/data/test554 @@ -69,68 +69,68 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 780 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="sendfile"; filename="postit2.c" - +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 780%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="sendfile"; filename="postit2.c"%CR +%CR this is what we post to the silly web server - ------------------------------- -Content-Disposition: form-data; name="callbackdata" - +%CR +------------------------------%CR +Content-Disposition: form-data; name="callbackdata"%CR +%CR this is what we post to the silly web server - ------------------------------- -Content-Disposition: form-data; name="filename" - -postit2.c ------------------------------- -Content-Disposition: form-data; name="submit" -Content-Type: text/plain - -send ------------------------------- -Content-Disposition: form-data; name="somename"; filename="somefile.txt" -Content-Type: text/plain - -blah blah --------------------------------- -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 794 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2" - +%CR +------------------------------%CR +Content-Disposition: form-data; name="filename"%CR +%CR +postit2.c%CR +------------------------------%CR +Content-Disposition: form-data; name="submit"%CR +Content-Type: text/plain%CR +%CR +send%CR +------------------------------%CR +Content-Disposition: form-data; name="somename"; filename="somefile.txt"%CR +Content-Type: text/plain%CR +%CR +blah blah%CR +--------------------------------%CR +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 794%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"%CR +%CR this is what we post to the silly web server - ------------------------------- -Content-Disposition: form-data; name="callbackdata" - +%CR +------------------------------%CR +Content-Disposition: form-data; name="callbackdata"%CR +%CR this is what we post to the silly web server - ------------------------------- -Content-Disposition: form-data; name="filename" - -postit2.c ------------------------------- -Content-Disposition: form-data; name="submit" -Content-Type: text/plain - -send ------------------------------- -Content-Disposition: form-data; name="somename"; filename="somefile.txt" -Content-Type: text/plain - -blah blah --------------------------------- +%CR +------------------------------%CR +Content-Disposition: form-data; name="filename"%CR +%CR +postit2.c%CR +------------------------------%CR +Content-Disposition: form-data; name="submit"%CR +Content-Type: text/plain%CR +%CR +send%CR +------------------------------%CR +Content-Disposition: form-data; name="somename"; filename="somefile.txt"%CR +Content-Type: text/plain%CR +%CR +blah blah%CR +--------------------------------%CR diff --git a/tests/data/test568 b/tests/data/test568 index e4161762570d..caadd95d1279 100644 --- a/tests/data/test568 +++ b/tests/data/test568 @@ -18,12 +18,12 @@ Cseq: 1 -RTSP/1.0 200 OK -Server: RTSPD/libcurl-test -Cseq: 2 -Content-Length: 70 -Content-Type: application/sdp - +RTSP/1.0 200 OK%CR +Server: RTSPD/libcurl-test%CR +Cseq: 2%CR +Content-Length: 70%CR +Content-Type: application/sdp%CR +%CR v=0 s=rtspd SDP i=A fake SDP reply diff --git a/tests/data/test585 b/tests/data/test585 index 5a50587b9492..dd455a5b6f0b 100644 --- a/tests/data/test585 +++ b/tests/data/test585 @@ -22,13 +22,13 @@ Connection: close [OPEN] counter: 1 -HTTP/1.1 302 eat this! -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Location: this-is-the-first.html -Content-Length: 0 -Connection: close - +HTTP/1.1 302 eat this!%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Location: this-is-the-first.html%CR +Content-Length: 0%CR +Connection: close%CR +%CR [CLOSE] counter: 1 diff --git a/tests/data/test599 b/tests/data/test599 index f06773a60679..4df0cf13a034 100644 --- a/tests/data/test599 +++ b/tests/data/test599 @@ -21,18 +21,18 @@ Content-Type: text/html -foo- -HTTP/1.1 200 OK -Date: Tue, 09 Nov 2010 14:49:00 GMT -Server: test-server/fake -Transfer-Encoding: chunked -Connection: close -Content-Type: text/html - -32 +HTTP/1.1 200 OK%CR +Date: Tue, 09 Nov 2010 14:49:00 GMT%CR +Server: test-server/fake%CR +Transfer-Encoding: chunked%CR +Connection: close%CR +Content-Type: text/html%CR +%CR +32%CR this data is slightly larger than the first piece - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test60 b/tests/data/test60 index 4d9b8b541bb5..0544b2c6dfce 100644 --- a/tests/data/test60 +++ b/tests/data/test60 @@ -38,19 +38,19 @@ more than one byte # Verify data after the test has been "shot" -PUT /bzz/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Transfer-Encoding: chunked -Content-Length: 1 -Expect: 100-continue - -13 +PUT /bzz/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Length: 1%CR +Expect: 100-continue%CR +%CR +13%CR more than one byte - -0 - +%CR +0%CR +%CR diff --git a/tests/data/test643 b/tests/data/test643 index fc4e639a012d..14bbd4aa3927 100644 --- a/tests/data/test643 +++ b/tests/data/test643 @@ -69,66 +69,66 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 676 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="sendfile"; filename="postit2.c" - +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 676%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="sendfile"; filename="postit2.c"%CR +%CR dummy - ------------------------------- -Content-Disposition: form-data; name="callbackdata" - +%CR +------------------------------%CR +Content-Disposition: form-data; name="callbackdata"%CR +%CR dummy - ------------------------------- -Content-Disposition: form-data; name="filename" - -postit2.c ------------------------------- -Content-Disposition: form-data; name="submit" - -send ------------------------------- -Content-Disposition: form-data; name="somename"; filename="somefile.txt" -Content-Type: text/plain - -blah blah --------------------------------- -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 690 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2" - +%CR +------------------------------%CR +Content-Disposition: form-data; name="filename"%CR +%CR +postit2.c%CR +------------------------------%CR +Content-Disposition: form-data; name="submit"%CR +%CR +send%CR +------------------------------%CR +Content-Disposition: form-data; name="somename"; filename="somefile.txt"%CR +Content-Type: text/plain%CR +%CR +blah blah%CR +--------------------------------%CR +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 690%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"%CR +%CR dummy - ------------------------------- -Content-Disposition: form-data; name="callbackdata" - +%CR +------------------------------%CR +Content-Disposition: form-data; name="callbackdata"%CR +%CR dummy - ------------------------------- -Content-Disposition: form-data; name="filename" - -postit2.c ------------------------------- -Content-Disposition: form-data; name="submit" - -send ------------------------------- -Content-Disposition: form-data; name="somename"; filename="somefile.txt" -Content-Type: text/plain - -blah blah --------------------------------- +%CR +------------------------------%CR +Content-Disposition: form-data; name="filename"%CR +%CR +postit2.c%CR +------------------------------%CR +Content-Disposition: form-data; name="submit"%CR +%CR +send%CR +------------------------------%CR +Content-Disposition: form-data; name="somename"; filename="somefile.txt"%CR +Content-Type: text/plain%CR +%CR +blah blah%CR +--------------------------------%CR diff --git a/tests/data/test645 b/tests/data/test645 index 4d8857780a67..6370a5a478a2 100644 --- a/tests/data/test645 +++ b/tests/data/test645 @@ -69,128 +69,128 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -7c ------------------------------- -Content-Disposition: form-data; name="sendfile"; filename="postit2.c" - -d -1 -u -1 -m -1 -m -1 -y -1 +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +Expect: 100-continue%CR +%CR +7c%CR +------------------------------%CR +Content-Disposition: form-data; name="sendfile"; filename="postit2.c"%CR +%CR +d%CR +1%CR +u%CR +1%CR +m%CR +1%CR +m%CR +1%CR +y%CR +1%CR - -6b - ------------------------------- -Content-Disposition: form-data; name="callbackdata" - - -1 -d -1 -u -1 -m -1 -m -1 -y -1 +%CR +6b%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="callbackdata"%CR +%CR +%CR +1%CR +d%CR +1%CR +u%CR +1%CR +m%CR +1%CR +m%CR +1%CR +y%CR +1%CR - -1b2 - ------------------------------- -Content-Disposition: form-data; name="filename" - -postit2.c ------------------------------- -Content-Disposition: form-data; name="submit" - -send ------------------------------- -Content-Disposition: form-data; name="somename"; filename="somefile.txt" -Content-Type: text/plain - -blah blah --------------------------------- - -0 - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -8a ------------------------------- -Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2" - -d -1 -u -1 -m -1 -m -1 -y -1 +%CR +1b2%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="filename"%CR +%CR +postit2.c%CR +------------------------------%CR +Content-Disposition: form-data; name="submit"%CR +%CR +send%CR +------------------------------%CR +Content-Disposition: form-data; name="somename"; filename="somefile.txt"%CR +Content-Type: text/plain%CR +%CR +blah blah%CR +--------------------------------%CR +%CR +0%CR +%CR +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +Expect: 100-continue%CR +%CR +8a%CR +------------------------------%CR +Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"%CR +%CR +d%CR +1%CR +u%CR +1%CR +m%CR +1%CR +m%CR +1%CR +y%CR +1%CR - -6b - ------------------------------- -Content-Disposition: form-data; name="callbackdata" - - -1 -d -1 -u -1 -m -1 -m -1 -y -1 +%CR +6b%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="callbackdata"%CR +%CR +%CR +1%CR +d%CR +1%CR +u%CR +1%CR +m%CR +1%CR +m%CR +1%CR +y%CR +1%CR - -1b2 - ------------------------------- -Content-Disposition: form-data; name="filename" - -postit2.c ------------------------------- -Content-Disposition: form-data; name="submit" - -send ------------------------------- -Content-Disposition: form-data; name="somename"; filename="somefile.txt" -Content-Type: text/plain - -blah blah --------------------------------- - -0 - +%CR +1b2%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="filename"%CR +%CR +postit2.c%CR +------------------------------%CR +Content-Disposition: form-data; name="submit"%CR +%CR +send%CR +------------------------------%CR +Content-Disposition: form-data; name="somename"; filename="somefile.txt"%CR +Content-Type: text/plain%CR +%CR +blah blah%CR +--------------------------------%CR +%CR +0%CR +%CR diff --git a/tests/data/test646 b/tests/data/test646 index a8d8ff2b6f2f..2bca8337c65c 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -39,7 +39,7 @@ It may contain any type of data. # This line is a comment -X-fileheader1: This is a header from a file%SP +X-fileheader1: This is a header from a file%SP%CR # This line is another comment. It precedes a folded header. X-fileheader2: This is #a @@ -62,40 +62,40 @@ DATA QUIT -Content-Type: multipart/mixed; boundary=---------------------------- -Mime-Version: 1.0 -From: different -To: another -Reply-To: - ------------------------------- -Content-Type: multipart/alternative; boundary=---------------------------- - ------------------------------- -Content-Type: text/html -Content-Transfer-Encoding: 8bit -X-test1: this is a header -X-test2: this is another header - -This is the html version ------------------------------- -X-fileheader1: This is a header from a file -X-fileheader2: This is #a folded header - -This is the plain text version --------------------------------- - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -X-fileheader1: This is a header from a file -X-fileheader2: This is #a folded header - +Content-Type: multipart/mixed; boundary=----------------------------%CR +Mime-Version: 1.0%CR +From: different%CR +To: another%CR +Reply-To: %CR +%CR +------------------------------%CR +Content-Type: multipart/alternative; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Type: text/html%CR +Content-Transfer-Encoding: 8bit%CR +X-test1: this is a header%CR +X-test2: this is another header%CR +%CR +This is the html version%CR +------------------------------%CR +X-fileheader1: This is a header from a file%CR +X-fileheader2: This is #a folded header%CR +%CR +This is the plain text version%CR +--------------------------------%CR +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +X-fileheader1: This is a header from a file%CR +X-fileheader2: This is #a folded header%CR +%CR This is an attached file. It may contain any type of data. - --------------------------------- -. +%CR +--------------------------------%CR +.%CR diff --git a/tests/data/test647 b/tests/data/test647 index 0e3d242cd746..732472db9c24 100644 --- a/tests/data/test647 +++ b/tests/data/test647 @@ -49,35 +49,35 @@ A003 APPEND %TESTNUMBER (\Seen) {940} A004 LOGOUT -Content-Type: multipart/mixed; boundary=---------------------------- -Mime-Version: 1.0 -Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar -To: joe@example.com -Message-Id: -Subject: afternoon meeting - ------------------------------- -Content-Type: multipart/alternative; boundary=---------------------------- - ------------------------------- -Content-Type: text/html -Content-Transfer-Encoding: 8bit - -This is the html version ------------------------------- - -This is the plain text version --------------------------------- - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" - +Content-Type: multipart/mixed; boundary=----------------------------%CR +Mime-Version: 1.0%CR +Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)%CR +From: Fred Foobar %CR +To: joe@example.com%CR +Message-Id: %CR +Subject: afternoon meeting%CR +%CR +------------------------------%CR +Content-Type: multipart/alternative; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Type: text/html%CR +Content-Transfer-Encoding: 8bit%CR +%CR +This is the html version%CR +------------------------------%CR +%CR +This is the plain text version%CR +--------------------------------%CR +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.txt"%CR +%CR This is an attached file. It may contain any type of data. - --------------------------------- +%CR +--------------------------------%CR diff --git a/tests/data/test650 b/tests/data/test650 index e1ac811dde20..3864303b34b5 100644 --- a/tests/data/test650 +++ b/tests/data/test650 @@ -70,150 +70,150 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -385 ------------------------------- -Content-Disposition: form-data; name="fieldname" -Content-Type: text/plain -X-customheader-1: Header 1 data -X-customheader-2: Header 2 data - -this is what we post to the silly web server ------------------------------- -Content-Disposition: form-data; name="fieldnam" - -uhis is what we post to the silly web serve ------------------------------- -Content-Disposition: form-data; name="multifile" -Content-Type: multipart/mixed; boundary=---------------------------- - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" -Content-Type: application/octet-stream - +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +Expect: 100-continue%CR +%CR +385%CR +------------------------------%CR +Content-Disposition: form-data; name="fieldname"%CR +Content-Type: text/plain%CR +X-customheader-1: Header 1 data%CR +X-customheader-2: Header 2 data%CR +%CR +this is what we post to the silly web server%CR +------------------------------%CR +Content-Disposition: form-data; name="fieldnam"%CR +%CR +uhis is what we post to the silly web serve%CR +------------------------------%CR +Content-Disposition: form-data; name="multifile"%CR +Content-Type: multipart/mixed; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"%CR +Content-Type: application/octet-stream%CR +%CR This is data from a file. - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" -Content-Type: text/whatever - - -ab +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"%CR +Content-Type: text/whatever%CR +%CR +%CR +ab%CR This is data from a file. - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" -Content-Type: text/whatever - - -bb +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"%CR +Content-Type: text/whatever%CR +%CR +%CR +bb%CR This is data from a file. - --------------------------------- - ------------------------------- -Content-Disposition: form-data; name="filecontents" - - -11b +%CR +--------------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="filecontents"%CR +%CR +%CR +11b%CR This is data from a file. - ------------------------------- -Content-Disposition: form-data; name="formlength" - -1433 ------------------------------- -Content-Disposition: form-data; name="standardinput" -Content-Type: application/octet-stream - - -16 +%CR +------------------------------%CR +Content-Disposition: form-data; name="formlength"%CR +%CR +1433%CR +------------------------------%CR +Content-Disposition: form-data; name="standardinput"%CR +Content-Type: application/octet-stream%CR +%CR +%CR +16%CR Some data from stdin - -36 - --------------------------------- - -0 - -POST /%TESTNUMBER0002 HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -385 ------------------------------- -Content-Disposition: form-data; name="fieldname" -Content-Type: text/plain -X-customheader-1: Header 1 data -X-customheader-2: Header 2 data - -this is what we post to the silly web server ------------------------------- -Content-Disposition: form-data; name="fieldnam" - -uhis is what we post to the silly web serve ------------------------------- -Content-Disposition: form-data; name="multifile" -Content-Type: multipart/mixed; boundary=---------------------------- - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" -Content-Type: application/octet-stream - +%CR +36%CR +%CR +--------------------------------%CR +%CR +0%CR +%CR +POST /%TESTNUMBER0002 HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +Expect: 100-continue%CR +%CR +385%CR +------------------------------%CR +Content-Disposition: form-data; name="fieldname"%CR +Content-Type: text/plain%CR +X-customheader-1: Header 1 data%CR +X-customheader-2: Header 2 data%CR +%CR +this is what we post to the silly web server%CR +------------------------------%CR +Content-Disposition: form-data; name="fieldnam"%CR +%CR +uhis is what we post to the silly web serve%CR +------------------------------%CR +Content-Disposition: form-data; name="multifile"%CR +Content-Type: multipart/mixed; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"%CR +Content-Type: application/octet-stream%CR +%CR This is data from a file. - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" -Content-Type: text/whatever - - -ab +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"%CR +Content-Type: text/whatever%CR +%CR +%CR +ab%CR This is data from a file. - ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" -Content-Type: text/whatever - - -bb +%CR +------------------------------%CR +Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"%CR +Content-Type: text/whatever%CR +%CR +%CR +bb%CR This is data from a file. - --------------------------------- - ------------------------------- -Content-Disposition: form-data; name="filecontents" - - -11b +%CR +--------------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="filecontents"%CR +%CR +%CR +11b%CR This is data from a file. - ------------------------------- -Content-Disposition: form-data; name="formlength" - -1433 ------------------------------- -Content-Disposition: form-data; name="standardinput" -Content-Type: application/octet-stream - - -16 +%CR +------------------------------%CR +Content-Disposition: form-data; name="formlength"%CR +%CR +1433%CR +------------------------------%CR +Content-Disposition: form-data; name="standardinput"%CR +Content-Type: application/octet-stream%CR +%CR +%CR +16%CR Some data from stdin - -36 - --------------------------------- - -0 - +%CR +36%CR +%CR +--------------------------------%CR +%CR +0%CR +%CR diff --git a/tests/data/test654 b/tests/data/test654 index 10a914205af5..8bb74d271f3d 100644 --- a/tests/data/test654 +++ b/tests/data/test654 @@ -72,55 +72,55 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 0 - -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -1c1 ------------------------------- -Content-Disposition: form-data; name="greeting" -Content-Type: application/X-Greeting -Content-Transfer-Encoding: base64 -X-Test-Number: %TESTNUMBER - -aGVsbG8= ------------------------------- -Content-Disposition: form-data; filename="file%TESTNUMBER.txt" -Content-Type: text/plain - +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 0%CR +%CR +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +Expect: 100-continue%CR +%CR +1c1%CR +------------------------------%CR +Content-Disposition: form-data; name="greeting"%CR +Content-Type: application/X-Greeting%CR +Content-Transfer-Encoding: base64%CR +X-Test-Number: %TESTNUMBER%CR +%CR +aGVsbG8=%CR +------------------------------%CR +Content-Disposition: form-data; filename="file%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR This is data from a file - ------------------------------- -Content-Disposition: form-data - - -1 -d -1 -u -1 -m -1 -m -1 -y -1 +%CR +------------------------------%CR +Content-Disposition: form-data%CR +%CR +%CR +1%CR +d%CR +1%CR +u%CR +1%CR +m%CR +1%CR +m%CR +1%CR +y%CR +1%CR - -36 - --------------------------------- - -0 - +%CR +36%CR +%CR +--------------------------------%CR +%CR +0%CR +%CR diff --git a/tests/data/test666 b/tests/data/test666 index 6e65768e3dc8..9c95556a5f20 100644 --- a/tests/data/test666 +++ b/tests/data/test666 @@ -58,17 +58,17 @@ s/^--------------------------[A-Za-z0-9]*/------------------------------/ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 17237 -Content-Type: multipart/form-data; boundary=---------------------------- - ------------------------------- -Content-Disposition: form-data; name="upfile"; filename="myfile.txt" -Content-Type: text/plain -Content-Transfer-Encoding: binary - +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 17237%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="upfile"; filename="myfile.txt"%CR +Content-Type: text/plain%CR +Content-Transfer-Encoding: binary%CR +%CR ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX ZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW YZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV @@ -289,8 +289,8 @@ STUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP RSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNO QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN PQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM -OPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV --------------------------------- +OPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV%CR +--------------------------------%CR diff --git a/tests/data/test668 b/tests/data/test668 index 412aa5bd7994..34d649572dbb 100644 --- a/tests/data/test668 +++ b/tests/data/test668 @@ -65,38 +65,38 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- # boundary string and since 5 of them are in the body contents, we see # (5*12) == 60 bytes less -POST /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Transfer-Encoding: chunked -Content-Type: multipart/form-data; boundary=---------------------------- -Expect: 100-continue - -cd ------------------------------- -Content-Disposition: form-data; name="field1" - -dummy ------------------------------- -Content-Disposition: form-data; name="field2" - - -5 -dummy -97 - ------------------------------- -Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt" -Content-Type: text/plain - - -4f +POST /%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Transfer-Encoding: chunked%CR +Content-Type: multipart/form-data; boundary=----------------------------%CR +Expect: 100-continue%CR +%CR +cd%CR +------------------------------%CR +Content-Disposition: form-data; name="field1"%CR +%CR +dummy%CR +------------------------------%CR +Content-Disposition: form-data; name="field2"%CR +%CR +%CR +5%CR +dummy%CR +97%CR +%CR +------------------------------%CR +Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR +%CR +4f%CR This is data from a file - --------------------------------- - -0 - +%CR +--------------------------------%CR +%CR +0%CR +%CR diff --git a/tests/data/test71 b/tests/data/test71 index f47879a3f738..35358fe91681 100644 --- a/tests/data/test71 +++ b/tests/data/test71 @@ -53,29 +53,29 @@ bar ^(Content-Type: multipart/form-data;|------------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Accept: */* -Content-Length: 432 -Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 - -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="name" - -daniel -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="tool" - -curl -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +Accept: */*%CR +Content-Length: 432%CR +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763%CR +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------9ef8d6205763-- +%CR +------------------------------9ef8d6205763--%CR diff --git a/tests/data/test744 b/tests/data/test744 index f725a29c3a70..a1d1a28ceebe 100644 --- a/tests/data/test744 +++ b/tests/data/test744 @@ -25,8 +25,8 @@ HTTP/1.1 200 Mighty fine indeed -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test780 b/tests/data/test780 index 085b2845bd0c..44d0552abfe4 100644 --- a/tests/data/test780 +++ b/tests/data/test780 @@ -63,9 +63,9 @@ test-duphandle -HTTP/1.1 200 OK -Server: fake - +HTTP/1.1 200 OK%CR +Server: fake%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test781 b/tests/data/test781 index 6423fe7e477f..2c06d404655d 100644 --- a/tests/data/test781 +++ b/tests/data/test781 @@ -65,9 +65,9 @@ test-duphandle -HTTP/1.1 200 OK -Server: fake - +HTTP/1.1 200 OK%CR +Server: fake%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test782 b/tests/data/test782 index 8e1b2918c689..4d559a9402f8 100644 --- a/tests/data/test782 +++ b/tests/data/test782 @@ -65,9 +65,9 @@ test-duphandle -HTTP/1.1 200 OK -Server: fake - +HTTP/1.1 200 OK%CR +Server: fake%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test783 b/tests/data/test783 index 62ff5c23dda9..3fb83a0a198f 100644 --- a/tests/data/test783 +++ b/tests/data/test783 @@ -65,9 +65,9 @@ test-duphandle -HTTP/1.1 200 OK -Server: fake - +HTTP/1.1 200 OK%CR +Server: fake%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test80 b/tests/data/test80 index 2e41c87a0d41..684c29da697e 100644 --- a/tests/data/test80 +++ b/tests/data/test80 @@ -29,8 +29,8 @@ HTTP/1.1 200 Mighty fine indeed -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test83 b/tests/data/test83 index 4bf191e9ec47..f6d3e84b08a7 100644 --- a/tests/data/test83 +++ b/tests/data/test83 @@ -26,8 +26,8 @@ HTTP/1.1 200 Mighty fine indeed -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/data/test9 b/tests/data/test9 index 90b146e75a33..9ca6c831d4ad 100644 --- a/tests/data/test9 +++ b/tests/data/test9 @@ -46,30 +46,30 @@ bar ^(Content-Type: multipart/form-data;|------------).* -POST /we/want/%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -User-Agent: curl/%VERSION -Accept: */* -Content-Length: 431 -Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 - -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="name" - -daniel -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="tool" - -curl -------------------------------9ef8d6205763 -Content-Disposition: form-data; name="file"; filename="test9.txt" -Content-Type: text/plain - +POST /we/want/%TESTNUMBER HTTP/1.1%CR +Host: %HOSTIP:%HTTPPORT%CR +User-Agent: curl/%VERSION%CR +Accept: */*%CR +Content-Length: 431%CR +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763%CR +%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="name"%CR +%CR +daniel%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="tool"%CR +%CR +curl%CR +------------------------------9ef8d6205763%CR +Content-Disposition: form-data; name="file"; filename="test9.txt"%CR +Content-Type: text/plain%CR +%CR foo- This is a moo- bar - -------------------------------9ef8d6205763-- +%CR +------------------------------9ef8d6205763--%CR diff --git a/tests/data/test900 b/tests/data/test900 index 14644401b3c5..8eb433b78e37 100644 --- a/tests/data/test900 +++ b/tests/data/test900 @@ -20,10 +20,10 @@ smtp SMTP -From: different -To: another - -body +From: different%CR +To: another%CR +%CR +body%CR %repeat[6553 x 0123456789]% @@ -43,13 +43,13 @@ DATA QUIT -From: different -To: another - -body +From: different%CR +To: another%CR +%CR +body%CR %repeat[6553 x 0123456789]% - -. +%CR +.%CR diff --git a/tests/data/test95 b/tests/data/test95 index d7e2151361fa..87c0728645a0 100644 --- a/tests/data/test95 +++ b/tests/data/test95 @@ -26,8 +26,8 @@ HTTP/1.1 200 Mighty fine indeed -HTTP/1.1 200 Mighty fine indeed - +HTTP/1.1 200 Mighty fine indeed%CR +%CR HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose diff --git a/tests/getpart.pm b/tests/getpart.pm index 3f9ecbb5af73..b555038cf724 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -33,6 +33,7 @@ BEGIN { our @EXPORT = qw( compareparts fulltest + checktest getpart getpartattr loadarray @@ -250,6 +251,18 @@ sub fulltest { return @xml; } +sub checktest { + my $anyerr = 0; + + for my $i (0 .. $#xml) { + if(index($xml[$i], "\r") >= 0) { + print STDERR "*** getpart.pm: $xmlfile:$i: 0x0d carriage return found. Use %CR macro instead.\n"; + $anyerr = 1; + } + } + return $anyerr; +} + # write the test to the given file sub savetest { my ($file)=@_; diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 8635dea55b58..6203b6274943 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -73,6 +73,7 @@ BEGIN { %keywords @protocols $dev_null + $checktests ); } use pathhelp qw( @@ -94,6 +95,7 @@ our $torture; # 1 to enable torture testing our $proxy_address; # external HTTP proxy address our $listonly; # only list the tests our $buildinfo; # dump buildinfo.txt +our $checktests; # 1 to run a check on test data our $run_duphandle; # run curl with --test-duphandle to verify handle duplication our $run_event_based; # run curl with --test-event to test the event API our $automakestyle; # use automake-like test status output format diff --git a/tests/runner.pm b/tests/runner.pm index 328857e5219b..8b9c0c3f2e51 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -1148,6 +1148,15 @@ sub singletest_postcheck { } } } + + if($checktests) { + loadtest("${TESTDIR}/test${testnum}"); # load the raw original data + if(checktest()) { + logmsg " $testnum: postcheck FAILED: issue(s) found in test data\n"; + return -1; + } + } + return 0; } diff --git a/tests/runtests.pl b/tests/runtests.pl index ac74869543e3..761056a8ed6c 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1191,6 +1191,10 @@ sub singletest_shouldrun { } } + if($why && $checktests && checktest()) { + logmsg "Warning: issue(s) found in test data: ${TESTDIR}/test${testnum}\n"; + } + return ($why, $errorreturncode); } @@ -2420,6 +2424,10 @@ sub pickrunner { # execute in scrambled order $scrambleorder=1; } + elsif($ARGV[0] eq "-w") { + # verify test data + $checktests=1; + } elsif($ARGV[0] =~ /^-t(.*)/) { # torture $torture=1; @@ -2563,6 +2571,7 @@ sub pickrunner { -u error instead of warning on server unexpectedly alive -v verbose output -vc path use this curl only to verify the existing servers + -w check test data [num] like "5 6 9" or " 5 to 22 " to run those tests only [!num] like "!5 !6 !9" to disable those tests [~num] like "~5 ~6 ~9" to ignore the result of those tests diff --git a/tests/testutil.pm b/tests/testutil.pm index 30ac782a99a2..126f83e021f2 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -149,6 +149,7 @@ sub subbase64 { $$thing =~ s/%SP/ /g; # space $$thing =~ s/%TAB/\t/g; # horizontal tab + $$thing =~ s/%CR/\r/g; # carriage return aka \r aka 0x0d # include a file $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1)/ge; From e108778db318b74b28c5ca35e3dd583bd0bca118 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 6 Nov 2025 21:10:12 +0100 Subject: [PATCH 257/885] GHA/macos: replace deleted gcc-12 with gcc-13/gcc-14 GitHub dropped gcc-12 for the remaining two macos runner images. Replace it with gcc-13 in normal jobs, and gcc-14 in combination jobs. Ref: https://github.com/actions/runner-images/commit/f7e2c3f34b4985282b39ba42de9f6862a2f8a242 Ref: https://github.com/actions/runner-images/pull/13249 Ref: https://github.com/actions/runner-images/commit/1c1351b6350d920e6c5c524f3eb80cc48c8069a4 Ref: https://github.com/actions/runner-images/pull/13253 Closes #19387 --- .github/workflows/macos.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 20585e7b7db4..0e0d03bc4f01 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -217,7 +217,7 @@ jobs: strategy: fail-fast: false matrix: - compiler: [clang, llvm@18, gcc-12] + compiler: [clang, llvm@18, gcc-13] build: # autotools - name: '!ssl !debug brotli zstd' @@ -226,7 +226,7 @@ jobs: configure: --without-ssl --with-brotli --with-zstd xcode: '' # default Xcode. Set it once to silence actionlint. - name: '!ssl !debug' - compiler: gcc-12 + compiler: gcc-13 configure: --without-ssl - name: '!ssl' compiler: clang @@ -320,7 +320,7 @@ jobs: install: gnutls nettle krb5 generate: -DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5 -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON - name: 'aws-lc' - compiler: gcc-12 + compiler: gcc-13 install: aws-lc generate: -DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/aws-lc -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON - name: 'Rustls' @@ -342,10 +342,10 @@ jobs: exclude: # opt out jobs from combinations that have the compiler set manually - { compiler: llvm@18, build: { compiler: 'clang' } } - - { compiler: llvm@18, build: { compiler: 'gcc-12' } } - - { compiler: gcc-12, build: { compiler: 'clang' } } - - { compiler: gcc-12, build: { compiler: 'llvm@18' } } - - { compiler: clang, build: { compiler: 'gcc-12' } } + - { compiler: llvm@18, build: { compiler: 'gcc-13' } } + - { compiler: gcc-13, build: { compiler: 'clang' } } + - { compiler: gcc-13, build: { compiler: 'llvm@18' } } + - { compiler: clang, build: { compiler: 'gcc-13' } } - { compiler: clang, build: { compiler: 'llvm@18' } } steps: @@ -557,7 +557,7 @@ jobs: # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md # https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md - compiler: [gcc-12, gcc-13, gcc-15, llvm@15, llvm@18, llvm@20, clang] + compiler: [gcc-13, gcc-14, gcc-15, llvm@15, llvm@18, llvm@20, clang] # Xcode support matrix as of 2025-10, with default macOS SDK versions and OS names, years: # * = default Xcode on the runner. # macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4 @@ -579,9 +579,9 @@ jobs: - { image: macos-15, compiler: 'llvm@20' } - { image: macos-26, compiler: 'llvm@15' } - { image: macos-26, compiler: 'llvm@18' } - - { image: macos-26, compiler: 'gcc-12' } # Reduce build combinations, by dropping less interesting ones - - { compiler: gcc-13, build: cmake } + - { image: macos-26, compiler: 'gcc-13' } + - { compiler: gcc-14, build: cmake } - { compiler: gcc-15, build: autotools } steps: - name: 'install autotools' From 8e93a74a731714767e2414e1a5687aa0ef31d9ea Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Nov 2025 23:14:04 +0100 Subject: [PATCH 258/885] tool_paramhlp: refuse --proto remove all protocols curl is for transfers so disabling all protocols has to be a mistake. Previously it would allow this to get set (even if curl_easy_setopt() returns an error for it) and then let libcurl return error instead. Updated 1474 accordingly. Closes #19388 --- src/tool_paramhlp.c | 16 ++++++++++------ tests/data/test1474 | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index 9f54704ea2ed..008f0fc388c1 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -397,7 +397,7 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str) const char **protoset; struct dynbuf obuf; size_t proto; - CURLcode result; + CURLcode result = CURLE_OK; curlx_dyn_init(&obuf, MAX_PROTOSTRING); @@ -496,15 +496,19 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str) qsort((char *) protoset, protoset_index(protoset, NULL), sizeof(*protoset), struplocompare4sort); - result = curlx_dyn_addn(&obuf, "", 0); for(proto = 0; protoset[proto] && !result; proto++) - result = curlx_dyn_addf(&obuf, "%s,", protoset[proto]); + result = curlx_dyn_addf(&obuf, "%s%s", curlx_dyn_len(&obuf) ? "," : "", + protoset[proto]); free((char *) protoset); - curlx_dyn_setlen(&obuf, curlx_dyn_len(&obuf) - 1); + if(result) + return PARAM_NO_MEM; + if(!curlx_dyn_len(&obuf)) { + curlx_dyn_free(&obuf); + return PARAM_BAD_USE; + } free(*ostr); *ostr = curlx_dyn_ptr(&obuf); - - return *ostr ? PARAM_OK : PARAM_NO_MEM; + return PARAM_OK; } /** diff --git a/tests/data/test1474 b/tests/data/test1474 index 8ccecf18775b..9ca209cf2694 100644 --- a/tests/data/test1474 +++ b/tests/data/test1474 @@ -29,9 +29,9 @@ http # # Verify data after the test has been "shot" -# 1 - Protocol "http" disabled +# 2 failed init, the --proto argument is not accepted -1 +2 From 684af00181145e08e6cb287d09ecdf29ee7450ab Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Nov 2025 23:39:56 +0100 Subject: [PATCH 259/885] setopt: when setting bad protocols, don't store them Both CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR would previously return error on bad input but would wrongly still store and keep the partial (unacceptable) result in the handle. Closes #19389 --- lib/setopt.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index 3f385ed8a54a..90a1cf24a8d1 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2361,17 +2361,27 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, #endif /* USE_LIBSSH2 */ #endif /* USE_SSH */ case CURLOPT_PROTOCOLS_STR: - if(ptr) - return protocol2num(ptr, &s->allowed_protocols); - /* make a NULL argument reset to default */ - s->allowed_protocols = (curl_prot_t) CURLPROTO_ALL; + if(ptr) { + curl_prot_t protos; + result = protocol2num(ptr, &protos); + if(!result) + s->allowed_protocols = protos; + } + else + /* make a NULL argument reset to default */ + s->allowed_protocols = (curl_prot_t) CURLPROTO_ALL; break; case CURLOPT_REDIR_PROTOCOLS_STR: - if(ptr) - return protocol2num(ptr, &s->redir_protocols); - /* make a NULL argument reset to default */ - s->redir_protocols = (curl_prot_t) CURLPROTO_REDIR; + if(ptr) { + curl_prot_t protos; + result = protocol2num(ptr, &protos); + if(!result) + s->redir_protocols = protos; + } + else + /* make a NULL argument reset to default */ + s->redir_protocols = (curl_prot_t) CURLPROTO_REDIR; break; case CURLOPT_DEFAULT_PROTOCOL: From a6eaa67c5582155e5d5149b0ff33d11b166ee41a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 7 Nov 2025 10:39:26 +0100 Subject: [PATCH 260/885] mbedtls: fix potential use of uninitialized `nread` When Curl_conn_cf_recv() returns error, the variable might not be assigned and the tracing output may (harmlessly) use it uninitialized. Also add a comment about the typecast from size_t to int being fine. Pointed out by ZeroPath Closes #19393 --- lib/vtls/mbedtls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4e8a0c3cf799..36200de6fa6f 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -200,7 +200,7 @@ static int mbedtls_bio_cf_read(void *bio, unsigned char *buf, size_t blen) { struct Curl_cfilter *cf = bio; struct Curl_easy *data = CF_DATA_CURRENT(cf); - size_t nread; + size_t nread = 0; CURLcode result; DEBUGASSERT(data); @@ -215,6 +215,7 @@ static int mbedtls_bio_cf_read(void *bio, unsigned char *buf, size_t blen) blen, result, nread); if(CURLE_AGAIN == result) return MBEDTLS_ERR_SSL_WANT_READ; + /* nread is never larger than int here */ return result ? -1 : (int)nread; } From 40b1724f58311a472b195dedd269deb1fd84405e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Nov 2025 16:34:23 +0100 Subject: [PATCH 261/885] tool: consider (some) curl_easy_setopt errors fatal Instead of happily ignoring return codes. Calls that allocate data, like duplicating strings, can fail because of lack of memory which could then leave the option unset and curl would unknowingly continue (if the memory shortage was momentary). Closes #19385 --- src/config2setopts.c | 361 +++++++++++++++++++------------------------ src/tool_findfile.c | 3 +- src/tool_setopt.c | 92 +++++++---- src/tool_setopt.h | 82 +++++----- src/tool_ssls.c | 5 +- 5 files changed, 261 insertions(+), 282 deletions(-) diff --git a/src/config2setopts.c b/src/config2setopts.c index c367959ccb3e..929123cfbf0b 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -175,32 +175,26 @@ static CURLcode ssh_setopts(struct OperationConfig *config, CURL *curl) CURLcode result; /* SSH and SSL private key uses same command-line option */ - /* new in libcurl 7.16.1 */ - my_setopt_str(curl, CURLOPT_SSH_PRIVATE_KEYFILE, config->key); - /* new in libcurl 7.16.1 */ - my_setopt_str(curl, CURLOPT_SSH_PUBLIC_KEYFILE, config->pubkey); - - /* new in libcurl 7.17.1: SSH host key md5 checking allows us - to fail if we are not talking to who we think we should */ - my_setopt_str(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, - config->hostpubmd5); - - /* new in libcurl 7.80.0: SSH host key sha256 checking allows us - to fail if we are not talking to who we think we should */ - my_setopt_str(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, + MY_SETOPT_STR(curl, CURLOPT_SSH_PRIVATE_KEYFILE, config->key); + MY_SETOPT_STR(curl, CURLOPT_SSH_PUBLIC_KEYFILE, config->pubkey); + + /* SSH host key md5 checking allows us to fail if we are not talking to who + we think we should */ + MY_SETOPT_STR(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, config->hostpubmd5); + + /* SSH host key sha256 checking allows us to fail if we are not talking to + who we think we should */ + MY_SETOPT_STR(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, config->hostpubsha256); - /* new in libcurl 7.56.0 */ if(config->ssh_compression) my_setopt_long(curl, CURLOPT_SSH_COMPRESSION, 1); if(!config->insecure_ok) { char *known = config->knownhosts; - if(!known) known = findfile(".ssh/known_hosts", FALSE); if(known) { - /* new in curl 7.19.6 */ result = my_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, known); if(result) { config->knownhosts = NULL; @@ -280,32 +274,26 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) CURLcode result = CURLE_OK; if(config->cacert) - my_setopt_str(curl, CURLOPT_CAINFO, config->cacert); + MY_SETOPT_STR(curl, CURLOPT_CAINFO, config->cacert); if(config->proxy_cacert) - my_setopt_str(curl, CURLOPT_PROXY_CAINFO, config->proxy_cacert); + MY_SETOPT_STR(curl, CURLOPT_PROXY_CAINFO, config->proxy_cacert); + if(config->capath) + MY_SETOPT_STR(curl, CURLOPT_CAPATH, config->capath); - if(config->capath) { - result = my_setopt_str(curl, CURLOPT_CAPATH, config->capath); - if(result) - return result; - } /* For the time being if --proxy-capath is not set then we use the --capath value for it, if any. See #1257 */ if(config->proxy_capath || config->capath) { - result = my_setopt_str(curl, CURLOPT_PROXY_CAPATH, - (config->proxy_capath ? config->proxy_capath : - config->capath)); - if((result == CURLE_NOT_BUILT_IN) || - (result == CURLE_UNKNOWN_OPTION)) { - if(config->proxy_capath) { - warnf("ignoring %s, not supported by libcurl with %s", - config->proxy_capath ? "--proxy-capath" : "--capath", - ssl_backend()); - } + MY_SETOPT_STR(curl, CURLOPT_PROXY_CAPATH, + (config->proxy_capath ? config->proxy_capath : + config->capath)); + if(result && config->proxy_capath) { + warnf("ignoring %s, not supported by libcurl with %s", + config->proxy_capath ? "--proxy-capath" : "--capath", + ssl_backend()); } - else if(result) - return result; } + if(result) + return result; #ifdef CURL_CA_EMBED if(!config->cacert && !config->capath) { @@ -335,47 +323,46 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) #endif if(config->crlfile) - my_setopt_str(curl, CURLOPT_CRLFILE, config->crlfile); + MY_SETOPT_STR(curl, CURLOPT_CRLFILE, config->crlfile); if(config->proxy_crlfile) - my_setopt_str(curl, CURLOPT_PROXY_CRLFILE, config->proxy_crlfile); - else if(config->crlfile) /* CURLOPT_PROXY_CRLFILE default is crlfile */ - my_setopt_str(curl, CURLOPT_PROXY_CRLFILE, config->crlfile); + MY_SETOPT_STR(curl, CURLOPT_PROXY_CRLFILE, config->proxy_crlfile); + else if(config->crlfile) + /* CURLOPT_PROXY_CRLFILE default is crlfile */ + MY_SETOPT_STR(curl, CURLOPT_PROXY_CRLFILE, config->crlfile); if(config->pinnedpubkey) { - result = my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, - config->pinnedpubkey); - if(result == CURLE_NOT_BUILT_IN) + MY_SETOPT_STR(curl, CURLOPT_PINNEDPUBLICKEY, + config->pinnedpubkey); + if(result) warnf("ignoring %s, not supported by libcurl with %s", "--pinnedpubkey", ssl_backend()); } if(config->proxy_pinnedpubkey) { - result = my_setopt_str(curl, CURLOPT_PROXY_PINNEDPUBLICKEY, - config->proxy_pinnedpubkey); - if(result == CURLE_NOT_BUILT_IN) + MY_SETOPT_STR(curl, CURLOPT_PROXY_PINNEDPUBLICKEY, + config->proxy_pinnedpubkey); + if(result) warnf("ignoring %s, not supported by libcurl with %s", "--proxy-pinnedpubkey", ssl_backend()); } if(config->ssl_ec_curves) - my_setopt_str(curl, CURLOPT_SSL_EC_CURVES, config->ssl_ec_curves); + MY_SETOPT_STR(curl, CURLOPT_SSL_EC_CURVES, config->ssl_ec_curves); if(config->ssl_signature_algorithms) - my_setopt_str(curl, CURLOPT_SSL_SIGNATURE_ALGORITHMS, + MY_SETOPT_STR(curl, CURLOPT_SSL_SIGNATURE_ALGORITHMS, config->ssl_signature_algorithms); if(config->writeout) my_setopt_long(curl, CURLOPT_CERTINFO, 1); - my_setopt_str(curl, CURLOPT_SSLCERT, config->cert); - my_setopt_str(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert); - my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type); - my_setopt_str(curl, CURLOPT_PROXY_SSLCERTTYPE, - config->proxy_cert_type); - my_setopt_str(curl, CURLOPT_SSLKEY, config->key); - my_setopt_str(curl, CURLOPT_PROXY_SSLKEY, config->proxy_key); - my_setopt_str(curl, CURLOPT_SSLKEYTYPE, config->key_type); - my_setopt_str(curl, CURLOPT_PROXY_SSLKEYTYPE, - config->proxy_key_type); + MY_SETOPT_STR(curl, CURLOPT_SSLCERT, config->cert); + MY_SETOPT_STR(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert); + MY_SETOPT_STR(curl, CURLOPT_SSLCERTTYPE, config->cert_type); + MY_SETOPT_STR(curl, CURLOPT_PROXY_SSLCERTTYPE, config->proxy_cert_type); + MY_SETOPT_STR(curl, CURLOPT_SSLKEY, config->key); + MY_SETOPT_STR(curl, CURLOPT_PROXY_SSLKEY, config->proxy_key); + MY_SETOPT_STR(curl, CURLOPT_SSLKEYTYPE, config->key_type); + MY_SETOPT_STR(curl, CURLOPT_PROXY_SSLKEYTYPE, config->proxy_key_type); /* libcurl default is strict verifyhost -> 1L, verifypeer -> 1L */ if(config->insecure_ok) { @@ -431,30 +418,28 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) } if(config->cipher_list) { - result = my_setopt_str(curl, CURLOPT_SSL_CIPHER_LIST, - config->cipher_list); - if(result == CURLE_NOT_BUILT_IN) + MY_SETOPT_STR(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list); + if(result) warnf("ignoring %s, not supported by libcurl with %s", "--ciphers", ssl_backend()); } if(config->proxy_cipher_list) { - result = my_setopt_str(curl, CURLOPT_PROXY_SSL_CIPHER_LIST, - config->proxy_cipher_list); - if(result == CURLE_NOT_BUILT_IN) + MY_SETOPT_STR(curl, CURLOPT_PROXY_SSL_CIPHER_LIST, + config->proxy_cipher_list); + if(result) warnf("ignoring %s, not supported by libcurl with %s", "--proxy-ciphers", ssl_backend()); } if(config->cipher13_list) { - result = my_setopt_str(curl, CURLOPT_TLS13_CIPHERS, - config->cipher13_list); - if(result == CURLE_NOT_BUILT_IN) + MY_SETOPT_STR(curl, CURLOPT_TLS13_CIPHERS, config->cipher13_list); + if(result) warnf("ignoring %s, not supported by libcurl with %s", "--tls13-ciphers", ssl_backend()); } if(config->proxy_cipher13_list) { - result = my_setopt_str(curl, CURLOPT_PROXY_TLS13_CIPHERS, - config->proxy_cipher13_list); - if(result == CURLE_NOT_BUILT_IN) + MY_SETOPT_STR(curl, CURLOPT_PROXY_TLS13_CIPHERS, + config->proxy_cipher13_list); + if(result) warnf("ignoring %s, not supported by libcurl with %s", "--proxy-tls13-ciphers", ssl_backend()); } @@ -467,29 +452,22 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) if(feature_ech) { /* only if enabled in libcurl */ if(config->ech) /* only if set (optional) */ - my_setopt_str(curl, CURLOPT_ECH, config->ech); + MY_SETOPT_STR(curl, CURLOPT_ECH, config->ech); if(config->ech_public) /* only if set (optional) */ - my_setopt_str(curl, CURLOPT_ECH, config->ech_public); + MY_SETOPT_STR(curl, CURLOPT_ECH, config->ech_public); if(config->ech_config) /* only if set (optional) */ - my_setopt_str(curl, CURLOPT_ECH, config->ech_config); + MY_SETOPT_STR(curl, CURLOPT_ECH, config->ech_config); } - /* new in curl 7.9.3 */ - if(config->engine) { - result = my_setopt_str(curl, CURLOPT_SSLENGINE, config->engine); - if(result) - return result; - } + if(config->engine) + MY_SETOPT_STR(curl, CURLOPT_SSLENGINE, config->engine); - /* new in curl 7.15.5 */ if(config->ftp_ssl_reqd) my_setopt_enum(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); - /* new in curl 7.11.0 */ else if(config->ftp_ssl) my_setopt_enum(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY); - /* new in curl 7.16.0 */ else if(config->ftp_ssl_control) my_setopt_enum(curl, CURLOPT_USE_SSL, CURLUSESSL_CONTROL); @@ -503,28 +481,25 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) static CURLcode http_setopts(struct OperationConfig *config, CURL *curl) { + CURLcode result; long postRedir = 0; my_setopt_long(curl, CURLOPT_FOLLOWLOCATION, config->followlocation); my_setopt_long(curl, CURLOPT_UNRESTRICTED_AUTH, config->unrestricted_auth); - my_setopt_str(curl, CURLOPT_AWS_SIGV4, config->aws_sigv4); + MY_SETOPT_STR(curl, CURLOPT_AWS_SIGV4, config->aws_sigv4); my_setopt_long(curl, CURLOPT_AUTOREFERER, config->autoreferer); - /* new in libcurl 7.36.0 */ if(config->proxyheaders) { my_setopt_slist(curl, CURLOPT_PROXYHEADER, config->proxyheaders); my_setopt_long(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE); } - /* new in libcurl 7.5 */ my_setopt_long(curl, CURLOPT_MAXREDIRS, config->maxredirs); if(config->httpversion) my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion); - /* curl 7.19.1 (the 301 version existed in 7.18.2), - 303 was added in 7.26.0 */ if(config->post301) postRedir |= CURL_REDIR_POST_301; if(config->post302) @@ -533,28 +508,25 @@ static CURLcode http_setopts(struct OperationConfig *config, postRedir |= CURL_REDIR_POST_303; my_setopt_long(curl, CURLOPT_POSTREDIR, postRedir); - /* new in libcurl 7.21.6 */ if(config->encoding) - my_setopt_str(curl, CURLOPT_ACCEPT_ENCODING, ""); + MY_SETOPT_STR(curl, CURLOPT_ACCEPT_ENCODING, ""); - /* new in libcurl 7.21.6 */ if(config->tr_encoding) my_setopt_long(curl, CURLOPT_TRANSFER_ENCODING, 1); - /* new in libcurl 7.64.0 */ + my_setopt_long(curl, CURLOPT_HTTP09_ALLOWED, config->http09_allowed); if(config->altsvc) - my_setopt_str(curl, CURLOPT_ALTSVC, config->altsvc); + MY_SETOPT_STR(curl, CURLOPT_ALTSVC, config->altsvc); if(config->hsts) - my_setopt_str(curl, CURLOPT_HSTS, config->hsts); + MY_SETOPT_STR(curl, CURLOPT_HSTS, config->hsts); - /* new in 7.47.0 */ if(config->expect100timeout_ms > 0) my_setopt_long(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, config->expect100timeout_ms); - return CURLE_OK; + return result; } static CURLcode cookie_setopts(struct OperationConfig *config, CURL *curl) @@ -580,29 +552,28 @@ static CURLcode cookie_setopts(struct OperationConfig *config, CURL *curl) } } - my_setopt_str(curl, CURLOPT_COOKIE, curlx_dyn_ptr(&cookies)); + result = my_setopt_str(curl, CURLOPT_COOKIE, curlx_dyn_ptr(&cookies)); curlx_dyn_free(&cookies); + if(result) + return result; } if(config->cookiefiles) { struct curl_slist *cfl; for(cfl = config->cookiefiles; cfl; cfl = cfl->next) - my_setopt_str(curl, CURLOPT_COOKIEFILE, cfl->data); + MY_SETOPT_STR(curl, CURLOPT_COOKIEFILE, cfl->data); } - /* new in libcurl 7.9 */ if(config->cookiejar) - my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar); + MY_SETOPT_STR(curl, CURLOPT_COOKIEJAR, config->cookiejar); - /* new in libcurl 7.9.7 */ my_setopt_long(curl, CURLOPT_COOKIESESSION, config->cookiesession); return result; } -static CURLcode tcp_setopts(struct OperationConfig *config, - CURL *curl) +static void tcp_setopts(struct OperationConfig *config, CURL *curl) { if(!config->tcp_nodelay) my_setopt_long(curl, CURLOPT_TCP_NODELAY, 0); @@ -611,7 +582,8 @@ static CURLcode tcp_setopts(struct OperationConfig *config, my_setopt_long(curl, CURLOPT_TCP_FASTOPEN, 1); if(config->mptcp) - my_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, tool_socket_open_mptcp_cb); + my_setopt_ptr(curl, CURLOPT_OPENSOCKETFUNCTION, + tool_socket_open_mptcp_cb); /* curl 7.17.1 */ if(!config->nokeepalive) { @@ -625,51 +597,41 @@ static CURLcode tcp_setopts(struct OperationConfig *config, } else my_setopt_long(curl, CURLOPT_TCP_KEEPALIVE, 0); - return CURLE_OK; } static CURLcode ftp_setopts(struct OperationConfig *config, CURL *curl) { - my_setopt_str(curl, CURLOPT_FTPPORT, config->ftpport); + CURLcode result; + MY_SETOPT_STR(curl, CURLOPT_FTPPORT, config->ftpport); - /* new in libcurl 7.9.2: */ if(config->disable_epsv) /* disable it */ my_setopt_long(curl, CURLOPT_FTP_USE_EPSV, 0); - /* new in libcurl 7.10.5 */ if(config->disable_eprt) /* disable it */ my_setopt_long(curl, CURLOPT_FTP_USE_EPRT, 0); - /* new in curl 7.16.1 */ if(config->ftp_ssl_ccc) my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC, config->ftp_ssl_ccc_mode); - my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account); - - /* curl 7.14.2 */ + MY_SETOPT_STR(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account); my_setopt_long(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip); - - /* curl 7.15.1 */ my_setopt_long(curl, CURLOPT_FTP_FILEMETHOD, config->ftp_filemethod); - - /* curl 7.15.5 */ - my_setopt_str(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, + MY_SETOPT_STR(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, config->ftp_alternative_to_user); - /* curl 7.20.x */ if(config->ftp_pret) my_setopt_long(curl, CURLOPT_FTP_USE_PRET, 1); - return CURLE_OK; + return result; } static void gen_trace_setopts(struct OperationConfig *config, CURL *curl) { if(global->tracetype != TRACE_NONE) { - my_setopt(curl, CURLOPT_DEBUGFUNCTION, tool_debug_cb); - my_setopt(curl, CURLOPT_DEBUGDATA, config); + my_setopt_ptr(curl, CURLOPT_DEBUGFUNCTION, tool_debug_cb); + my_setopt_ptr(curl, CURLOPT_DEBUGDATA, config); my_setopt_long(curl, CURLOPT_VERBOSE, 1L); } } @@ -681,45 +643,45 @@ static void gen_cb_setopts(struct OperationConfig *config, (void)config; /* when --libcurl is disabled */ /* where to store */ - my_setopt(curl, CURLOPT_WRITEDATA, per); - my_setopt(curl, CURLOPT_INTERLEAVEDATA, per); + my_setopt_ptr(curl, CURLOPT_WRITEDATA, per); + my_setopt_ptr(curl, CURLOPT_INTERLEAVEDATA, per); /* what call to write */ - my_setopt(curl, CURLOPT_WRITEFUNCTION, tool_write_cb); + my_setopt_ptr(curl, CURLOPT_WRITEFUNCTION, tool_write_cb); /* what to read */ - my_setopt(curl, CURLOPT_READDATA, per); - my_setopt(curl, CURLOPT_READFUNCTION, tool_read_cb); + my_setopt_ptr(curl, CURLOPT_READDATA, per); + my_setopt_ptr(curl, CURLOPT_READFUNCTION, tool_read_cb); /* in 7.18.0, the CURLOPT_SEEKFUNCTION/DATA pair is taking over what CURLOPT_IOCTLFUNCTION/DATA pair previously provided for seeking */ - my_setopt(curl, CURLOPT_SEEKDATA, per); - my_setopt(curl, CURLOPT_SEEKFUNCTION, tool_seek_cb); + my_setopt_ptr(curl, CURLOPT_SEEKDATA, per); + my_setopt_ptr(curl, CURLOPT_SEEKFUNCTION, tool_seek_cb); if((global->progressmode == CURL_PROGRESS_BAR) && !global->noprogress && !global->silent) { /* we want the alternative style, then we have to implement it ourselves! */ - my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_progress_cb); - my_setopt(curl, CURLOPT_XFERINFODATA, per); + my_setopt_ptr(curl, CURLOPT_XFERINFOFUNCTION, tool_progress_cb); + my_setopt_ptr(curl, CURLOPT_XFERINFODATA, per); } else if(per->uploadfile && !strcmp(per->uploadfile, ".")) { /* when reading from stdin in non-blocking mode, we use the progress function to unpause a busy read */ my_setopt_long(curl, CURLOPT_NOPROGRESS, 0); - my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_readbusy_cb); - my_setopt(curl, CURLOPT_XFERINFODATA, per); + my_setopt_ptr(curl, CURLOPT_XFERINFOFUNCTION, tool_readbusy_cb); + my_setopt_ptr(curl, CURLOPT_XFERINFODATA, per); } - my_setopt(curl, CURLOPT_HEADERFUNCTION, tool_header_cb); - my_setopt(curl, CURLOPT_HEADERDATA, per); + my_setopt_ptr(curl, CURLOPT_HEADERFUNCTION, tool_header_cb); + my_setopt_ptr(curl, CURLOPT_HEADERDATA, per); } static CURLcode proxy_setopts(struct OperationConfig *config, CURL *curl) { + CURLcode result; if(config->proxy) { - CURLcode result = my_setopt_str(curl, CURLOPT_PROXY, config->proxy); - + result = my_setopt_str(curl, CURLOPT_PROXY, config->proxy); if(result) { errorf("proxy support is disabled in this libcurl"); config->synthetic_error = TRUE; @@ -727,20 +689,14 @@ static CURLcode proxy_setopts(struct OperationConfig *config, CURL *curl) } } - /* new in libcurl 7.5 */ if(config->proxy) my_setopt_enum(curl, CURLOPT_PROXYTYPE, config->proxyver); - my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd); - - /* new in libcurl 7.3 */ + MY_SETOPT_STR(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd); my_setopt_long(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel); - - /* new in libcurl 7.52.0 */ if(config->preproxy) - my_setopt_str(curl, CURLOPT_PRE_PROXY, config->preproxy); + MY_SETOPT_STR(curl, CURLOPT_PRE_PROXY, config->preproxy); - /* new in libcurl 7.10.6 */ if(config->proxyanyauth) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY); else if(config->proxynegotiate) @@ -752,45 +708,42 @@ static CURLcode proxy_setopts(struct OperationConfig *config, CURL *curl) else if(config->proxybasic) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); - /* new in libcurl 7.19.4 */ - my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy); - + MY_SETOPT_STR(curl, CURLOPT_NOPROXY, config->noproxy); my_setopt_long(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS, config->suppress_connect_headers); - /* new in curl 7.43.0 */ if(config->proxy_service_name) - my_setopt_str(curl, CURLOPT_PROXY_SERVICE_NAME, + MY_SETOPT_STR(curl, CURLOPT_PROXY_SERVICE_NAME, config->proxy_service_name); - /* new in 7.60.0 */ if(config->haproxy_protocol) my_setopt_long(curl, CURLOPT_HAPROXYPROTOCOL, 1); - /* new in 8.2.0 */ if(config->haproxy_clientip) - my_setopt_str(curl, CURLOPT_HAPROXY_CLIENT_IP, config->haproxy_clientip); + MY_SETOPT_STR(curl, CURLOPT_HAPROXY_CLIENT_IP, config->haproxy_clientip); - return CURLE_OK; + return result; } -static void tls_srp_setopts(struct OperationConfig *config, CURL *curl) +static CURLcode tls_srp_setopts(struct OperationConfig *config, CURL *curl) { + CURLcode result = CURLE_OK; if(config->tls_username) - my_setopt_str(curl, CURLOPT_TLSAUTH_USERNAME, config->tls_username); + MY_SETOPT_STR(curl, CURLOPT_TLSAUTH_USERNAME, config->tls_username); if(config->tls_password) - my_setopt_str(curl, CURLOPT_TLSAUTH_PASSWORD, config->tls_password); + MY_SETOPT_STR(curl, CURLOPT_TLSAUTH_PASSWORD, config->tls_password); if(config->tls_authtype) - my_setopt_str(curl, CURLOPT_TLSAUTH_TYPE, config->tls_authtype); + MY_SETOPT_STR(curl, CURLOPT_TLSAUTH_TYPE, config->tls_authtype); if(config->proxy_tls_username) - my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, + MY_SETOPT_STR(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, config->proxy_tls_username); if(config->proxy_tls_password) - my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, + MY_SETOPT_STR(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, config->proxy_tls_password); if(config->proxy_tls_authtype) - my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_TYPE, + MY_SETOPT_STR(curl, CURLOPT_PROXY_TLSAUTH_TYPE, config->proxy_tls_authtype); + return result; } CURLcode config2setopts(struct OperationConfig *config, @@ -838,21 +791,20 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_long(curl, CURLOPT_BUFFERSIZE, BUFFER_SIZE); } - my_setopt_str(curl, CURLOPT_URL, per->url); + MY_SETOPT_STR(curl, CURLOPT_URL, per->url); my_setopt_long(curl, CURLOPT_NOPROGRESS, global->noprogress || global->silent); /* call after the line above. It may override CURLOPT_NOPROGRESS */ gen_cb_setopts(config, per, curl); my_setopt_long(curl, CURLOPT_NOBODY, config->no_body); - my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer); - + MY_SETOPT_STR(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer); result = proxy_setopts(config, curl); - if(result) + if(setopt_bad(result) || config->synthetic_error) return result; my_setopt_long(curl, CURLOPT_FAILONERROR, config->fail == FAIL_WO_BODY); - my_setopt_str(curl, CURLOPT_REQUEST_TARGET, config->request_target); + MY_SETOPT_STR(curl, CURLOPT_REQUEST_TARGET, config->request_target); my_setopt_long(curl, CURLOPT_UPLOAD, !!per->uploadfile); my_setopt_long(curl, CURLOPT_DIRLISTONLY, config->dirlistonly); my_setopt_long(curl, CURLOPT_APPEND, config->ftp_append); @@ -864,12 +816,12 @@ CURLcode config2setopts(struct OperationConfig *config, else my_setopt_enum(curl, CURLOPT_NETRC, CURL_NETRC_IGNORED); - my_setopt_str(curl, CURLOPT_NETRC_FILE, config->netrc_file); + MY_SETOPT_STR(curl, CURLOPT_NETRC_FILE, config->netrc_file); my_setopt_long(curl, CURLOPT_TRANSFERTEXT, config->use_ascii); - my_setopt_str(curl, CURLOPT_LOGIN_OPTIONS, config->login_options); - my_setopt_str(curl, CURLOPT_USERPWD, config->userpwd); - my_setopt_str(curl, CURLOPT_RANGE, config->range); - my_setopt(curl, CURLOPT_ERRORBUFFER, per->errorbuffer); + MY_SETOPT_STR(curl, CURLOPT_LOGIN_OPTIONS, config->login_options); + MY_SETOPT_STR(curl, CURLOPT_USERPWD, config->userpwd); + MY_SETOPT_STR(curl, CURLOPT_RANGE, config->range); + my_setopt_ptr(curl, CURLOPT_ERRORBUFFER, per->errorbuffer); my_setopt_long(curl, CURLOPT_TIMEOUT_MS, config->timeout_ms); switch(config->httpreq) { @@ -879,7 +831,7 @@ CURLcode config2setopts(struct OperationConfig *config, result = CURLE_FAILED_INIT; } else { - my_setopt_str(curl, CURLOPT_POSTFIELDS, + MY_SETOPT_STR(curl, CURLOPT_POSTFIELDS, curlx_dyn_ptr(&config->postdata)); my_setopt_offt(curl, CURLOPT_POSTFIELDSIZE_LARGE, curlx_dyn_len(&config->postdata)); @@ -914,8 +866,8 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_slist(curl, CURLOPT_HTTPHEADER, config->headers); if(proto_http || proto_rtsp) { - my_setopt_str(curl, CURLOPT_REFERER, config->referer); - my_setopt_str(curl, CURLOPT_USERAGENT, config->useragent); + MY_SETOPT_STR(curl, CURLOPT_REFERER, config->referer); + MY_SETOPT_STR(curl, CURLOPT_USERAGENT, config->useragent); } if(use_proto == proto_http || use_proto == proto_https) { @@ -942,28 +894,26 @@ CURLcode config2setopts(struct OperationConfig *config, else my_setopt_offt(curl, CURLOPT_RESUME_FROM_LARGE, 0); - my_setopt_str(curl, CURLOPT_KEYPASSWD, config->key_passwd); - my_setopt_str(curl, CURLOPT_PROXY_KEYPASSWD, config->proxy_key_passwd); + MY_SETOPT_STR(curl, CURLOPT_KEYPASSWD, config->key_passwd); + MY_SETOPT_STR(curl, CURLOPT_PROXY_KEYPASSWD, config->proxy_key_passwd); if(use_proto == proto_scp || use_proto == proto_sftp) { result = ssh_setopts(config, curl); - if(result) + if(setopt_bad(result)) return result; } - if(feature_ssl) { result = ssl_setopts(config, curl); - if(result) + if(setopt_bad(result)) return result; } if(config->path_as_is) my_setopt_long(curl, CURLOPT_PATH_AS_IS, 1); - if(config->no_body || config->remote_time) { + if(config->no_body || config->remote_time) /* no body or use remote time */ my_setopt_long(curl, CURLOPT_FILETIME, 1); - } my_setopt_long(curl, CURLOPT_CRLF, config->crlf); my_setopt_slist(curl, CURLOPT_QUOTE, config->quote); @@ -972,18 +922,18 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_enum(curl, CURLOPT_TIMECONDITION, config->timecond); my_setopt_offt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime); - my_setopt_str(curl, CURLOPT_CUSTOMREQUEST, config->customrequest); + MY_SETOPT_STR(curl, CURLOPT_CUSTOMREQUEST, config->customrequest); customrequest_helper(config->httpreq, config->customrequest); - my_setopt(curl, CURLOPT_STDERR, tool_stderr); - my_setopt_str(curl, CURLOPT_INTERFACE, config->iface); + my_setopt_ptr(curl, CURLOPT_STDERR, tool_stderr); + MY_SETOPT_STR(curl, CURLOPT_INTERFACE, config->iface); progressbarinit(&per->progressbar, config); - my_setopt_str(curl, CURLOPT_DNS_SERVERS, config->dns_servers); - my_setopt_str(curl, CURLOPT_DNS_INTERFACE, config->dns_interface); - my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr); - my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP6, config->dns_ipv6_addr); + MY_SETOPT_STR(curl, CURLOPT_DNS_SERVERS, config->dns_servers); + MY_SETOPT_STR(curl, CURLOPT_DNS_INTERFACE, config->dns_interface); + MY_SETOPT_STR(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr); + MY_SETOPT_STR(curl, CURLOPT_DNS_LOCAL_IP6, config->dns_ipv6_addr); my_setopt_slist(curl, CURLOPT_TELNETOPTIONS, config->telnet_options); my_setopt_long(curl, CURLOPT_CONNECTTIMEOUT_MS, config->connecttimeout_ms); - my_setopt_str(curl, CURLOPT_DOH_URL, config->doh_url); + MY_SETOPT_STR(curl, CURLOPT_DOH_URL, config->doh_url); my_setopt_long(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, (config->ftp_create_dirs ? CURLFTP_CREATE_DIR_RETRY : CURLFTP_CREATE_DIR_NONE)); @@ -994,7 +944,7 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_long(curl, CURLOPT_SOCKS5_GSSAPI_NEC, 1); if(config->socks5_auth) my_setopt_bitmask(curl, CURLOPT_SOCKS5_AUTH, config->socks5_auth); - my_setopt_str(curl, CURLOPT_SERVICE_NAME, config->service_name); + MY_SETOPT_STR(curl, CURLOPT_SERVICE_NAME, config->service_name); my_setopt_long(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl); if(config->localport) { @@ -1007,14 +957,12 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_long(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0); } - result = tcp_setopts(config, curl); - if(result) - return result; + tcp_setopts(config, curl); if(config->tftp_blksize && proto_tftp) my_setopt_long(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize); - my_setopt_str(curl, CURLOPT_MAIL_FROM, config->mail_from); + MY_SETOPT_STR(curl, CURLOPT_MAIL_FROM, config->mail_from); my_setopt_slist(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt); my_setopt_long(curl, CURLOPT_MAIL_RCPT_ALLOWFAILS, config->mail_rcpt_allowfails); @@ -1022,35 +970,36 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_long(curl, CURLOPT_NEW_FILE_PERMS, config->create_file_mode); if(config->proto_present) - my_setopt_str(curl, CURLOPT_PROTOCOLS_STR, config->proto_str); + MY_SETOPT_STR(curl, CURLOPT_PROTOCOLS_STR, config->proto_str); if(config->proto_redir_present) - my_setopt_str(curl, CURLOPT_REDIR_PROTOCOLS_STR, config->proto_redir_str); + MY_SETOPT_STR(curl, CURLOPT_REDIR_PROTOCOLS_STR, config->proto_redir_str); my_setopt_slist(curl, CURLOPT_RESOLVE, config->resolve); my_setopt_slist(curl, CURLOPT_CONNECT_TO, config->connect_to); - if(feature_tls_srp) - tls_srp_setopts(config, curl); + if(feature_tls_srp) { + result = tls_srp_setopts(config, curl); + if(setopt_bad(result)) + return result; + } if(config->gssapi_delegation) my_setopt_long(curl, CURLOPT_GSSAPI_DELEGATION, config->gssapi_delegation); - my_setopt_str(curl, CURLOPT_MAIL_AUTH, config->mail_auth); - my_setopt_str(curl, CURLOPT_SASL_AUTHZID, config->sasl_authzid); + MY_SETOPT_STR(curl, CURLOPT_MAIL_AUTH, config->mail_auth); + MY_SETOPT_STR(curl, CURLOPT_SASL_AUTHZID, config->sasl_authzid); my_setopt_long(curl, CURLOPT_SASL_IR, config->sasl_ir); if(config->unix_socket_path) { - if(config->abstract_unix_socket) { - my_setopt_str(curl, CURLOPT_ABSTRACT_UNIX_SOCKET, + if(config->abstract_unix_socket) + MY_SETOPT_STR(curl, CURLOPT_ABSTRACT_UNIX_SOCKET, config->unix_socket_path); - } - else { - my_setopt_str(curl, CURLOPT_UNIX_SOCKET_PATH, + else + MY_SETOPT_STR(curl, CURLOPT_UNIX_SOCKET_PATH, config->unix_socket_path); - } } - my_setopt_str(curl, CURLOPT_DEFAULT_PROTOCOL, config->proto_default); + MY_SETOPT_STR(curl, CURLOPT_DEFAULT_PROTOCOL, config->proto_default); my_setopt_long(curl, CURLOPT_TFTP_NO_OPTIONS, config->tftp_no_options && proto_tftp); @@ -1063,8 +1012,8 @@ CURLcode config2setopts(struct OperationConfig *config, if(config->ip_tos > 0 || config->vlan_priority > 0) { #if defined(IP_TOS) || defined(IPV6_TCLASS) || defined(SO_PRIORITY) - my_setopt(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback); - my_setopt(curl, CURLOPT_SOCKOPTDATA, config); + my_setopt_ptr(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback); + my_setopt_ptr(curl, CURLOPT_SOCKOPTDATA, config); #else if(config->ip_tos > 0) { errorf("Type of service is not supported in this build."); diff --git a/src/tool_findfile.c b/src/tool_findfile.c index 02898a8fb1b5..6e9fbdfd6003 100644 --- a/src/tool_findfile.c +++ b/src/tool_findfile.c @@ -87,7 +87,8 @@ static char *checkhome(const char *home, const char *fname, bool dotscore) } /* - * findfile() - return the full path name of the file. + * findfile() - returns the full path name of the file. It must be freed with + * curl_free(). * * If 'dotscore' is TRUE, then check for the file first with a leading dot * and then with a leading underscore. diff --git a/src/tool_setopt.c b/src/tool_setopt.c index c3e7213dc85e..ccecd3a7e030 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -23,11 +23,12 @@ ***************************************************************************/ #include "tool_setup.h" -#ifndef CURL_DISABLE_LIBCURL_OPTION - #include "tool_cfgable.h" #include "tool_easysrc.h" #include "tool_setopt.h" + +#ifndef CURL_DISABLE_LIBCURL_OPTION + #include "tool_msgs.h" #include "memdebug.h" /* keep this as LAST include */ @@ -628,56 +629,79 @@ CURLcode tool_setopt_offt(CURL *curl, const char *name, CURLoption tag, return ret; } -/* setopt wrapper for setting object and function pointer options */ -CURLcode tool_setopt(CURL *curl, struct OperationConfig *config, - bool str, const char *name, CURLoption tag, - ...) +/* setopt wrapper for setting object and function pointers */ +CURLcode tool_setopt_ptr(CURL *curl, const char *name, CURLoption tag, ...) { - va_list arg; - CURLcode ret = CURLE_OK; void *pval; - - va_start(arg, tag); + va_list arg; + CURLcode result; DEBUGASSERT(tag >= CURLOPTTYPE_OBJECTPOINT); DEBUGASSERT((tag < CURLOPTTYPE_OFF_T) || (tag >= CURLOPTTYPE_BLOB)); - /* we never set _BLOB options in the curl tool */ DEBUGASSERT(tag < CURLOPTTYPE_BLOB); + va_start(arg, tag); /* argument is an object or function pointer */ pval = va_arg(arg, void *); - ret = curl_easy_setopt(curl, tag, pval); + result = curl_easy_setopt(curl, tag, pval); + if(global->libcurl && pval && !result) { + /* we only use this if --libcurl was used */ + const char *remark = (tag >= CURLOPTTYPE_FUNCTIONPOINT) ? + "function" : "object"; + result = easysrc_addf(&easysrc_toohard, + "%s was set to a%s %s pointer", name, + (*remark == 'o' ? "n" : ""), remark); + } va_end(arg); + return result; +} - if(global->libcurl && pval && !ret) { - /* we only use this if --libcurl was used */ +/* setopt wrapper for setting strings */ +CURLcode tool_setopt_str(CURL *curl, struct OperationConfig *config, + const char *name, CURLoption tag, ...) +{ + char *str; + va_list arg; + CURLcode result; + DEBUGASSERT(tag >= CURLOPTTYPE_OBJECTPOINT); + DEBUGASSERT((tag < CURLOPTTYPE_OFF_T) || (tag >= CURLOPTTYPE_BLOB)); + DEBUGASSERT(tag < CURLOPTTYPE_BLOB); + DEBUGASSERT(tag < CURLOPTTYPE_FUNCTIONPOINT); - if(!str) { - /* function pointers are never printable */ - const char *remark = (tag >= CURLOPTTYPE_FUNCTIONPOINT) ? - "function" : "object"; - ret = easysrc_addf(&easysrc_toohard, - "%s was set to a%s %s pointer", name, - (*remark == 'o' ? "n" : ""), remark); - } - else { - curl_off_t len = ZERO_TERMINATED; - char *escaped; - if(tag == CURLOPT_POSTFIELDS) - len = curlx_dyn_len(&config->postdata); - escaped = c_escape(pval, len); - if(escaped) { - ret = easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, \"%s\");", - name, escaped); - free(escaped); - } + va_start(arg, tag); + /* argument is a string */ + str = va_arg(arg, char *); + + result = curl_easy_setopt(curl, tag, str); + if(global->libcurl && str && !result) { + /* we only use this if --libcurl was used */ + curl_off_t len = ZERO_TERMINATED; + char *escaped; + if(tag == CURLOPT_POSTFIELDS) + len = curlx_dyn_len(&config->postdata); + escaped = c_escape(str, len); + if(escaped) { + result = easysrc_addf(&easysrc_code, + "curl_easy_setopt(hnd, %s, \"%s\");", + name, escaped); + free(escaped); } + else + result = CURLE_OUT_OF_MEMORY; } - return ret; + va_end(arg); + return result; } #endif /* CURL_DISABLE_LIBCURL_OPTION */ + +/* return TRUE if the error code is "lethal" */ +bool setopt_bad(CURLcode result) +{ + return (result && (result != CURLE_NOT_BUILT_IN) && + (result != CURLE_UNKNOWN_OPTION)); +} diff --git a/src/tool_setopt.h b/src/tool_setopt.h index 4f28df980ec1..5ca7188841c4 100644 --- a/src/tool_setopt.h +++ b/src/tool_setopt.h @@ -31,6 +31,9 @@ * Macros used in operate() */ +/* return TRUE if the error code is "lethal" */ +bool setopt_bad(CURLcode result); + #ifndef CURL_DISABLE_LIBCURL_OPTION /* Associate symbolic names with option values */ @@ -95,67 +98,68 @@ CURLcode tool_setopt_long(CURL *curl, const char *name, CURLoption tag, long lval); CURLcode tool_setopt_offt(CURL *curl, const char *name, CURLoption tag, curl_off_t lval); -CURLcode tool_setopt(CURL *curl, struct OperationConfig *config, - bool str, const char *name, CURLoption tag, - ...); +CURLcode tool_setopt_str(CURL *curl, struct OperationConfig *config, + const char *name, CURLoption tag, + ...) WARN_UNUSED_RESULT; +CURLcode tool_setopt_ptr(CURL *curl, const char *name, CURLoption tag, ...); -#define my_setopt(x,y,z) \ - tool_setopt(x, config, FALSE, #y, y, z) +#define my_setopt_ptr(x,y,z) \ + tool_setopt_ptr(x, #y, y, z) -#define my_setopt_long(x,y,z) \ +#define my_setopt_long(x,y,z) \ tool_setopt_long(x, #y, y, z) -#define my_setopt_offt(x,y,z) \ +#define my_setopt_offt(x,y,z) \ tool_setopt_offt(x, #y, y, z) -#define my_setopt_str(x,y,z) \ - tool_setopt(x, config, TRUE, #y, y, z) +#define my_setopt_str(x,y,z) \ + tool_setopt_str(x, config, #y, y, z) + +/* assumes a 'result' variable to use. If the return code is benign it is left + in 'result' after this call, otherwise the function returns the error */ +#define MY_SETOPT_STR(x,y,z) \ + do { \ + result = tool_setopt_str(x, config, #y, y, z); \ + if(setopt_bad(result)) \ + return result; \ + } while(0) -#define my_setopt_enum(x,y,z) \ +#define my_setopt_enum(x,y,z) \ tool_setopt_enum(x, #y, y, setopt_nv_ ## y, z) -#define my_setopt_SSLVERSION(x,y,z) \ +#define my_setopt_SSLVERSION(x,y,z) \ tool_setopt_SSLVERSION(x, #y, y, z) -#define my_setopt_bitmask(x,y,z) \ +#define my_setopt_bitmask(x,y,z) \ tool_setopt_bitmask(x, #y, y, setopt_nv_ ## y, z) -#define my_setopt_mimepost(x,y,z) \ +#define my_setopt_mimepost(x,y,z) \ tool_setopt_mimepost(x, config, #y, y, z) -#define my_setopt_slist(x,y,z) \ +#define my_setopt_slist(x,y,z) \ tool_setopt_slist(x, #y, y, z) #else /* CURL_DISABLE_LIBCURL_OPTION */ /* No --libcurl, so pass options directly to library */ -#define my_setopt(x,y,z) \ - curl_easy_setopt(x, y, z) - -#define my_setopt_long(x,y,z) \ - curl_easy_setopt(x, y, (long)(z)) - -#define my_setopt_offt(x,y,z) \ - curl_easy_setopt(x, y, (curl_off_t)(z)) - -#define my_setopt_str(x,y,z) \ - curl_easy_setopt(x, y, z) - -#define my_setopt_enum(x,y,z) \ - curl_easy_setopt(x, y, z) - -#define my_setopt_SSLVERSION(x,y,z) \ - curl_easy_setopt(x, y, z) - -#define my_setopt_bitmask(x,y,z) \ - curl_easy_setopt(x, y, (long)z) - -#define my_setopt_mimepost(x,y,z) \ - curl_easy_setopt(x, y, z) +#define my_setopt_long(x,y,z) curl_easy_setopt(x, y, (long)(z)) +#define my_setopt_offt(x,y,z) curl_easy_setopt(x, y, (curl_off_t)(z)) +#define my_setopt_ptr(x,y,z) curl_easy_setopt(x, y, z) +#define my_setopt_str(x,y,z) curl_easy_setopt(x, y, z) +#define my_setopt_enum(x,y,z) curl_easy_setopt(x, y, z) +#define my_setopt_SSLVERSION(x,y,z) curl_easy_setopt(x, y, z) +#define my_setopt_bitmask(x,y,z) curl_easy_setopt(x, y, (long)z) +#define my_setopt_mimepost(x,y,z) curl_easy_setopt(x, y, z) +#define my_setopt_slist(x,y,z) curl_easy_setopt(x, y, z) + +#define MY_SETOPT_STR(x,y,z) \ + do { \ + result = curl_easy_setopt(x, y, z); \ + if(setopt_bad(result)) \ + return result; \ + } while(0) -#define my_setopt_slist(x,y,z) \ - curl_easy_setopt(x, y, z) #endif /* CURL_DISABLE_LIBCURL_OPTION */ diff --git a/src/tool_ssls.c b/src/tool_ssls.c index 6fb01804554d..2b8cc1067266 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -45,8 +45,9 @@ static CURLcode tool_ssls_easy(struct OperationConfig *config, result = curl_easy_setopt(*peasy, CURLOPT_SHARE, share); if(!result && (global->tracetype != TRACE_NONE)) { - my_setopt(*peasy, CURLOPT_DEBUGFUNCTION, tool_debug_cb); - my_setopt(*peasy, CURLOPT_DEBUGDATA, config); + result = my_setopt_ptr(*peasy, CURLOPT_DEBUGFUNCTION, tool_debug_cb); + if(!result) + result = my_setopt_ptr(*peasy, CURLOPT_DEBUGDATA, config); my_setopt_long(*peasy, CURLOPT_VERBOSE, 1L); } return result; From f77c574445532e3c17e624fe4965b8aae4a8c45e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 7 Nov 2025 00:52:12 +0100 Subject: [PATCH 262/885] renovate: update ruff less often `ruff` seems to be getting a new release every week. Make renovate bump it once every month. Closes #19392 --- renovate.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/renovate.json b/renovate.json index 102bf42521fd..e48d6a93b812 100644 --- a/renovate.json +++ b/renovate.json @@ -45,11 +45,12 @@ "enabled": false }, { - "description": "Schedule CodeQL updates on the 10th of each month", + "description": "Schedule package updates on the 10th of each month", "matchPackageNames": [ - "/codeql/i" + "/codeql/i", + "/ruff/i" ], - "groupName": "CodeQL", + "groupName": "monthly updates (by name)", "schedule": [ "* * 10 * *" ] @@ -59,7 +60,7 @@ "matchSourceUrls": [ "**/awslabs/**" ], - "groupName": "monthly updates", + "groupName": "monthly updates (by source URL)", "schedule": [ "* * 10 * *" ] From 2684af257e7fc4369e4ac1d45b4e303859259677 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 7 Nov 2025 11:50:02 +0100 Subject: [PATCH 263/885] osslq: code readability - remove assertions that are unnecessary - lookup stream after assertions Closes #19394 --- lib/vquic/curl_osslq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 50051041df36..efa653cf800b 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -2007,7 +2007,7 @@ static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, size_t *pnwritten) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); + struct h3_stream_ctx *stream = NULL; struct cf_call_data save; ssize_t nwritten; CURLcode result = CURLE_OK; @@ -2027,6 +2027,7 @@ static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, if(result) goto out; + stream = H3_STREAM_CTX(ctx, data); if(!stream || stream->s.id < 0) { nwritten = h3_stream_open(cf, data, buf, len, &result); if(nwritten < 0) { @@ -2103,18 +2104,17 @@ static CURLcode cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, size_t *pnread) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); + struct h3_stream_ctx *stream; struct cf_call_data save; CURLcode result = CURLE_OK; - (void)ctx; CF_DATA_SAVE(save, cf, data); DEBUGASSERT(cf->connected); - DEBUGASSERT(ctx); DEBUGASSERT(ctx->tls.ossl.ssl); DEBUGASSERT(ctx->h3.conn); *pnread = 0; + stream = H3_STREAM_CTX(ctx, data); if(!stream) { result = CURLE_RECV_ERROR; goto out; From 608d96694b392a96e448de266a41fc65607150b9 Mon Sep 17 00:00:00 2001 From: x2018 Date: Fri, 7 Nov 2025 01:59:00 +0800 Subject: [PATCH 264/885] lib: refactor the type of funcs which have useless return and checks Some internal functions always return CURLE_OK. - Curl_http_proxy_get_destination() does that from bb4032a, (2 years ago) And the original inline code does not need to check the status. - Curl_wildcard_init() does that from e60fe20. (8 years ago) - Curl_initinfo() does that from a very beginning. - Curl_pgrsSetDownloadCounter() did not have a return before 914e49b, ad051e1 recovered its content (2 years ago) but did not completely recovered the changes related to it. - auth_digest_get_qop_values() does that from 676de7f. This directly changes their type to void and cleaned the remaining checks for their return value. Closes #19386 --- lib/cf-h2-proxy.c | 5 +---- lib/ftplistparser.c | 4 +--- lib/ftplistparser.h | 2 +- lib/getinfo.c | 3 +-- lib/getinfo.h | 2 +- lib/http_proxy.c | 12 ++++-------- lib/http_proxy.h | 6 +++--- lib/progress.c | 3 +-- lib/progress.h | 4 +--- lib/sendf.c | 4 +--- lib/telnet.c | 5 ++--- lib/transfer.c | 4 +--- lib/vauth/digest.c | 8 ++------ 13 files changed, 20 insertions(+), 42 deletions(-) diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index b0638c664287..318fe54253fc 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -87,7 +87,6 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf, const char *hostname; int port; bool ipv6_ip; - CURLcode result; ts->state = H2_TUNNEL_INIT; ts->stream_id = -1; @@ -95,9 +94,7 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf, BUFQ_OPT_SOFT_LIMIT); Curl_bufq_init(&ts->sendbuf, PROXY_H2_CHUNK_SIZE, H2_TUNNEL_SEND_CHUNKS); - result = Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip); - if(result) - return result; + Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip); /* host:port with IPv6 support */ ts->authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname, diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index de573d3c57b5..d8d155d5c2eb 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -185,12 +185,10 @@ static void fileinfo_dtor(void *user, void *element) Curl_fileinfo_cleanup(element); } -CURLcode Curl_wildcard_init(struct WildcardData *wc) +void Curl_wildcard_init(struct WildcardData *wc) { Curl_llist_init(&wc->filelist, fileinfo_dtor); wc->state = CURLWC_INIT; - - return CURLE_OK; } void Curl_wildcard_dtor(struct WildcardData **wcp) diff --git a/lib/ftplistparser.h b/lib/ftplistparser.h index 5ba1f6a97d18..ad8dee74386a 100644 --- a/lib/ftplistparser.h +++ b/lib/ftplistparser.h @@ -65,7 +65,7 @@ struct WildcardData { unsigned char state; /* wildcard_states */ }; -CURLcode Curl_wildcard_init(struct WildcardData *wc); +void Curl_wildcard_init(struct WildcardData *wc); void Curl_wildcard_dtor(struct WildcardData **wcp); struct Curl_easy; diff --git a/lib/getinfo.c b/lib/getinfo.c index e2a8231d5300..f57a454d5db3 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -45,7 +45,7 @@ * beginning of a perform session. It must reset the session-info variables, * in particular all variables in struct PureInfo. */ -CURLcode Curl_initinfo(struct Curl_easy *data) +void Curl_initinfo(struct Curl_easy *data) { struct Progress *pro = &data->progress; struct PureInfo *info = &data->info; @@ -91,7 +91,6 @@ CURLcode Curl_initinfo(struct Curl_easy *data) #ifdef USE_SSL Curl_ssl_free_certinfo(data); #endif - return CURLE_OK; } static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, diff --git a/lib/getinfo.h b/lib/getinfo.h index 56bb440b43b2..f5efe4185c50 100644 --- a/lib/getinfo.h +++ b/lib/getinfo.h @@ -24,6 +24,6 @@ * ***************************************************************************/ CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...); -CURLcode Curl_initinfo(struct Curl_easy *data); +void Curl_initinfo(struct Curl_easy *data); #endif /* HEADER_CURL_GETINFO_H */ diff --git a/lib/http_proxy.c b/lib/http_proxy.c index f6e546b9fd96..9bde118baff2 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -167,9 +167,9 @@ static CURLcode dynhds_add_custom(struct Curl_easy *data, return CURLE_OK; } -CURLcode Curl_http_proxy_get_destination(struct Curl_cfilter *cf, - const char **phostname, - int *pport, bool *pipv6_ip) +void Curl_http_proxy_get_destination(struct Curl_cfilter *cf, + const char **phostname, + int *pport, bool *pipv6_ip) { DEBUGASSERT(cf); DEBUGASSERT(cf->conn); @@ -192,8 +192,6 @@ CURLcode Curl_http_proxy_get_destination(struct Curl_cfilter *cf, *pipv6_ip = (strchr(*phostname, ':') != NULL); else *pipv6_ip = cf->conn->bits.ipv6_ip; - - return CURLE_OK; } struct cf_proxy_ctx { @@ -214,9 +212,7 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, CURLcode result; struct httpreq *req = NULL; - result = Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip); - if(result) - goto out; + Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip); authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname, ipv6_ip ?"]" : "", port); diff --git a/lib/http_proxy.h b/lib/http_proxy.h index e6ab2bacf3bb..17f7e10488e1 100644 --- a/lib/http_proxy.h +++ b/lib/http_proxy.h @@ -36,9 +36,9 @@ enum Curl_proxy_use { HEADER_CONNECT /* sending CONNECT to a proxy */ }; -CURLcode Curl_http_proxy_get_destination(struct Curl_cfilter *cf, - const char **phostname, - int *pport, bool *pipv6_ip); +void Curl_http_proxy_get_destination(struct Curl_cfilter *cf, + const char **phostname, + int *pport, bool *pipv6_ip); CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, struct Curl_cfilter *cf, diff --git a/lib/progress.c b/lib/progress.c index 7b473ef3ae93..928461043ab2 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -305,10 +305,9 @@ timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, /* * Set the number of downloaded bytes so far. */ -CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size) +void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size) { data->progress.dl.cur_size = size; - return CURLE_OK; } /* diff --git a/lib/progress.h b/lib/progress.h index bbe135cdbcd7..7a176b7554ac 100644 --- a/lib/progress.h +++ b/lib/progress.h @@ -48,9 +48,7 @@ void Curl_pgrsStartNow(struct Curl_easy *data); void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size); void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size); -/* It is fine to not check the return code if 'size' is set to 0 */ -CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size); - +void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size); void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size); void Curl_ratelimit(struct Curl_easy *data, struct curltime now); int Curl_pgrsUpdate(struct Curl_easy *data); diff --git a/lib/sendf.c b/lib/sendf.c index f2c29956d1f5..980fae23e646 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -316,9 +316,7 @@ static CURLcode cw_download_write(struct Curl_easy *data, } /* Update stats, write and report progress */ data->req.bytecount += nwrite; - result = Curl_pgrsSetDownloadCounter(data, data->req.bytecount); - if(result) - return result; + Curl_pgrsSetDownloadCounter(data, data->req.bytecount); if(excess_len) { if(!data->req.ignorebody) { diff --git a/lib/telnet.c b/lib/telnet.c index 5c25bc2eaa36..232e56a8849a 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1599,9 +1599,8 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } total_dl += nread; - result = Curl_pgrsSetDownloadCounter(data, total_dl); - if(!result) - result = telrcv(data, tn, (unsigned char *)buffer, nread); + Curl_pgrsSetDownloadCounter(data, total_dl); + result = telrcv(data, tn, (unsigned char *)buffer, nread); if(result) { keepon = FALSE; break; diff --git a/lib/transfer.c b/lib/transfer.c index 0269a4c2505f..98168d3aa662 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -606,9 +606,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) wc->dtor(wc->ftpwc); Curl_safefree(wc->pattern); Curl_safefree(wc->path); - result = Curl_wildcard_init(wc); /* init wildcard structures */ - if(result) - return CURLE_OUT_OF_MEMORY; + Curl_wildcard_init(wc); /* init wildcard structures */ } } #endif diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 0a0b3580ed09..a8d4ffe5b774 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -232,7 +232,7 @@ static bool auth_digest_get_key_value(const char *chlg, const char *key, return FALSE; } -static CURLcode auth_digest_get_qop_values(const char *options, int *value) +static void auth_digest_get_qop_values(const char *options, int *value) { struct Curl_str out; /* Initialise the output */ @@ -248,8 +248,6 @@ static CURLcode auth_digest_get_qop_values(const char *options, int *value) if(curlx_str_single(&options, ',')) break; } - - return CURLE_OK; } /* @@ -377,9 +375,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, return CURLE_BAD_CONTENT_ENCODING; /* Get the qop-values from the qop-options */ - result = auth_digest_get_qop_values(qop_options, &qop_values); - if(result) - return result; + auth_digest_get_qop_values(qop_options, &qop_values); /* We only support auth quality-of-protection */ if(!(qop_values & DIGEST_QOP_VALUE_AUTH)) From 891714acb4b1a9ebff9c6f773c07f9bcd909efef Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 7 Nov 2025 13:06:28 +0100 Subject: [PATCH 265/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f5e85c224800..cb0026259451 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,16 +4,33 @@ curl and libcurl 8.17.1 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3536 + Contributors: 3535 This release includes the following changes: This release includes the following bugfixes: + o checksrc.pl: detect assign followed by more than one space [26] + o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] + o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] + o curl: fix progress meter in parallel mode [15] + o docs: fix checksrc `EQUALSPACE` warnings [21] + o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] o lib: cleanup for some typos about spaces and code style [3] + o lib: refactor the type of funcs which have useless return and checks [1] o m4/sectrust: fix test(1) operator [4] + o mbedtls: fix potential use of uninitialized `nread` [8] + o openssl: remove code handling default version [28] + o osslq: code readability [5] + o setopt: when setting bad protocols, don't store them [9] + o tool: consider (some) curl_easy_setopt errors fatal [7] + o tool_help: add checks to avoid unsigned wrap around [14] + o tool_ipfs: check return codes better [20] + o tool_operate: remove redundant condition [19] + o tool_paramhlp: refuse --proto remove all protocols [10] + o wolfSSL: able to differentiate between IP and DNS in alt names [13] This release includes the following known bugs: @@ -37,11 +54,29 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Daniel Stenberg, Thomas Klausner, Viktor Szakats, Xiaoke Wang - (4 contributors) + Dan Fandrich, Daniel Stenberg, Juliusz Sosinowicz, renovate[bot], + Stefan Eissing, Thomas Klausner, Viktor Szakats, Xiaoke Wang + (8 contributors) References to bug reports and discussions on issues: + [1] = https://curl.se/bug/?i=19386 [2] = https://curl.se/bug/?i=19366 [3] = https://curl.se/bug/?i=19370 [4] = https://curl.se/bug/?i=19371 + [5] = https://curl.se/bug/?i=19394 + [7] = https://curl.se/bug/?i=19385 + [8] = https://curl.se/bug/?i=19393 + [9] = https://curl.se/bug/?i=19389 + [10] = https://curl.se/bug/?i=19388 + [13] = https://curl.se/bug/?i=19364 + [14] = https://curl.se/bug/?i=19377 + [15] = https://curl.se/bug/?i=19383 + [16] = https://curl.se/bug/?i=19380 + [17] = https://curl.se/bug/?i=19378 + [18] = https://curl.se/bug/?i=19365 + [19] = https://curl.se/bug/?i=19381 + [20] = https://curl.se/bug/?i=19382 + [21] = https://curl.se/bug/?i=19379 + [26] = https://curl.se/bug/?i=19375 + [28] = https://curl.se/bug/?i=19354 From d8bad9926ca6ca6def5c09fbcecebcd6c87b68a7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 7 Nov 2025 13:42:36 +0100 Subject: [PATCH 266/885] docs: mention umask need when curl creates files for cookies, alt-svc and HSTS, command line and library Closes #19396 --- .github/scripts/pyspelling.words | 1 + docs/cmdline-opts/alt-svc.md | 3 +++ docs/cmdline-opts/cookie-jar.md | 3 +++ docs/cmdline-opts/hsts.md | 3 +++ docs/libcurl/opts/CURLOPT_ALTSVC.md | 4 ++++ docs/libcurl/opts/CURLOPT_COOKIEJAR.md | 4 ++++ docs/libcurl/opts/CURLOPT_HSTS.md | 4 ++++ 7 files changed, 22 insertions(+) diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index a5c28091301f..f64025b2adbc 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -889,6 +889,7 @@ UI UID UIDL Ultrix +umask Unary unassign UNC diff --git a/docs/cmdline-opts/alt-svc.md b/docs/cmdline-opts/alt-svc.md index 257f4d5b9cb7..a3b17d04f182 100644 --- a/docs/cmdline-opts/alt-svc.md +++ b/docs/cmdline-opts/alt-svc.md @@ -24,5 +24,8 @@ filename again if it has been modified. Specify a "" filename (zero length) to avoid loading/saving and make curl just handle the cache in memory. +You may want to restrict your umask to prevent other users on the same system +to access the created file. + If this option is used several times, curl loads contents from all the files but the last one is used for saving. diff --git a/docs/cmdline-opts/cookie-jar.md b/docs/cmdline-opts/cookie-jar.md index 103144acc314..de09fd5274d4 100644 --- a/docs/cmdline-opts/cookie-jar.md +++ b/docs/cmdline-opts/cookie-jar.md @@ -37,3 +37,6 @@ If the cookie jar cannot be created or written to, the whole curl operation does not fail or even report an error clearly. Using --verbose gets a warning displayed, but that is the only visible feedback you get about this possibly lethal situation. + +You may want to restrict your umask to prevent other users on the same system +to access the created file. diff --git a/docs/cmdline-opts/hsts.md b/docs/cmdline-opts/hsts.md index ca6b07e66d66..f58566e95dfb 100644 --- a/docs/cmdline-opts/hsts.md +++ b/docs/cmdline-opts/hsts.md @@ -28,5 +28,8 @@ performed. Specify a "" filename (zero length) to avoid loading/saving and make curl just handle HSTS in memory. +You may want to restrict your umask to prevent other users on the same system +to access the created file. + If this option is used several times, curl loads contents from all the files but the last one is used for saving. diff --git a/docs/libcurl/opts/CURLOPT_ALTSVC.md b/docs/libcurl/opts/CURLOPT_ALTSVC.md index b74565790cdd..0b2a9cad7232 100644 --- a/docs/libcurl/opts/CURLOPT_ALTSVC.md +++ b/docs/libcurl/opts/CURLOPT_ALTSVC.md @@ -47,6 +47,10 @@ libcurl cannot fully protect against attacks where an attacker has write access to the same directory where it is directed to save files. This is particularly sensitive if you save files using elevated privileges. +libcurl creates the file to store the alt-svc cache in using default file +permissions, meaning that on *nix systems you may need to restrict your umask +to prevent other users on the same system to access the file. + # DEFAULT NULL. The alt-svc cache is not read nor written to file. diff --git a/docs/libcurl/opts/CURLOPT_COOKIEJAR.md b/docs/libcurl/opts/CURLOPT_COOKIEJAR.md index 646972792efe..01cf9c01c6fb 100644 --- a/docs/libcurl/opts/CURLOPT_COOKIEJAR.md +++ b/docs/libcurl/opts/CURLOPT_COOKIEJAR.md @@ -58,6 +58,10 @@ libcurl cannot fully protect against attacks where an attacker has write access to the same directory where it is directed to save files. This is particularly sensitive if you save files using elevated privileges. +libcurl creates the file to store cookies using default file permissions, +meaning that on *nix systems you may need to restrict your umask to prevent +other users on the same system to access the file. + # DEFAULT NULL diff --git a/docs/libcurl/opts/CURLOPT_HSTS.md b/docs/libcurl/opts/CURLOPT_HSTS.md index 79665d0a5c1e..667d15972640 100644 --- a/docs/libcurl/opts/CURLOPT_HSTS.md +++ b/docs/libcurl/opts/CURLOPT_HSTS.md @@ -67,6 +67,10 @@ libcurl cannot fully protect against attacks where an attacker has write access to the same directory where it is directed to save files. This is particularly sensitive if you save files using elevated privileges. +libcurl creates the file to store HSTS data in using default file permissions, +meaning that on *nix systems you may need to restrict your umask to prevent +other users on the same system to access the file. + # %PROTOCOLS% # EXAMPLE From 9d1acd048c75b24d56d5131cc12f907e37f0bd8f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 7 Nov 2025 13:10:48 +0100 Subject: [PATCH 267/885] gtls: skip session resumption when verifystatus is set Resumed TLS sessions skip OCSP stapled-response verification. Force a full handshake so verifystatus() runs. Follow-up to 4bfd7a961521e1fd6aab7610e931d82a342781 Pointed out by ZeroPath --- lib/vtls/gtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index f3d6abb23cac..ebd2c8de1eb0 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1121,7 +1121,7 @@ CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx, /* This might be a reconnect, so we check for a session ID in the cache to speed up things. We need to do this before constructing the gnutls session since we need to set flags depending on the kind of reuse. */ - if(conn_config->cache_session) { + if(conn_config->cache_session && !conn_config->verifystatus) { result = Curl_ssl_scache_take(cf, data, peer->scache_key, &scs); if(result) goto out; From 2d99cf07618d240c265aaf6795df3ef3b8ea7ceb Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 3 Nov 2025 13:53:00 +0000 Subject: [PATCH 268/885] lib: fix gssapi.h include on IBMi Fixes #19336 Closes #19337 --- lib/config-os400.h | 3 +++ lib/urldata.h | 6 +++++- lib/vauth/vauth.h | 6 +++++- lib/version.c | 6 +++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/config-os400.h b/lib/config-os400.h index bccdb4a8974d..b08400fe972a 100644 --- a/lib/config-os400.h +++ b/lib/config-os400.h @@ -102,6 +102,9 @@ /* Define if you have GSS API. */ #define HAVE_GSSAPI +/* Define if you have the header file. */ +#define HAVE_GSSAPI_H + /* Define if you have the GNU gssapi libraries */ #undef HAVE_GSSGNU diff --git a/lib/urldata.h b/lib/urldata.h index f79ccca0aceb..f92bfcb3b2a8 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -191,7 +191,11 @@ typedef CURLcode (Curl_recv)(struct Curl_easy *data, /* transfer */ # ifdef HAVE_GSSGNU # include # else -# include +# ifdef HAVE_GSSAPI_H +# include +# else +# include +# endif # endif #endif diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h index 2ba8e471dc00..51b9f41c1b04 100644 --- a/lib/vauth/vauth.h +++ b/lib/vauth/vauth.h @@ -237,7 +237,11 @@ CURLcode Curl_auth_create_xoauth_bearer_message(const char *user, # ifdef HAVE_GSSGNU # include # else -# include +# ifdef HAVE_GSSAPI_H +# include +# else +# include +# endif # endif #endif diff --git a/lib/version.c b/lib/version.c index 4c7e5712f0f9..f02b92fedfc7 100644 --- a/lib/version.c +++ b/lib/version.c @@ -81,7 +81,11 @@ # ifdef HAVE_GSSGNU # include # else -# include +# ifdef HAVE_GSSAPI_H +# include +# else +# include +# endif # endif #endif From a6fcaf29588a50aa6c27a05994ebe3478f041fba Mon Sep 17 00:00:00 2001 From: x2018 Date: Sat, 8 Nov 2025 00:43:51 +0800 Subject: [PATCH 269/885] rtmp: precaution for a potential integer truncation On some platforms, socket descriptors may use types larger than int. When these values exceed INT_MAX, conversion to int can truncate to negative values causing RTMP connection failures, and even accidentally affect other socket when high-value descriptors map to existing lower-value sockets after integer conversion. This check ensures socket values are within the safe range before passing them to the RTMP library. Closes #19399 --- lib/curl_rtmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 7006ca5eb94e..779422c9ae7f 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -256,6 +256,11 @@ static CURLcode rtmp_connect(struct Curl_easy *data, bool *done) if(!r) return CURLE_FAILED_INIT; + if(conn->sock[FIRSTSOCKET] > INT_MAX) { + /* The socket value is invalid for rtmp. */ + return CURLE_FAILED_INIT; + } + r->m_sb.sb_socket = (int)conn->sock[FIRSTSOCKET]; /* We have to know if it is a write before we send the From 9c0ccd27390c985bd4b7875b5f161ac1e68c9da4 Mon Sep 17 00:00:00 2001 From: x2018 Date: Fri, 7 Nov 2025 20:51:22 +0800 Subject: [PATCH 270/885] vtls: handle possible malicious certs_num from peer For GnuTLS, mbedTLS, Rustls, Schannel and wolfSSL This check was previously added for OpenSSL in 3df71e6dc23e80466c2d448 Closes #19397 --- lib/vtls/gtls.c | 26 +++++++++++++++++--------- lib/vtls/mbedtls.c | 13 +++++++++++-- lib/vtls/openssl.c | 2 -- lib/vtls/rustls.c | 7 ++++++- lib/vtls/schannel.c | 8 ++++++++ lib/vtls/vtls.h | 1 + lib/vtls/wolfssl.c | 8 ++++++-- 7 files changed, 49 insertions(+), 16 deletions(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index ebd2c8de1eb0..34d9b84d7914 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1618,19 +1618,27 @@ Curl_gtls_verifyserver(struct Curl_cfilter *cf, } if(data->set.ssl.certinfo && chain.certs) { - unsigned int i; - - result = Curl_ssl_init_certinfo(data, (int)chain.num_certs); - if(result) + if(chain.num_certs > MAX_ALLOWED_CERT_AMOUNT) { + failf(data, "%u certificates is more than allowed (%u)", + chain.num_certs, MAX_ALLOWED_CERT_AMOUNT); + result = CURLE_SSL_CONNECT_ERROR; goto out; + } + else { + unsigned int i; - for(i = 0; i < chain.num_certs; i++) { - const char *beg = (const char *) chain.certs[i].data; - const char *end = beg + chain.certs[i].size; - - result = Curl_extract_certinfo(data, (int)i, beg, end); + result = Curl_ssl_init_certinfo(data, (int)chain.num_certs); if(result) goto out; + + for(i = 0; i < chain.num_certs; i++) { + const char *beg = (const char *) chain.certs[i].data; + const char *end = beg + chain.certs[i].size; + + result = Curl_extract_certinfo(data, (int)i, beg, end); + if(result) + goto out; + } } } diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 36200de6fa6f..f5302499bdd7 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -475,10 +475,19 @@ mbed_extract_certinfo(struct Curl_easy *data, const mbedtls_x509_crt *crt) { CURLcode result; const mbedtls_x509_crt *cur; + int cert_count = 0; int i; - for(i = 0, cur = crt; cur; ++i, cur = cur->next); - result = Curl_ssl_init_certinfo(data, i); + for(cur = crt; cur && cert_count <= MAX_ALLOWED_CERT_AMOUNT; cur = cur->next) + cert_count++; + + if(cert_count > MAX_ALLOWED_CERT_AMOUNT) { + infof(data, "Certificates is more than allowed (%u), skipping certinfo", + MAX_ALLOWED_CERT_AMOUNT); + return; + } + + result = Curl_ssl_init_certinfo(data, cert_count); for(i = 0, cur = crt; result == CURLE_OK && cur; ++i, cur = cur->next) { const char *beg = (const char *) cur->raw.p; diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 87b00cc252a9..59fd0cbd6de5 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -349,8 +349,6 @@ static CURLcode X509V3_ext(struct Curl_easy *data, return result; } -#define MAX_ALLOWED_CERT_AMOUNT 100 - static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) { CURLcode result; diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index ecf4d0315253..262f016f9fea 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -1211,8 +1211,13 @@ cr_connect(struct Curl_cfilter *cf, if(data->set.ssl.certinfo) { size_t num_certs = 0; size_t i; - while(rustls_connection_get_peer_certificate(rconn, (int)num_certs)) { + while(rustls_connection_get_peer_certificate(rconn, num_certs)) { num_certs++; + if(num_certs > MAX_ALLOWED_CERT_AMOUNT) { + failf(data, "%zu certificates is more than allowed (%u)", + num_certs, MAX_ALLOWED_CERT_AMOUNT); + return CURLE_SSL_CONNECT_ERROR; + } } result = Curl_ssl_init_certinfo(data, (int)num_certs); if(result) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index f9d697bbb844..c96e0df77b50 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1478,6 +1478,8 @@ cert_counter_callback(const CERT_CONTEXT *ccert_context, bool reverse_order, (void)reverse_order; if(valid_cert_encoding(ccert_context)) (*(int *)certs_count)++; + if(*(int *)certs_count > MAX_ALLOWED_CERT_AMOUNT) + return FALSE; return TRUE; } @@ -1623,6 +1625,12 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) } traverse_cert_store(ccert_context, cert_counter_callback, &certs_count); + if(certs_count > MAX_ALLOWED_CERT_AMOUNT) { + failf(data, "%d certificates is more than allowed (%u)", + certs_count, MAX_ALLOWED_CERT_AMOUNT); + CertFreeCertificateContext(ccert_context); + return CURLE_SSL_CONNECT_ERROR; + } result = Curl_ssl_init_certinfo(data, certs_count); if(!result) { diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index 180333e63cc8..dbe13c59030b 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -165,6 +165,7 @@ void Curl_ssl_version(char *buffer, size_t size); /* Certificate information list handling. */ #define CURL_X509_STR_MAX 100000 +#define MAX_ALLOWED_CERT_AMOUNT 100 void Curl_ssl_free_certinfo(struct Curl_easy *data); CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num); diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 19e8c5558aec..585a4060021d 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1512,9 +1512,13 @@ wssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) wolfSSL_set_bio(wssl->ssl, bio, bio); } #else /* USE_BIO_CHAIN */ + curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); + if(sockfd > INT_MAX) { + failf(data, "SSL: socket value too large"); + return CURLE_SSL_CONNECT_ERROR; + } /* pass the raw socket into the SSL layer */ - if(!wolfSSL_set_fd(wssl->ssl, - (int)Curl_conn_cf_get_socket(cf, data))) { + if(!wolfSSL_set_fd(wssl->ssl, (int)sockfd)) { failf(data, "SSL: wolfSSL_set_fd failed"); return CURLE_SSL_CONNECT_ERROR; } From 16c6ea36cca6684aacbcb33578af61b28e3fee0d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 6 Nov 2025 23:59:16 +0100 Subject: [PATCH 271/885] GHA/linux: add minimal Fil-C build with tests Requirements for Fil-C: - not to accidentally pick up system headers. E.g. from `/usr/include` on Linux. It can happen when any dependency is auto-detected on this header path. This makes Fil-C find the wrong system headers, which in turn breaks the configuration step in subtle ways (with CMake) and less subtle ways (autotools). Then CMake ends up running into an error while compiling. - build all dependencies with Fil-C too. (this patch doesn't build any dependencies yet.) - "unity" mode disabled. It should work, but needs a lot of memory and slower than a standard compiler, or a Fil-C non-unity build. - x86_64 Linux host platform when using the pre-built toolchain. Observations on a minimal, static build made with no dependencies and Fil-C 0.674 (based on clang 20.1.8). - curl tool sizes: - cmake, default, w/o -O: 30 MB (gcc 14.2.0: 1.7 MB) - cmake, default, w/o -O, stripped: 29.6 MB (gcc: 1.4 MB) - cmake, Release, -O3: 7.2 MB (gcc: 1 MB) - cmake, Release, -O3, stripped: 6.8 MB (gcc: 0.93 MB) - autotools, default, -O2: 7 MB - libcurl.a size is 32 MB (cmake, default, w/o -O) (gcc: 2.7 MB) - build times 3-3.5x longer (compared to system gcc 14.2.0): - all runtests available pass OK. - all pytests skipped due to missing features/dependencies. - shared libcurl builds also work (cmake, default: 25 MB libcurl.so and 5.75 MB (5.6 stripped) curl tool) - autotools works fine too, with dependencies disabled or set to avoid `/usr/include`. Closes #19391 --- .github/workflows/linux.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6eeb6b697e98..ccf171d932c2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -55,6 +55,8 @@ env: RUSTLS_VERSION: 0.15.0 # handled in renovate.json OPENLDAP_VERSION: 2.6.10 + # renovate: datasource=github-tags depName=pizlonator/fil-c versioning=semver-partial registryUrl=https://github.com + FIL_C_VERSION: 0.674 jobs: linux: @@ -213,6 +215,15 @@ jobs: - name: '!ssl !http !smtp !imap' configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity + - name: 'Fil-C' + install_steps: filc + CC: /home/runner/filc/build/bin/filcc + generate: >- + -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_UNITY_BUILD=OFF + -DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF + -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF + -DUSE_NGHTTP2=OFF -DCURL_DISABLE_LDAP=ON -DUSE_LIBIDN2=OFF -DCURL_USE_LIBSSH2=OFF + - name: 'clang-tidy' install_packages: clang-tidy libssl-dev libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev libkrb5-dev librtmp-dev libgnutls28-dev install_steps: skipall mbedtls rustls wolfssl-opensslextra @@ -351,7 +362,7 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install ${INSTALL_PACKAGES_BREW} fi - - name: 'install prereqs' + - name: 'install prereqs (i686)' if: ${{ contains(matrix.build.name, 'i686') }} run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list @@ -363,7 +374,7 @@ jobs: libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 \ ${MATRIX_INSTALL_PACKAGES} - - name: 'install dependencies' + - name: 'install prereqs (alpine)' if: ${{ startsWith(matrix.build.container, 'alpine') }} run: | apk add --no-cache build-base autoconf automake libtool perl openssl-dev \ @@ -372,6 +383,16 @@ jobs: py3-impacket py3-asn1 py3-six py3-pycryptodomex \ perl-time-hires openssh stunnel sudo git openssl + - name: 'install Fil-C' + if: ${{ contains(matrix.build.install_steps, 'filc') }} + run: | + cd /home/runner + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ + --location "https://github.com/pizlonator/fil-c/releases/download/v${FIL_C_VERSION}/filc-${FIL_C_VERSION}-linux-x86_64.tar.xz" | tar -xJ + mv "filc-${FIL_C_VERSION}-linux-x86_64" filc + cd filc + ./setup.sh + - name: 'cache libressl' if: ${{ contains(matrix.build.install_steps, 'libressl') }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 @@ -652,7 +673,7 @@ jobs: fi - name: 'single-use function check' - if: ${{ contains(matrix.build.configure, '--disable-unity') || contains(matrix.build.generate, '-DCMAKE_UNITY_BUILD=OFF') }} + if: ${{ (contains(matrix.build.configure, '--disable-unity') || contains(matrix.build.generate, '-DCMAKE_UNITY_BUILD=OFF')) && !contains(matrix.build.install_steps, 'filc') }} run: | git config --global --add safe.directory "*" if [ "${MATRIX_BUILD}" = 'cmake' ]; then From f55974c139d88582a9c503c9a35840f3b9fae458 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Sat, 8 Nov 2025 14:28:38 +0100 Subject: [PATCH 272/885] vtls: fix CURLOPT_CAPATH use A regression in curl 8.17.0 led to a customer CAPATH set by the application (or the curl command) to be ignored unless licurl was built with a default CAPATH. Add test cases using `--capath` on the custom pytest CA, generated with the help of the openssl command when available. Fixes #19401 Reported-by: Brad King Closes #19308 --- lib/vtls/vtls.c | 4 ++-- tests/http/test_17_ssl_use.py | 26 ++++++++++++++++++++++++++ tests/http/testenv/certs.py | 16 ++++++++++++++++ tests/http/testenv/curl.py | 3 ++- tests/http/testenv/env.py | 20 ++++++++++++++++++++ 5 files changed, 66 insertions(+), 3 deletions(-) diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 3b7a095c8b75..3858cad98312 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -310,7 +310,6 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) if(result) return result; } - sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH]; #endif #ifdef CURL_CA_BUNDLE if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE]) { @@ -322,6 +321,7 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) } sslc->primary.CAfile = data->set.str[STRING_SSL_CAFILE]; sslc->primary.CRLfile = data->set.str[STRING_SSL_CRLFILE]; + sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH]; sslc->primary.issuercert = data->set.str[STRING_SSL_ISSUERCERT]; sslc->primary.issuercert_blob = data->set.blobs[BLOB_SSL_ISSUERCERT]; sslc->primary.cipher_list = data->set.str[STRING_SSL_CIPHER_LIST]; @@ -358,7 +358,6 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) if(result) return result; } - sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH_PROXY]; #endif #ifdef CURL_CA_BUNDLE if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE_PROXY]) { @@ -370,6 +369,7 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) #endif } sslc->primary.CAfile = data->set.str[STRING_SSL_CAFILE_PROXY]; + sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH_PROXY]; sslc->primary.cipher_list = data->set.str[STRING_SSL_CIPHER_LIST_PROXY]; sslc->primary.cipher_list13 = data->set.str[STRING_SSL_CIPHER13_LIST_PROXY]; sslc->primary.pinned_key = data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]; diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index 57e1c014042b..615658f06c01 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -597,3 +597,29 @@ def test_17_20_correct_pin(self, env: Env, proto, httpd): ]) # expect NOT_IMPLEMENTED or OK assert r.exit_code in [0, 2], f'{r.dump_logs()}' + + @pytest.mark.skipif(condition=not Env.have_openssl(), reason="needs openssl command") + def test_17_21_capath_valid(self, env: Env, httpd): + if env.curl_uses_lib('rustls-ffi'): + pytest.skip('rustls does not support CURLOPT_CAPATH') + proto = 'http/1.1' + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/sslinfo' + r = curl.http_get(url=url, alpn_proto=proto, extra_args=[ + '--capath', env.ca.hashdir + ]) + assert r.exit_code == 0, f'{r.dump_logs()}' + assert r.json['HTTPS'] == 'on', f'{r.json}' + + @pytest.mark.skipif(condition=not Env.have_openssl(), reason="needs openssl command") + def test_17_22_capath_invalid(self, env: Env, httpd): + # we can test all TLS backends here. the ones not supporting CAPATH + # need to fail as well as the ones which do, but get an invalid path. + proto = 'http/1.1' + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/sslinfo' + r = curl.http_get(url=url, alpn_proto=proto, extra_args=[ + '--capath', os.path.join(env.gen_dir, 'ca/invalid') + ]) + # CURLE_PEER_FAILED_VERIFICATION or CURLE_SSL_CACERT_BADFILE + assert r.exit_code in [60, 77], f'{r.dump_logs()}' diff --git a/tests/http/testenv/certs.py b/tests/http/testenv/certs.py index e59b1ea147e1..c9a30aaac065 100644 --- a/tests/http/testenv/certs.py +++ b/tests/http/testenv/certs.py @@ -28,6 +28,8 @@ import ipaddress import os import re +import shutil +import subprocess from datetime import timedelta, datetime, timezone from typing import List, Any, Optional @@ -200,6 +202,10 @@ def pkey_file(self) -> Optional[str]: def combined_file(self) -> Optional[str]: return self._combined_file + @property + def hashdir(self) -> Optional[str]: + return os.path.join(self._store.path, 'hashdir') + def get_first(self, name) -> Optional['Credentials']: creds = self._store.get_credentials_for_name(name) if self._store else [] return creds[0] if len(creds) else None @@ -236,6 +242,16 @@ def issue_cert(self, spec: CertificateSpec, creds.issue_certs(spec.sub_specs, chain=subchain) return creds + def create_hashdir(self, openssl): + os.makedirs(self.hashdir, exist_ok=True) + p = subprocess.run(args=[ + openssl, 'x509', '-hash', '-noout', '-in', self.cert_file + ], capture_output=True, text=True) + if p.returncode != 0: + raise Exception(f'openssl failed to compute cert hash: {p}') + cert_hname = f'{p.stdout.strip()}.0' + shutil.copy(self.cert_file, os.path.join(self.hashdir, cert_hname)) + class CertStore: diff --git a/tests/http/testenv/curl.py b/tests/http/testenv/curl.py index dc885ab8cba9..a92e4f681f34 100644 --- a/tests/http/testenv/curl.py +++ b/tests/http/testenv/curl.py @@ -987,7 +987,8 @@ def _complete_args(self, urls, timeout=None, options=None, pass elif insecure: args.append('--insecure') - elif active_options and "--cacert" in active_options: + elif active_options and ("--cacert" in active_options or \ + "--capath" in active_options): pass elif u.hostname: args.extend(["--cacert", self.env.ca.cert_file]) diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index ff8741530b70..859b704a35a3 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -199,6 +199,16 @@ def __init__(self, pytestconfig: Optional[pytest.Config] = None, ]), ] + self.openssl = 'openssl' + p = subprocess.run(args=[self.openssl, 'version'], + capture_output=True, text=True) + if p.returncode != 0: + # no openssl in path + self.openssl = None + self.openssl_version = None + else: + self.openssl_version = p.stdout.strip() + self.nghttpx = self.config['nghttpx']['nghttpx'] if len(self.nghttpx.strip()) == 0: self.nghttpx = None @@ -372,6 +382,10 @@ def setup_incomplete() -> bool: def incomplete_reason() -> Optional[str]: return Env.CONFIG.get_incomplete_reason() + @staticmethod + def have_openssl() -> bool: + return Env.CONFIG.openssl is not None + @staticmethod def have_nghttpx() -> bool: return Env.CONFIG.nghttpx is not None @@ -548,6 +562,8 @@ def issue_certs(self): store_dir=ca_dir, key_type="rsa2048") self._ca.issue_certs(self.CONFIG.cert_specs) + if self.have_openssl(): + self._ca.create_hashdir(self.openssl) def setup(self): os.makedirs(self.gen_dir, exist_ok=True) @@ -703,6 +719,10 @@ def ws_port(self) -> int: def curl(self) -> str: return self.CONFIG.curl + @property + def openssl(self) -> Optional[str]: + return self.CONFIG.openssl + @property def httpd(self) -> str: return self.CONFIG.httpd From 8442c24c9a05dcf50ce44c8f92718138ae14dd0f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Nov 2025 13:09:50 +0100 Subject: [PATCH 273/885] CURLINFO: remove 'get' and 'get the' from each short desc The short descriptions describe the data each info retrieves. The info itself does not 'get' the data. This simplifies and shortens the descriptions and make them more consistent. Closes #19406 --- docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md | 2 +- docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_CAINFO.md | 2 +- docs/libcurl/opts/CURLINFO_CAPATH.md | 2 +- docs/libcurl/opts/CURLINFO_CERTINFO.md | 2 +- docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md | 2 +- docs/libcurl/opts/CURLINFO_CONNECT_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_CONN_ID.md | 2 +- docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md | 2 +- .../libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md | 2 +- docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md | 2 +- docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md | 2 +- docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md | 2 +- docs/libcurl/opts/CURLINFO_COOKIELIST.md | 2 +- docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md | 2 +- docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md | 2 +- docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md | 2 +- docs/libcurl/opts/CURLINFO_FILETIME.md | 2 +- docs/libcurl/opts/CURLINFO_FILETIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md | 2 +- docs/libcurl/opts/CURLINFO_HEADER_SIZE.md | 2 +- docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md | 2 +- docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md | 2 +- docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md | 2 +- docs/libcurl/opts/CURLINFO_HTTP_VERSION.md | 10 +++++----- docs/libcurl/opts/CURLINFO_LASTSOCKET.md | 2 +- docs/libcurl/opts/CURLINFO_LOCAL_IP.md | 2 +- docs/libcurl/opts/CURLINFO_LOCAL_PORT.md | 2 +- docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md | 2 +- docs/libcurl/opts/CURLINFO_OS_ERRNO.md | 2 +- docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_PRIMARY_IP.md | 2 +- docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md | 2 +- docs/libcurl/opts/CURLINFO_PRIVATE.md | 2 +- docs/libcurl/opts/CURLINFO_PROTOCOL.md | 2 +- docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md | 2 +- docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md | 2 +- docs/libcurl/opts/CURLINFO_PROXY_ERROR.md | 2 +- docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md | 2 +- docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md | 2 +- docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_REDIRECT_URL.md | 2 +- docs/libcurl/opts/CURLINFO_REFERER.md | 2 +- docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md | 2 +- docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md | 2 +- docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md | 2 +- docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md | 2 +- docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md | 2 +- docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md | 2 +- docs/libcurl/opts/CURLINFO_SCHEME.md | 2 +- docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md | 2 +- docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md | 2 +- docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md | 2 +- docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md | 2 +- docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md | 2 +- docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md | 2 +- docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md | 2 +- docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md | 2 +- docs/libcurl/opts/CURLINFO_SSL_ENGINES.md | 2 +- docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md | 2 +- docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_TLS_SESSION.md | 2 +- docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md | 2 +- docs/libcurl/opts/CURLINFO_TOTAL_TIME.md | 2 +- docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md | 2 +- docs/libcurl/opts/CURLINFO_XFER_ID.md | 2 +- 73 files changed, 77 insertions(+), 77 deletions(-) diff --git a/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md b/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md index 0bbb52ff146a..a9db2926b239 100644 --- a/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md +++ b/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md @@ -16,7 +16,7 @@ Added-in: 7.45.0 # NAME -CURLINFO_ACTIVESOCKET - get the active socket +CURLINFO_ACTIVESOCKET - active socket # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md b/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md index 1c4a9cafb5de..e86cd34cc587 100644 --- a/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md +++ b/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md @@ -15,7 +15,7 @@ Added-in: 7.19.0 # NAME -CURLINFO_APPCONNECT_TIME - get the time until the SSL/SSH handshake is completed +CURLINFO_APPCONNECT_TIME - time until the SSL/SSH handshake is completed # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CAINFO.md b/docs/libcurl/opts/CURLINFO_CAINFO.md index 686e7b9d4e10..23502d22966a 100644 --- a/docs/libcurl/opts/CURLINFO_CAINFO.md +++ b/docs/libcurl/opts/CURLINFO_CAINFO.md @@ -17,7 +17,7 @@ Added-in: 7.84.0 # NAME -CURLINFO_CAINFO - get the default built-in CA certificate path +CURLINFO_CAINFO - default built-in CA certificate path # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CAPATH.md b/docs/libcurl/opts/CURLINFO_CAPATH.md index c441805ca17f..c58930e0e9bc 100644 --- a/docs/libcurl/opts/CURLINFO_CAPATH.md +++ b/docs/libcurl/opts/CURLINFO_CAPATH.md @@ -20,7 +20,7 @@ Added-in: 7.84.0 # NAME -CURLINFO_CAPATH - get the default built-in CA path string +CURLINFO_CAPATH - default built-in CA path string # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CERTINFO.md b/docs/libcurl/opts/CURLINFO_CERTINFO.md index d1127afb9b38..f9fd0ad51c6d 100644 --- a/docs/libcurl/opts/CURLINFO_CERTINFO.md +++ b/docs/libcurl/opts/CURLINFO_CERTINFO.md @@ -20,7 +20,7 @@ Added-in: 7.19.1 # NAME -CURLINFO_CERTINFO - get the TLS certificate chain +CURLINFO_CERTINFO - TLS certificate chain # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md index 5f13126ad7c4..9e7bd173c4e3 100644 --- a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md +++ b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md @@ -16,7 +16,7 @@ Added-in: 7.19.4 # NAME -CURLINFO_CONDITION_UNMET - get info on unmet time conditional or 304 HTTP response. +CURLINFO_CONDITION_UNMET - unmet time conditional or 304 HTTP response # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md b/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md index c259e9af5bbb..4a14a1cd7a22 100644 --- a/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md +++ b/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md @@ -15,7 +15,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_CONNECT_TIME - get the time until connect +CURLINFO_CONNECT_TIME - time to connect # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md b/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md index 89ae04c33758..5f0eb1da7a91 100644 --- a/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md @@ -16,7 +16,7 @@ Added-in: 7.61.0 # NAME -CURLINFO_CONNECT_TIME_T - get the time until connect +CURLINFO_CONNECT_TIME_T - time to connect # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONN_ID.md b/docs/libcurl/opts/CURLINFO_CONN_ID.md index 1239c1e332a8..95d5258a598b 100644 --- a/docs/libcurl/opts/CURLINFO_CONN_ID.md +++ b/docs/libcurl/opts/CURLINFO_CONN_ID.md @@ -15,7 +15,7 @@ Added-in: 8.2.0 # NAME -CURLINFO_CONN_ID - get the ID of the last connection used by the handle +CURLINFO_CONN_ID - ID of the last connection # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md index 46e8e7ba015d..7b63c95d9df2 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md @@ -15,7 +15,7 @@ Added-in: 7.6.1 # NAME -CURLINFO_CONTENT_LENGTH_DOWNLOAD - get content-length of download +CURLINFO_CONTENT_LENGTH_DOWNLOAD - content-length of download # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md index 7279bd6b6d9d..83a714b53db7 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md @@ -15,7 +15,7 @@ Added-in: 7.55.0 # NAME -CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - get content-length of download +CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - content-length of download # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md index 725b7f9a45b1..6045dcfdbff1 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md @@ -15,7 +15,7 @@ Added-in: 7.6.1 # NAME -CURLINFO_CONTENT_LENGTH_UPLOAD - get the specified size of the upload +CURLINFO_CONTENT_LENGTH_UPLOAD - specified size of the upload # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md index 9b37e54d6dd2..013f0d064ccf 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md @@ -15,7 +15,7 @@ Added-in: 7.55.0 # NAME -CURLINFO_CONTENT_LENGTH_UPLOAD_T - get the specified size of the upload +CURLINFO_CONTENT_LENGTH_UPLOAD_T - specified size of the upload # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md b/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md index 8a9093ced2ff..c019606cc184 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md @@ -16,7 +16,7 @@ Added-in: 7.9.4 # NAME -CURLINFO_CONTENT_TYPE - get Content-Type +CURLINFO_CONTENT_TYPE - Content-Type of response # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_COOKIELIST.md b/docs/libcurl/opts/CURLINFO_COOKIELIST.md index b0074b990bc4..c106864c3ab0 100644 --- a/docs/libcurl/opts/CURLINFO_COOKIELIST.md +++ b/docs/libcurl/opts/CURLINFO_COOKIELIST.md @@ -15,7 +15,7 @@ Added-in: 7.14.1 # NAME -CURLINFO_COOKIELIST - get all known cookies +CURLINFO_COOKIELIST - all known cookies # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md b/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md index 6855572970d1..5c1323ba1e5a 100644 --- a/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md +++ b/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md @@ -16,7 +16,7 @@ Added-in: 8.11.0 # NAME -CURLINFO_EARLYDATA_SENT_T - get the number of bytes sent as TLS early data +CURLINFO_EARLYDATA_SENT_T - number of bytes sent as TLS early data # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md b/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md index 5299dab8c16e..4538a13342b8 100644 --- a/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md +++ b/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md @@ -16,7 +16,7 @@ Added-in: 7.72.0 # NAME -CURLINFO_EFFECTIVE_METHOD - get the last used HTTP method +CURLINFO_EFFECTIVE_METHOD - last used HTTP request method # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md b/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md index 172f6de3d46b..6840583c8461 100644 --- a/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md +++ b/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md @@ -15,7 +15,7 @@ Added-in: 7.4 # NAME -CURLINFO_EFFECTIVE_URL - get the last used URL +CURLINFO_EFFECTIVE_URL - last used URL # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_FILETIME.md b/docs/libcurl/opts/CURLINFO_FILETIME.md index 9d4c414d5407..67bb822e49b5 100644 --- a/docs/libcurl/opts/CURLINFO_FILETIME.md +++ b/docs/libcurl/opts/CURLINFO_FILETIME.md @@ -17,7 +17,7 @@ Added-in: 7.5 # NAME -CURLINFO_FILETIME - get the remote time of the retrieved document +CURLINFO_FILETIME - remote time of the retrieved document # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_FILETIME_T.md b/docs/libcurl/opts/CURLINFO_FILETIME_T.md index 2d15ba88d49f..627881c2a472 100644 --- a/docs/libcurl/opts/CURLINFO_FILETIME_T.md +++ b/docs/libcurl/opts/CURLINFO_FILETIME_T.md @@ -17,7 +17,7 @@ Added-in: 7.59.0 # NAME -CURLINFO_FILETIME_T - get the remote time of the retrieved document +CURLINFO_FILETIME_T - remote time of the retrieved resource # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md b/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md index db053e311e75..8cf7aae9b2bb 100644 --- a/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md +++ b/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md @@ -15,7 +15,7 @@ Added-in: 7.15.4 # NAME -CURLINFO_FTP_ENTRY_PATH - get entry path in FTP server +CURLINFO_FTP_ENTRY_PATH - entry path in FTP server # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md b/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md index 85907f3b09ff..f54680832056 100644 --- a/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md +++ b/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md @@ -16,7 +16,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_HEADER_SIZE - get size of retrieved headers +CURLINFO_HEADER_SIZE - size of response headers # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md b/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md index 4d001fb4b6f5..85b67c8bdab0 100644 --- a/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md +++ b/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md @@ -16,7 +16,7 @@ Added-in: 7.10.8 # NAME -CURLINFO_HTTPAUTH_AVAIL - get available HTTP authentication methods +CURLINFO_HTTPAUTH_AVAIL - available HTTP authentication methods # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md b/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md index 9b6312171021..5e4727b68d6c 100644 --- a/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md +++ b/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md @@ -15,7 +15,7 @@ Added-in: 8.12.0 # NAME -CURLINFO_HTTPAUTH_USED - get used HTTP authentication method +CURLINFO_HTTPAUTH_USED - used HTTP authentication method # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md b/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md index a9231289c035..0a951254883b 100644 --- a/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md +++ b/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md @@ -15,7 +15,7 @@ Added-in: 7.10.7 # NAME -CURLINFO_HTTP_CONNECTCODE - get the CONNECT response code +CURLINFO_HTTP_CONNECTCODE - CONNECT response code # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md b/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md index 8fddc14f0790..bcc274bf6943 100644 --- a/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md +++ b/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md @@ -15,7 +15,7 @@ Added-in: 7.50.0 # NAME -CURLINFO_HTTP_VERSION - get the http version used in the connection +CURLINFO_HTTP_VERSION - HTTP version used in the transfer # SYNOPSIS @@ -27,10 +27,10 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTP_VERSION, long *p); # DESCRIPTION -Pass a pointer to a long to receive the version used in the last http -connection done using this handle. The returned value is -CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1, CURL_HTTP_VERSION_2_0, -CURL_HTTP_VERSION_3 or 0 if the version cannot be determined. +Pass a pointer to a long to receive the version used in the last http transfer +done using this handle. The returned value is CURL_HTTP_VERSION_1_0, +CURL_HTTP_VERSION_1_1, CURL_HTTP_VERSION_2_0, CURL_HTTP_VERSION_3 or 0 if the +version cannot be determined. # %PROTOCOLS% diff --git a/docs/libcurl/opts/CURLINFO_LASTSOCKET.md b/docs/libcurl/opts/CURLINFO_LASTSOCKET.md index 1b4a22d65048..755cf9a5e0fc 100644 --- a/docs/libcurl/opts/CURLINFO_LASTSOCKET.md +++ b/docs/libcurl/opts/CURLINFO_LASTSOCKET.md @@ -16,7 +16,7 @@ Added-in: 7.15.2 # NAME -CURLINFO_LASTSOCKET - get the last socket used +CURLINFO_LASTSOCKET - last socket used # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_LOCAL_IP.md b/docs/libcurl/opts/CURLINFO_LOCAL_IP.md index c626815c9003..1a99f870148c 100644 --- a/docs/libcurl/opts/CURLINFO_LOCAL_IP.md +++ b/docs/libcurl/opts/CURLINFO_LOCAL_IP.md @@ -17,7 +17,7 @@ Added-in: 7.21.0 # NAME -CURLINFO_LOCAL_IP - get local IP address of last connection +CURLINFO_LOCAL_IP - local IP address of last connection # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md b/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md index 937327f45e99..67d73b71650e 100644 --- a/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md +++ b/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md @@ -17,7 +17,7 @@ Added-in: 7.21.0 # NAME -CURLINFO_LOCAL_PORT - get the latest local port number +CURLINFO_LOCAL_PORT - latest local port number # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md b/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md index fe29e0c4369b..427516819a06 100644 --- a/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md +++ b/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md @@ -15,7 +15,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_NAMELOOKUP_TIME - get the name lookup time +CURLINFO_NAMELOOKUP_TIME - name lookup time # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md b/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md index 7b34ef5c0c96..418f9f8f3246 100644 --- a/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md @@ -15,7 +15,7 @@ Added-in: 7.61.0 # NAME -CURLINFO_NAMELOOKUP_TIME_T - get the name lookup time in microseconds +CURLINFO_NAMELOOKUP_TIME_T - name lookup time in microseconds # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md b/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md index eefb38ea75aa..1728a6614be1 100644 --- a/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md +++ b/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md @@ -14,7 +14,7 @@ Added-in: 7.12.3 # NAME -CURLINFO_NUM_CONNECTS - get number of created connections +CURLINFO_NUM_CONNECTS - number of created connections # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_OS_ERRNO.md b/docs/libcurl/opts/CURLINFO_OS_ERRNO.md index 25ddd6221e06..b12a8ec8a52a 100644 --- a/docs/libcurl/opts/CURLINFO_OS_ERRNO.md +++ b/docs/libcurl/opts/CURLINFO_OS_ERRNO.md @@ -14,7 +14,7 @@ Added-in: 7.12.2 # NAME -CURLINFO_OS_ERRNO - get errno number from last connect failure +CURLINFO_OS_ERRNO - errno number from last connect failure # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md b/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md index e5f1b5002f4d..0f4dc19ceeb5 100644 --- a/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md @@ -16,7 +16,7 @@ Added-in: 8.10.0 # NAME -CURLINFO_POSTTRANSFER_TIME_T - get the time until the last byte is sent +CURLINFO_POSTTRANSFER_TIME_T - time to last byte sent # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md b/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md index 9442d19c0ab7..ef10c67fa89b 100644 --- a/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md +++ b/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md @@ -16,7 +16,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_PRETRANSFER_TIME - get the time until the file transfer start +CURLINFO_PRETRANSFER_TIME - time to transfer start # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md b/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md index 2147f2796984..4c5d6d91517e 100644 --- a/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md @@ -16,7 +16,7 @@ Added-in: 7.61.0 # NAME -CURLINFO_PRETRANSFER_TIME_T - get the time until the file transfer start +CURLINFO_PRETRANSFER_TIME_T - time to transfer start # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md b/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md index 1fdb130711e4..90bd5e400c47 100644 --- a/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md +++ b/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md @@ -17,7 +17,7 @@ Added-in: 7.19.0 # NAME -CURLINFO_PRIMARY_IP - get IP address of last connection +CURLINFO_PRIMARY_IP - IP address of last connection # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md b/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md index d0bb632f44dd..b98f246042da 100644 --- a/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md +++ b/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md @@ -16,7 +16,7 @@ Added-in: 7.21.0 # NAME -CURLINFO_PRIMARY_PORT - get the latest destination port number +CURLINFO_PRIMARY_PORT - last destination port number # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PRIVATE.md b/docs/libcurl/opts/CURLINFO_PRIVATE.md index 7d4aff10f7d3..b14ece5a1bef 100644 --- a/docs/libcurl/opts/CURLINFO_PRIVATE.md +++ b/docs/libcurl/opts/CURLINFO_PRIVATE.md @@ -15,7 +15,7 @@ Added-in: 7.10.3 # NAME -CURLINFO_PRIVATE - get the private pointer +CURLINFO_PRIVATE - private pointer # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PROTOCOL.md b/docs/libcurl/opts/CURLINFO_PROTOCOL.md index a472a3d80832..ef9ca6d54e9a 100644 --- a/docs/libcurl/opts/CURLINFO_PROTOCOL.md +++ b/docs/libcurl/opts/CURLINFO_PROTOCOL.md @@ -15,7 +15,7 @@ Added-in: 7.52.0 # NAME -CURLINFO_PROTOCOL - get the protocol used in the connection +CURLINFO_PROTOCOL - protocol used in the connection # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md b/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md index c30794f27886..fb980f30feca 100644 --- a/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md +++ b/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md @@ -15,7 +15,7 @@ Added-in: 7.10.8 # NAME -CURLINFO_PROXYAUTH_AVAIL - get available HTTP proxy authentication methods +CURLINFO_PROXYAUTH_AVAIL - HTTP proxy authentication methods # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md b/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md index c4a9c943afc5..92316f1a3eb8 100644 --- a/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md +++ b/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md @@ -15,7 +15,7 @@ Added-in: 8.12.0 # NAME -CURLINFO_PROXYAUTH_USED - get used HTTP proxy authentication method +CURLINFO_PROXYAUTH_USED - HTTP proxy authentication method # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md b/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md index 772fa7cb755d..bb833570c8ee 100644 --- a/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md +++ b/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md @@ -16,7 +16,7 @@ Added-in: 7.73.0 # NAME -CURLINFO_PROXY_ERROR - get the detailed (SOCKS) proxy error +CURLINFO_PROXY_ERROR - detailed (SOCKS) proxy error # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md b/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md index dd65c4214bf0..17dab0e32419 100644 --- a/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md +++ b/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md @@ -18,7 +18,7 @@ Added-in: 7.52.0 # NAME -CURLINFO_PROXY_SSL_VERIFYRESULT - get the result of the proxy certificate verification +CURLINFO_PROXY_SSL_VERIFYRESULT - result of proxy certificate verification # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md b/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md index 3f58cc09c4bd..586bf3db053c 100644 --- a/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md +++ b/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md @@ -16,7 +16,7 @@ Added-in: 7.9.7 # NAME -CURLINFO_REDIRECT_COUNT - get the number of redirects +CURLINFO_REDIRECT_COUNT - number of redirects # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md b/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md index f0b79e261feb..3922b86c7968 100644 --- a/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md +++ b/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md @@ -17,7 +17,7 @@ Added-in: 7.9.7 # NAME -CURLINFO_REDIRECT_TIME - get the time for all redirection steps +CURLINFO_REDIRECT_TIME - time for all redirection steps # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md b/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md index 88a0830d3726..a612cf04b6eb 100644 --- a/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md @@ -17,7 +17,7 @@ Added-in: 7.61.0 # NAME -CURLINFO_REDIRECT_TIME_T - get the time for all redirection steps +CURLINFO_REDIRECT_TIME_T - time for all redirection steps # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md b/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md index d1197e0b28ac..5e33a7115d4a 100644 --- a/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md +++ b/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md @@ -17,7 +17,7 @@ Added-in: 7.18.2 # NAME -CURLINFO_REDIRECT_URL - get the URL a redirect would go to +CURLINFO_REDIRECT_URL - URL a redirect would go to # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_REFERER.md b/docs/libcurl/opts/CURLINFO_REFERER.md index 17b9db1a18a3..07978f463ff9 100644 --- a/docs/libcurl/opts/CURLINFO_REFERER.md +++ b/docs/libcurl/opts/CURLINFO_REFERER.md @@ -16,7 +16,7 @@ Added-in: 7.76.0 # NAME -CURLINFO_REFERER - get the used referrer request header +CURLINFO_REFERER - used HTTP referrer request header # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md b/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md index fedefc0cc61e..6f68ce4fce60 100644 --- a/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md +++ b/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md @@ -16,7 +16,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_REQUEST_SIZE - get size of sent request +CURLINFO_REQUEST_SIZE - size of sent request # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md b/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md index db75eb94a096..f07fb8d90820 100644 --- a/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md +++ b/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md @@ -18,7 +18,7 @@ Added-in: 7.10.8 # NAME -CURLINFO_RESPONSE_CODE - get the last response code +CURLINFO_RESPONSE_CODE - last response code # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md b/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md index 0cfa84b34bcd..ef699e85535c 100644 --- a/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md +++ b/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md @@ -16,7 +16,7 @@ Added-in: 7.20.0 # NAME -CURLINFO_RTSP_CLIENT_CSEQ - get the next RTSP client CSeq +CURLINFO_RTSP_CLIENT_CSEQ - next RTSP client CSeq # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md b/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md index 9de26f0f76bf..d4fecaacf6fc 100644 --- a/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md +++ b/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md @@ -15,7 +15,7 @@ Added-in: 7.20.0 # NAME -CURLINFO_RTSP_CSEQ_RECV - get the recently received CSeq +CURLINFO_RTSP_CSEQ_RECV - last received RTSP CSeq # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md b/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md index 0f3c638f8f39..1a4a2a42731e 100644 --- a/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md +++ b/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md @@ -15,7 +15,7 @@ Added-in: 7.20.0 # NAME -CURLINFO_RTSP_SERVER_CSEQ - get the next RTSP server CSeq +CURLINFO_RTSP_SERVER_CSEQ - next RTSP server CSeq # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md b/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md index 121642677b78..2fbffbe697b0 100644 --- a/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md +++ b/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md @@ -15,7 +15,7 @@ Added-in: 7.20.0 # NAME -CURLINFO_RTSP_SESSION_ID - get RTSP session ID +CURLINFO_RTSP_SESSION_ID - RTSP session ID # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SCHEME.md b/docs/libcurl/opts/CURLINFO_SCHEME.md index 1c61849829af..661c8887a373 100644 --- a/docs/libcurl/opts/CURLINFO_SCHEME.md +++ b/docs/libcurl/opts/CURLINFO_SCHEME.md @@ -17,7 +17,7 @@ Added-in: 7.52.0 # NAME -CURLINFO_SCHEME - get the URL scheme (sometimes called protocol) used in the connection +CURLINFO_SCHEME - URL scheme used in transfer # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md index 30dc52b395fd..809abd3e770f 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md @@ -17,7 +17,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_SIZE_DOWNLOAD - get the number of downloaded bytes +CURLINFO_SIZE_DOWNLOAD - number of downloaded bytes # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md index 5d181b12e0f1..102177ae2264 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md @@ -17,7 +17,7 @@ Added-in: 7.55.0 # NAME -CURLINFO_SIZE_DOWNLOAD_T - get the number of downloaded bytes +CURLINFO_SIZE_DOWNLOAD_T - number of downloaded bytes # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md index 6e1881271a74..b018e00e2dd3 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md @@ -16,7 +16,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_SIZE_UPLOAD - get the number of uploaded bytes +CURLINFO_SIZE_UPLOAD - number of uploaded bytes # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md index 939d66887a33..ec35a0f974c2 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md @@ -16,7 +16,7 @@ Added-in: 7.55.0 # NAME -CURLINFO_SIZE_UPLOAD_T - get the number of uploaded bytes +CURLINFO_SIZE_UPLOAD_T - number of uploaded bytes # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md index 53169e03fb9e..8b3b7b32e7f5 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md @@ -16,7 +16,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_SPEED_DOWNLOAD - get download speed +CURLINFO_SPEED_DOWNLOAD - download speed # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md index 60d759f84454..50d6d324f99c 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md @@ -16,7 +16,7 @@ Added-in: 7.55.0 # NAME -CURLINFO_SPEED_DOWNLOAD_T - get download speed +CURLINFO_SPEED_DOWNLOAD_T - download speed # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md index a10b475b60bd..06778c1e2f34 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md @@ -15,7 +15,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_SPEED_UPLOAD - get upload speed +CURLINFO_SPEED_UPLOAD - upload speed # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md index 9f152131b21a..12b569186ca6 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md @@ -15,7 +15,7 @@ Added-in: 7.55.0 # NAME -CURLINFO_SPEED_UPLOAD_T - get upload speed +CURLINFO_SPEED_UPLOAD_T - upload speed # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md b/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md index 6c25f90161b1..6c4dd46cf666 100644 --- a/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md +++ b/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md @@ -17,7 +17,7 @@ Added-in: 7.12.3 # NAME -CURLINFO_SSL_ENGINES - get an slist of OpenSSL crypto-engines +CURLINFO_SSL_ENGINES - an slist of OpenSSL crypto-engines # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md b/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md index 15f9495d809f..c55a63e05e1c 100644 --- a/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md +++ b/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md @@ -18,7 +18,7 @@ Added-in: 7.5 # NAME -CURLINFO_SSL_VERIFYRESULT - get the result of the certificate verification +CURLINFO_SSL_VERIFYRESULT - result of the certificate verification # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md b/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md index 749930ce46fc..47fe77673f11 100644 --- a/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md +++ b/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md @@ -16,7 +16,7 @@ Added-in: 7.9.2 # NAME -CURLINFO_STARTTRANSFER_TIME - get the time until the first byte is received +CURLINFO_STARTTRANSFER_TIME - time to first byte received # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md b/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md index 2c0d0eac8c2e..a1d5c5642f3f 100644 --- a/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md @@ -16,7 +16,7 @@ Added-in: 7.61.0 # NAME -CURLINFO_STARTTRANSFER_TIME_T - get the time until the first byte is received +CURLINFO_STARTTRANSFER_TIME_T - time to first byte received # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_TLS_SESSION.md b/docs/libcurl/opts/CURLINFO_TLS_SESSION.md index f4209b45b6b0..18022ac2c615 100644 --- a/docs/libcurl/opts/CURLINFO_TLS_SESSION.md +++ b/docs/libcurl/opts/CURLINFO_TLS_SESSION.md @@ -18,7 +18,7 @@ Added-in: 7.34.0 # NAME -CURLINFO_TLS_SESSION - get TLS session info +CURLINFO_TLS_SESSION - TLS session info # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md b/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md index 2f87b1a9cdd6..e3514530f241 100644 --- a/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md +++ b/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md @@ -21,7 +21,7 @@ Added-in: 7.48.0 # NAME -CURLINFO_TLS_SESSION, CURLINFO_TLS_SSL_PTR - get TLS session info +CURLINFO_TLS_SSL_PTR - TLS session info # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md b/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md index 201c4e482349..60d383a45838 100644 --- a/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md +++ b/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md @@ -16,7 +16,7 @@ Added-in: 7.4.1 # NAME -CURLINFO_TOTAL_TIME - get total time of previous transfer +CURLINFO_TOTAL_TIME - total time of previous transfer # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md b/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md index 8ae305d5af0d..0302310b6610 100644 --- a/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md +++ b/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md @@ -15,7 +15,7 @@ Added-in: 7.61.0 --- # NAME -CURLINFO_TOTAL_TIME_T - get total time of previous transfer in microseconds +CURLINFO_TOTAL_TIME_T - total time of previous transfer # SYNOPSIS diff --git a/docs/libcurl/opts/CURLINFO_XFER_ID.md b/docs/libcurl/opts/CURLINFO_XFER_ID.md index a5f3dd01e761..7de560939917 100644 --- a/docs/libcurl/opts/CURLINFO_XFER_ID.md +++ b/docs/libcurl/opts/CURLINFO_XFER_ID.md @@ -15,7 +15,7 @@ Added-in: 8.2.0 # NAME -CURLINFO_XFER_ID - get the ID of a transfer +CURLINFO_XFER_ID - ID of the transfer # SYNOPSIS From a5c0dfc19f57da30afd6c3eaf7f44cb2c444e222 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Nov 2025 12:58:13 +0100 Subject: [PATCH 274/885] CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text That option is properly documented in its own page. Closes #19404 --- docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md b/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md index e3514530f241..e1c725727ca4 100644 --- a/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md +++ b/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md @@ -30,12 +30,6 @@ CURLINFO_TLS_SSL_PTR - TLS session info CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TLS_SSL_PTR, struct curl_tlssessioninfo **session); - -/* if you need compatibility with libcurl < 7.48.0 use - CURLINFO_TLS_SESSION instead: */ - -CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TLS_SESSION, - struct curl_tlssessioninfo **session); ~~~ # DESCRIPTION From d083f529e8eb9bd222093262fe0ef6e39778e2ef Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Nov 2025 17:09:31 +0100 Subject: [PATCH 275/885] CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" Not protocol. Not for connection. Closes #19403 --- docs/libcurl/opts/CURLINFO_PROTOCOL.md | 16 ++++++++-------- docs/libcurl/opts/CURLINFO_SCHEME.md | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/libcurl/opts/CURLINFO_PROTOCOL.md b/docs/libcurl/opts/CURLINFO_PROTOCOL.md index ef9ca6d54e9a..f254857ca7db 100644 --- a/docs/libcurl/opts/CURLINFO_PROTOCOL.md +++ b/docs/libcurl/opts/CURLINFO_PROTOCOL.md @@ -15,7 +15,7 @@ Added-in: 7.52.0 # NAME -CURLINFO_PROTOCOL - protocol used in the connection +CURLINFO_PROTOCOL - URL scheme used in transfer # SYNOPSIS @@ -27,12 +27,12 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROTOCOL, long *p); # DESCRIPTION -This option is deprecated. We strongly recommend using -CURLINFO_SCHEME(3) instead, because this option cannot return all -possible protocols. +This option is deprecated. We strongly recommend using CURLINFO_SCHEME(3) +instead, because this option cannot return all possible schemes. The scheme +might also sometimes be referred to as the protocol. -Pass a pointer to a long to receive the version used in the last http -connection. The returned value is set to one of these values: +Pass a pointer to a long to receive the scheme used in the last transfer. The +returned value is set to one of these values: ~~~c CURLPROTO_DICT, CURLPROTO_FILE, CURLPROTO_FTP, CURLPROTO_FTPS, @@ -57,8 +57,8 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); res = curl_easy_perform(curl); if(res == CURLE_OK) { - long protocol; - curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); + long scheme; + curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &scheme); } curl_easy_cleanup(curl); } diff --git a/docs/libcurl/opts/CURLINFO_SCHEME.md b/docs/libcurl/opts/CURLINFO_SCHEME.md index 661c8887a373..5d6288e11cb0 100644 --- a/docs/libcurl/opts/CURLINFO_SCHEME.md +++ b/docs/libcurl/opts/CURLINFO_SCHEME.md @@ -30,8 +30,9 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SCHEME, char **scheme); # DESCRIPTION Pass a pointer to a char pointer to receive the pointer to a null-terminated -string holding the URL scheme used for the most recent connection done with -this CURL **handle**. +string holding the URL scheme used for the most recent transfer done with this +CURL **handle**. The scheme might also sometimes be referred to as the +protocol. The **scheme** pointer is NULL or points to private memory. You **must not** free it. The memory gets freed automatically when you call From 64489bc3be7bcf69493143c1f1c221e12748e285 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Nov 2025 12:43:24 +0100 Subject: [PATCH 276/885] CURLOPT_READFUNCTION.md: clarify the size of the buffer No need to multiply with size as size is always 1 - and documented so. Closes #19402 --- docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md | 2 +- docs/libcurl/opts/CURLOPT_READFUNCTION.md | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md b/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md index 8e16b78d5552..060ebf5bddc3 100644 --- a/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md @@ -109,7 +109,7 @@ Nothing. static size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata) { - /* received header is 'nitems' bytes in 'buffer' NOT ZERO TERMINATED */ + /* received header is 'nitems' bytes in 'buffer' NOT NULL-TERMINATED */ /* 'userdata' is set with CURLOPT_HEADERDATA */ return nitems; } diff --git a/docs/libcurl/opts/CURLOPT_READFUNCTION.md b/docs/libcurl/opts/CURLOPT_READFUNCTION.md index 71ad2e9ca0fd..0046ded635c8 100644 --- a/docs/libcurl/opts/CURLOPT_READFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_READFUNCTION.md @@ -36,9 +36,8 @@ Pass a pointer to your callback function, as the prototype shows above. This callback function gets called by libcurl as soon as it needs to read data in order to send it to the peer - like if you ask it to upload or post data to -the server. The data area pointed at by the pointer *buffer* should be -filled up with at most *size* multiplied with *nitems* number of bytes -by your function. *size* is always 1. +the server. The data area pointed at by the pointer *buffer* should be filled +up with at most *nitems* number of bytes by your function. *size* is always 1. Set the *userdata* argument with the CURLOPT_READDATA(3) option. From 7e0d4dd4a86e11babfc91c8b7e0caefc7048832c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 8 Nov 2025 17:49:30 +0100 Subject: [PATCH 277/885] CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example --- docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md b/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md index 1e21b614f136..85801b8af799 100644 --- a/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md @@ -141,7 +141,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/home/user/known_hosts"); curl_easy_perform(curl); -} + } } ~~~ From 3752de465d70552106b2527fbf821aee525e53e2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 8 Nov 2025 18:23:32 +0100 Subject: [PATCH 278/885] pytest: skip H2 tests if feature missing from curl To allow running pytests on more curl configurations. Also delete a redundant H3 feature check from test_17_14_expired_cert. Cherry-picked from #19407 Closes #19412 --- tests/http/test_01_basic.py | 32 +++++++++++++++ tests/http/test_02_download.py | 70 ++++++++++++++++++++++++++++++++ tests/http/test_03_goaway.py | 2 + tests/http/test_04_stuttered.py | 8 ++++ tests/http/test_05_errors.py | 8 ++++ tests/http/test_07_upload.py | 68 +++++++++++++++++++++++++++++++ tests/http/test_08_caddy.py | 18 ++++++++ tests/http/test_09_push.py | 4 ++ tests/http/test_10_proxy.py | 24 +++++++++++ tests/http/test_13_proxy_auth.py | 4 ++ tests/http/test_14_auth.py | 12 ++++++ tests/http/test_16_info.py | 6 +++ tests/http/test_17_ssl_use.py | 26 +++++++++++- tests/http/test_18_methods.py | 4 ++ tests/http/test_19_shutdown.py | 4 ++ tests/http/test_40_socks.py | 6 +++ 16 files changed, 294 insertions(+), 2 deletions(-) diff --git a/tests/http/test_01_basic.py b/tests/http/test_01_basic.py index 692bb3d7b266..c786488c2e63 100644 --- a/tests/http/test_01_basic.py +++ b/tests/http/test_01_basic.py @@ -56,6 +56,8 @@ def test_01_02_https_get(self, env: Env, httpd): # simple https: GET, h2 wanted and got @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_03_h2_get(self, env: Env, httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2']) @@ -65,6 +67,8 @@ def test_01_03_h2_get(self, env: Env, httpd): # simple https: GET, h2 unsupported, fallback to h1 @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_04_h2_unsupported(self, env: Env, httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.domain2}:{env.https_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2']) @@ -84,6 +88,8 @@ def test_01_05_h3_get(self, env: Env, httpd, nghttpx): @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_01_06_timings(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -100,6 +106,8 @@ def test_01_06_timings(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_07_head(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -115,6 +123,8 @@ def test_01_07_head(self, env: Env, httpd, nghttpx, proto): # http: GET for HTTP/2, see Upgrade:, 101 switch def test_01_08_h2_upgrade(self, env: Env, httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2']) @@ -127,6 +137,8 @@ def test_01_08_h2_upgrade(self, env: Env, httpd): # http: GET for HTTP/2 with prior knowledge def test_01_09_h2_prior_knowledge(self, env: Env, httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2-prior-knowledge']) @@ -138,6 +150,8 @@ def test_01_09_h2_prior_knowledge(self, env: Env, httpd): # http: strip TE header in HTTP/2 requests def test_01_10_te_strip(self, env: Env, httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, "h2")}/data.json' r = curl.http_get(url=url, extra_args=['--http2', '-H', 'TE: gzip']) @@ -152,6 +166,8 @@ def test_01_10_te_strip(self, env: Env, httpd): # RSTing the stream correctly when its internal limits are exceeded. @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_01_11_large_resp_headers(self, env: Env, httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -167,6 +183,8 @@ def test_01_11_large_resp_headers(self, env: Env, httpd, proto): reason='httpd must be at least 2.4.64') @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_01_12_xlarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") httpd.set_extra_config('base', [ f'H2MaxHeaderBlockLen {130 * 1024}', ]) @@ -184,6 +202,8 @@ def test_01_12_xlarge_resp_headers(self, env: Env, httpd, configures_httpd, prot reason='httpd must be at least 2.4.64') @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_01_13_megalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") httpd.set_extra_config('base', [ 'LogLevel http2:trace2', f'H2MaxHeaderBlockLen {130 * 1024}', @@ -204,6 +224,8 @@ def test_01_13_megalarge_resp_headers(self, env: Env, httpd, configures_httpd, p reason='httpd must be at least 2.4.64') @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_01_14_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") httpd.set_extra_config('base', [ 'LogLevel http2:trace2', f'H2MaxHeaderBlockLen {1024 * 1024}', @@ -223,6 +245,8 @@ def test_01_14_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, p reason='httpd must be at least 2.4.64') @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_01_15_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") httpd.set_extra_config('base', [ 'LogLevel http2:trace2', f'H2MaxHeaderBlockLen {1024 * 1024}', @@ -240,6 +264,8 @@ def test_01_15_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, p # http: invalid request headers, GET, issue #16998 @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_01_16_inv_req_get(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -263,6 +289,8 @@ def test_01_16_inv_req_get(self, env: Env, httpd, nghttpx, proto): ]) def test_01_17_TE(self, env: Env, httpd, te_in, te_out): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo' r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True, @@ -277,6 +305,8 @@ def test_01_17_TE(self, env: Env, httpd, te_in, te_out): # check that an existing https: connection is not reused for http: def test_01_18_tls_reuse(self, env: Env, httpd): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url1 = f'https://{env.authority_for(env.domain1, proto)}/data.json' url2 = f'http://{env.authority_for(env.domain1, proto)}/data.json' @@ -287,6 +317,8 @@ def test_01_18_tls_reuse(self, env: Env, httpd): # check that an existing http: connection is not reused for https: def test_01_19_plain_reuse(self, env: Env, httpd): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url1 = f'http://{env.domain1}:{env.http_port}/data.json' url2 = f'https://{env.domain1}:{env.http_port}/data.json' diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 574401cb7297..d2d149f20fb9 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -55,6 +55,8 @@ def _class_scope(self, env, httpd): # download 1 file @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_01_download_1(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -65,6 +67,8 @@ def test_02_01_download_1(self, env: Env, httpd, nghttpx, proto): # download 2 files @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_02_download_2(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -75,6 +79,8 @@ def test_02_02_download_2(self, env: Env, httpd, nghttpx, proto): # download 100 files sequentially @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_03_download_sequential(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if (proto == 'http/1.1' or proto == 'h2') and env.curl_uses_lib('mbedtls') and \ @@ -89,6 +95,8 @@ def test_02_03_download_sequential(self, env: Env, httpd, nghttpx, proto): # download 100 files parallel @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_04_download_parallel(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h2' and env.curl_uses_lib('mbedtls') and \ @@ -112,6 +120,8 @@ def test_02_04_download_parallel(self, env: Env, httpd, nghttpx, proto): # download 500 files sequential @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_05_download_many_sequential(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h2' and env.curl_uses_lib('mbedtls') and \ @@ -132,6 +142,8 @@ def test_02_05_download_many_sequential(self, env: Env, httpd, nghttpx, proto): # download 500 files parallel @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_06_download_many_parallel(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h2' and env.curl_uses_lib('mbedtls') and \ @@ -149,6 +161,8 @@ def test_02_06_download_many_parallel(self, env: Env, httpd, nghttpx, proto): # download files parallel, check connection reuse/multiplex @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_07_download_reuse(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 200 @@ -180,6 +194,8 @@ def test_02_07b_download_reuse(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_08_1MB_serial(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 5 @@ -190,6 +206,8 @@ def test_02_08_1MB_serial(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_09_1MB_parallel(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 5 @@ -204,6 +222,8 @@ def test_02_09_1MB_parallel(self, env: Env, httpd, nghttpx, proto): @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_10_10MB_serial(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 3 @@ -216,6 +236,8 @@ def test_02_10_10MB_serial(self, env: Env, httpd, nghttpx, proto): @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_11_10MB_parallel(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 3 @@ -228,6 +250,8 @@ def test_02_11_10MB_parallel(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_12_head_serial_https(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 5 @@ -240,6 +264,8 @@ def test_02_12_head_serial_https(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['h2']) def test_02_13_head_serial_h2c(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 5 @@ -252,6 +278,8 @@ def test_02_13_head_serial_h2c(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_14_not_found(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 5 @@ -266,6 +294,8 @@ def test_02_14_not_found(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_15_fail_not_found(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 5 @@ -280,6 +310,8 @@ def test_02_15_fail_not_found(self, env: Env, httpd, nghttpx, proto): @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") def test_02_20_h2_small_frames(self, env: Env, httpd, configures_httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") # Test case to reproduce content corruption as observed in # https://github.com/curl/curl/issues/10525 # To reliably reproduce, we need an Apache httpd that supports @@ -328,6 +360,8 @@ def test_02_21_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset): @pytest.mark.parametrize("swin_max", [0, 10*1024]) def test_02_21_h2_lib_serial(self, env: Env, httpd, pause_offset, swin_max): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") count = 2 docname = 'data-10m' url = f'https://localhost:{env.https_port}/{docname}' @@ -349,6 +383,8 @@ def test_02_21_h2_lib_serial(self, env: Env, httpd, pause_offset, swin_max): @pytest.mark.parametrize("pause_offset", [100*1023]) @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_offset): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -369,6 +405,8 @@ def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_ # download, several at a time, pause and abort paused @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_23a_lib_abort_paused(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -398,6 +436,8 @@ def test_02_23a_lib_abort_paused(self, env: Env, httpd, nghttpx, proto): # download, several at a time, abort after n bytes @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_23b_lib_abort_offset(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -427,6 +467,8 @@ def test_02_23b_lib_abort_offset(self, env: Env, httpd, nghttpx, proto): # download, several at a time, abort after n bytes @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_23c_lib_fail_offset(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -456,6 +498,8 @@ def test_02_23c_lib_fail_offset(self, env: Env, httpd, nghttpx, proto): # speed limited download @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_24_speed_limit(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -485,6 +529,8 @@ def test_02_25_h2_upgrade_x(self, env: Env, httpd): # TODO: just uses a single connection for h2/h3. Not sure how to prevent that @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_26_session_shared_reuse(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}/data-100k' @@ -497,6 +543,8 @@ def test_02_26_session_shared_reuse(self, env: Env, proto, httpd, nghttpx): # test on paused transfers, based on issue #11982 @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_27a_paused_no_cl(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}' \ @@ -508,6 +556,8 @@ def test_02_27a_paused_no_cl(self, env: Env, httpd, nghttpx, proto): # test on paused transfers, based on issue #11982 @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_27b_paused_no_cl(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}' \ @@ -519,6 +569,8 @@ def test_02_27b_paused_no_cl(self, env: Env, httpd, nghttpx, proto): # test on paused transfers, based on issue #11982 @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_27c_paused_no_cl(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}' \ @@ -529,6 +581,8 @@ def test_02_27c_paused_no_cl(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, proto): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -557,6 +611,8 @@ def check_downloads(self, client, srcfile: str, count: int, @pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000]) @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -574,6 +630,8 @@ def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset # download parallel with prior knowledge def test_02_30_parallel_prior_knowledge(self, env: Env, httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") count = 3 curl = CurlClient(env=env) urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' @@ -585,6 +643,8 @@ def test_02_30_parallel_prior_knowledge(self, env: Env, httpd): # download parallel with h2 "Upgrade:" def test_02_31_parallel_upgrade(self, env: Env, httpd, nghttpx): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") count = 3 curl = CurlClient(env=env) urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' @@ -605,6 +665,8 @@ def test_02_31_parallel_upgrade(self, env: Env, httpd, nghttpx): def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and \ (not env.have_h3() or not env.curl_can_h3_early_data()): pytest.skip("h3 not supported") @@ -661,6 +723,8 @@ def test_02_33_max_host_conns(self, env: Env, httpd, nghttpx, proto, max_host_co pytest.skip('only works for curl debug builds') if not env.curl_is_verbose(): pytest.skip('only works for curl with verbose strings') + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 50 @@ -701,6 +765,8 @@ def test_02_34_max_total_conns(self, env: Env, httpd, nghttpx, proto, max_total_ pytest.skip('only works for curl debug builds') if not env.curl_is_verbose(): pytest.skip('only works for curl with verbose strings') + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 50 @@ -746,6 +812,8 @@ def test_02_34_max_total_conns(self, env: Env, httpd, nghttpx, proto, max_total_ # to be received, requiring buffering. @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_35_pause_bomb(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -765,6 +833,8 @@ def test_02_35_pause_bomb(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) @pytest.mark.parametrize("url_junk", [1024, 16*1024, 32*1024, 64*1024, 80*1024, 96*1024]) def test_02_36_looong_urls(self, env: Env, httpd, nghttpx, proto, url_junk): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('quiche'): diff --git a/tests/http/test_03_goaway.py b/tests/http/test_03_goaway.py index 2688210a8432..8acaa9dc659c 100644 --- a/tests/http/test_03_goaway.py +++ b/tests/http/test_03_goaway.py @@ -41,6 +41,8 @@ class TestGoAway: # download files sequentially with delay, reload server for GOAWAY def test_03_01_h2_goaway(self, env: Env, httpd, nghttpx): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") count = 3 self.r = None diff --git a/tests/http/test_04_stuttered.py b/tests/http/test_04_stuttered.py index 3ba5c6169c3f..bd2c5e1f77c3 100644 --- a/tests/http/test_04_stuttered.py +++ b/tests/http/test_04_stuttered.py @@ -41,6 +41,8 @@ class TestStuttered: # download 1 file, check that delayed response works in general @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_04_01_download_1(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -56,6 +58,8 @@ def test_04_01_download_1(self, env: Env, httpd, nghttpx, proto): # (Apache2 increases # of parallel processed requests after successes) @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_04_02_100_100_10(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 50 @@ -78,6 +82,8 @@ def test_04_02_100_100_10(self, env: Env, httpd, nghttpx, proto): # (Apache2 increases # of parallel processed requests after successes) @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_04_03_1000_10_1(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 50 @@ -100,6 +106,8 @@ def test_04_03_1000_10_1(self, env: Env, httpd, nghttpx, proto): # (Apache2 increases # of parallel processed requests after successes) @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_04_04_1000_10_1(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 50 diff --git a/tests/http/test_05_errors.py b/tests/http/test_05_errors.py index d24879b3acce..8d8ea707bbce 100644 --- a/tests/http/test_05_errors.py +++ b/tests/http/test_05_errors.py @@ -40,6 +40,8 @@ class TestErrors: # download 1 file, check that we get CURLE_PARTIAL_FILE @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_05_01_partial_1(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -60,6 +62,8 @@ def test_05_01_partial_1(self, env: Env, httpd, nghttpx, proto): # download files, check that we get CURLE_PARTIAL_FILE for all @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -82,6 +86,8 @@ def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): # access a resource that, on h2, RST the stream with HTTP_1_1_REQUIRED def test_05_03_required(self, env: Env, httpd, nghttpx): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) proto = 'http/1.1' urln = f'https://{env.authority_for(env.domain1, proto)}/curltest/1_1' @@ -107,6 +113,8 @@ def test_05_03_required(self, env: Env, httpd, nghttpx): # and not see the "unclean" close either @pytest.mark.parametrize("proto", ['http/1.0', 'http/1.1', 'h2']) def test_05_04_unclean_tls_shutdown(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 10 if proto == 'h2' else 1 diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index fa2ef272d7c6..ad2db48a8c9c 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -53,6 +53,8 @@ def _class_scope(self, env, httpd, nghttpx): # upload small data, check that this is what was echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_01_upload_1_small(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") data = '0123456789' @@ -66,6 +68,8 @@ def test_07_01_upload_1_small(self, env: Env, httpd, nghttpx, proto): # upload large data, check that this is what was echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_02_upload_1_large(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') @@ -80,6 +84,8 @@ def test_07_02_upload_1_large(self, env: Env, httpd, nghttpx, proto): # upload data sequentially, check that they were echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_10_upload_sequential(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 20 @@ -95,6 +101,8 @@ def test_07_10_upload_sequential(self, env: Env, httpd, nghttpx, proto): # upload data parallel, check that they were echoed @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_07_11_upload_parallel(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") # limit since we use a separate connection in h1 @@ -112,6 +120,8 @@ def test_07_11_upload_parallel(self, env: Env, httpd, nghttpx, proto): # upload large data sequentially, check that this is what was echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_12_upload_seq_large(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') @@ -129,6 +139,8 @@ def test_07_12_upload_seq_large(self, env: Env, httpd, nghttpx, proto): # upload very large data sequentially, check that this is what was echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_13_upload_seq_large(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') @@ -148,6 +160,8 @@ def test_07_13_upload_seq_large(self, env: Env, httpd, nghttpx, proto): '', '1', '123\n456andsomething\n\n' ]) def test_07_14_upload_stdin(self, env: Env, httpd, nghttpx, proto, indata): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -161,6 +175,8 @@ def test_07_14_upload_stdin(self, env: Env, httpd, nghttpx, proto, indata): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -177,6 +193,8 @@ def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -193,6 +211,8 @@ def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -210,6 +230,8 @@ def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto): # upload data parallel, check that they were echoed @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_07_20_upload_parallel(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") # limit since we use a separate connection in h1 @@ -227,6 +249,8 @@ def test_07_20_upload_parallel(self, env: Env, httpd, nghttpx, proto): # upload large data parallel, check that this is what was echoed @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_07_21_upload_parallel_large(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') @@ -242,6 +266,8 @@ def test_07_21_upload_parallel_large(self, env: Env, httpd, nghttpx, proto): # upload large data parallel to a URL that denies uploads @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_07_22_upload_parallel_fail(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') @@ -258,6 +284,8 @@ def test_07_22_upload_parallel_fail(self, env: Env, httpd, nghttpx, proto): # PUT 100k @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_30_put_100k(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') @@ -276,6 +304,8 @@ def test_07_30_put_100k(self, env: Env, httpd, nghttpx, proto): # PUT 10m @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_31_put_10m(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') @@ -294,6 +324,8 @@ def test_07_31_put_10m(self, env: Env, httpd, nghttpx, proto): # issue #10591 @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_32_issue_10591(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') @@ -307,6 +339,8 @@ def test_07_32_issue_10591(self, env: Env, httpd, nghttpx, proto): # correctly and not time out on sending def test_07_33_issue_11157a(self, env: Env, httpd, nghttpx): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') # send a POST to our PUT handler which will send immediately a 404 back url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put' @@ -328,6 +362,8 @@ def test_07_33_issue_11157a(self, env: Env, httpd, nghttpx): # issue #11157, send upload that is slowly read in def test_07_33_issue_11157b(self, env: Env, httpd, nghttpx): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') # tell our test PUT handler to read the upload more slowly, so # that the send buffering and transfer loop needs to wait @@ -350,6 +386,8 @@ def test_07_33_issue_11157b(self, env: Env, httpd, nghttpx): def test_07_34_issue_11194(self, env: Env, httpd, nghttpx): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") # tell our test PUT handler to read the upload more slowly, so # that the send buffering and transfer loop needs to wait fdata = os.path.join(env.gen_dir, 'data-100k') @@ -369,6 +407,8 @@ def test_07_34_issue_11194(self, env: Env, httpd, nghttpx): # upload large data on a h1 to h2 upgrade def test_07_35_h1_h2_upgrade_upload(self, env: Env, httpd, nghttpx): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/curltest/echo?id=[0-0]' @@ -386,6 +426,8 @@ def test_07_35_h1_h2_upgrade_upload(self, env: Env, httpd, nghttpx): @pytest.mark.parametrize("redir", ['301', '302', '303']) @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_36_upload_30x(self, env: Env, httpd, nghttpx, redir, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -403,6 +445,8 @@ def test_07_36_upload_30x(self, env: Env, httpd, nghttpx, redir, proto): # upload to a 307 response @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_37_upload_307(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -420,6 +464,8 @@ def test_07_37_upload_307(self, env: Env, httpd, nghttpx, proto): # POST form data, yet another code path in transfer @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_38_form_small(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -432,6 +478,8 @@ def test_07_38_form_small(self, env: Env, httpd, nghttpx, proto): # POST data urlencoded, small enough to be sent with request headers @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_39_post_urlenc_small(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-63k') @@ -448,6 +496,8 @@ def test_07_39_post_urlenc_small(self, env: Env, httpd, nghttpx, proto): # POST data urlencoded, large enough to be sent separate from request headers @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_40_post_urlenc_large(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-64k') @@ -468,6 +518,8 @@ def test_07_40_post_urlenc_large(self, env: Env, httpd, nghttpx, proto): # of the time @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_41_post_urlenc_small(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('quiche'): @@ -501,6 +553,8 @@ def check_download(self, r: ExecResult, count: int, srcfile: Union[str, os.PathL # issues #11769 #13260 @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_42a_upload_disconnect(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") client = LocalClient(name='cli_upload_pausing', env=env, timeout=60) @@ -521,6 +575,8 @@ def test_07_42a_upload_disconnect(self, env: Env, httpd, nghttpx, proto): # upload data, pause, let connection die without any response at all @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_42b_upload_disconnect(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") client = LocalClient(name='cli_upload_pausing', env=env, timeout=60) @@ -536,6 +592,8 @@ def test_07_42b_upload_disconnect(self, env: Env, httpd, nghttpx, proto): # upload data, pause, let connection die after 100 continue @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_42c_upload_disconnect(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") client = LocalClient(name='cli_upload_pausing', env=env, timeout=60) @@ -550,6 +608,8 @@ def test_07_42c_upload_disconnect(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_43_upload_denied(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -567,6 +627,8 @@ def test_07_43_upload_denied(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) @pytest.mark.parametrize("httpcode", [301, 302, 307, 308]) def test_07_44_put_redir(self, env: Env, httpd, nghttpx, proto, httpcode): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -591,6 +653,8 @@ def test_07_44_put_redir(self, env: Env, httpd, nghttpx, proto, httpcode): # speed limited on put handler @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_50_put_speed_limit(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -611,6 +675,8 @@ def test_07_50_put_speed_limit(self, env: Env, httpd, nghttpx, proto): # speed limited on echo handler @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_07_51_echo_speed_limit(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -707,6 +773,8 @@ def test_07_63_upload_exp100_paused(self, env: Env, httpd, nghttpx, proto): def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early): if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and \ (not env.have_h3() or not env.curl_can_h3_early_data()): pytest.skip("h3 not supported") diff --git a/tests/http/test_08_caddy.py b/tests/http/test_08_caddy.py index 319ffeb96268..afacee5917ee 100644 --- a/tests/http/test_08_caddy.py +++ b/tests/http/test_08_caddy.py @@ -70,6 +70,8 @@ def _class_scope(self, env, caddy): # download 1 file @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_01_download_1(self, env: Env, caddy: Caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") curl = CurlClient(env=env) @@ -80,6 +82,8 @@ def test_08_01_download_1(self, env: Env, caddy: Caddy, proto): # download 1MB files sequentially @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_02_download_1mb_sequential(self, env: Env, caddy: Caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") count = 50 @@ -91,6 +95,8 @@ def test_08_02_download_1mb_sequential(self, env: Env, caddy: Caddy, proto): # download 1MB files parallel @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_03_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") count = 20 @@ -110,6 +116,8 @@ def test_08_03_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") count = 40 @@ -122,6 +130,8 @@ def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") count = 20 @@ -134,6 +144,8 @@ def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3_curl(): pytest.skip("h3 not supported in curl") if proto == 'http/1.1' and env.curl_uses_lib('mbedtls'): @@ -155,6 +167,8 @@ def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): # post data parallel, check that they were echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_06_post_parallel(self, env: Env, httpd, caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") # limit since we use a separate connection in h1 @@ -172,6 +186,8 @@ def test_08_06_post_parallel(self, env: Env, httpd, caddy, proto): # put large file, check that they length were echoed @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_07_put_large(self, env: Env, httpd, caddy, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") # limit since we use a separate connection in h1< @@ -190,6 +206,8 @@ def test_08_07_put_large(self, env: Env, httpd, caddy, proto): def test_08_08_earlydata(self, env: Env, httpd, caddy, proto): if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and \ (not env.have_h3() or not env.curl_can_h3_early_data()): pytest.skip("h3 not supported") diff --git a/tests/http/test_09_push.py b/tests/http/test_09_push.py index d149fabb304d..ea73bbc7e5f2 100644 --- a/tests/http/test_09_push.py +++ b/tests/http/test_09_push.py @@ -61,6 +61,8 @@ def httpd_configure(self, env, httpd): # download a file that triggers a "103 Early Hints" response def test_09_01_h2_early_hints(self, env: Env, httpd, configures_httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") self.httpd_configure(env, httpd) curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/push/data1' @@ -73,6 +75,8 @@ def test_09_01_h2_early_hints(self, env: Env, httpd, configures_httpd): assert r.responses[0]['header']['link'] == '; rel=preload', f'{r.responses[0]}' def test_09_02_h2_push(self, env: Env, httpd, configures_httpd): + if not env.have_h2_curl(): + pytest.skip("h2 not supported") self.httpd_configure(env, httpd) # use localhost as we do not have resolve support in local client url = f'https://localhost:{env.https_port}/push/data1' diff --git a/tests/http/test_10_proxy.py b/tests/http/test_10_proxy.py index 592acbd60c9b..aa4e43a38034 100644 --- a/tests/http/test_10_proxy.py +++ b/tests/http/test_10_proxy.py @@ -73,6 +73,8 @@ def test_10_01_proxy_http(self, env: Env, httpd): reason='curl lacks HTTPS-proxy support') @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_10_02_proxys_down(self, env: Env, httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -95,6 +97,8 @@ def test_10_02_proxys_down(self, env: Env, httpd, proto): reason="no nghttpx available") def test_10_02_proxys_up(self, env: Env, httpd, nghttpx, proto, fname, fcount): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') count = fcount @@ -136,6 +140,8 @@ def test_10_04_proxy_https(self, env: Env, httpd, nghttpx_fwd): @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_10_05_proxytunnel_http(self, env: Env, httpd, nghttpx_fwd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://localhost:{env.https_port}/data.json' xargs = curl.get_proxy_args(proxys=False, tunnel=True) @@ -153,6 +159,8 @@ def test_10_05_proxytunnel_http(self, env: Env, httpd, nghttpx_fwd, proto): @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_06_proxytunnel_https(self, env: Env, httpd, nghttpx_fwd, proto, tunnel): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -181,6 +189,8 @@ def test_10_06_proxytunnel_https(self, env: Env, httpd, nghttpx_fwd, proto, tunn @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") def test_10_07_pts_down_small(self, env: Env, httpd, nghttpx_fwd, proto, tunnel, fname, fcount): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ @@ -215,6 +225,8 @@ def test_10_07_pts_down_small(self, env: Env, httpd, nghttpx_fwd, proto, @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") def test_10_08_upload_seq_large(self, env: Env, httpd, nghttpx, proto, tunnel, fname, fcount): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ @@ -241,6 +253,8 @@ def test_10_08_upload_seq_large(self, env: Env, httpd, nghttpx, proto, @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_09_reuse_server(self, env: Env, httpd, nghttpx_fwd, tunnel): + if tunnel == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -266,6 +280,8 @@ def test_10_09_reuse_server(self, env: Env, httpd, nghttpx_fwd, tunnel): @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel): # url twice via https: proxy separated with '--next', will reuse + if tunnel == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ @@ -295,6 +311,8 @@ def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel): @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_11_noreuse_proxy_https(self, env: Env, httpd, nghttpx_fwd, tunnel): # different --proxy-tls13-ciphers, no reuse of connection for https: + if tunnel == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') @@ -322,6 +340,8 @@ def test_10_11_noreuse_proxy_https(self, env: Env, httpd, nghttpx_fwd, tunnel): @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_12_noreuse_proxy_http(self, env: Env, httpd, nghttpx_fwd, tunnel): # different --proxy-tls13-ciphers, no reuse of connection for http: + if tunnel == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -349,6 +369,8 @@ def test_10_12_noreuse_proxy_http(self, env: Env, httpd, nghttpx_fwd, tunnel): @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_13_noreuse_https(self, env: Env, httpd, nghttpx_fwd, tunnel): # different --tls13-ciphers on https: same proxy config + if tunnel == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -373,6 +395,8 @@ def test_10_13_noreuse_https(self, env: Env, httpd, nghttpx_fwd, tunnel): reason='curl lacks HTTPS-proxy support') @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_10_14_proxys_ip_addr(self, env: Env, httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) diff --git a/tests/http/test_13_proxy_auth.py b/tests/http/test_13_proxy_auth.py index 1f7c41e2dd5c..6576bdba1aab 100644 --- a/tests/http/test_13_proxy_auth.py +++ b/tests/http/test_13_proxy_auth.py @@ -124,6 +124,8 @@ def test_13_06_tunnel_http_auth(self, env: Env, httpd, configures_httpd): @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) def test_13_07_tunnels_no_auth(self, env: Env, httpd, configures_httpd, nghttpx_fwd, proto, tunnel): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") self.httpd_configure(env, httpd) if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') @@ -144,6 +146,8 @@ def test_13_07_tunnels_no_auth(self, env: Env, httpd, configures_httpd, nghttpx_ @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) def test_13_08_tunnels_auth(self, env: Env, httpd, configures_httpd, nghttpx_fwd, proto, tunnel): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") self.httpd_configure(env, httpd) if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') diff --git a/tests/http/test_14_auth.py b/tests/http/test_14_auth.py index 944cb56fc2ef..3e15b224473d 100644 --- a/tests/http/test_14_auth.py +++ b/tests/http/test_14_auth.py @@ -43,6 +43,8 @@ def _class_scope(self, env, httpd, nghttpx): # download 1 file, not authenticated @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_14_01_digest_get_noauth(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -55,6 +57,8 @@ def test_14_01_digest_get_noauth(self, env: Env, httpd, nghttpx, proto): def test_14_02_digest_get_auth(self, env: Env, httpd, nghttpx, proto): if not env.curl_has_feature('digest'): pytest.skip("curl built without digest") + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -69,6 +73,8 @@ def test_14_02_digest_get_auth(self, env: Env, httpd, nghttpx, proto): def test_14_03_digest_put_auth(self, env: Env, httpd, nghttpx, proto): if not env.curl_has_feature('digest'): pytest.skip("curl built without digest") + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): @@ -86,6 +92,8 @@ def test_14_03_digest_put_auth(self, env: Env, httpd, nghttpx, proto): def test_14_04_digest_large_pw(self, env: Env, httpd, nghttpx, proto): if not env.curl_has_feature('digest'): pytest.skip("curl built without digest") + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") data='0123456789' @@ -103,6 +111,8 @@ def test_14_04_digest_large_pw(self, env: Env, httpd, nghttpx, proto): # PUT data, basic auth large pw @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and not env.curl_uses_lib('ngtcp2'): @@ -123,6 +133,8 @@ def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto): # PUT data, basic auth with very large pw @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_14_06_basic_very_large_pw(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('quiche'): diff --git a/tests/http/test_16_info.py b/tests/http/test_16_info.py index 53e335e950ac..017f7998812c 100644 --- a/tests/http/test_16_info.py +++ b/tests/http/test_16_info.py @@ -47,6 +47,8 @@ def _class_scope(self, env, httpd): # download plain file @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_16_01_info_download(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -62,6 +64,8 @@ def test_16_01_info_download(self, env: Env, httpd, nghttpx, proto): # download plain file with a 302 redirect @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_16_02_info_302_download(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 @@ -78,6 +82,8 @@ def test_16_02_info_302_download(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_16_03_info_upload(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 2 diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index 615658f06c01..49a20c6994f4 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -118,6 +118,8 @@ def test_17_02_sslinfo_reconnect(self, env: Env, tls_max, httpd): # use host name with trailing dot, verify handshake @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -133,6 +135,8 @@ def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx): # use host name with double trailing dot, verify handshake @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -157,6 +161,8 @@ def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx): def test_17_05_good_ip_addr(self, env: Env, proto, httpd, nghttpx): if env.curl_uses_lib('mbedtls'): pytest.skip("mbedTLS does use IP addresses in SNI") + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -174,6 +180,8 @@ def test_17_05_good_ip_addr(self, env: Env, proto, httpd, nghttpx): def test_17_05_bad_ip_addr(self, env: Env, proto, httpd, configures_httpd, nghttpx, configures_nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") httpd.set_domain1_cred_name('domain1-no-ip') @@ -191,6 +199,8 @@ def test_17_05_bad_ip_addr(self, env: Env, proto, def test_17_05_very_bad_ip_addr(self, env: Env, proto, httpd, configures_httpd, nghttpx, configures_nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if env.curl_uses_lib('mbedtls'): @@ -211,6 +221,8 @@ def test_17_05_very_bad_ip_addr(self, env: Env, proto, # use localhost for connect @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_06_localhost(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -300,6 +312,8 @@ def test_17_07_ssl_ciphers(self, env: Env, httpd, configures_httpd, @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_08_cert_status(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if not env.curl_uses_lib('openssl') and \ @@ -421,6 +435,8 @@ def test_17_10_h3_session_reuse(self, env: Env, httpd, nghttpx): # use host name server has no certificate for @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -432,6 +448,8 @@ def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx): # use host name server has no cert for with --insecure @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) @@ -446,8 +464,8 @@ def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx): # connect to an expired certificate @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_17_14_expired_cert(self, env: Env, proto, httpd): - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.expired_domain}:{env.port_for(proto)}/' r = curl.http_get(url=url, alpn_proto=proto) @@ -572,6 +590,8 @@ def test_17_18_gnutls_priority(self, env: Env, httpd, configures_httpd, priority @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_19_wrong_pin(self, env: Env, proto, httpd): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if env.curl_uses_lib('rustls-ffi'): @@ -586,6 +606,8 @@ def test_17_19_wrong_pin(self, env: Env, proto, httpd): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_17_20_correct_pin(self, env: Env, proto, httpd): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env) diff --git a/tests/http/test_18_methods.py b/tests/http/test_18_methods.py index afca5867ec98..10f4867c15f5 100644 --- a/tests/http/test_18_methods.py +++ b/tests/http/test_18_methods.py @@ -45,6 +45,8 @@ def _class_scope(self, env, httpd, nghttpx): # download 1 file @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_18_01_delete(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") count = 1 @@ -59,6 +61,8 @@ def test_18_01_delete(self, env: Env, httpd, nghttpx, proto): # should be accepted def test_18_02_delete_h2_special(self, env: Env, httpd, nghttpx): proto = 'h2' + if not env.have_h2_curl(): + pytest.skip("h2 not supported") count = 1 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak?id=[0-{count-1}]'\ diff --git a/tests/http/test_19_shutdown.py b/tests/http/test_19_shutdown.py index a0167549fd43..7bbc035f28c8 100644 --- a/tests/http/test_19_shutdown.py +++ b/tests/http/test_19_shutdown.py @@ -68,6 +68,8 @@ def test_19_01_check_tcp_rst(self, env: Env, httpd, proto): @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_19_02_check_shutdown(self, env: Env, httpd, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if not env.curl_is_debug(): pytest.skip('only works for curl debug builds') run_env = os.environ.copy() @@ -164,6 +166,8 @@ def test_19_05_event_shutdown_by_server(self, env: Env, httpd, proto): # check graceful shutdown on multiplexed http @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_19_06_check_shutdown(self, env: Env, httpd, nghttpx, proto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if not env.curl_is_debug(): diff --git a/tests/http/test_40_socks.py b/tests/http/test_40_socks.py index 6b43f878a694..2dd61cc2eca4 100644 --- a/tests/http/test_40_socks.py +++ b/tests/http/test_40_socks.py @@ -63,6 +63,8 @@ def test_40_01_socks_http(self, env: Env, sproto, danted: Dante, httpd): @pytest.mark.parametrize("sproto", ['socks4', 'socks5']) @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_40_02_socks_https(self, env: Env, sproto, proto, danted: Dante, httpd): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") curl = CurlClient(env=env, socks_args=[ @@ -78,6 +80,8 @@ def test_40_02_socks_https(self, env: Env, sproto, proto, danted: Dante, httpd): @pytest.mark.parametrize("sproto", ['socks4', 'socks5']) @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_40_03_dl_serial(self, env: Env, httpd, danted, proto, sproto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") count = 3 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env, socks_args=[ @@ -89,6 +93,8 @@ def test_40_03_dl_serial(self, env: Env, httpd, danted, proto, sproto): @pytest.mark.parametrize("sproto", ['socks4', 'socks5']) @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) def test_40_04_ul_serial(self, env: Env, httpd, danted, proto, sproto): + if proto == 'h2' and not env.have_h2_curl(): + pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') count = 2 curl = CurlClient(env=env, socks_args=[ From c2624818739916652a041164939afaba5bb5ee73 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 8 Nov 2025 13:54:11 +0100 Subject: [PATCH 279/885] GHA/linux: build and test LibreSSL with Fil-C curl, enable pytests Build and cache LibreSSL locally with Fil-C and enable it in the Fil-C job. Also: - disable test 776 in the Fil-C job. It fails consistently, and due to flakiness seen earlier its result is disabled. In this job it seems to be adding 1 to 9 minues to the test run step and fails consistently. - include Fil-C version in the LibreSSL cache key to prepare for Fil-C ABI changes. - GHA/linux: fully quote `tflags` values to avoid breaking YAML. Tested and confirmed working with OpenSSL too, but ended up with LibreSSL for faster, smaller builds. Closes #19407 --- .github/workflows/linux.yml | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ccf171d932c2..a24681a307c6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -193,13 +193,13 @@ jobs: - name: 'openssl torture !FTP' install_packages: libnghttp2-dev libssh2-1-dev libc-ares-dev generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON - tflags: -t --shallow=25 !FTP + tflags: '-t --shallow=25 !FTP' torture: true - name: 'openssl torture FTP' install_packages: libnghttp2-dev libssh2-1-dev libc-ares-dev generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON - tflags: -t --shallow=20 FTP + tflags: '-t --shallow=20 FTP' torture: true - name: 'openssl i686' @@ -215,12 +215,13 @@ jobs: - name: '!ssl !http !smtp !imap' configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity - - name: 'Fil-C' - install_steps: filc + - name: 'libressl Fil-C' + install_steps: filc libressl-filc pytest + tflags: '!776' # adds 1-9 minutes to the test run step, and fails consistently CC: /home/runner/filc/build/bin/filcc generate: >- -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_UNITY_BUILD=OFF - -DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF + -DOPENSSL_ROOT_DIR=/home/runner/libressl -DCURL_USE_LIBPSL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DUSE_NGHTTP2=OFF -DCURL_DISABLE_LDAP=ON -DUSE_LIBIDN2=OFF -DCURL_USE_LIBSSH2=OFF @@ -303,12 +304,12 @@ jobs: - name: 'event-based' install_packages: libssh-dev configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl - tflags: -n --test-event '!TLS-SRP' + tflags: '-n --test-event !TLS-SRP' - name: 'duphandle' install_packages: libssh-dev configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl - tflags: -n --test-duphandle '!TLS-SRP' + tflags: '-n --test-duphandle !TLS-SRP' - name: 'rustls valgrind' install_packages: libnghttp2-dev libldap-dev valgrind @@ -413,6 +414,27 @@ jobs: cmake --build . cmake --install . + - name: 'cache libressl (filc)' + if: ${{ contains(matrix.build.install_steps, 'libressl-filc') }} + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: cache-libressl-filc + env: + cache-name: cache-libressl-filc + with: + path: ~/libressl + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}-${{ env.FIL_C_VERSION }} + + - name: 'build libressl (filc)' + if: ${{ contains(matrix.build.install_steps, 'libressl-filc') && steps.cache-libressl-filc.outputs.cache-hit != 'true' }} + run: | + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ + --location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -xz + cd "libressl-${LIBRESSL_VERSION}" + cmake -B . -G Ninja -DLIBRESSL_APPS=OFF -DLIBRESSL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/libressl \ + -DCMAKE_C_COMPILER=/home/runner/filc/build/bin/filcc -DENABLE_ASM=OFF + cmake --build . + cmake --install . + - name: 'cache wolfssl (all)' if: ${{ contains(matrix.build.install_steps, 'wolfssl-all') }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 From 019874f1971332d3b988803feafd829a6b570fef Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 8 Nov 2025 22:54:08 +0100 Subject: [PATCH 280/885] GHA/linux: stop disabling TLS-SRP tests in event-based & duphandle jobs They were disabled since these jobs ran in Zuul. The tests are 320, 321, 322, 323, 324. Of which, 323 runs in CI, the rest needs `gnutls-serv` with SRP enabled, which is not available in current jobs and no longer offered by Ubuntu's `gnutls-bin` package. 324 doesn't appear as a skipped test, 323 seems to be running fine, the rest are logged as skipped. This suggests it's safe to drop the exceptions. Closes #19413 --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a24681a307c6..c3b1b02c1557 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -304,12 +304,12 @@ jobs: - name: 'event-based' install_packages: libssh-dev configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl - tflags: '-n --test-event !TLS-SRP' + tflags: '-n --test-event' - name: 'duphandle' install_packages: libssh-dev configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl - tflags: '-n --test-duphandle !TLS-SRP' + tflags: '-n --test-duphandle' - name: 'rustls valgrind' install_packages: libnghttp2-dev libldap-dev valgrind From 239c3898367a67f33afa199a3cf7ec2d51d1a423 Mon Sep 17 00:00:00 2001 From: x2018 Date: Sat, 8 Nov 2025 20:07:54 +0800 Subject: [PATCH 281/885] openssl: release ssl_session if sess_reuse_cb fails Closes #19405 --- lib/vtls/openssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 59fd0cbd6de5..5c2711c58762 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3775,8 +3775,10 @@ ossl_init_session_and_alpns(struct ossl_ctx *octx, bool do_early_data = FALSE; if(sess_reuse_cb) { result = sess_reuse_cb(cf, data, &alpns, scs, &do_early_data); - if(result) + if(result) { + SSL_SESSION_free(ssl_session); return result; + } } if(do_early_data) { /* We only try the ALPN protocol the session used before, From 59584399a5a10a923bc33adf3d2037143f279a4e Mon Sep 17 00:00:00 2001 From: x2018 Date: Sat, 8 Nov 2025 23:44:58 +0800 Subject: [PATCH 282/885] tftp: release filename if conn_get_remote_addr fails Closes #19409 --- lib/tftp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/tftp.c b/lib/tftp.c index ffea60f62190..653654315147 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -479,6 +479,7 @@ static CURLcode tftp_send_first(struct tftp_conn *state, state->blksize, "%s%c%s%c", filename, '\0', mode, '\0'); sbytes = 4 + strlen(filename) + strlen(mode); + free(filename); /* optional addition of TFTP options */ if(!data->set.tftp_no_options) { @@ -517,7 +518,6 @@ static CURLcode tftp_send_first(struct tftp_conn *state, if(result != CURLE_OK) { failf(data, "TFTP buffer too small for options"); - free(filename); return CURLE_TFTP_ILLEGAL; } } @@ -537,7 +537,6 @@ static CURLcode tftp_send_first(struct tftp_conn *state, (SEND_TYPE_ARG3)sbytes, 0, CURL_SENDTO_ARG5(&remote_addr->curl_sa_addr), (curl_socklen_t)remote_addr->addrlen); - free(filename); if(senddata != (ssize_t)sbytes) { char buffer[STRERROR_LEN]; failf(data, "%s", curlx_strerror(SOCKERRNO, buffer, sizeof(buffer))); From 1bddfe02d5b3d728a01a85ee588696310876f0d9 Mon Sep 17 00:00:00 2001 From: x2018 Date: Sun, 9 Nov 2025 00:37:16 +0800 Subject: [PATCH 283/885] asyn-thrdd: release rrname if ares_init_options fails Closes #19410 --- lib/asyn-thrdd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index b25745ee1b3b..2ee462989003 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -376,14 +376,17 @@ static CURLcode async_rr_start(struct Curl_easy *data, int port) status = ares_init_options(&thrdd->rr.channel, NULL, 0); if(status != ARES_SUCCESS) { thrdd->rr.channel = NULL; + free(rrname); return CURLE_FAILED_INIT; } #ifdef CURLDEBUG if(getenv("CURL_DNS_SERVER")) { const char *servers = getenv("CURL_DNS_SERVER"); status = ares_set_servers_ports_csv(thrdd->rr.channel, servers); - if(status) + if(status) { + free(rrname); return CURLE_FAILED_INIT; + } } #endif From a002c50510b08807928637a2aac95d477e3762ee Mon Sep 17 00:00:00 2001 From: x2018 Date: Sun, 9 Nov 2025 01:54:51 +0800 Subject: [PATCH 284/885] ftp: refactor a piece of code by merging the repeated part Closes #19411 --- lib/ftp.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index 819fab462b93..dd70c2a5ce8c 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -2744,16 +2744,6 @@ static CURLcode ftp_pwd_resp(struct Curl_easy *data, free(dir); return result; } - free(ftpc->entrypath); - ftpc->entrypath = dir; /* remember this */ - infof(data, "Entry path is '%s'", ftpc->entrypath); - /* also save it where getinfo can access it: */ - free(data->state.most_recent_ftp_entrypath); - data->state.most_recent_ftp_entrypath = strdup(ftpc->entrypath); - if(!data->state.most_recent_ftp_entrypath) - return CURLE_OUT_OF_MEMORY; - ftp_state(data, ftpc, FTP_SYST); - return result; } free(ftpc->entrypath); @@ -2764,6 +2754,11 @@ static CURLcode ftp_pwd_resp(struct Curl_easy *data, data->state.most_recent_ftp_entrypath = strdup(ftpc->entrypath); if(!data->state.most_recent_ftp_entrypath) return CURLE_OUT_OF_MEMORY; + + if(!ftpc->server_os && dir[0] != '/') { + ftp_state(data, ftpc, FTP_SYST); + return CURLE_OK; + } } else { /* could not get the path */ From 92fd791f310eb5b1dec6bc4708631fd7f5e87598 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 9 Nov 2025 11:12:06 +0100 Subject: [PATCH 285/885] mqtt: reject overly big messages Reported-by: Jiyong Yang Closes #19415 --- lib/mqtt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/mqtt.c b/lib/mqtt.c index 0bf956c05bd4..bac319e63a4c 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -582,6 +582,8 @@ static CURLcode mqtt_verify_suback(struct Curl_easy *data) return result; } +#define MAX_MQTT_MESSAGE_SIZE 0xFFFFFFF + static CURLcode mqtt_publish(struct Curl_easy *data) { CURLcode result; @@ -611,6 +613,8 @@ static CURLcode mqtt_publish(struct Curl_easy *data) remaininglength = payloadlen + 2 + topiclen; encodelen = mqtt_encode_len(encodedbytes, remaininglength); + if(MAX_MQTT_MESSAGE_SIZE - remaininglength - 1 < encodelen) + return CURLE_TOO_LARGE; /* add the control byte and the encoded remaining length */ pkt = malloc(remaininglength + 1 + encodelen); From 7aa50124c270fdc596a39653b7c850ada7ea50e5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 9 Nov 2025 11:45:03 +0100 Subject: [PATCH 286/885] TODO: improve code for large MQTT payloads Closes #19416 --- docs/TODO | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/TODO b/docs/TODO index add6819eae77..99e8d1dd605b 100644 --- a/docs/TODO +++ b/docs/TODO @@ -180,6 +180,7 @@ 21.1 Support rate-limiting 21.2 Support MQTTS 21.3 Handle network blocks + 21.4 large payloads 22. TFTP 22.1 TFTP does not convert LF to CRLF for mode=netascii @@ -1270,16 +1271,24 @@ 21.3 Handle network blocks - Running test suite with - `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes several - MQTT test cases fail where they should not. + Running test suite with `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes + several MQTT test cases fail where they should not. + +21.4 large payloads + + libcurl unnecessarily allocates heap memory to hold the entire payload to get + sent, when the data is already perfectly accessible where it is when + `CURLOPT_POSTFIELDS` is used. This is highly inefficient for larger payloads. + Additionally, libcurl does not support using the read callback for sending + MQTT which is yet another way to avoid having to hold large payload in + memory. 22. TFTP 22.1 TFTP does not convert LF to CRLF for mode=netascii - RFC 3617 defines that an TFTP transfer can be done using "netascii" - mode. curl does not support extracting that mode from the URL nor does it treat + RFC 3617 defines that an TFTP transfer can be done using "netascii" mode. + curl does not support extracting that mode from the URL nor does it treat such transfers specifically. It should probably do LF to CRLF translations for them. From d35c880a75fb31166b3e2e9f7c45bd0b3645fa44 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Nov 2025 12:56:42 +0100 Subject: [PATCH 287/885] INSTALL-CMAKE.md: document static option defaults more Closes #19419 --- docs/INSTALL-CMAKE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index 4b9b85326ff0..edce5c0e7291 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -222,8 +222,8 @@ target_link_libraries(my_target PRIVATE CURL::libcurl) - `BUILD_LIBCURL_DOCS`: Build libcurl man pages. Default: `ON` - `BUILD_MISC_DOCS`: Build misc man pages (e.g. `curl-config` and `mk-ca-bundle`). Default: `ON` - `BUILD_SHARED_LIBS`: Build shared libraries. Default: `ON` -- `BUILD_STATIC_CURL`: Build curl executable with static libcurl. Default: `OFF` -- `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF` +- `BUILD_STATIC_CURL`: Build curl executable with static libcurl. Default: `OFF` (turns to `ON`, when building static libcurl only) +- `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF` (turns to `ON` if `BUILD_SHARED_LIBS` is `OFF`) - `BUILD_TESTING`: Build tests. Default: `ON` - `CURL_CLANG_TIDY`: Run the build through `clang-tidy`. Default: `OFF` - `CURL_CLANG_TIDYFLAGS`: Custom options to pass to `clang-tidy`. Default: (empty) From f760a5cef79b73bb5716024638148d9b8dce02f4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Nov 2025 15:54:11 +0100 Subject: [PATCH 288/885] tests/data: replace `%CR` with `crlf=headers` where possible Missed them in previous rounds of updates: test 433, 1375, 1376, 1377, 1429 Closes #19424 --- tests/data/test1375 | 18 +++++++++--------- tests/data/test1376 | 16 ++++++++-------- tests/data/test1377 | 18 +++++++++--------- tests/data/test1429 | 24 ++++++++++++------------ tests/data/test433 | 10 +++++----- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/tests/data/test1375 b/tests/data/test1375 index 9af026ba2e92..a02a616732b5 100644 --- a/tests/data/test1375 +++ b/tests/data/test1375 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK%CR -Date: Tue, 09 Nov 2010 14:49:00 GMT%CR -Server: test-server/fake%CR -Content-Length: 6%CR -Connection: close%CR -Content-Type: text/html%CR -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange%CR -%CR + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 diff --git a/tests/data/test1376 b/tests/data/test1376 index d673bd73539a..379dee301832 100644 --- a/tests/data/test1376 +++ b/tests/data/test1376 @@ -8,14 +8,14 @@ HTTP GET # - -HTTP/1.1 200 OK%CR -Date: Tue, 09 Nov 2010 14:49:00 GMT%CR -Server: test-server/fake%CR -Content-Length: 6%CR -Connection: close%CR -Content-Type: text/html%CR -%CR + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + 12345 diff --git a/tests/data/test1377 b/tests/data/test1377 index c2ade403d29f..7a8234891df8 100644 --- a/tests/data/test1377 +++ b/tests/data/test1377 @@ -8,15 +8,15 @@ HTTP GET # - -HTTP/1.1 200 OK%CR -Date: Tue, 09 Nov 2010 14:49:00 GMT%CR -Server: test-server/fake%CR -Content-Length: 6%CR -Connection: close%CR -Content-Type: text/html%CR -Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange%CR -%CR + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html +Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + 12345 diff --git a/tests/data/test1429 b/tests/data/test1429 index b9c6bd126d60..f08c0dae2a5d 100644 --- a/tests/data/test1429 +++ b/tests/data/test1429 @@ -8,18 +8,18 @@ HTTP/0.9 - -HTTP/1.1 999 OK%CR -Date: Tue, 09 Nov 2010 14:49:00 GMT%CR -Server: test-server/fake%CR -Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT%CR -ETag: "21025-dc7-39462498"%CR -Accept-Ranges: bytes%CR -Content-Length: 6%CR -Connection: close%CR -Content-Type: text/html%CR -Funny-head: yesyes%CR -%CR + +HTTP/1.1 999 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + -foo- diff --git a/tests/data/test433 b/tests/data/test433 index c6c77d90bb97..63c884fdbe48 100644 --- a/tests/data/test433 +++ b/tests/data/test433 @@ -8,11 +8,11 @@ # # Server-side - -HTTP/1.1 200 OK%CR -Content-Length: 6%CR -Content-Type: text/1%CR -%CR + +HTTP/1.1 200 OK +Content-Length: 6 +Content-Type: text/1 + -foo- From 49ef2f8d1ef78e702c73f5d72242301cc2a0157e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 8 Nov 2025 02:27:23 +0100 Subject: [PATCH 289/885] cmake: adjust defaults for target platforms not supporting shared libs If CMake reports the target platform not supporting shared libs, turn `BUILD_SHARED_LIBS` off by default. CMake 3.30+ fails with an error when trying to create a `SHARED` target for such platforms. Earlier versions used a workaround that may or may not have worked in practice. Ref: https://cmake.org/cmake/help/v3.30/policy/CMP0164.html Seen this with a build setting `-DCMAKE_SYSTEM_NAME=Generic`, e.g. AmigaOS. Note this may introduce incompatibility for "Generic" targets, which support shared libs. If that's the case, set `BUILD_SHARED_LIBS=ON` manually. Also drop AmigaOS-specific logic handled automatically after this patch. Ref: https://cmake.org/cmake/help/v3.7/command/get_property.html Ref: https://cmake.org/cmake/help/v3.7/prop_gbl/TARGET_SUPPORTS_SHARED_LIBS.html Closes #19420 --- CMakeLists.txt | 5 +++-- docs/INSTALL-CMAKE.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 068d97d49b95..8113cdea90dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,8 @@ endif() option(CURL_WERROR "Turn compiler warnings into errors" OFF) option(PICKY_COMPILER "Enable picky compiler options" ON) option(BUILD_CURL_EXE "Build curl executable" ON) -option(BUILD_SHARED_LIBS "Build shared libraries" ON) +get_property(_has_shared GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) +option(BUILD_SHARED_LIBS "Build shared libraries" ${_has_shared}) option(BUILD_STATIC_LIBS "Build static libraries" OFF) option(BUILD_STATIC_CURL "Build curl executable with static libcurl" OFF) option(ENABLE_ARES "Enable c-ares support" OFF) @@ -260,7 +261,7 @@ if(WIN32) endif() unset(MINGW64_VERSION CACHE) # Avoid storing in CMake cache endif() -elseif(DOS OR AMIGA) +elseif(DOS) set(BUILD_SHARED_LIBS OFF) set(BUILD_STATIC_LIBS ON) endif() diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index edce5c0e7291..9921fbf12c4c 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -221,7 +221,7 @@ target_link_libraries(my_target PRIVATE CURL::libcurl) - `BUILD_EXAMPLES`: Build libcurl examples. Default: `ON` - `BUILD_LIBCURL_DOCS`: Build libcurl man pages. Default: `ON` - `BUILD_MISC_DOCS`: Build misc man pages (e.g. `curl-config` and `mk-ca-bundle`). Default: `ON` -- `BUILD_SHARED_LIBS`: Build shared libraries. Default: `ON` +- `BUILD_SHARED_LIBS`: Build shared libraries. Default: `ON` (if target platform supports shared libs, otherwise `OFF`) - `BUILD_STATIC_CURL`: Build curl executable with static libcurl. Default: `OFF` (turns to `ON`, when building static libcurl only) - `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF` (turns to `ON` if `BUILD_SHARED_LIBS` is `OFF`) - `BUILD_TESTING`: Build tests. Default: `ON` From 67236f7edd0a69d6d2fdb51f493b6b77d108d809 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2025 14:51:31 +0100 Subject: [PATCH 290/885] tests/data: delete stray space indentation from xml tags Closes #19428 --- tests/data/test1129 | 2 +- tests/data/test1130 | 2 +- tests/data/test1131 | 2 +- tests/data/test1164 | 2 +- tests/data/test1176 | 2 +- tests/data/test1327 | 2 +- tests/data/test1499 | 6 +++--- tests/data/test1571 | 6 +++--- tests/data/test1572 | 6 +++--- tests/data/test1573 | 6 +++--- tests/data/test1581 | 6 +++--- tests/data/test17 | 4 ++-- tests/data/test1909 | 2 +- tests/data/test2033 | 4 ++-- tests/data/test2070 | 4 ++-- tests/data/test2079 | 4 ++-- tests/data/test2087 | 4 ++-- tests/data/test256 | 2 +- tests/data/test319 | 4 ++-- tests/data/test326 | 4 ++-- tests/data/test376 | 2 +- tests/data/test38 | 2 +- tests/data/test471 | 2 +- tests/data/test513 | 2 +- tests/data/test514 | 2 +- tests/data/test56 | 4 ++-- tests/data/test587 | 2 +- tests/data/test728 | 6 +++--- tests/data/test74 | 2 +- tests/data/test75 | 2 +- tests/data/test86 | 2 +- tests/data/test87 | 2 +- tests/data/test982 | 2 +- tests/data/test985 | 2 +- 34 files changed, 54 insertions(+), 54 deletions(-) diff --git a/tests/data/test1129 b/tests/data/test1129 index 9a81043b1771..66f74fc1dc4e 100644 --- a/tests/data/test1129 +++ b/tests/data/test1129 @@ -50,7 +50,7 @@ http HTTP POST expect 100-continue with a 404 - + -d @%LOGDIR/file%TESTNUMBER --expect100-timeout 99 http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 diff --git a/tests/data/test1130 b/tests/data/test1130 index 1057d06d722e..839ba753988e 100644 --- a/tests/data/test1130 +++ b/tests/data/test1130 @@ -51,7 +51,7 @@ http HTTP POST forced expect 100-continue with a 404 - + -d @%LOGDIR/file%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -H "Expect: 100-continue" --expect100-timeout 99 diff --git a/tests/data/test1131 b/tests/data/test1131 index 51601c03adb8..8abf2a62452d 100644 --- a/tests/data/test1131 +++ b/tests/data/test1131 @@ -51,7 +51,7 @@ http HTTP PUT expect 100-continue with a 400 - + -H "Expect: 100-continue" -T %LOGDIR/file%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T %LOGDIR/file%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 --expect100-timeout 99 diff --git a/tests/data/test1164 b/tests/data/test1164 index 27934a7b7597..ed58ffb22c2f 100644 --- a/tests/data/test1164 +++ b/tests/data/test1164 @@ -23,7 +23,7 @@ http HTTP/0.9 GET and all zeroes - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{size_download}\n' --http0.9 diff --git a/tests/data/test1176 b/tests/data/test1176 index 6d38e8689f08..f18023620463 100644 --- a/tests/data/test1176 +++ b/tests/data/test1176 @@ -33,7 +33,7 @@ http --output using #0 - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o '%LOGDIR/base-#0' diff --git a/tests/data/test1327 b/tests/data/test1327 index 1a4ac898753b..70b922c3338a 100644 --- a/tests/data/test1327 +++ b/tests/data/test1327 @@ -31,7 +31,7 @@ GET /ignore/for/%TESTNUMBER HTTP/1.0 GET /we/want/%TESTNUMBER HTTP/1.0 - + telnet://%HOSTIP:%HTTPPORT -T %LOGDIR/%TESTNUMBER.txt diff --git a/tests/data/test1499 b/tests/data/test1499 index 54fec7104998..01c8781dd871 100644 --- a/tests/data/test1499 +++ b/tests/data/test1499 @@ -48,10 +48,10 @@ writedelay: 10 http - + HTTP chunked encoding and chunked trailer, twice - - + + http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER diff --git a/tests/data/test1571 b/tests/data/test1571 index 8a2bfb46167e..58091c08025f 100644 --- a/tests/data/test1571 +++ b/tests/data/test1571 @@ -65,10 +65,10 @@ http lib%TESTNUMBER - + CURLFOLLOW_OBEYCODE with custom POST method, 302 => GET - - + + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test1572 b/tests/data/test1572 index 53683ed88faa..b502ea9572a9 100644 --- a/tests/data/test1572 +++ b/tests/data/test1572 @@ -65,10 +65,10 @@ http lib1571 - + CURLFOLLOW_OBEYCODE with custom POST method, 308 => custom - - + + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test1573 b/tests/data/test1573 index e13522964f81..01f5abc117e7 100644 --- a/tests/data/test1573 +++ b/tests/data/test1573 @@ -65,10 +65,10 @@ http lib1571 - + CURLFOLLOW_OBEYCODE with custom GET method, 301 => custom - - + + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test1581 b/tests/data/test1581 index f3f29757a215..3de7e7b40066 100644 --- a/tests/data/test1581 +++ b/tests/data/test1581 @@ -65,10 +65,10 @@ http lib1571 - + CURLFOLLOW_OBEYCODE with custom POST301 method, 301 => custom - - + + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test17 b/tests/data/test17 index 31e2a8e53648..f0e5dea74cb7 100644 --- a/tests/data/test17 +++ b/tests/data/test17 @@ -25,7 +25,7 @@ http HTTP with config file on stdin - + # # Use a silly request without '--': request MOOO @@ -35,7 +35,7 @@ request MOOO # # long option *with* '--': --max-time 180 - + -K - %HOSTIP:%HTTPPORT/that.site.com/%TESTNUMBER diff --git a/tests/data/test1909 b/tests/data/test1909 index a7be2d307676..bb8100858840 100644 --- a/tests/data/test1909 +++ b/tests/data/test1909 @@ -35,7 +35,7 @@ http HTTP GET --retry-all-errors to overcome partial transfer - + --retry 1 --retry-all-errors -o %LOGDIR/outfile%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test2033 b/tests/data/test2033 index 32c9edc67c47..0526db995452 100644 --- a/tests/data/test2033 +++ b/tests/data/test2033 @@ -35,10 +35,10 @@ https test-localhost.pem simple HTTPS GET with DER public key pinning (Schannel variant) - + # This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel - + -4 --cacert %CERTDIR/certs/test-ca.crt --pinnedpubkey %CERTDIR/certs/test-localhost.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2070 b/tests/data/test2070 index 0dfa5db7277d..a3b5a4ba78f9 100644 --- a/tests/data/test2070 +++ b/tests/data/test2070 @@ -34,10 +34,10 @@ https test-localhost.pem Ignore certificate revocation "best effort" strategy - + # This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel - + -4 --cacert %CERTDIR/certs/test-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2079 b/tests/data/test2079 index 78709f3a2cda..701b55fb6521 100644 --- a/tests/data/test2079 +++ b/tests/data/test2079 @@ -35,10 +35,10 @@ https test-localhost.pem simple HTTPS GET with PEM public key pinning (Schannel variant) - + # This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel - + -4 --cacert %CERTDIR/certs/test-ca.crt --pinnedpubkey %CERTDIR/certs/test-localhost.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2087 b/tests/data/test2087 index 7c7176723412..87fd29740a7b 100644 --- a/tests/data/test2087 +++ b/tests/data/test2087 @@ -35,10 +35,10 @@ https test-localhost.pem simple HTTPS GET with base64-sha256 public key pinning (Schannel variant) - + # This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel - + -4 --cacert %CERTDIR/certs/test-ca.crt --pinnedpubkey sha256//%sha256b64file[%CERTDIR/certs/test-localhost.pub.der]sha256b64file% --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test256 b/tests/data/test256 index ca76e738612e..eb4acefb2c15 100644 --- a/tests/data/test256 +++ b/tests/data/test256 @@ -28,7 +28,7 @@ http HTTP resume request over proxy with auth without server supporting it - + -x http://%HOSTIP:%HTTPPORT http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -C - --no-include -o %LOGDIR/fewl%TESTNUMBER.txt -U daniel:stenberg diff --git a/tests/data/test319 b/tests/data/test319 index 6258a12720e0..c0cb54fb0622 100644 --- a/tests/data/test319 +++ b/tests/data/test319 @@ -40,9 +40,9 @@ http HTTP GET gobbledigook transfer-encoded data in raw mode - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER --raw - + # diff --git a/tests/data/test326 b/tests/data/test326 index 4c3ed3e08524..3c004e203775 100644 --- a/tests/data/test326 +++ b/tests/data/test326 @@ -45,9 +45,9 @@ http HTTP GET chunked data in raw mode - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER --raw - + # diff --git a/tests/data/test376 b/tests/data/test376 index 16c28002d6aa..1f25a3930aa6 100644 --- a/tests/data/test376 +++ b/tests/data/test376 @@ -34,7 +34,7 @@ http --remove-on-error - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save-%TESTNUMBER --remove-on-error diff --git a/tests/data/test38 b/tests/data/test38 index d48e743a4600..31207b95964f 100644 --- a/tests/data/test38 +++ b/tests/data/test38 @@ -27,7 +27,7 @@ http HTTP resume request without server supporting it - + http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -C - --no-include -o %LOGDIR/fewl%TESTNUMBER.txt diff --git a/tests/data/test471 b/tests/data/test471 index e434198ad131..f32ccd1277ce 100644 --- a/tests/data/test471 +++ b/tests/data/test471 @@ -46,7 +46,7 @@ http Reject HTTP/1.1 to HTTP/2 switch on the same connection - + "http://%HOSTIP:%HTTPPORT/{%TESTNUMBER,%TESTNUMBER0001}" -o "%LOGDIR/dumpit#1.dump" diff --git a/tests/data/test513 b/tests/data/test513 index d61d2be4a5c0..d63e071b9013 100644 --- a/tests/data/test513 +++ b/tests/data/test513 @@ -25,7 +25,7 @@ lib%TESTNUMBER send HTTP POST using read callback that returns CURL_READFUNC_ABORT # the 1s post-command delay helps to prevent a spurious failure on s390 - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test514 b/tests/data/test514 index 9ab14de7c643..71dd74e42b13 100644 --- a/tests/data/test514 +++ b/tests/data/test514 @@ -36,7 +36,7 @@ lib%TESTNUMBER First set options to POST and then to make HEAD # the 1s post-command delay helps to prevent a spurious failure on s390 - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test56 b/tests/data/test56 index 5ced385bb0cf..5dea16c0c13b 100644 --- a/tests/data/test56 +++ b/tests/data/test56 @@ -26,7 +26,7 @@ http HTTP POST with *HUGE* request and chunked transfer-encoding - + # data "we post this" # @@ -36,7 +36,7 @@ header "Transfer-Encoding: chunked" # Set the user-agent using a short-option: -A "%repeat[99999 x a]%" # - + -K - %HOSTIP:%HTTPPORT/that.site.com/%TESTNUMBER diff --git a/tests/data/test587 b/tests/data/test587 index 44e1fb047d91..85f7453735f6 100644 --- a/tests/data/test587 +++ b/tests/data/test587 @@ -33,7 +33,7 @@ HTTP multi-part formpost with aborted read callback # Add a delay to give server time to write its output since we otherwise might # not even give it enough time to write its lock file. - + http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test728 b/tests/data/test728 index 3be19113906a..19d45ab4e158 100644 --- a/tests/data/test728 +++ b/tests/data/test728 @@ -33,10 +33,10 @@ proxy http socks5 - + SOCKS5h with HTTP redirect to hostname too long - - + + --no-progress-meter --location --proxy socks5h://%HOSTIP:%SOCKSPORT http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test74 b/tests/data/test74 index 0d10f20587d0..d23c5da45060 100644 --- a/tests/data/test74 +++ b/tests/data/test74 @@ -42,7 +42,7 @@ http HTTP, urlglob {}-retrieval and -o #[num] usage - + "http://%HOSTIP:%HTTPPORT/{%TESTNUMBER,%TESTNUMBER0001}" -o "%LOGDIR/dumpit#1.dump" diff --git a/tests/data/test75 b/tests/data/test75 index 3aa416a5b36e..a79a929201d4 100644 --- a/tests/data/test75 +++ b/tests/data/test75 @@ -21,7 +21,7 @@ http HTTP, urlglob retrieval with bad range - + "http://a-site-never-accessed.example.org/[2-1]" -o "%LOGDIR/weee#1.dump" --stderr - diff --git a/tests/data/test86 b/tests/data/test86 index ecd1f632141d..2fe5ce837eb3 100644 --- a/tests/data/test86 +++ b/tests/data/test86 @@ -56,7 +56,7 @@ http HTTP, urlglob []-retrieval and -o #[num] usage - + "http://%HOSTIP:%HTTPPORT/[%TESTNUMBER0001-%TESTNUMBER0003]" -o "%LOGDIR/dumpit#1.dump" diff --git a/tests/data/test87 b/tests/data/test87 index 6bbb35a4f00d..b22578f82f2a 100644 --- a/tests/data/test87 +++ b/tests/data/test87 @@ -39,7 +39,7 @@ http urlglob with out of range -o #[num] usage - + "http://%HOSTIP:%HTTPPORT/[%TESTNUMBER0001-%TESTNUMBER0002]" -o "%LOGDIR/dumpit%TESTNUMBER-#2.dump" diff --git a/tests/data/test982 b/tests/data/test982 index 6098b7255aa5..f250a6b88f20 100644 --- a/tests/data/test982 +++ b/tests/data/test982 @@ -39,7 +39,7 @@ POP3 STARTTLS pipelined server response pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --ssl - + # diff --git a/tests/data/test985 b/tests/data/test985 index 816730c7f11a..b0bd1dac15af 100644 --- a/tests/data/test985 +++ b/tests/data/test985 @@ -37,7 +37,7 @@ POP3 require STARTTLS with failing capabilities pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret --ssl-reqd - + # From 28ff2b260e53ad566197702af8e1259934650b24 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Nov 2025 19:02:00 +0100 Subject: [PATCH 291/885] tests/data: replace hard-coded test numbers with `%TESTNUMBER` Closes #19427 --- tests/data/test1948 | 2 +- tests/data/test439 | 2 +- tests/data/test472 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/data/test1948 b/tests/data/test1948 index 1f4c3c8ac465..c0982171439b 100644 --- a/tests/data/test1948 +++ b/tests/data/test1948 @@ -60,7 +60,7 @@ Accept: */* Content-Length: 22 This is test PUT data -POST /1948 HTTP/1.1 +POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* Content-Length: 22 diff --git a/tests/data/test439 b/tests/data/test439 index 9a5b0522af6e..2659f139e971 100644 --- a/tests/data/test439 +++ b/tests/data/test439 @@ -47,7 +47,7 @@ aws-sigv4 with query # Verify data after the test has been "shot" -GET /439/?name=me&noval&aim=b%aad&&&weirdo=*.//- HTTP/1.1 +GET /%TESTNUMBER/?name=me&noval&aim=b%aad&&&weirdo=*.//- HTTP/1.1 Host: fake.fake.fake:8000 Authorization: AWS4-HMAC-SHA256 Credential=user/19700101/us-east-2/es/aws4_request, SignedHeaders=host;x-amz-date, Signature=9dd8592929306832a6673d10063491391e486e5f50de4647ea7c2c797277e0a6 X-Amz-Date: 19700101T000000Z diff --git a/tests/data/test472 b/tests/data/test472 index 61d72e30d7b3..89c01b85fed1 100644 --- a/tests/data/test472 +++ b/tests/data/test472 @@ -48,7 +48,7 @@ aws-sigv4 with query # Verify data after the test has been "shot" -GET /472/a=%E3%81%82 HTTP/1.1 +GET /%TESTNUMBER/a=%E3%81%82 HTTP/1.1 Host: fake.fake.fake:8000 Authorization: AWS4-HMAC-SHA256 Credential=user/19700101/us-east-2/es/aws4_request, SignedHeaders=host;x-amz-date, Signature=b8783c8387a5249b084642126fe1f8e07e12a2847820fd5b6cd64b2047149da4 X-Amz-Date: 19700101T000000Z From c6f1b0ff49268817101ac1734f43074fcc8775b2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Nov 2025 19:37:28 +0100 Subject: [PATCH 292/885] tests/server: do not fall back to original data file in `test2fopen()` Before this patch servers were loading the original data source file (from `tests/data/test*`) if they failed to open the preprocessed data file. It was causing issues in many (most?) tests, because original data files are not preprocessed, thus may be incomplete and/or come with wrong newline characters. It's also causing difficult to diagnose issues when a test accidentally references another test's data, which by chance makes the test pass initially, until either that or the executed test data gets an update, and breaking it, as seen in #19329. Historically, the fallback existed first, then the preprocessed copy. The fallback is no longer used by tests (except by stray accidents). Fix it by dropping the fallback logic and relying on the preprocessed data file saved there by the runtests framework. Also fix two remaining test data cross-references: - test1565: reference own server input data instead of test1's. - test3014: reference own server input data instead of test1439's. Ref: #19398 Follow-up to aaf9522a2c28e5142c7f5640da4e24b65b47dc53 #19329 Closes #19429 --- tests/data/test1565 | 2 +- tests/data/test3014 | 4 ++-- tests/server/util.c | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/data/test1565 b/tests/data/test1565 index 15374bf7e623..42bbcdf6f750 100644 --- a/tests/data/test1565 +++ b/tests/data/test1565 @@ -34,7 +34,7 @@ lib%TESTNUMBER wakeup from another thread -http://%HOSTIP:%HTTPPORT/1 +http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test3014 b/tests/data/test3014 index e1e6471a4a8d..10ad554da3c9 100644 --- a/tests/data/test3014 +++ b/tests/data/test3014 @@ -29,7 +29,7 @@ http Check if %{num_headers} returns correct number of headers -http://%HOSTIP:%HTTPPORT/1439 --write-out '%{num_headers}' +http://%HOSTIP:%HTTPPORT/%TESTNUMBER --write-out '%{num_headers}' @@ -46,7 +46,7 @@ testdata 4 -GET /1439 HTTP/1.1 +GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/server/util.c b/tests/server/util.c index 5abd30873834..0e34f4ab21a8 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -200,12 +200,6 @@ FILE *test2fopen(long testno, const char *logdir2) /* first try the alternative, preprocessed, file */ snprintf(filename, sizeof(filename), "%s/test%ld", logdir2, testno); stream = fopen(filename, "rb"); - if(stream) - return stream; - - /* then try the source version */ - snprintf(filename, sizeof(filename), "%s/data/test%ld", srcpath, testno); - stream = fopen(filename, "rb"); return stream; } From 2701ac6a4d16a62130dad05be1c484903b8545c7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Nov 2025 13:54:49 +0100 Subject: [PATCH 293/885] processhelp.pm: log taskkill pid info, add debug envs, enable in CI To debug the Windows CI fails further. Acting on the suspicions that `taskkill` may sometimes be applied to the wrong process. - log task info, and task child info before calling `taskkill` on a PID. (on native Windows.) One of the calls needs PowerShell. - add env `CURL_TEST_NO_TASKKILL` to disable using `taskkill`. - add env `CURL_TEST_NO_TASKKILL_TREE` to use `taskkill` without `-t`, meaning to kill the process, but not child processes. - GHA/windows: disable `taskkill` calls, to see what happens. I'll revert or tweak this in a future commit depending on results. Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-13062859 Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-14913014 Closes #19421 --- .github/scripts/typos.toml | 2 +- .github/workflows/windows.yml | 1 + tests/processhelp.pm | 54 +++++++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/.github/scripts/typos.toml b/.github/scripts/typos.toml index 28dcad73bec4..3495823c1bdc 100644 --- a/.github/scripts/typos.toml +++ b/.github/scripts/typos.toml @@ -4,7 +4,7 @@ [default] extend-ignore-identifiers-re = [ - "^(ba|pn|PN|UE)$", + "^(ba|fo|pn|PN|UE)$", "^(CNA|ser)$", "^(ECT0|ECT1|HELO|htpt|PASE)$", "^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8214cbb3101a..bcb846d80656 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -37,6 +37,7 @@ permissions: {} env: CURL_CI: github + CURL_TEST_NO_TASKKILL: '1' jobs: cygwin: diff --git a/tests/processhelp.pm b/tests/processhelp.pm index f1f8ef525a42..8c436d5eab23 100644 --- a/tests/processhelp.pm +++ b/tests/processhelp.pm @@ -169,10 +169,29 @@ sub pidterm { if($has_win32_process) { Win32::Process::KillProcess($pid, 0); } else { - # https://ss64.com/nt/taskkill.html - my $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1"; - print "Executing: '$cmd'\n"; - system($cmd); + # https://ss64.com/nt/tasklist.html + my $result = `tasklist -v -fo list -fi "PID eq $pid" 2>&1`; + $result =~ s/\r//g; + $result =~ s/\n/ | /g; + print "Task info for $pid before taskkill: '$result'\n"; + + $result = `powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine"`; + $result =~ s/\r//g; + print "Task child processes for $pid before taskkill:\n"; + print "$result\n"; + + if(!$ENV{'CURL_TEST_NO_TASKKILL'}) { + # https://ss64.com/nt/taskkill.html + my $cmd; + if($ENV{'CURL_TEST_NO_TASKKILL_TREE'}) { + $cmd = "taskkill -f -pid $pid >$dev_null 2>&1"; + } + else { + $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1"; + } + print "Executing: '$cmd'\n"; + system($cmd); + } } return; } @@ -198,10 +217,29 @@ sub pidkill { if($has_win32_process) { Win32::Process::KillProcess($pid, 0); } else { - # https://ss64.com/nt/taskkill.html - my $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1"; - print "Executing: '$cmd'\n"; - system($cmd); + # https://ss64.com/nt/tasklist.html + my $result = `tasklist -v -fo list -fi "PID eq $pid" 2>&1`; + $result =~ s/\r//g; + $result =~ s/\n/ | /g; + print "Task info for $pid before taskkill: '$result'\n"; + + $result = `powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine"`; + $result =~ s/\r//g; + print "Task child processes for $pid before taskkill:\n"; + print "$result\n"; + + if(!$ENV{'CURL_TEST_NO_TASKKILL'}) { + # https://ss64.com/nt/taskkill.html + my $cmd; + if($ENV{'CURL_TEST_NO_TASKKILL_TREE'}) { + $cmd = "taskkill -f -pid $pid >$dev_null 2>&1"; + } + else { + $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1"; + } + print "Executing: '$cmd'\n"; + system($cmd); + } } return; } From c791223743d227bb0773fc4d2b723404b0fdda96 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 01:02:37 +0100 Subject: [PATCH 294/885] setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL As documented. Reported-by: Stanislav Fort (Aisle Research) Closes #19434 --- lib/setopt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index 90a1cf24a8d1..67b5371e87dd 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2169,8 +2169,9 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Set the client IP to send through HAProxy PROXY protocol */ result = Curl_setstropt(&s->str[STRING_HAPROXY_CLIENT_IP], ptr); - /* enable the HAProxy protocol */ - s->haproxyprotocol = TRUE; + + /* enable the HAProxy protocol if an IP is provided */ + s->haproxyprotocol = !!s->str[STRING_HAPROXY_CLIENT_IP]; break; #endif From 79d3e1d7d44dda65fdc303a53a44109583135b12 Mon Sep 17 00:00:00 2001 From: Samuel Henrique Date: Sun, 9 Nov 2025 06:37:24 -0800 Subject: [PATCH 295/885] wcurl: import v2025.11.09 Closes #19430 --- scripts/wcurl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/wcurl b/scripts/wcurl index 56c04ba9a4ee..cbdbb327e4e9 100755 --- a/scripts/wcurl +++ b/scripts/wcurl @@ -29,7 +29,7 @@ # Stop on errors and on usage of unset variables. set -eu -VERSION="2025.11.04" +VERSION="2025.11.09" PROGRAM_NAME="$(basename "$0")" readonly PROGRAM_NAME @@ -85,7 +85,7 @@ _EOF_ # Display an error message and bail out. error() { - printf "%s\n" "$*" > /dev/stderr + printf "%s\n" "$*" >&2 exit 1 } @@ -118,7 +118,7 @@ readonly PER_URL_PARAMETERS="\ # characters. # 2F = / # 5C = \ -readonly UNSAFE_PERCENT_ENCODE="2F 5C" +readonly UNSAFE_PERCENT_ENCODE="%2F %5C" # Whether to invoke curl or not. DRY_RUN="false" From 00872d5c98bf977eff7d4276eb7379c2b3a7eed6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 08:11:30 +0100 Subject: [PATCH 296/885] rtmp: fix double-free on URL parse errors Reported-by: Stanislav Fort (Aisle Research) Closes #19438 --- lib/curl_rtmp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 779422c9ae7f..4a5e5cb637ac 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -240,10 +240,9 @@ static CURLcode rtmp_setup_connection(struct Curl_easy *data, RTMP_Init(r); RTMP_SetBufferMS(r, DEF_BUFTIME); - if(!RTMP_SetupURL(r, data->state.url)) { - RTMP_Free(r); + if(!RTMP_SetupURL(r, data->state.url)) + /* rtmp_conn_dtor() performs the cleanup */ return CURLE_URL_MALFORMAT; - } return CURLE_OK; } From b0aba1005bf4f0f1eef467cf1e0ef4728421a6fd Mon Sep 17 00:00:00 2001 From: Stanislav Fort Date: Mon, 10 Nov 2025 08:18:53 +0100 Subject: [PATCH 297/885] cshutdn: acknowledge FD_SETSIZE for shutdown descriptors In the logic called for curl_multi_fdset(). File descriptors larger than FD_SETSIZE size are simply ignored, which of course will make things break but at least it does not trash memory. Reported-by: Stanislav Fort (Aisle Research) Closes #19439 --- lib/cshutdn.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/cshutdn.c b/lib/cshutdn.c index c2788e7780a4..1ce34606ecf3 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -503,20 +503,23 @@ void Curl_cshutdn_setfds(struct cshutdn *cshutdn, continue; for(i = 0; i < ps.n; i++) { + curl_socket_t sock = ps.sockets[i]; + if(!FDSET_SOCK(sock)) + continue; #ifdef __DJGPP__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warith-conversion" #endif if(ps.actions[i] & CURL_POLL_IN) - FD_SET(ps.sockets[i], read_fd_set); + FD_SET(sock, read_fd_set); if(ps.actions[i] & CURL_POLL_OUT) - FD_SET(ps.sockets[i], write_fd_set); + FD_SET(sock, write_fd_set); #ifdef __DJGPP__ #pragma GCC diagnostic pop #endif if((ps.actions[i] & (CURL_POLL_OUT | CURL_POLL_IN)) && - ((int)ps.sockets[i] > *maxfd)) - *maxfd = (int)ps.sockets[i]; + ((int)sock > *maxfd)) + *maxfd = (int)sock; } } Curl_pollset_cleanup(&ps); From 87149c8383f7cdc85cd4780256afc1b5a923bac8 Mon Sep 17 00:00:00 2001 From: x2018 Date: Sun, 9 Nov 2025 19:19:13 +0800 Subject: [PATCH 298/885] mqtt: properly handle the message which exceeds maxsize We should goto fail as topic is allocated. Follow-up to 92fd791 Closes #19417 --- lib/mqtt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/mqtt.c b/lib/mqtt.c index bac319e63a4c..713e4aa02cd6 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -613,8 +613,10 @@ static CURLcode mqtt_publish(struct Curl_easy *data) remaininglength = payloadlen + 2 + topiclen; encodelen = mqtt_encode_len(encodedbytes, remaininglength); - if(MAX_MQTT_MESSAGE_SIZE - remaininglength - 1 < encodelen) - return CURLE_TOO_LARGE; + if(MAX_MQTT_MESSAGE_SIZE - remaininglength - 1 < encodelen) { + result = CURLE_TOO_LARGE; + goto fail; + } /* add the control byte and the encoded remaining length */ pkt = malloc(remaininglength + 1 + encodelen); From baafa5ff7664230ac4475dc9227e842cc09c8151 Mon Sep 17 00:00:00 2001 From: x2018 Date: Sun, 9 Nov 2025 22:20:24 +0800 Subject: [PATCH 299/885] schannel: fix potental memory leak of cert_store_path on four error paths Closes #19423 --- lib/vtls/schannel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index c96e0df77b50..639d6c384208 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -580,6 +580,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, failf(data, "schannel: certificate format compatibility error " " for %s", blob ? "(memory blob)" : data->set.ssl.primary.clientcert); + free(cert_store_path); curlx_unicodefree(cert_path); if(fInCert) curlx_fclose(fInCert); @@ -597,6 +598,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, int cert_find_flags; const char *cert_showfilename_error = blob ? "(memory blob)" : data->set.ssl.primary.clientcert; + free(cert_store_path); curlx_unicodefree(cert_path); if(fInCert) { long cert_tell = 0; From 660f2446404ca7ba36877bf7f02442e05a2299d1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 08:47:51 +0100 Subject: [PATCH 300/885] urlapi: fix mem-leaks in curl_url_get error paths Reported-by: Stanislav Fort (Aisle Research) Closes #19440 --- lib/urlapi.c | 53 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/lib/urlapi.c b/lib/urlapi.c index 0a6ae5ba1a7c..73f476ed3f62 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -1345,20 +1345,22 @@ static CURLUcode host_encode(const char *host, char **allochost) #endif static CURLUcode urlget_format(const CURLU *u, CURLUPart what, - const char *ptr, char **part, + const char *ptr, char **partp, bool plusdecode, unsigned int flags) { + CURLUcode uc = CURLUE_OK; size_t partlen = strlen(ptr); bool urldecode = (flags & CURLU_URLDECODE) ? 1 : 0; bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0; bool punycode = (flags & CURLU_PUNYCODE) && (what == CURLUPART_HOST); bool depunyfy = (flags & CURLU_PUNY2IDN) && (what == CURLUPART_HOST); - *part = Curl_memdup0(ptr, partlen); - if(!*part) + char *part = Curl_memdup0(ptr, partlen); + *partp = NULL; + if(!part) return CURLUE_OUT_OF_MEMORY; if(plusdecode) { /* convert + to space */ - char *plus = *part; + char *plus = part; size_t i = 0; for(i = 0; i < partlen; ++plus, i++) { if(*plus == '+') @@ -1370,46 +1372,43 @@ static CURLUcode urlget_format(const CURLU *u, CURLUPart what, size_t dlen; /* this unconditional rejection of control bytes is documented API behavior */ - CURLcode res = Curl_urldecode(*part, 0, &decoded, &dlen, REJECT_CTRL); - free(*part); - if(res) { - *part = NULL; + CURLcode res = Curl_urldecode(part, partlen, &decoded, &dlen, REJECT_CTRL); + free(part); + if(res) return CURLUE_URLDECODE; - } - *part = decoded; + part = decoded; partlen = dlen; } if(urlencode) { struct dynbuf enc; - CURLUcode uc; curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); - uc = urlencode_str(&enc, *part, partlen, TRUE, what == CURLUPART_QUERY); + uc = urlencode_str(&enc, part, partlen, TRUE, what == CURLUPART_QUERY); + free(part); if(uc) return uc; - free(*part); - *part = curlx_dyn_ptr(&enc); + part = curlx_dyn_ptr(&enc); } else if(punycode) { if(!Curl_is_ASCII_name(u->host)) { - char *allochost = NULL; - CURLUcode ret = host_decode(*part, &allochost); - if(ret) - return ret; - free(*part); - *part = allochost; + char *punyversion = NULL; + uc = host_decode(part, &punyversion); + free(part); + if(uc) + return uc; + part = punyversion; } } else if(depunyfy) { if(Curl_is_ASCII_name(u->host)) { - char *allochost = NULL; - CURLUcode ret = host_encode(*part, &allochost); - if(ret) - return ret; - free(*part); - *part = allochost; + char *unpunified = NULL; + uc = host_encode(part, &unpunified); + free(part); + if(uc) + return uc; + part = unpunified; } } - + *partp = part; return CURLUE_OK; } From 323b33d51f79bbfa115cbc966c78619cb95b14f4 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 10 Nov 2025 01:44:27 +0800 Subject: [PATCH 301/885] digest_sspi: properly free sspi identity Closes #19426 --- lib/vauth/digest_sspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index 9441ee26fcca..f04c3845abe9 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -502,6 +502,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, /* Populate our identity domain */ if(Curl_override_sspi_http_realm((const char *) digest->input_token, &identity)) { + Curl_sspi_free_identity(&identity); free(output_token); return CURLE_OUT_OF_MEMORY; } From 24774bbb5e084ab0cc2b16c62c9673b22eaf33eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 01:01:14 +0000 Subject: [PATCH 302/885] GHA: update awslabs/aws-lc to v1.63.0 Closes #19435 --- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 29d0fe6eaff4..c99dcd90acb3 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -43,7 +43,7 @@ env: # renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com LIBRESSL_VERSION: 4.2.1 # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com - AWSLC_VERSION: 1.61.4 + AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251002.0 # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c3b1b02c1557..4805bf16be03 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,7 +46,7 @@ env: # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver:^3.0.0 registryUrl=https://github.com MBEDTLS_VERSION_PREV: 3.6.4 # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com - AWSLC_VERSION: 1.61.4 + AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251002.0 # handled in renovate.json From 4efe88ee7e40fc7e02d356ecb5371d482a088047 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 09:23:56 +0100 Subject: [PATCH 303/885] renovate.json: drop parentheses from group names They make git branch names using those parentheses, that need to be quoted when used with git command lines. Avoid parentheses for easier to use branch names. Follow-up to f77c574445532e3c17e62 Closes #19441 --- renovate.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index e48d6a93b812..616fd1aaedf8 100644 --- a/renovate.json +++ b/renovate.json @@ -50,7 +50,7 @@ "/codeql/i", "/ruff/i" ], - "groupName": "monthly updates (by name)", + "groupName": "monthly updates by name", "schedule": [ "* * 10 * *" ] @@ -60,7 +60,7 @@ "matchSourceUrls": [ "**/awslabs/**" ], - "groupName": "monthly updates (by source URL)", + "groupName": "monthly updates by URL", "schedule": [ "* * 10 * *" ] From 2f768b8c62151f83d8ffe92c1fcea4de1fc257fd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 10:09:03 +0100 Subject: [PATCH 304/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 61 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cb0026259451..267e4783d1f1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,32 +4,60 @@ curl and libcurl 8.17.1 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3535 + Contributors: 3536 This release includes the following changes: This release includes the following bugfixes: + o asyn-thrdd: release rrname if ares_init_options fails [41] o checksrc.pl: detect assign followed by more than one space [26] + o cmake: adjust defaults for target platforms not supporting shared libs [35] o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] + o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] + o CURLINFO: remove 'get' and 'get the' from each short desc [50] + o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48] + o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] + o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] + o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example + o digest_sspi: properly free sspi identity [12] o docs: fix checksrc `EQUALSPACE` warnings [21] + o docs: mention umask need when curl creates files [56] + o ftp: refactor a piece of code by merging the repeated part [40] o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] + o gtls: skip session resumption when verifystatus is set + o INSTALL-CMAKE.md: document static option defaults more [37] o lib: cleanup for some typos about spaces and code style [3] + o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] o m4/sectrust: fix test(1) operator [4] o mbedtls: fix potential use of uninitialized `nread` [8] + o mqtt: reject overly big messages [39] + o openssl: release ssl_session if sess_reuse_cb fails [43] o openssl: remove code handling default version [28] o osslq: code readability [5] + o pytest: skip H2 tests if feature missing from curl [46] + o rtmp: fix double-free on URL parse errors [27] + o rtmp: precaution for a potential integer truncation [54] + o schannel: fix potental memory leak of cert_store_path on four error paths [23] + o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] o setopt: when setting bad protocols, don't store them [9] + o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33] + o tests/server: do not fall back to original data file in `test2fopen()` [32] + o tftp: release filename if conn_get_remote_addr fails [42] o tool: consider (some) curl_easy_setopt errors fatal [7] o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] o tool_operate: remove redundant condition [19] o tool_paramhlp: refuse --proto remove all protocols [10] + o urlapi: fix mem-leaks in curl_url_get error paths [22] + o vtls: fix CURLOPT_CAPATH use [51] + o vtls: handle possible malicious certs_num from peer [53] + o wcurl: import v2025.11.09 [29] o wolfSSL: able to differentiate between IP and DNS in alt names [13] This release includes the following known bugs: @@ -54,9 +82,10 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Dan Fandrich, Daniel Stenberg, Juliusz Sosinowicz, renovate[bot], + Andrew Kirillov, Brad King, Dan Fandrich, Daniel Stenberg, Jiyong Yang, + Juliusz Sosinowicz, renovate[bot], Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner, Viktor Szakats, Xiaoke Wang - (8 contributors) + (13 contributors) References to bug reports and discussions on issues: @@ -69,6 +98,7 @@ References to bug reports and discussions on issues: [8] = https://curl.se/bug/?i=19393 [9] = https://curl.se/bug/?i=19389 [10] = https://curl.se/bug/?i=19388 + [12] = https://curl.se/bug/?i=19426 [13] = https://curl.se/bug/?i=19364 [14] = https://curl.se/bug/?i=19377 [15] = https://curl.se/bug/?i=19383 @@ -78,5 +108,30 @@ References to bug reports and discussions on issues: [19] = https://curl.se/bug/?i=19381 [20] = https://curl.se/bug/?i=19382 [21] = https://curl.se/bug/?i=19379 + [22] = https://curl.se/bug/?i=19440 + [23] = https://curl.se/bug/?i=19423 + [25] = https://curl.se/bug/?i=19439 [26] = https://curl.se/bug/?i=19375 + [27] = https://curl.se/bug/?i=19438 [28] = https://curl.se/bug/?i=19354 + [29] = https://curl.se/bug/?i=19430 + [30] = https://curl.se/bug/?i=19434 + [32] = https://curl.se/bug/?i=19429 + [33] = https://curl.se/bug/?i=19427 + [35] = https://curl.se/bug/?i=19420 + [37] = https://curl.se/bug/?i=19419 + [39] = https://curl.se/bug/?i=19415 + [40] = https://curl.se/bug/?i=19411 + [41] = https://curl.se/bug/?i=19410 + [42] = https://curl.se/bug/?i=19409 + [43] = https://curl.se/bug/?i=19405 + [46] = https://curl.se/bug/?i=19412 + [47] = https://curl.se/bug/?i=19402 + [48] = https://curl.se/bug/?i=19403 + [49] = https://curl.se/bug/?i=19404 + [50] = https://curl.se/bug/?i=19406 + [51] = https://curl.se/bug/?i=19401 + [53] = https://curl.se/bug/?i=19397 + [54] = https://curl.se/bug/?i=19399 + [55] = https://curl.se/bug/?i=19336 + [56] = https://curl.se/bug/?i=19396 From 2f29a8f19ede9898a788340a38109215cec3a8fb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 10:41:38 +0100 Subject: [PATCH 305/885] RELEASE-NOTES: spellcheck --- RELEASE-NOTES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 267e4783d1f1..956e2b42a5b8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -43,7 +43,7 @@ This release includes the following bugfixes: o pytest: skip H2 tests if feature missing from curl [46] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] - o schannel: fix potental memory leak of cert_store_path on four error paths [23] + o schannel: fix memory leak of cert_store_path on four error paths [23] o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] o setopt: when setting bad protocols, don't store them [9] o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33] From 37050a146221194f36d26845f32e29589e15b517 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 10:26:19 +0100 Subject: [PATCH 306/885] OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs When a blob option is used and it does not convert, the code would erroneously pass along an uninitialized stack struct. Reported-by: Stanislav Fort (Aisle Research) Closes #19444 --- packages/OS400/ccsidcurl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index b40367fd960b..9fd11a4cf9ba 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -1286,7 +1286,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) blob.flags = bp->flags | CURL_BLOB_COPY; bp = &blob; } - result = curl_easy_setopt(easy, tag, &blob); + result = curl_easy_setopt(easy, tag, bp); break; } FALLTHROUGH(); From 7e8725502087227a615216d9c56f5aee6119223a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 11:08:26 +0100 Subject: [PATCH 307/885] socks_sspi: use free() not FreeContextBuffer() The memory is allocated with malloc(). This reverts commit 1d01d4975f540f3a363b38e1296aead62130fc6d. Reported-by: Stanislav Fort (Aisle Research) Closes #19445 --- lib/socks_sspi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 31645527a36f..975172576c35 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -588,12 +588,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); if(names.sUserName) Curl_pSecFn->FreeContextBuffer(names.sUserName); - if(sspi_w_token[0].pvBuffer) - Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - if(sspi_w_token[1].pvBuffer) - Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); - if(sspi_w_token[2].pvBuffer) - Curl_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); + free(sspi_w_token[0].pvBuffer); + free(sspi_w_token[1].pvBuffer); + free(sspi_w_token[2].pvBuffer); free(etbuf); return result; } From 8e321a53df866dfb2a2d5c5fc77c9639f733f93f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 13:17:37 +0100 Subject: [PATCH 308/885] examples/crawler: fix variable A variable missed in the previous rename cleanup Follow-up to 928363f28ca533d743adcb70597c3e30917 Reported-by: Gisle Vanem Closes #19446 --- docs/examples/crawler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index c56ad5ab3c8e..4812a67d1426 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -232,7 +232,7 @@ int main(void) if(is_html(ctype) && mem->size > 100) { if(pending < max_requests && (complete + pending) < max_total) { - pending += follow_links(multi_curl, mem, url); + pending += follow_links(multi, mem, url); still_running = 1; } } From f477f3efc3ec58f7effc2aa01e7f4565b12be976 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 7 Nov 2025 16:39:29 +0100 Subject: [PATCH 309/885] tests/data: support using native newlines on disk, drop `.gitattributes` Data files no longer depend on mixed newline styles. Before this patch the harness still assumed data files to use LF newlines, ensured by `.gitattribute` and distributing sources with LF newlines. To allow using platform native newlines (CRLF on Windows typically), update the test harness to support data files with any newline style on disk. And delete `.gitattributes`. Fix to: - load original data files (from test/data) so that their newline-style doesn't matter on the checked out source repo, meaning it works when its CRLF on Windows, just like any other file. (if a BOM slips in, it's caught by `spacecheck.pl` as binary content.) - do the same in `util.py` used by `smbserver.py` (for test 1451). - also fix `util.py` to use us-ascii encoding for data files, replacing utf-8. Also: - runtests: rework the stray CR checker to allow full CRLF data files, and keep warning for mixed newlines. Follow-up to 904e7ecb66519951681377758fe6b07dde28ce36 #19347 Closes #19398 --- tests/data/.gitattributes | 5 ---- tests/devtest.pl | 2 +- tests/getpart.pm | 49 ++++++++++++++++++++++++++++++++------- tests/runner.pm | 11 ++++----- tests/runtests.pl | 8 +++---- tests/util.py | 6 ++--- 6 files changed, 53 insertions(+), 28 deletions(-) delete mode 100644 tests/data/.gitattributes diff --git a/tests/data/.gitattributes b/tests/data/.gitattributes deleted file mode 100644 index bb1b92830695..000000000000 --- a/tests/data/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -test* -crlf diff --git a/tests/devtest.pl b/tests/devtest.pl index 0bfc71b07a53..30124a9f91d8 100755 --- a/tests/devtest.pl +++ b/tests/devtest.pl @@ -176,7 +176,7 @@ sub init_tests { } elsif($ARGV[0] eq "preprocess") { shift @ARGV; - loadtest("${TESTDIR}/test${ARGV[0]}"); + loadtest("${TESTDIR}/test${ARGV[0]}", 1); readtestkeywords(); singletest_preprocess($ARGV[0]); } diff --git a/tests/getpart.pm b/tests/getpart.pm index b555038cf724..2b6d2a63c4bd 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -217,7 +217,7 @@ sub partexists { # memoize('partexists', NORMALIZER => 'normalize_part'); # cache each result sub loadtest { - my ($file)=@_; + my ($file, $original)=@_; if(defined $xmlfile && $file eq $xmlfile) { # This test is already loaded @@ -228,7 +228,12 @@ sub loadtest { $xmlfile = ""; if(open(my $xmlh, "<", "$file")) { - binmode $xmlh; # for crapage systems, use binary + if($original) { + binmode $xmlh, ':crlf' + } + else { + binmode $xmlh; # for crapage systems, use binary + } while(<$xmlh>) { push @xml, $_; } @@ -251,16 +256,44 @@ sub fulltest { return @xml; } +sub eol_detect { + my ($content) = @_; + + my $cr = () = $content =~ /\r/g; + my $lf = () = $content =~ /\n/g; + + if($cr > 0 && $lf == 0) { + return "cr"; + } + elsif($cr == 0 && $lf > 0) { + return "lf"; + } + elsif($cr == 0 && $lf == 0) { + return "bin"; + } + elsif($cr == $lf) { + return "crlf"; + } + + return ""; +} + sub checktest { - my $anyerr = 0; + my ($file) = @_; - for my $i (0 .. $#xml) { - if(index($xml[$i], "\r") >= 0) { - print STDERR "*** getpart.pm: $xmlfile:$i: 0x0d carriage return found. Use %CR macro instead.\n"; - $anyerr = 1; + if(open(my $xmlh, '<', $file)) { + binmode $xmlh; # we want the raw data to check original newlines + my $content = do { local $/; <$xmlh> }; + close($xmlh); + + my $eol = eol_detect($content); + if($eol eq '') { + print STDERR "*** getpart.pm: $xmlfile has mixed newlines. Replace significant carriage return with %CR macro, or convert to consistent newlines.\n"; + return 1; } } - return $anyerr; + + return 0; } # write the test to the given file diff --git a/tests/runner.pm b/tests/runner.pm index 8b9c0c3f2e51..c711834e0149 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -1149,12 +1149,9 @@ sub singletest_postcheck { } } - if($checktests) { - loadtest("${TESTDIR}/test${testnum}"); # load the raw original data - if(checktest()) { - logmsg " $testnum: postcheck FAILED: issue(s) found in test data\n"; - return -1; - } + if($checktests && checktest("${TESTDIR}/test${testnum}")) { + logmsg " $testnum: postcheck FAILED: issue(s) found in test data\n"; + return -1; } return 0; @@ -1181,7 +1178,7 @@ sub runner_test_preprocess { # ignore any error here--if there were one, it would have been # caught during the selection phase and this test would not be # running now - loadtest("${TESTDIR}/test${testnum}"); + loadtest("${TESTDIR}/test${testnum}", 1); readtestkeywords(); ################################################################### diff --git a/tests/runtests.pl b/tests/runtests.pl index 761056a8ed6c..226573941d35 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1078,7 +1078,7 @@ sub singletest_shouldrun { $errorreturncode = 2; } - if(loadtest("${TESTDIR}/test${testnum}")) { + if(loadtest("${TESTDIR}/test${testnum}", 1)) { if($verbose) { # this is not a test logmsg "RUN: $testnum doesn't look like a test case\n"; @@ -1191,7 +1191,7 @@ sub singletest_shouldrun { } } - if($why && $checktests && checktest()) { + if($why && $checktests && checktest("${TESTDIR}/test${testnum}")) { logmsg "Warning: issue(s) found in test data: ${TESTDIR}/test${testnum}\n"; } @@ -1980,7 +1980,7 @@ sub singletest { ################################################################### # Load test file so CI registration can get the right data before the # runner is called - loadtest("${TESTDIR}/test${testnum}"); + loadtest("${TESTDIR}/test${testnum}", 1); ################################################################### # Register the test case with the CI environment @@ -3281,7 +3281,7 @@ sub displaylogs { sub testnumdetails { my ($desc, $numlist) = @_; foreach my $testnum (split(' ', $numlist)) { - if(!loadtest("${TESTDIR}/test${testnum}")) { + if(!loadtest("${TESTDIR}/test${testnum}", 1)) { my @info_keywords = getpart("info", "keywords"); my $testname = (getpart("client", "name"))[0]; chomp $testname; diff --git a/tests/util.py b/tests/util.py index fa4ca8272386..8ed8c892676f 100755 --- a/tests/util.py +++ b/tests/util.py @@ -75,8 +75,8 @@ def get_test_data(self, test_number): log.debug("Parsing file %s", filename) - with open(filename, "rb") as f: - contents = f.read().decode("utf-8") + with open(filename, "r", encoding='us-ascii') as f: + contents = f.read() m = REPLY_DATA.search(contents) if not m: @@ -88,5 +88,5 @@ def get_test_data(self, test_number): if __name__ == '__main__': td = TestData("./data") - data = td.get_test_data(1) + data = td.get_test_data(1451) print(data) From b39c158e4a2ca463bb2a2a8db8e21ed818fa185e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 00:32:02 +0100 Subject: [PATCH 310/885] scripts: fix shellcheck SC2046 warnings Fix SC2046: "Quote this to prevent word splitting." Ref: https://www.shellcheck.net/wiki/SC2046 Also: - shellcheck.sh: add `set -eu`. - shellcheck.sh, yamlcheck.sh: always run from repo root. - pass `--` before passing the list of files, where missing. - badwords.pl, cleancmd.pl: rework to accept `git ls-files` arguments. Requires Perl 5.22+ (2015-Jun-01) on Windows. Ref: https://perldoc.perl.org/functions/open - INTERNALS.md: require Perl 5.22 on Windows. - spacecheck.pl: formatting. - GHA/http3-linux: rework command to avoid SC2046. - stop suppressing SC2046 warnings. The yamlcheck.sh issue reported-by: Stanislav Fort (Aisle Research) Ref: 20251109163515_6eb31da3-deb2-4f4d-8327-935904f27da5 Closes #19432 --- .github/scripts/badwords.pl | 8 +++++--- .github/scripts/cleancmd.pl | 6 +++++- .github/scripts/codespell.sh | 4 ++-- .github/scripts/shellcheck.sh | 10 +++++++--- .github/scripts/spacecheck.pl | 4 ++-- .github/scripts/yamlcheck.sh | 8 +++++--- .github/workflows/checkdocs.yml | 12 ++++-------- .github/workflows/checksrc.yml | 5 +---- .github/workflows/http3-linux.yml | 3 +-- docs/INTERNALS.md | 2 +- 10 files changed, 33 insertions(+), 29 deletions(-) diff --git a/.github/scripts/badwords.pl b/.github/scripts/badwords.pl index bd66f331669b..b9b20697f547 100755 --- a/.github/scripts/badwords.pl +++ b/.github/scripts/badwords.pl @@ -79,9 +79,11 @@ sub file { close(F); } -my @files = @ARGV; - -foreach my $each (@files) { +my @filemasks = @ARGV; +open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!"; +while(my $each = <$git_ls_files>) { + chomp $each; file($each); } +close $git_ls_files; exit $errors; diff --git a/.github/scripts/cleancmd.pl b/.github/scripts/cleancmd.pl index 7b79c2e65aee..f90b31d8f1bb 100755 --- a/.github/scripts/cleancmd.pl +++ b/.github/scripts/cleancmd.pl @@ -119,6 +119,10 @@ sub process { } } -for my $f (@ARGV) { +my @filemasks = @ARGV; +open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!"; +while(my $f = <$git_ls_files>) { + chomp $f; process($f); } +close $git_ls_files; diff --git a/.github/scripts/codespell.sh b/.github/scripts/codespell.sh index bbbbef571968..dfb6467535e6 100755 --- a/.github/scripts/codespell.sh +++ b/.github/scripts/codespell.sh @@ -7,7 +7,7 @@ set -eu cd "$(dirname "${0}")"/../.. -# shellcheck disable=SC2046 +git ls-files -z | xargs -0 -r \ codespell \ --skip '.github/scripts/pyspelling.words' \ --skip '.github/scripts/typos.toml' \ @@ -16,4 +16,4 @@ codespell \ --skip 'scripts/wcurl' \ --ignore-regex '.*spellchecker:disable-line' \ --ignore-words '.github/scripts/codespell-ignore.words' \ - $(git ls-files) + -- diff --git a/.github/scripts/shellcheck.sh b/.github/scripts/shellcheck.sh index 66590ec6c7c3..59b49131ac4b 100755 --- a/.github/scripts/shellcheck.sh +++ b/.github/scripts/shellcheck.sh @@ -3,7 +3,11 @@ # # SPDX-License-Identifier: curl -# shellcheck disable=SC2046 -shellcheck --exclude=1091 \ +set -eu + +cd "$(dirname "${0}")"/../.. + +git grep -z -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' | xargs -0 -r \ +shellcheck --exclude=1091,2248 \ --enable=avoid-nullary-conditions,deprecate-which \ - $(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files)) + -- diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl index e2da2cec5d60..d0776a97d1fe 100755 --- a/.github/scripts/spacecheck.pl +++ b/.github/scripts/spacecheck.pl @@ -88,11 +88,11 @@ sub eol_detect { my $issues = 0; -open my $git_ls_files, '-|', 'git ls-files' or die "Failed running git ls-files: $!"; +open(my $git_ls_files, '-|', 'git ls-files') or die "Failed running git ls-files: $!"; while(my $filename = <$git_ls_files>) { chomp $filename; - open my $fh, '<', $filename or die "Cannot open '$filename': $!"; + open(my $fh, '<', $filename) or die "Cannot open '$filename': $!"; my $content = do { local $/; <$fh> }; close $fh; diff --git a/.github/scripts/yamlcheck.sh b/.github/scripts/yamlcheck.sh index 2431c97abc7a..4bdeff45cb96 100755 --- a/.github/scripts/yamlcheck.sh +++ b/.github/scripts/yamlcheck.sh @@ -5,9 +5,11 @@ set -eu -# shellcheck disable=SC2046 +cd "$(dirname "${0}")"/../.. + +git ls-files '*.yaml' '*.yml' -z | xargs -0 -r \ yamllint \ --format standard \ --strict \ - --config-data "$(dirname "$0")/yamlcheck.yaml" \ - $(git ls-files '*.yaml' '*.yml') + --config-data .github/scripts/yamlcheck.yaml \ + -- diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index 58f5f29f8b4c..dbdd556557b5 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -66,10 +66,10 @@ jobs: # JSON # # - name: 'trim headers off all *.md files' - # run: git ls-files -z '*.md' | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl + # run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl # # - name: 'check prose' - # run: git ls-files -z '*.md' | grep -Evz 'CHECKSRC\.md|DISTROS\.md|curl_mprintf\.md|CURLOPT_INTERFACE\.md|interface\.md' | xargs -0 proselint -- README + # run: git ls-files '*.md' -z | grep -Evz 'CHECKSRC\.md|DISTROS\.md|curl_mprintf\.md|CURLOPT_INTERFACE\.md|interface\.md' | xargs -0 proselint -- README # # # This is for CHECKSRC and files with aggressive exclamation mark needs # - name: 'create second proselint config' @@ -109,9 +109,7 @@ jobs: persist-credentials: false - name: 'trim all *.md files in docs/' - run: | - # shellcheck disable=SC2046 - .github/scripts/cleancmd.pl $(find docs -name '*.md') + run: .github/scripts/cleancmd.pl 'docs/*.md' - name: 'install' run: | @@ -140,9 +138,7 @@ jobs: persist-credentials: false - name: 'badwords' - run: | - # shellcheck disable=SC2046 - .github/scripts/badwords.pl < .github/scripts/badwords.txt $(git ls-files '**.md') docs/TODO docs/KNOWN_BUGS packages/OS400/README.OS400 + run: .github/scripts/badwords.pl '**.md' docs/TODO docs/KNOWN_BUGS packages/OS400/README.OS400 < .github/scripts/badwords.txt - name: 'verify synopsis' run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 8557ec708ccf..8f79f1ca6d47 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -164,7 +164,4 @@ jobs: # we allow some extra in source code - name: 'badwords' - run: | - # shellcheck disable=SC2046 - grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | \ - .github/scripts/badwords.pl $(git ls-files -- src lib include) + run: grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index c99dcd90acb3..d242c0611601 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -587,8 +587,7 @@ jobs: cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose ln -s libquiche.so target/release/libquiche.so.0 mkdir -v quiche/deps/boringssl/src/lib - # shellcheck disable=SC2046 - ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/ + find target/release \( -name libcrypto.a -o -name libssl.a \) -exec ln -vnf '{}' quiche/deps/boringssl/src/lib \; # include dir # /home/runner/quiche/quiche/deps/boringssl/src/include diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index b6b00e924a73..ac90d3fe8270 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -48,7 +48,7 @@ versions of libs and build tools. - GNU Autoconf 2.59 - GNU Automake 1.7 - GNU M4 1.4 - - perl 5.8 + - perl 5.8 (5.22 on Windows) - roffit 0.5 - cmake 3.7 From 77be4a7ab2b5a0c633b9107fd286bda1f57e4725 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 01:27:25 +0100 Subject: [PATCH 311/885] mdlinkcheck: pass curl arguments to `open()` as list To prevent misinterpreting quotes or other special characters. Requires Perl 5.22+ (2015-Jun-01) on Windows. Ref: https://perldoc.perl.org/functions/open Closes #19437 --- scripts/mdlinkcheck | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index bbd6ac46022b..842f0c976658 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -138,13 +138,17 @@ sub checkurl { } print "check $url\n"; - my $curlcmd="curl -ILfsm10 --retry 2 --retry-delay 5 -A \"Mozilla/curl.se link-probe\""; $url =~ s/\+/%2B/g; - if($url =~ /[\"\'\n]/) { - print STDERR "Bad URL in markdown: %s\n", $url{$url}; + my @content; + if(open(my $fh, '-|', 'curl', '-ILfsm10', '--retry', '2', '--retry-delay', '5', + '-A', 'Mozilla/curl.se link-probe', $url)) { + @content = <$fh>; + close $fh; + } + else { + print STDERR "FAIL\n"; return 1; # fail } - my @content = `$curlcmd \"$url\"`; if(!$content[0]) { print STDERR "FAIL\n"; return 1; # fail From a8e46c5ab1d9c0eda0536260c8ef0ea8fa745226 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 15:08:19 +0100 Subject: [PATCH 312/885] verify-release: update to avoid shellcheck warning SC2034 ``` SC2034: dl appears unused ``` Also to shorten the code. Closes #19449 --- scripts/verify-release | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/verify-release b/scripts/verify-release index 2f7a0bf89fea..b24d9b370d5a 100755 --- a/scripts/verify-release +++ b/scripts/verify-release @@ -40,12 +40,7 @@ if [ -z "$tarball" ]; then exit fi -i="0" - -# shellcheck disable=SC2034 -for dl in curl-*; do - i=$((i + 1)) -done +i="$(find . -maxdepth 1 -type d -name 'curl-*' | wc -l)" if test "$i" -gt 1; then echo "multiple curl-* entries found, disambiguate please" From 6aab1dc2639d4fc8aaaa1190914b0491e029dace Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 16:49:11 +0100 Subject: [PATCH 313/885] scripts: use end-of-options marker in `find -exec` commands Closes #19450 --- .github/workflows/checksrc.yml | 2 +- .github/workflows/http3-linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/non-native.yml | 2 +- .github/workflows/windows.yml | 10 +++++----- Makefile.am | 2 +- appveyor.sh | 2 +- scripts/maketgz | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 8f79f1ca6d47..7aa8faf6a234 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -91,7 +91,7 @@ jobs: - name: 'pytype' run: | source ~/venv/bin/activate - find . -name '*.py' -exec pytype -j auto -k {} + + find . -name '*.py' -exec pytype -j auto -k -- {} + - name: 'ruff' run: | diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index d242c0611601..a844eb6c1422 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -587,7 +587,7 @@ jobs: cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose ln -s libquiche.so target/release/libquiche.so.0 mkdir -v quiche/deps/boringssl/src/lib - find target/release \( -name libcrypto.a -o -name libssl.a \) -exec ln -vnf '{}' quiche/deps/boringssl/src/lib \; + find target/release \( -name libcrypto.a -o -name libssl.a \) -exec ln -vnf -- '{}' quiche/deps/boringssl/src/lib \; # include dir # /home/runner/quiche/quiche/deps/boringssl/src/include diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0e0d03bc4f01..fc624dc09a5d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -184,7 +184,7 @@ jobs: fi - name: 'curl info' - run: find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -exec file '{}' \; + run: find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -exec file -- '{}' \; - name: 'build tests' run: | diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 523a6761e6fd..7813c694a5d8 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -310,7 +310,7 @@ jobs: fi - name: 'curl info' - run: find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -exec file '{}' \; + run: find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -exec file -- '{}' \; - name: 'build tests' run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bcb846d80656..15a586b12fc7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -133,7 +133,7 @@ jobs: timeout-minutes: 1 run: | PATH=/usr/bin - find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \; + find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file -- '{}' \; if [ "${MATRIX_BUILD}" = 'cmake' ]; then PATH="$PWD/bld/lib:$PATH" fi @@ -337,7 +337,7 @@ jobs: # avoid libtool's curl.exe wrapper for shared builds mv bld/src/.libs/curl.exe bld/src/curl.exe || true fi - find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \; + find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file -- '{}' \; if [ "${MATRIX_TEST}" != 'uwp' ]; then # curl: error initializing curl library bld/src/curl.exe --disable --version fi @@ -548,7 +548,7 @@ jobs: - name: 'curl -V' timeout-minutes: 1 run: | - /usr/bin/find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \; + /usr/bin/find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file -- '{}' \; PATH="$PWD/bld/lib:$PATH" bld/src/curl.exe --disable --version @@ -667,7 +667,7 @@ jobs: fi - name: 'curl info' - run: find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \; + run: find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file -- '{}' \; - name: 'build tests' if: ${{ matrix.build == 'cmake' && matrix.compiler != 'clang-tidy' }} # Save time by skipping this for autotools and clang-tidy @@ -907,7 +907,7 @@ jobs: - name: 'curl -V' timeout-minutes: 1 run: | - /usr/bin/find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file '{}' \; + /usr/bin/find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file -- '{}' \; if [ "${MATRIX_PLAT}" != 'uwp' ]; then # Missing: ucrtbased.dll, VCRUNTIME140D.dll, VCRUNTIME140D_APP.dll PATH="$PWD/bld/lib/${MATRIX_TYPE}:$PATH" "bld/src/${MATRIX_TYPE}/curl.exe" --disable --version diff --git a/Makefile.am b/Makefile.am index 7b2f05f92e56..f60c50e5ac54 100644 --- a/Makefile.am +++ b/Makefile.am @@ -91,7 +91,7 @@ pkgconfig_DATA = libcurl.pc dist-hook: rm -rf $(top_builddir)/tests/log - find $(distdir) -name "*.dist" -exec rm {} \; + find $(distdir) -name "*.dist" -exec rm -- {} \; (distit=`find $(srcdir) -name "*.dist" | grep -v Makefile`; \ for file in $$distit; do \ strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ diff --git a/appveyor.sh b/appveyor.sh index 4be76095ee4a..81407f7f3318 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -98,7 +98,7 @@ elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then curl="build/Win32/${VC_VERSION}/${PRJ_CFG}/curld.exe" fi -find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file '{}' \; +find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file -- '{}' \; if [ -z "${SKIP_RUN:-}" ]; then "${curl}" --disable --version else diff --git a/scripts/maketgz b/scripts/maketgz index d7059554d34b..e6bc53dcdc1b 100755 --- a/scripts/maketgz +++ b/scripts/maketgz @@ -70,7 +70,7 @@ fi # As a precaution, remove all *.dist files that may be lying around, to reduce # the risk of old leftovers getting shipped. echo "removing all old *.dist files" -find . -name "*.dist" -exec rm {} \; +find . -name "*.dist" -exec rm -- {} \; numeric="$(printf "%02x%02x%02x\n" "$major" "$minor" "$patch")" @@ -184,7 +184,7 @@ retar() { mkdir "$tempdir" cd "$tempdir" gzip -dc "../$targz" | tar -xf - - find curl-* -depth -exec touch -c -t "$filestamp" '{}' + + find curl-* -depth -exec touch -c -t "$filestamp" -- '{}' + tar --create --format=ustar --owner=0 --group=0 --numeric-owner --sort=name curl-* | gzip --best --no-name > out.tar.gz mv out.tar.gz ../ cd .. From af5a1647afa8aaf7cafc1e87af529a4cd48cb240 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 16:54:57 +0100 Subject: [PATCH 314/885] OS400/makefile.sh: fix shellcheck warning SC2038 Also: - OS400/makefile.sh: use end-of-options marker in xargs command. - OS400/make-tests.sh: drop warning suppression. Seems to not trigger anymore as of shellcheck 0.11.0 Closes #19451 --- packages/OS400/make-tests.sh | 2 +- packages/OS400/makefile.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/OS400/make-tests.sh b/packages/OS400/make-tests.sh index 3a2125965cfc..4ddc537487b2 100755 --- a/packages/OS400/make-tests.sh +++ b/packages/OS400/make-tests.sh @@ -58,7 +58,7 @@ build_all_programs() for FLAG in ${PGMCFLAGS} do case "${FLAG}" in - -D?*) # shellcheck disable=SC2001 + -D?*) DEFINE="$(echo "${FLAG}" | sed 's/^..//')" PGMDFNS="${PGMDFNS} '${DEFINE}'" ;; diff --git a/packages/OS400/makefile.sh b/packages/OS400/makefile.sh index 7f7584521589..b40094afd662 100755 --- a/packages/OS400/makefile.sh +++ b/packages/OS400/makefile.sh @@ -35,8 +35,7 @@ cd "${TOPDIR}" || exit 1 # Make sure all files are UTF8-encoded. -# shellcheck disable=SC2038 -find "${TOPDIR}" -type f -print | xargs ls -S | while read -r CCSID FILE +find "${TOPDIR}" -type f -print0 | xargs -0 ls -S -- | while read -r CCSID FILE do if [ "${CCSID}" != 1208 ] then CMD="CPY OBJ('${FILE}') TOOBJ('${FILE}') FROMCCSID(*OBJ)" CMD="${CMD} TOCCSID(1208) DTAFMT(*TEXT) REPLACE(*YES)" From cdb7ac11b48ad716ee58782f48465548d753f897 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 21:26:25 +0100 Subject: [PATCH 315/885] GHA/linux: disable test 776 in valgrind jobs to avoid delay Saving ~30 seconds in jobs affected. Closes #19456 --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4805bf16be03..06f058c92934 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -741,6 +741,7 @@ jobs: run: | if [ "${TEST_TARGET}" = 'test-ci' ] && [[ "${MATRIX_INSTALL_PACKAGES}" = *'valgrind'* ]]; then TFLAGS+=' -j6' + TFLAGS+=' !776' # skip long-running flaky test if [[ "${MATRIX_INSTALL_PACKAGES}" = *'libgss-dev'* ]]; then TFLAGS+=' ~2077 ~2078' # memory leaks from Curl_auth_decode_spnego_message() -> gss_init_sec_context() fi From b81d30ade314af7c3197dfcef2d978428b96b009 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 22:43:59 +0100 Subject: [PATCH 316/885] pytest: fix conditions for test_02_28 - allow 02_28 to run in HTTP/1.1 without H2 support again. Follow-up to 3752de465d70552106b2527fbf821aee525e53e2 #19412 - fix to skip 02_28 for all protocols for curl without compression support (either zlib, brotli or ztsd). Closes #19458 --- tests/http/test_02_download.py | 4 +++- tests/http/testenv/env.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index d2d149f20fb9..13d5d2a0f0a1 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -581,7 +581,9 @@ def test_02_27c_paused_no_cl(self, env: Env, httpd, nghttpx, proto): @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, proto): - if not env.have_h2_curl(): + if not env.have_compressed_curl(): + pytest.skip("--compressed not supported") + if proto == 'h2' and not env.have_h2_curl(): pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index 859b704a35a3..31db10499457 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -406,6 +406,12 @@ def have_h2_curl() -> bool: def have_h3_curl() -> bool: return 'http3' in Env.CONFIG.curl_props['features'] + @staticmethod + def have_compressed_curl() -> bool: + return 'brotli' in Env.CONFIG.curl_props['libs'] or \ + 'zlib' in Env.CONFIG.curl_props['libs'] or \ + 'zstd' in Env.CONFIG.curl_props['libs'] + @staticmethod def curl_uses_lib(libname: str) -> bool: return libname.lower() in Env.CONFIG.curl_props['libs'] From 67ef4a34f2e11aa45f0965909d0dd542643deede Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Nov 2025 22:30:24 +0100 Subject: [PATCH 317/885] GHA/linux: build and enable nghttp2 for Fil-C job pytests after: 527 passed, 286 skipped pytests before: 392 passed, 423 skipped runtests after: TESTDONE: 1646 tests out of 1646 reported OK: 100% runtests before: TESTDONE: 1643 tests out of 1643 reported OK: 100% Ref: b81d30ade314af7c3197dfcef2d978428b96b009 #19458 Closes #19457 --- .github/workflows/linux.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 06f058c92934..773e5b4e919d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -55,6 +55,8 @@ env: RUSTLS_VERSION: 0.15.0 # handled in renovate.json OPENLDAP_VERSION: 2.6.10 + # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com + NGHTTP2_VERSION: 1.68.0 # renovate: datasource=github-tags depName=pizlonator/fil-c versioning=semver-partial registryUrl=https://github.com FIL_C_VERSION: 0.674 @@ -216,14 +218,15 @@ jobs: configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity - name: 'libressl Fil-C' - install_steps: filc libressl-filc pytest + install_steps: filc libressl-filc nghttp2-filc pytest tflags: '!776' # adds 1-9 minutes to the test run step, and fails consistently CC: /home/runner/filc/build/bin/filcc + PKG_CONFIG_PATH: /home/runner/nghttp2/lib/pkgconfig generate: >- -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_UNITY_BUILD=OFF -DOPENSSL_ROOT_DIR=/home/runner/libressl -DCURL_USE_LIBPSL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF - -DUSE_NGHTTP2=OFF -DCURL_DISABLE_LDAP=ON -DUSE_LIBIDN2=OFF -DCURL_USE_LIBSSH2=OFF + -DCURL_DISABLE_LDAP=ON -DUSE_LIBIDN2=OFF -DCURL_USE_LIBSSH2=OFF - name: 'clang-tidy' install_packages: clang-tidy libssl-dev libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev libkrb5-dev librtmp-dev libgnutls28-dev @@ -435,6 +438,27 @@ jobs: cmake --build . cmake --install . + - name: 'cache nghttp2 (filc)' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: cache-nghttp2-filc + env: + cache-name: cache-nghttp2-filc + with: + path: ~/nghttp2 + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.FIL_C_VERSION }} + + - name: 'build nghttp2 (filc)' + if: ${{ contains(matrix.build.install_steps, 'nghttp2-filc') && steps.cache-nghttp2-filc.outputs.cache-hit != 'true' }} + run: | + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ + --location "https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.xz" | tar -xJ + cd "nghttp2-${NGHTTP2_VERSION}" + cmake -B . -G Ninja -DENABLE_LIB_ONLY=ON -DBUILD_TESTING=OFF -DENABLE_DOC=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/nghttp2 \ + -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_C_COMPILER=/home/runner/filc/build/bin/filcc + cmake --build . + cmake --install . + - name: 'cache wolfssl (all)' if: ${{ contains(matrix.build.install_steps, 'wolfssl-all') }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 From c545e10fa75c04b4ded093573a0c15077937c51b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 09:42:16 +0100 Subject: [PATCH 318/885] sftp: fix range downloads in both SSH backends When asking for the last N bytes of a file, and that size was larger than the file size, it would miss the first byte due to a logic error. The fixed range parser is now made a common function in the file now renamed to vssh.c (from curl_path.c) - used by both backends. Unit test 2605 verifies the parser. Reported-by: Stanislav Fort (Aisle Research) Closes #19460 --- lib/Makefile.inc | 4 +- lib/vssh/libssh.c | 45 ++---------- lib/vssh/libssh2.c | 43 ++---------- lib/vssh/ssh.h | 2 +- lib/vssh/{curl_path.c => vssh.c} | 49 +++++++++++++- lib/vssh/{curl_path.h => vssh.h} | 4 ++ tests/data/Makefile.am | 2 +- tests/data/test2605 | 20 ++++++ tests/data/test637 | 2 +- tests/unit/Makefile.inc | 2 +- tests/unit/unit2604.c | 2 +- tests/unit/unit2605.c | 113 +++++++++++++++++++++++++++++++ 12 files changed, 204 insertions(+), 84 deletions(-) rename lib/vssh/{curl_path.c => vssh.c} (80%) rename lib/vssh/{curl_path.h => vssh.h} (88%) create mode 100644 tests/data/test2605 create mode 100644 tests/unit/unit2605.c diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 8b506febcfab..4bdf293f8976 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -133,10 +133,10 @@ LIB_VQUIC_HFILES = \ LIB_VSSH_CFILES = \ vssh/libssh.c \ vssh/libssh2.c \ - vssh/curl_path.c + vssh/vssh.c LIB_VSSH_HFILES = \ - vssh/curl_path.h \ + vssh/vssh.h \ vssh/ssh.h LIB_CFILES = \ diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index f5de9f3e84fb..781c5dafc3d4 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -64,7 +64,7 @@ #include "../multiif.h" #include "../select.h" #include "../curlx/warnless.h" -#include "curl_path.h" +#include "vssh.h" #ifdef HAVE_UNISTD_H #include @@ -1329,44 +1329,11 @@ static int myssh_in_SFTP_DOWNLOAD_STAT(struct Curl_easy *data, return myssh_to_ERROR(data, sshc, CURLE_BAD_DOWNLOAD_RESUME); } if(data->state.use_range) { - curl_off_t from, to; - const char *p = data->state.range; - int from_t, to_t; - - from_t = curlx_str_number(&p, &from, CURL_OFF_T_MAX); - if(from_t == STRE_OVERFLOW) - return myssh_to_ERROR(data, sshc, CURLE_RANGE_ERROR); - - curlx_str_passblanks(&p); - (void)curlx_str_single(&p, '-'); - - to_t = curlx_str_numblanks(&p, &to); - if(to_t == STRE_OVERFLOW) - return myssh_to_ERROR(data, sshc, CURLE_RANGE_ERROR); - - if((to_t == STRE_NO_NUM) || (to >= size)) { - to = size - 1; - } - - if(from_t == STRE_NO_NUM) { - /* from is relative to end of file */ - from = size - to; - to = size - 1; - } - if(from > size) { - failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%" - FMT_OFF_T ")", from, size); - return myssh_to_ERROR(data, sshc, CURLE_BAD_DOWNLOAD_RESUME); - } - if(from > to) { - from = to; - size = 0; - } - else { - if((to - from) == CURL_OFF_T_MAX) - return myssh_to_ERROR(data, sshc, CURLE_RANGE_ERROR); - size = to - from + 1; - } + curl_off_t from; + CURLcode result = Curl_ssh_range(data, data->state.range, size, + &from, &size); + if(result) + return myssh_to_ERROR(data, sshc, result); rc = sftp_seek64(sshc->sftp_file, from); if(rc) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index ee82396753c9..e83bc682b9d0 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -63,7 +63,7 @@ #include "../select.h" #include "../curlx/fopen.h" #include "../curlx/warnless.h" -#include "curl_path.h" +#include "vssh.h" #include "../curlx/strparse.h" #include "../curlx/base64.h" /* for base64 encoding/decoding */ @@ -1434,42 +1434,11 @@ sftp_download_stat(struct Curl_easy *data, return CURLE_BAD_DOWNLOAD_RESUME; } if(data->state.use_range) { - curl_off_t from, to; - const char *p = data->state.range; - int to_t, from_t; - - from_t = curlx_str_number(&p, &from, CURL_OFF_T_MAX); - if(from_t == STRE_OVERFLOW) - return CURLE_RANGE_ERROR; - curlx_str_passblanks(&p); - (void)curlx_str_single(&p, '-'); - - to_t = curlx_str_numblanks(&p, &to); - if(to_t == STRE_OVERFLOW) - return CURLE_RANGE_ERROR; - if((to_t == STRE_NO_NUM) /* no "to" value given */ - || (to >= size)) { - to = size - 1; - } - if(from_t) { - /* from is relative to end of file */ - from = size - to; - to = size - 1; - } - if(from > size) { - failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%" - FMT_OFF_T ")", from, (curl_off_t)attrs.filesize); - return CURLE_BAD_DOWNLOAD_RESUME; - } - if(from > to) { - from = to; - size = 0; - } - else { - if((to - from) == CURL_OFF_T_MAX) - return CURLE_RANGE_ERROR; - size = to - from + 1; - } + curl_off_t from; + CURLcode result = Curl_ssh_range(data, data->state.range, size, + &from, &size); + if(result) + return result; libssh2_sftp_seek64(sshc->sftp_handle, (libssh2_uint64_t)from); } diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index e09111e63f66..9d03b52f407b 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -36,7 +36,7 @@ #include #endif -#include "curl_path.h" +#include "vssh.h" /* meta key for storing protocol meta at easy handle */ #define CURL_META_SSH_EASY "meta:proto:ssh:easy" diff --git a/lib/vssh/curl_path.c b/lib/vssh/vssh.c similarity index 80% rename from lib/vssh/curl_path.c rename to lib/vssh/vssh.c index a6d572520fac..e33386a16aa5 100644 --- a/lib/vssh/curl_path.c +++ b/lib/vssh/vssh.c @@ -26,9 +26,10 @@ #ifdef USE_SSH -#include "curl_path.h" +#include "vssh.h" #include #include "../curlx/strparse.h" +#include "../curl_trc.h" #include "../curl_memory.h" #include "../escape.h" #include "../memdebug.h" @@ -196,4 +197,50 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) return CURLE_QUOTE_ERROR; } +CURLcode Curl_ssh_range(struct Curl_easy *data, + const char *p, curl_off_t filesize, + curl_off_t *startp, curl_off_t *sizep) +{ + curl_off_t from, to; + int to_t; + int from_t = curlx_str_number(&p, &from, CURL_OFF_T_MAX); + if(from_t == STRE_OVERFLOW) + return CURLE_RANGE_ERROR; + curlx_str_passblanks(&p); + (void)curlx_str_single(&p, '-'); + + to_t = curlx_str_numblanks(&p, &to); + if((to_t == STRE_OVERFLOW) || (to_t && from_t) || *p) + return CURLE_RANGE_ERROR; + + if(from_t) { + /* no start point given, set from relative to end of file */ + if(!to) + /* "-0" is not a fine range */ + return CURLE_RANGE_ERROR; + else if(to > filesize) + to = filesize; + from = filesize - to; + to = filesize - 1; + } + else if(from > filesize) { + failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%" + FMT_OFF_T ")", from, filesize); + return CURLE_RANGE_ERROR; + } + else if((to_t == STRE_NO_NUM) || (to >= filesize)) + to = filesize - 1; + + if(from > to) { + failf(data, "Bad range: start offset larger than end offset"); + return CURLE_RANGE_ERROR; + } + if((to - from) == CURL_OFF_T_MAX) + return CURLE_RANGE_ERROR; + + *startp = from; + *sizep = to - from + 1; + return CURLE_OK; +} + #endif /* if SSH is used */ diff --git a/lib/vssh/curl_path.h b/lib/vssh/vssh.h similarity index 88% rename from lib/vssh/curl_path.h rename to lib/vssh/vssh.h index 1c167f96603a..1a4e597b156d 100644 --- a/lib/vssh/curl_path.h +++ b/lib/vssh/vssh.h @@ -33,4 +33,8 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, char **path); CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir); + +CURLcode Curl_ssh_range(struct Curl_easy *data, + const char *range, curl_off_t filesize, + curl_off_t *startp, curl_off_t *sizep); #endif /* HEADER_CURL_PATH_H */ diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index bbd97853a33b..bdec674dff26 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -265,7 +265,7 @@ test2400 test2401 test2402 test2403 test2404 test2405 test2406 \ \ test2500 test2501 test2502 test2503 \ \ -test2600 test2601 test2602 test2603 test2604 \ +test2600 test2601 test2602 test2603 test2604 test2605 \ \ test2700 test2701 test2702 test2703 test2704 test2705 test2706 test2707 \ test2708 test2709 test2710 test2711 test2712 test2713 test2714 test2715 \ diff --git a/tests/data/test2605 b/tests/data/test2605 new file mode 100644 index 000000000000..81b580b7b454 --- /dev/null +++ b/tests/data/test2605 @@ -0,0 +1,20 @@ + + + +unittest +sftp + + + +# +# Client-side + + +unittest +sftp + + +Curl_ssh_range unit test + + + diff --git a/tests/data/test637 b/tests/data/test637 index 83da596fed03..30529487514f 100644 --- a/tests/data/test637 +++ b/tests/data/test637 @@ -35,7 +35,7 @@ for ssh test # Verify data after the test has been "shot" -36 +33 diff --git a/tests/unit/Makefile.inc b/tests/unit/Makefile.inc index f64a1630c859..7027973d2f93 100644 --- a/tests/unit/Makefile.inc +++ b/tests/unit/Makefile.inc @@ -40,6 +40,6 @@ TESTS_C = \ unit1650.c unit1651.c unit1652.c unit1653.c unit1654.c unit1655.c unit1656.c \ unit1657.c unit1658.c unit1660.c unit1661.c unit1663.c unit1664.c \ unit1979.c unit1980.c \ - unit2600.c unit2601.c unit2602.c unit2603.c unit2604.c \ + unit2600.c unit2601.c unit2602.c unit2603.c unit2604.c unit2605.c \ unit3200.c unit3205.c \ unit3211.c unit3212.c unit3213.c unit3214.c diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index 7cb82bbcf1cf..13f7e80d8acb 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -22,7 +22,7 @@ * ***************************************************************************/ #include "unitcheck.h" -#include "vssh/curl_path.h" +#include "vssh/vssh.h" #include "memdebug.h" static CURLcode test_unit2604(const char *arg) diff --git a/tests/unit/unit2605.c b/tests/unit/unit2605.c new file mode 100644 index 000000000000..b94e87e78cea --- /dev/null +++ b/tests/unit/unit2605.c @@ -0,0 +1,113 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ +#include "unitcheck.h" +#include "vssh/vssh.h" +#include "memdebug.h" + +static CURLcode test_unit2605(const char *arg) +{ + UNITTEST_BEGIN_SIMPLE + +#ifdef USE_SSH + CURL *curl; + struct range { + const char *r; + curl_off_t filesize; + curl_off_t start; + curl_off_t size; + CURLcode result; + }; + + int i; + struct range list[] = { + { "0-9", 100, 0, 10, CURLE_OK}, + { "1-10", 100, 1, 10, CURLE_OK}, + { "222222-222222", 300000, 222222, 1, CURLE_OK}, + { "4294967296 - 4294967297", 4294967298, 4294967296, 2, CURLE_OK}, + { "-10", 100, 90, 10, CURLE_OK}, + { "-20", 100, 80, 20, CURLE_OK}, + { "-1", 100, 99, 1, CURLE_OK}, + { "-0", 100, 0, 0, CURLE_RANGE_ERROR}, + { "--2", 100, 0, 0, CURLE_RANGE_ERROR}, + { "-100", 100, 0, 100, CURLE_OK}, + { "-101", 100, 0, 100, CURLE_OK}, + { "-1000", 100, 0, 100, CURLE_OK}, + { "2-1000", 100, 2, 98, CURLE_OK}, + { ".2-3", 100, 0, 0, CURLE_RANGE_ERROR}, + { "+2-3", 100, 0, 0, CURLE_RANGE_ERROR}, + { "2 - 3", 100, 2, 2, CURLE_OK}, + { " 2 - 3", 100, 2, 2, CURLE_RANGE_ERROR}, /* no leading space */ + { "2 - 3 ", 100, 2, 2, CURLE_RANGE_ERROR}, /* no trailing space */ + { "3-2", 100, 0, 0, CURLE_RANGE_ERROR}, + { "2.-3", 100, 0, 0, CURLE_RANGE_ERROR}, + { "-3-2", 100, 0, 0, CURLE_RANGE_ERROR}, + { "101-102", 100, 0, 0, CURLE_RANGE_ERROR}, + { "0-", 100, 0, 100, CURLE_OK}, + { "1-", 100, 1, 99, CURLE_OK}, + { "99-", 100, 99, 1, CURLE_OK}, + { "100-", 100, 0, 0, CURLE_RANGE_ERROR}, + { NULL, 0, 0, 0, CURLE_OK } + }; + + curl_global_init(CURL_GLOBAL_ALL); + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + + for(i = 0; list[i].r; i++) { + curl_off_t start; + curl_off_t size; + CURLcode result; + curl_mprintf("%u: '%s' (file size: %" FMT_OFF_T ")\n", + i, list[i].r, list[i].filesize); + result = Curl_ssh_range(curl, list[i].r, list[i].filesize, + &start, &size); + if(result != list[i].result) { + curl_mprintf("... returned %d\n", result); + unitfail++; + } + if(!result) { + if(start != list[i].start) { + curl_mprintf("... start (%" FMT_OFF_T ") was not %" FMT_OFF_T " \n", + start, list[i].start); + unitfail++; + } + if(size != list[i].size) { + curl_mprintf("... size (%" FMT_OFF_T ") was not %" FMT_OFF_T " \n", + size, list[i].size); + unitfail++; + } + } + } + curl_easy_cleanup(curl); + } + curl_global_cleanup(); + + if(!unitfail) + curl_mprintf("ok\n"); + +#endif + + UNITTEST_END_SIMPLE +} From 3f1a8dbb983ebc60062bbf44a25b9c51bfacd648 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 10 Nov 2025 00:24:10 +0800 Subject: [PATCH 319/885] rustls: fix a potential memory issue Closes #19425 --- lib/vtls/rustls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 262f016f9fea..ab2290927867 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -1098,8 +1098,6 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, &backend->config); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to build client config"); - rustls_client_config_builder_free(config_builder); - rustls_client_config_free(backend->config); return CURLE_SSL_CONNECT_ERROR; } @@ -1109,6 +1107,8 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, &rconn); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "rustls_client_connection_new"); + rustls_client_config_free(backend->config); + backend->config = NULL; return CURLE_COULDNT_CONNECT; } DEBUGASSERT(rconn); From 10b2dd8e6b1376aa74b8a415f02544d7f494cd19 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 10 Nov 2025 23:55:02 +0800 Subject: [PATCH 320/885] krb5_sspi: unify a part of error handling Closes #19452 --- lib/vauth/krb5_sspi.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index c1953e114569..cad2412d1794 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -250,6 +250,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, struct kerberos5data *krb5, struct bufref *out) { + CURLcode result = CURLE_OK; size_t offset = 0; size_t messagelen = 0; size_t appdatalen = 0; @@ -349,9 +350,8 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, messagelen += strlen(authzid); message = malloc(messagelen); if(!message) { - free(trailer); - - return CURLE_OUT_OF_MEMORY; + result = CURLE_OUT_OF_MEMORY; + goto out; } /* Populate the message with the security layer and client supported receive @@ -369,10 +369,8 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, /* Allocate the padding */ padding = malloc(sizes.cbBlockSize); if(!padding) { - free(message); - free(trailer); - - return CURLE_OUT_OF_MEMORY; + result = CURLE_OUT_OF_MEMORY; + goto out; } /* Setup the "authentication data" security buffer */ @@ -393,14 +391,11 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, status = Curl_pSecFn->EncryptMessage(krb5->context, KERB_WRAP_NO_ENCRYPT, &wrap_desc, 0); if(status != SEC_E_OK) { - free(padding); - free(message); - free(trailer); - if(status == SEC_E_INSUFFICIENT_MEMORY) - return CURLE_OUT_OF_MEMORY; - - return CURLE_AUTH_ERROR; + result = CURLE_OUT_OF_MEMORY; + else + result = CURLE_AUTH_ERROR; + goto out; } /* Allocate the encryption (wrap) buffer */ @@ -408,11 +403,8 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, wrap_buf[2].cbBuffer; appdata = malloc(appdatalen); if(!appdata) { - free(padding); - free(message); - free(trailer); - - return CURLE_OUT_OF_MEMORY; + result = CURLE_OUT_OF_MEMORY; + goto out; } /* Populate the encryption buffer */ @@ -422,11 +414,15 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, offset += wrap_buf[1].cbBuffer; memcpy(appdata + offset, wrap_buf[2].pvBuffer, wrap_buf[2].cbBuffer); +out: /* Free all of our local buffers */ free(padding); free(message); free(trailer); + if(result) + return result; + /* Return the response. */ Curl_bufref_set(out, appdata, appdatalen, curl_free); return CURLE_OK; From 0dacc0796960c9caf5c31e7cbde8c5c062797b3c Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 11 Nov 2025 00:29:29 +0800 Subject: [PATCH 321/885] cf-https-connect: allocate ctx at first in cf_hc_create() Closes #19454 --- lib/cf-https-connect.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index 5d6724dbc5e2..085b93da64af 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -587,20 +587,22 @@ static CURLcode cf_hc_create(struct Curl_cfilter **pcf, CURLcode result = CURLE_OK; size_t i; + ctx = calloc(1, sizeof(*ctx)); + if(!ctx) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } + DEBUGASSERT(alpnids); DEBUGASSERT(alpn_count); DEBUGASSERT(alpn_count <= CURL_ARRAYSIZE(ctx->ballers)); if(!alpn_count || (alpn_count > CURL_ARRAYSIZE(ctx->ballers))) { failf(data, "https-connect filter create with unsupported %zu ALPN ids", alpn_count); - return CURLE_FAILED_INIT; - } - - ctx = calloc(1, sizeof(*ctx)); - if(!ctx) { - result = CURLE_OUT_OF_MEMORY; + result = CURLE_FAILED_INIT; goto out; } + for(i = 0; i < alpn_count; ++i) cf_hc_baller_assign(&ctx->ballers[i], alpnids[i], def_transport); for(; i < CURL_ARRAYSIZE(ctx->ballers); ++i) From 28380bb9fd1d6eb25344220d569df3f80ded7363 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 00:46:53 +0100 Subject: [PATCH 322/885] progress: show fewer digits Without unit, show up to 99999 "raw" (5 digits). After that, prefer to show the number as less than 1000 per unit and use single decimal fraction. Like '123.4M' (spending 6 characters). This now makes the largest possible size to show 8.0E (exabytes). Probably makes the output easier to read. Fixes #19431 Reported-by: Fd929c2CE5fA on github Closes #19433 --- lib/progress.c | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/lib/progress.c b/lib/progress.c index 928461043ab2..211212d4ed3a 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -67,33 +67,27 @@ static void time2str(char *r, curl_off_t seconds) Add suffix k, M, G when suitable... */ static char *max6data(curl_off_t bytes, char *max6) { - /* a signed 64-bit value is 8192 petabytes maximum */ - const char unit[] = { 'k', 'M', 'G', 'T', 'P', 0 }; - int k = 0; - if(bytes < 1000000) { - curl_msnprintf(max6, 7, "%5" CURL_FORMAT_CURL_OFF_T, bytes); - return max6; + /* a signed 64-bit value is 8192 petabytes maximum, shown as + 8.0E (exabytes)*/ + if(bytes < 100000) + curl_msnprintf(max6, 7, "%6" CURL_FORMAT_CURL_OFF_T, bytes); + else { + const char unit[] = { 'k', 'M', 'G', 'T', 'P', 'E', 0 }; + int k = 0; + curl_off_t nbytes; + do { + nbytes = bytes / 1024; + if(nbytes < 1000) + break; + bytes = nbytes; + k++; + DEBUGASSERT(unit[k]); + } while(unit[k]); + /* xxx.yU */ + curl_msnprintf(max6, 7, "%3" CURL_FORMAT_CURL_OFF_T + ".%" CURL_FORMAT_CURL_OFF_T "%c", nbytes, + (bytes%1024) / (1024/10), unit[k]); } - - do { - curl_off_t nbytes = bytes / 1024; - if(nbytes < 1000) { - /* xxx.yU */ - curl_msnprintf(max6, 7, "%3" CURL_FORMAT_CURL_OFF_T - ".%" CURL_FORMAT_CURL_OFF_T "%c", nbytes, - (bytes%1024) / (1024/10), unit[k]); - break; - } - else if(nbytes < 100000) { - /* xxxxxU */ - curl_msnprintf(max6, 7, "%5" CURL_FORMAT_CURL_OFF_T "%c", - nbytes, unit[k]); - break; - } - bytes = nbytes; - k++; - DEBUGASSERT(unit[k]); - } while(unit[k]); return max6; } #endif From 5bd670c39341087d15e90db1abd89b9187a07ed8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 09:06:13 +0100 Subject: [PATCH 323/885] wolfssl: avoid NULL dereference in OOM situation Verify that wolfSSL_BIO_meth_new() actually works and handle situations where it returns NULL. Reported-by: Stanislav Fort (Aisle Research) Closes #19459 --- lib/vtls/wolfssl.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 585a4060021d..bf39ccf9b1fc 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -395,20 +395,24 @@ static int wssl_bio_cf_in_read(WOLFSSL_BIO *bio, char *buf, int blen) static WOLFSSL_BIO_METHOD *wssl_bio_cf_method = NULL; -static void wssl_bio_cf_init_methods(void) +static int wssl_bio_cf_init_methods(void) { wssl_bio_cf_method = wolfSSL_BIO_meth_new(WOLFSSL_BIO_MEMORY, - "wolfSSL CF BIO"); + "wolfSSL CF BIO"); + if(!wssl_bio_cf_method) + return FALSE; /* error */ wolfSSL_BIO_meth_set_write(wssl_bio_cf_method, &wssl_bio_cf_out_write); wolfSSL_BIO_meth_set_read(wssl_bio_cf_method, &wssl_bio_cf_in_read); wolfSSL_BIO_meth_set_ctrl(wssl_bio_cf_method, &wssl_bio_cf_ctrl); wolfSSL_BIO_meth_set_create(wssl_bio_cf_method, &wssl_bio_cf_create); wolfSSL_BIO_meth_set_destroy(wssl_bio_cf_method, &wssl_bio_cf_destroy); + return TRUE; /* fine */ } static void wssl_bio_cf_free_methods(void) { wolfSSL_BIO_meth_free(wssl_bio_cf_method); + wssl_bio_cf_method = NULL; } #else /* USE_BIO_CHAIN */ @@ -1504,6 +1508,8 @@ wssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) { WOLFSSL_BIO *bio; + if(!wssl_bio_cf_method) + return CURLE_FAILED_INIT; bio = wolfSSL_BIO_new(wssl_bio_cf_method); if(!bio) return CURLE_OUT_OF_MEMORY; @@ -2089,7 +2095,8 @@ static int wssl_init(void) Curl_tls_keylog_open(); #endif ret = (wolfSSL_Init() == WOLFSSL_SUCCESS); - wssl_bio_cf_init_methods(); + if(ret) + ret = wssl_bio_cf_init_methods(); return ret; } From 6ca1d05797c5edc2359b7710f27a935902ffc613 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 14:39:20 +0100 Subject: [PATCH 324/885] ftp: remove #ifdef for define that is always defined The CURL_FTP_HTTPSTYLE_HEAD logic was added back in 2007 with the intention to remove that logic one day, but since we never bump the SONAME it is not likely to happen anytime soon. Remove again for readability. Follow-up to 3217809294b Closes #19463 --- lib/ftp.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index dd70c2a5ce8c..ca6b9497b23a 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -316,18 +316,6 @@ static void close_secondarysocket(struct Curl_easy *data, Curl_conn_cf_discard_all(data, data->conn, SECONDARYSOCKET); } -/* - * NOTE: back in the old days, we added code in the FTP code that made NOBODY - * requests on files respond with headers passed to the client/stdout that - * looked like HTTP ones. - * - * This approach is not elegant, it causes confusion and is error-prone. It is - * subject for removal at the next (or at least a future) soname bump. Until - * then you can test the effects of the removal by undefining the following - * define named CURL_FTP_HTTPSTYLE_HEAD. - */ -#define CURL_FTP_HTTPSTYLE_HEAD 1 - static void freedirs(struct ftp_conn *ftpc) { Curl_safefree(ftpc->dirs); @@ -2114,7 +2102,6 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data, showtime = TRUE; } -#ifdef CURL_FTP_HTTPSTYLE_HEAD /* If we asked for a time of the file and we actually got one as well, we "emulate" an HTTP-style header in our output. */ @@ -2155,7 +2142,6 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data, if(result) return result; } /* end of a ridiculous amount of conditionals */ -#endif } break; default: @@ -2360,7 +2346,6 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data, } if(instate == FTP_SIZE) { -#ifdef CURL_FTP_HTTPSTYLE_HEAD if(filesize != -1) { char clbuf[128]; int clbuflen = curl_msnprintf(clbuf, sizeof(clbuf), @@ -2370,7 +2355,6 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data, if(result) return result; } -#endif Curl_pgrsSetDownloadSize(data, filesize); result = ftp_state_rest(data, ftpc, ftp); } @@ -2397,14 +2381,12 @@ static CURLcode ftp_state_rest_resp(struct Curl_easy *data, switch(instate) { case FTP_REST: default: -#ifdef CURL_FTP_HTTPSTYLE_HEAD if(ftpcode == 350) { char buffer[24]= { "Accept-ranges: bytes\r\n" }; result = client_write_header(data, buffer, strlen(buffer)); if(result) return result; } -#endif result = ftp_state_prepare_transfer(data, ftpc, ftp); break; From 3d9f7b436cd65f67ccdd99d3e5f94e180d546373 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 16:12:21 +0100 Subject: [PATCH 325/885] noproxy: simplify Curl_check_noproxy By creating two separate matching functions for name and IP. Closes #19466 --- lib/noproxy.c | 126 +++++++++++++++++++++++++++----------------------- 1 file changed, 69 insertions(+), 57 deletions(-) diff --git a/lib/noproxy.c b/lib/noproxy.c index 20a335993da1..b9e8492fd6e4 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -117,6 +117,67 @@ enum nametype { TYPE_IPV6 }; +static bool match_host(const char *token, size_t tokenlen, + const char *name, size_t namelen) +{ + bool match = FALSE; + + /* ignore trailing dots in the token to check */ + if(token[tokenlen - 1] == '.') + tokenlen--; + + if(tokenlen && (*token == '.')) { + /* ignore leading token dot as well */ + token++; + tokenlen--; + } + /* A: example.com matches 'example.com' + B: www.example.com matches 'example.com' + C: nonexample.com DOES NOT match 'example.com' + */ + if(tokenlen == namelen) + /* case A, exact match */ + match = curl_strnequal(token, name, namelen); + else if(tokenlen < namelen) { + /* case B, tailmatch domain */ + match = (name[namelen - tokenlen - 1] == '.') && + curl_strnequal(token, name + (namelen - tokenlen), + tokenlen); + } + /* case C passes through, not a match */ + return match; +} + +static bool match_ip(int type, const char *token, size_t tokenlen, + const char *name) +{ + const char *check = token; + char *slash; + unsigned int bits = 0; + char checkip[128]; + if(tokenlen >= sizeof(checkip)) + /* this cannot match */ + return FALSE; + /* copy the check name to a temp buffer */ + memcpy(checkip, check, tokenlen); + checkip[tokenlen] = 0; + check = checkip; + + slash = strchr(check, '/'); + /* if the slash is part of this token, use it */ + if(slash) { + /* if the bits variable gets a crazy value here, that is fine as + the value will then be rejected in the cidr function */ + bits = (unsigned int)atoi(slash + 1); + *slash = 0; /* null-terminate there */ + } + if(type == TYPE_IPV6) + return Curl_cidr6_match(name, check, bits); + else + return Curl_cidr4_match(name, check, bits); +} + + /**************************************************************** * Checks if the host is in the noproxy list. returns TRUE if it matches and * therefore the proxy should NOT be used. @@ -176,7 +237,6 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) while(*p) { const char *token; size_t tokenlen = 0; - bool match = FALSE; /* pass blanks */ curlx_str_passblanks(&p); @@ -189,64 +249,16 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) } if(tokenlen) { - switch(type) { - case TYPE_HOST: - /* ignore trailing dots in the token to check */ - if(token[tokenlen - 1] == '.') - tokenlen--; - - if(tokenlen && (*token == '.')) { - /* ignore leading token dot as well */ - token++; - tokenlen--; - } - /* A: example.com matches 'example.com' - B: www.example.com matches 'example.com' - C: nonexample.com DOES NOT match 'example.com' - */ - if(tokenlen == namelen) - /* case A, exact match */ - match = curl_strnequal(token, name, namelen); - else if(tokenlen < namelen) { - /* case B, tailmatch domain */ - match = (name[namelen - tokenlen - 1] == '.') && - curl_strnequal(token, name + (namelen - tokenlen), - tokenlen); - } - /* case C passes through, not a match */ - break; - case TYPE_IPV4: - case TYPE_IPV6: { - const char *check = token; - char *slash; - unsigned int bits = 0; - char checkip[128]; - if(tokenlen >= sizeof(checkip)) - /* this cannot match */ - break; - /* copy the check name to a temp buffer */ - memcpy(checkip, check, tokenlen); - checkip[tokenlen] = 0; - check = checkip; - - slash = strchr(check, '/'); - /* if the slash is part of this token, use it */ - if(slash) { - /* if the bits variable gets a crazy value here, that is fine as - the value will then be rejected in the cidr function */ - bits = (unsigned int)atoi(slash + 1); - *slash = 0; /* null-terminate there */ - } - if(type == TYPE_IPV6) - match = Curl_cidr6_match(name, check, bits); - else - match = Curl_cidr4_match(name, check, bits); - break; - } - } + bool match = FALSE; + if(type == TYPE_HOST) + match = match_host(token, tokenlen, name, namelen); + else + match = match_ip(type, token, tokenlen, name); + if(match) return TRUE; - } /* if(tokenlen) */ + } + /* pass blanks after pattern */ curlx_str_passblanks(&p); /* if not a comma, this ends the loop */ From 8c9946d35fc147cfe7521575686e56dd4134d48e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 15:53:07 +0100 Subject: [PATCH 326/885] ccsidcurl: make curl_mime_data_ccsid() use the converted size dynconvert() now offers to return the size of the converted data as it might be different that the provided input size. Bonus: minor indent fixing of some closing braces. Reported-by: Stanislav Fort (Aisle Research) Closes #19465 --- packages/OS400/ccsidcurl.c | 68 ++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index 9fd11a4cf9ba..30be1f60f71e 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -134,16 +134,16 @@ convert(char *d, size_t dlen, int dccsid, memcpy(d, s, i); return i; - } + } if(slen < 0) { lslen = 0; cd = iconv_open_CCSID(dccsid, sccsid, 1); - } + } else { lslen = (size_t) slen; cd = iconv_open_CCSID(dccsid, sccsid, 0); - } + } if(ICONV_OPEN_ERROR(cd)) return -1; @@ -160,7 +160,8 @@ convert(char *d, size_t dlen, int dccsid, } -static char *dynconvert(int dccsid, const char *s, int slen, int sccsid) +static char *dynconvert(int dccsid, const char *s, int slen, int sccsid, + int *olen) { char *d; char *cp; @@ -182,7 +183,7 @@ static char *dynconvert(int dccsid, const char *s, int slen, int sccsid) if(l < 0) { free(d); return (char *) NULL; - } + } if(slen < 0) { /* Need to null-terminate even when source length is given. @@ -194,17 +195,19 @@ static char *dynconvert(int dccsid, const char *s, int slen, int sccsid) if(l2 < 0) { free(d); return (char *) NULL; - } + } l += l2; - } + } if((size_t) l < dlen) { cp = realloc(d, l); /* Shorten to minimum needed. */ if(cp) d = cp; - } + } + if(olen) + *olen = l; return d; } @@ -217,7 +220,7 @@ slist_convert(int dccsid, struct curl_slist *from, int sccsid) for(; from; from = from->next) { struct curl_slist *nl; - char *cp = dynconvert(dccsid, from->data, -1, sccsid); + char *cp = dynconvert(dccsid, from->data, -1, sccsid, NULL); if(!cp) { curl_slist_free_all(to); @@ -261,7 +264,7 @@ const char * curl_to_ccsid(const char *s, unsigned int ccsid) { if(s) - s = dynconvert(ccsid, s, -1, ASCII_CCSID); + s = dynconvert(ccsid, s, -1, ASCII_CCSID, NULL); return s; } @@ -270,7 +273,7 @@ const char * curl_from_ccsid(const char *s, unsigned int ccsid) { if(s) - s = dynconvert(ASCII_CCSID, s, -1, ccsid); + s = dynconvert(ASCII_CCSID, s, -1, ccsid, NULL); return s; } @@ -295,7 +298,7 @@ curl_easy_escape_ccsid(CURL *handle, const char *string, int length, return (char *) NULL; } - s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid); + s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL); if(!s) return (char *) NULL; @@ -306,7 +309,7 @@ curl_easy_escape_ccsid(CURL *handle, const char *string, int length, if(!d) return (char *) NULL; - s = dynconvert(dccsid, d, -1, ASCII_CCSID); + s = dynconvert(dccsid, d, -1, ASCII_CCSID, NULL); free(d); return s; } @@ -326,7 +329,7 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, return (char *) NULL; } - s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid); + s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL); if(!s) return (char *) NULL; @@ -337,7 +340,7 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, if(!d) return (char *) NULL; - s = dynconvert(dccsid, d, -1, ASCII_CCSID); + s = dynconvert(dccsid, d, -1, ASCII_CCSID, NULL); free(d); if(s && outlength) @@ -378,7 +381,7 @@ curl_getdate_ccsid(const char *p, const time_t *unused, unsigned int ccsid) if(!p) return curl_getdate(p, unused); - s = dynconvert(ASCII_CCSID, p, -1, ccsid); + s = dynconvert(ASCII_CCSID, p, -1, ccsid, NULL); if(!s) return (time_t) -1; @@ -407,7 +410,7 @@ convert_version_info_string(const char **stringp, *stringp = *bufp; *bufp += l; *left -= l; - } + } return 0; } @@ -471,7 +474,7 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) n += strlen(p->protocols[nproto++]); n += nproto++; - } + } for(i = 0; i < sizeof(charfields) / sizeof(charfields[0]); i++) { cpp = (const char **) ((char *) p + charfields[i]); @@ -596,7 +599,7 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) cpp = (char * *) paramp; if(*cpp) { - *cpp = dynconvert(ccsid, *cpp, -1, ASCII_CCSID); + *cpp = dynconvert(ccsid, *cpp, -1, ASCII_CCSID, NULL); if(!*cpp) ret = CURLE_OUT_OF_MEMORY; @@ -1180,7 +1183,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) ccsid = va_arg(arg, unsigned int); if(s) { - s = dynconvert(ASCII_CCSID, s, -1, ccsid); + s = dynconvert(ASCII_CCSID, s, -1, ccsid, NULL); if(!s) { result = CURLE_OUT_OF_MEMORY; @@ -1208,7 +1211,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) if(pfsize == -1) { /* Data is null-terminated. */ - s = dynconvert(ASCII_CCSID, s, -1, ccsid); + s = dynconvert(ASCII_CCSID, s, -1, ccsid, NULL); if(!s) { result = CURLE_OUT_OF_MEMORY; @@ -1343,7 +1346,7 @@ curl_pushheader_bynum_cssid(struct curl_pushheaders *h, char *s = curl_pushheader_bynum(h, num); if(s) - d = dynconvert(ccsid, s, -1, ASCII_CCSID); + d = dynconvert(ccsid, s, -1, ASCII_CCSID, NULL); return d; } @@ -1356,14 +1359,14 @@ curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header, char *d = (char *) NULL; if(header) { - header = dynconvert(ASCII_CCSID, header, -1, ccsidin); + header = dynconvert(ASCII_CCSID, header, -1, ccsidin, NULL); if(header) { char *s = curl_pushheader_byname(h, header); free((char *) header); if(s) - d = dynconvert(ccsidout, s, -1, ASCII_CCSID); + d = dynconvert(ccsidout, s, -1, ASCII_CCSID, NULL); } } @@ -1379,7 +1382,7 @@ mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid, if(!string) return mimefunc(part, string); - s = dynconvert(ASCII_CCSID, string, -1, ccsid); + s = dynconvert(ASCII_CCSID, string, -1, ccsid, NULL); if(!s) return CURLE_OUT_OF_MEMORY; @@ -1428,14 +1431,15 @@ curl_mime_data_ccsid(curl_mimepart *part, { char *s = (char *) NULL; CURLcode result; + int osize; if(!data) return curl_mime_data(part, data, datasize); - s = dynconvert(ASCII_CCSID, data, datasize, ccsid); + s = dynconvert(ASCII_CCSID, data, datasize, ccsid, &osize); if(!s) return CURLE_OUT_OF_MEMORY; - result = curl_mime_data(part, s, datasize); + result = curl_mime_data(part, s, osize); free(s); return result; } @@ -1454,7 +1458,7 @@ curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part, result = curl_url_get(handle, what, &s, flags); if(result == CURLUE_OK) { if(s) { - *part = dynconvert(ccsid, s, -1, ASCII_CCSID); + *part = dynconvert(ccsid, s, -1, ASCII_CCSID, NULL); if(!*part) result = CURLUE_OUT_OF_MEMORY; } @@ -1472,7 +1476,7 @@ curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part, CURLUcode result; if(part) { - s = dynconvert(ASCII_CCSID, part, -1, ccsid); + s = dynconvert(ASCII_CCSID, part, -1, ccsid, NULL); if(!s) return CURLUE_OUT_OF_MEMORY; } @@ -1488,7 +1492,7 @@ curl_easy_option_by_name_ccsid(const char *name, unsigned int ccsid) const struct curl_easyoption *option = NULL; if(name) { - char *s = dynconvert(ASCII_CCSID, name, -1, ccsid); + char *s = dynconvert(ASCII_CCSID, name, -1, ccsid, NULL); if(s) { option = curl_easy_option_by_name(s); @@ -1507,7 +1511,7 @@ curl_easy_option_get_name_ccsid(const struct curl_easyoption *option, char *name = NULL; if(option && option->name) - name = dynconvert(ccsid, option->name, -1, ASCII_CCSID); + name = dynconvert(ccsid, option->name, -1, ASCII_CCSID, NULL); return (const char *) name; } @@ -1521,7 +1525,7 @@ curl_easy_header_ccsid(CURL *easy, const char *name, size_t index, CURLHcode result = CURLHE_BAD_ARGUMENT; if(name) { - char *s = dynconvert(ASCII_CCSID, name, -1, ccsid); + char *s = dynconvert(ASCII_CCSID, name, -1, ccsid, NULL); result = CURLHE_OUT_OF_MEMORY; if(s) { From f1f5cc781c33814331b9663c01430ea5afe53e2f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 16:41:57 +0100 Subject: [PATCH 327/885] cf-socket: split out the MTU and GRO setopts into sep functions It simplifies the #ifdefs and declaring of local variables slightly. Closes #19467 --- lib/cf-socket.c | 71 ++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 92fe433a69b1..667bf1e1be0d 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1799,14 +1799,50 @@ CURLcode Curl_cf_tcp_create(struct Curl_cfilter **pcf, return result; } +#ifdef __linux__ +static void linux_quic_mtu(struct cf_socket_ctx *ctx) +{ + int val; + switch(ctx->addr.family) { +#ifdef IP_MTU_DISCOVER + case AF_INET: + val = IP_PMTUDISC_DO; + (void)setsockopt(ctx->sock, IPPROTO_IP, IP_MTU_DISCOVER, &val, + sizeof(val)); + break; +#endif +#ifdef IPV6_MTU_DISCOVER + case AF_INET6: + val = IPV6_PMTUDISC_DO; + (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &val, + sizeof(val)); + break; +#endif + } +} +#else +#define linux_quic_mtu(x) +#endif + +#if defined(UDP_GRO) && \ + (defined(HAVE_SENDMMSG) || defined(HAVE_SENDMSG)) && \ + ((defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || defined(USE_QUICHE)) +static void linux_quic_gro(struct cf_socket_ctx *ctx) +{ + int one = 1; + (void)setsockopt(ctx->sock, IPPROTO_UDP, UDP_GRO, &one, + (socklen_t)sizeof(one)); +} +#else +#define linux_quic_gro(x) +#endif + + static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_socket_ctx *ctx = cf->ctx; int rc; - int one = 1; - - (void)one; /* QUIC needs a connected socket, nonblocking */ DEBUGASSERT(ctx->sock != CURL_SOCKET_BAD); @@ -1831,33 +1867,8 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf, * non-blocking socket created by cf_socket_open() to it. Thus, we * do not need to call curlx_nonblock() in cf_udp_setup_quic() anymore. */ -#ifdef __linux__ - switch(ctx->addr.family) { -#ifdef IP_MTU_DISCOVER - case AF_INET: { - int val = IP_PMTUDISC_DO; - (void)setsockopt(ctx->sock, IPPROTO_IP, IP_MTU_DISCOVER, &val, - sizeof(val)); - break; - } -#endif -#ifdef IPV6_MTU_DISCOVER - case AF_INET6: { - int val = IPV6_PMTUDISC_DO; - (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &val, - sizeof(val)); - break; - } -#endif - } - -#if defined(UDP_GRO) && \ - (defined(HAVE_SENDMMSG) || defined(HAVE_SENDMSG)) && \ - ((defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || defined(USE_QUICHE)) - (void)setsockopt(ctx->sock, IPPROTO_UDP, UDP_GRO, &one, - (socklen_t)sizeof(one)); -#endif -#endif + linux_quic_mtu(ctx); + linux_quic_gro(ctx); return CURLE_OK; } From f544eb97da73870dcc3e29b73337bc24c384d8d3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 11 Nov 2025 00:50:52 -0800 Subject: [PATCH 328/885] docs: Line endings are no longer significant in test files Since commit f477f3efc, CR/LF characters in test files are no longer significant, making the files a little more XML-like. Closes #19469 --- docs/tests/FILEFORMAT.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index f100adcf89b3..8c4d0181e10d 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -12,9 +12,9 @@ mark the beginning and the end of all sections, and each label must be written in its own line. Comments are either XML-style (enclosed with ``) or shell script style (beginning with `#`) and must appear on their own lines and not alongside actual test data. Most test data files are -syntactically valid XML, although a few files are not (lack of support for -character entities and the preservation of CR/LF characters at the end of -lines are the biggest differences). +syntactically-valid XML (a few files are not); lack of support for character +entities is a big difference but macros like %CR fill that particular role +here. Each test case source exists as a file matching the format `tests/data/testNUM`, where `NUM` is the unique test number, and must begin From d499aa52385a520ddbbb8694af3cd04411a91933 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Nov 2025 11:09:36 +0100 Subject: [PATCH 329/885] mk-ca-bundle.pl: use `open()` with argument list to replace backticks On Windows this requires Perl 5.22 from year 2015. Also: - mdlinkcheck: delete redundant error handling logic. Follow-up to 77be4a7ab2b5a0c633b9107fd286bda1f57e4725 #19437 Closes #19461 --- scripts/mdlinkcheck | 4 ---- scripts/mk-ca-bundle.pl | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index 842f0c976658..6b648786f33e 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -145,10 +145,6 @@ sub checkurl { @content = <$fh>; close $fh; } - else { - print STDERR "FAIL\n"; - return 1; # fail - } if(!$content[0]) { print STDERR "FAIL\n"; return 1; # fail diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index cb0b58609326..af31ccd10e8f 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -247,7 +247,9 @@ sub sha256 { close(FILE); } else { # Use OpenSSL command if Perl Digest::SHA modules not available - $result = `"$openssl" dgst -r -sha256 "$_[0]"`; + open(my $fh, '-|', $openssl, 'dgst', '-r', '-sha256', $_[0]) or die "Failed running openssl on '$_[0]': $!"; + $result = <$fh>; # read first line + close $fh; $result =~ s/^([0-9a-f]{64}) .+/$1/is; } return $result; @@ -311,10 +313,16 @@ (%) if($curl) { if($curl =~ /^Protocols:.* https( |$)/m) { report "Get certdata with curl!"; - my $proto = !$opt_k ? "--proto =https" : ""; - my $quiet = $opt_q ? "-s" : ""; - my @out = `curl -Lw %{response_code} $proto $quiet -o "$txt" "$url"`; - if(!$? && @out && $out[0] == 200) { + my @opts = (); + push @opts, '--proto', '=https' if !$opt_k; + push @opts, '-s' if $opt_q; + my $out = ''; + if(open(my $fh, '-|', 'curl', '-Lw', '%{response_code}', (@opts), '-o', $txt, $url)) { + $out = <$fh>; # read first line + chomp $out; + close $fh; + } + if($out && $out == 200) { $fetched = 1; report "Downloaded $txt"; } From ebc5fea64de5c348f99a487d3f7859b8453f1ebb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Nov 2025 15:28:36 +0100 Subject: [PATCH 330/885] autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) The minimum required autoconf is 2.59, since curl 7.76.0 (2021). Follow-up to a59f04611629f0db9ad8e768b9def73b9b4d9423 #6748 Closes #19464 --- configure.ac | 1 - m4/zz60-xc-ovr.m4 | 65 ----------------------------------------------- 2 files changed, 66 deletions(-) delete mode 100644 m4/zz60-xc-ovr.m4 diff --git a/configure.ac b/configure.ac index cc16f4120af5..e493369b9db6 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,6 @@ dnl We don't know the version number "statically" so we use a dash here AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/]) XC_OVR_ZZ50 -XC_OVR_ZZ60 CURL_OVERRIDE_AUTOCONF dnl configure script copyright diff --git a/m4/zz60-xc-ovr.m4 b/m4/zz60-xc-ovr.m4 deleted file mode 100644 index d1d3a2fd50f9..000000000000 --- a/m4/zz60-xc-ovr.m4 +++ /dev/null @@ -1,65 +0,0 @@ -#--------------------------------------------------------------------------- -# -# zz60-xc-ovr.m4 -# -# Copyright (C) Daniel Stenberg, -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# SPDX-License-Identifier: ISC -# -#--------------------------------------------------------------------------- - -# serial 1 - - -dnl The funny name of this file is intentional in order to make it -dnl sort alphabetically after any libtool, autoconf or automake -dnl provided .m4 macro file that might get copied into this same -dnl subdirectory. This allows that macro (re)definitions from this -dnl file may override those provided in other files. - - -dnl Override an autoconf provided macro -dnl ------------------------------------------------- -dnl This macro overrides the one provided by autoconf -dnl 2.58 or newer, and provides macro definition for -dnl autoconf 2.57 or older which lack it. This allows -dnl using libtool 2.2 or newer, which requires that -dnl this macro is used in configure.ac, with autoconf -dnl 2.57 or older. - -m4_ifdef([AC_CONFIG_MACRO_DIR], -[dnl -m4_undefine([AC_CONFIG_MACRO_DIR])dnl -]) -m4_define([AC_CONFIG_MACRO_DIR],[]) - - -dnl XC_OVR_ZZ60 -dnl ------------------------------------------------- -dnl Placing a call to this macro in configure.ac will -dnl make macros in this file visible to other macros -dnl used for same configure script, overriding those -dnl provided elsewhere. - -AC_DEFUN([XC_OVR_ZZ60], -[dnl -AC_BEFORE([$0],[LT_INIT])dnl -AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl -AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl -AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl -dnl -AC_BEFORE([$0],[AC_CONFIG_MACRO_DIR])dnl -AC_BEFORE([$0],[AC_CONFIG_MACRO_DIRS])dnl -]) From 4841e4290dfca768328401522f319225e819824c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Nov 2025 17:43:06 +0100 Subject: [PATCH 331/885] badwords: re-sync with curl-www, fix issues found Also: - replace `manpage` with `man page`, add to `badwords.txt`. - badwords.pl: import `-w` feature from curl-www, syncing the two scripts fully. - badwords.txt: import missing items from curl-www, syncing the two files fully. - pyspelling.words: drop `cURL` allowed word. Closes #19468 --- .github/scripts/badwords.pl | 28 +++++++++++++++++++++++++++- .github/scripts/badwords.txt | 12 +++++++++--- .github/scripts/pyspelling.words | 1 - README.md | 4 ++-- docs/BINDINGS.md | 4 ++-- docs/CONTRIBUTE.md | 6 +++--- docs/DISTROS.md | 6 +++--- docs/FAQ | 16 ++++++++-------- docs/IPFS.md | 22 +++++++++++----------- docs/cmdline-opts/Makefile.am | 2 +- include/curl/easy.h | 2 +- include/curl/multi.h | 2 +- lib/asyn-ares.c | 2 +- lib/vtls/openssl.c | 4 ++-- scripts/cd2nroff | 4 ++-- scripts/managen | 8 ++++---- src/tool_getparam.c | 2 +- tests/data/test1140 | 2 +- tests/data/test1488 | 2 +- tests/data/test1705 | 4 ++-- tests/ech_tests.sh | 2 +- tests/libtest/lib1592.c | 2 +- tests/test1139.pl | 8 ++++---- tests/test1140.pl | 8 ++++---- tests/test1173.pl | 12 ++++++------ tests/test1222.pl | 20 ++++++++++---------- tests/test1477.pl | 2 +- 27 files changed, 109 insertions(+), 78 deletions(-) diff --git a/.github/scripts/badwords.pl b/.github/scripts/badwords.pl index b9b20697f547..c6229f4ad402 100755 --- a/.github/scripts/badwords.pl +++ b/.github/scripts/badwords.pl @@ -21,6 +21,24 @@ my %alt; my %exactcase; +my %wl; +if($ARGV[0] eq "-w") { + shift @ARGV; + my $file = shift @ARGV; + open(W, "<$file"); + while() { + if(/^#/) { + # allow #-comments + next; + } + if(/^([^:]*):(\d+):(.*)/) { + $wl{"$1:$2:$3"}=1; + #print STDERR "whitelisted $1:$2:$3\n"; + } + } + close(W); +} + my @w; while() { chomp; @@ -30,7 +48,7 @@ if($_ =~ /^---(.*)/) { push @whitelist, $1; } - elsif($_ =~ /^([^:=]*)([:=])(.*)/) { + elsif($_ =~ /^(.*)([:=])(.*)/) { my ($bad, $sep, $better)=($1, $2, $3); push @w, $bad; $alt{$bad} = $better; @@ -67,6 +85,14 @@ sub file { ($in =~ /^(.*)$w/ && $case) ) { my $p = $1; my $c = length($p)+1; + + my $ch = "$f:$l:$w"; + if($wl{$ch}) { + # whitelisted + print STDERR "$ch found but whitelisted\n"; + next; + } + print STDERR "$f:$l:$c: error: found bad word \"$w\"\n"; printf STDERR " %4d | $in\n", $l; printf STDERR " | %*s^%s\n", length($p), " ", diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index 492ea32537b2..7f6bca32b6a6 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -3,7 +3,7 @@ # SPDX-License-Identifier: curl # back-end:backend -e-mail:email +\be-mail[^/]:email run-time:runtime set-up:setup tool chain:toolchain @@ -36,7 +36,7 @@ aren't:are not a IPv4: an IPv4 a IPv6: an IPv6 url =URL -internet\b=Internet +[^/]internet\b=Internet isation:ization \bit's:it is it'd:it would @@ -47,12 +47,14 @@ there's:there is \. So : Rewrite without "so" ? dir :directory sub-director:subdirector +you'd:you would +you'll:you will can't:cannot that's:that is web page:webpage host name\b:hostname host names\b:hostnames -file name\b:filename +[^;]file name\b:filename file names\b:filenames \buser name\b:username \buser names\b:usernames @@ -70,7 +72,11 @@ couldn't:could not 32-bits:32 bits or 32-bit \bvery\b:rephrase using an alternative word \bCurl\b=curl +\bcURL\b=curl \bLibcurl\b=libcurl +\bLibCurl\b=libcurl ---WWW::Curl ---NET::Curl ---Curl Corporation +\bmanpages[^./&:-]:man pages +\bmanpage[^si./&:-]:man page diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index f64025b2adbc..5dbce132271e 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -149,7 +149,6 @@ CSeq csh cshrc CTRL -cURL CURLcode curldown CURLE diff --git a/README.md b/README.md index e61924673a98..2fe531628188 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. Learn how to use curl by reading [the -manpage](https://curl.se/docs/manpage.html) or [everything +man page](https://curl.se/docs/manpage.html) or [everything curl](https://everything.curl.dev/). Find out how to install curl by reading [the INSTALL @@ -20,7 +20,7 @@ document](https://curl.se/docs/install.html). libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read [the libcurl -manpage](https://curl.se/libcurl/c/libcurl.html) to learn how. +man page](https://curl.se/libcurl/c/libcurl.html) to learn how. ## Open Source diff --git a/docs/BINDINGS.md b/docs/BINDINGS.md index b7074a22756a..9ddbde5c425d 100644 --- a/docs/BINDINGS.md +++ b/docs/BINDINGS.md @@ -73,7 +73,7 @@ Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang [LibQurl](https://github.com/Qriist/LibQurl) a feature rich AutoHotKey v2 (AHKv2) wrapper around libcurl. -Lua: [luacurl](https://web.archive.org/web/20201205052437/luacurl.luaforge.net/) by Alexander Marinov, [Lua-cURL](https://github.com/Lua-cURL) by Jürgen Hötzel +Lua: [luacurl](https://web.archive.org/web/20201205052437/luacurl.luaforge.net/) by Alexander Marinov, [Lua-curl](https://github.com/Lua-cURL) by Jürgen Hötzel [Mono](https://web.archive.org/web/20070606064500/forge.novell.com/modules/xfmod/project/?libcurl-mono) Written by Jeffrey Phillips @@ -98,7 +98,7 @@ Bailiff and Bálint Szilakszi, [PostgreSQL](https://github.com/pramsey/pgsql-http) - HTTP client for PostgreSQL -[PostgreSQL](https://github.com/RekGRpth/pg_curl) - cURL client for PostgreSQL +[PostgreSQL](https://github.com/RekGRpth/pg_curl) - curl client for PostgreSQL [PureBasic](https://web.archive.org/web/20250325015028/www.purebasic.com/documentation/http/index.html) uses libcurl in its "native" HTTP subsystem diff --git a/docs/CONTRIBUTE.md b/docs/CONTRIBUTE.md index 710b3a1ef837..4a34a539bbe9 100644 --- a/docs/CONTRIBUTE.md +++ b/docs/CONTRIBUTE.md @@ -111,8 +111,8 @@ projects but someone's gotta do it. It makes things a lot easier if you submit a small description of your fix or your new features with every contribution so that it can be swiftly added to the package documentation. -Documentation is mostly provided as manpages or plain ASCII files. The -manpages are rendered from their source files that are usually written using +Documentation is mostly provided as man pages or plain ASCII files. The +man pages are rendered from their source files that are usually written using markdown. Most HTML files on the website and in the release archives are generated from corresponding markdown and ASCII files. @@ -289,7 +289,7 @@ Just ask if this is what you would want. You are required to have posted several high quality patches first, before you can be granted push access. ## Useful resources - - [Webinar on getting code into cURL](https://www.youtube.com/watch?v=QmZ3W1d6LQI) + - [Webinar on getting code into curl](https://www.youtube.com/watch?v=QmZ3W1d6LQI) # Update copyright and license information diff --git a/docs/DISTROS.md b/docs/DISTROS.md index e852b797d29f..40a9bf571674 100644 --- a/docs/DISTROS.md +++ b/docs/DISTROS.md @@ -188,9 +188,9 @@ unless it is specific to Homebrew's way of packaging software. *Rolling Release* -- curl: https://github.com/lordmulder/cURL-build-win32 -- curl issues: https://github.com/lordmulder/cURL-build-win32/issues -- curl patches: https://github.com/lordmulder/cURL-build-win32/tree/master/patch +- curl: https://github.com/lordmulder/curl-build-win32 +- curl issues: https://github.com/lordmulder/curl-build-win32/issues +- curl patches: https://github.com/lordmulder/curl-build-win32/tree/master/patch ## NixOS diff --git a/docs/FAQ b/docs/FAQ index 640dc1ab2a87..6ba339c7d55c 100644 --- a/docs/FAQ +++ b/docs/FAQ @@ -7,7 +7,7 @@ FAQ 1. Philosophy - 1.1 What is cURL? + 1.1 What is curl? 1.2 What is libcurl? 1.3 What is curl not? 1.4 When will you make curl do XXXX ? @@ -123,15 +123,15 @@ FAQ 1. Philosophy - 1.1 What is cURL? + 1.1 What is curl? - cURL is the name of the project. The name is a play on 'Client for URLs', + curl is the name of the project. The name is a play on 'Client for URLs', originally with URL spelled in uppercase to make it obvious it deals with URLs. The fact it can also be read as 'see URL' also helped, it works as an abbreviation for "Client URL Request Library" or why not the recursive version: "curl URL Request Library". - The cURL project produces two products: + The curl project produces two products: libcurl @@ -247,7 +247,7 @@ FAQ 1.6 What do you get for making curl? - Project cURL is entirely free and open. We do this voluntarily, mostly in + Project curl is entirely free and open. We do this voluntarily, mostly in our spare time. Companies may pay individual developers to work on curl. This is not controlled by nor supervised in any way by the curl project. @@ -326,7 +326,7 @@ FAQ 1.11 Why do you not update ca-bundle.crt - In the cURL project we have decided not to attempt to keep this file updated + In the curl project we have decided not to attempt to keep this file updated (or even present) since deciding what to add to a ca cert bundle is an undertaking we have not been ready to accept, and the one we can get from Mozilla is perfectly fine so there is no need to duplicate that work. @@ -548,7 +548,7 @@ FAQ https://curl.se/libcurl/ All the various bindings to libcurl are made by other projects and people, - outside of the cURL project. The cURL project itself only produces libcurl + outside of the curl project. The curl project itself only produces libcurl with its plain C API. If you do not find anywhere else to ask you can ask about bindings on the curl-library list too, but be prepared that people on that list may not know anything about bindings. @@ -1496,7 +1496,7 @@ FAQ The module for PHP that makes it possible for PHP programs to access curl- functions from within PHP. - In the cURL project we call this module PHP/CURL to differentiate it from + In the curl project we call this module PHP/CURL to differentiate it from curl the command line tool and libcurl the library. The PHP team however does not refer to it like this (for unknown reasons). They call it plain CURL (often using all caps) or sometimes ext/curl, but both cause much diff --git a/docs/IPFS.md b/docs/IPFS.md index 82dae9439990..8ce51325bfd2 100644 --- a/docs/IPFS.md +++ b/docs/IPFS.md @@ -43,9 +43,9 @@ in this link: `http://127.0.0.1:8080/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi` -## cURL handling of the IPFS protocols +## curl handling of the IPFS protocols -The IPFS integration in cURL hides this gateway logic for you. Instead of +The IPFS integration in curl hides this gateway logic for you. Instead of providing a full URL to a file on IPFS like this: ``` @@ -57,7 +57,7 @@ You can provide it with the IPFS protocol instead: curl ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi ``` -With the IPFS protocol way of asking a file, cURL still needs to know the +With the IPFS protocol way of asking a file, curl still needs to know the gateway. curl essentially just rewrites the IPFS based URL to a gateway URL. ### IPFS_GATEWAY environment variable @@ -67,7 +67,7 @@ gateway. ### Automatic gateway detection -When you provide no additional details to cURL then it: +When you provide no additional details to curl then it: 1. First looks for the `IPFS_GATEWAY` environment variable and use that if it is set. @@ -75,12 +75,12 @@ When you provide no additional details to cURL then it: means that you have a local gateway running and that file contains the URL to your local gateway. -If cURL fails, you are presented with an error message and a link to this page +If curl fails, you are presented with an error message and a link to this page to the option most applicable to solving the issue. ### `--ipfs-gateway` argument -You can also provide a `--ipfs-gateway` argument to cURL. This overrules any +You can also provide a `--ipfs-gateway` argument to curl. This overrules any other gateway setting. curl does not fallback to the other options if the provided gateway did not work. @@ -107,21 +107,21 @@ option follows the redirect. ## Error messages and hints -Depending on the arguments, cURL could present the user with an error. +Depending on the arguments, curl could present the user with an error. ### Gateway file and environment variable -cURL tried to look for the file: `~/.ipfs/gateway` but could not find it. It +curl tried to look for the file: `~/.ipfs/gateway` but could not find it. It also tried to look for the `IPFS_GATEWAY` environment variable but could not -find that either. This happens when no extra arguments are passed to cURL and +find that either. This happens when no extra arguments are passed to curl and letting it try to figure it out [automatically](#automatic-gateway-detection). Any IPFS implementation that has gateway support should expose its URL in `~/.ipfs/gateway`. If you are already running a gateway, make sure it exposes -the file where cURL expects to find it. +the file where curl expects to find it. Alternatively you could set the `IPFS_GATEWAY` environment variable or pass -the `--ipfs-gateway` flag to the cURL command. +the `--ipfs-gateway` flag to the curl command. ### Malformed gateway URL diff --git a/docs/cmdline-opts/Makefile.am b/docs/cmdline-opts/Makefile.am index e016be286cf2..019dd57b8a56 100644 --- a/docs/cmdline-opts/Makefile.am +++ b/docs/cmdline-opts/Makefile.am @@ -40,7 +40,7 @@ GN_ = $(GN_0) MANAGEN=$(top_srcdir)/scripts/managen MAXLINE=$(top_srcdir)/scripts/maxline -# Maximum number of columns accepted in the ASCII version of the manpage +# Maximum number of columns accepted in the ASCII version of the man page INCDIR=$(top_srcdir)/include if BUILD_DOCS diff --git a/include/curl/easy.h b/include/curl/easy.h index fa1356493798..8a1d68dfd8b9 100644 --- a/include/curl/easy.h +++ b/include/curl/easy.h @@ -50,7 +50,7 @@ CURL_EXTERN void curl_easy_cleanup(CURL *curl); * * Request internal information from the curl session with this function. * The third argument MUST be pointing to the specific type of the used option - * which is documented in each manpage of the option. The data pointed to + * which is documented in each man page of the option. The data pointed to * will be filled in accordingly and can be relied upon only if the function * returns CURLE_OK. This function is intended to get used *AFTER* a performed * transfer, all results from this function are undefined until the transfer diff --git a/include/curl/multi.h b/include/curl/multi.h index 4e30637ef565..e307b98f4c25 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -278,7 +278,7 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); * Desc: An alternative version of curl_multi_perform() that allows the * application to pass in one of the file descriptors that have been * detected to have "action" on them and let libcurl perform. - * See manpage for details. + * See man page for details. */ #define CURL_POLL_NONE 0 #define CURL_POLL_IN 1 diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 09c94f97b8f1..96768feb1100 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -88,7 +88,7 @@ /* How long we are willing to wait for additional parallel responses after obtaining a "definitive" one. For old c-ares without getaddrinfo. - This is intended to equal the c-ares default timeout. cURL always uses that + This is intended to equal the c-ares default timeout. curl always uses that default value. Unfortunately, c-ares does not expose its default timeout in its API, but it is officially documented as 5 seconds. diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 5c2711c58762..2c6c05e53d2e 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2395,7 +2395,7 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data, switch(target) { case GEN_DNS: /* name/pattern comparison */ - /* The OpenSSL manpage explicitly says: "In general it cannot be + /* The OpenSSL man page explicitly says: "In general it cannot be assumed that the data returned by ASN1_STRING_data() is null terminated or does not contain embedded nulls." But also that "The actual format of the data will depend on the actual string @@ -4126,7 +4126,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, /* OpenSSL contains code to work around lots of bugs and flaws in various SSL-implementations. SSL_CTX_set_options() is used to enabled those - work-arounds. The manpage for this option states that SSL_OP_ALL enables + work-arounds. The man page for this option states that SSL_OP_ALL enables all the work-arounds and that "It is usually safe to use SSL_OP_ALL to enable the bug workaround options if compatibility with somewhat broken implementations is desired." diff --git a/scripts/cd2nroff b/scripts/cd2nroff index 950011173b89..992cf37b5a9b 100755 --- a/scripts/cd2nroff +++ b/scripts/cd2nroff @@ -25,7 +25,7 @@ =begin comment -Converts a curldown file to nroff (manpage). +Converts a curldown file to nroff (man page). =end comment =cut @@ -431,7 +431,7 @@ sub single { # convert backslash-'<' or '> to just the second character $d =~ s/\\([<>])/$1/g; - # mentions of curl symbols with manpages use italics by default + # mentions of curl symbols with man pages use italics by default $d =~ s/((lib|)curl([^ ]*\(3\)))/\\fI$1\\fP/gi; # backticked becomes italics diff --git a/scripts/managen b/scripts/managen index 0c75148fd170..6099f0ff4d60 100755 --- a/scripts/managen +++ b/scripts/managen @@ -25,7 +25,7 @@ =begin comment -This script generates the manpage. +This script generates the man page. Example: managen [files] > curl.1 @@ -64,7 +64,7 @@ my $globals; my $error = 0; my $indent = 4; -# get the long name version, return the manpage string +# get the long name version, return the man page string sub manpageify { my ($k, $manpage)=@_; my $trail = ''; @@ -412,7 +412,7 @@ sub render { print STDERR "$f:$line:1:WARN: un-escaped < or > used: $nontick\n"; } - # if there is a space, it needs quotes for manpage + # if there is a space, it needs quotes for man page if(($word =~ / /) && $manpage) { $word = "\"$word\""; } @@ -1253,7 +1253,7 @@ sub mainpage { .\\" * .\\" ************************************************************************** .\\" -.\\" DO NOT EDIT. Generated by the curl project managen manpage generator. +.\\" DO NOT EDIT. Generated by the curl project managen man page generator. .\\" .TH curl 1 "$date" "curl $version" "curl Manual" HEADER diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 5624d3cd761d..8d5d89a75261 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1400,7 +1400,7 @@ static ParameterError parse_range(struct OperationConfig *config, if(!curlx_str_number(&nextarg, &value, CURL_OFF_T_MAX) && curlx_str_single(&nextarg, '-')) { /* Specifying a range WITHOUT A DASH will create an illegal HTTP range - (and will not actually be range by definition). The manpage previously + (and will not actually be range by definition). The man page previously claimed that to be a good way, why this code is added to work-around it. */ char buffer[32]; diff --git a/tests/data/test1140 b/tests/data/test1140 index 01b1e0309add..3c29fb5c3fb3 100644 --- a/tests/data/test1140 +++ b/tests/data/test1140 @@ -11,7 +11,7 @@ documentation # Client-side -Verify the nroff of manpages +Verify the nroff of man pages diff --git a/tests/data/test1488 b/tests/data/test1488 index 9b326ed1311b..f2e92a50538e 100644 --- a/tests/data/test1488 +++ b/tests/data/test1488 @@ -11,7 +11,7 @@ manpages # Client-side -symbols-in-versions and manpages agree on added-in versions +symbols-in-versions and man pages agree on added-in versions diff --git a/tests/data/test1705 b/tests/data/test1705 index 26ddf3d4ad19..c85886b96a82 100644 --- a/tests/data/test1705 +++ b/tests/data/test1705 @@ -12,7 +12,7 @@ managen -managen makes manpage +managen makes man page @@ -191,7 +191,7 @@ option2.md:15:1:WARN: see-also a non-existing option: proto-default .\" * .\" ************************************************************************** .\" -.\" DO NOT EDIT. Generated by the curl project managen manpage generator. +.\" DO NOT EDIT. Generated by the curl project managen man page generator. .\" .TH curl 1 "%DATE" "curl %VERNUM" "curl Manual" .SH DESCRIPTION diff --git a/tests/ech_tests.sh b/tests/ech_tests.sh index 9123bbc096c5..f55a0f12ec5d 100755 --- a/tests/ech_tests.sh +++ b/tests/ech_tests.sh @@ -308,7 +308,7 @@ fi echo "have_portsblocked: $have_portsblocked" } >> "$logfile" -echo "curl: have $have_curl, cURL command: |$CURL ${CURL_PARAMS[*]}|" +echo "curl: have $have_curl, curl command: |$CURL ${CURL_PARAMS[*]}|" echo "ossl: have: $have_ossl, using: $using_ossl" echo "wolf: have: $have_wolf, using: $using_wolf" echo "bssl: have: $have_bssl, using: $using_bssl" diff --git a/tests/libtest/lib1592.c b/tests/libtest/lib1592.c index 7e23d576bf2b..1a36c4a925b2 100644 --- a/tests/libtest/lib1592.c +++ b/tests/libtest/lib1592.c @@ -26,7 +26,7 @@ * * This test case checks whether curl_multi_remove_handle() cancels * asynchronous DNS resolvers without blocking where possible. Obviously, it - * only tests whichever resolver cURL is actually built with. + * only tests whichever resolver curl is actually built with. */ /* We're willing to wait a very generous two seconds for the removal. This is diff --git a/tests/test1139.pl b/tests/test1139.pl index cebf58ccf207..e2eb8946eb74 100755 --- a/tests/test1139.pl +++ b/tests/test1139.pl @@ -24,12 +24,12 @@ ########################################################################### # # Scan symbols-in-version (which is verified to be correct by test 1119), then -# verify that each option mention in there that should have its own manpage +# verify that each option mention in there that should have its own man page # actually does. # # In addition, make sure that every current option to curl_easy_setopt, # curl_easy_getinfo and curl_multi_setopt are also mentioned in their -# corresponding main (index) manpage. +# corresponding main (index) man page. # # src/tool_getparam.c lists all options curl can parse # docs/curl.1 documents all command line options @@ -229,8 +229,8 @@ sub scanmdpage { close($r); ######################################################################### -# parse the curl.1 manpage, extract all documented command line options -# The manpage may or may not be rebuilt, so check both possible locations +# parse the curl.1 man page, extract all documented command line options +# The man page may or may not be rebuilt, so check both possible locations open($r, "<", "$buildroot/docs/cmdline-opts/curl.1") || open($r, "<", "$root/docs/cmdline-opts/curl.1") || die "failed getting curl.1"; my @manpage; # store all parsed parameters diff --git a/tests/test1140.pl b/tests/test1140.pl index 8900ef439fed..7890ce58f685 100755 --- a/tests/test1140.pl +++ b/tests/test1140.pl @@ -23,8 +23,8 @@ # ########################################################################### # -# scan manpages to find basic syntactic problems such as unbalanced \f -# codes or references to non-existing curl manpages. +# scan man pages to find basic syntactic problems such as unbalanced \f +# codes or references to non-existing curl man pages. use strict; use warnings; @@ -81,7 +81,7 @@ sub file { my $man = "$1.3"; $man =~ s/\\//g; # cut off backslashes if(!manpresent($man)) { - print "error: $f:$line: referring to non-existing manpage $man\n"; + print "error: $f:$line: referring to non-existing man page $man\n"; $errors++; } if($pre ne "I") { @@ -100,7 +100,7 @@ sub file { my $man = "$1.3"; $man =~ s/\\//g; # cut off backslashes if(!manpresent($man)) { - print "error: $f:$line: referring to non-existing manpage $man\n"; + print "error: $f:$line: referring to non-existing man page $man\n"; $errors++; } } diff --git a/tests/test1173.pl b/tests/test1173.pl index 9b384ded78ac..19bcd1af8cfd 100755 --- a/tests/test1173.pl +++ b/tests/test1173.pl @@ -23,7 +23,7 @@ # ########################################################################### # -# Scan manpage(s) and detect some simple and yet common formatting mistakes. +# Scan man page(s) and detect some simple and yet common formatting mistakes. # # Output all deviances to stderr. @@ -148,7 +148,7 @@ sub scanmanpage { open(my $m, "<", "$file") || die "test1173.pl could not open $file"; if($file =~ /[\/\\](CURL|curl_)([^\/\\]*).3/) { - # This is a manpage for libcurl. It requires an example unless it's + # This is a man page for libcurl. It requires an example unless it's # considered deprecated. $reqex = 1 unless defined $deprecated{'CURL'.$2}; if($1 eq "CURL") { @@ -159,12 +159,12 @@ sub scanmanpage { while(<$m>) { chomp; if($_ =~ /^.so /) { - # this manpage is just a referral + # this man page is just a referral close($m); return; } if(($_ =~ /^\.SH SYNOPSIS/i) && ($reqex)) { - # this is for libcurl manpage SYNOPSIS checks + # this is for libcurl man page SYNOPSIS checks $insynop = 1; $inexample = 0; } @@ -269,7 +269,7 @@ sub scanmanpage { if($optpage && $SH && ($SH !~ /^(SYNOPSIS|EXAMPLE|NAME|SEE ALSO)/i) && ($_ =~ /(.*)(CURL(OPT_|MOPT_|INFO_|SHOPT_)[A-Z0-9_]*)/)) { - # an option with its own manpage, check that it is tagged + # an option with its own man page, check that it is tagged # for linking my ($pref, $symbol) = ($1, $2); if($deprecated{$symbol}) { @@ -318,7 +318,7 @@ sub scanmanpage { } if($shcount < 3) { - print STDERR "$file:$line too few manpage sections!\n"; + print STDERR "$file:$line too few man page sections!\n"; $errors++; return; } diff --git a/tests/test1222.pl b/tests/test1222.pl index 0d9d6fdd32b9..8186d635112e 100755 --- a/tests/test1222.pl +++ b/tests/test1222.pl @@ -25,7 +25,7 @@ ########################################################################### # # Check that the deprecated statuses of functions and enum values in header -# files, manpages and symbols-in-versions are in sync. +# files, man pages and symbols-in-versions are in sync. use strict; use warnings; @@ -48,8 +48,8 @@ # x.yy.z Deprecated in version x.yy.z my %syminver; # Symbols-in-versions deprecations. my %hdr; # Public header files deprecations. -my %funcman; # Function manpages deprecations. -my %optman; # Option manpages deprecations. +my %funcman; # Function man pages deprecations. +my %optman; # Option man pages deprecations. # Scan header file for public function and enum values. Flag them with @@ -144,7 +144,7 @@ sub scan_header { close $h; } -# Scan function manpage for options. +# Scan function man page for options. # Each option has to be declared as ".IP diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 84f61202117c..ba796f1ceb16 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -1495,9 +1495,9 @@ static int test_oct_hex_formatting(void) #endif if(!errors) - curl_mprintf("All curl_mprintf() octal & hexadecimal tests OK!\n"); + curl_mprintf("All curl_mprintf() octal and hexadecimal tests OK!\n"); else - curl_mprintf("Some curl_mprintf() octal & hexadecimal tests Failed!\n"); + curl_mprintf("Some curl_mprintf() octal or hexadecimal tests Failed!\n"); return errors; } From d077d5473dbb5c8d5206b98ff071f1a14cced5de Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 16:05:52 +0100 Subject: [PATCH 347/885] test1554: make test output XML-friendly Meaning no `<` and `>` characters. Reducing the number of `xmllint` failures by 1. Closes #19496 --- tests/data/test1554 | 92 ++++++++++++++++++++--------------------- tests/libtest/lib1554.c | 4 +- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tests/data/test1554 b/tests/data/test1554 index 2f4b6d562982..43886f68a9b5 100644 --- a/tests/data/test1554 +++ b/tests/data/test1554 @@ -19,55 +19,55 @@ Content-Length: 29 run 1: foobar and so on fun! --> Mutex lock SHARE -<- Mutex unlock SHARE --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT +-] Mutex lock SHARE +[- Mutex unlock SHARE +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT run 1: foobar and so on fun! --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock SHARE -<- Mutex unlock SHARE --> Mutex lock SHARE -<- Mutex unlock SHARE --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock SHARE +[- Mutex unlock SHARE +-] Mutex lock SHARE +[- Mutex unlock SHARE +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT run 1: foobar and so on fun! --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock SHARE -<- Mutex unlock SHARE --> Mutex lock SHARE -<- Mutex unlock SHARE --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock SHARE +[- Mutex unlock SHARE +-] Mutex lock SHARE +[- Mutex unlock SHARE +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT run 1: foobar and so on fun! --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock CONNECT -<- Mutex unlock CONNECT --> Mutex lock SHARE -<- Mutex unlock SHARE --> Mutex lock SHARE -<- Mutex unlock SHARE +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock CONNECT +[- Mutex unlock CONNECT +-] Mutex lock SHARE +[- Mutex unlock SHARE +-] Mutex lock SHARE +[- Mutex unlock SHARE diff --git a/tests/libtest/lib1554.c b/tests/libtest/lib1554.c index 050075df3f34..a23d713e63d7 100644 --- a/tests/libtest/lib1554.c +++ b/tests/libtest/lib1554.c @@ -44,7 +44,7 @@ static void t1554_test_lock(CURL *curl, curl_lock_data data, (void)data; (void)laccess; (void)useptr; - curl_mprintf("-> Mutex lock %s\n", ldata_names[data]); + curl_mprintf("-] Mutex lock %s\n", ldata_names[data]); } static void t1554_test_unlock(CURL *curl, curl_lock_data data, void *useptr) @@ -52,7 +52,7 @@ static void t1554_test_unlock(CURL *curl, curl_lock_data data, void *useptr) (void)curl; (void)data; (void)useptr; - curl_mprintf("<- Mutex unlock %s\n", ldata_names[data]); + curl_mprintf("[- Mutex unlock %s\n", ldata_names[data]); } /* test function */ From d7b0b654ea4cce1bceb5edeecd05566d3729a388 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 16:36:14 +0100 Subject: [PATCH 348/885] test1404, 1547: replace `&` char in comment and name for XML-friendliness Closes #19497 --- tests/data/test1404 | 2 +- tests/data/test1547 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/test1404 b/tests/data/test1404 index 1cf0c676eaaf..e40c775b2197 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -31,7 +31,7 @@ Mime http ---libcurl plus -F with 3 files, one with explicit type & encoder +--libcurl plus -F with 3 files, one with explicit type and encoder SSL_CERT_FILE diff --git a/tests/data/test1547 b/tests/data/test1547 index 7e1625aa4b9e..7984038e5c56 100644 --- a/tests/data/test1547 +++ b/tests/data/test1547 @@ -1,5 +1,5 @@ -# Based on test100 & test101 +# Based on test100 and test101 FTP From 8a19bf862a82bf4e8ef83b9754b071dca5494c0b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 17:41:54 +0100 Subject: [PATCH 349/885] test2045: replace HTML multi-line comment markup with `#` comments As used everywhere else in tests/data. To play nice with XML. Follow-up to 9756d1da7637d1913b7ca2b589e4635f32ed3e00 Closes #19498 --- tests/data/test2045 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/data/test2045 b/tests/data/test2045 index 41b31e54096c..241d9fc14f6b 100644 --- a/tests/data/test2045 +++ b/tests/data/test2045 @@ -10,17 +10,15 @@ FTP # # Server-side - +# The purpose of this test is to make sure the --proto-default option works +# properly. We specify a default protocol of FTP and if the option works properly +# curl will use the FTP protocol. If the option is broken however curl will use +# the HTTP protocol. +# In the broken scenario curl would use HTTP to talk to our FTP server. We handle +# that by replying with something that both protocols can understand. Our FTP +# server allows a custom welcome message, so we use that feature to make an HTTP +# reply that contains an FTP reply (think polyglot). In the case of FTP we expect +# curl will return CURLE_WEIRD_SERVER_REPLY so we test for that return code. REPLY welcome HTTP/1.1 200 OK\r\nContent-Length: 21\r\n\r\n500 Weird FTP Reply From 6b26d465e1df7d172dbc8302c5314d31f3239667 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 18:16:55 +0100 Subject: [PATCH 350/885] tests/data: use more `repeat` macro Found in `client/command` sections. Closes #19499 --- tests/data/test1294 | 4 ++-- tests/data/test1295 | 6 +++--- tests/data/test1453 | 2 +- tests/data/test729 | 2 +- tests/data/test761 | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/data/test1294 b/tests/data/test1294 index 887023959bd2..e7593970011d 100644 --- a/tests/data/test1294 +++ b/tests/data/test1294 @@ -44,7 +44,7 @@ HTTP GET with split initial request send CURL_SMALLREQSEND=128 -http://%HOSTIP:%HTTPPORT/012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER -H "Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small to ___, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter: 511" +http://%HOSTIP:%HTTPPORT/%repeat[30 x 012345679]%/%TESTNUMBER -H "Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small to ___, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter: 511" @@ -52,7 +52,7 @@ http://%HOSTIP:%HTTPPORT/0123456790123456790123456790123456790123456790123456790 # Verify data after the test has been "shot" -GET /012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER HTTP/1.1 +GET /%repeat[30 x 012345679]%/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1295 b/tests/data/test1295 index bfd13c73f635..de9c86ef21ff 100644 --- a/tests/data/test1295 +++ b/tests/data/test1295 @@ -44,7 +44,7 @@ HTTP POST with split initial request send CURL_SMALLREQSEND=100 -http://%HOSTIP:%HTTPPORT/012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER -H "012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679: 300" -d "Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table." -w '%{size_upload}\n' +http://%HOSTIP:%HTTPPORT/%repeat[30 x 012345679]%/%TESTNUMBER -H "%repeat[30 x 012345679]%: 300" -d "Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table." -w '%{size_upload}\n' @@ -52,11 +52,11 @@ http://%HOSTIP:%HTTPPORT/0123456790123456790123456790123456790123456790123456790 # Verify data after the test has been "shot" -POST /012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679/%TESTNUMBER HTTP/1.1 +POST /%repeat[30 x 012345679]%/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679: 300 +%repeat[30 x 012345679]%: 300 Content-Length: 165 Content-Type: application/x-www-form-urlencoded diff --git a/tests/data/test1453 b/tests/data/test1453 index 921b1bdf9fe9..28f6ed732f0c 100644 --- a/tests/data/test1453 +++ b/tests/data/test1453 @@ -20,7 +20,7 @@ tftp Too long tftp filename -tftp://%HOSTIP:%NOLISTENPORT/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz +tftp://%HOSTIP:%NOLISTENPORT/%repeat[503 x a]%z diff --git a/tests/data/test729 b/tests/data/test729 index 80575892158d..fca56ade55ea 100644 --- a/tests/data/test729 +++ b/tests/data/test729 @@ -26,7 +26,7 @@ socks4 SOCKS4 with very long proxy user name -http://fake --limit-rate 1 -x socks4a://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@%HOSTIP:%SOCKSPORT +http://fake --limit-rate 1 -x socks4a://%repeat[1015 x a]%@%HOSTIP:%SOCKSPORT diff --git a/tests/data/test761 b/tests/data/test761 index 3044e1e54d15..f3b35eadccc5 100644 --- a/tests/data/test761 +++ b/tests/data/test761 @@ -12,7 +12,7 @@ globbing too many {} globs -http://testingthis/{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b +http://testingthis/%repeat[201 x {a}b]% @@ -24,7 +24,7 @@ http://testingthis/{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{ curl: (3) too many {} sets in URL position 403: -http://testingthis/{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a}b{a +http://testingthis/%repeat[113 x {a}b]%{a From 4b2da75bca4ff32f004491f5fa622749d78f698e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 20:34:53 +0100 Subject: [PATCH 351/885] test716: use `repeat` macro Closes #19501 --- tests/data/test716 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test716 b/tests/data/test716 index 5c20b45a75f6..d6910718b3f0 100644 --- a/tests/data/test716 +++ b/tests/data/test716 @@ -31,7 +31,7 @@ SOCKS5 proxy with too long user name # it should never connect to the target server -http://hohoho.example.com:99/%TESTNUMBER -x socks5://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:b@%HOSTIP:%SOCKSPORT +http://hohoho.example.com:99/%TESTNUMBER -x socks5://%repeat[256 x A]%:b@%HOSTIP:%SOCKSPORT From c6eb9bb3dc0158ebd543436d3d364fde4e38ce40 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 12 Nov 2025 23:15:37 +0100 Subject: [PATCH 352/885] _PROGRESS.md: add the E unit, mention kibibyte The suffixes used are not standard since we want them to be single characters and the proper ones would be KiB, MiB etc. Closes #19502 --- .github/scripts/pyspelling.words | 3 +++ docs/cmdline-opts/_PROGRESS.md | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index 5dbce132271e..76889a05bbe0 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -244,6 +244,7 @@ et etag ETag ETags +exa exe executables EXPN @@ -417,6 +418,7 @@ kerberos Keychain keychain KiB +kibibyte kickstart Kirei Knauf @@ -491,6 +493,7 @@ Mavrogiannopoulos Mbed mbedTLS md +mebibyte Meglio memdebug MesaLink diff --git a/docs/cmdline-opts/_PROGRESS.md b/docs/cmdline-opts/_PROGRESS.md index 9ab1ce8c9bf7..a506d041dca0 100644 --- a/docs/cmdline-opts/_PROGRESS.md +++ b/docs/cmdline-opts/_PROGRESS.md @@ -4,9 +4,10 @@ curl normally displays a progress meter during operations, indicating the amount of transferred data, transfer speeds and estimated time left, etc. The -progress meter displays the transfer rate in bytes per second. The suffixes -(`k` for kilo, `M` for mega, `G` for giga, `T` for tera, and `P` for peta) are -1024 based. For example 1k is 1024 bytes. 1M is 1048576 bytes. +progress meter displays the transfer rate in bytes per second. The used +suffixes (`k` for kilo, `M` for mega, `G` for giga, `T` for tera, `P` for peta +and `E` for exa) are 1024 based. For example 1k is 1024 bytes. 1M is 1048576 +bytes. Strictly speaking this makes the units kibibyte and mebibyte etc. curl displays this data to the terminal by default, so if you invoke curl to do an operation and it is about to write data to the terminal, it *disables* @@ -14,8 +15,8 @@ the progress meter as otherwise it would mess up the output mixing progress meter and response data. If you want a progress meter for HTTP POST or PUT requests, you need to -redirect the response output to a file, using shell redirect (\>), --output -or similar. +redirect the response output to a file, using shell redirect (\>), --output or +similar. This does not apply to FTP upload as that operation does not spit out any response data to the terminal. From 64c03bbdf2e5956de387c2c7952e2785442a5540 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 12 Nov 2025 15:45:59 +0100 Subject: [PATCH 353/885] OS400: fix build - Fix failed build due to missing parameter. Follow-up to 8c9946d3 from yesterday. Closes https://github.com/curl/curl/pull/19494 --- packages/OS400/ccsidcurl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index 30be1f60f71e..76b182cf1724 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -361,7 +361,7 @@ curl_slist_append_ccsid(struct curl_slist *list, if(!data) return curl_slist_append(list, data); - s = dynconvert(ASCII_CCSID, data, -1, ccsid); + s = dynconvert(ASCII_CCSID, data, -1, ccsid, NULL); if(!s) return (struct curl_slist *) NULL; From 3d42510118a9eba12a0d3cd4e23b84a1bccd9f2a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 17:26:27 +0100 Subject: [PATCH 354/885] runtests: allow `client/command` to span multiple lines, and use it Some curl command-lines are long, often repetitive, and difficult to read or write: Before this patch (1 test == 1 line): - <=78 characters: 1099 tests - 79-132 characters: 500 tests - 133+ characters: 217 tests: patch meant to help with some of these. After this patch: - <=78 characters: 1288 lines - 79-132 characters: 526 lines - 133+ characters: 190 lines After this patch it's possible to fold long lines into multiple ones. Folding can reduce greppability, thus this is primarily useful for cases when the options are repetitive, e.g. a list of form options, headers, mail parameters and the like. Closes #19500 --- docs/tests/FILEFORMAT.md | 3 +++ tests/data/test1133 | 7 ++++++- tests/data/test1158 | 5 ++++- tests/data/test1186 | 5 ++++- tests/data/test1189 | 10 +++++++++- tests/data/test1294 | 3 ++- tests/data/test1295 | 4 +++- tests/data/test1404 | 5 ++++- tests/data/test1583 | 3 ++- tests/data/test2003 | 9 ++++++++- tests/data/test2004 | 9 ++++++++- tests/data/test2049 | 5 ++++- tests/data/test2051 | 4 +++- tests/data/test2052 | 6 +++++- tests/data/test2053 | 3 ++- tests/data/test2054 | 16 +++++++++++++++- tests/data/test3002 | 10 +++++++++- tests/data/test3003 | 10 +++++++++- tests/data/test3004 | 10 +++++++++- tests/data/test3005 | 10 +++++++++- tests/data/test3006 | 10 +++++++++- tests/data/test3007 | 6 +++++- tests/data/test3029 | 3 ++- tests/data/test39 | 10 +++++++++- tests/data/test4 | 12 +++++++++++- tests/data/test423 | 6 +++++- tests/data/test424 | 7 ++++++- tests/data/test618 | 4 +++- tests/data/test619 | 4 +++- tests/data/test62 | 5 ++++- tests/data/test625 | 5 ++++- tests/data/test646 | 12 +++++++++++- tests/data/test647 | 13 ++++++++++++- tests/data/test648 | 8 +++++++- tests/data/test917 | 9 ++++++++- tests/data/test918 | 9 ++++++++- tests/data/test938 | 3 ++- tests/runner.pm | 9 ++++++--- 38 files changed, 233 insertions(+), 39 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 8c4d0181e10d..2e0648267ed1 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -579,6 +579,9 @@ deleted. ### `` Command line to run. +If the command spans multiple lines, they are concatenated with a space added +between them. + Note that the URL that gets passed to the server actually controls what data that is returned. The last slash in the URL must be followed by a number. That number (N) is used by the test-server to load test case N and return the data diff --git a/tests/data/test1133 b/tests/data/test1133 index a14dbe8ee9ac..37e48f8b55a1 100644 --- a/tests/data/test1133 +++ b/tests/data/test1133 @@ -29,7 +29,12 @@ http HTTP RFC1867-type formposting with filename/data contains ',', ';', '"' -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "file=@\"%LOGDIR/test%TESTNUMBER,and;.txt\";type=mo/foo;filename=\"faker,and;.txt\"" -F 'file2=@"%LOGDIR/test%TESTNUMBER,and;.txt"' -F 'file3=@"%LOGDIR/test%TESTNUMBER,and;.txt";type=m/f,"%LOGDIR/test%TESTNUMBER,and;.txt"' -F a="{\"field1\":\"value1\",\"field2\":\"value2\"}" -F 'b=" \\value1;type=\"whatever\" "; type=text/foo; charset=utf-8 ; filename=param_b' +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER +-F "file=@\"%LOGDIR/test%TESTNUMBER,and;.txt\";type=mo/foo;filename=\"faker,and;.txt\"" +-F 'file2=@"%LOGDIR/test%TESTNUMBER,and;.txt"' +-F 'file3=@"%LOGDIR/test%TESTNUMBER,and;.txt";type=m/f,"%LOGDIR/test%TESTNUMBER,and;.txt"' +-F a="{\"field1\":\"value1\",\"field2\":\"value2\"}" +-F 'b=" \\value1;type=\"whatever\" "; type=text/foo; charset=utf-8 ; filename=param_b' # We create this file before the command is invoked! diff --git a/tests/data/test1158 b/tests/data/test1158 index bc9f2d571995..c2a7330fe6ef 100644 --- a/tests/data/test1158 +++ b/tests/data/test1158 @@ -30,7 +30,10 @@ http HTTP RFC1867-type formposting with filename containing '"' -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "file=@\"%LOGDIR/test%TESTNUMBER\\\".txt\";type=mo/foo;filename=\"test%TESTNUMBER\\\".txt\"" -F 'file2=@"%LOGDIR/test%TESTNUMBER\".txt"' -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"' +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER +-F "file=@\"%LOGDIR/test%TESTNUMBER\\\".txt\";type=mo/foo;filename=\"test%TESTNUMBER\\\".txt\"" +-F 'file2=@"%LOGDIR/test%TESTNUMBER\".txt"' +-F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"' # We create this file before the command is invoked! diff --git a/tests/data/test1186 b/tests/data/test1186 index e3157f36ca54..f9edac8f361d 100644 --- a/tests/data/test1186 +++ b/tests/data/test1186 @@ -30,7 +30,10 @@ http Multipart formposting with backslash-escaping filename containing '"' -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape -F "file=@\"%LOGDIR/test%TESTNUMBER\\\".txt\";type=mo/foo;filename=\"test%TESTNUMBER\\\".txt\"" -F 'file2=@"%LOGDIR/test%TESTNUMBER\".txt"' -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"' +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape +-F "file=@\"%LOGDIR/test%TESTNUMBER\\\".txt\";type=mo/foo;filename=\"test%TESTNUMBER\\\".txt\"" +-F 'file2=@"%LOGDIR/test%TESTNUMBER\".txt"' +-F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"' # We create this file before the command is invoked! diff --git a/tests/data/test1189 b/tests/data/test1189 index 3e5748eafdce..0fb354a88eae 100644 --- a/tests/data/test1189 +++ b/tests/data/test1189 @@ -29,7 +29,15 @@ http Multipart formposting with backslash-escaping of name= and filename= -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2= # We create this file before the command is invoked! diff --git a/tests/data/test1294 b/tests/data/test1294 index e7593970011d..0e3eff5dea59 100644 --- a/tests/data/test1294 +++ b/tests/data/test1294 @@ -44,7 +44,8 @@ HTTP GET with split initial request send CURL_SMALLREQSEND=128 -http://%HOSTIP:%HTTPPORT/%repeat[30 x 012345679]%/%TESTNUMBER -H "Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small to ___, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter: 511" +http://%HOSTIP:%HTTPPORT/%repeat[30 x 012345679]%/%TESTNUMBER +-H "Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small to ___, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter: 511" diff --git a/tests/data/test1295 b/tests/data/test1295 index de9c86ef21ff..8de79a310d6c 100644 --- a/tests/data/test1295 +++ b/tests/data/test1295 @@ -44,7 +44,9 @@ HTTP POST with split initial request send CURL_SMALLREQSEND=100 -http://%HOSTIP:%HTTPPORT/%repeat[30 x 012345679]%/%TESTNUMBER -H "%repeat[30 x 012345679]%: 300" -d "Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table." -w '%{size_upload}\n' +http://%HOSTIP:%HTTPPORT/%repeat[30 x 012345679]%/%TESTNUMBER -H "%repeat[30 x 012345679]%: 300" +-d "Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table." +-w '%{size_upload}\n' diff --git a/tests/data/test1404 b/tests/data/test1404 index e40c775b2197..7ae7d8b5019c 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -37,7 +37,10 @@ http SSL_CERT_FILE -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=value -F 'file=@%LOGDIR/test%TESTNUMBER.txt,%LOGDIR/test%TESTNUMBER.txt;type=magic/content;encoder=8bit,%LOGDIR/test%TESTNUMBER.txt;headers=X-testheader-1: header 1;headers=X-testheader-2: header 2' --libcurl %LOGDIR/test%TESTNUMBER.c +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER +-F name=value +-F 'file=@%LOGDIR/test%TESTNUMBER.txt,%LOGDIR/test%TESTNUMBER.txt;type=magic/content;encoder=8bit,%LOGDIR/test%TESTNUMBER.txt;headers=X-testheader-1: header 1;headers=X-testheader-2: header 2' +--libcurl %LOGDIR/test%TESTNUMBER.c # We create this file before the command is invoked! diff --git a/tests/data/test1583 b/tests/data/test1583 index b266d7eea8e1..8bcd7811a0bc 100644 --- a/tests/data/test1583 +++ b/tests/data/test1583 @@ -23,7 +23,8 @@ sftp SFTP dir and empty file ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: --insecure sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.dir/ --next --key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: --insecure sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.dir/emptyfile.txt +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: --insecure sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.dir/ --next +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: --insecure sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.dir/emptyfile.txt diff --git a/tests/data/test2003 b/tests/data/test2003 index ce5fcbcb6f0c..f3f2194d427e 100644 --- a/tests/data/test2003 +++ b/tests/data/test2003 @@ -58,7 +58,14 @@ tftp HTTP GET, FTP RETR, FILE, TFTP RRQ then again in rev order -http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER0003 tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER0003 file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 +http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 +ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 +file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt +tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER0003 +tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER0003 +file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt +ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 +http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 foo diff --git a/tests/data/test2004 b/tests/data/test2004 index f9770c3fb323..87dabcd6e978 100644 --- a/tests/data/test2004 +++ b/tests/data/test2004 @@ -30,7 +30,14 @@ sftp TFTP RRQ, SFTP, FILE, SCP retrieval then in rev order ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.txt file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt scp://%HOSTIP:%SSHPORT%SCP_PWD/%LOGDIR/test%TESTNUMBER.txt file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: +tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER +sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.txt +file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt +scp://%HOSTIP:%SSHPORT%SCP_PWD/%LOGDIR/test%TESTNUMBER.txt +file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt +sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.txt +tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --insecure This is test data diff --git a/tests/data/test2049 b/tests/data/test2049 index 0fd0d94d77de..75ef13201120 100644 --- a/tests/data/test2049 +++ b/tests/data/test2049 @@ -31,7 +31,10 @@ Connect to specific host -http://www1.example.com:8081/%TESTNUMBER --connect-to ::%HOSTIP:%HTTPPORT --next http://www2.example.com:8082/%TESTNUMBER --connect-to :8082:%HOSTIP:%HTTPPORT --next http://www3.example.com:8083/%TESTNUMBER --connect-to www3.example.com::%HOSTIP:%HTTPPORT --next http://www4.example.com:8084/%TESTNUMBER --connect-to www4.example.com:8084:%HOSTIP:%HTTPPORT +http://www1.example.com:8081/%TESTNUMBER --connect-to ::%HOSTIP:%HTTPPORT --next +http://www2.example.com:8082/%TESTNUMBER --connect-to :8082:%HOSTIP:%HTTPPORT --next +http://www3.example.com:8083/%TESTNUMBER --connect-to www3.example.com::%HOSTIP:%HTTPPORT --next +http://www4.example.com:8084/%TESTNUMBER --connect-to www4.example.com:8084:%HOSTIP:%HTTPPORT diff --git a/tests/data/test2051 b/tests/data/test2051 index 8523652f0249..d730a3c41dd5 100644 --- a/tests/data/test2051 +++ b/tests/data/test2051 @@ -31,7 +31,9 @@ Connect to specific host: Reuse existing connections if possible -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" --next --connect-to ::%HOSTIP:%HTTPPORT http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" --next http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" --next --connect-to ::%HOSTIP:%HTTPPORT +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" --next +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" diff --git a/tests/data/test2052 b/tests/data/test2052 index 891912dde109..56814d35ab04 100644 --- a/tests/data/test2052 +++ b/tests/data/test2052 @@ -32,7 +32,11 @@ http -http://www.example.com:%HTTPPORT/%TESTNUMBER --resolve www.example.com:%HTTPPORT:%HOSTIP -w "%{num_connects}\n" --next --resolve -www.example.com:%HTTPPORT --connect-to ::%HOSTIP:%HTTPPORT http://www.example.com:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" +http://www.example.com:%HTTPPORT/%TESTNUMBER +--resolve www.example.com:%HTTPPORT:%HOSTIP -w "%{num_connects}\n" +--next +--resolve -www.example.com:%HTTPPORT --connect-to ::%HOSTIP:%HTTPPORT +http://www.example.com:%HTTPPORT/%TESTNUMBER -w "%{num_connects}\n" diff --git a/tests/data/test2053 b/tests/data/test2053 index 8322f79e72ff..7945c0c9b5e5 100644 --- a/tests/data/test2053 +++ b/tests/data/test2053 @@ -31,7 +31,8 @@ Connect to specific host with IP addresses -http://10.0.0.1:8081/%TESTNUMBER --connect-to 10.0.0.1:8081:%HOSTIP:%HTTPPORT --next http://[fc00::1]:8082/%TESTNUMBER --connect-to [fc00::1]:8082:%HOSTIP:%HTTPPORT +http://10.0.0.1:8081/%TESTNUMBER --connect-to 10.0.0.1:8081:%HOSTIP:%HTTPPORT --next +http://[fc00::1]:8082/%TESTNUMBER --connect-to [fc00::1]:8082:%HOSTIP:%HTTPPORT diff --git a/tests/data/test2054 b/tests/data/test2054 index 350e55634e38..7d7d573b4f0b 100644 --- a/tests/data/test2054 +++ b/tests/data/test2054 @@ -31,7 +31,21 @@ Connect to specific host: use the first "connect-to" string that matches -http://%HOSTIP:%HTTPPORT/%TESTNUMBER --connect-to foo::bar: --connect-to :123::456 --next http://www.example.com:%HTTPPORT/%TESTNUMBER --connect-to www.example.com::%HOSTIP: --connect-to www.example.com::foo: --next http://%HOSTIP:8083/%TESTNUMBER --connect-to :8083::%HTTPPORT --connect-to :8083::123 --next http://www.example.com:8084/%TESTNUMBER --connect-to www.example.com:8084:%HOSTIP:%HTTPPORT --connect-to www.example.com:8084:foo:123 +http://%HOSTIP:%HTTPPORT/%TESTNUMBER +--connect-to foo::bar: +--connect-to :123::456 +--next +http://www.example.com:%HTTPPORT/%TESTNUMBER +--connect-to www.example.com::%HOSTIP: +--connect-to www.example.com::foo: +--next +http://%HOSTIP:8083/%TESTNUMBER +--connect-to :8083::%HTTPPORT +--connect-to :8083::123 +--next +http://www.example.com:8084/%TESTNUMBER +--connect-to www.example.com:8084:%HOSTIP:%HTTPPORT +--connect-to www.example.com:8084:foo:123 diff --git a/tests/data/test3002 b/tests/data/test3002 index 95d454dee1b0..ffb6e49a49dc 100644 --- a/tests/data/test3002 +++ b/tests/data/test3002 @@ -26,7 +26,15 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt-allowfails +--mail-rcpt invalid.one +--mail-rcpt recipient.two@example.com +--mail-rcpt recipient.three@example.com +--mail-rcpt recipient.four@example.com +--mail-rcpt recipient.five@example.com +--mail-from sender@example.com +-T - diff --git a/tests/data/test3003 b/tests/data/test3003 index 0a90820ad73d..07c72f0798a8 100644 --- a/tests/data/test3003 +++ b/tests/data/test3003 @@ -26,7 +26,15 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt invalid.five --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt-allowfails +--mail-rcpt recipient.one@example.com +--mail-rcpt recipient.two@example.com +--mail-rcpt recipient.three@example.com +--mail-rcpt recipient.four@example.com +--mail-rcpt invalid.five +--mail-from sender@example.com +-T - diff --git a/tests/data/test3004 b/tests/data/test3004 index 80261f67030d..52ef1188b928 100644 --- a/tests/data/test3004 +++ b/tests/data/test3004 @@ -26,7 +26,15 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt invalid.three --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt-allowfails +--mail-rcpt recipient.one@example.com +--mail-rcpt recipient.two@example.com +--mail-rcpt invalid.three +--mail-rcpt recipient.four@example.com +--mail-rcpt recipient.five@example.com +--mail-from sender@example.com +-T - diff --git a/tests/data/test3005 b/tests/data/test3005 index ef417a9cd592..68dedd2fc002 100644 --- a/tests/data/test3005 +++ b/tests/data/test3005 @@ -26,7 +26,15 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt recipient.two@example.com --mail-rcpt invalid.three --mail-rcpt invalid.four --mail-rcpt invalid.five --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt-allowfails +--mail-rcpt invalid.one +--mail-rcpt recipient.two@example.com +--mail-rcpt invalid.three +--mail-rcpt invalid.four +--mail-rcpt invalid.five +--mail-from sender@example.com +-T - diff --git a/tests/data/test3006 b/tests/data/test3006 index 4cb13ba17d43..d5086c23d604 100644 --- a/tests/data/test3006 +++ b/tests/data/test3006 @@ -26,7 +26,15 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt invalid.two --mail-rcpt invalid.three --mail-rcpt invalid.four --mail-rcpt invalid.five --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt-allowfails +--mail-rcpt invalid.one +--mail-rcpt invalid.two +--mail-rcpt invalid.three +--mail-rcpt invalid.four +--mail-rcpt invalid.five +--mail-from sender@example.com +-T - diff --git a/tests/data/test3007 b/tests/data/test3007 index d6222408852d..3cc0aedc86e8 100644 --- a/tests/data/test3007 +++ b/tests/data/test3007 @@ -26,7 +26,11 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt-allowfails +--mail-rcpt invalid.one +--mail-from sender@example.com +-T - diff --git a/tests/data/test3029 b/tests/data/test3029 index 1436602093a1..057b2128f8f4 100644 --- a/tests/data/test3029 +++ b/tests/data/test3029 @@ -23,7 +23,8 @@ http HTTP with multiple -D --D %LOGDIR/heads%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER --next -D %LOGDIR/heads%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-D %LOGDIR/heads%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER --next +-D %LOGDIR/heads%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test39 b/tests/data/test39 index 1ca61c80874c..02a4659e0947 100644 --- a/tests/data/test39 +++ b/tests/data/test39 @@ -29,7 +29,15 @@ http HTTP RFC1867-type formposting with filename= and type= -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2= # We create this file before the command is invoked! diff --git a/tests/data/test4 b/tests/data/test4 index 8b0479c1f8b4..d96190fa4140 100644 --- a/tests/data/test4 +++ b/tests/data/test4 @@ -30,7 +30,17 @@ http Replaced internal and added custom HTTP headers - -H "extra-header: here" -H "Accept: replaced" -H "X-Custom-Header;" -H "X-Test: foo; " -H "X-Test:" -H "X-Test2: foo;" -H "X-Test3: " -H "X-Test4; " -H "X-Test5;ignored" http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-H "extra-header: here" +-H "Accept: replaced" +-H "X-Custom-Header;" +-H "X-Test: foo; " +-H "X-Test:" +-H "X-Test2: foo;" +-H "X-Test3: " +-H "X-Test4; " +-H "X-Test5;ignored" +http://%HOSTIP:%HTTPPORT/%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test423 b/tests/data/test423 index 01313a9655e0..6d6843aa11a5 100644 --- a/tests/data/test423 +++ b/tests/data/test423 @@ -34,7 +34,11 @@ http -w with url.* variables -"http://uuuu:pppp@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" "h55p://hello2000:1/%TESTNUMBER?qqqq#ffff" "local host" "http://u22u:p22p@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" -w '%{url.host}+%{url.path}+%{url.scheme}+%{url.user}+%{url.password}+%{url.port}+%{url.query}+%{url.fragment}\n' +"http://uuuu:pppp@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" +"h55p://hello2000:1/%TESTNUMBER?qqqq#ffff" +"local host" +"http://u22u:p22p@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" +-w '%{url.host}+%{url.path}+%{url.scheme}+%{url.user}+%{url.password}+%{url.port}+%{url.query}+%{url.fragment}\n' diff --git a/tests/data/test424 b/tests/data/test424 index ff3509650542..a10752dbbeb4 100644 --- a/tests/data/test424 +++ b/tests/data/test424 @@ -51,7 +51,12 @@ http -w with urle.* variables -"http://uuuu:pppp@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" "h55p://hello2000:1/%TESTNUMBER?qqqq#ffff" "local host" "http://u22u:p22p@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" -w '%{urle.host}+%{urle.path}+%{urle.scheme}+%{urle.user}+%{urle.password}+%{urle.port}+%{urle.query}+%{urle.fragment}\n' -x http://%HOSTIP:%HTTPPORT/ -L +"http://uuuu:pppp@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" +"h55p://hello2000:1/%TESTNUMBER?qqqq#ffff" +"local host" +"http://u22u:p22p@%HOSTIP:%HTTPPORT/%TESTNUMBER?qqqq#ffff" +-w '%{urle.host}+%{urle.path}+%{urle.scheme}+%{urle.user}+%{urle.password}+%{urle.port}+%{urle.query}+%{urle.fragment}\n' +-x http://%HOSTIP:%HTTPPORT/ -L diff --git a/tests/data/test618 b/tests/data/test618 index ee1228f0f3b3..3e9c980b2970 100644 --- a/tests/data/test618 +++ b/tests/data/test618 @@ -15,7 +15,9 @@ sftp SFTP retrieval of two files ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: +sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/file%TESTNUMBER.txt +sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure Test data diff --git a/tests/data/test619 b/tests/data/test619 index 7862e5476736..c929da567309 100644 --- a/tests/data/test619 +++ b/tests/data/test619 @@ -15,7 +15,9 @@ scp SCP retrieval of two files ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%SCP_PWD/%LOGDIR/file%TESTNUMBER.txt scp://%HOSTIP:%SSHPORT%SCP_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: +scp://%HOSTIP:%SSHPORT%SCP_PWD/%LOGDIR/file%TESTNUMBER.txt +scp://%HOSTIP:%SSHPORT%SCP_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure Test data diff --git a/tests/data/test62 b/tests/data/test62 index d072e34ca898..e1a66537d42e 100644 --- a/tests/data/test62 +++ b/tests/data/test62 @@ -29,7 +29,10 @@ http HTTP, send cookies when using custom Host: -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER?hoge=fuga -b %LOGDIR/jar%TESTNUMBER.txt -H "Host: www.host.foo.com" +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER?hoge=fuga +-b %LOGDIR/jar%TESTNUMBER.txt +-H "Host: www.host.foo.com" # Netscape HTTP Cookie File diff --git a/tests/data/test625 b/tests/data/test625 index aaef56e2e5c2..0aae0b678d36 100644 --- a/tests/data/test625 +++ b/tests/data/test625 @@ -22,7 +22,10 @@ sftp SFTP put with --ftp-create-dirs twice ---ftp-create-dirs --key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -T %LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.a/upload.%TESTNUMBER -T %LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.b/upload.%TESTNUMBER --insecure +--ftp-create-dirs +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: +-T %LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.a/upload.%TESTNUMBER +-T %LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/test%TESTNUMBER.b/upload.%TESTNUMBER --insecure Test data diff --git a/tests/data/test646 b/tests/data/test646 index 2bca8337c65c..cc400604dbd1 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -30,7 +30,17 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=(;type=multipart/alternative" -F "= This is the html version;headers=X-test1: this is a header;type=text/html;headers=X-test2: this is another header " -F "=This is the plain text version;headers=@%LOGDIR/headers%TESTNUMBER" -F "=)" -F "=@%LOGDIR/test%TESTNUMBER.txt;headers=<%LOGDIR/headers%TESTNUMBER" -H "From: different" -H "To: another" -H "Reply-To: " +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt recipient@example.com +--mail-from sender@example.com +-F "=(;type=multipart/alternative" +-F "= This is the html version;headers=X-test1: this is a header;type=text/html;headers=X-test2: this is another header " +-F "=This is the plain text version;headers=@%LOGDIR/headers%TESTNUMBER" +-F "=)" +-F "=@%LOGDIR/test%TESTNUMBER.txt;headers=<%LOGDIR/headers%TESTNUMBER" +-H "From: different" +-H "To: another" +-H "Reply-To: " This is an attached file. diff --git a/tests/data/test647 b/tests/data/test647 index 732472db9c24..e6edb72c686c 100644 --- a/tests/data/test647 +++ b/tests/data/test647 @@ -26,7 +26,18 @@ imap IMAP APPEND multipart using mime API -imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -F "=(;type=multipart/alternative" -F "= This is the html version;type=text/html" -F "=This is the plain text version" -F "=)" -F "=@%LOGDIR/test%TESTNUMBER.txt" -H "Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)" -H "From: Fred Foobar " -H "To: joe@example.com" -H "Message-Id: " -H "Subject: afternoon meeting" -u user:secret +imap://%HOSTIP:%IMAPPORT/%TESTNUMBER +-F "=(;type=multipart/alternative" +-F "= This is the html version;type=text/html" +-F "=This is the plain text version" +-F "=)" +-F "=@%LOGDIR/test%TESTNUMBER.txt" +-H "Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)" +-H "From: Fred Foobar " +-H "To: joe@example.com" +-H "Message-Id: " +-H "Subject: afternoon meeting" +-u user:secret This is an attached file. diff --git a/tests/data/test648 b/tests/data/test648 index 739a61ac210f..d36823e88fbd 100644 --- a/tests/data/test648 +++ b/tests/data/test648 @@ -30,7 +30,13 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F '=This is the email inline text with a very long line containing the special character = and that should be split by encoder.;headers=Content-disposition: "inline";encoder=quoted-printable' -F "=@%LOGDIR/test%TESTNUMBER.txt;encoder=base64" -H "From: different" -H "To: another" +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt recipient@example.com +--mail-from sender@example.com +-F '=This is the email inline text with a very long line containing the special character = and that should be split by encoder.;headers=Content-disposition: "inline";encoder=quoted-printable' +-F "=@%LOGDIR/test%TESTNUMBER.txt;encoder=base64" +-H "From: different" +-H "To: another" This is an attached file. diff --git a/tests/data/test917 b/tests/data/test917 index 5f009c772083..3ccc5334526f 100644 --- a/tests/data/test917 +++ b/tests/data/test917 @@ -26,7 +26,14 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt recipient.one@example.com +--mail-rcpt recipient.two@example.com +--mail-rcpt recipient.three@example.com +--mail-rcpt recipient.four@example.com +--mail-rcpt recipient.five@example.com +--mail-from sender@example.com +-T - diff --git a/tests/data/test918 b/tests/data/test918 index 491e8be195c7..d81b44db1694 100644 --- a/tests/data/test918 +++ b/tests/data/test918 @@ -26,7 +26,14 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient.one@example.com --mail-rcpt invalid --mail-rcpt recipient.three@example.com --mail-rcpt sTrAnGe --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER +--mail-rcpt recipient.one@example.com +--mail-rcpt invalid +--mail-rcpt recipient.three@example.com +--mail-rcpt sTrAnGe +--mail-rcpt recipient.five@example.com +--mail-from sender@example.com +-T - diff --git a/tests/data/test938 b/tests/data/test938 index d539b7cb80d2..a77a3a08e1ca 100644 --- a/tests/data/test938 +++ b/tests/data/test938 @@ -34,7 +34,8 @@ SMTP multiple connection authentication mail body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER001 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.one:secret -T %LOGDIR/upload%TESTNUMBER -: smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER002 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.two:secret -T %LOGDIR/upload%TESTNUMBER +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER001 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.one:secret -T %LOGDIR/upload%TESTNUMBER -: +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER002 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user.two:secret -T %LOGDIR/upload%TESTNUMBER diff --git a/tests/runner.pm b/tests/runner.pm index c711834e0149..fe43ed05bacc 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -804,10 +804,13 @@ sub singletest_run { my ($testnum, $testtimings) = @_; # get the command line options to use - my ($cmd, @blaha)= getpart("client", "command"); - if($cmd) { - # make some nice replace operations + my $cmd; + my @cmd = getpart("client", "command"); + if(@cmd) { + # allow splitting the command-line to multiple lines + $cmd = join(' ', @cmd); $cmd =~ s/\n//g; # no newlines please + chomp $cmd; # no newlines please # substitute variables in the command line } else { From f1fec22776e9f6d554a5b6b78c1d9db183c61be3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 08:49:49 +0100 Subject: [PATCH 355/885] RELEASE-NOTES: synced curlver: 8.18.0 is the next planned release version --- RELEASE-NOTES | 70 ++++++++++++++++++++++++++++++++++++++---- include/curl/curlver.h | 8 ++--- 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 956e2b42a5b8..a997e6839430 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,17 +1,21 @@ -curl and libcurl 8.17.1 +curl and libcurl 8.18.0 Public curl releases: 272 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3536 + Contributors: 3537 This release includes the following changes: This release includes the following bugfixes: + o _PROGRESS.md: add the E unit, mention kibibyte [24] o asyn-thrdd: release rrname if ares_init_options fails [41] + o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] + o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74] + o cf-https-connect: allocate ctx at first in cf_hc_create() [79] o checksrc.pl: detect assign followed by more than one space [26] o cmake: adjust defaults for target platforms not supporting shared libs [35] o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] @@ -26,39 +30,63 @@ This release includes the following bugfixes: o digest_sspi: properly free sspi identity [12] o docs: fix checksrc `EQUALSPACE` warnings [21] o docs: mention umask need when curl creates files [56] + o examples/crawler: fix variable [92] o ftp: refactor a piece of code by merging the repeated part [40] + o ftp: remove #ifdef for define that is always defined [76] o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] o gtls: skip session resumption when verifystatus is set + o hostip: don't store negative lookup on OOM [61] + o http: replace atoi use in Curl_http_follow with curlx_str_number [65] o INSTALL-CMAKE.md: document static option defaults more [37] + o krb5_sspi: unify a part of error handling [80] o lib: cleanup for some typos about spaces and code style [3] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] + o libssh2: cleanup ssh_force_knownhost_key_type [64] + o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] o m4/sectrust: fix test(1) operator [4] o mbedtls: fix potential use of uninitialized `nread` [8] + o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] + o noproxy: replace atoi with curlx_str_number [67] o openssl: release ssl_session if sess_reuse_cb fails [43] o openssl: remove code handling default version [28] + o OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs [94] + o OS400/makefile.sh: fix shellcheck warning SC2038 [86] o osslq: code readability [5] + o progress: show fewer digits [78] o pytest: skip H2 tests if feature missing from curl [46] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] + o rustls: fix a potential memory issue [81] o schannel: fix memory leak of cert_store_path on four error paths [23] + o scripts: fix shellcheck SC2046 warnings [90] + o scripts: use end-of-options marker in `find -exec` commands [87] o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] o setopt: when setting bad protocols, don't store them [9] + o sftp: fix range downloads in both SSH backends [82] + o socks_sspi: use free() not FreeContextBuffer() [93] + o telnet: replace atoi for BINARY handling with curlx_str_number [66] + o test2045: replace HTML multi-line comment markup with `#` comments [36] + o test363: delete stray character (typo) from a section tag [52] o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33] + o tests/data: support using native newlines on disk, drop `.gitattributes` [91] o tests/server: do not fall back to original data file in `test2fopen()` [32] o tftp: release filename if conn_get_remote_addr fails [42] o tool: consider (some) curl_easy_setopt errors fatal [7] o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] o tool_operate: remove redundant condition [19] + o tool_operate: use curlx_str_number intead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] o urlapi: fix mem-leaks in curl_url_get error paths [22] + o verify-release: update to avoid shellcheck warning SC2034 [88] o vtls: fix CURLOPT_CAPATH use [51] o vtls: handle possible malicious certs_num from peer [53] o wcurl: import v2025.11.09 [29] o wolfSSL: able to differentiate between IP and DNS in alt names [13] + o wolfssl: avoid NULL dereference in OOM situation [77] This release includes the following known bugs: @@ -82,10 +110,12 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Andrew Kirillov, Brad King, Dan Fandrich, Daniel Stenberg, Jiyong Yang, - Juliusz Sosinowicz, renovate[bot], Samuel Henrique, Stanislav Fort, - Stefan Eissing, Thomas Klausner, Viktor Szakats, Xiaoke Wang - (13 contributors) + Andrew Kirillov, Brad King, Dan Fandrich, Daniel Stenberg, + Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, + Leonardo Taccari, Patrick Monnerat, Ray Satiro, renovate[bot], + Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner, + Viktor Szakats, Xiaoke Wang + (18 contributors) References to bug reports and discussions on issues: @@ -110,6 +140,7 @@ References to bug reports and discussions on issues: [21] = https://curl.se/bug/?i=19379 [22] = https://curl.se/bug/?i=19440 [23] = https://curl.se/bug/?i=19423 + [24] = https://curl.se/bug/?i=19502 [25] = https://curl.se/bug/?i=19439 [26] = https://curl.se/bug/?i=19375 [27] = https://curl.se/bug/?i=19438 @@ -119,6 +150,7 @@ References to bug reports and discussions on issues: [32] = https://curl.se/bug/?i=19429 [33] = https://curl.se/bug/?i=19427 [35] = https://curl.se/bug/?i=19420 + [36] = https://curl.se/bug/?i=19498 [37] = https://curl.se/bug/?i=19419 [39] = https://curl.se/bug/?i=19415 [40] = https://curl.se/bug/?i=19411 @@ -131,7 +163,33 @@ References to bug reports and discussions on issues: [49] = https://curl.se/bug/?i=19404 [50] = https://curl.se/bug/?i=19406 [51] = https://curl.se/bug/?i=19401 + [52] = https://curl.se/bug/?i=19490 [53] = https://curl.se/bug/?i=19397 [54] = https://curl.se/bug/?i=19399 [55] = https://curl.se/bug/?i=19336 [56] = https://curl.se/bug/?i=19396 + [61] = https://curl.se/bug/?i=19484 + [63] = https://curl.se/bug/?i=19479 + [64] = https://curl.se/bug/?i=19479 + [65] = https://curl.se/bug/?i=19478 + [66] = https://curl.se/bug/?i=19477 + [67] = https://curl.se/bug/?i=19475 + [68] = https://curl.se/bug/?i=19480 + [70] = https://curl.se/bug/?i=19464 + [71] = https://curl.se/bug/?i=19461 + [74] = https://curl.se/bug/?i=19465 + [76] = https://curl.se/bug/?i=19463 + [77] = https://curl.se/bug/?i=19459 + [78] = https://curl.se/bug/?i=19431 + [79] = https://curl.se/bug/?i=19454 + [80] = https://curl.se/bug/?i=19452 + [81] = https://curl.se/bug/?i=19425 + [82] = https://curl.se/bug/?i=19460 + [86] = https://curl.se/bug/?i=19451 + [87] = https://curl.se/bug/?i=19450 + [88] = https://curl.se/bug/?i=19449 + [90] = https://curl.se/bug/?i=19432 + [91] = https://curl.se/bug/?i=19398 + [92] = https://curl.se/bug/?i=19446 + [93] = https://curl.se/bug/?i=19445 + [94] = https://curl.se/bug/?i=19444 diff --git a/include/curl/curlver.h b/include/curl/curlver.h index 8977d9eb410d..5a19dc2f5d7e 100644 --- a/include/curl/curlver.h +++ b/include/curl/curlver.h @@ -32,13 +32,13 @@ /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "8.17.1-DEV" +#define LIBCURL_VERSION "8.18.0-DEV" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 8 -#define LIBCURL_VERSION_MINOR 17 -#define LIBCURL_VERSION_PATCH 1 +#define LIBCURL_VERSION_MINOR 18 +#define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will always follow this syntax: @@ -58,7 +58,7 @@ CURL_VERSION_BITS() macro since curl's own configure script greps for it and needs it to contain the full number. */ -#define LIBCURL_VERSION_NUM 0x081101 +#define LIBCURL_VERSION_NUM 0x081200 /* * This is the date and time when the full source package was created. The From 296ffc45c3a3e389fb816cad2d2e4e23bc045212 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 12 Nov 2025 11:27:36 +0100 Subject: [PATCH 356/885] schannel: replace atoi() with curlx_str_number() The last atoi() call removed from libcurl Closes #19483 --- lib/vtls/schannel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 639d6c384208..863524e4ee62 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -2587,9 +2587,12 @@ static int schannel_init(void) #pragma clang diagnostic pop #endif if(p_wine_get_version) { /* WINE detected */ + curl_off_t ver = 0; const char *wine_version = p_wine_get_version(); /* e.g. "6.0.2" */ /* Assume ALPN support with WINE 6.0 or upper */ - s_win_has_alpn = wine_version && atoi(wine_version) >= 6; + if(wine_version) + curlx_str_number(&wine_version, &ver, 20); + s_win_has_alpn = (ver >= 6); } else { /* ALPN is supported on Windows 8.1 / Server 2012 R2 and above. */ From 3f0629ca443825916cbc0795bcd5f241fbf7104c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 12 Nov 2025 13:16:33 +0100 Subject: [PATCH 357/885] cookie: propagate errors better, cleanup the internal API Overhaul of the internal cookie APIs and an attempt to better return errors for OOM and similar critical problems, separate from ordinary and benign parsing problems. Closes #19493 --- lib/cookie.c | 434 +++++++++++++++++++++------------------------ lib/cookie.h | 27 +-- lib/easy.c | 4 +- lib/http.c | 11 +- lib/setopt.c | 25 +-- lib/share.c | 2 +- lib/transfer.c | 6 +- tests/data/test506 | 124 +++++++------ 8 files changed, 307 insertions(+), 326 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index 35b252971d9a..fce628cb9754 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -22,53 +22,6 @@ * ***************************************************************************/ -/*** - - -RECEIVING COOKIE INFORMATION -============================ - -Curl_cookie_init() - - Inits a cookie struct to store data in a local file. This is always - called before any cookies are set. - -Curl_cookie_add() - - Adds a cookie to the in-memory cookie jar. - - -SENDING COOKIE INFORMATION -========================== - -Curl_cookie_getlist() - - For a given host and path, return a linked list of cookies that - the client should send to the server if used now. The secure - boolean informs the cookie if a secure connection is achieved or - not. - - It shall only return cookies that have not expired. - -Example set of cookies: - - Set-cookie: PRODUCTINFO=webxpress; domain=.fidelity.com; path=/; secure - Set-cookie: PERSONALIZE=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/ftgw; secure - Set-cookie: FidHist=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: FidOrder=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: DisPend=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: FidDis=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: - Session_Key@6791a9e0-901a-11d0-a1c8-9b012c88aa77=none;expires=Monday, - 13-Jun-1988 03:04:55 GMT; domain=.fidelity.com; path=/; secure -****/ - - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) @@ -303,34 +256,6 @@ static char *sanitize_cookie_path(const char *cookie_path) return Curl_memdup0(cookie_path, len); } -/* - * Load cookies from all given cookie files (CURLOPT_COOKIEFILE). - * - * NOTE: OOM or cookie parsing failures are ignored. - */ -void Curl_cookie_loadfiles(struct Curl_easy *data) -{ - struct curl_slist *list = data->state.cookielist; - if(list) { - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - while(list) { - struct CookieInfo *ci = - Curl_cookie_init(data, list->data, data->cookies, - data->set.cookiesession); - if(!ci) - /* - * Failure may be due to OOM or a bad cookie; both are ignored - * but only the first should be - */ - infof(data, "ignoring failed cookie_init for %s", list->data); - else - data->cookies = ci; - list = list->next; - } - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - } -} - /* * strstore * @@ -445,25 +370,6 @@ static bool invalid_octets(const char *ptr) return FALSE; } -#define CERR_OK 0 -#define CERR_TOO_LONG 1 /* input line too long */ -#define CERR_TAB 2 /* in a wrong place */ -#define CERR_TOO_BIG 3 /* name/value too large */ -#define CERR_BAD 4 /* deemed incorrect */ -#define CERR_NO_SEP 5 /* semicolon problem */ -#define CERR_NO_NAME_VALUE 6 /* name or value problem */ -#define CERR_INVALID_OCTET 7 /* bad content */ -#define CERR_BAD_SECURE 8 /* secure in a bad place */ -#define CERR_OUT_OF_MEMORY 9 -#define CERR_NO_TAILMATCH 10 -#define CERR_COMMENT 11 /* a commented line */ -#define CERR_RANGE 12 /* expire range problem */ -#define CERR_FIELDS 13 /* incomplete netscape line */ -#ifdef USE_LIBPSL -#define CERR_PSL 14 /* a public suffix */ -#endif -#define CERR_LIVE_WINS 15 - /* The maximum length we accept a date string for the 'expire' keyword. The standard date formats are within the 30 bytes range. This adds an extra margin just to make sure it realistically works with what is used out @@ -471,10 +377,13 @@ static bool invalid_octets(const char *ptr) */ #define MAX_DATE_LENGTH 80 -static int +/* 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 @@ -486,9 +395,10 @@ parse_cookie_header(struct Curl_easy *data, /* This line was read off an HTTP-header */ time_t now; size_t linelength = strlen(ptr); + *okay = FALSE; if(linelength > MAX_COOKIE_LINE) /* discard overly long lines at once */ - return CERR_TOO_LONG; + return CURLE_OK; now = time(NULL); do { @@ -509,7 +419,7 @@ parse_cookie_header(struct Curl_easy *data, /* Reject cookies with a TAB inside the value */ if(memchr(curlx_str(&val), '\t', curlx_strlen(&val))) { infof(data, "cookie contains TAB, dropping"); - return CERR_TAB; + return CURLE_OK; } } } @@ -527,7 +437,7 @@ parse_cookie_header(struct Curl_easy *data, ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) { infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", curlx_strlen(&name), curlx_strlen(&val)); - return CERR_TOO_BIG; + return CURLE_OK; } /* @@ -551,17 +461,17 @@ parse_cookie_header(struct Curl_easy *data, /* The very first name/value pair is the actual cookie name */ if(!sep) /* Bad name/value pair. */ - return CERR_NO_SEP; + return CURLE_OK; strstore(&co->name, curlx_str(&name), curlx_strlen(&name)); strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); done = TRUE; if(!co->name || !co->value) - return CERR_NO_NAME_VALUE; + return CURLE_OK; if(invalid_octets(co->value) || invalid_octets(co->name)) { infof(data, "invalid octets in name/value, cookie dropped"); - return CERR_INVALID_OCTET; + return CURLE_OK; } } else if(!curlx_strlen(&val)) { @@ -576,11 +486,11 @@ parse_cookie_header(struct Curl_easy *data, * reading from file */ if(curlx_str_casecompare(&name, "secure")) { - if(secure || !ci->running) { + if(secure || !ci->running) co->secure = TRUE; - } else { - return CERR_BAD_SECURE; + infof(data, "skipped cookie %s because not 'secure'", co->name); + return CURLE_OK; } } else if(curlx_str_casecompare(&name, "httponly")) @@ -594,11 +504,11 @@ parse_cookie_header(struct Curl_easy *data, else if(curlx_str_casecompare(&name, "path")) { strstore(&co->path, curlx_str(&val), curlx_strlen(&val)); if(!co->path) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; free(co->spath); /* if this is set again */ co->spath = sanitize_cookie_path(co->path); if(!co->spath) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; } else if(curlx_str_casecompare(&name, "domain") && curlx_strlen(&val)) { bool is_ip; @@ -631,7 +541,7 @@ parse_cookie_header(struct Curl_easy *data, curlx_strlen(&val), domain))) { strstore(&co->domain, curlx_str(&val), curlx_strlen(&val)); if(!co->domain) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; if(!is_ip) co->tailmatch = TRUE; /* we always do that if the domain name was @@ -644,7 +554,7 @@ parse_cookie_header(struct Curl_easy *data, */ infof(data, "skipped cookie with bad tailmatch domain: %s", curlx_str(&val)); - return CERR_NO_TAILMATCH; + return CURLE_OK; } } else if(curlx_str_casecompare(&name, "version")) { @@ -722,7 +632,7 @@ parse_cookie_header(struct Curl_easy *data, /* no domain was given in the header line, set the default */ co->domain = strdup(domain); if(!co->domain) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; } if(!co->path && path) { @@ -736,10 +646,10 @@ parse_cookie_header(struct Curl_easy *data, if(co->path) { co->spath = sanitize_cookie_path(co->path); if(!co->spath) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; } else - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; } } @@ -748,14 +658,16 @@ parse_cookie_header(struct Curl_easy *data, * line so bail out. */ if(!co->name) - return CERR_BAD; + return CURLE_OK; - return CERR_OK; + *okay = TRUE; + return CURLE_OK; } -static int +static CURLcode parse_netscape(struct Cookie *co, struct CookieInfo *ci, + bool *okay, const char *lineptr, bool secure) /* TRUE if connection is over secure origin */ @@ -767,6 +679,7 @@ parse_netscape(struct Cookie *co, const char *ptr, *next; int fields; size_t len; + *okay = FALSE; /* * In 2008, Internet Explorer introduced HTTP-only cookies to prevent XSS @@ -781,7 +694,7 @@ parse_netscape(struct Cookie *co, if(lineptr[0]=='#') /* do not even try the comments */ - return CERR_COMMENT; + return CURLE_OK; /* * Now loop through the fields and init the struct we already have @@ -800,7 +713,7 @@ parse_netscape(struct Cookie *co, } co->domain = Curl_memdup0(ptr, len); if(!co->domain) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; break; case 1: /* @@ -816,21 +729,21 @@ parse_netscape(struct Cookie *co, /* only if the path does not look like a boolean option! */ co->path = Curl_memdup0(ptr, len); if(!co->path) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; else { co->spath = sanitize_cookie_path(co->path); if(!co->spath) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; } break; } /* this does not look like a path, make one up! */ co->path = strdup("/"); if(!co->path) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; co->spath = strdup("/"); if(!co->spath) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; fields++; /* add a field and fall down to secure */ FALLTHROUGH(); case 3: @@ -839,17 +752,17 @@ parse_netscape(struct Cookie *co, if(secure || ci->running) co->secure = TRUE; else - return CERR_BAD_SECURE; + return CURLE_OK; } break; case 4: if(curlx_str_number(&ptr, &co->expires, CURL_OFF_T_MAX)) - return CERR_RANGE; + return CURLE_OK; break; case 5: co->name = Curl_memdup0(ptr, len); if(!co->name) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; else { /* For Netscape file format cookies we check prefix on the name */ if(curl_strnequal("__Secure-", co->name, 9)) @@ -861,7 +774,7 @@ parse_netscape(struct Cookie *co, case 6: co->value = Curl_memdup0(ptr, len); if(!co->value) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; break; } } @@ -869,19 +782,20 @@ parse_netscape(struct Cookie *co, /* we got a cookie with blank contents, fix it */ co->value = strdup(""); if(!co->value) - return CERR_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; else fields++; } if(fields != 7) /* we did not find the sufficient number of fields */ - return CERR_FIELDS; + return CURLE_OK; - return CERR_OK; + *okay = TRUE; + return CURLE_OK; } -static int +static bool is_public_suffix(struct Curl_easy *data, struct Cookie *co, const char *domain) @@ -916,7 +830,7 @@ is_public_suffix(struct Curl_easy *data, if(!acceptable) { infof(data, "cookie '%s' dropped, domain '%s' must not " "set cookies for '%s'", co->name, domain, co->domain); - return CERR_PSL; + return TRUE; } } #else @@ -926,15 +840,15 @@ is_public_suffix(struct Curl_easy *data, DEBUGF(infof(data, "NO PSL to check set-cookie '%s' for domain=%s in %s", co->name, co->domain, domain)); #endif - return CERR_OK; + return FALSE; } -static int -replace_existing(struct Curl_easy *data, - struct Cookie *co, - struct CookieInfo *ci, - bool secure, - bool *replacep) +/* returns TRUE when replaced */ +static bool replace_existing(struct Curl_easy *data, + struct Cookie *co, + struct CookieInfo *ci, + bool secure, + bool *replacep) { bool replace_old = FALSE; struct Curl_llist_node *replace_n = NULL; @@ -978,7 +892,7 @@ replace_existing(struct Curl_easy *data, if(curl_strnequal(clist->spath, co->spath, cllen)) { infof(data, "cookie '%s' for domain '%s' dropped, would " "overlay an existing cookie", co->name, co->domain); - return CERR_BAD_SECURE; + return FALSE; } } } @@ -1012,7 +926,7 @@ replace_existing(struct Curl_easy *data, * was read from a file and thus is not "live". "live" cookies are * preferred so the new cookie is freed. */ - return CERR_LIVE_WINS; + return FALSE; } if(replace_old) replace_n = n; @@ -1031,7 +945,7 @@ replace_existing(struct Curl_easy *data, freecookie(repl); } *replacep = replace_old; - return CERR_OK; + return TRUE; } /* @@ -1041,10 +955,8 @@ replace_existing(struct Curl_easy *data, * sometimes we get an IP-only hostname, and that might also be a numerical * IPv6 address. * - * Returns NULL on out of memory or invalid cookie. This is suboptimal, - * as they should be treated separately. */ -struct Cookie * +CURLcode Curl_cookie_add(struct Curl_easy *data, struct CookieInfo *ci, bool httpheader, /* TRUE if HTTP header-style line */ @@ -1058,25 +970,27 @@ Curl_cookie_add(struct Curl_easy *data, { struct Cookie *co; size_t myhash; - int rc; + CURLcode result; bool replaces = FALSE; + bool okay; DEBUGASSERT(data); DEBUGASSERT(MAX_SET_COOKIE_AMOUNT <= 255); /* counter is an unsigned char */ if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT) - return NULL; + return CURLE_OK; /* silently ignore */ /* First, alloc and init a new struct for it */ co = calloc(1, sizeof(struct Cookie)); if(!co) - return NULL; /* bail out if we are this low on memory */ + return CURLE_OUT_OF_MEMORY; /* bail out if we are this low on memory */ if(httpheader) - rc = parse_cookie_header(data, co, ci, lineptr, domain, path, secure); + result = parse_cookie_header(data, co, ci, &okay, + lineptr, domain, path, secure); else - rc = parse_netscape(co, ci, lineptr, secure); + result = parse_netscape(co, ci, &okay, lineptr, secure); - if(rc) + if(result || !okay) goto fail; if(co->prefix_secure && !co->secure) @@ -1115,7 +1029,7 @@ Curl_cookie_add(struct Curl_easy *data, if(is_public_suffix(data, co, domain)) goto fail; - if(replace_existing(data, co, ci, secure, &replaces)) + if(!replace_existing(data, co, ci, secure, &replaces)) goto fail; /* add this cookie to the list */ @@ -1142,10 +1056,10 @@ Curl_cookie_add(struct Curl_easy *data, if(httpheader) data->req.setcookies++; - return co; + return result; fail: freecookie(co); - return NULL; + return result; } @@ -1161,91 +1075,130 @@ Curl_cookie_add(struct Curl_easy *data, * Note that 'data' might be called as NULL pointer. If data is NULL, 'file' * will be ignored. * - * Returns NULL on out of memory. Invalid cookies are ignored. + * Returns NULL on out of memory. */ -struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, - const char *file, - struct CookieInfo *ci, - bool newsession) +struct CookieInfo *Curl_cookie_init(void) { - FILE *handle = NULL; + int i; + struct CookieInfo *ci = calloc(1, sizeof(struct CookieInfo)); + if(!ci) + return NULL; + + /* This does not use the destructor callback since we want to add + and remove to lists while keeping the cookie struct intact */ + for(i = 0; i < COOKIE_HASH_SIZE; i++) + Curl_llist_init(&ci->cookielist[i], NULL); + /* + * Initialize the next_expiration time to signal that we do not have enough + * information yet. + */ + ci->next_expiration = CURL_OFF_T_MAX; - if(!ci) { - int i; + return ci; +} - /* we did not get a struct, create one */ - ci = calloc(1, sizeof(struct CookieInfo)); - if(!ci) - return NULL; /* failed to get memory */ +/* + * cookie_load() + * + * Reads cookies from a local file. This is always called before any cookies + * are set. If file is "-" then STDIN is read. + * + * If 'newsession' is TRUE, discard all "session cookies" on read from file. + * + */ +static CURLcode cookie_load(struct Curl_easy *data, const char *file, + struct CookieInfo *ci, bool newsession) +{ + FILE *handle = NULL; + CURLcode result = CURLE_OK; + FILE *fp = NULL; + DEBUGASSERT(ci); + DEBUGASSERT(data); + DEBUGASSERT(file); - /* This does not use the destructor callback since we want to add - and remove to lists while keeping the cookie struct intact */ - for(i = 0; i < COOKIE_HASH_SIZE; i++) - Curl_llist_init(&ci->cookielist[i], NULL); - /* - * Initialize the next_expiration time to signal that we do not have enough - * information yet. - */ - ci->next_expiration = CURL_OFF_T_MAX; - } ci->newsession = newsession; /* new session? */ - - if(data) { - FILE *fp = NULL; - if(file && *file) { - if(!strcmp(file, "-")) - fp = stdin; - else { - fp = curlx_fopen(file, "rb"); - if(!fp) - infof(data, "WARNING: failed to open cookie file \"%s\"", file); - else - handle = fp; - } + ci->running = FALSE; /* this is not running, this is init */ + + if(file && *file) { + if(!strcmp(file, "-")) + fp = stdin; + else { + fp = curlx_fopen(file, "rb"); + if(!fp) + infof(data, "WARNING: failed to open cookie file \"%s\"", file); + else + handle = fp; } + } - ci->running = FALSE; /* this is not running, this is init */ - if(fp) { - struct dynbuf buf; - bool eof = FALSE; - CURLcode result; - curlx_dyn_init(&buf, MAX_COOKIE_LINE); - do { - result = Curl_get_line(&buf, fp, &eof); - if(!result) { - const char *lineptr = curlx_dyn_ptr(&buf); - bool headerline = FALSE; - if(checkprefix("Set-Cookie:", lineptr)) { - /* This is a cookie line, get it! */ - lineptr += 11; - headerline = TRUE; - curlx_str_passblanks(&lineptr); - } - - (void)Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL, - NULL, TRUE); - /* File reading cookie failures are not propagated back to the - caller because there is no way to do that */ + if(fp) { + struct dynbuf buf; + bool eof = FALSE; + curlx_dyn_init(&buf, MAX_COOKIE_LINE); + do { + result = Curl_get_line(&buf, fp, &eof); + if(!result) { + const char *lineptr = curlx_dyn_ptr(&buf); + bool headerline = FALSE; + if(checkprefix("Set-Cookie:", lineptr)) { + /* This is a cookie line, get it! */ + lineptr += 11; + headerline = TRUE; + curlx_str_passblanks(&lineptr); } - } while(!result && !eof); - curlx_dyn_free(&buf); /* free the line buffer */ - /* - * Remove expired cookies from the hash. We must make sure to run this - * after reading the file, and not on every cookie. - */ - remove_expired(ci); + result = Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL, + NULL, TRUE); + /* File reading cookie failures are not propagated back to the + caller because there is no way to do that */ + } + } while(!result && !eof); + curlx_dyn_free(&buf); /* free the line buffer */ - if(handle) - curlx_fclose(handle); - } - data->state.cookie_engine = TRUE; + /* + * Remove expired cookies from the hash. We must make sure to run this + * after reading the file, and not on every cookie. + */ + remove_expired(ci); + + if(handle) + curlx_fclose(handle); } + data->state.cookie_engine = TRUE; ci->running = TRUE; /* now, we are running */ - return ci; + return result; } +/* + * Load cookies from all given cookie files (CURLOPT_COOKIEFILE). + */ +CURLcode Curl_cookie_loadfiles(struct Curl_easy *data) +{ + CURLcode result = CURLE_OK; + struct curl_slist *list = data->state.cookielist; + if(list) { + Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); + if(!data->cookies) + data->cookies = Curl_cookie_init(); + if(!data->cookies) + result = CURLE_OUT_OF_MEMORY; + else { + data->state.cookie_engine = TRUE; + while(list) { + result = cookie_load(data, list->data, data->cookies, + data->set.cookiesession); + if(result) + break; + list = list->next; + } + } + Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); + } + return result; +} + + /* * cookie_sort * @@ -1315,12 +1268,13 @@ bool Curl_secure_context(struct connectdata *conn, const char *host) * * It shall only return cookies that have not expired. * - * Returns 0 when there is a list returned. Otherwise non-zero. + * 'okay' is TRUE when there is a list returned. */ -int Curl_cookie_getlist(struct Curl_easy *data, - struct connectdata *conn, - const char *host, - struct Curl_llist *list) +CURLcode Curl_cookie_getlist(struct Curl_easy *data, + struct connectdata *conn, + bool *okay, + const char *host, + struct Curl_llist *list) { size_t matches = 0; const bool is_ip = Curl_host_is_ipnum(host); @@ -1329,11 +1283,13 @@ int Curl_cookie_getlist(struct Curl_easy *data, const bool secure = Curl_secure_context(conn, host); struct CookieInfo *ci = data->cookies; const char *path = data->state.up.path; + CURLcode result = CURLE_OK; + *okay = FALSE; Curl_llist_init(list, NULL); if(!ci || !Curl_llist_count(&ci->cookielist[myhash])) - return 1; /* no cookie struct or no cookies in the struct */ + return CURLE_OK; /* no cookie struct or no cookies in the struct */ /* at first, remove expired cookies */ remove_expired(ci); @@ -1387,8 +1343,10 @@ int Curl_cookie_getlist(struct Curl_easy *data, /* alloc an array and store all cookie pointers */ array = malloc(sizeof(struct Cookie *) * matches); - if(!array) + if(!array) { + result = CURLE_OUT_OF_MEMORY; goto fail; + } n = Curl_llist_head(list); @@ -1407,12 +1365,13 @@ int Curl_cookie_getlist(struct Curl_easy *data, free(array); /* remove the temporary data again */ } - return 0; /* success */ + *okay = TRUE; + return CURLE_OK; /* success */ fail: /* failure, clear up the allocated chain and return NULL */ Curl_llist_destroy(list, NULL); - return 2; /* error */ + return result; /* error */ } /* @@ -1667,8 +1626,6 @@ struct curl_slist *Curl_cookie_list(struct Curl_easy *data) void Curl_flush_cookies(struct Curl_easy *data, bool cleanup) { - CURLcode res; - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); /* only save the cookie file if a transfer was started (data->state.url is set), as otherwise the cookies were not completely initialized and there @@ -1676,10 +1633,11 @@ void Curl_flush_cookies(struct Curl_easy *data, bool cleanup) thing. */ if(data->set.str[STRING_COOKIEJAR] && data->state.url) { /* if we have a destination file for all the cookies to get dumped to */ - res = cookie_output(data, data->cookies, data->set.str[STRING_COOKIEJAR]); - if(res) + CURLcode result = cookie_output(data, data->cookies, + data->set.str[STRING_COOKIEJAR]); + if(result) infof(data, "WARNING: failed to save cookies in %s: %s", - data->set.str[STRING_COOKIEJAR], curl_easy_strerror(res)); + data->set.str[STRING_COOKIEJAR], curl_easy_strerror(result)); } if(cleanup && (!data->share || (data->cookies != data->share->cookies))) { @@ -1689,4 +1647,12 @@ void Curl_flush_cookies(struct Curl_easy *data, bool cleanup) Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); } +void Curl_cookie_run(struct Curl_easy *data) +{ + Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); + if(data->cookies) + data->cookies->running = TRUE; + Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); +} + #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */ diff --git a/lib/cookie.h b/lib/cookie.h index 99aa20af7c4b..e1be698cf49a 100644 --- a/lib/cookie.h +++ b/lib/cookie.h @@ -113,30 +113,31 @@ struct connectdata; */ bool Curl_secure_context(struct connectdata *conn, const char *host); -struct Cookie *Curl_cookie_add(struct Curl_easy *data, - struct CookieInfo *c, bool header, - bool noexpiry, const char *lineptr, - const char *domain, const char *path, - bool secure); -int Curl_cookie_getlist(struct Curl_easy *data, struct connectdata *conn, - const char *host, struct Curl_llist *list); +CURLcode Curl_cookie_add(struct Curl_easy *data, + struct CookieInfo *c, bool header, + bool noexpiry, const char *lineptr, + const char *domain, const char *path, + bool secure) WARN_UNUSED_RESULT; +CURLcode Curl_cookie_getlist(struct Curl_easy *data, struct connectdata *conn, + bool *okay, const char *host, + struct Curl_llist *list) WARN_UNUSED_RESULT; void Curl_cookie_clearall(struct CookieInfo *cookies); void Curl_cookie_clearsess(struct CookieInfo *cookies); #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES) #define Curl_cookie_list(x) NULL -#define Curl_cookie_loadfiles(x) Curl_nop_stmt -#define Curl_cookie_init(x,y,z,w) 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_flush_cookies(x,y) Curl_nop_stmt #else void Curl_flush_cookies(struct Curl_easy *data, bool cleanup); void Curl_cookie_cleanup(struct CookieInfo *c); -struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, - const char *file, struct CookieInfo *inc, - bool newsession); +struct CookieInfo *Curl_cookie_init(void); struct curl_slist *Curl_cookie_list(struct Curl_easy *data); -void Curl_cookie_loadfiles(struct Curl_easy *data); +CURLcode Curl_cookie_loadfiles(struct Curl_easy *data) WARN_UNUSED_RESULT; +void Curl_cookie_run(struct Curl_easy *data); #endif #endif /* HEADER_CURL_COOKIE_H */ diff --git a/lib/easy.c b/lib/easy.c index 4236a01d8744..919ed80e8b1a 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -1010,10 +1010,10 @@ CURL *curl_easy_duphandle(CURL *d) if(data->cookies && data->state.cookie_engine) { /* If cookies are enabled in the parent handle, we enable them in the clone as well! */ - outcurl->cookies = Curl_cookie_init(outcurl, NULL, outcurl->cookies, - data->set.cookiesession); + outcurl->cookies = Curl_cookie_init(); if(!outcurl->cookies) goto fail; + outcurl->state.cookie_engine = TRUE; } if(data->state.cookielist) { diff --git a/lib/http.c b/lib/http.c index 08739ffddbfb..6726d23a4399 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2463,10 +2463,12 @@ static CURLcode http_cookies(struct Curl_easy *data, int count = 0; if(data->cookies && data->state.cookie_engine) { + bool okay; const char *host = data->state.aptr.cookiehost ? data->state.aptr.cookiehost : data->conn->host.name; Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - if(!Curl_cookie_getlist(data, data->conn, host, &list)) { + result = Curl_cookie_getlist(data, data->conn, &okay, host, &list); + if(!result && okay) { struct Curl_llist_node *n; size_t clen = 8; /* hold the size of the generated Cookie: header */ @@ -3471,11 +3473,12 @@ static CURLcode http_header_s(struct Curl_easy *data, const char *host = data->state.aptr.cookiehost ? data->state.aptr.cookiehost : conn->host.name; const bool secure_context = Curl_secure_context(conn, host); + CURLcode result; Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - Curl_cookie_add(data, data->cookies, TRUE, FALSE, v, host, - data->state.up.path, secure_context); + result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, v, host, + data->state.up.path, secure_context); Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - return CURLE_OK; + return result; } #endif #ifndef CURL_DISABLE_HSTS diff --git a/lib/setopt.c b/lib/setopt.c index 67b5371e87dd..9f43b1b60da0 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1537,6 +1537,7 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, static CURLcode cookielist(struct Curl_easy *data, const char *ptr) { + CURLcode result = CURLE_OK; if(!ptr) return CURLE_OK; @@ -1558,14 +1559,15 @@ static CURLcode cookielist(struct Curl_easy *data, } else if(curl_strequal(ptr, "RELOAD")) { /* reload cookies from file */ - Curl_cookie_loadfiles(data); + return Curl_cookie_loadfiles(data); } else { if(!data->cookies) { /* if cookie engine was not running, activate it */ - data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE); + data->cookies = Curl_cookie_init(); if(!data->cookies) return CURLE_OUT_OF_MEMORY; + data->state.cookie_engine = TRUE; } /* general protection against mistakes and abuse */ @@ -1575,15 +1577,15 @@ static CURLcode cookielist(struct Curl_easy *data, Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); if(checkprefix("Set-Cookie:", ptr)) /* HTTP Header format line */ - Curl_cookie_add(data, data->cookies, TRUE, FALSE, ptr + 11, NULL, - NULL, TRUE); + result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, ptr + 11, + NULL, NULL, TRUE); else /* Netscape format line */ - Curl_cookie_add(data, data->cookies, FALSE, FALSE, ptr, NULL, - NULL, TRUE); + result = Curl_cookie_add(data, data->cookies, FALSE, FALSE, ptr, NULL, + NULL, TRUE); Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); } - return CURLE_OK; + return result; } static CURLcode cookiefile(struct Curl_easy *data, @@ -1797,11 +1799,12 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Activate the cookie parser. This may or may not already * have been made. */ - struct CookieInfo *newcookies = - Curl_cookie_init(data, NULL, data->cookies, s->cookiesession); - if(!newcookies) + if(!data->cookies) + data->cookies = Curl_cookie_init(); + if(!data->cookies) result = CURLE_OUT_OF_MEMORY; - data->cookies = newcookies; + else + data->state.cookie_engine = TRUE; } break; diff --git a/lib/share.c b/lib/share.c index 711622a170a2..fdb80f5f64ab 100644 --- a/lib/share.c +++ b/lib/share.c @@ -97,7 +97,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) case CURL_LOCK_DATA_COOKIE: #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) if(!share->cookies) { - share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE); + share->cookies = Curl_cookie_init(); if(!share->cookies) res = CURLSHE_NOMEM; } diff --git a/lib/transfer.c b/lib/transfer.c index 98168d3aa662..2b77219a9cba 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -558,10 +558,12 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) data->state.infilesize = 0; /* If there is a list of cookie files to read, do it now! */ - Curl_cookie_loadfiles(data); + result = Curl_cookie_loadfiles(data); + if(!result) + Curl_cookie_run(data); /* activate */ /* If there is a list of host pairs to deal with */ - if(data->state.resolve) + if(!result && data->state.resolve) result = Curl_loadhostpairs(data); /* If there is a list of hsts files to read */ diff --git a/tests/data/test506 b/tests/data/test506 index 02165275b691..5b4d16d9bcd8 100644 --- a/tests/data/test506 +++ b/tests/data/test506 @@ -118,96 +118,102 @@ unlock: share [Pigs in space]: 17 PERFORM lock: cookie [Pigs in space]: 18 unlock: cookie [Pigs in space]: 19 -lock: dns [Pigs in space]: 20 -unlock: dns [Pigs in space]: 21 +lock: cookie [Pigs in space]: 20 +unlock: cookie [Pigs in space]: 21 lock: dns [Pigs in space]: 22 unlock: dns [Pigs in space]: 23 -lock: cookie [Pigs in space]: 24 -unlock: cookie [Pigs in space]: 25 +lock: dns [Pigs in space]: 24 +unlock: dns [Pigs in space]: 25 lock: cookie [Pigs in space]: 26 unlock: cookie [Pigs in space]: 27 lock: cookie [Pigs in space]: 28 unlock: cookie [Pigs in space]: 29 lock: cookie [Pigs in space]: 30 unlock: cookie [Pigs in space]: 31 +lock: cookie [Pigs in space]: 32 +unlock: cookie [Pigs in space]: 33 run 1: set cookie 1, 2 and 3 -lock: dns [Pigs in space]: 32 -unlock: dns [Pigs in space]: 33 lock: dns [Pigs in space]: 34 unlock: dns [Pigs in space]: 35 +lock: dns [Pigs in space]: 36 +unlock: dns [Pigs in space]: 37 CLEANUP -lock: cookie [Pigs in space]: 36 -unlock: cookie [Pigs in space]: 37 -lock: share [Pigs in space]: 38 -unlock: share [Pigs in space]: 39 -*** run 2 -CURLOPT_SHARE +lock: cookie [Pigs in space]: 38 +unlock: cookie [Pigs in space]: 39 lock: share [Pigs in space]: 40 unlock: share [Pigs in space]: 41 +*** run 2 +CURLOPT_SHARE +lock: share [Pigs in space]: 42 +unlock: share [Pigs in space]: 43 PERFORM -lock: cookie [Pigs in space]: 42 -unlock: cookie [Pigs in space]: 43 -lock: dns [Pigs in space]: 44 -unlock: dns [Pigs in space]: 45 +lock: cookie [Pigs in space]: 44 +unlock: cookie [Pigs in space]: 45 lock: cookie [Pigs in space]: 46 unlock: cookie [Pigs in space]: 47 -lock: cookie [Pigs in space]: 48 -unlock: cookie [Pigs in space]: 49 +lock: dns [Pigs in space]: 48 +unlock: dns [Pigs in space]: 49 lock: cookie [Pigs in space]: 50 unlock: cookie [Pigs in space]: 51 +lock: cookie [Pigs in space]: 52 +unlock: cookie [Pigs in space]: 53 +lock: cookie [Pigs in space]: 54 +unlock: cookie [Pigs in space]: 55 run 2: set cookie 4 and 5 -lock: dns [Pigs in space]: 52 -unlock: dns [Pigs in space]: 53 -lock: dns [Pigs in space]: 54 -unlock: dns [Pigs in space]: 55 +lock: dns [Pigs in space]: 56 +unlock: dns [Pigs in space]: 57 +lock: dns [Pigs in space]: 58 +unlock: dns [Pigs in space]: 59 CLEANUP -lock: cookie [Pigs in space]: 56 -unlock: cookie [Pigs in space]: 57 -lock: share [Pigs in space]: 58 -unlock: share [Pigs in space]: 59 +lock: cookie [Pigs in space]: 60 +unlock: cookie [Pigs in space]: 61 +lock: share [Pigs in space]: 62 +unlock: share [Pigs in space]: 63 *** run 3 CURLOPT_SHARE -lock: share [Pigs in space]: 60 -unlock: share [Pigs in space]: 61 +lock: share [Pigs in space]: 64 +unlock: share [Pigs in space]: 65 CURLOPT_COOKIEJAR CURLOPT_COOKIELIST FLUSH -lock: cookie [Pigs in space]: 62 -unlock: cookie [Pigs in space]: 63 -PERFORM -lock: dns [Pigs in space]: 64 -unlock: dns [Pigs in space]: 65 lock: cookie [Pigs in space]: 66 unlock: cookie [Pigs in space]: 67 +PERFORM lock: cookie [Pigs in space]: 68 unlock: cookie [Pigs in space]: 69 -lock: cookie [Pigs in space]: 70 -unlock: cookie [Pigs in space]: 71 +lock: dns [Pigs in space]: 70 +unlock: dns [Pigs in space]: 71 lock: cookie [Pigs in space]: 72 unlock: cookie [Pigs in space]: 73 lock: cookie [Pigs in space]: 74 unlock: cookie [Pigs in space]: 75 -run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch -lock: dns [Pigs in space]: 76 -unlock: dns [Pigs in space]: 77 -lock: dns [Pigs in space]: 78 -unlock: dns [Pigs in space]: 79 -CLEANUP +lock: cookie [Pigs in space]: 76 +unlock: cookie [Pigs in space]: 77 +lock: cookie [Pigs in space]: 78 +unlock: cookie [Pigs in space]: 79 lock: cookie [Pigs in space]: 80 unlock: cookie [Pigs in space]: 81 -lock: share [Pigs in space]: 82 -unlock: share [Pigs in space]: 83 -CURLOPT_SHARE -lock: share [Pigs in space]: 84 -unlock: share [Pigs in space]: 85 -CURLOPT_COOKIELIST ALL +run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch +lock: dns [Pigs in space]: 82 +unlock: dns [Pigs in space]: 83 +lock: dns [Pigs in space]: 84 +unlock: dns [Pigs in space]: 85 +CLEANUP lock: cookie [Pigs in space]: 86 unlock: cookie [Pigs in space]: 87 +lock: share [Pigs in space]: 88 +unlock: share [Pigs in space]: 89 +CURLOPT_SHARE +lock: share [Pigs in space]: 90 +unlock: share [Pigs in space]: 91 +CURLOPT_COOKIELIST ALL +lock: cookie [Pigs in space]: 92 +unlock: cookie [Pigs in space]: 93 CURLOPT_COOKIEJAR CURLOPT_COOKIELIST RELOAD -lock: cookie [Pigs in space]: 88 -unlock: cookie [Pigs in space]: 89 -lock: cookie [Pigs in space]: 90 -unlock: cookie [Pigs in space]: 91 +lock: cookie [Pigs in space]: 94 +unlock: cookie [Pigs in space]: 95 +lock: cookie [Pigs in space]: 96 +unlock: cookie [Pigs in space]: 97 loaded cookies: ----------------- www.host.foo.com FALSE / FALSE %days[400] test6 six_more @@ -220,17 +226,17 @@ loaded cookies: .host.foo.com TRUE / FALSE %days[400] injected yes ----------------- try SHARE_CLEANUP... -lock: share [Pigs in space]: 92 -unlock: share [Pigs in space]: 93 +lock: share [Pigs in space]: 98 +unlock: share [Pigs in space]: 99 SHARE_CLEANUP failed, correct CLEANUP -lock: cookie [Pigs in space]: 94 -unlock: cookie [Pigs in space]: 95 -lock: share [Pigs in space]: 96 -unlock: share [Pigs in space]: 97 +lock: cookie [Pigs in space]: 100 +unlock: cookie [Pigs in space]: 101 +lock: share [Pigs in space]: 102 +unlock: share [Pigs in space]: 103 SHARE_CLEANUP -lock: share [Pigs in space]: 98 -unlock: share [Pigs in space]: 99 +lock: share [Pigs in space]: 104 +unlock: share [Pigs in space]: 105 GLOBAL_CLEANUP From e496bcfd0ab63e29e23650d7733adf6e1356f173 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 23:20:58 +0100 Subject: [PATCH 358/885] FILEFORMAT.md: drop some text from the `command` section Special meanings of URLs became outdated, and it's also no longer necessary to pass the test number via the URL or domain anymore. Delete the text. Follow-up to c6f1b0ff49268817101ac1734f43074fcc8775b2 #19429 Closes #19503 --- docs/tests/FILEFORMAT.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 2e0648267ed1..df5eed8ac694 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -582,18 +582,6 @@ Command line to run. If the command spans multiple lines, they are concatenated with a space added between them. -Note that the URL that gets passed to the server actually controls what data -that is returned. The last slash in the URL must be followed by a number. That -number (N) is used by the test-server to load test case N and return the data -that is defined within the `` section. - -If there is no test number found above, the HTTP test server uses the number -following the last dot in the given hostname (made so that a CONNECT can still -pass on test number) so that "foo.bar.123" gets treated as test case -123. Alternatively, if an IPv6 address is provided to CONNECT, the last -hexadecimal group in the address is used as the test number. For example the -address "[1234::ff]" would be treated as test case 255. - Set `type="perl"` to write the test case as a perl script. It implies that there is no memory debugging and valgrind gets shut off for this test. From 4415e865ad7bcad6fdc256c354dc6065876381d2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 03:40:42 +0100 Subject: [PATCH 359/885] libtests: replace `atoi()` with `curlx_str_number()` Also: - lib1568: fail in global initialization error. Closes #19506 --- tests/libtest/Makefile.inc | 1 + tests/libtest/cli_hx_download.c | 23 ++++++++++++++++------- tests/libtest/cli_hx_upload.c | 20 ++++++++++++++------ tests/libtest/cli_ws_data.c | 11 ++++++++--- tests/libtest/first.c | 20 +++++++++++--------- tests/libtest/lib1568.c | 13 +++++++++---- tests/libtest/lib1960.c | 9 +++++---- tests/libtest/lib521.c | 12 ++++++++---- tests/libtest/lib562.c | 12 ++++++++---- tests/libtest/lib591.c | 6 +++++- 10 files changed, 85 insertions(+), 42 deletions(-) diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc index 67ffabad0b3d..8efeba914df8 100644 --- a/tests/libtest/Makefile.inc +++ b/tests/libtest/Makefile.inc @@ -38,6 +38,7 @@ CURLX_C = \ ../../lib/curlx/fopen.c \ ../../lib/curlx/multibyte.c \ ../../lib/curlx/strerr.c \ + ../../lib/curlx/strparse.c \ ../../lib/curlx/timediff.c \ ../../lib/curlx/timeval.c \ ../../lib/curlx/version_win32.c \ diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index b7ad5912a93b..365348455a00 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -302,6 +302,8 @@ static CURLcode test_cli_hx_download(const char *URL) while((ch = cgetopt(test_argc, test_argv, "aefhm:n:xA:F:M:P:r:T:V:")) != -1) { + const char *opt = coptarg; + curl_off_t num; switch(ch) { case 'h': usage_hx_download(NULL); @@ -317,32 +319,39 @@ static CURLcode test_cli_hx_download(const char *URL) forbid_reuse_d = 1; break; case 'm': - max_parallel = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + max_parallel = (size_t)num; break; case 'n': - transfer_count_d = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + transfer_count_d = (size_t)num; break; case 'x': fresh_connect = 1; break; case 'A': - abort_offset = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + abort_offset = (size_t)num; break; case 'F': - fail_offset = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + fail_offset = (size_t)num; break; case 'M': - max_host_conns = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + max_host_conns = (size_t)num; break; case 'P': - pause_offset = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + pause_offset = (size_t)num; break; case 'r': free(resolve); resolve = strdup(coptarg); break; case 'T': - max_total_conns = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + max_total_conns = (size_t)num; break; case 'V': { if(!strcmp("http/1.1", coptarg)) diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index 5069bcab636e..dc053ae755bd 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -252,6 +252,8 @@ static CURLcode test_cli_hx_upload(const char *URL) while((ch = cgetopt(test_argc, test_argv, "aefhlm:n:A:F:M:P:r:RS:V:")) != -1) { + const char *opt = coptarg; + curl_off_t num; switch(ch) { case 'h': usage_hx_upload(NULL); @@ -269,22 +271,27 @@ static CURLcode test_cli_hx_upload(const char *URL) announce_length = 1; break; case 'm': - max_parallel = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + max_parallel = (size_t)num; break; case 'n': - transfer_count_u = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + transfer_count_u = (size_t)num; break; case 'A': - abort_offset = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + abort_offset = (size_t)num; break; case 'F': - fail_offset = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + fail_offset = (size_t)num; break; case 'M': method = coptarg; break; case 'P': - pause_offset = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + pause_offset = (size_t)num; break; case 'r': resolve = coptarg; @@ -293,7 +300,8 @@ static CURLcode test_cli_hx_upload(const char *URL) reuse_easy = 1; break; case 'S': - send_total = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + send_total = (size_t)num; break; case 'V': { if(!strcmp("http/1.1", coptarg)) diff --git a/tests/libtest/cli_ws_data.c b/tests/libtest/cli_ws_data.c index 8b8b1fa0d1b8..7e5479b74312 100644 --- a/tests/libtest/cli_ws_data.c +++ b/tests/libtest/cli_ws_data.c @@ -419,6 +419,8 @@ static CURLcode test_cli_ws_data(const char *URL) (void)URL; while((ch = cgetopt(test_argc, test_argv, "12c:hm:M:")) != -1) { + const char *opt = coptarg; + curl_off_t num; switch(ch) { case '1': model = 1; @@ -430,13 +432,16 @@ static CURLcode test_cli_ws_data(const char *URL) test_ws_data_usage(NULL); return CURLE_BAD_FUNCTION_ARGUMENT; case 'c': - count = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + count = (size_t)num; break; case 'm': - plen_min = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + plen_min = (size_t)num; break; case 'M': - plen_max = (size_t)atol(coptarg); + if(!curlx_str_number(&opt, &num, LONG_MAX)) + plen_max = (size_t)num; break; default: test_ws_data_usage("invalid option"); diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 79baca331ea9..ad1f92997111 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -127,7 +127,7 @@ int cgetopt(int argc, const char * const argv[], const char *optstring) #ifdef CURLDEBUG static void memory_tracking_init(void) { - char *env; + const char *env; /* if CURL_MEMDEBUG is set, this starts memory tracking message logging */ env = getenv("CURL_MEMDEBUG"); if(env) { @@ -137,9 +137,9 @@ static void memory_tracking_init(void) /* if CURL_MEMLIMIT is set, this enables fail-on-alloc-number-N feature */ env = getenv("CURL_MEMLIMIT"); if(env) { - long num = atol(env); - if(num > 0) - curl_dbg_memlimit(num); + curl_off_t num; + if(!curlx_str_number(&env, &num, LONG_MAX) && num > 0) + curl_dbg_memlimit((long)num); } } #else @@ -215,7 +215,7 @@ int main(int argc, const char **argv) CURLcode result; entry_func_t entry_func; const char *entry_name; - char *env; + const char *env; size_t tmp; CURLX_SET_BINMODE(stdout); @@ -271,11 +271,13 @@ int main(int argc, const char **argv) if(argc > 5) libtest_arg4 = argv[5]; + testnum = 0; env = getenv("CURL_TESTNUM"); - if(env) - testnum = atoi(env); - else - testnum = 0; + if(env) { + curl_off_t num; + if(!curlx_str_number(&env, &num, INT_MAX) && num > 0) + testnum = (int)num; + } result = entry_func(URL); curl_mfprintf(stderr, "Test ended with result %d\n", result); diff --git a/tests/libtest/lib1568.c b/tests/libtest/lib1568.c index 9e73029d510a..a7c454edf754 100644 --- a/tests/libtest/lib1568.c +++ b/tests/libtest/lib1568.c @@ -27,9 +27,15 @@ static CURLcode test_lib1568(const char *URL) { - CURLcode ret; + CURLcode ret = TEST_ERR_MAJOR_BAD; CURL *curl; - curl_global_init(CURL_GLOBAL_ALL); + curl_off_t port; + + if(curlx_str_number(&libtest_arg2, &port, 0xffff)) + return ret; + + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) + return ret; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, URL); @@ -39,12 +45,11 @@ static CURLcode test_lib1568(const char *URL) curl_easy_setopt(curl, CURLOPT_USERAGENT, "lib1568"); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(curl, CURLOPT_PORT, atol(libtest_arg2)); + curl_easy_setopt(curl, CURLOPT_PORT, (long)port); ret = curl_easy_perform(curl); curl_easy_cleanup(curl); - curl = NULL; curl_global_cleanup(); return ret; diff --git a/tests/libtest/lib1960.c b/tests/libtest/lib1960.c index 1ee9277bef62..152b1053f133 100644 --- a/tests/libtest/lib1960.c +++ b/tests/libtest/lib1960.c @@ -79,16 +79,17 @@ static CURLcode test_lib1960(const char *URL) int status; curl_socket_t client_fd = CURL_SOCKET_BAD; struct sockaddr_in serv_addr; - unsigned short port; + curl_off_t port; if(!strcmp("check", URL)) return CURLE_OK; /* no output makes it not skipped */ - port = (unsigned short)atoi(libtest_arg3); + if(curlx_str_number(&libtest_arg3, &port, 0xffff)) + return res; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); - return TEST_ERR_MAJOR_BAD; + return res; } /* @@ -103,7 +104,7 @@ static CURLcode test_lib1960(const char *URL) } serv_addr.sin_family = AF_INET; - serv_addr.sin_port = htons(port); + serv_addr.sin_port = htons((unsigned short)port); if(my_inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) { curl_mfprintf(stderr, "inet_pton failed\n"); diff --git a/tests/libtest/lib521.c b/tests/libtest/lib521.c index c02c45a3c103..acfec703811f 100644 --- a/tests/libtest/lib521.c +++ b/tests/libtest/lib521.c @@ -27,23 +27,27 @@ static CURLcode test_lib521(const char *URL) { - CURLcode res; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl; + curl_off_t port; + + if(curlx_str_number(&libtest_arg2, &port, 0xffff)) + return res; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); - return TEST_ERR_MAJOR_BAD; + return res; } curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); - return TEST_ERR_MAJOR_BAD; + return res; } test_setopt(curl, CURLOPT_URL, URL); - test_setopt(curl, CURLOPT_PORT, atol(libtest_arg2)); + test_setopt(curl, CURLOPT_PORT, (long)port); test_setopt(curl, CURLOPT_USERPWD, "xxx:yyy"); test_setopt(curl, CURLOPT_VERBOSE, 1L); diff --git a/tests/libtest/lib562.c b/tests/libtest/lib562.c index 1c3bf8cff837..e9716e5768a4 100644 --- a/tests/libtest/lib562.c +++ b/tests/libtest/lib562.c @@ -35,12 +35,16 @@ static CURLcode test_lib562(const char *URL) { + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl; - CURLcode res = CURLE_OK; + curl_off_t port; + + if(curlx_str_number(&libtest_arg2, &port, 0xffff)) + return res; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); - return TEST_ERR_MAJOR_BAD; + return res; } /* get a curl handle */ @@ -48,14 +52,14 @@ static CURLcode test_lib562(const char *URL) if(!curl) { curl_mfprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); - return TEST_ERR_MAJOR_BAD; + return res; } /* enable verbose */ test_setopt(curl, CURLOPT_VERBOSE, 1L); /* set port number */ - test_setopt(curl, CURLOPT_PORT, atol(libtest_arg2)); + test_setopt(curl, CURLOPT_PORT, (long)port); /* specify target */ test_setopt(curl, CURLOPT_URL, URL); diff --git a/tests/libtest/lib591.c b/tests/libtest/lib591.c index 0b7a0b4e855e..c30bde5e8be4 100644 --- a/tests/libtest/lib591.c +++ b/tests/libtest/lib591.c @@ -36,6 +36,10 @@ static CURLcode test_lib591(const char *URL) int msgs_left; CURLMsg *msg; FILE *upload = NULL; + curl_off_t accept_timeout; + + if(curlx_str_number(&libtest_arg2, &accept_timeout, 65535)) + return TEST_ERR_MAJOR_BAD; start_test_timing(); @@ -72,7 +76,7 @@ static CURLcode test_lib591(const char *URL) easy_setopt(curl, CURLOPT_FTPPORT, "-"); /* server connection timeout */ - easy_setopt(curl, CURLOPT_ACCEPTTIMEOUT_MS, atol(libtest_arg2)*1000); + easy_setopt(curl, CURLOPT_ACCEPTTIMEOUT_MS, (long)(accept_timeout * 1000)); multi_init(multi); From e18ad59e46380e0bef7a06e2997372afc80e4d77 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 04:44:15 +0100 Subject: [PATCH 360/885] runtests: add missing Perl semicolon Follow-up to f477f3efc3ec58f7effc2aa01e7f4565b12be976 #19398 Closes #19507 --- tests/getpart.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/getpart.pm b/tests/getpart.pm index 2b6d2a63c4bd..75eb8dfe5d57 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -229,7 +229,7 @@ sub loadtest { if(open(my $xmlh, "<", "$file")) { if($original) { - binmode $xmlh, ':crlf' + binmode $xmlh, ':crlf'; } else { binmode $xmlh; # for crapage systems, use binary From 85cfc15601b19f13f1d480e6f7ba8922850429c3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 11:46:13 +0100 Subject: [PATCH 361/885] RELEASE-NOTES: codespell --- RELEASE-NOTES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a997e6839430..64d498806032 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -78,7 +78,7 @@ This release includes the following bugfixes: o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] o tool_operate: remove redundant condition [19] - o tool_operate: use curlx_str_number intead of atoi [68] + o tool_operate: use curlx_str_number instead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] o urlapi: fix mem-leaks in curl_url_get error paths [22] o verify-release: update to avoid shellcheck warning SC2034 [88] From ca27404d2737e64bdc803fc7456e9a72bf61bb01 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 02:11:48 +0100 Subject: [PATCH 362/885] tests/data: add `%includetext`, dedupe XML payloads into external file To reduce duplication and to avoid keeping XML-like markup within XML markup (`test*`), that was tripping `xmllint`. Ref: #19470 Closes #19504 --- REUSE.toml | 1 + docs/tests/FILEFORMAT.md | 5 ++ tests/data/Makefile.am | 2 +- tests/data/data-xml1 | 112 ++++++++++++++++++++++++++++++++++++++ tests/data/test1123 | 113 +-------------------------------------- tests/data/test1277 | 113 +-------------------------------------- tests/data/test222 | 113 +-------------------------------------- tests/data/test230 | 113 +-------------------------------------- tests/data/test232 | 113 +-------------------------------------- tests/data/test314 | 113 +-------------------------------------- tests/data/test396 | 113 +-------------------------------------- tests/testutil.pm | 10 +++- 12 files changed, 134 insertions(+), 787 deletions(-) create mode 100644 tests/data/data-xml1 diff --git a/REUSE.toml b/REUSE.toml index fff538016477..e9e9ecf03d32 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -35,6 +35,7 @@ path = [ "RELEASE-NOTES", "renovate.json", "tests/certs/**", + "tests/data/data**", "tests/data/test**", "tests/valgrind.supp", ] diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index df5eed8ac694..3897deb9cb09 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -106,6 +106,11 @@ the include instruction: %include filename% +Or, a variant of the above where the file is loaded as a newline-agnostic +text file, and `%CR`, `%SP`, `%TAB` macros are expanded after inclusion: + + %includetext filename% + ## Conditional lines Lines in the test file can be made to appear conditionally on a specific diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index c9e3f75ba16a..d417a70a4045 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -283,4 +283,4 @@ test3200 test3201 test3202 test3203 test3204 test3205 test3206 test3207 test3208 test3209 test3210 test3211 test3212 test3213 test3214 test3215 \ test4000 test4001 -EXTRA_DIST = $(TESTCASES) DISABLED +EXTRA_DIST = $(TESTCASES) DISABLED data-xml1 diff --git a/tests/data/data-xml1 b/tests/data/data-xml1 new file mode 100644 index 000000000000..76d8a4afd4fa --- /dev/null +++ b/tests/data/data-xml1 @@ -0,0 +1,112 @@ + + + + + 1612 + 1998-08-21 04:01:29 + 2004-10-18 02:22:23 + curl + curl and libcurl + Command line tool and library for client-side URL transfers. + curl and libcurl is a tool for transferring files%CR +using URL syntax. It supports HTTP, HTTPS, FTP,%CR +FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR +well as HTTP-post, HTTP-put, cookies, FTP upload,%CR +resumed transfers, passwords, portnumbers, SSL%CR +certificates, Kerberos, and proxies. It is powered%CR +by libcurl, the client-side URL transfer library.%CR +There are bindings to libcurl for over 20%CR +languages and environments.%CR + + 5784.57 + 3.16 + 169 + 6594.54 + 13.81 + 105 + 8.50 + 21 + 183 + 323 + Default + http://freshmeat.net/projects/curl/ + http://freshmeat.net/redir/curl/1612/url_homepage/ + http://freshmeat.net/redir/curl/1612/url_tgz/ + http://freshmeat.net/redir/curl/1612/url_bz2/ + http://freshmeat.net/redir/curl/1612/url_zip/ + http://freshmeat.net/redir/curl/1612/url_changelog/ + http://freshmeat.net/redir/curl/1612/url_rpm/ + http://freshmeat.net/redir/curl/1612/url_deb/ + http://freshmeat.net/redir/curl/1612/url_osx/ + http://freshmeat.net/redir/curl/1612/url_bsdport/ + + http://freshmeat.net/redir/curl/1612/url_cvs/ + http://freshmeat.net/redir/curl/1612/url_list/ + http://freshmeat.net/redir/curl/1612/url_mirror/ + + MIT/X Consortium License + + 7.12.2 + 176085 + 2004-10-18 02:22:23 + + + + + Daniel Stenberg + http://freshmeat.net/~bagder/ + Owner + + + + 12 + 226 + 3 + 2 + 188 + 216 + 200 + 220 + 164 + 90 + 89 + 809 + 150 + 224 + 900 + 839 + + + + 0 + 7464 + 7464 + OpenSSL (Default) + + + 0 + 0 + 7443 + OpenLDAP + + + 0 + 0 + 12351 + zlib + + + 0 + 0 + 32047 + Heimdal + + + 0 + 0 + 44532 + c-ares + + + + diff --git a/tests/data/test1123 b/tests/data/test1123 index d0fc9fb0665b..80ec7b4cb313 100644 --- a/tests/data/test1123 +++ b/tests/data/test1123 @@ -35,118 +35,7 @@ Vary: Accept-Encoding%CR Content-Type: text/html; charset=ISO-8859-1%CR Transfer-Encoding: deflate, chunked%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/data/test1277 b/tests/data/test1277 index b229a0e1c252..56275d2bc589 100644 --- a/tests/data/test1277 +++ b/tests/data/test1277 @@ -39,118 +39,7 @@ Content-Type: text/html; charset=ISO-8859-1%CR Transfer-Encoding: gzip, chunked%CR Content-Encoding: deflate%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/data/test222 b/tests/data/test222 index e1b3bceb3ad3..0f09d9caaa8e 100644 --- a/tests/data/test222 +++ b/tests/data/test222 @@ -33,118 +33,7 @@ Content-Type: text/html; charset=ISO-8859-1%CR Content-Encoding: deflate%CR Content-Length: 1305%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/data/test230 b/tests/data/test230 index 45f0a7f884c7..9d7703ed192a 100644 --- a/tests/data/test230 +++ b/tests/data/test230 @@ -33,118 +33,7 @@ Content-Type: text/html; charset=ISO-8859-1%CR Content-Encoding: deflate, identity, gzip%CR Content-Length: 1328%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/data/test232 b/tests/data/test232 index 94cb1b9f99d9..9fe30dd005d6 100644 --- a/tests/data/test232 +++ b/tests/data/test232 @@ -33,118 +33,7 @@ Content-Type: text/html; charset=ISO-8859-1%CR Content-Encoding: deflate%CR Content-Length: 1287%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/data/test314 b/tests/data/test314 index 4f14957a432d..6074da33c338 100644 --- a/tests/data/test314 +++ b/tests/data/test314 @@ -35,118 +35,7 @@ Content-Type: text/html; charset=ISO-8859-1%CR Content-Encoding: br%CR Content-Length: 1056%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/data/test396 b/tests/data/test396 index 5dd3faed1352..bc29bad5f700 100644 --- a/tests/data/test396 +++ b/tests/data/test396 @@ -32,118 +32,7 @@ Content-Type: text/html; charset=ISO-8859-1%CR Content-Encoding: zstd%CR Content-Length: 1309%CR %CR - - - - - 1612 - 1998-08-21 04:01:29 - 2004-10-18 02:22:23 - curl - curl and libcurl - Command line tool and library for client-side URL transfers. - curl and libcurl is a tool for transferring files%CR -using URL syntax. It supports HTTP, HTTPS, FTP,%CR -FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as%CR -well as HTTP-post, HTTP-put, cookies, FTP upload,%CR -resumed transfers, passwords, portnumbers, SSL%CR -certificates, Kerberos, and proxies. It is powered%CR -by libcurl, the client-side URL transfer library.%CR -There are bindings to libcurl for over 20%CR -languages and environments.%CR - - 5784.57 - 3.16 - 169 - 6594.54 - 13.81 - 105 - 8.50 - 21 - 183 - 323 - Default - http://freshmeat.net/projects/curl/ - http://freshmeat.net/redir/curl/1612/url_homepage/ - http://freshmeat.net/redir/curl/1612/url_tgz/ - http://freshmeat.net/redir/curl/1612/url_bz2/ - http://freshmeat.net/redir/curl/1612/url_zip/ - http://freshmeat.net/redir/curl/1612/url_changelog/ - http://freshmeat.net/redir/curl/1612/url_rpm/ - http://freshmeat.net/redir/curl/1612/url_deb/ - http://freshmeat.net/redir/curl/1612/url_osx/ - http://freshmeat.net/redir/curl/1612/url_bsdport/ - - http://freshmeat.net/redir/curl/1612/url_cvs/ - http://freshmeat.net/redir/curl/1612/url_list/ - http://freshmeat.net/redir/curl/1612/url_mirror/ - - MIT/X Consortium License - - 7.12.2 - 176085 - 2004-10-18 02:22:23 - - - - - Daniel Stenberg - http://freshmeat.net/~bagder/ - Owner - - - - 12 - 226 - 3 - 2 - 188 - 216 - 200 - 220 - 164 - 90 - 89 - 809 - 150 - 224 - 900 - 839 - - - - 0 - 7464 - 7464 - OpenSSL (Default) - - - 0 - 0 - 7443 - OpenLDAP - - - 0 - 0 - 12351 - zlib - - - 0 - 0 - 32047 - Heimdal - - - 0 - 0 - 44532 - c-ares - - - - +%includetext %SRCDIR/data/data-xml1% diff --git a/tests/testutil.pm b/tests/testutil.pm index 126f83e021f2..35fe4bd633b3 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -100,8 +100,11 @@ sub clearlogs { ####################################################################### sub includefile { - my ($f) = @_; + my ($f, $text) = @_; open(F, "<$f"); + if($text) { + binmode F, ':crlf'; + } my @a = ; close(F); return join("", @a); @@ -147,12 +150,15 @@ sub subbase64 { $$thing =~ s/%%DAYS%%/%alternatives[$d,$d2]/; } + # include a file, expand space macros + $$thing =~ s/%includetext ([^%]*)%[\n\r]+/includefile($1, 1)/ge; + $$thing =~ s/%SP/ /g; # space $$thing =~ s/%TAB/\t/g; # horizontal tab $$thing =~ s/%CR/\r/g; # carriage return aka \r aka 0x0d # include a file - $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1)/ge; + $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1, 0)/ge; } my $prevupdate; # module scope so it remembers the last value From 78a610cb832e9cd6441edc1b9cf5acf57bef28f5 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 12 Nov 2025 12:15:42 +0100 Subject: [PATCH 363/885] lib: rename curlx_timediff to curlx_timeleft_ms Rename `Curl_timeleft()` to `Curl_timeleft_ms()` to make the units in the returned `timediff_t` clear. (We used to always have ms there, but with QUIC started to sometimes calc ns as well). Rename some assigned vars without `_ms` suffix for clarity as well. Closes #19486 --- lib/asyn-ares.c | 50 ++++++++++++++++++++--------------------- lib/asyn-thrdd.c | 6 ++--- lib/cf-h1-proxy.c | 4 +--- lib/cf-h2-proxy.c | 4 +--- lib/cf-https-connect.c | 11 ++++----- lib/cf-ip-happy.c | 16 ++++++------- lib/cf-socket.c | 16 ++++++------- lib/cfilters.c | 2 +- lib/conncache.c | 6 ++--- lib/connect.c | 14 ++++++------ lib/connect.h | 6 ++--- lib/cshutdn.c | 8 +++---- lib/curlx/timeval.c | 5 +++-- lib/curlx/timeval.h | 5 +++-- lib/doh.c | 2 +- lib/easy.c | 8 +++---- lib/gopher.c | 2 +- lib/hostip.c | 6 ++--- lib/http.c | 2 +- lib/mqtt.c | 2 +- lib/multi.c | 18 +++++++-------- lib/pingpong.c | 6 ++--- lib/progress.c | 8 +++---- lib/rename.c | 2 +- lib/socketpair.c | 2 +- lib/socks.c | 2 +- lib/speedcheck.c | 2 +- lib/telnet.c | 4 ++-- lib/tftp.c | 6 ++--- lib/transfer.c | 6 ++--- lib/url.c | 10 ++++----- lib/vquic/curl_ngtcp2.c | 10 ++++----- lib/vquic/curl_osslq.c | 8 +++---- lib/vquic/curl_quiche.c | 6 ++--- lib/vssh/libssh.c | 10 ++++----- lib/vssh/libssh2.c | 10 ++++----- lib/vtls/gtls.c | 2 +- lib/vtls/openssl.c | 2 +- lib/vtls/schannel.c | 28 +++++++++++------------ lib/vtls/wolfssl.c | 2 +- lib/ws.c | 2 +- src/tool_cb_prg.c | 4 ++-- src/tool_cb_rea.c | 2 +- src/tool_operate.c | 6 ++--- src/tool_progress.c | 8 +++---- tests/data/test1303 | 4 ++-- tests/libtest/first.h | 2 +- tests/libtest/lib1501.c | 2 +- tests/libtest/lib1507.c | 2 +- tests/libtest/lib1564.c | 10 ++++----- tests/unit/unit1303.c | 2 +- tests/unit/unit1323.c | 2 +- tests/unit/unit2600.c | 10 ++++----- 53 files changed, 187 insertions(+), 188 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 96768feb1100..c729aebdafd6 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -317,7 +317,7 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, /* This is only set to non-zero if the timer was started. */ && (ares->happy_eyeballs_dns_time.tv_sec || ares->happy_eyeballs_dns_time.tv_usec) - && (curlx_timediff(curlx_now(), ares->happy_eyeballs_dns_time) + && (curlx_timediff_ms(curlx_now(), ares->happy_eyeballs_dns_time) >= HAPPY_EYEBALLS_DNS_TIMEOUT)) { /* Remember that the EXPIRE_HAPPY_EYEBALLS_DNS timer is no longer running. */ @@ -394,47 +394,47 @@ CURLcode Curl_async_await(struct Curl_easy *data, { struct async_ares_ctx *ares = &data->state.async.ares; CURLcode result = CURLE_OK; - timediff_t timeout; + timediff_t timeout_ms; struct curltime now = curlx_now(); DEBUGASSERT(entry); *entry = NULL; /* clear on entry */ - timeout = Curl_timeleft(data, &now, TRUE); - if(timeout < 0) { + timeout_ms = Curl_timeleft_ms(data, &now, TRUE); + if(timeout_ms < 0) { /* already expired! */ connclose(data->conn, "Timed out before name resolve started"); return CURLE_OPERATION_TIMEDOUT; } - if(!timeout) - timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */ + if(!timeout_ms) + timeout_ms = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve */ /* Wait for the name resolve query to complete. */ while(!result) { - struct timeval *tvp, tv, store; - int itimeout; - timediff_t timeout_ms; + struct timeval *real_timeout, time_buf, max_timeout; + int itimeout_ms; + timediff_t call_timeout_ms; #if TIMEDIFF_T_MAX > INT_MAX - itimeout = (timeout > INT_MAX) ? INT_MAX : (int)timeout; + itimeout_ms = (timeout_ms > INT_MAX) ? INT_MAX : (int)timeout_ms; #else - itimeout = (int)timeout; + itimeout_ms = (int)timeout_ms; #endif - store.tv_sec = itimeout/1000; - store.tv_usec = (itimeout%1000)*1000; + max_timeout.tv_sec = itimeout_ms/1000; + max_timeout.tv_usec = (itimeout_ms%1000)*1000; - tvp = ares_timeout(ares->channel, &store, &tv); + real_timeout = ares_timeout(ares->channel, &max_timeout, &time_buf); /* use the timeout period ares returned to us above if less than one second is left, otherwise just use 1000ms to make sure the progress callback gets called frequent enough */ - if(!tvp->tv_sec) - timeout_ms = (timediff_t)(tvp->tv_usec/1000); + if(!real_timeout->tv_sec) + call_timeout_ms = (timediff_t)(real_timeout->tv_usec/1000); else - timeout_ms = 1000; + call_timeout_ms = 1000; - if(Curl_ares_perform(ares->channel, timeout_ms) < 0) + if(Curl_ares_perform(ares->channel, call_timeout_ms) < 0) return CURLE_UNRECOVERABLE_POLL; result = Curl_async_is_resolved(data, entry); @@ -445,16 +445,16 @@ CURLcode Curl_async_await(struct Curl_easy *data, result = CURLE_ABORTED_BY_CALLBACK; else { struct curltime now2 = curlx_now(); - timediff_t timediff = curlx_timediff(now2, now); /* spent time */ - if(timediff <= 0) - timeout -= 1; /* always deduct at least 1 */ - else if(timediff > timeout) - timeout = -1; + timediff_t elapsed_ms = curlx_timediff_ms(now2, now); /* spent time */ + if(elapsed_ms <= 0) + timeout_ms -= 1; /* always deduct at least 1 */ + else if(elapsed_ms > timeout_ms) + timeout_ms = -1; else - timeout -= timediff; + timeout_ms -= elapsed_ms; now = now2; /* for next loop */ } - if(timeout < 0) + if(timeout_ms < 0) result = CURLE_OPERATION_TIMEDOUT; } diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index 2ee462989003..d1652d0ff425 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -660,8 +660,8 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, else { /* poll for name lookup done with exponential backoff up to 250ms */ /* should be fine even if this converts to 32-bit */ - timediff_t elapsed = curlx_timediff(curlx_now(), - data->progress.t_startsingle); + timediff_t elapsed = curlx_timediff_ms(curlx_now(), + data->progress.t_startsingle); if(elapsed < 0) elapsed = 0; @@ -711,7 +711,7 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) result = Curl_pollset_add_in(data, ps, thrdd->addr->sock_pair[0]); #else timediff_t milli; - timediff_t ms = curlx_timediff(curlx_now(), thrdd->addr->start); + timediff_t ms = curlx_timediff_ms(curlx_now(), thrdd->addr->start); if(ms < 3) milli = 0; else if(ms <= 50) diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index f46cc09616b6..be01891bf078 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -535,10 +535,8 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, return CURLE_RECV_ERROR; /* Need a cfilter close and new bootstrap */ do { - timediff_t check; - check = Curl_timeleft(data, NULL, TRUE); - if(check <= 0) { + if(Curl_timeleft_ms(data, NULL, TRUE) < 0) { failf(data, "Proxy CONNECT aborted due to timeout"); result = CURLE_OPERATION_TIMEDOUT; goto out; diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index 318fe54253fc..148caca71b1a 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -1073,7 +1073,6 @@ static CURLcode cf_h2_proxy_connect(struct Curl_cfilter *cf, struct cf_h2_proxy_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; struct cf_call_data save; - timediff_t check; struct tunnel_stream *ts = &ctx->tunnel; if(cf->connected) { @@ -1098,8 +1097,7 @@ static CURLcode cf_h2_proxy_connect(struct Curl_cfilter *cf, } DEBUGASSERT(ts->authority); - check = Curl_timeleft(data, NULL, TRUE); - if(check <= 0) { + if(Curl_timeleft_ms(data, NULL, TRUE) < 0) { failf(data, "Proxy CONNECT aborted due to timeout"); result = CURLE_OPERATION_TIMEDOUT; goto out; diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index 085b93da64af..dfd82bd9a117 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -215,12 +215,13 @@ static CURLcode baller_connected(struct Curl_cfilter *cf, reply_ms = cf_hc_baller_reply_ms(winner, data); if(reply_ms >= 0) CURL_TRC_CF(data, cf, "connect+handshake %s: %dms, 1st data: %dms", - winner->name, (int)curlx_timediff(curlx_now(), - winner->started), reply_ms); + winner->name, + (int)curlx_timediff_ms(curlx_now(), + winner->started), reply_ms); else CURL_TRC_CF(data, cf, "deferred handshake %s: %dms", - winner->name, (int)curlx_timediff(curlx_now(), - winner->started)); + winner->name, (int)curlx_timediff_ms(curlx_now(), + winner->started)); /* install the winning filter below this one. */ cf->next = winner->cf; @@ -269,7 +270,7 @@ static bool time_to_start_next(struct Curl_cfilter *cf, ctx->ballers[idx].name); return TRUE; } - elapsed_ms = curlx_timediff(now, ctx->started); + elapsed_ms = curlx_timediff_ms(now, ctx->started); if(elapsed_ms >= ctx->hard_eyeballs_timeout_ms) { CURL_TRC_CF(data, cf, "hard timeout of %" FMT_TIMEDIFF_T "ms reached, " "starting %s", diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 22ae260ce047..2e522322c384 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -413,8 +413,8 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, more_possible = cf_ai_iter_has_more(&bs->ipv6_iter); #endif do_more = more_possible && - (curlx_timediff(now, bs->last_attempt_started) >= - bs->attempt_delay_ms); + (curlx_timediff_ms(now, bs->last_attempt_started) >= + bs->attempt_delay_ms); if(do_more) CURL_TRC_CF(data, cf, "happy eyeballs timeout expired, " "start next attempt"); @@ -460,7 +460,7 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, else if(inconclusive) { /* tried all addresses, no success but some where inconclusive. * Let's restart the inconclusive ones. */ - timediff_t since_ms = curlx_timediff(now, bs->last_attempt_started); + timediff_t since_ms = curlx_timediff_ms(now, bs->last_attempt_started); timediff_t delay_ms = bs->attempt_delay_ms - since_ms; if(delay_ms <= 0) { CURL_TRC_CF(data, cf, "all attempts inconclusive, restarting one"); @@ -505,10 +505,10 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, bool more_possible; /* when do we need to be called again? */ - next_expire_ms = Curl_timeleft(data, &now, TRUE); + next_expire_ms = Curl_timeleft_ms(data, &now, TRUE); if(next_expire_ms <= 0) { failf(data, "Connection timeout after %" FMT_OFF_T " ms", - curlx_timediff(now, data->progress.t_startsingle)); + curlx_timediff_ms(now, data->progress.t_startsingle)); return CURLE_OPERATION_TIMEDOUT; } @@ -519,7 +519,7 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, #endif if(more_possible) { timediff_t expire_ms, elapsed_ms; - elapsed_ms = curlx_timediff(now, bs->last_attempt_started); + elapsed_ms = curlx_timediff_ms(now, bs->last_attempt_started); expire_ms = CURLMAX(bs->attempt_delay_ms - elapsed_ms, 0); next_expire_ms = CURLMIN(next_expire_ms, expire_ms); if(next_expire_ms <= 0) { @@ -682,7 +682,7 @@ static CURLcode is_connected(struct Curl_cfilter *cf, proxy_name ? "via " : "", proxy_name ? proxy_name : "", proxy_name ? " " : "", - curlx_timediff(curlx_now(), data->progress.t_startsingle), + curlx_timediff_ms(curlx_now(), data->progress.t_startsingle), curl_easy_strerror(result)); } @@ -707,7 +707,7 @@ static CURLcode start_connect(struct Curl_cfilter *cf, if(!dns) return CURLE_FAILED_INIT; - if(Curl_timeleft(data, NULL, TRUE) < 0) { + if(Curl_timeleft_ms(data, NULL, TRUE) < 0) { /* a precaution, no need to continue if time already is up */ failf(data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 667bf1e1be0d..d4244fc2ad6a 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1428,7 +1428,7 @@ static void win_update_sndbuf_size(struct cf_socket_ctx *ctx) DWORD ideallen; struct curltime n = curlx_now(); - if(curlx_timediff(n, ctx->last_sndbuf_query_at) > 1000) { + if(curlx_timediff_ms(n, ctx->last_sndbuf_query_at) > 1000) { if(!WSAIoctl(ctx->sock, SIO_IDEAL_SEND_BACKLOG_QUERY, 0, 0, &ideal, sizeof(ideal), &ideallen, 0, 0) && ideal != ctx->sndbuf_size && @@ -1701,7 +1701,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf, return CURLE_OK; case CF_QUERY_CONNECT_REPLY_MS: if(ctx->got_first_byte) { - timediff_t ms = curlx_timediff(ctx->first_byte_at, ctx->started_at); + timediff_t ms = curlx_timediff_ms(ctx->first_byte_at, ctx->started_at); *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else @@ -2020,7 +2020,7 @@ static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf, { struct cf_socket_ctx *ctx = cf->ctx; timediff_t timeout_ms = DEFAULT_ACCEPT_TIMEOUT; - timediff_t other; + timediff_t other_ms; struct curltime now; #ifndef CURL_DISABLE_FTP @@ -2030,14 +2030,14 @@ static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf, now = curlx_now(); /* check if the generic timeout possibly is set shorter */ - other = Curl_timeleft(data, &now, FALSE); - if(other && (other < timeout_ms)) - /* note that this also works fine for when other happens to be negative + other_ms = Curl_timeleft_ms(data, &now, FALSE); + if(other_ms && (other_ms < timeout_ms)) + /* note that this also works fine for when other_ms happens to be negative due to it already having elapsed */ - timeout_ms = other; + timeout_ms = other_ms; else { /* subtract elapsed time */ - timeout_ms -= curlx_timediff(now, ctx->started_at); + timeout_ms -= curlx_timediff_ms(now, ctx->started_at); if(!timeout_ms) /* avoid returning 0 as that means no timeout! */ timeout_ms = -1; diff --git a/lib/cfilters.c b/lib/cfilters.c index 090365fdd6ed..507512f8aa46 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -526,7 +526,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, goto out; else { /* check allowed time left */ - const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); + const timediff_t timeout_ms = Curl_timeleft_ms(data, NULL, TRUE); curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); int rc; diff --git a/lib/conncache.c b/lib/conncache.c index 7dc21d967adc..86dcce7138e6 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -299,7 +299,7 @@ cpool_bundle_get_oldest_idle(struct cpool_bundle *bundle) if(!CONN_INUSE(conn)) { /* Set higher score for the age passed since the connection was used */ - score = curlx_timediff(now, conn->lastused); + score = curlx_timediff_ms(now, conn->lastused); if(score > highscore) { highscore = score; @@ -336,7 +336,7 @@ static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool) if(CONN_INUSE(conn) || conn->bits.close || conn->connect_only) continue; /* Set higher score for the age passed since the connection was used */ - score = curlx_timediff(now, conn->lastused); + score = curlx_timediff_ms(now, conn->lastused); if(score > highscore) { highscore = score; oldest_idle = conn; @@ -745,7 +745,7 @@ void Curl_cpool_prune_dead(struct Curl_easy *data) rctx.now = curlx_now(); CPOOL_LOCK(cpool, data); - elapsed = curlx_timediff(rctx.now, cpool->last_cleanup); + elapsed = curlx_timediff_ms(rctx.now, cpool->last_cleanup); if(elapsed >= 1000L) { while(cpool_foreach(data, cpool, &rctx, cpool_reap_dead_cb)) diff --git a/lib/connect.c b/lib/connect.c index e3295524b0ec..18d9028c6cfa 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -101,7 +101,7 @@ enum alpnid Curl_alpn2alpnid(const char *name, size_t len) #endif /* - * Curl_timeleft() returns the amount of milliseconds left allowed for the + * Curl_timeleft_ms() returns the amount of milliseconds left allowed for the * transfer/connection. If the value is 0, there is no timeout (ie there is * infinite time left). If the value is negative, the timeout time has already * elapsed. @@ -110,9 +110,9 @@ enum alpnid Curl_alpn2alpnid(const char *name, size_t len) * @param duringconnect TRUE iff connect timeout is also taken into account. * @unittest: 1303 */ -timediff_t Curl_timeleft(struct Curl_easy *data, - struct curltime *nowp, - bool duringconnect) +timediff_t Curl_timeleft_ms(struct Curl_easy *data, + struct curltime *nowp, + bool duringconnect) { timediff_t timeleft_ms = 0; timediff_t ctimeleft_ms = 0; @@ -133,7 +133,7 @@ timediff_t Curl_timeleft(struct Curl_easy *data, if(data->set.timeout) { timeleft_ms = data->set.timeout - - curlx_timediff(*nowp, data->progress.t_startop); + curlx_timediff_ms(*nowp, data->progress.t_startop); if(!timeleft_ms) timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ if(!duringconnect) @@ -144,7 +144,7 @@ timediff_t Curl_timeleft(struct Curl_easy *data, timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ? data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT; ctimeleft_ms = ctimeout_ms - - curlx_timediff(*nowp, data->progress.t_startsingle); + curlx_timediff_ms(*nowp, data->progress.t_startsingle); if(!ctimeleft_ms) ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ if(!timeleft_ms) @@ -191,7 +191,7 @@ timediff_t Curl_shutdown_timeleft(struct connectdata *conn, int sockindex, nowp = &now; } left_ms = conn->shutdown.timeout_ms - - curlx_timediff(*nowp, conn->shutdown.start[sockindex]); + curlx_timediff_ms(*nowp, conn->shutdown.start[sockindex]); return left_ms ? left_ms : -1; } diff --git a/lib/connect.h b/lib/connect.h index cb185b2c571b..ebf756c562bd 100644 --- a/lib/connect.h +++ b/lib/connect.h @@ -36,9 +36,9 @@ enum alpnid Curl_alpn2alpnid(const char *name, size_t len); /* generic function that returns how much time there is left to run, according to the timeouts set */ -timediff_t Curl_timeleft(struct Curl_easy *data, - struct curltime *nowp, - bool duringconnect); +timediff_t Curl_timeleft_ms(struct Curl_easy *data, + struct curltime *nowp, + bool duringconnect); #define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */ diff --git a/lib/cshutdn.c b/lib/cshutdn.c index 1ce34606ecf3..f9f636640a03 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -291,7 +291,7 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn, sigpipe_apply(data, &pipe_st); while(Curl_llist_head(&cshutdn->list)) { - timediff_t timespent; + timediff_t spent_ms; int remain_ms; cshutdn_perform(cshutdn, data); @@ -302,14 +302,14 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn, } /* wait for activity, timeout or "nothing" */ - timespent = curlx_timediff(curlx_now(), started); - if(timespent >= (timediff_t)timeout_ms) { + spent_ms = curlx_timediff_ms(curlx_now(), started); + if(spent_ms >= (timediff_t)timeout_ms) { CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, %s", (timeout_ms > 0) ? "timeout" : "best effort done"); break; } - remain_ms = timeout_ms - (int)timespent; + remain_ms = timeout_ms - (int)spent_ms; if(cshutdn_wait(cshutdn, data, remain_ms)) { CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, aborted"); break; diff --git a/lib/curlx/timeval.c b/lib/curlx/timeval.c index bd8b9bcee27b..a27525855b0a 100644 --- a/lib/curlx/timeval.c +++ b/lib/curlx/timeval.c @@ -220,7 +220,7 @@ struct curltime curlx_now(void) * * @unittest: 1323 */ -timediff_t curlx_timediff(struct curltime newer, struct curltime older) +timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older) { timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; if(diff >= (TIMEDIFF_T_MAX/1000)) @@ -234,7 +234,8 @@ timediff_t curlx_timediff(struct curltime newer, struct curltime older) * Returns: time difference in number of milliseconds, rounded up. * For too large diffs it returns max value. */ -timediff_t curlx_timediff_ceil(struct curltime newer, struct curltime older) +timediff_t curlx_timediff_ceil_ms(struct curltime newer, + struct curltime older) { timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; if(diff >= (TIMEDIFF_T_MAX/1000)) diff --git a/lib/curlx/timeval.h b/lib/curlx/timeval.h index 1f8fe5e8ad1e..14819157fd49 100644 --- a/lib/curlx/timeval.h +++ b/lib/curlx/timeval.h @@ -46,7 +46,7 @@ struct curltime curlx_now(void); * * Returns: the time difference in number of milliseconds. */ -timediff_t curlx_timediff(struct curltime newer, struct curltime older); +timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older); /* * Make sure that the first argument (newer) is the more recent time and older @@ -54,7 +54,8 @@ timediff_t curlx_timediff(struct curltime newer, struct curltime older); * * Returns: the time difference in number of milliseconds, rounded up. */ -timediff_t curlx_timediff_ceil(struct curltime newer, struct curltime older); +timediff_t curlx_timediff_ceil_ms(struct curltime newer, + struct curltime older); /* * Make sure that the first argument (newer) is the more recent time and older diff --git a/lib/doh.c b/lib/doh.c index 3552cba7b554..636f0f41cf24 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -311,7 +311,7 @@ static CURLcode doh_probe_run(struct Curl_easy *data, goto error; } - timeout_ms = Curl_timeleft(data, NULL, TRUE); + timeout_ms = Curl_timeleft_ms(data, NULL, TRUE); if(timeout_ms <= 0) { result = CURLE_OPERATION_TIMEDOUT; goto error; diff --git a/lib/easy.c b/lib/easy.c index 919ed80e8b1a..c5ccc5b1e61f 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -654,16 +654,16 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) /* If nothing updated the timeout, we decrease it by the spent time. * If it was updated, it has the new timeout time stored already. */ - timediff_t timediff = curlx_timediff(curlx_now(), before); - if(timediff > 0) { + timediff_t spent_ms = curlx_timediff_ms(curlx_now(), before); + if(spent_ms > 0) { #if DEBUG_EV_POLL curl_mfprintf(stderr, "poll timeout %ldms not updated, decrease by " "time spent %ldms\n", ev->ms, (long)timediff); #endif - if(timediff > ev->ms) + if(spent_ms > ev->ms) ev->ms = 0; else - ev->ms -= (long)timediff; + ev->ms -= (long)spent_ms; } } } diff --git a/lib/gopher.c b/lib/gopher.c index 3a6c73e6a274..1d4c75295ccb 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -202,7 +202,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) else break; - timeout_ms = Curl_timeleft(data, NULL, FALSE); + timeout_ms = Curl_timeleft_ms(data, NULL, FALSE); if(timeout_ms < 0) { result = CURLE_OPERATION_TIMEDOUT; break; diff --git a/lib/hostip.c b/lib/hostip.c index ff7ac18c996b..ef000aab6930 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -200,7 +200,7 @@ dnscache_entry_is_stale(void *datap, void *hc) if(dns->timestamp.tv_sec || dns->timestamp.tv_usec) { /* get age in milliseconds */ - timediff_t age = curlx_timediff(prune->now, dns->timestamp); + timediff_t age = curlx_timediff_ms(prune->now, dns->timestamp); if(!dns->addr) age *= 2; /* negative entries age twice as fast */ if(age >= prune->max_age_ms) @@ -1177,8 +1177,8 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, the time we spent until now! */ if(prev_alarm) { /* there was an alarm() set before us, now put it back */ - timediff_t elapsed_secs = curlx_timediff(curlx_now(), - data->conn->created) / 1000; + timediff_t elapsed_secs = curlx_timediff_ms(curlx_now(), + data->conn->created) / 1000; /* the alarm period is counted in even number of seconds */ unsigned long alarm_set = (unsigned long)(prev_alarm - elapsed_secs); diff --git a/lib/http.c b/lib/http.c index 6726d23a4399..0555291d0bba 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4945,7 +4945,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data, *eos = FALSE; return CURLE_READ_ERROR; case EXP100_AWAITING_CONTINUE: - ms = curlx_timediff(curlx_now(), ctx->start); + ms = curlx_timediff_ms(curlx_now(), ctx->start); if(ms < data->set.expect_100_timeout) { DEBUGF(infof(data, "cr_exp100_read, AWAITING_CONTINUE, not expired")); data->req.keepon &= ~KEEP_SEND; diff --git a/lib/mqtt.c b/lib/mqtt.c index 713e4aa02cd6..58458a841639 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -847,7 +847,7 @@ static CURLcode mqtt_ping(struct Curl_easy *data) !mq->pingsent && data->set.upkeep_interval_ms > 0) { struct curltime t = curlx_now(); - timediff_t diff = curlx_timediff(t, mq->lastTime); + timediff_t diff = curlx_timediff_ms(t, mq->lastTime); if(diff > data->set.upkeep_interval_ms) { /* 0xC0 is PINGREQ, and 0x00 is remaining length */ diff --git a/lib/multi.c b/lib/multi.c index efc240b4facc..1e24ce8c4662 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1739,7 +1739,7 @@ static bool multi_handle_timeout(struct Curl_easy *data, CURLcode *result) { bool connect_timeout = data->mstate < MSTATE_DO; - timediff_t timeout_ms = Curl_timeleft(data, now, connect_timeout); + timediff_t timeout_ms = Curl_timeleft_ms(data, now, connect_timeout); if(timeout_ms < 0) { /* Handle timed out */ struct curltime since; @@ -1749,22 +1749,22 @@ static bool multi_handle_timeout(struct Curl_easy *data, since = data->progress.t_startop; if(data->mstate == MSTATE_RESOLVING) failf(data, "Resolving timed out after %" FMT_TIMEDIFF_T - " milliseconds", curlx_timediff(*now, since)); + " milliseconds", curlx_timediff_ms(*now, since)); else if(data->mstate == MSTATE_CONNECTING) failf(data, "Connection timed out after %" FMT_TIMEDIFF_T - " milliseconds", curlx_timediff(*now, since)); + " milliseconds", curlx_timediff_ms(*now, since)); else { struct SingleRequest *k = &data->req; if(k->size != -1) { failf(data, "Operation timed out after %" FMT_TIMEDIFF_T " milliseconds with %" FMT_OFF_T " out of %" FMT_OFF_T " bytes received", - curlx_timediff(*now, since), k->bytecount, k->size); + curlx_timediff_ms(*now, since), k->bytecount, k->size); } else { failf(data, "Operation timed out after %" FMT_TIMEDIFF_T " milliseconds with %" FMT_OFF_T " bytes received", - curlx_timediff(*now, since), k->bytecount); + curlx_timediff_ms(*now, since), k->bytecount); } } *result = CURLE_OPERATION_TIMEDOUT; @@ -3410,13 +3410,13 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, if(multi->timetree && curlx_timediff_us(multi->timetree->key, now) > 0) { /* some time left before expiration */ - timediff_t diff = curlx_timediff_ceil(multi->timetree->key, now); + timediff_t diff_ms = curlx_timediff_ceil_ms(multi->timetree->key, now); #ifndef CURL_DISABLE_VERBOSE_STRINGS data = Curl_splayget(multi->timetree); #endif /* this should be safe even on 32-bit archs, as we do not use that overly long timeouts */ - *timeout_ms = (long)diff; + *timeout_ms = (long)diff_ms; } else { #ifndef CURL_DISABLE_VERBOSE_STRINGS @@ -3574,7 +3574,7 @@ multi_addtimeout(struct Curl_easy *data, /* find the correct spot in the list */ for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) { struct time_node *check = Curl_node_elem(e); - timediff_t diff = curlx_timediff(check->time, node->time); + timediff_t diff = curlx_timediff_ms(check->time, node->time); if(diff > 0) break; prev = e; @@ -3625,7 +3625,7 @@ void Curl_expire_ex(struct Curl_easy *data, /* This means that the struct is added as a node in the splay tree. Compare if the new time is earlier, and only remove-old/add-new if it is. */ - timediff_t diff = curlx_timediff(set, *curr_expire); + timediff_t diff = curlx_timediff_ms(set, *curr_expire); int rc; if(diff > 0) { diff --git a/lib/pingpong.c b/lib/pingpong.c index d0959470bea5..670d37c38e62 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -61,17 +61,17 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, /* Without a requested timeout, we only wait 'response_time' seconds for the full response to arrive before we bail out */ - timeout_ms = response_time - curlx_timediff(now, pp->response); + timeout_ms = response_time - curlx_timediff_ms(now, pp->response); if(data->set.timeout && !disconnecting) { /* if timeout is requested, find out how much overall remains */ - timediff_t timeout2_ms = Curl_timeleft(data, &now, FALSE); + timediff_t timeout2_ms = Curl_timeleft_ms(data, &now, FALSE); /* pick the lowest number */ timeout_ms = CURLMIN(timeout_ms, timeout2_ms); } if(disconnecting) { - timediff_t total_left_ms = Curl_timeleft(data, NULL, FALSE); + timediff_t total_left_ms = Curl_timeleft_ms(data, NULL, FALSE); timeout_ms = CURLMIN(timeout_ms, CURLMAX(total_left_ms, 0)); } diff --git a/lib/progress.c b/lib/progress.c index 211212d4ed3a..02841544dd7a 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -271,7 +271,7 @@ timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, return 0; /* The time it took us to have `bytes` */ - took_ms = curlx_timediff_ceil(now, d->limit.start); + took_ms = curlx_timediff_ceil_ms(now, d->limit.start); /* The time it *should* have taken us to have `bytes` * when obeying the bytes_per_sec speed_limit. */ @@ -311,14 +311,14 @@ void Curl_ratelimit(struct Curl_easy *data, struct curltime now) { /* do not set a new stamp unless the time since last update is long enough */ if(data->set.max_recv_speed) { - if(curlx_timediff(now, data->progress.dl.limit.start) >= + if(curlx_timediff_ms(now, data->progress.dl.limit.start) >= MIN_RATE_LIMIT_PERIOD) { data->progress.dl.limit.start = now; data->progress.dl.limit.start_size = data->progress.dl.cur_size; } } if(data->set.max_send_speed) { - if(curlx_timediff(now, data->progress.ul.limit.start) >= + if(curlx_timediff_ms(now, data->progress.ul.limit.start) >= MIN_RATE_LIMIT_PERIOD) { data->progress.ul.limit.start = now; data->progress.ul.limit.start_size = data->progress.ul.cur_size; @@ -424,7 +424,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) checkindex = (p->speeder_c >= CURR_TIME) ? p->speeder_c%CURR_TIME : 0; /* Figure out the exact time for the time span */ - span_ms = curlx_timediff(now, p->speeder_time[checkindex]); + span_ms = curlx_timediff_ms(now, p->speeder_time[checkindex]); if(span_ms == 0) span_ms = 1; /* at least one millisecond MUST have passed */ diff --git a/lib/rename.c b/lib/rename.c index 4c66ce4ed0eb..225811e65a65 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -54,7 +54,7 @@ int Curl_rename(const char *oldpath, const char *newpath) curlx_unicodefree(tchar_newpath); break; } - diff = curlx_timediff(curlx_now(), start); + diff = curlx_timediff_ms(curlx_now(), start); if(diff < 0 || diff > max_wait_ms) { curlx_unicodefree(tchar_oldpath); curlx_unicodefree(tchar_newpath); diff --git a/lib/socketpair.c b/lib/socketpair.c index 45e908bbf3a9..08753c8a8c21 100644 --- a/lib/socketpair.c +++ b/lib/socketpair.c @@ -228,7 +228,7 @@ int Curl_socketpair(int domain, int type, int protocol, if(nread == -1) { int sockerr = SOCKERRNO; /* Do not block forever */ - if(curlx_timediff(curlx_now(), start) > (60 * 1000)) + if(curlx_timediff_ms(curlx_now(), start) > (60 * 1000)) goto error; if( #ifdef USE_WINSOCK diff --git a/lib/socks.c b/lib/socks.c index 5daf5393cd14..5185913a2458 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -137,7 +137,7 @@ CURLcode Curl_blockread_all(struct Curl_cfilter *cf, *pnread = 0; for(;;) { - timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); + timediff_t timeout_ms = Curl_timeleft_ms(data, NULL, TRUE); if(timeout_ms < 0) { /* we already got the timeout */ return CURLE_OPERATION_TIMEDOUT; diff --git a/lib/speedcheck.c b/lib/speedcheck.c index b063e5d4f208..3b128655f5e7 100644 --- a/lib/speedcheck.c +++ b/lib/speedcheck.c @@ -53,7 +53,7 @@ CURLcode Curl_speedcheck(struct Curl_easy *data, data->state.keeps_speed = now; else { /* how long has it been under the limit */ - timediff_t howlong = curlx_timediff(now, data->state.keeps_speed); + timediff_t howlong = curlx_timediff_ms(now, data->state.keeps_speed); if(howlong >= data->set.low_speed_time * 1000) { /* too long */ diff --git a/lib/telnet.c b/lib/telnet.c index a939ae1a73f8..45a70808ea6b 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1531,7 +1531,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) if(data->set.timeout) { now = curlx_now(); - if(curlx_timediff(now, conn->created) >= data->set.timeout) { + if(curlx_timediff_ms(now, conn->created) >= data->set.timeout) { failf(data, "Time-out"); result = CURLE_OPERATION_TIMEDOUT; keepon = FALSE; @@ -1652,7 +1652,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) if(data->set.timeout) { now = curlx_now(); - if(curlx_timediff(now, conn->created) >= data->set.timeout) { + if(curlx_timediff_ms(now, conn->created) >= data->set.timeout) { failf(data, "Time-out"); result = CURLE_OPERATION_TIMEDOUT; keepon = FALSE; diff --git a/lib/tftp.c b/lib/tftp.c index 653654315147..91a8c25ff315 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -211,7 +211,7 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state) bool start = (state->state == TFTP_STATE_START); /* Compute drop-dead time */ - timeout_ms = Curl_timeleft(state->data, NULL, start); + timeout_ms = Curl_timeleft_ms(state->data, NULL, start); if(timeout_ms < 0) { /* time-out, bail out, go home */ @@ -1199,8 +1199,8 @@ static timediff_t tftp_state_timeout(struct tftp_conn *state, if(event) *event = TFTP_EVENT_NONE; - timeout_ms = Curl_timeleft(state->data, NULL, - (state->state == TFTP_STATE_START)); + timeout_ms = Curl_timeleft_ms(state->data, NULL, + (state->state == TFTP_STATE_START)); if(timeout_ms < 0) { state->error = TFTP_ERR_TIMEOUT; state->state = TFTP_STATE_FIN; diff --git a/lib/transfer.c b/lib/transfer.c index 2b77219a9cba..6ae21e1a4030 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -422,18 +422,18 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp) goto out; if(k->keepon) { - if(0 > Curl_timeleft(data, nowp, FALSE)) { + if(Curl_timeleft_ms(data, nowp, FALSE) < 0) { if(k->size != -1) { failf(data, "Operation timed out after %" FMT_TIMEDIFF_T " milliseconds with %" FMT_OFF_T " out of %" FMT_OFF_T " bytes received", - curlx_timediff(*nowp, data->progress.t_startsingle), + curlx_timediff_ms(*nowp, data->progress.t_startsingle), k->bytecount, k->size); } else { failf(data, "Operation timed out after %" FMT_TIMEDIFF_T " milliseconds with %" FMT_OFF_T " bytes received", - curlx_timediff(*nowp, data->progress.t_startsingle), + curlx_timediff_ms(*nowp, data->progress.t_startsingle), k->bytecount); } result = CURLE_OPERATION_TIMEDOUT; diff --git a/lib/url.c b/lib/url.c index e816da442a16..0a0b6ff3a205 100644 --- a/lib/url.c +++ b/lib/url.c @@ -655,7 +655,7 @@ static bool conn_maxage(struct Curl_easy *data, timediff_t age_ms; if(data->set.conn_max_idle_ms) { - age_ms = curlx_timediff(now, conn->lastused); + age_ms = curlx_timediff_ms(now, conn->lastused); if(age_ms > data->set.conn_max_idle_ms) { infof(data, "Too old connection (%" FMT_TIMEDIFF_T " ms idle, max idle is %" FMT_TIMEDIFF_T " ms), disconnect it", @@ -665,7 +665,7 @@ static bool conn_maxage(struct Curl_easy *data, } if(data->set.conn_max_age_ms) { - age_ms = curlx_timediff(now, conn->created); + age_ms = curlx_timediff_ms(now, conn->created); if(age_ms > data->set.conn_max_age_ms) { infof(data, "Too old connection (created %" FMT_TIMEDIFF_T @@ -750,7 +750,7 @@ CURLcode Curl_conn_upkeep(struct Curl_easy *data, struct curltime *now) { CURLcode result = CURLE_OK; - if(curlx_timediff(*now, conn->keepalive) <= data->set.upkeep_interval_ms) + if(curlx_timediff_ms(*now, conn->keepalive) <= data->set.upkeep_interval_ms) return result; /* briefly attach for action */ @@ -3217,7 +3217,7 @@ static CURLcode resolve_server(struct Curl_easy *data, { struct hostname *ehost; int eport; - timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); + timediff_t timeout_ms = Curl_timeleft_ms(data, NULL, TRUE); const char *peertype = "host"; CURLcode result; @@ -3275,7 +3275,7 @@ static CURLcode resolve_server(struct Curl_easy *data, else if(result == CURLE_OPERATION_TIMEDOUT) { failf(data, "Failed to resolve %s '%s' with timeout after %" FMT_TIMEDIFF_T " ms", peertype, ehost->dispname, - curlx_timediff(curlx_now(), data->progress.t_startsingle)); + curlx_timediff_ms(curlx_now(), data->progress.t_startsingle)); return CURLE_OPERATION_TIMEDOUT; } else if(result) { diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 36bd28926d1e..1f70e0b480ab 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -517,11 +517,11 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data) if(Curl_trc_is_verbose(data)) { const ngtcp2_transport_params *rp; rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn); - CURL_TRC_CF(data, cf, "handshake complete after %dms, remote transport[" - "max_udp_payload=%" FMT_PRIu64 + CURL_TRC_CF(data, cf, "handshake complete after %" FMT_TIMEDIFF_T + "ms, remote transport[max_udp_payload=%" FMT_PRIu64 ", initial_max_data=%" FMT_PRIu64 "]", - (int)curlx_timediff(ctx->handshake_at, ctx->started_at), + curlx_timediff_ms(ctx->handshake_at, ctx->started_at), (curl_uint64_t)rp->max_udp_payload_size, (curl_uint64_t)rp->initial_max_data); } @@ -2722,7 +2722,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf, } case CF_QUERY_CONNECT_REPLY_MS: if(ctx->q.got_first_byte) { - timediff_t ms = curlx_timediff(ctx->q.first_byte_at, ctx->started_at); + timediff_t ms = curlx_timediff_ms(ctx->q.first_byte_at, ctx->started_at); *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else @@ -2783,7 +2783,7 @@ static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf, * it will close the connection when it expires. */ rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn); if(rp && rp->max_idle_timeout) { - timediff_t idletime_ms = curlx_timediff(curlx_now(), ctx->q.last_io); + timediff_t idletime_ms = curlx_timediff_ms(curlx_now(), ctx->q.last_io); if(idletime_ms > 0) { uint64_t max_idle_ms = (uint64_t)(rp->max_idle_timeout / NGTCP2_MILLISECONDS); diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index efa653cf800b..145a2831db02 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1805,8 +1805,8 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, /* connected */ ctx->handshake_at = now; ctx->q.last_io = now; - CURL_TRC_CF(data, cf, "handshake complete after %dms", - (int)curlx_timediff(now, ctx->started_at)); + CURL_TRC_CF(data, cf, "handshake complete after %" FMT_TIMEDIFF_T "ms", + curlx_timediff_ms(now, ctx->started_at)); result = cf_osslq_verify_peer(cf, data); if(!result) { CURL_TRC_CF(data, cf, "peer verified"); @@ -2247,7 +2247,7 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf, } CURL_TRC_CF(data, cf, "negotiated idle timeout: %" FMT_PRIu64 "ms", (curl_uint64_t)idle_ms); - idletime = curlx_timediff(curlx_now(), ctx->q.last_io); + idletime = curlx_timediff_ms(curlx_now(), ctx->q.last_io); if(idle_ms && idletime > 0 && (uint64_t)idletime > idle_ms) goto out; } @@ -2337,7 +2337,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf, } case CF_QUERY_CONNECT_REPLY_MS: if(ctx->got_first_byte) { - timediff_t ms = curlx_timediff(ctx->first_byte_at, ctx->started_at); + timediff_t ms = curlx_timediff_ms(ctx->first_byte_at, ctx->started_at); *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index fc1c55526e47..d8d063b2eca2 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -1402,8 +1402,8 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf, if(quiche_conn_is_established(ctx->qconn)) { ctx->handshake_at = ctx->q.last_op; - CURL_TRC_CF(data, cf, "handshake complete after %dms", - (int)curlx_timediff(ctx->handshake_at, ctx->started_at)); + CURL_TRC_CF(data, cf, "handshake complete after %" FMT_TIMEDIFF_T "ms", + curlx_timediff_ms(ctx->handshake_at, ctx->started_at)); result = cf_quiche_verify_peer(cf, data); if(!result) { CURL_TRC_CF(data, cf, "peer verified"); @@ -1534,7 +1534,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf, } case CF_QUERY_CONNECT_REPLY_MS: if(ctx->q.got_first_byte) { - timediff_t ms = curlx_timediff(ctx->q.first_byte_at, ctx->started_at); + timediff_t ms = curlx_timediff_ms(ctx->q.first_byte_at, ctx->started_at); *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 781c5dafc3d4..07036f900a5c 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -2481,7 +2481,7 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, while((sshc->state != SSH_STOP) && !result) { bool block; - timediff_t left = 1000; + timediff_t left_ms = 1000; struct curltime now = curlx_now(); result = myssh_statemach_act(data, sshc, sshp, &block); @@ -2496,8 +2496,8 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, if(result) break; - left = Curl_timeleft(data, NULL, FALSE); - if(left < 0) { + left_ms = Curl_timeleft_ms(data, NULL, FALSE); + if(left_ms < 0) { failf(data, "Operation timed out"); return CURLE_OPERATION_TIMEDOUT; } @@ -2506,8 +2506,8 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, if(block) { curl_socket_t fd_read = conn->sock[FIRSTSOCKET]; /* wait for the socket to become ready */ - (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, - CURL_SOCKET_BAD, left > 1000 ? 1000 : left); + (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, CURL_SOCKET_BAD, + left_ms > 1000 ? 1000 : left_ms); } } diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index d3d6cb1dc9a9..b414dfcf2d60 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3124,7 +3124,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, while((sshc->state != SSH_STOP) && !result) { bool block; - timediff_t left = 1000; + timediff_t left_ms = 1000; struct curltime now = curlx_now(); result = ssh_statemachine(data, sshc, sshp, &block); @@ -3139,13 +3139,13 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, if(result) break; - left = Curl_timeleft(data, NULL, FALSE); - if(left < 0) { + left_ms = Curl_timeleft_ms(data, NULL, FALSE); + if(left_ms < 0) { failf(data, "Operation timed out"); return CURLE_OPERATION_TIMEDOUT; } } - else if(curlx_timediff(now, dis) > 1000) { + else if(curlx_timediff_ms(now, dis) > 1000) { /* disconnect timeout */ failf(data, "Disconnect timed out"); result = CURLE_OK; @@ -3163,7 +3163,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, fd_write = sock; /* wait for the socket to become ready */ (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write, - left > 1000 ? 1000 : left); + left_ms > 1000 ? 1000 : left_ms); } } diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 34d9b84d7914..a692ce31c729 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -544,7 +544,7 @@ static bool gtls_shared_creds_expired(const struct Curl_easy *data, { const struct ssl_general_config *cfg = &data->set.general_ssl; struct curltime now = curlx_now(); - timediff_t elapsed_ms = curlx_timediff(now, sc->time); + timediff_t elapsed_ms = curlx_timediff_ms(now, sc->time); timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; if(timeout_ms < 0) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 2c6c05e53d2e..533597ed4176 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3573,7 +3573,7 @@ ossl_cached_x509_store_expired(const struct Curl_easy *data, return FALSE; else { struct curltime now = curlx_now(); - timediff_t elapsed_ms = curlx_timediff(now, mb->time); + timediff_t elapsed_ms = curlx_timediff_ms(now, mb->time); timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; return elapsed_ms >= timeout_ms; diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 863524e4ee62..137e525722cd 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1767,7 +1767,7 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, curl_socket_t readfd, writefd; timediff_t elapsed; - elapsed = curlx_timediff(curlx_now(), rs->start_time); + elapsed = curlx_timediff_ms(curlx_now(), rs->start_time); if(elapsed >= MAX_RENEG_BLOCK_TIME) { failf(data, "schannel: renegotiation timeout"); result = CURLE_SSL_CONNECT_ERROR; @@ -1827,14 +1827,14 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, for(;;) { int what; - timediff_t timeout, remaining; + timediff_t timeout_ms, remaining; if(Curl_pgrsUpdate(data)) { result = CURLE_ABORTED_BY_CALLBACK; break; } - elapsed = curlx_timediff(curlx_now(), rs->start_time); + elapsed = curlx_timediff_ms(curlx_now(), rs->start_time); if(elapsed >= MAX_RENEG_BLOCK_TIME) { failf(data, "schannel: renegotiation timeout"); result = CURLE_SSL_CONNECT_ERROR; @@ -1843,31 +1843,31 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, remaining = MAX_RENEG_BLOCK_TIME - elapsed; if(blocking) { - timeout = Curl_timeleft(data, NULL, FALSE); + timeout_ms = Curl_timeleft_ms(data, NULL, FALSE); - if(timeout < 0) { + if(timeout_ms < 0) { result = CURLE_OPERATION_TIMEDOUT; break; } /* the blocking is in intervals so that the progress function can be called every second */ - if(!timeout || timeout > 1000) - timeout = 1000; + if(!timeout_ms || timeout_ms > 1000) + timeout_ms = 1000; - if(timeout > remaining) - timeout = remaining; + if(timeout_ms > remaining) + timeout_ms = remaining; } else - timeout = 0; + timeout_ms = 0; SCH_DEV(infof(data, "schannel: renegotiation wait until socket is" "%s%s for up to %" FMT_TIMEDIFF_T " ms", ((readfd != CURL_SOCKET_BAD) ? " readable" : ""), ((writefd != CURL_SOCKET_BAD) ? " writeable" : ""), - timeout)); + timeout_ms)); - what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, timeout); + what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, timeout_ms); if(what > 0 && (what & (CURL_CSELECT_IN | CURL_CSELECT_OUT))) { SCH_DEV(infof(data, "schannel: renegotiation socket %s%s", @@ -1997,7 +1997,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, while(len > *pnwritten) { size_t this_write = 0; int what; - timediff_t timeout_ms = Curl_timeleft(data, NULL, FALSE); + timediff_t timeout_ms = Curl_timeleft_ms(data, NULL, FALSE); if(timeout_ms < 0) { /* we already got the timeout */ failf(data, "schannel: timed out sending data " @@ -2801,7 +2801,7 @@ HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf, timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; if(timeout_ms >= 0) { now = curlx_now(); - elapsed_ms = curlx_timediff(now, share->time); + elapsed_ms = curlx_timediff_ms(now, share->time); if(elapsed_ms >= timeout_ms) { return NULL; } diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index bf39ccf9b1fc..34fc17d994ad 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -733,7 +733,7 @@ wssl_cached_x509_store_expired(const struct Curl_easy *data, { const struct ssl_general_config *cfg = &data->set.general_ssl; struct curltime now = curlx_now(); - timediff_t elapsed_ms = curlx_timediff(now, mb->time); + timediff_t elapsed_ms = curlx_timediff_ms(now, mb->time); timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; if(timeout_ms < 0) diff --git a/lib/ws.c b/lib/ws.c index 891a53dbb458..ddf49c9d2d83 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -1703,7 +1703,7 @@ static CURLcode ws_send_raw_blocking(struct Curl_easy *data, CURL_TRC_WS(data, "ws_send_raw_blocking() partial, %zu left to send", buflen); - left_ms = Curl_timeleft(data, NULL, FALSE); + left_ms = Curl_timeleft_ms(data, NULL, FALSE); if(left_ms < 0) { failf(data, "[WS] Timeout waiting for socket becoming writable"); return CURLE_SEND_ERROR; diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index dd460a4bf6ed..5f33c7c29c05 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -171,13 +171,13 @@ int tool_progress_cb(void *clientp, if(bar->prev == point) /* progress did not change since last invoke */ return 0; - else if((curlx_timediff(now, bar->prevtime) < 100L) && point < total) + else if((curlx_timediff_ms(now, bar->prevtime) < 100L) && point < total) /* limit progress-bar updating to 10 Hz except when we are at 100% */ return 0; } else { /* total is unknown */ - if(curlx_timediff(now, bar->prevtime) < 100L) + if(curlx_timediff_ms(now, bar->prevtime) < 100L) /* limit progress-bar updating to 10 Hz */ return 0; update_width(bar); diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index b5c614384521..a4c475be8e7a 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -101,7 +101,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) if(config->timeout_ms) { struct curltime now = curlx_now(); - long msdelta = (long)curlx_timediff(now, per->start); + long msdelta = (long)curlx_timediff_ms(now, per->start); if(msdelta > config->timeout_ms) /* timeout */ diff --git a/src/tool_operate.c b/src/tool_operate.c index 401abe12f968..2c85839d17b8 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -476,7 +476,7 @@ static CURLcode retrycheck(struct OperationConfig *config, maximum time allowed for retrying, then exit the retries right away */ if(config->retry_maxtime_ms) { - timediff_t ms = curlx_timediff(curlx_now(), per->retrystart); + timediff_t ms = curlx_timediff_ms(curlx_now(), per->retrystart); if((CURL_OFF_T_MAX - sleeptime < ms) || (ms + sleeptime > config->retry_maxtime_ms)) { @@ -713,7 +713,7 @@ static CURLcode post_per_transfer(struct per_transfer *per, time */ if(per->retry_remaining && (!config->retry_maxtime_ms || - (curlx_timediff(curlx_now(), per->retrystart) < + (curlx_timediff_ms(curlx_now(), per->retrystart) < config->retry_maxtime_ms)) ) { result = retrycheck(config, per, result, retryp, delay); if(!result && *retryp) @@ -1984,7 +1984,7 @@ static CURLcode serial_transfers(CURLSH *share) if(per && global->ms_per_transfer) { /* how long time did the most recent transfer take in number of milliseconds */ - timediff_t milli = curlx_timediff(curlx_now(), start); + timediff_t milli = curlx_timediff_ms(curlx_now(), start); if(milli < global->ms_per_transfer) { notef("Transfer took %" CURL_FORMAT_CURL_OFF_T " ms, " "waits %ldms as set by --rate", diff --git a/src/tool_progress.c b/src/tool_progress.c index ad4cd98eb7f5..f9fbd83574ed 100644 --- a/src/tool_progress.c +++ b/src/tool_progress.c @@ -156,7 +156,7 @@ bool progress_meter(CURLM *multi, return FALSE; now = curlx_now(); - diff = curlx_timediff(now, stamp); + diff = curlx_timediff_ms(now, stamp); if(!header) { header = TRUE; @@ -169,7 +169,7 @@ bool progress_meter(CURLM *multi, char time_total[10]; char time_spent[10]; char buffer[3][6]; - curl_off_t spent = curlx_timediff(now, *start)/1000; + curl_off_t spent = curlx_timediff_ms(now, *start)/1000; char dlpercen[4]="--"; char ulpercen[4]="--"; struct per_transfer *per; @@ -236,13 +236,13 @@ bool progress_meter(CURLM *multi, curl_off_t uls; if(indexwrapped) { /* 'speedindex' is the oldest stored data */ - deltams = curlx_timediff(now, speedstore[speedindex].stamp); + deltams = curlx_timediff_ms(now, speedstore[speedindex].stamp); dl = all_dlnow - speedstore[speedindex].dl; ul = all_ulnow - speedstore[speedindex].ul; } else { /* since the beginning */ - deltams = curlx_timediff(now, *start); + deltams = curlx_timediff_ms(now, *start); dl = all_dlnow; ul = all_ulnow; } diff --git a/tests/data/test1303 b/tests/data/test1303 index 705a04111dc6..6d97bfe99f5a 100644 --- a/tests/data/test1303 +++ b/tests/data/test1303 @@ -2,7 +2,7 @@ unittest -Curl_timeleft +Curl_timeleft_ms @@ -13,7 +13,7 @@ Curl_timeleft unittest -Curl_timeleft unit tests +Curl_timeleft_ms unit tests diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 52a6395ad19b..555741175422 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -461,7 +461,7 @@ void ws_close(CURL *curl); #define TEST_HANG_TIMEOUT 60 * 1000 /* global default */ #define exe_test_timedout(T,Y,Z) do { \ - timediff_t timediff = curlx_timediff(curlx_now(), tv_test_start); \ + timediff_t timediff = curlx_timediff_ms(curlx_now(), tv_test_start); \ if(timediff > (T)) { \ curl_mfprintf(stderr, "%s:%d ABORTING TEST, since it seems " \ "that it would have run forever (%ld ms > %ld ms)\n", \ diff --git a/tests/libtest/lib1501.c b/tests/libtest/lib1501.c index feb775f136dc..5b5e64c48cca 100644 --- a/tests/libtest/lib1501.c +++ b/tests/libtest/lib1501.c @@ -87,7 +87,7 @@ static CURLcode test_lib1501(const char *URL) abort_on_test_timeout_custom(HANG_TIMEOUT); after = curlx_now(); - e = curlx_timediff(after, before); + e = curlx_timediff_ms(after, before); curl_mfprintf(stderr, "pong = %ld\n", (long)e); if(e > MAX_BLOCKED_TIME_MS) { diff --git a/tests/libtest/lib1507.c b/tests/libtest/lib1507.c index a02a07e61b29..d9f85a3318aa 100644 --- a/tests/libtest/lib1507.c +++ b/tests/libtest/lib1507.c @@ -112,7 +112,7 @@ static CURLcode test_lib1507(const char *URL) rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout); - if(curlx_timediff(curlx_now(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) { + if(curlx_timediff_ms(curlx_now(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) { curl_mfprintf(stderr, "ABORTING TEST, since it seems " "that it would have run forever.\n"); break; diff --git a/tests/libtest/lib1564.c b/tests/libtest/lib1564.c index 283f9dcf399f..42b3a07d1a91 100644 --- a/tests/libtest/lib1564.c +++ b/tests/libtest/lib1564.c @@ -49,7 +49,7 @@ static CURLcode test_lib1564(const char *URL) multi_poll(multi, NULL, 0, 1000, &numfds); time_after_wait = curlx_now(); - if(curlx_timediff(time_after_wait, time_before_wait) < 500) { + if(curlx_timediff_ms(time_after_wait, time_before_wait) < 500) { curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n", __FILE__, __LINE__); res = TEST_ERR_MAJOR_BAD; @@ -66,7 +66,7 @@ static CURLcode test_lib1564(const char *URL) multi_poll(multi, NULL, 0, 1000, &numfds); time_after_wait = curlx_now(); - if(curlx_timediff(time_after_wait, time_before_wait) > 500) { + if(curlx_timediff_ms(time_after_wait, time_before_wait) > 500) { curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too late\n", __FILE__, __LINE__); res = TEST_ERR_MAJOR_BAD; @@ -81,7 +81,7 @@ static CURLcode test_lib1564(const char *URL) multi_poll(multi, NULL, 0, 1000, &numfds); time_after_wait = curlx_now(); - if(curlx_timediff(time_after_wait, time_before_wait) < 500) { + if(curlx_timediff_ms(time_after_wait, time_before_wait) < 500) { curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n", __FILE__, __LINE__); res = TEST_ERR_MAJOR_BAD; @@ -99,7 +99,7 @@ static CURLcode test_lib1564(const char *URL) multi_poll(multi, NULL, 0, 1000, &numfds); time_after_wait = curlx_now(); - if(curlx_timediff(time_after_wait, time_before_wait) > 500) { + if(curlx_timediff_ms(time_after_wait, time_before_wait) > 500) { curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too late\n", __FILE__, __LINE__); res = TEST_ERR_MAJOR_BAD; @@ -114,7 +114,7 @@ static CURLcode test_lib1564(const char *URL) multi_poll(multi, NULL, 0, 1000, &numfds); time_after_wait = curlx_now(); - if(curlx_timediff(time_after_wait, time_before_wait) < 500) { + if(curlx_timediff_ms(time_after_wait, time_before_wait) < 500) { curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n", __FILE__, __LINE__); res = TEST_ERR_MAJOR_BAD; diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c index 1ce367b6a796..b02cb3abad04 100644 --- a/tests/unit/unit1303.c +++ b/tests/unit/unit1303.c @@ -148,7 +148,7 @@ static CURLcode test_unit1303(const char *arg) timediff_t timeout; NOW(run[i].now_s, run[i].now_us); TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms); - timeout = Curl_timeleft(easy, &now, run[i].connecting); + timeout = Curl_timeleft_ms(easy, &now, run[i].connecting); if(timeout != run[i].result) fail(run[i].comment); } diff --git a/tests/unit/unit1323.c b/tests/unit/unit1323.c index a4e3eab2e103..15d140e10a2a 100644 --- a/tests/unit/unit1323.c +++ b/tests/unit/unit1323.c @@ -43,7 +43,7 @@ static CURLcode test_unit1323(const char *arg) size_t i; for(i = 0; i < CURL_ARRAYSIZE(tests); i++) { - timediff_t result = curlx_timediff(tests[i].first, tests[i].second); + timediff_t result = curlx_timediff_ms(tests[i].first, tests[i].second); if(result != tests[i].result) { curl_mprintf("%ld.%06u to %ld.%06u got %" FMT_TIMEDIFF_T ", but expected %" FMT_TIMEDIFF_T "\n", diff --git a/tests/unit/unit2600.c b/tests/unit/unit2600.c index 08b2ca6fbd57..fbf53c510791 100644 --- a/tests/unit/unit2600.c +++ b/tests/unit/unit2600.c @@ -122,7 +122,7 @@ static void cf_test_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) struct cf_test_ctx *ctx = cf->ctx; #ifndef CURL_DISABLE_VERBOSE_STRINGS infof(data, "%04dms: cf[%s] destroyed", - (int)curlx_timediff(curlx_now(), current_tr->started), ctx->id); + (int)curlx_timediff_ms(curlx_now(), current_tr->started), ctx->id); #else (void)data; #endif @@ -139,7 +139,7 @@ static CURLcode cf_test_connect(struct Curl_cfilter *cf, (void)data; *done = FALSE; - duration_ms = curlx_timediff(curlx_now(), ctx->started); + duration_ms = curlx_timediff_ms(curlx_now(), ctx->started); if(duration_ms >= ctx->fail_delay_ms) { infof(data, "%04dms: cf[%s] fail delay reached", (int)duration_ms, ctx->id); @@ -218,7 +218,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, ctx->stats->creations++; } - created_at = curlx_timediff(ctx->started, current_tr->started); + created_at = curlx_timediff_ms(ctx->started, current_tr->started); if(ctx->stats->creations == 1) ctx->stats->first_created = created_at; ctx->stats->last_created = created_at; @@ -245,7 +245,7 @@ static void check_result(const struct test_case *tc, char msg[256]; timediff_t duration_ms; - duration_ms = curlx_timediff(tr->ended, tr->started); + duration_ms = curlx_timediff_ms(tr->ended, tr->started); curl_mfprintf(stderr, "%d: test case took %dms\n", tc->id, (int)duration_ms); if(tr->result != tc->exp_result @@ -267,7 +267,7 @@ static void check_result(const struct test_case *tc, fail(msg); } - duration_ms = curlx_timediff(tr->ended, tr->started); + duration_ms = curlx_timediff_ms(tr->ended, tr->started); if(duration_ms < tc->min_duration_ms) { curl_msprintf(msg, "%d: expected min duration of %dms, but took %dms", tc->id, (int)tc->min_duration_ms, (int)duration_ms); From cb2bcb681fc9044d2a7adaaa6210b61e2f7cff59 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 12 Nov 2025 15:58:49 +0100 Subject: [PATCH 364/885] lib: eliminate size_t casts Add new functions in `curlx/warnless.h` for controlled type conversions: * curlx_uitouz, convert unsigned into to size_t (should always work) * curlx_uztoso, convert size_t to curl_off_t, capping at CURL_OFF_T_MAX * curlx_sztouz, convert ssize_t to size_t, return TRUE when ok * curlx_sotouz_range, convert curl_off_t to size_t interval, capping values to interval bounds Remove some unnecesary casts, convert some internal recv functions to the "return result, have size_t* arg" pattern. Closes #19495 --- lib/cf-h1-proxy.c | 2 +- lib/cf-h2-proxy.c | 2 +- lib/curlx/warnless.c | 35 +++++++++++++++ lib/curlx/warnless.h | 12 ++++++ lib/dict.c | 4 +- lib/http.c | 8 ++-- lib/http2.c | 96 +++++++++++++++++++++-------------------- lib/multi.c | 13 +++--- lib/sendf.c | 25 ++--------- lib/setopt.c | 12 +++--- lib/transfer.c | 58 +++++++++++-------------- lib/vquic/curl_ngtcp2.c | 23 +++------- lib/ws.c | 36 ++++++++-------- 13 files changed, 170 insertions(+), 156 deletions(-) diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index be01891bf078..ac0dc596f2b7 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -268,7 +268,7 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf, DEBUGASSERT(blen >= nwritten); ts->nsent += nwritten; - Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)nwritten); + Curl_debug(data, CURLINFO_HEADER_OUT, buf, nwritten); out: if(result) diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index 148caca71b1a..d38bd4695254 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -847,7 +847,7 @@ static int tunnel_recv_callback(nghttp2_session *session, uint8_t flags, #endif } /* tunnel.recbuf has soft limit, any success MUST add all data */ - DEBUGASSERT((size_t)nwritten == len); + DEBUGASSERT(nwritten == len); return 0; } diff --git a/lib/curlx/warnless.c b/lib/curlx/warnless.c index bb636a93270f..a0aa5eda13b1 100644 --- a/lib/curlx/warnless.c +++ b/lib/curlx/warnless.c @@ -290,3 +290,38 @@ size_t curlx_sitouz(int sinum) # pragma warning(pop) #endif } + +size_t curlx_uitouz(unsigned int uinum) +{ + return (size_t)uinum; +} + +size_t curlx_sotouz_range(curl_off_t sonum, size_t uzmin, size_t uzmax) +{ + if(sonum < 0) + return uzmin; +#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T + if(sonum > SIZE_MAX) + return uzmax; +#endif + return CURLMIN(CURLMAX((size_t)sonum, uzmin), uzmax); +} + +bool curlx_sztouz(ssize_t sznum, size_t *puznum) +{ + if(sznum < 0) { + *puznum = 0; + return FALSE; + } + *puznum = (size_t)sznum; + return TRUE; +} + +curl_off_t curlx_uztoso(size_t uznum) +{ +#if SIZEOF_SIZE_T >= SIZEOF_CURL_OFF_T + if(uznum > (size_t)CURL_OFF_T_MAX) + return CURL_OFF_T_MAX; +#endif + return (curl_off_t)uznum; +} diff --git a/lib/curlx/warnless.h b/lib/curlx/warnless.h index 0a0c60807340..a128f71488a1 100644 --- a/lib/curlx/warnless.h +++ b/lib/curlx/warnless.h @@ -57,6 +57,18 @@ unsigned short curlx_uitous(unsigned int uinum); size_t curlx_sitouz(int sinum); +size_t curlx_uitouz(unsigned int uinum); + +/* Convert a curl_off_t to fit into size_t interval [uzmin, uzmax]. + * values outside this interval give the lower/upper bound. */ +size_t curlx_sotouz_range(curl_off_t sonum, size_t uzmin, size_t uzmax); + +/* Convert a size_t to curl_off_t, return CURL_OFF_T_MAX if too large. */ +curl_off_t curlx_uztoso(size_t uznum); + +/* Convert a ssize_t to size_t, return FALSE if negative and set 0 */ +bool curlx_sztouz(ssize_t sznum, size_t *puznum); + #ifdef _WIN32 #undef read #define read(fd, buf, count) (ssize_t)_read(fd, buf, curlx_uztoui(count)) diff --git a/lib/dict.c b/lib/dict.c index 3296a45466ad..5c7ba7f6229f 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -160,9 +160,9 @@ static CURLcode sendf(struct Curl_easy *data, const char *fmt, ...) if(result) break; - Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written); + Curl_debug(data, CURLINFO_DATA_OUT, sptr, bytes_written); - if((size_t)bytes_written != write_len) { + if(bytes_written != write_len) { /* if not all was written at once, we must advance the pointer, decrease the size left and try again! */ write_len -= bytes_written; diff --git a/lib/http.c b/lib/http.c index 0555291d0bba..f3444d46a91f 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2222,9 +2222,11 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq) result = Curl_creader_set_null(data); } else if(data->set.postfields) { - if(postsize > 0) - result = Curl_creader_set_buf(data, data->set.postfields, - (size_t)postsize); + size_t plen = curlx_sotouz_range(postsize, 0, SIZE_MAX); + if(plen == SIZE_MAX) + return CURLE_OUT_OF_MEMORY; + else if(plen) + result = Curl_creader_set_buf(data, data->set.postfields, plen); else result = Curl_creader_set_null(data); } diff --git a/lib/http2.c b/lib/http2.c index de1113c1e45f..5c8b0cab3886 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -45,6 +45,7 @@ #include "curlx/strparse.h" #include "transfer.h" #include "curlx/dynbuf.h" +#include "curlx/warnless.h" #include "headers.h" /* The last 3 #include files should be in this order */ @@ -539,10 +540,12 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, * in the H1 request and we upgrade from there. This stream * is opened implicitly as #1. */ uint8_t binsettings[H2_BINSETTINGS_LEN]; - ssize_t binlen; /* length of the binsettings data */ + ssize_t rclen; + size_t binlen; /* length of the binsettings data */ - binlen = populate_binsettings(binsettings, data); - if(binlen <= 0) { + rclen = populate_binsettings(binsettings, data); + + if(!curlx_sztouz(rclen, &binlen) || !binlen) { failf(data, "nghttp2 unexpectedly failed on pack_settings_payload"); result = CURLE_FAILED_INIT; goto out; @@ -554,7 +557,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, DEBUGASSERT(stream); stream->id = 1; /* queue SETTINGS frame (again) */ - rc = nghttp2_session_upgrade2(ctx->h2, binsettings, (size_t)binlen, + rc = nghttp2_session_upgrade2(ctx->h2, binsettings, binlen, data->state.httpreq == HTTPREQ_HEAD, NULL); if(rc) { @@ -627,16 +630,16 @@ static CURLcode h2_process_pending_input(struct Curl_cfilter *cf, { struct cf_h2_ctx *ctx = cf->ctx; const unsigned char *buf; - size_t blen; + size_t blen, nread; ssize_t rv; while(Curl_bufq_peek(&ctx->inbufq, &buf, &blen)) { rv = nghttp2_session_mem_recv(ctx->h2, (const uint8_t *)buf, blen); - if(rv < 0) { + if(!curlx_sztouz(rv, &nread)) { failf(data, "nghttp2 recv error %zd: %s", rv, nghttp2_strerror((int)rv)); return CURLE_HTTP2; } - Curl_bufq_skip(&ctx->inbufq, (size_t)rv); + Curl_bufq_skip(&ctx->inbufq, nread); if(Curl_bufq_is_empty(&ctx->inbufq)) { break; } @@ -1804,16 +1807,17 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req, size_t blen; struct SingleRequest *k = &data->req; uint8_t binsettings[H2_BINSETTINGS_LEN]; - ssize_t binlen; /* length of the binsettings data */ + ssize_t rc; + size_t binlen; /* length of the binsettings data */ - binlen = populate_binsettings(binsettings, data); - if(binlen <= 0) { + rc = populate_binsettings(binsettings, data); + if(!curlx_sztouz(rc, &binlen) || !binlen) { failf(data, "nghttp2 unexpectedly failed on pack_settings_payload"); curlx_dyn_free(req); return CURLE_FAILED_INIT; } - result = curlx_base64url_encode((const char *)binsettings, (size_t)binlen, + result = curlx_base64url_encode((const char *)binsettings, binlen, &base64, &blen); if(result) { curlx_dyn_free(req); @@ -2173,15 +2177,16 @@ static CURLcode cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } -static ssize_t cf_h2_body_send(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct h2_stream_ctx *stream, - const void *buf, size_t blen, bool eos, - CURLcode *err) +static CURLcode cf_h2_body_send(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h2_stream_ctx *stream, + const void *buf, size_t blen, bool eos, + size_t *pnwritten) { struct cf_h2_ctx *ctx = cf->ctx; - size_t nwritten; + CURLcode result; + *pnwritten = 0; if(stream->closed) { if(stream->resp_hds_complete) { /* Server decided to close the stream after having sent us a final @@ -2193,31 +2198,29 @@ static ssize_t cf_h2_body_send(struct Curl_cfilter *cf, "on closed stream with response", stream->id); if(eos) stream->body_eos = TRUE; - *err = CURLE_OK; - return (ssize_t)blen; + *pnwritten = blen; + return CURLE_OK; } /* Server closed before we got a response, this is an error */ infof(data, "stream %u closed", stream->id); - *err = CURLE_SEND_ERROR; - return -1; + return CURLE_SEND_ERROR; } - *err = Curl_bufq_write(&stream->sendbuf, buf, blen, &nwritten); - if(*err) - return -1; + result = Curl_bufq_write(&stream->sendbuf, buf, blen, pnwritten); + if(result) + return result; - if(eos && (blen == nwritten)) + if(eos && (blen == *pnwritten)) stream->body_eos = TRUE; if(eos || !Curl_bufq_is_empty(&stream->sendbuf)) { /* resume the potentially suspended stream */ int rv = nghttp2_session_resume_data(ctx->h2, stream->id); - if(nghttp2_is_fatal(rv)) { - *err = CURLE_SEND_ERROR; - return -1; - } + if(nghttp2_is_fatal(rv)) + return CURLE_SEND_ERROR; } - return (ssize_t)nwritten; + + return CURLE_OK; } static CURLcode h2_submit(struct h2_stream_ctx **pstream, @@ -2234,7 +2237,8 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, nghttp2_data_provider data_prd; int32_t stream_id; nghttp2_priority_spec pri_spec; - ssize_t nwritten; + ssize_t rc; + size_t nwritten; CURLcode result = CURLE_OK; *pnwritten = 0; @@ -2244,10 +2248,10 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, if(result) goto out; - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result); - if(nwritten < 0) + rc = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result); + if(!curlx_sztouz(rc, &nwritten)) goto out; - *pnwritten = (size_t)nwritten; + *pnwritten = nwritten; if(!stream->h1.done) { /* need more data */ goto out; @@ -2321,8 +2325,9 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, bodylen = len - *pnwritten; if(bodylen || eos) { - ssize_t n = cf_h2_body_send(cf, data, stream, body, bodylen, eos, &result); - if(n >= 0) + size_t n; + result = cf_h2_body_send(cf, data, stream, body, bodylen, eos, &n); + if(!result) *pnwritten += n; else if(result == CURLE_AGAIN) result = CURLE_OK; @@ -2347,7 +2352,6 @@ static CURLcode cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); struct cf_call_data save; - ssize_t nwritten; CURLcode result = CURLE_OK, r2; CF_DATA_SAVE(save, cf, data); @@ -2364,21 +2368,19 @@ static CURLcode cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, * being able to flush stream->sendbuf. Make a 0-length write * to trigger flushing again. * If this works, we report to have written `len` bytes. */ + size_t n; DEBUGASSERT(eos); - nwritten = cf_h2_body_send(cf, data, stream, buf, 0, eos, &result); - CURL_TRC_CF(data, cf, "[%d] cf_body_send last CHUNK -> %zd, %d, eos=%d", - stream->id, nwritten, result, eos); - if(nwritten < 0) { + result = cf_h2_body_send(cf, data, stream, buf, 0, eos, &n); + CURL_TRC_CF(data, cf, "[%d] cf_body_send last CHUNK -> %d, %zu, eos=%d", + stream->id, result, n, eos); + if(result) goto out; - } *pnwritten = len; } else { - nwritten = cf_h2_body_send(cf, data, stream, buf, len, eos, &result); - CURL_TRC_CF(data, cf, "[%d] cf_body_send(len=%zu) -> %zd, %d, eos=%d", - stream->id, len, nwritten, result, eos); - if(nwritten >= 0) - *pnwritten = (size_t)nwritten; + result = cf_h2_body_send(cf, data, stream, buf, len, eos, pnwritten); + CURL_TRC_CF(data, cf, "[%d] cf_body_send(len=%zu) -> %d, %zu, eos=%d", + stream->id, len, result, *pnwritten, eos); } /* Call the nghttp2 send loop and flush to write ALL buffered data, diff --git a/lib/multi.c b/lib/multi.c index 1e24ce8c4662..a47336457b80 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -3879,10 +3879,10 @@ CURLcode Curl_multi_xfer_buf_borrow(struct Curl_easy *data, } if(!data->multi->xfer_buf) { - data->multi->xfer_buf = malloc((size_t)data->set.buffer_size); + data->multi->xfer_buf = malloc(curlx_uitouz(data->set.buffer_size)); if(!data->multi->xfer_buf) { - failf(data, "could not allocate xfer_buf of %zu bytes", - (size_t)data->set.buffer_size); + failf(data, "could not allocate xfer_buf of %u bytes", + data->set.buffer_size); return CURLE_OUT_OF_MEMORY; } data->multi->xfer_buf_len = data->set.buffer_size; @@ -3932,10 +3932,11 @@ CURLcode Curl_multi_xfer_ulbuf_borrow(struct Curl_easy *data, } if(!data->multi->xfer_ulbuf) { - data->multi->xfer_ulbuf = malloc((size_t)data->set.upload_buffer_size); + data->multi->xfer_ulbuf = + malloc(curlx_uitouz(data->set.upload_buffer_size)); if(!data->multi->xfer_ulbuf) { - failf(data, "could not allocate xfer_ulbuf of %zu bytes", - (size_t)data->set.upload_buffer_size); + failf(data, "could not allocate xfer_ulbuf of %u bytes", + data->set.upload_buffer_size); return CURLE_OUT_OF_MEMORY; } data->multi->xfer_ulbuf_len = data->set.upload_buffer_size; diff --git a/lib/sendf.c b/lib/sendf.c index 980fae23e646..655444a29504 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -209,20 +209,7 @@ static size_t get_max_body_write_len(struct Curl_easy *data, curl_off_t limit) { if(limit != -1) { /* How much more are we allowed to write? */ - curl_off_t remain_diff; - remain_diff = limit - data->req.bytecount; - if(remain_diff < 0) { - /* already written too much! */ - return 0; - } -#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T - else if(remain_diff > SSIZE_MAX) { - return SIZE_MAX; - } -#endif - else { - return (size_t)remain_diff; - } + return curlx_sotouz_range(limit - data->req.bytecount, 0, SIZE_MAX); } return SIZE_MAX; } @@ -678,11 +665,7 @@ static CURLcode cr_in_read(struct Curl_easy *data, } /* respect length limitations */ if(ctx->total_len >= 0) { - curl_off_t remain = ctx->total_len - ctx->read_len; - if(remain <= 0) - blen = 0; - else if(remain < (curl_off_t)blen) - blen = (size_t)remain; + blen = curlx_sotouz_range(ctx->total_len - ctx->read_len, 0, blen); } nread = 0; if(ctx->read_cb && blen) { @@ -1363,9 +1346,9 @@ static CURLcode cr_buf_resume_from(struct Curl_easy *data, /* already started reading? */ if(ctx->index) return CURLE_READ_ERROR; - if(offset <= 0) + boffset = curlx_sotouz_range(offset, 0, SIZE_MAX); + if(!boffset) return CURLE_OK; - boffset = (size_t)offset; if(boffset > ctx->blen) return CURLE_READ_ERROR; diff --git a/lib/setopt.c b/lib/setopt.c index 9f43b1b60da0..338e94d1bbf4 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1689,22 +1689,20 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, if(!ptr || s->postfieldsize == -1) result = Curl_setstropt(&s->str[STRING_COPYPOSTFIELDS], ptr); else { + size_t pflen; + if(s->postfieldsize < 0) return CURLE_BAD_FUNCTION_ARGUMENT; -#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T - /* - * Check that requested length does not overflow the size_t type. - */ - else if(s->postfieldsize > SIZE_MAX) + pflen = curlx_sotouz_range(s->postfieldsize, 0, SIZE_MAX); + if(pflen == SIZE_MAX) return CURLE_OUT_OF_MEMORY; -#endif else { /* Allocate even when size == 0. This satisfies the need of possible later address compare to detect the COPYPOSTFIELDS mode, and to mark that postfields is used rather than read function or form data. */ - char *p = Curl_memdup0(ptr, (size_t)s->postfieldsize); + char *p = Curl_memdup0(ptr, pflen); if(!p) return CURLE_OUT_OF_MEMORY; else { diff --git a/lib/transfer.c b/lib/transfer.c index 6ae21e1a4030..4c17cbb50da0 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -82,6 +82,7 @@ #include "hsts.h" #include "setopt.h" #include "headers.h" +#include "curlx/warnless.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" @@ -189,53 +190,44 @@ CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done) * @param err error code in case of -1 return * @return number of bytes read or -1 for error */ -static ssize_t xfer_recv_resp(struct Curl_easy *data, - char *buf, size_t blen, - bool eos_reliable, - CURLcode *err) +static CURLcode xfer_recv_resp(struct Curl_easy *data, + char *buf, size_t blen, + bool eos_reliable, + size_t *pnread) { - size_t nread; + CURLcode result; DEBUGASSERT(blen > 0); + *pnread = 0; /* If we are reading BODY data and the connection does NOT handle EOF * and we know the size of the BODY data, limit the read amount */ if(!eos_reliable && !data->req.header && data->req.size != -1) { - curl_off_t totalleft = data->req.size - data->req.bytecount; - if(totalleft <= 0) - blen = 0; - else if(totalleft < (curl_off_t)blen) - blen = (size_t)totalleft; + blen = curlx_sotouz_range(data->req.size - data->req.bytecount, 0, blen); } else if(xfer_recv_shutdown_started(data)) { /* we already received everything. Do not try more. */ blen = 0; } - if(!blen) { - /* want nothing more */ - *err = CURLE_OK; - nread = 0; - } - else { - *err = Curl_xfer_recv(data, buf, blen, &nread); + if(blen) { + result = Curl_xfer_recv(data, buf, blen, pnread); + if(result) + return result; } - if(*err) - return -1; - if(nread == 0) { + if(*pnread == 0) { if(data->req.shutdown) { bool done; - *err = xfer_recv_shutdown(data, &done); - if(*err) - return -1; + result = xfer_recv_shutdown(data, &done); + if(result) + return result; if(!done) { - *err = CURLE_AGAIN; - return -1; + return CURLE_AGAIN; } } DEBUGF(infof(data, "sendrecv_dl: we are done")); } - return (ssize_t)nread; + return CURLE_OK; } /* @@ -264,7 +256,6 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, read or we get a CURLE_AGAIN */ do { size_t bytestoread; - ssize_t nread; if(!is_multiplex) { /* Multiplexed connection have inherent handling of EOF and we do not @@ -288,9 +279,9 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, } rcvd_eagain = FALSE; - nread = xfer_recv_resp(data, buf, bytestoread, is_multiplex, &result); - if(nread < 0) { - if(CURLE_AGAIN != result) + result = xfer_recv_resp(data, buf, bytestoread, is_multiplex, &blen); + if(result) { + if(result != CURLE_AGAIN) goto out; /* real error */ rcvd_eagain = TRUE; result = CURLE_OK; @@ -298,7 +289,7 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, !data->req.resp_trailer) { DEBUGF(infof(data, "EAGAIN, download done, no trailer announced, " "not waiting for EOS")); - nread = 0; + blen = 0; /* continue as if we received the EOS */ } else @@ -306,7 +297,6 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, } /* We only get a 0-length receive at the end of the response */ - blen = (size_t)nread; is_eos = (blen == 0); if(!blen && (conn->recv[FIRSTSOCKET] == Curl_cf_recv)) { @@ -899,8 +889,8 @@ CURLcode Curl_xfer_recv(struct Curl_easy *data, DEBUGASSERT(data->conn); DEBUGASSERT(data->set.buffer_size > 0); - if((size_t)data->set.buffer_size < blen) - blen = (size_t)data->set.buffer_size; + if(curlx_uitouz(data->set.buffer_size) < blen) + blen = curlx_uitouz(data->set.buffer_size); return Curl_conn_recv(data, data->conn->recv_idx, buf, blen, pnrcvd); } diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 1f70e0b480ab..475060ebdd34 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1320,32 +1320,25 @@ static CURLcode init_ngh3_conn(struct Curl_cfilter *cf, return CURLE_OK; } -static ssize_t recv_closed_stream(struct Curl_cfilter *cf, +static CURLcode recv_closed_stream(struct Curl_cfilter *cf, struct Curl_easy *data, struct h3_stream_ctx *stream, - CURLcode *err) + size_t *pnread) { - ssize_t nread = -1; - (void)cf; + *pnread = 0; if(stream->reset) { failf(data, "HTTP/3 stream %" FMT_PRId64 " reset by server", stream->id); - *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; - goto out; + return data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; } else if(!stream->resp_hds_complete) { failf(data, "HTTP/3 stream %" FMT_PRId64 " was closed cleanly, but before " "getting all response header fields, treated as error", stream->id); - *err = CURLE_HTTP3; - goto out; + return CURLE_HTTP3; } - *err = CURLE_OK; - nread = 0; - -out: - return nread; + return CURLE_OK; } /* incoming data frames on the h3 stream */ @@ -1393,9 +1386,7 @@ static CURLcode cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, goto out; } else if(stream->closed) { - ssize_t nread = recv_closed_stream(cf, data, stream, &result); - if(nread > 0) - *pnread = (size_t)nread; + result = recv_closed_stream(cf, data, stream, pnread); goto out; } result = CURLE_AGAIN; diff --git a/lib/ws.c b/lib/ws.c index ddf49c9d2d83..96a0d61378f0 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -41,6 +41,7 @@ #include "select.h" #include "curlx/nonblock.h" #include "curlx/strparse.h" +#include "curlx/warnless.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" @@ -489,12 +490,13 @@ static CURLcode ws_dec_pass_payload(struct ws_decoder *dec, size_t inlen; size_t nwritten; CURLcode result; - curl_off_t remain = dec->payload_len - dec->payload_offset; + size_t remain = curlx_sotouz_range(dec->payload_len - dec->payload_offset, + 0, SIZE_MAX); (void)data; while(remain && Curl_bufq_peek(inraw, &inbuf, &inlen)) { - if((curl_off_t)inlen > remain) - inlen = (size_t)remain; + if(inlen > remain) + inlen = remain; result = write_cb(inbuf, inlen, dec->frame_age, dec->frame_flags, dec->payload_offset, dec->payload_len, write_ctx, &nwritten); @@ -502,9 +504,10 @@ static CURLcode ws_dec_pass_payload(struct ws_decoder *dec, return result; Curl_bufq_skip(inraw, nwritten); dec->payload_offset += nwritten; - remain = dec->payload_len - dec->payload_offset; - CURL_TRC_WS(data, "passed %zu bytes payload, %" - FMT_OFF_T " remain", nwritten, remain); + remain = curlx_sotouz_range(dec->payload_len - dec->payload_offset, + 0, SIZE_MAX); + CURL_TRC_WS(data, "passed %zu bytes payload, %zu remain", + nwritten, remain); } return remain ? CURLE_AGAIN : CURLE_OK; @@ -651,16 +654,13 @@ static curl_off_t ws_payload_remain(curl_off_t payload_total, curl_off_t payload_offset, size_t payload_buffered) { - curl_off_t remain = payload_total - payload_offset; + curl_off_t buffered, remain = payload_total - payload_offset; if((payload_total < 0) || (payload_offset < 0) || (remain < 0)) return -1; -#if SIZEOF_SIZE_T >= SIZEOF_CURL_OFF_T - if(payload_buffered > (size_t)CURL_OFF_T_MAX) + buffered = curlx_uztoso(payload_buffered); + if(remain < buffered) return -1; -#endif - if(remain < (curl_off_t)payload_buffered) - return -1; - return remain - (curl_off_t)payload_buffered; + return remain - buffered; } static CURLcode ws_cw_dec_next(const unsigned char *buf, size_t buflen, @@ -947,7 +947,7 @@ static CURLcode ws_enc_write_payload(struct ws_encoder *enc, struct bufq *out, size_t *pnwritten) { CURLcode result; - size_t i, len, n; + size_t i, len, n, remain; *pnwritten = 0; if(Curl_bufq_is_full(out)) @@ -955,8 +955,9 @@ static CURLcode ws_enc_write_payload(struct ws_encoder *enc, /* not the most performant way to do this */ len = buflen; - if((curl_off_t)len > enc->payload_remain) - len = (size_t)enc->payload_remain; + remain = curlx_sotouz_range(enc->payload_remain, 0, SIZE_MAX); + if(remain < len) + len = remain; for(i = 0; i < len; ++i) { unsigned char c = buf[i] ^ enc->mask[enc->xori]; @@ -1167,8 +1168,7 @@ static CURLcode cr_ws_read(struct Curl_easy *data, if(ws->enc.payload_remain) { CURL_TRC_WS(data, "current frame, %" FMT_OFF_T " remaining", ws->enc.payload_remain); - if(ws->enc.payload_remain < (curl_off_t)blen) - blen = (size_t)ws->enc.payload_remain; + blen = curlx_sotouz_range(ws->enc.payload_remain, 0, blen); } result = Curl_creader_read(data, reader->next, buf, blen, &nread, &eos); From 833c429627ea3771d2fd027d85721bf9549342aa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 13:19:01 +0100 Subject: [PATCH 365/885] wolfssl: simplify wssl_send_earlydata Move out logic from a switch() expression and return error directly instead of using goto. This also removes the odd-looking two subsequent closing braces at the same indent level. Closes #19509 --- lib/vtls/wolfssl.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 34fc17d994ad..9d6b094ff11a 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1618,7 +1618,6 @@ static CURLcode wssl_send_earlydata(struct Curl_cfilter *cf, { struct ssl_connect_data *connssl = cf->ctx; struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; - CURLcode result = CURLE_OK; const unsigned char *buf; size_t blen; @@ -1633,23 +1632,17 @@ static CURLcode wssl_send_earlydata(struct Curl_cfilter *cf, blen, rc, nwritten); if(rc < 0) { int err = wolfSSL_get_error(wssl->ssl, rc); + char error_buffer[256]; switch(err) { case WOLFSSL_ERROR_NONE: /* just did not get anything */ case WOLFSSL_ERROR_WANT_READ: case WOLFSSL_ERROR_WANT_WRITE: - result = CURLE_AGAIN; - break; - default: { - char error_buffer[256]; - CURL_TRC_CF(data, cf, "SSL send early data, error: '%s'(%d)", - wssl_strerror((unsigned long)err, error_buffer, - sizeof(error_buffer)), - err); - result = CURLE_SEND_ERROR; - break; - } + return CURLE_AGAIN; } - goto out; + CURL_TRC_CF(data, cf, "SSL send early data, error: '%s'(%d)", + wssl_strerror((unsigned long)err, error_buffer, + sizeof(error_buffer)), err); + return CURLE_SEND_ERROR; } Curl_bufq_skip(&connssl->earlydata, (size_t)nwritten); @@ -1659,8 +1652,7 @@ static CURLcode wssl_send_earlydata(struct Curl_cfilter *cf, if(!Curl_ssl_cf_is_proxy(cf)) Curl_pgrsEarlyData(data, (curl_off_t)connssl->earlydata_skip); infof(data, "SSL sending %zu bytes of early data", connssl->earlydata_skip); -out: - return result; + return CURLE_OK; } #endif /* WOLFSSL_EARLY_DATA */ From bb1391f94394e635c1a5c58253e7a3d3b36bde57 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 12:46:59 +0100 Subject: [PATCH 366/885] tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` Closes #19510 --- tests/server/dnsd.c | 6 +++- tests/server/first.h | 1 - tests/server/mqttd.c | 31 ++++++++++++++------ tests/server/rtspd.c | 26 ++++++++++++++--- tests/server/sockfilt.c | 12 +++++--- tests/server/socksd.c | 64 +++++++++++++++++++++++++++-------------- tests/server/sws.c | 41 +++++++++++++++++--------- tests/server/tftpd.c | 16 +++++++++-- tests/server/util.c | 6 ---- 9 files changed, 141 insertions(+), 62 deletions(-) diff --git a/tests/server/dnsd.c b/tests/server/dnsd.c index 93edcb2397c6..c541b05295b2 100644 --- a/tests/server/dnsd.c +++ b/tests/server/dnsd.c @@ -399,6 +399,8 @@ static int test_dnsd(int argc, char **argv) serverlogslocked = 0; while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--verbose", argv[arg])) { arg++; /* nothing yet */ @@ -450,7 +452,9 @@ static int test_dnsd(int argc, char **argv) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - port = (unsigned short)atoi(argv[arg]); + opt = argv[arg]; + if(!curlx_str_number(&opt, &num, 0xffff)) + port = (unsigned short)num; arg++; } } diff --git a/tests/server/first.h b/tests/server/first.h index 8e69a2b976f6..3a7255ccb88f 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -128,7 +128,6 @@ extern int getpart(char **outbuf, size_t *outlen, extern char *data_to_hex(char *data, size_t len); extern void logmsg(const char *msg, ...); extern void loghex(unsigned char *buffer, ssize_t len); -extern unsigned char byteval(char *value); extern int win32_init(void); extern FILE *test2fopen(long testno, const char *logdir2); extern curl_off_t our_getpid(void); diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index acb427a37c0c..c99a0e8084e4 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -81,10 +81,15 @@ static void mqttd_getconfig(void) while(fgets(buffer, sizeof(buffer), fp)) { char key[32]; char value[32]; + const char *pval; + curl_off_t num; if(sscanf(buffer, "%31s %31s", key, value) == 2) { if(!strcmp(key, "version")) { - m_config.version = byteval(value); - logmsg("version [%d] set", m_config.version); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + m_config.version = (unsigned char)num; + logmsg("version [%d] set", m_config.version); + } } else if(!strcmp(key, "PUBLISH-before-SUBACK")) { logmsg("PUBLISH-before-SUBACK set"); @@ -95,12 +100,18 @@ static void mqttd_getconfig(void) m_config.short_publish = TRUE; } else if(!strcmp(key, "error-CONNACK")) { - m_config.error_connack = byteval(value); - logmsg("error-CONNACK = %d", m_config.error_connack); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + m_config.error_connack = (unsigned char)num; + logmsg("error-CONNACK = %d", m_config.error_connack); + } } else if(!strcmp(key, "Testnum")) { - m_config.testnum = atoi(value); - logmsg("testnum = %d", m_config.testnum); + pval = value; + if(!curlx_str_number(&pval, &num, INT_MAX)) { + m_config.testnum = (int)num; + logmsg("testnum = %d", m_config.testnum); + } } else if(!strcmp(key, "excessive-remaining")) { logmsg("excessive-remaining set"); @@ -734,6 +745,8 @@ static int test_mqttd(int argc, char *argv[]) server_port = 1883; /* MQTT default port */ while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--version", argv[arg])) { printf("mqttd IPv4%s\n", #ifdef USE_IPV6 @@ -787,13 +800,13 @@ static int test_mqttd(int argc, char *argv[]) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - int inum = atoi(argv[arg]); - if(inum && ((inum < 1025) || (inum > 65535))) { + opt = argv[arg]; + if(curlx_str_number(&opt, &num, 0xffff) || num < 1025) { fprintf(stderr, "mqttd: invalid --port argument (%s)\n", argv[arg]); return 0; } - server_port = (unsigned short)inum; + server_port = (unsigned short)num; arg++; } } diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index d13b8ff9a96b..c3d4678ae4ac 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -165,6 +165,8 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) &prot_major, &prot_minor) == 5) { char *ptr; + const char *pval; + curl_off_t testnum; if(!strcmp(prot_str, "HTTP")) { req->protocol = RPROT_HTTP; @@ -211,7 +213,14 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) while(*ptr && !ISDIGIT(*ptr)) ptr++; - req->testno = atol(ptr); + pval = ptr; + if(!curlx_str_number(&pval, &testnum, INT_MAX)) + req->testno = (long)testnum; + else { + req->protocol = RPROT_NONE; + logmsg("rtspd: failed to read the test number from '%s'", doc); + return 1; + } if(req->testno > 10000) { req->partno = req->testno % 10000; @@ -359,8 +368,13 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) /* if the host name starts with test, the port number used in the CONNECT line will be used as test number! */ char *portp = strchr(doc, ':'); - if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1))) - req->testno = atol(portp + 1); + if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1))) { + pval = portp + 1; + if(!curlx_str_number(&pval, &testnum, INT_MAX)) + req->testno = (long)testnum; + else + req->testno = DOCNUMBER_CONNECT; + } else req->testno = DOCNUMBER_CONNECT; } @@ -1006,6 +1020,8 @@ static int test_rtspd(int argc, char *argv[]) serverlogslocked = 0; while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--version", argv[arg])) { printf("rtspd IPv4%s" "\n" @@ -1055,7 +1071,9 @@ static int test_rtspd(int argc, char *argv[]) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - port = (unsigned short)atol(argv[arg]); + opt = argv[arg]; + if(!curlx_str_number(&opt, &num, 0xffff)) + port = (unsigned short)num; arg++; } } diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 48728bfd01a4..91ebb7c9a125 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -1240,6 +1240,8 @@ static int test_sockfilt(int argc, char *argv[]) server_port = 8999; while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--version", argv[arg])) { printf("sockfilt IPv4%s\n", #ifdef USE_IPV6 @@ -1291,7 +1293,9 @@ static int test_sockfilt(int argc, char *argv[]) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - server_port = (unsigned short)atol(argv[arg]); + opt = argv[arg]; + if(!curlx_str_number(&opt, &num, 0xffff)) + server_port = (unsigned short)num; arg++; } } @@ -1300,13 +1304,13 @@ static int test_sockfilt(int argc, char *argv[]) doing a passive server-style listening. */ arg++; if(argc > arg) { - int inum = atoi(argv[arg]); - if(inum && ((inum < 1025) || (inum > 65535))) { + opt = argv[arg]; + if(curlx_str_number(&opt, &num, 0xffff) || num < 1025) { fprintf(stderr, "sockfilt: invalid --connect argument (%s)\n", argv[arg]); return 0; } - server_connectport = (unsigned short)inum; + server_connectport = (unsigned short)num; arg++; } } diff --git a/tests/server/socksd.c b/tests/server/socksd.c index 1f2460ec2908..f14ee13ee4fd 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -106,12 +106,6 @@ static void socksd_resetdefaults(void) strcpy(s_config.password, "password"); } -static unsigned short shortval(char *value) -{ - unsigned long num = (unsigned long)atol(value); - return num & 0xffff; -} - static void socksd_getconfig(void) { FILE *fp = fopen(configfile, FOPEN_READTEXT); @@ -122,26 +116,40 @@ static void socksd_getconfig(void) while(fgets(buffer, sizeof(buffer), fp)) { char key[32]; char value[260]; + const char *pval; + curl_off_t num; if(sscanf(buffer, "%31s %259s", key, value) == 2) { if(!strcmp(key, "version")) { - s_config.version = byteval(value); - logmsg("version [%d] set", s_config.version); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + s_config.version = (unsigned char)num; + logmsg("version [%d] set", s_config.version); + } } else if(!strcmp(key, "nmethods_min")) { - s_config.nmethods_min = byteval(value); - logmsg("nmethods_min [%d] set", s_config.nmethods_min); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + s_config.nmethods_min = (unsigned char)num; + logmsg("nmethods_min [%d] set", s_config.nmethods_min); + } } else if(!strcmp(key, "nmethods_max")) { - s_config.nmethods_max = byteval(value); - logmsg("nmethods_max [%d] set", s_config.nmethods_max); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + s_config.nmethods_max = (unsigned char)num; + logmsg("nmethods_max [%d] set", s_config.nmethods_max); + } } else if(!strcmp(key, "backend")) { strcpy(s_config.addr, value); logmsg("backend [%s] set", s_config.addr); } else if(!strcmp(key, "backendport")) { - s_config.port = shortval(value); - logmsg("backendport [%d] set", s_config.port); + pval = value; + if(!curlx_str_number(&pval, &num, 0xffff)) { + s_config.port = (unsigned short)num; + logmsg("backendport [%d] set", s_config.port); + } } else if(!strcmp(key, "user")) { strcpy(s_config.user, value); @@ -157,12 +165,18 @@ static void socksd_getconfig(void) o X'02' USERNAME/PASSWORD */ else if(!strcmp(key, "method")) { - s_config.responsemethod = byteval(value); - logmsg("method [%d] set", s_config.responsemethod); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + s_config.responsemethod = (unsigned char)num; + logmsg("method [%d] set", s_config.responsemethod); + } } else if(!strcmp(key, "response")) { - s_config.connectrep = byteval(value); - logmsg("response [%d] set", s_config.connectrep); + pval = value; + if(!curlx_str_number(&pval, &num, 0xff)) { + s_config.connectrep = (unsigned char)num; + logmsg("response [%d] set", s_config.connectrep); + } } } } @@ -754,6 +768,8 @@ static int test_socksd(int argc, char *argv[]) server_port = 8905; while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--version", argv[arg])) { printf("socksd IPv4%s\n", #ifdef USE_IPV6 @@ -786,8 +802,12 @@ static int test_socksd(int argc, char *argv[]) } else if(!strcmp("--backendport", argv[arg])) { arg++; - if(argc > arg) - backendport = (unsigned short)atoi(argv[arg++]); + if(argc > arg) { + opt = argv[arg]; + if(!curlx_str_number(&opt, &num, 0xffff)) + backendport = (unsigned short)num; + arg++; + } } else if(!strcmp("--logfile", argv[arg])) { arg++; @@ -834,7 +854,9 @@ static int test_socksd(int argc, char *argv[]) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - server_port = (unsigned short)atol(argv[arg]); + opt = argv[arg]; + if(!curlx_str_number(&opt, &num, 0xffff)) + server_port = (unsigned short)num; arg++; } } diff --git a/tests/server/sws.c b/tests/server/sws.c index caa5605534e4..ab73ec336948 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -308,6 +308,8 @@ static int sws_ProcessRequest(struct sws_httprequest *req) int prot_major = 0; int prot_minor = 0; char *end = strstr(line, end_of_headers); + const char *pval; + curl_off_t num; req->callcount++; @@ -391,7 +393,9 @@ static int sws_ProcessRequest(struct sws_httprequest *req) ptr++; /* skip the slash */ - req->testno = atol(ptr); + pval = ptr; + if(!curlx_str_number(&pval, &num, INT_MAX)) + req->testno = (long)num; if(req->testno > 10000) { req->partno = req->testno % 10000; @@ -450,12 +454,12 @@ static int sws_ProcessRequest(struct sws_httprequest *req) portp = strchr(doc, ':'); if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1))) { - int inum = atoi(portp + 1); - if((inum <= 0) || (inum > 65535)) + pval = portp + 1; + if(curlx_str_number(&pval, &num, 0xffff) || + (num <= 0) || (num > 65535)) logmsg("Invalid CONNECT port received"); else - req->connect_port = (unsigned short)inum; - + req->connect_port = (unsigned short)num; } logmsg("Port number: %d, test case number: %ld", req->connect_port, req->testno); @@ -491,8 +495,13 @@ static int sws_ProcessRequest(struct sws_httprequest *req) /* check for a Testno: header with the test case number */ char *testno = strstr(line, "\nTestno: "); if(testno) { - req->testno = atol(&testno[9]); - logmsg("Found test number %ld in Testno: header!", req->testno); + pval = &testno[9]; + if(!curlx_str_number(&pval, &num, INT_MAX)) { + req->testno = (long)num; + logmsg("Found test number %ld in Testno: header!", req->testno); + } + else + logmsg("No Testno: number"); } else { logmsg("No Testno: header"); @@ -517,7 +526,9 @@ static int sws_ProcessRequest(struct sws_httprequest *req) while(*ptr && !ISDIGIT(*ptr)) ptr++; - req->testno = atol(ptr); + pval = ptr; + if(!curlx_str_number(&pval, &num, INT_MAX)) + req->testno = (long)num; if(req->testno > 10000) { req->partno = req->testno % 10000; @@ -2005,6 +2016,8 @@ static int test_sws(int argc, char *argv[]) serverlogslocked = 0; while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--version", argv[arg])) { puts("sws IPv4" #ifdef USE_IPV6 @@ -2082,13 +2095,13 @@ static int test_sws(int argc, char *argv[]) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - int inum = atoi(argv[arg]); - if(inum && ((inum < 1025) || (inum > 65535))) { + opt = argv[arg]; + if(curlx_str_number(&opt, &num, 0xffff) || num < 1025) { fprintf(stderr, "sws: invalid --port argument (%s)\n", argv[arg]); return 0; } - port = (unsigned short)inum; + port = (unsigned short)num; arg++; } } @@ -2102,13 +2115,13 @@ static int test_sws(int argc, char *argv[]) else if(!strcmp("--keepalive", argv[arg])) { arg++; if(argc > arg) { - int inum = atoi(argv[arg]); - if(inum && (inum > 65535)) { + opt = argv[arg]; + if(curlx_str_number(&opt, &num, 0xffff)) { fprintf(stderr, "sws: invalid --keepalive argument (%s), must " "be number of seconds\n", argv[arg]); return 0; } - keepalive_secs = (unsigned short)inum; + keepalive_secs = (unsigned short)num; arg++; } } diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 31ae5c8a3943..819f06bf2d32 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -561,6 +561,8 @@ static int test_tftpd(int argc, char **argv) serverlogslocked = 0; while(argc > arg) { + const char *opt; + curl_off_t num; if(!strcmp("--version", argv[arg])) { printf("tftpd IPv4%s\n", #ifdef USE_IPV6 @@ -608,7 +610,9 @@ static int test_tftpd(int argc, char **argv) else if(!strcmp("--port", argv[arg])) { arg++; if(argc > arg) { - port = (unsigned short)atol(argv[arg]); + opt = argv[arg]; + if(!curlx_str_number(&opt, &num, 0xffff)) + port = (unsigned short)num; arg++; } } @@ -1095,6 +1099,8 @@ static int validate_access(struct testcase *test, char partbuf[80]="data"; long partno; long testno; + const char *pval; + curl_off_t num; FILE *stream; ptr++; /* skip the slash */ @@ -1104,7 +1110,13 @@ static int validate_access(struct testcase *test, ptr++; /* get the number */ - testno = atol(ptr); + pval = ptr; + if(!curlx_str_number(&pval, &num, INT_MAX)) + testno = (long)num; + else { + logmsg("tftpd: failed to read the test number from '%s'", filename); + return TFTP_EACCESS; + } if(testno > 10000) { partno = testno % 10000; diff --git a/tests/server/util.c b/tests/server/util.c index 0e34f4ab21a8..6de8000327bd 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -132,12 +132,6 @@ void logmsg(const char *msg, ...) } } -unsigned char byteval(char *value) -{ - unsigned int num = (unsigned int)atoi(value); - return num & 0xff; -} - #ifdef _WIN32 /* use instead of perror() on generic Windows */ static void win32_perror(const char *msg) From 6384e2aca0045e72d7d81c9fbdca1d284ed704b6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Nov 2025 23:37:06 +0100 Subject: [PATCH 367/885] checksrc: disallow `atoi` and `atol` globally No longer used in core and test code. Also: allowlist in docs/examples. Closes #19508 --- docs/examples/.checksrc | 2 ++ scripts/checksrc.pl | 2 ++ src/.checksrc | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/examples/.checksrc b/docs/examples/.checksrc index e35dccc7261d..c47627467ff3 100644 --- a/docs/examples/.checksrc +++ b/docs/examples/.checksrc @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: curl +allowfunc atoi +allowfunc atol allowfunc fclose allowfunc fdopen allowfunc fopen diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 5dcad3e31526..caf60e1c4dbd 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -72,6 +72,8 @@ "strtok_r" => 1, "strtol" => 1, "strtoul" => 1, + "atoi" => 1, + "atol" => 1, "_mbscat" => 1, "_mbsncat" => 1, "_tcscat" => 1, diff --git a/src/.checksrc b/src/.checksrc index 37b81cfe2ff4..bc97c06028da 100644 --- a/src/.checksrc +++ b/src/.checksrc @@ -3,4 +3,3 @@ # SPDX-License-Identifier: curl enable STDERR -banfunc atoi From f2a75a14dd95e06cf9121c7d3bd5dc559748f350 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 16:39:10 +0100 Subject: [PATCH 368/885] sws: repair --port, and accept any port Also for mqttd and sockfilt. The < 1025 check was not serving any purpose. Follow-up to bb1391f94394e635c1a5c58253e7a3d3b36bde57 --- tests/server/mqttd.c | 2 +- tests/server/sockfilt.c | 2 +- tests/server/sws.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index c99a0e8084e4..df5fb3690337 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -801,7 +801,7 @@ static int test_mqttd(int argc, char *argv[]) arg++; if(argc > arg) { opt = argv[arg]; - if(curlx_str_number(&opt, &num, 0xffff) || num < 1025) { + if(curlx_str_number(&opt, &num, 0xffff)) { fprintf(stderr, "mqttd: invalid --port argument (%s)\n", argv[arg]); return 0; diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 91ebb7c9a125..7320fa6fe9a2 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -1305,7 +1305,7 @@ static int test_sockfilt(int argc, char *argv[]) arg++; if(argc > arg) { opt = argv[arg]; - if(curlx_str_number(&opt, &num, 0xffff) || num < 1025) { + if(curlx_str_number(&opt, &num, 0xffff)) { fprintf(stderr, "sockfilt: invalid --connect argument (%s)\n", argv[arg]); return 0; diff --git a/tests/server/sws.c b/tests/server/sws.c index ab73ec336948..29e69d893ba2 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -2096,7 +2096,7 @@ static int test_sws(int argc, char *argv[]) arg++; if(argc > arg) { opt = argv[arg]; - if(curlx_str_number(&opt, &num, 0xffff) || num < 1025) { + if(curlx_str_number(&opt, &num, 0xffff)) { fprintf(stderr, "sws: invalid --port argument (%s)\n", argv[arg]); return 0; From 75955c0851cba958aa0f3137312ecb2a06f282a2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 16:26:24 +0100 Subject: [PATCH 369/885] tool_operate: exit on curl_share_setopt errors Continuing when one of these has failed is fragile and error-prone. Closes #19513 --- src/tool_operate.c | 103 +++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 41 deletions(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 2c85839d17b8..9aee520f0619 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2200,6 +2200,36 @@ static CURLcode run_all_transfers(CURLSH *share, return result; } +static CURLcode share_setopt(CURLSH *share, int opt) +{ + CURLSHcode shres = curl_share_setopt(share, CURLSHOPT_SHARE, opt); + if(!shres || (shres == CURLSHE_NOT_BUILT_IN)) + return CURLE_OK; + return CURLE_FAILED_INIT; +} + +static CURLcode share_setup(CURLSH *share) +{ + CURLcode result = CURLE_OK; + int i; + static int options[7] = { + CURL_LOCK_DATA_COOKIE, + CURL_LOCK_DATA_DNS, + CURL_LOCK_DATA_SSL_SESSION, + CURL_LOCK_DATA_PSL, + CURL_LOCK_DATA_HSTS, + 0, /* 5 might be set below */ + 0 + }; + /* Running parallel, use the multi connection cache */ + if(!global->parallel) + options[5] = CURL_LOCK_DATA_CONNECT; + for(i = 0; !result && options[i]; i++) + result = share_setopt(share, options[i]); + return result; +} + + CURLcode operate(int argc, argv_item_t argv[]) { CURLcode result = CURLE_OK; @@ -2286,52 +2316,43 @@ CURLcode operate(int argc, argv_item_t argv[]) result = CURLE_OUT_OF_MEMORY; } + if(!result) + result = share_setup(share); + + if(!result && global->ssl_sessions && feature_ssls_export) + result = tool_ssls_load(global->first, share, + global->ssl_sessions); + if(!result) { - curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); - curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); - curl_share_setopt(share, CURLSHOPT_SHARE, - CURL_LOCK_DATA_SSL_SESSION); - /* Running parallel, use the multi connection cache */ - if(!global->parallel) - curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); - curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_PSL); - curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_HSTS); - - if(global->ssl_sessions && feature_ssls_export) - result = tool_ssls_load(global->first, share, - global->ssl_sessions); - - if(!result) { - /* Get the required arguments for each operation */ - do { - result = get_args(operation, count++); - - operation = operation->next; - } while(!result && operation); - - /* Set the current operation pointer */ - global->current = global->first; - - /* now run! */ - result = run_all_transfers(share, result); - - if(global->ssl_sessions && feature_ssls_export) { - CURLcode r2 = tool_ssls_save(global->first, share, - global->ssl_sessions); - if(r2 && !result) - result = r2; - } - } + /* Get the required arguments for each operation */ + do { + result = get_args(operation, count++); - curl_share_cleanup(share); - if(global->libcurl) { - /* Cleanup the libcurl source output */ - easysrc_cleanup(); + operation = operation->next; + } while(!result && operation); - /* Dump the libcurl code if previously enabled */ - dumpeasysrc(); + /* Set the current operation pointer */ + global->current = global->first; + + /* now run! */ + result = run_all_transfers(share, result); + + if(global->ssl_sessions && feature_ssls_export) { + CURLcode r2 = tool_ssls_save(global->first, share, + global->ssl_sessions); + if(r2 && !result) + result = r2; } } + + curl_share_cleanup(share); + if(global->libcurl) { + /* Cleanup the libcurl source output */ + easysrc_cleanup(); + + /* Dump the libcurl code if previously enabled */ + dumpeasysrc(); + } } else errorf("out of memory"); From 0afb52a0cd2abfb2d6b9ac8400db36be8a7a49b2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 13:50:49 +0100 Subject: [PATCH 370/885] code: minor indent fixes before closing braces Closes #19512 --- docs/examples/ghiper.c | 29 ++++++++--- lib/http2.c | 2 +- lib/if2ip.h | 18 +++---- lib/strcase.c | 62 ++++++++++++----------- lib/vtls/gtls.c | 2 +- lib/vtls/mbedtls.c | 5 +- lib/vtls/wolfssl.c | 10 ++-- packages/OS400/ccsidcurl.c | 38 +++++++------- packages/OS400/curlmain.c | 2 +- src/tool_formparse.c | 2 +- src/tool_getparam.c | 18 +++---- src/tool_getpass.c | 15 +++--- tests/unit/unit1603.c | 2 +- tests/unit/unit1651.c | 3 +- tests/unit/unit1656.c | 54 ++++++++++---------- tests/unit/unit1660.c | 100 ++++++++++++++++++------------------- 16 files changed, 188 insertions(+), 174 deletions(-) diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index 61771c7ad7bb..45c129faea09 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -101,14 +101,27 @@ static void mcode_or_die(const char *where, CURLMcode code) if(CURLM_OK != code) { const char *s; switch(code) { - case CURLM_BAD_HANDLE: s = "CURLM_BAD_HANDLE"; break; - case CURLM_BAD_EASY_HANDLE: s = "CURLM_BAD_EASY_HANDLE"; break; - case CURLM_OUT_OF_MEMORY: s = "CURLM_OUT_OF_MEMORY"; break; - case CURLM_INTERNAL_ERROR: s = "CURLM_INTERNAL_ERROR"; break; - case CURLM_BAD_SOCKET: s = "CURLM_BAD_SOCKET"; break; - case CURLM_UNKNOWN_OPTION: s = "CURLM_UNKNOWN_OPTION"; break; - case CURLM_LAST: s = "CURLM_LAST"; break; - default: s = "CURLM_unknown"; + case CURLM_BAD_HANDLE: + s = "CURLM_BAD_HANDLE"; + break; + case CURLM_BAD_EASY_HANDLE: + s = "CURLM_BAD_EASY_HANDLE"; + break; + case CURLM_OUT_OF_MEMORY: + s = "CURLM_OUT_OF_MEMORY"; + break; + case CURLM_INTERNAL_ERROR: + s = "CURLM_INTERNAL_ERROR"; + break; + case CURLM_BAD_SOCKET: + s = "CURLM_BAD_SOCKET"; + break; + case CURLM_UNKNOWN_OPTION: + s = "CURLM_UNKNOWN_OPTION"; + break; + default: + s = "CURLM_unknown"; + break; } MSG_OUT("ERROR: %s returns %s\n", where, s); exit(code); diff --git a/lib/http2.c b/lib/http2.c index 5c8b0cab3886..68446d5177af 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -716,7 +716,7 @@ static CURLcode http2_send_ping(struct Curl_cfilter *cf, if(rc) { failf(data, "nghttp2_submit_ping() failed: %s(%d)", nghttp2_strerror(rc), rc); - return CURLE_HTTP2; + return CURLE_HTTP2; } rc = nghttp2_session_send(ctx->h2); diff --git a/lib/if2ip.h b/lib/if2ip.h index b33e41aebd0b..42ec7b033a8c 100644 --- a/lib/if2ip.h +++ b/lib/if2ip.h @@ -62,15 +62,15 @@ struct ifreq { char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ } ifr_ifrn; - union { - struct sockaddr ifru_addr; - struct sockaddr ifru_broadaddr; - struct sockaddr ifru_netmask; - struct sockaddr ifru_hwaddr; - short ifru_flags; - int ifru_metric; - int ifru_mtu; - } ifr_ifru; + union { + struct sockaddr ifru_addr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short ifru_flags; + int ifru_metric; + int ifru_mtu; + } ifr_ifru; }; /* This define exists to avoid an extra #ifdef INTERIX in the C code. */ diff --git a/lib/strcase.c b/lib/strcase.c index ee5b9072c4cc..78d4dc5b3d93 100644 --- a/lib/strcase.c +++ b/lib/strcase.c @@ -30,40 +30,42 @@ /* Mapping table to go from lowercase to uppercase for plain ASCII.*/ static const unsigned char touppermap[256] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, -41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65, -66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, -85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, -134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, -150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, -166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, -182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, -198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, -214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, -230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255 }; /* Mapping table to go from uppercase to lowercase for plain ASCII.*/ static const unsigned char tolowermap[256] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, -42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, -111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, -96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, -128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, -144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, -160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, -176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, -192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, -208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, -224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, -240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index a692ce31c729..4ac6bad0163d 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -346,7 +346,7 @@ gnutls_set_ssl_version_min_max(struct Curl_easy *data, if(ssl_version_max < CURL_SSLVERSION_MAX_TLSv1_3) { failf(data, "QUIC needs at least TLS version 1.3"); return CURLE_SSL_CONNECT_ERROR; - } + } *prioritylist = QUIC_PRIORITY; return CURLE_OK; } diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index f5302499bdd7..9a307499595a 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -1350,6 +1350,7 @@ static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(nread > 0) *pnread = (size_t)nread; else { + char errorbuf[128]; CURL_TRC_CF(data, cf, "mbedtls_ssl_read(len=%zu) -> -0x%04X", buffersize, -nread); switch(nread) { @@ -1369,14 +1370,12 @@ static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data, case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY: result = CURLE_OK; break; - default: { - char errorbuf[128]; + default: mbedtls_strerror(nread, errorbuf, sizeof(errorbuf)); failf(data, "ssl_read returned: (-0x%04X) %s", -nread, errorbuf); result = CURLE_RECV_ERROR; break; } - } } return result; } diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 9d6b094ff11a..a7883fe08a2f 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -868,9 +868,9 @@ CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf, } } else { - /* We never share the CTX's store, use it. */ - WOLFSSL_X509_STORE *store = wolfSSL_CTX_get_cert_store(wssl->ssl_ctx); - result = wssl_populate_x509_store(cf, data, store, wssl); + /* We never share the CTX's store, use it. */ + WOLFSSL_X509_STORE *store = wolfSSL_CTX_get_cert_store(wssl->ssl_ctx); + result = wssl_populate_x509_store(cf, data, store, wssl); } return result; @@ -1389,8 +1389,8 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, } } else { - trying_ech_now = 1; - infof(data, "ECH: ECHConfig from command line"); + trying_ech_now = 1; + infof(data, "ECH: ECHConfig from command line"); } } else { diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index 76b182cf1724..b176def67d18 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -296,7 +296,7 @@ curl_easy_escape_ccsid(CURL *handle, const char *string, int length, /* !checksrc! disable ERRNOVAR 1 */ errno = EINVAL; return (char *) NULL; - } + } s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL); @@ -327,7 +327,7 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, /* !checksrc! disable ERRNOVAR 1 */ errno = EINVAL; return (char *) NULL; - } + } s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL); @@ -728,7 +728,7 @@ Curl_formadd_convert(struct curl_forms *forms, if(l < 0) { free(cp); return -1; - } + } cp2 = realloc(cp, l); /* Shorten buffer to the string size. */ @@ -810,10 +810,10 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!tforms) { result = CURL_FORMADD_MEMORY; break; - } + } lforms = tforms; - } + } /* Get next option. */ @@ -823,7 +823,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, option = forms->option; value = forms->value; forms++; - } + } else { /* Get option from arguments. */ @@ -845,7 +845,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!forms) { forms = va_arg(arg, struct curl_forms *); continue; - } + } result = CURL_FORMADD_ILLEGAL_ARRAY; break; @@ -862,11 +862,11 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!forms) { value = va_arg(arg, char *); nameccsid = (unsigned int) va_arg(arg, long); - } + } else { nameccsid = (unsigned int) forms->value; forms++; - } + } break; @@ -879,11 +879,11 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!forms) { value = va_arg(arg, char *); contentccsid = (unsigned int) va_arg(arg, long); - } + } else { contentccsid = (unsigned int) forms->value; forms++; - } + } break; @@ -942,7 +942,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(Curl_formadd_convert(lforms, contentx, lengthx, contentccsid) < 0) { result = CURL_FORMADD_MEMORY; break; - } + } contentx = -1; lengthx = -1; @@ -954,16 +954,16 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!Curl_is_formadd_string(option)) { result = CURL_FORMADD_UNKNOWN_OPTION; break; - } + } if(!forms) { value = va_arg(arg, char *); ccsid = (unsigned int) va_arg(arg, long); - } + } else { ccsid = (unsigned int) forms->value; forms++; - } + } /* Do the conversion. */ @@ -972,17 +972,17 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(Curl_formadd_convert(lforms, nargs, -1, ccsid) < 0) { result = CURL_FORMADD_MEMORY; break; - } + } value = lforms[nargs].value; - } + } if(result != CURL_FORMADD_OK) break; lforms[nargs].value = value; lforms[nargs++].option = option; - } + } va_end(arg); @@ -1047,7 +1047,7 @@ Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len) if(l < 0) { free(b); return (size_t) -1; - } + } ret = (*p->append)(p->arg, b, l); free(b); diff --git a/packages/OS400/curlmain.c b/packages/OS400/curlmain.c index 079b9b0d9dcd..19328f7c8446 100644 --- a/packages/OS400/curlmain.c +++ b/packages/OS400/curlmain.c @@ -85,7 +85,7 @@ int main(int argc, char **argv) /* Reset the shift state. */ iconv(cd, NULL, &inbytesleft, &outbuf, &outbytesleft); - } + } /* Allocate memory for the ASCII arguments and vector. */ argv = (char **) malloc((argc + 1) * sizeof(*argv) + bytecount); diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 004ad6ff4c70..1d127a584286 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -116,7 +116,7 @@ static struct tool_mime *tool_mime_new_filedata(struct tool_mime *parent, m->data = filedup; if(!isremotefile) m->kind = TOOLMIME_FILEDATA; - *errcode = CURLE_OK; + *errcode = CURLE_OK; } } } diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 8d5d89a75261..b74b73806d2c 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1654,15 +1654,15 @@ static ParameterError parse_upload_flags(struct OperationConfig *config, } } - if(!map->name) { - err = PARAM_OPTION_UNKNOWN; - break; - } - - if(next) - /* move over the comma */ - next++; - flag = next; + if(!map->name) { + err = PARAM_OPTION_UNKNOWN; + break; + } + + if(next) + /* move over the comma */ + next++; + flag = next; } return err; diff --git a/src/tool_getpass.c b/src/tool_getpass.c index a92fb7594c78..a4dea347efe0 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -60,15 +60,12 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) long sts; short chan; - /* MSK, 23-JAN-2004, iosbdef.h was not in VAX V7.2 or CC 6.4 */ - /* distribution so I created this. May revert back later to */ - /* struct _iosb iosb; */ - struct _iosb - { - short int iosb$w_status; /* status */ - short int iosb$w_bcnt; /* byte count */ - int unused; /* unused */ - } iosb; + /* iosbdef.h was not in VAX V7.2 or CC 6.4 */ + struct _isb { + short int iosb$w_status; /* status */ + short int iosb$w_bcnt; /* byte count */ + int unused; /* unused */ + } iosb; $DESCRIPTOR(ttdesc, "TT"); diff --git a/tests/unit/unit1603.c b/tests/unit/unit1603.c index d59b458d5793..b4ec152936ee 100644 --- a/tests/unit/unit1603.c +++ b/tests/unit/unit1603.c @@ -32,7 +32,7 @@ static const size_t slots = 3; static void t1603_mydtor(void *p) { /* Data are statically allocated */ - (void)p; + (void)p; } static size_t elem_dtor_calls; diff --git a/tests/unit/unit1651.c b/tests/unit/unit1651.c index 5ebce7aabdad..a038caacbd7f 100644 --- a/tests/unit/unit1651.c +++ b/tests/unit/unit1651.c @@ -32,7 +32,8 @@ static CURLcode test_unit1651(const char *arg) #if defined(USE_GNUTLS) || defined(USE_SCHANNEL) /* cert captured from gdb when connecting to curl.se on October 26 - 2018 */ + 2018. + !checksrc! disable CLOSEBRACE 1 */ static unsigned char cert[] = { 0x30, 0x82, 0x0F, 0x5B, 0x30, 0x82, 0x0E, 0x43, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x0C, 0x08, 0x77, 0x99, 0x2C, 0x6B, 0x67, 0xE1, 0x18, 0xD6, 0x66, 0x66, diff --git a/tests/unit/unit1656.c b/tests/unit/unit1656.c index 520a430fe930..98e25b7c22a1 100644 --- a/tests/unit/unit1656.c +++ b/tests/unit/unit1656.c @@ -61,32 +61,34 @@ static CURLcode test_unit1656(const char *arg) UNITTEST_BEGIN_SIMPLE static const struct test_spec test_specs[] = { - { "190321134340", "1903-21-13 43:40:00", CURLE_OK }, - { "", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, - { "WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, - { "0WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, - { "19032113434", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, - { "19032113434WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, - { "190321134340.", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, - { "190321134340.1", "1903-21-13 43:40:00.1", CURLE_OK }, - { "19032113434017.0", "1903-21-13 43:40:17", CURLE_OK }, - { "19032113434017.01", "1903-21-13 43:40:17.01", CURLE_OK }, - { "19032113434003.001", "1903-21-13 43:40:03.001", CURLE_OK }, - { "19032113434003.090", "1903-21-13 43:40:03.09", CURLE_OK }, - { "190321134340Z", "1903-21-13 43:40:00 GMT", CURLE_OK }, - { "19032113434017.0Z", "1903-21-13 43:40:17 GMT", CURLE_OK }, - { "19032113434017.01Z", "1903-21-13 43:40:17.01 GMT", CURLE_OK }, - { "19032113434003.001Z", "1903-21-13 43:40:03.001 GMT", CURLE_OK }, - { "19032113434003.090Z", "1903-21-13 43:40:03.09 GMT", CURLE_OK }, - { "190321134340CET", "1903-21-13 43:40:00 CET", CURLE_OK }, - { "19032113434017.0CET", "1903-21-13 43:40:17 CET", CURLE_OK }, - { "19032113434017.01CET", "1903-21-13 43:40:17.01 CET", CURLE_OK }, - { "190321134340+02:30", "1903-21-13 43:40:00 UTC+02:30", CURLE_OK }, - { "19032113434017.0+02:30", "1903-21-13 43:40:17 UTC+02:30", CURLE_OK }, - { "19032113434017.01+02:30", "1903-21-13 43:40:17.01 UTC+02:30", CURLE_OK }, - { "190321134340-3", "1903-21-13 43:40:00 UTC-3", CURLE_OK }, - { "19032113434017.0-04", "1903-21-13 43:40:17 UTC-04", CURLE_OK }, - { "19032113434017.01-01:10", "1903-21-13 43:40:17.01 UTC-01:10", CURLE_OK }, + { "190321134340", "1903-21-13 43:40:00", CURLE_OK }, + { "", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, + { "WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, + { "0WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, + { "19032113434", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, + { "19032113434WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, + { "190321134340.", NULL, CURLE_BAD_FUNCTION_ARGUMENT }, + { "190321134340.1", "1903-21-13 43:40:00.1", CURLE_OK }, + { "19032113434017.0", "1903-21-13 43:40:17", CURLE_OK }, + { "19032113434017.01", "1903-21-13 43:40:17.01", CURLE_OK }, + { "19032113434003.001", "1903-21-13 43:40:03.001", CURLE_OK }, + { "19032113434003.090", "1903-21-13 43:40:03.09", CURLE_OK }, + { "190321134340Z", "1903-21-13 43:40:00 GMT", CURLE_OK }, + { "19032113434017.0Z", "1903-21-13 43:40:17 GMT", CURLE_OK }, + { "19032113434017.01Z", "1903-21-13 43:40:17.01 GMT", CURLE_OK }, + { "19032113434003.001Z", "1903-21-13 43:40:03.001 GMT", CURLE_OK }, + { "19032113434003.090Z", "1903-21-13 43:40:03.09 GMT", CURLE_OK }, + { "190321134340CET", "1903-21-13 43:40:00 CET", CURLE_OK }, + { "19032113434017.0CET", "1903-21-13 43:40:17 CET", CURLE_OK }, + { "19032113434017.01CET", "1903-21-13 43:40:17.01 CET", CURLE_OK }, + { "190321134340+02:30", "1903-21-13 43:40:00 UTC+02:30", CURLE_OK }, + { "19032113434017.0+02:30", "1903-21-13 43:40:17 UTC+02:30", CURLE_OK }, + { "19032113434017.01+02:30", "1903-21-13 43:40:17.01 UTC+02:30", + CURLE_OK }, + { "190321134340-3", "1903-21-13 43:40:00 UTC-3", CURLE_OK }, + { "19032113434017.0-04", "1903-21-13 43:40:17 UTC-04", CURLE_OK }, + { "19032113434017.01-01:10", "1903-21-13 43:40:17.01 UTC-01:10", + CURLE_OK }, }; size_t i; diff --git a/tests/unit/unit1660.c b/tests/unit/unit1660.c index e74285d74ec4..cbb78202150d 100644 --- a/tests/unit/unit1660.c +++ b/tests/unit/unit1660.c @@ -58,56 +58,56 @@ static CURLcode test_unit1660(const char *arg) }; static const struct testit headers[] = { - /* two entries read from disk cache, verify first */ - { "-", "readfrom.example", NULL, CURLE_OK}, - { "-", "old.example", NULL, CURLE_OK}, - /* delete the remaining one read from disk */ - { "readfrom.example", NULL, "max-age=\"0\"", CURLE_OK}, - - { "example.com", NULL, "max-age=\"31536000\"\r\n", CURLE_OK }, - { "example.com", NULL, "max-age=\"21536000\"\r\n", CURLE_OK }, - { "example.com", NULL, "max-age=\"21536000\"; \r\n", CURLE_OK }, - { "example.com", NULL, "max-age=\"21536000\"; includeSubDomains\r\n", - CURLE_OK }, - { "example.org", NULL, "max-age=\"31536000\"\r\n", CURLE_OK }, - { "this.example", NULL, "max=\"31536\";", CURLE_BAD_FUNCTION_ARGUMENT }, - { "this.example", NULL, "max-age=\"31536", CURLE_BAD_FUNCTION_ARGUMENT }, - { "this.example", NULL, "max-age=31536\"", CURLE_OK }, - /* max-age=0 removes the entry */ - { "this.example", NULL, "max-age=0", CURLE_OK }, - { "another.example", NULL, "includeSubDomains; ", - CURLE_BAD_FUNCTION_ARGUMENT }, - - /* Two max-age is illegal */ - { "example.com", NULL, - "max-age=\"21536000\"; includeSubDomains; max-age=\"3\";", - CURLE_BAD_FUNCTION_ARGUMENT }, - /* Two includeSubDomains is illegal */ - { "2.example.com", NULL, - "max-age=\"21536000\"; includeSubDomains; includeSubDomains;", - CURLE_BAD_FUNCTION_ARGUMENT }, - /* use an unknown directive "include" that should be ignored */ - { "3.example.com", NULL, "max-age=\"21536000\"; include; includeSubDomains;", - CURLE_OK }, - /* remove the "3.example.com" one, should still match the example.com */ - { "3.example.com", NULL, "max-age=\"0\"; includeSubDomains;", - CURLE_OK }, - { "-", "foo.example.com", NULL, CURLE_OK}, - { "-", "foo.xample.com", NULL, CURLE_OK}, - - /* should not match */ - { "example.net", "forexample.net", "max-age=\"31536000\"\r\n", CURLE_OK }, - - /* should not match either, since forexample.net is not in the example.net - domain */ - { "example.net", "forexample.net", - "max-age=\"31536000\"; includeSubDomains\r\n", CURLE_OK }, - /* remove example.net again */ - { "example.net", NULL, "max-age=\"0\"; includeSubDomains\r\n", CURLE_OK }, - - /* make this live for 7 seconds */ - { "expire.example", NULL, "max-age=\"7\"\r\n", CURLE_OK }, - { NULL, NULL, NULL, CURLE_OK } + /* two entries read from disk cache, verify first */ + { "-", "readfrom.example", NULL, CURLE_OK}, + { "-", "old.example", NULL, CURLE_OK}, + /* delete the remaining one read from disk */ + { "readfrom.example", NULL, "max-age=\"0\"", CURLE_OK}, + + { "example.com", NULL, "max-age=\"31536000\"\r\n", CURLE_OK }, + { "example.com", NULL, "max-age=\"21536000\"\r\n", CURLE_OK }, + { "example.com", NULL, "max-age=\"21536000\"; \r\n", CURLE_OK }, + { "example.com", NULL, "max-age=\"21536000\"; includeSubDomains\r\n", + CURLE_OK }, + { "example.org", NULL, "max-age=\"31536000\"\r\n", CURLE_OK }, + { "this.example", NULL, "max=\"31536\";", CURLE_BAD_FUNCTION_ARGUMENT }, + { "this.example", NULL, "max-age=\"31536", CURLE_BAD_FUNCTION_ARGUMENT }, + { "this.example", NULL, "max-age=31536\"", CURLE_OK }, + /* max-age=0 removes the entry */ + { "this.example", NULL, "max-age=0", CURLE_OK }, + { "another.example", NULL, "includeSubDomains; ", + CURLE_BAD_FUNCTION_ARGUMENT }, + + /* Two max-age is illegal */ + { "example.com", NULL, + "max-age=\"21536000\"; includeSubDomains; max-age=\"3\";", + CURLE_BAD_FUNCTION_ARGUMENT }, + /* Two includeSubDomains is illegal */ + { "2.example.com", NULL, + "max-age=\"21536000\"; includeSubDomains; includeSubDomains;", + CURLE_BAD_FUNCTION_ARGUMENT }, + /* use an unknown directive "include" that should be ignored */ + { "3.example.com", NULL, + "max-age=\"21536000\"; include; includeSubDomains;", CURLE_OK }, + /* remove the "3.example.com" one, should still match the example.com */ + { "3.example.com", NULL, "max-age=\"0\"; includeSubDomains;", + CURLE_OK }, + { "-", "foo.example.com", NULL, CURLE_OK}, + { "-", "foo.xample.com", NULL, CURLE_OK}, + + /* should not match */ + { "example.net", "forexample.net", "max-age=\"31536000\"\r\n", CURLE_OK }, + + /* should not match either, since forexample.net is not in the example.net + domain */ + { "example.net", "forexample.net", + "max-age=\"31536000\"; includeSubDomains\r\n", CURLE_OK }, + /* remove example.net again */ + { "example.net", NULL, "max-age=\"0\"; includeSubDomains\r\n", CURLE_OK }, + + /* make this live for 7 seconds */ + { "expire.example", NULL, "max-age=\"7\"\r\n", CURLE_OK }, + { NULL, NULL, NULL, CURLE_OK } }; CURLcode result; From 42098d1ee6874aa6a69b051e41e2a6d96ad30ffa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 15:52:33 +0100 Subject: [PATCH 371/885] checksrc: verify close brace indent level Closes #19512 --- scripts/checksrc.pl | 16 ++++++++++++++++ tests/data/test1185 | 43 ++++++++++++++++++++++++------------------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index caf60e1c4dbd..4224934a5eac 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -126,6 +126,7 @@ 'BRACEPOS' => 'wrong position for an open brace', 'BRACEWHILE' => 'A single space between open brace and while', 'COMMANOSPACE' => 'comma without following space', + "CLOSEBRACE" => 'close brace indent level vs line above is off', 'COMMENTNOSPACEEND' => 'no space before */', 'COMMENTNOSPACESTART' => 'no space following /*', 'COPYRIGHT' => 'file missing a copyright statement', @@ -880,6 +881,21 @@ sub scanfile { } } + # when the line starts with a brace + if($l =~ /^( *)\}/) { + my $tlen = length($1); + if($prevl =~ /^( *)(.)/) { + my $plen = length($1); + my $firstc = $2; + # skips the check if the previous line starts with a close + # brace since we see the occasional legit use of that oddity + if(($tlen + $indent) > $plen && ($firstc ne "}")) { + checkwarn("CLOSEBRACE", + $line, $plen, $file, $prevl, + "Suspicious close brace indentation"); + } + } + } # check for "} else" if($l =~ /^(.*)\} *else/) { checkwarn("BRACEELSE", diff --git a/tests/data/test1185 b/tests/data/test1185 index 26852a641835..5571888aae67 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -65,6 +65,8 @@ void startfunc(int a, int b) { int foo = bar; int foo = bar;foo++; for(;;) { + moo(); + moo(); } int a = sizeof int; @@ -156,52 +158,55 @@ void startfunc(int a, int b) { ./%LOGDIR/code1185.c:49:10: warning: multiple spaces (MULTISPACE) for(;;) { ^ -./%LOGDIR/code1185.c:50:2: warning: not indented 2 steps (uses 0) (INDENTATION) - } - ^ -./%LOGDIR/code1185.c:52:16: warning: sizeof without parenthesis (SIZEOFNOPAREN) +./%LOGDIR/code1185.c:50:5: warning: not indented 2 steps (uses 3) (INDENTATION) + moo(); + ^ +./%LOGDIR/code1185.c:52:3: warning: Suspicious close brace indentation (CLOSEBRACE) + moo(); + ^ +./%LOGDIR/code1185.c:54:16: warning: sizeof without parenthesis (SIZEOFNOPAREN) int a = sizeof int; ^ -./%LOGDIR/code1185.c:53:10: warning: use of magicbad is banned (BANNEDFUNC) +./%LOGDIR/code1185.c:55:10: warning: use of magicbad is banned (BANNEDFUNC) int a = magicbad(buffer, alsobad(buffer), "%d", 99); ^ -./%LOGDIR/code1185.c:53:27: warning: use of alsobad is banned (BANNEDFUNC) +./%LOGDIR/code1185.c:55:27: warning: use of alsobad is banned (BANNEDFUNC) int a = magicbad(buffer, alsobad(buffer), "%d", 99); ^ -./%LOGDIR/code1185.c:54:21: warning: missing space before colon (NOSPACEC) +./%LOGDIR/code1185.c:56:21: warning: missing space before colon (NOSPACEC) int moo = hej?wrong:a>b; ^ -./%LOGDIR/code1185.c:54:22: warning: missing space after colon (NOSPACEC) +./%LOGDIR/code1185.c:56:22: warning: missing space after colon (NOSPACEC) int moo = hej?wrong:a>b; ^ -./%LOGDIR/code1185.c:54:15: warning: missing space before question mark (NOSPACEQ) +./%LOGDIR/code1185.c:56:15: warning: missing space before question mark (NOSPACEQ) int moo = hej?wrong:a>b; ^ -./%LOGDIR/code1185.c:54:16: warning: missing space after question mark (NOSPACEQ) +./%LOGDIR/code1185.c:56:16: warning: missing space after question mark (NOSPACEQ) int moo = hej?wrong:a>b; ^ -./%LOGDIR/code1185.c:54:23: warning: missing space before less or greater than (NOSPACETHAN) +./%LOGDIR/code1185.c:56:23: warning: missing space before less or greater than (NOSPACETHAN) int moo = hej?wrong:a>b; ^ -./%LOGDIR/code1185.c:54:23: warning: missing space after less or greater than (NOSPACETHAN) +./%LOGDIR/code1185.c:56:23: warning: missing space after less or greater than (NOSPACETHAN) int moo = hej?wrong:a>b; ^ -./%LOGDIR/code1185.c:55:23: warning: missing space before less or greater than (NOSPACETHAN) +./%LOGDIR/code1185.c:57:23: warning: missing space before less or greater than (NOSPACETHAN) int moo2 = wrong2:(a)>(b); ^ -./%LOGDIR/code1185.c:55:23: warning: missing space after less or greater than (NOSPACETHAN) +./%LOGDIR/code1185.c:57:23: warning: missing space after less or greater than (NOSPACETHAN) int moo2 = wrong2:(a)>(b); ^ -./%LOGDIR/code1185.c:57:7: warning: conditional block on the same line (ONELINECONDITION) +./%LOGDIR/code1185.c:59:7: warning: conditional block on the same line (ONELINECONDITION) if(a) b++; ^ -./%LOGDIR/code1185.c:59:5: warning: use of sprintf is banned (BANNEDFUNC) +./%LOGDIR/code1185.c:61:5: warning: use of sprintf is banned (BANNEDFUNC) if(sprintf(buffer, "%s", moo)) {} ^ -./%LOGDIR/code1185.c:60:25: warning: use of alsobad is banned (BANNEDFUNC) +./%LOGDIR/code1185.c:62:25: warning: use of alsobad is banned (BANNEDFUNC) *buffer_len = (ssize_t)alsobad((char *)buffer, NULL, 16); ^ -./%LOGDIR/code1185.c:62:2: warning: // comment (CPPCOMMENTS) +./%LOGDIR/code1185.c:64:2: warning: // comment (CPPCOMMENTS) // CPP comment ? ^ ./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT) @@ -210,7 +215,7 @@ void startfunc(int a, int b) { ./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT) %SP ^ -checksrc: 0 errors and 41 warnings +checksrc: 0 errors and 42 warnings 5 From e3e0559ed26fbc0bac193e5a815c0990fdb48175 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 22:24:32 +0100 Subject: [PATCH 372/885] config2setopts: exit if curl_url_set() fails on OOM An error case that previously did not properly return error. Closes #19517 --- src/config2setopts.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/config2setopts.c b/src/config2setopts.c index 929123cfbf0b..57e7a7337669 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -137,30 +137,34 @@ static CURLcode url_proto_and_rewrite(char **url, DEBUGASSERT(url && *url); if(uh) { char *schemep = NULL; - if(!curl_url_set(uh, CURLUPART_URL, *url, - CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME) && - !curl_url_get(uh, CURLUPART_SCHEME, &schemep, - CURLU_DEFAULT_SCHEME)) { + CURLUcode uc = + curl_url_set(uh, CURLUPART_URL, *url, + CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME); + if(!uc) { + if(!curl_url_get(uh, CURLUPART_SCHEME, &schemep, + CURLU_DEFAULT_SCHEME)) { #ifdef CURL_DISABLE_IPFS - (void)config; + (void)config; #else - if(curl_strequal(schemep, proto_ipfs) || - curl_strequal(schemep, proto_ipns)) { - result = ipfs_url_rewrite(uh, schemep, url, config); - /* short-circuit proto_token, we know it is ipfs or ipns */ - if(curl_strequal(schemep, proto_ipfs)) - proto = proto_ipfs; - else if(curl_strequal(schemep, proto_ipns)) - proto = proto_ipns; - if(result) - config->synthetic_error = TRUE; - } - else + if(curl_strequal(schemep, proto_ipfs) || + curl_strequal(schemep, proto_ipns)) { + result = ipfs_url_rewrite(uh, schemep, url, config); + /* short-circuit proto_token, we know it is ipfs or ipns */ + if(curl_strequal(schemep, proto_ipfs)) + proto = proto_ipfs; + else if(curl_strequal(schemep, proto_ipns)) + proto = proto_ipns; + if(result) + config->synthetic_error = TRUE; + } + else #endif /* !CURL_DISABLE_IPFS */ - proto = proto_token(schemep); - - curl_free(schemep); + proto = proto_token(schemep); + curl_free(schemep); + } } + else if(uc == CURLUE_OUT_OF_MEMORY) + result = CURLE_OUT_OF_MEMORY; curl_url_cleanup(uh); } else From 96500f466ef9abb3a416f8e0cc65de7fa0669217 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 20:31:51 +0100 Subject: [PATCH 373/885] tidy-up: result code variable names in tests and examples Sync outliers with the rest of the code. Also: - return error in some failed init cases, instead of `CURLE_OK`: 1908, 1910, 1913, 2082, 3010 - lib1541: delete unused struct member. Closes #19515 --- docs/examples/sftpuploadresume.c | 21 +++-- docs/examples/websocket-updown.c | 9 +- tests/libtest/cli_h2_pausing.c | 26 +++--- tests/libtest/cli_h2_serverpush.c | 10 +-- tests/libtest/cli_h2_upgrade_extreme.c | 6 +- tests/libtest/cli_hx_download.c | 32 +++---- tests/libtest/cli_hx_upload.c | 16 ++-- tests/libtest/cli_tls_session_reuse.c | 10 +-- tests/libtest/cli_upload_pausing.c | 18 ++-- tests/libtest/cli_ws_data.c | 8 +- tests/libtest/cli_ws_pingpong.c | 12 +-- tests/libtest/first.c | 32 ++++--- tests/libtest/lib1156.c | 6 +- tests/libtest/lib1485.c | 20 ++--- tests/libtest/lib1523.c | 18 ++-- tests/libtest/lib1541.c | 1 - tests/libtest/lib1568.c | 10 +-- tests/libtest/lib1908.c | 10 +-- tests/libtest/lib1910.c | 6 +- tests/libtest/lib1911.c | 8 +- tests/libtest/lib1913.c | 6 +- tests/libtest/lib2082.c | 13 +-- tests/libtest/lib2301.c | 6 +- tests/libtest/lib2304.c | 6 +- tests/libtest/lib3010.c | 16 ++-- tests/libtest/lib3207.c | 10 +-- tests/unit/unit1606.c | 6 +- tests/unit/unit1651.c | 6 +- tests/unit/unit1654.c | 112 ++++++++++++------------- tests/unit/unit1656.c | 12 +-- tests/unit/unit1657.c | 16 ++-- tests/unit/unit1658.c | 10 +-- tests/unit/unit1660.c | 14 ++-- tests/unit/unit1661.c | 6 +- tests/unit/unit2600.c | 26 +++--- tests/unit/unit2601.c | 56 ++++++------- tests/unit/unit2602.c | 16 ++-- tests/unit/unit2604.c | 12 +-- tests/unit/unit2605.c | 14 ++-- tests/unit/unit3200.c | 48 +++++------ 40 files changed, 342 insertions(+), 348 deletions(-) diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index c15d103b5f0b..cb5d1cf33e0c 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -53,7 +53,7 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) CURL *curl = curl_easy_init(); if(curl) { - CURLcode result; + CURLcode res; curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -63,12 +63,11 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) curl_easy_setopt(curl, CURLOPT_HEADER, 1L); curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); - result = curl_easy_perform(curl); - if(CURLE_OK == result) { - result = curl_easy_getinfo(curl, - CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, - &remoteFileSizeByte); - if(result) + res = curl_easy_perform(curl); + if(CURLE_OK == res) { + res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, + &remoteFileSizeByte); + if(res) return -1; printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); } @@ -83,7 +82,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath, const char *localpath) { FILE *f = NULL; - CURLcode result = CURLE_GOT_NOTHING; + CURLcode res = CURLE_GOT_NOTHING; curl_off_t remoteFileSizeByte = sftpGetRemoteFileSize(remotepath); if(remoteFileSizeByte == -1) { @@ -110,14 +109,14 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath, fseek(f, (long)remoteFileSizeByte, SEEK_SET); #endif curl_easy_setopt(curl, CURLOPT_APPEND, 1L); - result = curl_easy_perform(curl); + res = curl_easy_perform(curl); fclose(f); - if(result == CURLE_OK) + if(res == CURLE_OK) return 1; else { - fprintf(stderr, "%s\n", curl_easy_strerror(result)); + fprintf(stderr, "%s\n", curl_easy_strerror(res)); return 0; } } diff --git a/docs/examples/websocket-updown.c b/docs/examples/websocket-updown.c index 88d7b6e6e9f4..87f7aea28752 100644 --- a/docs/examples/websocket-updown.c +++ b/docs/examples/websocket-updown.c @@ -60,15 +60,14 @@ static size_t read_cb(char *buf, size_t nitems, size_t buflen, void *p) struct read_ctx *ctx = p; size_t len = nitems * buflen; size_t left = ctx->blen - ctx->nsent; - CURLcode result; + CURLcode res; if(!ctx->nsent) { /* On first call, set the FRAME information to be used (it defaults * to CURLWS_BINARY otherwise). */ - result = curl_ws_start_frame(ctx->curl, CURLWS_TEXT, - (curl_off_t)ctx->blen); - if(result) { - fprintf(stderr, "error starting frame: %d\n", result); + res = curl_ws_start_frame(ctx->curl, CURLWS_TEXT, (curl_off_t)ctx->blen); + if(res) { + fprintf(stderr, "error starting frame: %d\n", res); return CURL_READFUNC_ABORT; } } diff --git a/tests/libtest/cli_h2_pausing.c b/tests/libtest/cli_h2_pausing.c index 692b0a321103..0f06dadd5204 100644 --- a/tests/libtest/cli_h2_pausing.c +++ b/tests/libtest/cli_h2_pausing.c @@ -88,7 +88,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) size_t i; CURLMsg *msg; int rounds = 0; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; CURLU *cu; struct curl_slist *resolve = NULL; char resolve_buf[1024]; @@ -145,22 +145,22 @@ static CURLcode test_cli_h2_pausing(const char *URL) cu = curl_url(); if(!cu) { curl_mfprintf(stderr, "out of memory\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_set(cu, CURLUPART_URL, url, 0)) { curl_mfprintf(stderr, "not a URL: '%s'\n", url); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) { curl_mfprintf(stderr, "could not get host of '%s'\n", url); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) { curl_mfprintf(stderr, "could not get port of '%s'\n", url); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } memset(&resolve, 0, sizeof(resolve)); @@ -192,7 +192,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) curl_easy_setopt(handles[i].curl, CURLOPT_PIPEWAIT, 1L) != CURLE_OK || curl_easy_setopt(handles[i].curl, CURLOPT_URL, url) != CURLE_OK) { curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n"); - result = (CURLcode)2; + res = (CURLcode)2; goto cleanup; } curl_easy_setopt(handles[i].curl, CURLOPT_HTTP_VERSION, http_version); @@ -201,14 +201,14 @@ static CURLcode test_cli_h2_pausing(const char *URL) multi = curl_multi_init(); if(!multi) { curl_mfprintf(stderr, "curl_multi_init() failed - bailing out\n"); - result = (CURLcode)2; + res = (CURLcode)2; goto cleanup; } for(i = 0; i < CURL_ARRAYSIZE(handles); i++) { if(curl_multi_add_handle(multi, handles[i].curl) != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_add_handle() failed - bailing out\n"); - result = (CURLcode)2; + res = (CURLcode)2; goto cleanup; } } @@ -217,7 +217,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) curl_mfprintf(stderr, "INFO: multi_perform round %d\n", rounds); if(curl_multi_perform(multi, &still_running) != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_perform() failed - bailing out\n"); - result = (CURLcode)2; + res = (CURLcode)2; goto cleanup; } @@ -247,14 +247,14 @@ static CURLcode test_cli_h2_pausing(const char *URL) if(!as_expected) { curl_mfprintf(stderr, "ERROR: handles not in expected state " "after %d rounds\n", rounds); - result = (CURLcode)1; + res = (CURLcode)1; } break; } if(curl_multi_poll(multi, NULL, 0, 100, &numfds) != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_poll() failed - bailing out\n"); - result = (CURLcode)2; + res = (CURLcode)2; goto cleanup; } @@ -268,7 +268,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) "resumed=%d, result %d - wtf?\n", i, handles[i].paused, handles[i].resumed, msg->data.result); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } } @@ -314,5 +314,5 @@ static CURLcode test_cli_h2_pausing(const char *URL) curl_multi_cleanup(multi); curl_global_cleanup(); - return result; + return res; } diff --git a/tests/libtest/cli_h2_serverpush.c b/tests/libtest/cli_h2_serverpush.c index 6936b3b0d65c..ad3ae4f91406 100644 --- a/tests/libtest/cli_h2_serverpush.c +++ b/tests/libtest/cli_h2_serverpush.c @@ -109,7 +109,7 @@ static CURLcode test_cli_h2_serverpush(const char *URL) CURL *curl = NULL; CURLM *multi; int transfers = 1; /* we start with one */ - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; debug_config.nohex = TRUE; debug_config.tracetime = FALSE; @@ -126,19 +126,19 @@ static CURLcode test_cli_h2_serverpush(const char *URL) multi = curl_multi_init(); if(!multi) { - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl = curl_easy_init(); if(!curl) { - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(setup_h2_serverpush(curl, URL)) { curl_mfprintf(stderr, "failed\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } @@ -189,5 +189,5 @@ static CURLcode test_cli_h2_serverpush(const char *URL) curl_global_cleanup(); - return result; + return res; } diff --git a/tests/libtest/cli_h2_upgrade_extreme.c b/tests/libtest/cli_h2_upgrade_extreme.c index eb0549380031..b5c6c31b1b59 100644 --- a/tests/libtest/cli_h2_upgrade_extreme.c +++ b/tests/libtest/cli_h2_upgrade_extreme.c @@ -43,7 +43,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) CURLMsg *msg; int msgs_in_queue; char range[128]; - CURLcode result = (CURLcode)1; + CURLcode res = (CURLcode)1; if(!URL) { curl_mfprintf(stderr, "need URL as argument\n"); @@ -149,7 +149,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) } while(running_handles > 0 || start_count); curl_mfprintf(stderr, "exiting\n"); - result = CURLE_OK; + res = CURLE_OK; cleanup: @@ -168,5 +168,5 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) curl_global_cleanup(); - return result; + return res; } diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index 365348455a00..f88a456a20bf 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -63,7 +63,7 @@ struct transfer_d { int resumed; int done; int checked_ssl; - CURLcode result; + CURLcode res; }; static size_t transfer_count_d = 1; @@ -296,7 +296,7 @@ static CURLcode test_cli_hx_download(const char *URL) size_t max_host_conns = 0; size_t max_total_conns = 0; int fresh_connect = 0; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; (void)URL; @@ -307,7 +307,7 @@ static CURLcode test_cli_hx_download(const char *URL) switch(ch) { case 'h': usage_hx_download(NULL); - result = (CURLcode)2; + res = (CURLcode)2; goto optcleanup; case 'a': abort_paused = 1; @@ -362,14 +362,14 @@ static CURLcode test_cli_hx_download(const char *URL) http_version = CURL_HTTP_VERSION_3ONLY; else { usage_hx_download("invalid http version"); - result = (CURLcode)1; + res = (CURLcode)1; goto optcleanup; } break; } default: usage_hx_download("invalid option"); - result = (CURLcode)1; + res = (CURLcode)1; goto optcleanup; } } @@ -380,14 +380,14 @@ static CURLcode test_cli_hx_download(const char *URL) if(test_argc != 1) { usage_hx_download("not enough arguments"); - result = (CURLcode)2; + res = (CURLcode)2; goto optcleanup; } url = test_argv[0]; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); - result = (CURLcode)3; + res = (CURLcode)3; goto optcleanup; } @@ -397,7 +397,7 @@ static CURLcode test_cli_hx_download(const char *URL) share = curl_share_init(); if(!share) { curl_mfprintf(stderr, "error allocating share\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); @@ -410,7 +410,7 @@ static CURLcode test_cli_hx_download(const char *URL) transfer_d = calloc(transfer_count_d, sizeof(*transfer_d)); if(!transfer_d) { curl_mfprintf(stderr, "error allocating transfer structs\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } @@ -438,7 +438,7 @@ static CURLcode test_cli_hx_download(const char *URL) setup_hx_download(t->curl, url, t, http_version, host, share, use_earlydata, fresh_connect)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl_multi_add_handle(multi, t->curl); @@ -469,9 +469,9 @@ static CURLcode test_cli_hx_download(const char *URL) t = get_transfer_for_easy_d(easy); if(t) { t->done = 1; - t->result = m->data.result; + t->res = m->data.result; curl_mfprintf(stderr, "[t-%zu] FINISHED with result %d\n", - t->idx, t->result); + t->idx, t->res); if(use_earlydata) { curl_off_t sent; curl_easy_getinfo(easy, CURLINFO_EARLYDATA_SENT_T, &sent); @@ -521,7 +521,7 @@ static CURLcode test_cli_hx_download(const char *URL) setup_hx_download(t->curl, url, t, http_version, host, share, use_earlydata, fresh_connect)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl_multi_add_handle(multi, t->curl); @@ -554,8 +554,8 @@ static CURLcode test_cli_hx_download(const char *URL) curl_easy_cleanup(t->curl); t->curl = NULL; } - if(t->result) - result = t->result; + if(t->res) + res = t->res; else /* on success we expect ssl to have been checked */ assert(t->checked_ssl); } @@ -571,5 +571,5 @@ static CURLcode test_cli_hx_download(const char *URL) free(resolve); - return result; + return res; } diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index dc053ae755bd..9ce955bba6c5 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -246,7 +246,7 @@ static CURLcode test_cli_hx_upload(const char *URL) struct curl_slist *host = NULL; const char *resolve = NULL; int ch; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; (void)URL; @@ -348,7 +348,7 @@ static CURLcode test_cli_hx_upload(const char *URL) share = curl_share_init(); if(!share) { curl_mfprintf(stderr, "error allocating share\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); @@ -361,7 +361,7 @@ static CURLcode test_cli_hx_upload(const char *URL) transfer_u = calloc(transfer_count_u, sizeof(*transfer_u)); if(!transfer_u) { curl_mfprintf(stderr, "error allocating transfer structs\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } @@ -380,7 +380,7 @@ static CURLcode test_cli_hx_upload(const char *URL) CURL *curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "failed to init easy handle\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } for(i = 0; i < transfer_count_u; ++i) { @@ -390,7 +390,7 @@ static CURLcode test_cli_hx_upload(const char *URL) if(setup_hx_upload(t->curl, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } @@ -413,7 +413,7 @@ static CURLcode test_cli_hx_upload(const char *URL) if(!t->curl || setup_hx_upload(t->curl, url, t, http_version, host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl_multi_add_handle(multi, t->curl); @@ -500,7 +500,7 @@ static CURLcode test_cli_hx_upload(const char *URL) host, share, use_earlydata, announce_length)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } curl_multi_add_handle(multi, t->curl); @@ -546,5 +546,5 @@ static CURLcode test_cli_hx_upload(const char *URL) curl_slist_free_all(host); curl_global_cleanup(); - return result; + return res; } diff --git a/tests/libtest/cli_tls_session_reuse.c b/tests/libtest/cli_tls_session_reuse.c index 2a6c0ea3bfab..2f6bde43e384 100644 --- a/tests/libtest/cli_tls_session_reuse.c +++ b/tests/libtest/cli_tls_session_reuse.c @@ -109,7 +109,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) int add_more, waits, ongoing = 0; char *host = NULL, *port = NULL; long http_version = CURL_HTTP_VERSION_1_1; - CURLcode result = (CURLcode)1; + CURLcode res = (CURLcode)1; if(!URL || !libtest_arg2) { curl_mfprintf(stderr, "need args: URL proto\n"); @@ -129,7 +129,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) cu = curl_url(); if(!cu) { curl_mfprintf(stderr, "out of memory\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_set(cu, CURLUPART_URL, URL, 0)) { @@ -236,12 +236,12 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) if(!tse_found_tls_session) { curl_mfprintf(stderr, "CURLINFO_TLS_SSL_PTR not found during run\n"); - result = CURLE_FAILED_INIT; + res = CURLE_FAILED_INIT; goto cleanup; } curl_mfprintf(stderr, "exiting\n"); - result = CURLE_OK; + res = CURLE_OK; cleanup: @@ -265,5 +265,5 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) curl_url_cleanup(cu); curl_global_cleanup(); - return result; + return res; } diff --git a/tests/libtest/cli_upload_pausing.c b/tests/libtest/cli_upload_pausing.c index 971157c3138a..441ce899a09e 100644 --- a/tests/libtest/cli_upload_pausing.c +++ b/tests/libtest/cli_upload_pausing.c @@ -86,7 +86,7 @@ static void usage_upload_pausing(const char *msg) static CURLcode test_cli_upload_pausing(const char *URL) { CURL *curl = NULL; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; CURLU *cu; struct curl_slist *resolve = NULL; char resolve_buf[1024]; @@ -136,22 +136,22 @@ static CURLcode test_cli_upload_pausing(const char *URL) cu = curl_url(); if(!cu) { curl_mfprintf(stderr, "out of memory\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_set(cu, CURLUPART_URL, url, 0)) { curl_mfprintf(stderr, "not a URL: '%s'\n", url); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) { curl_mfprintf(stderr, "could not get host of '%s'\n", url); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) { curl_mfprintf(stderr, "could not get port of '%s'\n", url); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } memset(&resolve, 0, sizeof(resolve)); @@ -162,7 +162,7 @@ static CURLcode test_cli_upload_pausing(const char *URL) curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "out of memory\n"); - result = (CURLcode)1; + res = (CURLcode)1; goto cleanup; } /* We want to use our own read function. */ @@ -190,14 +190,14 @@ static CURLcode test_cli_upload_pausing(const char *URL) curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb) != CURLE_OK || curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve) != CURLE_OK) { curl_mfprintf(stderr, "something unexpected went wrong - bailing out!\n"); - result = (CURLcode)2; + res = (CURLcode)2; goto cleanup; } curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version); - result = curl_easy_perform(curl); + res = curl_easy_perform(curl); cleanup: @@ -210,5 +210,5 @@ static CURLcode test_cli_upload_pausing(const char *URL) curl_url_cleanup(cu); curl_global_cleanup(); - return result; + return res; } diff --git a/tests/libtest/cli_ws_data.c b/tests/libtest/cli_ws_data.c index 7e5479b74312..aa43bc6058ca 100644 --- a/tests/libtest/cli_ws_data.c +++ b/tests/libtest/cli_ws_data.c @@ -411,7 +411,7 @@ static void test_ws_data_usage(const char *msg) static CURLcode test_cli_ws_data(const char *URL) { #ifndef CURL_DISABLE_WEBSOCKETS - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; const char *url; size_t plen_min = 0, plen_max = 0, count = 1; int ch, model = 2; @@ -472,13 +472,13 @@ static CURLcode test_cli_ws_data(const char *URL) } if(model == 1) - result = test_ws_data_m1_echo(url, plen_min, plen_max); + res = test_ws_data_m1_echo(url, plen_min, plen_max); else - result = test_ws_data_m2_echo(url, count, plen_min, plen_max); + res = test_ws_data_m2_echo(url, count, plen_min, plen_max); curl_global_cleanup(); - return result; + return res; #else /* !CURL_DISABLE_WEBSOCKETS */ (void)URL; diff --git a/tests/libtest/cli_ws_pingpong.c b/tests/libtest/cli_ws_pingpong.c index 995c1e3f7c40..0a8e957aa411 100644 --- a/tests/libtest/cli_ws_pingpong.c +++ b/tests/libtest/cli_ws_pingpong.c @@ -56,7 +56,7 @@ static CURLcode test_cli_ws_pingpong(const char *URL) { #ifndef CURL_DISABLE_WEBSOCKETS CURL *curl; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; const char *payload; if(!URL || !libtest_arg2) { @@ -78,16 +78,16 @@ static CURLcode test_cli_ws_pingpong(const char *URL) curl_easy_setopt(curl, CURLOPT_USERAGENT, "ws-pingpong"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ - result = curl_easy_perform(curl); - curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", result); - if(result == CURLE_OK) - result = pingpong(curl, payload); + res = curl_easy_perform(curl); + curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", res); + if(res == CURLE_OK) + res = pingpong(curl, payload); /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); - return result; + return res; #else /* !CURL_DISABLE_WEBSOCKETS */ (void)URL; diff --git a/tests/libtest/first.c b/tests/libtest/first.c index ad1f92997111..7ab38a9fd852 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -163,11 +163,10 @@ char *hexdump(const unsigned char *buf, size_t len) CURLcode ws_send_ping(CURL *curl, const char *send_payload) { size_t sent; - CURLcode result = curl_ws_send(curl, send_payload, strlen(send_payload), - &sent, 0, CURLWS_PING); - curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n", - result, sent); - return result; + CURLcode res = curl_ws_send(curl, send_payload, strlen(send_payload), + &sent, 0, CURLWS_PING); + curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n", res, sent); + return res; } CURLcode ws_recv_pong(CURL *curl, const char *expected_payload) @@ -175,11 +174,11 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload) size_t rlen; const struct curl_ws_frame *meta; char buffer[256]; - CURLcode result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); - if(result) { + CURLcode res = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); + if(res) { curl_mfprintf(stderr, "ws: curl_ws_recv returned %u, received %zu\n", - result, rlen); - return result; + res, rlen); + return res; } if(!(meta->flags & CURLWS_PONG)) { @@ -192,7 +191,7 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload) if(rlen == strlen(expected_payload) && !memcmp(expected_payload, buffer, rlen)) { curl_mfprintf(stderr, "ws: got the same payload back\n"); - return CURLE_OK; /* lib2304 returned 'result' here. Intentional? */ + return CURLE_OK; /* lib2304 returned 'res' here. Intentional? */ } curl_mfprintf(stderr, "ws: did NOT get the same payload back\n"); return CURLE_RECV_ERROR; @@ -202,9 +201,8 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload) void ws_close(CURL *curl) { size_t sent; - CURLcode result = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); - curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n", - result, sent); + CURLcode res = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); + curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n", res, sent); } #endif /* CURL_DISABLE_WEBSOCKETS */ @@ -212,7 +210,7 @@ void ws_close(CURL *curl) int main(int argc, const char **argv) { const char *URL = ""; - CURLcode result; + CURLcode res; entry_func_t entry_func; const char *entry_name; const char *env; @@ -279,8 +277,8 @@ int main(int argc, const char **argv) testnum = (int)num; } - result = entry_func(URL); - curl_mfprintf(stderr, "Test ended with result %d\n", result); + res = entry_func(URL); + curl_mfprintf(stderr, "Test ended with result %d\n", res); #ifdef _WIN32 /* flush buffers of all streams regardless of mode */ @@ -289,5 +287,5 @@ int main(int argc, const char **argv) /* Regular program status codes are limited to 0..127 and 126 and 127 have * special meanings by the shell, so limit a normal return code to 125 */ - return (int)result <= 125 ? (int)result : 125; + return (int)res <= 125 ? (int)res : 125; } diff --git a/tests/libtest/lib1156.c b/tests/libtest/lib1156.c index 07f8e46a0473..6ceb6894e785 100644 --- a/tests/libtest/lib1156.c +++ b/tests/libtest/lib1156.c @@ -44,7 +44,7 @@ struct testparams { unsigned int flags; /* ORed flags as above. */ - CURLcode result; /* Code that should be returned by curl_easy_perform(). */ + CURLcode res; /* Code that should be returned by curl_easy_perform(). */ }; static const struct testparams testparams[] = { @@ -102,14 +102,14 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p, test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL) ? 1L : 0L); hasbody = 0; res = curl_easy_perform(curl); - if(res != p->result) { + if(res != p->res) { curl_mprintf("%zu: bad error code (%d): resume=%s, fail=%s, http416=%s, " "content-range=%s, expected=%d\n", num, res, (p->flags & F_RESUME) ? "yes": "no", (p->flags & F_FAIL) ? "yes": "no", (p->flags & F_HTTP416) ? "yes": "no", (p->flags & F_CONTENTRANGE) ? "yes": "no", - p->result); + p->res); return 1; } if(hasbody && (p->flags & F_IGNOREBODY)) { diff --git a/tests/libtest/lib1485.c b/tests/libtest/lib1485.c index 36be7cd1e83b..7fea83317c06 100644 --- a/tests/libtest/lib1485.c +++ b/tests/libtest/lib1485.c @@ -29,7 +29,7 @@ struct t1485_transfer_status { CURL *curl; curl_off_t out_len; size_t hd_line; - CURLcode result; + CURLcode res; int http_status; }; @@ -39,7 +39,7 @@ static size_t t1485_header_callback(char *ptr, size_t size, size_t nmemb, struct t1485_transfer_status *st = (struct t1485_transfer_status *)userp; const char *hd = ptr; size_t len = size * nmemb; - CURLcode result; + CURLcode res; (void)fwrite(ptr, size, nmemb, stdout); ++st->hd_line; @@ -47,22 +47,22 @@ static size_t t1485_header_callback(char *ptr, size_t size, size_t nmemb, curl_off_t clen; long httpcode = 0; /* end of a response */ - result = curl_easy_getinfo(st->curl, CURLINFO_RESPONSE_CODE, &httpcode); + res = curl_easy_getinfo(st->curl, CURLINFO_RESPONSE_CODE, &httpcode); curl_mfprintf(stderr, "header_callback, get status: %ld, %d\n", - httpcode, result); + httpcode, res); if(httpcode < 100 || httpcode >= 1000) { curl_mfprintf(stderr, "header_callback, invalid status: %ld, %d\n", - httpcode, result); + httpcode, res); return CURLE_WRITE_ERROR; } st->http_status = (int)httpcode; if(st->http_status >= 200 && st->http_status < 300) { - result = curl_easy_getinfo(st->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, - &clen); + res = curl_easy_getinfo(st->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, + &clen); curl_mfprintf(stderr, "header_callback, info Content-Length: " - "%" CURL_FORMAT_CURL_OFF_T ", %d\n", clen, result); - if(result) { - st->result = result; + "%" CURL_FORMAT_CURL_OFF_T ", %d\n", clen, res); + if(res) { + st->res = res; return CURLE_WRITE_ERROR; } if(clen < 0) { diff --git a/tests/libtest/lib1523.c b/tests/libtest/lib1523.c index 36bdce8e83bc..5c9a01a5eb1b 100644 --- a/tests/libtest/lib1523.c +++ b/tests/libtest/lib1523.c @@ -55,7 +55,7 @@ static CURLcode run(CURL *curl, long limit, long time) static CURLcode test_lib1523(const char *URL) { - CURLcode ret; + CURLcode res; CURL *curl; char buffer[CURL_ERROR_SIZE]; curl_global_init(CURL_GLOBAL_ALL); @@ -66,18 +66,18 @@ static CURLcode test_lib1523(const char *URL) curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, dload_progress_cb); - ret = run(curl, 1, 2); - if(ret) - curl_mfprintf(stderr, "error (%d) %s\n", ret, buffer); + res = run(curl, 1, 2); + if(res) + curl_mfprintf(stderr, "error (%d) %s\n", res, buffer); - ret = run(curl, 12000, 1); - if(ret != CURLE_OPERATION_TIMEDOUT) - curl_mfprintf(stderr, "error (%d) %s\n", ret, buffer); + res = run(curl, 12000, 1); + if(res != CURLE_OPERATION_TIMEDOUT) + curl_mfprintf(stderr, "error (%d) %s\n", res, buffer); else - ret = CURLE_OK; + res = CURLE_OK; curl_easy_cleanup(curl); curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib1541.c b/tests/libtest/lib1541.c index a2caaef8c3fc..150fd2e30bc9 100644 --- a/tests/libtest/lib1541.c +++ b/tests/libtest/lib1541.c @@ -29,7 +29,6 @@ struct t1541_transfer_status { CURL *curl; int hd_count; int bd_count; - CURLcode result; }; #define KN(a) a, #a diff --git a/tests/libtest/lib1568.c b/tests/libtest/lib1568.c index a7c454edf754..89dd83480dad 100644 --- a/tests/libtest/lib1568.c +++ b/tests/libtest/lib1568.c @@ -27,15 +27,15 @@ static CURLcode test_lib1568(const char *URL) { - CURLcode ret = TEST_ERR_MAJOR_BAD; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl; curl_off_t port; if(curlx_str_number(&libtest_arg2, &port, 0xffff)) - return ret; + return res; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) - return ret; + return res; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, URL); @@ -47,10 +47,10 @@ static CURLcode test_lib1568(const char *URL) curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L); curl_easy_setopt(curl, CURLOPT_PORT, (long)port); - ret = curl_easy_perform(curl); + res = curl_easy_perform(curl); curl_easy_cleanup(curl); curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib1908.c b/tests/libtest/lib1908.c index 500120066ed2..1613d03e019e 100644 --- a/tests/libtest/lib1908.c +++ b/tests/libtest/lib1908.c @@ -27,7 +27,7 @@ static CURLcode test_lib1908(const char *URL) { - CURLcode ret = CURLE_OK; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl; start_test_timing(); @@ -38,13 +38,13 @@ static CURLcode test_lib1908(const char *URL) curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); curl_easy_setopt(curl, CURLOPT_ALTSVC, libtest_arg2); - ret = curl_easy_perform(curl); + res = curl_easy_perform(curl); - if(!ret) { + if(!res) { /* make a copy and check that this also has alt-svc activated */ CURL *curldupe = curl_easy_duphandle(curl); if(curldupe) { - ret = curl_easy_perform(curldupe); + res = curl_easy_perform(curldupe); /* we close the second handle first, which makes it store the alt-svc file only to get overwritten when the next handle is closed! */ curl_easy_cleanup(curldupe); @@ -58,5 +58,5 @@ static CURLcode test_lib1908(const char *URL) curl_easy_cleanup(curl); } curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib1910.c b/tests/libtest/lib1910.c index 425598bf8833..ebe86c12453c 100644 --- a/tests/libtest/lib1910.c +++ b/tests/libtest/lib1910.c @@ -27,7 +27,7 @@ static CURLcode test_lib1910(const char *URL) { - CURLcode ret = CURLE_OK; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl; start_test_timing(); @@ -39,9 +39,9 @@ static CURLcode test_lib1910(const char *URL) curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_USERPWD, "user\nname:pass\nword"); - ret = curl_easy_perform(curl); + res = curl_easy_perform(curl); curl_easy_cleanup(curl); } curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib1911.c b/tests/libtest/lib1911.c index 7add65ec48c6..46c73ffb361d 100644 --- a/tests/libtest/lib1911.c +++ b/tests/libtest/lib1911.c @@ -55,7 +55,7 @@ static CURLcode test_lib1911(const char *URL) o; o = curl_easy_option_next(o)) { if(o->type == CURLOT_STRING) { - CURLcode result; + CURLcode res; /* * Whitelist string options that are safe for abuse */ @@ -72,8 +72,8 @@ static CURLcode test_lib1911(const char *URL) /* This is a string. Make sure that passing in a string longer CURL_MAX_INPUT_LENGTH returns an error */ - result = curl_easy_setopt(curl, o->id, testbuf); - switch(result) { + res = curl_easy_setopt(curl, o->id, testbuf); + switch(res) { case CURLE_BAD_FUNCTION_ARGUMENT: /* the most normal */ case CURLE_UNKNOWN_OPTION: /* left out from the build */ case CURLE_NOT_BUILT_IN: /* not supported */ @@ -82,7 +82,7 @@ static CURLcode test_lib1911(const char *URL) default: /* all other return codes are unexpected */ curl_mfprintf(stderr, "curl_easy_setopt(%s...) returned %d\n", - o->name, result); + o->name, res); error++; break; } diff --git a/tests/libtest/lib1913.c b/tests/libtest/lib1913.c index 94a319f0c745..cea7a6c6ec81 100644 --- a/tests/libtest/lib1913.c +++ b/tests/libtest/lib1913.c @@ -27,7 +27,7 @@ static CURLcode test_lib1913(const char *URL) { - CURLcode ret = CURLE_OK; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl; start_test_timing(); @@ -40,9 +40,9 @@ static CURLcode test_lib1913(const char *URL) if(libtest_arg2) /* test1914 sets this extra arg */ curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); - ret = curl_easy_perform(curl); + res = curl_easy_perform(curl); curl_easy_cleanup(curl); } curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib2082.c b/tests/libtest/lib2082.c index 093eebda3154..9e41d43b0dd7 100644 --- a/tests/libtest/lib2082.c +++ b/tests/libtest/lib2082.c @@ -53,10 +53,11 @@ static int prereq_callback(void *clientp, static CURLcode test_lib2082(const char *URL) /* libprereq */ { - struct prcs prereq_cb; - CURLcode ret = CURLE_OK; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl = NULL; + struct prcs prereq_cb; + prereq_cb.prereq_retcode = CURL_PREREQFUNC_OK; prereq_cb.ipv6 = 0; @@ -83,11 +84,11 @@ static CURLcode test_lib2082(const char *URL) /* libprereq */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); } - ret = curl_easy_perform(curl); - if(ret) { + res = curl_easy_perform(curl); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", - __FILE__, __LINE__, ret, curl_easy_strerror(ret)); + __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } } @@ -96,5 +97,5 @@ static CURLcode test_lib2082(const char *URL) /* libprereq */ curl_easy_cleanup(curl); curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib2301.c b/tests/libtest/lib2301.c index 40e357a3bafd..6fb9e48618cb 100644 --- a/tests/libtest/lib2301.c +++ b/tests/libtest/lib2301.c @@ -57,10 +57,10 @@ static size_t t2301_write_cb(char *b, size_t size, size_t nitems, void *p) curl_mfprintf(stderr, "\n"); (void)size; if(buffer[0] == 0x89) { - CURLcode result; + CURLcode res; curl_mfprintf(stderr, "send back a simple PONG\n"); - result = curl_ws_send(curl, pong, 2, &sent, 0, 0); - if(result) + res = curl_ws_send(curl, pong, 2, &sent, 0, 0); + if(res) nitems = 0; } if(nitems != incoming) diff --git a/tests/libtest/lib2304.c b/tests/libtest/lib2304.c index 4a2abe5f7b1d..cc86e76a10dc 100644 --- a/tests/libtest/lib2304.c +++ b/tests/libtest/lib2304.c @@ -29,9 +29,9 @@ static CURLcode recv_any(CURL *curl) size_t rlen; const struct curl_ws_frame *meta; char buffer[256]; - CURLcode result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); - if(result) - return result; + CURLcode res = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); + if(res) + return res; curl_mfprintf(stderr, "recv_any: got %zu bytes rflags %x\n", rlen, meta->flags); diff --git a/tests/libtest/lib3010.c b/tests/libtest/lib3010.c index 58271772ab4b..4595f4de3577 100644 --- a/tests/libtest/lib3010.c +++ b/tests/libtest/lib3010.c @@ -27,7 +27,7 @@ static CURLcode test_lib3010(const char *URL) { - CURLcode ret = CURLE_OK; + CURLcode res = TEST_ERR_MAJOR_BAD; CURL *curl = NULL; curl_off_t retry_after; char *follow_url = NULL; @@ -37,22 +37,22 @@ static CURLcode test_lib3010(const char *URL) if(curl) { curl_easy_setopt(curl, CURLOPT_URL, URL); - ret = curl_easy_perform(curl); - if(ret) { + res = curl_easy_perform(curl); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", - __FILE__, __LINE__, ret, curl_easy_strerror(ret)); + __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &follow_url); curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after); curl_mprintf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry_after); curl_easy_setopt(curl, CURLOPT_URL, follow_url); - ret = curl_easy_perform(curl); - if(ret) { + res = curl_easy_perform(curl); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", - __FILE__, __LINE__, ret, curl_easy_strerror(ret)); + __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } @@ -65,5 +65,5 @@ static CURLcode test_lib3010(const char *URL) curl_easy_cleanup(curl); curl_global_cleanup(); - return ret; + return res; } diff --git a/tests/libtest/lib3207.c b/tests/libtest/lib3207.c index 316258c86e93..8ba88e4a66b6 100644 --- a/tests/libtest/lib3207.c +++ b/tests/libtest/lib3207.c @@ -37,7 +37,7 @@ struct Ctx { const char *URL; CURLSH *share; - CURLcode result; + CURLcode res; size_t thread_id; struct curl_slist *contents; }; @@ -109,7 +109,7 @@ static unsigned int test_thread(void *ptr) } test_cleanup: - ctx->result = res; + ctx->res = res; return 0; } @@ -192,15 +192,15 @@ static CURLcode test_lib3207(const char *URL) ctx[i].share = share; ctx[i].URL = URL; ctx[i].thread_id = i; - ctx[i].result = CURLE_OK; + ctx[i].res = CURLE_OK; ctx[i].contents = NULL; } execute(share, ctx); for(i = 0; i < CURL_ARRAYSIZE(ctx); i++) { - if(ctx[i].result) { - res = ctx[i].result; + if(ctx[i].res) { + res = ctx[i].res; } else { struct curl_slist *item = ctx[i].contents; diff --git a/tests/unit/unit1606.c b/tests/unit/unit1606.c index e39ecaecdc08..d323b5ce020b 100644 --- a/tests/unit/unit1606.c +++ b/tests/unit/unit1606.c @@ -53,7 +53,7 @@ static int runawhile(struct Curl_easy *easy, { int counter = 1; struct curltime now = {1, 0}; - CURLcode result; + CURLcode res; int finaltime; curl_easy_setopt(easy, CURLOPT_LOW_SPEED_LIMIT, speed_limit); @@ -63,8 +63,8 @@ static int runawhile(struct Curl_easy *easy, do { /* fake the current transfer speed */ easy->progress.current_speed = speed; - result = Curl_speedcheck(easy, now); - if(result) + res = Curl_speedcheck(easy, now); + if(res) break; /* step the time */ now.tv_sec = ++counter; diff --git a/tests/unit/unit1651.c b/tests/unit/unit1651.c index a038caacbd7f..d3620d99f299 100644 --- a/tests/unit/unit1651.c +++ b/tests/unit/unit1651.c @@ -340,7 +340,7 @@ static CURLcode test_unit1651(const char *arg) 0x61, 0x54, 0x4A, 0x2B, 0xB7, 0x6A, 0x12, 0x08, 0xFB, }; - CURLcode result; + CURLcode res; const char *beg = (const char *)&cert[0]; const char *end = (const char *)&cert[sizeof(cert)]; struct Curl_easy *data; @@ -354,9 +354,9 @@ static CURLcode test_unit1651(const char *arg) data = curl_easy_init(); if(data) { - result = Curl_extract_certinfo(data, 0, beg, end); + res = Curl_extract_certinfo(data, 0, beg, end); - fail_unless(result == CURLE_OK, "Curl_extract_certinfo returned error"); + fail_unless(res == CURLE_OK, "Curl_extract_certinfo returned error"); /* a poor man's fuzzing of some initial data to make sure nothing bad happens */ diff --git a/tests/unit/unit1654.c b/tests/unit/unit1654.c index 4fe2439907a1..d2144fc21423 100644 --- a/tests/unit/unit1654.c +++ b/tests/unit/unit1654.c @@ -33,12 +33,12 @@ static CURLcode test_unit1654(const char *arg) #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC) char outname[256]; CURL *curl; - CURLcode result; + CURLcode res; struct altsvcinfo *asi = Curl_altsvc_init(); abort_if(!asi, "Curl_altsvc_i"); - result = Curl_altsvc_load(asi, arg); - if(result) { - fail_if(result, "Curl_altsvc_load"); + res = Curl_altsvc_load(asi, arg); + if(res) { + fail_if(res, "Curl_altsvc_load"); goto fail; } curl_global_init(CURL_GLOBAL_ALL); @@ -50,88 +50,86 @@ static CURLcode test_unit1654(const char *arg) fail_unless(Curl_llist_count(&asi->list) == 4, "wrong number of entries"); curl_msnprintf(outname, sizeof(outname), "%s-out", arg); - result = Curl_altsvc_parse(curl, asi, "h2=\"example.com:8080\"\r\n", - ALPN_h1, "example.org", 8080); - fail_if(result, "Curl_altsvc_parse() failed!"); + res = Curl_altsvc_parse(curl, asi, "h2=\"example.com:8080\"\r\n", + ALPN_h1, "example.org", 8080); + fail_if(res, "Curl_altsvc_parse() failed!"); fail_unless(Curl_llist_count(&asi->list) == 5, "wrong number of entries"); - result = Curl_altsvc_parse(curl, asi, "h3=\":8080\"\r\n", - ALPN_h1, "2.example.org", 8080); - fail_if(result, "Curl_altsvc_parse(2) failed!"); + res = Curl_altsvc_parse(curl, asi, "h3=\":8080\"\r\n", + ALPN_h1, "2.example.org", 8080); + fail_if(res, "Curl_altsvc_parse(2) failed!"); fail_unless(Curl_llist_count(&asi->list) == 6, "wrong number of entries"); - result = Curl_altsvc_parse(curl, asi, - "h2=\"example.com:8080\", " - "h3=\"yesyes.com:8080\"\r\n", - ALPN_h1, "3.example.org", 8080); - fail_if(result, "Curl_altsvc_parse(3) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\"example.com:8080\", " + "h3=\"yesyes.com:8080\"\r\n", + ALPN_h1, "3.example.org", 8080); + fail_if(res, "Curl_altsvc_parse(3) failed!"); /* that one should make two entries */ fail_unless(Curl_llist_count(&asi->list) == 8, "wrong number of entries"); - result = Curl_altsvc_parse(curl, asi, - "h2=\"example.com:443\"; ma = 120;\r\n", - ALPN_h2, "example.org", 80); - fail_if(result, "Curl_altsvc_parse(4) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\"example.com:443\"; ma = 120;\r\n", + ALPN_h2, "example.org", 80); + fail_if(res, "Curl_altsvc_parse(4) failed!"); fail_unless(Curl_llist_count(&asi->list) == 9, "wrong number of entries"); /* quoted 'ma' value */ - result = Curl_altsvc_parse(curl, asi, - "h2=\"example.net:443\"; ma=\"180\";\r\n", - ALPN_h2, "example.net", 80); - fail_if(result, "Curl_altsvc_parse(5) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\"example.net:443\"; ma=\"180\";\r\n", + ALPN_h2, "example.net", 80); + fail_if(res, "Curl_altsvc_parse(5) failed!"); fail_unless(Curl_llist_count(&asi->list) == 10, "wrong number of entries"); - result = - Curl_altsvc_parse(curl, asi, - "h2=\":443\", h3=\":443\"; " - "persist = \"1\"; ma = 120;\r\n", - ALPN_h1, "curl.se", 80); - fail_if(result, "Curl_altsvc_parse(6) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\":443\", h3=\":443\"; " + "persist = \"1\"; ma = 120;\r\n", + ALPN_h1, "curl.se", 80); + fail_if(res, "Curl_altsvc_parse(6) failed!"); fail_unless(Curl_llist_count(&asi->list) == 12, "wrong number of entries"); /* clear that one again and decrease the counter */ - result = Curl_altsvc_parse(curl, asi, "clear;\r\n", - ALPN_h1, "curl.se", 80); - fail_if(result, "Curl_altsvc_parse(7) failed!"); + res = Curl_altsvc_parse(curl, asi, "clear;\r\n", + ALPN_h1, "curl.se", 80); + fail_if(res, "Curl_altsvc_parse(7) failed!"); fail_unless(Curl_llist_count(&asi->list) == 10, "wrong number of entries"); - result = - Curl_altsvc_parse(curl, asi, - "h2=\":443\", h3=\":443\"; " - "persist = \"1\"; ma = 120;\r\n", - ALPN_h1, "curl.se", 80); - fail_if(result, "Curl_altsvc_parse(6) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\":443\", h3=\":443\"; " + "persist = \"1\"; ma = 120;\r\n", + ALPN_h1, "curl.se", 80); + fail_if(res, "Curl_altsvc_parse(6) failed!"); fail_unless(Curl_llist_count(&asi->list) == 12, "wrong number of entries"); /* clear - without semicolon */ - result = Curl_altsvc_parse(curl, asi, "clear\r\n", - ALPN_h1, "curl.se", 80); - fail_if(result, "Curl_altsvc_parse(7) failed!"); + res = Curl_altsvc_parse(curl, asi, "clear\r\n", + ALPN_h1, "curl.se", 80); + fail_if(res, "Curl_altsvc_parse(7) failed!"); fail_unless(Curl_llist_count(&asi->list) == 10, "wrong number of entries"); /* only a non-existing alpn */ - result = Curl_altsvc_parse(curl, asi, - "h6=\"example.net:443\"; ma=\"180\";\r\n", - ALPN_h2, "5.example.net", 80); - fail_if(result, "Curl_altsvc_parse(8) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h6=\"example.net:443\"; ma=\"180\";\r\n", + ALPN_h2, "5.example.net", 80); + fail_if(res, "Curl_altsvc_parse(8) failed!"); /* missing quote in alpn host */ - result = Curl_altsvc_parse(curl, asi, - "h2=\"example.net:443,; ma=\"180\";\r\n", - ALPN_h2, "6.example.net", 80); - fail_if(result, "Curl_altsvc_parse(9) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\"example.net:443,; ma=\"180\";\r\n", + ALPN_h2, "6.example.net", 80); + fail_if(res, "Curl_altsvc_parse(9) failed!"); /* missing port in host name */ - result = Curl_altsvc_parse(curl, asi, - "h2=\"example.net\"; ma=\"180\";\r\n", - ALPN_h2, "7.example.net", 80); - fail_if(result, "Curl_altsvc_parse(10) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\"example.net\"; ma=\"180\";\r\n", + ALPN_h2, "7.example.net", 80); + fail_if(res, "Curl_altsvc_parse(10) failed!"); /* illegal port in host name */ - result = Curl_altsvc_parse(curl, asi, - "h2=\"example.net:70000\"; ma=\"180\";\r\n", - ALPN_h2, "8.example.net", 80); - fail_if(result, "Curl_altsvc_parse(11) failed!"); + res = Curl_altsvc_parse(curl, asi, + "h2=\"example.net:70000\"; ma=\"180\";\r\n", + ALPN_h2, "8.example.net", 80); + fail_if(res, "Curl_altsvc_parse(11) failed!"); Curl_altsvc_save(curl, asi, outname); diff --git a/tests/unit/unit1656.c b/tests/unit/unit1656.c index 98e25b7c22a1..322aa2dbe329 100644 --- a/tests/unit/unit1656.c +++ b/tests/unit/unit1656.c @@ -30,23 +30,23 @@ struct test_spec { const char *input; const char *exp_output; - CURLcode exp_result; + CURLcode exp_res; }; static bool do_test(const struct test_spec *spec, size_t i, struct dynbuf *dbuf) { - CURLcode result; + CURLcode res; const char *in = spec->input; curlx_dyn_reset(dbuf); - result = Curl_x509_GTime2str(dbuf, in, in + strlen(in)); - if(result != spec->exp_result) { + res = Curl_x509_GTime2str(dbuf, in, in + strlen(in)); + if(res != spec->exp_res) { curl_mfprintf(stderr, "test %zu: expect result %d, got %d\n", - i, spec->exp_result, result); + i, spec->exp_res, res); return FALSE; } - else if(!result && strcmp(spec->exp_output, curlx_dyn_ptr(dbuf))) { + else if(!res && strcmp(spec->exp_output, curlx_dyn_ptr(dbuf))) { curl_mfprintf(stderr, "test %zu: input '%s', expected output '%s', got '%s'\n", i, in, spec->exp_output, curlx_dyn_ptr(dbuf)); diff --git a/tests/unit/unit1657.c b/tests/unit/unit1657.c index 4898d6c13943..c03cd51f55a8 100644 --- a/tests/unit/unit1657.c +++ b/tests/unit/unit1657.c @@ -30,7 +30,7 @@ struct test1657_spec { CURLcode (*setbuf)(const struct test1657_spec *spec, struct dynbuf *buf); size_t n; - CURLcode exp_result; + CURLcode exp_res; }; static CURLcode make1657_nested(const struct test1657_spec *spec, @@ -64,22 +64,22 @@ static const struct test1657_spec test1657_specs[] = { static bool do_test1657(const struct test1657_spec *spec, size_t i, struct dynbuf *buf) { - CURLcode result; + CURLcode res; struct Curl_asn1Element elem; const char *in; memset(&elem, 0, sizeof(elem)); curlx_dyn_reset(buf); - result = spec->setbuf(spec, buf); - if(result) { - curl_mfprintf(stderr, "test %zu: error setting buf %d\n", i, result); + res = spec->setbuf(spec, buf); + if(res) { + curl_mfprintf(stderr, "test %zu: error setting buf %d\n", i, res); return FALSE; } in = curlx_dyn_ptr(buf); - result = Curl_x509_getASN1Element(&elem, in, in + curlx_dyn_len(buf)); - if(result != spec->exp_result) { + res = Curl_x509_getASN1Element(&elem, in, in + curlx_dyn_len(buf)); + if(res != spec->exp_res) { curl_mfprintf(stderr, "test %zu: expect result %d, got %d\n", - i, spec->exp_result, result); + i, spec->exp_res, res); return FALSE; } return TRUE; diff --git a/tests/unit/unit1658.c b/tests/unit/unit1658.c index 6db104309287..3273c2141aae 100644 --- a/tests/unit/unit1658.c +++ b/tests/unit/unit1658.c @@ -48,11 +48,11 @@ extern void doh_print_httpsrr(struct Curl_easy *data, */ static char rrbuffer[256]; -static void rrresults(struct Curl_https_rrinfo *rr, CURLcode result) +static void rrresults(struct Curl_https_rrinfo *rr, CURLcode res) { char *p = rrbuffer; char *pend = rrbuffer + sizeof(rrbuffer); - curl_msnprintf(rrbuffer, sizeof(rrbuffer), "r:%d|", (int)result); + curl_msnprintf(rrbuffer, sizeof(rrbuffer), "r:%d|", (int)res); p += strlen(rrbuffer); if(rr) { @@ -502,7 +502,7 @@ static CURLcode test_unit1658(const char *arg) } }; - CURLcode result = CURLE_OUT_OF_MEMORY; + CURLcode res = CURLE_OUT_OF_MEMORY; CURL *easy; easy = curl_easy_init(); @@ -516,10 +516,10 @@ static CURLcode test_unit1658(const char *arg) curl_mprintf("test %u: %s\n", i, t[i].name); - result = doh_resp_decode_httpsrr(easy, t[i].dns, t[i].len, &hrr); + res = doh_resp_decode_httpsrr(easy, t[i].dns, t[i].len, &hrr); /* create an output */ - rrresults(hrr, result); + rrresults(hrr, res); /* is the output the expected? */ if(strcmp(rrbuffer, t[i].expect)) { diff --git a/tests/unit/unit1660.c b/tests/unit/unit1660.c index cbb78202150d..376f6bdcfa45 100644 --- a/tests/unit/unit1660.c +++ b/tests/unit/unit1660.c @@ -54,7 +54,7 @@ static CURLcode test_unit1660(const char *arg) const char *host; const char *chost; /* if non-NULL, use to lookup with */ const char *hdr; /* if NULL, just do the lookup */ - const CURLcode result; /* parse result */ + const CURLcode res; /* parse result */ }; static const struct testit headers[] = { @@ -110,7 +110,7 @@ static CURLcode test_unit1660(const char *arg) { NULL, NULL, NULL, CURLE_OK } }; - CURLcode result; + CURLcode res; struct stsentry *e; struct hsts *h = Curl_hsts_init(); int i; @@ -132,16 +132,16 @@ static CURLcode test_unit1660(const char *arg) for(i = 0; headers[i].host ; i++) { if(headers[i].hdr) { - result = Curl_hsts_parse(h, headers[i].host, headers[i].hdr); + res = Curl_hsts_parse(h, headers[i].host, headers[i].hdr); - if(result != headers[i].result) { + if(res != headers[i].res) { curl_mfprintf(stderr, "Curl_hsts_parse(%s) failed: %d\n", - headers[i].hdr, result); + headers[i].hdr, res); unitfail++; continue; } - else if(result) { - curl_mprintf("Input %u: error %d\n", i, (int) result); + else if(res) { + curl_mprintf("Input %u: error %d\n", i, (int)res); continue; } } diff --git a/tests/unit/unit1661.c b/tests/unit/unit1661.c index 446ef51bda3e..6cc448554401 100644 --- a/tests/unit/unit1661.c +++ b/tests/unit/unit1661.c @@ -52,7 +52,7 @@ static CURLcode test_unit1661(const char *arg) UNITTEST_BEGIN(t1661_setup(&bufref)) const char *buffer = NULL; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; /** * testing Curl_bufref_init. @@ -90,8 +90,8 @@ static CURLcode test_unit1661(const char *arg) /** * testing Curl_bufref_memdup */ - result = Curl_bufref_memdup(&bufref, "1661", 3); - abort_unless(result == CURLE_OK, curl_easy_strerror(result)); + res = Curl_bufref_memdup(&bufref, "1661", 3); + abort_unless(res == CURLE_OK, curl_easy_strerror(res)); fail_unless(freecount == 1, "Destructor not called"); fail_unless((const char *)bufref.ptr != buffer, "Returned pointer not set"); buffer = (const char *)Curl_bufref_ptr(&bufref); diff --git a/tests/unit/unit2600.c b/tests/unit/unit2600.c index fbf53c510791..6a03c438dcd9 100644 --- a/tests/unit/unit2600.c +++ b/tests/unit/unit2600.c @@ -84,7 +84,7 @@ struct test_case { int exp_cf6_creations; timediff_t min_duration_ms; timediff_t max_duration_ms; - CURLcode exp_result; + CURLcode exp_res; const char *pref_family; }; @@ -96,7 +96,7 @@ struct ai_family_stats { }; struct test_result { - CURLcode result; + CURLcode res; struct curltime started; struct curltime ended; struct ai_family_stats cf4; @@ -189,13 +189,13 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, struct cf_test_ctx *ctx = NULL; struct Curl_cfilter *cf = NULL; timediff_t created_at; - CURLcode result; + CURLcode res; (void)data; (void)conn; ctx = calloc(1, sizeof(*ctx)); if(!ctx) { - result = CURLE_OUT_OF_MEMORY; + res = CURLE_OUT_OF_MEMORY; goto out; } ctx->idx = test_idx++; @@ -224,19 +224,19 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, ctx->stats->last_created = created_at; infof(data, "%04dms: cf[%s] created", (int)created_at, ctx->id); - result = Curl_cf_create(&cf, &cft_test, ctx); - if(result) + res = Curl_cf_create(&cf, &cft_test, ctx); + if(res) goto out; Curl_expire(data, ctx->fail_delay_ms, EXPIRE_TIMEOUT); out: - *pcf = (!result) ? cf : NULL; - if(result) { + *pcf = (!res) ? cf : NULL; + if(res) { free(cf); free(ctx); } - return result; + return res; } static void check_result(const struct test_case *tc, @@ -248,12 +248,12 @@ static void check_result(const struct test_case *tc, duration_ms = curlx_timediff_ms(tr->ended, tr->started); curl_mfprintf(stderr, "%d: test case took %dms\n", tc->id, (int)duration_ms); - if(tr->result != tc->exp_result - && CURLE_OPERATION_TIMEDOUT != tr->result) { + if(tr->res != tc->exp_res + && CURLE_OPERATION_TIMEDOUT != tr->res) { /* on CI we encounter the TIMEOUT result, since images get less CPU * and events are not as sharply timed. */ curl_msprintf(msg, "%d: expected result %d but got %d", - tc->id, tc->exp_result, tr->result); + tc->id, tc->exp_res, tr->res); fail(msg); } if(tr->cf4.creations != tc->exp_cf4_creations) { @@ -326,7 +326,7 @@ static void test_connect(CURL *easy, const struct test_case *tc) tr.cf4.family = "v4"; tr.started = curlx_now(); - tr.result = curl_easy_perform(easy); + tr.res = curl_easy_perform(easy); tr.ended = curlx_now(); curl_easy_setopt(easy, CURLOPT_RESOLVE, NULL); diff --git a/tests/unit/unit2601.c b/tests/unit/unit2601.c index aadd69fc1204..8411c19e9878 100644 --- a/tests/unit/unit2601.c +++ b/tests/unit/unit2601.c @@ -85,7 +85,7 @@ static void check_bufq(size_t pool_spares, struct bufq q; struct bufc_pool pool; size_t max_len = chunk_size * max_chunks; - CURLcode result; + CURLcode res; ssize_t i; size_t n2; size_t nwritten, nread; @@ -105,20 +105,20 @@ static void check_bufq(size_t pool_spares, fail_unless(q.spare == NULL, "init: spare not NULL"); fail_unless(Curl_bufq_len(&q) == 0, "init: bufq length != 0"); - result = Curl_bufq_write(&q, test_data, wsize, &n2); + res = Curl_bufq_write(&q, test_data, wsize, &n2); fail_unless(n2 <= wsize, "write: wrong size returned"); - fail_unless(result == CURLE_OK, "write: wrong result returned"); + fail_unless(res == CURLE_OK, "write: wrong result returned"); /* write empty bufq full */ nwritten = 0; Curl_bufq_reset(&q); while(!Curl_bufq_is_full(&q)) { - result = Curl_bufq_write(&q, test_data, wsize, &n2); - if(!result) { + res = Curl_bufq_write(&q, test_data, wsize, &n2); + if(!res) { nwritten += n2; } - else if(result != CURLE_AGAIN) { - fail_unless(result == CURLE_AGAIN, "write-loop: unexpected result"); + else if(res != CURLE_AGAIN) { + fail_unless(res == CURLE_AGAIN, "write-loop: unexpected result"); break; } } @@ -132,12 +132,12 @@ static void check_bufq(size_t pool_spares, /* read full bufq empty */ nread = 0; while(!Curl_bufq_is_empty(&q)) { - result = Curl_bufq_read(&q, test_data, rsize, &n2); - if(!result) { + res = Curl_bufq_read(&q, test_data, rsize, &n2); + if(!res) { nread += n2; } - else if(result != CURLE_AGAIN) { - fail_unless(result == CURLE_AGAIN, "read-loop: unexpected result"); + else if(res != CURLE_AGAIN) { + fail_unless(res == CURLE_AGAIN, "read-loop: unexpected result"); break; } } @@ -153,14 +153,14 @@ static void check_bufq(size_t pool_spares, } for(i = 0; i < 1000; ++i) { - result = Curl_bufq_write(&q, test_data, wsize, &n2); - if(result && result != CURLE_AGAIN) { - fail_unless(result == CURLE_AGAIN, "rw-loop: unexpected write result"); + res = Curl_bufq_write(&q, test_data, wsize, &n2); + if(res && res != CURLE_AGAIN) { + fail_unless(res == CURLE_AGAIN, "rw-loop: unexpected write result"); break; } - result = Curl_bufq_read(&q, test_data, rsize, &n2); - if(result && result != CURLE_AGAIN) { - fail_unless(result == CURLE_AGAIN, "rw-loop: unexpected read result"); + res = Curl_bufq_read(&q, test_data, rsize, &n2); + if(res && res != CURLE_AGAIN) { + fail_unless(res == CURLE_AGAIN, "rw-loop: unexpected read result"); break; } } @@ -170,9 +170,9 @@ static void check_bufq(size_t pool_spares, Curl_bufq_init2(&q, chunk_size, max_chunks, (opts|BUFQ_OPT_SOFT_LIMIT)); nwritten = 0; while(!Curl_bufq_is_full(&q)) { - result = Curl_bufq_write(&q, test_data, wsize, &n2); - if(result || n2 != wsize) { - fail_unless(!result && n2 == wsize, "write should be complete"); + res = Curl_bufq_write(&q, test_data, wsize, &n2); + if(res || n2 != wsize) { + fail_unless(!res && n2 == wsize, "write should be complete"); break; } nwritten += n2; @@ -184,15 +184,15 @@ static void check_bufq(size_t pool_spares, fail_if(TRUE, "write: bufq full but nwritten wrong"); } /* do one more write on a full bufq, should work */ - result = Curl_bufq_write(&q, test_data, wsize, &n2); - fail_unless(!result && n2 == wsize, "write should be complete"); + res = Curl_bufq_write(&q, test_data, wsize, &n2); + fail_unless(!res && n2 == wsize, "write should be complete"); nwritten += n2; /* see that we get all out again */ nread = 0; while(!Curl_bufq_is_empty(&q)) { - result = Curl_bufq_read(&q, test_data, rsize, &n2); - if(result) { - fail_unless(result, "read-loop: unexpected fail"); + res = Curl_bufq_read(&q, test_data, rsize, &n2); + if(res) { + fail_unless(res, "read-loop: unexpected fail"); break; } nread += n2; @@ -211,12 +211,12 @@ static CURLcode test_unit2601(const char *arg) struct bufq q; size_t n; - CURLcode result; + CURLcode res; unsigned char buf[16*1024]; Curl_bufq_init(&q, 8*1024, 12); - result = Curl_bufq_read(&q, buf, 128, &n); - fail_unless(result && result == CURLE_AGAIN, "read empty fail"); + res = Curl_bufq_read(&q, buf, 128, &n); + fail_unless(res && res == CURLE_AGAIN, "read empty fail"); Curl_bufq_free(&q); check_bufq(0, 1024, 4, 128, 128, BUFQ_OPT_NONE); diff --git a/tests/unit/unit2602.c b/tests/unit/unit2602.c index f031132986cc..da2b7dba5496 100644 --- a/tests/unit/unit2602.c +++ b/tests/unit/unit2602.c @@ -33,7 +33,7 @@ static CURLcode test_unit2602(const char *arg) struct dynhds hds; struct dynbuf dbuf; - CURLcode result; + CURLcode res; size_t i; /* add 1 more header than allowed */ @@ -62,8 +62,8 @@ static CURLcode test_unit2602(const char *arg) } fail_unless(Curl_dynhds_count(&hds) == 2, "should hold 2"); /* exceed limit on # of entries */ - result = Curl_dynhds_add(&hds, "test3", 5, "789", 3); - fail_unless(result, "add should have failed"); + res = Curl_dynhds_add(&hds, "test3", 5, "789", 3); + fail_unless(res, "add should have failed"); fail_unless(Curl_dynhds_count_name(&hds, "test", 4) == 0, "false positive"); fail_unless(Curl_dynhds_count_name(&hds, "test1", 4) == 0, "false positive"); @@ -94,9 +94,9 @@ static CURLcode test_unit2602(const char *arg) fail_unless(Curl_dynhds_cremove(&hds, "blablabla") == 2, "should"); fail_if(Curl_dynhds_ccontains(&hds, "blablabla"), "should not"); - result = Curl_dynhds_h1_cadd_line(&hds, "blablabla thingies"); - fail_unless(result, "add should have failed"); - if(!result) { + res = Curl_dynhds_h1_cadd_line(&hds, "blablabla thingies"); + fail_unless(res, "add should have failed"); + if(!res) { fail_unless(Curl_dynhds_ccount_name(&hds, "bLABlaBlA") == 0, "should"); fail_if(Curl_dynhds_cadd(&hds, "Bla-Bla", "thingies"), "add failed"); @@ -113,8 +113,8 @@ static CURLcode test_unit2602(const char *arg) Curl_dynhds_free(&hds); Curl_dynhds_init(&hds, 128, 4*1024); /* continuation without previous header fails */ - result = Curl_dynhds_h1_cadd_line(&hds, " indented value"); - fail_unless(result, "add should have failed"); + res = Curl_dynhds_h1_cadd_line(&hds, " indented value"); + fail_unless(res, "add should have failed"); /* continuation with previous header must succeed */ fail_if(Curl_dynhds_h1_cadd_line(&hds, "ti1: val1"), "add"); diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index 13f7e80d8acb..695b1210071e 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -36,7 +36,7 @@ static CURLcode test_unit2604(const char *arg) const char *expect; /* the returned content */ const char *next; /* what cp points to after the call */ const char *home; - CURLcode result; + CURLcode res; }; #if defined(CURL_GNUC_DIAG) || defined(__clang__) @@ -86,14 +86,14 @@ static CURLcode test_unit2604(const char *arg) for(i = 0; list[i].home; i++) { char *path; const char *cp = i == 0 ? cp0 : list[i].cp; - CURLcode result = Curl_get_pathname(&cp, &path, list[i].home); + CURLcode res = Curl_get_pathname(&cp, &path, list[i].home); curl_mprintf("%u - Curl_get_pathname(\"%s\", ... \"%s\") == %u\n", i, - list[i].cp, list[i].home, list[i].result); - if(result != list[i].result) { - curl_mprintf("... returned %d\n", result); + list[i].cp, list[i].home, list[i].res); + if(res != list[i].res) { + curl_mprintf("... returned %d\n", res); unitfail++; } - if(!result) { + if(!res) { if(cp && strcmp(cp, list[i].next)) { curl_mprintf("... cp points to '%s', not '%s' as expected \n", cp, list[i].next); diff --git a/tests/unit/unit2605.c b/tests/unit/unit2605.c index b94e87e78cea..71c37f32cfcb 100644 --- a/tests/unit/unit2605.c +++ b/tests/unit/unit2605.c @@ -36,7 +36,7 @@ static CURLcode test_unit2605(const char *arg) curl_off_t filesize; curl_off_t start; curl_off_t size; - CURLcode result; + CURLcode res; }; int i; @@ -78,16 +78,16 @@ static CURLcode test_unit2605(const char *arg) for(i = 0; list[i].r; i++) { curl_off_t start; curl_off_t size; - CURLcode result; + CURLcode res; curl_mprintf("%u: '%s' (file size: %" FMT_OFF_T ")\n", i, list[i].r, list[i].filesize); - result = Curl_ssh_range(curl, list[i].r, list[i].filesize, - &start, &size); - if(result != list[i].result) { - curl_mprintf("... returned %d\n", result); + res = Curl_ssh_range(curl, list[i].r, list[i].filesize, + &start, &size); + if(res != list[i].res) { + curl_mprintf("... returned %d\n", res); unitfail++; } - if(!result) { + if(!res) { if(start != list[i].start) { curl_mprintf("... start (%" FMT_OFF_T ") was not %" FMT_OFF_T " \n", start, list[i].start); diff --git a/tests/unit/unit3200.c b/tests/unit/unit3200.c index 15abba25db79..0b3c87691157 100644 --- a/tests/unit/unit3200.c +++ b/tests/unit/unit3200.c @@ -76,7 +76,7 @@ static CURLcode test_unit3200(const char *arg) #endif size_t i; - CURLcode result = CURLE_OK; + CURLcode res = CURLE_OK; for(i = 0; i < CURL_ARRAYSIZE(filecontents); i++) { FILE *fp; struct dynbuf buf; @@ -96,62 +96,62 @@ static CURLcode test_unit3200(const char *arg) curl_mfprintf(stderr, "Test %zd...", i); switch(i) { case 0: - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE1\n", line), + fail_unless(!res && line && !strcmp("LINE1\n", line), "First line failed (1)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE2 NEWLINE\n", line), + fail_unless(!res && line && !strcmp("LINE2 NEWLINE\n", line), "Second line failed (1)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); abort_unless(eof, "Missed EOF (1)"); break; case 1: - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE1\n", line), + fail_unless(!res && line && !strcmp("LINE1\n", line), "First line failed (2)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE2 NONEWLINE\n", line), + fail_unless(!res && line && !strcmp("LINE2 NONEWLINE\n", line), "Second line failed (2)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); abort_unless(eof, "Missed EOF (2)"); break; case 2: - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE1\n", line), + fail_unless(!res && line && !strcmp("LINE1\n", line), "First line failed (3)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); fail_unless(!curlx_dyn_len(&buf), "Did not detect max read on EOF (3)"); break; case 3: - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE1\n", line), + fail_unless(!res && line && !strcmp("LINE1\n", line), "First line failed (4)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); fail_unless(!curlx_dyn_len(&buf), "Did not ignore partial on EOF (4)"); break; case 4: - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE1\n", line), + fail_unless(!res && line && !strcmp("LINE1\n", line), "First line failed (5)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); fail_unless(!curlx_dyn_len(&buf), "Did not bail out on too long line"); break; case 5: - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); line = curlx_dyn_ptr(&buf); - fail_unless(!result && line && !strcmp("LINE1\x1aTEST\n", line), + fail_unless(!res && line && !strcmp("LINE1\x1aTEST\n", line), "Missed/Misinterpreted ^Z (6)"); - result = Curl_get_line(&buf, fp, &eof); + res = Curl_get_line(&buf, fp, &eof); abort_unless(eof, "Missed EOF (6)"); break; default: @@ -162,7 +162,7 @@ static CURLcode test_unit3200(const char *arg) curlx_fclose(fp); curl_mfprintf(stderr, "OK\n"); } - return result; + return res; #endif From ae7b4eeade0e4903e97fe2a9bac013efc034221f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Nov 2025 23:47:10 +0100 Subject: [PATCH 374/885] curl_setup.h: drop stray `#undef stat` (Windows) Follow-up to 9678ff5b1bfea1c847aee4f9edf023e8f01c9293 #18776 Closes #19519 --- lib/curl_setup.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 7c033623c5ff..d41c9b8ceabc 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -493,7 +493,6 @@ # define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence) # undef fstat # define fstat(fdes,stp) _fstati64(fdes, stp) -# undef stat # define struct_stat struct _stati64 # define LSEEK_ERROR (__int64)-1 # else From 3fc31c4ee200c7ae9b5fd8dbd9b590a6405395cc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Nov 2025 23:03:52 +0100 Subject: [PATCH 375/885] config2setopts: bail out if curl_url_get() returns OOM Closes #19518 --- src/config2setopts.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config2setopts.c b/src/config2setopts.c index 57e7a7337669..7d099602d30b 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -141,8 +141,9 @@ static CURLcode url_proto_and_rewrite(char **url, curl_url_set(uh, CURLUPART_URL, *url, CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME); if(!uc) { - if(!curl_url_get(uh, CURLUPART_SCHEME, &schemep, - CURLU_DEFAULT_SCHEME)) { + uc = curl_url_get(uh, CURLUPART_SCHEME, &schemep, + CURLU_DEFAULT_SCHEME); + if(!uc) { #ifdef CURL_DISABLE_IPFS (void)config; #else @@ -162,6 +163,8 @@ static CURLcode url_proto_and_rewrite(char **url, proto = proto_token(schemep); curl_free(schemep); } + else if(uc == CURLUE_OUT_OF_MEMORY) + result = CURLE_OUT_OF_MEMORY; } else if(uc == CURLUE_OUT_OF_MEMORY) result = CURLE_OUT_OF_MEMORY; From 5f4cd4c689c822ce957bb415076f0c78e5f474b5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Nov 2025 09:59:25 +0100 Subject: [PATCH 376/885] DEPRECATE: remove RTMP support in April 2026 URL: https://curl.se/mail/lib-2025-11/0008.html --- docs/DEPRECATE.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 43c94875b175..48c44e6c6bba 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -70,6 +70,18 @@ stack. We remove the OpenSSL-QUIC backend in March 2026. +## RTMP + +RTMP in curl is powered by the 3rd party library librtmp. + + - RTMP is barely used by curl users (2.2% in the 2025 survey) + - librtmp has no test cases, makes no proper releases and has not had a single + commit within the last year + - librtmp parses the URL itself and requires non-compliant URLs for this + - we have no RTMP tests + +Support for RTMP in libcurl gets removed in April 2026. + ## Past removals - axTLS (removed in 7.63.0) From 971e8d661c68ce8859885c3ae865ff9441b62f0e Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 14 Nov 2025 12:51:31 +0100 Subject: [PATCH 377/885] examples/multithread: fix race condition Reported-by: Nick Korepanov Fixes #19524 Closes #19526 --- docs/examples/multithread.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/examples/multithread.c b/docs/examples/multithread.c index 36836ef47533..3ecca2590820 100644 --- a/docs/examples/multithread.c +++ b/docs/examples/multithread.c @@ -50,14 +50,19 @@ static const char * const urls[NUMT]= { "www.example" }; -static void *pull_one_url(void *pindex) +struct targ { + const char *url; +}; + + +static void *pull_one_url(void *p) { CURL *curl; + struct targ *targ = p; curl = curl_easy_init(); if(curl) { - int i = *(int *)pindex; - curl_easy_setopt(curl, CURLOPT_URL, urls[i]); + curl_easy_setopt(curl, CURLOPT_URL, targ->url); (void)curl_easy_perform(curl); /* ignores error */ curl_easy_cleanup(curl); } @@ -76,6 +81,7 @@ int main(void) { CURLcode res; pthread_t tid[NUMT]; + struct targ targs[NUMT]; int i; /* Must initialize libcurl before any threads are started */ @@ -84,10 +90,12 @@ int main(void) return (int)res; for(i = 0; i < NUMT; i++) { - int error = pthread_create(&tid[i], - NULL, /* default attributes please */ - pull_one_url, - (void *)&i); + int error; + targs[i].url = urls[i]; + error = pthread_create(&tid[i], + NULL, /* default attributes please */ + pull_one_url, + (void *)&targs[i]); if(error) fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); else From 9a633ec04f3a7f5e9260ff73c08f0140fa6668de Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 14 Nov 2025 10:52:43 +0100 Subject: [PATCH 378/885] connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' Line 143: "if(duringconnect)" would always equal true. While this is harmless, I believe this minor tweak makes the flow slightly more obvious to the reader and avoids the redundant condition. Pointed out by CodeSonar Closes #19523 --- lib/connect.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/connect.c b/lib/connect.c index 18d9028c6cfa..573b02952b10 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -116,6 +116,7 @@ timediff_t Curl_timeleft_ms(struct Curl_easy *data, { timediff_t timeleft_ms = 0; timediff_t ctimeleft_ms = 0; + timediff_t ctimeout_ms; struct curltime now; /* The duration of a connect and the total transfer are calculated from two @@ -136,20 +137,19 @@ timediff_t Curl_timeleft_ms(struct Curl_easy *data, curlx_timediff_ms(*nowp, data->progress.t_startop); if(!timeleft_ms) timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ - if(!duringconnect) - return timeleft_ms; /* no connect check, this is it */ } - if(duringconnect) { - timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ? - data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT; - ctimeleft_ms = ctimeout_ms - - curlx_timediff_ms(*nowp, data->progress.t_startsingle); - if(!ctimeleft_ms) - ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ - if(!timeleft_ms) - return ctimeleft_ms; /* no general timeout, this is it */ - } + if(!duringconnect) + return timeleft_ms; /* no connect check, this is it */ + ctimeout_ms = (data->set.connecttimeout > 0) ? + data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT; + ctimeleft_ms = ctimeout_ms - + curlx_timediff_ms(*nowp, data->progress.t_startsingle); + if(!ctimeleft_ms) + ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ + if(!timeleft_ms) + return ctimeleft_ms; /* no general timeout, this is it */ + /* return minimal time left or max amount already expired */ return (ctimeleft_ms < timeleft_ms) ? ctimeleft_ms : timeleft_ms; } From 0abb72210ee07cb2630d8393a1d2e7b53c255732 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 14 Nov 2025 12:45:58 +0100 Subject: [PATCH 379/885] getinfo: improve perf in debug mode Save some cpu cycles in debug mode for getinfo. Look up env vars for overwriting variables only when variables are actually requested. Closes #19525 --- lib/getinfo.c | 113 ++++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/lib/getinfo.c b/lib/getinfo.c index f57a454d5db3..6a16258b13e1 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -204,31 +204,31 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, } lptr; #ifdef DEBUGBUILD - const char *timestr = getenv("CURL_TIME"); - if(timestr) { - curl_off_t val; - curlx_str_number(×tr, &val, TIME_T_MAX); - switch(info) { - case CURLINFO_LOCAL_PORT: + const char *envstr; + + /* use another variable for this to allow different values */ + switch(info) { + case CURLINFO_LOCAL_PORT: + envstr = getenv("CURL_TIME"); + if(envstr) { + curl_off_t val; + curlx_str_number(&envstr, &val, TIME_T_MAX); *param_longp = (long)val; return CURLE_OK; - default: - break; } - } - /* use another variable for this to allow different values */ - timestr = getenv("CURL_DEBUG_SIZE"); - if(timestr) { - curl_off_t val; - curlx_str_number(×tr, &val, LONG_MAX); - switch(info) { - case CURLINFO_HEADER_SIZE: - case CURLINFO_REQUEST_SIZE: + break; + case CURLINFO_HEADER_SIZE: + case CURLINFO_REQUEST_SIZE: + envstr = getenv("CURL_DEBUG_SIZE"); + if(envstr) { + curl_off_t val; + curlx_str_number(&envstr, &val, LONG_MAX); *param_longp = (long)val; return CURLE_OK; - default: - break; } + break; + default: + break; } #endif @@ -381,28 +381,29 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, curl_off_t *param_offt) { #ifdef DEBUGBUILD - const char *timestr = getenv("CURL_TIME"); - if(timestr) { - curl_off_t val; - curlx_str_number(×tr, &val, CURL_OFF_T_MAX); - - switch(info) { - case CURLINFO_TOTAL_TIME_T: - case CURLINFO_NAMELOOKUP_TIME_T: - case CURLINFO_CONNECT_TIME_T: - case CURLINFO_APPCONNECT_TIME_T: - case CURLINFO_PRETRANSFER_TIME_T: - case CURLINFO_POSTTRANSFER_TIME_T: - case CURLINFO_QUEUE_TIME_T: - case CURLINFO_STARTTRANSFER_TIME_T: - case CURLINFO_REDIRECT_TIME_T: - case CURLINFO_SPEED_DOWNLOAD_T: - case CURLINFO_SPEED_UPLOAD_T: + const char *envstr; + switch(info) { + case CURLINFO_TOTAL_TIME_T: + case CURLINFO_NAMELOOKUP_TIME_T: + case CURLINFO_CONNECT_TIME_T: + case CURLINFO_APPCONNECT_TIME_T: + case CURLINFO_PRETRANSFER_TIME_T: + case CURLINFO_POSTTRANSFER_TIME_T: + case CURLINFO_QUEUE_TIME_T: + case CURLINFO_STARTTRANSFER_TIME_T: + case CURLINFO_REDIRECT_TIME_T: + case CURLINFO_SPEED_DOWNLOAD_T: + case CURLINFO_SPEED_UPLOAD_T: + envstr = getenv("CURL_TIME"); + if(envstr) { + curl_off_t val; + curlx_str_number(&envstr, &val, CURL_OFF_T_MAX); *param_offt = (curl_off_t)val; return CURLE_OK; - default: - break; } + break; + default: + break; } #endif switch(info) { @@ -480,26 +481,28 @@ static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info, double *param_doublep) { #ifdef DEBUGBUILD - const char *timestr = getenv("CURL_TIME"); - if(timestr) { - curl_off_t val; - curlx_str_number(×tr, &val, CURL_OFF_T_MAX); - - switch(info) { - case CURLINFO_TOTAL_TIME: - case CURLINFO_NAMELOOKUP_TIME: - case CURLINFO_CONNECT_TIME: - case CURLINFO_APPCONNECT_TIME: - case CURLINFO_PRETRANSFER_TIME: - case CURLINFO_STARTTRANSFER_TIME: - case CURLINFO_REDIRECT_TIME: - case CURLINFO_SPEED_DOWNLOAD: - case CURLINFO_SPEED_UPLOAD: + const char *envstr; + + switch(info) { + case CURLINFO_TOTAL_TIME: + case CURLINFO_NAMELOOKUP_TIME: + case CURLINFO_CONNECT_TIME: + case CURLINFO_APPCONNECT_TIME: + case CURLINFO_PRETRANSFER_TIME: + case CURLINFO_STARTTRANSFER_TIME: + case CURLINFO_REDIRECT_TIME: + case CURLINFO_SPEED_DOWNLOAD: + case CURLINFO_SPEED_UPLOAD: + envstr = getenv("CURL_TIME"); + if(envstr) { + curl_off_t val; + curlx_str_number(&envstr, &val, CURL_OFF_T_MAX); *param_doublep = (double)val; return CURLE_OK; - default: - break; } + break; + default: + break; } #endif switch(info) { From 9f979ea683253b5c2517dc822c060734bfec287a Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 14 Nov 2025 15:25:04 +0100 Subject: [PATCH 380/885] vtls: pinned key check Cleanup the vtls pinned key matching somewhat. Add a DEBUGF for pinned key hashes that do not match, so we can see in traces what was going on. Ref #19489 Closes #19529 --- lib/vtls/vtls.c | 60 ++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 3858cad98312..918a4686fcbc 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -772,8 +772,9 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, /* only do this if pinnedpubkey starts with "sha256//", length 8 */ if(!strncmp(pinnedpubkey, "sha256//", 8)) { CURLcode encode; - size_t encodedlen = 0; - char *encoded = NULL, *pinkeycopy, *begin_pos, *end_pos; + char *cert_hash = NULL; + const char *pinned_hash, *end_pos; + size_t cert_hash_len = 0, pinned_hash_len; unsigned char *sha256sumdigest; if(!Curl_ssl->sha256sum) { @@ -790,50 +791,37 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, if(!encode) encode = curlx_base64_encode((char *)sha256sumdigest, - CURL_SHA256_DIGEST_LENGTH, &encoded, - &encodedlen); + CURL_SHA256_DIGEST_LENGTH, + &cert_hash, &cert_hash_len); Curl_safefree(sha256sumdigest); if(encode) return encode; - infof(data, " public key hash: sha256//%s", encoded); + infof(data, " public key hash: sha256//%s", cert_hash); - /* it starts with sha256//, copy so we can modify it */ - pinkeycopy = strdup(pinnedpubkey); - if(!pinkeycopy) { - Curl_safefree(encoded); - return CURLE_OUT_OF_MEMORY; - } - /* point begin_pos to the copy, and start extracting keys */ - begin_pos = pinkeycopy; - do { - end_pos = strstr(begin_pos, ";sha256//"); - /* - * if there is an end_pos, null-terminate, otherwise it will go to the - * end of the original string - */ - if(end_pos) - end_pos[0] = '\0'; - - /* compare base64 sha256 digests, 8 is the length of "sha256//" */ - if(encodedlen == strlen(begin_pos + 8) && - !memcmp(encoded, begin_pos + 8, encodedlen)) { + pinned_hash = pinnedpubkey; + while(pinned_hash && + !strncmp(pinned_hash, "sha256//", (sizeof("sha256//")-1))) { + pinned_hash = pinned_hash + (sizeof("sha256//")-1); + end_pos = strchr(pinned_hash, ';'); + pinned_hash_len = end_pos ? + (size_t)(end_pos - pinned_hash) : strlen(pinned_hash); + + /* compare base64 sha256 digests" */ + if(cert_hash_len == pinned_hash_len && + !memcmp(cert_hash, pinned_hash, cert_hash_len)) { + DEBUGF(infof(data, "public key hash matches pinned value")); result = CURLE_OK; break; } - /* - * change back the null-terminator we changed earlier, - * and look for next begin - */ - if(end_pos) { - end_pos[0] = ';'; - begin_pos = strstr(end_pos, "sha256//"); - } - } while(end_pos && begin_pos); - Curl_safefree(encoded); - Curl_safefree(pinkeycopy); + DEBUGF(infof(data, "public key hash does not match 'sha256//%.*s'", + (int)pinned_hash_len, pinned_hash)); + /* next one or we are at the end */ + pinned_hash = end_pos ? (end_pos + 1) : NULL; + } + Curl_safefree(cert_hash); } else { long filesize; From dc34498d18d3303d67364423b4aa0daab4afb3ba Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 14 Nov 2025 14:18:12 +0100 Subject: [PATCH 381/885] cf-socket: trace ignored errors Instead of blasting the user with infof() statements. Reported-by: Aleksandr Sergeev Fixes #19520 Closes #19527 --- lib/cf-socket.c | 95 ++++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 44 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index d4244fc2ad6a..555bb77903ca 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -103,7 +103,9 @@ static void set_ipv6_v6only(curl_socket_t sockfd, int on) #define set_ipv6_v6only(x,y) #endif -static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd) +static void tcpnodelay(struct Curl_cfilter *cf, + struct Curl_easy *data, + curl_socket_t sockfd) { #if defined(TCP_NODELAY) && defined(CURL_TCP_NODELAY_SUPPORTED) curl_socklen_t onoff = (curl_socklen_t) 1; @@ -112,9 +114,10 @@ static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd) if(setsockopt(sockfd, level, TCP_NODELAY, (void *)&onoff, sizeof(onoff)) < 0) - infof(data, "Could not set TCP_NODELAY: %s", - curlx_strerror(SOCKERRNO, buffer, sizeof(buffer))); + CURL_TRC_CF(data, cf, "Could not set TCP_NODELAY: %s", + curlx_strerror(SOCKERRNO, buffer, sizeof(buffer))); #else + (void)cf; (void)data; (void)sockfd; #endif @@ -125,22 +128,25 @@ static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd) sending data to a dead peer (instead of relying on the 4th argument to send being MSG_NOSIGNAL). Possibly also existing and in use on other BSD systems? */ -static void nosigpipe(struct Curl_easy *data, +static void nosigpipe(struct Curl_cfilter *cf, + struct Curl_easy *data, curl_socket_t sockfd) { int onoff = 1; - (void)data; if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&onoff, sizeof(onoff)) < 0) { #ifndef CURL_DISABLE_VERBOSE_STRINGS char buffer[STRERROR_LEN]; - infof(data, "Could not set SO_NOSIGPIPE: %s", - curlx_strerror(SOCKERRNO, buffer, sizeof(buffer))); + CURL_TRC_CF(data, cf, "Could not set SO_NOSIGPIPE: %s", + curlx_strerror(SOCKERRNO, buffer, sizeof(buffer))); +#else + (void)cf; + (void)data; #endif } } #else -#define nosigpipe(x,y) Curl_nop_stmt +#define nosigpipe(x,y,z) Curl_nop_stmt #endif #if defined(USE_WINSOCK) && \ @@ -172,7 +178,8 @@ struct tcp_keepalive { #endif static void -tcpkeepalive(struct Curl_easy *data, +tcpkeepalive(struct Curl_cfilter *cf, + struct Curl_easy *data, curl_socket_t sockfd) { int optval = data->set.tcp_keepalive ? 1 : 0; @@ -180,9 +187,9 @@ tcpkeepalive(struct Curl_easy *data, /* only set IDLE and INTVL if setting KEEPALIVE is successful */ if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set SO_KEEPALIVE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set SO_KEEPALIVE on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } else { #ifdef SIO_KEEPALIVE_VALS /* Windows */ @@ -192,24 +199,24 @@ tcpkeepalive(struct Curl_easy *data, KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (const char *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPIDLE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } optval = curlx_sltosi(data->set.tcp_keepintvl); KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, (const char *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPINTVL on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } optval = curlx_sltosi(data->set.tcp_keepcnt); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, (const char *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPCNT on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } #else /* Windows < 10.0.16299 */ struct tcp_keepalive vals; @@ -223,8 +230,8 @@ tcpkeepalive(struct Curl_easy *data, vals.keepaliveinterval = (u_long)optval; if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID) &vals, sizeof(vals), NULL, 0, &dummy, NULL, NULL) != 0) { - infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd " - "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set SIO_KEEPALIVE_VALS on fd " + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #endif #else /* !Windows */ @@ -233,9 +240,9 @@ tcpkeepalive(struct Curl_easy *data, KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPIDLE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE) /* macOS style */ @@ -243,9 +250,9 @@ tcpkeepalive(struct Curl_easy *data, KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPALIVE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE_THRESHOLD) /* Solaris <11.4 style */ @@ -253,9 +260,9 @@ tcpkeepalive(struct Curl_easy *data, KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_THRESHOLD, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } #endif #ifdef TCP_KEEPINTVL @@ -263,9 +270,9 @@ tcpkeepalive(struct Curl_easy *data, KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPINTVL on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE_ABORT_THRESHOLD) /* Solaris <11.4 style */ @@ -284,16 +291,16 @@ tcpkeepalive(struct Curl_easy *data, KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_ABORT_THRESHOLD, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPALIVE_ABORT_THRESHOLD on fd " - "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_ABORT_THRESHOLD" + " on fd %" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #endif #ifdef TCP_KEEPCNT optval = curlx_sltosi(data->set.tcp_keepcnt); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, (void *)&optval, sizeof(optval)) < 0) { - infof(data, "Failed to set TCP_KEEPCNT on fd " - "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd " + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #endif #endif @@ -1150,14 +1157,14 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, ctx->addr.socktype == SOCK_STREAM; #endif if(is_tcp && data->set.tcp_nodelay) - tcpnodelay(data, ctx->sock); + tcpnodelay(cf, data, ctx->sock); - nosigpipe(data, ctx->sock); + nosigpipe(cf, data, ctx->sock); Curl_sndbuf_init(ctx->sock); if(is_tcp && data->set.tcp_keepalive) - tcpkeepalive(data, ctx->sock); + tcpkeepalive(cf, data, ctx->sock); if(data->set.fsockopt) { /* activate callback for setting socket options */ @@ -1271,8 +1278,8 @@ static int do_connect(struct Curl_cfilter *cf, struct Curl_easy *data, #elif defined(TCP_FASTOPEN_CONNECT) /* Linux >= 4.11 */ if(setsockopt(ctx->sock, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, (void *)&optval, sizeof(optval)) < 0) - infof(data, "Failed to enable TCP Fast Open on fd %" FMT_SOCKET_T, - ctx->sock); + CURL_TRC_CF(data, cf, "Failed to enable TCP Fast Open on fd %" + FMT_SOCKET_T, ctx->sock); rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen); #elif defined(MSG_FASTOPEN) /* old Linux */ From 3d91ca8cdb3b434226e743946d428b4dd3acf2c9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 14 Nov 2025 16:42:23 +0100 Subject: [PATCH 382/885] vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally Closes #19531 --- lib/vquic/vquic-tls.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index f4ef06c33b72..46bb4c7d4c25 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -168,13 +168,11 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, (void)conn_config; result = Curl_ossl_check_peer_cert(cf, data, &ctx->ossl, peer); #elif defined(USE_GNUTLS) - if(conn_config->verifyhost) { - result = Curl_gtls_verifyserver(cf, data, ctx->gtls.session, - conn_config, &data->set.ssl, peer, - data->set.str[STRING_SSL_PINNEDPUBLICKEY]); - if(result) - return result; - } + result = Curl_gtls_verifyserver(cf, data, ctx->gtls.session, + conn_config, &data->set.ssl, peer, + data->set.str[STRING_SSL_PINNEDPUBLICKEY]); + if(result) + return result; #elif defined(USE_WOLFSSL) (void)data; if(conn_config->verifyhost) { From f37c956d0f6a05081bc6d05d9f5fe7fe9843ef98 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 14 Nov 2025 16:26:14 +0100 Subject: [PATCH 383/885] test07_22: fix flakiness The HTTP/3 tests did send 20 transfers against nghttpx with a backend that failed the uploads with a 400 and an incomplete response body. This causes stream resets. Apache keeps the connection open, but newer nghttpx closes the front connection after "too many" reset. When that bites, it depends on the number of transfers ongoing how the test case fails. This led to flaky outcomes. Reduce the transfers to just a single one and check the result of that one. Parallelism is not important here. refs #19489 Closes #19530 --- tests/http/test_07_upload.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index ad2db48a8c9c..93d1fb26bf15 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -263,15 +263,18 @@ def test_07_21_upload_parallel_large(self, env: Env, httpd, nghttpx, proto): r.check_response(count=count, http_status=200) self.check_download(r, count, fdata, curl) - # upload large data parallel to a URL that denies uploads + # upload single large data to a URL that fails uploads, causing RESETs + # (We used to do this for 20 parallel transfers, but the triggered + # stream resets make nghttpx drop the connection after several, which + # then gives a non-deterministic number of completely failed transfers) @pytest.mark.parametrize("proto", ['h2', 'h3']) - def test_07_22_upload_parallel_fail(self, env: Env, httpd, nghttpx, proto): + def test_07_22_upload_fail(self, env: Env, httpd, nghttpx, proto): if proto == 'h2' and not env.have_h2_curl(): pytest.skip("h2 not supported") if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') - count = 20 + count = 1 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}'\ f'/curltest/tweak?status=400&delay=5ms&chunks=1&body_error=reset&id=[0-{count-1}]' From 57b4fe1817b150d822ea1faeb144854b4de02fed Mon Sep 17 00:00:00 2001 From: nait-furry Date: Wed, 12 Nov 2025 01:51:37 +0300 Subject: [PATCH 384/885] limit-rate: add example using --limit-rate and --max-time together Closes #19473 --- docs/cmdline-opts/limit-rate.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/cmdline-opts/limit-rate.md b/docs/cmdline-opts/limit-rate.md index c5e276e1b575..f58fd1fcd865 100644 --- a/docs/cmdline-opts/limit-rate.md +++ b/docs/cmdline-opts/limit-rate.md @@ -15,6 +15,7 @@ Example: - --limit-rate 100K $URL - --limit-rate 1000 $URL - --limit-rate 10M $URL + - --limit-rate 200K --max-time 60 $URL --- # `--limit-rate` From f3095f0dbd7e842d4a72c0300ba4817a755c74f5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 14 Nov 2025 15:39:40 +0100 Subject: [PATCH 385/885] GHA/checksrc: check XML files for errors Closes #19528 --- .github/workflows/checksrc.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 7aa8faf6a234..94407ff6774c 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -103,10 +103,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 3 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - name: 'install pmccabe' run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list @@ -115,9 +111,25 @@ jobs: sudo apt-get -o Dpkg::Use-Pty=0 install \ pmccabe + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - name: 'check scores' run: ./scripts/top-complexity + xmllint: + name: 'xmllint' + runs-on: macos-latest + timeout-minutes: 1 + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: 'check' + run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint >/dev/null + miscchecks: name: 'misc checks' runs-on: ubuntu-latest From af4c789e0084f5076fd1f370363b054a842e79f5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 14 Nov 2025 16:58:05 +0100 Subject: [PATCH 386/885] badwords: fix two exceptions and drop them Also: - extend `dir` rule to exclude C assignments. Closes #19532 --- .github/scripts/badwords.txt | 2 +- .github/workflows/checksrc.yml | 2 +- lib/ftp.h | 6 +++--- lib/http_aws_sigv4.c | 4 ++-- lib/urldata.h | 2 +- lib/vssh/libssh.c | 12 ++++++------ lib/vssh/libssh2.c | 12 ++++++------ lib/vssh/ssh.h | 4 ++-- src/tool_cfgable.h | 2 +- src/tool_ipfs.c | 2 +- src/tool_operate.c | 2 +- src/tool_operhlp.c | 2 +- src/tool_writeout.h | 2 +- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index 7f6bca32b6a6..705c54fbac91 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -45,7 +45,7 @@ there's:there is ^(And|So|But) = Rewrite it somehow? \. But: Rewrite it somehow? \. So : Rewrite without "so" ? - dir :directory + dir [^=]:directory sub-director:subdirector you'd:you would you'll:you will diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 94407ff6774c..663811ef935d 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -176,4 +176,4 @@ jobs: # we allow some extra in source code - name: 'badwords' - run: grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include + run: grep -Ev '(\\bwill)' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include diff --git a/lib/ftp.h b/lib/ftp.h index 8d5f9c203147..f4ddb1a37cc3 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -61,11 +61,11 @@ enum { FTP_STOR_PREQUOTE, FTP_LIST_PREQUOTE, FTP_POSTQUOTE, - FTP_CWD, /* change dir */ - FTP_MKD, /* if the dir did not exist */ + FTP_CWD, /* change directory */ + FTP_MKD, /* if the directory did not exist */ FTP_MDTM, /* to figure out the datestamp */ FTP_TYPE, /* to set type when doing a head-like request */ - FTP_LIST_TYPE, /* set type when about to do a dir list */ + FTP_LIST_TYPE, /* set type when about to do a directory list */ FTP_RETR_LIST_TYPE, FTP_RETR_TYPE, /* set type when about to RETR a file */ FTP_STOR_TYPE, /* set type when about to STOR a file */ diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index b5601f45a2cb..d3d4760be780 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -1141,10 +1141,10 @@ static CURLcode http_aws_decode_encode(const char *in, size_t in_len, static bool should_urlencode(struct Curl_str *service_name) { /* - * These services require unmodified (not additionally url encoded) URL + * These services require unmodified (not additionally URL-encoded) URL * paths. * should_urlencode == true is equivalent to should_urlencode_uri_path - * from the AWS SDK. Urls are already normalized by the curl url parser + * from the AWS SDK. Urls are already normalized by the curl URL parser */ if(curlx_str_cmp(service_name, "s3") || diff --git a/lib/urldata.h b/lib/urldata.h index f92bfcb3b2a8..4b112e7072dd 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -238,7 +238,7 @@ struct ssl_backend_data; struct Curl_ssl_scache_entry; struct ssl_primary_config { - char *CApath; /* certificate dir (does not work on Windows) */ + char *CApath; /* certificate directory (does not work on Windows) */ char *CAfile; /* certificate to verify peer against */ char *issuercert; /* optional issuer certificate filename */ char *clientcert; diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 07036f900a5c..74a1da5a3e7a 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1677,7 +1677,7 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data, else if(!strncmp(cmd, "mkdir ", 6)) { if(*cp) return return_quote_error(data, sshc); - /* create dir */ + /* create directory */ myssh_to(data, sshc, SSH_SFTP_QUOTE_MKDIR); return SSH_NO_ERROR; } @@ -1703,7 +1703,7 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data, return SSH_NO_ERROR; } else if(!strncmp(cmd, "rmdir ", 6)) { - /* delete dir */ + /* delete directory */ if(*cp) return return_quote_error(data, sshc); myssh_to(data, sshc, SSH_SFTP_QUOTE_RMDIR); @@ -2157,9 +2157,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, ++sshc->slash_pos; if(rc < 0) { /* - * Abort if failure was not that the dir already exists or the - * permission was denied (creation might succeed further down the - * path) - retry on unspecific FAILURE also + * Abort if failure was not that the directory already exists or + * the permission was denied (creation might succeed further down + * the path) - retry on unspecific FAILURE also */ err = sftp_get_error(sshc->sftp_session); if((err != SSH_FX_FILE_ALREADY_EXISTS) && @@ -2744,7 +2744,7 @@ static CURLcode myssh_do_it(struct Curl_easy *data, bool *done) data->req.size = -1; /* make sure this is unknown at this point */ sshc->actualcode = CURLE_OK; /* reset error code */ - sshc->secondCreateDirs = 0; /* reset the create dir attempt state + sshc->secondCreateDirs = 0; /* reset the create directory attempt state variable */ Curl_pgrsSetUploadCounter(data, 0); diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index b414dfcf2d60..49044669fc06 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -957,7 +957,7 @@ static CURLcode sftp_quote(struct Curl_easy *data, else if(!strncmp(cmd, "mkdir ", 6)) { if(*cp) return_quote_error(data, sshc); - /* create dir */ + /* create directory */ myssh_state(data, sshc, SSH_SFTP_QUOTE_MKDIR); return result; } @@ -980,7 +980,7 @@ static CURLcode sftp_quote(struct Curl_easy *data, else if(!strncmp(cmd, "rmdir ", 6)) { if(*cp) return_quote_error(data, sshc); - /* delete dir */ + /* delete directory */ myssh_state(data, sshc, SSH_SFTP_QUOTE_RMDIR); return result; } @@ -2275,9 +2275,9 @@ static CURLcode ssh_state_sftp_create_dirs_mkdir(struct Curl_easy *data, ++sshc->slash_pos; if(rc < 0) { /* - * Abort if failure was not that the dir already exists or the - * permission was denied (creation might succeed further down the - * path) - retry on unspecific FAILURE also + * Abort if failure was not that the directory already exists or + * the permission was denied (creation might succeed further down + * the path) - retry on unspecific FAILURE also */ unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); if((sftperr != LIBSSH2_FX_FILE_ALREADY_EXISTS) && @@ -3528,7 +3528,7 @@ static CURLcode ssh_do(struct Curl_easy *data, bool *done) return CURLE_FAILED_INIT; data->req.size = -1; /* make sure this is unknown at this point */ - sshc->secondCreateDirs = 0; /* reset the create dir attempt state + sshc->secondCreateDirs = 0; /* reset the create directory attempt state variable */ Curl_pgrsSetUploadCounter(data, 0); diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 9d03b52f407b..5317351478fc 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -149,8 +149,8 @@ struct ssh_conn { char *quote_path1; /* two generic pointers for the QUOTE stuff */ char *quote_path2; - char *homedir; /* when doing SFTP we figure out home dir in the - connect phase */ + char *homedir; /* when doing SFTP we figure out home directory + in the connect phase */ /* end of READDIR stuff */ int secondCreateDirs; /* counter use by the code to see if the diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 630f23fd9654..cac22483b7df 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -248,7 +248,7 @@ struct OperationConfig { BIT(autoreferer); /* automatically set referer */ BIT(show_headers); /* show headers to data output */ BIT(no_body); /* do not get the body */ - BIT(dirlistonly); /* only get the FTP dir list */ + BIT(dirlistonly); /* only get the FTP directory list */ BIT(unrestricted_auth); /* Continue to send authentication (user+password) when following redirects, even when hostname changed */ diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index 89d12fc1c6a5..0214a2004f1e 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -176,7 +176,7 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, goto clean; /* inputpath might be NULL or a valid pointer now */ - /* set gateway parts in input url */ + /* set gateway parts in input URL */ if(curl_url_set(uh, CURLUPART_SCHEME, gwscheme, CURLU_URLENCODE) || curl_url_set(uh, CURLUPART_HOST, gwhost, CURLU_URLENCODE) || curl_url_set(uh, CURLUPART_PORT, gwport, CURLU_URLENCODE)) diff --git a/src/tool_operate.c b/src/tool_operate.c index 9aee520f0619..1317e735510d 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2123,7 +2123,7 @@ static CURLcode transfer_per_config(struct OperationConfig *config, CURLcode result; *added = FALSE; - /* Check we have a url */ + /* Check we have a URL */ if(!config->url_list || !config->url_list->url) { helpf("(%d) no URL specified", CURLE_FAILED_INIT); result = CURLE_FAILED_INIT; diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index a83239054089..d25fccf46c6d 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -80,7 +80,7 @@ CURLcode urlerr_cvt(CURLUcode ucode) /* * Adds the filename to the URL if it does not already have one. - * url will be freed before return if the returned pointer is different + * URL will be freed before return if the returned pointer is different */ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename) { diff --git a/src/tool_writeout.h b/src/tool_writeout.h index eebfde03b26a..70b3cd148b56 100644 --- a/src/tool_writeout.h +++ b/src/tool_writeout.h @@ -56,7 +56,7 @@ typedef enum { VAR_INPUT_URLQUERY, VAR_INPUT_URLFRAGMENT, VAR_INPUT_URLZONEID, - /* the same ones again for url *effective* */ + /* the same ones again for URL *effective* */ VAR_INPUT_URLESCHEME, /* keep this the first URLE* variable */ VAR_INPUT_URLEUSER, VAR_INPUT_URLEPASSWORD, From 231e8a71e12a5f1c4b6db9e50ad8f7b9dec78ee4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 14 Nov 2025 17:09:50 +0100 Subject: [PATCH 387/885] docs: fix checksrc warning, fix checkdocs CI filter Also: - GHA/checkdocs: fix CI filters to catch it early. Follow-up to 28dd14aafe2692a3e7dceb40340554c03c127cf1 #15797 Closes #19533 --- .github/workflows/checkdocs.yml | 2 ++ docs/libcurl/curl_multi_perform.md | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index dbdd556557b5..8caf9479fde5 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -14,6 +14,7 @@ name: 'Docs' - '*/ci' paths: - '.github/workflows/checkdocs.yml' + - '.github/scripts/**' - '.github/scripts/mdlinkcheck' - '/scripts/**' - '**.md' @@ -25,6 +26,7 @@ name: 'Docs' - '.github/workflows/checkdocs.yml' - '.github/scripts/**' - '.github/scripts/mdlinkcheck' + - '/scripts/**' - '**.md' - 'docs/*' diff --git a/docs/libcurl/curl_multi_perform.md b/docs/libcurl/curl_multi_perform.md index 9ca13c679347..6e5f0cd8cf7b 100644 --- a/docs/libcurl/curl_multi_perform.md +++ b/docs/libcurl/curl_multi_perform.md @@ -85,8 +85,7 @@ int main(void) break; } - /* if there are still transfers, loop */ - } while(still_running); + } while(still_running); /* if there are still transfers, loop */ } } ~~~ From 7bb59a7dc7e17cee3a820099d586d31c5782fdd5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 14 Nov 2025 17:57:03 +0100 Subject: [PATCH 388/885] badwords.pl: fix variable in printf mask Causing warnings if a matched line has mask patterns. Closes #19534 --- .github/scripts/badwords.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/badwords.pl b/.github/scripts/badwords.pl index c6229f4ad402..e119617d0a9a 100755 --- a/.github/scripts/badwords.pl +++ b/.github/scripts/badwords.pl @@ -94,7 +94,7 @@ sub file { } print STDERR "$f:$l:$c: error: found bad word \"$w\"\n"; - printf STDERR " %4d | $in\n", $l; + printf STDERR " %4d | %s\n", $l, $in; printf STDERR " | %*s^%s\n", length($p), " ", "~" x (length($w)-1); printf STDERR " maybe use \"%s\" instead?\n", $alt{$w}; From 8a968095df066410f23861597c3f8a3b04239bb5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2025 12:55:25 +0100 Subject: [PATCH 389/885] mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option Replacing previous default: MD5. You can use the existing `-s` option to override the default. Also bump version to 1.30. Closes #19359 --- scripts/mk-ca-bundle.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index af31ccd10e8f..d4b5418e0c7b 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -60,7 +60,7 @@ # If the OpenSSL commandline is not in search path you can configure it here! my $openssl = 'openssl'; -my $version = '1.29'; +my $version = '1.30'; $opt_w = 76; # default base64 encoded lines length @@ -100,7 +100,7 @@ # for delegates (i.e. it is not a CA). ); -my $default_signature_algorithms = $opt_s = "MD5"; +my $default_signature_algorithms = $opt_s = "SHA256"; my @valid_signature_algorithms = ( "MD5", From 2dc71ba8bf70fa8d7e345cb0baeb4a4ea804994e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 14 Nov 2025 17:55:33 +0100 Subject: [PATCH 390/885] badwords: check indented lines in source code, fix fallouts - badwords.pl: add `-a` option to check all lines in source code files. Before this patch indented lines were skipped (to avoid Markdown code fences.) - GHA/checksrc: use `-a` when verifying the source code. - GHA/checksrc: disable `So` and `But` rules for source code. - GHA/checksrc: add docs/examples to the verified sources. - badwords.txt: delete 4 duplicates. - badwords.txt: group and sort contractions. - badwords.txt: allow ` url = `, `DIR`, `= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.'); - /* check again for 0D0A, to avoid an extra \n if it's at width */ + /* check again for 0D0A, to avoid an extra \n if it is at width */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { i += (c + 3 - width); diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index 026967f3eca5..b47cbbedbfb1 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -133,7 +133,7 @@ static void mcode_or_die(const char *where, CURLMcode code) static void timer_cb(struct GlobalInfo *g, int revents); -/* Update the timer after curl_multi library does its thing. Curl informs the +/* Update the timer after curl_multi library does its thing. curl informs the * application through this callback what it wants the new timeout to be, * after it does some work. */ static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g) @@ -219,7 +219,7 @@ static void timer_cb(struct GlobalInfo *g, int revents) err = read(g->tfd, &count, sizeof(uint64_t)); if(err == -1) { /* Note that we may call the timer callback even if the timerfd is not - * readable. It's possible that there are multiple events stored in the + * readable. It is possible that there are multiple events stored in the * epoll buffer (i.e. the timer may have fired multiple times). The event * count is cleared after the first call so future events in the epoll * buffer fails to read from the timer. */ diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 0df41005f5c3..26db7f595301 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -90,7 +90,7 @@ int main(void) /* get a FILE * of the file */ hd_src = fopen(LOCAL_FILE, "rb"); if(!hd_src) { - printf("Couldn't open '%s': %s\n", LOCAL_FILE, strerror(errno)); + printf("Could not open '%s': %s\n", LOCAL_FILE, strerror(errno)); return 2; } diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index 0bf3155570ce..97eff2b45acc 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -50,7 +50,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent) for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) { ctmbstr name = tidyNodeGetName(child); if(name) { - /* if it has a name, then it's an HTML tag ... */ + /* if it has a name, then it is an HTML tag ... */ TidyAttr attr; printf("%*.*s%s ", indent, indent, "<", name); /* walk the attribute list */ @@ -62,7 +62,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent) printf(">\n"); } else { - /* if it does not have a name, then it's probably text, cdata, etc... */ + /* if it does not have a name, then it is probably text, cdata, etc... */ TidyBuffer buf; tidyBufInit(&buf); tidyNodeGetText(doc, child, &buf); diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index 2251a215e8a5..cdbf0afa08eb 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -22,7 +22,7 @@ * ***************************************************************************/ /* - * Get a web page, extract the title with libxml. + * Get a webpage, extract the title with libxml. * Written by Lars Nilsson diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index efc747215371..ca61a92d916f 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -90,7 +90,7 @@ static void dump(const char *text, int num, unsigned char *ptr, } fprintf(stderr, "%c", (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.'); - /* check again for 0D0A, to avoid an extra \n if it's at width */ + /* check again for 0D0A, to avoid an extra \n if it is at width */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { i += (c + 3 - width); diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index d501f2419940..8c43075b937d 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -78,7 +78,7 @@ static void dump(const char *text, unsigned char *ptr, size_t size, char nohex) } fprintf(stderr, "%c", (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.'); - /* check again for 0D0A, to avoid an extra \n if it's at width */ + /* check again for 0D0A, to avoid an extra \n if it is at width */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { i += (c + 3 - width); diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 2bff0d050602..7ba150e91af5 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -128,7 +128,7 @@ static void dump(const char *text, int num, unsigned char *ptr, } fprintf(stderr, "%c", (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.'); - /* check again for 0D0A, to avoid an extra \n if it's at width */ + /* check again for 0D0A, to avoid an extra \n if it is at width */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { i += (c + 3 - width); @@ -305,7 +305,7 @@ int main(int argc, char **argv) num_transfers = 3; /* a suitable low default */ if(argc > 2) - /* if given a file name, upload this! */ + /* if given a filename, upload this! */ filename = argv[2]; } else diff --git a/docs/examples/http3.c b/docs/examples/http3.c index 323f6d7d17b6..217974f93cac 100644 --- a/docs/examples/http3.c +++ b/docs/examples/http3.c @@ -22,7 +22,7 @@ * ***************************************************************************/ /* - * Very simple HTTP/3 GET + * Simple HTTP/3 GET * */ #include diff --git a/docs/examples/https.c b/docs/examples/https.c index 23729afcaa02..1f7f5e1fbb31 100644 --- a/docs/examples/https.c +++ b/docs/examples/https.c @@ -56,7 +56,7 @@ int main(void) #ifdef SKIP_HOSTNAME_VERIFICATION /* - * If the site you are connecting to uses a different host name that what + * If the site you are connecting to uses a different hostname that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. diff --git a/docs/examples/imap-ssl.c b/docs/examples/imap-ssl.c index 59edd130e526..6eb49ae9780b 100644 --- a/docs/examples/imap-ssl.c +++ b/docs/examples/imap-ssl.c @@ -68,7 +68,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif - /* If the site you are connecting to uses a different host name that what + /* If the site you are connecting to uses a different hostname that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. */ diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index c9c0009763ac..350d41affaa6 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -140,8 +140,8 @@ static int mem_addf(struct mem *mem, const char *format, ...) /* we need about 100 chars or less to write 95% of lines */ x = 128; - /* first try: there's probably enough memory to write everything. - second try: there's definitely enough memory to write everything. */ + /* first try: there is probably enough memory to write everything. + second try: there is definitely enough memory to write everything. */ for(i = 0; i < 2; ++i) { if(x < 0 || mem_need(mem, (size_t)x + 1) < 0) break; diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c index 758cfca1de9d..d838feed4075 100644 --- a/docs/examples/multi-debugcallback.c +++ b/docs/examples/multi-debugcallback.c @@ -71,7 +71,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr, } fprintf(stream, "%c", (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.'); - /* check again for 0D0A, to avoid an extra \n if it's at width */ + /* check again for 0D0A, to avoid an extra \n if it is at width */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { i += (c + 3 - width); diff --git a/docs/examples/multi-formadd.c b/docs/examples/multi-formadd.c index 7a1b9eb95dec..068412827ae7 100644 --- a/docs/examples/multi-formadd.c +++ b/docs/examples/multi-formadd.c @@ -51,7 +51,7 @@ int main(void) CURL_IGNORE_DEPRECATION( /* Fill in the file upload field. This makes libcurl load data from - the given file name when curl_easy_perform() is called. */ + the given filename when curl_easy_perform() is called. */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "sendfile", diff --git a/docs/examples/multithread.c b/docs/examples/multithread.c index 3ecca2590820..535788e394bc 100644 --- a/docs/examples/multithread.c +++ b/docs/examples/multithread.c @@ -97,7 +97,7 @@ int main(void) pull_one_url, (void *)&targs[i]); if(error) - fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); + fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]); } diff --git a/docs/examples/parseurl.c b/docs/examples/parseurl.c index 8675adc62383..1514a798237f 100644 --- a/docs/examples/parseurl.c +++ b/docs/examples/parseurl.c @@ -51,7 +51,7 @@ int main(void) /* extract hostname from the parsed URL */ uc = curl_url_get(h, CURLUPART_HOST, &host, 0); if(!uc) { - printf("Host name: %s\n", host); + printf("Hostname: %s\n", host); curl_free(host); } diff --git a/docs/examples/pop3-ssl.c b/docs/examples/pop3-ssl.c index 63a9edca70d6..1be48adc8292 100644 --- a/docs/examples/pop3-ssl.c +++ b/docs/examples/pop3-ssl.c @@ -67,7 +67,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif - /* If the site you are connecting to uses a different host name that what + /* If the site you are connecting to uses a different hostname that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. */ diff --git a/docs/examples/rtsp-options.c b/docs/examples/rtsp-options.c index 50d5e2f27ee0..8c160f6b76dc 100644 --- a/docs/examples/rtsp-options.c +++ b/docs/examples/rtsp-options.c @@ -22,7 +22,7 @@ * ***************************************************************************/ /* - * Very simple RTSP request sending OPTIONS. + * Simple RTSP request sending OPTIONS. * */ #include diff --git a/docs/examples/simple.c b/docs/examples/simple.c index 29ed14313eda..a427266fd406 100644 --- a/docs/examples/simple.c +++ b/docs/examples/simple.c @@ -22,7 +22,7 @@ * ***************************************************************************/ /* - * Very simple HTTP GET + * Simple HTTP GET * */ #include diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c index b1175ba924a4..824e073e2a12 100644 --- a/docs/examples/simplepost.c +++ b/docs/examples/simplepost.c @@ -22,7 +22,7 @@ * ***************************************************************************/ /* - * Very simple HTTP POST + * Simple HTTP POST * */ #include diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 0fcffe250188..0d1438e7d773 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -133,7 +133,7 @@ void *create_thread(void *progress_bar) pull_one_url, NULL); if(error) - fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); + fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]); } diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index 5391f3e22297..36ecd18d7449 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -116,7 +116,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif - /* If the site you are connecting to uses a different host name that what + /* If the site you are connecting to uses a different hostname that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. */ diff --git a/docs/examples/threaded-ssl.c b/docs/examples/threaded-ssl.c index 5d984a670ab9..8119113695ea 100644 --- a/docs/examples/threaded-ssl.c +++ b/docs/examples/threaded-ssl.c @@ -91,7 +91,7 @@ int main(int argc, char **argv) pull_one_url, (void *)&i); if(error) - fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); + fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]); } diff --git a/docs/examples/urlapi.c b/docs/examples/urlapi.c index 82ef3e19aab9..7afc759fa1e4 100644 --- a/docs/examples/urlapi.c +++ b/docs/examples/urlapi.c @@ -42,7 +42,7 @@ int main(void) if(res) return (int)res; - /* init Curl URL */ + /* init curl URL */ urlp = curl_url(); uc = curl_url_set(urlp, CURLUPART_URL, "http://example.com/path/index.html", 0); diff --git a/lib/altsvc.c b/lib/altsvc.c index d9933f229802..357d3bc2090a 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -559,7 +559,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, } } else { - /* IPv6 host name */ + /* IPv6 hostname */ if(curlx_str_until(&p, &dsthost, MAX_IPADR_LEN, ']') || curlx_str_single(&p, ']')) { infof(data, "Bad alt-svc IPv6 hostname, ignoring."); diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index d38bd4695254..9a8312a04268 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -311,7 +311,7 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf, rc = nghttp2_session_callbacks_new(&cbs); if(rc) { - failf(data, "Couldn't initialize nghttp2 callbacks"); + failf(data, "Could not initialize nghttp2 callbacks"); goto out; } @@ -331,7 +331,7 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf, /* The nghttp2 session is not yet setup, do it */ rc = proxy_h2_client_new(cf, cbs); if(rc) { - failf(data, "Couldn't initialize nghttp2"); + failf(data, "Could not initialize nghttp2"); goto out; } diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 555bb77903ca..a8fa997de025 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -664,7 +664,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, /* Do not fall back to treating it as a hostname */ char buffer[STRERROR_LEN]; data->state.os_errno = error = SOCKERRNO; - failf(data, "Couldn't bind to interface '%s' with errno %d: %s", + failf(data, "Could not bind to interface '%s' with errno %d: %s", iface, error, curlx_strerror(error, buffer, sizeof(buffer))); return CURLE_INTERFACE_FAILED; } @@ -768,7 +768,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, char buffer[STRERROR_LEN]; data->state.errorbuf = FALSE; data->state.os_errno = error = SOCKERRNO; - failf(data, "Couldn't bind to '%s' with errno %d: %s", host, + failf(data, "Could not bind to '%s' with errno %d: %s", host, error, curlx_strerror(error, buffer, sizeof(buffer))); return CURLE_INTERFACE_FAILED; } diff --git a/lib/cookie.c b/lib/cookie.c index fce628cb9754..3155c4b3e42b 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -458,7 +458,7 @@ parse_cookie_header(struct Curl_easy *data, */ if(!co->name) { - /* The very first name/value pair is the actual cookie name */ + /* The first name/value pair is the actual cookie name */ if(!sep) /* Bad name/value pair. */ return CURLE_OK; diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index c3fa864effca..9f2624ff051d 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -62,7 +62,7 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) if(strlen(force_hostname) < (size_t)namelen) strcpy(name, force_hostname); else - return 1; /* can't do it */ + return 1; /* cannot do it */ err = 0; } else { diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index cc164c8c29b4..9509e8314880 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -142,7 +142,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) else if(!wcsncmp(fbuf, L"\\\\.\\", 4)) fbuf[2] = '?'; else if(!wcsncmp(fbuf, L"\\\\.", 3) || !wcsncmp(fbuf, L"\\\\?", 3)) { - /* Unexpected, not UNC. The formatting doc doesn't allow this AFAICT. */ + /* Unexpected, not UNC. The formatting doc does not allow this AFAICT. */ goto cleanup; } else { diff --git a/lib/curlx/inet_ntop.c b/lib/curlx/inet_ntop.c index 884cfb79c2d8..a9595d0c2f25 100644 --- a/lib/curlx/inet_ntop.c +++ b/lib/curlx/inet_ntop.c @@ -160,7 +160,7 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size) break; } else { - /* Lower-case digits. Can't use the set from mprintf.c since this + /* Lower-case digits. Cannot use the set from mprintf.c since this needs to work as a curlx function */ static const unsigned char ldigits[] = "0123456789abcdef"; diff --git a/lib/fake_addrinfo.c b/lib/fake_addrinfo.c index 80edf7864857..9789d1ef62bd 100644 --- a/lib/fake_addrinfo.c +++ b/lib/fake_addrinfo.c @@ -180,7 +180,7 @@ int r_getaddrinfo(const char *node, curl_mfprintf(stderr, "ares_set_servers_ports_csv failed: %d", rc); /* Cleanup */ ares_destroy(channel); - return EAI_MEMORY; /* we can't run */ + return EAI_MEMORY; /* we cannot run */ } } } diff --git a/lib/file.c b/lib/file.c index f45a487c90f3..565620283403 100644 --- a/lib/file.c +++ b/lib/file.c @@ -275,7 +275,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done) file->fd = fd; if(!data->state.upload && (fd == -1)) { - failf(data, "Couldn't open file %s", data->state.up.path); + failf(data, "Could not open file %s", data->state.up.path); file_done(data, CURLE_FILE_COULDNT_READ_FILE, FALSE); return CURLE_FILE_COULDNT_READ_FILE; } diff --git a/lib/ftp.c b/lib/ftp.c index ca6b9497b23a..108310bf301b 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1867,7 +1867,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, } if(!*str) { - failf(data, "Couldn't interpret the 227-response"); + failf(data, "Could not interpret the 227-response"); return CURLE_FTP_WEIRD_227_FORMAT; } @@ -2202,7 +2202,7 @@ static CURLcode ftp_state_type_resp(struct Curl_easy *data, /* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a successful 'TYPE I'. While that is not as RFC959 says, it is still a positive response code and we allow that. */ - failf(data, "Couldn't set desired mode"); + failf(data, "Could not set desired mode"); return CURLE_FTP_COULDNT_SET_TYPE; } if(ftpcode != 200) @@ -2392,7 +2392,7 @@ static CURLcode ftp_state_rest_resp(struct Curl_easy *data, case FTP_RETR_REST: if(ftpcode != 350) { - failf(data, "Couldn't use REST"); + failf(data, "Could not use REST"); result = CURLE_FTP_COULDNT_USE_REST; } else { @@ -2537,7 +2537,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, } else { if((instate == FTP_LIST) && (ftpcode == 450)) { - /* simply no matching files in the dir listing */ + /* simply no matching files in the directory listing */ ftp->transfer = PPTRANSFER_NONE; /* do not download anything */ ftp_state(data, ftpc, FTP_STOP); /* this phase is over */ } @@ -3052,7 +3052,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, case FTP_MKD: if((ftpcode/100 != 2) && !ftpc->count3--) { - /* failure to MKD the dir */ + /* failure to MKD the directory */ failf(data, "Failed to MKD dir: %03d", ftpcode); result = CURLE_REMOTE_ACCESS_DENIED; } @@ -3306,7 +3306,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, } } if(ftpc->prevpath) - infof(data, "Remembering we are in dir \"%s\"", ftpc->prevpath); + infof(data, "Remembering we are in directory \"%s\"", ftpc->prevpath); } /* shut down the socket to inform the server we are done */ @@ -4192,7 +4192,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data, ftpc->dirs[0].start = 0; ftpc->dirs[0].len = (int)dirlen; - ftpc->dirdepth = 1; /* we consider it to be a single dir */ + ftpc->dirdepth = 1; /* we consider it to be a single directory */ fileName = slashPos + 1; /* rest is filename */ } else @@ -4208,7 +4208,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data, size_t dirAlloc = numof_slashes(rawPath); if(dirAlloc >= FTP_MAX_DIR_DEPTH) - /* suspiciously deep dir hierarchy */ + /* suspiciously deep directory hierarchy */ return CURLE_URL_MALFORMAT; if(dirAlloc) { diff --git a/lib/headers.c b/lib/headers.c index 5a5725711317..feb52e087de8 100644 --- a/lib/headers.c +++ b/lib/headers.c @@ -51,7 +51,7 @@ static void copy_header_external(struct Curl_header_store *hs, h->index = index; /* this will randomly OR a reserved bit for the sole purpose of making it impossible for applications to do == comparisons, as that would otherwise - be very tempting and then lead to the reserved bits not being reserved + be tempting and then lead to the reserved bits not being reserved anymore. */ h->origin = (unsigned int)(hs->type | (1 << 27)); h->anchor = e; diff --git a/lib/hostip.c b/lib/hostip.c index ef000aab6930..ce79e5fc4b4e 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -956,7 +956,7 @@ CURLcode Curl_resolv(struct Curl_easy *data, /* we got a response, create a dns entry, add to cache, return */ dns = Curl_dnscache_mk_entry(data, addr, hostname, 0, port, FALSE); if(!dns || Curl_dnscache_add(data, dns)) { - /* this is OOM or similar, don't store such negative resolves */ + /* this is OOM or similar, do not store such negative resolves */ keep_negative = FALSE; goto error; } @@ -1393,7 +1393,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) error = FALSE; err: if(error) { - failf(data, "Couldn't parse CURLOPT_RESOLVE entry '%s'", + failf(data, "Could not parse CURLOPT_RESOLVE entry '%s'", hostp->data); Curl_freeaddrinfo(head); return CURLE_SETOPT_OPTION_SYNTAX; diff --git a/lib/hsts.c b/lib/hsts.c index 4e41155f3006..437851b8baee 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -277,7 +277,7 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, blen = ntail; } } - /* avoid curl_strequal because the host name is not null-terminated */ + /* avoid curl_strequal because the hostname is not null-terminated */ if((hlen == ntail) && curl_strnequal(hostname, sts->host, hlen)) return sts; } diff --git a/lib/http.c b/lib/http.c index f3444d46a91f..7458d8b6400b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -504,7 +504,7 @@ static CURLcode http_perhapsrewind(struct Curl_easy *data, return CURLE_OK; if(abort_upload) { - /* We'd like to abort the upload - but should we? */ + /* We would like to abort the upload - but should we? */ #ifdef USE_NTLM if((data->state.authproxy.picked == CURLAUTH_NTLM) || (data->state.authhost.picked == CURLAUTH_NTLM)) { @@ -1716,7 +1716,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data, curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE); curlx_str_trimblanks(&val); if(!curlx_strlen(&val)) - /* no content, don't send this */ + /* no content, do not send this */ continue; } else @@ -2404,7 +2404,7 @@ static CURLcode http_add_content_hds(struct Curl_easy *data, (data->req.authneg || !Curl_checkheaders(data, STRCONST("Content-Length")))) { /* we allow replacing this header if not during auth negotiation, - although it is not very wise to actually set your own */ + although it is not wise to actually set your own */ result = curlx_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n", req_clen); } @@ -4018,7 +4018,7 @@ static CURLcode http_on_response(struct Curl_easy *data, * * The check for close above is done simply because of something * else has already deemed the connection to get closed then - * something else should've considered the big picture and we + * something else should have considered the big picture and we * avoid this check. * */ @@ -4187,7 +4187,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data, k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + (p[2] - '0'); /* RFC 9112 requires a single space following the status code, - but the browsers don't so let's not insist */ + but the browsers do not so let's not insist */ fine_statusline = TRUE; } } diff --git a/lib/http2.c b/lib/http2.c index 68446d5177af..2e1e5bd07e56 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -506,7 +506,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, rc = nghttp2_session_callbacks_new(&cbs); if(rc) { - failf(data, "Couldn't initialize nghttp2 callbacks"); + failf(data, "Could not initialize nghttp2 callbacks"); goto out; } @@ -530,7 +530,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, /* The nghttp2 session is not yet setup, do it */ rc = h2_client_new(cf, cbs); if(rc) { - failf(data, "Couldn't initialize nghttp2"); + failf(data, "Could not initialize nghttp2"); goto out; } ctx->max_concurrent_streams = DEFAULT_MAX_CONCURRENT_STREAMS; @@ -972,7 +972,7 @@ static int push_promise(struct Curl_cfilter *cf, rv = set_transfer_url(newhandle, &heads); if(rv) { - CURL_TRC_CF(data, cf, "[%d] PUSH_PROMISE, failed to set url -> %d", + CURL_TRC_CF(data, cf, "[%d] PUSH_PROMISE, failed to set URL -> %d", frame->promised_stream_id, rv); discard_newhandle(cf, newhandle); rv = CURL_PUSH_DENY; diff --git a/lib/multi.c b/lib/multi.c index a47336457b80..c52ee54c7723 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1038,7 +1038,7 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data, case MSTATE_RESOLVING: result = Curl_resolv_pollset(data, ps); - /* connection filters are not involved in this phase. It's ok if we get no + /* connection filters are not involved in this phase. It is OK if we get no * sockets to wait for. Resolving can wake up from other sources. */ expect_sockets = FALSE; break; diff --git a/lib/multi_ev.c b/lib/multi_ev.c index ff755caa6aa3..f5000a456245 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -340,7 +340,7 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, /* What was the previous action the transfer had regarding this socket? * If the transfer is new to the socket, disregard the information * in `last_poll`, because the socket might have been destroyed and - * reopened. We'd have cleared the sh_entry for that, but the socket + * reopened. We would have cleared the sh_entry for that, but the socket * might still be mentioned in the hashed pollsets. */ last_action = 0; if(first_time) { diff --git a/lib/pop3.c b/lib/pop3.c index affd64276cd8..d469dc07660d 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -1742,9 +1742,8 @@ static CURLcode pop3_write(struct Curl_easy *data, const char *str, /* Did we have a partial match which has subsequently failed? */ if(prev && prev >= pop3c->eob) { - /* Strip can only be non-zero for the very first mismatch after CRLF - and then both prev and strip are equal and nothing will be output - below */ + /* Strip can only be non-zero for the first mismatch after CRLF and + then both prev and strip are equal and nothing will be output below */ while(prev && pop3c->strip) { prev--; pop3c->strip--; diff --git a/lib/progress.c b/lib/progress.c index 02841544dd7a..228f5dc19737 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -280,7 +280,7 @@ timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, should_ms = (timediff_t) (1000 * bytes / bytes_per_sec); } else { - /* very large `bytes`, first calc the seconds it should have taken. + /* large `bytes`, first calc the seconds it should have taken. * if that is small enough, convert to milliseconds. */ should_ms = (timediff_t) (bytes / bytes_per_sec); if(should_ms < TIMEDIFF_T_MAX/1000) diff --git a/lib/socks.c b/lib/socks.c index 5185913a2458..3434030c839f 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -308,7 +308,7 @@ static CURLproxycode socks4_req_add_user(struct socks_state *sx, return CURLPX_SEND_REQUEST; } else { - /* empty user name */ + /* empty username */ unsigned char b = 0; result = Curl_bufq_write(&sx->iobuf, &b, 1, &nwritten); if(result || (nwritten != 1)) diff --git a/lib/speedcheck.c b/lib/speedcheck.c index 3b128655f5e7..aede06001920 100644 --- a/lib/speedcheck.c +++ b/lib/speedcheck.c @@ -49,7 +49,7 @@ CURLcode Curl_speedcheck(struct Curl_easy *data, if((data->progress.current_speed >= 0) && data->set.low_speed_time) { if(data->progress.current_speed < data->set.low_speed_limit) { if(!data->state.keeps_speed.tv_sec) - /* under the limit at this very moment */ + /* under the limit at this moment */ data->state.keeps_speed = now; else { /* how long has it been under the limit */ diff --git a/lib/url.c b/lib/url.c index 0a0b6ff3a205..cf34514b1a9b 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1283,7 +1283,7 @@ static bool url_match_result(bool result, void *userdata) return TRUE; } else if(match->seen_single_use_conn && !match->seen_multiplex_conn) { - /* We've seen a single-use, existing connection to the destination and + /* We have seen a single-use, existing connection to the destination and * no multiplexed one. It seems safe to assume that the server does * not support multiplexing. */ match->wait_pipe = FALSE; @@ -2740,7 +2740,7 @@ static CURLcode override_login(struct Curl_easy *data, data->set.str[STRING_NETRC_FILE]); if(ret && ((ret == NETRC_NO_MATCH) || (data->set.use_netrc == CURL_NETRC_OPTIONAL))) { - infof(data, "Couldn't find host %s in the %s file; using defaults", + infof(data, "Could not find host %s in the %s file; using defaults", conn->host.name, (data->set.str[STRING_NETRC_FILE] ? data->set.str[STRING_NETRC_FILE] : ".netrc")); @@ -2752,7 +2752,7 @@ static CURLcode override_login(struct Curl_easy *data, } else { if(!(conn->handler->flags&PROTOPT_USERPWDCTRL)) { - /* if the protocol can't handle control codes in credentials, make + /* if the protocol cannot handle control codes in credentials, make sure there are none */ if(str_has_ctrl(*userp) || str_has_ctrl(*passwdp)) { failf(data, "control code detected in .netrc credentials"); diff --git a/lib/urlapi.c b/lib/urlapi.c index 73f476ed3f62..a3d9efdb919f 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -1940,7 +1940,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, if(!n) bad = TRUE; /* empty hostname is not okay */ else if(!urlencode) { - /* if the host name part was not URL encoded here, it was set ready + /* if the hostname part was not URL encoded here, it was set ready URL encoded so we need to decode it to check */ size_t dlen; char *decoded = NULL; diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index a8d4ffe5b774..c1c0ab2ab219 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -216,7 +216,7 @@ static bool auth_digest_get_key_value(const char *chlg, const char *key, if(curlx_str_cmp(&name, key)) { /* if this is our key, return the value */ if(curlx_strlen(&data) >= buflen) - /* doesn't fit */ + /* does not fit */ return FALSE; memcpy(buf, curlx_str(&data), curlx_strlen(&data)); buf[curlx_strlen(&data)] = 0; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 145a2831db02..75dc5cc69473 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -781,7 +781,7 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf, if(nwritten < memlen) { /* This MUST not happen. Our recbuf is dimensioned to hold the - * full max_stream_window and then some for this very reason. */ + * full max_stream_window and then some for this reason. */ DEBUGASSERT(0); return CURLE_RECV_ERROR; } diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index d8d063b2eca2..ff3e76b06342 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -342,7 +342,7 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf, if(nwritten < memlen) { /* This MUST not happen. Our recbuf is dimensioned to hold the - * full max_stream_window and then some for this very reason. */ + * full max_stream_window and then some for this reason. */ DEBUGASSERT(0); return CURLE_RECV_ERROR; } diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 74a1da5a3e7a..8653c4901d39 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1574,8 +1574,8 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data, Curl_debug(data, CURLINFO_HEADER_OUT, "PWD\n", 4); Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); - /* this sends an FTP-like "header" to the header callback so that the - current directory can be read very similar to how it is read when + /* this sends an FTP-like "header" to the header callback so that + the current directory can be read similar to how it is read when using ordinary FTP. */ result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); free(tmp); @@ -1860,7 +1860,7 @@ static int myssh_in_SFTP_QUOTE_STAT(struct Curl_easy *data, return SSH_NO_ERROR; } if(date > UINT_MAX) - /* because the liubssh API can't deal with a larger value */ + /* because the liubssh API cannot deal with a larger value */ date = UINT_MAX; if(!strncmp(cmd, "atime", 5)) sshc->quote_attrs->atime = (uint32_t)date; diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 49044669fc06..f5cb5f9a1d5d 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -878,8 +878,8 @@ static CURLcode sftp_quote(struct Curl_easy *data, Curl_debug(data, CURLINFO_HEADER_OUT, "PWD\n", 4); Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); - /* this sends an FTP-like "header" to the header callback so that the - current directory can be read very similar to how it is read when + /* this sends an FTP-like "header" to the header callback so that + the current directory can be read similar to how it is read when using ordinary FTP. */ result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); free(tmp); diff --git a/lib/vtls/apple.c b/lib/vtls/apple.c index 87d5208d735a..297ebc39f393 100644 --- a/lib/vtls/apple.c +++ b/lib/vtls/apple.c @@ -148,7 +148,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf, * add `kSecRevocationRequirePositiveResponse` to the Apple * Trust policies, it interprets this as it NEEDs a confirmation * of a cert being NOT REVOKED. Which not in general available for - * certificates on the internet. + * certificates on the Internet. * It seems that applications using this policy are expected to PIN * their certificate public keys or verification will fail. * This does not seem to be what we want here. */ diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 533597ed4176..f7a5727a11ca 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1688,7 +1688,7 @@ static CURLcode client_cert(struct Curl_easy *data, failf(data, "could not load PEM client certificate from %s, " OSSL_PACKAGE " error %s, " - "(no key found, wrong pass phrase, or wrong file format?)", + "(no key found, wrong passphrase, or wrong file format?)", (cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file), ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)) ); @@ -1708,7 +1708,7 @@ static CURLcode client_cert(struct Curl_easy *data, failf(data, "could not load ASN1 client certificate from %s, " OSSL_PACKAGE " error %s, " - "(no key found, wrong pass phrase, or wrong file format?)", + "(no key found, wrong passphrase, or wrong file format?)", (cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file), ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)) ); @@ -5154,7 +5154,7 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, #endif if(data->set.ssl.certinfo && !octx->reused_session) { - /* asked to gather certificate info. Reused sessions don't have cert + /* asked to gather certificate info. Reused sessions do not have cert chains */ result = ossl_certchain(data, octx->ssl); if(result) @@ -5684,7 +5684,7 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex, cert = SSL_get1_peer_certificate(octx->ssl); if(!cert) - /* No server certificate, don't do channel binding */ + /* No server certificate, do not do channel binding */ return CURLE_OK; if(!OBJ_find_sigid_algs(X509_get_signature_nid(cert), &algo_nid, NULL)) { diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 137e525722cd..f2a907cb09cb 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1286,7 +1286,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* The socket must be writeable (or a poll error occurred) before we call InitializeSecurityContext to continue processing the received TLS - records. This is because that function is not idempotent and we don't + records. This is because that function is not idempotent and we do not support partial save/resume sending replies of handshake tokens. */ if(!SOCKET_WRITABLE(Curl_conn_cf_get_socket(cf, data), 0)) { SCH_DEV(infof(data, "schannel: handshake waiting for writeable socket")); @@ -1809,7 +1809,7 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, * data needs to be sent then we block for a writeable socket that should * be writeable immediately except for OS resource constraints. For caller * send if handshake data needs to be received then we block for a readable - * socket, which could take some time, but it's more likely the user has + * socket, which could take some time, but it is more likely the user has * called recv since they had called it prior (only recv can start * renegotiation and probably the user is going to call it again to get * more of their data before calling send). diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 918a4686fcbc..ed0af3d53b91 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1423,7 +1423,7 @@ static CURLcode ssl_cf_connect_deferred(struct Curl_cfilter *cf, result = ssl_cf_set_earlydata(cf, data, buf, blen); if(result) return result; - /* we buffered any early data we'd like to send. Actually + /* we buffered any early data we would like to send. Actually * do the connect now which sends it and performs the handshake. */ connssl->earlydata_state = ssl_earlydata_sending; connssl->earlydata_skip = Curl_bufq_len(&connssl->earlydata); diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index a7883fe08a2f..7b567fd89250 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1725,7 +1725,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, if(ret == WOLFSSL_SUCCESS && conn_config->verifyhost && !connssl->peer.sni) { - /* we have an IP address as host name. */ + /* we have an IP address as hostname. */ WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(wssl->ssl); if(!cert) { failf(data, "unable to get peer certificate"); diff --git a/lib/ws.c b/lib/ws.c index 96a0d61378f0..5a61c65aa80d 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -1037,7 +1037,7 @@ static CURLcode ws_enc_send(struct Curl_easy *data, * that needs to be encoded into the buffer */ if(buflen < ws->sendbuf_payload) { /* We have been called with LESS buffer data than before. This - * is not how it's supposed too work. */ + * is not how it is supposed too work. */ failf(data, "[WS] curl_ws_send() called with smaller 'buflen' than " "bytes already buffered in previous call, %zu vs %zu", buflen, ws->sendbuf_payload); diff --git a/src/config2setopts.c b/src/config2setopts.c index 7d099602d30b..154319231f11 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -212,11 +212,11 @@ static CURLcode ssh_setopts(struct OperationConfig *config, CURL *curl) config->knownhosts = known; } else if(!config->hostpubmd5 && !config->hostpubsha256) { - errorf("Couldn't find a known_hosts file"); + errorf("Could not find a known_hosts file"); return CURLE_FAILED_INIT; } else - warnf("Couldn't find a known_hosts file"); + warnf("Could not find a known_hosts file"); } return CURLE_OK; /* ignore if SHA256 did not work */ } diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index a4c475be8e7a..6c119047ce56 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -60,7 +60,7 @@ static bool waitfd(int waitms, int fd) struct timeval timeout; if(fd >= FD_SETSIZE) - /* can't wait! */ + /* cannot wait! */ return FALSE; /* wait this long at the most */ diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index 68899c582950..292da1c25176 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -55,8 +55,8 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) if(offset > OUR_MAX_SEEK_O) { /* Some precaution code to work around problems with different data sizes - to allow seeking >32-bit even if off_t is 32-bit. Should be very rare - and is really valid on weirdo-systems. */ + to allow seeking >32-bit even if off_t is 32-bit. Should be rare and + is really valid on weirdo-systems. */ curl_off_t left = offset; if(whence != SEEK_SET) diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 8e9e5f023d39..2b19a163ce8b 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -874,7 +874,7 @@ curl_socket_t win32_stdin_read_thread(void) break; } - /* Start up the thread. We don't bother keeping a reference to it + /* Start up the thread. We do not bother keeping a reference to it because it runs until program termination. From here on out all reads from the stdin handle or file descriptor 0 will be reading from the socket that is fed by the thread. */ diff --git a/src/tool_getparam.c b/src/tool_getparam.c index b74b73806d2c..bd90da1ec754 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1213,7 +1213,7 @@ static ParameterError parse_ech(struct OperationConfig *config, file = curlx_fopen(nextarg, FOPEN_READTEXT); } if(!file) { - warnf("Couldn't read file \"%s\" " + warnf("Could not read file \"%s\" " "specified for \"--ech ecl:\" option", nextarg); return PARAM_BAD_USE; /* */ @@ -2084,7 +2084,7 @@ static ParameterError opt_bool(struct OperationConfig *config, config->doh_insecure_ok = toggle; break; case C_LIST_ONLY: /* --list-only */ - config->dirlistonly = toggle; /* only list the names of the FTP dir */ + config->dirlistonly = toggle; /* only list names of the FTP directory */ break; case C_MANUAL: /* --manual */ if(toggle) /* --no-manual shows no manual... */ @@ -2876,7 +2876,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ /* is there an '=' ? */ if(!curlx_str_until(&p, &out, MAX_OPTION_LEN, '=') && !curlx_str_single(&p, '=') ) { - /* there's an equal sign */ + /* there is an equal sign */ char tempword[MAX_OPTION_LEN + 1]; memcpy(tempword, curlx_str(&out), curlx_strlen(&out)); tempword[curlx_strlen(&out)] = 0; diff --git a/src/tool_operate.c b/src/tool_operate.c index 1317e735510d..b7c8805b3a4c 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2252,7 +2252,7 @@ CURLcode operate(int argc, argv_item_t argv[]) strcmp(first_arg, "--disable"))) { parseconfig(NULL, CONFIG_MAX_LEVELS); /* ignore possible failure */ - /* If we had no arguments then make sure a url was specified in .curlrc */ + /* If we had no arguments then make sure a URL was specified in .curlrc */ if((argc < 2) && (!global->first->url_list)) { helpf(NULL); result = CURLE_FAILED_INIT; diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index d25fccf46c6d..e17955bec306 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -211,7 +211,7 @@ CURLcode get_url_file_name(char **filename, const char *url) else { /* no slash => empty string, use default */ *filename = strdup("curl_response"); - warnf("No remote file name, uses \"%s\"", *filename); + warnf("No remote filename, uses \"%s\"", *filename); } curl_free(path); diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index 008f0fc388c1..2e7b98f26eb0 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -135,7 +135,7 @@ ParameterError file2memory_range(char **bufp, size_t *size, FILE *file, offset = starto; } else - /* we can't seek stdin, read 'starto' bytes and throw them away */ + /* we cannot seek stdin, read 'starto' bytes and throw them away */ throwaway = starto; } diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 03f9930c5d8c..46096d5b5abe 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -103,7 +103,7 @@ ParameterError parseconfig(const char *filename, int max_recursive) #if defined(_WIN32) && !defined(UNDER_CE) else { char *fullp; - /* check for .curlrc then _curlrc in the dir of the executable */ + /* check for .curlrc then _curlrc in the directory of the executable */ file = tool_execpath(".curlrc", &fullp); if(!file) file = tool_execpath("_curlrc", &fullp); From 554dfa556886c3d7425f6690f3fc408128bf4744 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 15 Jul 2025 00:36:08 +0200 Subject: [PATCH 391/885] build: drop Windows CE / CeGCC support Windows CE support was limited to successful builds with ming32ce (a toolchain that hasn't seen an update since 2009, using an ancient gcc version and "old mingw"-style SDK headers, that curl deprecated earlier). Builds with MSVC were broken for a long time. mingw32ce builds were never actually tested and runtime and unlikely to work due to missing stubs. Windows CE toolchains also miss to comply with C89. Paired with lack of demand and support for the platform, curl deprecated it earlier. This patch removes support from the codebase to ease maintaining Windows codepaths. Follow-up to f98c0ba834d4b4da480373b732a86976f9064ccd #17924 Follow-up to 8491e6574cde770b227ca0e1cd66548291f49661 #17379 Follow-up to 2a292c39846107228201674d686be5b3ed96674d #15975 Closes #17927 --- CMake/CurlSymbolHiding.cmake | 2 +- CMake/win32-cache.cmake | 24 +-- CMakeLists.txt | 103 +++-------- acinclude.m4 | 12 +- configure.ac | 64 +------ docs/DEPRECATE.md | 8 +- docs/INSTALL.md | 4 +- docs/examples/anyauthput.c | 5 - docs/examples/block_ip.c | 2 +- docs/examples/externalsocket.c | 4 - docs/examples/fileupload.c | 5 - docs/examples/ftpupload.c | 9 - docs/examples/ftpuploadresume.c | 2 - docs/examples/http2-download.c | 4 - docs/examples/http2-upload.c | 13 +- docs/examples/httpput.c | 5 - docs/examples/log_failed_transfers.c | 8 +- docs/examples/sftpuploadresume.c | 4 +- include/curl/system.h | 21 +-- lib/asyn-thrdd.c | 2 +- lib/cf-socket.c | 13 -- lib/config-win32.h | 93 ++-------- lib/connect.c | 2 +- lib/curl_fopen.c | 9 +- lib/curl_setup.h | 43 +---- lib/curl_setup_once.h | 4 +- lib/curl_sspi.c | 4 - lib/curl_sspi.h | 252 --------------------------- lib/curl_threads.c | 13 +- lib/curlx/fopen.c | 10 +- lib/curlx/fopen.h | 2 +- lib/curlx/inet_ntop.c | 10 +- lib/curlx/inet_pton.c | 2 +- lib/curlx/strerr.c | 7 +- lib/curlx/version_win32.c | 8 +- lib/curlx/winapi.c | 5 +- lib/easy.c | 8 +- lib/file.c | 2 +- lib/ftp.c | 4 - lib/getenv.c | 2 +- lib/hostip.c | 2 - lib/md4.c | 5 - lib/md5.c | 4 - lib/memdebug.c | 2 +- lib/rename.c | 2 +- lib/sha256.c | 4 - lib/strerror.c | 2 +- lib/system_win32.c | 18 +- lib/transfer.c | 2 - lib/vtls/schannel.c | 30 +--- lib/vtls/schannel_verify.c | 77 -------- lib/vtls/vtls_scache.c | 5 +- m4/xc-lt-iface.m4 | 4 +- src/CMakeLists.txt | 2 +- src/terminal.c | 2 +- src/tool_cb_hdr.c | 2 +- src/tool_cb_rea.c | 6 +- src/tool_cb_see.c | 2 +- src/tool_cb_wrt.c | 6 +- src/tool_cfgable.c | 2 +- src/tool_cfgable.h | 4 +- src/tool_dirhie.c | 4 +- src/tool_doswin.c | 12 +- src/tool_doswin.h | 6 +- src/tool_formparse.c | 4 - src/tool_getparam.h | 2 +- src/tool_getpass.c | 4 +- src/tool_main.c | 11 +- src/tool_operate.c | 22 +-- src/tool_parsecfg.c | 2 +- src/tool_setup.h | 9 - src/tool_util.c | 11 +- src/tool_util.h | 2 +- tests/libtest/lib505.c | 5 - tests/libtest/lib525.c | 5 - tests/libtest/lib541.c | 5 - tests/libtest/lib556.c | 4 - tests/libtest/lib582.c | 5 - tests/server/first.h | 2 - tests/server/sockfilt.c | 29 +-- tests/server/util.c | 20 +-- 81 files changed, 166 insertions(+), 975 deletions(-) diff --git a/CMake/CurlSymbolHiding.cmake b/CMake/CurlSymbolHiding.cmake index 217c8832c9ab..2576a1aff36f 100644 --- a/CMake/CurlSymbolHiding.cmake +++ b/CMake/CurlSymbolHiding.cmake @@ -29,7 +29,7 @@ if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG)) # e.g. curl_easy_perform_ev() or curl_dbg_*(), # so disable symbol hiding for debug builds and for memory tracking. set(CURL_HIDDEN_SYMBOLS OFF) -elseif(DOS OR AMIGA OR MINGW32CE) +elseif(DOS OR AMIGA) set(CURL_HIDDEN_SYMBOLS OFF) endif() diff --git a/CMake/win32-cache.cmake b/CMake/win32-cache.cmake index 8cb9b58b3937..50c319d1b66b 100644 --- a/CMake/win32-cache.cmake +++ b/CMake/win32-cache.cmake @@ -193,7 +193,7 @@ if(MINGW OR MSVC) curl_prefill_type_size("CURL_OFF_T" 8) curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P}) curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P}) - # TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise + # TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise # Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set. # mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined. if(MSVC) @@ -206,25 +206,3 @@ if(MINGW OR MSVC) curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+ endif() endif() - -# Windows CE exceptions - -if(WINCE) - set(HAVE_FREEADDRINFO 0) - set(HAVE_GETADDRINFO 0) - set(HAVE_LOCALE_H 0) - set(HAVE_SETLOCALE 0) - set(HAVE_SETMODE 0) - set(HAVE_SIGNAL 0) - set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0) - curl_prefill_type_size("CURL_SOCKET_T" 4) - curl_prefill_type_size("TIME_T" 4) - curl_prefill_type_size("SIZE_T" 4) - if(MINGW32CE) - set(HAVE_STRTOK_R 0) - set(HAVE__SETMODE 0) - set(HAVE_FILE_OFFSET_BITS 0) - curl_prefill_type_size("SSIZE_T" 4) - curl_prefill_type_size("OFF_T" 4) - endif() -endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 8113cdea90dc..0b9b666adb51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,37 +71,6 @@ if(WINDOWS_STORE AND MINGW) # mingw UWP build # CMake (as of v3.31.2) gets confused and applies the MSVC rc.exe command-line # template to windres. Reset it to the windres template via 'Modules/Platform/Windows-windres.cmake': set(CMAKE_RC_COMPILE_OBJECT " -O coff ") -elseif(WIN32 AND WINCE AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # mingw32ce build - if(NOT MINGW32CE_LIBRARY_DIR) - message(FATAL_ERROR "Set MINGW32CE_LIBRARY_DIR variable to the mingw32ce platform library directory.") - endif() - - set(MINGW 1) - set(MINGW32CE 1) - - # Build implib with libcurl DLL. Copied from CMake's 'Modules/Platform/Windows-GNU.cmake'. - set(CMAKE_C_CREATE_SHARED_LIBRARY " ") - string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " -o -Wl,--out-implib,") - string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " ${CMAKE_GNULD_IMAGE_VERSION} ") - - # Build resources. Copied from CMake's 'Modules/Platform/Windows-windres.cmake'. - set(CMAKE_RC_COMPILE_OBJECT " -O coff ") - enable_language(RC) - - # To compile long long integer literals - set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-std=gnu99") - string(APPEND CMAKE_REQUIRED_FLAGS " -std=gnu99") - - set(CMAKE_C_COMPILE_OPTIONS_PIC "") # CMake sets it to '-fPIC', confusing the toolchain and breaking builds. Zap it. - - set(CMAKE_STATIC_LIBRARY_PREFIX "lib") - set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") - set(CMAKE_SHARED_LIBRARY_PREFIX "lib") - set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") - set(CMAKE_IMPORT_LIBRARY_PREFIX "lib") - set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a") - set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "") - set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib") elseif(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # DJGPP set(CMAKE_STATIC_LIBRARY_PREFIX "lib") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") @@ -130,9 +99,6 @@ endif() if(WIN32) string(APPEND _target_flags " WIN32") endif() -if(WINCE) - string(APPEND _target_flags " WINCE") -endif() if(WINDOWS_STORE) string(APPEND _target_flags " UWP") endif() @@ -213,12 +179,12 @@ option(CURL_DISABLE_INSTALL "Disable installation targets" OFF) if(WIN32) option(ENABLE_UNICODE "Use the Unicode version of the Windows API functions" OFF) - if(WINDOWS_STORE OR WINCE) + if(WINDOWS_STORE) set(ENABLE_UNICODE ON) endif() if(ENABLE_UNICODE) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "UNICODE" "_UNICODE") - if(MINGW AND NOT MINGW32CE) + if(MINGW) set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-municode") endif() endif() @@ -538,7 +504,7 @@ if(HTTP_ONLY) set(CURL_DISABLE_TFTP ON) endif() -if(WINDOWS_STORE OR WINCE) +if(WINDOWS_STORE) set(CURL_DISABLE_TELNET ON) # telnet code needs fixing to compile for UWP. endif() @@ -624,21 +590,7 @@ if(ENABLE_THREADED_RESOLVER) endif() # Check for all needed libraries -if(WIN32) - if(WINCE) - set(_win32_winsock "ws2") - else() - set(_win32_winsock "ws2_32") - endif() - set(_win32_crypt32 "crypt32") - set(_win32_secur32 "secur32") - - if(MINGW32CE) # FIXME upstream: must specify the full path to avoid CMake converting "ws2" to "ws2.lib" - set(_win32_winsock "${MINGW32CE_LIBRARY_DIR}/lib${_win32_winsock}.a") - set(_win32_crypt32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_crypt32}.a") - set(_win32_secur32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_secur32}.a") - endif() -elseif(DOS) +if(DOS) if(WATT_ROOT) set(USE_WATT32 ON) # FIXME upstream: must specify the full path to avoid CMake converting "watt" to "watt.lib" @@ -659,7 +611,7 @@ elseif(AMIGA) set(CURL_USE_OPENSSL ON) set(CURL_CA_FALLBACK ON CACHE BOOL "") endif() -elseif(NOT APPLE) +elseif(NOT WIN32 AND NOT APPLE) check_library_exists("socket" "connect" "" HAVE_LIBSOCKET) if(HAVE_LIBSOCKET) set(CURL_NETWORK_AND_TIME_LIBS "socket" ${CURL_NETWORK_AND_TIME_LIBS}) @@ -694,7 +646,7 @@ if(ENABLE_IPV6) endif() endif() endif() -if(ENABLE_IPV6 AND NOT WINCE) +if(ENABLE_IPV6) set(USE_IPV6 ON) endif() @@ -1035,7 +987,7 @@ macro(curl_openssl_check_exists) if(HAVE_LIBZ) list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) endif() - if(WIN32 AND NOT WINCE) + if(WIN32) list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL endif() endif() @@ -1049,7 +1001,7 @@ macro(curl_openssl_check_exists) list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T") # to pull in stdint.h (as of wolfSSL v5.5.4) endif() if(WIN32) - list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}" "${_win32_crypt32}") # for OpenSSL/wolfSSL + list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32" "crypt32") # for OpenSSL/wolfSSL endif() if(${ARGC} EQUAL 2) check_function_exists(${ARGN}) @@ -1262,7 +1214,7 @@ if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP)) endif() if(NOT CURL_DISABLE_LDAP) - if(WIN32 AND NOT WINDOWS_STORE AND NOT WINCE) + if(WIN32 AND NOT WINDOWS_STORE) option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON) if(USE_WIN32_LDAP) list(APPEND CURL_LIBS "wldap32") @@ -1501,7 +1453,7 @@ if(USE_LIBRTMP) endif() option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) -if(ENABLE_UNIX_SOCKETS AND NOT WINCE) +if(ENABLE_UNIX_SOCKETS) if(WIN32 OR DOS) set(USE_UNIX_SOCKETS 1) else() @@ -1618,7 +1570,7 @@ if(WIN32) list(APPEND CURL_INCLUDES "winsock2.h") list(APPEND CURL_INCLUDES "ws2tcpip.h") - if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501 AND NOT WINCE) + if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501) # Windows XP is required for freeaddrinfo, getaddrinfo message(FATAL_ERROR "Building for Windows XP or newer is required.") endif() @@ -1626,7 +1578,7 @@ if(WIN32) # Pre-fill detection results based on target OS version if(_CURL_PREFILL) if(NOT HAVE_WIN32_WINNT OR HAVE_WIN32_WINNT LESS 0x0600 OR # older than Windows Vista - WINCE OR WINDOWS_STORE) + WINDOWS_STORE) set(HAVE_IF_NAMETOINDEX 0) unset(HAVE_IF_NAMETOINDEX CACHE) elseif(MSVC OR MINGW) @@ -1734,8 +1686,8 @@ endif() # Apply to all feature checks if(WIN32) - list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}") - if(NOT WINCE AND NOT WINDOWS_STORE) + list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32") + if(NOT WINDOWS_STORE) list(APPEND CMAKE_REQUIRED_LIBRARIES "iphlpapi") endif() elseif(HAVE_LIBSOCKET) @@ -1805,11 +1757,9 @@ else() check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI) endif() -if(NOT MINGW32CE) # Avoid false detections - check_function_exists("setmode" HAVE_SETMODE) - if(WIN32 OR CYGWIN) - check_function_exists("_setmode" HAVE__SETMODE) - endif() +check_function_exists("setmode" HAVE_SETMODE) +if(WIN32 OR CYGWIN) + check_function_exists("_setmode" HAVE__SETMODE) endif() if(AMIGA) @@ -1971,17 +1921,13 @@ include(CMake/OtherTests.cmake) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "HAVE_CONFIG_H") if(WIN32) - list(APPEND CURL_NETWORK_AND_TIME_LIBS "${_win32_winsock}") - if(NOT WINCE AND NOT WINDOWS_STORE) + list(APPEND CURL_NETWORK_AND_TIME_LIBS "ws2_32") + if(NOT WINDOWS_STORE) list(APPEND CURL_NETWORK_AND_TIME_LIBS "iphlpapi") endif() - if(NOT WINCE) - list(APPEND CURL_LIBS "bcrypt") - endif() + list(APPEND CURL_LIBS "bcrypt") - if(NOT WINCE) - set(USE_WIN32_LARGE_FILES ON) - endif() + set(USE_WIN32_LARGE_FILES ON) # We use crypto functions that are not available for UWP apps if(NOT WINDOWS_STORE) @@ -1990,13 +1936,10 @@ if(WIN32) # Link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL if(USE_WIN32_CRYPTO OR USE_SCHANNEL) - if(NOT WINCE) - list(APPEND CURL_LIBS "advapi32") - endif() - list(APPEND CURL_LIBS "${_win32_crypt32}") + list(APPEND CURL_LIBS "advapi32" "crypt32") endif() if(USE_WINDOWS_SSPI) - list(APPEND CURL_LIBS "${_win32_secur32}") + list(APPEND CURL_LIBS "secur32") endif() endif() diff --git a/acinclude.m4 b/acinclude.m4 index 517de0c4a63e..7038f32a8b8d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1315,13 +1315,8 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl if test "$curl_cv_native_windows" = 'yes'; then AC_MSG_CHECKING([whether build target supports Win32 large files]) - if test "$curl_cv_wince" = 'yes'; then - dnl Windows CE does not support large files - curl_win32_has_largefile='no' - else - dnl All mingw-w64 versions support large files - curl_win32_has_largefile='yes' - fi + dnl All mingw-w64 versions support large files + curl_win32_has_largefile='yes' case "$curl_win32_has_largefile" in yes) if test x"$enable_largefile" = 'xno'; then @@ -1478,9 +1473,6 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [ if test "$curl_cv_native_windows" = 'yes'; then curl_pflags="${curl_pflags} WIN32" fi - if test "$curl_cv_wince" = 'yes'; then - curl_pflags="${curl_pflags} WINCE" - fi if test "$curl_cv_winuwp" = 'yes'; then curl_pflags="${curl_pflags} UWP" fi diff --git a/configure.ac b/configure.ac index e493369b9db6..9602be344f85 100644 --- a/configure.ac +++ b/configure.ac @@ -529,12 +529,8 @@ dnl for --enable-code-coverage CURL_COVERAGE CURL_CHECK_NATIVE_WINDOWS -curl_cv_wince='no' curl_cv_winuwp='no' if test "$curl_cv_native_windows" = "yes"; then - case $host_os in - mingw32ce*) curl_cv_wince='yes';; - esac case "$CPPFLAGS" in *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; esac @@ -896,7 +892,7 @@ AS_HELP_STRING([--disable-telnet],[Disable TELNET support]), AC_MSG_RESULT(yes) ) -if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then +if test "$curl_cv_winuwp" = 'yes'; then AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) CURL_DISABLE_TELNET=1 fi @@ -1177,37 +1173,6 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1"; then - if test "$curl_cv_wince" = 'yes'; then - dnl This is for Windows CE systems - winsock_LIB="-lws2" - if test ! -z "$winsock_LIB"; then - my_ac_save_LIBS=$LIBS - LIBS="$winsock_LIB $LIBS" - AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #ifdef _WIN32 - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif - #include - #endif - ]],[[ - gethostbyname("localhost"); - ]]) - ],[ - AC_MSG_RESULT([yes]) - HAVE_GETHOSTBYNAME="1" - ],[ - AC_MSG_RESULT([no]) - winsock_LIB="" - LIBS=$my_ac_save_LIBS - ]) - fi - fi -fi - # In UWP mode gethostbyname gets detected via the core libs, but some # code (in6addr_any) still need ws2_32, so let us detect and add it. if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then @@ -1693,10 +1658,6 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), ) ) -if test "$curl_cv_wince" = 'yes'; then - ipv6=no -fi - if test "$ipv6" = yes; then curl_ipv6_msg="enabled" AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) @@ -1998,14 +1959,11 @@ CURL_WITH_APPLE_SECTRUST dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then - LIBS="-lcrypt32 $LIBS" - if test "$curl_cv_wince" = 'no'; then - LIBS="-ladvapi32 $LIBS" - fi + LIBS="-ladvapi32 -lcrypt32 $LIBS" fi dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer) -if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then +if test "x$curl_cv_native_windows" = "xyes"; then LIBS="-lbcrypt $LIBS" fi @@ -2750,11 +2708,7 @@ dnl ---------------------------- dnl check Windows Unicode option dnl ---------------------------- -if test "$curl_cv_wince" = 'yes'; then - want_winuni="yes" -else - want_winuni="no" -fi +want_winuni="no" if test "$curl_cv_native_windows" = "yes"; then if test "$curl_cv_winuwp" = 'yes'; then want_winuni="yes" @@ -4266,11 +4220,9 @@ else CURL_CHECK_FUNC_STRICMP fi -if test "$curl_cv_wince" = 'no'; then - AC_CHECK_FUNCS([setmode]) - if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then - AC_CHECK_FUNCS([_setmode]) - fi +AC_CHECK_FUNCS([setmode]) +if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then + AC_CHECK_FUNCS([_setmode]) fi if test -z "$ssl_backends"; then @@ -4639,7 +4591,7 @@ AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), want_unix_sockets=auto ] ) -if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then +if test "x$want_unix_sockets" != "xno"; then if test "x$curl_cv_native_windows" = "xyes"; then USE_UNIX_SOCKETS=1 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 48c44e6c6bba..d02174d8caab 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -12,13 +12,6 @@ email the as soon as possible and explain to us why this is a problem for you and how your use case cannot be satisfied properly using a workaround. -## Windows CE - -Windows CE "mainstream support" ended on October 9, 2018, and "Extended -Support" ended on October 10, 2023. - -curl drops all support in November 2025. - ## VS2008 curl drops support for getting built with Microsoft Visual Studio 2008 in @@ -100,3 +93,4 @@ Support for RTMP in libcurl gets removed in April 2026. - BearSSL (removed in 8.15.0) - msh3 (removed in 8.16.0) - winbuild build system (removed in 8.17.0) + - Windows CE (removed in 8.18.0) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index dfbc1eebfd1b..0db7848a224e 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -650,7 +650,7 @@ This is a probably incomplete list of known CPU architectures and operating systems that curl has been compiled for. If you know a system curl compiles and runs on, that is not listed, please let us know. -## 109 Operating Systems +## 108 Operating Systems AIX, AmigaOS, Android, ArcaOS, Aros, Atari FreeMiNT, Azure Sphere, BeOS, Blackberry 10, Blackberry Tablet OS, Cell OS, Cesium, CheriBSD, Chrome OS, @@ -665,7 +665,7 @@ and runs on, that is not listed, please let us know. SINIX-Z, SkyOS, SmartOS, Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS, ucLinux, Ultrix, UNICOS, UnixWare, visionOS, VMS, vxWorks, watchOS, Wear OS, WebOS, Wii System Software, Wii U, Windows, - Windows CE, Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr + Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr ## 28 CPU Architectures diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index b13593a0414b..12d8de76c974 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -103,12 +103,7 @@ int main(int argc, char **argv) if(!fp) return 2; -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - if(stat(file, &file_info) != 0) { -#else if(fstat(fileno(fp), &file_info) != 0) { -#endif fclose(fp); return 1; /* cannot continue */ } diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index b99fab58c389..290f92a61e78 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -29,7 +29,7 @@ * filter IP addresses. */ -#if defined(__AMIGA__) || defined(UNDER_CE) +#ifdef __AMIGA__ #include int main(void) { printf("Platform not supported.\n"); return 1; } #else diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 7415cff81f01..6cab781a4657 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -46,11 +46,7 @@ #include /* misc. Unix functions */ #endif -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif /* The IP address and port number to connect to */ #define IPADDR "127.0.0.1" diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index 03dd323bda6b..fa9de2aa4f64 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -57,12 +57,7 @@ int main(void) } /* to get the file size */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - if(stat("debugit", &file_info) != 0) { -#else if(fstat(fileno(fd), &file_info) != 0) { -#endif fclose(fd); curl_global_cleanup(); return 1; /* cannot continue */ diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 26db7f595301..b334ad327317 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -28,11 +28,7 @@ #include #include #include -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif #ifdef _WIN32 #include #undef stat @@ -95,12 +91,7 @@ int main(void) } /* to get the file size */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - if(stat(LOCAL_FILE, &file_info) != 0) { -#else if(fstat(fileno(hd_src), &file_info) != 0) { -#endif fclose(hd_src); return 1; /* cannot continue */ } diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index ea972ec1931f..e9d723d70d66 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -77,9 +77,7 @@ static int upload(CURL *curl, const char *remotepath, f = fopen(localpath, "rb"); if(!f) { -#ifndef UNDER_CE perror(NULL); -#endif return 0; } diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index ca61a92d916f..e58742e59c96 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -28,11 +28,7 @@ #include #include #include -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif #if defined(_MSC_VER) && (_MSC_VER < 1900) #define snprintf _snprintf diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 7ba150e91af5..84b0e18ea12b 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -30,11 +30,7 @@ #include #include #include -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif /* somewhat Unix-specific */ #ifndef _MSC_VER @@ -231,14 +227,9 @@ static int setup(struct input *t, int num, const char *upload) return 1; } -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - if(stat(upload, &file_info) != 0) { -#else if(fstat(fileno(t->in), &file_info) != 0) { -#endif - fprintf(stderr, "error: could not stat file %s: %s\n", - upload, strerror(errno)); + fprintf(stderr, "error: could not stat file %s: %s\n", upload, + strerror(errno)); fclose(t->out); t->out = NULL; return 1; diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 794ea99ae582..a7fac75b4a2f 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -90,12 +90,7 @@ int main(int argc, char **argv) return 2; /* get the file size of the local file */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - if(stat(file, &file_info) != 0) { -#else if(fstat(fileno(hd_src), &file_info) != 0) { -#endif fclose(hd_src); return 1; /* cannot continue */ } diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index 350d41affaa6..23208d232caf 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -32,9 +32,7 @@ * */ -#ifndef UNDER_CE #include -#endif #include #include #include @@ -156,7 +154,7 @@ static int mem_addf(struct mem *mem, const char *format, ...) return x; } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 /* Not all versions of Windows CRT vsnprintf are compliant with C99. Some return -1 if buffer too small. Try _vscprintf to get the needed size. */ if(!i && x < 0) { @@ -297,11 +295,9 @@ int main(void) } } else { -#ifndef UNDER_CE mem_addf(&t->log, "Failed to create body output file %s: %s\n", t->bodyfile, strerror(errno)); fprintf(stderr, "%s", t->log.recent); -#endif failed = 1; } @@ -310,12 +306,10 @@ int main(void) if(fp && t->log.len == fwrite(t->log.buf, 1, t->log.len, fp)) fprintf(stderr, "Transfer log written to %s\n", t->logfile); -#ifndef UNDER_CE else { fprintf(stderr, "Failed to write transfer log to %s: %s\n", t->logfile, strerror(errno)); } -#endif if(fp) fclose(fp); diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index cb5d1cf33e0c..72ae41382c84 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -92,9 +92,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath, f = fopen(localpath, "rb"); if(!f) { -#ifndef UNDER_CE perror(NULL); -#endif return 0; } @@ -103,7 +101,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath, curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); curl_easy_setopt(curl, CURLOPT_READDATA, f); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 _fseeki64(f, remoteFileSizeByte, SEEK_SET); #else fseek(f, (long)remoteFileSizeByte, SEEK_SET); diff --git a/include/curl/system.h b/include/curl/system.h index 62ed2b0f43aa..a5b3e9eba79a 100644 --- a/include/curl/system.h +++ b/include/curl/system.h @@ -135,21 +135,12 @@ # endif #elif defined(UNDER_CE) -# ifdef __MINGW32CE__ -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# else -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T "I64d" -# define CURL_FORMAT_CURL_OFF_TU "I64u" -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# endif +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T i64 +# define CURL_SUFFIX_CURL_OFF_TU ui64 +# define CURL_TYPEOF_CURL_SOCKLEN_T int #elif defined(__MINGW32__) # include diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index d1652d0ff425..07b666304910 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -473,7 +473,7 @@ static bool async_thrdd_init(struct Curl_easy *data, err_exit: CURL_TRC_DNS(data, "resolve thread failed init: %d", err); async_thrdd_destroy(data); - CURL_SETERRNO(err); + errno = err; return FALSE; } diff --git a/lib/cf-socket.c b/lib/cf-socket.c index a8fa997de025..d1a99d3ecee9 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -853,24 +853,11 @@ static bool verifyconnect(curl_socket_t sockfd, int *error) * * Someone got to verify this on Win-NT 4.0, 2000." */ - -#ifdef UNDER_CE - Sleep(0); -#else SleepEx(0, FALSE); -#endif - #endif if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize)) err = SOCKERRNO; -#ifdef UNDER_CE - /* Old Windows CE versions do not support SO_ERROR */ - if(WSAENOPROTOOPT == err) { - SET_SOCKERRNO(0); - err = 0; - } -#endif #if defined(EBADIOCTL) && defined(__minix) /* Minix 3.1.x does not support getsockopt on UDP sockets */ if(EBADIOCTL == err) { diff --git a/lib/config-win32.h b/lib/config-win32.h index 408606d61179..bf9038a894a2 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -28,8 +28,6 @@ /* Hand crafted config file for Windows */ /* ================================================================ */ -#ifndef UNDER_CE - /* Define some minimum and default build targets for Visual Studio */ #ifdef _MSC_VER /* VS2012 default target settings and minimum build target check. */ @@ -78,8 +76,6 @@ # endif #endif /* _MSC_VER */ -#endif /* UNDER_CE */ - /* ---------------------------------------------------------------- */ /* HEADER FILES */ /* ---------------------------------------------------------------- */ @@ -87,19 +83,15 @@ /* Define if you have the header file. */ /* #define HAVE_ARPA_INET_H 1 */ -#ifndef UNDER_CE - /* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 /* exists on __MINGW32CE__ */ +#define HAVE_FCNTL_H 1 /* Define if you have the header file. */ -#define HAVE_IO_H 1 /* exists on __MINGW32CE__ */ +#define HAVE_IO_H 1 /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 -#endif - /* Define if you have the header file. */ /* #define HAVE_NETDB_H 1 */ @@ -107,10 +99,8 @@ /* #define HAVE_NETINET_IN_H 1 */ /* Define to 1 if you have the header file. */ -#ifndef UNDER_CE #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__) -#define HAVE_STDBOOL_H 1 /* exists on __MINGW32CE__ */ -#endif +#define HAVE_STDBOOL_H 1 #endif /* Define to 1 if you have the header file. */ @@ -159,10 +149,8 @@ #define STDC_HEADERS 1 /* Define to 1 if bool is an available type. */ -#ifndef UNDER_CE #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__) -#define HAVE_BOOL_T 1 /* exists on __MINGW32CE__ */ -#endif +#define HAVE_BOOL_T 1 #endif /* ---------------------------------------------------------------- */ @@ -200,7 +188,6 @@ /* Define if you have the select function. */ #define HAVE_SELECT 1 -#ifndef UNDER_CE /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 @@ -209,7 +196,6 @@ /* Define if you have the _setmode function. */ #define HAVE__SETMODE 1 -#endif /* Define if you have the socket function. */ #define HAVE_SOCKET 1 @@ -276,9 +262,7 @@ #endif /* Define to 1 if you have the signal function. */ -#ifndef UNDER_CE #define HAVE_SIGNAL 1 -#endif /* ---------------------------------------------------------------- */ /* TYPEDEF REPLACEMENTS */ @@ -347,11 +331,9 @@ #endif /* Windows XP is required for freeaddrinfo, getaddrinfo */ -#ifndef UNDER_CE #define HAVE_FREEADDRINFO 1 #define HAVE_GETADDRINFO 1 #define HAVE_GETADDRINFO_THREADSAFE 1 -#endif /* ---------------------------------------------------------------- */ /* STRUCT RELATED */ @@ -370,8 +352,6 @@ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ -#ifndef UNDER_CE - #if defined(_MSC_VER) || defined(__MINGW32__) # define USE_WIN32_LARGE_FILES /* Number of bits in a file offset, on hosts where this is settable. */ @@ -390,8 +370,6 @@ # define SIZEOF_OFF_T 4 #endif -#endif /* UNDER_CE */ - /* ---------------------------------------------------------------- */ /* DNS RESOLVER SPECIALTY */ /* ---------------------------------------------------------------- */ @@ -420,7 +398,7 @@ #ifdef CURL_HAS_OPENLDAP_LDAPSDK #undef USE_WIN32_LDAP #define HAVE_LDAP_URL_PARSE 1 -#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#elif !defined(CURL_WINDOWS_UWP) #undef HAVE_LDAP_URL_PARSE #define HAVE_LDAP_SSL 1 #define USE_WIN32_LDAP 1 @@ -432,9 +410,7 @@ #endif /* Define to use Unix sockets. */ -#ifndef UNDER_CE #define USE_UNIX_SOCKETS -#endif /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ @@ -442,52 +418,19 @@ /* Define cpu-machine-OS */ #ifndef CURL_OS -# ifdef UNDER_CE -# ifdef _M_ARM -# define CURL_OS "arm-pc-win32ce" -# else -# define CURL_OS "i386-pc-win32ce" -# endif -# else /* !UNDER_CE */ -# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ -# define CURL_OS "i386-pc-win32" -# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */ -# define CURL_OS "x86_64-pc-win32" -# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */ -# define CURL_OS "ia64-pc-win32" -# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */ -# define CURL_OS "thumbv7a-pc-win32" -# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */ -# define CURL_OS "aarch64-pc-win32" -# else -# define CURL_OS "unknown-pc-win32" -# endif -# endif /* UNDER_CE */ +# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ +# define CURL_OS "i386-pc-win32" +# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */ +# define CURL_OS "x86_64-pc-win32" +# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */ +# define CURL_OS "ia64-pc-win32" +# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */ +# define CURL_OS "thumbv7a-pc-win32" +# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */ +# define CURL_OS "aarch64-pc-win32" +# else +# define CURL_OS "unknown-pc-win32" +# endif #endif /* !CURL_OS */ -/* ---------------------------------------------------------------- */ -/* Windows CE */ -/* ---------------------------------------------------------------- */ - -#ifdef UNDER_CE - -#ifndef UNICODE -#define UNICODE -#endif - -#ifndef _UNICODE -#define _UNICODE -#endif - -#define CURL_DISABLE_FILE 1 -#define CURL_DISABLE_TELNET 1 -#define CURL_DISABLE_LDAP 1 - -#ifndef _MSC_VER -/* !checksrc! disable BANNEDFUNC 1 */ -extern int stat(const char *path, struct stat *buffer); -#endif - -#endif /* UNDER_CE */ - #endif /* HEADER_CURL_CONFIG_WIN32_H */ diff --git a/lib/connect.c b/lib/connect.c index 573b02952b10..b5de9b4f5eb0 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -280,7 +280,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, addr[0] = '\0'; *port = 0; - CURL_SETERRNO(SOCKEAFNOSUPPORT); + errno = SOCKEAFNOSUPPORT; return FALSE; } diff --git a/lib/curl_fopen.c b/lib/curl_fopen.c index c41cff21cde9..fd0c7c65d201 100644 --- a/lib/curl_fopen.c +++ b/lib/curl_fopen.c @@ -101,14 +101,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, *fh = curlx_fopen(filename, FOPEN_WRITETEXT); if(!*fh) goto fail; - if( -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - stat(filename, &sb) == -1 -#else - fstat(fileno(*fh), &sb) == -1 -#endif - || !S_ISREG(sb.st_mode)) { + if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) { return CURLE_OK; } curlx_fclose(*fh); diff --git a/lib/curl_setup.h b/lib/curl_setup.h index d41c9b8ceabc..fe3b9e0ee395 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -75,7 +75,7 @@ #endif #endif -#if defined(__MINGW32__) && !defined(__MINGW32CE__) && \ +#if defined(__MINGW32__) && \ (!defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 3)) #error "Building curl requires mingw-w64 3.0 or later" #endif @@ -122,14 +122,6 @@ # endif #endif -/* Avoid bogus format check warnings with mingw32ce gcc 4.4.0 in - C99 (-std=gnu99) mode */ -#if defined(__MINGW32CE__) && !defined(CURL_NO_FMT_CHECKS) && \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) && \ - (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)) -#define CURL_NO_FMT_CHECKS -#endif - /* Compatibility */ #ifdef ENABLE_IPV6 #define USE_IPV6 1 @@ -497,12 +489,10 @@ # define LSEEK_ERROR (__int64)-1 # else /* Small file (<2Gb) support using Win32 functions. */ -# ifndef UNDER_CE -# undef lseek -# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence) -# define fstat(fdes, stp) _fstat(fdes, stp) -# define struct_stat struct _stat -# endif +# undef lseek +# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence) +# define fstat(fdes, stp) _fstat(fdes, stp) +# define struct_stat struct _stat # define LSEEK_ERROR (long)-1 # endif #elif defined(__DJGPP__) @@ -817,27 +807,6 @@ #include "curl_setup_once.h" #endif -#ifdef UNDER_CE -#define getenv curl_getenv /* Windows CE does not support getenv() */ -#define raise(s) ((void)(s)) -/* Terrible workarounds to make Windows CE compile */ -#define errno 0 -#define CURL_SETERRNO(x) ((void)(x)) -#define EINTR 4 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EEXIST 17 -#define EISDIR 21 -#define EINVAL 22 -#define ENOSPC 28 -#define strerror(x) "?" -#undef STDIN_FILENO -#define STDIN_FILENO 0 -#else -#define CURL_SETERRNO(x) (errno = (x)) -#endif - /* * Definition of our NOP statement Object-like macro */ @@ -926,7 +895,7 @@ endings either CRLF or LF so 't' is appropriate. /* for systems that do not detect this in configure */ #ifndef CURL_SA_FAMILY_T -# if defined(_WIN32) && !defined(UNDER_CE) +# ifdef _WIN32 # define CURL_SA_FAMILY_T ADDRESS_FAMILY # elif defined(HAVE_SA_FAMILY_T) # define CURL_SA_FAMILY_T sa_family_t diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index 7a54760e161e..1c2194c50248 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -33,9 +33,7 @@ #include #include #include -#ifndef UNDER_CE #include -#endif #ifdef HAVE_SYS_TYPES_H #include @@ -356,7 +354,7 @@ typedef unsigned int bit; #ifdef __VMS #define argv_item_t __char_ptr32 -#elif defined(_UNICODE) && !defined(UNDER_CE) +#elif defined(_UNICODE) #define argv_item_t wchar_t * #else #define argv_item_t char * diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index c819b1c22ea5..32b4c894d6b5 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -62,11 +62,7 @@ CURLcode Curl_sspi_global_init(void) /* If security interface is not yet initialized try to do this */ if(!Curl_pSecFn) { /* Get pointer to Security Service Provider Interface dispatch table */ -#ifdef __MINGW32CE__ - Curl_pSecFn = InitSecurityInterfaceW(); -#else Curl_pSecFn = InitSecurityInterface(); -#endif if(!Curl_pSecFn) return CURLE_FAILED_INIT; } diff --git a/lib/curl_sspi.h b/lib/curl_sspi.h index 8ecd81fdea14..89ebc9b0ba8b 100644 --- a/lib/curl_sspi.h +++ b/lib/curl_sspi.h @@ -70,225 +70,6 @@ extern PSecurityFunctionTable Curl_pSecFn; #define ISC_REQ_USE_HTTP_STYLE 0x01000000 #endif -#ifdef __MINGW32CE__ -#ifndef ISC_RET_REPLAY_DETECT -#define ISC_RET_REPLAY_DETECT 0x00000004 -#endif -#ifndef ISC_RET_SEQUENCE_DETECT -#define ISC_RET_SEQUENCE_DETECT 0x00000008 -#endif -#ifndef ISC_RET_CONFIDENTIALITY -#define ISC_RET_CONFIDENTIALITY 0x00000010 -#endif -#ifndef ISC_RET_ALLOCATED_MEMORY -#define ISC_RET_ALLOCATED_MEMORY 0x00000100 -#endif -#ifndef ISC_RET_STREAM -#define ISC_RET_STREAM 0x00008000 -#endif - -#ifndef SEC_E_INSUFFICIENT_MEMORY -#define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L) -#endif -#ifndef SEC_E_INVALID_HANDLE -#define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L) -#endif -#ifndef SEC_E_UNSUPPORTED_FUNCTION -#define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L) -#endif -#ifndef SEC_E_TARGET_UNKNOWN -#define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L) -#endif -#ifndef SEC_E_INTERNAL_ERROR -#define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L) -#endif -#ifndef SEC_E_SECPKG_NOT_FOUND -#define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L) -#endif -#ifndef SEC_E_NOT_OWNER -#define SEC_E_NOT_OWNER ((HRESULT)0x80090306L) -#endif -#ifndef SEC_E_CANNOT_INSTALL -#define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L) -#endif -#ifndef SEC_E_INVALID_TOKEN -#define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L) -#endif -#ifndef SEC_E_CANNOT_PACK -#define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L) -#endif -#ifndef SEC_E_QOP_NOT_SUPPORTED -#define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL) -#endif -#ifndef SEC_E_NO_IMPERSONATION -#define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL) -#endif -#ifndef SEC_E_LOGON_DENIED -#define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL) -#endif -#ifndef SEC_E_UNKNOWN_CREDENTIALS -#define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL) -#endif -#ifndef SEC_E_NO_CREDENTIALS -#define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL) -#endif -#ifndef SEC_E_MESSAGE_ALTERED -#define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL) -#endif -#ifndef SEC_E_OUT_OF_SEQUENCE -#define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L) -#endif -#ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY -#define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L) -#endif -#ifndef SEC_E_BAD_PKGID -#define SEC_E_BAD_PKGID ((HRESULT)0x80090316L) -#endif -#ifndef SEC_E_CONTEXT_EXPIRED -#define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L) -#endif -#ifndef SEC_E_INCOMPLETE_MESSAGE -#define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L) -#endif -#ifndef SEC_E_INCOMPLETE_CREDENTIALS -#define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L) -#endif -#ifndef SEC_E_BUFFER_TOO_SMALL -#define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L) -#endif -#ifndef SEC_E_WRONG_PRINCIPAL -#define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L) -#endif -#ifndef SEC_E_TIME_SKEW -#define SEC_E_TIME_SKEW ((HRESULT)0x80090324L) -#endif -#ifndef SEC_E_UNTRUSTED_ROOT -#define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L) -#endif -#ifndef SEC_E_ILLEGAL_MESSAGE -#define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L) -#endif -#ifndef SEC_E_CERT_UNKNOWN -#define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L) -#endif -#ifndef SEC_E_CERT_EXPIRED -#define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L) -#endif -#ifndef SEC_E_ENCRYPT_FAILURE -#define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L) -#endif -#ifndef SEC_E_DECRYPT_FAILURE -#define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L) -#endif -#ifndef SEC_E_ALGORITHM_MISMATCH -#define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L) -#endif -#ifndef SEC_E_SECURITY_QOS_FAILED -#define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L) -#endif -#ifndef SEC_E_UNFINISHED_CONTEXT_DELETED -#define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L) -#endif -#ifndef SEC_E_NO_TGT_REPLY -#define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L) -#endif -#ifndef SEC_E_NO_IP_ADDRESSES -#define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L) -#endif -#ifndef SEC_E_WRONG_CREDENTIAL_HANDLE -#define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L) -#endif -#ifndef SEC_E_CRYPTO_SYSTEM_INVALID -#define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L) -#endif -#ifndef SEC_E_MAX_REFERRALS_EXCEEDED -#define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L) -#endif -#ifndef SEC_E_MUST_BE_KDC -#define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L) -#endif -#ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED -#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL) -#endif -#ifndef SEC_E_TOO_MANY_PRINCIPALS -#define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL) -#endif -#ifndef SEC_E_NO_PA_DATA -#define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL) -#endif -#ifndef SEC_E_PKINIT_NAME_MISMATCH -#define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL) -#endif -#ifndef SEC_E_SMARTCARD_LOGON_REQUIRED -#define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL) -#endif -#ifndef SEC_E_SHUTDOWN_IN_PROGRESS -#define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL) -#endif -#ifndef SEC_E_KDC_INVALID_REQUEST -#define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L) -#endif -#ifndef SEC_E_KDC_UNABLE_TO_REFER -#define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L) -#endif -#ifndef SEC_E_KDC_UNKNOWN_ETYPE -#define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L) -#endif -#ifndef SEC_E_UNSUPPORTED_PREAUTH -#define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L) -#endif -#ifndef SEC_E_DELEGATION_REQUIRED -#define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L) -#endif -#ifndef SEC_E_BAD_BINDINGS -#define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L) -#endif -#ifndef SEC_E_MULTIPLE_ACCOUNTS -#define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L) -#endif -#ifndef SEC_E_NO_KERB_KEY -#define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L) -#endif -#ifndef SEC_E_CERT_WRONG_USAGE -#define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L) -#endif -#ifndef SEC_E_DOWNGRADE_DETECTED -#define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L) -#endif -#ifndef SEC_E_SMARTCARD_CERT_REVOKED -#define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L) -#endif -#ifndef SEC_E_ISSUING_CA_UNTRUSTED -#define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L) -#endif -#ifndef SEC_E_REVOCATION_OFFLINE_C -#define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L) -#endif -#ifndef SEC_E_PKINIT_CLIENT_FAILURE -#define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L) -#endif -#ifndef SEC_E_SMARTCARD_CERT_EXPIRED -#define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L) -#endif -#ifndef SEC_E_NO_S4U_PROT_SUPPORT -#define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L) -#endif -#ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE -#define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L) -#endif -#ifndef SEC_E_REVOCATION_OFFLINE_KDC -#define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L) -#endif -#ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC -#define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L) -#endif -#ifndef SEC_E_KDC_CERT_EXPIRED -#define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL) -#endif -#ifndef SEC_E_KDC_CERT_REVOKED -#define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL) -#endif -#endif /* __MINGW32CE__ */ /* Offered by mingw-w64 v8+. MS SDK 6.0A+. */ #ifndef SEC_E_INVALID_PARAMETER #define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL) @@ -302,44 +83,11 @@ extern PSecurityFunctionTable Curl_pSecFn; #define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL) #endif -#ifdef __MINGW32CE__ -#ifndef SEC_I_CONTINUE_NEEDED -#define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L) -#endif -#ifndef SEC_I_COMPLETE_NEEDED -#define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L) -#endif -#ifndef SEC_I_COMPLETE_AND_CONTINUE -#define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L) -#endif -#ifndef SEC_I_LOCAL_LOGON -#define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L) -#endif -#ifndef SEC_I_CONTEXT_EXPIRED -#define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L) -#endif -#ifndef SEC_I_INCOMPLETE_CREDENTIALS -#define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L) -#endif -#ifndef SEC_I_RENEGOTIATE -#define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L) -#endif -#ifndef SEC_I_NO_LSA_CONTEXT -#define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L) -#endif -#endif /* __MINGW32CE__ */ - /* Offered by mingw-w64 v8+. MS SDK 6.0A+. */ #ifndef SEC_I_SIGNATURE_NEEDED #define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL) #endif -#ifdef __MINGW32CE__ -#ifndef CRYPT_E_NOT_IN_REVOCATION_DATABASE -#define CRYPT_E_NOT_IN_REVOCATION_DATABASE ((HRESULT)0x80092014L) -#endif -#endif /* __MINGW32CE__ */ - /* * Definitions required from ntsecapi.h are directly provided below this point * to avoid including ntsecapi.h due to a conflict with OpenSSL's safestack.h diff --git a/lib/curl_threads.c b/lib/curl_threads.c index 68bfddddcbcd..a0308f06b2dc 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -69,7 +69,7 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T rc = pthread_create(t, NULL, curl_thread_create_thunk, ac); if(rc) { - CURL_SETERRNO(rc); + errno = rc; goto err; } @@ -109,10 +109,9 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T if(!t) { DWORD gle = GetLastError(); /* !checksrc! disable ERRNOVAR 1 */ - int err = (gle == ERROR_ACCESS_DENIED || - gle == ERROR_NOT_ENOUGH_MEMORY) ? - EACCES : EINVAL; - CURL_SETERRNO(err); + errno = (gle == ERROR_ACCESS_DENIED || + gle == ERROR_NOT_ENOUGH_MEMORY) ? + EACCES : EINVAL; return curl_thread_t_null; } return t; @@ -128,11 +127,7 @@ void Curl_thread_destroy(curl_thread_t *hnd) int Curl_thread_join(curl_thread_t *hnd) { -#ifdef UNDER_CE - int ret = (WaitForSingleObject(*hnd, INFINITE) == WAIT_OBJECT_0); -#else int ret = (WaitForSingleObjectEx(*hnd, INFINITE, FALSE) == WAIT_OBJECT_0); -#endif Curl_thread_destroy(hnd); diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index 9509e8314880..a5311874b8ae 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -47,7 +47,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence) #endif } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 #include "multibyte.h" @@ -235,7 +235,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) } else /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(EINVAL); + errno = EINVAL; #else if(fix_excessive_path(filename, &fixed)) target = fixed; @@ -266,7 +266,7 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) } else /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(EINVAL); + errno = EINVAL; curlx_unicodefree(filename_w); curlx_unicodefree(mode_w); #else @@ -304,7 +304,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) } else /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(EINVAL); + errno = EINVAL; #else if(fix_excessive_path(path, &fixed)) target = fixed; @@ -321,4 +321,4 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) return result; } -#endif /* _WIN32 && !UNDER_CE */ +#endif /* _WIN32 */ diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index 51f4dbca173b..da9eb55ec9dd 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -34,7 +34,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 FILE *curlx_win32_fopen(const char *filename, const char *mode); int curlx_win32_stat(const char *path, struct_stat *buffer); int curlx_win32_open(const char *filename, int oflag, ...); diff --git a/lib/curlx/inet_ntop.c b/lib/curlx/inet_ntop.c index a9595d0c2f25..d4053f1a60f2 100644 --- a/lib/curlx/inet_ntop.c +++ b/lib/curlx/inet_ntop.c @@ -72,9 +72,9 @@ static char *inet_ntop4(const unsigned char *src, char *dst, size_t size) len = strlen(tmp); if(len == 0 || len >= size) { #ifdef USE_WINSOCK - CURL_SETERRNO(WSAEINVAL); + errno = WSAEINVAL; #else - CURL_SETERRNO(ENOSPC); + errno = ENOSPC; #endif return NULL; } @@ -186,9 +186,9 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size) */ if((size_t)(tp - tmp) > size) { #ifdef USE_WINSOCK - CURL_SETERRNO(WSAEINVAL); + errno = WSAEINVAL; #else - CURL_SETERRNO(ENOSPC); + errno = ENOSPC; #endif return NULL; } @@ -215,7 +215,7 @@ char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size) case AF_INET6: return inet_ntop6((const unsigned char *)src, buf, size); default: - CURL_SETERRNO(SOCKEAFNOSUPPORT); + errno = SOCKEAFNOSUPPORT; return NULL; } } diff --git a/lib/curlx/inet_pton.c b/lib/curlx/inet_pton.c index d2b39ae9f1a7..b78fa5d746fb 100644 --- a/lib/curlx/inet_pton.c +++ b/lib/curlx/inet_pton.c @@ -82,7 +82,7 @@ curlx_inet_pton(int af, const char *src, void *dst) case AF_INET6: return inet_pton6(src, (unsigned char *)dst); default: - CURL_SETERRNO(SOCKEAFNOSUPPORT); + errno = SOCKEAFNOSUPPORT; return -1; } /* NOTREACHED */ diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index e5227554e563..047588ed183a 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -287,13 +287,10 @@ const char *curlx_strerror(int err, char *buf, size_t buflen) *buf = '\0'; #ifdef _WIN32 -#ifndef UNDER_CE /* 'sys_nerr' is the maximum errno number, it is not widely portable */ if(err >= 0 && err < sys_nerr) SNPRINTF(buf, buflen, "%s", sys_errlist[err]); - else -#endif - { + else { if( #ifdef USE_WINSOCK !get_winsock_error(err, buf, buflen) && @@ -350,7 +347,7 @@ const char *curlx_strerror(int err, char *buf, size_t buflen) *p = '\0'; if(errno != old_errno) - CURL_SETERRNO(old_errno); + errno = old_errno; #ifdef _WIN32 if(old_win_err != GetLastError()) diff --git a/lib/curlx/version_win32.c b/lib/curlx/version_win32.c index 7e415dfe89d9..cc86b71d3e3d 100644 --- a/lib/curlx/version_win32.c +++ b/lib/curlx/version_win32.c @@ -111,12 +111,6 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, /* we are always running on PLATFORM_WINNT */ matched = FALSE; } -#elif defined(UNDER_CE) - (void)majorVersion; - (void)minorVersion; - (void)buildVersion; - (void)platform; - (void)condition; #else ULONGLONG cm = 0; struct OUR_OSVERSIONINFOEXW osver; @@ -139,7 +133,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, #pragma clang diagnostic ignored "-Wcast-function-type-strict" #endif pRtlVerifyVersionInfo = CURLX_FUNCTION_CAST(RTLVERIFYVERSIONINFO_FN, - GetProcAddress(GetModuleHandleA("ntdll"), "RtlVerifyVersionInfo")); + GetProcAddress(GetModuleHandle(TEXT("ntdll")), "RtlVerifyVersionInfo")); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop #endif diff --git a/lib/curlx/winapi.c b/lib/curlx/winapi.c index de1218cec7f5..2dc277c1c1fa 100644 --- a/lib/curlx/winapi.c +++ b/lib/curlx/winapi.c @@ -61,8 +61,7 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen) /* We return the local codepage version of the error string because if it is output to the user's terminal it will likely be with functions which - expect the local codepage (eg fprintf, failf, infof). - FormatMessageW -> wcstombs is used for Windows CE compatibility. */ + expect the local codepage (eg fprintf, failf, infof). */ if(FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err, LANG_NEUTRAL, wbuf, CURL_ARRAYSIZE(wbuf), NULL)) { @@ -118,7 +117,7 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen) #endif if(errno != old_errno) - CURL_SETERRNO(old_errno); + errno = old_errno; if(old_win_err != GetLastError()) SetLastError(old_win_err); diff --git a/lib/easy.c b/lib/easy.c index c5ccc5b1e61f..54896a8d55b4 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -106,12 +106,10 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT; * ways, but at this point it must be defined as the system-supplied strdup * so the callback pointer is initialized correctly. */ -#ifdef UNDER_CE -#define system_strdup _strdup -#elif !defined(HAVE_STRDUP) -#define system_strdup Curl_strdup -#else +#ifdef HAVE_STRDUP #define system_strdup strdup +#else +#define system_strdup Curl_strdup #endif #if defined(_MSC_VER) && defined(_DLL) diff --git a/lib/file.c b/lib/file.c index 565620283403..5fff5d0a82f0 100644 --- a/lib/file.c +++ b/lib/file.c @@ -572,7 +572,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) if(data->state.resume_from) { if(!S_ISDIR(statbuf.st_mode)) { -#if defined(__AMIGA__) || defined(__MINGW32CE__) +#ifdef __AMIGA__ if(data->state.resume_from != lseek(fd, (off_t)data->state.resume_from, SEEK_SET)) #else diff --git a/lib/ftp.c b/lib/ftp.c index 108310bf301b..bcf4b809cc80 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3311,10 +3311,6 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, /* shut down the socket to inform the server we are done */ -#ifdef UNDER_CE - shutdown(conn->sock[SECONDARYSOCKET], 2); /* SD_BOTH */ -#endif - if(Curl_conn_is_setup(conn, SECONDARYSOCKET)) { if(!result && ftpc->dont_check && data->req.maxdownload > 0) { /* partial download completed */ diff --git a/lib/getenv.c b/lib/getenv.c index 3bfcf707a44b..a2d8056fcc72 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -31,7 +31,7 @@ static char *GetEnv(const char *variable) { -#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE) || \ +#if defined(CURL_WINDOWS_UWP) || \ defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */ (void)variable; return NULL; diff --git a/lib/hostip.c b/lib/hostip.c index ce79e5fc4b4e..48889dcb43bc 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -42,9 +42,7 @@ #endif #include -#ifndef UNDER_CE #include -#endif #include "urldata.h" #include "sendf.h" diff --git a/lib/md4.c b/lib/md4.c index d86a24628c46..0cc62f815233 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -133,12 +133,7 @@ static int MD4_Init(MD4_CTX *ctx) static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size) { -#ifdef __MINGW32CE__ - CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(data), - (unsigned int) size, 0); -#else CryptHashData(ctx->hHash, (const BYTE *)data, (unsigned int) size, 0); -#endif } static void MD4_Final(unsigned char *result, MD4_CTX *ctx) diff --git a/lib/md5.c b/lib/md5.c index d99554a4aac9..4b38bb070b32 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -240,11 +240,7 @@ static void my_md5_update(void *in, unsigned int inputLen) { my_md5_ctx *ctx = in; -#ifdef __MINGW32CE__ - CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(input), inputLen, 0); -#else CryptHashData(ctx->hHash, (const BYTE *)input, inputLen, 0); -#endif } static void my_md5_final(unsigned char *digest, void *in) diff --git a/lib/memdebug.c b/lib/memdebug.c index 7ded52c1e97c..11e924a55b09 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -117,7 +117,7 @@ static bool countcheck(const char *func, int line, const char *source) source, line, func); fflush(curl_dbg_logfile); /* because it might crash now */ /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(ENOMEM); + errno = ENOMEM; return TRUE; /* RETURN ERROR! */ } else diff --git a/lib/rename.c b/lib/rename.c index 225811e65a65..911afca57563 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -39,7 +39,7 @@ /* return 0 on success, 1 on error */ int Curl_rename(const char *oldpath, const char *newpath) { -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 /* rename() on Windows does not overwrite, so we cannot use it here. MoveFileEx() will overwrite and is usually atomic, however it fails when there are open handles to the file. */ diff --git a/lib/sha256.c b/lib/sha256.c index f7bb5456133d..3e3205e36bf3 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -214,11 +214,7 @@ static void my_sha256_update(void *in, unsigned int length) { my_sha256_ctx *ctx = (my_sha256_ctx *)in; -#ifdef __MINGW32CE__ - CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(data), length, 0); -#else CryptHashData(ctx->hHash, (const BYTE *)data, length, 0); -#endif } static void my_sha256_final(unsigned char *digest, void *in) diff --git a/lib/strerror.c b/lib/strerror.c index 5b82d7f96556..afe69756bcbc 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -679,7 +679,7 @@ const char *Curl_sspi_strerror(SECURITY_STATUS err, char *buf, size_t buflen) #endif if(errno != old_errno) - CURL_SETERRNO(old_errno); + errno = old_errno; #ifdef _WIN32 if(old_win_err != GetLastError()) diff --git a/lib/system_win32.c b/lib/system_win32.c index cd01fd2ebfe3..bdbed66162eb 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -99,15 +99,9 @@ CURLcode Curl_win32_init(long flags) s_hIpHlpApiDll = curl_load_library(TEXT("iphlpapi.dll")); if(s_hIpHlpApiDll) { /* Get the address of the if_nametoindex function */ -#ifdef UNDER_CE - #define CURL_TEXT(n) TEXT(n) -#else - #define CURL_TEXT(n) (n) -#endif IF_NAMETOINDEX_FN pIfNameToIndex = CURLX_FUNCTION_CAST(IF_NAMETOINDEX_FN, - GetProcAddress(s_hIpHlpApiDll, - CURL_TEXT("if_nametoindex"))); + GetProcAddress(s_hIpHlpApiDll, "if_nametoindex")); if(pIfNameToIndex) Curl_if_nametoindex = pIfNameToIndex; @@ -164,13 +158,9 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD); /* See function definitions in winbase.h */ #ifdef UNICODE -# ifdef UNDER_CE -# define LOADLIBARYEX L"LoadLibraryExW" -# else -# define LOADLIBARYEX "LoadLibraryExW" -# endif +# define LOADLIBARYEX "LoadLibraryExW" #else -# define LOADLIBARYEX "LoadLibraryExA" +# define LOADLIBARYEX "LoadLibraryExA" #endif /* @@ -189,7 +179,7 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD); */ static HMODULE curl_load_library(LPCTSTR filename) { -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP HMODULE hModule = NULL; LOADLIBRARYEX_FN pLoadLibraryEx = NULL; diff --git a/lib/transfer.c b/lib/transfer.c index 4c17cbb50da0..2b06566f73c0 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -39,9 +39,7 @@ #ifdef HAVE_SYS_IOCTL_H #include #endif -#ifndef UNDER_CE #include -#endif #ifdef HAVE_SYS_PARAM_H #include diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index f2a907cb09cb..6311f4a41623 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -119,12 +119,6 @@ #define CALG_SHA_256 0x0000800c #endif -/* Work around typo in CeGCC (as of 0.59.1) w32api headers */ -#if defined(__MINGW32CE__) && \ - !defined(ALG_CLASS_DHASH) && defined(ALG_CLASS_HASH) -#define ALG_CLASS_DHASH ALG_CLASS_HASH -#endif - /* Offered by mingw-w64 v4+. MS SDK 6.0A+. */ #ifndef PKCS12_NO_PERSIST_KEY #define PKCS12_NO_PERSIST_KEY 0x00008000 @@ -385,7 +379,6 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, return CURLE_OK; } -#ifndef UNDER_CE /* Function allocates memory for store_path only if CURLE_OK is returned */ static CURLcode get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, @@ -441,7 +434,6 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, return CURLE_OK; } -#endif static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, @@ -536,7 +528,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, return CURLE_SSL_CONNECT_ERROR; } -#ifndef UNDER_CE /* client certificate */ if(data->set.ssl.primary.clientcert || data->set.ssl.primary.cert_blob) { DWORD cert_store_name = 0; @@ -744,7 +735,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, } client_cert_store = cert_store; } -#endif /* allocate memory for the reusable credential handle */ backend->cred = (struct Curl_schannel_cred *) @@ -875,9 +865,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = (struct schannel_ssl_backend_data *)connssl->backend; -#ifndef UNDER_CE struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); -#endif struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); SecBuffer outbuf; SecBufferDesc outbuf_desc; @@ -908,11 +896,6 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) backend->use_alpn = FALSE; #endif -#ifdef UNDER_CE - /* certificate validation on Windows CE does not seem to work right; we will - * do it following a more manual process. */ - backend->use_manual_cred_validation = TRUE; -#else if(conn_config->CAfile || conn_config->ca_info_blob) { if(curlx_verify_windows_version(6, 1, 0, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL)) { @@ -926,7 +909,6 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } else backend->use_manual_cred_validation = FALSE; -#endif backend->cred = NULL; @@ -2573,7 +2555,7 @@ static void schannel_close(struct Curl_cfilter *cf, struct Curl_easy *data) static int schannel_init(void) { -#if defined(HAS_ALPN_SCHANNEL) && !defined(UNDER_CE) +#ifdef HAS_ALPN_SCHANNEL typedef const char *(APIENTRY *WINE_GET_VERSION_FN)(void); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic push @@ -2581,8 +2563,7 @@ static int schannel_init(void) #endif WINE_GET_VERSION_FN p_wine_get_version = CURLX_FUNCTION_CAST(WINE_GET_VERSION_FN, - GetProcAddress(GetModuleHandleA("ntdll"), - "wine_get_version")); + GetProcAddress(GetModuleHandle(TEXT("ntdll")), "wine_get_version")); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop #endif @@ -2599,7 +2580,7 @@ static int schannel_init(void) s_win_has_alpn = curlx_verify_windows_version(6, 3, 0, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL); } -#endif /* HAS_ALPN_SCHANNEL && !UNDER_CE */ +#endif /* HAS_ALPN_SCHANNEL */ return Curl_sspi_global_init() == CURLE_OK ? 1 : 0; } @@ -2716,12 +2697,7 @@ static void schannel_checksum(const unsigned char *input, if(!CryptCreateHash(hProv, algId, 0, 0, &hHash)) break; /* failed */ -#ifdef __MINGW32CE__ - /* workaround for CeGCC, should be (const BYTE*) */ - if(!CryptHashData(hHash, (BYTE*)CURL_UNCONST(input), (DWORD)inputlen, 0)) -#else if(!CryptHashData(hHash, input, (DWORD)inputlen, 0)) -#endif break; /* failed */ /* get hash size */ diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index a5084944846f..6b8aec561374 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -55,22 +55,6 @@ #define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend) -#ifdef __MINGW32CE__ -#define CERT_QUERY_OBJECT_BLOB 0x00000002 -#define CERT_QUERY_CONTENT_CERT 1 -#define CERT_QUERY_CONTENT_FLAG_CERT (1 << CERT_QUERY_CONTENT_CERT) -#define CERT_QUERY_FORMAT_BINARY 1 -#define CERT_QUERY_FORMAT_BASE64_ENCODED 2 -#define CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED 3 -#define CERT_QUERY_FORMAT_FLAG_ALL \ - (1 << CERT_QUERY_FORMAT_BINARY) | \ - (1 << CERT_QUERY_FORMAT_BASE64_ENCODED) | \ - (1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED) -#define CERT_CHAIN_REVOCATION_CHECK_CHAIN 0x20000000 -#define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000 -#define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000 -#endif /* __MINGW32CE__ */ - #define MAX_CAFILE_SIZE 1048576 /* 1 MiB */ #define BEGIN_CERT "-----BEGIN CERTIFICATE-----" #define END_CERT "\n-----END CERTIFICATE-----" @@ -112,7 +96,6 @@ struct cert_chain_engine_config_win7 { HCERTSTORE hExclusiveTrustedPeople; }; -#ifndef UNDER_CE static int is_cr_or_lf(char c) { return c == '\r' || c == '\n'; @@ -534,7 +517,6 @@ static bool get_alt_name_info(struct Curl_easy *data, result = TRUE; return result; } -#endif /* !UNDER_CE */ /* Verify the server's hostname */ CURLcode Curl_verify_host(struct Curl_cfilter *cf, @@ -543,58 +525,6 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, CURLcode result = CURLE_PEER_FAILED_VERIFICATION; struct ssl_connect_data *connssl = cf->ctx; CERT_CONTEXT *pCertContextServer = NULL; -#ifdef UNDER_CE - TCHAR cert_hostname_buff[256]; - DWORD len; - - /* This code does not support certificates with multiple alternative names. - * Right now we are only asking for the first preferred alternative name. - * Instead we would need to do all via CERT_NAME_SEARCH_ALL_NAMES_FLAG - * (If Windows CE supports that?) and run this section in a loop for each. - * https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certgetnamestringa - * curl: (51) schannel: CertGetNameString() certificate hostname - * (.google.com) did not match connection (google.com) - */ - len = CertGetNameString(pCertContextServer, - CERT_NAME_DNS_TYPE, - CERT_NAME_DISABLE_IE4_UTF8_FLAG, - NULL, - cert_hostname_buff, - 256); - if(len > 0) { - /* Comparing the cert name and the connection hostname encoded as UTF-8 - * is acceptable since both values are assumed to use ASCII - * (or some equivalent) encoding - */ - char *cert_hostname = curlx_convert_tchar_to_UTF8(cert_hostname_buff); - if(!cert_hostname) { - result = CURLE_OUT_OF_MEMORY; - } - else{ - const char *conn_hostname = connssl->peer.hostname; - if(Curl_cert_hostcheck(cert_hostname, strlen(cert_hostname), - conn_hostname, strlen(conn_hostname))) { - infof(data, - "schannel: connection hostname (%s) validated " - "against certificate name (%s)", - conn_hostname, cert_hostname); - result = CURLE_OK; - } - else{ - failf(data, - "schannel: connection hostname (%s) " - "does not match certificate name (%s)", - conn_hostname, cert_hostname); - } - Curl_safefree(cert_hostname); - } - } - else { - failf(data, - "schannel: CertGetNameString did not provide any " - "certificate name information"); - } -#else SECURITY_STATUS sspi_status; TCHAR *cert_hostname_buff = NULL; size_t cert_hostname_buff_index = 0; @@ -740,7 +670,6 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, if(pCertContextServer) CertFreeCertificateContext(pCertContextServer); -#endif /* !UNDER_CE */ return result; } @@ -757,10 +686,8 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, CERT_CONTEXT *pCertContextServer = NULL; const CERT_CHAIN_CONTEXT *pChainContext = NULL; HCERTCHAINENGINE cert_chain_engine = NULL; -#ifndef UNDER_CE HCERTSTORE trust_store = NULL; HCERTSTORE own_trust_store = NULL; -#endif /* !UNDER_CE */ DEBUGASSERT(BACKEND); @@ -776,7 +703,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, result = CURLE_PEER_FAILED_VERIFICATION; } -#ifndef UNDER_CE if(result == CURLE_OK && (conn_config->CAfile || conn_config->ca_info_blob) && BACKEND->use_manual_cred_validation) { @@ -870,7 +796,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, } } } -#endif /* !UNDER_CE */ if(result == CURLE_OK) { CERT_CHAIN_PARA ChainPara; @@ -934,7 +859,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, } } -#ifndef UNDER_CE if(cert_chain_engine) { CertFreeCertificateChainEngine(cert_chain_engine); } @@ -942,7 +866,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, if(own_trust_store) { CertCloseStore(own_trust_store, 0); } -#endif /* !UNDER_CE */ if(pChainContext) CertFreeCertificateChain(pChainContext); diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index b9abc6e3faed..328b12403e9b 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -386,10 +386,7 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf, * valid when used in another process with different CWD. However, * when a path does not exist, this does not work. Then, we add * the path as is. */ -#ifdef UNDER_CE - (void)is_local; - return curlx_dyn_addf(buf, ":%s-%s", name, path); -#elif defined(_WIN32) +#ifdef _WIN32 char abspath[_MAX_PATH]; if(_fullpath(abspath, path, _MAX_PATH)) return curlx_dyn_addf(buf, ":%s-%s", name, abspath); diff --git a/m4/xc-lt-iface.m4 b/m4/xc-lt-iface.m4 index a4088003535e..22eecd349f20 100644 --- a/m4/xc-lt-iface.m4 +++ b/m4/xc-lt-iface.m4 @@ -74,7 +74,7 @@ fi if test "x$xc_lt_want_enable_shared" = 'xyes' && test "x$xc_lt_want_enable_static" = 'xyes'; then case $host_os in @%:@ ( - cegcc* | os2* | aix*) + os2* | aix*) xc_lt_want_enable_static='no' ;; esac @@ -265,7 +265,7 @@ elif test "x$allow_undefined_flag" = 'xunsupported'; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in @%:@ ( - cygwin* | mingw* | cegcc* | os2* | aix*) + cygwin* | mingw* | os2* | aix*) xc_lt_shlib_use_no_undefined='yes' ;; esac diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a70c96b7650f..9e2bbed8f06c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -121,7 +121,7 @@ if(CURL_HAS_LTO) set_target_properties(${EXE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) endif() -if(ENABLE_UNICODE AND MINGW AND NOT MINGW32CE) +if(ENABLE_UNICODE AND MINGW) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_OPTIONS "-municode") else() diff --git a/src/terminal.c b/src/terminal.c index 014e2df8c00b..867ca6edcf88 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -64,7 +64,7 @@ unsigned int get_terminal_columns(void) struct winsize ts; if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts)) cols = (int)ts.ws_col; -#elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP) { HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE); CONSOLE_SCREEN_BUFFER_INFO console_info; diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index 2ea88017051e..d4431a74b951 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -156,7 +156,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) /* * Truncate the etag save stream, it can have an existing etag value. */ -#if defined(HAVE_FTRUNCATE) && !defined(__MINGW32CE__) +#ifdef HAVE_FTRUNCATE if(ftruncate(fileno(etag_save->stream), 0)) { return CURL_WRITEFUNC_ERROR; } diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 6c119047ce56..cc7ef5a55079 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -122,11 +122,11 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) On Linux per->infd should be stdin (0) and the block below should not execute */ if(per->uploadfile && !strcmp(per->uploadfile, ".") && per->infd > 0) { -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) rc = CURL_RECV(per->infd, buffer, curlx_uztosi(sz * nmemb), 0); if(rc < 0) { if(SOCKERRNO == SOCKEWOULDBLOCK) { - CURL_SETERRNO(0); + errno = 0; config->readbusy = TRUE; return CURL_READFUNC_PAUSE; } @@ -142,7 +142,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) rc = read(per->infd, buffer, sz*nmemb); if(rc < 0) { if(errno == EAGAIN) { - CURL_SETERRNO(0); + errno = 0; config->readbusy = TRUE; return CURL_READFUNC_PAUSE; } diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index 292da1c25176..fd1b4c563c80 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -78,7 +78,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) } #endif -#if defined(__AMIGA__) || defined(__MINGW32CE__) +#ifdef __AMIGA__ if(LSEEK_ERROR == lseek(per->infd, (off_t)offset, whence)) #else if(LSEEK_ERROR == lseek(per->infd, offset, whence)) diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 724706b7a1af..48f5fea3c9b9 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -109,7 +109,7 @@ bool tool_create_output_file(struct OutStruct *outs, return TRUE; } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 static size_t win_console(intptr_t fhnd, struct OutStruct *outs, char *buffer, size_t bytes, size_t *retp) @@ -247,7 +247,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) struct OperationConfig *config = per->config; size_t bytes = sz * nmemb; bool is_tty = global->isatty; -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 CONSOLE_SCREEN_BUFFER_INFO console_info; intptr_t fhnd; #endif @@ -321,7 +321,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) } } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 fhnd = _get_osfhandle(fileno(outs->stream)); /* if Windows console then UTF-8 must be converted to UTF-16 */ if(isatty(fileno(outs->stream)) && diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 29d5ecc78220..2ddb0ad2fcfc 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -261,7 +261,7 @@ static void free_globalconfig(void) global->trace_stream = NULL; tool_safefree(global->libcurl); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 free(global->term.buf); #endif } diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index cac22483b7df..dc78f2db44f6 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -326,7 +326,7 @@ struct OperationConfig { BIT(skip_existing); }; -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 struct termout { wchar_t *buf; DWORD len; @@ -343,7 +343,7 @@ struct GlobalConfig { struct OperationConfig *first; struct OperationConfig *current; struct OperationConfig *last; -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 struct termout term; #endif timediff_t ms_per_transfer; /* start next transfer after (at least) this diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index 91cc1b60cbd5..17b2d01e9bc6 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -23,8 +23,8 @@ ***************************************************************************/ #include "tool_setup.h" -#if defined(_WIN32) && !defined(UNDER_CE) -# include +#ifdef _WIN32 +#include #endif #include "tool_dirhie.h" diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 2b19a163ce8b..6204296a8b51 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -561,7 +561,7 @@ char **__crt0_glob_function(char *arg) #ifdef _WIN32 -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ +#if !defined(CURL_WINDOWS_UWP) && \ !defined(CURL_DISABLE_CA_SEARCH) && !defined(CURL_CA_SEARCH_SAFE) /* Search and set the CA cert file for Windows. * @@ -613,7 +613,7 @@ CURLcode FindWin32CACert(struct OperationConfig *config, struct curl_slist *GetLoadedModulePaths(void) { struct curl_slist *slist = NULL; -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP HANDLE hnd = INVALID_HANDLE_VALUE; MODULEENTRY32 mod = {0}; @@ -664,7 +664,7 @@ struct curl_slist *GetLoadedModulePaths(void) bool tool_term_has_bold; -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP /* The terminal settings to restore on exit */ static struct TerminalSettings { HANDLE hStdOut; @@ -735,14 +735,14 @@ static void init_terminal(void) CURLcode win32_init(void) { curlx_now_init(); -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP init_terminal(); #endif return CURLE_OK; } -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP /* The following STDIN non - blocking read techniques are heavily inspired by nmap and ncat (https://nmap.org/ncat/) */ struct win_thread_data { @@ -949,7 +949,7 @@ curl_socket_t win32_stdin_read_thread(void) return socket_r; } -#endif /* !CURL_WINDOWS_UWP && !UNDER_CE */ +#endif /* !CURL_WINDOWS_UWP */ #endif /* _WIN32 */ diff --git a/src/tool_doswin.h b/src/tool_doswin.h index 7fe5260476ea..01500bdbf732 100644 --- a/src/tool_doswin.h +++ b/src/tool_doswin.h @@ -47,7 +47,7 @@ char **__crt0_glob_function(char *arg); #ifdef _WIN32 -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ +#if !defined(CURL_WINDOWS_UWP) && \ !defined(CURL_DISABLE_CA_SEARCH) && !defined(CURL_CA_SEARCH_SAFE) CURLcode FindWin32CACert(struct OperationConfig *config, const TCHAR *bundle_file); @@ -55,9 +55,9 @@ CURLcode FindWin32CACert(struct OperationConfig *config, struct curl_slist *GetLoadedModulePaths(void); CURLcode win32_init(void); -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP curl_socket_t win32_stdin_read_thread(void); -#endif /* !CURL_WINDOWS_UWP && !UNDER_CE */ +#endif #endif /* _WIN32 */ diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 1d127a584286..c1e9abe9d0b8 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -121,11 +121,7 @@ static struct tool_mime *tool_mime_new_filedata(struct tool_mime *parent, } } else { /* Standard input. */ -#ifdef UNDER_CE - int fd = STDIN_FILENO; -#else int fd = fileno(stdin); -#endif char *data = NULL; curl_off_t size; curl_off_t origin; diff --git a/src/tool_getparam.h b/src/tool_getparam.h index 6b37cc50ebe7..d5ef54a81d24 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -379,7 +379,7 @@ void parse_cert_parameter(const char *cert_parameter, ParameterError parse_args(int argc, argv_item_t argv[]); -#if defined(UNICODE) && defined(_WIN32) && !defined(UNDER_CE) +#if defined(UNICODE) && defined(_WIN32) #define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) #define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) diff --git a/src/tool_getpass.c b/src/tool_getpass.c index a4dea347efe0..014c22813acf 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -42,7 +42,7 @@ # include iodef #endif -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 # include #endif @@ -115,7 +115,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) return buffer; /* we always return success */ } #define DONE -#endif /* _WIN32 && !UNDER_CE */ +#endif /* _WIN32 */ #ifndef DONE /* not previously provided */ diff --git a/src/tool_main.c b/src/tool_main.c index 4e70c1081cfa..8df63ef05a59 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -27,9 +27,7 @@ #include #endif -#ifndef UNDER_CE #include -#endif #ifdef HAVE_FCNTL_H #include @@ -143,7 +141,7 @@ static void memory_tracking_init(void) /* ** curl tool main function. */ -#if defined(_UNICODE) && !defined(UNDER_CE) +#ifdef _UNICODE #if defined(__GNUC__) || defined(__clang__) /* GCC does not know about wmain() */ #pragma GCC diagnostic push @@ -159,7 +157,7 @@ int main(int argc, char *argv[]) tool_init_stderr(); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 /* Undocumented diagnostic option to list the full paths of all loaded modules. This is purposely pre-init. */ if(argc == 2 && !_tcscmp(argv[1], _T("--dump-module-paths"))) { @@ -169,8 +167,7 @@ int main(int argc, char *argv[]) curl_slist_free_all(head); return head ? 0 : 1; } -#endif -#ifdef _WIN32 + /* win32_init must be called before other init routines. */ result = win32_init(); if(result) { @@ -214,7 +211,7 @@ int main(int argc, char *argv[]) #endif } -#if defined(_UNICODE) && !defined(UNDER_CE) +#ifdef _UNICODE #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif diff --git a/src/tool_operate.c b/src/tool_operate.c index b7c8805b3a4c..8949ce2a52f3 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -555,25 +555,19 @@ static CURLcode retrycheck(struct OperationConfig *config, } if(truncate && outs->bytes && outs->filename && outs->stream) { -#ifndef __MINGW32CE__ struct_stat fileinfo; /* The output can be a named pipe or a character device etc that cannot be truncated. Only truncate regular files. */ if(!fstat(fileno(outs->stream), &fileinfo) && - S_ISREG(fileinfo.st_mode)) -#else - /* Windows CE's fileno() is bad so just skip the check */ -#endif - { + S_ISREG(fileinfo.st_mode)) { int rc; /* 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 */ -#if defined(HAVE_FTRUNCATE) && !defined(__DJGPP__) && !defined(__AMIGA__) && \ - !defined(__MINGW32CE__) +#if defined(HAVE_FTRUNCATE) && !defined(__DJGPP__) && !defined(__AMIGA__) if(ftruncate(fileno(outs->stream), outs->init)) { /* when truncate fails, we cannot just append as then we will create something strange, bail out */ @@ -625,7 +619,7 @@ static CURLcode post_per_transfer(struct per_transfer *per, if(per->uploadfile) { if(!strcmp(per->uploadfile, ".") && per->infd > 0) { -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) sclose(per->infd); #else warnf("Closing per->infd != 0: FD == " @@ -1122,7 +1116,7 @@ static void check_stdin_upload(struct OperationConfig *config, CURLX_SET_BINMODE(stdin); if(!strcmp(per->uploadfile, ".")) { -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) /* non-blocking stdin behavior on Windows is challenging Spawn a new thread that will read from stdin and write out to a socket */ @@ -2100,8 +2094,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) goto fail; } } -#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ - !defined(CURL_DISABLE_CA_SEARCH) +#elif !defined(CURL_WINDOWS_UWP) && !defined(CURL_DISABLE_CA_SEARCH) result = FindWin32CACert(config, TEXT("curl-ca-bundle.crt")); if(result) goto fail; @@ -2234,11 +2227,8 @@ CURLcode operate(int argc, argv_item_t argv[]) { CURLcode result = CURLE_OK; const char *first_arg; -#ifdef UNDER_CE - first_arg = argc > 1 ? strdup(argv[1]) : NULL; -#else + first_arg = argc > 1 ? convert_tchar_to_UTF8(argv[1]) : NULL; -#endif #ifdef HAVE_SETLOCALE /* Override locale for number parsing (only) */ diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 46096d5b5abe..5fce4e24d124 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -100,7 +100,7 @@ ParameterError parseconfig(const char *filename, int max_recursive) } filename = pathalloc = curlrc; } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 else { char *fullp; /* check for .curlrc then _curlrc in the directory of the executable */ diff --git a/src/tool_setup.h b/src/tool_setup.h index a661040737b8..17c2f420b582 100644 --- a/src/tool_setup.h +++ b/src/tool_setup.h @@ -93,15 +93,6 @@ extern FILE *tool_stderr; /* set in init_terminal() */ extern bool tool_term_has_bold; -#ifdef UNDER_CE -# undef isatty -# define isatty(fd) 0 /* fd is void*, expects int */ -# undef _get_osfhandle -# define _get_osfhandle(fd) (fd) -# undef _getch -# define _getch() 0 -#endif - #ifndef HAVE_FTRUNCATE int tool_ftruncate64(int fd, curl_off_t where); diff --git a/src/tool_util.c b/src/tool_util.c index f8415d2a1739..a2798876ea06 100644 --- a/src/tool_util.c +++ b/src/tool_util.c @@ -80,17 +80,9 @@ int struplocompare4sort(const void *p1, const void *p2) } #ifdef USE_TOOL_FTRUNCATE - -#ifdef UNDER_CE -/* 64-bit lseek-like function unavailable */ -# undef _lseeki64 -# define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence) -#endif - /* * Truncate a file handle at a 64-bit position 'where'. */ - int tool_ftruncate64(int fd, curl_off_t where) { intptr_t handle = _get_osfhandle(fd); @@ -103,10 +95,9 @@ int tool_ftruncate64(int fd, curl_off_t where) return 0; } - #endif /* USE_TOOL_FTRUNCATE */ -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 FILE *tool_execpath(const char *filename, char **pathp) { static char filebuffer[512]; diff --git a/src/tool_util.h b/src/tool_util.h index c97c1c03c205..12206ce980aa 100644 --- a/src/tool_util.h +++ b/src/tool_util.h @@ -34,7 +34,7 @@ struct timeval tvrealnow(void); int struplocompare(const char *p1, const char *p2); int struplocompare4sort(const void *p1, const void *p2); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 FILE *tool_execpath(const char *filename, char **pathp); #endif diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index b4f770285137..88cbdd8a44f4 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -61,12 +61,7 @@ static CURLcode test_lib505(const char *URL) } /* get the file size of the local file */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - hd = stat(libtest_arg2, &file_info); -#else hd = fstat(fileno(hd_src), &file_info); -#endif if(hd == -1) { /* can't open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c index 4c33973ec9f7..292dd59f21bc 100644 --- a/tests/libtest/lib525.c +++ b/tests/libtest/lib525.c @@ -52,12 +52,7 @@ static CURLcode test_lib525(const char *URL) } /* get the file size of the local file */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - hd = stat(libtest_arg2, &file_info); -#else hd = fstat(fileno(hd_src), &file_info); -#endif if(hd == -1) { /* can't open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c index dfe585d9da73..8a2b76f8d0b7 100644 --- a/tests/libtest/lib541.c +++ b/tests/libtest/lib541.c @@ -52,12 +52,7 @@ static CURLcode test_lib541(const char *URL) } /* get the file size of the local file */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - hd = stat(libtest_arg2, &file_info); -#else hd = fstat(fileno(hd_src), &file_info); -#endif if(hd == -1) { /* can't open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index 78b89975e8ac..daf92fe1e600 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -80,11 +80,7 @@ static CURLcode test_lib556(const char *URL) if(nread) { /* send received stuff to stdout */ -#ifdef UNDER_CE - if((size_t)fwrite(buf, sizeof(buf[0]), nread, stdout) != nread) { -#else if((size_t)write(STDOUT_FILENO, buf, nread) != nread) { -#endif char errbuf[STRERROR_LEN]; curl_mfprintf(stderr, "write() failed: errno %d (%s)\n", errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index e013daedff8a..9601f29c71bc 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -254,12 +254,7 @@ static CURLcode test_lib582(const char *URL) } /* get the file size of the local file */ -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - hd = stat(libtest_arg2, &file_info); -#else hd = fstat(fileno(hd_src), &file_info); -#endif if(hd == -1) { /* can't open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", diff --git a/tests/server/first.h b/tests/server/first.h index 3a7255ccb88f..fc581487e694 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -48,9 +48,7 @@ struct entry_s { extern const struct entry_s s_entries[]; -#ifndef UNDER_CE #include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 7320fa6fe9a2..b4896260b94e 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -101,7 +101,7 @@ enum sockmode { ACTIVE_DISCONNECT /* as a client, disconnected from server */ }; -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) /* * read-wrapper to support reading from stdin on Windows. */ @@ -128,7 +128,7 @@ static ssize_t read_wincon(int fd, void *buf, size_t count) return rcount; } - CURL_SETERRNO((int)GetLastError()); + errno = (int)GetLastError(); return -1; } @@ -161,7 +161,7 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count) return wcount; } - CURL_SETERRNO((int)GetLastError()); + errno = (int)GetLastError(); return -1; } #define SOCKFILT_read read_wincon @@ -171,8 +171,6 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count) #define SOCKFILT_write write #endif -#ifndef UNDER_CE - /* On Windows, we sometimes get this for a broken pipe, seemingly * when the client just closed stdin? */ #define CURL_WIN32_EPIPE 109 @@ -296,7 +294,6 @@ static bool read_stdin(void *buffer, size_t nbytes) } return TRUE; } -#endif /* * write_stdout tries to write to stdio nbytes from the given buffer. This is a @@ -308,12 +305,7 @@ static bool read_stdin(void *buffer, size_t nbytes) static bool write_stdout(const void *buffer, size_t nbytes) { ssize_t nwrite; -#ifdef UNDER_CE - puts(buffer); - nwrite = nbytes; -#else nwrite = fullwrite(fileno(stdout), buffer, nbytes); -#endif if(nwrite != (ssize_t)nbytes) { logmsg("exiting..."); return FALSE; @@ -321,7 +313,6 @@ static bool write_stdout(const void *buffer, size_t nbytes) return TRUE; } -#ifndef UNDER_CE static void lograw(unsigned char *buffer, ssize_t len) { char data[120]; @@ -401,10 +392,8 @@ static bool read_data_block(unsigned char *buffer, ssize_t maxlen, return TRUE; } -#endif - -#if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_UWP) /* * Winsock select() does not support standard file descriptors, * it can only check SOCKETs. The following function is an attempt @@ -867,8 +856,6 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, #define SOCKFILT_select(a,b,c,d,e) select(a,b,c,d,e) #endif /* USE_WINSOCK */ - -#ifndef UNDER_CE /* Perform the disconnect handshake with sockfilt * This involves waiting for the disconnect acknowledgment after the DISC * command, while throwing away anything else that might come in before @@ -923,7 +910,6 @@ static bool disc_handshake(void) } while(TRUE); return TRUE; } -#endif /* sockfdp is a pointer to an established stream or CURL_SOCKET_BAD @@ -935,12 +921,6 @@ static bool juggle(curl_socket_t *sockfdp, curl_socket_t listenfd, enum sockmode *mode) { -#ifdef UNDER_CE - (void)sockfdp; - (void)listenfd; - (void)mode; - return FALSE; -#else struct timeval timeout; fd_set fds_read; fd_set fds_write; @@ -1217,7 +1197,6 @@ static bool juggle(curl_socket_t *sockfdp, } return TRUE; -#endif } static int test_sockfilt(int argc, char *argv[]) diff --git a/tests/server/util.c b/tests/server/util.c index 6de8000327bd..afe69862636a 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -333,7 +333,7 @@ static SIGHANDLER_T old_sigterm_handler = SIG_ERR; static SIGHANDLER_T old_sigbreak_handler = SIG_ERR; #endif -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) static DWORD thread_main_id = 0; static HANDLE thread_main_window = NULL; static HWND hidden_main_window = NULL; @@ -344,7 +344,6 @@ static HWND hidden_main_window = NULL; * The first time this is called it will set got_exit_signal to one and * store in exit_signal the signal that triggered its execution. */ -#ifndef UNDER_CE /* * Only call signal-safe functions from the signal handler, as required by * the POSIX specification: @@ -387,11 +386,10 @@ static void exit_signal_handler(int signum) #endif } (void)signal(signum, exit_signal_handler); - CURL_SETERRNO(old_errno); + errno = old_errno; } -#endif -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 /* CTRL event handler for Windows Console applications to simulate * SIGINT, SIGTERM and SIGBREAK on CTRL events and trigger signal handler. * @@ -439,7 +437,7 @@ static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType) } #endif -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) /* Window message handler for Windows applications to add support * for graceful process termination via taskkill (without /f) which * sends WM_CLOSE to all Windows of a process (even hidden ones). @@ -519,7 +517,6 @@ static DWORD WINAPI main_window_loop(void *lpParameter) } #endif -#ifndef UNDER_CE static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler, bool restartable) { @@ -549,7 +546,6 @@ static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler, return oldhdlr; #endif } -#endif void install_signal_handlers(bool keep_sigalrm) { @@ -608,12 +604,10 @@ void install_signal_handlers(bool keep_sigalrm) errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); #endif #ifdef _WIN32 -#ifndef UNDER_CE if(!SetConsoleCtrlHandler(ctrl_event_handler, TRUE)) logmsg("cannot install CTRL event handler"); -#endif -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP thread_main_window = CreateThread(NULL, 0, &main_window_loop, GetModuleHandle(NULL), 0, &thread_main_id); if(!thread_main_window || !thread_main_id) @@ -653,10 +647,8 @@ void restore_signal_handlers(bool keep_sigalrm) (void)set_signal(SIGBREAK, old_sigbreak_handler, FALSE); #endif #ifdef _WIN32 -#ifndef UNDER_CE (void)SetConsoleCtrlHandler(ctrl_event_handler, FALSE); -#endif -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP if(thread_main_window && thread_main_id) { if(PostThreadMessage(thread_main_id, WM_APP, 0, 0)) { if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) { From 2e1a045d8985e5daa4d9a4f908ed870a16d8e41e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 13 Jul 2025 12:57:26 +0200 Subject: [PATCH 392/885] build: drop support for VS2008 (Windows) Require Visual Studio 2010 or newer. Ref: https://github.com/curl/curl/discussions/15972 Follow-up to dc28bb86c1e466c667ce220fd2e51355cd8bae8d #17798 Follow-up to 63e513b106113db0b1b68bab347b80cb4cef4e65 #17380 Closes #17931 --- CMake/win32-cache.cmake | 6 +----- docs/DEPRECATE.md | 12 +----------- docs/INSTALL.md | 2 +- lib/config-win32.h | 19 +++++++++---------- lib/curl_setup.h | 4 ++-- lib/curl_setup_once.h | 2 -- lib/rand.c | 4 ---- lib/vtls/schannel_int.h | 2 +- lib/vtls/vtls_spack.c | 11 ----------- 9 files changed, 15 insertions(+), 47 deletions(-) diff --git a/CMake/win32-cache.cmake b/CMake/win32-cache.cmake index 50c319d1b66b..870acf80de19 100644 --- a/CMake/win32-cache.cmake +++ b/CMake/win32-cache.cmake @@ -53,11 +53,7 @@ else() if(MSVC) set(HAVE_UNISTD_H 0) set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size() - if(MSVC_VERSION GREATER_EQUAL 1600) - set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size() - else() - set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size() - endif() + set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size() if(MSVC_VERSION GREATER_EQUAL 1800) set(HAVE_STDBOOL_H 1) else() diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index d02174d8caab..102969e4b10b 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -12,17 +12,6 @@ email the as soon as possible and explain to us why this is a problem for you and how your use case cannot be satisfied properly using a workaround. -## VS2008 - -curl drops support for getting built with Microsoft Visual Studio 2008 in -November 2025. - -The only reason we kept support for this version is for Windows CE - and we -intend to remove support for that Operating System in this time frame as well. -Bumping the minimum to VS2010. VS2008 is a pain to support. - -Previous discussion and details: https://github.com/curl/curl/discussions/15972 - ## Windows XP In January 2026, curl drops support for Windows XP and Server 2003. Their @@ -94,3 +83,4 @@ Support for RTMP in libcurl gets removed in April 2026. - msh3 (removed in 8.16.0) - winbuild build system (removed in 8.17.0) - Windows CE (removed in 8.18.0) + - Support for Visual Studio 2008 (removed in 8.18.0) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 0db7848a224e..f3db34da280a 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -200,7 +200,7 @@ Building for Windows XP is required as a minimum. You can build curl with: -- Microsoft Visual Studio 2008 v9.0 or later (`_MSC_VER >= 1500`) +- Microsoft Visual Studio 2010 v10.0 or later (`_MSC_VER >= 1600`) - MinGW-w64 3.0 or later (`__MINGW64_VERSION_MAJOR >= 3`) ## Building Windows DLLs and C runtime (CRT) linkage issues diff --git a/lib/config-win32.h b/lib/config-win32.h index bf9038a894a2..4bf034bea31b 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -56,22 +56,21 @@ # error VS2012 does not support build targets prior to Windows Vista # endif # endif - /* Default target settings and minimum build target check for - VS2008 and VS2010 */ + /* VS2010 default target settings and minimum build target check. */ # else -# define VS2008_MIN_TARGET 0x0501 /* XP */ - /* VS2008 default build target is Windows Vista (0x0600). + /* VS2010 default build target is Windows 7 (0x0601). We override default target to be Windows XP. */ -# define VS2008_DEF_TARGET 0x0501 /* XP */ +# define VS2010_MIN_TARGET 0x0501 /* XP */ +# define VS2010_DEF_TARGET 0x0501 /* XP */ # ifndef _WIN32_WINNT -# define _WIN32_WINNT VS2008_DEF_TARGET +# define _WIN32_WINNT VS2010_DEF_TARGET # endif # ifndef WINVER -# define WINVER VS2008_DEF_TARGET +# define WINVER VS2010_DEF_TARGET # endif -# if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET) -# error VS2008 does not support build targets prior to Windows XP +# if (_WIN32_WINNT < VS2010_MIN_TARGET) || (WINVER < VS2010_MIN_TARGET) +# error VS2010 does not support build targets prior to Windows XP # endif # endif #endif /* _MSC_VER */ @@ -104,7 +103,7 @@ #endif /* Define to 1 if you have the header file. */ -#if (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(__MINGW32__) +#if defined(_MSC_VER) || defined(__MINGW32__) #define HAVE_STDINT_H 1 #endif diff --git a/lib/curl_setup.h b/lib/curl_setup.h index fe3b9e0ee395..bf7030f693e1 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -80,9 +80,9 @@ #error "Building curl requires mingw-w64 3.0 or later" #endif -/* Visual Studio 2008 is the minimum Visual Studio version we support. +/* Visual Studio 2010 is the minimum Visual Studio version we support. Workarounds for older versions of Visual Studio have been removed. */ -#if defined(_MSC_VER) && (_MSC_VER < 1500) +#if defined(_MSC_VER) && (_MSC_VER < 1600) #error "Ancient versions of Visual Studio are no longer supported due to bugs." #endif diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index 1c2194c50248..7caf6c9bc5eb 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -65,8 +65,6 @@ Use it for APIs that do not or cannot support the const qualifier. */ #ifdef HAVE_STDINT_H # define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p)) -#elif defined(_WIN32) /* for VS2008 */ -# define CURL_UNCONST(p) ((void *)(ULONG_PTR)(const void *)(p)) #else # define CURL_UNCONST(p) ((void *)(p)) /* Fall back to simple cast */ #endif diff --git a/lib/rand.c b/lib/rand.c index cbfcbf27409b..5eace0283349 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -50,10 +50,6 @@ # include # ifdef _MSC_VER # pragma comment(lib, "bcrypt.lib") -# endif - /* Offered by mingw-w64 v3+. MS SDK v7.0A+. */ -# ifndef BCRYPT_USE_SYSTEM_PREFERRED_RNG -# define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 # endif # ifndef STATUS_SUCCESS # define STATUS_SUCCESS ((NTSTATUS)0x00000000L) diff --git a/lib/vtls/schannel_int.h b/lib/vtls/schannel_int.h index 05116dfa1a92..88f03aaf68c4 100644 --- a/lib/vtls/schannel_int.h +++ b/lib/vtls/schannel_int.h @@ -31,7 +31,7 @@ #include "vtls.h" #include "../curl_sha256.h" -#if defined(_MSC_VER) && (_MSC_VER <= 1600) +#if defined(_MSC_VER) && (_MSC_VER < 1700) /* Workaround for warning: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size */ #undef CERT_STORE_PROV_MEMORY diff --git a/lib/vtls/vtls_spack.c b/lib/vtls/vtls_spack.c index 10d16f213d4f..d86f31d72721 100644 --- a/lib/vtls/vtls_spack.c +++ b/lib/vtls/vtls_spack.c @@ -36,17 +36,6 @@ #include "../curl_memory.h" #include "../memdebug.h" -#ifdef _MSC_VER -#if _MSC_VER >= 1600 -#include -#else -typedef unsigned char uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -#endif -#endif /* _MSC_VER */ - #ifndef UINT16_MAX #define UINT16_MAX 0xffff #endif From 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 27 Aug 2025 00:54:22 +0200 Subject: [PATCH 393/885] openssl: bump minimum OpenSSL version to 3.0.0 It also means that all supported OpenSSL versions and forks support TLSv1.3 after this patch. It reduces `openssl.c` size by more than 10%, or 400 LOC. Ref: #18822 Closes #18330 --- .github/workflows/linux.yml | 6 +- CMakeLists.txt | 3 +- appveyor.sh | 5 +- appveyor.yml | 15 +- docs/INTERNALS.md | 2 +- lib/curl_sha512_256.c | 6 +- lib/dllmain.c | 2 +- lib/vtls/openssl.c | 477 ++---------------------------------- lib/vtls/openssl.h | 3 +- m4/curl-openssl.m4 | 33 ++- 10 files changed, 59 insertions(+), 493 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 773e5b4e919d..fd70d825ecda 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -329,10 +329,10 @@ jobs: install_steps: intel configure: CC=icc --enable-debug --with-openssl - - name: 'Slackware openssl gssapi gcc' - # These are essentially the same flags used to build the curl Slackware package + - name: 'Slackware !ssl gssapi gcc' + # Flags used to build the curl Slackware package, except OpenSSL 1.1.0: # https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild - configure: --enable-debug --with-openssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs + configure: --enable-debug --without-ssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs # Docker Hub image that `container-job` executes in container: 'andy5995/slackware-build-essential:15.0' diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b9b666adb51..8876b5e636f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2152,8 +2152,7 @@ message(STATUS "Features: ${SUPPORT_FEATURES}") # Clear list and collect SSL backends set(_items "") curl_add_if("Schannel" _ssl_enabled AND USE_SCHANNEL) -curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0) -curl_add_if("${_openssl} v3+" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_GREATER_EQUAL 3.0.0) +curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL) curl_add_if("mbedTLS" _ssl_enabled AND USE_MBEDTLS) curl_add_if("wolfSSL" _ssl_enabled AND USE_WOLFSSL) curl_add_if("GnuTLS" _ssl_enabled AND USE_GNUTLS) diff --git a/appveyor.sh b/appveyor.sh index 81407f7f3318..ccd0cc86b0ef 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -35,12 +35,11 @@ esac if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then openssl_root_win="C:/OpenSSL-v35${openssl_suffix}" + openssl_root="$(cygpath "${openssl_root_win}")" elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then openssl_root_win="C:/OpenSSL-v30${openssl_suffix}" -else - openssl_root_win="C:/OpenSSL-v111${openssl_suffix}" + openssl_root="$(cygpath "${openssl_root_win}")" fi -openssl_root="$(cygpath "${openssl_root_win}")" if [ "${BUILD_SYSTEM}" = 'CMake' ]; then # Set env CHKPREFILL to the value '_chkprefill' to compare feature detection diff --git a/appveyor.yml b/appveyor.yml index 98e6e516091a..3d5c6b55aca6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -70,35 +70,34 @@ environment: SCHANNEL: 'ON' SHARED: 'ON' EXAMPLES: 'ON' - - job_name: 'CM VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests' + - job_name: 'CM VS2012, Release, x86, Schannel, Shared, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PRJ_GEN: 'Visual Studio 11 2012' TARGET: '-A Win32' PRJ_CFG: Release - OPENSSL: 'ON' SCHANNEL: 'ON' SHARED: 'ON' - - job_name: 'CM VS2013, Debug, x64, OpenSSL 1.1.1, Shared, Build-only' + - job_name: 'CM VS2013, Debug, x64, Schannel, Shared, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PRJ_GEN: 'Visual Studio 12 2013' TARGET: '-A x64' PRJ_CFG: Debug - OPENSSL: 'ON' + SCHANNEL: 'ON' SHARED: 'ON' TFLAGS: 'skipall' - - job_name: 'CM VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only' + - job_name: 'CM VS2015, Debug, x64, Schannel, Static, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PRJ_GEN: 'Visual Studio 14 2015' TARGET: '-A x64' PRJ_CFG: Debug - OPENSSL: 'ON' + SCHANNEL: 'ON' TFLAGS: 'skipall' - - job_name: 'CM VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only' + - job_name: 'CM VS2017, Debug, x64, Schannel, Shared, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PRJ_GEN: 'Visual Studio 15 2017' TARGET: '-A x64' PRJ_CFG: Debug - OPENSSL: 'ON' + SCHANNEL: 'ON' SHARED: 'ON' TFLAGS: 'skipall' - job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, Build-tests' diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index ac90d3fe8270..c21d5a9120f6 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -24,7 +24,7 @@ versions of libs and build tools. We aim to support these or later versions. - - OpenSSL 1.0.2a + - OpenSSL 3.0.0 - LibreSSL 2.9.1 - GnuTLS 3.1.10 - mbedTLS 3.2.0 diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index 0d2cd3c3f966..070d1722cbce 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -40,10 +40,8 @@ #ifdef USE_OPENSSL # include -# if (!defined(LIBRESSL_VERSION_NUMBER) && \ - OPENSSL_VERSION_NUMBER >= 0x10101000L) || \ - (defined(LIBRESSL_VERSION_NUMBER) && \ - LIBRESSL_VERSION_NUMBER >= 0x3080000fL) +# if !defined(LIBRESSL_VERSION_NUMBER) || \ + (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x3080000fL) # include # if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA512) # include diff --git a/lib/dllmain.c b/lib/dllmain.c index d871a524847b..011090589bb0 100644 --- a/lib/dllmain.c +++ b/lib/dllmain.c @@ -37,7 +37,7 @@ #if defined(USE_OPENSSL) && \ !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC) && \ - !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L + !defined(LIBRESSL_VERSION_NUMBER) #define PREVENT_OPENSSL_MEMLEAK #endif diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f7a5727a11ca..72ca0f6cb38b 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -108,8 +108,10 @@ # if LIBRESSL_VERSION_NUMBER < 0x2090100fL /* 2019-04-13 */ # error "LibreSSL 2.9.1 or later required" # endif -#elif OPENSSL_VERSION_NUMBER < 0x1000201fL /* 2015-03-19 */ -# error "OpenSSL 1.0.2a or later required" +#elif !defined(HAVE_BORINGSSL_LIKE) +# ifndef HAVE_OPENSSL3 /* 2021-09-07 */ +# error "OpenSSL 3.0.0 or later required" +# endif #endif #if defined(HAVE_OPENSSL3) && !defined(OPENSSL_NO_UI_CONSOLE) @@ -123,8 +125,7 @@ static void ossl_provider_cleanup(struct Curl_easy *data); /* AWS-LC fixed a bug with large buffers in v1.61.0 which also introduced * X509_V_ERR_EC_KEY_EXPLICIT_PARAMS. */ -#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ - !defined(LIBRESSL_VERSION_NUMBER) && !defined(OPENSSL_IS_BORINGSSL) && \ +#if !defined(LIBRESSL_VERSION_NUMBER) && !defined(OPENSSL_IS_BORINGSSL) && \ (!defined(OPENSSL_IS_AWSLC) || defined(X509_V_ERR_EC_KEY_EXPLICIT_PARAMS)) #define HAVE_SSL_CTX_SET_DEFAULT_READ_BUFFER_LEN 1 #endif @@ -137,31 +138,6 @@ static void ossl_provider_cleanup(struct Curl_easy *data); #if defined(USE_OPENSSL_ENGINE) || defined(OPENSSL_HAS_PROVIDERS) #include - -#if OPENSSL_VERSION_NUMBER >= 0x10100000L -#define OSSL_UI_METHOD_CAST(x) (x) -#else -#define OSSL_UI_METHOD_CAST(x) CURL_UNCONST(x) -#endif -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL 1.1.0+ and LibreSSL */ -#define HAVE_X509_GET0_EXTENSIONS 1 /* added in 1.1.0 -pre1 */ -#define HAVE_OPAQUE_EVP_PKEY 1 /* since 1.1.0 -pre3 */ -#define HAVE_OPAQUE_RSA_DSA_DH 1 /* since 1.1.0 -pre5 */ -#define HAVE_ERR_REMOVE_THREAD_STATE_DEPRECATED 1 -#else -/* For OpenSSL before 1.1.0 */ -#define ASN1_STRING_get0_data(x) ASN1_STRING_data(x) -#define X509_get0_notBefore(x) X509_get_notBefore(x) -#define X509_get0_notAfter(x) X509_get_notAfter(x) -#define OpenSSL_version_num() SSLeay() -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x10002003L && \ - OPENSSL_VERSION_NUMBER <= 0x10002FFFL && \ - !defined(OPENSSL_NO_COMP) -#define HAVE_SSL_COMP_FREE_COMPRESSION_METHODS 1 #endif #ifdef HAVE_OPENSSL3 @@ -182,8 +158,7 @@ static void ossl_provider_cleanup(struct Curl_easy *data); * BoringSSL: no * LibreSSL: supported since 3.4.1 (released 2021-10-14) */ -#if ((OPENSSL_VERSION_NUMBER >= 0x10101000L && \ - !defined(LIBRESSL_VERSION_NUMBER)) || \ +#if (!defined(LIBRESSL_VERSION_NUMBER) || \ (defined(LIBRESSL_VERSION_NUMBER) && \ LIBRESSL_VERSION_NUMBER >= 0x3040100fL)) && \ !defined(OPENSSL_IS_BORINGSSL) @@ -198,7 +173,7 @@ static void ossl_provider_cleanup(struct Curl_easy *data); * BoringSSL: supported since 0.20240913.0 (commit 826ce15) * LibreSSL: no */ -#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER) +#ifndef LIBRESSL_VERSION_NUMBER #define HAVE_SSL_CTX_SET1_SIGALGS #endif @@ -224,30 +199,6 @@ typedef unsigned long sslerr_t; #endif #define ossl_valsize_t numcert_t -#if OPENSSL_VERSION_NUMBER >= 0x10100000L -/* up2date versions of OpenSSL maintain reasonably secure defaults without - * breaking compatibility, so it is better not to override the defaults in curl - */ -#define DEFAULT_CIPHER_SELECTION NULL -#else -/* not the case with old versions of OpenSSL */ -#define DEFAULT_CIPHER_SELECTION \ - "ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH" -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x10100000L -#define HAVE_RANDOM_INIT_BY_DEFAULT 1 -#endif - -/* - * Whether the OpenSSL version has the API needed to support sharing an - * X509_STORE between connections. The API is: - * * `X509_STORE_up_ref` -- Introduced: OpenSSL 1.1.0. - */ -#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL >= 1.1.0 */ -#define HAVE_SSL_X509_STORE_SHARE -#endif - static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl); static CURLcode push_certinfo(struct Curl_easy *data, @@ -280,27 +231,12 @@ static CURLcode pubkey_show(struct Curl_easy *data, return push_certinfo(data, mem, namebuf, num); } -#ifdef HAVE_OPAQUE_RSA_DSA_DH #define print_pubkey_BN(_type, _name, _num) \ pubkey_show(data, mem, _num, #_type, #_name, _name) -#else -#define print_pubkey_BN(_type, _name, _num) \ -do { \ - if(_type->_name) { \ - pubkey_show(data, mem, _num, #_type, #_name, _type->_name); \ - } \ -} while(0) -#endif - static int asn1_object_dump(const ASN1_OBJECT *a, char *buf, size_t len) { - int i; -#if OPENSSL_VERSION_NUMBER >= 0x10100000L - i = i2t_ASN1_OBJECT(buf, (int)len, a); -#else - i = i2t_ASN1_OBJECT(buf, (int)len, CURL_UNCONST(a)); -#endif + int i = i2t_ASN1_OBJECT(buf, (int)len, a); return (i >= (int)len); /* buffer too small */ } @@ -310,10 +246,10 @@ static CURLcode X509V3_ext(struct Curl_easy *data, { int i; CURLcode result = CURLE_OK; -#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) - const STACK_OF(X509_EXTENSION) *exts = extsarg; -#else +#ifdef LIBRESSL_VERSION_NUMBER STACK_OF(X509_EXTENSION) *exts = CURL_UNCONST(extsarg); +#else + const STACK_OF(X509_EXTENSION) *exts = extsarg; #endif if((int)sk_X509_EXTENSION_num(exts) <= 0) @@ -409,7 +345,6 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) if(result) break; -#ifdef HAVE_X509_GET0_EXTENSIONS { const X509_ALGOR *sigalg = NULL; X509_PUBKEY *xpubkey = NULL; @@ -440,28 +375,6 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) if(result) break; } -#else - { - /* before OpenSSL 1.0.2 */ - X509_CINF *cinf = x->cert_info; - - i2a_ASN1_OBJECT(mem, cinf->signature->algorithm); - result = push_certinfo(data, mem, "Signature Algorithm", i); - - if(!result) { - i2a_ASN1_OBJECT(mem, cinf->key->algor->algorithm); - result = push_certinfo(data, mem, "Public Key Algorithm", i); - } - - if(!result) - result = X509V3_ext(data, i, cinf->extensions); - - if(result) - break; - - psig = x->signature; - } -#endif ASN1_TIME_print(mem, X509_get0_notBefore(x)); result = push_certinfo(data, mem, "Start date", i); @@ -477,25 +390,14 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) if(!pubkey) infof(data, " Unable to load public key"); else { - int pktype; -#ifdef HAVE_OPAQUE_EVP_PKEY - pktype = EVP_PKEY_id(pubkey); -#else - pktype = pubkey->type; -#endif - switch(pktype) { + switch(EVP_PKEY_id(pubkey)) { case EVP_PKEY_RSA: { #ifndef HAVE_EVP_PKEY_GET_PARAMS RSA *rsa; -#ifdef HAVE_OPAQUE_EVP_PKEY rsa = EVP_PKEY_get0_RSA(pubkey); -#else - rsa = pubkey->pkey.rsa; -#endif /* HAVE_OPAQUE_EVP_PKEY */ #endif /* !HAVE_EVP_PKEY_GET_PARAMS */ { -#ifdef HAVE_OPAQUE_RSA_DSA_DH DECLARE_PKEY_PARAM_BIGNUM(n); DECLARE_PKEY_PARAM_BIGNUM(e); #ifdef HAVE_EVP_PKEY_GET_PARAMS @@ -505,9 +407,6 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) RSA_get0_key(rsa, &n, &e, NULL); #endif /* HAVE_EVP_PKEY_GET_PARAMS */ BIO_printf(mem, "%d", n ? BN_num_bits(n) : 0); -#else - BIO_printf(mem, "%d", rsa->n ? BN_num_bits(rsa->n) : 0); -#endif /* HAVE_OPAQUE_RSA_DSA_DH */ result = push_certinfo(data, mem, "RSA Public Key", i); if(result) break; @@ -523,15 +422,9 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) { #ifndef OPENSSL_NO_DSA #ifndef HAVE_EVP_PKEY_GET_PARAMS - DSA *dsa; -#ifdef HAVE_OPAQUE_EVP_PKEY - dsa = EVP_PKEY_get0_DSA(pubkey); -#else - dsa = pubkey->pkey.dsa; -#endif /* HAVE_OPAQUE_EVP_PKEY */ + DSA *dsa = EVP_PKEY_get0_DSA(pubkey); #endif /* !HAVE_EVP_PKEY_GET_PARAMS */ { -#ifdef HAVE_OPAQUE_RSA_DSA_DH DECLARE_PKEY_PARAM_BIGNUM(p); DECLARE_PKEY_PARAM_BIGNUM(q); DECLARE_PKEY_PARAM_BIGNUM(g); @@ -545,7 +438,6 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) DSA_get0_pqg(dsa, &p, &q, &g); DSA_get0_key(dsa, &pub_key, NULL); #endif /* HAVE_EVP_PKEY_GET_PARAMS */ -#endif /* HAVE_OPAQUE_RSA_DSA_DH */ print_pubkey_BN(dsa, p, i); print_pubkey_BN(dsa, q, i); print_pubkey_BN(dsa, g, i); @@ -560,15 +452,9 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) } case EVP_PKEY_DH: { #ifndef HAVE_EVP_PKEY_GET_PARAMS - DH *dh; -#ifdef HAVE_OPAQUE_EVP_PKEY - dh = EVP_PKEY_get0_DH(pubkey); -#else - dh = pubkey->pkey.dh; -#endif /* HAVE_OPAQUE_EVP_PKEY */ + DH *dh = EVP_PKEY_get0_DH(pubkey); #endif /* !HAVE_EVP_PKEY_GET_PARAMS */ { -#ifdef HAVE_OPAQUE_RSA_DSA_DH DECLARE_PKEY_PARAM_BIGNUM(p); DECLARE_PKEY_PARAM_BIGNUM(q); DECLARE_PKEY_PARAM_BIGNUM(g); @@ -585,10 +471,6 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) print_pubkey_BN(dh, p, i); print_pubkey_BN(dh, q, i); print_pubkey_BN(dh, g, i); -#else - print_pubkey_BN(dh, p, i); - print_pubkey_BN(dh, g, i); -#endif /* HAVE_OPAQUE_RSA_DSA_DH */ print_pubkey_BN(dh, pub_key, i); FREE_PKEY_PARAM_BIGNUM(p); FREE_PKEY_PARAM_BIGNUM(q); @@ -626,21 +508,10 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) #ifdef USE_OPENSSL -#if OPENSSL_VERSION_NUMBER < 0x10100000L -#define BIO_set_init(x,v) ((x)->init=(v)) -#define BIO_get_data(x) ((x)->ptr) -#define BIO_set_data(x,v) ((x)->ptr=(v)) -#define BIO_get_shutdown(x) ((x)->shutdown) -#define BIO_set_shutdown(x,v) ((x)->shutdown=(v)) -#endif /* HAVE_PRE_1_1_API */ - static int ossl_bio_cf_create(BIO *bio) { BIO_set_shutdown(bio, 1); BIO_set_init(bio, 1); -#if OPENSSL_VERSION_NUMBER < 0x10100000L - bio->num = -1; -#endif BIO_set_data(bio, NULL); return 1; } @@ -759,30 +630,6 @@ static int ossl_bio_cf_in_read(BIO *bio, char *buf, int blen) return result ? -1 : (int)nread; } -#if OPENSSL_VERSION_NUMBER < 0x10100000L - -static BIO_METHOD ossl_bio_cf_meth_1_0 = { - BIO_TYPE_MEM, - "OpenSSL CF BIO", - ossl_bio_cf_out_write, - ossl_bio_cf_in_read, - NULL, /* puts is never called */ - NULL, /* gets is never called */ - ossl_bio_cf_ctrl, - ossl_bio_cf_create, - ossl_bio_cf_destroy, - NULL -}; - -static BIO_METHOD *ossl_bio_cf_method_create(void) -{ - return &ossl_bio_cf_meth_1_0; -} - -#define ossl_bio_cf_method_free(m) Curl_nop_stmt - -#else - static BIO_METHOD *ossl_bio_cf_method_create(void) { BIO_METHOD *m = BIO_meth_new(BIO_TYPE_MEM, "OpenSSL CF BIO"); @@ -802,9 +649,6 @@ static void ossl_bio_cf_method_free(BIO_METHOD *m) BIO_meth_free(m); } -#endif - - #ifdef HAVE_KEYLOG_CALLBACK static void ossl_keylog_callback(const SSL *ssl, const char *line) { @@ -834,19 +678,9 @@ ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done) return; } -#if OPENSSL_VERSION_NUMBER >= 0x10100000L - /* ssl->s3 is not checked in OpenSSL 1.1.0-pre6, but let's assume that - * we have a valid SSL context if we have a non-NULL session. */ SSL_get_client_random(ssl, client_random, SSL3_RANDOM_SIZE); master_key_length = (int) SSL_SESSION_get_master_key(session, master_key, SSL_MAX_MASTER_KEY_LENGTH); -#else - if(ssl->s3 && session->master_key_length > 0) { - master_key_length = session->master_key_length; - memcpy(master_key, session->master_key, session->master_key_length); - memcpy(client_random, ssl->s3->client_random, SSL3_RANDOM_SIZE); - } -#endif ERR_pop_to_mark(); @@ -968,58 +802,8 @@ static CURLcode ossl_seed(struct Curl_easy *data) data->multi->ssl_seeded = TRUE; return CURLE_OK; } -#ifdef HAVE_RANDOM_INIT_BY_DEFAULT - /* with OpenSSL 1.1.0+, a failed RAND_status is a showstopper */ failf(data, "Insufficient randomness"); return CURLE_SSL_CONNECT_ERROR; -#else - - /* fallback to a custom seeding of the PRNG using a hash based on a current - time */ - do { - unsigned char randb[64]; - size_t len = sizeof(randb); - size_t i, i_max; - for(i = 0, i_max = len / sizeof(struct curltime); i < i_max; ++i) { - struct curltime tv = curlx_now(); - curlx_wait_ms(1); - tv.tv_sec *= (time_t)i + 1; - tv.tv_usec *= (int)i + 2; - tv.tv_sec ^= ((curlx_now().tv_sec + (time_t)curlx_now().tv_usec) * - (time_t)(i + 3)) << 8; - tv.tv_usec ^= (int) ((curlx_now().tv_sec + (time_t)curlx_now().tv_usec) * - (time_t)(i + 4)) << 16; - memcpy(&randb[i * sizeof(struct curltime)], &tv, - sizeof(struct curltime)); - } - RAND_add(randb, (int)len, (double)len/2); - } while(!rand_enough()); - - /* - * Number of bytes to read from the random number seed file. This must be - * a finite value (because some entropy "files" like /dev/urandom have - * an infinite length), but must be large enough to provide enough - * entropy to properly seed OpenSSL's PRNG. - */ -# define RAND_LOAD_LENGTH 1024 - - { - /* generates a default path for the random seed file */ - char fname[256]; - fname[0] = 0; /* blank it first */ - RAND_file_name(fname, sizeof(fname)); - if(fname[0]) { - /* we got a filename to try */ - RAND_load_file(fname, RAND_LOAD_LENGTH); - if(rand_enough()) - return CURLE_OK; - } - } - - infof(data, "libcurl is now using a weak random seed"); - return rand_enough() ? CURLE_OK : - CURLE_SSL_CONNECT_ERROR; /* confusing error code */ -#endif } #ifndef SSL_FILETYPE_ENGINE @@ -1247,7 +1031,7 @@ static int enginecheck(struct Curl_easy *data, if(data->state.engine) { UI_METHOD *ui_method = - UI_create_method(OSSL_UI_METHOD_CAST("curl user interface")); + UI_create_method("curl user interface"); if(!ui_method) { failf(data, "unable to create " OSSL_PACKAGE " user-interface method"); return 0; @@ -1309,7 +1093,7 @@ static int providercheck(struct Curl_easy *data, OSSL_STORE_CTX *store = NULL; OSSL_STORE_INFO *info = NULL; UI_METHOD *ui_method = - UI_create_method(OSSL_UI_METHOD_CAST("curl user interface")); + UI_create_method("curl user interface"); if(!ui_method) { failf(data, "unable to create " OSSL_PACKAGE " user-interface method"); return 0; @@ -1797,13 +1581,7 @@ static CURLcode client_cert(struct Curl_easy *data, /* If RSA is used, do not check the private key if its flags indicate * it does not support it. */ EVP_PKEY *priv_key = SSL_get_privatekey(ssl); - int pktype; -#ifdef HAVE_OPAQUE_EVP_PKEY - pktype = EVP_PKEY_id(priv_key); -#else - pktype = priv_key->type; -#endif - if(pktype == EVP_PKEY_RSA) { + if(EVP_PKEY_id(priv_key) == EVP_PKEY_RSA) { RSA *rsa = EVP_PKEY_get1_RSA(priv_key); if(RSA_flags(rsa) & RSA_METHOD_FLAG_NO_CHECK) check_privkey = FALSE; @@ -1861,7 +1639,6 @@ static CURLcode x509_name_oneline(X509_NAME *a, struct dynbuf *d) */ static int ossl_init(void) { -#if OPENSSL_VERSION_NUMBER >= 0x10100000L const uint64_t flags = #ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN /* not present in BoringSSL */ @@ -1874,28 +1651,6 @@ static int ossl_init(void) #endif 0; OPENSSL_init_ssl(flags, NULL); -#else - OPENSSL_load_builtin_modules(); - -#ifdef USE_OPENSSL_ENGINE - ENGINE_load_builtin_engines(); -#endif - -#ifndef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG - CONF_modules_load_file(NULL, NULL, - CONF_MFLAGS_DEFAULT_SECTION| - CONF_MFLAGS_IGNORE_MISSING_FILE); -#endif - - /* Let's get nice error messages */ - SSL_load_error_strings(); - - /* Init the global ciphers and digests */ - if(!SSLeay_add_ssl_algorithms()) - return 0; - - OpenSSL_add_all_algorithms(); -#endif Curl_tls_keylog_open(); @@ -1905,32 +1660,6 @@ static int ossl_init(void) /* Global cleanup */ static void ossl_cleanup(void) { -#if OPENSSL_VERSION_NUMBER >= 0x10100000L - /* OpenSSL 1.1 deprecates all these cleanup functions and - turns them into no-ops in OpenSSL 1.0 compatibility mode */ -#else - /* Free ciphers and digests lists */ - EVP_cleanup(); - -#ifdef USE_OPENSSL_ENGINE - /* Free engine list */ - ENGINE_cleanup(); -#endif - - /* Free OpenSSL error strings */ - ERR_free_strings(); - - /* Free thread local error state, destroying hash upon zero refcount */ - ERR_remove_thread_state(NULL); - - /* Free all memory allocated by all configuration modules */ - CONF_modules_free(); - -#ifdef HAVE_SSL_COMP_FREE_COMPRESSION_METHODS - SSL_COMP_free_compression_methods(); -#endif -#endif - Curl_tls_keylog_close(); } @@ -2284,13 +2013,6 @@ static void ossl_close_all(struct Curl_easy *data) #ifdef OPENSSL_HAS_PROVIDERS ossl_provider_cleanup(data); #endif -#ifndef HAVE_ERR_REMOVE_THREAD_STATE_DEPRECATED - /* OpenSSL 1.0.1 and 1.0.2 build an error queue that is stored per-thread - so we need to clean it here in case the thread will be killed. All OpenSSL - code should extract the error in association with the error so clearing - this queue here should be harmless at worst. */ - ERR_remove_thread_state(NULL); -#endif } /* ====================================================== */ @@ -2777,7 +2499,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, const void *buf, size_t len, SSL *ssl, void *userp) { - const char *verstr = "???"; + const char *verstr; struct Curl_cfilter *cf = userp; struct Curl_easy *data = NULL; char unknown[32]; @@ -2812,13 +2534,9 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, verstr = "TLSv1.2"; break; #endif -#ifdef TLS1_3_VERSION /* OpenSSL 1.1.1+, all forks */ case TLS1_3_VERSION: verstr = "TLSv1.3"; break; -#endif - case 0: - break; default: curl_msnprintf(unknown, sizeof(unknown), "(%x)", ssl_ver); verstr = unknown; @@ -2884,7 +2602,6 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, # define HAS_ALPN_OPENSSL #endif -#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 */ static CURLcode ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, unsigned int ssl_version_min) @@ -2916,12 +2633,8 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, ossl_ssl_version_min = TLS1_2_VERSION; break; case CURL_SSLVERSION_TLSv1_3: -#ifdef TLS1_3_VERSION ossl_ssl_version_min = TLS1_3_VERSION; break; -#else - return CURLE_NOT_BUILT_IN; -#endif } /* ... then, TLS max version */ @@ -2938,11 +2651,9 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, case CURL_SSLVERSION_MAX_TLSv1_2: ossl_ssl_version_max = TLS1_2_VERSION; break; -#ifdef TLS1_3_VERSION case CURL_SSLVERSION_MAX_TLSv1_3: ossl_ssl_version_max = TLS1_3_VERSION; break; -#endif case CURL_SSLVERSION_MAX_NONE: /* none selected */ case CURL_SSLVERSION_MAX_DEFAULT: /* max selected */ default: @@ -2959,80 +2670,15 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx, return CURLE_OK; } -#endif #ifdef HAVE_BORINGSSL_LIKE typedef uint32_t ctx_option_t; #elif defined(HAVE_OPENSSL3) typedef uint64_t ctx_option_t; -#elif OPENSSL_VERSION_NUMBER >= 0x10100000L && \ - !defined(LIBRESSL_VERSION_NUMBER) -typedef unsigned long ctx_option_t; -#else +#elif defined(LIBRESSL_VERSION_NUMBER) typedef long ctx_option_t; -#endif - -#if OPENSSL_VERSION_NUMBER < 0x10100000L /* 1.1.0 */ -static CURLcode -ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, - struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - long ssl_version = conn_config->version; - long ssl_version_max = conn_config->version_max; - - (void)data; /* In case it is unused. */ - - switch(ssl_version) { - case CURL_SSLVERSION_TLSv1_3: -#ifdef TLS1_3_VERSION - { - struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; - DEBUGASSERT(octx); - SSL_CTX_set_max_proto_version(octx->ssl_ctx, TLS1_3_VERSION); - *ctx_options |= SSL_OP_NO_TLSv1_2; - } -#else - (void)ctx_options; - failf(data, OSSL_PACKAGE " was built without TLS 1.3 support"); - return CURLE_NOT_BUILT_IN; -#endif - FALLTHROUGH(); - case CURL_SSLVERSION_TLSv1_2: - *ctx_options |= SSL_OP_NO_TLSv1_1; - FALLTHROUGH(); - case CURL_SSLVERSION_TLSv1_1: - *ctx_options |= SSL_OP_NO_TLSv1; - FALLTHROUGH(); - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1: - break; - } - - switch(ssl_version_max) { - case CURL_SSLVERSION_MAX_TLSv1_0: - *ctx_options |= SSL_OP_NO_TLSv1_1; - FALLTHROUGH(); - case CURL_SSLVERSION_MAX_TLSv1_1: - *ctx_options |= SSL_OP_NO_TLSv1_2; - FALLTHROUGH(); - case CURL_SSLVERSION_MAX_TLSv1_2: -#ifdef TLS1_3_VERSION - *ctx_options |= SSL_OP_NO_TLSv1_3; -#endif - break; - case CURL_SSLVERSION_MAX_TLSv1_3: -#ifdef TLS1_3_VERSION - break; #else - failf(data, OSSL_PACKAGE " was built without TLS 1.3 support"); - return CURLE_NOT_BUILT_IN; -#endif - } - return CURLE_OK; -} +typedef unsigned long ctx_option_t; #endif CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, @@ -3538,8 +3184,6 @@ static CURLcode ossl_populate_x509_store(struct Curl_cfilter *cf, return result; } -#ifdef HAVE_SSL_X509_STORE_SHARE - /* key to use at `multi->proto_hash` */ #define MPROTO_OSSL_X509_KEY "tls:ossl:x509:share" @@ -3706,25 +3350,6 @@ CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf, return result; } -#else /* HAVE_SSL_X509_STORE_SHARE */ -CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct ossl_ctx *octx) -{ - CURLcode result; - X509_STORE *store; - - ERR_set_mark(); - - store = SSL_CTX_get_cert_store(octx->ssl_ctx); - result = ossl_populate_x509_store(cf, data, octx, store); - - ERR_pop_to_mark(); - - return result; -} -#endif /* HAVE_SSL_X509_STORE_SHARE */ - static CURLcode ossl_init_session_and_alpns(struct ossl_ctx *octx, @@ -4020,11 +3645,7 @@ static CURLcode ossl_init_method(struct Curl_cfilter *cf, case CURL_SSLVERSION_TLSv1_2: case CURL_SSLVERSION_TLSv1_3: /* it will be handled later with the context options */ -#if OPENSSL_VERSION_NUMBER >= 0x10100000L *pmethod = TLS_client_method(); -#else - *pmethod = SSLv23_client_method(); -#endif break; case CURL_SSLVERSION_SSLv2: failf(data, "No SSLv2 support"); @@ -4048,10 +3669,8 @@ static CURLcode ossl_init_method(struct Curl_cfilter *cf, #ifdef USE_OPENSSL_QUIC *pmethod = OSSL_QUIC_client_method(); -#elif (OPENSSL_VERSION_NUMBER >= 0x10100000L) - *pmethod = TLS_method(); #else - *pmethod = SSLv23_client_method(); + *pmethod = TLS_method(); #endif break; default: @@ -4187,11 +3806,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; -#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 */ result = ossl_set_ssl_version_min_max(cf, octx->ssl_ctx, ssl_version_min); -#else - result = ossl_set_ssl_version_min_max_legacy(&ctx_options, cf, data); -#endif if(result) return result; break; @@ -4222,7 +3837,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, ciphers = conn_config->cipher_list; if(!ciphers && (peer->transport != TRNSPRT_QUIC)) - ciphers = DEFAULT_CIPHER_SELECTION; + ciphers = NULL; if(ciphers && (ssl_version_min < CURL_SSLVERSION_TLSv1_3)) { if(!SSL_CTX_set_cipher_list(octx->ssl_ctx, ciphers)) { failf(data, "failed setting cipher list: %s", ciphers); @@ -4829,9 +4444,8 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert, return result; } -#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ - !(defined(LIBRESSL_VERSION_NUMBER) && \ - LIBRESSL_VERSION_NUMBER < 0x3060000fL) && \ +#if !(defined(LIBRESSL_VERSION_NUMBER) && \ + LIBRESSL_VERSION_NUMBER < 0x3060000fL) && \ !defined(HAVE_BORINGSSL_LIKE) && !defined(CURL_DISABLE_VERBOSE_STRINGS) static void infof_certstack(struct Curl_easy *data, const SSL *ssl) { @@ -5650,8 +5264,6 @@ static CURLcode ossl_recv(struct Curl_cfilter *cf, static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex, struct dynbuf *binding) { - /* required for X509_get_signature_nid support */ -#if OPENSSL_VERSION_NUMBER > 0x10100000L X509 *cert; int algo_nid; const EVP_MD *algo_type; @@ -5726,13 +5338,6 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex, error: X509_free(cert); return result; -#else - /* No X509_get_signature_nid support */ - (void)data; - (void)sockindex; - (void)binding; - return CURLE_OK; -#endif } size_t Curl_ossl_version(char *buffer, size_t size) @@ -5761,41 +5366,9 @@ size_t Curl_ossl_version(char *buffer, size_t size) #elif defined(OPENSSL_IS_AWSLC) return curl_msnprintf(buffer, size, "%s/%s", OSSL_PACKAGE, AWSLC_VERSION_NUMBER_STRING); -#elif defined(OPENSSL_VERSION_STRING) /* OpenSSL 3+ */ +#else /* OpenSSL 3+ */ return curl_msnprintf(buffer, size, "%s/%s", OSSL_PACKAGE, OpenSSL_version(OPENSSL_VERSION_STRING)); -#else - /* not LibreSSL, BoringSSL and not using OpenSSL_version */ - - char sub[3]; - unsigned long ssleay_value; - sub[2]='\0'; - sub[1]='\0'; - ssleay_value = OpenSSL_version_num(); - if(ssleay_value&0xff0) { - int minor_ver = (ssleay_value >> 4) & 0xff; - if(minor_ver > 26) { - /* handle extended version introduced for 0.9.8za */ - sub[1] = (char) ((minor_ver - 1) % 26 + 'a' + 1); - sub[0] = 'z'; - } - else { - sub[0] = (char) (minor_ver + 'a' - 1); - } - } - else - sub[0]='\0'; - - return curl_msnprintf(buffer, size, "%s/%lx.%lx.%lx%s" -#ifdef OPENSSL_FIPS - "-fips" -#endif - , - OSSL_PACKAGE, - (ssleay_value >> 28) & 0xf, - (ssleay_value >> 20) & 0xff, - (ssleay_value >> 12) & 0xff, - sub); #endif } diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h index 021d754a62b4..5b6f35396d91 100644 --- a/lib/vtls/openssl.h +++ b/lib/vtls/openssl.h @@ -51,8 +51,7 @@ * BoringSSL: supported since d28f59c27bac (committed 2015-11-19) * LibreSSL: not supported. 3.5.0+ has a stub function that does nothing. */ -#if (OPENSSL_VERSION_NUMBER >= 0x10101000L && \ - !defined(LIBRESSL_VERSION_NUMBER)) || defined(HAVE_BORINGSSL_LIKE) +#if !defined(LIBRESSL_VERSION_NUMBER) || defined(HAVE_BORINGSSL_LIKE) #define HAVE_KEYLOG_CALLBACK #endif diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index 18c929e2b27e..c34268ca9413 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -282,23 +282,22 @@ if test "x$OPT_OPENSSL" != xno; then AC_MSG_RESULT([no]) ]) - AC_MSG_CHECKING([for OpenSSL >= v3]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) - return 0; - #else - #error older than 3 - #endif - ]]) - ],[ - AC_MSG_RESULT([yes]) - ssl_msg="OpenSSL v3+" - ],[ - AC_MSG_RESULT([no]) - ]) + if test "$ssl_msg" = 'OpenSSL'; then + AC_MSG_CHECKING([for OpenSSL >= v3]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]],[[ + #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) + return 0; + #else + #error older than 3 + #endif + ]]) + ],[],[ + AC_MSG_ERROR([OpenSSL 3.0.0 or upper required.]) + ]) + fi fi dnl is this OpenSSL (fork) providing the original QUIC API? From bb213bd76915368ac49c5db9da9d6462c6b8e6cf Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 15 Nov 2025 19:33:37 +0100 Subject: [PATCH 394/885] DEPRECATE.md: move OpenSSL to past removals Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330 Closes #19542 --- docs/DEPRECATE.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 102969e4b10b..3e30be0cfbd3 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -23,14 +23,6 @@ Making the new minimum target Windows version Vista / Server 2008. In March 2026, we drop support for all c-ares versions before 1.16.0. -## OpenSSL 1.0.2 - -OpenSSL and others only ship fixes for this version to paying customers, -meaning users of the free version risk being vulnerable. - -We remove support for this OpenSSL version from curl in December 2025. - -## OpenSSL 1.1.1 OpenSSL and others only ship fixes to paying customers, meaning users of the free version risk being vulnerable. @@ -84,3 +76,4 @@ Support for RTMP in libcurl gets removed in April 2026. - winbuild build system (removed in 8.17.0) - Windows CE (removed in 8.18.0) - Support for Visual Studio 2008 (removed in 8.18.0) + - OpenSSL 1.1.1 and older (removed in 8.18.0) From dbe06f38ae34ec43a373c74d65474480ac49191e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 15 Nov 2025 22:32:56 +0100 Subject: [PATCH 395/885] DEPRECATE.md: move OpenSSL to past removals (fixup) Follow-up to bb213bd76915368ac49c5db9da9d6462c6b8e6cf #19542 --- docs/DEPRECATE.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 3e30be0cfbd3..1629af1fffd0 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -23,12 +23,6 @@ Making the new minimum target Windows version Vista / Server 2008. In March 2026, we drop support for all c-ares versions before 1.16.0. - -OpenSSL and others only ship fixes to paying customers, meaning users of the -free version risk being vulnerable. - -We remove support for this OpenSSL version from curl in December 2025. - ## OpenSSL-QUIC OpenSSL-QUIC is what we call the curl QUIC backend that uses the OpenSSL QUIC From 8ba10a790a39dd48536c38e1d4569ab9fac537a1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 00:18:31 +0100 Subject: [PATCH 396/885] CI: bump Circle CI jobs to Ubuntu 22.04 runners for OpenSSL 3 Ref: https://packages.ubuntu.com/jammy/libssl-dev Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330 Closes #19546 --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63eae308c49f..8e015bf7e9cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,7 +118,7 @@ commands: executors: ubuntu: machine: - image: ubuntu-2004:2024.01.1 + image: ubuntu-2204:2025.09.1 jobs: basic: @@ -161,7 +161,7 @@ jobs: arm: machine: - image: ubuntu-2004:2024.01.1 + image: ubuntu-2204:2025.09.1 resource_class: arm.medium steps: - checkout @@ -172,7 +172,7 @@ jobs: arm-cares: machine: - image: ubuntu-2004:2024.01.1 + image: ubuntu-2204:2025.09.1 resource_class: arm.medium steps: - checkout From 6225d7ba2f7dcad322776fc1cadae63e530de705 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 00:22:59 +0100 Subject: [PATCH 397/885] CI: drop no longer used `install-wolfssl` step in Circle CI Follow-up to b011e3fcfb06d6c0278595ee2ee297036fbe9793 #18700 Closes #19547 --- .circleci/config.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e015bf7e9cd..680949c2b570 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,20 +47,6 @@ commands: sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev sudo python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt - install-wolfssl: - steps: - - run: - command: | - # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com - WOLFSSL_VERSION=5.8.0 - echo "Installing wolfSSL $WOLFSSL_VERSION" - curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ - --location "https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VERSION-stable.tar.gz" | tar -xz - cd wolfssl-$WOLFSSL_VERSION-stable - ./autogen.sh - ./configure --disable-dependency-tracking --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl - make install - configure: steps: - run: From 4c76cdc157651b857ab142d97cf0380809745930 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 1 Nov 2025 02:20:32 +0100 Subject: [PATCH 398/885] runtests: drop Python 2 support remains Used in the test SMB and telnet servers. Closes #19544 --- tests/smbserver.py | 9 +-------- tests/util.py | 3 --- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/smbserver.py b/tests/smbserver.py index bbaea6069eb4..1fc76f3416ec 100755 --- a/tests/smbserver.py +++ b/tests/smbserver.py @@ -23,9 +23,6 @@ # """Server for testing SMB.""" -from __future__ import (absolute_import, division, print_function, - unicode_literals) - import argparse import logging import os @@ -33,15 +30,11 @@ import sys import tempfile import threading +import configparser # Import our curl test data helper from util import ClosingFileHandler, TestData -if sys.version_info.major >= 3: - import configparser -else: - import ConfigParser as configparser - # impacket needs to be installed in the Python environment try: import impacket # noqa: F401 diff --git a/tests/util.py b/tests/util.py index 8ed8c892676f..4d08ecc93a81 100755 --- a/tests/util.py +++ b/tests/util.py @@ -23,9 +23,6 @@ # """Module for extracting test data from the test data folder and other utils.""" -from __future__ import (absolute_import, division, print_function, - unicode_literals) - import logging import os import re From 517a12922e8a02caf94b70877bf65328a842b87f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 00:42:14 +0100 Subject: [PATCH 399/885] GHA/linux: add missing condition for nghttp2-filc cache step Follow-up to 67ef4a34f2e11aa45f0965909d0dd542643deede #19457 Closes #19548 --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fd70d825ecda..90376ac50572 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -439,6 +439,7 @@ jobs: cmake --install . - name: 'cache nghttp2 (filc)' + if: ${{ contains(matrix.build.install_steps, 'nghttp2-filc') }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 id: cache-nghttp2-filc env: From eeff93013c1df0b4063df98f64e5e6feddf46c40 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 15 Nov 2025 23:56:31 +0100 Subject: [PATCH 400/885] rustls: minor adjustment of sizeof() The mistake is harmless because it is still a size of a pointer, but this is the correct pointer. Acked-by: Daniel McCarney Reported-by: pelioro on hackerone Bug: https://hackerone.com/reports/3427460 Closes #19545 --- lib/vtls/rustls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index ab2290927867..f5e328831670 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -586,7 +586,7 @@ init_config_builder(struct Curl_easy *data, } #endif /* USE_ECH */ - cipher_suites = malloc(sizeof(cipher_suites) * (cipher_suites_len)); + cipher_suites = malloc(sizeof(*cipher_suites) * (cipher_suites_len)); if(!cipher_suites) { result = CURLE_OUT_OF_MEMORY; goto cleanup; From 6d9c5c91b9fd5f3a2733363d1ded8f70b6c24e5d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 01:06:24 +0100 Subject: [PATCH 401/885] CI: avoid restart prompt on libssh-dev install in CircleCI By setting `DEBIAN_FRONTEND=noninteractive`. Also: - add `curl -V` step to CircleCI jobs. - drop duplicate `libpsl` from `apt install`. - replace sudo pip with venv, fixing a warning and syncing with GHA. - Note that test 1459 was disabled on Ubuntu 20.04 due to past issues. When running on newer CircleCI Ubuntu runners (22.04 or 24.04), the test is not disabled, and also fails with the issue seen in the past. I've identified the root cause and will fix it in a separate PR. Ref: https://circleci.com/developer/images?imageType=machine Ref: https://discuss.circleci.com/t/ubuntu-20-04-22-04-24-04-q3-current-release/51856/7 Ref: https://app.circleci.com/pipelines/github/curl/curl/16450/workflows/af1f2a99-6452-4cc3-96c1-18a217ebabfc/jobs/155194 Follow-up to 8ba10a790a39dd48536c38e1d4569ab9fac537a1 #19546 Closes #19549 --- .circleci/config.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 680949c2b570..64fb03c87569 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,14 +38,16 @@ commands: steps: - run: command: | + export DEBIAN_FRONTEND=noninteractive sudo apt-get update && sudo apt-get install -y libssh-dev install-deps: steps: - run: command: | - sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev - sudo python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt + sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip + python3 -m venv ~/venv + ~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt configure: steps: @@ -95,11 +97,15 @@ commands: build: steps: - run: make -j3 V=1 + - run: src/curl --disable --version - run: make -j3 V=1 examples test: steps: - - run: make -j3 V=1 test-ci TFLAGS='-j14' + - run: + command: | + source ~/venv/bin/activate + make -j3 V=1 test-ci TFLAGS='-j14' executors: ubuntu: From ea2203c1aafb5f103b376a2b6a30965cb4d48163 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 13:14:04 +0100 Subject: [PATCH 402/885] GHA/codeql: limit cron job to the origin repository To avoid running it in every fork, every week. Closes #19552 --- .github/workflows/codeql.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5cbde8de054c..d464562ab253 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -39,6 +39,7 @@ permissions: {} jobs: gha_python: + if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }} name: 'GHA and Python' runs-on: ubuntu-latest permissions: @@ -58,6 +59,7 @@ jobs: uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 c: + if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }} name: 'C' runs-on: ${{ matrix.platform == 'Linux' && 'ubuntu-latest' || 'windows-2022' }} permissions: From c07a7f6bf82f8f9aa59d189573378e494439164a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 19:56:39 +0100 Subject: [PATCH 403/885] runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job) test 1459 "SFTP with corrupted known_hosts" was seen failing in the past. To fix it, the test was automatically disabled when detecting libssh 0.9.3 or older, as in the curl CircleCI job, running on Ubuntu 20.04. This work for a long time, until bumping the CircleCI runner to Ubuntu 22.04 (to have OpenSSL 3), where the test was running again, and failing with the isssue seen in the past. - Test skipped with Ubuntu 20.04 (libssh 0.9.3): https://app.circleci.com/pipelines/github/curl/curl/16445/workflows/7f198763-e0b0-4037-9245-4c4b40ab8726/jobs/155164 - Failure seen with Ubuntu 22.04 (libssh 0.9.6): https://app.circleci.com/pipelines/github/curl/curl/16452/workflows/b817a808-0fd4-40b0-8eb0-d064926efe12/jobs/155206?invite=true#step-107-211709_45 - Failure seen with Ubuntu 24.04 (libssh 0.10.6): https://app.circleci.com/pipelines/github/curl/curl/16455/workflows/86c631f1-3c5f-4438-b398-3df2bdab5d20/jobs/155218 Turns out the issue issue isn't libssh 0.9.3 itself, but a CircleCI-specific default configuration in `/etc/ssh/ssh_config`: ``` # BEGIN ANSIBLE MANAGED BLOCK Host * StrictHostKeyChecking no <------ this particular line HashKnownHosts no SendEnv LANG LC_* # END ANSIBLE MANAGED BLOCK ``` libssh will consult configuration files on hard-coded default system locations and alter its behavior based on settings found in them. This libssh behavior is present in all supported versions: https://gitlab.com/libssh/libssh-mirror/-/commit/5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa https://gitlab.com/libssh/libssh-mirror/-/tags/libssh-0.9.0 It means the existing disable logic based on libssh version worked by coincidence, and what needs to be checked is these configurations to decide if it's safe to run the test. Another, simpler option is to also accept the result code 67, though in that case the test wouldn't actually test what we want, but would pass anyway. With the old `oldlibssh` workaround deleted, and the problematic setting manually overridden (`StrictHostKeyChecking yes`): - CircleCI Ubuntu 20.04 passes with 1459 enabled: https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155302 - CircleCI Ubuntu 22.04 does too: https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155303 To fix, replace the `runtests` `oldlibssh` detection logic to parse libssh config files (instead of checking for libssh version) and disable test 1459 based on that. Notice the detection is making a light attempt to parse these files, and does not implement most config file features (such as includes, quoted values and `=` operator.) The new runtests workaround tests OK with the: - default CircleCI configuration, disabling 1459 automatically. - a sudoless configuration fix, with 1459 run successfully. Also keep setting this option in CircleCI jobs. - a sudo configuration fix, with 1459 run successfully. Ref: https://app.circleci.com/pipelines/github/curl/curl/16492/workflows/56f39335-97ba-412c-9a9b-3d662694375a GHA jobs are not affected and they work fine, with 1459 running successfully before and after this patch. It's possible the libssh API offers ways to control config file use and/or set the strict host checking option programatically. Maybe to enable in debug mode (albeit CircleCI job are not debug-enabled), or offer an option for them. It may be something for a future patch. Follow-up to 23540923e1b09ce00dc08bab3bb3a2c0e62ba4e7 #8622 Follow-up to 4b01a57c95fd4c041dfa4a41834c761658ea89ee #8548 Follow-up to bdc664a64002a7df66f34159454844e6b6f5515f #8490 Follow-up to 7c140f6b2d90975629ba81a23acbef4363a3e6fe #8444 Ref: 6d9c5c91b9fd5f3a2733363d1ded8f70b6c24e5d #19549 Closes #19557 --- .circleci/config.yml | 4 ++++ docs/tests/FILEFORMAT.md | 2 +- tests/data/test1459 | 5 +++-- tests/runtests.pl | 19 ++++++++++++++----- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64fb03c87569..30eec16e5ae0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,10 @@ commands: - run: command: | source ~/venv/bin/activate + # Revert a CircleCI-specific local setting that makes test 1459 + # return 67 (CURLE_LOGIN_DENIED) instead of the + # expected 60 (CURLE_PEER_FAILED_VERIFICATION). + echo 'StrictHostKeyChecking yes' >> ~/.ssh/config make -j3 V=1 test-ci TFLAGS='-j14' executors: diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 3897deb9cb09..c5c1bcfe90a7 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -504,7 +504,7 @@ Features testable here are: - `large-size` (size_t is larger than 32-bit) - `libssh2` - `libssh` -- `oldlibssh` (versions before 0.9.4) +- `badlibssh` (libssh configuration incompatible with the test suite) - `libz` - `local-http`. The HTTP server runs on 127.0.0.1 - `manual` diff --git a/tests/data/test1459 b/tests/data/test1459 index e4901d74f06c..6f3105e8ed21 100644 --- a/tests/data/test1459 +++ b/tests/data/test1459 @@ -14,7 +14,7 @@ sftp sftp -!oldlibssh +!badlibssh SFTP with corrupted known_hosts @@ -30,7 +30,8 @@ R93Ey5VtBeBblYTRlFXBWJgKFcTKBRJ/O4qBZwbUgt10AHj31i6h8NehfT19tR8wG/YCmj3KtYLHmwdz # Verify data after the test has been "shot" -# old libssh installs return the wrong thing +# badlibssh configurations return the wrong thing: 67 CURLE_LOGIN_DENIED, +# instead of 60 CURLE_PEER_FAILED_VERIFICATION. 60 diff --git a/tests/runtests.pl b/tests/runtests.pl index 226573941d35..e1608e0aaa8b 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -632,11 +632,20 @@ sub checksystemfeatures { } if($libcurl =~ /libssh\/([0-9.]*)\//i) { $feature{"libssh"} = 1; - if($1 =~ /(\d+)\.(\d+).(\d+)/) { - my $v = $1 * 100 + $2 * 10 + $3; - if($v < 94) { - # before 0.9.4 - $feature{"oldlibssh"} = 1; + # Detect simple cases of default libssh configuration files ending up + # setting `StrictHostKeyChecking no`. include files, quoted values, + # '=value' format not implemented. + $feature{"badlibssh"} = 0; + foreach my $libssh_configfile (('/etc/ssh/ssh_config', $ENV{'HOME'} . '/.ssh/config')) { + if(open(my $fd, '<', $libssh_configfile)) { + while(my $line = <$fd>) { + chomp $line; + if($line =~ /^\s*StrictHostKeyChecking\s+(yes|no)\s*$/) { + $feature{"badlibssh"} = ($1 eq 'no' ? 1 : 0); + last; # Do as openssh and libssh + } + } + close($fd); } } } From 205a8e861ff9a05ac81d21f9589e7d2de270ff66 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 17 Nov 2025 01:52:02 +0800 Subject: [PATCH 404/885] wolfssl: fix a potential memory leak of session Closes #19555 --- lib/vtls/wolfssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 7b567fd89250..a8090d1bf1ad 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -581,8 +581,10 @@ wssl_setup_session(struct Curl_cfilter *cf, bool do_early_data = FALSE; if(sess_reuse_cb) { result = sess_reuse_cb(cf, data, alpns, scs, &do_early_data); - if(result) + if(result) { + wolfSSL_SESSION_free(session); goto out; + } } #ifdef WOLFSSL_EARLY_DATA if(do_early_data) { From f5fa8048f76ec5cc149f61ec25f123597375d07c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 16 Nov 2025 23:38:48 +0100 Subject: [PATCH 405/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 66 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 64d498806032..4bfa8d81d5ed 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,10 +4,13 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3537 + Contributors: 3541 This release includes the following changes: + o build: drop support for VS2008 (Windows) [62] + o build: drop Windows CE / CeGCC support [69] + o openssl: bump minimum OpenSSL version to 3.0.0 [60] This release includes the following bugfixes: @@ -16,12 +19,19 @@ This release includes the following bugfixes: o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74] o cf-https-connect: allocate ctx at first in cf_hc_create() [79] + o cf-socket: trace ignored errors [97] o checksrc.pl: detect assign followed by more than one space [26] o cmake: adjust defaults for target platforms not supporting shared libs [35] o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] + o code: minor indent fixes before closing braces [107] + o config2setopts: bail out if curl_url_get() returns OOM [102] + o config2setopts: exit if curl_url_set() fails on OOM [105] o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] + o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100] + o cookie: propagate errors better, cleanup the internal API [118] o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] + o curl_setup.h: drop stray `#undef stat` (Windows) [103] o CURLINFO: remove 'get' and 'get the' from each short desc [50] o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48] o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] @@ -31,8 +41,10 @@ This release includes the following bugfixes: o docs: fix checksrc `EQUALSPACE` warnings [21] o docs: mention umask need when curl creates files [56] o examples/crawler: fix variable [92] + o examples/multithread: fix race condition [101] o ftp: refactor a piece of code by merging the repeated part [40] o ftp: remove #ifdef for define that is always defined [76] + o getinfo: improve perf in debug mode [99] o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] o gtls: skip session resumption when verifystatus is set @@ -41,12 +53,15 @@ This release includes the following bugfixes: o INSTALL-CMAKE.md: document static option defaults more [37] o krb5_sspi: unify a part of error handling [80] o lib: cleanup for some typos about spaces and code style [3] + o lib: eliminate size_t casts [112] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] o libssh2: cleanup ssh_force_knownhost_key_type [64] o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] + o limit-rate: add example using --limit-rate and --max-time together [89] o m4/sectrust: fix test(1) operator [4] o mbedtls: fix potential use of uninitialized `nread` [8] + o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] o noproxy: replace atoi with curlx_str_number [67] @@ -59,8 +74,12 @@ This release includes the following bugfixes: o pytest: skip H2 tests if feature missing from curl [46] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] + o runtests: detect bad libssh differently for test 1459 [11] + o runtests: drop Python 2 support remains [45] o rustls: fix a potential memory issue [81] + o rustls: minor adjustment of sizeof() [38] o schannel: fix memory leak of cert_store_path on four error paths [23] + o schannel: replace atoi() with curlx_str_number() [119] o scripts: fix shellcheck SC2046 warnings [90] o scripts: use end-of-options marker in `find -exec` commands [87] o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] @@ -68,25 +87,32 @@ This release includes the following bugfixes: o sftp: fix range downloads in both SSH backends [82] o socks_sspi: use free() not FreeContextBuffer() [93] o telnet: replace atoi for BINARY handling with curlx_str_number [66] + o test07_22: fix flakiness [95] o test2045: replace HTML multi-line comment markup with `#` comments [36] o test363: delete stray character (typo) from a section tag [52] o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33] o tests/data: support using native newlines on disk, drop `.gitattributes` [91] o tests/server: do not fall back to original data file in `test2fopen()` [32] + o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110] o tftp: release filename if conn_get_remote_addr fails [42] o tool: consider (some) curl_easy_setopt errors fatal [7] o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] + o tool_operate: exit on curl_share_setopt errors [108] o tool_operate: remove redundant condition [19] o tool_operate: use curlx_str_number instead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] o urlapi: fix mem-leaks in curl_url_get error paths [22] o verify-release: update to avoid shellcheck warning SC2034 [88] + o vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally [96] o vtls: fix CURLOPT_CAPATH use [51] o vtls: handle possible malicious certs_num from peer [53] + o vtls: pinned key check [98] o wcurl: import v2025.11.09 [29] o wolfSSL: able to differentiate between IP and DNS in alt names [13] o wolfssl: avoid NULL dereference in OOM situation [77] + o wolfssl: fix a potential memory leak of session [6] + o wolfssl: simplify wssl_send_earlydata [111] This release includes the following known bugs: @@ -99,23 +125,21 @@ For all changes ever done in curl: Planned upcoming removals include: o Builds using VS2008 - o OpenSSL 1.x support o OpenSSL-QUIC o Support for c-ares versions before 1.16.0 - o Support for Windows XP/2003 - o Windows CE support See https://curl.se/dev/deprecate.html This release would not have looked like this without help, code, reports and advice from friends like these: - Andrew Kirillov, Brad King, Dan Fandrich, Daniel Stenberg, - Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, - Leonardo Taccari, Patrick Monnerat, Ray Satiro, renovate[bot], + Aleksandr Sergeev, Andrew Kirillov, Brad King, Dan Fandrich, Daniel McCarney, + Daniel Stenberg, Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang, + Juliusz Sosinowicz, Leonardo Taccari, nait-furry, Nick Korepanov, + Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot], Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner, Viktor Szakats, Xiaoke Wang - (18 contributors) + (23 contributors) References to bug reports and discussions on issues: @@ -124,10 +148,12 @@ References to bug reports and discussions on issues: [3] = https://curl.se/bug/?i=19370 [4] = https://curl.se/bug/?i=19371 [5] = https://curl.se/bug/?i=19394 + [6] = https://curl.se/bug/?i=19555 [7] = https://curl.se/bug/?i=19385 [8] = https://curl.se/bug/?i=19393 [9] = https://curl.se/bug/?i=19389 [10] = https://curl.se/bug/?i=19388 + [11] = https://curl.se/bug/?i=19557 [12] = https://curl.se/bug/?i=19426 [13] = https://curl.se/bug/?i=19364 [14] = https://curl.se/bug/?i=19377 @@ -152,11 +178,13 @@ References to bug reports and discussions on issues: [35] = https://curl.se/bug/?i=19420 [36] = https://curl.se/bug/?i=19498 [37] = https://curl.se/bug/?i=19419 + [38] = https://hackerone.com/reports/3427460 [39] = https://curl.se/bug/?i=19415 [40] = https://curl.se/bug/?i=19411 [41] = https://curl.se/bug/?i=19410 [42] = https://curl.se/bug/?i=19409 [43] = https://curl.se/bug/?i=19405 + [45] = https://curl.se/bug/?i=19544 [46] = https://curl.se/bug/?i=19412 [47] = https://curl.se/bug/?i=19402 [48] = https://curl.se/bug/?i=19403 @@ -168,15 +196,19 @@ References to bug reports and discussions on issues: [54] = https://curl.se/bug/?i=19399 [55] = https://curl.se/bug/?i=19336 [56] = https://curl.se/bug/?i=19396 + [60] = https://curl.se/bug/?i=18330 [61] = https://curl.se/bug/?i=19484 + [62] = https://curl.se/bug/?i=17931 [63] = https://curl.se/bug/?i=19479 [64] = https://curl.se/bug/?i=19479 [65] = https://curl.se/bug/?i=19478 [66] = https://curl.se/bug/?i=19477 [67] = https://curl.se/bug/?i=19475 [68] = https://curl.se/bug/?i=19480 + [69] = https://curl.se/bug/?i=17927 [70] = https://curl.se/bug/?i=19464 [71] = https://curl.se/bug/?i=19461 + [73] = https://curl.se/bug/?i=19359 [74] = https://curl.se/bug/?i=19465 [76] = https://curl.se/bug/?i=19463 [77] = https://curl.se/bug/?i=19459 @@ -188,8 +220,26 @@ References to bug reports and discussions on issues: [86] = https://curl.se/bug/?i=19451 [87] = https://curl.se/bug/?i=19450 [88] = https://curl.se/bug/?i=19449 + [89] = https://curl.se/bug/?i=19473 [90] = https://curl.se/bug/?i=19432 [91] = https://curl.se/bug/?i=19398 [92] = https://curl.se/bug/?i=19446 [93] = https://curl.se/bug/?i=19445 [94] = https://curl.se/bug/?i=19444 + [95] = https://curl.se/bug/?i=19530 + [96] = https://curl.se/bug/?i=19531 + [97] = https://curl.se/bug/?i=19520 + [98] = https://curl.se/bug/?i=19529 + [99] = https://curl.se/bug/?i=19525 + [100] = https://curl.se/bug/?i=19523 + [101] = https://curl.se/bug/?i=19524 + [102] = https://curl.se/bug/?i=19518 + [103] = https://curl.se/bug/?i=19519 + [105] = https://curl.se/bug/?i=19517 + [107] = https://curl.se/bug/?i=19512 + [108] = https://curl.se/bug/?i=19513 + [110] = https://curl.se/bug/?i=19510 + [111] = https://curl.se/bug/?i=19509 + [112] = https://curl.se/bug/?i=19495 + [118] = https://curl.se/bug/?i=19493 + [119] = https://curl.se/bug/?i=19483 From b3d4f17e3d902b70a4967e1fa9fc574c1cac676d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 14 Nov 2025 23:00:05 +0100 Subject: [PATCH 406/885] curl_sasl: make Curl_sasl_decode_mech compare case insenstively The provided mechanisms should be compared case insenstively. Found by ZeroPath Closes #19535 --- lib/curl_sasl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index b04e9582689d..1c9f259de471 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -96,7 +96,7 @@ unsigned short Curl_sasl_decode_mech(const char *ptr, size_t maxlen, for(i = 0; mechtable[i].name; i++) { if(maxlen >= mechtable[i].len && - !memcmp(ptr, mechtable[i].name, mechtable[i].len)) { + curl_strnequal(ptr, mechtable[i].name, mechtable[i].len)) { if(len) *len = mechtable[i].len; From 217f0e4d59717fa2a9fd428a4e7458dde26e6e94 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Sat, 15 Nov 2025 12:45:54 +0100 Subject: [PATCH 407/885] pytest fixes and improvements - fix test_17_20 flakiness: the test case did not have `nghttpx` in its parameters, causing it to no check if a reload was necessary. When that test ran behind one that gave nghttpx another certificate, eg. in parallel mode, it used the wrong pinned pubkey. - Have `env` provide lists of HTTP protocol versions available for testing. Replace parameterized tests on a fixed protocol list with the dynamic one from env. This makes checks for protocol availability in the test function bodies superfluous. refs #19489 Closes #19540 --- tests/http/test_01_basic.py | 64 +++------- tests/http/test_02_download.py | 206 ++++++------------------------- tests/http/test_03_goaway.py | 3 +- tests/http/test_04_stuttered.py | 24 +--- tests/http/test_05_errors.py | 15 +-- tests/http/test_07_upload.py | 186 +++++----------------------- tests/http/test_08_caddy.py | 57 ++------- tests/http/test_09_push.py | 6 +- tests/http/test_10_proxy.py | 54 +++----- tests/http/test_13_proxy_auth.py | 12 +- tests/http/test_14_auth.py | 36 +----- tests/http/test_16_info.py | 18 +-- tests/http/test_17_ssl_use.py | 74 +++-------- tests/http/test_18_methods.py | 9 +- tests/http/test_19_shutdown.py | 10 +- tests/http/test_40_socks.py | 14 +-- tests/http/testenv/env.py | 33 ++++- 17 files changed, 191 insertions(+), 630 deletions(-) diff --git a/tests/http/test_01_basic.py b/tests/http/test_01_basic.py index c786488c2e63..c734318890f3 100644 --- a/tests/http/test_01_basic.py +++ b/tests/http/test_01_basic.py @@ -55,9 +55,8 @@ def test_01_02_https_get(self, env: Env, httpd): # simple https: GET, h2 wanted and got @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_03_h2_get(self, env: Env, httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2']) @@ -66,9 +65,8 @@ def test_01_03_h2_get(self, env: Env, httpd): # simple https: GET, h2 unsupported, fallback to h1 @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_04_h2_unsupported(self, env: Env, httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.domain2}:{env.https_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2']) @@ -86,12 +84,8 @@ def test_01_05_h3_get(self, env: Env, httpd, nghttpx): # simple download, check connect/handshake timings @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_01_06_timings(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/data.json' r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True) @@ -103,13 +97,9 @@ def test_01_06_timings(self, env: Env, httpd, nghttpx, proto): assert r.stats[0]['time_appconnect'] > 0, f'{r.stats[0]}' # simple https: HEAD - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_07_head(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/data.json' r = curl.http_download(urls=[url], with_stats=True, with_headers=True, @@ -122,9 +112,8 @@ def test_01_07_head(self, env: Env, httpd, nghttpx, proto): assert r.stats[0]['size_download'] == 0, f'{r.stats[0]}' # http: GET for HTTP/2, see Upgrade:, 101 switch + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_08_h2_upgrade(self, env: Env, httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2']) @@ -136,9 +125,8 @@ def test_01_08_h2_upgrade(self, env: Env, httpd): assert r.json['server'] == env.domain1 # http: GET for HTTP/2 with prior knowledge + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_09_h2_prior_knowledge(self, env: Env, httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/data.json' r = curl.http_get(url=url, extra_args=['--http2-prior-knowledge']) @@ -149,9 +137,8 @@ def test_01_09_h2_prior_knowledge(self, env: Env, httpd): assert r.json['server'] == env.domain1 # http: strip TE header in HTTP/2 requests + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_10_te_strip(self, env: Env, httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, "h2")}/data.json' r = curl.http_get(url=url, extra_args=['--http2', '-H', 'TE: gzip']) @@ -164,12 +151,8 @@ def test_01_10_te_strip(self, env: Env, httpd): # send 48KB+ sized response headers to check we handle that correctly # larger than 64KB headers expose a bug in Apache HTTP/2 that is not # RSTing the stream correctly when its internal limits are exceeded. - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_01_11_large_resp_headers(self, env: Env, httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}' \ f'/curltest/tweak?x-hd={48 * 1024}' @@ -181,10 +164,8 @@ def test_01_11_large_resp_headers(self, env: Env, httpd, proto): # http: response headers larger than what curl buffers for @pytest.mark.skipif(condition=not Env.httpd_is_at_least('2.4.64'), reason='httpd must be at least 2.4.64') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_01_12_xlarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") httpd.set_extra_config('base', [ f'H2MaxHeaderBlockLen {130 * 1024}', ]) @@ -200,10 +181,8 @@ def test_01_12_xlarge_resp_headers(self, env: Env, httpd, configures_httpd, prot # http: 1 response header larger than what curl buffers for @pytest.mark.skipif(condition=not Env.httpd_is_at_least('2.4.64'), reason='httpd must be at least 2.4.64') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_01_13_megalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") httpd.set_extra_config('base', [ 'LogLevel http2:trace2', f'H2MaxHeaderBlockLen {130 * 1024}', @@ -222,10 +201,8 @@ def test_01_13_megalarge_resp_headers(self, env: Env, httpd, configures_httpd, p # nghttp2 error -905: Too many CONTINUATION frames following a HEADER frame @pytest.mark.skipif(condition=not Env.httpd_is_at_least('2.4.64'), reason='httpd must be at least 2.4.64') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_01_14_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") httpd.set_extra_config('base', [ 'LogLevel http2:trace2', f'H2MaxHeaderBlockLen {1024 * 1024}', @@ -243,10 +220,8 @@ def test_01_14_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, p # http: one response header > 256 KB @pytest.mark.skipif(condition=not Env.httpd_is_at_least('2.4.64'), reason='httpd must be at least 2.4.64') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_01_15_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") httpd.set_extra_config('base', [ 'LogLevel http2:trace2', f'H2MaxHeaderBlockLen {1024 * 1024}', @@ -262,12 +237,8 @@ def test_01_15_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, p r.check_exit_code(100) # CURLE_TOO_LARGE # http: invalid request headers, GET, issue #16998 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_01_16_inv_req_get(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo' r = curl.http_get(url=url, alpn_proto=proto, extra_args=[ @@ -287,10 +258,9 @@ def test_01_16_inv_req_get(self, env: Env, httpd, nghttpx, proto): pytest.param('gzip ;q=0.2;x="y,x", trailers', 'trailers', id='gzip+q+x+trailers'), pytest.param('gzip ;x="trailers", chunks', None, id='gzip+x+chunks'), ]) + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_17_TE(self, env: Env, httpd, te_in, te_out): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo' r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True, @@ -303,10 +273,9 @@ def test_01_17_TE(self, env: Env, httpd, te_in, te_out): assert 'request-te' not in r.responses[0]['header'], f'{r.responses[0]}' # check that an existing https: connection is not reused for http: + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_18_tls_reuse(self, env: Env, httpd): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url1 = f'https://{env.authority_for(env.domain1, proto)}/data.json' url2 = f'http://{env.authority_for(env.domain1, proto)}/data.json' @@ -315,10 +284,9 @@ def test_01_18_tls_reuse(self, env: Env, httpd): assert r.total_connects == 2, f'{r.dump_logs()}' # check that an existing http: connection is not reused for https: + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_01_19_plain_reuse(self, env: Env, httpd): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url1 = f'http://{env.domain1}:{env.http_port}/data.json' url2 = f'https://{env.domain1}:{env.http_port}/data.json' diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 13d5d2a0f0a1..68c75d4d3eff 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -53,36 +53,24 @@ def _class_scope(self, env, httpd): env.make_data_gzipbomb(indir=indir, fname="bomb-100m.txt", fsize=100*1024*1024) # download 1 file - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_01_download_1(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/data.json' r = curl.http_download(urls=[url], alpn_proto=proto) r.check_response(http_status=200) # download 2 files - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_02_download_2(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-1]' r = curl.http_download(urls=[url], alpn_proto=proto) r.check_response(http_status=200, count=2) # download 100 files sequentially - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_03_download_sequential(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if (proto == 'http/1.1' or proto == 'h2') and env.curl_uses_lib('mbedtls') and \ sys.platform.startswith('darwin') and env.ci_run: pytest.skip('mbedtls 3.6.3 fails this test on macOS CI runners') @@ -93,12 +81,8 @@ def test_02_03_download_sequential(self, env: Env, httpd, nghttpx, proto): r.check_response(http_status=200, count=count, connect_count=1) # download 100 files parallel - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_04_download_parallel(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h2' and env.curl_uses_lib('mbedtls') and \ sys.platform.startswith('darwin') and env.ci_run: pytest.skip('mbedtls 3.6.3 fails this test on macOS CI runners') @@ -118,12 +102,8 @@ def test_02_04_download_parallel(self, env: Env, httpd, nghttpx, proto): assert r.total_connects == 1, r.dump_logs() # download 500 files sequential - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_05_download_many_sequential(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h2' and env.curl_uses_lib('mbedtls') and \ sys.platform.startswith('darwin') and env.ci_run: pytest.skip('mbedtls 3.6.3 fails this test on macOS CI runners') @@ -140,12 +120,8 @@ def test_02_05_download_many_sequential(self, env: Env, httpd, nghttpx, proto): assert r.total_connects == 1, r.dump_logs() # download 500 files parallel - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_06_download_many_parallel(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h2' and env.curl_uses_lib('mbedtls') and \ sys.platform.startswith('darwin') and env.ci_run: pytest.skip('mbedtls 3.6.3 fails this test on macOS CI runners') @@ -159,12 +135,8 @@ def test_02_06_download_many_parallel(self, env: Env, httpd, nghttpx, proto): r.check_response(http_status=200, count=count, connect_count=1) # download files parallel, check connection reuse/multiplex - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_07_download_reuse(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 200 curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]' @@ -192,24 +164,16 @@ def test_02_07b_download_reuse(self, env: Env, httpd, nghttpx, proto): # http/1.1 should have used count connections assert r.total_connects == count, "http/1.1 should use this many connections" - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_08_1MB_serial(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 5 urln = f'https://{env.authority_for(env.domain1, proto)}/data-1m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto=proto) r.check_response(count=count, http_status=200) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_09_1MB_parallel(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 5 urln = f'https://{env.authority_for(env.domain1, proto)}/data-1m?[0-{count-1}]' curl = CurlClient(env=env) @@ -220,12 +184,8 @@ def test_02_09_1MB_parallel(self, env: Env, httpd, nghttpx, proto): @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_10_10MB_serial(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 3 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) @@ -234,12 +194,8 @@ def test_02_10_10MB_serial(self, env: Env, httpd, nghttpx, proto): @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_11_10MB_parallel(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 3 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) @@ -248,12 +204,8 @@ def test_02_11_10MB_parallel(self, env: Env, httpd, nghttpx, proto): ]) r.check_response(count=count, http_status=200) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_12_head_serial_https(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 5 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) @@ -263,11 +215,8 @@ def test_02_12_head_serial_https(self, env: Env, httpd, nghttpx, proto): r.check_response(count=count, http_status=200) @pytest.mark.parametrize("proto", ['h2']) + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_02_13_head_serial_h2c(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 5 urln = f'http://{env.domain1}:{env.http_port}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) @@ -276,12 +225,8 @@ def test_02_13_head_serial_h2c(self, env: Env, httpd, nghttpx, proto): ]) r.check_response(count=count, http_status=200) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_14_not_found(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 5 urln = f'https://{env.authority_for(env.domain1, proto)}/not-found?[0-{count-1}]' curl = CurlClient(env=env) @@ -292,12 +237,8 @@ def test_02_14_not_found(self, env: Env, httpd, nghttpx, proto): remote_port=env.port_for(alpn_proto=proto), remote_ip='127.0.0.1') - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_02_15_fail_not_found(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 5 urln = f'https://{env.authority_for(env.domain1, proto)}/not-found?[0-{count-1}]' curl = CurlClient(env=env) @@ -309,9 +250,8 @@ def test_02_15_fail_not_found(self, env: Env, httpd, nghttpx, proto): remote_ip='127.0.0.1') @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_02_20_h2_small_frames(self, env: Env, httpd, configures_httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") # Test case to reproduce content corruption as observed in # https://github.com/curl/curl/issues/10525 # To reliably reproduce, we need an Apache httpd that supports @@ -358,10 +298,9 @@ def test_02_21_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset): # debug-override stream window size to reproduce #16955 @pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000]) @pytest.mark.parametrize("swin_max", [0, 10*1024]) + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_02_21_h2_lib_serial(self, env: Env, httpd, pause_offset, swin_max): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") count = 2 docname = 'data-10m' url = f'https://localhost:{env.https_port}/{docname}' @@ -381,12 +320,8 @@ def test_02_21_h2_lib_serial(self, env: Env, httpd, pause_offset, swin_max): # download via lib client, several at a time, pause/resume @pytest.mark.parametrize("pause_offset", [100*1023]) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_offset): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 max_parallel = 5 docname = 'data-10m' @@ -403,19 +338,15 @@ def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_ self.check_downloads(client, srcfile, count) # download, several at a time, pause and abort paused - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_23a_lib_abort_paused(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip('OpenSSL QUIC fails here') if proto == 'h3' and env.ci_run and env.curl_uses_lib('quiche'): pytest.skip("fails in CI, but works locally for unknown reasons") count = 10 max_parallel = 5 - if proto in ['h2', 'h3']: + if proto in Env.http_mplx_protos(): pause_offset = 64 * 1024 else: pause_offset = 12 * 1024 @@ -434,19 +365,15 @@ def test_02_23a_lib_abort_paused(self, env: Env, httpd, nghttpx, proto): self.check_downloads(client, srcfile, count, complete=False) # download, several at a time, abort after n bytes - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_23b_lib_abort_offset(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip('OpenSSL QUIC fails here') if proto == 'h3' and env.ci_run and env.curl_uses_lib('quiche'): pytest.skip("fails in CI, but works locally for unknown reasons") count = 10 max_parallel = 5 - if proto in ['h2', 'h3']: + if proto in Env.http_mplx_protos(): abort_offset = 64 * 1024 else: abort_offset = 12 * 1024 @@ -465,19 +392,15 @@ def test_02_23b_lib_abort_offset(self, env: Env, httpd, nghttpx, proto): self.check_downloads(client, srcfile, count, complete=False) # download, several at a time, abort after n bytes - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_23c_lib_fail_offset(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip('OpenSSL QUIC fails here') if proto == 'h3' and env.ci_run and env.curl_uses_lib('quiche'): pytest.skip("fails in CI, but works locally for unknown reasons") count = 10 max_parallel = 5 - if proto in ['h2', 'h3']: + if proto in Env.http_mplx_protos(): fail_offset = 64 * 1024 else: fail_offset = 12 * 1024 @@ -496,12 +419,8 @@ def test_02_23c_lib_fail_offset(self, env: Env, httpd, nghttpx, proto): self.check_downloads(client, srcfile, count, complete=False) # speed limited download - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_24_speed_limit(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 url = f'https://{env.authority_for(env.domain1, proto)}/data-1m' curl = CurlClient(env=env) @@ -527,12 +446,8 @@ def test_02_25_h2_upgrade_x(self, env: Env, httpd): # Special client that tests TLS session reuse in parallel transfers # TODO: just uses a single connection for h2/h3. Not sure how to prevent that - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_26_session_shared_reuse(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}/data-100k' client = LocalClient(name='cli_tls_session_reuse', env=env) if not client.exists(): @@ -541,12 +456,8 @@ def test_02_26_session_shared_reuse(self, env: Env, proto, httpd, nghttpx): r.check_exit_code(0) # test on paused transfers, based on issue #11982 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_27a_paused_no_cl(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}' \ '/curltest/tweak/?&chunks=6&chunk_size=8000' client = LocalClient(env=env, name='cli_h2_pausing') @@ -554,12 +465,8 @@ def test_02_27a_paused_no_cl(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(0) # test on paused transfers, based on issue #11982 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_27b_paused_no_cl(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}' \ '/curltest/tweak/?error=502' client = LocalClient(env=env, name='cli_h2_pausing') @@ -567,26 +474,18 @@ def test_02_27b_paused_no_cl(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(0) # test on paused transfers, based on issue #11982 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_27c_paused_no_cl(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") url = f'https://{env.authority_for(env.domain1, proto)}' \ '/curltest/tweak/?status=200&chunks=1&chunk_size=100' client = LocalClient(env=env, name='cli_h2_pausing') r = client.run(args=['-V', proto, url]) r.check_exit_code(0) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, proto): if not env.have_compressed_curl(): pytest.skip("--compressed not supported") - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 urln = f'https://{env.authority_for(env.domain1brotli, proto)}/data-100k?[0-{count-1}]' curl = CurlClient(env=env) @@ -611,12 +510,8 @@ def check_downloads(self, client, srcfile: str, count: int, # download via lib client, 1 at a time, pause/resume at different offsets @pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000]) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 docname = 'data-10m' url = f'https://localhost:{env.https_port}/{docname}' @@ -631,9 +526,8 @@ def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset self.check_downloads(client, srcfile, count) # download parallel with prior knowledge + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_02_30_parallel_prior_knowledge(self, env: Env, httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") count = 3 curl = CurlClient(env=env) urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' @@ -644,9 +538,8 @@ def test_02_30_parallel_prior_knowledge(self, env: Env, httpd): assert r.total_connects == 1, r.dump_logs() # download parallel with h2 "Upgrade:" + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_02_31_parallel_upgrade(self, env: Env, httpd, nghttpx): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") count = 3 curl = CurlClient(env=env) urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' @@ -663,15 +556,12 @@ def test_02_31_parallel_upgrade(self, env: Env, httpd, nghttpx): @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and \ - (not env.have_h3() or not env.curl_can_h3_early_data()): - pytest.skip("h3 not supported") + if proto == 'h3' and not env.curl_can_h3_early_data(): + pytest.skip("h3 early data not supported") if proto != 'h3' and sys.platform.startswith('darwin') and env.ci_run: pytest.skip('failing on macOS CI runners') if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('wolfssl'): @@ -718,17 +608,13 @@ def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): elif proto == 'h3': assert earlydata[1] == 109, f'{earlydata}' - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) @pytest.mark.parametrize("max_host_conns", [0, 1, 5]) def test_02_33_max_host_conns(self, env: Env, httpd, nghttpx, proto, max_host_conns): if not env.curl_is_debug(): pytest.skip('only works for curl debug builds') if not env.curl_is_verbose(): pytest.skip('only works for curl with verbose strings') - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 50 max_parallel = 50 docname = 'data-10k' @@ -760,17 +646,13 @@ def test_02_33_max_host_conns(self, env: Env, httpd, nghttpx, proto, max_host_co assert n <= max_host_conns assert matched_lines > 0 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) @pytest.mark.parametrize("max_total_conns", [0, 1, 5]) def test_02_34_max_total_conns(self, env: Env, httpd, nghttpx, proto, max_total_conns): if not env.curl_is_debug(): pytest.skip('only works for curl debug builds') if not env.curl_is_verbose(): pytest.skip('only works for curl with verbose strings') - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 50 max_parallel = 50 docname = 'data-10k' @@ -812,12 +694,8 @@ def test_02_34_max_total_conns(self, env: Env, httpd, nghttpx, proto, max_total_ # * h2/h3: server continues sending what the stream window allows and # since the one connection involved unpaused transfers, data continues # to be received, requiring buffering. - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_35_pause_bomb(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 pause_offset = 1024 * 1024 docname = 'bomb-100m.txt.var' @@ -832,13 +710,9 @@ def test_02_35_pause_bomb(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(0) # download with looong urls - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) @pytest.mark.parametrize("url_junk", [1024, 16*1024, 32*1024, 64*1024, 80*1024, 96*1024]) def test_02_36_looong_urls(self, env: Env, httpd, nghttpx, proto, url_junk): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('quiche'): pytest.skip("quiche fails from 16k onwards") curl = CurlClient(env=env) diff --git a/tests/http/test_03_goaway.py b/tests/http/test_03_goaway.py index 8acaa9dc659c..2e1d6a58020c 100644 --- a/tests/http/test_03_goaway.py +++ b/tests/http/test_03_goaway.py @@ -39,10 +39,9 @@ class TestGoAway: # download files sequentially with delay, reload server for GOAWAY + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_03_01_h2_goaway(self, env: Env, httpd, nghttpx): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") count = 3 self.r = None diff --git a/tests/http/test_04_stuttered.py b/tests/http/test_04_stuttered.py index bd2c5e1f77c3..7fa2fe37a557 100644 --- a/tests/http/test_04_stuttered.py +++ b/tests/http/test_04_stuttered.py @@ -39,12 +39,8 @@ class TestStuttered: # download 1 file, check that delayed response works in general - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_04_01_download_1(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, proto)}' \ @@ -56,12 +52,8 @@ def test_04_01_download_1(self, env: Env, httpd, nghttpx, proto): # download 50 files in 100 chunks a 100 bytes with 10ms delay between # prepend 100 file requests to warm up connection processing limits # (Apache2 increases # of parallel processed requests after successes) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_04_02_100_100_10(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 50 warmups = 100 curl = CurlClient(env=env) @@ -80,12 +72,8 @@ def test_04_02_100_100_10(self, env: Env, httpd, nghttpx, proto): # download 50 files in 1000 chunks a 10 bytes with 1ms delay between # prepend 100 file requests to warm up connection processing limits # (Apache2 increases # of parallel processed requests after successes) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_04_03_1000_10_1(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 50 warmups = 100 curl = CurlClient(env=env) @@ -104,12 +92,8 @@ def test_04_03_1000_10_1(self, env: Env, httpd, nghttpx, proto): # download 50 files in 10000 chunks a 1 byte with 10us delay between # prepend 100 file requests to warm up connection processing limits # (Apache2 increases # of parallel processed requests after successes) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_04_04_1000_10_1(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 50 warmups = 100 curl = CurlClient(env=env) diff --git a/tests/http/test_05_errors.py b/tests/http/test_05_errors.py index 8d8ea707bbce..258b7f11d5e5 100644 --- a/tests/http/test_05_errors.py +++ b/tests/http/test_05_errors.py @@ -38,12 +38,8 @@ class TestErrors: # download 1 file, check that we get CURLE_PARTIAL_FILE - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_05_01_partial_1(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, proto)}' \ @@ -60,12 +56,8 @@ def test_05_01_partial_1(self, env: Env, httpd, nghttpx, proto): assert len(invalid_stats) == 0, f'failed: {invalid_stats}' # download files, check that we get CURLE_PARTIAL_FILE for all - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("openssl-quic is flaky in yielding proper error codes") count = 20 @@ -85,9 +77,8 @@ def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): assert len(invalid_stats) == 0, f'failed: {invalid_stats}' # access a resource that, on h2, RST the stream with HTTP_1_1_REQUIRED + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_05_03_required(self, env: Env, httpd, nghttpx): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) proto = 'http/1.1' urln = f'https://{env.authority_for(env.domain1, proto)}/curltest/1_1' diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index 93d1fb26bf15..8d6901884146 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -51,12 +51,8 @@ def _class_scope(self, env, httpd, nghttpx): env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024) # upload small data, check that this is what was echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_01_upload_1_small(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") data = '0123456789' curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]' @@ -66,12 +62,8 @@ def test_07_01_upload_1_small(self, env: Env, httpd, nghttpx, proto): assert respdata == [data] # upload large data, check that this is what was echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_02_upload_1_large(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]' @@ -82,12 +74,8 @@ def test_07_02_upload_1_large(self, env: Env, httpd, nghttpx, proto): assert respdata == indata # upload data sequentially, check that they were echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_10_upload_sequential(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 20 data = '0123456789' curl = CurlClient(env=env) @@ -99,12 +87,8 @@ def test_07_10_upload_sequential(self, env: Env, httpd, nghttpx, proto): assert respdata == [data] # upload data parallel, check that they were echoed - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_07_11_upload_parallel(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") # limit since we use a separate connection in h1 count = 20 data = '0123456789' @@ -118,12 +102,8 @@ def test_07_11_upload_parallel(self, env: Env, httpd, nghttpx, proto): assert respdata == [data] # upload large data sequentially, check that this is what was echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_12_upload_seq_large(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') count = 10 curl = CurlClient(env=env) @@ -137,12 +117,8 @@ def test_07_12_upload_seq_large(self, env: Env, httpd, nghttpx, proto): assert respdata == indata # upload very large data sequentially, check that this is what was echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_13_upload_seq_large(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') count = 2 curl = CurlClient(env=env) @@ -155,15 +131,11 @@ def test_07_13_upload_seq_large(self, env: Env, httpd, nghttpx, proto): assert respdata == indata # upload from stdin, issue #14870 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) @pytest.mark.parametrize("indata", [ '', '1', '123\n456andsomething\n\n' ]) def test_07_14_upload_stdin(self, env: Env, httpd, nghttpx, proto, indata): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-{count-1}]' @@ -173,12 +145,8 @@ def test_07_14_upload_stdin(self, env: Env, httpd, nghttpx, proto, indata): respdata = open(curl.response_file(i)).readlines() assert respdata == [f'{len(indata)}'] - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 upload_size = 128*1024 url = f'https://localhost:{env.https_port}/curltest/put' @@ -191,12 +159,8 @@ def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(0) self.check_downloads(client, r, [f"{upload_size}"], count) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 upload_size = 128*1024 url = f'https://localhost:{env.https_port}/curltest/put' @@ -209,12 +173,8 @@ def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(0) self.check_downloads(client, r, [f"{upload_size}"], count) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 upload_size = 128*1024 url = f'https://localhost:{env.https_port}/curltest/echo' @@ -228,12 +188,8 @@ def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto): self.check_downloads(client, r, ["x" * upload_size], count) # upload data parallel, check that they were echoed - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_07_20_upload_parallel(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") # limit since we use a separate connection in h1 count = 10 data = '0123456789' @@ -247,12 +203,8 @@ def test_07_20_upload_parallel(self, env: Env, httpd, nghttpx, proto): assert respdata == [data] # upload large data parallel, check that this is what was echoed - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_07_21_upload_parallel_large(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') # limit since we use a separate connection in h1 count = 10 @@ -267,12 +219,8 @@ def test_07_21_upload_parallel_large(self, env: Env, httpd, nghttpx, proto): # (We used to do this for 20 parallel transfers, but the triggered # stream resets make nghttpx drop the connection after several, which # then gives a non-deterministic number of completely failed transfers) - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_07_22_upload_fail(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') count = 1 curl = CurlClient(env=env) @@ -285,12 +233,8 @@ def test_07_22_upload_fail(self, env: Env, httpd, nghttpx, proto): r.check_stats(count=count, exitcode=[18, 55, 56, 92, 95]) # PUT 100k - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_30_put_100k(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') count = 1 curl = CurlClient(env=env) @@ -305,12 +249,8 @@ def test_07_30_put_100k(self, env: Env, httpd, nghttpx, proto): assert respdata == exp_data # PUT 10m - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_31_put_10m(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') count = 1 curl = CurlClient(env=env) @@ -325,12 +265,8 @@ def test_07_31_put_10m(self, env: Env, httpd, nghttpx, proto): assert respdata == exp_data # issue #10591 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_32_issue_10591(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') count = 1 curl = CurlClient(env=env) @@ -340,10 +276,9 @@ def test_07_32_issue_10591(self, env: Env, httpd, nghttpx, proto): # issue #11157, upload that is 404'ed by server, needs to terminate # correctly and not time out on sending + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_07_33_issue_11157a(self, env: Env, httpd, nghttpx): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') # send a POST to our PUT handler which will send immediately a 404 back url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put' @@ -363,10 +298,9 @@ def test_07_33_issue_11157a(self, env: Env, httpd, nghttpx): r.check_stats(1, 404) # issue #11157, send upload that is slowly read in + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_07_33_issue_11157b(self, env: Env, httpd, nghttpx): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') # tell our test PUT handler to read the upload more slowly, so # that the send buffering and transfer loop needs to wait @@ -387,10 +321,9 @@ def test_07_33_issue_11157b(self, env: Env, httpd, nghttpx): assert r.exit_code == 0, r.dump_logs() r.check_stats(1, 200) + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_07_34_issue_11194(self, env: Env, httpd, nghttpx): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") # tell our test PUT handler to read the upload more slowly, so # that the send buffering and transfer loop needs to wait fdata = os.path.join(env.gen_dir, 'data-100k') @@ -409,9 +342,8 @@ def test_07_34_issue_11194(self, env: Env, httpd, nghttpx): r.check_stats(1, 200) # upload large data on a h1 to h2 upgrade + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_07_35_h1_h2_upgrade_upload(self, env: Env, httpd, nghttpx): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-100k') curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/curltest/echo?id=[0-0]' @@ -427,12 +359,8 @@ def test_07_35_h1_h2_upgrade_upload(self, env: Env, httpd, nghttpx): # upload to a 301,302,303 response @pytest.mark.parametrize("redir", ['301', '302', '303']) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_36_upload_30x(self, env: Env, httpd, nghttpx, redir, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("OpenSSL's own QUIC is flaky here") data = '0123456789' * 10 @@ -446,12 +374,8 @@ def test_07_36_upload_30x(self, env: Env, httpd, nghttpx, redir, proto): assert respdata == [] # was transformed to a GET # upload to a 307 response - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_37_upload_307(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("OpenSSL's own QUIC is flaky here") data = '0123456789' * 10 @@ -465,12 +389,8 @@ def test_07_37_upload_307(self, env: Env, httpd, nghttpx, proto): assert respdata == [data] # was POST again # POST form data, yet another code path in transfer - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_38_form_small(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]' r = curl.http_form(urls=[url], alpn_proto=proto, form={ @@ -479,12 +399,8 @@ def test_07_38_form_small(self, env: Env, httpd, nghttpx, proto): r.check_stats(count=1, http_status=200, exitcode=0) # POST data urlencoded, small enough to be sent with request headers - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_39_post_urlenc_small(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-63k') curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]' @@ -497,12 +413,8 @@ def test_07_39_post_urlenc_small(self, env: Env, httpd, nghttpx, proto): assert respdata == indata # POST data urlencoded, large enough to be sent separate from request headers - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_40_post_urlenc_large(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") fdata = os.path.join(env.gen_dir, 'data-64k') curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]' @@ -519,12 +431,8 @@ def test_07_40_post_urlenc_large(self, env: Env, httpd, nghttpx, proto): # than our default upload buffer length (64KB). # Unfixed, this will fail when run with CURL_DBG_SOCK_WBLOCK=80 most # of the time - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_41_post_urlenc_small(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('quiche'): pytest.skip("quiche has CWND issues with large requests") fdata = os.path.join(env.gen_dir, 'data-63k') @@ -554,12 +462,8 @@ def check_download(self, r: ExecResult, count: int, srcfile: Union[str, os.PathL # upload data, pause, let connection die with an incomplete response # issues #11769 #13260 - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_42a_upload_disconnect(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") client = LocalClient(name='cli_upload_pausing', env=env, timeout=60) if not client.exists(): pytest.skip(f'example client not built: {client.name}') @@ -576,12 +480,8 @@ def test_07_42a_upload_disconnect(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(18) # will fail as it should # upload data, pause, let connection die without any response at all - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_42b_upload_disconnect(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") client = LocalClient(name='cli_upload_pausing', env=env, timeout=60) if not client.exists(): pytest.skip(f'example client not built: {client.name}') @@ -593,12 +493,8 @@ def test_07_42b_upload_disconnect(self, env: Env, httpd, nghttpx, proto): r.check_exit_code(exp_code) # GOT_NOTHING # upload data, pause, let connection die after 100 continue - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_42c_upload_disconnect(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") client = LocalClient(name='cli_upload_pausing', env=env, timeout=60) if not client.exists(): pytest.skip(f'example client not built: {client.name}') @@ -609,12 +505,8 @@ def test_07_42c_upload_disconnect(self, env: Env, httpd, nghttpx, proto): exp_code = 0 # we get a 500 from the server r.check_exit_code(exp_code) # GOT_NOTHING - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_43_upload_denied(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("openssl-quic is flaky in filed PUTs") fdata = os.path.join(env.gen_dir, 'data-10m') @@ -627,13 +519,9 @@ def test_07_43_upload_denied(self, env: Env, httpd, nghttpx, proto): extra_args=['--trace-config', 'all']) r.check_stats(count=count, http_status=413, exitcode=0) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) @pytest.mark.parametrize("httpcode", [301, 302, 307, 308]) def test_07_44_put_redir(self, env: Env, httpd, nghttpx, proto, httpcode): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 upload_size = 128*1024 url = f'https://localhost:{env.https_port}/curltest/put-redir-{httpcode}' @@ -654,12 +542,8 @@ def test_07_44_put_redir(self, env: Env, httpd, nghttpx, proto, httpcode): assert httpcodes[0] == httpcode, f'{r}' # speed limited on put handler - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_50_put_speed_limit(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 fdata = os.path.join(env.gen_dir, 'data-100k') up_len = 100 * 1024 @@ -676,12 +560,8 @@ def test_07_50_put_speed_limit(self, env: Env, httpd, nghttpx, proto): assert (speed_limit * 0.5) <= up_speed <= (speed_limit * 1.5), f'{r.stats[0]}' # speed limited on echo handler - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_07_51_echo_speed_limit(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 fdata = os.path.join(env.gen_dir, 'data-100k') speed_limit = 50 * 1024 diff --git a/tests/http/test_08_caddy.py b/tests/http/test_08_caddy.py index afacee5917ee..9229ce1f22b4 100644 --- a/tests/http/test_08_caddy.py +++ b/tests/http/test_08_caddy.py @@ -68,24 +68,16 @@ def _class_scope(self, env, caddy): env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024) # download 1 file - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_01_download_1(self, env: Env, caddy: Caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3_curl(): - pytest.skip("h3 not supported in curl") curl = CurlClient(env=env) url = f'https://{env.domain1}:{caddy.port}/data.json' r = curl.http_download(urls=[url], alpn_proto=proto) r.check_response(count=1, http_status=200) # download 1MB files sequentially - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_02_download_1mb_sequential(self, env: Env, caddy: Caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3_curl(): - pytest.skip("h3 not supported in curl") count = 50 curl = CurlClient(env=env) urln = f'https://{env.domain1}:{caddy.port}/data1.data?[0-{count-1}]' @@ -93,12 +85,8 @@ def test_08_02_download_1mb_sequential(self, env: Env, caddy: Caddy, proto): r.check_response(count=count, http_status=200, connect_count=1) # download 1MB files parallel - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_03_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3_curl(): - pytest.skip("h3 not supported in curl") count = 20 curl = CurlClient(env=env) urln = f'https://{env.domain1}:{caddy.port}/data1.data?[0-{count-1}]' @@ -114,12 +102,8 @@ def test_08_03_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): # download 5MB files sequentially @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3_curl(): - pytest.skip("h3 not supported in curl") count = 40 curl = CurlClient(env=env) urln = f'https://{env.domain1}:{caddy.port}/data5.data?[0-{count-1}]' @@ -128,12 +112,8 @@ def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): # download 10MB files sequentially @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3_curl(): - pytest.skip("h3 not supported in curl") count = 20 curl = CurlClient(env=env) urln = f'https://{env.domain1}:{caddy.port}/data10.data?[0-{count-1}]' @@ -142,12 +122,8 @@ def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto): # download 10MB files parallel @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3_curl(): - pytest.skip("h3 not supported in curl") if proto == 'http/1.1' and env.curl_uses_lib('mbedtls'): pytest.skip("mbedtls 3.6.0 fails on 50 connections with: " "ssl_handshake returned: (-0x7F00) SSL - Memory allocation failed") @@ -165,12 +141,8 @@ def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto): assert r.total_connects == 1, r.dump_logs() # post data parallel, check that they were echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_06_post_parallel(self, env: Env, httpd, caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") # limit since we use a separate connection in h1 count = 20 data = '0123456789' @@ -184,12 +156,8 @@ def test_08_06_post_parallel(self, env: Env, httpd, caddy, proto): assert respdata == [data] # put large file, check that they length were echoed - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_07_put_large(self, env: Env, httpd, caddy, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") # limit since we use a separate connection in h1< count = 1 fdata = os.path.join(env.gen_dir, 'data-10m') @@ -202,15 +170,12 @@ def test_08_07_put_large(self, env: Env, httpd, caddy, proto): respdata = open(curl.response_file(i)).readlines() assert respdata == exp_data - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_08_08_earlydata(self, env: Env, httpd, caddy, proto): if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and \ - (not env.have_h3() or not env.curl_can_h3_early_data()): - pytest.skip("h3 not supported") + if proto == 'h3' and not env.curl_can_h3_early_data(): + pytest.skip("h3 early data not supported") count = 2 docname = 'data10k.data' url = f'https://{env.domain1}:{caddy.port}/{docname}' diff --git a/tests/http/test_09_push.py b/tests/http/test_09_push.py index ea73bbc7e5f2..35425d11b7b2 100644 --- a/tests/http/test_09_push.py +++ b/tests/http/test_09_push.py @@ -60,9 +60,8 @@ def httpd_configure(self, env, httpd): httpd.reload_if_config_changed() # download a file that triggers a "103 Early Hints" response + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_09_01_h2_early_hints(self, env: Env, httpd, configures_httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") self.httpd_configure(env, httpd) curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/push/data1' @@ -74,9 +73,8 @@ def test_09_01_h2_early_hints(self, env: Env, httpd, configures_httpd): assert 'link' in r.responses[0]['header'], f'{r.responses[0]}' assert r.responses[0]['header']['link'] == '; rel=preload', f'{r.responses[0]}' + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_09_02_h2_push(self, env: Env, httpd, configures_httpd): - if not env.have_h2_curl(): - pytest.skip("h2 not supported") self.httpd_configure(env, httpd) # use localhost as we do not have resolve support in local client url = f'https://localhost:{env.https_port}/push/data1' diff --git a/tests/http/test_10_proxy.py b/tests/http/test_10_proxy.py index aa4e43a38034..13993b2b524f 100644 --- a/tests/http/test_10_proxy.py +++ b/tests/http/test_10_proxy.py @@ -71,10 +71,8 @@ def test_10_01_proxy_http(self, env: Env, httpd): # download via https: proxy (no tunnel) @pytest.mark.skipif(condition=not Env.curl_has_feature('HTTPS-proxy'), reason='curl lacks HTTPS-proxy support') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_10_02_proxys_down(self, env: Env, httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if proto == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -87,7 +85,7 @@ def test_10_02_proxys_down(self, env: Env, httpd, proto): # upload via https: with proto (no tunnel) @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) @pytest.mark.parametrize("fname, fcount", [ ['data.json', 5], ['data-100k', 5], @@ -97,8 +95,6 @@ def test_10_02_proxys_down(self, env: Env, httpd, proto): reason="no nghttpx available") def test_10_02_proxys_up(self, env: Env, httpd, nghttpx, proto, fname, fcount): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if proto == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') count = fcount @@ -137,11 +133,9 @@ def test_10_04_proxy_https(self, env: Env, httpd, nghttpx_fwd): r.check_response(count=1, http_status=200) # download https: with proto via http: proxytunnel - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_10_05_proxytunnel_http(self, env: Env, httpd, nghttpx_fwd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://localhost:{env.https_port}/data.json' xargs = curl.get_proxy_args(proxys=False, tunnel=True) @@ -153,14 +147,12 @@ def test_10_05_proxytunnel_http(self, env: Env, httpd, nghttpx_fwd, proto): # download https: with proto via https: proxytunnel @pytest.mark.skipif(condition=not Env.curl_has_feature('HTTPS-proxy'), reason='curl lacks HTTPS-proxy support') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_06_proxytunnel_https(self, env: Env, httpd, nghttpx_fwd, proto, tunnel): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -179,8 +171,8 @@ def test_10_06_proxytunnel_https(self, env: Env, httpd, nghttpx_fwd, proto, tunn @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.parametrize("fname, fcount", [ ['data.json', 100], ['data-100k', 20], @@ -189,8 +181,6 @@ def test_10_06_proxytunnel_https(self, env: Env, httpd, nghttpx_fwd, proto, tunn @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") def test_10_07_pts_down_small(self, env: Env, httpd, nghttpx_fwd, proto, tunnel, fname, fcount): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ @@ -213,8 +203,8 @@ def test_10_07_pts_down_small(self, env: Env, httpd, nghttpx_fwd, proto, # upload many https: with proto via https: proxytunnel @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.parametrize("fname, fcount", [ ['data.json', 50], ['data-100k', 20], @@ -225,8 +215,6 @@ def test_10_07_pts_down_small(self, env: Env, httpd, nghttpx_fwd, proto, @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") def test_10_08_upload_seq_large(self, env: Env, httpd, nghttpx, proto, tunnel, fname, fcount): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ @@ -248,13 +236,11 @@ def test_10_08_upload_seq_large(self, env: Env, httpd, nghttpx, proto, assert respdata == indata, f'response {i} differs' @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_09_reuse_server(self, env: Env, httpd, nghttpx_fwd, tunnel): - if tunnel == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -274,14 +260,12 @@ def test_10_09_reuse_server(self, env: Env, httpd, nghttpx_fwd, tunnel): assert r.total_connects == 2 @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel): # url twice via https: proxy separated with '--next', will reuse - if tunnel == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ @@ -304,15 +288,13 @@ def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel): assert r2.total_connects == 1 @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") @pytest.mark.skipif(condition=not Env.curl_uses_lib('openssl'), reason="tls13-ciphers not supported") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_11_noreuse_proxy_https(self, env: Env, httpd, nghttpx_fwd, tunnel): # different --proxy-tls13-ciphers, no reuse of connection for https: - if tunnel == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') @@ -333,15 +315,13 @@ def test_10_11_noreuse_proxy_https(self, env: Env, httpd, nghttpx_fwd, tunnel): assert r2.total_connects == 2 @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") @pytest.mark.skipif(condition=not Env.curl_uses_lib('openssl'), reason="tls13-ciphers not supported") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_12_noreuse_proxy_http(self, env: Env, httpd, nghttpx_fwd, tunnel): # different --proxy-tls13-ciphers, no reuse of connection for http: - if tunnel == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -362,15 +342,13 @@ def test_10_12_noreuse_proxy_http(self, env: Env, httpd, nghttpx_fwd, tunnel): assert r2.total_connects == 2 @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") @pytest.mark.skipif(condition=not Env.curl_uses_lib('openssl'), reason="tls13-ciphers not supported") @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_13_noreuse_https(self, env: Env, httpd, nghttpx_fwd, tunnel): # different --tls13-ciphers on https: same proxy config - if tunnel == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) @@ -393,10 +371,8 @@ def test_10_13_noreuse_https(self, env: Env, httpd, nghttpx_fwd, tunnel): # download via https: proxy (no tunnel) using IP address @pytest.mark.skipif(condition=not Env.curl_has_feature('HTTPS-proxy'), reason='curl lacks HTTPS-proxy support') - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_10_14_proxys_ip_addr(self, env: Env, httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if proto == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') curl = CurlClient(env=env) diff --git a/tests/http/test_13_proxy_auth.py b/tests/http/test_13_proxy_auth.py index 6576bdba1aab..080adef1870e 100644 --- a/tests/http/test_13_proxy_auth.py +++ b/tests/http/test_13_proxy_auth.py @@ -121,11 +121,9 @@ def test_13_06_tunnel_http_auth(self, env: Env, httpd, configures_httpd): reason='curl lacks HTTPS-proxy support') @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) def test_13_07_tunnels_no_auth(self, env: Env, httpd, configures_httpd, nghttpx_fwd, proto, tunnel): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") self.httpd_configure(env, httpd) if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') @@ -143,11 +141,9 @@ def test_13_07_tunnels_no_auth(self, env: Env, httpd, configures_httpd, nghttpx_ reason='curl lacks HTTPS-proxy support') @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) - @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) + @pytest.mark.parametrize("tunnel", Env.http_h1_h2_protos()) def test_13_08_tunnels_auth(self, env: Env, httpd, configures_httpd, nghttpx_fwd, proto, tunnel): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") self.httpd_configure(env, httpd) if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') diff --git a/tests/http/test_14_auth.py b/tests/http/test_14_auth.py index 3e15b224473d..0187c76a6a70 100644 --- a/tests/http/test_14_auth.py +++ b/tests/http/test_14_auth.py @@ -41,26 +41,18 @@ def _class_scope(self, env, httpd, nghttpx): env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024) # download 1 file, not authenticated - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_14_01_digest_get_noauth(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/restricted/digest/data.json' r = curl.http_download(urls=[url], alpn_proto=proto) r.check_response(http_status=401) # download 1 file, authenticated - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_14_02_digest_get_auth(self, env: Env, httpd, nghttpx, proto): if not env.curl_has_feature('digest'): pytest.skip("curl built without digest") - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/restricted/digest/data.json' r = curl.http_download(urls=[url], alpn_proto=proto, extra_args=[ @@ -69,14 +61,10 @@ def test_14_02_digest_get_auth(self, env: Env, httpd, nghttpx, proto): r.check_response(http_status=200) # PUT data, authenticated - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_14_03_digest_put_auth(self, env: Env, httpd, nghttpx, proto): if not env.curl_has_feature('digest'): pytest.skip("curl built without digest") - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("openssl-quic is flaky in retrying POST") data='0123456789' @@ -88,14 +76,10 @@ def test_14_03_digest_put_auth(self, env: Env, httpd, nghttpx, proto): r.check_response(http_status=200) # PUT data, digest auth large pw - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_14_04_digest_large_pw(self, env: Env, httpd, nghttpx, proto): if not env.curl_has_feature('digest'): pytest.skip("curl built without digest") - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") data='0123456789' password = 'x' * 65535 curl = CurlClient(env=env) @@ -109,12 +93,8 @@ def test_14_04_digest_large_pw(self, env: Env, httpd, nghttpx, proto): r.check_response(http_status=401) # PUT data, basic auth large pw - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and not env.curl_uses_lib('ngtcp2'): # See pytest.skip("quiche/openssl-quic have problems with large requests") @@ -131,12 +111,8 @@ def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto): r.check_response(http_status=431) # PUT data, basic auth with very large pw - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_14_06_basic_very_large_pw(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('quiche'): # See pytest.skip("quiche has problems with large requests") diff --git a/tests/http/test_16_info.py b/tests/http/test_16_info.py index 017f7998812c..4e0d1ed5b1a9 100644 --- a/tests/http/test_16_info.py +++ b/tests/http/test_16_info.py @@ -45,12 +45,8 @@ def _class_scope(self, env, httpd): env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100*1024) # download plain file - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_16_01_info_download(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]' @@ -62,12 +58,8 @@ def test_16_01_info_download(self, env: Env, httpd, nghttpx, proto): self.check_stat(idx, s, r, dl_size=30, ul_size=0) # download plain file with a 302 redirect - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_16_02_info_302_download(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/data.json.302?[0-{count-1}]' @@ -80,12 +72,8 @@ def test_16_02_info_302_download(self, env: Env, httpd, nghttpx, proto): for idx, s in enumerate(r.stats): self.check_stat(idx, s, r, dl_size=30, ul_size=0) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_16_03_info_upload(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 fdata = os.path.join(env.gen_dir, 'data-100k') fsize = 100 * 1024 diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index 49a20c6994f4..427ca70fdd83 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -116,12 +116,8 @@ def test_17_02_sslinfo_reconnect(self, env: Env, tls_max, httpd): assert djson['SSL_SESSION_RESUMED'] == exp_resumed, f'{i}: {djson}\n{r.dump_logs()}' # use host name with trailing dot, verify handshake - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) domain = f'{env.domain1}.' url = f'https://{env.authority_for(domain, proto)}/curltest/sslinfo' @@ -133,12 +129,8 @@ def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx): assert r.json['SSL_TLS_SNI'] == env.domain1, f'{r.json}' # use host name with double trailing dot, verify handshake - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) domain = f'{env.domain1}..' url = f'https://{env.authority_for(domain, proto)}/curltest/sslinfo' @@ -157,14 +149,10 @@ def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx): assert r.exit_code in [7, 35, 60], f'{r}' # use ip address for connect - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_05_good_ip_addr(self, env: Env, proto, httpd, nghttpx): if env.curl_uses_lib('mbedtls'): pytest.skip("mbedTLS does use IP addresses in SNI") - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) domain = '127.0.0.1' url = f'https://{env.authority_for(domain, proto)}/curltest/sslinfo' @@ -176,14 +164,10 @@ def test_17_05_good_ip_addr(self, env: Env, proto, httpd, nghttpx): assert 'SSL_TLS_SNI' not in r.json, f'{r.json}' # use IP address that is not in cert - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_05_bad_ip_addr(self, env: Env, proto, httpd, configures_httpd, nghttpx, configures_nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") httpd.set_domain1_cred_name('domain1-no-ip') httpd.reload_if_config_changed() if proto == 'h3': @@ -195,14 +179,10 @@ def test_17_05_bad_ip_addr(self, env: Env, proto, assert r.exit_code == 60, f'{r}' # use IP address that is in cert as DNS name (not really legal) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_05_very_bad_ip_addr(self, env: Env, proto, httpd, configures_httpd, nghttpx, configures_nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if env.curl_uses_lib('mbedtls'): pytest.skip("mbedtls falsely verifies a DNS: altname as IP address") if env.curl_uses_lib('wolfssl') and \ @@ -219,12 +199,8 @@ def test_17_05_very_bad_ip_addr(self, env: Env, proto, assert r.exit_code == 60, f'{r}' # use localhost for connect - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_06_localhost(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) domain = 'localhost' url = f'https://{env.authority_for(domain, proto)}/curltest/sslinfo' @@ -310,12 +286,8 @@ def test_17_07_ssl_ciphers(self, env: Env, httpd, configures_httpd, else: assert r.exit_code != 0, r.dump_logs() - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_08_cert_status(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if not env.curl_uses_lib('openssl') and \ not env.curl_uses_lib('gnutls') and \ not env.curl_uses_lib('quictls'): @@ -433,12 +405,8 @@ def test_17_10_h3_session_reuse(self, env: Env, httpd, nghttpx): assert reused_session, f'{r}\n{r.dump_logs()}' # use host name server has no certificate for - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) domain = f'insecure.{env.tld}' url = f'https://{domain}:{env.port_for(proto)}/curltest/sslinfo' @@ -446,12 +414,8 @@ def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx): assert r.exit_code == 60, f'{r}' # use host name server has no cert for with --insecure - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env) domain = f'insecure.{env.tld}' url = f'https://{domain}:{env.port_for(proto)}/curltest/sslinfo' @@ -462,10 +426,8 @@ def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx): assert r.json, f'{r}' # connect to an expired certificate - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_17_14_expired_cert(self, env: Env, proto, httpd): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") curl = CurlClient(env=env) url = f'https://{env.expired_domain}:{env.port_for(proto)}/' r = curl.http_get(url=url, alpn_proto=proto) @@ -588,12 +550,8 @@ def test_17_18_gnutls_priority(self, env: Env, httpd, configures_httpd, priority else: assert r.exit_code != 0, r.dump_logs() - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) - def test_17_19_wrong_pin(self, env: Env, proto, httpd): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") + @pytest.mark.parametrize("proto", Env.http_protos()) + def test_17_19_wrong_pin(self, env: Env, proto, httpd, nghttpx): if env.curl_uses_lib('rustls-ffi'): pytest.skip('TLS backend ignores --pinnedpubkey') curl = CurlClient(env=env) @@ -604,12 +562,8 @@ def test_17_19_wrong_pin(self, env: Env, proto, httpd): # expect NOT_IMPLEMENTED or CURLE_SSL_PINNEDPUBKEYNOTMATCH assert r.exit_code in [2, 90], f'{r.dump_logs()}' - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) - def test_17_20_correct_pin(self, env: Env, proto, httpd): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") + @pytest.mark.parametrize("proto", Env.http_protos()) + def test_17_20_correct_pin(self, env: Env, proto, httpd, nghttpx): curl = CurlClient(env=env) creds = env.get_credentials(env.domain1) assert creds diff --git a/tests/http/test_18_methods.py b/tests/http/test_18_methods.py index 10f4867c15f5..d693b67e8921 100644 --- a/tests/http/test_18_methods.py +++ b/tests/http/test_18_methods.py @@ -43,12 +43,8 @@ def _class_scope(self, env, httpd, nghttpx): env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024) # download 1 file - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_18_01_delete(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 1 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak?id=[0-{count-1}]' @@ -59,10 +55,9 @@ def test_18_01_delete(self, env: Env, httpd, nghttpx, proto): # - HEADER frame with 204 and eos=0 # - 10ms later DATA frame length=0 and eos=1 # should be accepted + @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") def test_18_02_delete_h2_special(self, env: Env, httpd, nghttpx): proto = 'h2' - if not env.have_h2_curl(): - pytest.skip("h2 not supported") count = 1 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak?id=[0-{count-1}]'\ diff --git a/tests/http/test_19_shutdown.py b/tests/http/test_19_shutdown.py index 7bbc035f28c8..efa7657fe939 100644 --- a/tests/http/test_19_shutdown.py +++ b/tests/http/test_19_shutdown.py @@ -66,10 +66,8 @@ def test_19_01_check_tcp_rst(self, env: Env, httpd, proto): # check with `tcpdump` that we do NOT see TCP RST when CURL_GRACEFUL_SHUTDOWN set @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_19_02_check_shutdown(self, env: Env, httpd, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") if not env.curl_is_debug(): pytest.skip('only works for curl debug builds') run_env = os.environ.copy() @@ -164,12 +162,8 @@ def test_19_05_event_shutdown_by_server(self, env: Env, httpd, proto): assert len(removes) == count, f'{removes}' # check graceful shutdown on multiplexed http - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_mplx_protos()) def test_19_06_check_shutdown(self, env: Env, httpd, nghttpx, proto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") if not env.curl_is_debug(): pytest.skip('only works for curl debug builds') if not env.curl_is_verbose(): diff --git a/tests/http/test_40_socks.py b/tests/http/test_40_socks.py index 2dd61cc2eca4..8c6a81f4f6ad 100644 --- a/tests/http/test_40_socks.py +++ b/tests/http/test_40_socks.py @@ -61,12 +61,8 @@ def test_40_01_socks_http(self, env: Env, sproto, danted: Dante, httpd): r.check_response(http_status=200) @pytest.mark.parametrize("sproto", ['socks4', 'socks5']) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_40_02_socks_https(self, env: Env, sproto, proto, danted: Dante, httpd): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") curl = CurlClient(env=env, socks_args=[ f'--{sproto}', f'127.0.0.1:{danted.port}' ]) @@ -78,10 +74,8 @@ def test_40_02_socks_https(self, env: Env, sproto, proto, danted: Dante, httpd): r.check_response(http_status=200) @pytest.mark.parametrize("sproto", ['socks4', 'socks5']) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_40_03_dl_serial(self, env: Env, httpd, danted, proto, sproto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") count = 3 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env, socks_args=[ @@ -91,10 +85,8 @@ def test_40_03_dl_serial(self, env: Env, httpd, danted, proto, sproto): r.check_response(count=count, http_status=200) @pytest.mark.parametrize("sproto", ['socks4', 'socks5']) - @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + @pytest.mark.parametrize("proto", Env.http_h1_h2_protos()) def test_40_04_ul_serial(self, env: Env, httpd, danted, proto, sproto): - if proto == 'h2' and not env.have_h2_curl(): - pytest.skip("h2 not supported") fdata = os.path.join(env.gen_dir, 'data-10m') count = 2 curl = CurlClient(env=env, socks_args=[ diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index 31db10499457..5e6bcfc68759 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -506,6 +506,36 @@ def curl_can_h3_early_data() -> bool: return Env.curl_can_early_data() and \ Env.curl_uses_lib('ngtcp2') + @staticmethod + def http_protos() -> List[str]: + # http protocols we can test + if Env.have_h2_curl(): + if Env.have_h3(): + return ['http/1.1', 'h2', 'h3'] + else: + return ['http/1.1', 'h2'] + else: + return ['http/1.1'] + + @staticmethod + def http_h1_h2_protos() -> List[str]: + # http 1+2 protocols we can test + if Env.have_h2_curl(): + return ['http/1.1', 'h2'] + else: + return ['http/1.1'] + + @staticmethod + def http_mplx_protos() -> List[str]: + # http multiplexing protocols we can test + if Env.have_h2_curl(): + if Env.have_h3(): + return ['h2', 'h3'] + else: + return ['h2'] + else: + return [] + @staticmethod def have_h3() -> bool: return Env.have_h3_curl() and Env.have_h3_server() @@ -560,7 +590,8 @@ def __init__(self, pytestconfig=None, env_config=None): def issue_certs(self): if self._ca is None: - ca_dir = os.path.join(self.CONFIG.gen_root, 'ca') + # ca_dir = os.path.join(self.CONFIG.gen_root, 'ca') + ca_dir = os.path.join(self.gen_dir, 'ca') os.makedirs(ca_dir, exist_ok=True) lock_file = os.path.join(ca_dir, 'ca.lock') with FileLock(lock_file): From f2460e2cb5a017e7e441d5e968b94d9c3e2ba9d1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Nov 2025 23:54:54 +0100 Subject: [PATCH 408/885] RELEASE-NOTES: update upcoming removals Also add a missed commit (noticed by accident) Closes #19558 --- RELEASE-NOTES | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4bfa8d81d5ed..e24762bafde4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -56,6 +56,7 @@ This release includes the following bugfixes: o lib: eliminate size_t casts [112] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] + o libtests: replace `atoi()` with `curlx_str_number()` [120] o libssh2: cleanup ssh_force_knownhost_key_type [64] o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] o limit-rate: add example using --limit-rate and --max-time together [89] @@ -124,9 +125,9 @@ For all changes ever done in curl: Planned upcoming removals include: - o Builds using VS2008 o OpenSSL-QUIC o Support for c-ares versions before 1.16.0 + o Support for Windows XP/2003 See https://curl.se/dev/deprecate.html @@ -243,3 +244,4 @@ References to bug reports and discussions on issues: [112] = https://curl.se/bug/?i=19495 [118] = https://curl.se/bug/?i=19493 [119] = https://curl.se/bug/?i=19483 + [120] = https://curl.se/bug/?i=19506 From f0de14168a4d1c3a4ed43a04af92c5755c84b9fc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 01:16:07 +0100 Subject: [PATCH 409/885] cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime Before this patch `TCP_KEEP*` socket options were unconditionally used if the build-time SDK supported them. This caused curl logging errors (or trace messages since #19527) on Windows versions missing support for them. After this patch, use them only when the runtime environment supports it and fall back to the alternate method (`SIO_KEEPALIVE_VALS`) dynamically. Also: - log a trace message when using the Win10 method. - document which SDK versions offer `TCP_KEEP*` macros. Ref: https://learn.microsoft.com/windows/win32/winsock/ipproto-tcp-socket-options Ref: https://learn.microsoft.com/windows/win32/winsock/sio-keepalive-vals Reported-by: Aleksandr Sergeev Fixes #19520 Follow-up to dc34498d18d3303d67364423b4aa0daab4afb3ba #19527 Closes #19559 --- lib/cf-socket.c | 118 ++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 60 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index d1a99d3ecee9..8661647ba52b 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -149,13 +149,7 @@ static void nosigpipe(struct Curl_cfilter *cf, #define nosigpipe(x,y,z) Curl_nop_stmt #endif -#if defined(USE_WINSOCK) && \ - defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT) -/* Win 10, v 1709 (10.0.16299) and later can use SetSockOpt TCP_KEEP____ - * so should use seconds */ -#define CURL_WINSOCK_KEEP_SSO -#define KEEPALIVE_FACTOR(x) -#elif defined(USE_WINSOCK) || \ +#if defined(USE_WINSOCK) || \ (defined(__sun) && !defined(TCP_KEEPIDLE)) || \ (defined(__DragonFly__) && __DragonFly_version < 500702) || \ (defined(_WIN32) && !defined(TCP_KEEPIDLE)) @@ -166,17 +160,6 @@ static void nosigpipe(struct Curl_cfilter *cf, #define KEEPALIVE_FACTOR(x) #endif -/* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */ -#if defined(USE_WINSOCK) && !defined(SIO_KEEPALIVE_VALS) -#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4) - -struct tcp_keepalive { - u_long onoff; - u_long keepalivetime; - u_long keepaliveinterval; -}; -#endif - static void tcpkeepalive(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -192,49 +175,64 @@ tcpkeepalive(struct Curl_cfilter *cf, sockfd, SOCKERRNO); } else { -#ifdef SIO_KEEPALIVE_VALS /* Windows */ -/* Windows 10, version 1709 (10.0.16299) and later versions */ -#ifdef CURL_WINSOCK_KEEP_SSO - optval = curlx_sltosi(data->set.tcp_keepidle); - KEEPALIVE_FACTOR(optval); - if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, - (const char *)&optval, sizeof(optval)) < 0) { - CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); - } - optval = curlx_sltosi(data->set.tcp_keepintvl); - KEEPALIVE_FACTOR(optval); - if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, - (const char *)&optval, sizeof(optval)) < 0) { - CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); - } - optval = curlx_sltosi(data->set.tcp_keepcnt); - if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, - (const char *)&optval, sizeof(optval)) < 0) { - CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); +#ifdef USE_WINSOCK +/* Offered by mingw-w64 v12+. MS SDK ~10+/~VS2017+. */ +#if defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT) + /* Windows 10, version 1709 (10.0.16299) and later versions can use + setsockopt() TCP_KEEP*. Older versions return with failure. */ + if(curlx_verify_windows_version(10, 0, 16299, PLATFORM_WINNT, + VERSION_GREATER_THAN_EQUAL)) { + CURL_TRC_CF(data, cf, "Set TCP_KEEP* on fd=%" FMT_SOCKET_T, sockfd); + optval = curlx_sltosi(data->set.tcp_keepidle); + if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, + (const char *)&optval, sizeof(optval)) < 0) { + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); + } + optval = curlx_sltosi(data->set.tcp_keepintvl); + if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, + (const char *)&optval, sizeof(optval)) < 0) { + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); + } + optval = curlx_sltosi(data->set.tcp_keepcnt); + if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, + (const char *)&optval, sizeof(optval)) < 0) { + CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd " + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); + } } -#else /* Windows < 10.0.16299 */ - struct tcp_keepalive vals; - DWORD dummy; - vals.onoff = 1; - optval = curlx_sltosi(data->set.tcp_keepidle); - KEEPALIVE_FACTOR(optval); - vals.keepalivetime = (u_long)optval; - optval = curlx_sltosi(data->set.tcp_keepintvl); - KEEPALIVE_FACTOR(optval); - vals.keepaliveinterval = (u_long)optval; - if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID) &vals, sizeof(vals), - NULL, 0, &dummy, NULL, NULL) != 0) { - CURL_TRC_CF(data, cf, "Failed to set SIO_KEEPALIVE_VALS on fd " - "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); + else +#endif /* TCP_KEEPIDLE && TCP_KEEPINTVL && TCP_KEEPCNT */ + { +/* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */ +#ifndef SIO_KEEPALIVE_VALS +#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4) + struct tcp_keepalive { + u_long onoff; + u_long keepalivetime; + u_long keepaliveinterval; + }; +#endif + struct tcp_keepalive vals; + DWORD dummy; + vals.onoff = 1; + optval = curlx_sltosi(data->set.tcp_keepidle); + KEEPALIVE_FACTOR(optval); + vals.keepalivetime = (u_long)optval; + optval = curlx_sltosi(data->set.tcp_keepintvl); + KEEPALIVE_FACTOR(optval); + vals.keepaliveinterval = (u_long)optval; + if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID)&vals, sizeof(vals), + NULL, 0, &dummy, NULL, NULL) != 0) { + CURL_TRC_CF(data, cf, "Failed to set SIO_KEEPALIVE_VALS on fd " + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); + } } -#endif -#else /* !Windows */ +#else /* !USE_WINSOCK */ #ifdef TCP_KEEPIDLE optval = curlx_sltosi(data->set.tcp_keepidle); KEEPALIVE_FACTOR(optval); @@ -303,7 +301,7 @@ tcpkeepalive(struct Curl_cfilter *cf, "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #endif -#endif +#endif /* USE_WINSOCK */ } } From a87383828e4534c17c282cc6498d45a0cadee1d2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 15 Nov 2025 00:27:38 +0100 Subject: [PATCH 410/885] badwords: fix issues found in tests There remain some false positives, hits in test data, and `dir` use, around 100 issues in total. There is no plan to enforce badwords on tests. Also: - badwords.txt: let a few `manpage[s]` occurrences through (in Perl code). Closes #19541 --- .github/scripts/badwords.txt | 4 +- tests/Makefile.am | 8 +- tests/allversions.pm | 2 +- tests/certs/genserv.pl | 2 +- tests/certs/test-ca.prm | 2 +- tests/certs/test-client-cert.prm | 2 +- tests/certs/test-client-eku-only.prm | 2 +- tests/certs/test-localhost-san-first.prm | 2 +- tests/certs/test-localhost-san-last.prm | 2 +- tests/certs/test-localhost.nn.prm | 2 +- tests/certs/test-localhost.prm | 2 +- tests/certs/test-localhost0h.prm | 2 +- tests/data/test1034 | 4 +- tests/data/test1035 | 2 +- tests/data/test1038 | 4 +- tests/data/test1039 | 4 +- tests/data/test1041 | 2 +- tests/data/test1059 | 2 +- tests/data/test1069 | 2 +- tests/data/test1101 | 2 +- tests/data/test1108 | 2 +- tests/data/test112 | 4 +- tests/data/test1173 | 2 +- tests/data/test1185 | 2 +- tests/data/test1187 | 2 +- tests/data/test1208 | 2 +- tests/data/test1216 | 2 +- tests/data/test1218 | 2 +- tests/data/test1229 | 2 +- tests/data/test1233 | 2 +- tests/data/test1237 | 2 +- tests/data/test1238 | 2 +- tests/data/test1246 | 2 +- tests/data/test1264 | 2 +- tests/data/test1318 | 2 +- tests/data/test1411 | 2 +- tests/data/test1421 | 2 +- tests/data/test1447 | 2 +- tests/data/test1448 | 2 +- tests/data/test1453 | 2 +- tests/data/test1456 | 2 +- tests/data/test1468 | 2 +- tests/data/test1470 | 2 +- tests/data/test1471 | 2 +- tests/data/test1472 | 2 +- tests/data/test1491 | 2 +- tests/data/test151 | 4 +- tests/data/test1513 | 2 +- tests/data/test1516 | 2 +- tests/data/test152 | 4 +- tests/data/test1553 | 2 +- tests/data/test1555 | 2 +- tests/data/test1557 | 2 +- tests/data/test1561 | 2 +- tests/data/test1590 | 2 +- tests/data/test1592 | 2 +- tests/data/test161 | 2 +- tests/data/test162 | 6 +- tests/data/test1631 | 2 +- tests/data/test1632 | 2 +- tests/data/test165 | 2 +- tests/data/test187 | 2 +- tests/data/test189 | 2 +- tests/data/test1915 | 2 +- tests/data/test1917 | 2 +- tests/data/test20 | 2 +- tests/data/test2024 | 2 +- tests/data/test2025 | 2 +- tests/data/test2026 | 2 +- tests/data/test2027 | 2 +- tests/data/test2028 | 2 +- tests/data/test2029 | 2 +- tests/data/test2030 | 4 +- tests/data/test2046 | 2 +- tests/data/test2047 | 2 +- tests/data/test2102 | 2 +- tests/data/test2103 | 2 +- tests/data/test2104 | 2 +- tests/data/test2205 | 2 +- tests/data/test2302 | 2 +- tests/data/test2304 | 2 +- tests/data/test235 | 4 +- tests/data/test24 | 2 +- tests/data/test258 | 2 +- tests/data/test259 | 2 +- tests/data/test3016 | 2 +- tests/data/test3202 | 2 +- tests/data/test3203 | 2 +- tests/data/test328 | 2 +- tests/data/test331 | 2 +- tests/data/test336 | 2 +- tests/data/test349 | 2 +- tests/data/test357 | 2 +- tests/data/test361 | 2 +- tests/data/test367 | 2 +- tests/data/test380 | 2 +- tests/data/test389 | 2 +- tests/data/test399 | 2 +- tests/data/test410 | 2 +- tests/data/test412 | 2 +- tests/data/test413 | 2 +- tests/data/test440 | 2 +- tests/data/test441 | 2 +- tests/data/test458 | 2 +- tests/data/test506 | 2 +- tests/data/test507 | 2 +- tests/data/test517 | 6 +- tests/data/test531 | 2 +- tests/data/test542 | 2 +- tests/data/test543 | 2 +- tests/data/test554 | 2 +- tests/data/test562 | 4 +- tests/data/test563 | 2 +- tests/data/test579 | 2 +- tests/data/test583 | 6 +- tests/data/test588 | 4 +- tests/data/test643 | 2 +- tests/data/test645 | 2 +- tests/data/test678 | 2 +- tests/data/test716 | 2 +- tests/data/test717 | 2 +- tests/data/test721 | 2 +- tests/data/test726 | 4 +- tests/data/test729 | 2 +- tests/data/test739 | 2 +- tests/data/test742 | 4 +- tests/data/test752 | 2 +- tests/data/test775 | 2 +- tests/data/test804 | 2 +- tests/data/test841 | 2 +- tests/data/test842 | 2 +- tests/data/test87 | 3 +- tests/devtest.pl | 6 +- tests/dictserver.py | 4 +- tests/ech_tests.sh | 42 +++---- tests/ftpserver.pl | 42 +++---- tests/getpart.pm | 4 +- tests/http/scorecard.py | 2 +- tests/http/test_02_download.py | 2 +- tests/http/test_10_proxy.py | 2 +- tests/http/test_17_ssl_use.py | 8 +- tests/http/testenv/caddy.py | 4 +- tests/http/testenv/httpd.py | 12 +- .../http/testenv/mod_curltest/mod_curltest.c | 14 +-- tests/http/testenv/nghttpx.py | 4 +- tests/http/testenv/vsftpd.py | 2 +- tests/libtest/cli_hx_download.c | 2 +- tests/libtest/cli_hx_upload.c | 2 +- tests/libtest/first.c | 2 +- tests/libtest/first.h | 6 +- tests/libtest/lib1308.c | 2 +- tests/libtest/lib1531.c | 2 +- tests/libtest/lib1560.c | 10 +- tests/libtest/lib1565.c | 4 +- tests/libtest/lib1592.c | 18 +-- tests/libtest/lib1593.c | 2 +- tests/libtest/lib1906.c | 4 +- tests/libtest/lib1907.c | 2 +- tests/libtest/lib1908.c | 2 +- tests/libtest/lib1918.c | 4 +- tests/libtest/lib1939.c | 2 +- tests/libtest/lib1940.c | 2 +- tests/libtest/lib1945.c | 2 +- tests/libtest/lib2032.c | 4 +- tests/libtest/lib2405.c | 6 +- tests/libtest/lib3026.c | 6 +- tests/libtest/lib3102.c | 2 +- tests/libtest/lib505.c | 4 +- tests/libtest/lib506.c | 2 +- tests/libtest/lib518.c | 6 +- tests/libtest/lib525.c | 2 +- tests/libtest/lib530.c | 4 +- tests/libtest/lib537.c | 10 +- tests/libtest/lib540.c | 2 +- tests/libtest/lib541.c | 4 +- tests/libtest/lib542.c | 2 +- tests/libtest/lib554.c | 2 +- tests/libtest/lib557.c | 2 +- tests/libtest/lib562.c | 2 +- tests/libtest/lib568.c | 4 +- tests/libtest/lib569.c | 2 +- tests/libtest/lib571.c | 2 +- tests/libtest/lib572.c | 4 +- tests/libtest/lib579.c | 4 +- tests/libtest/lib582.c | 8 +- tests/libtest/lib586.c | 2 +- tests/libtest/lib643.c | 2 +- tests/libtest/lib659.c | 2 +- tests/libtest/lib694.c | 2 +- tests/libtest/lib758.c | 4 +- tests/libtest/mk-lib1521.pl | 2 +- tests/libtest/test1013.pl | 4 +- tests/libtest/test1022.pl | 6 +- tests/libtest/test307.pl | 2 +- tests/libtest/test613.pl | 2 +- tests/libtest/testtrace.c | 4 +- tests/libtest/testutil.c | 2 +- tests/libtest/testutil.h | 2 +- tests/memanalyze.pl | 2 +- tests/negtelnetserver.py | 10 +- tests/pathhelp.pm | 4 +- tests/runner.pm | 26 ++--- tests/runtests.pl | 82 +++++++------- tests/secureserver.pl | 6 +- tests/server/first.h | 2 +- tests/server/getpart.c | 2 +- tests/server/mqttd.c | 6 +- tests/server/resolve.c | 4 +- tests/server/rtspd.c | 28 ++--- tests/server/sockfilt.c | 8 +- tests/server/socksd.c | 4 +- tests/server/sws.c | 34 +++--- tests/server/tftpd.c | 12 +- tests/server/util.c | 6 +- tests/serverhelp.pm | 24 ++-- tests/servers.pm | 104 +++++++++--------- tests/smbserver.py | 8 +- tests/sshserver.pl | 24 ++-- tests/test1119.pl | 8 +- tests/test1132.pl | 6 +- tests/test1135.pl | 2 +- tests/test1139.pl | 6 +- tests/test1165.pl | 6 +- tests/test1167.pl | 6 +- tests/test1173.pl | 10 +- tests/test1175.pl | 2 +- tests/test1222.pl | 4 +- tests/test1477.pl | 4 +- tests/test1486.pl | 2 +- tests/test1488.pl | 4 +- tests/test745.pl | 2 +- tests/test971.pl | 4 +- tests/testcurl.pl | 42 +++---- tests/testutil.pm | 2 +- tests/unit/README.md | 4 +- tests/unit/unit1300.c | 2 +- tests/unit/unit1303.c | 2 +- tests/unit/unit1307.c | 4 +- tests/unit/unit1605.c | 4 +- tests/unit/unit1607.c | 2 +- tests/unit/unit1609.c | 2 +- tests/unit/unit1652.c | 2 +- tests/unit/unit1653.c | 2 +- tests/unit/unit1654.c | 4 +- tests/unit/unit1655.c | 2 +- tests/unit/unit1658.c | 2 +- tests/util.py | 6 +- 247 files changed, 594 insertions(+), 595 deletions(-) diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index d24d97faac6a..ca86745ebf80 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -75,5 +75,5 @@ file names\b:filenames ---WWW::Curl ---NET::Curl ---Curl Corporation -\bmanpages[^./&:-]:man pages -\bmanpage[^si./&:-]:man page +\bmanpages[^./;=&{:-]:man pages +\bmanpage[^si./;=&{:-]:man page diff --git a/tests/Makefile.am b/tests/Makefile.am index 12fdc29cdaec..677a17cd99fe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -84,7 +84,7 @@ EXTRA_DIST = \ valgrind.supp \ $(TESTSCRIPTS) -# we have two variables here to make sure DIST_SUBDIRS won't get 'unit' +# we have two variables here to make sure DIST_SUBDIRS does not get 'unit' # added twice as then targets such as 'distclean' misbehave and try to # do things twice in that subdir at times (and thus fails). if BUILD_UNITTESTS @@ -108,7 +108,7 @@ curl: TEST_COMMON = if CROSSCOMPILING -TEST = @echo "NOTICE: we can't run the tests when cross-compiling!" +TEST = @echo "NOTICE: we cannot run the tests when cross-compiling!" PYTEST = $(TEST) else # if not cross-compiling: @@ -124,8 +124,8 @@ TEST_F = -a -w -p -r TEST_T = -a -w -t -j20 TEST_E = -a -w -e -# ~ means that it will run all tests matching the keyword, but will -# ignore their results (since these ones are likely to fail for no good reason) +# ~ means that it runs all tests matching the keyword, but ignores +# their results (since these ones are likely to fail for no good reason) TEST_NF = -a -w -p ~flaky ~timing-dependent # special target for CI use diff --git a/tests/allversions.pm b/tests/allversions.pm index 7673a5fccaa6..8ae47fc59988 100644 --- a/tests/allversions.pm +++ b/tests/allversions.pm @@ -33,7 +33,7 @@ our %pastversion; sub allversions { my ($file) = @_; open(A, "<$file") || - die "can't open the versions file $file\n"; + die "cannot open the versions file $file\n"; my $before = 1; my $relcount; while() { diff --git a/tests/certs/genserv.pl b/tests/certs/genserv.pl index 42aba5370e33..2e61ecece6e6 100755 --- a/tests/certs/genserv.pl +++ b/tests/certs/genserv.pl @@ -55,7 +55,7 @@ sub opensslfail { } elsif(! -f "$CAPREFIX-ca.cacert" || ! -f "$CAPREFIX-ca.key") { - if($OPENSSL eq basename($OPENSSL)) { # has no dir component + if($OPENSSL eq basename($OPENSSL)) { # has no directory component # find openssl in PATH my $found = 0; foreach(File::Spec->path()) { diff --git a/tests/certs/test-ca.prm b/tests/certs/test-ca.prm index 5b9180298115..c86c4e40ccff 100644 --- a/tests/certs/test-ca.prm +++ b/tests/certs/test-ca.prm @@ -27,6 +27,6 @@ string_mask = utf8only countryName = "Country Name" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = Northern Nowhere Trust Anchor diff --git a/tests/certs/test-client-cert.prm b/tests/certs/test-client-cert.prm index e78225c6742e..99962e21c18a 100644 --- a/tests/certs/test-client-cert.prm +++ b/tests/certs/test-client-cert.prm @@ -29,6 +29,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost diff --git a/tests/certs/test-client-eku-only.prm b/tests/certs/test-client-eku-only.prm index c4e61eec46f8..2ada8f9e7e09 100644 --- a/tests/certs/test-client-eku-only.prm +++ b/tests/certs/test-client-eku-only.prm @@ -29,6 +29,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost diff --git a/tests/certs/test-localhost-san-first.prm b/tests/certs/test-localhost-san-first.prm index 40ac46044506..d354eda81914 100644 --- a/tests/certs/test-localhost-san-first.prm +++ b/tests/certs/test-localhost-san-first.prm @@ -29,6 +29,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost.nn diff --git a/tests/certs/test-localhost-san-last.prm b/tests/certs/test-localhost-san-last.prm index 2de9dd8bab78..e8c87a19b09b 100644 --- a/tests/certs/test-localhost-san-last.prm +++ b/tests/certs/test-localhost-san-last.prm @@ -29,6 +29,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost.nn diff --git a/tests/certs/test-localhost.nn.prm b/tests/certs/test-localhost.nn.prm index 16411614caa6..aa3f3650bdc6 100644 --- a/tests/certs/test-localhost.nn.prm +++ b/tests/certs/test-localhost.nn.prm @@ -29,6 +29,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost.nn diff --git a/tests/certs/test-localhost.prm b/tests/certs/test-localhost.prm index ca7eced96d72..1d574a6b6cc9 100644 --- a/tests/certs/test-localhost.prm +++ b/tests/certs/test-localhost.prm @@ -29,6 +29,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost diff --git a/tests/certs/test-localhost0h.prm b/tests/certs/test-localhost0h.prm index 03bd2f12cf9d..2b6b05937715 100644 --- a/tests/certs/test-localhost0h.prm +++ b/tests/certs/test-localhost0h.prm @@ -30,6 +30,6 @@ string_mask = utf8only countryName = "Country Name is Northern Nowhere" countryName_value = NN organizationName = "Organization Name" -organizationName_value = Edel Curl Arctic Illudium Research Cloud +organizationName_value = Edel curl Arctic Illudium Research Cloud commonName = "Common Name" commonName_value = localhost diff --git a/tests/data/test1034 b/tests/data/test1034 index b99368fb9fa0..f503d97700fc 100644 --- a/tests/data/test1034 +++ b/tests/data/test1034 @@ -29,10 +29,10 @@ codeset-utf8 LC_ALL=C.UTF-8 -HTTP over proxy with malformatted IDN host name +HTTP over proxy with malformatted IDN hostname -# This host name contains an invalid UTF-8 byte sequence that can't be +# This hostname contains an invalid UTF-8 byte sequence that cannot be # converted into an IDN name url = "http://invalid-utf8-%hex[%e2%90]hex%.local/page/%TESTNUMBER" diff --git a/tests/data/test1035 b/tests/data/test1035 index 50a762d72695..b36872fd3ec1 100644 --- a/tests/data/test1035 +++ b/tests/data/test1035 @@ -27,7 +27,7 @@ codeset-utf8 LC_ALL=C.UTF-8 -HTTP over proxy with too long IDN host name +HTTP over proxy with too long IDN hostname http://too-long-IDN-name-c%hex[%c3%bc]hex%rl-r%hex[%c3%bc]hex%le%hex[%c3%9f]hex%-la-la-la-dee-da-flooby-nooby.local/page/%TESTNUMBER -x %HOSTIP:%NOLISTENPORT diff --git a/tests/data/test1038 b/tests/data/test1038 index 294c7b94c16b..f384a1d23611 100644 --- a/tests/data/test1038 +++ b/tests/data/test1038 @@ -26,7 +26,7 @@ FTP PASV upload resume from end of file ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -C - -this is the *****cr@p******** that we're gonna upload +this is the *****cr@p******** that we are gonna upload worx? @@ -45,7 +45,7 @@ APPE %TESTNUMBER QUIT -cr@p******** that we're gonna upload +cr@p******** that we are gonna upload worx? diff --git a/tests/data/test1039 b/tests/data/test1039 index 6637c5721bd5..39709ddb5a34 100644 --- a/tests/data/test1039 +++ b/tests/data/test1039 @@ -26,7 +26,7 @@ FTP PASV upload resume from end of empty file ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -C - -this is the *****cr@p******** that we're gonna upload +this is the *****cr@p******** that we are gonna upload worx? @@ -45,7 +45,7 @@ STOR %TESTNUMBER QUIT -this is the *****cr@p******** that we're gonna upload +this is the *****cr@p******** that we are gonna upload worx? diff --git a/tests/data/test1041 b/tests/data/test1041 index 68ec259d6fbc..ebc62d3006e9 100644 --- a/tests/data/test1041 +++ b/tests/data/test1041 @@ -50,7 +50,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T%LOGDIR/test%TESTNUMBER.txt -C - # Verify data after the test has been "shot" -# curl doesn't do a HEAD request on the remote file so it has no idea whether +# curl does not do a HEAD request on the remote file so it has no idea whether # it can skip part of the file or not. Instead, it sends the entire file. PUT /%TESTNUMBER HTTP/1.1 diff --git a/tests/data/test1059 b/tests/data/test1059 index 688b92850a43..66b6dcf6d191 100644 --- a/tests/data/test1059 +++ b/tests/data/test1059 @@ -42,7 +42,7 @@ ftp://test-number:%TESTNUMBER/wanted/page -p -x %HOSTIP:%HTTPPORT # # Verify data after the test has been "shot" -# The server doesn't implement CONNECT for ftp, so this must be a failure test +# The server does not implement CONNECT for ftp, so this must be a failure test 56 diff --git a/tests/data/test1069 b/tests/data/test1069 index 51569418336a..2976ff1d6d50 100644 --- a/tests/data/test1069 +++ b/tests/data/test1069 @@ -23,7 +23,7 @@ HTTP 1.0 PUT from stdin with no content length http://%HOSTIP:%HTTPPORT/bzz/%TESTNUMBER -T - -0 -this data can't be sent +this data cannot be sent diff --git a/tests/data/test1101 b/tests/data/test1101 index a6471a4a6488..9f2678ec46b6 100644 --- a/tests/data/test1101 +++ b/tests/data/test1101 @@ -28,7 +28,7 @@ boo http -NO_PROXY test, with user name in URL +NO_PROXY test, with username in URL diff --git a/tests/data/test1108 b/tests/data/test1108 index 107ef8d55caa..1318e0a1b9d3 100644 --- a/tests/data/test1108 +++ b/tests/data/test1108 @@ -37,7 +37,7 @@ PASS ftp@example.com PWD PRET RETR %TESTNUMBER -# we expect that the server doesn't understand PRET +# we expect that the server does not understand PRET 84 diff --git a/tests/data/test112 b/tests/data/test112 index 9a73da35a57c..d680d05e90e3 100644 --- a/tests/data/test112 +++ b/tests/data/test112 @@ -20,10 +20,10 @@ ftp FTP PASV upload resume -ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -C 40 +ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -C 41 -this is the *****crap******** that we're gonna upload +this is the *****crap******** that we are gonna upload worx? diff --git a/tests/data/test1173 b/tests/data/test1173 index e49ed9336f0d..bc666872d785 100644 --- a/tests/data/test1173 +++ b/tests/data/test1173 @@ -11,7 +11,7 @@ documentation # Client-side -Manpage syntax checks +Man page syntax checks diff --git a/tests/data/test1185 b/tests/data/test1185 index 5571888aae67..e5efc45e2e06 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -81,7 +81,7 @@ void startfunc(int a, int b) { // CPP comment ? - /* comment doesn't end + /* comment does not end diff --git a/tests/data/test1187 b/tests/data/test1187 index 3cae202eb193..82debafd0404 100644 --- a/tests/data/test1187 +++ b/tests/data/test1187 @@ -21,7 +21,7 @@ Mime smtp -SMTP multipart with file name escaping +SMTP multipart with filename escaping From: different diff --git a/tests/data/test1208 b/tests/data/test1208 index 8acf3c1cd716..4c0e6aafda84 100644 --- a/tests/data/test1208 +++ b/tests/data/test1208 @@ -41,7 +41,7 @@ FTP PORT download, no data conn and no transient negative reply s/^EPRT \|1\|(\S*)/EPRT \|1\|/ -# This test doesn't send a QUIT because the main state machine in multi.c +# This test does not send a QUIT because the main state machine in multi.c # triggers the timeout and sets the CURLE_OPERATION_TIMEDOUT error (28) for # which the FTP disconnect code generically has to assume could mean the # control the connection and thus it cannot send any command. diff --git a/tests/data/test1216 b/tests/data/test1216 index bb8e043b81ad..87718fd8d973 100644 --- a/tests/data/test1216 +++ b/tests/data/test1216 @@ -28,7 +28,7 @@ This server says moo http -HTTP cookie domains tailmatching the host name +HTTP cookie domains tailmatching the hostname http://example.fake/c/%TESTNUMBER http://bexample.fake/c/%TESTNUMBER -b %LOGDIR/injar%TESTNUMBER -x %HOSTIP:%HTTPPORT diff --git a/tests/data/test1218 b/tests/data/test1218 index e66d84e1ebd6..28f4fb06498f 100644 --- a/tests/data/test1218 +++ b/tests/data/test1218 @@ -8,7 +8,7 @@ cookies -# This test is very similar to 1216, only that it sets the cookies from the +# This test is similar to 1216, only that it sets the cookies from the # first site instead of reading from a file diff --git a/tests/data/test1229 b/tests/data/test1229 index 781fa61b7a0b..eddce04f2570 100644 --- a/tests/data/test1229 +++ b/tests/data/test1229 @@ -57,7 +57,7 @@ crypto digest -HTTP with Digest authorization with user name needing escape +HTTP with Digest authorization with username needing escape http://%5cuser%22:password@%HOSTIP:%HTTPPORT/%TESTNUMBER --digest diff --git a/tests/data/test1233 b/tests/data/test1233 index e8b45cd04067..4a0b7023a40d 100644 --- a/tests/data/test1233 +++ b/tests/data/test1233 @@ -9,7 +9,7 @@ connect to non-listen # Server-side -# Assuming there's nothing listening on port 1 +# Assuming there is nothing listening on port 1 REPLY EPSV 229 Entering Passive Mode (|||1|) diff --git a/tests/data/test1237 b/tests/data/test1237 index 2c572ace2743..285e4679296c 100644 --- a/tests/data/test1237 +++ b/tests/data/test1237 @@ -24,7 +24,7 @@ Content-Type: text/html http -URL with 1000+ letter user name + password +URL with 1000+ letter username + password "%repeat[1000 x A]%:%repeat[1002 x B]%@%HOSTIP:%HTTPPORT/%TESTNUMBER" diff --git a/tests/data/test1238 b/tests/data/test1238 index 49b9e65e5711..66d0dde84c2c 100644 --- a/tests/data/test1238 +++ b/tests/data/test1238 @@ -15,7 +15,7 @@ DELAY writedelay: 2000 -# ~1200 bytes (so that they don't fit in two 512 byte chunks) +# ~1200 bytes (so that they do not fit in two 512 byte chunks) 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 diff --git a/tests/data/test1246 b/tests/data/test1246 index e1f11cef5bd9..02054a3199ac 100644 --- a/tests/data/test1246 +++ b/tests/data/test1246 @@ -35,7 +35,7 @@ Connection: close http -URL with '#' at end of host name instead of '/' +URL with '#' at end of hostname instead of '/' --proxy http://%HOSTIP:%HTTPPORT http://test.remote.haxx.se.%TESTNUMBER:%HTTPPORT#@127.0.0.1/tricked.html no-scheme-url.com.%TESTNUMBER:%HTTPPORT#@127.127.127.127/again.html diff --git a/tests/data/test1264 b/tests/data/test1264 index 9eebd58f947c..dbe4152d40dc 100644 --- a/tests/data/test1264 +++ b/tests/data/test1264 @@ -16,7 +16,7 @@ HTTP GET http -HTTP URL with space in host name +HTTP URL with space in hostname -g "http://127.0.0.1 www.example.com/we/want/%TESTNUMBER" diff --git a/tests/data/test1318 b/tests/data/test1318 index 27e0d80c135e..0ccd123eb80e 100644 --- a/tests/data/test1318 +++ b/tests/data/test1318 @@ -33,7 +33,7 @@ Content-Length: 0 http -HTTP with --resolve and same host name using different cases +HTTP with --resolve and same hostname using different cases --resolve MiXeDcAsE.cOm:%HTTPPORT:%HOSTIP http://MiXeDcAsE.cOm:%HTTPPORT/%TESTNUMBER http://mixedcase.com:%HTTPPORT/%TESTNUMBER0001 diff --git a/tests/data/test1411 b/tests/data/test1411 index ae58242f22f0..6eaa65d32889 100644 --- a/tests/data/test1411 +++ b/tests/data/test1411 @@ -31,7 +31,7 @@ Funny-head: yesyes http -# make sure there's no Expect: 100-continue when there's no file to send! +# make sure there is no Expect: 100-continue when there is no file to send! HTTP with zero size file PUT diff --git a/tests/data/test1421 b/tests/data/test1421 index 3cab703b4a68..82a8061a1f3a 100644 --- a/tests/data/test1421 +++ b/tests/data/test1421 @@ -30,7 +30,7 @@ connection-monitor http -Reusing HTTP proxy connection for two different host names +Reusing HTTP proxy connection for two different hostnames --proxy http://%HOSTIP:%HTTPPORT http://test.remote.haxx.se.%TESTNUMBER:8990/ http://different.remote.haxx.se.%TESTNUMBER:8990 diff --git a/tests/data/test1447 b/tests/data/test1447 index 517c22b04d88..f28c25022689 100644 --- a/tests/data/test1447 +++ b/tests/data/test1447 @@ -28,7 +28,7 @@ Provide illegal proxy name # # Verify data after the test has been "shot" -# Couldn't resolve proxy name +# Could not resolve proxy name 5 diff --git a/tests/data/test1448 b/tests/data/test1448 index aed178fc5854..d35d5b5e6f15 100644 --- a/tests/data/test1448 +++ b/tests/data/test1448 @@ -46,7 +46,7 @@ codeset-utf8 LC_ALL=C.UTF-8 -Redirect following to UTF-8 IDN host name +Redirect following to UTF-8 IDN hostname diff --git a/tests/data/test1453 b/tests/data/test1453 index 28f6ed732f0c..bfbe692032f3 100644 --- a/tests/data/test1453 +++ b/tests/data/test1453 @@ -27,7 +27,7 @@ tftp://%HOSTIP:%NOLISTENPORT/%repeat[503 x a]%z # # Verify data after the test has been "shot" -# TFTP file name too long +# TFTP filename too long 71 diff --git a/tests/data/test1456 b/tests/data/test1456 index 6f1b0260d5c7..c80df3b7c62b 100644 --- a/tests/data/test1456 +++ b/tests/data/test1456 @@ -23,7 +23,7 @@ Connection: close Content-Type: text/html Funny-head: yesyes -These data aren't actually sent to the client +These data are not actually sent to the client diff --git a/tests/data/test1468 b/tests/data/test1468 index ec004b368bd4..7cb9b1345629 100644 --- a/tests/data/test1468 +++ b/tests/data/test1468 @@ -40,7 +40,7 @@ http socks5unix -HTTP GET with host name using SOCKS5h via Unix sockets +HTTP GET with hostname using SOCKS5h via Unix sockets http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://localhost%SOCKSUNIXPATH diff --git a/tests/data/test1470 b/tests/data/test1470 index 2a8e0ea2955e..c93af27f7db3 100644 --- a/tests/data/test1470 +++ b/tests/data/test1470 @@ -41,7 +41,7 @@ https socks5unix -HTTPS GET with host name using SOCKS5h via Unix sockets +HTTPS GET with hostname using SOCKS5h via Unix sockets https://this.is.a.host.name:%HTTPSPORT/%TESTNUMBER --insecure --proxy socks5h://localhost%SOCKSUNIXPATH diff --git a/tests/data/test1471 b/tests/data/test1471 index 27343fd2fce5..b07af3a9aec3 100644 --- a/tests/data/test1471 +++ b/tests/data/test1471 @@ -28,7 +28,7 @@ red.onion # # Verify data after the test has been "shot" -# Couldn't resolve host name +# Could not resolve hostname 6 diff --git a/tests/data/test1472 b/tests/data/test1472 index 2266e3ec9b26..ed15302a04a0 100644 --- a/tests/data/test1472 +++ b/tests/data/test1472 @@ -28,7 +28,7 @@ tasty.onion. # # Verify data after the test has been "shot" -# Couldn't resolve host name +# Could not resolve hostname 6 diff --git a/tests/data/test1491 b/tests/data/test1491 index 84d4e94e0f21..fc856671e46e 100644 --- a/tests/data/test1491 +++ b/tests/data/test1491 @@ -14,7 +14,7 @@ FILE file -file:// don't overwrite self with --skip-existing +file:// do not overwrite self with --skip-existing file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt -o %LOGDIR/test%TESTNUMBER.txt --skip-existing diff --git a/tests/data/test151 b/tests/data/test151 index 727a7e910015..92a513986ef2 100644 --- a/tests/data/test151 +++ b/tests/data/test151 @@ -13,8 +13,8 @@ HTTP/1.0 401 BAD BOY Server: swsclose Content-Type: text/html -This contains a response code >= 400, so curl shouldn't display this. Even -though it's a response code that triggers authentication, we're not using +This contains a response code >= 400, so curl should not display this. Even +though it is a response code that triggers authentication, we are not using authentication so we should still fail. diff --git a/tests/data/test1513 b/tests/data/test1513 index ff8c03f279d5..d4e741c534a6 100644 --- a/tests/data/test1513 +++ b/tests/data/test1513 @@ -29,7 +29,7 @@ lib%TESTNUMBER return failure immediately from progress callback -# this server/host won't be used for real +# this server/host will not be used for real http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test1516 b/tests/data/test1516 index 5c30305bf1fa..226b8d3c9db7 100644 --- a/tests/data/test1516 +++ b/tests/data/test1516 @@ -10,7 +10,7 @@ resolve -# Close the connection after the first request but don't tell the client to do +# Close the connection after the first request but do not tell the client to do # so! When starting the second request it'll detect a dead connection and must # not clean the DNS entries added manually. diff --git a/tests/data/test152 b/tests/data/test152 index 2f4ee6938d45..0a9a12d334c8 100644 --- a/tests/data/test152 +++ b/tests/data/test152 @@ -14,8 +14,8 @@ HTTP/1.0 401 BAD BOY Server: swsclose Content-Type: text/html -This contains a response code >= 400, so curl shouldn't display this. Even -though it's a response code that triggers authentication, we're not using +This contains a response code >= 400, so curl should not display this. Even +though it is a response code that triggers authentication, we are not using authentication so we should still fail. diff --git a/tests/data/test1553 b/tests/data/test1553 index 5b4f11e55496..7deea6869b64 100644 --- a/tests/data/test1553 +++ b/tests/data/test1553 @@ -42,7 +42,7 @@ IMAP cleanup before a connection was created lib%TESTNUMBER -# this MUST use a host name that doesn't resolve +# this MUST use a hostname that does not resolve imap://non-existing-host.haxx.se:%IMAPPORT/%TESTNUMBER diff --git a/tests/data/test1555 b/tests/data/test1555 index 75e1e5c258bc..5332aca6eb49 100644 --- a/tests/data/test1555 +++ b/tests/data/test1555 @@ -29,7 +29,7 @@ lib%TESTNUMBER verify api is protected against calls from callbacks -# this server/host won't be used for real +# this server/host will not be used for real http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test1557 b/tests/data/test1557 index 0c308f03355f..0e0a3515a398 100644 --- a/tests/data/test1557 +++ b/tests/data/test1557 @@ -15,7 +15,7 @@ lib%TESTNUMBER -Remove easy handle in pending connections doesn't leave dangling entry +Remove easy handle in pending connections does not leave dangling entry hostname.invalid diff --git a/tests/data/test1561 b/tests/data/test1561 index 5af47edce0b2..df9477dd47bd 100644 --- a/tests/data/test1561 +++ b/tests/data/test1561 @@ -69,7 +69,7 @@ https https -Cookies set over HTTP can't override secure ones +Cookies set over HTTP cannot override secure ones --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER0001 -L -c %LOGDIR/jar%TESTNUMBER.txt -H "Host: www.example.com" http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 -L -c %LOGDIR/jar%TESTNUMBER.txt -H "Host: www.example.com" diff --git a/tests/data/test1590 b/tests/data/test1590 index 8d459601be8a..309ec3801a3a 100644 --- a/tests/data/test1590 +++ b/tests/data/test1590 @@ -42,7 +42,7 @@ IMAP cleanup before a connection was created lib1553 -# it is important this uses a host name that resolves successfully +# it is important this uses a hostname that resolves successfully imap://localhost:%IMAPPORT/%TESTNUMBER diff --git a/tests/data/test1592 b/tests/data/test1592 index aacdb9eadb61..9a3aa800c360 100644 --- a/tests/data/test1592 +++ b/tests/data/test1592 @@ -16,7 +16,7 @@ timing-dependent lib%TESTNUMBER -HTTP request, remove handle while resolving, don't block +HTTP request, remove handle while resolving, do not block diff --git a/tests/data/test161 b/tests/data/test161 index 201fe52bfaaf..7908c41d2a93 100644 --- a/tests/data/test161 +++ b/tests/data/test161 @@ -32,7 +32,7 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" -# This doesn't send QUIT because of known bug: +# This does not send QUIT because of known bug: # "7.8 Premature transfer end but healthy control channel" USER anonymous diff --git a/tests/data/test162 b/tests/data/test162 index 02809e812757..196475ac86ca 100644 --- a/tests/data/test162 +++ b/tests/data/test162 @@ -17,9 +17,9 @@ Proxy-Authenticate: Basic realm="Squid proxy-caching web server" Server: swsclose Content-Type: text/html -Even though it's the response code that triggers authentication, we're -using NTLM and the server isn't, so we should fail. We know the server -isn't because there's no Proxy-Authorization: NTLM header +Even though it is the response code that triggers authentication, we are +using NTLM and the server is not, so we should fail. We know the server +is not because there is no Proxy-Authorization: NTLM header diff --git a/tests/data/test1631 b/tests/data/test1631 index 6e28263b3df9..af6a95bb8b92 100644 --- a/tests/data/test1631 +++ b/tests/data/test1631 @@ -56,7 +56,7 @@ proxy # The second CONNECT will be made to the dynamic port number the FTP server -# opens for us, so we can't compare with a known pre-existing number! +# opens for us, so we cannot compare with a known pre-existing number! s/((https.proxy):(\d+))/$2:12345/ diff --git a/tests/data/test1632 b/tests/data/test1632 index ebf91098d5f8..bfb446fd338d 100644 --- a/tests/data/test1632 +++ b/tests/data/test1632 @@ -65,7 +65,7 @@ proxy # The second and third CONNECT will be made to the dynamic port number the FTP -# server opens for us, so we can't compare with known pre-existing numbers! +# server opens for us, so we cannot compare with known pre-existing numbers! s/((https.proxy):(\d+))/$2:12345/ diff --git a/tests/data/test165 b/tests/data/test165 index 0d1c2ebdd0e5..cd193b5532cf 100644 --- a/tests/data/test165 +++ b/tests/data/test165 @@ -36,7 +36,7 @@ codeset-utf8 LC_ALL=C.UTF-8 -HTTP over proxy with IDN host name +HTTP over proxy with IDN hostname http://www.%hex[%c3%a5%c3%a4%c3%b6]hex%.se/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT http://www.gro%hex[%c3%9f]hex%e.de/page/%TESTNUMBER diff --git a/tests/data/test187 b/tests/data/test187 index c3d1199a2311..2a405281bc33 100644 --- a/tests/data/test187 +++ b/tests/data/test187 @@ -51,7 +51,7 @@ If this is received, the location following worked http -HTTP redirect with bad host name separation and slash in parameters +HTTP redirect with bad hostname separation and slash in parameters http://%HOSTIP:%HTTPPORT?oh=what-weird=test/%TESTNUMBER -L diff --git a/tests/data/test189 b/tests/data/test189 index e8e8044049a5..173293b9c488 100644 --- a/tests/data/test189 +++ b/tests/data/test189 @@ -42,7 +42,7 @@ Content-Length: 15 http -HTTP GET with resume and redirect (to a page that doesn't resume) +HTTP GET with resume and redirect (to a page that does not resume) http://%HOSTIP:%HTTPPORT/%TESTNUMBER -C 50 -L diff --git a/tests/data/test1915 b/tests/data/test1915 index 30432593176e..0c7c770547c3 100644 --- a/tests/data/test1915 +++ b/tests/data/test1915 @@ -32,7 +32,7 @@ http://%HOSTIP:%NOLISTENPORT/not-there/%TESTNUMBER # Verify data after the test has been "shot" -# 7 CURLE_COULDNT_CONNECT (expected since there's nothing listening there) +# 7 CURLE_COULDNT_CONNECT (expected since there is nothing listening there) # 42 CURLE_ABORTED_BY_CALLBACK 42 diff --git a/tests/data/test1917 b/tests/data/test1917 index 622623dc55bd..2d1850d7abe3 100644 --- a/tests/data/test1917 +++ b/tests/data/test1917 @@ -21,7 +21,7 @@ hello # Client-side -# require HTTP too as otherwise CURLOPT_POST doesn't exist +# require HTTP too as otherwise CURLOPT_POST does not exist mqtt http diff --git a/tests/data/test20 b/tests/data/test20 index a84928a2dcb3..072df696e75c 100644 --- a/tests/data/test20 +++ b/tests/data/test20 @@ -17,7 +17,7 @@ non-existing host http -attempt connect to non-existing host name +attempt connect to non-existing hostname --ipv4 non-existing-host.haxx.se. diff --git a/tests/data/test2024 b/tests/data/test2024 index 7838aeb2eb2a..45fe1a8359fa 100644 --- a/tests/data/test2024 +++ b/tests/data/test2024 @@ -11,7 +11,7 @@ HTTP Digest auth +ensure that the order does not matter. --> diff --git a/tests/data/test2025 b/tests/data/test2025 index 2b2c6f33f82e..3bda6455700c 100644 --- a/tests/data/test2025 +++ b/tests/data/test2025 @@ -12,7 +12,7 @@ NTLM +ensure that the order does not matter. --> diff --git a/tests/data/test2026 b/tests/data/test2026 index d576725c4c4c..8db0142a9cbb 100644 --- a/tests/data/test2026 +++ b/tests/data/test2026 @@ -11,7 +11,7 @@ HTTP Digest auth +ensure that the order does not matter. --> diff --git a/tests/data/test2027 b/tests/data/test2027 index bff987e1cc50..24d26eb7608b 100644 --- a/tests/data/test2027 +++ b/tests/data/test2027 @@ -13,7 +13,7 @@ HTTP Digest auth Explanation for the duplicate 400 requests: - libcurl doesn't detect that a given Digest password is wrong already on the + libcurl does not detect that a given Digest password is wrong already on the first 401 response (as the data400 gives). libcurl will instead consider the new response just as a duplicate and it sends another and detects the auth problem on the second 401 response! diff --git a/tests/data/test2028 b/tests/data/test2028 index 7f71f0549c79..0e1dfcd41df7 100644 --- a/tests/data/test2028 +++ b/tests/data/test2028 @@ -12,7 +12,7 @@ NTLM +ensure that the order does not matter. --> diff --git a/tests/data/test2029 b/tests/data/test2029 index 08a955fed7cd..f05695215982 100644 --- a/tests/data/test2029 +++ b/tests/data/test2029 @@ -12,7 +12,7 @@ NTLM +ensure that the order does not matter. --> diff --git a/tests/data/test2030 b/tests/data/test2030 index b02d219201f2..47f01a14ed69 100644 --- a/tests/data/test2030 +++ b/tests/data/test2030 @@ -12,13 +12,13 @@ NTLM +ensure that the order does not matter. --> + !win32 diff --git a/tests/data/test3202 b/tests/data/test3202 index d4ea6a33c317..44414c03aa7f 100644 --- a/tests/data/test3202 +++ b/tests/data/test3202 @@ -23,7 +23,7 @@ Connection: close Content-Type: text/html Funny-head: yesyes -These data aren't actually sent to the client +These data are not actually sent to the client diff --git a/tests/data/test3203 b/tests/data/test3203 index 527e870a491f..0c5507d1dbf0 100644 --- a/tests/data/test3203 +++ b/tests/data/test3203 @@ -16,7 +16,7 @@ file GET a directory using file:// - + !win32 diff --git a/tests/data/test328 b/tests/data/test328 index 602b6efa19ae..92f3133565e0 100644 --- a/tests/data/test328 +++ b/tests/data/test328 @@ -26,7 +26,7 @@ Q- What did 0 say to 8? A- Nice Belt! http -# we're actually more interested in any compression support but this is the +# we are actually more interested in any compression support but this is the # best we can do right now libz diff --git a/tests/data/test331 b/tests/data/test331 index 4b613c5e1356..bbc77a099796 100644 --- a/tests/data/test331 +++ b/tests/data/test331 @@ -37,7 +37,7 @@ Funny-head: yesyes swsclose http -HTTP with cookie using host name 'moo' +HTTP with cookie using hostname 'moo' -x http://%HOSTIP:%HTTPPORT http://moo/we/want/%TESTNUMBER -b none http://moo/we/want/%TESTNUMBER0002 diff --git a/tests/data/test336 b/tests/data/test336 index ddf4266b46b6..66552f8f71eb 100644 --- a/tests/data/test336 +++ b/tests/data/test336 @@ -32,7 +32,7 @@ REPLY SIZE 500 no such command ftp -FTP range download when SIZE doesn't work +FTP range download when SIZE does not work ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --range 3-6 diff --git a/tests/data/test349 b/tests/data/test349 index 07d9d07a0087..42e2882cb923 100644 --- a/tests/data/test349 +++ b/tests/data/test349 @@ -12,7 +12,7 @@ HTTP GET HTTP/1.0 404 BAD BOY swsclose Content-Type: text/html -This silly page doesn't reaaaaaly exist so you should not get it. +This silly page does not reaaaaaly exist so you should not get it. diff --git a/tests/data/test357 b/tests/data/test357 index d0b7b7325f4a..5bed28506922 100644 --- a/tests/data/test357 +++ b/tests/data/test357 @@ -8,7 +8,7 @@ Expect: 100-continue # Server-side -# 417 means the server didn't like the Expect header +# 417 means the server did not like the Expect header HTTP/1.1 417 BAD swsbounce Date: Tue, 09 Nov 2010 14:49:00 GMT diff --git a/tests/data/test361 b/tests/data/test361 index c333a8ce0848..b574b4aa3910 100644 --- a/tests/data/test361 +++ b/tests/data/test361 @@ -12,7 +12,7 @@ HTTP GET HTTP/1.0 404 BAD BOY swsclose Content-Type: text/html -This silly page doesn't reaaaaaly exist so you should not get it. +This silly page does not reaaaaaly exist so you should not get it. diff --git a/tests/data/test367 b/tests/data/test367 index 335d59e6627e..42a7ec2c32e1 100644 --- a/tests/data/test367 +++ b/tests/data/test367 @@ -26,7 +26,7 @@ Connection: close http -Empty user name provided in URL +Empty username provided in URL http://:example@%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test380 b/tests/data/test380 index 6fe29288b641..a418dae4ae3b 100644 --- a/tests/data/test380 +++ b/tests/data/test380 @@ -32,7 +32,7 @@ dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr ftp -pick netrc password based on user name in URL +pick netrc password based on username in URL diff --git a/tests/data/test389 b/tests/data/test389 index 65bf1e9ad964..dcae640ecfa4 100644 --- a/tests/data/test389 +++ b/tests/data/test389 @@ -40,7 +40,7 @@ local-http -4 http://curlmachine.localhost:%HTTPPORT/%TESTNUMBER -# Ensure that we're running on localhost +# Ensure that we are running on localhost # diff --git a/tests/data/test399 b/tests/data/test399 index da4b3f7cf79a..bd73155253a2 100644 --- a/tests/data/test399 +++ b/tests/data/test399 @@ -13,7 +13,7 @@ URL http -65536 bytes long host name in URL +65536 bytes long hostname in URL url = http://%repeat[65536 x a]%/399 diff --git a/tests/data/test410 b/tests/data/test410 index 3eb4eb4c8b07..aab2fd725930 100644 --- a/tests/data/test410 +++ b/tests/data/test410 @@ -29,7 +29,7 @@ SSL https -HTTPS GET with very long request header +HTTPS GET with 49 KB long request header # 14 characters repeated 3500 times makes 49000 bytes diff --git a/tests/data/test412 b/tests/data/test412 index 7a8e83e68524..0f38d17ff6e1 100644 --- a/tests/data/test412 +++ b/tests/data/test412 @@ -34,7 +34,7 @@ Debug http -alt-svc using host name with trailing dot in URL +alt-svc using hostname with trailing dot in URL # make Debug-curl accept Alt-Svc over plain HTTP diff --git a/tests/data/test413 b/tests/data/test413 index e365b1dfea0a..89877f537099 100644 --- a/tests/data/test413 +++ b/tests/data/test413 @@ -34,7 +34,7 @@ Debug http -alt-svc using host name with trailing dot on host from file +alt-svc using hostname with trailing dot on host from file # make Debug-curl accept Alt-Svc over plain HTTP diff --git a/tests/data/test440 b/tests/data/test440 index 161e6e3d9a98..127fb16270ab 100644 --- a/tests/data/test440 +++ b/tests/data/test440 @@ -39,7 +39,7 @@ this.hsts.example "99991001 04:47:41" -HSTS with trailing-dot host name in URL but none in hsts file +HSTS with trailing-dot hostname in URL but none in hsts file -x http://%HOSTIP:%HTTPPORT http://this.hsts.example./%TESTNUMBER --hsts %LOGDIR/input%TESTNUMBER -w '%{url_effective}\n' diff --git a/tests/data/test441 b/tests/data/test441 index 033c5343041b..eba528129122 100644 --- a/tests/data/test441 +++ b/tests/data/test441 @@ -39,7 +39,7 @@ this.hsts.example. "99991001 04:47:41" -HSTS with no t-dot host name in URL but t-dot in file +HSTS with no t-dot hostname in URL but t-dot in file -x http://%HOSTIP:%HTTPPORT http://this.hsts.example/%TESTNUMBER --hsts %LOGDIR/input%TESTNUMBER -w '%{url_effective}\n' diff --git a/tests/data/test458 b/tests/data/test458 index 66027b087e53..c2e0501fedcc 100644 --- a/tests/data/test458 +++ b/tests/data/test458 @@ -36,7 +36,7 @@ FUNVALUE=contents%TESTNUMBER VALUE2=curl -variable expand the file name with --expand-output +variable expand the filename with --expand-output --variable %FUNVALUE diff --git a/tests/data/test506 b/tests/data/test506 index 5b4d16d9bcd8..d7618272dd01 100644 --- a/tests/data/test506 +++ b/tests/data/test506 @@ -55,7 +55,7 @@ run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch http -# don't run this with the threaded-resolver or c-ares since the events might +# do not run this with the threaded-resolver or c-ares since the events might # trigger in a different order! !threaded-resolver diff --git a/tests/data/test507 b/tests/data/test507 index 49d75176085a..aa4ec61ef63c 100644 --- a/tests/data/test507 +++ b/tests/data/test507 @@ -18,7 +18,7 @@ non-existing host http -multi interface get with non-existing host name +multi interface get with non-existing hostname lib%TESTNUMBER diff --git a/tests/data/test517 b/tests/data/test517 index 859e54f3195b..a60a46dfda2e 100644 --- a/tests/data/test517 +++ b/tests/data/test517 @@ -30,9 +30,9 @@ curl_getdate() testing # This test case previously tested an overflow case ("2094 Nov 6 => # 2147483647") for 32-bit time_t, but since some systems have 64-bit time_t and -# handles this (returning 3939840000), and some 64-bit time_t systems don't -# handle this and return -1 for this, it turned very tricky to write a fine -# test case and thus it is now removed until we have a way to write test cases +# handles this (returning 3939840000), and some 64-bit time_t systems do not +# handle this and return -1 for this, it turned tricky to write a fine test +# case and thus it is now removed until we have a way to write test cases # for this kind of things. diff --git a/tests/data/test531 b/tests/data/test531 index e018d7d60cd9..4e22a648404e 100644 --- a/tests/data/test531 +++ b/tests/data/test531 @@ -33,7 +33,7 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER %LOGDIR/upload%TESTNUMBER Moooooooooooo -don't upload this +do not upload this diff --git a/tests/data/test542 b/tests/data/test542 index 8f6bdf89453e..14aeeae9e988 100644 --- a/tests/data/test542 +++ b/tests/data/test542 @@ -41,7 +41,7 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" # -# There's no MTDM in the protocol here since this code doesn't ask for the +# There is no MTDM in the protocol here since this code does not ask for the # time/date of the file diff --git a/tests/data/test543 b/tests/data/test543 index c9a5a21398b5..917e95726021 100644 --- a/tests/data/test543 +++ b/tests/data/test543 @@ -18,7 +18,7 @@ curl_easy_escape # Verify data after the test has been "shot" # -# There's no MTDM in the protocol here since this code doesn't ask for the +# There is no MTDM in the protocol here since this code does not ask for the # time/date of the file diff --git a/tests/data/test554 b/tests/data/test554 index 9336930f920e..1db9fa9b6799 100644 --- a/tests/data/test554 +++ b/tests/data/test554 @@ -107,7 +107,7 @@ Content-Length: 794%CR Content-Type: multipart/form-data; boundary=----------------------------%CR %CR ------------------------------%CR -Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"%CR +Content-Disposition: form-data; name="sendfile alternative"; filename="filename 2 "%CR %CR this is what we post to the silly web server %CR diff --git a/tests/data/test562 b/tests/data/test562 index d7871f18ec28..9c7d01be5276 100644 --- a/tests/data/test562 +++ b/tests/data/test562 @@ -26,7 +26,7 @@ lib%TESTNUMBER FTP a type=A URL and CURLOPT_PORT set -# note that we need quotes around the URL below to make sure the shell doesn't +# note that we need quotes around the URL below to make sure the shell does not # treat the semicolon as a separator! 'ftp://%HOSTIP:23456/%TESTNUMBER;type=A' %FTPPORT @@ -36,7 +36,7 @@ FTP a type=A URL and CURLOPT_PORT set # Verify data after the test has been "shot" # -# There's no MTDM in the protocol here since this code doesn't ask for the +# There is no MTDM in the protocol here since this code does not ask for the # time/date of the file diff --git a/tests/data/test563 b/tests/data/test563 index 12f0368d58d8..30730fd792c0 100644 --- a/tests/data/test563 +++ b/tests/data/test563 @@ -38,7 +38,7 @@ proxy ftp_proxy=http://%HOSTIP:%HTTPPORT/ -# note that we need quotes around the URL below to make sure the shell doesn't +# note that we need quotes around the URL below to make sure the shell does not # treat the semicolon as a separator! "ftp://%HOSTIP:23456/%TESTNUMBER;type=A" %FTPPORT diff --git a/tests/data/test579 b/tests/data/test579 index a4e63b612d62..be3c91099827 100644 --- a/tests/data/test579 +++ b/tests/data/test579 @@ -66,7 +66,7 @@ lib%TESTNUMBER -small chunked HTTP POSTs with digest auth. and progress callback +small chunked HTTP POSTs with digest auth and progress callback http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER diff --git a/tests/data/test583 b/tests/data/test583 index 8f87bcef9d94..46a937631c34 100644 --- a/tests/data/test583 +++ b/tests/data/test583 @@ -25,9 +25,9 @@ SFTP with multi interface, remove handle early # The command here uses 'localhost' just to make sure that curl_multi_perform -# won't reach too far in the first invoke. When using c-ares at least, the -# name resolve will cause it to return rather quickly and thus we could trigger -# the problem we're looking to verify. +# does not reach too far in the first invoke. When using c-ares at least, the +# name resolve causes it to return rather quickly and thus we could trigger +# the problem we are looking to verify. sftp://localhost:%SSHPORT%SFTP_PWD/%LOGDIR/upload%TESTNUMBER.txt %USER: %LOGDIR/server/curl_client_key.pub %LOGDIR/server/curl_client_key diff --git a/tests/data/test588 b/tests/data/test588 index 5c53e0455472..24d05ef747ee 100644 --- a/tests/data/test588 +++ b/tests/data/test588 @@ -1,7 +1,7 @@ # # This test is exactly like 525 but the server rejects the EPRT command. -# Written up to make sure that there's nothing in the multi interface +# Written up to make sure that there is nothing in the multi interface # active connection case that differs between PORT and EPRT use # @@ -32,7 +32,7 @@ ftp lib525 -FTP PORT upload using multi interface, EPRT doesn't work +FTP PORT upload using multi interface, EPRT does not work ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER %LOGDIR/upload%TESTNUMBER diff --git a/tests/data/test643 b/tests/data/test643 index 14bbd4aa3927..b0ecd42cd831 100644 --- a/tests/data/test643 +++ b/tests/data/test643 @@ -106,7 +106,7 @@ Content-Length: 690%CR Content-Type: multipart/form-data; boundary=----------------------------%CR %CR ------------------------------%CR -Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"%CR +Content-Disposition: form-data; name="sendfile alternative"; filename="filename 2 "%CR %CR dummy %CR diff --git a/tests/data/test645 b/tests/data/test645 index 6370a5a478a2..9b59eb8f6960 100644 --- a/tests/data/test645 +++ b/tests/data/test645 @@ -139,7 +139,7 @@ Expect: 100-continue%CR %CR 8a%CR ------------------------------%CR -Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"%CR +Content-Disposition: form-data; name="sendfile alternative"; filename="filename 2 "%CR %CR d%CR 1%CR diff --git a/tests/data/test678 b/tests/data/test678 index 48b65076b0a2..cac12ca071f2 100644 --- a/tests/data/test678 +++ b/tests/data/test678 @@ -39,7 +39,7 @@ lib%TESTNUMBER https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt -# Ensure that we're running on localhost because we're checking the host name +# Ensure that we are running on localhost because we are checking the hostname %LIBTESTS lib%TESTNUMBER check diff --git a/tests/data/test716 b/tests/data/test716 index d6910718b3f0..fb03233eac1b 100644 --- a/tests/data/test716 +++ b/tests/data/test716 @@ -26,7 +26,7 @@ http proxy -SOCKS5 proxy with too long user name +SOCKS5 proxy with too long username # it should never connect to the target server diff --git a/tests/data/test717 b/tests/data/test717 index ca377a4bceba..afd9b6396699 100644 --- a/tests/data/test717 +++ b/tests/data/test717 @@ -43,7 +43,7 @@ http SOCKS5 proxy auth -# target a port that won't work without the SOCKS magic +# target a port that does not work without the SOCKS magic http://%HOSTIP:1/%TESTNUMBER -x socks5://uz3r:p4ssworm@%HOSTIP:%SOCKSPORT diff --git a/tests/data/test721 b/tests/data/test721 index 23878f5b2f59..46ee2674a1fe 100644 --- a/tests/data/test721 +++ b/tests/data/test721 @@ -38,7 +38,7 @@ http socks5 -HTTP GET with host name using SOCKS5h +HTTP GET with hostname using SOCKS5h http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://%HOSTIP:%SOCKSPORT diff --git a/tests/data/test726 b/tests/data/test726 index 54a07de70cf3..048b1ff4cbd3 100644 --- a/tests/data/test726 +++ b/tests/data/test726 @@ -21,7 +21,7 @@ http # -# Set a home that doesn't have a ".ipfs" folder. %PWD should be good. +# Set a home that does not have a ".ipfs" folder. %PWD should be good. # This is to prevent the automatic gateway detection from finding a gateway file in your home folder. HOME=%PWD @@ -34,7 +34,7 @@ ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u # -# Verify with no gateway url and no auto detection +# Verify with no gateway URL and no auto detection 37 diff --git a/tests/data/test729 b/tests/data/test729 index fca56ade55ea..172b06ffe9e9 100644 --- a/tests/data/test729 +++ b/tests/data/test729 @@ -23,7 +23,7 @@ http socks4 -SOCKS4 with very long proxy user name +SOCKS4 with long proxy username http://fake --limit-rate 1 -x socks4a://%repeat[1015 x a]%@%HOSTIP:%SOCKSPORT diff --git a/tests/data/test739 b/tests/data/test739 index 41fa8e1dbe47..41f3599e4d3d 100644 --- a/tests/data/test739 +++ b/tests/data/test739 @@ -20,7 +20,7 @@ ipfs http -IPNS path and query args for gateway and IPFS url (malformed gateway url) +IPNS path and query args for gateway and IPFS URL (malformed gateway URL) --ipfs-gateway "http://%HOSTIP:%HTTPPORT/some/path?biz=baz" "ipns://fancy.tld/a/b?foo=bar&aaa=bbb" diff --git a/tests/data/test742 b/tests/data/test742 index 4cffe4d33dc6..d94d8b0da15c 100644 --- a/tests/data/test742 +++ b/tests/data/test742 @@ -40,10 +40,10 @@ socks5 http -SOCKS5-hostname with max length credentials and max host name length +SOCKS5-hostname with max length credentials and max hostname length -# target a port that won't work without the SOCKS magic +# target a port that does not work without the SOCKS magic http://%repeat[254 x c]%:%HTTPPORT -x socks5h://%repeat[255 x a]%:%repeat[255 x b]%@%HOSTIP:%SOCKSPORT diff --git a/tests/data/test752 b/tests/data/test752 index 28866bc31288..76f792a003f1 100644 --- a/tests/data/test752 +++ b/tests/data/test752 @@ -48,7 +48,7 @@ Funny-head: yesyes http ---retry and -f on a HTTP 404 response +--retry and -f on an HTTP 404 response http://%HOSTIP:%HTTPPORT/%TESTNUMBER -f --retry 1 diff --git a/tests/data/test775 b/tests/data/test775 index aa016a0955fd..9ca0223ba4c9 100644 --- a/tests/data/test775 +++ b/tests/data/test775 @@ -43,7 +43,7 @@ SSL http -HTTP with NTLM with too long user name +HTTP with NTLM with too long username http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser%repeat[1100 x A]%:testpass --ntlm diff --git a/tests/data/test804 b/tests/data/test804 index 9df5decafee8..9912f018a410 100644 --- a/tests/data/test804 +++ b/tests/data/test804 @@ -25,7 +25,7 @@ body imap -IMAP doesn't perform SELECT if reusing the same mailbox +IMAP does not perform SELECT if reusing the same mailbox 'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=123/;SECTION=1' 'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=456/;SECTION=2.3' -u user:secret diff --git a/tests/data/test841 b/tests/data/test841 index 321512431c59..18bf7ae8593b 100644 --- a/tests/data/test841 +++ b/tests/data/test841 @@ -35,7 +35,7 @@ body imap -IMAP custom request doesn't check continuation data +IMAP custom request does not check continuation data imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/ -u user:secret -X 'FETCH 123 BODY[1]' diff --git a/tests/data/test842 b/tests/data/test842 index cc0dcd9c0017..63c4a9d3932b 100644 --- a/tests/data/test842 +++ b/tests/data/test842 @@ -40,7 +40,7 @@ IMAP OAuth 2.0 (OAUTHBEARER) authentication 'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM -# The protocol section doesn't support ways of specifying the raw data in the +# The protocol section does not support ways of specifying the raw data in the # base64 encoded message so we must assert this diff --git a/tests/data/test87 b/tests/data/test87 index b22578f82f2a..c1909df9728d 100644 --- a/tests/data/test87 +++ b/tests/data/test87 @@ -46,8 +46,7 @@ urlglob with out of range -o #[num] usage # # Verify data after the test has been "shot". Note that the command line -# will write both responses into the same file name so only the second -# survives +# writes both responses into the same filename so only the second survives # diff --git a/tests/devtest.pl b/tests/devtest.pl index 30124a9f91d8..a2a9cde87543 100755 --- a/tests/devtest.pl +++ b/tests/devtest.pl @@ -24,13 +24,13 @@ ########################################################################### # This script is intended for developers to test some internals of the -# runtests.pl harness. Don't try to use this unless you know what you're +# runtests.pl harness. Do not try to use this unless you know what you are # doing! # An example command-line that starts a test http server for test 11 and waits # for the user before stopping it: # ./devtest.pl --verbose serverfortest https echo "Started https" protoport https preprocess 11 pause echo Stopping stopservers echo Done -# curl can connect to the server while it's running like this: +# curl can connect to the server while it is running like this: # curl -vkL https://localhost:/11 use strict; @@ -94,7 +94,7 @@ sub parseprotocols { # Generate a "proto-ipv6" version of each protocol to match the # IPv6 name and a "proto-unix" to match the variant which - # uses Unix domain sockets. This works even if support isn't + # uses Unix domain sockets. This works even if support is not # compiled in because the test will fail. push @protocols, map(("$_-ipv6", "$_-unix"), @protocols); diff --git a/tests/dictserver.py b/tests/dictserver.py index ad65e55957b0..3ecb86785d8d 100755 --- a/tests/dictserver.py +++ b/tests/dictserver.py @@ -115,9 +115,9 @@ def get_options(): parser.add_argument("--verbose", action="store", type=int, default=0, help="verbose output") parser.add_argument("--pidfile", action="store", - help="file name for the PID") + help="filename for the PID") parser.add_argument("--logfile", action="store", - help="file name for the log") + help="filename for the log") parser.add_argument("--srcdir", action="store", help="test directory") parser.add_argument("--id", action="store", help="server ID") parser.add_argument("--ipv4", action="store_true", default=0, diff --git a/tests/ech_tests.sh b/tests/ech_tests.sh index f55a0f12ec5d..3944793b702b 100755 --- a/tests/ech_tests.sh +++ b/tests/ech_tests.sh @@ -25,7 +25,7 @@ # # Run some tests against servers we know to support ECH (CF, defo.ie, etc.). -# as well as some we know don't do ECH but have an HTTPS RR, and finally some +# as well as some we know do not do ECH but have an HTTPS RR, and finally some # for which neither is the case. # TODO: Translate this into something that approximates a valid curl test:-) @@ -36,9 +36,9 @@ # set -x -# Exit with an error if there's an active ech stanza in ~/.curlrc -# as that'd likely skew some results (e.g. turning a fail into a -# success or vice versa) +# Exit with an error if there is an active ech stanza in ~/.curlrc +# as that would likely skew some results (e.g. turning a fail into +# a success or vice versa) : "${CURL_CFG_FILE=$HOME/.curlrc}" active_ech=$(grep ech "$CURL_CFG_FILE" | grep -v "#.*ech") if [[ "$active_ech" != "" ]]; then @@ -88,7 +88,7 @@ declare -A neither_targets=( # Variables that can be over-ridden from environment # -# Top of curl test tree, assume we're there +# Top of curl test tree, assume we are there : "${CTOP:=.}" # Place to put test log output @@ -214,7 +214,7 @@ if [ ! -d "$LTOP" ]; then mkdir -p "$LTOP" fi if [ ! -d "$LTOP" ]; then - echo "Can't see $LTOP for logs - exiting" + echo "Cannot see $LTOP for logs - exiting" exit 1 fi logfile=$LTOP/${BINNAME}_$NOW.log @@ -223,7 +223,7 @@ echo "-----" > "$logfile" echo "Running $0 at $NOW" >> "$logfile" echo "Running $0 at $NOW" -# check we have the binaries needed and which TLS library we'll be using +# check we have the binaries needed and which TLS library we will be using if [ -f "$OSSL"/libssl.so ]; then have_ossl="yes" fi @@ -254,8 +254,8 @@ wolf_cnt=$($CURL "${CURL_PARAMS[@]}" -V 2> /dev/null | grep -c wolfSSL) if ((wolf_cnt == 1)); then using_wolf="yes" # for some reason curl+wolfSSL dislikes certs that are ok - # for browsers, so we'll test using "insecure" mode (-k) - # but that's ok here as we're only interested in ECH testing + # for browsers, so we will test using "insecure" mode (-k) + # but that is ok here as we are only interested in ECH testing CURL_PARAMS+=(-k) fi # check if we have dig and it knows https or not @@ -274,7 +274,7 @@ digout=$($digcmd https defo.ie) if [[ $digout != "1 . "* ]]; then digout=$($digcmd -t TYPE65 defo.ie) if [[ $digout == "1 . "* ]]; then - # we're good + # we are good have_presout="yes" fi else @@ -282,7 +282,7 @@ else fi # Check if ports other than 443 are blocked from this -# vantage point (I run tests in a n/w where that's +# vantage point (I run tests in a n/w where that is # sadly true sometimes;-) # echo "Checking if ports other than 443 are maybe blocked" not443testurl="https://draft-13.esni.defo.ie:9413/" @@ -317,7 +317,7 @@ echo "dig command: |$digcmd|" echo "ports != 443 blocked: $have_portsblocked" if [[ "$have_curl" == "no" ]]; then - echo "Can't proceed without curl - exiting" + echo "Cannot proceed without curl - exiting" exit 32 fi @@ -379,7 +379,7 @@ if [[ "$using_ossl" == "yes" ]]; then continue fi if [[ "$host" == "cloudflare-ech.com" ]]; then - echo "Skipping $host as they've blocked PN override" + echo "Skipping $host as they have blocked PN override" continue fi path=${ech_targets[$targ]} @@ -472,9 +472,9 @@ for targ in "${!neither_targets[@]}"; do echo "" >> "$logfile" done -# Check various command line options, if we're good so far +# Check various command line options, if we are good so far if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]]; then - # use this test URL as it'll tell us if things worked + # use this test URL as it will tell us if things worked turl="https://defo.ie/ech-check.php" echo "cli_test with $turl" echo "cli_test with $turl" >> "$logfile" @@ -490,8 +490,8 @@ fi fi # skip -# Check combinations of command line options, if we're good so far -# Most of this only works for OpenSSL, which is ok, as we're checking +# Check combinations of command line options, if we are good so far +# Most of this only works for OpenSSL, which is ok, as we are checking # the argument handling here, not the ECH protocol if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]]; then # ech can be hard, true, grease or false @@ -786,11 +786,11 @@ if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]]; then cli_test "$turl" 1 1 --ech true --ech pn:"$goodpn" [ "$allgood" != "yes" ] && echo "$LINENO" - # a target URL that doesn't support ECH + # a target URL that does not support ECH turl="https://tcd.ie" echo "cli_test with $turl" echo "cli_test with $turl" >> "$logfile" - # the params below don't matter much here as we'll fail anyway + # the params below do not matter much here as we will fail anyway echconfiglist=$(get_ech_configlist defo.ie) goodecl=$echconfiglist badecl="$goodecl" @@ -1083,13 +1083,13 @@ else echo "NOT all good, log in $logfile" fi -# send a mail to root (will be fwd'd) but just once every 24 hours +# send a mail to root (will be forwarded) but just once every 24 hours # 'cause we only really need "new" news itsnews="yes" age_of_news=0 if [ -f "$LTOP"/bad_runs ]; then age_of_news=$(fileage "$LTOP"/bad_runs) - # only consider news "new" if we haven't mailed today + # only consider news "new" if we have not mailed today if ((age_of_news < 24*3600)); then itsnews="no" fi diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index cd725fccfdb9..10ac7c7c143a 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -32,7 +32,7 @@ # protocols simultaneously. # # It is meant to exercise curl, it is not meant to be a fully working -# or even very standard compliant server. +# or even overly standard compliant server. # # You may optionally specify port on the command line, otherwise it'll # default to port 8921. @@ -104,11 +104,11 @@ BEGIN my $listenaddr = '127.0.0.1'; # default address for listener port #********************************************************************** -# global vars used for file names +# global vars used for filenames # -my $PORTFILE="ftpserver.port"; # server port file name +my $PORTFILE="ftpserver.port"; # server port filename my $portfile; # server port file path -my $pidfile; # server pid file name +my $pidfile; # server pid filename my $mainsockf_pidfile; # pid file for primary connection sockfilt process my $mainsockf_logfile; # log file for primary connection sockfilt process my $datasockf_pidfile; # pid file for secondary connection sockfilt process @@ -147,15 +147,15 @@ BEGIN # my $ctrldelay; # set if server should throttle ctrl stream my $datadelay; # set if server should throttle data stream -my $retrweirdo; # set if ftp server should use RETRWEIRDO -my $retrnosize; # set if ftp server should use RETRNOSIZE -my $retrsize; # set if ftp server should use RETRSIZE -my $pasvbadip; # set if ftp server should use PASVBADIP -my $nosave; # set if ftp server should not save uploaded data -my $nodataconn; # set if ftp srvr doesn't establish or accepts data channel -my $nodataconn425; # set if ftp srvr doesn't establish data ch and replies 425 -my $nodataconn421; # set if ftp srvr doesn't establish data ch and replies 421 -my $nodataconn150; # set if ftp srvr doesn't establish data ch and replies 150 +my $retrweirdo; # set if FTP server should use RETRWEIRDO +my $retrnosize; # set if FTP server should use RETRNOSIZE +my $retrsize; # set if FTP server should use RETRSIZE +my $pasvbadip; # set if FTP server should use PASVBADIP +my $nosave; # set if FTP server should not save uploaded data +my $nodataconn; # set if FTP srvr does not establish or accepts data channel +my $nodataconn425; # set if FTP srvr does not establish data ch and replies 425 +my $nodataconn421; # set if FTP srvr does not establish data ch and replies 421 +my $nodataconn150; # set if FTP srvr does not establish data ch and replies 150 my $storeresp; my $postfetch; my @capabilities; # set if server supports capability commands @@ -166,7 +166,7 @@ BEGIN my %delayreply; # #********************************************************************** -# global variables for to test ftp wildcardmatching or other test that +# global variables for to test FTP wildcardmatching or other test that # need flexible LIST responses.. and corresponding files. # $ftptargetdir is keeping the fake "name" of LIST directory. # @@ -174,7 +174,7 @@ BEGIN my $ftptargetdir=""; #********************************************************************** -# global variables used when running a ftp server to keep state info +# global variables used when running an FTP server to keep state info # relative to the secondary or data sockfilt process. Values of these # variables should only be modified using datasockf_state() sub, given # that they are closely related and relationship is a bit awkward. @@ -768,7 +768,7 @@ sub EHLO_smtp { my @data; # TODO: Get the IP address of the client connection to use in the - # EHLO response when the client doesn't specify one but for now use + # EHLO response when the client does not specify one but for now use # 127.0.0.1 if(!$client) { $client = "[127.0.0.1]"; @@ -823,7 +823,7 @@ sub HELO_smtp { my ($client) = @_; # TODO: Get the IP address of the client connection to use in the HELO - # response when the client doesn't specify one but for now use 127.0.0.1 + # response when the client does not specify one but for now use 127.0.0.1 if(!$client) { $client = "[127.0.0.1]"; } @@ -864,7 +864,7 @@ sub MAIL_smtp { } } - # this server doesn't "validate" MAIL FROM addresses + # this server does not "validate" MAIL FROM addresses if(length($from)) { my @found; my $valid = 1; @@ -2765,7 +2765,7 @@ sub datasockf_state { } elsif($state eq 'PASSIVE_NODATACONN') { # Data sockfilter bound port without listening, - # client won't be able to establish data connection. + # client will not be able to establish data connection. $datasockf_state = $state; $datasockf_mode = 'passive'; $datasockf_runs = 'yes'; @@ -2930,7 +2930,7 @@ sub customize { @auth_mechs = split(/ /, $1); } elsif($_ =~ /NOSAVE/) { - # don't actually store the file we upload - to be used when + # do not actually store the file we upload - to be used when # uploading insanely huge amounts $nosave = 1; logmsg "FTPD: NOSAVE prevents saving of uploaded data\n"; @@ -3332,7 +3332,7 @@ sub customize { $check = 0; } - # only perform this if we're not faking a reply + # only perform this if we are not faking a reply my $func = $commandfunc{uc($FTPCMD)}; if($func) { &$func($FTPARG, $FTPCMD); diff --git a/tests/getpart.pm b/tests/getpart.pm index 75eb8dfe5d57..c9382ad7f22e 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -47,13 +47,13 @@ BEGIN { use Memoize; my @xml; # test data file contents -my $xmlfile; # test data file name +my $xmlfile; # test data filename my $warning=0; my $trace=0; # Normalize the part function arguments for proper caching. This includes the -# file name in the arguments since that is an implied parameter that affects the +# filename in the arguments since that is an implied parameter that affects the # return value. Any error messages will only be displayed the first time, but # those are disabled by default anyway, so should never been seen outside # development. diff --git a/tests/http/scorecard.py b/tests/http/scorecard.py index 6afb9c74016a..c3ad9bbc4109 100644 --- a/tests/http/scorecard.py +++ b/tests/http/scorecard.py @@ -845,7 +845,7 @@ def print_file(filename): def main(): parser = argparse.ArgumentParser(prog='scorecard', description=""" - Run a range of tests to give a scorecard for a HTTP protocol + Run a range of tests to give a scorecard for an HTTP protocol 'h3' or 'h2' implementation in curl. """) parser.add_argument("-v", "--verbose", action='count', default=1, diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 68c75d4d3eff..9abe497539d2 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -716,7 +716,7 @@ def test_02_36_looong_urls(self, env: Env, httpd, nghttpx, proto, url_junk): if proto == 'h3' and env.curl_uses_lib('quiche'): pytest.skip("quiche fails from 16k onwards") curl = CurlClient(env=env) - # url is longer than 'url_len' + # 'url' is longer than 'url_len' url = f'https://{env.authority_for(env.domain1, proto)}/data.json?{"x"*(url_junk)}' r = curl.http_download(urls=[url], alpn_proto=proto) if url_junk <= 1024: diff --git a/tests/http/test_10_proxy.py b/tests/http/test_10_proxy.py index 13993b2b524f..37797181f8bb 100644 --- a/tests/http/test_10_proxy.py +++ b/tests/http/test_10_proxy.py @@ -265,7 +265,7 @@ def test_10_09_reuse_server(self, env: Env, httpd, nghttpx_fwd, tunnel): @pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug") @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings") def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel): - # url twice via https: proxy separated with '--next', will reuse + # URL twice via https: proxy separated with '--next', will reuse if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'): pytest.skip('only supported with nghttp2') if env.curl_uses_lib('mbedtls') and \ diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index 427ca70fdd83..58ad7fdf1576 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -115,7 +115,7 @@ def test_17_02_sslinfo_reconnect(self, env: Env, tls_max, httpd): else: assert djson['SSL_SESSION_RESUMED'] == exp_resumed, f'{i}: {djson}\n{r.dump_logs()}' - # use host name with trailing dot, verify handshake + # use hostname with trailing dot, verify handshake @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx): curl = CurlClient(env=env) @@ -128,7 +128,7 @@ def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx): # the SNI the server received is without trailing dot assert r.json['SSL_TLS_SNI'] == env.domain1, f'{r.json}' - # use host name with double trailing dot, verify handshake + # use hostname with double trailing dot, verify handshake @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx): curl = CurlClient(env=env) @@ -404,7 +404,7 @@ def test_17_10_h3_session_reuse(self, env: Env, httpd, nghttpx): reused_session = True assert reused_session, f'{r}\n{r.dump_logs()}' - # use host name server has no certificate for + # use hostname server has no certificate for @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx): curl = CurlClient(env=env) @@ -413,7 +413,7 @@ def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx): r = curl.http_get(url=url, alpn_proto=proto) assert r.exit_code == 60, f'{r}' - # use host name server has no cert for with --insecure + # use hostname server has no cert for with --insecure @pytest.mark.parametrize("proto", Env.http_protos()) def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx): curl = CurlClient(env=env) diff --git a/tests/http/testenv/caddy.py b/tests/http/testenv/caddy.py index d7f6a0d7291a..d7386bc28aeb 100644 --- a/tests/http/testenv/caddy.py +++ b/tests/http/testenv/caddy.py @@ -165,10 +165,10 @@ def _mkpath(self, path): def _write_config(self): domain1 = self.env.domain1 creds1 = self.env.get_credentials(domain1) - assert creds1 # convince pytype this isn't None + assert creds1 # convince pytype this is not None domain2 = self.env.domain2 creds2 = self.env.get_credentials(domain2) - assert creds2 # convince pytype this isn't None + assert creds2 # convince pytype this is not None self._mkpath(self._docs_dir) self._mkpath(self._tmp_dir) with open(os.path.join(self._docs_dir, 'data.json'), 'w') as fd: diff --git a/tests/http/testenv/httpd.py b/tests/http/testenv/httpd.py index 740237abc4e6..52578be7d61e 100644 --- a/tests/http/testenv/httpd.py +++ b/tests/http/testenv/httpd.py @@ -100,9 +100,9 @@ def __init__(self, env: Env): raise Exception(f'{env.apxs} failed to query libexecdir: {p}') self._mods_dir = p.stdout.strip() if self._mods_dir is None: - raise Exception('apache modules dir cannot be found') + raise Exception('apache modules directory cannot be found') if not os.path.exists(self._mods_dir): - raise Exception(f'apache modules dir does not exist: {self._mods_dir}') + raise Exception(f'apache modules directory does not exist: {self._mods_dir}') self._maybe_running = False self.ports = {} self._rmf(self._error_log) @@ -260,17 +260,17 @@ def _write_config(self): domain1 = self.env.domain1 domain1brotli = self.env.domain1brotli creds1 = self.env.get_credentials(self._domain1_cred_name) - assert creds1 # convince pytype this isn't None + assert creds1 # convince pytype this is not None self._loaded_domain1_cred_name = self._domain1_cred_name domain2 = self.env.domain2 creds2 = self.env.get_credentials(domain2) - assert creds2 # convince pytype this isn't None + assert creds2 # convince pytype this is not None exp_domain = self.env.expired_domain exp_creds = self.env.get_credentials(exp_domain) - assert exp_creds # convince pytype this isn't None + assert exp_creds # convince pytype this is not None proxy_domain = self.env.proxy_domain proxy_creds = self.env.get_credentials(proxy_domain) - assert proxy_creds # convince pytype this isn't None + assert proxy_creds # convince pytype this is not None self._mkpath(self._conf_dir) self._mkpath(self._docs_dir) self._mkpath(self._logs_dir) diff --git a/tests/http/testenv/mod_curltest/mod_curltest.c b/tests/http/testenv/mod_curltest/mod_curltest.c index 17d0688ace68..cb236557e0a5 100644 --- a/tests/http/testenv/mod_curltest/mod_curltest.c +++ b/tests/http/testenv/mod_curltest/mod_curltest.c @@ -45,10 +45,10 @@ static int curltest_sslinfo_handler(request_rec *r); AP_DECLARE_MODULE(curltest) = { STANDARD20_MODULE_STUFF, - NULL, /* func to create per dir config */ - NULL, /* func to merge per dir config */ - NULL, /* func to create per server config */ - NULL, /* func to merge per server config */ + NULL, /* func to create per-directory config */ + NULL, /* func to merge per-directory config */ + NULL, /* func to create per-server config */ + NULL, /* func to merge per-server config */ NULL, /* command handlers */ curltest_hooks, #ifdef AP_MODULE_FLAG_NONE @@ -398,7 +398,7 @@ static int curltest_tweak_handler(request_rec *r) } } else if(!strcmp("id", arg)) { - /* just an id for repeated requests with curl's url globbing */ + /* just an id for repeated requests with curl's URL globbing */ request_id = val; continue; } @@ -606,7 +606,7 @@ static int curltest_put_handler(request_rec *r) *s = '\0'; val = s + 1; if(!strcmp("id", arg)) { - /* just an id for repeated requests with curl's url globbing */ + /* just an id for repeated requests with curl's URL globbing */ request_id = val; continue; } @@ -804,7 +804,7 @@ static int curltest_sslinfo_handler(request_rec *r) *s = '\0'; val = s + 1; if(!strcmp("id", arg)) { - /* just an id for repeated requests with curl's url globbing */ + /* just an id for repeated requests with curl's URL globbing */ request_id = val; continue; } diff --git a/tests/http/testenv/nghttpx.py b/tests/http/testenv/nghttpx.py index dfb416334c5a..6db888b901be 100644 --- a/tests/http/testenv/nghttpx.py +++ b/tests/http/testenv/nghttpx.py @@ -238,7 +238,7 @@ def start(self, wait_live=True): if self._process: self.stop() creds = self.env.get_credentials(self._cred_name) - assert creds # convince pytype this isn't None + assert creds # convince pytype this is not None self._loaded_cred_name = self._cred_name args = [self._cmd, f'--frontend=*,{self._port};tls'] if self.supports_h3(): @@ -297,7 +297,7 @@ def start(self, wait_live=True): if self._process: self.stop() creds = self.env.get_credentials(self._cred_name) - assert creds # convince pytype this isn't None + assert creds # convince pytype this is not None self._loaded_cred_name = self._cred_name args = [ self._cmd, diff --git a/tests/http/testenv/vsftpd.py b/tests/http/testenv/vsftpd.py index 0819861c62ee..acf86b989e1d 100644 --- a/tests/http/testenv/vsftpd.py +++ b/tests/http/testenv/vsftpd.py @@ -202,7 +202,7 @@ def _write_config(self): ] if self._with_ssl: creds = self.env.get_credentials(self.domain) - assert creds # convince pytype this isn't None + assert creds # convince pytype this is not None conf.extend([ 'ssl_enable=YES', 'debug_ssl=YES', diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index f88a456a20bf..82e8c1b70da7 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -256,7 +256,7 @@ static void usage_hx_download(const char *msg) curl_mfprintf(stderr, "%s\n", msg); curl_mfprintf(stderr, "usage: [options] url\n" - " download a url with following options:\n" + " download a URL with following options:\n" " -a abort paused transfer\n" " -m number max parallel downloads\n" " -e use TLS early data when possible\n" diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index 9ce955bba6c5..f0183f6df2bf 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -208,7 +208,7 @@ static void usage_hx_upload(const char *msg) curl_mfprintf(stderr, "%s\n", msg); curl_mfprintf(stderr, "usage: [options] url\n" - " upload to a url with following options:\n" + " upload to a URL with following options:\n" " -a abort paused transfer\n" " -e use TLS earlydata\n" " -m number max parallel uploads\n" diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 7ab38a9fd852..a8e2e91cf0cc 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -131,7 +131,7 @@ static void memory_tracking_init(void) /* if CURL_MEMDEBUG is set, this starts memory tracking message logging */ env = getenv("CURL_MEMDEBUG"); if(env) { - /* use the value as file name */ + /* use the value as filename */ curl_dbg_memdebug(env); } /* if CURL_MEMLIMIT is set, this enables fail-on-alloc-number-N feature */ diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 555741175422..f5cbc6023783 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -27,9 +27,9 @@ #define CURL_DISABLE_DEPRECATION /* Now include the curl_setup.h file from libcurl's private libdir (the source - version, but that might include "curl_config.h" from the build dir so we - need both of them in the include path), so that we get good in-depth - knowledge about the system we're building this on */ + version, but that might include "curl_config.h" from the build directory so + we need both of them in the include path), so that we get good in-depth + knowledge about the system we are building this on */ #include "curl_setup.h" #include diff --git a/tests/libtest/lib1308.c b/tests/libtest/lib1308.c index 1455b0b0dfe7..b859d4da5fe5 100644 --- a/tests/libtest/lib1308.c +++ b/tests/libtest/lib1308.c @@ -56,7 +56,7 @@ static CURLcode test_lib1308(const char *URL) CURLFORM_COPYCONTENTS, "content", CURLFORM_END); t1308_fail_unless(rc == 0, "curl_formadd returned error"); - /* after the first curl_formadd when there's a single entry, both pointers + /* after the first curl_formadd when there is a single entry, both pointers should point to the same struct */ t1308_fail_unless(post == last, "post and last weren't the same"); diff --git a/tests/libtest/lib1531.c b/tests/libtest/lib1531.c index 6e69c5baee38..65b20c2993b4 100644 --- a/tests/libtest/lib1531.c +++ b/tests/libtest/lib1531.c @@ -50,7 +50,7 @@ static CURLcode test_lib1531(const char *URL) /* add the individual transfer */ curl_multi_add_handle(multi, curl); - /* set the options (I left out a few, you'll get the point anyway) */ + /* set the options (I left out a few, you get the point anyway) */ curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, testDataSize); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, testData); diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 0071bb0f8b8f..db85fe738239 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -399,7 +399,7 @@ static const struct testcase get_parts_list[] ={ CURLU_DEFAULT_SCHEME, 0, CURLUE_BAD_IPV6}, {"http://[ab.be]/x", "", CURLU_DEFAULT_SCHEME, 0, CURLUE_BAD_IPV6}, - /* URL without host name */ + /* URL without hostname */ {"http://a:b@/x", "", CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST}, {"boing:80", @@ -641,7 +641,7 @@ static const struct urltestcase get_url_list[] = { {"mailto:infobot@example.com?body=send%20current-issue", "", 0, 0, CURLUE_UNSUPPORTED_SCHEME}, {"about:80", "https://about:80/", CURLU_DEFAULT_SCHEME, 0, CURLUE_OK}, - /* percent encoded host names */ + /* percent encoded hostnames */ {"http://example.com%40127.0.0.1/", "", 0, 0, CURLUE_BAD_HOSTNAME}, {"http://example.com%21127.0.0.1/", "", 0, 0, CURLUE_BAD_HOSTNAME}, {"http://example.com%3f127.0.0.1/", "", 0, 0, CURLUE_BAD_HOSTNAME}, @@ -996,7 +996,7 @@ static const struct setcase set_parts_list[] = { 0, /* set */ CURLUE_OK, CURLUE_BAD_HOSTNAME}, {"https://example.com/", - "host=0xff,", /* '++' there's no automatic URL decode when setting this + "host=0xff,", /* '++' there is no automatic URL decode when setting this part */ "https://0xff/", 0, /* get */ @@ -1016,7 +1016,7 @@ static const struct setcase set_parts_list[] = { "https://example.com/", 0, CURLU_NON_SUPPORT_SCHEME, CURLUE_OK, CURLUE_BAD_SCHEME}, {"https://example.com/", - /* Set a 41 bytes scheme. That's too long so the old scheme remains set. */ + /* Set a 41 bytes scheme. That is too long so the old scheme remains set. */ "scheme=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc,", "https://example.com/", 0, CURLU_NON_SUPPORT_SCHEME, CURLUE_OK, CURLUE_BAD_SCHEME}, @@ -1069,7 +1069,7 @@ static const struct setcase set_parts_list[] = { "scheme=https,user= @:,host=foobar,", "https://%20%20%20%40%3A@foobar/", 0, CURLU_URLENCODE, CURLUE_OK, CURLUE_OK}, - /* Setting a host name with spaces is not OK: */ + /* Setting a hostname with spaces is not OK: */ {NULL, "scheme=https,host= ,path= ,user= ,password= ,query= ,fragment= ,", "[nothing]", diff --git a/tests/libtest/lib1565.c b/tests/libtest/lib1565.c index 893950b90d23..7e983978e7bf 100644 --- a/tests/libtest/lib1565.c +++ b/tests/libtest/lib1565.c @@ -111,7 +111,7 @@ static CURLcode test_lib1565(const char *URL) if(!result) tid_valid = true; else { - curl_mfprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", + curl_mfprintf(stderr, "%s:%d Could not create thread, errno %d\n", __FILE__, __LINE__, result); goto test_cleanup; } @@ -198,7 +198,7 @@ static CURLcode test_lib1565(const char *URL) return t1565_test_failure; } -#else /* without pthread, this test doesn't work */ +#else /* without pthread, this test does not work */ static CURLcode test_lib1565(const char *URL) { (void)URL; diff --git a/tests/libtest/lib1592.c b/tests/libtest/lib1592.c index 1a36c4a925b2..021a016351a1 100644 --- a/tests/libtest/lib1592.c +++ b/tests/libtest/lib1592.c @@ -29,9 +29,9 @@ * only tests whichever resolver curl is actually built with. */ -/* We're willing to wait a very generous two seconds for the removal. This is +/* We are willing to wait a generous two seconds for the removal. This is as low as we can go while still easily supporting SIGALRM timing for the - non-threaded blocking resolver. It doesn't matter that much because when + non-threaded blocking resolver. It does not matter that much because when the test passes, we never wait this long. We set it much higher via the default TEST_HANG_TIMEOUT to avoid issues when running on overloaded CI machines. */ @@ -66,14 +66,14 @@ static CURLcode test_lib1592(const char *URL) blocks. */ timeout = TEST_HANG_TIMEOUT * 2; else { - /* If we can't set the DNS server, presume that we are configured to use a - resolver that can't be cancelled (i.e. the threaded resolver or the + /* If we cannot set the DNS server, presume that we are configured to use + a resolver that cannot be cancelled (i.e. the threaded resolver or the non-threaded blocking resolver). So, we just test that the curl_multi_remove_handle() call does finish well within our test timeout. - But, it is very unlikely that the resolver request will take any time at - all because we haven't been able to configure the resolver to use an + But, it is unlikely that the resolver request will take any time at + all because we have not been able to configure the resolver to use an non-responsive DNS server. At least we exercise the flow. */ curl_mfprintf(stderr, @@ -83,7 +83,7 @@ static CURLcode test_lib1592(const char *URL) } /* Setting a timeout on the request should ensure that even if we have to - wait for the resolver during curl_multi_remove_handle(), it won't take + wait for the resolver during curl_multi_remove_handle(), it will not take longer than this, because the resolver request inherits its timeout from this. */ easy_setopt(curl, CURLOPT_TIMEOUT_MS, timeout); @@ -108,8 +108,8 @@ static CURLcode test_lib1592(const char *URL) curl_mfprintf(stderr, "curl_multi_remove_handle() succeeded\n"); /* Fail the test if it took too long to remove. This happens after the fact, - and says "it seems that it would have run forever", which isn't true, but - it's close enough, and simple to do. */ + and says "it seems that it would have run forever", which is not true, but + it is close enough, and simple to do. */ abort_on_test_timeout(); test_cleanup: diff --git a/tests/libtest/lib1593.c b/tests/libtest/lib1593.c index 22a07e29209b..5b6e57d4f752 100644 --- a/tests/libtest/lib1593.c +++ b/tests/libtest/lib1593.c @@ -41,7 +41,7 @@ static CURLcode test_lib1593(const char *URL) easy_setopt(curl, CURLOPT_URL, URL); easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); - /* Some TIMEVALUE; it doesn't matter. */ + /* Some TIMEVALUE; it does not matter. */ easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L); header = curl_slist_append(NULL, "If-Modified-Since:"); diff --git a/tests/libtest/lib1906.c b/tests/libtest/lib1906.c index 72486d6227c7..da0f9f56b900 100644 --- a/tests/libtest/lib1906.c +++ b/tests/libtest/lib1906.c @@ -54,7 +54,7 @@ static CURLcode test_lib1906(const char *URL) } res = CURLE_OK; /* reset for next use */ - /* print the used url */ + /* print the used URL */ curl_url_get(curlu, CURLUPART_URL, &url_after, 0); curl_mfprintf(stderr, "curlu now: <%s>\n", url_after); curl_free(url_after); @@ -69,7 +69,7 @@ static CURLcode test_lib1906(const char *URL) "curl_easy_perform returned %d: <%s>, <%s>\n", res, curl_easy_strerror(res), error_buffer); - /* print url */ + /* print URL */ curl_url_get(curlu, CURLUPART_URL, &url_after, 0); curl_mfprintf(stderr, "curlu now: <%s>\n", url_after); diff --git a/tests/libtest/lib1907.c b/tests/libtest/lib1907.c index 2aed89240770..0a3556719b61 100644 --- a/tests/libtest/lib1907.c +++ b/tests/libtest/lib1907.c @@ -43,7 +43,7 @@ static CURLcode test_lib1907(const char *URL) "curl_easy_perform returned %d: <%s>, <%s>\n", res, curl_easy_strerror(res), error_buffer); - /* print the used url */ + /* print the used URL */ if(!curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url_after)) curl_mprintf("Effective URL: %s\n", url_after); diff --git a/tests/libtest/lib1908.c b/tests/libtest/lib1908.c index 1613d03e019e..ac841ca1a18b 100644 --- a/tests/libtest/lib1908.c +++ b/tests/libtest/lib1908.c @@ -53,7 +53,7 @@ static CURLcode test_lib1908(const char *URL) curl_easy_reset(curl); - /* using the same file name for the alt-svc cache, this clobbers the + /* using the same filename for the alt-svc cache, this clobbers the content just written from the 'curldupe' handle */ curl_easy_cleanup(curl); } diff --git a/tests/libtest/lib1918.c b/tests/libtest/lib1918.c index 86fa84c92f5e..de9252107bfb 100644 --- a/tests/libtest/lib1918.c +++ b/tests/libtest/lib1918.c @@ -41,11 +41,11 @@ static CURLcode test_lib1918(const char *URL) curl_easy_option_by_id(o->id); if(ename->id != o->id) { - curl_mprintf("name lookup id %d doesn't match %d\n", + curl_mprintf("name lookup id %d does not match %d\n", ename->id, o->id); } else if(eid->id != o->id) { - curl_mprintf("ID lookup %d doesn't match %d\n", + curl_mprintf("ID lookup %d does not match %d\n", ename->id, o->id); } } diff --git a/tests/libtest/lib1939.c b/tests/libtest/lib1939.c index 5a10db96b138..9985af5adc28 100644 --- a/tests/libtest/lib1939.c +++ b/tests/libtest/lib1939.c @@ -48,7 +48,7 @@ static CURLcode test_lib1939(const char *URL) if(!c) { - /* We're going to drive the transfer using multi interface here, + /* We are going to drive the transfer using multi interface here, because we want to stop during the middle. */ m = curl_multi_add_handle(multi, curl); diff --git a/tests/libtest/lib1940.c b/tests/libtest/lib1940.c index 117afecf2fdc..283128dc31d6 100644 --- a/tests/libtest/lib1940.c +++ b/tests/libtest/lib1940.c @@ -98,7 +98,7 @@ static CURLcode test_lib1940(const char *URL) /* ignores any content */ easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1940_write_cb); - /* if there's a proxy set, use it */ + /* if there is a proxy set, use it */ if(libtest_arg2 && *libtest_arg2) { easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); diff --git a/tests/libtest/lib1945.c b/tests/libtest/lib1945.c index f0a92d6033e2..ee8e69f10016 100644 --- a/tests/libtest/lib1945.c +++ b/tests/libtest/lib1945.c @@ -60,7 +60,7 @@ static CURLcode test_lib1945(const char *URL) /* ignores any content */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, t1945_write_cb); - /* if there's a proxy set, use it */ + /* if there is a proxy set, use it */ if(libtest_arg2 && *libtest_arg2) { curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); diff --git a/tests/libtest/lib2032.c b/tests/libtest/lib2032.c index 81c949ab4488..e0f9990f59f4 100644 --- a/tests/libtest/lib2032.c +++ b/tests/libtest/lib2032.c @@ -123,7 +123,7 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ int maxfd = -99; bool found_new_socket = FALSE; - /* Start a new handle if we aren't at the max */ + /* Start a new handle if we are not at the max */ if(state == ReadyForNewHandle) { easy_init(ntlm_curls[num_handles]); @@ -204,7 +204,7 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ interval.tv_sec = 0; interval.tv_usec = 5000; - /* if there's no timeout and we get here on the last handle, we may + /* if there is no timeout and we get here on the last handle, we may already have read the last part of the stream so waiting makes no sense */ if(!running && num_handles == MAX_EASY_HANDLES) { diff --git a/tests/libtest/lib2405.c b/tests/libtest/lib2405.c index 2945b45b6ca8..4f3c8015c64e 100644 --- a/tests/libtest/lib2405.c +++ b/tests/libtest/lib2405.c @@ -223,7 +223,7 @@ static CURLcode test_run(const char *URL, long option, break; } - /* checking case when we don't have enough space for waitfds */ + /* checking case when we do not have enough space for waitfds */ mc = curl_multi_waitfds(multi, ufds1, fd_count - 1, &fd_count_chk); if(mc != CURLM_OUT_OF_MEMORY) { @@ -236,7 +236,7 @@ static CURLcode test_run(const char *URL, long option, if(fd_count_chk < fd_count) { curl_mfprintf(stderr, "curl_multi_waitfds() should return the amount of fds " - "needed if enough isn't passed in (%u vs. %u).\n", + "needed if enough is not passed in (%u vs. %u).\n", fd_count_chk, fd_count); res = TEST_ERR_FAILURE; break; @@ -264,7 +264,7 @@ static CURLcode test_run(const char *URL, long option, if(fd_count_chk < fd_count) { curl_mfprintf(stderr, "curl_multi_waitfds() should return the amount of fds " - "needed if enough isn't passed in (%u vs. %u).\n", + "needed if enough is not passed in (%u vs. %u).\n", fd_count_chk, fd_count); res = TEST_ERR_FAILURE; break; diff --git a/tests/libtest/lib3026.c b/tests/libtest/lib3026.c index 75d419cb5875..55d933462fda 100644 --- a/tests/libtest/lib3026.c +++ b/tests/libtest/lib3026.c @@ -59,7 +59,7 @@ static CURLcode test_lib3026(const char *URL) results[i] = CURL_LAST; /* initialize with invalid value */ th = CreateThread(NULL, 0, t3026_run_thread, &results[i], 0, NULL); if(!th) { - curl_mfprintf(stderr, "%s:%d Couldn't create thread, " + curl_mfprintf(stderr, "%s:%d Could not create thread, " "GetLastError 0x%08lx\n", __FILE__, __LINE__, GetLastError()); tid_count = i; @@ -120,7 +120,7 @@ static CURLcode test_lib3026(const char *URL) results[i] = CURL_LAST; /* initialize with invalid value */ res = pthread_create(&tids[i], NULL, t3026_run_thread, &results[i]); if(res) { - curl_mfprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", + curl_mfprintf(stderr, "%s:%d Could not create thread, errno %d\n", __FILE__, __LINE__, res); tid_count = i; test_failure = TEST_ERR_MAJOR_BAD; @@ -142,7 +142,7 @@ static CURLcode test_lib3026(const char *URL) return test_failure; } -#else /* without pthread or Windows, this test doesn't work */ +#else /* without pthread or Windows, this test does not work */ static CURLcode test_lib3026(const char *URL) { curl_version_info_data *ver; diff --git a/tests/libtest/lib3102.c b/tests/libtest/lib3102.c index 136ec0a1b73f..9cc87543dc87 100644 --- a/tests/libtest/lib3102.c +++ b/tests/libtest/lib3102.c @@ -106,7 +106,7 @@ static CURLcode test_lib3102(const char *URL) return TEST_ERR_MAJOR_BAD; } - /* Set the HTTPS url to retrieve. */ + /* Set the HTTPS URL to retrieve. */ test_setopt(curl, CURLOPT_URL, URL); /* Capture certificate information */ diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index 88cbdd8a44f4..37cc1e0b3f8c 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -63,7 +63,7 @@ static CURLcode test_lib505(const char *URL) /* get the file size of the local file */ hd = fstat(fileno(hd_src), &file_info); if(hd == -1) { - /* can't open file, bail out */ + /* cannot open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); @@ -132,7 +132,7 @@ static CURLcode test_lib505(const char *URL) test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); - /* Now run off and do what you've been told! */ + /* Now run off and do what you have been told! */ res = curl_easy_perform(curl); test_cleanup: diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index 7971fbeb17d6..928c33b13cc3 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -150,7 +150,7 @@ static void *t506_test_fire(void *ptr) code = curl_easy_perform(curl); if(code) { int i = 0; - curl_mfprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n", + curl_mfprintf(stderr, "perform URL '%s' repeat %d failed, curlcode %d\n", tdata->url, i, code); } diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index a2cb3471bfe2..b8a9ec4a6a84 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -142,7 +142,7 @@ static int t518_test_rlimit(int keep_open) curl_mfprintf(stderr, "raising soft limit up to OPEN_MAX\n"); rl.rlim_cur = OPEN_MAX; if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { - /* on failure don't abort just issue a warning */ + /* on failure do not abort just issue a warning */ t518_store_errmsg("setrlimit() failed", errno); curl_mfprintf(stderr, "%s\n", t518_msgbuff); t518_msgbuff[0] = '\0'; @@ -153,7 +153,7 @@ static int t518_test_rlimit(int keep_open) curl_mfprintf(stderr, "raising soft limit up to hard limit\n"); rl.rlim_cur = rl.rlim_max; if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { - /* on failure don't abort just issue a warning */ + /* on failure do not abort just issue a warning */ t518_store_errmsg("setrlimit() failed", errno); curl_mfprintf(stderr, "%s\n", t518_msgbuff); t518_msgbuff[0] = '\0'; @@ -248,7 +248,7 @@ static int t518_test_rlimit(int keep_open) t518_num_open.rlim_max = NUM_OPEN; - /* verify that we won't overflow size_t in malloc() */ + /* verify that we do not overflow size_t in malloc() */ if((size_t)(t518_num_open.rlim_max) > ((size_t)-1) / sizeof(*t518_testfd)) { tutil_rlim2str(strbuff1, sizeof(strbuff1), t518_num_open.rlim_max); diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c index 292dd59f21bc..4ca7ab7d6545 100644 --- a/tests/libtest/lib525.c +++ b/tests/libtest/lib525.c @@ -54,7 +54,7 @@ static CURLcode test_lib525(const char *URL) /* get the file size of the local file */ hd = fstat(fileno(hd_src), &file_info); if(hd == -1) { - /* can't open file, bail out */ + /* cannot open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index 5558487122c1..e7e86a32ccbb 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -257,7 +257,7 @@ static CURLMcode socket_action(CURLM *multi, curl_socket_t s, int evBitmask, CURLMcode result = curl_multi_socket_action(multi, s, evBitmask, &numhandles); if(result != CURLM_OK) { - curl_mfprintf(stderr, "%s Curl error on %s (%i) %s\n", + curl_mfprintf(stderr, "%s curl error on %s (%i) %s\n", t530_tag(), info, result, curl_multi_strerror(result)); } return result; @@ -365,7 +365,7 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) if(timeout.tv_sec != (time_t)-1 && t530_getMicroSecondTimeout(&timeout) == 0) { - /* Curl's timer has elapsed. */ + /* curl's timer has elapsed. */ if(socket_action(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { res = TEST_ERR_BAD_TIMEOUT; goto test_cleanup; diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index 05d50cba7f38..02d4a89b26a6 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -143,7 +143,7 @@ static int t537_test_rlimit(int keep_open) curl_mfprintf(stderr, "raising soft limit up to OPEN_MAX\n"); rl.rlim_cur = OPEN_MAX; if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { - /* on failure don't abort just issue a warning */ + /* on failure do not abort just issue a warning */ t537_store_errmsg("setrlimit() failed", errno); curl_mfprintf(stderr, "%s\n", t537_msgbuff); t537_msgbuff[0] = '\0'; @@ -154,7 +154,7 @@ static int t537_test_rlimit(int keep_open) curl_mfprintf(stderr, "raising soft limit up to hard limit\n"); rl.rlim_cur = rl.rlim_max; if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { - /* on failure don't abort just issue a warning */ + /* on failure do not abort just issue a warning */ t537_store_errmsg("setrlimit() failed", errno); curl_mfprintf(stderr, "%s\n", t537_msgbuff); t537_msgbuff[0] = '\0'; @@ -182,7 +182,7 @@ static int t537_test_rlimit(int keep_open) * test 537 is all about testing libcurl functionality * when the system has nearly exhausted the number of * available file descriptors. Test 537 will try to run - * with a very small number of file descriptors available. + * with a small number of file descriptors available. * This implies that any file descriptor which is open * when the test runs will have a number in the high range * of whatever the system supports. @@ -243,7 +243,7 @@ static int t537_test_rlimit(int keep_open) t537_num_open.rlim_max = nitems; } - /* verify that we won't overflow size_t in malloc() */ + /* verify that we do not overflow size_t in malloc() */ if((size_t)(t537_num_open.rlim_max) > ((size_t)-1) / sizeof(*t537_testfd)) { tutil_rlim2str(strbuff1, sizeof(strbuff1), t537_num_open.rlim_max); @@ -343,7 +343,7 @@ static int t537_test_rlimit(int keep_open) curl_mfprintf(stderr, "shrinking array for %s file descriptors\n", strbuff); - /* we don't care if we can't shrink it */ + /* we do not care if we cannot shrink it */ tmpfd = realloc(t537_testfd, sizeof(*t537_testfd) * (size_t)(t537_num_open.rlim_max)); diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index 9eb7e407c0f5..55d5adad0742 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -27,7 +27,7 @@ * argv1 = URL * argv2 = proxy * argv3 = proxyuser:password - * argv4 = host name to use for the custom Host: header + * argv4 = hostname to use for the custom Host: header */ #include "first.h" diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c index 8a2b76f8d0b7..ebab472456b5 100644 --- a/tests/libtest/lib541.c +++ b/tests/libtest/lib541.c @@ -54,7 +54,7 @@ static CURLcode test_lib541(const char *URL) /* get the file size of the local file */ hd = fstat(fileno(hd_src), &file_info); if(hd == -1) { - /* can't open file, bail out */ + /* cannot open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); @@ -95,7 +95,7 @@ static CURLcode test_lib541(const char *URL) /* now specify which file to upload */ test_setopt(curl, CURLOPT_READDATA, hd_src); - /* Now run off and do what you've been told! */ + /* Now run off and do what you have been told! */ res = curl_easy_perform(curl); if(res) goto test_cleanup; diff --git a/tests/libtest/lib542.c b/tests/libtest/lib542.c index e6e73131fd62..b29a2733fffd 100644 --- a/tests/libtest/lib542.c +++ b/tests/libtest/lib542.c @@ -59,7 +59,7 @@ static CURLcode test_lib542(const char *URL) /* specify target */ test_setopt(curl, CURLOPT_URL, URL); - /* Now run off and do what you've been told! */ + /* Now run off and do what you have been told! */ res = curl_easy_perform(curl); test_cleanup: diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c index 23cb5a7046ad..230da065a1b4 100644 --- a/tests/libtest/lib554.c +++ b/tests/libtest/lib554.c @@ -90,7 +90,7 @@ static CURLcode t554_test_once(const char *URL, bool oldstyle) CURLFORM_COPYNAME, "sendfile alternative", CURLFORM_STREAM, &pooh, CURLFORM_CONTENTLEN, (curl_off_t)pooh.sizeleft, - CURLFORM_FILENAME, "file name 2", + CURLFORM_FILENAME, "filename 2 ", CURLFORM_END); } diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index ba796f1ceb16..42602eeeeb06 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -1413,7 +1413,7 @@ static int test_float_formatting(void) curl_msnprintf(buf, sizeof(buf), "%.*f", 0, 9.2987654); errors += string_check(buf, "9"); - /* very large precisions easily turn into system specific outputs so we only + /* large precisions easily turn into system specific outputs so we only check the output buffer length here as we know the internal limit */ curl_msnprintf(buf, sizeof(buf), "%.*f", (1 << 30), 9.2987654); diff --git a/tests/libtest/lib562.c b/tests/libtest/lib562.c index e9716e5768a4..3f2c912c9173 100644 --- a/tests/libtest/lib562.c +++ b/tests/libtest/lib562.c @@ -64,7 +64,7 @@ static CURLcode test_lib562(const char *URL) /* specify target */ test_setopt(curl, CURLOPT_URL, URL); - /* Now run off and do what you've been told! */ + /* Now run off and do what you have been told! */ res = curl_easy_perform(curl); test_cleanup: diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index 6e53b7998956..5465ca0c8be8 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -68,7 +68,7 @@ static CURLcode test_lib568(const char *URL) sdp = curlx_open(libtest_arg2, O_RDONLY); if(sdp == -1) { - curl_mfprintf(stderr, "can't open %s\n", libtest_arg2); + curl_mfprintf(stderr, "cannot open %s\n", libtest_arg2); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -77,7 +77,7 @@ static CURLcode test_lib568(const char *URL) sdpf = curlx_fopen(libtest_arg2, "rb"); if(!sdpf) { - curl_mfprintf(stderr, "can't fopen %s\n", libtest_arg2); + curl_mfprintf(stderr, "cannot fopen %s\n", libtest_arg2); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/tests/libtest/lib569.c b/tests/libtest/lib569.c index b1a80a7b0118..1c44153d009f 100644 --- a/tests/libtest/lib569.c +++ b/tests/libtest/lib569.c @@ -40,7 +40,7 @@ static CURLcode test_lib569(const char *URL) FILE *idfile = curlx_fopen(libtest_arg2, "wb"); if(!idfile) { - curl_mfprintf(stderr, "couldn't open the Session ID File\n"); + curl_mfprintf(stderr, "Could not open the Session ID File\n"); return TEST_ERR_MAJOR_BAD; } diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c index 49afc2211d2a..509557f0f50b 100644 --- a/tests/libtest/lib571.c +++ b/tests/libtest/lib571.c @@ -97,7 +97,7 @@ static CURLcode test_lib571(const char *URL) FILE *protofile = curlx_fopen(libtest_arg2, "wb"); if(!protofile) { - curl_mfprintf(stderr, "Couldn't open the protocol dump file\n"); + curl_mfprintf(stderr, "Could not open the protocol dump file\n"); return TEST_ERR_MAJOR_BAD; } diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c index c3951f8d1df6..2865372f5fef 100644 --- a/tests/libtest/lib572.c +++ b/tests/libtest/lib572.c @@ -86,7 +86,7 @@ static CURLcode test_lib572(const char *URL) /* PUT style GET_PARAMETERS */ params = curlx_open(libtest_arg2, O_RDONLY); if(params == -1) { - curl_mfprintf(stderr, "can't open %s\n", libtest_arg2); + curl_mfprintf(stderr, "cannot open %s\n", libtest_arg2); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -95,7 +95,7 @@ static CURLcode test_lib572(const char *URL) paramsf = curlx_fopen(libtest_arg2, "rb"); if(!paramsf) { - curl_mfprintf(stderr, "can't fopen %s\n", libtest_arg2); + curl_mfprintf(stderr, "cannot fopen %s\n", libtest_arg2); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index 29396941cc80..9e626c130002 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -41,7 +41,7 @@ static void progress_final_report(void) if(moo) curlx_fclose(moo); else - curl_mfprintf(stderr, "Progress: end UL, can't open %s\n", libtest_arg2); + curl_mfprintf(stderr, "Progress: end UL, cannot open %s\n", libtest_arg2); started = FALSE; } @@ -65,7 +65,7 @@ static int t579_progress_callback(void *clientp, double dltotal, double dlnow, if(moo) curlx_fclose(moo); else - curl_mfprintf(stderr, "Progress: start UL, can't open %s\n", + curl_mfprintf(stderr, "Progress: start UL, cannot open %s\n", libtest_arg2); started = TRUE; } diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index 9601f29c71bc..4318096e1f79 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -78,7 +78,7 @@ static void t582_addFd(struct t582_Sockets *sockets, curl_socket_t fd, sockets->max_count = 20; } else if(sockets->count >= sockets->max_count) { - /* this can't happen in normal cases */ + /* this cannot happen in normal cases */ curl_mfprintf(stderr, "too many file handles error\n"); exit(2); } @@ -203,7 +203,7 @@ static void notifyCurl(CURLM *multi, curl_socket_t s, int evBitmask, CURLMcode result = curl_multi_socket_action(multi, s, evBitmask, &numhandles); if(result != CURLM_OK) { - curl_mfprintf(stderr, "Curl error on %s (%i) %s\n", + curl_mfprintf(stderr, "curl error on %s (%i) %s\n", info, result, curl_multi_strerror(result)); } } @@ -256,7 +256,7 @@ static CURLcode test_lib582(const char *URL) /* get the file size of the local file */ hd = fstat(fileno(hd_src), &file_info); if(hd == -1) { - /* can't open file, bail out */ + /* cannot open file, bail out */ curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); @@ -334,7 +334,7 @@ static CURLcode test_lib582(const char *URL) if(timeout.tv_sec != (time_t)-1 && t582_getMicroSecondTimeout(&timeout) == 0) { - /* Curl's timer has elapsed. */ + /* curl's timer has elapsed. */ notifyCurl(multi, CURL_SOCKET_TIMEOUT, 0, "timeout"); } diff --git a/tests/libtest/lib586.c b/tests/libtest/lib586.c index 5ee1582a8eb2..dac6751b3587 100644 --- a/tests/libtest/lib586.c +++ b/tests/libtest/lib586.c @@ -119,7 +119,7 @@ static void *t586_test_fire(void *ptr) code = curl_easy_perform(curl); if(code != CURLE_OK) { int i = 0; - curl_mfprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n", + curl_mfprintf(stderr, "perform URL '%s' repeat %d failed, curlcode %d\n", tdata->url, i, code); } diff --git a/tests/libtest/lib643.c b/tests/libtest/lib643.c index a0fef02dda90..d74d7ea9ee03 100644 --- a/tests/libtest/lib643.c +++ b/tests/libtest/lib643.c @@ -114,7 +114,7 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) res = curl_mime_data_cb(part, datasize, t643_read_cb, NULL, NULL, &pooh); if(!res) - res = curl_mime_filename(part, "file name 2"); + res = curl_mime_filename(part, "filename 2 "); } if(res) diff --git a/tests/libtest/lib659.c b/tests/libtest/lib659.c index 44fe7b0c49e1..84c3ecc8cd46 100644 --- a/tests/libtest/lib659.c +++ b/tests/libtest/lib659.c @@ -45,7 +45,7 @@ static CURLcode test_lib659(const char *URL) goto test_cleanup; } - /* this doesn't set the PATH part */ + /* this does not set the PATH part */ if(curl_url_set(urlp, CURLUPART_HOST, "www.example.com", 0) || curl_url_set(urlp, CURLUPART_SCHEME, "http", 0) || curl_url_set(urlp, CURLUPART_PORT, "80", 0)) { diff --git a/tests/libtest/lib694.c b/tests/libtest/lib694.c index eb760fbee2c6..5b477ecebd44 100644 --- a/tests/libtest/lib694.c +++ b/tests/libtest/lib694.c @@ -64,7 +64,7 @@ static CURLcode test_lib694(const char *URL) curl_mprintf("CURLINFO_HTTPAUTH_USED did not say NTLM\n"); } - /* set a new URL for the second, so that we don't restart NTLM */ + /* set a new URL for the second, so that we do not restart NTLM */ test_setopt(curl, CURLOPT_URL, libtest_arg2); } while(!res && ++count < 2); diff --git a/tests/libtest/lib758.c b/tests/libtest/lib758.c index 35e60cc04f50..ab6ce481b779 100644 --- a/tests/libtest/lib758.c +++ b/tests/libtest/lib758.c @@ -303,7 +303,7 @@ static CURLMcode t758_saction(CURLM *multi, curl_socket_t s, CURLMcode result = curl_multi_socket_action(multi, s, evBitmask, &numhandles); if(result != CURLM_OK) { - curl_mfprintf(stderr, "%s Curl error on %s (%i) %s\n", + curl_mfprintf(stderr, "%s curl error on %s (%i) %s\n", t758_tag(), info, result, curl_multi_strerror(result)); } return result; @@ -457,7 +457,7 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, if(timeout.tv_sec != (time_t)-1 && t758_getMicroSecondTimeout(&timeout) == 0) { - /* Curl's timer has elapsed. */ + /* curl's timer has elapsed. */ if(t758_saction(multi, CURL_SOCKET_TIMEOUT, 0, "timeout")) { res = TEST_ERR_BAD_TIMEOUT; goto test_cleanup; diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index 95a600c3d02a..156422eccc42 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -174,7 +174,7 @@ ; if(!$ARGV[0]) { - die "missing target file name"; + die "missing target filename"; } use File::Temp qw/ :mktemp /; diff --git a/tests/libtest/test1013.pl b/tests/libtest/test1013.pl index b97341d0cbc4..98ea64204416 100755 --- a/tests/libtest/test1013.pl +++ b/tests/libtest/test1013.pl @@ -36,7 +36,7 @@ # Read the output of curl --version my $curl_protocols=""; -open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n"; +open(CURL, "$ARGV[1]") || die "Cannot get curl $what list\n"; while() { $curl_protocols = $_ if(/$what:/i); } @@ -48,7 +48,7 @@ # Read the output of curl-config my @curl_config; -open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n"; +open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Cannot get curl-config $what list\n"; while() { chomp; $_ = lc($_) if($what eq "protocols"); # accept uppercase protocols in curl-config diff --git a/tests/libtest/test1022.pl b/tests/libtest/test1022.pl index e1c3cd598eee..7309372d226f 100755 --- a/tests/libtest/test1022.pl +++ b/tests/libtest/test1022.pl @@ -34,7 +34,7 @@ my $what=$ARGV[2]; # Read the output of curl --version -open(CURL, "$ARGV[1]") || die "Can't open curl --version list in $ARGV[1]\n"; +open(CURL, "$ARGV[1]") || die "Cannot open curl --version list in $ARGV[1]\n"; $_ = ; chomp; /libcurl\/([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)/; @@ -44,7 +44,7 @@ my $curlconfigversion; # Read the output of curl-config --version/--vernum -open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config --$what list\n"; +open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Cannot get curl-config --$what list\n"; $_ = ; chomp; my $filever=$_; @@ -65,7 +65,7 @@ $curlconfigversion = "illegal value"; } - # Strip off the -DEV and -rc suffixes from the curl version if they're there + # Strip off the -DEV and -rc suffixes from the curl version if they are there $version =~ s/-\w*$//; } close CURLCONFIG; diff --git a/tests/libtest/test307.pl b/tests/libtest/test307.pl index 5a0a97a3a6e0..bef5ebae14d7 100755 --- a/tests/libtest/test307.pl +++ b/tests/libtest/test307.pl @@ -31,7 +31,7 @@ exit 3; } if(!open(CURL, "$ARGV[0] -s --engine list|")) { - print "Can't get SSL engine list\n"; + print "Cannot get SSL engine list\n"; exit 2; } while() { diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index d45e2e4e960a..88c0e4968256 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -29,7 +29,7 @@ use Time::Local; if($#ARGV < 1) { - print "Usage: $0 prepare|postprocess dir [logfile]\n"; + print "Usage: $0 prepare|postprocess directory [logfile]\n"; exit 1; } diff --git a/tests/libtest/testtrace.c b/tests/libtest/testtrace.c index 092aca8385bf..7c4517378751 100644 --- a/tests/libtest/testtrace.c +++ b/tests/libtest/testtrace.c @@ -69,7 +69,7 @@ void debug_dump(const char *timebuf, const char *text, curl_mfprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ? ptr[i + c] : '.'); - /* check again for 0D0A, to avoid an extra \n if it's at width */ + /* check again for 0D0A, to avoid an extra \n if it is at width */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { i += (c + 3 - width); @@ -105,7 +105,7 @@ int libtest_debug_cb(CURL *curl, curl_infotype type, } secs = epoch_offset + tv.tv_sec; /* !checksrc! disable BANNEDFUNC 1 */ - now = localtime(&secs); /* not thread safe but we don't care */ + now = localtime(&secs); /* not thread safe but we do not care */ curl_msnprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld ", now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec); } diff --git a/tests/libtest/testutil.c b/tests/libtest/testutil.c index 269479c3cea6..b5cfa70369b7 100644 --- a/tests/libtest/testutil.c +++ b/tests/libtest/testutil.c @@ -25,7 +25,7 @@ #include "memdebug.h" -/* build request url */ +/* build request URL */ char *tutil_suburl(const char *base, int i) { return curl_maprintf("%s%.4d", base, i); diff --git a/tests/libtest/testutil.h b/tests/libtest/testutil.h index 7c98e0aadee2..3dcd7e34174b 100644 --- a/tests/libtest/testutil.h +++ b/tests/libtest/testutil.h @@ -25,7 +25,7 @@ ***************************************************************************/ #include "first.h" -/* build request url */ +/* build request URL */ char *tutil_suburl(const char *base, int i); #ifdef HAVE_SYS_RESOURCE_H diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index f0ebd7fbaff0..e35b2e7abadf 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -420,7 +420,7 @@ sub newtotal { $addr = $_; $size = $sizeataddr{$addr}; if($size > 0) { - print "At $addr, there's $size bytes.\n"; + print "At $addr, there is $size bytes.\n"; print " allocated by ".$getmem{$addr}."\n"; } } diff --git a/tests/negtelnetserver.py b/tests/negtelnetserver.py index e043d538e565..61bc1d0359d7 100755 --- a/tests/negtelnetserver.py +++ b/tests/negtelnetserver.py @@ -135,7 +135,7 @@ def recv(self, bytes): """ buffer = bytearray() - # If we keep receiving negotiation sequences, we won't fill the buffer. + # If we keep receiving negotiation sequences, we will not fill the buffer. # Keep looping while we can, and until we have something to give back # to the caller. while len(buffer) == 0: @@ -190,8 +190,8 @@ def start_neg(self, byte_int): log.debug("Client can do") self.state = self.DO elif byte_int == NegTokens.DONT: - # Client is indicating they can't do an option - log.debug("Client can't do") + # Client is indicating they cannot do an option + log.debug("Client cannot do") self.state = self.DONT else: # Received an unexpected byte. Stop negotiations @@ -296,9 +296,9 @@ def get_options(): parser.add_argument("--verbose", action="store", type=int, default=0, help="verbose output") parser.add_argument("--pidfile", action="store", - help="file name for the PID") + help="filename for the PID") parser.add_argument("--logfile", action="store", - help="file name for the log") + help="filename for the log") parser.add_argument("--srcdir", action="store", help="test directory") parser.add_argument("--id", action="store", help="server ID") parser.add_argument("--ipv4", action="store_true", default=0, diff --git a/tests/pathhelp.pm b/tests/pathhelp.pm index 49987f745388..92871617b340 100644 --- a/tests/pathhelp.pm +++ b/tests/pathhelp.pm @@ -36,7 +36,7 @@ # Forward slashes are simpler processed in Perl, do not require extra escaping # for shell (unlike back slashes) and accepted by Windows native programs, so # all functions return paths with only forward slashes. -# All returned paths don't contain any duplicated slashes, only single slashes +# All returned paths do not contain any duplicated slashes, only single slashes # are used as directory separators on output. # On non-Windows platforms functions acts as transparent wrappers for similar # Perl's functions or return unmodified string (depending on functionality), @@ -195,7 +195,7 @@ sub dirsepadd { ####################################################################### # Quote an argument for passing safely to a Bourne shell -# This does the same thing as String::ShellQuote but doesn't need a package. +# This does the same thing as String::ShellQuote but does not need a package. # sub shell_quote { my ($s)=@_; diff --git a/tests/runner.pm b/tests/runner.pm index fe43ed05bacc..6113c1874527 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -190,7 +190,7 @@ sub runner_init { $SIG{INT} = 'IGNORE'; $SIG{TERM} = 'IGNORE'; eval { - # some msys2 perl versions don't define SIGUSR1, also missing from Win32 Perl + # some MSYS2 Perl versions do not define SIGUSR1, also missing from Win32 Perl $SIG{USR1} = 'IGNORE'; }; @@ -214,7 +214,7 @@ sub runner_init { # handle IPC calls event_loop(); - # Can't rely on logmsg here in case it's buffered + # Cannot rely on logmsg here in case it is buffered print "Runner $thisrunnerid exiting\n" if($verbose); # To reach this point, either the controller has sent @@ -234,7 +234,7 @@ sub runner_init { # Create our pid directory mkdir("$LOGDIR/$PIDDIR", 0777); - # Don't create a separate process + # Do not create a separate process $thisrunnerid = "integrated"; } @@ -522,7 +522,7 @@ sub torture { delete $ENV{'CURL_MEMLIMIT'} if($ENV{'CURL_MEMLIMIT'}); if(-r "core") { - # there's core file present now! + # there is core file present now! logmsg " core dumped\n"; $dumped_core = 1; $fail = 2; @@ -542,8 +542,8 @@ sub torture { } } - # verify that it returns a proper error code, doesn't leak memory - # and doesn't core dump + # verify that it returns a proper error code, does not leak memory + # and does not core dump if(($ret & 255) || ($ret >> 8) >= 128) { logmsg " system() returned $ret\n"; $fail=1; @@ -885,7 +885,7 @@ sub singletest_run { chomp $dis[0] if($dis[0]); if($dis[0] eq "test-duphandle") { # marked to not run with duphandle - logmsg " $testnum: IGNORED: Can't run test-duphandle\n"; + logmsg " $testnum: IGNORED: Cannot run test-duphandle\n"; return (-1, 0, 0, "", "", 0); } } @@ -1059,7 +1059,7 @@ sub singletest_clean { if(!$dumped_core) { if(-r "core") { - # there's core file present now! + # there is core file present now! $dumped_core = 1; } } @@ -1144,7 +1144,7 @@ sub singletest_postcheck { logmsg "postcheck $cmd\n" if($verbose); my $rc = runclient("$cmd"); # Must run the postcheck command in torture mode in order - # to clean up, but the result can't be relied upon. + # to clean up, but the result cannot be relied upon. if($rc != 0 && !$torture) { logmsg " $testnum: postcheck FAILED\n"; return -1; @@ -1317,7 +1317,7 @@ sub controlleripccall { # Get the name of the function from the reference my $cv = svref_2object($funcref); my $gv = $cv->GV; - # Prepend the name to the function arguments so it's marshalled along with them + # Prepend the name to the function arguments so it is marshalled along with them unshift @_, $gv->NAME; # Marshall the arguments into a flat string my $margs = freeze \@_; @@ -1368,7 +1368,7 @@ sub runnerar { my $resarrayref = thaw $buf; # First argument is runner ID - # TODO: remove this; it's unneeded since it's passed in + # TODO: remove this; it is unneeded since it is passed in unshift @$resarrayref, $runnerid; return @$resarrayref; } @@ -1376,7 +1376,7 @@ sub runnerar { ################################################################### # Returns runner ID if a response from an async call is ready or error # First value is ready, second is error, however an error case shows up -# as ready in Linux, so you can't trust it. +# as ready in Linux, so you cannot trust it. # argument is 0 for nonblocking, undef for blocking, anything else for timeout # Called by controller sub runnerar_ready { @@ -1402,7 +1402,7 @@ sub runnerar_ready { my $e_in = $r_in; 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's both + # Return an error condition first in case it is both if(vec($e_out, $fd, 1)) { return (undef, $idbyfileno{$fd}); } diff --git a/tests/runtests.pl b/tests/runtests.pl index e1608e0aaa8b..192c92a641b2 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -54,7 +54,7 @@ # to check the remote system's PATH, and the places in the code where # the curl binary is read directly to determine its type also need to be # fixed. As long as the -g option is never given, and the -n is always -# given, this won't be a problem. +# given, this will not be a problem. use strict; use warnings; @@ -233,7 +233,7 @@ sub singletest_logmsg { } ####################################################################### -# Stop buffering log messages, but don't touch them +# Stop buffering log messages, but do not touch them sub singletest_unbufferlogs { undef $singletest_bufferedrunner; } @@ -276,7 +276,7 @@ sub catch_usr1 { } eval { - # some msys2 perl versions don't define SIGUSR1 + # some msys2 perl versions do not define SIGUSR1 $SIG{USR1} = \&catch_usr1; }; $SIG{PIPE} = 'IGNORE'; # these errors are captured in the read/write calls @@ -293,7 +293,7 @@ sub catch_usr1 { delete $ENV{uc($proxy)} if($ENV{uc($proxy)}); } -# make sure we don't get affected by other variables that control our +# make sure we do not get affected by other variables that control our # behavior delete $ENV{'SSL_CERT_DIR'} if($ENV{'SSL_CERT_DIR'}); @@ -331,7 +331,7 @@ sub catch_usr1 { my $disttests = ""; sub get_disttests { # If a non-default $TESTDIR is being used there may not be any - # Makefile.am in which case there's nothing to do. + # Makefile.am in which case there is nothing to do. open(my $dh, "<", "$TESTDIR/Makefile.am") or return; while(<$dh>) { chomp $_; @@ -354,9 +354,9 @@ sub cleardir { # Get all files opendir(my $dh, $dir) || - return 0; # can't open dir + return 0; # cannot open dir while($file = readdir($dh)) { - # Don't clear the $PIDDIR or $LOCKDIR since those need to live beyond + # Do not clear the $PIDDIR or $LOCKDIR since those need to live beyond # one test if(($file !~ /^(\.|\.\.)\z/) && "$file" ne $PIDDIR && "$file" ne $LOCKDIR) { @@ -469,7 +469,7 @@ sub parseprotocols { # Generate a "proto-ipv6" version of each protocol to match the # IPv6 name and a "proto-unix" to match the variant which - # uses Unix domain sockets. This works even if support isn't + # uses Unix domain sockets. This works even if support is not # compiled in because the test will fail. push @protocols, map(("$_-ipv6", "$_-unix"), @protocols); @@ -776,7 +776,7 @@ sub checksystemfeatures { displaylogcontent("$curlverout"); logmsg "contents of $curlvererr: \n"; displaylogcontent("$curlvererr"); - die "couldn't get curl's version"; + die "Could not get curl's version"; } if(-r "../lib/curl_config.h") { @@ -848,12 +848,12 @@ sub checksystemfeatures { if($torture) { if(!$feature{"TrackMemory"}) { - die "can't run torture tests since curl was built without ". + die "cannot run torture tests since curl was built without ". "TrackMemory feature (--enable-curldebug)"; } if($feature{"threaded-resolver"} && !$valgrind) { - die "can't run torture tests since curl was built with the ". - "threaded resolver, and we aren't running with valgrind"; + die "cannot run torture tests since curl was built with the ". + "threaded resolver, and we are not running with valgrind"; } } @@ -970,7 +970,7 @@ sub citest_starttestrun { $AZURE_RUN_ID = azure_create_test_run($ACURL); logmsg "Azure Run ID: $AZURE_RUN_ID\n" if($verbose); } - # Appveyor doesn't require anything here + # Appveyor does not require anything here } @@ -1010,7 +1010,7 @@ sub citest_finishtestrun { if(azure_check_environment() && $AZURE_RUN_ID) { $AZURE_RUN_ID = azure_update_test_run($ACURL, $AZURE_RUN_ID); } - # Appveyor doesn't require anything here + # Appveyor does not require anything here } @@ -1067,7 +1067,7 @@ sub getrunnerlogdir { # Verify that this test case should be run sub singletest_shouldrun { my $testnum = $_[0]; - my $why; # why the test won't be run + my $why; # why the test will not be run my $errorreturncode = 1; # 1 means normal error, 2 means ignored error my @what; # what features are needed @@ -1090,7 +1090,7 @@ sub singletest_shouldrun { if(loadtest("${TESTDIR}/test${testnum}", 1)) { if($verbose) { # this is not a test - logmsg "RUN: $testnum doesn't look like a test case\n"; + logmsg "RUN: $testnum does not look like a test case\n"; } $why = "no test"; } @@ -1214,7 +1214,7 @@ sub singletest_count { my ($testnum, $why) = @_; if($why && !$listonly) { - # there's a problem, count it as "skipped" + # there is a problem, count it as "skipped" $skipped{$why}++; $teststat[$testnum]=$why; # store reason for this test case @@ -1229,7 +1229,7 @@ sub singletest_count { return -1; } - # At this point we've committed to run this test + # At this point we have committed to run this test logmsg sprintf("test %04d...", $testnum) if(!$automakestyle); # name of the test @@ -1403,7 +1403,7 @@ sub singletest_check { # Verify the sent request my @out = loadarray("$logdir/$SERVERIN"); - # check if there's any attributes on the verify/protocol section + # check if there is any attributes on the verify/protocol section my %hash = getpartattr("verify", "protocol"); if($hash{'nonewline'}) { @@ -1573,7 +1573,7 @@ sub singletest_check { my @proxyprot = getpart("verify", "proxy"); if(@proxyprot) { # Verify the sent proxy request - # check if there's any attributes on the verify/protocol section + # check if there is any attributes on the verify/protocol section my %hash = getpartattr("verify", "proxy"); if($hash{'nonewline'}) { @@ -1622,7 +1622,7 @@ sub singletest_check { for my $partsuffix (('', '1', '2', '3', '4')) { my @outfile=getpart("verify", "file".$partsuffix); if(@outfile || partexists("verify", "file".$partsuffix) ) { - # we're supposed to verify a dynamically generated file! + # we are supposed to verify a dynamically generated file! my %hash = getpartattr("verify", "file".$partsuffix); my $filename=$hash{'name'}; @@ -1713,7 +1713,7 @@ sub singletest_check { my @dnsd = getpart("verify", "dns"); if(@dnsd) { - # we're supposed to verify a dynamically generated file! + # we are supposed to verify a dynamically generated file! my %hash = getpartattr("verify", "dns"); my $hostname=$hash{'host'}; @@ -1982,7 +1982,7 @@ sub singletest { ################################################################### # Restore environment variables that were modified in a previous run. # Test definition may instruct to (un)set environment vars. - # This is done this early so that leftover variables don't affect + # This is done this early so that leftover variables do not affect # starting servers or CI registration. # restore_test_env(1); @@ -2350,8 +2350,8 @@ sub pickrunner { # use this path to a curl used to verify servers # Particularly useful when you introduce a crashing bug somewhere in - # the development version as then it won't be able to run any tests - # since it can't verify the servers! + # the development version as then it will not be able to run any tests + # since it cannot verify the servers! $VCURL=shell_quote($ARGV[1]); shift @ARGV; @@ -2381,7 +2381,7 @@ sub pickrunner { # load additional reasons to skip tests shift @ARGV; my $exclude_file = $ARGV[0]; - open(my $fd, "<", $exclude_file) or die "Couldn't open '$exclude_file': $!"; + open(my $fd, "<", $exclude_file) or die "Could not open '$exclude_file': $!"; while(my $line = <$fd>) { next if($line =~ /^#/); chomp $line; @@ -2665,7 +2665,7 @@ sub pickrunner { # since valgrind 2.1.x, '--tool' option is mandatory # use it, if it is supported by the version installed on the system - # (this happened in 2003, so we could probably don't need to care about + # (this happened in 2003, so we could probably do not need to care about # that old version any longer and just delete this check) runclient("valgrind --help 2>&1 | grep -- --tool >$dev_null 2>&1"); if(($? >> 8)) { @@ -2680,7 +2680,7 @@ sub pickrunner { close($curlh); # valgrind 3 renamed the --logfile option to --log-file!!! - # (this happened in 2005, so we could probably don't need to care about + # (this happened in 2005, so we could probably do not need to care about # that old version any longer and just delete this check) my $ver=join(' ', runclientoutput("valgrind --version")); # cut off all but digits and dots @@ -2712,7 +2712,7 @@ sub pickrunner { # clear and create logging directory: # -# TODO: figure how to get around this. This dir is needed for checksystemfeatures() +# TODO: figure how to get around this. This directory is needed for checksystemfeatures() # Maybe create & use & delete a temporary directory in that function cleardir($LOGDIR); mkdir($LOGDIR, 0777); @@ -2815,7 +2815,7 @@ sub disabledtests { if($TESTCASES eq "all") { # Get all commands and find out their test numbers - opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!"; + opendir(DIR, $TESTDIR) || die "cannot opendir $TESTDIR: $!"; my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR); closedir(DIR); @@ -2919,11 +2919,11 @@ sub displaylogs { my ($runnerid, $testnum)=@_; my $logdir = getrunnerlogdir($runnerid); opendir(DIR, "$logdir") || - die "can't open dir: $!"; + die "cannot open dir: $!"; my @logs = readdir(DIR); closedir(DIR); - logmsg "== Contents of files in the $logdir/ dir after test $testnum\n"; + logmsg "== Contents of files in the $logdir/ directory after test $testnum\n"; foreach my $log (sort @logs) { if($log =~ /\.(\.|)$/) { next; # skip "." and ".." @@ -2965,7 +2965,7 @@ sub displaylogs { next; # skip valgrindNnn of other tests } if(($log =~ /^test$testnum$/)) { - next; # skip test$testnum since it can be very big + next; # skip test$testnum since it can be big } logmsg "=== Start of file $log\n"; displaylogcontent("$logdir/$log"); @@ -3088,7 +3088,7 @@ sub displaylogs { } } - # See if we've completed all the tests + # See if we have completed all the tests if(!scalar(%runnersrunning)) { # No runners are running; we must be done scalar(@runtests) && die 'Internal error: still have tests to run'; @@ -3096,7 +3096,7 @@ sub displaylogs { } # See if a test runner needs attention - # If we could be running more tests, don't wait so we can schedule a new + # If we could be running more tests, do not wait so we can schedule a new # one immediately. If all runners are busy, wait a fraction of a second # for one to finish so we can still loop around to check the abort flag. my $runnerwait = scalar(@runnersidle) && scalar(@runtests) ? 0.1 : 1.0; @@ -3131,7 +3131,7 @@ sub displaylogs { next; } - $total++; # number of tests we've run + $total++; # number of tests we have run $executed++; if($error>0) { @@ -3200,9 +3200,9 @@ sub displaylogs { $endwaitcnt += $runnerwait; if($endwaitcnt >= 10) { # Once all tests have been scheduled on a runner at the end of a test - # run, we just wait for their results to come in. If we're still + # run, we just wait for their results to come in. If we are still # waiting after a couple of minutes ($endwaitcnt multiplied by - # $runnerwait, plus $jobs because that number won't time out), display + # $runnerwait, plus $jobs because that number will not time out), display # the same test runner status as we give with a SIGUSR1. This will # likely point to a single test that has hung. logmsg "Hmmm, the tests are taking a while to finish. Here is the status:\n"; @@ -3231,9 +3231,9 @@ sub displaylogs { } # Kill the runners -# There is a race condition here since we don't know exactly when the runners -# have each finished shutting themselves down, but we're about to exit so it -# doesn't make much difference. +# There is a race condition here since we do not know exactly when the runners +# have each finished shutting themselves down, but we are about to exit so it +# does not make much difference. foreach my $runnerid (values %runnerids) { runnerac_shutdown($runnerid); sleep 0; # give runner a context switch so it can shut itself down diff --git a/tests/secureserver.pl b/tests/secureserver.pl index 930845e971d7..a773a86b869b 100755 --- a/tests/secureserver.pl +++ b/tests/secureserver.pl @@ -217,7 +217,7 @@ sub exit_signal_handler { $ver_minor = $2; } elsif($verstr =~ /^sslVersion.*fips *= *yes/) { - # the fips option causes an error if stunnel doesn't support it + # the fips option causes an error if stunnel does not support it $fips_support = 1; last } @@ -304,7 +304,7 @@ sub exit_signal_handler { print $stunconf "verifyChain = yes\n"; } if($fips_support) { - # disable fips in case OpenSSL doesn't support it + # disable fips in case OpenSSL does not support it print $stunconf "fips = no\n"; } if(!$tstunnel_windows) { @@ -358,7 +358,7 @@ sub exit_signal_handler { # Put an "exec" in front of the command so that the child process # keeps this child's process ID by being tied to the spawned shell. - exec("exec $cmd") || die "Can't exec() $cmd: $!"; + exec("exec $cmd") || die "Cannot exec() $cmd: $!"; # exec() will create a new process, but ties the existence of the # new process to the parent waiting perl.exe and sh.exe processes. diff --git a/tests/server/first.h b/tests/server/first.h index fc581487e694..2979239ad366 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -150,7 +150,7 @@ extern curl_socket_t sockdaemon(curl_socket_t sock, bool bind_only); /* global variables */ -static const char *srcpath = "."; /* pointing to the test dir */ +static const char *srcpath = "."; /* pointing to the test directory */ static const char *pidname = NULL; static const char *portname = NULL; /* none by default */ static const char *serverlogfile = NULL; diff --git a/tests/server/getpart.c b/tests/server/getpart.c index 6bff92ab1aef..efec3de634b6 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -50,7 +50,7 @@ static size_t line_length(const char *buffer, int bytestocheck) } if(*buffer != '\n') { /* - * We didn't find a new line so the last byte must be a + * We did not find a new line so the last byte must be a * '\0' character inserted by fgets() which we should not * count. */ diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index df5fb3690337..2701d61260e0 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -563,7 +563,7 @@ static curl_socket_t mqttit(curl_socket_t fd) memcpy(topic, &buffer[4], topic_len); topic[topic_len] = 0; - /* there's a QoS byte (two bits) after the topic */ + /* there is a QoS byte (two bits) after the topic */ logmsg("SUBSCRIBE to '%s' [%d]", topic, packet_id); stream = test2fopen(testno, logdir); @@ -572,7 +572,7 @@ static curl_socket_t mqttit(curl_socket_t fd) error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg("Couldn't open test file %ld", testno); + logmsg("Could not open test file %ld", testno); goto end; } error = getpart(&data, &datalen, "reply", "data", stream); @@ -679,7 +679,7 @@ static bool mqttd_incoming(curl_socket_t listenfd) FD_ZERO(&fds_write); FD_ZERO(&fds_err); - /* there's always a socket to wait for */ + /* there is always a socket to wait for */ #ifdef __DJGPP__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warith-conversion" diff --git a/tests/server/resolve.c b/tests/server/resolve.c index cab3cb7dff87..c41c2fc68ad2 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -93,7 +93,7 @@ static int test_resolve(int argc, char *argv[]) /* Check that the system has IPv6 enabled before checking the resolver */ curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0); if(s == CURL_SOCKET_BAD) - /* an IPv6 address was requested and we can't get/use one */ + /* an IPv6 address was requested and we cannot get/use one */ rc = -1; else { sclose(s); @@ -128,7 +128,7 @@ static int test_resolve(int argc, char *argv[]) #endif if(rc) - printf("Resolving %s '%s' didn't work\n", ipv_inuse, host); + printf("Resolving %s '%s' did not work\n", ipv_inuse, host); return !!rc; } diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index c3d4678ae4ac..5ffd0f28e5ee 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -62,8 +62,8 @@ struct rtspd_httprequest { long testno; /* test number found in the request */ long partno; /* part number found in the request */ bool open; /* keep connection open info, as found in the request */ - bool auth_req; /* authentication required, don't wait for body unless - there's an Authorization header */ + bool auth_req; /* authentication required, do not wait for body unless + there is an Authorization header */ bool auth; /* Authorization header present in the incoming request */ size_t cl; /* Content-Length of the incoming request */ bool digest; /* Authorization digest header found */ @@ -238,7 +238,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) int error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg("Couldn't open test file %ld", req->testno); + logmsg("Could not open test file %ld", req->testno); req->open = FALSE; /* closes connection */ return 1; /* done */ } @@ -285,7 +285,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) if(num < 0) logmsg("negative pipe size ignored"); else if(num > 0) - req->pipe = num-1; /* decrease by one since we don't count the + req->pipe = num-1; /* decrease by one since we do not count the first request in this number */ } else if(sscanf(ptr, "skip: %d", &num) == 1) { @@ -362,10 +362,10 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) req->open = FALSE; /* HTTP 1.0 closes connection by default */ if(!strncmp(doc, "bad", 3)) - /* if the host name starts with bad, we fake an error here */ + /* if the hostname starts with bad, we fake an error here */ req->testno = DOCNUMBER_BADCONNECT; else if(!strncmp(doc, "test", 4)) { - /* if the host name starts with test, the port number used in the + /* if the hostname starts with test, the port number used in the CONNECT line will be used as test number! */ char *portp = strchr(doc, ':'); if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1))) { @@ -389,7 +389,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) } if(!end) { - /* we don't have a complete request yet! */ + /* we do not have a complete request yet! */ logmsg("rtspd_ProcessRequest returned without a complete request"); return 0; /* not complete yet */ } @@ -403,7 +403,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) /* **** Persistence **** * * If the request is an HTTP/1.0 one, we close the connection unconditionally - * when we're done. + * when we are done. * * If the request is an HTTP/1.1 one, we MUST check for a "Connection:" * header that might say "close". If it does, we close a connection when @@ -416,8 +416,8 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) return 1; /* done */ if((req->cl == 0) && !CURL_STRNICMP("Content-Length:", line, 15)) { - /* If we don't ignore content-length, we read it and we read the whole - request including the body before we return. If we've been told to + /* If we do not ignore content-length, we read it and we read the whole + request including the body before we return. If we have been told to ignore the content-length, we will return as soon as all headers have been received */ curl_off_t clen; @@ -645,7 +645,7 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req) else { if(req->skip) /* we are instructed to not read the entire thing, so we make sure to - only read what we're supposed to and NOT read the entire thing the + only read what we are supposed to and NOT read the entire thing the client wants to send! */ got = sread(sock, reqbuf + req->offset, req->cl); else @@ -810,7 +810,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg("Couldn't open test file"); + logmsg("Could not open test file"); return 0; } else { @@ -834,7 +834,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg("Couldn't open test file"); + logmsg("Could not open test file"); free(ptr); return 0; } @@ -876,7 +876,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); logmsg("Error opening file '%s'", responsedump); - logmsg("couldn't create logfile '%s'", responsedump); + logmsg("could not create logfile '%s'", responsedump); free(ptr); free(cmd); return -1; diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index b4896260b94e..e30f54c41551 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -901,7 +901,7 @@ static bool disc_handshake(void) * The only other messages that could occur here are PING and PORT, * and both of them occur at the start of a test when nothing should be * trying to DISC. Therefore, we should not ever get here, but if we - * do, it's probably due to some kind of unclean shutdown situation so + * do, it is probably due to some kind of unclean shutdown situation so * us shutting down is what we probably ought to be doing, anyway. */ return FALSE; @@ -970,7 +970,7 @@ static bool juggle(curl_socket_t *sockfdp, /* server mode */ sockfd = listenfd; - /* there's always a socket to wait for */ + /* there is always a socket to wait for */ #ifdef __DJGPP__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warith-conversion" @@ -991,7 +991,7 @@ static bool juggle(curl_socket_t *sockfdp, maxfd = 0; /* stdin */ } else { - /* there's always a socket to wait for */ + /* there is always a socket to wait for */ #ifdef __DJGPP__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warith-conversion" @@ -1150,7 +1150,7 @@ static bool juggle(curl_socket_t *sockfdp, if((sockfd != CURL_SOCKET_BAD) && (FD_ISSET(sockfd, &fds_read)) ) { ssize_t nread_socket; if(*mode == PASSIVE_LISTEN) { - /* there's no stream set up yet, this is an indication that there's a + /* there is no stream set up yet, this is an indication that there is a client connecting. */ curl_socket_t newfd = accept(sockfd, NULL, NULL); if(CURL_SOCKET_BAD == newfd) { diff --git a/tests/server/socksd.c b/tests/server/socksd.c index f14ee13ee4fd..1a1d40113bf8 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -42,7 +42,7 @@ * state * "nmethods_max [number: 3]" - the minimum numberf NMETHODS the client must * state - * "user [string]" - the user name that must match (if method is 2) + * "user [string]" - the username that must match (if method is 2) * "password [string]" - the password that must match (if method is 2) * "backend [IPv4]" - numerical IPv4 address of backend to connect to * "backendport [number:0]" - TCP port of backend to connect to. 0 means use @@ -644,7 +644,7 @@ static bool socksd_incoming(curl_socket_t listenfd) FD_ZERO(&fds_write); FD_ZERO(&fds_err); - /* there's always a socket to wait for */ + /* there is always a socket to wait for */ #ifdef __DJGPP__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warith-conversion" diff --git a/tests/server/sws.c b/tests/server/sws.c index 29e69d893ba2..d590cd6fef69 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -59,8 +59,8 @@ struct sws_httprequest { long testno; /* test number found in the request */ long partno; /* part number found in the request */ bool open; /* keep connection open info, as found in the request */ - bool auth_req; /* authentication required, don't wait for body unless - there's an Authorization header */ + bool auth_req; /* authentication required, do not wait for body unless + there is an Authorization header */ bool auth; /* Authorization header present in the incoming request */ size_t cl; /* Content-Length of the incoming request */ bool digest; /* Authorization digest header found */ @@ -76,7 +76,7 @@ struct sws_httprequest { int prot_version; /* HTTP version * 10 */ int callcount; /* times sws_ProcessRequest() gets called */ bool skipall; /* skip all incoming data */ - bool noexpect; /* refuse Expect: (don't read the body) */ + bool noexpect; /* refuse Expect: (do not read the body) */ bool connmon; /* monitor the state of the connection, log disconnects */ bool upgrade; /* test case allows upgrade */ bool upgrade_request; /* upgrade request found and allowed */ @@ -208,7 +208,7 @@ static int sws_parse_servercmd(struct sws_httprequest *req) error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg(" Couldn't open test file %ld", req->testno); + logmsg(" Could not open test file %ld", req->testno); req->open = FALSE; /* closes connection */ return 1; /* done */ } @@ -340,7 +340,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) if(http && sscanf(http, "HTTP/%d.%d", &prot_major, &prot_minor) == 2) { - /* between the request keyword and HTTP/ there's a path */ + /* between the request keyword and HTTP/ there is a path */ httppath = line + strlen(request); npath = http - httppath; @@ -414,7 +414,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) } if(req->testno == DOCNUMBER_NOTHING) { - /* didn't find any in the first scan, try alternative test case + /* did not find any in the first scan, try alternative test case number placements */ static char doc[MAXDOCNAMELEN]; if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d", @@ -485,7 +485,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) } if(!end) { - /* we don't have a complete request yet! */ + /* we do not have a complete request yet! */ logmsg("request not complete yet"); return 0; /* not complete yet */ } @@ -545,7 +545,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) /* **** Persistence **** * * If the request is an HTTP/1.0 one, we close the connection unconditionally - * when we're done. + * when we are done. * * If the request is an HTTP/1.1 one, we MUST check for a "Connection:" * header that might say "close". If it does, we close a connection when @@ -558,8 +558,8 @@ static int sws_ProcessRequest(struct sws_httprequest *req) return 1; /* done */ if((req->cl == 0) && !CURL_STRNICMP("Content-Length:", line, 15)) { - /* If we don't ignore content-length, we read it and we read the whole - request including the body before we return. If we've been told to + /* If we do not ignore content-length, we read it and we read the whole + request including the body before we return. If we have been told to ignore the content-length, we will return as soon as all headers have been received */ curl_off_t clen; @@ -883,7 +883,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) else { if(req->skip) /* we are instructed to not read the entire thing, so we make sure to - only read what we're supposed to and NOT read the entire thing the + only read what we are supposed to and NOT read the entire thing the client wants to send! */ got = sread(sock, reqbuf + req->offset, req->cl); else @@ -1955,7 +1955,7 @@ static int service_connection(curl_socket_t *msgsock, if(req->connect_request) { /* a CONNECT request, setup and talk the tunnel */ if(!is_proxy) { - logmsg("received CONNECT but isn't running as proxy!"); + logmsg("received CONNECT but not running as proxy!"); return 1; } else { @@ -2419,7 +2419,7 @@ static int test_sws(int argc, char *argv[]) if(!req->open) /* When instructed to close connection after server-reply we - wait a very small amount of time before doing so. If this + wait a small amount of time before doing so. If this is not done client might get an ECONNRESET before reading a single byte of server-reply. */ curlx_wait_ms(50); @@ -2437,7 +2437,7 @@ static int test_sws(int argc, char *argv[]) goto sws_cleanup; } - /* Reset the request, unless we're still in the middle of reading */ + /* Reset the request, unless we are still in the middle of reading */ if(rc && !req->upgrade_request) /* Note: resetting the HTTP request here can cause problems if: * 1) req->skipall is TRUE, @@ -2448,9 +2448,9 @@ static int test_sws(int argc, char *argv[]) * data (in service_connection()) as the first data received on * this new HTTP request and report "** Unusual request" (skipall * would have otherwise caused that data to be ignored). Normally, - * that socket will be closed by the client and there won't be any - * stale data to cause this, but stranger things have happened (see - * issue #11678). + * that socket will be closed by the client and there will not be + * any stale data to cause this, but stranger things have happened + * (see issue #11678). */ init_httprequest(req); } while(rc > 0); diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 819f06bf2d32..a701f223c57d 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -310,7 +310,7 @@ static struct tftphdr *rw_init(int x) { newline = 0; /* init crlf flag */ prevchar = -1; - bfs[0].counter = BF_ALLOC; /* pass out the first buffer */ + bfs[0].counter = BF_ALLOC; /* pass out the first buffer */ current = 0; bfs[1].counter = BF_FREE; nextone = x; /* ahead or behind? */ @@ -339,7 +339,7 @@ static int readit(struct testcase *test, struct tftphdr * volatile *dpp, current = !current; /* "incr" current */ b = &bfs[current]; /* look at new buffer */ - if(b->counter == BF_FREE) /* if it's empty */ + if(b->counter == BF_FREE) /* if empty */ read_ahead(test, convert); /* fill it */ *dpp = &b->buf.hdr; /* set caller's ptr */ @@ -360,7 +360,7 @@ static void read_ahead(struct testcase *test, struct tftphdr *dp; b = &bfs[nextone]; /* look at "next" buffer */ - if(b->counter != BF_FREE) /* nop if not free */ + if(b->counter != BF_FREE) /* nop if not free */ return; nextone = !nextone; /* "incr" next buffer ptr */ @@ -447,7 +447,7 @@ static ssize_t write_behind(struct testcase *test, int convert) snprintf(outfile, sizeof(outfile), "%s/upload.%ld", logdir, test->testno); test->ofile = open(outfile, O_CREAT|O_RDWR|CURL_O_BINARY, 0777); if(test->ofile == -1) { - logmsg("Couldn't create and/or open file %s for upload!", outfile); + logmsg("Could not create and/or open file %s for upload!", outfile); return -1; /* failure! */ } } @@ -1017,7 +1017,7 @@ static int tftpd_parse_servercmd(struct testcase *req) error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg(" Couldn't open test file %ld", req->testno); + logmsg(" Could not open test file %ld", req->testno); return 1; /* done */ } else { @@ -1141,7 +1141,7 @@ static int validate_access(struct testcase *test, int error = errno; logmsg("fopen() failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg("Couldn't open test file for test: %ld", testno); + logmsg("Could not open test file for test: %ld", testno); return TFTP_EACCESS; } else { diff --git a/tests/server/util.c b/tests/server/util.c index afe69862636a..6551e4742635 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -97,7 +97,7 @@ void logmsg(const char *msg, ...) } sec = epoch_offset + tv.tv_sec; /* !checksrc! disable BANNEDFUNC 1 */ - now = localtime(&sec); /* not thread safe but we don't care */ + now = localtime(&sec); /* not thread safe but we do not care */ snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld", (int)now->tm_hour, (int)now->tm_min, (int)now->tm_sec, @@ -227,7 +227,7 @@ int write_pidfile(const char *filename) pidfile = fopen(filename, "wb"); if(!pidfile) { char errbuf[STRERROR_LEN]; - logmsg("Couldn't write pid file: %s (%d) %s", filename, + logmsg("Could not write pid file: %s (%d) %s", filename, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); return 0; /* fail */ } @@ -243,7 +243,7 @@ int write_portfile(const char *filename, int port) FILE *portfile = fopen(filename, "wb"); if(!portfile) { char errbuf[STRERROR_LEN]; - logmsg("Couldn't write port file: %s (%d) %s", filename, + logmsg("Could not write port file: %s (%d) %s", filename, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); return 0; /* fail */ } diff --git a/tests/serverhelp.pm b/tests/serverhelp.pm index 1a3c997755e5..c79528af7124 100644 --- a/tests/serverhelp.pm +++ b/tests/serverhelp.pm @@ -64,7 +64,7 @@ use testutil qw( exerunner ); -our $logfile; # server log file name, for logmsg +our $logfile; # server log filename, for logmsg #*************************************************************************** # Just for convenience, test harness uses 'https' and 'httptls' literals as @@ -153,7 +153,7 @@ sub servername_id { #*************************************************************************** -# Return server name string formatted for file name purposes +# Return server name string formatted for filename purposes # sub servername_canon { my ($proto, $ipver, $idnum) = @_; @@ -165,7 +165,7 @@ sub servername_canon { #*************************************************************************** -# Return file name for server pid file. +# Return filename for server pid file. # sub server_pidfilename { my ($piddir, $proto, $ipver, $idnum) = @_; @@ -174,7 +174,7 @@ sub server_pidfilename { } #*************************************************************************** -# Return file name for server port file. +# Return filename for server port file. # sub server_portfilename { my ($piddir, $proto, $ipver, $idnum) = @_; @@ -184,7 +184,7 @@ sub server_portfilename { #*************************************************************************** -# Return file name for server log file. +# Return filename for server log file. # sub server_logfilename { my ($logdir, $proto, $ipver, $idnum) = @_; @@ -195,7 +195,7 @@ sub server_logfilename { #*************************************************************************** -# Return file name for server commands file. +# Return filename for server commands file. # sub server_cmdfilename { my ($logdir, $proto, $ipver, $idnum) = @_; @@ -205,7 +205,7 @@ sub server_cmdfilename { #*************************************************************************** -# Return file name for server input file. +# Return filename for server input file. # sub server_inputfilename { my ($logdir, $proto, $ipver, $idnum) = @_; @@ -215,7 +215,7 @@ sub server_inputfilename { #*************************************************************************** -# Return file name for server output file. +# Return filename for server output file. # sub server_outputfilename { my ($logdir, $proto, $ipver, $idnum) = @_; @@ -253,7 +253,7 @@ sub server_exe_args { #*************************************************************************** -# Return file name for main or primary sockfilter pid file. +# Return filename for main or primary sockfilter pid file. # sub mainsockf_pidfilename { my ($piddir, $proto, $ipver, $idnum) = @_; @@ -265,7 +265,7 @@ sub mainsockf_pidfilename { #*************************************************************************** -# Return file name for main or primary sockfilter log file. +# Return filename for main or primary sockfilter log file. # sub mainsockf_logfilename { my ($logdir, $proto, $ipver, $idnum) = @_; @@ -277,7 +277,7 @@ sub mainsockf_logfilename { #*************************************************************************** -# Return file name for data or secondary sockfilter pid file. +# Return filename for data or secondary sockfilter pid file. # sub datasockf_pidfilename { my ($piddir, $proto, $ipver, $idnum) = @_; @@ -289,7 +289,7 @@ sub datasockf_pidfilename { #*************************************************************************** -# Return file name for data or secondary sockfilter log file. +# Return filename for data or secondary sockfilter log file. # sub datasockf_logfilename { my ($logdir, $proto, $ipver, $idnum) = @_; diff --git a/tests/servers.pm b/tests/servers.pm index e5505886f6af..db4b3757b547 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -118,12 +118,12 @@ use testutil qw( ); -my %serverpidfile; # all server pid file names, identified by server id -my %serverportfile;# all server port file names, identified by server id +my %serverpidfile; # all server pid filenames, identified by server id +my %serverportfile;# all server port filenames, identified by server id my $sshdvernum; # for socks server, ssh daemon version number my $sshdverstr; # for socks server, ssh daemon version string my $sshderror; # for socks server, ssh daemon version error -my %doesntrun; # servers that don't work, identified by pidfile +my %doesntrun; # servers that do not work, identified by pidfile my %PORT = (nolisten => 47); # port we use for a local non-listening service my $server_response_maxtime=13; my $httptlssrv = find_httptlssrv(); @@ -185,7 +185,7 @@ sub getfreeport { Type => SOCK_STREAM, Reuse => 1, Listen => 10 ) - or die "Couldn't create tcp server socket: $@\n"; + or die "Could not create tcp server socket: $@\n"; return $server->sockport(); } @@ -225,7 +225,7 @@ sub initserverconfig { } ####################################################################### -# Load serverpidfile and serverportfile hashes with file names for all +# Load serverpidfile and serverportfile hashes with filenames for all # possible servers. # sub init_serverpidfile_hash { @@ -362,14 +362,14 @@ sub startnew { # Put an "exec" in front of the command so that the child process # keeps this child's process ID. - exec("exec $cmd") || die "Can't exec() $cmd: $!"; + exec("exec $cmd") || die "Cannot exec() $cmd: $!"; # exec() should never return back here to this process. We protect # ourselves by calling die() just in case something goes really bad. die "error: exec() has returned"; } - # Ugly hack but ssh client and gnutls-serv don't support pid files + # Ugly hack but ssh client and gnutls-serv do not support pid files if($fakepidfile) { if(open(my $out, ">", "$pidfile")) { print $out $child . "\n"; @@ -400,7 +400,7 @@ sub startnew { if(checkdied($child)) { logmsg "startnew: child process has died, server might start up\n" if($verbose); - # We can't just abort waiting for the server with a + # We cannot just abort waiting for the server with a # return (-1,-1); # because the server might have forked and could still start # up normally. Instead, just reduce the amount of time we remain @@ -427,7 +427,7 @@ sub protoport { ####################################################################### -# Stop a test server along with pids which aren't in the %run hash yet. +# Stop a test server along with pids which are not in the %run hash yet. # This also stops all servers which are relative to the given one. # sub stopserver { @@ -523,7 +523,7 @@ sub getexternalproxyflags { ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the -# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't +# server runs fine but we cannot talk to it ("Failed to connect to ::1: Cannot # assign requested address") # sub verifyhttp { @@ -596,7 +596,7 @@ sub verifyhttp { $pid = 0+$1; } elsif($res == 6) { - # curl: (6) Couldn't resolve host '::1' + # curl: (6) Could not resolve hostname '::1' logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n"; return -1; } @@ -610,7 +610,7 @@ sub verifyhttp { ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the -# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't +# server runs fine but we cannot talk to it ("Failed to connect to ::1: Cannot # assign requested address") # sub verifyftp { @@ -677,7 +677,7 @@ sub verifyftp { ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the -# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't +# server runs fine but we cannot talk to it ("Failed to connect to ::1: Cannot # assign requested address") # sub verifyrtsp { @@ -739,7 +739,7 @@ sub verifyrtsp { $pid = 0+$1; } elsif($res == 6) { - # curl: (6) Couldn't resolve host '::1' + # curl: (6) Could not resolve hostname '::1' logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n"; return -1; } @@ -774,13 +774,13 @@ sub verifysftp { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $verified = 0; - # Find out sftp client canonical file name + # Find out sftp client canonical filename my $sftp = find_sftp(); if(!$sftp) { logmsg "RUN: SFTP server cannot find $sftpexe\n"; return -1; } - # Find out ssh client canonical file name + # Find out ssh client canonical filename my $ssh = find_ssh(); if(!$ssh) { logmsg "RUN: SFTP server cannot find $sshexe\n"; @@ -807,7 +807,7 @@ sub verifysftp { # Verify that the non-stunnel HTTP TLS extensions capable server that runs # on $ip, $port is our server. This also implies that we can speak with it, # as there might be occasions when the server runs fine but we cannot talk -# to it ("Failed to connect to ::1: Can't assign requested address") +# to it ("Failed to connect to ::1: Cannot assign requested address") # sub verifyhttptls { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; @@ -874,7 +874,7 @@ sub verifyhttptls { return $pid; } elsif($res == 6) { - # curl: (6) Couldn't resolve host '::1' + # curl: (6) Could not resolve hostname '::1' logmsg "RUN: failed to resolve host (https://$ip:$port/verifiedserver)\n"; return -1; } @@ -902,7 +902,7 @@ sub verifypid { ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the -# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't +# server runs fine but we cannot talk to it ("Failed to connect to ::1: Cannot # assign requested address") # sub verifysmb { @@ -962,7 +962,7 @@ sub verifysmb { ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the -# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't +# server runs fine but we cannot talk to it ("Failed to connect to ::1: Cannot # assign requested address") # sub verifytelnet { @@ -1110,7 +1110,7 @@ sub runhttpserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1189,7 +1189,7 @@ sub runhttp2server { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0, 0); } @@ -1250,7 +1250,7 @@ sub runhttp3server { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1316,7 +1316,7 @@ sub runhttpsserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1360,7 +1360,7 @@ sub runhttpsserver { if($httpspid <= 0 || !pidexists($httpspid)) { # it is NOT alive - # don't call stopserver since that will also kill the dependent + # do not call stopserver since that will also kill the dependent # server that has already been started properly $doesntrun{$pidfile} = 1; $httpspid = $pid2 = 0; @@ -1397,7 +1397,7 @@ sub runhttptlsserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1460,7 +1460,7 @@ sub runpingpongserver { my $pidfile = $serverpidfile{$server}; my $portfile = $serverportfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0); } @@ -1531,7 +1531,7 @@ sub runsecureserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1564,7 +1564,7 @@ sub runsecureserver { if($protospid <= 0 || !pidexists($protospid)) { # it is NOT alive - # don't call stopserver since that will also kill the dependent + # do not call stopserver since that will also kill the dependent # server that has already been started properly $doesntrun{$pidfile} = 1; $protospid = $pid2 = 0; @@ -1602,7 +1602,7 @@ sub runtftpserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1673,7 +1673,7 @@ sub rundnsserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1746,7 +1746,7 @@ sub runrtspserver { my $pidfile = $serverpidfile{$server}; my $portfile = $serverportfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1808,7 +1808,7 @@ sub runsshserver { my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; if(!$USER) { - logmsg "Can't start ssh server due to lack of USER name\n"; + logmsg "Cannot start ssh server due to lack of username\n"; return (4, 0, 0, 0); } @@ -1816,7 +1816,7 @@ sub runsshserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1870,8 +1870,8 @@ sub runsshserver { # once it is known that the ssh server is alive, sftp server # verification is performed actually connecting to it, authenticating - # and performing a very simple remote command. This verification is - # tried only one time. + # and performing a simple remote command. This verification is tried + # only one time. $sshdlog = server_logfilename($LOGDIR, 'ssh', $ipvnum, $idnum); $sftplog = server_logfilename($LOGDIR, 'sftp', $ipvnum, $idnum); @@ -1889,7 +1889,7 @@ sub runsshserver { logmsg "RUN: failed to verify the $srvrname server on $port\n"; return (5, 0, 0, 0); } - # we're happy, no need to loop anymore! + # we are happy, no need to loop anymore! $doesntrun{$pidfile} = 0; my $hostfile; @@ -1934,7 +1934,7 @@ sub runmqttserver { my $pidfile = $serverpidfile{$server}; my $portfile = $serverportfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0); } @@ -1996,7 +1996,7 @@ sub runsocksserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2079,7 +2079,7 @@ sub rundictserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2140,7 +2140,7 @@ sub runsmbserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2201,7 +2201,7 @@ sub runnegtelnetserver { my $pidfile = $serverpidfile{$server}; - # don't retry if the server doesn't work + # do not retry if the server does not work if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2584,7 +2584,7 @@ sub startservers { elsif($what =~ /^(ftp|imap|pop3|smtp)s$/) { my $cproto = $1; if(!$stunnel) { - # we can't run ftps tests without stunnel + # we cannot run ftps tests without stunnel return ("no stunnel", 4); } if($runcert{$what} && ($runcert{$what} ne $certfile)) { @@ -2624,7 +2624,7 @@ sub startservers { } elsif($what eq "https" || $what eq "https-mtls") { if(!$stunnel) { - # we can't run https tests without stunnel + # we cannot run https tests without stunnel return ("no stunnel", 4); } if($runcert{$what} && ($runcert{$what} ne $certfile)) { @@ -2677,7 +2677,7 @@ sub startservers { } } elsif($what eq "http/2") { - # http/2 server proxies to a http server + # http/2 server proxies to an HTTP server if($run{'http/2'} && !responsive_http_server("https", $verbose, 0, protoport('http2tls'))) { logmsg "* restarting unresponsive HTTP/2 server\n"; @@ -2718,7 +2718,7 @@ sub startservers { } } elsif($what eq "http/3") { - # http/3 server proxies to a http server + # http/3 server proxies to an HTTP server if($run{'http/3'} && !responsive_http_server("https", $verbose, 0, protoport('http3'), 1)) { logmsg "* restarting unresponsive HTTP/3 server\n"; @@ -2759,7 +2759,7 @@ sub startservers { } elsif($what eq "gophers") { if(!$stunnel) { - # we can't run TLS tests without stunnel + # we cannot run TLS tests without stunnel return ("no stunnel", 4); } if($runcert{'gophers'} && ($runcert{'gophers'} ne $certfile)) { @@ -2803,7 +2803,7 @@ sub startservers { } elsif($what eq "https-proxy") { if(!$stunnel) { - # we can't run https-proxy tests without stunnel + # we cannot run https-proxy tests without stunnel return ("no stunnel", 4); } if($runcert{'https-proxy'} && @@ -2834,7 +2834,7 @@ sub startservers { } elsif($what eq "httptls") { if(!$httptlssrv) { - # for now, we can't run http TLS-EXT tests without gnutls-serv + # for now, we cannot run http TLS-EXT tests without gnutls-serv return ("no gnutls-serv (with SRP support)", 4); } if($run{'httptls'} && @@ -2856,7 +2856,7 @@ sub startservers { } elsif($what eq "httptls-ipv6") { if(!$httptlssrv) { - # for now, we can't run http TLS-EXT tests without gnutls-serv + # for now, we cannot run http TLS-EXT tests without gnutls-serv return ("no gnutls-serv", 4); } if($run{'httptls-ipv6'} && @@ -3027,7 +3027,7 @@ sub startservers { } } else { - warn "we don't support a server for $what"; + warn "we do not support a server for $what"; return ("no server for $what", 4); } } @@ -3188,7 +3188,7 @@ sub subvariables { # The purpose of FTPTIME2 is to provide times that can be # used for time-out tests and that would work on most hosts as these # adjust for the startup/check time for this particular host. We needed to - # do this to make the test suite run better on very slow hosts. + # do this to make the test suite run better on slow hosts. my $ftp2 = $ftpchecktime * 8; $$thing =~ s/${prefix}FTPTIME2/$ftp2/g; diff --git a/tests/smbserver.py b/tests/smbserver.py index 1fc76f3416ec..aff9bb067e81 100755 --- a/tests/smbserver.py +++ b/tests/smbserver.py @@ -171,7 +171,7 @@ def __init__(self, self.ctd = TestData(test_data_directory) # Override smbComNtCreateAndX so we can pretend to have files which - # don't exist. + # do not exist. self.hookSmbCommand(imp_smb.SMB.SMB_COM_NT_CREATE_ANDX, self.create_and_x) @@ -311,7 +311,7 @@ def get_server_path(self, requested_filename): log.debug("[SMB] Get server path '%s'", requested_filename) if requested_filename not in [VERIFIED_REQ]: - raise SmbError(STATUS_NO_SUCH_FILE, "Couldn't find the file") + raise SmbError(STATUS_NO_SUCH_FILE, "Could not find the file") fid, filename = tempfile.mkstemp() log.debug("[SMB] Created %s (%d) for storing '%s'", @@ -383,9 +383,9 @@ def get_options(): parser.add_argument("--verbose", action="store", type=int, default=0, help="verbose output") parser.add_argument("--pidfile", action="store", - help="file name for the PID") + help="filename for the PID") parser.add_argument("--logfile", action="store", - help="file name for the log") + help="filename for the log") parser.add_argument("--srcdir", action="store", help="test directory") parser.add_argument("--id", action="store", help="server ID") parser.add_argument("--ipv4", action="store_true", default=0, diff --git a/tests/sshserver.pl b/tests/sshserver.pl index 98c15bc2a9b4..20aceebc24e3 100755 --- a/tests/sshserver.pl +++ b/tests/sshserver.pl @@ -107,7 +107,7 @@ my @cfgarr; #*************************************************************************** -# Returns a path of the given file name in the log directory (PiddirPath) +# Returns a path of the given filename in the log directory (PiddirPath) # sub pp { my $file = $_[0]; @@ -201,7 +201,7 @@ sub logmsg { # #*************************************************************************** -# Default ssh daemon pid file name & directory +# Default ssh daemon pid filename & directory # if($pidfile) { # Use our pidfile directory to store server config files @@ -214,7 +214,7 @@ sub logmsg { } #*************************************************************************** -# ssh and sftp server log file names +# ssh and sftp server log filenames # $sshdlog = server_logfilename($logdir, 'ssh', $ipvnum, $idnum); $sftplog = server_logfilename($logdir, 'sftp', $ipvnum, $idnum); @@ -230,7 +230,7 @@ sub logmsg { # Validate username # if(!$username) { - $error = 'Will not run ssh server without a user name'; + $error = 'Will not run ssh server without a username'; } elsif($username eq 'root') { $error = 'Will not run ssh server as root to mitigate security risks'; @@ -242,7 +242,7 @@ sub logmsg { #*************************************************************************** -# Find out ssh daemon canonical file name +# Find out ssh daemon canonical filename # my $sshd = find_sshd(); if(!$sshd) { @@ -293,7 +293,7 @@ sub logmsg { #*************************************************************************** -# Find out sftp server plugin canonical file name +# Find out sftp server plugin canonical filename # my $sftpsrv = find_sftpsrv(); if(!$sftpsrv) { @@ -304,7 +304,7 @@ sub logmsg { #*************************************************************************** -# Find out sftp client canonical file name +# Find out sftp client canonical filename # my $sftp = find_sftp(); if(!$sftp) { @@ -315,7 +315,7 @@ sub logmsg { #*************************************************************************** -# Find out ssh keygen canonical file name +# Find out ssh keygen canonical filename # my $sshkeygen = find_sshkeygen(); if(!$sshkeygen) { @@ -326,7 +326,7 @@ sub logmsg { #*************************************************************************** -# Find out ssh client canonical file name +# Find out ssh client canonical filename # my $ssh = find_ssh(); if(!$ssh) { @@ -406,7 +406,7 @@ sub logmsg { (! -e pp($hstpubsha256f)) || (! -s pp($hstpubsha256f)) || (! -e pp($cliprvkeyf)) || (! -s pp($cliprvkeyf)) || (! -e pp($clipubkeyf)) || (! -s pp($clipubkeyf))) { - # Make sure all files are gone so ssh-keygen doesn't complain + # Make sure all files are gone so ssh-keygen does not complain unlink(pp($hstprvkeyf), pp($hstpubkeyf), pp($hstpubmd5f), pp($hstpubsha256f), pp($cliprvkeyf), pp($clipubkeyf)); @@ -435,7 +435,7 @@ sub logmsg { exit 1; } display_file_top(pp($cliprvkeyf)) if($verbose); - # Make sure that permissions are restricted so openssh doesn't complain + # Make sure that permissions are restricted so openssh does not complain chmod 0600, pp($hstprvkeyf); chmod 0600, pp($cliprvkeyf); if(($^O eq 'cygwin' || $^O eq 'msys') && -e "/bin/setfacl") { @@ -1207,7 +1207,7 @@ sub sshd_supports_opt { # Put an "exec" in front of the command so that the child process # keeps this child's process ID by being tied to the spawned shell. - exec("exec $cmd") || die "Can't exec() $cmd: $!"; + exec("exec $cmd") || die "Cannot exec() $cmd: $!"; # exec() will create a new process, but ties the existence of the # new process to the parent waiting perl.exe and sh.exe processes. diff --git a/tests/test1119.pl b/tests/test1119.pl index 45196926c361..48d080bc7a1e 100755 --- a/tests/test1119.pl +++ b/tests/test1119.pl @@ -47,7 +47,7 @@ $Cpreprocessor = 'cpp'; } -# we may get the dir root pointed out +# we may get the directory root pointed out my $root=$ARGV[0] || "."; # need an include directory when building out-of-tree @@ -93,7 +93,7 @@ sub scanheader { sub scanallheaders { my $d = "$root/include/curl"; opendir(my $dh, $d) || - die "Can't opendir: $!"; + die "Cannot opendir: $!"; my @headers = grep { /.h\z/ } readdir($dh); closedir $dh; foreach my $h (@headers) { @@ -126,7 +126,7 @@ sub checkmanpage { sub scanman_md_dir { my ($d) = @_; opendir(my $dh, $d) || - die "Can't opendir: $!"; + die "Cannot opendir: $!"; my @mans = grep { /.md\z/ } readdir($dh); closedir $dh; for my $m (@mans) { @@ -197,7 +197,7 @@ sub scanman_md_dir { # now scan through all symbols that were present in the symbols-in-versions # but not in the headers # -# If the symbols were marked 'removed' in symbols-in-versions we don't output +# If the symbols were marked 'removed' in symbols-in-versions we do not output # anything about it since that is perfectly fine. # diff --git a/tests/test1132.pl b/tests/test1132.pl index e808c2e8c82a..966bd09a489a 100755 --- a/tests/test1132.pl +++ b/tests/test1132.pl @@ -72,10 +72,10 @@ sub scanfile { } else { if(!$memdebug) { - print STDERR "$file doesn't include \"memdebug.h\"!\n"; + print STDERR "$file does not include \"memdebug.h\"!\n"; } if(!$curlmem) { - print STDERR "$file doesn't include \"curl_memory.h\"!\n"; + print STDERR "$file does not include \"curl_memory.h\"!\n"; } return 1; } @@ -83,7 +83,7 @@ sub scanfile { return 0; } -opendir(my $dh, $dir) || die "can't opendir $dir: $!"; +opendir(my $dh, $dir) || die "cannot opendir $dir: $!"; my @cfiles = grep { /\.c\z/ && -f "$dir/$_" } readdir($dh); closedir $dh; diff --git a/tests/test1135.pl b/tests/test1135.pl index b64e4bf8a85c..15982e659df9 100755 --- a/tests/test1135.pl +++ b/tests/test1135.pl @@ -28,7 +28,7 @@ my $sort = 0; -# we may get the dir root pointed out +# we may get the directory root pointed out my $root = shift @ARGV; while(defined $root) { diff --git a/tests/test1139.pl b/tests/test1139.pl index e2eb8946eb74..bfe636578fa5 100755 --- a/tests/test1139.pl +++ b/tests/test1139.pl @@ -34,14 +34,14 @@ # src/tool_getparam.c lists all options curl can parse # docs/curl.1 documents all command line options # src/tool_listhelp.c outputs all options with curl -h -# - make sure they're all in sync +# - make sure they are all in sync # # Output all deviances to stderr. use strict; use warnings; -# we may get the dir roots pointed out +# we may get the directory roots pointed out my $root=$ARGV[0] || "."; my $buildroot=$ARGV[1] || "."; my $syms = "$root/docs/libcurl/symbols-in-versions"; @@ -126,7 +126,7 @@ sub scanmdpage { } elsif($rem) { # $opt was removed in $rem - # so don't check for that + # so do not check for that } else { if($type eq "OPT") { diff --git a/tests/test1165.pl b/tests/test1165.pl index a15071c256bb..654a2ad64265 100755 --- a/tests/test1165.pl +++ b/tests/test1165.pl @@ -37,7 +37,7 @@ # the DISABLE options that are documented my %docs; -# we may get the dir root pointed out +# we may get the directory root pointed out my $root=$ARGV[0] || "."; my $DOCS="CURL-DISABLE.md"; @@ -54,7 +54,7 @@ sub scanconf { } sub scan_configure { - opendir(my $m, "$root/m4") || die "Can't opendir $root/m4: $!"; + opendir(my $m, "$root/m4") || die "Cannot opendir $root/m4: $!"; my @m4 = grep { /\.m4$/ } readdir($m); closedir $m; scanconf("$root/configure.ac"); @@ -105,7 +105,7 @@ sub scan_file { sub scan_dir { my ($dir)=@_; - opendir(my $dh, $dir) || die "Can't opendir $dir: $!"; + opendir(my $dh, $dir) || die "Cannot opendir $dir: $!"; my @cfiles = grep { /\.[ch]\z/ && -f "$dir/$_" } readdir($dh); closedir $dh; for my $f (sort @cfiles) { diff --git a/tests/test1167.pl b/tests/test1167.pl index e2965b784a53..1bcaedddcdbe 100755 --- a/tests/test1167.pl +++ b/tests/test1167.pl @@ -55,7 +55,7 @@ shift; } -# we may get the dir root pointed out +# we may get the directory root pointed out my $root=$ARGV[0] || "."; # need an include directory when building out-of-tree @@ -77,7 +77,7 @@ sub scanenums { while() { my ($line, $linenum) = ($_, $.); if(/^#(line|) (\d+) \"(.*)\"/) { - # if the included file isn't in our incdir, then we skip this section + # if the included file is not in our incdir, then we skip this section # until next #line # if($3 !~ /^$incdir/) { @@ -135,7 +135,7 @@ sub scanheader { } -opendir(my $dh, $incdir) || die "Can't opendir $incdir: $!"; +opendir(my $dh, $incdir) || die "Cannot opendir $incdir: $!"; my @hfiles = grep { /\.h$/ } readdir($dh); closedir $dh; diff --git a/tests/test1173.pl b/tests/test1173.pl index 19bcd1af8cfd..493ce37ca7d8 100755 --- a/tests/test1173.pl +++ b/tests/test1173.pl @@ -31,10 +31,10 @@ use warnings; use File::Basename; -# get the file name first +# get the filename first my $symbolsinversions=shift @ARGV; -# we may get the dir roots pointed out +# we may get the directory roots pointed out my @manpages=@ARGV; my $errors = 0; @@ -119,7 +119,7 @@ sub checkref { } } -# option-looking words that aren't options +# option-looking words that are not options my %allownonref = ( 'CURLINFO_TEXT' => 1, 'CURLINFO_HEADER_IN' => 1, @@ -148,7 +148,7 @@ sub scanmanpage { open(my $m, "<", "$file") || die "test1173.pl could not open $file"; if($file =~ /[\/\\](CURL|curl_)([^\/\\]*).3/) { - # This is a man page for libcurl. It requires an example unless it's + # This is a man page for libcurl. It requires an example unless it is # considered deprecated. $reqex = 1 unless defined $deprecated{'CURL'.$2}; if($1 eq "CURL") { @@ -372,7 +372,7 @@ sub scanmanpage { allsymbols(); if(!$symbol{'CURLALTSVC_H1'}) { - print STDERR "didn't get the symbols-in-version!\n"; + print STDERR "did not get the symbols-in-version!\n"; exit; } diff --git a/tests/test1175.pl b/tests/test1175.pl index 2e6714261371..54e0a1fe762e 100755 --- a/tests/test1175.pl +++ b/tests/test1175.pl @@ -26,7 +26,7 @@ use strict; use warnings; -# we may get the dir root pointed out +# we may get the directory root pointed out my $root = $ARGV[0] || "."; my %error; # from the include file diff --git a/tests/test1222.pl b/tests/test1222.pl index 8186d635112e..6aebc9646ab2 100755 --- a/tests/test1222.pl +++ b/tests/test1222.pl @@ -259,8 +259,8 @@ sub scan_man_page { exit 0; } -# Get header file names, -opendir(my $dh, $incdir) || die "Can't opendir $incdir"; +# Get header filenames, +opendir(my $dh, $incdir) || die "Cannot opendir $incdir"; my @hfiles = grep { /\.h$/ } readdir($dh); closedir $dh; diff --git a/tests/test1477.pl b/tests/test1477.pl index 44a0f90200d2..2ce5d8e89bed 100755 --- a/tests/test1477.pl +++ b/tests/test1477.pl @@ -29,7 +29,7 @@ use strict; use warnings; -# we may get the dir roots pointed out +# we may get the directory roots pointed out my $root=$ARGV[0] || "."; my $buildroot=$ARGV[1] || "."; my $manpge = "$buildroot/docs/libcurl/libcurl-errors.3"; @@ -79,7 +79,7 @@ sub scanmanpage { } -opendir(my $dh, $curlh) || die "Can't opendir $curlh: $!"; +opendir(my $dh, $curlh) || die "Cannot opendir $curlh: $!"; my @hfiles = grep { /\.h$/ } readdir($dh); closedir $dh; diff --git a/tests/test1486.pl b/tests/test1486.pl index f67926106167..05006ebc63f5 100755 --- a/tests/test1486.pl +++ b/tests/test1486.pl @@ -26,7 +26,7 @@ use strict; use warnings; -# we may get the dir root pointed out +# we may get the directory root pointed out my $root=$ARGV[0] || "."; my %insrc; # variable set in source diff --git a/tests/test1488.pl b/tests/test1488.pl index 1994f93beeb5..3d67908195b6 100755 --- a/tests/test1488.pl +++ b/tests/test1488.pl @@ -48,7 +48,7 @@ $Cpreprocessor = 'cpp'; } -# we may get the dir root pointed out +# we may get the directory root pointed out my $root=$ARGV[0] || "."; # need an include directory when building out-of-tree @@ -98,7 +98,7 @@ sub checkmanpage { sub scanman_md_dir { my ($d) = @_; opendir(my $dh, $d) || - die "Can't opendir: $!"; + die "Cannot opendir: $!"; my @mans = grep { /.md\z/ } readdir($dh); closedir $dh; for my $m (@mans) { diff --git a/tests/test745.pl b/tests/test745.pl index 4395eb9681ab..766496f23853 100755 --- a/tests/test745.pl +++ b/tests/test745.pl @@ -26,7 +26,7 @@ use strict; use warnings; -# we may get the dir root pointed out +# we may get the directory root pointed out my $root=$ARGV[0] || "."; my %typecheck; # from the include file diff --git a/tests/test971.pl b/tests/test971.pl index b7046ac678dc..a0b900282bfd 100755 --- a/tests/test971.pl +++ b/tests/test971.pl @@ -24,7 +24,7 @@ ########################################################################### # # - Get all options mentioned in the $cmddir. -# - Make sure they're all mentioned in the $opts document +# - Make sure they are all mentioned in the $opts document # - Make sure that the version in $opts matches the version in the file in # $cmddir # @@ -45,7 +45,7 @@ sub cmdfiles { my ($dir)=@_; - opendir(my $dh, $dir) || die "Can't opendir $dir: $!"; + opendir(my $dh, $dir) || die "Cannot opendir $dir: $!"; my @opts = grep { /[a-z0-9].*\.md$/ && -f "$dir/$_" } readdir($dh); closedir $dh; diff --git a/tests/testcurl.pl b/tests/testcurl.pl index 4f3eade70347..109272da3f7d 100755 --- a/tests/testcurl.pl +++ b/tests/testcurl.pl @@ -33,8 +33,8 @@ # at a regular interval. The output is suitable to be mailed to # curl-autocompile@haxx.se to be dealt with automatically (make sure the # subject includes the word "autobuild" as the mail gets silently discarded -# otherwise). The most current build status (with a reasonable backlog) will -# be published on the curl site, at https://curl.se/auto/ +# otherwise). The most current build status (with a reasonable backlog) is +# published on the curl site, at https://curl.se/auto/ # USAGE: # testcurl.pl [options] [curl-daily-name] > output @@ -49,12 +49,12 @@ # --mktarball=[command] Command to run after completed test # --name=[name] Set name to report as # --notes=[notes] More human-readable information about this configuration -# --nocvsup Don't pull from git even though it is a git tree -# --nogitpull Don't pull from git even though it is a git tree -# --nobuildconf Don't run autoreconf -fi -# --noconfigure Don't run configure +# --nocvsup Do not pull from git even though it is a git tree +# --nogitpull Do not pull from git even though it is a git tree +# --nobuildconf Do not run autoreconf -fi +# --noconfigure Do not run configure # --runtestopts=[options] Options to pass to runtests.pl -# --setup=[file name] File name to read setup from (deprecated) +# --setup=[filename] Filename to read setup from (deprecated) # --target=[your os] Specify your target environment. # # if [curl-daily-name] is omitted, a 'curl' git directory is assumed. @@ -66,7 +66,7 @@ use Cwd; use File::Spec; -# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env) +# Turn on warnings (equivalent to -w, which cannot be used with /usr/bin/env) #BEGIN { $^W = 1; } use vars qw($version $fixed $infixed $CURLDIR $git $pwd $build $buildlog @@ -84,7 +84,7 @@ $version='2024-11-28'; $fixed=0; -# Determine if we're running from git or a canned copy of curl, +# Determine if we are running from git or a canned copy of curl, # or if we got a specific target option or setup file option. $CURLDIR="curl"; if(-f ".git/config") { @@ -362,7 +362,7 @@ sub get_host_triplet { $str1066os = undef; -# Make $pwd to become the path without newline. We'll use that in order to cut +# Make $pwd to become the path without newline. We use that in order to cut # off that path from all possible logs and error messages etc. $pwd = getcwd(); @@ -374,14 +374,14 @@ sub get_host_triplet { # remove the generated sources to force them to be re-generated each # time we run this test unlink "$CURLDIR/src/tool_hugehelp.c"; - # find out if curl source dir has an in-tree c-ares repo + # find out if curl source directory has an in-tree c-ares repo $have_embedded_ares = 1 if(-f "$CURLDIR/ares/GIT-INFO"); } elsif(!$git && -f "$CURLDIR/tests/testcurl.pl") { logit "$CURLDIR is verified to be a fine daily source dir"; - # find out if curl source dir has an in-tree c-ares extracted tarball + # find out if curl source directory has an in-tree c-ares extracted tarball $have_embedded_ares = 1 if(-f "$CURLDIR/ares/ares_build.h"); } else { - mydie "$CURLDIR is not a daily source dir or checked out from git!" + mydie "$CURLDIR is not a daily source directory or checked out from git!" } } @@ -399,13 +399,13 @@ sub get_host_triplet { # this is to remove old build logs that ended up in the wrong dir foreach(glob("$CURLDIR/buildlog-*")) { unlink $_; } -# create a dir to build in +# create a directory to build in mkdir $build, 0777; if(-d $build) { - logit "build dir $build was created fine"; + logit "build directory $build was created fine"; } else { - mydie "failed to create dir $build"; + mydie "failed to create directory $build"; } # get in the curl source tree root @@ -500,7 +500,7 @@ sub get_host_triplet { } } -# Set timestamp to the one in curlver.h if this isn't a git test build. +# Set timestamp to the one in curlver.h if this is not a git test build. if((-f "include/curl/curlver.h") && (open(my $f, "<", "include/curl/curlver.h"))) { while(<$f>) { @@ -548,7 +548,7 @@ sub findinpath { my $make = findinpath("gmake", "make", "nmake"); if(!$make) { - mydie "Couldn't find make in the PATH"; + mydie "Could not find make in the PATH"; } # force to 'nmake' for VC builds $make = "nmake" if($targetos =~ /vc/); @@ -564,10 +564,10 @@ sub findinpath { if(-f "lib/Makefile") { logit "configure seems to have finished fine"; } else { - mydie "configure didn't work"; + mydie "configure did not work"; } } else { - logit "copying files to build dir ..."; + logit "copying files to build directory ..."; if($^O eq 'MSWin32') { system("xcopy /s /q \"$CURLDIR\" ."); } @@ -777,7 +777,7 @@ sub findinpath { close($log); chdir "$pwd/$build"; } - logit_spaced "cross-compiling, can't run tests"; + logit_spaced "cross-compiling, cannot run tests"; } # dummy message to feign success print "TESTDONE: 1 tests out of 0 (dummy message)\n"; diff --git a/tests/testutil.pm b/tests/testutil.pm index 35fe4bd633b3..6317a5e93138 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -183,7 +183,7 @@ sub subnewlines { } else { if(($$thing =~ /^\n\z/) && $prevupdate) { - # if there's a blank link after a line we update, we hope it is + # if there is a blank link after a line we update, we hope it is # the empty line following headers $$thing =~ s/\x0a/\x0d\x0a/; } diff --git a/tests/unit/README.md b/tests/unit/README.md index 80e2c5c46930..190821b33bde 100644 --- a/tests/unit/README.md +++ b/tests/unit/README.md @@ -47,7 +47,7 @@ For the actual C file, here's a simple example: ~~~c #include "unitcheck.h" - #include "a libcurl header.h" /* from the lib dir */ + #include "a libcurl header.h" /* from the lib directory */ static CURLcode test_unit9998(const char *arg) { @@ -68,7 +68,7 @@ Here's an example using optional initialization and cleanup: ~~~c #include "unitcheck.h" - #include "a libcurl header.h" /* from the lib dir */ + #include "a libcurl header.h" /* from the lib directory */ static CURLcode t9999_setup(void) { diff --git a/tests/unit/unit1300.c b/tests/unit/unit1300.c index a5ddf11f498c..77fb1fb38639 100644 --- a/tests/unit/unit1300.c +++ b/tests/unit/unit1300.c @@ -127,7 +127,7 @@ static CURLcode test_unit1300(const char *arg) fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == &unusedData_case2, "the node next to head is not getting set correctly"); - /* better safe than sorry, check that the tail isn't corrupted */ + /* better safe than sorry, check that the tail is not corrupted */ fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) != &unusedData_case2, "the list tail is not getting set correctly"); diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c index b02cb3abad04..03673c544e29 100644 --- a/tests/unit/unit1303.c +++ b/tests/unit/unit1303.c @@ -47,7 +47,7 @@ static void t1303_stop(struct Curl_easy *easy) } /* BASE is just a define to make us fool around with decently large number so - that we aren't zero-based */ + that we are not zero-based */ #define BASE 1000000 /* macro to set the pretended current time */ diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c index 248adb99c255..d5fcf5c6b1ed 100644 --- a/tests/unit/unit1307.c +++ b/tests/unit/unit1307.c @@ -186,13 +186,13 @@ static CURLcode test_unit1307(const char *arg) { "[[:foo:]]", "bar", NOMATCH|MAC_FAIL}, { "[[:foo:]]", "f]", MATCH|LINUX_NOMATCH|MAC_FAIL}, - { "Curl[[:blank:]];-)", "Curl ;-)", MATCH }, + { "curl[[:blank:]];-)", "curl ;-)", MATCH }, { "*[[:blank:]]*", " ", MATCH }, { "*[[:blank:]]*", "", NOMATCH }, { "*[[:blank:]]*", "hi, im_Pavel", MATCH }, /* common using */ - { "filename.dat", "filename.dat", MATCH }, + { "Filename.dat", "Filename.dat", MATCH }, { "*curl*", "lets use curl!!", MATCH }, { "filename.txt", "filename.dat", NOMATCH }, { "*.txt", "text.txt", MATCH }, diff --git a/tests/unit/unit1605.c b/tests/unit/unit1605.c index a092ff163976..8b1ec447caee 100644 --- a/tests/unit/unit1605.c +++ b/tests/unit/unit1605.c @@ -54,10 +54,10 @@ static CURLcode test_unit1605(const char *arg) char *esc; esc = curl_easy_escape(easy, "", -1); - fail_unless(esc == NULL, "negative string length can't work"); + fail_unless(esc == NULL, "negative string length cannot work"); esc = curl_easy_unescape(easy, "%41%41%41%41", -1, &len); - fail_unless(esc == NULL, "negative string length can't work"); + fail_unless(esc == NULL, "negative string length cannot work"); UNITTEST_END(t1605_stop(easy)) } diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index dda67697829e..089caa1c45b8 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -66,7 +66,7 @@ static CURLcode test_unit1607(const char *arg) /* CURLOPT_RESOLVE address parsing tests */ static const struct testcase tests[] = { - /* spaces aren't allowed, for now */ + /* spaces are not allowed, for now */ { "test.com:80:127.0.0.1, 127.0.0.2", "test.com", 80, TRUE, { NULL, } }, diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index 26934d89bf45..00164617f522 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -85,7 +85,7 @@ static CURLcode test_unit1609(const char *arg) }; static const struct testcase tests[] = { - /* spaces aren't allowed, for now */ + /* spaces are not allowed, for now */ { "test.com:80:127.0.0.1", "test.com", 80, { "127.0.0.1", } }, diff --git a/tests/unit/unit1652.c b/tests/unit/unit1652.c index 0b3337f6888f..d90dea36d4ae 100644 --- a/tests/unit/unit1652.c +++ b/tests/unit/unit1652.c @@ -37,7 +37,7 @@ static char output[4096]; /* * This debugf callback is simply dumping the string into the static buffer - * for the unit test to inspect. Since we know that we're only dealing with + * for the unit test to inspect. Since we know that we are only dealing with * text we can afford the luxury of skipping the type check here. */ static int debugf_cb(CURL *handle, curl_infotype type, char *buf, size_t size, diff --git a/tests/unit/unit1653.c b/tests/unit/unit1653.c index 1e6fd9ef269c..714b52a8e60f 100644 --- a/tests/unit/unit1653.c +++ b/tests/unit/unit1653.c @@ -173,7 +173,7 @@ static CURLcode test_unit1653(const char *arg) free_and_clear(ipv6port); curl_url_cleanup(u); - /* Incorrect zone index syntax, but the port extractor doesn't care */ + /* Incorrect zone index syntax, but the port extractor does not care */ u = curl_url(); if(!u) goto fail; diff --git a/tests/unit/unit1654.c b/tests/unit/unit1654.c index d2144fc21423..c16a9ebfd6ff 100644 --- a/tests/unit/unit1654.c +++ b/tests/unit/unit1654.c @@ -119,13 +119,13 @@ static CURLcode test_unit1654(const char *arg) ALPN_h2, "6.example.net", 80); fail_if(res, "Curl_altsvc_parse(9) failed!"); - /* missing port in host name */ + /* missing port in hostname */ res = Curl_altsvc_parse(curl, asi, "h2=\"example.net\"; ma=\"180\";\r\n", ALPN_h2, "7.example.net", 80); fail_if(res, "Curl_altsvc_parse(10) failed!"); - /* illegal port in host name */ + /* illegal port in hostname */ res = Curl_altsvc_parse(curl, asi, "h2=\"example.net:70000\"; ma=\"180\";\r\n", ALPN_h2, "8.example.net", 80); diff --git a/tests/unit/unit1655.c b/tests/unit/unit1655.c index 8b49fb32f89e..ab42b971ef51 100644 --- a/tests/unit/unit1655.c +++ b/tests/unit/unit1655.c @@ -23,7 +23,7 @@ ***************************************************************************/ #include "unitcheck.h" -#include "doh.h" /* from the lib dir */ +#include "doh.h" static CURLcode test_unit1655(const char *arg) { diff --git a/tests/unit/unit1658.c b/tests/unit/unit1658.c index 3273c2141aae..d60fa96b8fd0 100644 --- a/tests/unit/unit1658.c +++ b/tests/unit/unit1658.c @@ -23,7 +23,7 @@ ***************************************************************************/ #include "unitcheck.h" -#include "doh.h" /* from the lib dir */ +#include "doh.h" /* DoH + HTTPSRR are required */ #if !defined(CURL_DISABLE_DOH) && defined(USE_HTTPSRR) diff --git a/tests/util.py b/tests/util.py index 4d08ecc93a81..3982f2b67117 100755 --- a/tests/util.py +++ b/tests/util.py @@ -66,7 +66,7 @@ def __init__(self, data_folder): self.data_folder = data_folder def get_test_data(self, test_number): - # Create the test file name + # Create the test filename filename = os.path.join(self.data_folder, "test{0}".format(test_number)) @@ -77,9 +77,9 @@ def get_test_data(self, test_number): m = REPLY_DATA.search(contents) if not m: - raise Exception("Couldn't find a section") + raise Exception("Could not find a section") - # Left-strip the data so we don't get a newline before our data. + # Left-strip the data so we do not get a newline before our data. return m.group(1).lstrip() From 1b48c6148a0708f401e2cef8aaee445ffb689ea9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 25 Oct 2025 23:32:14 +0200 Subject: [PATCH 411/885] tidy-up: miscellaneous - schannel: delete superfluous parenthesis. - tftp: delete stray space from log output. - ws: update guard comment. - docs/examples: constify variables. - runtests/servers: enclose unknown parameter between quotes. - scripts/perlcheck.sh: drop redundant grep `-E` option. - THANKS: move names from comments to THANKS. - sync `--depth` option style across scripts. - sync git repo URL ending between some scripts. - BINDINGS.md: drop protocol from archive.org URL path. - whitespace, indent, unfold lines. Closes #19565 --- .github/workflows/http3-linux.yml | 20 ++++++++++---------- .github/workflows/linux.yml | 2 +- CMakeLists.txt | 13 ++++++------- docs/BINDINGS.md | 2 +- docs/HTTP3.md | 2 +- docs/THANKS | 4 +++- docs/examples/crawler.c | 2 +- docs/examples/ftpuploadfrommem.c | 2 +- docs/examples/ftpuploadresume.c | 2 +- docs/examples/ghiper.c | 4 ++-- docs/examples/headerapi.c | 2 +- docs/examples/http2-upload.c | 2 +- docs/examples/multi-debugcallback.c | 2 +- lib/cf-socket.c | 24 ++++++++---------------- lib/curl_ntlm_core.c | 6 +++--- lib/parsedate.c | 2 +- lib/tftp.c | 4 ++-- lib/vtls/rustls.c | 2 +- lib/vtls/schannel.c | 4 ++-- lib/ws.c | 2 +- scripts/mk-ca-bundle.pl | 2 +- scripts/perlcheck.sh | 2 +- tests/ech_combos.py | 8 +++----- tests/ftpserver.pl | 2 +- tests/getpart.pm | 2 +- tests/http-server.pl | 2 +- tests/http2-server.pl | 2 +- tests/http3-server.pl | 2 +- tests/rtspserver.pl | 2 +- tests/secureserver.pl | 2 +- tests/sshserver.pl | 2 +- tests/tftpserver.pl | 2 +- 32 files changed, 62 insertions(+), 71 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index a844eb6c1422..2979e9d7d16c 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -189,7 +189,7 @@ jobs: if: ${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl + git clone --quiet --depth 1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl cd openssl ./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated make @@ -232,7 +232,7 @@ jobs: if: ${{ steps.cache-gnutls.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls.git + git clone --quiet --depth 1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls cd gnutls # required: nettle-dev libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin ./bootstrap @@ -247,7 +247,7 @@ jobs: if: ${{ steps.cache-wolfssl.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl.git + git clone --quiet --depth 1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl cd wolfssl ./autogen.sh ./configure --disable-dependency-tracking --enable-all --enable-quic \ @@ -259,9 +259,9 @@ jobs: if: ${{ steps.cache-nghttp3.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3 + git clone --quiet --depth 1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3 cd nghttp3 - git submodule update --init --depth=1 + git submodule update --init --depth 1 autoreconf -fi ./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only make @@ -272,7 +272,7 @@ jobs: # building twice to get crypto libs for ossl, libressl and awslc installed run: | cd ~ - git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 + git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 cd ngtcp2 autoreconf -fi ./configure --disable-dependency-tracking --prefix="$PWD"/build \ @@ -290,7 +290,7 @@ jobs: if: ${{ steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl + git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl cd ngtcp2-boringssl autoreconf -fi ./configure --disable-dependency-tracking --prefix="$PWD"/build \ @@ -303,9 +303,9 @@ jobs: if: ${{ steps.cache-nghttp2.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2 + git clone --quiet --depth 1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2 cd nghttp2 - git submodule update --init --depth=1 + git submodule update --init --depth 1 autoreconf -fi # required (for nghttpx application): libc-ares-dev libev-dev zlib1g-dev # optional (for nghttpx application): libbrotli-dev @@ -578,7 +578,7 @@ jobs: if: ${{ matrix.build.name == 'quiche' && steps.cache-quiche.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth=1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche.git + git clone --quiet --depth 1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche cd quiche #### Work-around https://github.com/curl/curl/issues/7927 ####### #### See https://github.com/alexcrichton/cmake-rs/issues/131 #### diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 90376ac50572..4cea194c765e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -580,7 +580,7 @@ jobs: - name: 'build openssl (thread sanitizer)' if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true' }} run: | - git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl + git clone --quiet --depth 1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl cd openssl CC=clang CFLAGS='-fsanitize=thread' LDFLAGS='-fsanitize=thread' ./config --prefix=/home/runner/openssl --libdir=lib no-makedepend no-apps no-docs no-tests make diff --git a/CMakeLists.txt b/CMakeLists.txt index 8876b5e636f1..30cb5f398e59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,6 @@ # SPDX-License-Identifier: curl # ########################################################################### -# by Tetetest and Sukender (Benoit Neil) cmake_minimum_required(VERSION 3.7...3.16 FATAL_ERROR) message(STATUS "Using CMake version ${CMAKE_VERSION}") @@ -1741,9 +1740,9 @@ check_function_exists("eventfd" HAVE_EVENTFD) check_symbol_exists("ftruncate" "unistd.h" HAVE_FTRUNCATE) check_symbol_exists("getpeername" "${CURL_INCLUDES}" HAVE_GETPEERNAME) # winsock2.h unistd.h proto/bsdsocket.h check_symbol_exists("getsockname" "${CURL_INCLUDES}" HAVE_GETSOCKNAME) # winsock2.h unistd.h proto/bsdsocket.h -check_function_exists("getrlimit" HAVE_GETRLIMIT) -check_function_exists("setlocale" HAVE_SETLOCALE) -check_function_exists("setrlimit" HAVE_SETRLIMIT) +check_function_exists("getrlimit" HAVE_GETRLIMIT) +check_function_exists("setlocale" HAVE_SETLOCALE) +check_function_exists("setrlimit" HAVE_SETRLIMIT) if(WIN32) # include wincrypt.h as a workaround for mingw-w64 __MINGW64_VERSION_MAJOR <= 5 header bug */ @@ -1752,9 +1751,9 @@ else() check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h check_function_exists("realpath" HAVE_REALPATH) check_function_exists("sched_yield" HAVE_SCHED_YIELD) - check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP) - check_symbol_exists("stricmp" "string.h" HAVE_STRICMP) - check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI) + check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP) + check_symbol_exists("stricmp" "string.h" HAVE_STRICMP) + check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI) endif() check_function_exists("setmode" HAVE_SETMODE) diff --git a/docs/BINDINGS.md b/docs/BINDINGS.md index 9ddbde5c425d..065126efd723 100644 --- a/docs/BINDINGS.md +++ b/docs/BINDINGS.md @@ -61,7 +61,7 @@ Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang [Haskell](https://hackage.haskell.org/package/curl) Written by Galois, Inc -[Hollywood](https://web.archive.org/web/20250116185836/https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn +[Hollywood](https://web.archive.org/web/20250116185836/www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn [Java](https://github.com/covers1624/curl4j) diff --git a/docs/HTTP3.md b/docs/HTTP3.md index b3ddcbaaf832..def30798ecca 100644 --- a/docs/HTTP3.md +++ b/docs/HTTP3.md @@ -54,7 +54,7 @@ versions do not work. Build OpenSSL (version 3.5.0 or newer): - % git clone --quiet --depth=1 -b openssl-$OPENSSL_VERSION https://github.com/openssl/openssl + % git clone --depth 1 -b openssl-$OPENSSL_VERSION https://github.com/openssl/openssl % cd openssl % ./config --prefix= --libdir=lib % make diff --git a/docs/THANKS b/docs/THANKS index fd4015468e4a..d3b3efc0f11f 100644 --- a/docs/THANKS +++ b/docs/THANKS @@ -361,7 +361,7 @@ Benjamin Sergeant Ben Kohler Ben Madsen Ben Noordhuis -Benoit Neil +Benoit Neil (Sukender) Benoit Pierre Benoit Sigoure Ben Van Hof @@ -3148,6 +3148,7 @@ Temprimus Terence Eden Terri Oda Terry Wu +Tetetest thanhchungbtc on github TheAssassin on github TheBitBrine @@ -3328,6 +3329,7 @@ UrsusArctos on github User Sg ustcqidi on github Vadim Grinshpun +Vaibhav Kumar Valentin David Valentín Gutiérrez Valentin Richter diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index 4812a67d1426..bda931eb13ae 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -170,7 +170,7 @@ static size_t follow_links(CURLM *multi, struct memory *mem, return count; } -static int is_html(char *ctype) +static int is_html(const char *ctype) { return ctype != NULL && strlen(ctype) > 10 && strstr(ctype, "text/html"); } diff --git a/docs/examples/ftpuploadfrommem.c b/docs/examples/ftpuploadfrommem.c index 3ae71fa4aba4..9baf538b9948 100644 --- a/docs/examples/ftpuploadfrommem.c +++ b/docs/examples/ftpuploadfrommem.c @@ -48,7 +48,7 @@ struct WriteThis { static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct WriteThis *upload = (struct WriteThis *)userp; - size_t max = size*nmemb; + size_t max = size * nmemb; if(max < 1) return 0; diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index e9d723d70d66..b86c23ab8672 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -39,7 +39,7 @@ static size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, r = sscanf(ptr, "Content-Length: %ld\n", &len); if(r == 1) - *((long *) stream) = len; + *((long *)stream) = len; return size * nmemb; } diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index 45c129faea09..b9edb517d32d 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -430,9 +430,9 @@ int init_fifo(void) int main(void) { struct GlobalInfo *g = g_malloc0(sizeof(struct GlobalInfo)); - GMainLoop*gmain; + GMainLoop *gmain; int fd; - GIOChannel* ch; + GIOChannel *ch; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) diff --git a/docs/examples/headerapi.c b/docs/examples/headerapi.c index 428374bac667..18588cf33f67 100644 --- a/docs/examples/headerapi.c +++ b/docs/examples/headerapi.c @@ -33,7 +33,7 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp) /* take care of the data here, ignored in this example */ (void)data; (void)userp; - return n*l; + return n * l; } int main(void) diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 84b0e18ea12b..0365d93bc5ec 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -88,7 +88,7 @@ struct input { int num; }; -static void dump(const char *text, int num, unsigned char *ptr, +static void dump(const char *text, int num, const unsigned char *ptr, size_t size, char nohex) { size_t i; diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c index d838feed4075..52f00ce482ea 100644 --- a/docs/examples/multi-debugcallback.c +++ b/docs/examples/multi-debugcallback.c @@ -34,7 +34,7 @@ #define TRUE 1 -static void dump(const char *text, FILE *stream, unsigned char *ptr, +static void dump(const char *text, FILE *stream, const unsigned char *ptr, size_t size, char nohex) { size_t i; diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 8661647ba52b..80ed21272132 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -171,8 +171,7 @@ tcpkeepalive(struct Curl_cfilter *cf, if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set SO_KEEPALIVE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } else { #ifdef USE_WINSOCK @@ -187,22 +186,19 @@ tcpkeepalive(struct Curl_cfilter *cf, if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (const char *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } optval = curlx_sltosi(data->set.tcp_keepintvl); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, (const char *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } optval = curlx_sltosi(data->set.tcp_keepcnt); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, (const char *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } } else @@ -239,8 +235,7 @@ tcpkeepalive(struct Curl_cfilter *cf, if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE) /* macOS style */ @@ -249,8 +244,7 @@ tcpkeepalive(struct Curl_cfilter *cf, if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE_THRESHOLD) /* Solaris <11.4 style */ @@ -259,8 +253,7 @@ tcpkeepalive(struct Curl_cfilter *cf, if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_THRESHOLD, (void *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #endif #ifdef TCP_KEEPINTVL @@ -269,8 +262,7 @@ tcpkeepalive(struct Curl_cfilter *cf, if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, (void *)&optval, sizeof(optval)) < 0) { CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd " - "%" FMT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE_ABORT_THRESHOLD) /* Solaris <11.4 style */ diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index 28ae16d187a5..d013929d4da6 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -469,13 +469,13 @@ static void time2filetime(struct ms_filetime *ft, time_t t) { #if SIZEOF_TIME_T > 4 t = (t + (curl_off_t)11644473600) * 10000000; - ft->dwLowDateTime = (unsigned int) (t & 0xFFFFFFFF); - ft->dwHighDateTime = (unsigned int) (t >> 32); + ft->dwLowDateTime = (unsigned int)(t & 0xFFFFFFFF); + ft->dwHighDateTime = (unsigned int)(t >> 32); #else unsigned int r, s; unsigned int i; - ft->dwLowDateTime = (unsigned int)t & 0xFFFFFFFF; + ft->dwLowDateTime = (unsigned int)(t & 0xFFFFFFFF); ft->dwHighDateTime = 0; # ifndef HAVE_TIME_T_UNSIGNED diff --git a/lib/parsedate.c b/lib/parsedate.c index 3fa5919c0536..2c3eb67fd2e6 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -286,7 +286,7 @@ enum assume { static time_t time2epoch(int sec, int min, int hour, int mday, int mon, int year) { - static const int month_days_cumulative [12] = + static const int month_days_cumulative[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int leap_days = year - (mon <= 1); leap_days = ((leap_days / 4) - (leap_days / 100) + (leap_days / 400) diff --git a/lib/tftp.c b/lib/tftp.c index 91a8c25ff315..c730f8499ec4 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -241,7 +241,7 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state) state->retry_time = 1; infof(state->data, - "set timeouts for state %d; Total % " FMT_OFF_T ", retry %d maxtry %d", + "set timeouts for state %d; Total %" FMT_OFF_T ", retry %d maxtry %d", (int)state->state, timeout_ms, state->retry_time, state->retry_max); /* init RX time */ @@ -381,7 +381,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_conn *state, static CURLcode tftp_option_add(struct tftp_conn *state, size_t *csize, char *buf, const char *option) { - if(( strlen(option) + *csize + 1) > (size_t)state->blksize) + if((strlen(option) + *csize + 1) > (size_t)state->blksize) return CURLE_TFTP_ILLEGAL; strcpy(buf, option); *csize += strlen(option) + 1; diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index f5e328831670..3b5bea2c6fe7 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -494,7 +494,7 @@ cr_get_selected_ciphers(struct Curl_easy *data, for(j = 0; j < default_len; j++) { entry = rustls_default_crypto_provider_ciphersuites_get(j); if(rustls_supported_ciphersuite_protocol_version(entry) == - RUSTLS_TLS_VERSION_TLSV1_3) + RUSTLS_TLS_VERSION_TLSV1_3) continue; /* No duplicates allowed (so selected cannot overflow) */ diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 6311f4a41623..a40c440234ae 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -566,8 +566,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, } } - if((fInCert || blob) && (data->set.ssl.cert_type) && - (!curl_strequal(data->set.ssl.cert_type, "P12"))) { + if((fInCert || blob) && data->set.ssl.cert_type && + !curl_strequal(data->set.ssl.cert_type, "P12")) { failf(data, "schannel: certificate format compatibility error " " for %s", blob ? "(memory blob)" : data->set.ssl.primary.clientcert); diff --git a/lib/ws.c b/lib/ws.c index 5a61c65aa80d..140bdece47d8 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -2016,4 +2016,4 @@ CURL_EXTERN CURLcode curl_ws_start_frame(CURL *curl, return CURLE_NOT_BUILT_IN; } -#endif /* !CURL_DISABLE_WEBSOCKETS */ +#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */ diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index d4b5418e0c7b..71880653b2ba 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -357,7 +357,7 @@ (%) report "LWP is not available (LWP::UserAgent not found)"; exit 1; } - my $ua = new LWP::UserAgent(agent => "$0/$version"); + my $ua = new LWP::UserAgent(agent => "$0/$version"); $ua->env_proxy(); $resp = $ua->mirror($url, $txt); if($resp && $resp->code eq '304') { diff --git a/scripts/perlcheck.sh b/scripts/perlcheck.sh index 7ec23983d5e6..9e3c87f695c0 100755 --- a/scripts/perlcheck.sh +++ b/scripts/perlcheck.sh @@ -42,7 +42,7 @@ echo "parallel: ${procs}" elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then { git ls-files | grep -E '\.(pl|pm)$' - git grep -l -E '^#!/usr/bin/env perl' + git grep -l '^#!/usr/bin/env perl' } | sort -u else # strip off the leading ./ to make the grep regexes work properly diff --git a/tests/ech_combos.py b/tests/ech_combos.py index 66daaa373db4..4eba4de1c2f5 100755 --- a/tests/ech_combos.py +++ b/tests/ech_combos.py @@ -31,7 +31,7 @@ # ECH command line args def CombinationRepetitionUtil(chosen, arr, badarr, index, - r, start, end): + r, start, end): # Current combination is ready, # print it @@ -68,9 +68,9 @@ def CombinationRepetitionUtil(chosen, arr, badarr, index, # with next (Note that i+1 is passed, # but index is not changed) CombinationRepetitionUtil(chosen, arr, badarr, index + 1, - r, start, end) + r, start, end) CombinationRepetitionUtil(chosen, arr, badarr, index, - r, start + 1, end) + r, start + 1, end) # The main function that prints all # combinations of size r in arr[] of @@ -94,5 +94,3 @@ def CombinationRepetition(arr, badarr, n, r): n = len(arr) - 1 CombinationRepetition(arr, badarr, n, r) - -# This code is contributed by Vaibhav Kumar 12. diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 10ac7c7c143a..0ca3ac52811e 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -3044,7 +3044,7 @@ sub customize { } } else { - print STDERR "\nWarning: ftpserver.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: ftpserver.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/getpart.pm b/tests/getpart.pm index c9382ad7f22e..ba611d761f0a 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -398,7 +398,7 @@ sub writearray { my ($filename, $arrayref)=@_; open(my $temp, ">", "$filename") || die "Failure writing file"; - binmode($temp,":raw"); # Cygwin fix by Kevin Roth + binmode($temp,":raw"); # Cygwin fix for(@$arrayref) { print $temp $_; } diff --git a/tests/http-server.pl b/tests/http-server.pl index d100caef6854..006b6f381781 100755 --- a/tests/http-server.pl +++ b/tests/http-server.pl @@ -140,7 +140,7 @@ BEGIN $verbose = 1; } else { - print STDERR "\nWarning: http-server.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: http-server.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/http2-server.pl b/tests/http2-server.pl index 73dbf62e40e7..3ab38803f174 100755 --- a/tests/http2-server.pl +++ b/tests/http2-server.pl @@ -102,7 +102,7 @@ } } elsif($ARGV[0]) { - print STDERR "\nWarning: http2-server.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: http2-server.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/http3-server.pl b/tests/http3-server.pl index b7f9dd3009f3..13cc49a9dff0 100755 --- a/tests/http3-server.pl +++ b/tests/http3-server.pl @@ -102,7 +102,7 @@ } } else { - print STDERR "\nWarning: http3-server.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: http3-server.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/rtspserver.pl b/tests/rtspserver.pl index d2e133907338..d23ed7e6373e 100755 --- a/tests/rtspserver.pl +++ b/tests/rtspserver.pl @@ -104,7 +104,7 @@ BEGIN $verbose = 1; } else { - print STDERR "\nWarning: rtspserver.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: rtspserver.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/secureserver.pl b/tests/secureserver.pl index a773a86b869b..0e34bf1d7c5d 100755 --- a/tests/secureserver.pl +++ b/tests/secureserver.pl @@ -176,7 +176,7 @@ sub exit_signal_handler { $mtls = 1; } else { - print STDERR "\nWarning: secureserver.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: secureserver.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/sshserver.pl b/tests/sshserver.pl index 20aceebc24e3..ae1a2579f219 100755 --- a/tests/sshserver.pl +++ b/tests/sshserver.pl @@ -191,7 +191,7 @@ sub logmsg { } } else { - print STDERR "\nWarning: sshserver.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: sshserver.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } diff --git a/tests/tftpserver.pl b/tests/tftpserver.pl index 862d21cd137c..bb96bb743ead 100755 --- a/tests/tftpserver.pl +++ b/tests/tftpserver.pl @@ -104,7 +104,7 @@ BEGIN $verbose = 1; } else { - print STDERR "\nWarning: tftpserver.pl unknown parameter: $ARGV[0]\n"; + print STDERR "\nWarning: tftpserver.pl unknown parameter: '$ARGV[0]'\n"; } shift @ARGV; } From e9a973c513d232d7746664783fa4bce790e583b4 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Mon, 17 Nov 2025 09:25:22 +0100 Subject: [PATCH 412/885] build: exclude clang prereleases from compiler warning options Starting with clang 18, stable clang releases start with minor version 1. Exclude pre-releases with minor version 0 from the compiler warning options for that major version. This fixes the build with Android NDK r29, which uses a prerelease version of clang 21 that doesn't know the new options yet. Closes #19566 --- CMake/PickyWarnings.cmake | 14 +++++++------- m4/curl-compilers.m4 | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMake/PickyWarnings.cmake b/CMake/PickyWarnings.cmake index d46c878d46b4..e9a0d61c0ef6 100644 --- a/CMake/PickyWarnings.cmake +++ b/CMake/PickyWarnings.cmake @@ -232,20 +232,20 @@ if(PICKY_COMPILER) -Wcast-function-type-strict # clang 16.0 appleclang 16.0 ) endif() - if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.0) + if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) list(APPEND _picky_enable - -Warray-compare # clang 20.0 gcc 12.0 appleclang ? - -Wc++-hidden-decl # clang 21.0 appleclang ? - -Wno-implicit-void-ptr-cast # clang 21.0 appleclang ? - -Wtentative-definition-compat # clang 21.0 appleclang ? + -Warray-compare # clang 20.1 gcc 12.0 appleclang ? + -Wc++-hidden-decl # clang 21.1 appleclang ? + -Wno-implicit-void-ptr-cast # clang 21.1 appleclang ? + -Wtentative-definition-compat # clang 21.1 appleclang ? ) if(WIN32) list(APPEND _picky_enable - -Wno-c++-keyword # clang 21.0 appleclang ? # `wchar_t` triggers it on Windows + -Wno-c++-keyword # clang 21.1 appleclang ? # `wchar_t` triggers it on Windows ) else() list(APPEND _picky_enable - -Wc++-keyword # clang 21.0 appleclang ? + -Wc++-keyword # clang 21.1 appleclang ? ) endif() endif() diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 0e4c4e2655b0..9aab2736a7eb 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -937,11 +937,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [cast-function-type-strict]) # with Apple clang it requires 16.0 or above fi dnl clang 20 or later - if test "$compiler_num" -ge "2000"; then + if test "$compiler_num" -ge "2001"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [array-compare]) fi dnl clang 21 or later - if test "$compiler_num" -ge "2100"; then + if test "$compiler_num" -ge "2101"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [c++-hidden-decl]) tmp_CFLAGS="$tmp_CFLAGS -Wno-implicit-void-ptr-cast" CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [tentative-definition-compat]) From b42f226b94409defd7487347b543911f18eb1468 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 17 Nov 2025 18:36:42 +0800 Subject: [PATCH 413/885] libssh: properly free sftp_attributes Closes #19564 --- lib/vssh/libssh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 8653c4901d39..9428a20a5f39 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1137,14 +1137,13 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data, attrs = sftp_stat(sshc->sftp_session, sshp->path); if(attrs) { curl_off_t size = attrs->size; + sftp_attributes_free(attrs); if(size < 0) { failf(data, "Bad file size (%" FMT_OFF_T ")", size); rc = myssh_to_ERROR(data, sshc, CURLE_BAD_DOWNLOAD_RESUME); return rc; } - data->state.resume_from = attrs->size; - - sftp_attributes_free(attrs); + data->state.resume_from = size; } else { data->state.resume_from = 0; From a6c940a7523a05822e40a164e949341009a3ff44 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 17 Nov 2025 02:25:57 +0800 Subject: [PATCH 414/885] schannel_verify: fix a memory leak of cert_context Closes #19556 --- lib/vtls/schannel_verify.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index 6b8aec561374..72c42ed35341 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -166,6 +166,7 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, cert_blob.pbData = (BYTE *)CURL_UNCONST(begin_cert_ptr); cert_blob.cbData = cert_size; + /* Caution: CryptQueryObject() is deprecated */ if(!CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &cert_blob, CERT_QUERY_CONTENT_FLAG_CERT, @@ -204,7 +205,6 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, cert_context, CERT_STORE_ADD_ALWAYS, NULL); - CertFreeCertificateContext(cert_context); if(!add_cert_result) { char buffer[WINAPI_ERROR_LEN]; failf(data, @@ -220,6 +220,21 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, num_certs++; } } + + switch(actual_content_type) { + case CERT_QUERY_CONTENT_CERT: + case CERT_QUERY_CONTENT_SERIALIZED_CERT: + CertFreeCertificateContext(cert_context); + break; + case CERT_QUERY_CONTENT_CRL: + case CERT_QUERY_CONTENT_SERIALIZED_CRL: + CertFreeCRLContext((PCCRL_CONTEXT)cert_context); + break; + case CERT_QUERY_CONTENT_CTL: + case CERT_QUERY_CONTENT_SERIALIZED_CTL: + CertFreeCTLContext((PCCTL_CONTEXT)cert_context); + break; + } } } } From 22b8a6430dca99b4db7170fd02b2041f538fd1bd Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 17 Nov 2025 14:12:14 +0800 Subject: [PATCH 415/885] openssl: fix a potential memory leak of params.cert Closes #19560 --- lib/vtls/openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 72ca0f6cb38b..9b3ca9b5eaec 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1214,6 +1214,7 @@ static int engineload(struct Curl_easy *data, failf(data, "unable to set client certificate [%s]", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); + X509_free(params.cert); return 0; } X509_free(params.cert); /* we do not need the handle any more... */ From 11c0aaa339fb1c52e3952264b7bad776fe43441f Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 17 Nov 2025 14:26:24 +0800 Subject: [PATCH 416/885] openssl: fix a potential memory leak of bio_out Closes #19561 --- lib/vtls/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 9b3ca9b5eaec..fd6396471c92 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1625,8 +1625,8 @@ static CURLcode x509_name_oneline(X509_NAME *a, struct dynbuf *d) if(rc != -1) { BIO_get_mem_ptr(bio_out, &biomem); result = curlx_dyn_addn(d, biomem->data, biomem->length); - BIO_free(bio_out); } + BIO_free(bio_out); } return result; } From 821cba8facfea8394b4e9f9401700758cd0a63e3 Mon Sep 17 00:00:00 2001 From: x2018 Date: Mon, 17 Nov 2025 19:37:35 +0800 Subject: [PATCH 417/885] digest_sspi: fix a memory leak on error path Closes #19567 --- lib/vauth/digest_sspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index f04c3845abe9..f730c52987a3 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -583,6 +583,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, /* Allocate our new context handle */ digest->http_context = calloc(1, sizeof(CtxtHandle)); if(!digest->http_context) { + Curl_pSecFn->FreeCredentialsHandle(&credentials); curlx_unicodefree(spn); Curl_sspi_free_identity(p_identity); free(output_token); From 4075339db28b49beffd304375841ea1c2f96681e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 14:53:33 +0100 Subject: [PATCH 418/885] projects/README.md: Markdown fixes Closes #19569 --- projects/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/README.md b/projects/README.md index 1777074c6d05..bf373accdecd 100644 --- a/projects/README.md +++ b/projects/README.md @@ -105,7 +105,7 @@ that: 3. Navigate to 'Configuration Properties > Debugging > Environment' 4. Add `PATH='Path to DLL';C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem` -... where 'Path to DLL` is the configuration specific path. For example the +... where `Path to DLL` is the configuration specific path. For example the following configurations in Visual Studio 2010 might be: DLL Debug - DLL OpenSSL (Win32): @@ -119,7 +119,7 @@ DLL Debug - DLL OpenSSL (x64): C:\Windows;C:\Windows\System32\Wbem If you are using a configuration that uses multiple third-party library DLLs -(such as DLL Debug - DLL OpenSSL - DLL libssh2) then 'Path to DLL' need to +(such as `DLL Debug - DLL OpenSSL - DLL libssh2`) then 'Path to DLL' need to contain the path to both of these. ## Notes From 2459dc7a2221b04c7c27e144bcef879c69c795f5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 17 Nov 2025 13:28:48 +0100 Subject: [PATCH 419/885] http: the :authority header should never contain user+password Pointed-out-by: Stanislav Fort Closes #19568 --- lib/http.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/lib/http.c b/lib/http.c index 7458d8b6400b..aa921fd60248 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4558,12 +4558,12 @@ CURLcode Curl_http_req_make(struct httpreq **preq, static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) { - char *user, *pass, *host, *port; + char *host, *port; struct dynbuf buf; CURLUcode uc; CURLcode result = CURLE_URL_MALFORMAT; - user = pass = host = port = NULL; + host = port = NULL; curlx_dyn_init(&buf, DYN_HTTP_REQUEST); uc = curl_url_get(url, CURLUPART_HOST, &host, 0); @@ -4578,28 +4578,7 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) uc = curl_url_get(url, CURLUPART_PORT, &port, CURLU_NO_DEFAULT_PORT); if(uc && uc != CURLUE_NO_PORT) goto out; - uc = curl_url_get(url, CURLUPART_USER, &user, 0); - if(uc && uc != CURLUE_NO_USER) - goto out; - if(user) { - uc = curl_url_get(url, CURLUPART_PASSWORD, &pass, 0); - if(uc && uc != CURLUE_NO_PASSWORD) - goto out; - } - if(user) { - result = curlx_dyn_add(&buf, user); - if(result) - goto out; - if(pass) { - result = curlx_dyn_addf(&buf, ":%s", pass); - if(result) - goto out; - } - result = curlx_dyn_add(&buf, "@"); - if(result) - goto out; - } result = curlx_dyn_add(&buf, host); if(result) goto out; @@ -4614,8 +4593,6 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) result = CURLE_OK; out: - free(user); - free(pass); free(host); free(port); curlx_dyn_free(&buf); From ea105708c973bfbf2e3ae2881693d10c321b92c0 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 17 Nov 2025 09:56:48 +0100 Subject: [PATCH 420/885] h2/h3: handle methods with spaces The parsing of the HTTP/1.1 formatted request into the h2/h3 header structures should detect CURLOPT_CUSTOMREQUEST methods and forward them correctly. Add test_01_20 to verify Fixes #19543 Reported-by: Omdahake on github Closes #19563 --- lib/http1.c | 23 ++++++++++++++++------- lib/http1.h | 5 +++-- lib/http2.c | 5 ++++- lib/vquic/curl_ngtcp2.c | 5 ++++- lib/vquic/curl_osslq.c | 5 ++++- lib/vquic/curl_quiche.c | 5 ++++- tests/http/test_01_basic.py | 22 ++++++++++++++++++++++ tests/unit/unit2603.c | 31 +++++++++++++++++++++++-------- 8 files changed, 80 insertions(+), 21 deletions(-) diff --git a/lib/http1.c b/lib/http1.c index 0403e95ba20b..c487597e3492 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -134,7 +134,9 @@ static ssize_t next_line(struct h1_req_parser *parser, } static CURLcode start_req(struct h1_req_parser *parser, - const char *scheme_default, int options) + const char *scheme_default, + const char *custom_method, + int options) { const char *p, *m, *target, *hv, *scheme, *authority, *path; size_t m_len, target_len, hv_len, scheme_len, authority_len, path_len; @@ -144,9 +146,15 @@ static CURLcode start_req(struct h1_req_parser *parser, DEBUGASSERT(!parser->req); /* line must match: "METHOD TARGET HTTP_VERSION" */ - p = memchr(parser->line, ' ', parser->line_len); - if(!p || p == parser->line) - goto out; + if(custom_method && custom_method[0] && + !strncmp(custom_method, parser->line, strlen(custom_method))) { + p = parser->line + strlen(custom_method); + } + else { + p = memchr(parser->line, ' ', parser->line_len); + if(!p || p == parser->line) + goto out; + } m = parser->line; m_len = p - parser->line; @@ -258,8 +266,9 @@ static CURLcode start_req(struct h1_req_parser *parser, ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, const char *buf, size_t buflen, - const char *scheme_default, int options, - CURLcode *err) + const char *scheme_default, + const char *custom_method, + int options, CURLcode *err) { ssize_t nread = 0, n; @@ -285,7 +294,7 @@ ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, goto out; } else if(!parser->req) { - *err = start_req(parser, scheme_default, options); + *err = start_req(parser, scheme_default, custom_method, options); if(*err) { nread = -1; goto out; diff --git a/lib/http1.h b/lib/http1.h index b38b32f59115..94b5a44e3143 100644 --- a/lib/http1.h +++ b/lib/http1.h @@ -50,8 +50,9 @@ void Curl_h1_req_parse_free(struct h1_req_parser *parser); ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, const char *buf, size_t buflen, - const char *scheme_default, int options, - CURLcode *err); + const char *scheme_default, + const char *custom_method, + int options, CURLcode *err); CURLcode Curl_h1_req_dprint(const struct httpreq *req, struct dynbuf *dbuf); diff --git a/lib/http2.c b/lib/http2.c index 2e1e5bd07e56..1565e0b9ead3 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2248,7 +2248,10 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, if(result) goto out; - rc = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result); + rc = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, &result); if(!curlx_sztouz(rc, &nwritten)) goto out; *pnwritten = nwritten; diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 475060ebdd34..ce5786ca83e8 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1531,7 +1531,10 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, goto out; } - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result); + nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, &result); if(nwritten < 0) goto out; *pnwritten = (size_t)nwritten; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 75dc5cc69473..f328c08e35b5 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1900,7 +1900,10 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, goto out; } - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, err); + nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, err); if(nwritten < 0) goto out; if(!stream->h1.done) { diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index ff3e76b06342..02b679ab8431 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -991,7 +991,10 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST); DEBUGASSERT(stream); - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, 0, &result); + nwritten = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, &result); if(nwritten < 0) goto out; if(!stream->h1.done) { diff --git a/tests/http/test_01_basic.py b/tests/http/test_01_basic.py index c734318890f3..aa94238c3f01 100644 --- a/tests/http/test_01_basic.py +++ b/tests/http/test_01_basic.py @@ -25,6 +25,7 @@ ########################################################################### # import logging +import re import pytest from testenv import Env @@ -293,3 +294,24 @@ def test_01_19_plain_reuse(self, env: Env, httpd): r = curl.http_download(urls=[url1, url2], alpn_proto=proto, with_stats=True) assert len(r.stats) == 2 assert r.total_connects == 2, f'{r.dump_logs()}' + + # use a custom method containing a space + # check that h2/h3 did send that in the :method pseudo header. #19543 + @pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs verbosecurl") + @pytest.mark.parametrize("proto", Env.http_protos()) + def test_01_20_method_space(self, env: Env, proto, httpd): + curl = CurlClient(env=env) + method = 'IN SANE' + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo' + r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True, + extra_args=['-X', method]) + assert len(r.stats) == 1 + if proto == 'h2' or proto == 'h3': + r.check_response(http_status=0) + re_m = re.compile(r'.*\[:method: ([^\]]+)\].*') + lines = [line for line in r.trace_lines if re_m.match(line)] + assert len(lines) == 1, f'{r.dump_logs()}' + m = re_m.match(lines[0]) + assert m.group(1) == method, f'{r.dump_logs()}' + else: + r.check_response(http_status=400) diff --git a/tests/unit/unit2603.c b/tests/unit/unit2603.c index 5915555f8b04..a8ed09f1c2b5 100644 --- a/tests/unit/unit2603.c +++ b/tests/unit/unit2603.c @@ -51,6 +51,7 @@ static void check_eq(const char *s, const char *exp_s, const char *name) struct tcase { const char **input; const char *default_scheme; + const char *custom_method; const char *method; const char *scheme; const char *authority; @@ -74,7 +75,7 @@ static void parse_success(const struct tcase *t) buflen = strlen(buf); in_len += buflen; nread = Curl_h1_req_parse_read(&p, buf, buflen, t->default_scheme, - 0, &err); + t->custom_method, 0, &err); if(nread < 0) { curl_mfprintf(stderr, "got err %d parsing: '%s'\n", err, buf); fail("error consuming"); @@ -122,10 +123,10 @@ static CURLcode test_unit2603(const char *arg) NULL, }; static const struct tcase TEST1a = { - T1_INPUT, NULL, "GET", NULL, NULL, "/path", 1, 0 + T1_INPUT, NULL, NULL, "GET", NULL, NULL, "/path", 1, 0 }; static const struct tcase TEST1b = { - T1_INPUT, "https", "GET", "https", NULL, "/path", 1, 0 + T1_INPUT, "https", NULL, "GET", "https", NULL, "/path", 1, 0 }; static const char *T2_INPUT[] = { @@ -136,7 +137,7 @@ static CURLcode test_unit2603(const char *arg) NULL, }; static const struct tcase TEST2 = { - T2_INPUT, NULL, "GET", NULL, NULL, "/path", 1, 8 + T2_INPUT, NULL, NULL, "GET", NULL, NULL, "/path", 1, 8 }; static const char *T3_INPUT[] = { @@ -145,7 +146,7 @@ static CURLcode test_unit2603(const char *arg) NULL, }; static const struct tcase TEST3a = { - T3_INPUT, NULL, "GET", "ftp", "ftp.curl.se", "/xxx?a=2", 2, 0 + T3_INPUT, NULL, NULL, "GET", "ftp", "ftp.curl.se", "/xxx?a=2", 2, 0 }; static const char *T4_INPUT[] = { @@ -155,7 +156,7 @@ static CURLcode test_unit2603(const char *arg) NULL, }; static const struct tcase TEST4a = { - T4_INPUT, NULL, "CONNECT", NULL, "ftp.curl.se:123", NULL, 3, 2 + T4_INPUT, NULL, NULL, "CONNECT", NULL, "ftp.curl.se:123", NULL, 3, 2 }; static const char *T5_INPUT[] = { @@ -165,7 +166,7 @@ static CURLcode test_unit2603(const char *arg) NULL, }; static const struct tcase TEST5a = { - T5_INPUT, NULL, "OPTIONS", NULL, NULL, "*", 2, 3 + T5_INPUT, NULL, NULL, "OPTIONS", NULL, NULL, "*", 2, 3 }; static const char *T6_INPUT[] = { @@ -173,7 +174,19 @@ static CURLcode test_unit2603(const char *arg) NULL, }; static const struct tcase TEST6a = { - T6_INPUT, NULL, "PUT", NULL, NULL, "/path", 1, 3 + T6_INPUT, NULL, NULL, "PUT", NULL, NULL, "/path", 1, 3 + }; + + /* test a custom method with space, #19543 */ + static const char *T7_INPUT[] = { + "IN SANE /path HTTP/1.1\r\nContent-Length: 0\r\n\r\n", + NULL, + }; + static const struct tcase TEST7a = { + T7_INPUT, NULL, NULL, "IN", NULL, NULL, "SANE /path", 1, 0 + }; + static const struct tcase TEST7b = { + T7_INPUT, NULL, "IN SANE", "IN SANE", NULL, NULL, "/path", 1, 0 }; parse_success(&TEST1a); @@ -183,6 +196,8 @@ static CURLcode test_unit2603(const char *arg) parse_success(&TEST4a); parse_success(&TEST5a); parse_success(&TEST6a); + parse_success(&TEST7a); + parse_success(&TEST7b); #endif UNITTEST_END_SIMPLE From 142fd1cf32268df85ace2d3b0b9017fe9a126afa Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 14:55:14 +0100 Subject: [PATCH 421/885] appveyor: add VS2010 x86 Release VS project job and switch VS2013 to x64 To have a test case for VS2010 after bumping to minimum Vista. Ref: #18009 Closes #19570 --- appveyor.sh | 8 +++++--- appveyor.yml | 9 ++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/appveyor.sh b/appveyor.sh index ccd0cc86b0ef..b20838da427b 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -75,7 +75,7 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then -DCURL_USE_OPENSSL="${OPENSSL}" \ -DCURL_USE_LIBPSL=OFF \ ${options} \ - || { cat ${root}/_bld/CMakeFiles/CMake* 2>/dev/null; false; } + || { cat "${root}"/_bld/CMakeFiles/CMake* 2>/dev/null; false; } [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ] && cd .. done if [ -d _bld_chkprefill ] && ! diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h; then @@ -92,9 +92,11 @@ elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then ( cd projects ./generate.bat "${VC_VERSION}" - msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "Windows/${VC_VERSION}/curl-all.sln" + msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "-property:Platform=${PLAT}" "Windows/${VC_VERSION}/curl-all.sln" ) - curl="build/Win32/${VC_VERSION}/${PRJ_CFG}/curld.exe" + [ "${PLAT}" = 'x64' ] && platdir='Win64' || platdir='Win32' + [[ "${PRJ_CFG}" = *'Debug'* ]] && binsuffix='d' || binsuffix='' + curl="build/${platdir}/${VC_VERSION}/${PRJ_CFG}/curl${binsuffix}.exe" fi find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file -- '{}' \; diff --git a/appveyor.yml b/appveyor.yml index 3d5c6b55aca6..d10f8d39612f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -148,10 +148,17 @@ environment: # generated VisualStudioSolution-based builds - - job_name: 'VisualStudioSolution VS2013, Debug, x86, Schannel, Build-only' + - job_name: 'VisualStudioSolution VS2010, Release, x86, Schannel, Build-only' + APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' + BUILD_SYSTEM: VisualStudioSolution + PRJ_CFG: 'DLL Release - DLL Windows SSPI - DLL WinIDN' + PLAT: 'Win32' + VC_VERSION: VC10 + - job_name: 'VisualStudioSolution VS2013, Debug, x64, Schannel, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: VisualStudioSolution PRJ_CFG: 'DLL Debug - DLL Windows SSPI - DLL WinIDN' + PLAT: 'x64' VC_VERSION: VC12 install: From b360fc62fb55112c6ef620ef73062600136bfa1a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 17 Nov 2025 13:54:24 +0100 Subject: [PATCH 422/885] http: avoid two strdup()s and do minor simplifications Closes #19571 --- lib/http.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/lib/http.c b/lib/http.c index aa921fd60248..a470c04449dd 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4587,15 +4587,12 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) if(result) goto out; } - req->authority = strdup(curlx_dyn_ptr(&buf)); - if(!req->authority) - goto out; - result = CURLE_OK; - + req->authority = curlx_dyn_ptr(&buf); out: free(host); free(port); - curlx_dyn_free(&buf); + if(result) + curlx_dyn_free(&buf); return result; } @@ -4609,41 +4606,32 @@ static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url) path = query = NULL; curlx_dyn_init(&buf, DYN_HTTP_REQUEST); - uc = curl_url_get(url, CURLUPART_PATH, &path, CURLU_PATH_AS_IS); + uc = curl_url_get(url, CURLUPART_PATH, &path, 0); if(uc) goto out; uc = curl_url_get(url, CURLUPART_QUERY, &query, 0); if(uc && uc != CURLUE_NO_QUERY) goto out; - if(!path && !query) { - req->path = NULL; - } - else if(path && !query) { + if(!query) { req->path = path; path = NULL; } else { - if(path) { - result = curlx_dyn_add(&buf, path); - if(result) - goto out; - } - if(query) { + result = curlx_dyn_add(&buf, path); + if(!result) result = curlx_dyn_addf(&buf, "?%s", query); - if(result) - goto out; - } - req->path = strdup(curlx_dyn_ptr(&buf)); - if(!req->path) + if(result) goto out; + req->path = curlx_dyn_ptr(&buf); } result = CURLE_OK; out: free(path); free(query); - curlx_dyn_free(&buf); + if(result) + curlx_dyn_free(&buf); return result; } From 39320e1e1b1b42dccbfa7db38f28327c31545793 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 00:47:55 +0000 Subject: [PATCH 423/885] GHA: update dependencies - github/codeql-action to 4.31.3 - google/boringssl to v0.20251110.0 - ruff to 0.14.5 Closes #19442 Closes #19455 --- .github/scripts/requirements.txt | 2 +- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 8cb1d11d0af5..874e710997fe 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -6,4 +6,4 @@ cmakelang==0.6.13 codespell==2.4.1 pytype==2024.10.11 reuse==6.2.0 -ruff==0.14.2 +ruff==0.14.5 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d464562ab253..87a041563c82 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -50,13 +50,13 @@ jobs: persist-credentials: false - name: 'initialize' - uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 with: languages: actions, python queries: security-extended - name: 'perform analysis' - uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 c: if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }} @@ -87,7 +87,7 @@ jobs: persist-credentials: false - name: 'initialize' - uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 with: languages: cpp build-mode: manual @@ -133,4 +133,4 @@ jobs: fi - name: 'perform analysis' - uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 2979e9d7d16c..007f34612732 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -45,7 +45,7 @@ env: # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com - BORINGSSL_VERSION: 0.20251002.0 + BORINGSSL_VERSION: 0.20251110.0 # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com GNUTLS_VERSION: 3.8.10 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4cea194c765e..55f005993d2e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -48,7 +48,7 @@ env: # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com - BORINGSSL_VERSION: 0.20251002.0 + BORINGSSL_VERSION: 0.20251110.0 # handled in renovate.json OPENSSL_VERSION: 3.6.0 # renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com From 42c43f695c43777d84f7e02e0187ef9740d77387 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 16:49:49 +0100 Subject: [PATCH 424/885] renovate.json: replace `CI:` prefix with `GHA:` All bumped dependencies are in GHA. Follow-up to 6225d7ba2f7dcad322776fc1cadae63e530de705 #19547 --- renovate.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index 616fd1aaedf8..33421818180f 100644 --- a/renovate.json +++ b/renovate.json @@ -21,7 +21,7 @@ "pinDigest", "digest" ], - "commitMessagePrefix": "CI: ", + "commitMessagePrefix": "GHA: ", "labels": [ "CI" ] @@ -30,7 +30,7 @@ "matchManagers": [ "custom.regex" ], - "commitMessagePrefix": "CI: ", + "commitMessagePrefix": "GHA: ", "labels": [ "CI" ] From ad35ecba9763933121ec01013fea9cc7d22ba1d6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 16:06:00 +0100 Subject: [PATCH 425/885] badwords: fix issues found in scripts and other files Single pass, not enforced. Also: - pyspelling.words: drop `web page` Closes #19572 --- .github/labeler.yml | 2 +- .github/scripts/cleancmd.pl | 8 ++--- .github/scripts/pyspelling.words | 1 - .github/stale.yml | 2 +- .github/workflows/linux-old.yml | 6 ++-- .github/workflows/linux.yml | 2 +- CMake/Macros.cmake | 4 +-- CMakeLists.txt | 2 +- packages/OS400/curl.cmd | 2 +- packages/OS400/make-lib.sh | 4 +-- packages/OS400/rpg-examples/HEADERAPI | 2 +- packages/OS400/rpg-examples/HTTPPOST | 2 +- packages/OS400/rpg-examples/INMEMORY | 2 +- packages/OS400/rpg-examples/SIMPLE1 | 2 +- packages/OS400/rpg-examples/SIMPLE2 | 2 +- packages/OS400/rpg-examples/SMTPSRCMBR | 2 +- packages/vms/build_gnv_curl_pcsi_desc.com | 2 +- packages/vms/build_gnv_curl_pcsi_text.com | 4 +-- packages/vms/build_gnv_curl_release_notes.com | 10 +++--- packages/vms/build_vms.com | 8 ++--- packages/vms/compare_curl_source.com | 2 +- packages/vms/curl_crtl_init.c | 2 +- packages/vms/curl_gnv_build_steps.txt | 6 ++-- packages/vms/curl_release_note_start.txt | 8 ++--- packages/vms/curl_startup.com | 4 +-- packages/vms/generate_config_vms_h_curl.com | 6 ++-- packages/vms/gnv_curl_configure.sh | 2 +- packages/vms/gnv_link_curl.com | 8 ++--- packages/vms/make_gnv_curl_install.sh | 2 +- packages/vms/pcsi_gnv_curl_file_list.txt | 2 +- packages/vms/pcsi_product_gnv_curl.com | 6 ++-- packages/vms/readme | 10 +++--- packages/vms/setup_gnv_curl_build.com | 2 +- scripts/cd2nroff | 8 ++--- scripts/cdall | 2 +- scripts/checksrc.pl | 10 +++--- scripts/ciconfig.pl | 4 +-- scripts/cmakelint.sh | 2 +- scripts/completion.pl | 8 ++--- scripts/managen | 4 +-- scripts/mk-ca-bundle.pl | 32 +++++++++---------- scripts/perlcheck.sh | 2 +- scripts/release-notes.pl | 4 +-- scripts/release-tools.sh | 2 +- scripts/top-complexity | 2 +- 45 files changed, 104 insertions(+), 105 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 75ea8686da0a..7ff3971bdc92 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -11,7 +11,7 @@ # the files fit into the category, and the any-glob-to-any-file ones are added # as long as any file matches. The first ones are for "major" categories (the # PR is all about that one topic, like HTTP/3), while the second ones are -# "addendums" that give useful information about a PR that's really mostly +# "addendums" that give useful information about a PR that is really mostly # something else (e.g. CI if the PR also touches CI jobs). # # N.B. any-glob-to-all-files is misnamed; it acts like one-glob-to-all-files. diff --git a/.github/scripts/cleancmd.pl b/.github/scripts/cleancmd.pl index f90b31d8f1bb..06b38f102213 100755 --- a/.github/scripts/cleancmd.pl +++ b/.github/scripts/cleancmd.pl @@ -16,7 +16,7 @@ my @asyms; open(S, "<./docs/libcurl/symbols-in-versions") - || die "can't find symbols-in-versions"; + || die "cannot find symbols-in-versions"; while() { if(/^([^ ]*) /) { push @asyms, $1; @@ -30,7 +30,7 @@ ); open(O, "<./docs/options-in-versions") - || die "can't find options-in-versions"; + || die "cannot find options-in-versions"; while() { chomp; if(/^([^ ]+)/) { @@ -50,7 +50,7 @@ close(O); open(C, "<./.github/scripts/spellcheck.curl") - || die "can't find spellcheck.curl"; + || die "cannot find spellcheck.curl"; while() { if(/^\#/) { next; @@ -99,7 +99,7 @@ sub process { # *italics* $l =~ s/\*(\S.*?)\*//g; - # strip out https URLs, we don't want them spellchecked + # strip out https URLs, we do not want them spellchecked $l =~ s!https://[a-z0-9\#_/.-]+!!gi; $out .= $l; diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index 76889a05bbe0..f6a5405999e7 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -957,7 +957,6 @@ watchOS WAV WB wcurl -web page WebDAV WebOS webpage diff --git a/.github/stale.yml b/.github/stale.yml index dc239b56ce72..69a822e78be8 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -6,7 +6,7 @@ daysUntilStale: 180 # Number of days of inactivity before a stale issue is closed daysUntilClose: 14 -# Issues with these labels will never be considered stale +# Issues with these labels are never considered stale exemptLabels: - pinned - security diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index 7cba9243cbe9..8ac42855e03a 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -11,10 +11,10 @@ # is still supported (as of this writing). # stretch has ELTS support from Freexian until 2027-06-30 # For ELTS info see https://www.freexian.com/lts/extended/docs/how-to-use-extended-lts/ -# The Debian key will expire 2025-05-20, after which package signature +# The Debian key expires 2025-05-20, after which package signature # verification may need to be disabled. # httrack is one of the smallest downloaders, needed to bootstrap ELTS, -# and won't conflict with the curl we're building. +# and doesn not conflict with the curl we are building. name: 'Linux Old' @@ -74,7 +74,7 @@ jobs: apt-get -o Dpkg::Use-Pty=0 update apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libgnutls28-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 groff # GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on - # gcc-8-base, but it doesn't actually seem used in our situation and isn't available in + # gcc-8-base, but it does not actually seem used in our situation and is not available in # the main repo, so force the install. httrack --get https://deb.freexian.com/extended-lts/pool/main/g/glibc/libc6_2.28-10+deb10u5_amd64.deb httrack --get https://deb.freexian.com/extended-lts/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 55f005993d2e..20a7c4351cd6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -647,7 +647,7 @@ jobs: rm ~/rustls/librustls.zip - name: 'build rustls' - # Note: we don't check cache-hit here. If the cache is hit, we still need to dpkg install the deb. + # Note: we do not check cache-hit here. If the cache is hit, we need to dpkg install the deb. if: ${{ contains(matrix.build.install_steps, 'rustls') }} run: sudo dpkg -i ~/rustls/"librustls_${RUSTLS_VERSION}_amd64.deb" diff --git a/CMake/Macros.cmake b/CMake/Macros.cmake index 710df701168d..80173fb03bf0 100644 --- a/CMake/Macros.cmake +++ b/CMake/Macros.cmake @@ -56,10 +56,10 @@ macro(curl_internal_test _curl_test) "${_curl_test_add_libraries}" OUTPUT_VARIABLE CURL_TEST_OUTPUT) if(${_curl_test}) - set(${_curl_test} 1 CACHE INTERNAL "Curl test") + set(${_curl_test} 1 CACHE INTERNAL "curl test") message(STATUS "Performing Test ${_curl_test} - Success") else() - set(${_curl_test} "" CACHE INTERNAL "Curl test") + set(${_curl_test} "" CACHE INTERNAL "curl test") message(STATUS "Performing Test ${_curl_test} - Failed") endif() endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 30cb5f398e59..7de2162c6cd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1856,7 +1856,7 @@ check_type_size("off_t" SIZEOF_OFF_T) if(NOT WIN32) # fseeko may not exist with _FILE_OFFSET_BITS=64 but can exist with - # _FILE_OFFSET_BITS unset or 32 (e.g. Android ARMv7 with NDK 26b and API level < 24) + # _FILE_OFFSET_BITS unset or 32 (as in Android ARMv7 with NDK 26b and API level < 24) # so we need to test fseeko after testing for _FILE_OFFSET_BITS check_symbol_exists("fseeko" "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO) diff --git a/packages/OS400/curl.cmd b/packages/OS400/curl.cmd index 822f4db207e6..fa6aaa59a568 100644 --- a/packages/OS400/curl.cmd +++ b/packages/OS400/curl.cmd @@ -29,4 +29,4 @@ PARM KWD(CMDARGS) TYPE(*CHAR) LEN(5000) VARY(*YES *INT2) + CASE(*MIXED) EXPR(*YES) MIN(1) + - PROMPT('Curl command arguments') + PROMPT('curl command arguments') diff --git a/packages/OS400/make-lib.sh b/packages/OS400/make-lib.sh index e7b5b519e7e8..cd3f71897f2d 100755 --- a/packages/OS400/make-lib.sh +++ b/packages/OS400/make-lib.sh @@ -79,7 +79,7 @@ fi if [ -n "${LINK}" ] then rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})" - CMD="${CMD} TEXT('LibCurl API static binding directory')" + CMD="${CMD} TEXT('libcurl API static binding directory')" CLcommand "${CMD}" for MODULE in ${MODULES} @@ -173,7 +173,7 @@ fi if [ -n "${LINK}" ] then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})" - CMD="${CMD} TEXT('LibCurl API dynamic binding directory')" + CMD="${CMD} TEXT('libcurl API dynamic binding directory')" CLcommand "${CMD}" CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${DYNBNDDIR})" CMD="${CMD} OBJ((*LIBL/${SRVPGM} *SRVPGM))" diff --git a/packages/OS400/rpg-examples/HEADERAPI b/packages/OS400/rpg-examples/HEADERAPI index 2046306bb80b..f6ef80bbd4fb 100644 --- a/packages/OS400/rpg-examples/HEADERAPI +++ b/packages/OS400/rpg-examples/HEADERAPI @@ -1,4 +1,4 @@ - * Curl header API: extract headers post transfer + * curl header API: extract headers post transfer * h DFTACTGRP(*NO) ACTGRP(*NEW) h OPTION(*NOSHOWCPY) diff --git a/packages/OS400/rpg-examples/HTTPPOST b/packages/OS400/rpg-examples/HTTPPOST index 9a562e9084a1..8e5d0d74bbda 100644 --- a/packages/OS400/rpg-examples/HTTPPOST +++ b/packages/OS400/rpg-examples/HTTPPOST @@ -1,4 +1,4 @@ - * Curl MIME post data and display response + * curl MIME post data and display response * h DFTACTGRP(*NO) ACTGRP(*NEW) h OPTION(*NOSHOWCPY) diff --git a/packages/OS400/rpg-examples/INMEMORY b/packages/OS400/rpg-examples/INMEMORY index ab425fc22fc9..7111d565e9a5 100644 --- a/packages/OS400/rpg-examples/INMEMORY +++ b/packages/OS400/rpg-examples/INMEMORY @@ -1,4 +1,4 @@ - * Curl get in memory and count HTML tags + * curl get in memory and count HTML tags * h DFTACTGRP(*NO) ACTGRP(*NEW) h OPTION(*NOSHOWCPY) diff --git a/packages/OS400/rpg-examples/SIMPLE1 b/packages/OS400/rpg-examples/SIMPLE1 index e1286d121514..2d2296ed40bd 100644 --- a/packages/OS400/rpg-examples/SIMPLE1 +++ b/packages/OS400/rpg-examples/SIMPLE1 @@ -1,4 +1,4 @@ - * Curl simple URL request + * curl simple URL request * h DFTACTGRP(*NO) ACTGRP(*NEW) h OPTION(*NOSHOWCPY) diff --git a/packages/OS400/rpg-examples/SIMPLE2 b/packages/OS400/rpg-examples/SIMPLE2 index b0c590cc290c..2fead8517cdb 100644 --- a/packages/OS400/rpg-examples/SIMPLE2 +++ b/packages/OS400/rpg-examples/SIMPLE2 @@ -1,4 +1,4 @@ - * Curl simple URL request (free-format RPG) + * curl simple URL request (free-format RPG) * ctl-opt dftactgrp(*NO) actgrp(*NEW) option(*NOSHOWCPY) diff --git a/packages/OS400/rpg-examples/SMTPSRCMBR b/packages/OS400/rpg-examples/SMTPSRCMBR index d11ea963072e..7e3a3fce6c75 100644 --- a/packages/OS400/rpg-examples/SMTPSRCMBR +++ b/packages/OS400/rpg-examples/SMTPSRCMBR @@ -1,4 +1,4 @@ - * Curl SMTP send source member as attachment + * curl SMTP send source member as attachment * h DFTACTGRP(*NO) ACTGRP(*NEW) h OPTION(*NOSHOWCPY) diff --git a/packages/vms/build_gnv_curl_pcsi_desc.com b/packages/vms/build_gnv_curl_pcsi_desc.com index 85674261ce38..566384de0257 100644 --- a/packages/vms/build_gnv_curl_pcsi_desc.com +++ b/packages/vms/build_gnv_curl_pcsi_desc.com @@ -22,7 +22,7 @@ $! $! The PCSI system can really only handle ODS-2 format filenames and $! assumes that there is only one source directory. It also assumes that $! all destination files with the same name come from the same source file. -$! Fortunately CURL does not trip most of these issues, so those steps +$! Fortunately curl does not trip most of these issues, so those steps $! above are marked N/A. $! $! A rename action section is needed to make sure that the files are diff --git a/packages/vms/build_gnv_curl_pcsi_text.com b/packages/vms/build_gnv_curl_pcsi_text.com index 8f109c1e7e4e..b67ad8f18797 100644 --- a/packages/vms/build_gnv_curl_pcsi_text.com +++ b/packages/vms/build_gnv_curl_pcsi_text.com @@ -2,9 +2,9 @@ $! File: Build_GNV_curl_pcsi_text.com $! $! Build the *.pcsi$text file from the four components: $! 1. Generated =product header section -$! 2. [--]readme. file from the Curl distribution, modified to fit +$! 2. [--]readme. file from the curl distribution, modified to fit $! a pcsi$text file format. -$! 3. [--]copying file from the Curl distribution, modified to fit +$! 3. [--]copying file from the curl distribution, modified to fit $! a pcsi$text file format. $! 4. Generated Producer section. $! diff --git a/packages/vms/build_gnv_curl_release_notes.com b/packages/vms/build_gnv_curl_release_notes.com index 0da94454d5be..89b30ecbe99e 100644 --- a/packages/vms/build_gnv_curl_release_notes.com +++ b/packages/vms/build_gnv_curl_release_notes.com @@ -3,7 +3,7 @@ $! $! Build the release note file from the four components: $! 1. The curl_release_note_start.txt $! 2. The hp_ssl_release_info.txt -$! 3. [--]readme. file from the Curl distribution. +$! 3. [--]readme. file from the curl distribution. $! 4. The Curl_gnv-build_steps.txt. $! $! Set the name of the release notes from the GNV_PCSI_FILENAME_BASE @@ -42,7 +42,7 @@ $ curl_readme = f$search("sys$disk:[--]$README.") $ endif $ if curl_readme .eqs. "" $ then -$ write sys$output "Can not find Curl readme file." +$ write sys$output "Can not find curl readme file." $ goto all_exit $ endif $! @@ -53,7 +53,7 @@ $ curl_copying = f$search("sys$disk:[--]$COPYING.") $ endif $ if curl_copying .eqs. "" $ then -$ write sys$output "Can not find Curl copying file." +$ write sys$output "Can not find curl copying file." $ goto all_exit $ endif $! @@ -64,7 +64,7 @@ $ vms_readme = f$search("sys$disk:[]$README.") $ endif $ if vms_readme .eqs. "" $ then -$ write sys$output "Can not find VMS specific Curl readme file." +$ write sys$output "Can not find VMS specific curl readme file." $ goto all_exit $ endif $! @@ -75,7 +75,7 @@ $ curl_release_notes = f$search("sys$disk:[--]$RELEASE-NOTES.") $ endif $ if curl_release_notes .eqs. "" $ then -$ write sys$output "Can not find Curl release-notes file." +$ write sys$output "Can not find curl release-notes file." $ goto all_exit $ endif $! diff --git a/packages/vms/build_vms.com b/packages/vms/build_vms.com index d8f89f6ef436..e8bbee86b4d8 100644 --- a/packages/vms/build_vms.com +++ b/packages/vms/build_vms.com @@ -516,7 +516,7 @@ $ endif $! $! $! CC /LIST, LINK /MAP, and MESSAGE /LIST are defaults in batch mode, -$! so be explicit when they're not desired. +$! so be explicit when they are not desired. $! $ $ if list .eq. 0 @@ -744,7 +744,7 @@ $ endif $ if ((f$search(ossl_lib1) .eqs. "") .or. - (f$search(ossl_lib2) .eqs. "")) $ then -$ write sys$output "Can't find OpenSSL ''msg':" +$ write sys$output "Cannot find OpenSSL ''msg':" $ write sys$output " ''ossl_lib1'" $ write sys$output " ''ossl_lib2'" $ goto Common_Exit @@ -943,7 +943,7 @@ $ reset = f$search( "reset", 1) $Loop: $ file = f$search( search, 1) $ if file .eqs. "" then goto EndLoop -$! Skip a name if it's in the P4 exclusion list. +$! Skip a name if it is in the P4 exclusion list. $ if (p4 .nes. "") $ then $ name__ = "," + - @@ -1016,7 +1016,7 @@ $ endif $ ENDSUBROUTINE ! Compile $! $! Do a diff of the file specified in P1 with that in P2. If different -$! copy P1 to P2. This also covers if P2 doesn't exist, but not if P2 +$! copy P1 to P2. This also covers if P2 does not exist, but not if P2 $! is an invalid filespec. $! $MoveIfDiff: subroutine diff --git a/packages/vms/compare_curl_source.com b/packages/vms/compare_curl_source.com index 13ff4667f931..b63080620ec7 100644 --- a/packages/vms/compare_curl_source.com +++ b/packages/vms/compare_curl_source.com @@ -255,7 +255,7 @@ $ then $ ref_fname = f$edit(ref_fname, "LOWERCASE") $ endif $! -$! These files are in the wrong format for VMS diff, and we don't change them. +$! These files are in the wrong format for VMS diff, and we do not change them. $ ref_skip = 0 $ if ref_type .eqs. ".PDF" then ref_skip = 1 $ if ref_type .eqs. ".HTML" then ref_skip = 1 diff --git a/packages/vms/curl_crtl_init.c b/packages/vms/curl_crtl_init.c index 1c90847cd25d..1c21f1e88166 100644 --- a/packages/vms/curl_crtl_init.c +++ b/packages/vms/curl_crtl_init.c @@ -33,7 +33,7 @@ * will turn on some CRTL features that are not enabled by default. * * The CRTL features can also be turned on via logical names, but that - * impacts all programs and some aren't ready, willing, or able to handle + * impacts all programs and some are not ready, willing, or able to handle * those settings. * * On VMS versions that are too old to use the feature setting API, this diff --git a/packages/vms/curl_gnv_build_steps.txt b/packages/vms/curl_gnv_build_steps.txt index 46c2c6e0a617..0c30924998ea 100644 --- a/packages/vms/curl_gnv_build_steps.txt +++ b/packages/vms/curl_gnv_build_steps.txt @@ -16,11 +16,11 @@ From File: curl_gnv_build_steps.txt SPDX-License-Identifier: ISC -Currently building Curl using GNV takes longer than building Curl via DCL. +Currently building curl using GNV takes longer than building curl via DCL. The GNV procedure actually uses the same configure and makefiles that Unix builds use. -Building CURL on OpenVMS using GNV requires GNV V2.1-2 or the updated +Building curl on OpenVMS using GNV requires GNV V2.1-2 or the updated images that are available via anonymous FTP at encompasserve.org in the gnv directory. It also requires the GNV Bash 4.2.45 kit as an update from the same location or from the sourceforge.net GNV project. @@ -100,7 +100,7 @@ Note to builders: GNV currently has a bug where configure scripts take a long time to run. Some of the configure steps take a while to complete, and on a 600 Mhz -DS10 with IDE disks, taking an hour to run the CURL configure is normal. +DS10 with IDE disks, taking an hour to run the curl configure is normal. The following messages can be ignored and may get fixed in a future version of GNV. The GNV$*.OPT files are used to find the libraries as many have diff --git a/packages/vms/curl_release_note_start.txt b/packages/vms/curl_release_note_start.txt index 62b2836359fa..1a67b36020b0 100644 --- a/packages/vms/curl_release_note_start.txt +++ b/packages/vms/curl_release_note_start.txt @@ -16,16 +16,16 @@ OpenVMS specific building and kitting instructions are after the standard curl readme file. This product may be available for your platform in a PCSI kit. The source kit -contains files for building CURL using GNV or with a DCL procedure. +contains files for building curl using GNV or with a DCL procedure. The GNV based build creates a libcurl share imaged which is supplied in the PCSI kit. -This version of CURL will return VMS compatible status codes when run from +This version of curl will return VMS compatible status codes when run from DCL and Unix compatible exit codes and messages when run with the SHELL environment variable set. -This port of Curl uses the OpenSSL, Ldap, and Kerberos V5 that are bundled +This port of curl uses the OpenSSL, Ldap, and Kerberos V5 that are bundled with OpenVMS or supplied as updates by HP. Ldap and Kerberos are not available on the VAX platform. See section below for a special note about HP OpenSSL on Alpha and IA64. @@ -61,7 +61,7 @@ For the HP SSL work around to work for GNV do the following: Similar workarounds will be needed for any program linked with GNV$LIBCURL until the HP OpenSSL is upgraded to the current 1.4 version or later. -If you are installing a "daily" build instead of a release build of Curl, some +If you are installing a "daily" build instead of a release build of curl, some things have been changed so that it can be installed at the same time as a production build without conflicts. diff --git a/packages/vms/curl_startup.com b/packages/vms/curl_startup.com index e90bbecbb9d6..7e5b2729d810 100644 --- a/packages/vms/curl_startup.com +++ b/packages/vms/curl_startup.com @@ -1,6 +1,6 @@ $! File: curl_Startup.com $! -$! Procedure to setup the CURL libraries for use by programs from the +$! Procedure to setup the curl libraries for use by programs from the $! VMS SYSTARTUP*.COM procedure. $! $! Copyright (C) John Malmberg @@ -75,7 +75,7 @@ $ define/system/exec gnv$curl_ssl_libcryptoshr32 'curl_ssl_libcrypto32' $ define/system/exec gnv$curl_ssl_libsslshr32 'curl_ssl_libssl32' $! $! -$! CURL setup +$! curl setup $ define/system/exec gnv$libcurl gnv$gnu:[usr.lib]GNV$LIBCURL.EXE $ define/system/exec gnv$curl_include gnv$gnu:[usr.include.curl] $ if .not. f$file_attributes("gnv$libcurl", "known") diff --git a/packages/vms/generate_config_vms_h_curl.com b/packages/vms/generate_config_vms_h_curl.com index d7bc8bfc8f3b..245d072d20d0 100644 --- a/packages/vms/generate_config_vms_h_curl.com +++ b/packages/vms/generate_config_vms_h_curl.com @@ -1,6 +1,6 @@ $! File: GENERATE_CONFIG_H_CURL.COM $! -$! Curl like most open source products uses a variant of a config.h file. +$! curl like most open source products uses a variant of a config.h file. $! Depending on the curl version, this could be config.h or curl_config.h. $! $! For GNV based builds, the configure script is run and that produces @@ -197,7 +197,7 @@ $write cvh "#define __CONFIG_VMS_H__" $write cvh "" $write cvh "/* Define cpu-machine-OS */" $! -$! Curl uses an OS macro to set the build environment. +$! curl uses an OS macro to set the build environment. $!---------------------------------------------------- $! Now the DCL builds usually say xxx-HP-VMS and configure scripts $! may put DEC or COMPAQ or HP for the middle part. @@ -345,7 +345,7 @@ $! $! $! I can not figure out where the C compiler is finding the ALLOCA.H file $! in the text libraries, so CONFIG_H.COM can not find it either. -$! Usually the header file name is the module name in the text library. +$! Usually the header filename is the module name in the text library. $! It does not appear to hurt anything to not find header file, so we $! are not overriding it here. $! diff --git a/packages/vms/gnv_curl_configure.sh b/packages/vms/gnv_curl_configure.sh index 21558001ed86..7e74da346323 100755 --- a/packages/vms/gnv_curl_configure.sh +++ b/packages/vms/gnv_curl_configure.sh @@ -1,6 +1,6 @@ # File: gnv_curl_configure.sh # -# Set up and run the configure script for Curl so that it can find the +# Set up and run the configure script for curl so that it can find the # proper options for VMS. # # Copyright (C) John Malmberg diff --git a/packages/vms/gnv_link_curl.com b/packages/vms/gnv_link_curl.com index 83a8e021e823..9fc944c778c9 100644 --- a/packages/vms/gnv_link_curl.com +++ b/packages/vms/gnv_link_curl.com @@ -259,7 +259,7 @@ This package is built on with the OpenSSL version listed below and requires the shared images from the HP OpenSSL product that is kitted with that version or a compatible later version. -For Alpha and IA64 platforms, see the url below to register to get the +For Alpha and IA64 platforms, see the URL below to register to get the download URL. The kit will be HP 1.4-467 or later. https://h41379.www4.hpe.com/openvms/products/ssl/ssl.html @@ -269,10 +269,10 @@ download URLs provided and put in CPQ-VAXVMS-SSL-V0101-B-1.PCSI-DCX_VAXEXE If your system can not be upgraded to a compatible version of OpenSSL, then you can extract the two shared images from the kit and place them in the [vms$common.gnv.lib]directory of the volume that you are installing GNV and -or GNV compatible components like Curl. +or GNV compatible components like curl. If GNV is installed, you must run the GNV startup procedure before these steps -and before installing Curl. +and before installing curl. 1. make sure that [vms$common.gnv.lib] exists by using the following @@ -387,7 +387,7 @@ $! $ if f$search("[.src]curl-tool_main.o") .nes. "" $ then $! From src/makefile.inc: -$! # libcurl has sources that provide functions named curlx_* that aren't +$! # libcurl has sources that provide functions named curlx_* that are not $! # part of the official API, but we reuse the code here to avoid $! # duplication. $! diff --git a/packages/vms/make_gnv_curl_install.sh b/packages/vms/make_gnv_curl_install.sh index b85ef0ced245..4723070387d0 100755 --- a/packages/vms/make_gnv_curl_install.sh +++ b/packages/vms/make_gnv_curl_install.sh @@ -1,6 +1,6 @@ # File: make_gnv_curl_install.sh # -# Set up and run the make script for Curl. +# Set up and run the make script for curl. # # This makes the library, the curl binary and attempts an install. # A search list should be set up for GNU (GNV$GNU). diff --git a/packages/vms/pcsi_gnv_curl_file_list.txt b/packages/vms/pcsi_gnv_curl_file_list.txt index 586f7e767536..9ae49d5977e0 100644 --- a/packages/vms/pcsi_gnv_curl_file_list.txt +++ b/packages/vms/pcsi_gnv_curl_file_list.txt @@ -1,7 +1,7 @@ ! File: PCSI_GNV_CURL_FILE_LIST.TXT ! ! File list for building a PCSI kit. -! Very simple format so that the parsing logic can be simple. +! Simple format so that the parsing logic can be simple. ! links first, directory second, and files third. ! ! link -> file tells procedure to create/remove a link on install/uninstall diff --git a/packages/vms/pcsi_product_gnv_curl.com b/packages/vms/pcsi_product_gnv_curl.com index 83d8fa3b6611..2369613f47f8 100644 --- a/packages/vms/pcsi_product_gnv_curl.com +++ b/packages/vms/pcsi_product_gnv_curl.com @@ -1,6 +1,6 @@ $! File: PCSI_PRODUCT_GNV_CURL.COM $! -$! This command file packages up the product CURL into a sequential +$! This command file packages up the product curl into a sequential $! format kit $! $! Copyright (C) John Malmberg @@ -85,8 +85,8 @@ $ endif $ @gnv_link_curl.com $ endif $! -$! Make sure that the release note file name is up to date -$!--------------------------------------------------------- +$! Make sure that the release note filename is up to date +$!-------------------------------------------------------- $ @BUILD_GNV_CURL_RELEASE_NOTES.COM $! $! diff --git a/packages/vms/readme b/packages/vms/readme index 042a22b8070e..7cf3fc68671d 100644 --- a/packages/vms/readme +++ b/packages/vms/readme @@ -202,17 +202,17 @@ Other Notes: This release fixes known bugs #22, and #57 in the [curl.docs]known_bugs. file. -The libcurl formdata.c module and Curl tools post form now have some +The libcurl formdata.c module and curl tools post form now have some understanding of VMS file types. Files will be posted in STREAM_LF format. -The Curl tool now has some understanding of VMS file types and will upload the +The curl tool now has some understanding of VMS file types and will upload the files in STREAM_LF format. -When CURL is uploading a VARIABLE format VMS file, it is less efficient as in +When curl is uploading a VARIABLE format VMS file, it is less efficient as in order to get the file size, it will first read the entire file once, and then read the file again for the actual upload. -The Curl tool will now always download files into STREAM_LF format. Even if a +The curl tool will now always download files into STREAM_LF format. Even if a file by that name with a different format already exists. This is needed to allow interrupted downloads to be continued. @@ -225,4 +225,4 @@ The test suites are not supported as of 7.11.0. The curlmsg.sdl and curlmsg.h files are generated from curlmsg.msg. This is not done automatically, since the .MSG file is a hand edit of the relevant stuff from the curl.h file. If you want to do this -yourself you'll need the SDL package from the freeware collection. +yourself you need the SDL package from the freeware collection. diff --git a/packages/vms/setup_gnv_curl_build.com b/packages/vms/setup_gnv_curl_build.com index 49882463f3c4..e2d058a8b955 100644 --- a/packages/vms/setup_gnv_curl_build.com +++ b/packages/vms/setup_gnv_curl_build.com @@ -1,6 +1,6 @@ $! File: setup_gnv_curl_build.com $! -$! Set up build environment for building Curl under GNV on VMS. +$! Set up build environment for building curl under GNV on VMS. $! $! GNV needs some files moved into the other directories to help with $! the configure script and the build. diff --git a/scripts/cd2nroff b/scripts/cd2nroff index 992cf37b5a9b..3f1162a7396c 100755 --- a/scripts/cd2nroff +++ b/scripts/cd2nroff @@ -55,10 +55,10 @@ while(@ARGV) { print < Write the output to the file name from the meta-data in the +-d Write the output to the filename from the meta-data in the specified directory, instead of writing to stdout -e If -d is used, this option can provide an added "extension", arbitrary - text really, to append to the file name. + text really, to append to the filename. -h This help text, -v Show version then exit HELP @@ -373,7 +373,7 @@ sub single { my $blankline = 0; my $header = 0; - # cut off the leading path from the file name, if any + # cut off the leading path from the filename, if any $f =~ s/^(.*[\\\/])//; push @desc, ".\\\" generated by cd2nroff $cd2nroff from $f\n"; @@ -515,7 +515,7 @@ sub single { $blankline++; } else { - # don't output newlines if this is the first content after a + # do not output newlines if this is the first content after a # header push @desc, "\n" if($blankline && !$header); $blankline = 0; diff --git a/scripts/cdall b/scripts/cdall index aab41b65059c..3c5c68b525b1 100755 --- a/scripts/cdall +++ b/scripts/cdall @@ -23,7 +23,7 @@ # ########################################################################### -# provide all dir names to scan on the cmdline +# provide all directory names to scan on the command-line use strict; use warnings; diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 4224934a5eac..5f9ea3352683 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -181,7 +181,7 @@ sub readskiplist { # Reads the .checksrc in $dir for any extended warnings to enable locally. # Currently there is no support for disabling warnings from the standard set, -# and since that's already handled via !checksrc! commands there is probably +# and since that is already handled via !checksrc! commands there is probably # little use to add it. sub readlocalfile { my ($file) = @_; @@ -246,7 +246,7 @@ sub checkwarn { my $nowarn=0; #if(!$warnings{$name}) { - # print STDERR "Dev! there's no description for $name!\n"; + # print STDERR "Dev! there is no description for $name!\n"; #} # checksrc.skip @@ -351,7 +351,7 @@ sub checkwarn { print " -A[rule] Accept this violation, can be used multiple times\n"; print " -a[func] Allow use of this function\n"; print " -b[func] Ban use of this function\n"; - print " -D[DIR] Directory to prepend file names\n"; + print " -D[DIR] Directory to prepend filenames\n"; print " -h Show help output\n"; print " -W[file] Skip the given file - ignore all its flaws\n"; print " -i Indent spaces. Default: 2\n"; @@ -971,7 +971,7 @@ sub scanfile { } # check for open brace first on line but not first column only alert - # if previous line ended with a close paren and it wasn't a cpp line + # if previous line ended with a close paren and it was not a cpp line if(($prevl =~ /\)\z/) && ($l =~ /^( +)\{/) && !$prevp) { checkwarn("BRACEPOS", $line, length($1), $file, $ol, "badly placed open brace"); @@ -995,7 +995,7 @@ sub scanfile { } # if the previous line starts with if/while/for AND ends with a closed - # parenthesis and there's an equal number of open and closed + # parenthesis and there is an equal number of open and closed # parentheses, check that this line is indented $indent more steps, if # not a cpp line elsif(!$prevp && ($prevl =~ /^( *)(if|while|for)(\(.*\))\z/)) { diff --git a/scripts/ciconfig.pl b/scripts/ciconfig.pl index 1d8f23556434..c56c31e2be62 100755 --- a/scripts/ciconfig.pl +++ b/scripts/ciconfig.pl @@ -182,7 +182,7 @@ sub scanjobs { } } -print "Never ENABLED configure options that aren't on by default\n"; +print "Never ENABLED configure options that are not on by default\n"; for my $w (sort keys %avail) { if(!$with{$w} && !$defaulton{$w}) { printf " %s\n", $w; @@ -190,7 +190,7 @@ sub scanjobs { } -print "ENABLED configure options that aren't available\n"; +print "ENABLED configure options that are not available\n"; for my $w (sort keys %with) { if(!$avail{$w}) { printf " %s\n", $w; diff --git a/scripts/cmakelint.sh b/scripts/cmakelint.sh index 9462081f218b..325a07b5e6cb 100755 --- a/scripts/cmakelint.sh +++ b/scripts/cmakelint.sh @@ -34,7 +34,7 @@ # cmake-lint can be installed from PyPi with the command "python3 -m pip # install cmakelang". # -# The xargs invocation is portable, but does not preserve spaces in file names. +# The xargs invocation is portable, but does not preserve spaces in filenames. # If such a file is ever added, then this can be portably fixed by switching to # "xargs -I{}" and appending {} to the end of the xargs arguments (which will # call cmakelint once per file) or by using the GNU extension "xargs -d'\n'". diff --git a/scripts/completion.pl b/scripts/completion.pl index 7b689c74fbba..27e2f062e7a4 100755 --- a/scripts/completion.pl +++ b/scripts/completion.pl @@ -84,8 +84,8 @@ sub parse_main_opts { @files = readdir($dir_handle); closedir($dir_handle) || die "Unable to close handle on dir: $opts_dir due to error: $!"; - # We want regular files that end with .md and don't start with an underscore - # Edge case: MANPAGE.md doesn't start with an underscore but also isn't documentation for an option + # We want regular files that end with .md and do not start with an underscore + # Edge case: MANPAGE.md does not start with an underscore but also is not documentation for an option @files = grep { $_ =~ /\.md$/i && !/^_/ && -f "$opts_dir/$_" && $_ ne "MANPAGE.md" } @files; for my $file (@files) { @@ -145,8 +145,8 @@ sub parse_main_opts { push(@list, $option); } - # Sort longest first, because zsh won't complete an option listed - # after one that's a prefix of it. When length is equal, fall back + # Sort longest first, because zsh does not complete an option listed + # after one that is a prefix of it. When length is equal, fall back # to stringwise cmp. @list = sort { $a =~ /([^=]*)/; my $ma = $1; diff --git a/scripts/managen b/scripts/managen index 6099f0ff4d60..61dae8cc1f0f 100755 --- a/scripts/managen +++ b/scripts/managen @@ -538,7 +538,7 @@ sub render { exit 3; } if($quote) { - # don't leave the quote "hanging" + # do not leave the quote "hanging" push @desc, ".fi\n" if($manpage); } if($tablemode) { @@ -1052,7 +1052,7 @@ sub sourcecategories { my ($dir) = @_; my %cats; open(H, "<$dir/../../src/tool_help.h") || - die "can't find the header file"; + die "cannot find the header file"; while() { if(/^\#define CURLHELP_([A-Z0-9]*)/) { $cats{lc($1)}++; diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index 71880653b2ba..e43463c27a6e 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -92,7 +92,7 @@ my @valid_mozilla_trust_levels = ( "TRUSTED_DELEGATOR", # CAs "NOT_TRUSTED", # Don't trust these certs. - "MUST_VERIFY_TRUST", # This explicitly tells us that it ISN'T a CA but is + "MUST_VERIFY_TRUST", # This explicitly tells us that it IS NOT a CA but is # otherwise ok. In other words, this should tell the # app to ignore any other sources that claim this is # a CA. @@ -154,7 +154,7 @@ () print " 2) Default to 'release', but more recent updates may be found in other trees\n"; print " 3) certdata.txt file format may change, lag time to update this script\n"; print " 4) Generally unwise to blindly trust CAs without manual review & verification\n"; - print " 5) Mozilla apps use additional security checks aren't represented in certdata\n"; + print " 5) Mozilla apps use additional security checks are not represented in certdata\n"; print " 6) Use of this script will make a security engineer grind his teeth and\n"; print " swear at you. ;)\n"; exit; @@ -241,7 +241,7 @@ ($$@) sub sha256 { my $result; if($Digest::SHA::VERSION || $Digest::SHA::PurePerl::VERSION) { - open(FILE, $_[0]) or die "Can't open '$_[0]': $!"; + open(FILE, $_[0]) or die "Could not open '$_[0]': $!"; binmode(FILE); $result = $MOD_SHA->new(256)->addfile(*FILE)->hexdigest; close(FILE); @@ -401,9 +401,9 @@ (%) my $format = $opt_t ? "plain text and " : ""; if($stdout) { - open(CRT, '> -') or die "Couldn't open STDOUT: $!\n"; + open(CRT, '> -') or die "Could not open STDOUT: $!\n"; } else { - open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n"; + open(CRT,">$crt.~") or die "Could not open $crt.~: $!\n"; } print CRT <) { if(/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) { print CRT; @@ -629,25 +629,25 @@ (%) $pipe = "|$openssl x509 -" . $hash . " -fingerprint -noout -inform PEM"; if(!$stdout) { $pipe .= " >> $crt.~"; - close(CRT) or die "Couldn't close $crt.~: $!"; + close(CRT) or die "Could not close $crt.~: $!"; } - open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; + open(TMP, $pipe) or die "Could not open openssl pipe: $!"; print TMP $pem; - close(TMP) or die "Couldn't close openssl pipe: $!"; + close(TMP) or die "Could not close openssl pipe: $!"; if(!$stdout) { - open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; + open(CRT, ">>$crt.~") or die "Could not open $crt.~: $!"; } } $pipe = "|$openssl x509 -text -inform PEM"; if(!$stdout) { $pipe .= " >> $crt.~"; - close(CRT) or die "Couldn't close $crt.~: $!"; + close(CRT) or die "Could not close $crt.~: $!"; } - open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; + open(TMP, $pipe) or die "Could not open openssl pipe: $!"; print TMP $pem; - close(TMP) or die "Couldn't close openssl pipe: $!"; + close(TMP) or die "Could not close openssl pipe: $!"; if(!$stdout) { - open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; + open(CRT, ">>$crt.~") or die "Could not open $crt.~: $!"; } } report "Processed: $caname" if($opt_v); @@ -655,8 +655,8 @@ (%) } } } -close(TXT) or die "Couldn't close $txt: $!\n"; -close(CRT) or die "Couldn't close $crt.~: $!\n"; +close(TXT) or die "Could not close $txt: $!\n"; +close(CRT) or die "Could not close $crt.~: $!\n"; unless($stdout) { if($opt_b && -e $crt) { my $bk = 1; diff --git a/scripts/perlcheck.sh b/scripts/perlcheck.sh index 9e3c87f695c0..4d2996d2f717 100755 --- a/scripts/perlcheck.sh +++ b/scripts/perlcheck.sh @@ -23,7 +23,7 @@ # ########################################################################### -# The xargs invocation is portable, but does not preserve spaces in file names. +# The xargs invocation is portable, but does not preserve spaces in filenames. # If such a file is ever added, then this can be portably fixed by switching to # "xargs -I{}" and appending {} to the end of the xargs arguments (which will # call cmakelint once per file) or by using the GNU extension "xargs -d'\n'". diff --git a/scripts/release-notes.pl b/scripts/release-notes.pl index 593d7965a308..a4b4e2550fa0 100755 --- a/scripts/release-notes.pl +++ b/scripts/release-notes.pl @@ -31,10 +31,10 @@ # # $ ./scripts/release-notes.pl # -# 2. Edit RELEASE-NOTES and remove all entries that don't belong. Unused +# 2. Edit RELEASE-NOTES and remove all entries that do not belong. Unused # references below will be cleaned up in the next step. Make sure to move # "changes" up to the changes section. All entries will by default be listed -# under bug-fixes as this script can't know where to put them. +# under bug-fixes as this script cannot know where to put them. # # 3. Run the cleanup script and let it sort the entries and remove unused # references from lines you removed in step (2): diff --git a/scripts/release-tools.sh b/scripts/release-tools.sh index 4c4ed7d8097d..fc5d87fb9004 100755 --- a/scripts/release-tools.sh +++ b/scripts/release-tools.sh @@ -31,7 +31,7 @@ version=${2:-unknown} tag=$(echo "curl-$version" | tr '.' '_') commit=${3} if [ -n "$commit" ] && [ -r "docs/tarball-commit.txt.dist" ]; then - # If commit is given, then the tag likely doesn't actually exist + # If commit is given, then the tag likely does not actually exist tag="$(cat docs/tarball-commit.txt.dist)" fi diff --git a/scripts/top-complexity b/scripts/top-complexity index 414adaf56ca7..cd132697f7a9 100755 --- a/scripts/top-complexity +++ b/scripts/top-complexity @@ -64,7 +64,7 @@ open(F, "git ls-files '*.c'|"); while() { chomp $_; my $file = $_; - # we can't filter these with git so do it here + # we cannot filter these with git so do it here if($file =~ /^(lib|src)/) { push @files, $file; } From 1e1ec7f6c2864abef038822077e5e6a7f4e47cbb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 18:03:22 +0100 Subject: [PATCH 426/885] badwords: add more contractions, fix fallouts Also fix hits in autotools scripts (not to enforce). Closes #19576 --- .github/scripts/badwords.txt | 13 ++++++ Makefile.am | 2 +- acinclude.m4 | 20 ++++----- configure.ac | 56 ++++++++++++------------ docs/examples/simplessl.c | 2 +- docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md | 2 +- lib/arpa_telnet.h | 2 +- lib/asyn-ares.c | 2 +- lib/cf-h1-proxy.c | 2 +- lib/cookie.c | 2 +- lib/ftp.c | 4 +- lib/vtls/gtls.c | 2 +- m4/curl-compilers.m4 | 4 +- m4/curl-functions.m4 | 2 +- m4/curl-gnutls.m4 | 8 ++-- m4/curl-mbedtls.m4 | 4 +- m4/curl-openssl.m4 | 14 +++--- m4/curl-override.m4 | 2 +- m4/curl-reentrant.m4 | 4 +- m4/curl-rustls.m4 | 6 +-- m4/curl-wolfssl.m4 | 8 ++-- m4/xc-val-flgs.m4 | 2 +- m4/zz40-xc-ovr.m4 | 4 +- m4/zz50-xc-ovr.m4 | 2 +- packages/OS400/os400sys.c | 2 +- packages/vms/build_vms.com | 8 ++-- packages/vms/curl_crtl_init.c | 2 +- scripts/mk-ca-bundle.pl | 2 +- src/tool_parsecfg.c | 2 +- tests/data/test1425 | 2 +- tests/data/test1516 | 2 +- tests/data/test1566 | 2 +- tests/data/test555 | 2 +- tests/dictserver.py | 2 +- tests/ftpserver.pl | 12 ++--- tests/getpart.pm | 6 +-- tests/libtest/lib1308.c | 2 +- tests/libtest/lib557.c | 4 +- tests/libtest/lib560.c | 2 +- tests/negtelnetserver.py | 2 +- tests/processhelp.pm | 2 +- tests/runtests.pl | 2 +- tests/server/sockfilt.c | 2 +- tests/server/tftpd.c | 4 +- tests/smbserver.py | 4 +- tests/test1173.pl | 2 +- 46 files changed, 126 insertions(+), 113 deletions(-) diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index ca86745ebf80..d8f4461d2675 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -18,21 +18,34 @@ couldn't:could not didn't:did not doesn't:does not don't=do not +haven't:have not +i'd:I would +i'll:I will i'm:I am +i've:I have isn't:is not it'd:it would +it'll:it will +might've:might have +needn't:need not should've:should have +shouldn't:should not that's:that is there's:there is they'd:They would they'll:They will they're:They are they've:They have +this'll:this will +wasn't:was not we'd:we would we'll:we will we're:we are we've:we have +weren't:were not won't:will not +would've:would have +wouldn't:would not you'd:you would you'll:you will you're:you are diff --git a/Makefile.am b/Makefile.am index f60c50e5ac54..1ed54423e532 100644 --- a/Makefile.am +++ b/Makefile.am @@ -111,7 +111,7 @@ pytest: test pytest-ci: test test: - @echo "NOTICE: we can't run the tests when cross-compiling!" + @echo "NOTICE: we cannot run the tests when cross-compiling!" else diff --git a/acinclude.m4 b/acinclude.m4 index 7038f32a8b8d..60e05add111e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -820,7 +820,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ ]) dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed - dnl until library linking and run-time checks for clock_gettime succeed. + dnl until library linking and runtime checks for clock_gettime succeed. ]) dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW @@ -1085,8 +1085,8 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [ if test "x$cross_compiling" != xyes; then dnl just run a program to verify that the libs checked for previous to this - dnl point also is available run-time! - AC_MSG_CHECKING([run-time libs availability]) + dnl point also is available runtime! + AC_MSG_CHECKING([runtime libs availability]) CURL_RUN_IFELSE([ int main(void) { @@ -1095,7 +1095,7 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [ ], AC_MSG_RESULT([fine]), AC_MSG_RESULT([failed]) - AC_MSG_ERROR([one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS]) + AC_MSG_ERROR([one or more libs available at link-time are not available runtime. Libs used at link-time: $LIBS]) ) dnl if this test fails, configure has already stopped @@ -1122,7 +1122,7 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [ AC_ARG_WITH(ca-bundle, AS_HELP_STRING([--with-ca-bundle=FILE], [Absolute path to a file containing CA certificates (example: /etc/ca-bundle.crt)]) -AS_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), +AS_HELP_STRING([--without-ca-bundle], [Do not use a default CA bundle]), [ want_ca="$withval" if test "x$want_ca" = "xyes"; then @@ -1136,7 +1136,7 @@ AS_HELP_STRING([--with-ca-path=DIRECTORY], their filenames in a hash format. This option can be used with the OpenSSL, \ GnuTLS, mbedTLS and wolfSSL backends. Refer to OpenSSL c_rehash for details. \ (example: /etc/certificates)]) -AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), +AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]), [ want_capath="$withval" if test "x$want_capath" = "xyes"; then @@ -1255,7 +1255,7 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), AC_MSG_CHECKING([whether to use OpenSSL's built-in CA store]) AC_ARG_WITH(ca-fallback, AS_HELP_STRING([--with-ca-fallback], [Use OpenSSL's built-in CA store]) -AS_HELP_STRING([--without-ca-fallback], [Don't use OpenSSL's built-in CA store]), +AS_HELP_STRING([--without-ca-fallback], [Do not use OpenSSL's built-in CA store]), [ if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter]) @@ -1283,7 +1283,7 @@ AC_DEFUN([CURL_CHECK_CA_EMBED], [ AC_ARG_WITH(ca-embed, AS_HELP_STRING([--with-ca-embed=FILE], [Absolute path to a file containing CA certificates to embed in the curl tool (example: /etc/ca-bundle.crt)]) -AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the curl tool]), +AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the curl tool]), [ want_ca_embed="$withval" if test "x$want_ca_embed" = "xyes"; then @@ -1566,7 +1566,7 @@ TEST EINVAL TEST dnl CURL_DARWIN_CFLAGS dnl dnl Set -Werror=partial-availability to detect possible breaking code -dnl with very low deployment targets. +dnl with low deployment targets. dnl AC_DEFUN([CURL_DARWIN_CFLAGS], [ @@ -1583,7 +1583,7 @@ AC_DEFUN([CURL_DARWIN_CFLAGS], [ dnl CURL_SUPPORTS_BUILTIN_AVAILABLE dnl dnl Check to see if the compiler supports __builtin_available. This built-in -dnl compiler function first appeared in Apple LLVM 9.0.0. It's so new that, at +dnl compiler function first appeared in Apple LLVM 9.0.0. It is so new that, at dnl the time this macro was written, the function was not yet documented. Its dnl purpose is to return true if the code is running under a certain OS version dnl or later. diff --git a/configure.ac b/configure.ac index 9602be344f85..6c1b9c9ba666 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -dnl We don't know the version number "statically" so we use a dash here +dnl We do not know the version number "statically" so we use a dash here AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/]) XC_OVR_ZZ50 @@ -328,7 +328,7 @@ AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]), ) AC_SUBST(VSFTPD) -dnl we'd like a httpd as test server +dnl we would like an httpd as test server dnl HTTPD_ENABLED="maybe" AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH], @@ -378,7 +378,7 @@ fi AC_SUBST(HTTPD) AC_SUBST(APXS) -dnl we'd like a dante as test socks server +dnl we would like a dante as test socks server dnl DANTED_ENABLED="maybe" AC_ARG_WITH(test-danted, [AS_HELP_STRING([--with-test-danted=PATH], @@ -1368,7 +1368,7 @@ else [ dnl zlib.h was found HAVE_ZLIB_H="1" - dnl if the lib wasn't found already, try again with the new paths + dnl if the lib was not found already, try again with the new paths if test "$HAVE_LIBZ" != "1"; then AC_CHECK_LIB(z, gzread, [ @@ -1500,8 +1500,8 @@ if test X"$OPT_BROTLI" != Xno; then if test "$HAVE_BROTLI" = "1"; then if test -n "$DIR_BROTLI"; then - dnl when the brotli shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl when the brotli shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this if test "x$cross_compiling" != "xyes"; then @@ -1589,8 +1589,8 @@ if test X"$OPT_ZSTD" != Xno; then if test "$HAVE_ZSTD" = "1"; then if test -n "$DIR_ZSTD"; then - dnl when the zstd shared lib were found in a path that the run-time - dnl linker doesn't search through, we need to add it to + dnl when the zstd shared lib were found in a path that the runtime + dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to dnl this @@ -1836,7 +1836,7 @@ if test x"$want_gss" = xyes; then CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) fi if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything + dnl krb5-config does not have --libs-only-L or similar, put everything dnl into LIBS gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` LIBS="$gss_libs $LIBS" @@ -1845,7 +1845,7 @@ if test x"$want_gss" = xyes; then LIBS="$gss_libs $LIBS" link_pkgconfig=1 elif test -f "$KRB5CONFIG"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything + dnl krb5-config does not have --libs-only-L or similar, put everything dnl into LIBS gss_libs=`$KRB5CONFIG --libs gssapi` LIBS="$gss_libs $LIBS" @@ -2286,8 +2286,8 @@ if test X"$OPT_LIBSSH2" != Xno; then if test "$USE_LIBSSH2" = "1"; then if test -n "$DIR_SSH2"; then - dnl when the libssh2 shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl when the libssh2 shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this if test "x$cross_compiling" != "xyes"; then @@ -2366,8 +2366,8 @@ elif test X"$OPT_LIBSSH" != Xno; then LIBS="-liphlpapi $LIBS" fi if test -n "$DIR_SSH"; then - dnl when the libssh shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl when the libssh shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this if test "x$cross_compiling" != "xyes"; then @@ -2420,7 +2420,7 @@ case "$OPT_LDAP" in want_ldap="yes" ;; off) - dnl no --with-ldap option given, don't change anything + dnl no --with-ldap option given, do not change anything want_ldap="default" ;; *) @@ -2477,7 +2477,7 @@ if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then if test "$ldap_lib_ok" = "no"; then if test -n "$ldap_askedfor"; then - AC_MSG_ERROR([couldn't detect the LDAP libraries]) + AC_MSG_ERROR([could not detect the LDAP libraries]) fi AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) @@ -2495,7 +2495,7 @@ if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then case X-"$curl_cv_ldap_LIBS" in X-unknown) if test -n "$ldap_askedfor"; then - AC_MSG_ERROR([couldn't detect the LDAP libraries]) + AC_MSG_ERROR([could not detect the LDAP libraries]) fi AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) @@ -2514,8 +2514,8 @@ fi if test x$CURL_DISABLE_LDAP != x1; then dnl Add to library path if needed if test -n "$DIR_LDAP"; then - dnl when the ldap shared lib were found in a path that the run-time - dnl linker doesn't search through, we need to add it to + dnl when the ldap shared lib were found in a path that the runtime + dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to dnl this @@ -2527,8 +2527,8 @@ if test x$CURL_DISABLE_LDAP != x1; then fi if test "$LBERLIBNAME"; then - dnl If name is "no" then don't define this library at all - dnl (it's only needed if libldap.so's dependencies are broken). + dnl If name is "no" then do not define this library at all + dnl (it is only needed if libldap.so's dependencies are broken). dnl Skip this check if we already determined we need both libraries above if test "$LBERLIBNAME" != "no" -a "$ldap_lib_ok" != "yes"; then AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ @@ -3789,7 +3789,7 @@ if test X"$want_quiche" != Xno; then ) ], dnl not found, revert back to clean variables - AC_MSG_ERROR([couldn't use quiche]) + AC_MSG_ERROR([could not use quiche]) ) else dnl no quiche pkg-config found, deal with it @@ -3955,7 +3955,7 @@ if test -z "$PERL" -a x"$FISH_FUNCTIONS_DIR" != x; then fi AM_CONDITIONAL(USE_FISH_COMPLETION, test x"$FISH_FUNCTIONS_DIR" != x) -dnl Now check for the very most basic headers. Then we can use these +dnl Now check for the most basic headers. Then we can use these dnl ones as default-headers when checking for the rest! AC_CHECK_HEADERS( sys/types.h \ @@ -4053,7 +4053,7 @@ AC_CHECK_TYPE(long long, ) if test ${ac_cv_sizeof_curl_off_t} -lt 8; then - AC_MSG_ERROR([64 bit curl_off_t is required]) + AC_MSG_ERROR([64-bit curl_off_t is required]) fi # check for ssize_t @@ -4297,7 +4297,7 @@ if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; t ;; esac - dnl if it wasn't found without lib, search for it in pthread lib + dnl if it was not found without lib, search for it in pthread lib if test "$USE_THREADS_POSIX" != "1"; then # assign PTHREAD for pkg-config use PTHREAD=" -pthread" @@ -4908,7 +4908,7 @@ AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]), AC_MSG_RESULT(yes) ) -dnl only check for HSTS if there's SSL present +dnl only check for HSTS if there is SSL present if test -n "$SSL_ENABLED"; then dnl ************************************************************ dnl switch on/off hsts @@ -5029,9 +5029,9 @@ if test "x$CURL_DISABLE_HTTP" != "x1"; then if test ${ac_cv_sizeof_curl_off_t} -gt 4; then AC_MSG_RESULT(yes) else - dnl WebSockets requires >32 bit curl_off_t + dnl WebSockets requires >32-bit curl_off_t AC_MSG_RESULT(no) - AC_MSG_WARN([WebSockets disabled due to lack of >32 bit curl_off_t]) + AC_MSG_WARN([WebSockets disabled due to lack of >32-bit curl_off_t]) AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) CURL_DISABLE_WEBSOCKETS=1 fi diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index 9fc2e4148405..cf5477f94576 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -103,7 +103,7 @@ int main(void) #endif /* cert is stored PEM coded in file... */ - /* since PEM is default, we needn't set it for PEM */ + /* since PEM is default, we need not set it for PEM */ curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM"); /* set the cert for client authentication */ diff --git a/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md b/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md index 2065fe6f1660..79ced71ea76d 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md @@ -100,7 +100,7 @@ Tell libcurl to try sending application data as TLS1.3 early data. This option is supported for GnuTLS, wolfSSL, quictls and OpenSSL (but not BoringSSL or AWS-LC). It works on TCP and QUIC connections using ngtcp2. This option works on a best effort basis, -in cases when it wasn't possible to send early data the request is resent +in cases when it was not possible to send early data the request is resent normally post-handshake. This option does not work when using QUIC. (Added in 8.11.0 for GnuTLS and 8.13.0 for wolfSSL, quictls and OpenSSL) diff --git a/lib/arpa_telnet.h b/lib/arpa_telnet.h index d641a01da819..055aa98b1096 100644 --- a/lib/arpa_telnet.h +++ b/lib/arpa_telnet.h @@ -79,7 +79,7 @@ static const char * const telnetoptions[]= #define CURL_WILL 251 /* Our side WILL use this option */ #define CURL_WONT 252 /* Our side will not use this option */ #define CURL_DO 253 /* DO use this option! */ -#define CURL_DONT 254 /* DON'T use this option! */ +#define CURL_DONT 254 /* DO NOT use this option! */ #define CURL_IAC 255 /* Interpret As Command */ #ifndef CURL_DISABLE_VERBOSE_STRINGS diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index c729aebdafd6..ad9147a01c34 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -566,7 +566,7 @@ static void async_ares_hostbyname_cb(void *user_data, So, now that we have a usable answer (some IPv4 addresses, some IPv6 addresses, or "no such domain"), we start a timeout for the remaining pending responses. Even though it is typical that this resolved - request came back quickly, that needn't be the case. It might be that + request came back quickly, that need not be the case. It might be that this completing request did not get a result from the first DNS server or even the first round of the whole DNS server pool. So it could already be quite some time after we issued the DNS queries in diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index ac0dc596f2b7..91d690e31a9e 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -175,7 +175,7 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf, curlx_dyn_reset(&ts->rcvbuf); curlx_dyn_reset(&ts->request_data); /* restore the protocol pointer */ - data->info.httpcode = 0; /* clear it as it might've been used for the + data->info.httpcode = 0; /* clear it as it might have been used for the proxy */ /* If a proxy-authorization header was used for the proxy, then we should make sure that it is not accidentally used for the document request diff --git a/lib/cookie.c b/lib/cookie.c index 3155c4b3e42b..c7dedc95e849 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -1629,7 +1629,7 @@ void Curl_flush_cookies(struct Curl_easy *data, bool cleanup) Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); /* only save the cookie file if a transfer was started (data->state.url is set), as otherwise the cookies were not completely initialized and there - might be cookie files that weren't loaded so saving the file is the wrong + might be cookie files that were not loaded so saving the file is the wrong thing. */ if(data->set.str[STRING_COOKIEJAR] && data->state.url) { /* if we have a destination file for all the cookies to get dumped to */ diff --git a/lib/ftp.c b/lib/ftp.c index bcf4b809cc80..7a0bb8ce01dd 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1902,7 +1902,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, #ifndef CURL_DISABLE_PROXY if(conn->bits.proxy) { /* This connection uses a proxy and we need to connect to the proxy again - * here. We do not want to rely on a former host lookup that might've + * here. We do not want to rely on a former host lookup that might have * expired now, instead we remake the lookup here and now! */ struct ip_quadruple ipquad; bool is_ipv6; @@ -1964,7 +1964,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, } /* - * When this is used from the multi interface, this might've returned with + * When this is used from the multi interface, this might have returned with * the 'connected' set to FALSE and thus we are now awaiting a non-blocking * connect to connect. */ diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 4ac6bad0163d..eba5fb36f09f 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -691,7 +691,7 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf, /* we always unconditionally get the session id here, as even if we already got it from the cache and asked to use it in the connection, it - might've been rejected and then a new one is in use now and we need to + might have been rejected and then a new one is in use now and we need to detect that. */ /* get the session ID data size */ diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 9aab2736a7eb..dda5b7934ef3 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -119,7 +119,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ compiler_ver="$clangver" compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` if test "$appleclang" = '1' && test "$oldapple" = '0'; then - dnl Starting with Xcode 7 / clang 3.7, Apple clang won't tell its upstream version + dnl Starting with Xcode 7 / clang 3.7, Apple clang does not tell its upstream version if test "$compiler_num" -ge '1700'; then compiler_num='1901' elif test "$compiler_num" -ge '1600'; then compiler_num='1700' elif test "$compiler_num" -ge '1500'; then compiler_num='1600' @@ -555,7 +555,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # HP_UX_C) # - dnl Disallow run-time dereferencing of null pointers + dnl Disallow runtime dereferencing of null pointers tmp_CFLAGS="$tmp_CFLAGS -z" dnl Disable some remarks dnl #4227: padding struct with n bytes to align member diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index 3640f0c84ebb..a9b9ee58449e 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -3915,7 +3915,7 @@ dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize); dnl dnl glibc-style strerror_r returns a pointer to the error string, dnl and might use the provided workbuf as a scratch area if needed. A -dnl quick test on a few systems shows that it's usually not used at all. +dnl quick test on a few systems shows that it is usually not used at all. dnl dnl POSIX-style strerror_r: dnl diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index e934f870dd6b..9fa7e2451570 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -60,7 +60,7 @@ if test "x$OPT_GNUTLS" != xno; then fi fi else - dnl this is with a given path, first check if there's a libgnutls-config + dnl this is with a given path, first check if there is a libgnutls-config dnl there and if not, make an educated guess cfg=$OPT_GNUTLS/bin/libgnutls-config check=`$cfg --version 2>/dev/null` @@ -74,7 +74,7 @@ if test "x$OPT_GNUTLS" != xno; then addlib=-lgnutls addld=-L$OPT_GNUTLS/lib$libsuff addcflags=-I$OPT_GNUTLS/include - version="" # we just don't know + version="" # we just do not know gtlslib=$OPT_GNUTLS/lib$libsuff fi fi @@ -117,8 +117,8 @@ if test "x$OPT_GNUTLS" != xno; then AC_MSG_NOTICE([detected GnuTLS version $version]) check_for_ca_bundle=1 if test -n "$gtlslib"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to + dnl when shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail dnl due to this if test "x$cross_compiling" != "xyes"; then diff --git a/m4/curl-mbedtls.m4 b/m4/curl-mbedtls.m4 index 573db4c3ab8f..93da5b25e068 100644 --- a/m4/curl-mbedtls.m4 +++ b/m4/curl-mbedtls.m4 @@ -92,8 +92,8 @@ if test "x$OPT_MBEDTLS" != xno; then LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" if test -n "$mbedtlslib"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to + dnl when shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail dnl due to this if test "x$cross_compiling" != "xyes"; then diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index c34268ca9413..b9b93e2ea01f 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -76,7 +76,7 @@ if test "x$OPT_OPENSSL" != xno; then PREFIX_OPENSSL=$OPT_OPENSSL dnl Try pkg-config even when cross-compiling. Since we - dnl specify PKG_CONFIG_LIBDIR we're only looking where + dnl specify PKG_CONFIG_LIBDIR we are only looking where dnl the user told us to look OPENSSL_PCDIR="$OPT_OPENSSL/lib/pkgconfig" if test -f "$OPENSSL_PCDIR/openssl.pc"; then @@ -132,9 +132,9 @@ if test "x$OPT_OPENSSL" != xno; then dnl use the values pkg-config reported. This is here dnl instead of below with CPPFLAGS and LDFLAGS because we only dnl learn about this via pkg-config. If we only have - dnl the argument to --with-openssl we don't know what + dnl the argument to --with-openssl we do not know what dnl additional libs may be necessary. Hope that we - dnl don't need any. + dnl do not need any. LIBS="$SSL_LIBS $LIBS" fi fi @@ -153,7 +153,7 @@ if test "x$OPT_OPENSSL" != xno; then LDFLAGSPC="$CLEANLDFLAGSPC -L$LIB_OPENSSL" fi if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then - # only set this if pkg-config wasn't used + # only set this if pkg-config was not used CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" fi # Linking previously failed, try extra paths from --with-openssl or @@ -316,8 +316,8 @@ if test "x$OPT_OPENSSL" != xno; then if test "$OPENSSL_ENABLED" = "1"; then if test -n "$LIB_OPENSSL"; then - dnl when the ssl shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl when the ssl shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this if test "x$cross_compiling" != "xyes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL" @@ -391,7 +391,7 @@ AS_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]), [ if test X"$enableval" = X"no"; then AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled]) - AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically]) + AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration will not be loaded automatically]) fi ]) diff --git a/m4/curl-override.m4 b/m4/curl-override.m4 index e36c0c6c7428..e84b4ca5faeb 100644 --- a/m4/curl-override.m4 +++ b/m4/curl-override.m4 @@ -42,7 +42,7 @@ AC_BEFORE([$0],[AC_PROG_LIBTOOL]) dnl Override Autoconf's AC_LANG_PROGRAM (C) dnl ------------------------------------------------- dnl This is done to prevent compiler warning -dnl 'function declaration isn't a prototype' +dnl 'function declaration is not a prototype' dnl in function main. This requires at least dnl a C89 compiler and does not support K&R. diff --git a/m4/curl-reentrant.m4 b/m4/curl-reentrant.m4 index 95e539c152e6..5141622aefed 100644 --- a/m4/curl-reentrant.m4 +++ b/m4/curl-reentrant.m4 @@ -359,7 +359,7 @@ _EOF dnl CURL_CONFIGURE_REENTRANT dnl ------------------------------------------------- dnl This first checks if the preprocessor _REENTRANT -dnl symbol is already defined. If it isn't currently +dnl symbol is already defined. If it is not currently dnl defined a set of checks are performed to verify dnl if its definition is required to make visible to dnl the compiler a set of *_r functions. Finally, if @@ -421,7 +421,7 @@ AC_DEFUN([CURL_CONFIGURE_REENTRANT], [ dnl CURL_CONFIGURE_THREAD_SAFE dnl ------------------------------------------------- dnl This first checks if the preprocessor _THREAD_SAFE -dnl symbol is already defined. If it isn't currently +dnl symbol is already defined. If it is not currently dnl defined a set of checks are performed to verify dnl if its definition is required. Finally, if dnl _THREAD_SAFE is already defined or needed it takes diff --git a/m4/curl-rustls.m4 b/m4/curl-rustls.m4 index 8abcc6544bc5..7b7e9975240c 100644 --- a/m4/curl-rustls.m4 +++ b/m4/curl-rustls.m4 @@ -127,9 +127,9 @@ if test "x$OPT_RUSTLS" != xno; then dnl use the values pkg-config reported. This is here dnl instead of below with CPPFLAGS and LDFLAGS because we only dnl learn about this via pkg-config. If we only have - dnl the argument to --with-rustls we don't know what + dnl the argument to --with-rustls we do not know what dnl additional libs may be necessary. Hope that we - dnl don't need any. + dnl do not need any. LIBS="$SSL_LIBS $LIBS" link_pkgconfig=1 ssl_msg="Rustls" @@ -157,7 +157,7 @@ if test "x$OPT_RUSTLS" != xno; then check_for_ca_bundle=1 if test -n "$LIB_RUSTLS"; then - dnl when shared libs were found in a path that the run-time + dnl when shared libs were found in a path that the runtime dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH so that further configure tests do not dnl fail due to this diff --git a/m4/curl-wolfssl.m4 b/m4/curl-wolfssl.m4 index e2c58a94af5d..0eba972b633b 100644 --- a/m4/curl-wolfssl.m4 +++ b/m4/curl-wolfssl.m4 @@ -51,7 +51,7 @@ if test "x$OPT_WOLFSSL" != xno; then dnl try pkg-config magic CURL_CHECK_PKGCONFIG(wolfssl, [$wolfpkg]) - AC_MSG_NOTICE([Check dir $wolfpkg]) + AC_MSG_NOTICE([Check directory $wolfpkg]) addld="" addlib="" @@ -160,8 +160,8 @@ if test "x$OPT_WOLFSSL" != xno; then fi if test -n "$wolfssllibpath"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to + dnl when shared libs were found in a path that the runtime + dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail dnl due to this if test "x$cross_compiling" != "xyes"; then @@ -172,7 +172,7 @@ if test "x$OPT_WOLFSSL" != xno; then fi LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE wolfssl" else - AC_MSG_ERROR([--with-wolfssl but wolfSSL was not found or doesn't work]) + AC_MSG_ERROR([--with-wolfssl but wolfSSL was not found or does not work]) fi fi dnl wolfSSL not disabled diff --git a/m4/xc-val-flgs.m4 b/m4/xc-val-flgs.m4 index e2225c2e5742..4715163c9e7e 100644 --- a/m4/xc-val-flgs.m4 +++ b/m4/xc-val-flgs.m4 @@ -226,7 +226,7 @@ dnl script might have set. When checks fails, user dnl is noticed about errors detected in all of them dnl but script continues execution. dnl -dnl Intended to be used very late in configure script. +dnl Intended to be used late in configure script. AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ AC_PREREQ([2.50])dnl diff --git a/m4/zz40-xc-ovr.m4 b/m4/zz40-xc-ovr.m4 index 6faa94e43ee2..5389a455614c 100644 --- a/m4/zz40-xc-ovr.m4 +++ b/m4/zz40-xc-ovr.m4 @@ -448,7 +448,7 @@ dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro emits shell code which does some -dnl very basic checks related with the availability +dnl basic checks related with the availability dnl of some commands and utilities needed to allow dnl configure script bootstrapping itself when using dnl these to figure out other settings. Also emits @@ -602,7 +602,7 @@ dnl overrides the auto-detected one. dnl dnl Strictly speaking the check is done in two steps. The dnl first, which does the actual check, takes place in -dnl XC_CONFIGURE_PREAMBLE macro and happens very early in +dnl XC_CONFIGURE_PREAMBLE macro and happens early in dnl generated configure script. The second one shows and dnl logs the result of the check into config.log at a later dnl configure stage. Placement of this second stage in diff --git a/m4/zz50-xc-ovr.m4 b/m4/zz50-xc-ovr.m4 index 735df2f59b69..1a1e4a017766 100644 --- a/m4/zz50-xc-ovr.m4 +++ b/m4/zz50-xc-ovr.m4 @@ -35,7 +35,7 @@ dnl ------------------------------------------------- dnl This is done to prevent Libtool 1.5.X from doing dnl unnecessary C++, Fortran and Java tests when only dnl using C language and reduce resulting configure -dnl script by nearly 300 Kb. +dnl script by nearly 300 KB. m4_ifdef([AC_LIBTOOL_LANG_CXX_CONFIG], [m4_undefine([AC_LIBTOOL_LANG_CXX_CONFIG])]) diff --git a/packages/OS400/os400sys.c b/packages/OS400/os400sys.c index 40eca6edc290..4d31d3827c88 100644 --- a/packages/OS400/os400sys.c +++ b/packages/OS400/os400sys.c @@ -702,7 +702,7 @@ Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr) result = ldap_get_values_len(ld, entry, cp); free(cp); - /* Result data are binary in nature, so they haven't been + /* Result data are binary in nature, so they have not been converted to EBCDIC. Therefore do not convert. */ return result; diff --git a/packages/vms/build_vms.com b/packages/vms/build_vms.com index e8bbee86b4d8..7ce36178056d 100644 --- a/packages/vms/build_vms.com +++ b/packages/vms/build_vms.com @@ -1,6 +1,6 @@ $! BUILD_VMS.COM $! -$! I've taken the original build_vms.com, supplied by Nico Baggus, if +$! I have taken the original build_vms.com, supplied by Nico Baggus, if $! memory serves me correctly, and made some modifications. $! $! SSL support is controlled by logical names. If SSL$INCLUDE is @@ -45,14 +45,14 @@ $! LIST Create C compiler listings and linker maps. $! /list/show=(expan,includ)/machine $! FULLLIST Full detailed listing. $! /list/show=(all, nomessages)/machine -$! NOHPSSL Don't use HP SSL, even if available. +$! NOHPSSL Do not use HP SSL, even if available. $! Note, you must match the pointer size that the OpenSSL $! shared image expects. This procedure will select the $! correct HP OpenSSL image. -$! NOSSL Don't use any SSL, even if available. +$! NOSSL Do not use any SSL, even if available. $! OSSLOLB Use OpenSSL object libraries (.OLB), even if shared $! images (.EXE) are available. -$! NOZLIB Don't use GNV$ZLIB shared image even if available. +$! NOZLIB Do not use GNV$ZLIB shared image even if available. $! REALCLEAN Delete product files for all host architectures. (No $! build done.) Alias for CLEAN_ALL $! diff --git a/packages/vms/curl_crtl_init.c b/packages/vms/curl_crtl_init.c index 1c21f1e88166..d6500c08cde3 100644 --- a/packages/vms/curl_crtl_init.c +++ b/packages/vms/curl_crtl_init.c @@ -236,7 +236,7 @@ static void set_features(void) set_feature_default("DECC$EXEC_FILEATTR_INHERITANCE", 2); #endif - /* Don't display trailing dot after files without type */ + /* Do not display trailing dot after files without type */ set_feature_default("DECC$READDIR_DROPDOTNOTYPE", ENABLE); /* For standard output channels buffer output until terminator */ diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index e43463c27a6e..d52edbe734b7 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -91,7 +91,7 @@ my @valid_mozilla_trust_levels = ( "TRUSTED_DELEGATOR", # CAs - "NOT_TRUSTED", # Don't trust these certs. + "NOT_TRUSTED", # Do not trust these certs. "MUST_VERIFY_TRUST", # This explicitly tells us that it IS NOT a CA but is # otherwise ok. In other words, this should tell the # app to ignore any other sources that claim this is diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 5fce4e24d124..53b63746b5ac 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -54,7 +54,7 @@ static int unslashquote(const char *line, struct dynbuf *param) /* default is to output the letter after the backslash */ switch(out = *line) { case '\0': - continue; /* this'll break out of the loop */ + continue; /* this breaks out of the loop */ case 't': out = '\t'; break; diff --git a/tests/data/test1425 b/tests/data/test1425 index 51a38cc01c23..b8b8d0eaa51a 100644 --- a/tests/data/test1425 +++ b/tests/data/test1425 @@ -69,7 +69,7 @@ Content-Type: text/html Funny-head: yesyes -# 23 == CURLE_WRITE_ERROR, curl wouldn't accept the binary output +# 23 == CURLE_WRITE_ERROR, curl would not accept the binary output 23 diff --git a/tests/data/test1516 b/tests/data/test1516 index 226b8d3c9db7..54c8e5af5b67 100644 --- a/tests/data/test1516 +++ b/tests/data/test1516 @@ -11,7 +11,7 @@ resolve # Close the connection after the first request but do not tell the client to do -# so! When starting the second request it'll detect a dead connection and must +# so! When starting the second request it detects a dead connection and must # not clean the DNS entries added manually. HTTP/1.1 200 OK diff --git a/tests/data/test1566 b/tests/data/test1566 index ba1b609a0eda..499022131521 100644 --- a/tests/data/test1566 +++ b/tests/data/test1566 @@ -29,7 +29,7 @@ Content-Type: text/html http ---etag-compare that gets a 304 back shouldn't overwrite the file +--etag-compare that gets a 304 back should not overwrite the file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/output%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER diff --git a/tests/data/test555 b/tests/data/test555 index 1d42c8da2f92..738f96f16f99 100644 --- a/tests/data/test555 +++ b/tests/data/test555 @@ -1,6 +1,6 @@ # NOTE: this test case is a duplicate of 547 but the tool is built to use the -# multi interface instead of easy, but that shouldn't be noticeable at all in +# multi interface instead of easy, but that should not be noticeable at all in # this file! diff --git a/tests/dictserver.py b/tests/dictserver.py index 3ecb86785d8d..41143d6f71c1 100755 --- a/tests/dictserver.py +++ b/tests/dictserver.py @@ -140,7 +140,7 @@ def setup_logging(options): handler.setLevel(logging.DEBUG) root_logger.addHandler(handler) else: - # The logfile wasn't specified. Add a stdout logger. + # The logfile was not specified. Add a stdout logger. add_stdout = True if options.verbose: diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 0ca3ac52811e..74c7ec4fa9f2 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -34,8 +34,8 @@ # It is meant to exercise curl, it is not meant to be a fully working # or even overly standard compliant server. # -# You may optionally specify port on the command line, otherwise it'll -# default to port 8921. +# You may optionally specify port on the command line, otherwise it +# defaults to port 8921. # # All socket/network/TCP related stuff is done by the 'sockfilt' program. # @@ -989,7 +989,7 @@ sub DATA_smtp { } if($nosave) { - print $file "$ulsize bytes would've been stored here\n"; + print $file "$ulsize bytes would have been stored here\n"; } close($file); @@ -1336,7 +1336,7 @@ sub APPEND_imap { } if($nosave) { - print $file "$size bytes would've been stored here\n"; + print $file "$size bytes would have been stored here\n"; } close($file); @@ -2439,7 +2439,7 @@ sub STOR_ftp { } } if($nosave) { - print $file "$ulsize bytes would've been stored here\n"; + print $file "$ulsize bytes would have been stored here\n"; } close($file); close_dataconn($disc); @@ -3342,7 +3342,7 @@ sub customize { } if($check) { - logmsg "$FTPCMD wasn't handled!\n"; + logmsg "$FTPCMD was not handled!\n"; if($proto eq 'pop3') { sendcontrol "-ERR $FTPCMD is not dealt with!\r\n"; } diff --git a/tests/getpart.pm b/tests/getpart.pm index ba611d761f0a..7fa703d0b178 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -115,7 +115,7 @@ sub getpartattr { } last; } - # detect end of section when part wasn't found + # detect end of section when part was not found elsif((1 ==$inside) && ($_ =~ /^ *\<\/$section\>/)) { last; } @@ -242,7 +242,7 @@ sub loadtest { else { # failure if($warning) { - print STDERR "file $file wouldn't open!\n"; + print STDERR "file $file would not open!\n"; } return 1; } @@ -310,7 +310,7 @@ sub savetest { else { # failure if($warning) { - print STDERR "file $file wouldn't open!\n"; + print STDERR "file $file would not open!\n"; } return 1; } diff --git a/tests/libtest/lib1308.c b/tests/libtest/lib1308.c index b859d4da5fe5..6f7b9c264eef 100644 --- a/tests/libtest/lib1308.c +++ b/tests/libtest/lib1308.c @@ -58,7 +58,7 @@ static CURLcode test_lib1308(const char *URL) /* after the first curl_formadd when there is a single entry, both pointers should point to the same struct */ - t1308_fail_unless(post == last, "post and last weren't the same"); + t1308_fail_unless(post == last, "post and last were not the same"); rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode", CURLFORM_COPYCONTENTS, "", diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 42602eeeeb06..38d93a687e81 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -1108,7 +1108,7 @@ static int test_curl_off_t_formatting(void) static int string_check_low(int linenumber, char *buf, const char *buf2) { if(strcmp(buf, buf2)) { - /* they shouldn't differ */ + /* they should not differ */ curl_mprintf("sprintf line %d failed:\nwe '%s'\nsystem: '%s'\n", linenumber, buf, buf2); return 1; @@ -1121,7 +1121,7 @@ static int strlen_check_low(int linenumber, char *buf, size_t len) { size_t buflen = strlen(buf); if(len != buflen) { - /* they shouldn't differ */ + /* they should not differ */ curl_mprintf("sprintf strlen:%d failed:\nwe '%zu'\nsystem: '%zu'\n", linenumber, buflen, len); return 1; diff --git a/tests/libtest/lib560.c b/tests/libtest/lib560.c index bbdb7990e426..45f137aabeb7 100644 --- a/tests/libtest/lib560.c +++ b/tests/libtest/lib560.c @@ -30,7 +30,7 @@ * * This test was added after the HTTPS-using-multi-interface with OpenSSL * regression of 7.19.1 to hopefully prevent this embarrassing mistake from - * appearing again... Unfortunately the bug wasn't triggered by this test, + * appearing again... Unfortunately the bug was not triggered by this test, * which presumably is because the connect to a local server is too * fast/different compared to the real/distant servers we saw the bug happen * with. diff --git a/tests/negtelnetserver.py b/tests/negtelnetserver.py index 61bc1d0359d7..f671907ae677 100755 --- a/tests/negtelnetserver.py +++ b/tests/negtelnetserver.py @@ -323,7 +323,7 @@ def setup_logging(options): handler.setLevel(logging.DEBUG) root_logger.addHandler(handler) else: - # The logfile wasn't specified. Add a stdout logger. + # The logfile was not specified. Add a stdout logger. add_stdout = True if options.verbose: diff --git a/tests/processhelp.pm b/tests/processhelp.pm index 8c436d5eab23..80b961159f63 100644 --- a/tests/processhelp.pm +++ b/tests/processhelp.pm @@ -317,7 +317,7 @@ sub processexists { ####################################################################### # killpid attempts to gracefully stop processes in the given pid list -# with a SIGTERM signal and SIGKILLs those which haven't died on time. +# with a SIGTERM signal and SIGKILLs those which have not died on time. # sub killpid { my ($verbose, $pidlist) = @_; diff --git a/tests/runtests.pl b/tests/runtests.pl index 192c92a641b2..354be91f08a9 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -242,7 +242,7 @@ sub singletest_unbufferlogs { # Clear the buffered log messages & stop buffering after returning them sub singletest_dumplogs { if(!defined $singletest_bufferedrunner) { - # probably not multiprocess mode and logs weren't buffered + # probably not multiprocess mode and logs were not buffered return undef; } my $logsref = $singletest_logs{$singletest_bufferedrunner}; diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index e30f54c41551..08ece51ea141 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -44,7 +44,7 @@ * * o We want FTP-SSL support, which means that a connection that starts with * plain sockets needs to be able to "go SSL" in the midst. This would also - * require some nasty perl stuff I'd rather avoid. + * require some nasty perl stuff I would rather avoid. * * (Source originally based on sws.c) */ diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index a701f223c57d..dd7291c7ceb0 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -148,7 +148,7 @@ struct bf { tftphdr_storage_t buf; /* room for data packet */ }; -#define BF_ALLOC -3 /* alloc'd but not yet filled */ +#define BF_ALLOC -3 /* allocated but not yet filled */ #define BF_FREE -2 /* free */ #define opcode_RRQ 1 @@ -417,7 +417,7 @@ static int writeit(struct testcase *test, struct tftphdr * volatile *dpp, current = !current; /* switch to other buffer */ if(bfs[current].counter != BF_FREE) /* if not free */ write_behind(test, convert); /* flush it */ - bfs[current].counter = BF_ALLOC; /* mark as alloc'd */ + bfs[current].counter = BF_ALLOC; /* mark as allocated */ *dpp = &bfs[current].buf.hdr; return ct; /* this is a lie of course */ } diff --git a/tests/smbserver.py b/tests/smbserver.py index aff9bb067e81..397a40e220f1 100755 --- a/tests/smbserver.py +++ b/tests/smbserver.py @@ -76,7 +76,7 @@ def __enter__(self): signal.signal(signal.SIGTERM, self._sighandler) def __exit__(self, *_): - # Call for shutdown just in case it wasn't done already + # Call for shutdown just in case it was not done already self.shutdown_event.set() # Wait for thread, and therefore also the server, to finish self.join() @@ -408,7 +408,7 @@ def setup_logging(options): handler.setLevel(logging.DEBUG) root_logger.addHandler(handler) else: - # The logfile wasn't specified. Add a stdout logger. + # The logfile was not specified. Add a stdout logger. add_stdout = True if options.verbose: diff --git a/tests/test1173.pl b/tests/test1173.pl index 493ce37ca7d8..80b03d8f94ea 100755 --- a/tests/test1173.pl +++ b/tests/test1173.pl @@ -254,7 +254,7 @@ sub scanmanpage { if($_ =~ /(.*)\\f([^BIP])/) { my ($pre, $format) = ($1, $2); if($pre !~ /\\\z/) { - # only if there wasn't another backslash before the \f + # only if there was not another backslash before the \f print STDERR "$file:$line suspicious \\f format!\n"; $errors++; } From 5fa2d8320c4196435c1d554b06dfdcca73824dec Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 21 Oct 2025 11:51:02 +0200 Subject: [PATCH 427/885] build: tidy-up MSVC CRT warning suppression macros - curl_setup.h: replace `_CRT_SECURE_NO_DEPRECATE` with `_CRT_SECURE_NO_WARNINGS`, which seems to be the preferred, more recent macro for this. Also syncing with libssh2. They are equivalent for curl sources with the supported compilers. - cmake: stop setting `_CRT_SECURE_NO_DEPRECATE` globally for examples. - examples: suppress CRT deprecation warnings on a per-file basis. To make it work when compiling examples out of curl's build systems. Use `_CRT_SECURE_NO_WARNINGS`. - examples: document the functions requiring `_CRT_SECURE_NO_WARNINGS`. - examples/block_ip: delete superfluous `_CRT_SECURE_NO_WARNINGS`. - examples/block_ip: limit `_CRT_NONSTDC_NO_DEPRECATE` to MSVC. - examples/log_failed_transfers: fix to set `_CRT_SECURE_NO_WARNINGS` before headers and limit to MSVC. - curl_setup.h: document which SDKs support `_CRT_NONSTDC_NO_DEPRECATE`. Closes #19175 --- docs/examples/CMakeLists.txt | 3 +-- docs/examples/anyauthput.c | 6 ++++++ docs/examples/block_ip.c | 10 +++++----- docs/examples/chkspeed.c | 5 +++++ docs/examples/cookie_interface.c | 5 +++++ docs/examples/externalsocket.c | 3 +++ docs/examples/fileupload.c | 11 +++++++++-- docs/examples/ftp-wildcard.c | 9 ++++++++- docs/examples/ftpget.c | 13 +++++++++---- docs/examples/ftpgetinfo.c | 15 ++++++++++----- docs/examples/ftpgetresp.c | 14 ++++++++++---- docs/examples/ftpsget.c | 14 +++++++++----- docs/examples/ftpupload.c | 26 ++++++++++++++++---------- docs/examples/ftpuploadresume.c | 6 ++++++ docs/examples/hsts-preload.c | 7 +++++++ docs/examples/http2-download.c | 14 ++++++++++---- docs/examples/http2-serverpush.c | 14 ++++++++++---- docs/examples/http2-upload.c | 27 +++++++++++++++++---------- docs/examples/httpput.c | 6 ++++++ docs/examples/log_failed_transfers.c | 9 ++++++--- docs/examples/sepheaders.c | 6 ++++++ docs/examples/sftpget.c | 5 +++++ docs/examples/sftpuploadresume.c | 6 ++++++ docs/examples/simplessl.c | 6 ++++++ docs/examples/synctime.c | 6 ++++++ docs/examples/url2file.c | 6 ++++++ lib/curl_setup.h | 14 +++++++++----- 27 files changed, 202 insertions(+), 64 deletions(-) diff --git a/docs/examples/CMakeLists.txt b/docs/examples/CMakeLists.txt index c86e8439fda7..31f280898123 100644 --- a/docs/examples/CMakeLists.txt +++ b/docs/examples/CMakeLists.txt @@ -83,8 +83,7 @@ foreach(_target IN LISTS COMPLICATED_MAY_BUILD check_PROGRAMS _all) # keep 'COM add_dependencies(curl-examples ${_target_name}) endif() target_link_libraries(${_target_name} ${LIB_SELECTED} ${CURL_NETWORK_AND_TIME_LIBS} ${_more_libs}) - target_compile_definitions(${_target_name} PRIVATE "CURL_NO_OLDIES" - "$<$:WIN32_LEAN_AND_MEAN>" "$<$:_CRT_SECURE_NO_DEPRECATE>") + target_compile_definitions(${_target_name} PRIVATE "CURL_NO_OLDIES" "$<$:WIN32_LEAN_AND_MEAN>") set_target_properties(${_target_name} PROPERTIES OUTPUT_NAME "${_target}" PROJECT_LABEL "Example ${_target}" UNITY_BUILD OFF) endforeach() diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 12d8de76c974..eb5959ca2263 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -26,6 +26,12 @@ * one the server supports/wants. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include #include #include diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index 290f92a61e78..ef7056dc4340 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -34,13 +34,13 @@ int main(void) { printf("Platform not supported.\n"); return 1; } #else -#ifdef _WIN32 -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS -#endif +#ifdef _MSC_VER #ifndef _CRT_NONSTDC_NO_DEPRECATE -#define _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE /* for strdup() */ +#endif #endif + +#ifdef _WIN32 #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600 #undef _WIN32_WINNT #define _WIN32_WINNT 0x0600 /* Requires Windows Vista */ diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index ea71e6ad70a9..962180a56031 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -34,6 +34,11 @@ * dd if=/dev/urandom of=file_1M.bin bs=1M count=1 * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for ctime() */ +#endif +#endif #include #include diff --git a/docs/examples/cookie_interface.c b/docs/examples/cookie_interface.c index 4eee1a605d83..a031380f1207 100644 --- a/docs/examples/cookie_interface.c +++ b/docs/examples/cookie_interface.c @@ -25,6 +25,11 @@ * Import and export cookies with COOKIELIST. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for _snprintf() */ +#endif +#endif #include #include diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 6cab781a4657..11fedb07a206 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -26,6 +26,9 @@ * */ #ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for strerror() */ +#endif #ifndef _WINSOCK_DEPRECATED_NO_WARNINGS #define _WINSOCK_DEPRECATED_NO_WARNINGS /* for inet_addr() */ #endif diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index fa9de2aa4f64..da69e4a8ead1 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -25,10 +25,17 @@ * Upload to a file:// URL * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include -#include -#include #include +#include + +#include #ifdef _WIN32 #undef stat diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c index 79386f98343d..3bd2f690832b 100644 --- a/docs/examples/ftp-wildcard.c +++ b/docs/examples/ftp-wildcard.c @@ -25,9 +25,16 @@ * FTP wildcard pattern matching * */ -#include +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include +#include + struct callback_data { FILE *output; }; diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c index 391324bf64cc..f57974de1fb1 100644 --- a/docs/examples/ftpget.c +++ b/docs/examples/ftpget.c @@ -21,14 +21,19 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#include - -#include - /* * Get a single file from an FTP server. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + +#include + +#include struct FtpFile { const char *filename; diff --git a/docs/examples/ftpgetinfo.c b/docs/examples/ftpgetinfo.c index 549d3003a8a3..105bc608552f 100644 --- a/docs/examples/ftpgetinfo.c +++ b/docs/examples/ftpgetinfo.c @@ -21,15 +21,20 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#include -#include - -#include - /* * Checks a single file's size and mtime from an FTP server. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + +#include +#include + +#include static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data) { diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c index 6dce4ab7496a..eec727bf943b 100644 --- a/docs/examples/ftpgetresp.c +++ b/docs/examples/ftpgetresp.c @@ -21,15 +21,21 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#include - -#include - /* * Similar to ftpget.c but also stores the received response-lines * in a separate file using our own callback! * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + +#include + +#include + static size_t write_response(void *ptr, size_t size, size_t nmemb, void *data) { FILE *writehere = (FILE *)data; diff --git a/docs/examples/ftpsget.c b/docs/examples/ftpsget.c index f39046885e4f..22c94b8e9363 100644 --- a/docs/examples/ftpsget.c +++ b/docs/examples/ftpsget.c @@ -21,15 +21,19 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - -#include - -#include - /* * Get a single file from an FTPS server. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + +#include + +#include struct FtpFile { const char *filename; diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index b334ad327317..0a241db21c93 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -21,14 +21,26 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +/* + * Performs an FTP upload and renames the file just after a successful + * transfer. + * + */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen(), strerror() */ +#endif +#endif + #include #include +#include +#include +#include +#include #include -#include -#include -#include -#include + #ifdef _WIN32 #include #undef stat @@ -40,12 +52,6 @@ #include #endif -/* - * Performs an FTP upload and renames the file just after a successful - * transfer. - * - */ - #define LOCAL_FILE "/tmp/uploadthis.txt" #define UPLOAD_FILE_AS "while-uploading.txt" #define REMOTE_URL "ftp://example.com/" UPLOAD_FILE_AS diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index b86c23ab8672..a9af3f12cd56 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -25,9 +25,15 @@ * Upload to FTP, resuming failed transfers. Active mode. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen(), sscanf() */ +#endif +#endif #include #include + #include /* parse headers for Content-Length */ diff --git a/docs/examples/hsts-preload.c b/docs/examples/hsts-preload.c index a775ec9778a7..ad71c62cad96 100644 --- a/docs/examples/hsts-preload.c +++ b/docs/examples/hsts-preload.c @@ -25,8 +25,15 @@ * Preload domains to HSTS * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for strcpy() */ +#endif +#endif + #include #include + #include struct entry { diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index e58742e59c96..2caeaba512ee 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -25,15 +25,17 @@ * Multiplexed HTTP/2 downloads over a single connection * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), fopen(), strerror() */ +#endif +#endif + #include #include #include #include -#if defined(_MSC_VER) && (_MSC_VER < 1900) -#define snprintf _snprintf -#endif - /* curl stuff */ #include @@ -44,6 +46,10 @@ #define CURLPIPE_MULTIPLEX 0L #endif +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif + struct transfer { FILE *out; CURL *curl; diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index 8c43075b937d..2664158a1f04 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -25,6 +25,12 @@ * HTTP/2 server push * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), fopen() */ +#endif +#endif + #include #include #include @@ -32,14 +38,14 @@ /* curl stuff */ #include -#if defined(_MSC_VER) && (_MSC_VER < 1900) -#define snprintf _snprintf -#endif - #ifndef CURLPIPE_MULTIPLEX #error "too old libcurl, cannot do HTTP/2 server push!" #endif +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif + static FILE *out_download; static void dump(const char *text, unsigned char *ptr, size_t size, char nohex) diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 0365d93bc5ec..e546ded162cf 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -25,6 +25,13 @@ * Multiplexed HTTP/2 uploads over a single connection * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for '_snprintf(), fopen(), localtime(), + strerror() */ +#endif +#endif + #include #include #include @@ -38,6 +45,16 @@ #include #endif +/* curl stuff */ +#include + +#ifndef CURLPIPE_MULTIPLEX +/* This little trick makes sure that we do not enable pipelining for libcurls + old enough to not have this symbol. It is _not_ defined to zero in a recent + libcurl header. */ +#define CURLPIPE_MULTIPLEX 0L +#endif + #ifdef _WIN32 #undef stat #define stat _stat @@ -50,16 +67,6 @@ #define snprintf _snprintf #endif -/* curl stuff */ -#include - -#ifndef CURLPIPE_MULTIPLEX -/* This little trick makes sure that we do not enable pipelining for libcurls - old enough to not have this symbol. It is _not_ defined to zero in a recent - libcurl header. */ -#define CURLPIPE_MULTIPLEX 0L -#endif - #ifdef _MSC_VER #define gettimeofday(a, b) my_gettimeofday((a), (b)) static int my_gettimeofday(struct timeval *tp, void *tzp) diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index a7fac75b4a2f..38fb641f52cb 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -25,6 +25,12 @@ * HTTP PUT with easy interface and read callback * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include #include #include diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index 23208d232caf..a0d209ffc395 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -31,18 +31,21 @@ * The transfer's log is written to disk only if the transfer fails. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen(), strerror(), vsnprintf() */ +#endif +#endif #include #include #include #include #include + #include #ifdef _WIN32 -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS -#endif #include #define strcasecmp _stricmp #define strncasecmp _strnicmp diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index 85938dc223e4..613bc26a3c7c 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -25,6 +25,12 @@ * Simple HTTP GET that stores the headers in a separate file * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include #include diff --git a/docs/examples/sftpget.c b/docs/examples/sftpget.c index 5eaf3416e8de..287d5b253efb 100644 --- a/docs/examples/sftpget.c +++ b/docs/examples/sftpget.c @@ -25,6 +25,11 @@ * Gets a file using an SFTP URL. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif #include diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index 72ae41382c84..84bb42554939 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -25,9 +25,15 @@ * Upload to SFTP, resuming a previously aborted transfer. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif #include #include + #include /* read data to upload */ diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index cf5477f94576..a41a9ac29e6a 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -25,6 +25,12 @@ * Shows HTTPS usage with client certs and optional ssl engine use. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include #include diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index 43fe5d312eca..a9a746c30a20 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -56,6 +56,12 @@ * This software synchronises your computer clock only when you issue * it with --synctime. By default, it only display the webserver's clock. */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), fopen(), gmtime(), + localtime(), sscanf() */ +#endif +#endif #include diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c index a0523f62db60..b4cbe1c7eb22 100644 --- a/docs/examples/url2file.c +++ b/docs/examples/url2file.c @@ -25,6 +25,12 @@ * Download a given URL into a local file named page.out. * */ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ +#endif +#endif + #include #include diff --git a/lib/curl_setup.h b/lib/curl_setup.h index bf7030f693e1..15688aab2cd4 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -90,11 +90,15 @@ /* Disable Visual Studio warnings: 4127 "conditional expression is constant" */ #pragma warning(disable:4127) /* Avoid VS2005 and upper complaining about portable C functions. */ -#ifndef _CRT_NONSTDC_NO_DEPRECATE -#define _CRT_NONSTDC_NO_DEPRECATE /* for strdup(), write(), etc. */ -#endif -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE /* for fopen(), getenv(), etc. */ +#ifndef _CRT_NONSTDC_NO_DEPRECATE /* mingw-w64 v2+. MS SDK ~10+/~VS2017+. */ +#define _CRT_NONSTDC_NO_DEPRECATE /* for close(), fileno(), strdup(), + unlink(), etc. */ +#endif +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS /* for __sys_errlist, __sys_nerr, _wfopen(), + _wopen(), freopen(), getenv(), gmtime(), + sprintf(), strcpy(), wcscpy(), wcsncpy() + in tests: localtime(), open(), sscanf() */ #endif #endif /* _MSC_VER */ From 0a2618b265c4ae30bd0528718e05cdcea0a9a693 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 22:19:54 +0100 Subject: [PATCH 428/885] examples: make functions/data static where missing Also to avoid compiler warnings on missing declarations. Missed by CI for these "complicated" examples. Closes #19579 --- docs/examples/htmltidy.c | 5 ++--- docs/examples/smooth-gtk-thread.c | 18 ++++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index 97eff2b45acc..de1bd7399e85 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -35,7 +35,7 @@ #include /* curl write callback, to fill tidy's input buffer... */ -uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) +static uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) { uint r; r = size * nmemb; @@ -44,7 +44,7 @@ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) } /* Traverse the document tree */ -void dumpNode(TidyDoc doc, TidyNode tnod, int indent) +static void dumpNode(TidyDoc doc, TidyNode tnod, int indent) { TidyNode child; for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) { @@ -73,7 +73,6 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent) } } - int main(int argc, char **argv) { CURL *curl; diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 0d1438e7d773..2a3cdbc0ef3c 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -45,10 +45,10 @@ #define NUMT 4 -pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -int j = 0; -gint num_urls = 9; /* Just make sure this is less than urls[]*/ -const char * const urls[]= { +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; +static int j = 0; +static gint num_urls = 9; /* Just make sure this is less than urls[] */ +static const char * const urls[] = { "90022", "90023", "90024", @@ -60,7 +60,7 @@ const char * const urls[]= { "90030" }; -size_t write_cb(void *ptr, size_t size, size_t nmemb, FILE *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, FILE *stream) { return fwrite(ptr, size, nmemb, stream); } @@ -89,7 +89,7 @@ static void run_one(gchar *http, int j) } } -void *pull_one_url(void *NaN) +static void *pull_one_url(void *NaN) { /* protect the reading and increasing of 'j' with a mutex */ pthread_mutex_lock(&lock); @@ -109,7 +109,7 @@ void *pull_one_url(void *NaN) } -gboolean pulse_bar(gpointer data) +static gboolean pulse_bar(gpointer data) { gdk_threads_enter(); gtk_progress_bar_pulse(GTK_PROGRESS_BAR (data)); @@ -121,7 +121,7 @@ gboolean pulse_bar(gpointer data) return TRUE; } -void *create_thread(void *progress_bar) +static void *create_thread(void *progress_bar) { pthread_t tid[NUMT]; int i; @@ -155,9 +155,7 @@ void *create_thread(void *progress_bar) /* [Un]Comment this out to kill the program rather than pushing close. */ /* gtk_main_quit(); */ - return NULL; - } static gboolean cb_delete(GtkWidget *window, gpointer data) From 3c7cf8eac3cad4f425cfe7fb487fc6a6f22f6f63 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 23:48:39 +0100 Subject: [PATCH 429/885] examples: tidy-up headers and includes To have a more similar layout across examples. Closes #19580 --- docs/examples/address-scope.c | 1 + docs/examples/altsvc.c | 1 + docs/examples/cacertinmem.c | 4 +++- docs/examples/connect-to.c | 1 + docs/examples/crawler.c | 14 ++++++++------ docs/examples/debug.c | 1 + docs/examples/default-scheme.c | 1 + docs/examples/evhiperfifo.c | 14 ++++++++------ docs/examples/externalsocket.c | 1 + docs/examples/ftp-delete.c | 7 +++---- docs/examples/ftpuploadfrommem.c | 1 + docs/examples/getinfo.c | 1 + docs/examples/getinmemory.c | 1 - docs/examples/getredirect.c | 1 + docs/examples/getreferrer.c | 1 + docs/examples/ghiper.c | 5 +++-- docs/examples/headerapi.c | 1 + docs/examples/hiperfifo.c | 15 ++++++++------- docs/examples/htmltidy.c | 3 ++- docs/examples/htmltitle.cpp | 2 ++ docs/examples/http-options.c | 1 + docs/examples/http-post.c | 1 + docs/examples/http2-download.c | 1 - docs/examples/http2-pushinmemory.c | 1 - docs/examples/http2-serverpush.c | 1 - docs/examples/http2-upload.c | 1 - docs/examples/http3-present.c | 1 + docs/examples/http3.c | 1 + docs/examples/httpcustomheader.c | 1 + docs/examples/httpput-postfields.c | 1 + docs/examples/httpput.c | 1 + docs/examples/https.c | 1 + docs/examples/imap-append.c | 3 +-- docs/examples/imap-authzid.c | 3 +-- docs/examples/imap-copy.c | 3 +-- docs/examples/imap-create.c | 3 +-- docs/examples/imap-delete.c | 3 +-- docs/examples/imap-examine.c | 3 +-- docs/examples/imap-fetch.c | 3 +-- docs/examples/imap-list.c | 3 +-- docs/examples/imap-lsub.c | 3 +-- docs/examples/imap-multi.c | 3 +-- docs/examples/imap-noop.c | 3 +-- docs/examples/imap-search.c | 3 +-- docs/examples/imap-ssl.c | 3 +-- docs/examples/imap-store.c | 3 +-- docs/examples/imap-tls.c | 3 +-- docs/examples/interface.c | 1 + docs/examples/ipv6.c | 1 + docs/examples/keepalive.c | 1 + docs/examples/localport.c | 1 + docs/examples/maxconnects.c | 1 + docs/examples/multi-app.c | 2 -- docs/examples/multi-debugcallback.c | 2 -- docs/examples/multi-double.c | 1 - docs/examples/multi-event.c | 4 ++-- docs/examples/multi-formadd.c | 6 ++---- docs/examples/multi-legacy.c | 2 -- docs/examples/multi-post.c | 1 - docs/examples/multi-single.c | 1 - docs/examples/multi-uv.c | 3 ++- docs/examples/multithread.c | 2 ++ docs/examples/netrc.c | 1 + docs/examples/parseurl.c | 1 + docs/examples/pop3-authzid.c | 3 +-- docs/examples/pop3-dele.c | 3 +-- docs/examples/pop3-list.c | 3 +-- docs/examples/pop3-multi.c | 3 +-- docs/examples/pop3-noop.c | 3 +-- docs/examples/pop3-retr.c | 3 +-- docs/examples/pop3-ssl.c | 3 +-- docs/examples/pop3-stat.c | 3 +-- docs/examples/pop3-tls.c | 3 +-- docs/examples/pop3-top.c | 3 +-- docs/examples/pop3-uidl.c | 3 +-- docs/examples/post-callback.c | 1 + docs/examples/postinmemory.c | 1 + docs/examples/postit2-formadd.c | 2 -- docs/examples/postit2.c | 1 - docs/examples/progressfunc.c | 1 + docs/examples/protofeats.c | 1 + docs/examples/resolve.c | 1 + docs/examples/rtsp-options.c | 1 + docs/examples/sendrecv.c | 2 +- docs/examples/shared-connection-cache.c | 1 + docs/examples/simple.c | 1 + docs/examples/simplepost.c | 1 + docs/examples/smtp-authzid.c | 3 +-- docs/examples/smtp-expn.c | 3 +-- docs/examples/smtp-mail.c | 3 +-- docs/examples/smtp-mime.c | 3 +-- docs/examples/smtp-multi.c | 3 +-- docs/examples/smtp-ssl.c | 3 +-- docs/examples/smtp-tls.c | 3 +-- docs/examples/smtp-vrfy.c | 3 +-- docs/examples/xmlstream.c | 2 +- 96 files changed, 116 insertions(+), 121 deletions(-) diff --git a/docs/examples/address-scope.c b/docs/examples/address-scope.c index 82607e2df50e..adfcf2789bf6 100644 --- a/docs/examples/address-scope.c +++ b/docs/examples/address-scope.c @@ -26,6 +26,7 @@ * */ #include + #include #if !defined(_WIN32) && !defined(MSDOS) && !defined(__AMIGA__) diff --git a/docs/examples/altsvc.c b/docs/examples/altsvc.c index 4021c90002e9..99b92c0157c9 100644 --- a/docs/examples/altsvc.c +++ b/docs/examples/altsvc.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c index 15b11a3b6129..ed8f40aef454 100644 --- a/docs/examples/cacertinmem.c +++ b/docs/examples/cacertinmem.c @@ -30,9 +30,11 @@ #include #include -#include + #include +#include + #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic ignored "-Woverlength-strings" #endif diff --git a/docs/examples/connect-to.c b/docs/examples/connect-to.c index b2848772d81d..3353c6a6c203 100644 --- a/docs/examples/connect-to.c +++ b/docs/examples/connect-to.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index bda931eb13ae..419ceab26d06 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -20,25 +20,27 @@ * * SPDX-License-Identifier: curl * - * To compile: - * gcc crawler.c $(pkg-config --cflags --libs libxml-2.0 libcurl) - * - */ + ***************************************************************************/ /* * Web crawler based on curl and libxml2 to stress-test curl with * hundreds of concurrent connections to various servers. * */ - +/* + * To compile: + * gcc crawler.c $(pkg-config --cflags --libs libxml-2.0 libcurl) + */ #include #include #include -#include + #include #include #include #include +#include + /* Parameters */ static int max_con = 200; static int max_total = 20000; diff --git a/docs/examples/debug.c b/docs/examples/debug.c index 5df7aae90f75..ff59d9c8ab6e 100644 --- a/docs/examples/debug.c +++ b/docs/examples/debug.c @@ -26,6 +26,7 @@ * */ #include + #include struct data { diff --git a/docs/examples/default-scheme.c b/docs/examples/default-scheme.c index b4ea5fa3bfb4..db5063610753 100644 --- a/docs/examples/default-scheme.c +++ b/docs/examples/default-scheme.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 21f188549b99..b6b957d54eb6 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -62,18 +62,20 @@ callback. */ +#include +#include #include -#include #include +#include +#include +#include #include #include #include -#include -#include + #include -#include -#include -#include + +#include #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 11fedb07a206..610a835272a6 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -37,6 +37,7 @@ #include #include #include + #include #ifdef _WIN32 diff --git a/docs/examples/ftp-delete.c b/docs/examples/ftp-delete.c index e43dd30f2f27..795dae851ef8 100644 --- a/docs/examples/ftp-delete.c +++ b/docs/examples/ftp-delete.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#include - -#include - /* * Delete a single file from an FTP server. * */ +#include + +#include static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { diff --git a/docs/examples/ftpuploadfrommem.c b/docs/examples/ftpuploadfrommem.c index 9baf538b9948..af88f52f1a7b 100644 --- a/docs/examples/ftpuploadfrommem.c +++ b/docs/examples/ftpuploadfrommem.c @@ -27,6 +27,7 @@ */ #include #include + #include static const char data[]= diff --git a/docs/examples/getinfo.c b/docs/examples/getinfo.c index d6257afa791c..8d4337539507 100644 --- a/docs/examples/getinfo.c +++ b/docs/examples/getinfo.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c index 025ebe67a553..1deeeda26667 100644 --- a/docs/examples/getinmemory.c +++ b/docs/examples/getinmemory.c @@ -26,7 +26,6 @@ * chunk of memory instead of storing it in a file. * */ - #include #include #include diff --git a/docs/examples/getredirect.c b/docs/examples/getredirect.c index 908cd5f850f8..b1f42dc9fdf4 100644 --- a/docs/examples/getredirect.c +++ b/docs/examples/getredirect.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/getreferrer.c b/docs/examples/getreferrer.c index ae42f4605fce..6827055c2bd9 100644 --- a/docs/examples/getreferrer.c +++ b/docs/examples/getreferrer.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index b9edb517d32d..f27521971cd5 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -55,14 +55,15 @@ callback. */ - #include -#include + #include #include #include #include #include +#include + #include #define MSG_OUT g_print /* Change to "g_error" to write to stderr */ diff --git a/docs/examples/headerapi.c b/docs/examples/headerapi.c index 18588cf33f67..089a23a07013 100644 --- a/docs/examples/headerapi.c +++ b/docs/examples/headerapi.c @@ -26,6 +26,7 @@ * */ #include + #include static size_t write_cb(char *data, size_t n, size_t l, void *userp) diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index 314d7dd9d95a..60288b4bd263 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -58,21 +58,22 @@ This is purely a demo app, all retrieved data is simply discarded by the write callback. */ - +#include +#include #include -#include #include +#include +#include +#include +#include #include #include #include -#include + #include + #include #include -#include -#include -#include -#include #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index de1bd7399e85..04b4809317a9 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -28,10 +28,11 @@ /* * LibTidy => https://www.html-tidy.org/ */ - #include + #include #include + #include /* curl write callback, to fill tidy's input buffer... */ diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index cdbf0afa08eb..97b924b1802d 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -36,7 +36,9 @@ #include #include #include + #include + #include // diff --git a/docs/examples/http-options.c b/docs/examples/http-options.c index 9520670baeab..f1542edbbe5b 100644 --- a/docs/examples/http-options.c +++ b/docs/examples/http-options.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/http-post.c b/docs/examples/http-post.c index fb91822bb8ab..510c4c38396c 100644 --- a/docs/examples/http-post.c +++ b/docs/examples/http-post.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 2caeaba512ee..e6fdbd6b9c75 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -36,7 +36,6 @@ #include #include -/* curl stuff */ #include #ifndef CURLPIPE_MULTIPLEX diff --git a/docs/examples/http2-pushinmemory.c b/docs/examples/http2-pushinmemory.c index e15f15169762..14f37dbbbcd3 100644 --- a/docs/examples/http2-pushinmemory.c +++ b/docs/examples/http2-pushinmemory.c @@ -29,7 +29,6 @@ #include #include -/* curl stuff */ #include struct Memory { diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index 2664158a1f04..5c817ead5893 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -35,7 +35,6 @@ #include #include -/* curl stuff */ #include #ifndef CURLPIPE_MULTIPLEX diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index e546ded162cf..9ec8cbf5bc37 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -45,7 +45,6 @@ #include #endif -/* curl stuff */ #include #ifndef CURLPIPE_MULTIPLEX diff --git a/docs/examples/http3-present.c b/docs/examples/http3-present.c index 084f265c46a9..0052d5018866 100644 --- a/docs/examples/http3-present.c +++ b/docs/examples/http3-present.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/http3.c b/docs/examples/http3.c index 217974f93cac..99de5f8e2e22 100644 --- a/docs/examples/http3.c +++ b/docs/examples/http3.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/httpcustomheader.c b/docs/examples/httpcustomheader.c index 0657313ddf6c..3af5c1a2dbae 100644 --- a/docs/examples/httpcustomheader.c +++ b/docs/examples/httpcustomheader.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/httpput-postfields.c b/docs/examples/httpput-postfields.c index b855f454aec4..29fd6273d7eb 100644 --- a/docs/examples/httpput-postfields.c +++ b/docs/examples/httpput-postfields.c @@ -27,6 +27,7 @@ */ #include #include + #include static const char olivertwist[]= diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 38fb641f52cb..5c3fc314b801 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -34,6 +34,7 @@ #include #include #include + #include #ifdef _WIN32 diff --git a/docs/examples/https.c b/docs/examples/https.c index 1f7f5e1fbb31..905cdb07f23b 100644 --- a/docs/examples/https.c +++ b/docs/examples/https.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c index c78462a508cd..81ca682ffd26 100644 --- a/docs/examples/imap-append.c +++ b/docs/examples/imap-append.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send email with IMAP * */ - #include #include + #include /* This is a simple example showing how to send mail using libcurl's IMAP diff --git a/docs/examples/imap-authzid.c b/docs/examples/imap-authzid.c index b7c2e43f99d9..690b1d77c73f 100644 --- a/docs/examples/imap-authzid.c +++ b/docs/examples/imap-authzid.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Retrieve emails from a shared IMAP mailbox * */ - #include + #include /* This is a simple example showing how to fetch mail using libcurl's IMAP diff --git a/docs/examples/imap-copy.c b/docs/examples/imap-copy.c index 8adb8b8c6d80..7a5b52e10f2d 100644 --- a/docs/examples/imap-copy.c +++ b/docs/examples/imap-copy.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Copy an email from one IMAP folder to another * */ - #include + #include /* This is a simple example showing how to copy a mail from one mailbox folder diff --git a/docs/examples/imap-create.c b/docs/examples/imap-create.c index 51fbe5f1420c..2477a00385c7 100644 --- a/docs/examples/imap-create.c +++ b/docs/examples/imap-create.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Create a new IMAP folder * */ - #include + #include /* This is a simple example showing how to create a new mailbox folder using diff --git a/docs/examples/imap-delete.c b/docs/examples/imap-delete.c index a7682f7664d3..6744613cd1e7 100644 --- a/docs/examples/imap-delete.c +++ b/docs/examples/imap-delete.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Delete an IMAP folder * */ - #include + #include /* This is a simple example showing how to delete an existing mailbox folder diff --git a/docs/examples/imap-examine.c b/docs/examples/imap-examine.c index a46d450d21ab..32f38493f133 100644 --- a/docs/examples/imap-examine.c +++ b/docs/examples/imap-examine.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Obtain information about an IMAP folder * */ - #include + #include /* This is a simple example showing how to obtain information about a mailbox diff --git a/docs/examples/imap-fetch.c b/docs/examples/imap-fetch.c index 937d3e05b80e..ab25ba552bb3 100644 --- a/docs/examples/imap-fetch.c +++ b/docs/examples/imap-fetch.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Retrieve IMAP emails * */ - #include + #include /* This is a simple example showing how to fetch mail using libcurl's IMAP diff --git a/docs/examples/imap-list.c b/docs/examples/imap-list.c index 2d882503d09e..e0201e464ac5 100644 --- a/docs/examples/imap-list.c +++ b/docs/examples/imap-list.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * List the folders within an IMAP mailbox * */ - #include + #include /* This is a simple example showing how to list the folders within an IMAP diff --git a/docs/examples/imap-lsub.c b/docs/examples/imap-lsub.c index 74472d42ec23..e96751856512 100644 --- a/docs/examples/imap-lsub.c +++ b/docs/examples/imap-lsub.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * List the subscribed IMAP folders * */ - #include + #include /* This is a simple example showing how to list the subscribed folders within diff --git a/docs/examples/imap-multi.c b/docs/examples/imap-multi.c index 56a9147bc8a5..afbcfbb51557 100644 --- a/docs/examples/imap-multi.c +++ b/docs/examples/imap-multi.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Get IMAP email with the multi interface * */ - #include #include + #include /* This is a simple example showing how to fetch mail using libcurl's IMAP diff --git a/docs/examples/imap-noop.c b/docs/examples/imap-noop.c index 1d8607590f6f..a4a53ead4f6e 100644 --- a/docs/examples/imap-noop.c +++ b/docs/examples/imap-noop.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Perform an IMAP noop * */ - #include + #include /* This is a simple example showing how to perform a noop using libcurl's IMAP diff --git a/docs/examples/imap-search.c b/docs/examples/imap-search.c index b4e1576b38c6..ebef27b36969 100644 --- a/docs/examples/imap-search.c +++ b/docs/examples/imap-search.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Search for new IMAP emails * */ - #include + #include /* This is a simple example showing how to search for new messages using diff --git a/docs/examples/imap-ssl.c b/docs/examples/imap-ssl.c index 6eb49ae9780b..d56d89331ac4 100644 --- a/docs/examples/imap-ssl.c +++ b/docs/examples/imap-ssl.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * IMAP with implicit SSL * */ - #include + #include /* This is a simple example showing how to fetch mail using libcurl's IMAP diff --git a/docs/examples/imap-store.c b/docs/examples/imap-store.c index 95d8f0747652..c70c70ebce42 100644 --- a/docs/examples/imap-store.c +++ b/docs/examples/imap-store.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Modify the properties of an email over IMAP * */ - #include + #include /* This is a simple example showing how to modify an existing mail using diff --git a/docs/examples/imap-tls.c b/docs/examples/imap-tls.c index 9009174ccf01..61f4cea45bfd 100644 --- a/docs/examples/imap-tls.c +++ b/docs/examples/imap-tls.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * IMAP using TLS * */ - #include + #include /* This is a simple example showing how to fetch mail using libcurl's IMAP diff --git a/docs/examples/interface.c b/docs/examples/interface.c index 0698b6a8e2f2..904131c93a83 100644 --- a/docs/examples/interface.c +++ b/docs/examples/interface.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/ipv6.c b/docs/examples/ipv6.c index 1a55d640494f..d16bfc439346 100644 --- a/docs/examples/ipv6.c +++ b/docs/examples/ipv6.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/keepalive.c b/docs/examples/keepalive.c index 8d55c7133774..5f5c39f57ac8 100644 --- a/docs/examples/keepalive.c +++ b/docs/examples/keepalive.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/localport.c b/docs/examples/localport.c index 2700457211dd..21e632d8a7a9 100644 --- a/docs/examples/localport.c +++ b/docs/examples/localport.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/maxconnects.c b/docs/examples/maxconnects.c index e89f971cf41e..658b38d711e3 100644 --- a/docs/examples/maxconnects.c +++ b/docs/examples/maxconnects.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index 8c0d8b404152..460c93057ad5 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -26,11 +26,9 @@ * transfers in parallel. * */ - #include #include -/* curl stuff */ #include /* diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c index 52f00ce482ea..561a967abf15 100644 --- a/docs/examples/multi-debugcallback.c +++ b/docs/examples/multi-debugcallback.c @@ -25,11 +25,9 @@ * multi interface and debug callback * */ - #include #include -/* curl stuff */ #include #define TRUE 1 diff --git a/docs/examples/multi-double.c b/docs/examples/multi-double.c index 1149f21b78d7..8a0c3d27feb3 100644 --- a/docs/examples/multi-double.c +++ b/docs/examples/multi-double.c @@ -28,7 +28,6 @@ #include #include -/* curl stuff */ #include /* diff --git a/docs/examples/multi-event.c b/docs/examples/multi-event.c index abf907afe534..2698e24678f9 100644 --- a/docs/examples/multi-event.c +++ b/docs/examples/multi-event.c @@ -21,15 +21,15 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * multi_socket API using libevent * */ - #include #include + #include + #include static struct event_base *base; diff --git a/docs/examples/multi-formadd.c b/docs/examples/multi-formadd.c index 068412827ae7..7374fae092e4 100644 --- a/docs/examples/multi-formadd.c +++ b/docs/examples/multi-formadd.c @@ -25,12 +25,10 @@ * using the multi interface to do a multipart formpost without blocking * */ - /* - * Warning: this example uses the deprecated form api. See "multi-post.c" - * for a similar example using the mime api. + * Warning: this example uses the deprecated form API. See "multi-post.c" + * for a similar example using the mime API. */ - #include #include diff --git a/docs/examples/multi-legacy.c b/docs/examples/multi-legacy.c index 93b50c169f4d..ca2c0a4c7afb 100644 --- a/docs/examples/multi-legacy.c +++ b/docs/examples/multi-legacy.c @@ -26,7 +26,6 @@ * transfers in parallel without curl_multi_wait/poll. * */ - #include #include @@ -36,7 +35,6 @@ #include #endif -/* curl stuff */ #include /* diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index c6cb60e898b0..678fb78d0b7b 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -25,7 +25,6 @@ * using the multi interface to do a multipart formpost without blocking * */ - #include #include diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index ee2676bae3fe..6c3f341164ea 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -29,7 +29,6 @@ #include #include -/* curl stuff */ #include /* diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index de6beda2102c..190bed3ef475 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -25,7 +25,6 @@ * multi_socket API using libuv * */ - /* Use the socket_action interface to download multiple files in parallel, powered by libuv. @@ -38,7 +37,9 @@ #include #include + #include + #include /* object to pass to the callbacks */ diff --git a/docs/examples/multithread.c b/docs/examples/multithread.c index 535788e394bc..7de1baea9085 100644 --- a/docs/examples/multithread.c +++ b/docs/examples/multithread.c @@ -29,7 +29,9 @@ /* Requires: HAVE_PTHREAD_H */ #include + #include + #include #define NUMT 4 diff --git a/docs/examples/netrc.c b/docs/examples/netrc.c index 148a7e422be9..91f8df96dc31 100644 --- a/docs/examples/netrc.c +++ b/docs/examples/netrc.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/parseurl.c b/docs/examples/parseurl.c index 1514a798237f..f70df19bef2f 100644 --- a/docs/examples/parseurl.c +++ b/docs/examples/parseurl.c @@ -26,6 +26,7 @@ * */ #include + #include #if !CURL_AT_LEAST_VERSION(7, 62, 0) diff --git a/docs/examples/pop3-authzid.c b/docs/examples/pop3-authzid.c index 8cfe80bca239..85c28d700ee0 100644 --- a/docs/examples/pop3-authzid.c +++ b/docs/examples/pop3-authzid.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Retrieve emails from a shared POP3 mailbox * */ - #include + #include /* This is a simple example showing how to retrieve mail using libcurl's POP3 diff --git a/docs/examples/pop3-dele.c b/docs/examples/pop3-dele.c index 84592da4f9ff..bd220d71693a 100644 --- a/docs/examples/pop3-dele.c +++ b/docs/examples/pop3-dele.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Delete POP3 emails * */ - #include + #include /* This is a simple example showing how to delete an existing mail using diff --git a/docs/examples/pop3-list.c b/docs/examples/pop3-list.c index 05ecc662331a..cef33c2b4f27 100644 --- a/docs/examples/pop3-list.c +++ b/docs/examples/pop3-list.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * List the contents of a POP3 mailbox * */ - #include + #include /* This is a simple example using libcurl's POP3 capabilities to list the diff --git a/docs/examples/pop3-multi.c b/docs/examples/pop3-multi.c index d88d1193499d..be028a777a62 100644 --- a/docs/examples/pop3-multi.c +++ b/docs/examples/pop3-multi.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Get POP3 email using the multi interface * */ - #include #include + #include /* This is a simple example showing how to retrieve mail using libcurl's POP3 diff --git a/docs/examples/pop3-noop.c b/docs/examples/pop3-noop.c index 0ab6eb2d14c5..4bed103fc83f 100644 --- a/docs/examples/pop3-noop.c +++ b/docs/examples/pop3-noop.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Perform a POP3 noop * */ - #include + #include /* This is a simple example showing how to perform a noop using libcurl's POP3 diff --git a/docs/examples/pop3-retr.c b/docs/examples/pop3-retr.c index c89c77e5d649..5cb6e1b54576 100644 --- a/docs/examples/pop3-retr.c +++ b/docs/examples/pop3-retr.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Retrieve POP3 email * */ - #include + #include /* This is a simple example showing how to retrieve mail using libcurl's POP3 diff --git a/docs/examples/pop3-ssl.c b/docs/examples/pop3-ssl.c index 1be48adc8292..0f5ac3692d83 100644 --- a/docs/examples/pop3-ssl.c +++ b/docs/examples/pop3-ssl.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Get POP3 email using implicit SSL * */ - #include + #include /* This is a simple example showing how to retrieve mail using libcurl's POP3 diff --git a/docs/examples/pop3-stat.c b/docs/examples/pop3-stat.c index afaf79c9a4db..929422af9829 100644 --- a/docs/examples/pop3-stat.c +++ b/docs/examples/pop3-stat.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Obtain POP3 message statistics * */ - #include + #include /* This is a simple example showing how to obtain message statistics using diff --git a/docs/examples/pop3-tls.c b/docs/examples/pop3-tls.c index a4a7208986b4..7693e6321928 100644 --- a/docs/examples/pop3-tls.c +++ b/docs/examples/pop3-tls.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * POP3 using TLS * */ - #include + #include /* This is a simple example showing how to retrieve mail using libcurl's POP3 diff --git a/docs/examples/pop3-top.c b/docs/examples/pop3-top.c index 7584503b0c2c..3a8776f0b220 100644 --- a/docs/examples/pop3-top.c +++ b/docs/examples/pop3-top.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * POP3 example showing how to retrieve only the headers of an email * */ - #include + #include /* This is a simple example showing how to retrieve only the headers of a mail diff --git a/docs/examples/pop3-uidl.c b/docs/examples/pop3-uidl.c index aec10342311d..01df011eefc3 100644 --- a/docs/examples/pop3-uidl.c +++ b/docs/examples/pop3-uidl.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * List the contents of a POP3 mailbox by unique ID * */ - #include + #include /* This is a simple example using libcurl's POP3 capabilities to list the diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index ed5b4b197212..bbab00279091 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -27,6 +27,7 @@ */ #include #include + #include /* silly test data to POST */ diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index a6ff7fa3770c..fc42251ddd12 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -28,6 +28,7 @@ #include #include #include + #include struct MemoryStruct { diff --git a/docs/examples/postit2-formadd.c b/docs/examples/postit2-formadd.c index 81f8bfd27c11..086cae0e51b9 100644 --- a/docs/examples/postit2-formadd.c +++ b/docs/examples/postit2-formadd.c @@ -25,7 +25,6 @@ * HTTP Multipart formpost with file upload and two additional parts. * */ - /* * Example code that uploads a filename 'foo' to a remote script that accepts * "HTML form based" (as described in RFC 1738) uploads using HTTP POST. @@ -41,7 +40,6 @@ * * */ - #include #include diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index 57c7c86e3a2b..e5cb96336953 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -37,7 +37,6 @@ * * */ - #include #include diff --git a/docs/examples/progressfunc.c b/docs/examples/progressfunc.c index 052620dcdf67..59477951f934 100644 --- a/docs/examples/progressfunc.c +++ b/docs/examples/progressfunc.c @@ -27,6 +27,7 @@ * */ #include + #include #define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3000000 diff --git a/docs/examples/protofeats.c b/docs/examples/protofeats.c index fef4a3798d79..f93dccef003c 100644 --- a/docs/examples/protofeats.c +++ b/docs/examples/protofeats.c @@ -26,6 +26,7 @@ * */ #include + #include #if !CURL_AT_LEAST_VERSION(7,87,0) diff --git a/docs/examples/resolve.c b/docs/examples/resolve.c index 4ccc3ff1d815..95adb3c1baaa 100644 --- a/docs/examples/resolve.c +++ b/docs/examples/resolve.c @@ -27,6 +27,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/rtsp-options.c b/docs/examples/rtsp-options.c index 8c160f6b76dc..5e732e105f5c 100644 --- a/docs/examples/rtsp-options.c +++ b/docs/examples/rtsp-options.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/sendrecv.c b/docs/examples/sendrecv.c index 71faeb4ad31e..6f7cbb1b5188 100644 --- a/docs/examples/sendrecv.c +++ b/docs/examples/sendrecv.c @@ -25,9 +25,9 @@ * Demonstrate curl_easy_send() and curl_easy_recv() usage. * */ - #include #include + #include /* Avoid warning in FD_SET() with pre-2020 Cygwin/MSYS releases: diff --git a/docs/examples/shared-connection-cache.c b/docs/examples/shared-connection-cache.c index 4af62fee943c..bc1239428ba4 100644 --- a/docs/examples/shared-connection-cache.c +++ b/docs/examples/shared-connection-cache.c @@ -26,6 +26,7 @@ * */ #include + #include static void my_lock(CURL *curl, curl_lock_data data, diff --git a/docs/examples/simple.c b/docs/examples/simple.c index a427266fd406..e7ea3be61153 100644 --- a/docs/examples/simple.c +++ b/docs/examples/simple.c @@ -26,6 +26,7 @@ * */ #include + #include int main(void) diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c index 824e073e2a12..ff7295c59d3b 100644 --- a/docs/examples/simplepost.c +++ b/docs/examples/simplepost.c @@ -27,6 +27,7 @@ */ #include #include + #include int main(void) diff --git a/docs/examples/smtp-authzid.c b/docs/examples/smtp-authzid.c index 539997d945de..a375d839b131 100644 --- a/docs/examples/smtp-authzid.c +++ b/docs/examples/smtp-authzid.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send email on behalf of another user with SMTP * */ - #include #include + #include /* diff --git a/docs/examples/smtp-expn.c b/docs/examples/smtp-expn.c index 727880d6199e..60722a56883b 100644 --- a/docs/examples/smtp-expn.c +++ b/docs/examples/smtp-expn.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Expand an SMTP email mailing list * */ - #include #include + #include /* This is a simple example showing how to expand an email mailing list. diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c index 39aa86a81828..e6e77b97a39d 100644 --- a/docs/examples/smtp-mail.c +++ b/docs/examples/smtp-mail.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send email with SMTP * */ - #include #include + #include /* diff --git a/docs/examples/smtp-mime.c b/docs/examples/smtp-mime.c index d26021ef3407..553947b0976c 100644 --- a/docs/examples/smtp-mime.c +++ b/docs/examples/smtp-mime.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send SMTP mime emails * */ - #include #include + #include /* This is a simple example showing how to send mime mail using libcurl's SMTP diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index 3dabfbb9801e..ab7165cd5277 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send SMTP email with the multi interface * */ - #include + #include /* This is an example showing how to send mail using libcurl's SMTP diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index 36ecd18d7449..a87a033fc4aa 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send SMTP email using implicit SSL * */ - #include #include + #include /* This is a simple example showing how to send mail using libcurl's SMTP diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index b2ea769b21f5..f6b3bb6053c4 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Send SMTP email using implicit TLS * */ - #include #include + #include /* This is a simple example showing how to send mail using libcurl's SMTP diff --git a/docs/examples/smtp-vrfy.c b/docs/examples/smtp-vrfy.c index 33d439ec9c43..e58ed9491d7b 100644 --- a/docs/examples/smtp-vrfy.c +++ b/docs/examples/smtp-vrfy.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Verify an SMTP email address * */ - #include #include + #include /* This is a simple example showing how to verify an email address from an diff --git a/docs/examples/xmlstream.c b/docs/examples/xmlstream.c index 04fc3afd8580..0aec24cc67a7 100644 --- a/docs/examples/xmlstream.c +++ b/docs/examples/xmlstream.c @@ -32,12 +32,12 @@ * gcc -Wall -I/usr/local/include xmlstream.c -lcurl -lexpat -o xmlstream * */ - #include #include #include #include + #include struct MemoryStruct { From a41cea7d677702664ab15894880b3a2f7ba27547 Mon Sep 17 00:00:00 2001 From: boingball Date: Mon, 17 Nov 2025 22:49:27 +0000 Subject: [PATCH 430/885] AmigaOS: increase minimum stack size for tool_main In testing, the older stack size of 16384 was causing curl to crash on heavy TLS loads Closes #19578 --- src/tool_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_main.c b/src/tool_main.c index 8df63ef05a59..8047e663c8f7 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -65,7 +65,7 @@ int vms_show = 0; #else #define CURL_USED #endif -static const char CURL_USED min_stack[] = "$STACK:16384"; +static const char CURL_USED min_stack[] = "$STACK:32768"; #endif #ifdef __MINGW32__ From 1cbe510d8bb862bb391dc81d3aa35a146a52dc31 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 09:22:24 +0100 Subject: [PATCH 431/885] TEST-SUITE.md: correct the man page's path Closes #19586 --- docs/tests/TEST-SUITE.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/tests/TEST-SUITE.md b/docs/tests/TEST-SUITE.md index 2110cfb362ff..527a8599eafd 100644 --- a/docs/tests/TEST-SUITE.md +++ b/docs/tests/TEST-SUITE.md @@ -23,22 +23,24 @@ SPDX-License-Identifier: curl make test TFLAGS="-j10" "make test" builds the test suite support code and invokes the 'runtests.pl' - perl script to run all the tests. The value of `TFLAGS` is passed - directly to 'runtests.pl'. + perl script to run all the tests. The value of `TFLAGS` is passed directly + to 'runtests.pl'. - When you run tests via make, the flags `-a` and `-s` are passed, meaning - to continue running tests even after one fails, and to emit short output. + When you run tests via make, the flags `-a` and `-s` are passed, meaning to + continue running tests even after one fails, and to emit short output. - If you would like to not use those flags, you can run 'runtests.pl' directly. - You must `chdir` into the tests directory, then you can run it like so: + If you would like to not use those flags, you can run 'runtests.pl' + directly. You must `chdir` into the tests directory, then you can run it + like so: ./runtests.pl 303 410 You must have run `make test` at least once first to build the support code. - To see what flags are available for runtests.pl, and what output it emits, run: + To see what flags are available for runtests.pl, and what output it emits, + run: - man ./tests/runtests.1 + man ./docs/runtests.1 After a test fails, examine the tests/log directory for stdout, stderr, and output from the servers used in the test. From 54a3f63520f23d3f81743a949be7eb2f9a46599e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 18 Nov 2025 02:45:17 +0100 Subject: [PATCH 432/885] GHA: reduce timeouts for Linux and macOS jobs Also syncing the run tests timeout in GHA/linux with GHA/maos. Closes #19582 --- .github/workflows/linux.yml | 4 ++-- .github/workflows/macos.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 20a7c4351cd6..d164f08e41ee 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -65,7 +65,7 @@ jobs: name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }} runs-on: ${{ matrix.build.image || 'ubuntu-latest' }} container: ${{ matrix.build.container }} - timeout-minutes: 45 + timeout-minutes: 25 env: MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }} MATRIX_INSTALL_PACKAGES: '${{ matrix.build.install_packages }}' @@ -759,7 +759,7 @@ jobs: - name: 'run tests' if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }} - timeout-minutes: ${{ contains(matrix.build.install_packages, 'valgrind') && 30 || 15 }} + timeout-minutes: ${{ contains(matrix.build.install_packages, 'valgrind') && 20 || 10 }} env: TEST_TARGET: ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} TFLAGS: '${{ matrix.build.tflags }}' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index fc624dc09a5d..56d895f6abfb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -205,7 +205,7 @@ jobs: macos: name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.build.name }}" runs-on: 'macos-15' - timeout-minutes: 45 + timeout-minutes: 25 env: DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" CC: '${{ matrix.compiler }}' From 88024c6d39db0a7797f12a386cad38ec1e155e32 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 09:04:42 +0100 Subject: [PATCH 433/885] tool_getparam: verify that a file exists for some options Passing the option as-is to libcurl is fine, but checking that the file exists allows the tool to better provide a helpful message. This now done for the following options: --cacert, --crlfile, --knownhosts, --netrc-file, --proxy-cacert amd --proxy-crlfile Bonus: bail out properly on OOM errors in the --cert parser. Reported-by: Wesley Moore Fixes #19583 Closes #19585 --- src/tool_getparam.c | 77 +++++++++++++++++++++++----------- src/tool_getparam.h | 6 +-- tests/data/test305 | 7 +++- tests/data/test404 | 7 +++- tests/data/test697 | 2 +- tests/tunit/tool1394.c | 95 +++++++++++++++++++++++------------------- 6 files changed, 118 insertions(+), 76 deletions(-) diff --git a/src/tool_getparam.c b/src/tool_getparam.c index bd90da1ec754..337ad33280f7 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -385,20 +385,21 @@ static const struct LongShort aliases[]= { #ifndef UNITTESTS static #endif -void parse_cert_parameter(const char *cert_parameter, - char **certname, - char **passphrase) +ParameterError parse_cert_parameter(const char *cert_parameter, + char **certname, + char **passphrase) { size_t param_length = strlen(cert_parameter); size_t span; const char *param_place = NULL; char *certname_place = NULL; + ParameterError err = PARAM_OK; *certname = NULL; *passphrase = NULL; /* most trivial assumption: cert_parameter is empty */ if(param_length == 0) - return; + return PARAM_BLANK_STRING; /* next less trivial: cert_parameter starts 'pkcs11:' and thus * looks like a RFC7512 PKCS#11 URI which can be used as-is. @@ -407,12 +408,16 @@ void parse_cert_parameter(const char *cert_parameter, if(curl_strnequal(cert_parameter, "pkcs11:", 7) || !strpbrk(cert_parameter, ":\\")) { *certname = strdup(cert_parameter); - return; + if(!*certname) + return PARAM_NO_MEM; + return PARAM_OK; } /* deal with escaped chars; find unescaped colon if it exists */ certname_place = malloc(param_length + 1); - if(!certname_place) - return; + if(!certname_place) { + err = PARAM_NO_MEM; + goto done; + } *certname = certname_place; param_place = cert_parameter; @@ -471,12 +476,19 @@ void parse_cert_parameter(const char *cert_parameter, param_place++; if(*param_place) { *passphrase = strdup(param_place); + if(!*passphrase) + err = PARAM_NO_MEM; } goto done; } } done: - *certname_place = '\0'; + if(err) { + tool_safefree(*certname); + } + else + *certname_place = '\0'; + return err; } /* Replace (in-place) '%20' by '+' according to RFC1866 */ @@ -507,18 +519,22 @@ static size_t replace_url_encoded_space_by_plus(char *url) return new_index; /* new size */ } -static void +static ParameterError GetFileAndPassword(const char *nextarg, char **file, char **password) { char *certname, *passphrase; + ParameterError err; /* nextarg is never NULL here */ - parse_cert_parameter(nextarg, &certname, &passphrase); - free(*file); - *file = certname; - if(passphrase) { - free(*password); - *password = passphrase; + err = parse_cert_parameter(nextarg, &certname, &passphrase); + if(!err) { + free(*file); + *file = certname; + if(passphrase) { + free(*password); + *password = passphrase; + } } + return err; } /* Get a size parameter for '--limit-rate' or '--max-filesize'. @@ -2164,6 +2180,19 @@ static ParameterError opt_bool(struct OperationConfig *config, return PARAM_OK; } +static ParameterError existingfile(char **store, + const struct LongShort *a, + const char *filename) +{ + struct_stat info; + if(curlx_stat(filename, &info)) { + errorf("The file '%s' provided to --%s does not exist", + filename, a->lname); + return PARAM_BAD_USE; + } + return getstr(store, filename, DENY_BLANK); +} + /* opt_file handles file options */ static ParameterError opt_file(struct OperationConfig *config, const struct LongShort *a, @@ -2181,13 +2210,13 @@ static ParameterError opt_file(struct OperationConfig *config, err = getstr(&config->unix_socket_path, nextarg, DENY_BLANK); break; case C_CACERT: /* --cacert */ - err = getstr(&config->cacert, nextarg, DENY_BLANK); + err = existingfile(&config->cacert, a, nextarg); break; case C_CAPATH: /* --capath */ err = getstr(&config->capath, nextarg, DENY_BLANK); break; case C_CERT: /* --cert */ - GetFileAndPassword(nextarg, &config->cert, &config->key_passwd); + err = GetFileAndPassword(nextarg, &config->cert, &config->key_passwd); break; case C_CONFIG: /* --config */ if(--max_recursive < 0) { @@ -2200,7 +2229,7 @@ static ParameterError opt_file(struct OperationConfig *config, } break; case C_CRLFILE: /* --crlfile */ - err = getstr(&config->crlfile, nextarg, DENY_BLANK); + err = existingfile(&config->crlfile, a, nextarg); break; case C_DUMP_HEADER: /* --dump-header */ err = getstr(&config->headerfile, nextarg, DENY_BLANK); @@ -2225,26 +2254,26 @@ static ParameterError opt_file(struct OperationConfig *config, err = getstr(&config->key, nextarg, DENY_BLANK); break; case C_KNOWNHOSTS: /* --knownhosts */ - err = getstr(&config->knownhosts, nextarg, DENY_BLANK); + err = existingfile(&config->knownhosts, a, nextarg); break; case C_NETRC_FILE: /* --netrc-file */ - err = getstr(&config->netrc_file, nextarg, DENY_BLANK); + err = existingfile(&config->netrc_file, a, nextarg); break; case C_OUTPUT: /* --output */ err = parse_output(config, nextarg); break; case C_PROXY_CACERT: /* --proxy-cacert */ - err = getstr(&config->proxy_cacert, nextarg, DENY_BLANK); + err = existingfile(&config->proxy_cacert, a, nextarg); break; case C_PROXY_CAPATH: /* --proxy-capath */ err = getstr(&config->proxy_capath, nextarg, DENY_BLANK); break; case C_PROXY_CERT: /* --proxy-cert */ - GetFileAndPassword(nextarg, &config->proxy_cert, - &config->proxy_key_passwd); + err = GetFileAndPassword(nextarg, &config->proxy_cert, + &config->proxy_key_passwd); break; case C_PROXY_CRLFILE: /* --proxy-crlfile */ - err = getstr(&config->proxy_crlfile, nextarg, DENY_BLANK); + err = existingfile(&config->proxy_crlfile, a, nextarg); break; case C_PROXY_KEY: /* --proxy-key */ err = getstr(&config->proxy_key, nextarg, ALLOW_BLANK); diff --git a/src/tool_getparam.h b/src/tool_getparam.h index d5ef54a81d24..d4812f6cebca 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -372,9 +372,9 @@ ParameterError getparameter(const char *flag, const char *nextarg, int max_recursive); #ifdef UNITTESTS -void parse_cert_parameter(const char *cert_parameter, - char **certname, - char **passphrase); +ParameterError parse_cert_parameter(const char *cert_parameter, + char **certname, + char **passphrase); #endif ParameterError parse_args(int argc, argv_item_t argv[]); diff --git a/tests/data/test305 b/tests/data/test305 index 2d4ffd1aab93..25656d2289ec 100644 --- a/tests/data/test305 +++ b/tests/data/test305 @@ -19,14 +19,17 @@ https insecure HTTPS without permission -https://%HOSTIP:%HTTPSPORT/want/%TESTNUMBER --cacert moooo --no-ca-native +https://%HOSTIP:%HTTPSPORT/want/%TESTNUMBER --cacert "%LOGDIR/cacert" --no-ca-native + +made up content + # Verify data after the test has been "shot" -77 +77,60 diff --git a/tests/data/test404 b/tests/data/test404 index 8461abfc004a..a4fc826ed9f0 100644 --- a/tests/data/test404 +++ b/tests/data/test404 @@ -19,14 +19,17 @@ ftps FTPS with invalid cacert ---ftp-ssl-control --cacert moooo ftps://%HOSTIP:%FTPSPORT/ +--ftp-ssl-control --cacert "%LOGDIR/cacert" ftps://%HOSTIP:%FTPSPORT/ + +made up content + # Verify data after the test has been "shot" -77 +77,60 diff --git a/tests/data/test697 b/tests/data/test697 index f1958e83e7d2..d6cfd7613628 100644 --- a/tests/data/test697 +++ b/tests/data/test697 @@ -28,7 +28,7 @@ netrc with missing netrc file # Verify data after the test has been "shot" -26 +2 diff --git a/tests/tunit/tool1394.c b/tests/tunit/tool1394.c index 3a5256bae1fc..71be2c87c478 100644 --- a/tests/tunit/tool1394.c +++ b/tests/tunit/tool1394.c @@ -31,84 +31,91 @@ static CURLcode test_tool1394(const char *arg) { UNITTEST_BEGIN_SIMPLE - static const char *values[] = { + struct cert { + const char *param; + const char *cert; + const char *passwd; + }; + + static const struct cert values[] = { /* -E parameter */ /* exp. cert name */ /* exp. passphrase */ - "foo:bar:baz", "foo", "bar:baz", - "foo\\:bar:baz", "foo:bar", "baz", - "foo\\\\:bar:baz", "foo\\", "bar:baz", - "foo:bar\\:baz", "foo", "bar\\:baz", - "foo:bar\\\\:baz", "foo", "bar\\\\:baz", - "foo\\bar\\baz", "foo\\bar\\baz", NULL, - "foo\\\\bar\\\\baz", "foo\\bar\\baz", NULL, - "foo\\", "foo\\", NULL, - "foo\\\\", "foo\\", NULL, - "foo:bar\\", "foo", "bar\\", - "foo:bar\\\\", "foo", "bar\\\\", - "foo:bar:", "foo", "bar:", - "foo\\::bar\\:", "foo:", "bar\\:", - "pkcs11:foobar", "pkcs11:foobar", NULL, - "PKCS11:foobar", "PKCS11:foobar", NULL, - "PkCs11:foobar", "PkCs11:foobar", NULL, + {"foo:bar:baz", "foo", "bar:baz"}, + {"foo\\:bar:baz", "foo:bar", "baz"}, + {"foo\\\\:bar:baz", "foo\\", "bar:baz"}, + {"foo:bar\\:baz", "foo", "bar\\:baz"}, + {"foo:bar\\\\:baz", "foo", "bar\\\\:baz"}, + {"foo\\bar\\baz", "foo\\bar\\baz", NULL}, + {"foo\\\\bar\\\\baz", "foo\\bar\\baz", NULL}, + {"foo\\", "foo\\", NULL}, + {"foo\\\\", "foo\\", NULL}, + {"foo:bar\\", "foo", "bar\\"}, + {"foo:bar\\\\", "foo", "bar\\\\"}, + {"foo:bar:", "foo", "bar:"}, + {"foo\\::bar\\:", "foo:", "bar\\:"}, + {"pkcs11:foobar", "pkcs11:foobar", NULL}, + {"PKCS11:foobar", "PKCS11:foobar", NULL}, + {"PkCs11:foobar", "PkCs11:foobar", NULL}, #ifdef _WIN32 - "c:\\foo:bar:baz", "c:\\foo", "bar:baz", - "c:\\foo\\:bar:baz", "c:\\foo:bar", "baz", - "c:\\foo\\\\:bar:baz", "c:\\foo\\", "bar:baz", - "c:\\foo:bar\\:baz", "c:\\foo", "bar\\:baz", - "c:\\foo:bar\\\\:baz", "c:\\foo", "bar\\\\:baz", - "c:\\foo\\bar\\baz", "c:\\foo\\bar\\baz", NULL, - "c:\\foo\\\\bar\\\\baz", "c:\\foo\\bar\\baz", NULL, - "c:\\foo\\", "c:\\foo\\", NULL, - "c:\\foo\\\\", "c:\\foo\\", NULL, - "c:\\foo:bar\\", "c:\\foo", "bar\\", - "c:\\foo:bar\\\\", "c:\\foo", "bar\\\\", - "c:\\foo:bar:", "c:\\foo", "bar:", - "c:\\foo\\::bar\\:", "c:\\foo:", "bar\\:", + {"c:\\foo:bar:baz", "c:\\foo", "bar:baz"}, + {"c:\\foo\\:bar:baz", "c:\\foo:bar", "baz"}, + {"c:\\foo\\\\:bar:baz", "c:\\foo\\", "bar:baz"}, + {"c:\\foo:bar\\:baz", "c:\\foo", "bar\\:baz"}, + {"c:\\foo:bar\\\\:baz", "c:\\foo", "bar\\\\:baz"}, + {"c:\\foo\\bar\\baz", "c:\\foo\\bar\\baz", NULL}, + {"c:\\foo\\\\bar\\\\baz", "c:\\foo\\bar\\baz", NULL}, + {"c:\\foo\\", "c:\\foo\\", NULL}, + {"c:\\foo\\\\", "c:\\foo\\", NULL}, + {"c:\\foo:bar\\", "c:\\foo", "bar\\"}, + {"c:\\foo:bar\\\\", "c:\\foo", "bar\\\\"}, + {"c:\\foo:bar:", "c:\\foo", "bar:"}, + {"c:\\foo\\::bar\\:", "c:\\foo:", "bar\\:"}, #endif - NULL, NULL, NULL, + {NULL, NULL, NULL} }; - const char **p; + const struct cert *p; char *certname, *passphrase; - for(p = values; *p; p += 3) { - parse_cert_parameter(p[0], &certname, &passphrase); - if(p[1]) { + ParameterError err; + for(p = &values[0]; p->param; p++) { + err = parse_cert_parameter(p->param, &certname, &passphrase); + if(!err) { if(certname) { - if(strcmp(p[1], certname)) { + if(strcmp(p->cert, certname)) { curl_mprintf("expected certname '%s' but got '%s' " - "for -E param '%s'\n", p[1], certname, p[0]); + "for -E param '%s'\n", p->cert, certname, p->param); fail("assertion failure"); } } else { curl_mprintf("expected certname '%s' but got NULL " - "for -E param '%s'\n", p[1], p[0]); + "for -E param '%s'\n", p->cert, p->param); fail("assertion failure"); } } else { if(certname) { curl_mprintf("expected certname NULL but got '%s' " - "for -E param '%s'\n", certname, p[0]); + "for -E param '%s'\n", certname, p->param); fail("assertion failure"); } } - if(p[2]) { + if(p->passwd) { if(passphrase) { - if(strcmp(p[2], passphrase)) { + if(strcmp(p->passwd, passphrase)) { curl_mprintf("expected passphrase '%s' but got '%s'" - "for -E param '%s'\n", p[2], passphrase, p[0]); + "for -E param '%s'\n", p->passwd, passphrase, p->param); fail("assertion failure"); } } else { curl_mprintf("expected passphrase '%s' but got NULL " - "for -E param '%s'\n", p[2], p[0]); + "for -E param '%s'\n", p->passwd, p->param); fail("assertion failure"); } } else { if(passphrase) { curl_mprintf("expected passphrase NULL but got '%s' " - "for -E param '%s'\n", passphrase, p[0]); + "for -E param '%s'\n", passphrase, p->param); fail("assertion failure"); } } From 833efb437dd8fb8b3ff48274531b83a03798b24b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2025 22:40:31 +0100 Subject: [PATCH 434/885] openssl: exit properly on OOM when getting certchain Previously, a momentary OOM error in the middle could produce a broken result instead of correctly returning error. Closes #19471 --- lib/vtls/openssl.c | 197 ++++++++++++++++++++++++++------------------- 1 file changed, 112 insertions(+), 85 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index fd6396471c92..80d01c31604b 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -215,6 +215,13 @@ static CURLcode push_certinfo(struct Curl_easy *data, return result; } +static CURLcode pubkey_show(struct Curl_easy *data, + BIO *mem, + int num, + const char *type, + const char *name, + const BIGNUM *bn) WARN_UNUSED_RESULT; + static CURLcode pubkey_show(struct Curl_easy *data, BIO *mem, int num, @@ -231,7 +238,7 @@ static CURLcode pubkey_show(struct Curl_easy *data, return push_certinfo(data, mem, namebuf, num); } -#define print_pubkey_BN(_type, _name, _num) \ +#define print_pubkey_BN(_type, _name, _num) \ pubkey_show(data, mem, _num, #_type, #_name, _name) static int asn1_object_dump(const ASN1_OBJECT *a, char *buf, size_t len) @@ -285,6 +292,103 @@ static CURLcode X509V3_ext(struct Curl_easy *data, return result; } +static CURLcode get_pkey_rsa(struct Curl_easy *data, + EVP_PKEY *pubkey, BIO *mem, int i) +{ + CURLcode result = CURLE_OK; +#ifndef HAVE_EVP_PKEY_GET_PARAMS + RSA *rsa = EVP_PKEY_get0_RSA(pubkey); +#endif /* !HAVE_EVP_PKEY_GET_PARAMS */ + DECLARE_PKEY_PARAM_BIGNUM(n); + DECLARE_PKEY_PARAM_BIGNUM(e); +#ifdef HAVE_EVP_PKEY_GET_PARAMS + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_RSA_N, &n); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_RSA_E, &e); +#else + RSA_get0_key(rsa, &n, &e, NULL); +#endif /* HAVE_EVP_PKEY_GET_PARAMS */ + BIO_printf(mem, "%d", n ? BN_num_bits(n) : 0); + result = push_certinfo(data, mem, "RSA Public Key", i); + if(!result) { + result = print_pubkey_BN(rsa, n, i); + if(!result) + result = print_pubkey_BN(rsa, e, i); + } + FREE_PKEY_PARAM_BIGNUM(n); + FREE_PKEY_PARAM_BIGNUM(e); + return result; +} + +static CURLcode get_pkey_dsa(struct Curl_easy *data, + EVP_PKEY *pubkey, BIO *mem, int i) +{ + CURLcode result = CURLE_OK; +#ifndef OPENSSL_NO_DSA +#ifndef HAVE_EVP_PKEY_GET_PARAMS + DSA *dsa = EVP_PKEY_get0_DSA(pubkey); +#endif /* !HAVE_EVP_PKEY_GET_PARAMS */ + DECLARE_PKEY_PARAM_BIGNUM(p); + DECLARE_PKEY_PARAM_BIGNUM(q); + DECLARE_PKEY_PARAM_BIGNUM(g); + DECLARE_PKEY_PARAM_BIGNUM(pub_key); +#ifdef HAVE_EVP_PKEY_GET_PARAMS + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_P, &p); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_Q, &q); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_G, &g); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_PUB_KEY, &pub_key); +#else + DSA_get0_pqg(dsa, &p, &q, &g); + DSA_get0_key(dsa, &pub_key, NULL); +#endif /* HAVE_EVP_PKEY_GET_PARAMS */ + result = print_pubkey_BN(dsa, p, i); + if(!result) + result = print_pubkey_BN(dsa, q, i); + if(!result) + result = print_pubkey_BN(dsa, g, i); + if(!result) + result = print_pubkey_BN(dsa, pub_key, i); + FREE_PKEY_PARAM_BIGNUM(p); + FREE_PKEY_PARAM_BIGNUM(q); + FREE_PKEY_PARAM_BIGNUM(g); + FREE_PKEY_PARAM_BIGNUM(pub_key); +#endif /* !OPENSSL_NO_DSA */ + return result; +} + +static CURLcode get_pkey_dh(struct Curl_easy *data, + EVP_PKEY *pubkey, BIO *mem, int i) +{ + CURLcode result; +#ifndef HAVE_EVP_PKEY_GET_PARAMS + DH *dh = EVP_PKEY_get0_DH(pubkey); +#endif /* !HAVE_EVP_PKEY_GET_PARAMS */ + DECLARE_PKEY_PARAM_BIGNUM(p); + DECLARE_PKEY_PARAM_BIGNUM(q); + DECLARE_PKEY_PARAM_BIGNUM(g); + DECLARE_PKEY_PARAM_BIGNUM(pub_key); +#ifdef HAVE_EVP_PKEY_GET_PARAMS + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_P, &p); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_Q, &q); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_G, &g); + EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_PUB_KEY, &pub_key); +#else + DH_get0_pqg(dh, &p, &q, &g); + DH_get0_key(dh, &pub_key, NULL); +#endif /* HAVE_EVP_PKEY_GET_PARAMS */ + result = print_pubkey_BN(dh, p, i); + if(!result) + result = print_pubkey_BN(dh, q, i); + if(!result) + result = print_pubkey_BN(dh, g, i); + if(!result) + result = print_pubkey_BN(dh, pub_key, i); + FREE_PKEY_PARAM_BIGNUM(p); + FREE_PKEY_PARAM_BIGNUM(q); + FREE_PKEY_PARAM_BIGNUM(g); + FREE_PKEY_PARAM_BIGNUM(pub_key); + return result; +} + static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) { CURLcode result; @@ -391,95 +495,18 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) infof(data, " Unable to load public key"); else { switch(EVP_PKEY_id(pubkey)) { - case EVP_PKEY_RSA: { -#ifndef HAVE_EVP_PKEY_GET_PARAMS - RSA *rsa; - rsa = EVP_PKEY_get0_RSA(pubkey); -#endif /* !HAVE_EVP_PKEY_GET_PARAMS */ - - { - DECLARE_PKEY_PARAM_BIGNUM(n); - DECLARE_PKEY_PARAM_BIGNUM(e); -#ifdef HAVE_EVP_PKEY_GET_PARAMS - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_RSA_N, &n); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_RSA_E, &e); -#else - RSA_get0_key(rsa, &n, &e, NULL); -#endif /* HAVE_EVP_PKEY_GET_PARAMS */ - BIO_printf(mem, "%d", n ? BN_num_bits(n) : 0); - result = push_certinfo(data, mem, "RSA Public Key", i); - if(result) - break; - print_pubkey_BN(rsa, n, i); - print_pubkey_BN(rsa, e, i); - FREE_PKEY_PARAM_BIGNUM(n); - FREE_PKEY_PARAM_BIGNUM(e); - } - + case EVP_PKEY_RSA: + result = get_pkey_rsa(data, pubkey, mem, i); break; - } + case EVP_PKEY_DSA: - { -#ifndef OPENSSL_NO_DSA -#ifndef HAVE_EVP_PKEY_GET_PARAMS - DSA *dsa = EVP_PKEY_get0_DSA(pubkey); -#endif /* !HAVE_EVP_PKEY_GET_PARAMS */ - { - DECLARE_PKEY_PARAM_BIGNUM(p); - DECLARE_PKEY_PARAM_BIGNUM(q); - DECLARE_PKEY_PARAM_BIGNUM(g); - DECLARE_PKEY_PARAM_BIGNUM(pub_key); -#ifdef HAVE_EVP_PKEY_GET_PARAMS - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_P, &p); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_Q, &q); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_G, &g); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_PUB_KEY, &pub_key); -#else - DSA_get0_pqg(dsa, &p, &q, &g); - DSA_get0_key(dsa, &pub_key, NULL); -#endif /* HAVE_EVP_PKEY_GET_PARAMS */ - print_pubkey_BN(dsa, p, i); - print_pubkey_BN(dsa, q, i); - print_pubkey_BN(dsa, g, i); - print_pubkey_BN(dsa, pub_key, i); - FREE_PKEY_PARAM_BIGNUM(p); - FREE_PKEY_PARAM_BIGNUM(q); - FREE_PKEY_PARAM_BIGNUM(g); - FREE_PKEY_PARAM_BIGNUM(pub_key); - } -#endif /* !OPENSSL_NO_DSA */ + result = get_pkey_dsa(data, pubkey, mem, i); break; - } - case EVP_PKEY_DH: { -#ifndef HAVE_EVP_PKEY_GET_PARAMS - DH *dh = EVP_PKEY_get0_DH(pubkey); -#endif /* !HAVE_EVP_PKEY_GET_PARAMS */ - { - DECLARE_PKEY_PARAM_BIGNUM(p); - DECLARE_PKEY_PARAM_BIGNUM(q); - DECLARE_PKEY_PARAM_BIGNUM(g); - DECLARE_PKEY_PARAM_BIGNUM(pub_key); -#ifdef HAVE_EVP_PKEY_GET_PARAMS - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_P, &p); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_Q, &q); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_FFC_G, &g); - EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_PUB_KEY, &pub_key); -#else - DH_get0_pqg(dh, &p, &q, &g); - DH_get0_key(dh, &pub_key, NULL); -#endif /* HAVE_EVP_PKEY_GET_PARAMS */ - print_pubkey_BN(dh, p, i); - print_pubkey_BN(dh, q, i); - print_pubkey_BN(dh, g, i); - print_pubkey_BN(dh, pub_key, i); - FREE_PKEY_PARAM_BIGNUM(p); - FREE_PKEY_PARAM_BIGNUM(q); - FREE_PKEY_PARAM_BIGNUM(g); - FREE_PKEY_PARAM_BIGNUM(pub_key); - } + + case EVP_PKEY_DH: + result = get_pkey_dh(data, pubkey, mem, i); break; } - } EVP_PKEY_free(pubkey); } From 6dac2631df4b513e89464c29b257d168ce32155e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 14:29:36 +0100 Subject: [PATCH 435/885] url: if OOM in parse_proxy() return error Closes #19590 --- lib/url.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/url.c b/lib/url.c index cf34514b1a9b..527d69839049 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2285,7 +2285,11 @@ static CURLcode parse_proxy(struct Curl_easy *data, conn->bits.proxy_user_passwd = TRUE; /* enable it */ } - (void)curl_url_get(uhp, CURLUPART_PORT, &portptr, 0); + uc = curl_url_get(uhp, CURLUPART_PORT, &portptr, 0); + if(uc == CURLUE_OUT_OF_MEMORY) { + result = CURLE_OUT_OF_MEMORY; + goto error; + } if(portptr) { curl_off_t num; From 80005b4c8a5743aa48f6164f5da602cd8416451d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 15:00:50 +0100 Subject: [PATCH 436/885] cookie: return error on OOM Follow-up to 3f0629ca443825916cbc0795bcd5f241fbf710 Closes #19591 --- lib/cookie.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index c7dedc95e849..85356d563bb1 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -464,10 +464,11 @@ parse_cookie_header(struct Curl_easy *data, return CURLE_OK; strstore(&co->name, curlx_str(&name), curlx_strlen(&name)); - strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); - done = TRUE; + if(co->name) + strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); if(!co->name || !co->value) - return CURLE_OK; + return CURLE_OUT_OF_MEMORY; + done = TRUE; if(invalid_octets(co->value) || invalid_octets(co->name)) { infof(data, "invalid octets in name/value, cookie dropped"); From 97169a91d9ce0efef2bea7a185b1daa3c1f376be Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 16:13:28 +0100 Subject: [PATCH 437/885] hsts: propagate and error out correctly on OOM Closes #19593 --- lib/hsts.c | 8 ++++++-- lib/hsts.h | 4 ++-- lib/transfer.c | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/hsts.c b/lib/hsts.c index 437851b8baee..ec332392c429 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -571,18 +571,22 @@ CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h) return CURLE_OK; } -void Curl_hsts_loadfiles(struct Curl_easy *data) +CURLcode Curl_hsts_loadfiles(struct Curl_easy *data) { + CURLcode result = CURLE_OK; struct curl_slist *l = data->state.hstslist; if(l) { Curl_share_lock(data, CURL_LOCK_DATA_HSTS, CURL_LOCK_ACCESS_SINGLE); while(l) { - (void)Curl_hsts_loadfile(data, data->hsts, l->data); + result = Curl_hsts_loadfile(data, data->hsts, l->data); + if(result) + break; l = l->next; } Curl_share_unlock(data, CURL_LOCK_DATA_HSTS); } + return result; } #if defined(DEBUGBUILD) || defined(UNITTESTS) diff --git a/lib/hsts.h b/lib/hsts.h index 8ec9637cb0c0..cb83ada79043 100644 --- a/lib/hsts.h +++ b/lib/hsts.h @@ -59,11 +59,11 @@ CURLcode Curl_hsts_loadfile(struct Curl_easy *data, struct hsts *h, const char *file); CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h); -void Curl_hsts_loadfiles(struct Curl_easy *data); +CURLcode Curl_hsts_loadfiles(struct Curl_easy *data); #else #define Curl_hsts_cleanup(x) #define Curl_hsts_loadcb(x,y) CURLE_OK #define Curl_hsts_save(x,y,z) -#define Curl_hsts_loadfiles(x) +#define Curl_hsts_loadfiles(x) CURLE_OK #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */ #endif /* HEADER_CURL_HSTS_H */ diff --git a/lib/transfer.c b/lib/transfer.c index 2b06566f73c0..b576e6b88dbe 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -554,8 +554,9 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) if(!result && data->state.resolve) result = Curl_loadhostpairs(data); - /* If there is a list of hsts files to read */ - Curl_hsts_loadfiles(data); + if(!result) + /* If there is a list of hsts files to read */ + result = Curl_hsts_loadfiles(data); if(!result) { /* Allow data->set.use_port to set which port to use. This needs to be @@ -608,7 +609,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) * basically anything through an HTTP proxy we cannot limit this based on * protocol. */ - if(data->set.str[STRING_USERAGENT]) { + if(!result && data->set.str[STRING_USERAGENT]) { free(data->state.aptr.uagent); data->state.aptr.uagent = curl_maprintf("User-Agent: %s\r\n", data->set.str[STRING_USERAGENT]); From de49cc89abc917cb4f273ebea8c6fb584d097de2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Nov 2025 20:21:44 +0100 Subject: [PATCH 438/885] tests/data: more XML-compliance via `%LT` and `%GT` macros in email addresses Reduce number of files failing `xmllint --format` from 133 to 57 (-76) (3% of 1894), by replacing `<` and `>` with new macro `%LT` and `%GT`, in most places, which is in email addresses (192 lines). Follow-up to a9ec2a676c4257cf522a4349fb24fa547ed48aad #19491 Closes #19470 --- tests/data/test1015 | 2 +- tests/data/test1187 | 6 +++--- tests/data/test1221 | 2 +- tests/data/test1320 | 4 ++-- tests/data/test1406 | 6 +++--- tests/data/test1507 | 4 ++-- tests/data/test1520 | 4 ++-- tests/data/test1711 | 4 ++-- tests/data/test3002 | 12 ++++++------ tests/data/test3003 | 12 ++++++------ tests/data/test3004 | 12 ++++++------ tests/data/test3005 | 12 ++++++------ tests/data/test3006 | 12 ++++++------ tests/data/test3007 | 4 ++-- tests/data/test3209 | 8 ++++---- tests/data/test3210 | 8 ++++---- tests/data/test3215 | 6 +++--- tests/data/test646 | 8 ++++---- tests/data/test647 | 8 ++++---- tests/data/test648 | 4 ++-- tests/data/test649 | 4 ++-- tests/data/test652 | 4 ++-- tests/data/test805 | 8 ++++---- tests/data/test864 | 2 +- tests/data/test900 | 4 ++-- tests/data/test901 | 4 ++-- tests/data/test902 | 4 ++-- tests/data/test903 | 4 ++-- tests/data/test904 | 4 ++-- tests/data/test905 | 4 ++-- tests/data/test906 | 4 ++-- tests/data/test907 | 4 ++-- tests/data/test908 | 4 ++-- tests/data/test909 | 4 ++-- tests/data/test910 | 4 ++-- tests/data/test911 | 4 ++-- tests/data/test912 | 4 ++-- tests/data/test913 | 2 +- tests/data/test914 | 2 +- tests/data/test915 | 4 ++-- tests/data/test916 | 4 ++-- tests/data/test917 | 12 ++++++------ tests/data/test918 | 6 +++--- tests/data/test919 | 4 ++-- tests/data/test920 | 4 ++-- tests/data/test921 | 4 ++-- tests/data/test922 | 4 ++-- tests/data/test924 | 6 +++--- tests/data/test927 | 6 +++--- tests/data/test935 | 4 ++-- tests/data/test936 | 4 ++-- tests/data/test937 | 4 ++-- tests/data/test938 | 8 ++++---- tests/data/test939 | 4 ++-- tests/data/test940 | 4 ++-- tests/data/test941 | 4 ++-- tests/data/test942 | 4 ++-- tests/data/test943 | 4 ++-- tests/data/test944 | 4 ++-- tests/data/test945 | 4 ++-- tests/data/test946 | 4 ++-- tests/data/test947 | 4 ++-- tests/data/test950 | 2 +- tests/data/test951 | 4 ++-- tests/data/test952 | 4 ++-- tests/data/test953 | 4 ++-- tests/data/test955 | 2 +- tests/data/test956 | 4 ++-- tests/data/test959 | 2 +- tests/data/test960 | 4 ++-- tests/data/test962 | 4 ++-- tests/data/test963 | 4 ++-- tests/data/test965 | 4 ++-- tests/data/test966 | 4 ++-- tests/data/test969 | 6 +++--- tests/data/test981 | 4 ++-- tests/data/test984 | 4 ++-- tests/data/test987 | 4 ++-- tests/data/test992 | 4 ++-- tests/testutil.pm | 2 ++ 80 files changed, 195 insertions(+), 193 deletions(-) diff --git a/tests/data/test1015 b/tests/data/test1015 index beabcd1b9017..9f2a53d49a87 100644 --- a/tests/data/test1015 +++ b/tests/data/test1015 @@ -31,7 +31,7 @@ http http://%HOSTIP:%HTTPPORT/%TESTNUMBER --data-urlencode "my name is moo[]" --data-urlencode "y e s=s_i_r" --data-urlencode "v_alue@%LOGDIR/%TESTNUMBER.txt" --data-urlencode @%LOGDIR/%TESTNUMBER.txt -content to _?!#$'|<> +content to _?!#$'|%LT%GT diff --git a/tests/data/test1187 b/tests/data/test1187 index 82debafd0404..fdfadd847f8a 100644 --- a/tests/data/test1187 +++ b/tests/data/test1187 @@ -30,7 +30,7 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=This is the mail text" -F '=File content;filename="strange\file\"name"' +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=This is the mail text" -F '=File content;filename="strange\file\"name"' @@ -43,8 +43,8 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test1221 b/tests/data/test1221 index 6a410d95b898..1bfc61bdee3e 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -32,7 +32,7 @@ http http://%HOSTIP:%HTTPPORT/%TESTNUMBER --url-query "my name is moo[]" --url-query "yes=s i r" --url-query "v_alue@%LOGDIR/%TESTNUMBER.txt" --url-query @%LOGDIR/%TESTNUMBER.txt --url-query "+%3d%3d" --data-urlencode "start=once upon the time" -content to _?!#$'|<> +content to _?!#$'|%LT%GT diff --git a/tests/data/test1320 b/tests/data/test1320 index 92a23a4e9f4e..8c189ee9c7b2 100644 --- a/tests/data/test1320 +++ b/tests/data/test1320 @@ -48,8 +48,8 @@ smtp://smtp.%TESTNUMBER:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test1406 b/tests/data/test1406 index bdd142159d9c..492b5b8b31d1 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -49,9 +49,9 @@ ftp EHLO %TESTNUMBER -MAIL FROM: SIZE=38 -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT SIZE=38 +RCPT TO:%LTrecipient.one@example.com%GT +RCPT TO:%LTrecipient.two@example.com%GT DATA QUIT diff --git a/tests/data/test1507 b/tests/data/test1507 index afc87120566b..f48eff4de884 100644 --- a/tests/data/test1507 +++ b/tests/data/test1507 @@ -41,8 +41,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM:<%TESTNUMBER-realuser@example.com> -RCPT TO:<%TESTNUMBER-recipient@example.com> +MAIL FROM:%LT%TESTNUMBER-realuser@example.com%GT +RCPT TO:%LT%TESTNUMBER-recipient@example.com%GT DATA diff --git a/tests/data/test1520 b/tests/data/test1520 index f49b9147799c..acd3413e2cf7 100644 --- a/tests/data/test1520 +++ b/tests/data/test1520 @@ -41,8 +41,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test1711 b/tests/data/test1711 index 709266eac619..d7725e96e5ed 100644 --- a/tests/data/test1711 +++ b/tests/data/test1711 @@ -35,8 +35,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test3002 b/tests/data/test3002 index ffb6e49a49dc..fdb657bd7133 100644 --- a/tests/data/test3002 +++ b/tests/data/test3002 @@ -43,12 +43,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTinvalid.one%GT +RCPT TO:%LTrecipient.two@example.com%GT +RCPT TO:%LTrecipient.three@example.com%GT +RCPT TO:%LTrecipient.four@example.com%GT +RCPT TO:%LTrecipient.five@example.com%GT DATA QUIT diff --git a/tests/data/test3003 b/tests/data/test3003 index 07c72f0798a8..f382e0ec581f 100644 --- a/tests/data/test3003 +++ b/tests/data/test3003 @@ -43,12 +43,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient.one@example.com%GT +RCPT TO:%LTrecipient.two@example.com%GT +RCPT TO:%LTrecipient.three@example.com%GT +RCPT TO:%LTrecipient.four@example.com%GT +RCPT TO:%LTinvalid.five%GT DATA QUIT diff --git a/tests/data/test3004 b/tests/data/test3004 index 52ef1188b928..d11e3dafe5d6 100644 --- a/tests/data/test3004 +++ b/tests/data/test3004 @@ -43,12 +43,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient.one@example.com%GT +RCPT TO:%LTrecipient.two@example.com%GT +RCPT TO:%LTinvalid.three%GT +RCPT TO:%LTrecipient.four@example.com%GT +RCPT TO:%LTrecipient.five@example.com%GT DATA QUIT diff --git a/tests/data/test3005 b/tests/data/test3005 index 68dedd2fc002..725cfce20cdb 100644 --- a/tests/data/test3005 +++ b/tests/data/test3005 @@ -43,12 +43,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTinvalid.one%GT +RCPT TO:%LTrecipient.two@example.com%GT +RCPT TO:%LTinvalid.three%GT +RCPT TO:%LTinvalid.four%GT +RCPT TO:%LTinvalid.five%GT DATA QUIT diff --git a/tests/data/test3006 b/tests/data/test3006 index d5086c23d604..2c705448dac6 100644 --- a/tests/data/test3006 +++ b/tests/data/test3006 @@ -47,12 +47,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTinvalid.one%GT +RCPT TO:%LTinvalid.two%GT +RCPT TO:%LTinvalid.three%GT +RCPT TO:%LTinvalid.four%GT +RCPT TO:%LTinvalid.five%GT QUIT diff --git a/tests/data/test3007 b/tests/data/test3007 index 3cc0aedc86e8..752aafb2b3db 100644 --- a/tests/data/test3007 +++ b/tests/data/test3007 @@ -43,8 +43,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTinvalid.one%GT QUIT diff --git a/tests/data/test3209 b/tests/data/test3209 index 4c1c1888ebf5..d9cac898674a 100644 --- a/tests/data/test3209 +++ b/tests/data/test3209 @@ -27,10 +27,10 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -u user:secret Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII @@ -49,10 +49,10 @@ A004 LOGOUT Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII diff --git a/tests/data/test3210 b/tests/data/test3210 index 7056b9c6447a..2cf71305e4a8 100644 --- a/tests/data/test3210 +++ b/tests/data/test3210 @@ -27,10 +27,10 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -u user:secret Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII @@ -49,10 +49,10 @@ A004 LOGOUT Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII diff --git a/tests/data/test3215 b/tests/data/test3215 index 97183c21d487..49d78e30c8e5 100644 --- a/tests/data/test3215 +++ b/tests/data/test3215 @@ -31,7 +31,7 @@ To: another body -smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt " NOTIFY=SUCCESS,FAILURE" --mail-from " RET=HDRS" -T - +smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt "%LTrecipient@example.com%GT NOTIFY=SUCCESS,FAILURE" --mail-from "%LTsender@example.com%GT RET=HDRS" -T - @@ -40,8 +40,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt " NOTIFY EHLO %TESTNUMBER -MAIL FROM: RET=HDRS -RCPT TO: NOTIFY=SUCCESS,FAILURE +MAIL FROM:%LTsender@example.com%GT RET=HDRS +RCPT TO:%LTrecipient@example.com%GT NOTIFY=SUCCESS,FAILURE DATA QUIT diff --git a/tests/data/test646 b/tests/data/test646 index cc400604dbd1..1ef0c9f21ba3 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -40,7 +40,7 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER -F "=@%LOGDIR/test%TESTNUMBER.txt;headers=<%LOGDIR/headers%TESTNUMBER" -H "From: different" -H "To: another" --H "Reply-To: " +-H "Reply-To: %LTfollowup@example.com%GT" This is an attached file. @@ -66,8 +66,8 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT @@ -76,7 +76,7 @@ Content-Type: multipart/mixed; boundary=----------------------------%CR Mime-Version: 1.0%CR From: different%CR To: another%CR -Reply-To: %CR +Reply-To: %LTfollowup@example.com%GT%CR %CR ------------------------------%CR Content-Type: multipart/alternative; boundary=----------------------------%CR diff --git a/tests/data/test647 b/tests/data/test647 index e6edb72c686c..47297776ce13 100644 --- a/tests/data/test647 +++ b/tests/data/test647 @@ -33,9 +33,9 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -F "=)" -F "=@%LOGDIR/test%TESTNUMBER.txt" -H "Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)" --H "From: Fred Foobar " +-H "From: Fred Foobar %LTfoobar@example.com%GT" -H "To: joe@example.com" --H "Message-Id: " +-H "Message-Id: %LTB27397-0100000@example.com%GT" -H "Subject: afternoon meeting" -u user:secret @@ -63,9 +63,9 @@ A004 LOGOUT Content-Type: multipart/mixed; boundary=----------------------------%CR Mime-Version: 1.0%CR Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)%CR -From: Fred Foobar %CR +From: Fred Foobar %LTfoobar@example.com%GT%CR To: joe@example.com%CR -Message-Id: %CR +Message-Id: %LTB27397-0100000@example.com%GT%CR Subject: afternoon meeting%CR %CR ------------------------------%CR diff --git a/tests/data/test648 b/tests/data/test648 index d36823e88fbd..3123c33e34df 100644 --- a/tests/data/test648 +++ b/tests/data/test648 @@ -54,8 +54,8 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test649 b/tests/data/test649 index 97f4f099ca1a..0e66c9d2f3cc 100644 --- a/tests/data/test649 +++ b/tests/data/test649 @@ -44,8 +44,8 @@ It contains at least an 8-bit byte value. EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA diff --git a/tests/data/test652 b/tests/data/test652 index 25e5a6d9e3bb..413001284871 100644 --- a/tests/data/test652 +++ b/tests/data/test652 @@ -41,8 +41,8 @@ s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------- EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsomebody@example.com%GT +RCPT TO:%LTsomeone@example.com%GT DATA QUIT diff --git a/tests/data/test805 b/tests/data/test805 index eadd8a4cb7b4..834d7c1de4da 100644 --- a/tests/data/test805 +++ b/tests/data/test805 @@ -27,10 +27,10 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -u user:secret Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII @@ -49,10 +49,10 @@ A004 LOGOUT Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII diff --git a/tests/data/test864 b/tests/data/test864 index a21fc2517582..80b7b462a5b6 100644 --- a/tests/data/test864 +++ b/tests/data/test864 @@ -11,7 +11,7 @@ APOP CAPA APOP -REPLY welcome +OK curl POP3 server ready to serve <1972.987654321\@curl> +REPLY welcome +OK curl POP3 server ready to serve %LT1972.987654321\@curl%GT From: me@somewhere diff --git a/tests/data/test900 b/tests/data/test900 index 8eb433b78e37..59468252e571 100644 --- a/tests/data/test900 +++ b/tests/data/test900 @@ -37,8 +37,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test901 b/tests/data/test901 index 7e0b7034acd4..8e3ca8ad3c5b 100644 --- a/tests/data/test901 +++ b/tests/data/test901 @@ -41,8 +41,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test902 b/tests/data/test902 index b913e4fcc8ba..ccf213a9cdab 100644 --- a/tests/data/test902 +++ b/tests/data/test902 @@ -41,8 +41,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER HELO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test903 b/tests/data/test903 index 07c2cd3d3a79..13d6bc0ecca2 100644 --- a/tests/data/test903 +++ b/tests/data/test903 @@ -43,8 +43,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH PLAIN AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test904 b/tests/data/test904 index 1c60c28fe52f..81c6b107bcf1 100644 --- a/tests/data/test904 +++ b/tests/data/test904 @@ -44,8 +44,8 @@ EHLO %TESTNUMBER AUTH LOGIN dXNlcg== c2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test905 b/tests/data/test905 index 2c6f6e7c576f..fe6a62f80663 100644 --- a/tests/data/test905 +++ b/tests/data/test905 @@ -47,8 +47,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH CRAM-MD5 dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test906 b/tests/data/test906 index 4b99598e3744..c19ece3cd2be 100644 --- a/tests/data/test906 +++ b/tests/data/test906 @@ -50,8 +50,8 @@ EHLO %TESTNUMBER AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test907 b/tests/data/test907 index 48ae320b81d3..d4bab329dc4f 100644 --- a/tests/data/test907 +++ b/tests/data/test907 @@ -54,8 +54,8 @@ EHLO %TESTNUMBER AUTH DIGEST-MD5 dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIzNDMzMzIzMTM1MzMzMjMxMzYzMzMyMzEzNzMzMzIzMSIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJzbXRwLzEyNy4wLjAuMSIscmVzcG9uc2U9YTI3YzQzOTVmMzM4Njc0M2JlMTIyMDdiN2QxMTIxYzUscW9wPWF1dGg= -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test908 b/tests/data/test908 index 7bd4d5190b3b..4d8291186e2e 100644 --- a/tests/data/test908 +++ b/tests/data/test908 @@ -43,8 +43,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test909 b/tests/data/test909 index 91b720725769..0290eef8dd86 100644 --- a/tests/data/test909 +++ b/tests/data/test909 @@ -35,8 +35,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test910 b/tests/data/test910 index bc572a36ee7a..60911603a75b 100644 --- a/tests/data/test910 +++ b/tests/data/test910 @@ -35,8 +35,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test911 b/tests/data/test911 index 0ee44f2b84cc..9ee0fd7bf437 100644 --- a/tests/data/test911 +++ b/tests/data/test911 @@ -34,8 +34,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test912 b/tests/data/test912 index a5e284c7e69e..0cdc9ca4f69d 100644 --- a/tests/data/test912 +++ b/tests/data/test912 @@ -39,8 +39,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: SIZE=38 -RCPT TO: +MAIL FROM:%LTsender@example.com%GT SIZE=38 +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test913 b/tests/data/test913 index 20373cf183b2..8e9c0429a883 100644 --- a/tests/data/test913 +++ b/tests/data/test913 @@ -43,7 +43,7 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: SIZE=38 +MAIL FROM:%LTsender@example.com%GT SIZE=38 QUIT diff --git a/tests/data/test914 b/tests/data/test914 index a4a617a8bea6..0891b5fd6d59 100644 --- a/tests/data/test914 +++ b/tests/data/test914 @@ -42,7 +42,7 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: +MAIL FROM:%LTinvalid%GT QUIT diff --git a/tests/data/test915 b/tests/data/test915 index 5243da9003c4..3a761b4bbe4c 100644 --- a/tests/data/test915 +++ b/tests/data/test915 @@ -35,8 +35,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com -T - EHLO %TESTNUMBER -MAIL FROM:<> -RCPT TO: +MAIL FROM:%LT%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test916 b/tests/data/test916 index 9d25ccae3ddc..e0108edb9fb0 100644 --- a/tests/data/test916 +++ b/tests/data/test916 @@ -39,8 +39,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt invalid --mail-from sender@exam EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTinvalid%GT QUIT diff --git a/tests/data/test917 b/tests/data/test917 index 3ccc5334526f..a28ce3d3bc62 100644 --- a/tests/data/test917 +++ b/tests/data/test917 @@ -42,12 +42,12 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient.one@example.com%GT +RCPT TO:%LTrecipient.two@example.com%GT +RCPT TO:%LTrecipient.three@example.com%GT +RCPT TO:%LTrecipient.four@example.com%GT +RCPT TO:%LTrecipient.five@example.com%GT DATA QUIT diff --git a/tests/data/test918 b/tests/data/test918 index d81b44db1694..9507b769db4a 100644 --- a/tests/data/test918 +++ b/tests/data/test918 @@ -46,9 +46,9 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient.one@example.com%GT +RCPT TO:%LTinvalid%GT QUIT diff --git a/tests/data/test919 b/tests/data/test919 index 0d2ff8e1195e..97739093f302 100644 --- a/tests/data/test919 +++ b/tests/data/test919 @@ -42,8 +42,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH PLAIN AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test920 b/tests/data/test920 index 872038666211..8f4c981a26ab 100644 --- a/tests/data/test920 +++ b/tests/data/test920 @@ -43,8 +43,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH LOGIN dXNlcg== c2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test921 b/tests/data/test921 index 664b98d80c9f..3bed5ed0f0bf 100644 --- a/tests/data/test921 +++ b/tests/data/test921 @@ -49,8 +49,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAALAAsAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyV09SS1NUQVRJT04= -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test922 b/tests/data/test922 index a8b1e20a44e2..d3700876295c 100644 --- a/tests/data/test922 +++ b/tests/data/test922 @@ -42,8 +42,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test924 b/tests/data/test924 index 986b4e9956ca..c1bd9f228672 100644 --- a/tests/data/test924 +++ b/tests/data/test924 @@ -11,9 +11,9 @@ VRFY 553-Ambiguous; Possibilities are: -553-Joe Smith -553-Harry Smith -553 Melvin Smith +553-Joe Smith %LTjoe.smith@example.com%GT +553-Harry Smith %LTharry.smith@example.com%GT +553 Melvin Smith %LTmelvin.smith@example.com%GT diff --git a/tests/data/test927 b/tests/data/test927 index 7c81632d9bea..173caa2907f2 100644 --- a/tests/data/test927 +++ b/tests/data/test927 @@ -11,9 +11,9 @@ CUSTOMREQUEST # Server-side -250-Joe Smith -250-Harry Smith -250 Melvin Smith +250-Joe Smith %LTjoe.smith@example.com%GT +250-Harry Smith %LTharry.smith@example.com%GT +250 Melvin Smith %LTmelvin.smith@example.com%GT diff --git a/tests/data/test935 b/tests/data/test935 index 5f0dc9b0d3a0..07e7387cff5a 100644 --- a/tests/data/test935 +++ b/tests/data/test935 @@ -53,8 +53,8 @@ AUTH CRAM-MD5 * AUTH PLAIN AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test936 b/tests/data/test936 index cd0fe30e3f15..3586ed965a33 100644 --- a/tests/data/test936 +++ b/tests/data/test936 @@ -55,8 +55,8 @@ TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= * AUTH PLAIN AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test937 b/tests/data/test937 index 8060d8e94056..9c8641a17893 100644 --- a/tests/data/test937 +++ b/tests/data/test937 @@ -55,8 +55,8 @@ AUTH DIGEST-MD5 * AUTH PLAIN AHVzZXIAc2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test938 b/tests/data/test938 index a77a3a08e1ca..70d6b207482b 100644 --- a/tests/data/test938 +++ b/tests/data/test938 @@ -46,15 +46,15 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER002 --mail-rcpt recipient@example.com --mail EHLO %TESTNUMBER001 AUTH PLAIN dXNlci5vbmUAdXNlci5vbmUAc2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT EHLO %TESTNUMBER002 AUTH PLAIN dXNlci50d28AdXNlci50d28Ac2VjcmV0 -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test939 b/tests/data/test939 index 68fc9f87c7ec..bebc9286c8bc 100644 --- a/tests/data/test939 +++ b/tests/data/test939 @@ -37,8 +37,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER HELO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test940 b/tests/data/test940 index fa64163bd945..4395698a197d 100644 --- a/tests/data/test940 +++ b/tests/data/test940 @@ -32,8 +32,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test941 b/tests/data/test941 index 36544e43c835..06a65b86da81 100644 --- a/tests/data/test941 +++ b/tests/data/test941 @@ -44,8 +44,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test942 b/tests/data/test942 index 664ba4ea7d68..7d2b40e6d04a 100644 --- a/tests/data/test942 +++ b/tests/data/test942 @@ -43,8 +43,8 @@ mail body EHLO %TESTNUMBER AUTH EXTERNAL dXNlcg== -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test943 b/tests/data/test943 index 2003caf90404..6244ca5bd141 100644 --- a/tests/data/test943 +++ b/tests/data/test943 @@ -43,8 +43,8 @@ mail body EHLO %TESTNUMBER AUTH EXTERNAL = -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test944 b/tests/data/test944 index a00a44e635d2..5cc76d59e452 100644 --- a/tests/data/test944 +++ b/tests/data/test944 @@ -42,8 +42,8 @@ mail body EHLO %TESTNUMBER AUTH EXTERNAL dXNlcg== -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test945 b/tests/data/test945 index 5f34e31ab730..c470072607b2 100644 --- a/tests/data/test945 +++ b/tests/data/test945 @@ -42,8 +42,8 @@ mail body EHLO %TESTNUMBER AUTH EXTERNAL = -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test946 b/tests/data/test946 index f463bfc4eb9a..dbbbe66b950f 100644 --- a/tests/data/test946 +++ b/tests/data/test946 @@ -44,8 +44,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test947 b/tests/data/test947 index 995e54ed28ca..ade9aaef7b62 100644 --- a/tests/data/test947 +++ b/tests/data/test947 @@ -43,8 +43,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test950 b/tests/data/test950 index 6f18037370b9..160773bee68f 100644 --- a/tests/data/test950 +++ b/tests/data/test950 @@ -11,7 +11,7 @@ VRFY # Server-side -250 +250 %LTrecipient@example.com%GT diff --git a/tests/data/test951 b/tests/data/test951 index 616c6cd5235e..46c981cc60b4 100644 --- a/tests/data/test951 +++ b/tests/data/test951 @@ -32,8 +32,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test952 b/tests/data/test952 index f2a90bfbbd9e..7325e823e58b 100644 --- a/tests/data/test952 +++ b/tests/data/test952 @@ -32,8 +32,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test953 b/tests/data/test953 index 04ebe214666e..2fe9459283c6 100644 --- a/tests/data/test953 +++ b/tests/data/test953 @@ -43,8 +43,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH PLAIN dXJzZWwAa3VydAB4aXBqM3BsbXE= -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test955 b/tests/data/test955 index be0565842f7f..eac15f0adca2 100644 --- a/tests/data/test955 +++ b/tests/data/test955 @@ -49,7 +49,7 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: +MAIL FROM:%LTAvs%hex[%c3%a4]hex%ndaren@example.com%GT QUIT diff --git a/tests/data/test956 b/tests/data/test956 index aaae3544d071..f0e1e4d2074b 100644 --- a/tests/data/test956 +++ b/tests/data/test956 @@ -46,8 +46,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt St%hex[%c3%b6]hex%dmottagaren@e EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTSt%hex[%c3%b6]hex%dmottagaren@example.com%GT QUIT diff --git a/tests/data/test959 b/tests/data/test959 index 3ee988c57f8e..ae21234d7805 100644 --- a/tests/data/test959 +++ b/tests/data/test959 @@ -50,7 +50,7 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: +MAIL FROM:%LTsender@%hex[%c3%a5%c3%a4%c3%b6]hex%.se%GT QUIT diff --git a/tests/data/test960 b/tests/data/test960 index 64d5050a30b2..8420e022951d 100644 --- a/tests/data/test960 +++ b/tests/data/test960 @@ -47,8 +47,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@%hex[%c3%a5%c3%a4%c3% EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@%hex[%c3%a5%c3%a4%c3%b6]hex%.se%GT QUIT diff --git a/tests/data/test962 b/tests/data/test962 index 59ced3bc7736..98be6f0e2244 100644 --- a/tests/data/test962 +++ b/tests/data/test962 @@ -44,8 +44,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@xn--4cab6c.se%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test963 b/tests/data/test963 index 8b411458c6a9..0b042f0aa9a8 100644 --- a/tests/data/test963 +++ b/tests/data/test963 @@ -44,8 +44,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@%hex[%c3%a5%c3%a4%c3% EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@xn--4cab6c.se%GT DATA QUIT diff --git a/tests/data/test965 b/tests/data/test965 index b4ccc70425fa..54f1f51b0ad9 100644 --- a/tests/data/test965 +++ b/tests/data/test965 @@ -47,8 +47,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER -MAIL FROM: SMTPUTF8 -RCPT TO: +MAIL FROM:%LTAvs%hex[%c3%a4]hex%ndaren@xn--4cab6c.se%GT SMTPUTF8 +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test966 b/tests/data/test966 index 24ef5597665c..958df6858d87 100644 --- a/tests/data/test966 +++ b/tests/data/test966 @@ -47,8 +47,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt St%hex[%c3%b6]hex%dmottagaren@% EHLO %TESTNUMBER -MAIL FROM: SMTPUTF8 -RCPT TO: +MAIL FROM:%LTsender@example.com%GT SMTPUTF8 +RCPT TO:%LTSt%hex[%c3%b6]hex%dmottagaren@xn--4cab6c.se%GT DATA QUIT diff --git a/tests/data/test969 b/tests/data/test969 index 00311d5f19b2..875ea6d4b53b 100644 --- a/tests/data/test969 +++ b/tests/data/test969 @@ -15,9 +15,9 @@ IDN CAPA SMTPUTF8 -250-Joe Smith -250-Harry Smith -250 Melvin Smith +250-Joe Smith %LTjoe.smith@example.com%GT +250-Harry Smith %LTharry.smith@example.com%GT +250 Melvin Smith %LTmelvin.smith@example.com%GT diff --git a/tests/data/test981 b/tests/data/test981 index 94de9dfbea47..f1ac9aa20f16 100644 --- a/tests/data/test981 +++ b/tests/data/test981 @@ -33,10 +33,10 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -u user:secret Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII diff --git a/tests/data/test984 b/tests/data/test984 index e79efdf84b97..4e802a1d2eab 100644 --- a/tests/data/test984 +++ b/tests/data/test984 @@ -31,10 +31,10 @@ imap://%HOSTIP:%IMAPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -u user:secret Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) -From: Fred Foobar +From: Fred Foobar %LTfoobar@example.COM%GT Subject: afternoon meeting To: joe@example.com -Message-Id: +Message-Id: %LTB27397-0100000@example.COM%GT MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII diff --git a/tests/data/test987 b/tests/data/test987 index 312c406a70f3..7c158128fb9f 100644 --- a/tests/data/test987 +++ b/tests/data/test987 @@ -36,8 +36,8 @@ body EHLO %TESTNUMBER -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/data/test992 b/tests/data/test992 index 772ad91e79b2..bf8b0fb1c432 100644 --- a/tests/data/test992 +++ b/tests/data/test992 @@ -41,8 +41,8 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-fr EHLO %TESTNUMBER AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB -MAIL FROM: -RCPT TO: +MAIL FROM:%LTsender@example.com%GT +RCPT TO:%LTrecipient@example.com%GT DATA QUIT diff --git a/tests/testutil.pm b/tests/testutil.pm index 6317a5e93138..7e2b279f07a0 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -156,6 +156,8 @@ sub subbase64 { $$thing =~ s/%SP/ /g; # space $$thing =~ s/%TAB/\t/g; # horizontal tab $$thing =~ s/%CR/\r/g; # carriage return aka \r aka 0x0d + $$thing =~ s/%LT//g; # include a file $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1, 0)/ge; From 9726fc8259ad7ebf16822ff513dc4ad987f7f8fe Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 18 Nov 2025 12:02:36 +0100 Subject: [PATCH 439/885] test2405, 2407: mark tests based on lib2405 flaky Flaky in macOS CI jobs. 2405: https://github.com/curl/curl/actions/runs/19448567968/job/55648448197 CM gcc-13 aws-lc https://github.com/curl/curl/actions/runs/19432797208/job/55595742192 AM clang !ssl https://github.com/curl/curl/actions/runs/19431697816/job/55591941993 AM clang !ssl !debug brotli zstd https://github.com/curl/curl/actions/runs/19421214342/job/55558775785 CM llvm@18 GnuTLS !ldap krb5 +examples https://github.com/curl/curl/actions/runs/19413038235/job/55537174590 CM llvm@18 mbedTLS !ldap brotli zstd MultiSSL AppleIDN 2407: https://github.com/curl/curl/actions/runs/19462732039/job/55691022408 AM clang !ssl https://github.com/curl/curl/actions/runs/19440283144/job/55621665647 CM gcc-13 OpenSSL gsasl rtmp AppleIDN SecTrust +examples https://github.com/curl/curl/actions/runs/19440283144/job/55621665682 AM gcc-13 !ssl !debug https://github.com/curl/curl/actions/runs/19436530386/job/55608724437 CM gcc-13 aws-lc https://github.com/curl/curl/actions/runs/19436530386/job/55608724641 CM llvm@18 GnuTLS !ldap krb5 +examples https://github.com/curl/curl/actions/runs/19435651588/job/55605648449 CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples Ref: https://testclutch.curl.se/static/reports/results-count.html Bug: https://github.com/curl/curl/pull/19487#issuecomment-3546858203 Bug: https://github.com/curl/curl/pull/19487#issuecomment-3546921877 Follow-up to 2c7e1792a06b81b2bf41c9d348d374a83621340b #19487 Follow-up to 96a5ce5a82eb0f08650649ffafb7bb4e51fc4444 #19481 Follow-up to c78044c07e97cb720049579f4fe3cab33a7ea8d3 #15146 #15155 Closes #19587 --- tests/data/test2405 | 1 + tests/data/test2407 | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/data/test2405 b/tests/data/test2405 index 79f5e337c3e9..c9eb3ca8faf6 100644 --- a/tests/data/test2405 +++ b/tests/data/test2405 @@ -3,6 +3,7 @@ multi HTTP +flaky diff --git a/tests/data/test2407 b/tests/data/test2407 index c103cf74a141..1794daf2aba4 100644 --- a/tests/data/test2407 +++ b/tests/data/test2407 @@ -4,6 +4,7 @@ multi HTTP HTTP/2 +flaky From 318cd4f2ee4840a13634bacce462676b40dabe71 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 17:01:30 +0100 Subject: [PATCH 440/885] lib: error for OOM when extracting URL query Closes #19594 --- lib/imap.c | 6 ++++-- lib/url.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index d23076a48f85..faa595561dfa 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -2315,8 +2315,10 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data, and no UID as per RFC-5092 */ if(imap->mailbox && !imap->uid && !imap->mindex) { /* Get the query parameter, URL decoded */ - (void)curl_url_get(data->state.uh, CURLUPART_QUERY, &imap->query, - CURLU_URLDECODE); + CURLUcode uc = curl_url_get(data->state.uh, CURLUPART_QUERY, &imap->query, + CURLU_URLDECODE); + if(uc == CURLUE_OUT_OF_MEMORY) + return CURLE_OUT_OF_MEMORY; } /* Any extra stuff at the end of the URL is an error */ diff --git a/lib/url.c b/lib/url.c index 527d69839049..b4069e30f18b 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1974,7 +1974,9 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, conn->remote_port = (unsigned short)port; } - (void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0); + uc = curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0); + if(uc && (uc != CURLUE_NO_QUERY)) + return CURLE_OUT_OF_MEMORY; #ifdef USE_IPV6 if(data->set.scope_id) From 36d0f128814177b9927e2dff96940aa2a2c09bb0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 18 Nov 2025 21:41:42 +0100 Subject: [PATCH 441/885] DISTROS.md: add OpenBSD Closes #19596 --- docs/DISTROS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/DISTROS.md b/docs/DISTROS.md index 40a9bf571674..132ad86a0cfe 100644 --- a/docs/DISTROS.md +++ b/docs/DISTROS.md @@ -222,6 +222,12 @@ can also be used on other distributions - curl issues: https://support.oracle.com/ (requires support contract) - curl patches: https://github.com/oracle/solaris-userland/tree/master/components/curl/patches +## OpenBSD + +- curl: https://github.com/openbsd/ports/tree/master/net/curl +- curl issues: https://www.openbsd.org/mail.html (ports mailing list) +- curl patches: https://github.com/openbsd/ports/tree/master/net/curl/patches + ## OpenEmbedded / Yocto Project *Rolling Release* From 7f3731ce142c1d74023abad183cc8ce0fd527fab Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 18 Nov 2025 19:10:53 +0100 Subject: [PATCH 442/885] tests/data: mark non-XML-compliant files as such, xmllint the rest in CI There are 58 non-compliant files. Mark them with the `notxml` keyword. Also include the compliant ones in the GHA/checksrc xmllint CI job. Also: - delete XML prolog from the 3 test data files that had them. - FILEFORMAT.md: document the `notxml` keyword. - FILEFORMAT.md: fix a typo. Follow-up to de49cc89abc917cb4f273ebea8c6fb584d097de2 #19470 Follow-up to f3095f0dbd7e842d4a72c0300ba4817a755c74f5 #19528 Follow-up to 87ba80a6df1dfd7ceaaa52352c9f23afff0ed513 Closes #19595 --- .github/scripts/pyspelling.words | 2 ++ .github/workflows/checksrc.yml | 6 +++++- docs/tests/FILEFORMAT.md | 7 ++++++- tests/data/test1011 | 1 + tests/data/test1012 | 1 + tests/data/test1015 | 1 + tests/data/test1034 | 1 - tests/data/test1076 | 1 + tests/data/test1105 | 1 + tests/data/test1138 | 1 + tests/data/test1158 | 1 + tests/data/test1160 | 1 - tests/data/test1186 | 1 + tests/data/test1189 | 1 + tests/data/test1221 | 1 + tests/data/test1332 | 1 + tests/data/test1400 | 1 + tests/data/test1401 | 1 + tests/data/test1402 | 1 + tests/data/test1403 | 1 + tests/data/test1404 | 1 + tests/data/test1405 | 1 + tests/data/test1406 | 1 + tests/data/test1407 | 1 + tests/data/test1420 | 1 + tests/data/test1445 | 1 + tests/data/test1446 | 1 + tests/data/test1461 | 1 + tests/data/test1463 | 1 + tests/data/test1464 | 1 + tests/data/test1465 | 1 + tests/data/test1481 | 1 + tests/data/test1506 | 1 + tests/data/test1510 | 1 + tests/data/test1512 | 1 + tests/data/test1524 | 1 + tests/data/test1542 | 1 + tests/data/test1598 | 1 + tests/data/test163 | 1 + tests/data/test1683 | 1 + tests/data/test1705 | 1 + tests/data/test1706 | 1 + tests/data/test1977 | 1 + tests/data/test199 | 1 + tests/data/test2402 | 1 + tests/data/test2404 | 1 + tests/data/test2502 | 1 + tests/data/test3 | 1 + tests/data/test32 | 1 + tests/data/test320 | 1 + tests/data/test39 | 1 + tests/data/test40 | 1 + tests/data/test439 | 1 + tests/data/test446 | 1 - tests/data/test45 | 1 + tests/data/test48 | 1 + tests/data/test568 | 1 + tests/data/test646 | 1 + tests/data/test733 | 1 + tests/data/test734 | 1 + tests/data/test735 | 1 + tests/data/test739 | 1 + tests/data/test787 | 1 + tests/data/test96 | 1 + 64 files changed, 71 insertions(+), 5 deletions(-) diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index f6a5405999e7..5c96701cd09b 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -463,6 +463,7 @@ libWebSocket libz libzstd LineageOS +linter linux lldb ln @@ -981,6 +982,7 @@ Xbox XDG xdigit Xilinx +xmllint XP Xtensa XYZ diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 9ed049c13fd5..607661735679 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -128,7 +128,11 @@ jobs: persist-credentials: false - name: 'check' - run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint >/dev/null + run: | + { + git grep -z -i -l -E '^<\?xml' || true + git grep -z -L -F 'notxml' 'tests/data/test*' || true + } | xargs -0 -r xmllint >/dev/null miscchecks: name: 'misc checks' diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index c5c1bcfe90a7..7851e08e2597 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -239,7 +239,7 @@ When running a unit test and the keywords include `unittest`, the `` section can be left empty to use the standard unit test tool name `unitN` where `N` is the test number. -The `text-ci` make target automatically skips test with the `flaky` keyword. +The `test-ci` make target automatically skips test with the `flaky` keyword. Tests that have strict timing dependencies have the `timing-dependent` keyword. These are intended to eventually be treated specially on CI builds which are @@ -248,6 +248,11 @@ often run on overloaded machines with unpredictable timing. Tests using non-7-bit-ASCII characters must provide them with `%hex[]` or similar. +In most cases test files comply with the XML format, and pass xmllint cleanly. +If the data file uses the `&` character, or has other, non-compliant content, +and making it XML-compliant is not possible or unpractical, use the `notxml` +keyword to exclude it from linter checks. + ## `` ### `` diff --git a/tests/data/test1011 b/tests/data/test1011 index f4de4df6a20a..4f5111dea23b 100644 --- a/tests/data/test1011 +++ b/tests/data/test1011 @@ -4,6 +4,7 @@ HTTP HTTP POST followlocation +notxml # diff --git a/tests/data/test1012 b/tests/data/test1012 index d15e10f28e19..ef2d679bfc4c 100644 --- a/tests/data/test1012 +++ b/tests/data/test1012 @@ -4,6 +4,7 @@ HTTP HTTP POST followlocation +notxml # diff --git a/tests/data/test1015 b/tests/data/test1015 index 9f2a53d49a87..4fe79c7b9902 100644 --- a/tests/data/test1015 +++ b/tests/data/test1015 @@ -4,6 +4,7 @@ HTTP HTTP POST --data-urlencode +notxml diff --git a/tests/data/test1034 b/tests/data/test1034 index f503d97700fc..db0528a78950 100644 --- a/tests/data/test1034 +++ b/tests/data/test1034 @@ -1,4 +1,3 @@ - diff --git a/tests/data/test1076 b/tests/data/test1076 index 8613a9a92229..08eba396c597 100644 --- a/tests/data/test1076 +++ b/tests/data/test1076 @@ -4,6 +4,7 @@ HTTP HTTP POST followlocation +notxml # diff --git a/tests/data/test1105 b/tests/data/test1105 index d23b92f560f5..ea42efb6a9c0 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -5,6 +5,7 @@ HTTP HTTP POST cookies cookiejar +notxml diff --git a/tests/data/test1138 b/tests/data/test1138 index 7579fcd21dd2..a3e65d0e0fb7 100644 --- a/tests/data/test1138 +++ b/tests/data/test1138 @@ -4,6 +4,7 @@ HTTP HTTP GET followlocation +notxml # diff --git a/tests/data/test1158 b/tests/data/test1158 index c2a7330fe6ef..a791c6fd4ccf 100644 --- a/tests/data/test1158 +++ b/tests/data/test1158 @@ -3,6 +3,7 @@ HTTP HTTP FORMPOST +notxml # Server-side diff --git a/tests/data/test1160 b/tests/data/test1160 index 6b7c904cebca..9eca524c658f 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -1,4 +1,3 @@ - diff --git a/tests/data/test1186 b/tests/data/test1186 index f9edac8f361d..7a8b69486b7d 100644 --- a/tests/data/test1186 +++ b/tests/data/test1186 @@ -3,6 +3,7 @@ HTTP HTTP FORMPOST +notxml # Server-side diff --git a/tests/data/test1189 b/tests/data/test1189 index 0fb354a88eae..b5574cef507d 100644 --- a/tests/data/test1189 +++ b/tests/data/test1189 @@ -3,6 +3,7 @@ HTTP HTTP FORMPOST +notxml # Server-side diff --git a/tests/data/test1221 b/tests/data/test1221 index 1bfc61bdee3e..12a82be1ee74 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -5,6 +5,7 @@ HTTP HTTP POST --data-urlencode --url-query +notxml diff --git a/tests/data/test1332 b/tests/data/test1332 index c852d84b5d6f..f1b596e31016 100644 --- a/tests/data/test1332 +++ b/tests/data/test1332 @@ -5,6 +5,7 @@ HTTP HTTP POST followlocation +notxml # diff --git a/tests/data/test1400 b/tests/data/test1400 index 5ed32360d995..1d2ece68e4ad 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -4,6 +4,7 @@ HTTP HTTP GET --libcurl +notxml diff --git a/tests/data/test1401 b/tests/data/test1401 index a24c81cb94d3..31259e079f1d 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -7,6 +7,7 @@ HTTP Basic auth HTTP set cookie cookies --libcurl +notxml diff --git a/tests/data/test1402 b/tests/data/test1402 index 9c0330532db4..c256611b0d1e 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -4,6 +4,7 @@ HTTP HTTP POST --libcurl +notxml diff --git a/tests/data/test1403 b/tests/data/test1403 index 96328168940c..2a2f3617cd86 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -4,6 +4,7 @@ HTTP HTTP GET --libcurl +notxml diff --git a/tests/data/test1404 b/tests/data/test1404 index 7ae7d8b5019c..732c2678a693 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -6,6 +6,7 @@ HTTP HTTP FORMPOST HTTP file upload --libcurl +notxml diff --git a/tests/data/test1405 b/tests/data/test1405 index 1860f408c8e7..a71a522cfaec 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -6,6 +6,7 @@ FTP post-quote pre-quote --libcurl +notxml # Server-side diff --git a/tests/data/test1406 b/tests/data/test1406 index 492b5b8b31d1..5f935d2d075a 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -5,6 +5,7 @@ SMTP --libcurl +notxml diff --git a/tests/data/test1407 b/tests/data/test1407 index fad62abd062c..9ab40cef40e3 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -6,6 +6,7 @@ POP3 Clear Text LIST --libcurl +notxml diff --git a/tests/data/test1420 b/tests/data/test1420 index dbd671b1aa67..4a6be824376e 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -6,6 +6,7 @@ IMAP Clear Text FETCH --libcurl +notxml diff --git a/tests/data/test1445 b/tests/data/test1445 index f52be8f7254a..705162be2d37 100644 --- a/tests/data/test1445 +++ b/tests/data/test1445 @@ -3,6 +3,7 @@ FILE --remote-time +notxml diff --git a/tests/data/test1446 b/tests/data/test1446 index 8babaea5d518..448eefbc1f5a 100644 --- a/tests/data/test1446 +++ b/tests/data/test1446 @@ -3,6 +3,7 @@ SFTP --remote-time +notxml diff --git a/tests/data/test1461 b/tests/data/test1461 index 4ee109a12299..f45d0dcd1229 100644 --- a/tests/data/test1461 +++ b/tests/data/test1461 @@ -2,6 +2,7 @@ --help +notxml diff --git a/tests/data/test1463 b/tests/data/test1463 index 55174be50816..e67bdfdae452 100644 --- a/tests/data/test1463 +++ b/tests/data/test1463 @@ -3,6 +3,7 @@ FILE --help +notxml diff --git a/tests/data/test1464 b/tests/data/test1464 index c005b5afca0d..4a4f6b3633c9 100644 --- a/tests/data/test1464 +++ b/tests/data/test1464 @@ -3,6 +3,7 @@ FILE --help +notxml diff --git a/tests/data/test1465 b/tests/data/test1465 index bef59be3c004..686c28b0bac4 100644 --- a/tests/data/test1465 +++ b/tests/data/test1465 @@ -4,6 +4,7 @@ HTTP HTTP POST --libcurl +notxml diff --git a/tests/data/test1481 b/tests/data/test1481 index 3121ae536978..209c3f87e0a7 100644 --- a/tests/data/test1481 +++ b/tests/data/test1481 @@ -4,6 +4,7 @@ HTTP HTTP GET --libcurl +notxml diff --git a/tests/data/test1506 b/tests/data/test1506 index 98af4b19fe32..cd7654a0d8bc 100644 --- a/tests/data/test1506 +++ b/tests/data/test1506 @@ -4,6 +4,7 @@ HTTP multi verbose logs +notxml diff --git a/tests/data/test1510 b/tests/data/test1510 index c4fca7251afa..febe7d76ea30 100644 --- a/tests/data/test1510 +++ b/tests/data/test1510 @@ -4,6 +4,7 @@ HTTP verbose logs flaky +notxml diff --git a/tests/data/test1512 b/tests/data/test1512 index cb1d8f72f1c9..3798d7325b4c 100644 --- a/tests/data/test1512 +++ b/tests/data/test1512 @@ -3,6 +3,7 @@ HTTP GLOBAL DNS CACHE +notxml diff --git a/tests/data/test1524 b/tests/data/test1524 index 05433d47c274..fcfd9f4c0001 100644 --- a/tests/data/test1524 +++ b/tests/data/test1524 @@ -4,6 +4,7 @@ HTTP HTTP PUT followlocation +notxml # diff --git a/tests/data/test1542 b/tests/data/test1542 index dad66aff3d45..044fe518a467 100644 --- a/tests/data/test1542 +++ b/tests/data/test1542 @@ -6,6 +6,7 @@ connection reuse persistent connection CURLOPT_MAXLIFETIME_CONN verbose logs +notxml diff --git a/tests/data/test1598 b/tests/data/test1598 index a85c1246922b..f3143432edd0 100644 --- a/tests/data/test1598 +++ b/tests/data/test1598 @@ -5,6 +5,7 @@ HTTP HTTP POST CURLOPT_HTTPTRAILER_FUNCTION CURLOPT_HTTPTRAILER_DATA +notxml diff --git a/tests/data/test163 b/tests/data/test163 index 14332c16c72e..7a7406c13656 100644 --- a/tests/data/test163 +++ b/tests/data/test163 @@ -3,6 +3,7 @@ HTTP HTTP POST +notxml diff --git a/tests/data/test1683 b/tests/data/test1683 index 66f41cea55c9..47d280cd14a1 100644 --- a/tests/data/test1683 +++ b/tests/data/test1683 @@ -4,6 +4,7 @@ HTTP HTTP GET --no-clobber +notxml diff --git a/tests/data/test1705 b/tests/data/test1705 index c85886b96a82..dc2120786054 100644 --- a/tests/data/test1705 +++ b/tests/data/test1705 @@ -4,6 +4,7 @@ script documentation managen +notxml diff --git a/tests/data/test1706 b/tests/data/test1706 index f821618d277a..dd24365d056b 100644 --- a/tests/data/test1706 +++ b/tests/data/test1706 @@ -4,6 +4,7 @@ script documentation managen +notxml diff --git a/tests/data/test1977 b/tests/data/test1977 index b8e2bb4f2b54..d62ed337e61a 100644 --- a/tests/data/test1977 +++ b/tests/data/test1977 @@ -3,6 +3,7 @@ CURLOPT_CURLU CURLINFO_EFFECTIVE_URL +notxml diff --git a/tests/data/test199 b/tests/data/test199 index 763e7bf49ed8..fc8a8e96a0dc 100644 --- a/tests/data/test199 +++ b/tests/data/test199 @@ -4,6 +4,7 @@ HTTP HTTP GET globbing +notxml # diff --git a/tests/data/test2402 b/tests/data/test2402 index 1903534dc81a..ba3fcc85b451 100644 --- a/tests/data/test2402 +++ b/tests/data/test2402 @@ -5,6 +5,7 @@ HTTP HTTP/2 multi verbose logs +notxml diff --git a/tests/data/test2404 b/tests/data/test2404 index 1ed03968dbac..5034a15c3ca6 100644 --- a/tests/data/test2404 +++ b/tests/data/test2404 @@ -5,6 +5,7 @@ HTTP HTTP/2 multi verbose logs +notxml diff --git a/tests/data/test2502 b/tests/data/test2502 index ab460c29d534..627cfdccad8e 100644 --- a/tests/data/test2502 +++ b/tests/data/test2502 @@ -5,6 +5,7 @@ HTTP HTTP/3 multi verbose logs +notxml diff --git a/tests/data/test3 b/tests/data/test3 index 3f4b4ee9e2c0..50fdfeea48c3 100644 --- a/tests/data/test3 +++ b/tests/data/test3 @@ -4,6 +4,7 @@ HTTP HTTP POST HTTP Basic auth +notxml # diff --git a/tests/data/test32 b/tests/data/test32 index d02a541ae3d2..94b9531ca5ed 100644 --- a/tests/data/test32 +++ b/tests/data/test32 @@ -4,6 +4,7 @@ HTTP HTTP GET -G +notxml # diff --git a/tests/data/test320 b/tests/data/test320 index 00615e5d71e3..0967823d388b 100644 --- a/tests/data/test320 +++ b/tests/data/test320 @@ -4,6 +4,7 @@ HTTPS HTTP GET TLS-SRP +notxml diff --git a/tests/data/test39 b/tests/data/test39 index 02a4659e0947..b0062543378c 100644 --- a/tests/data/test39 +++ b/tests/data/test39 @@ -3,6 +3,7 @@ HTTP HTTP FORMPOST +notxml # Server-side diff --git a/tests/data/test40 b/tests/data/test40 index 959a7505dc08..04efdbbc70b4 100644 --- a/tests/data/test40 +++ b/tests/data/test40 @@ -4,6 +4,7 @@ HTTP HTTP GET followlocation +notxml # diff --git a/tests/data/test439 b/tests/data/test439 index 2659f139e971..8529797242b9 100644 --- a/tests/data/test439 +++ b/tests/data/test439 @@ -3,6 +3,7 @@ HTTP aws-sigv4 +notxml diff --git a/tests/data/test446 b/tests/data/test446 index ceae26b7e77a..eeb9366bb5cd 100644 --- a/tests/data/test446 +++ b/tests/data/test446 @@ -1,4 +1,3 @@ - diff --git a/tests/data/test45 b/tests/data/test45 index 54c41dec92bd..3d4df02f1332 100644 --- a/tests/data/test45 +++ b/tests/data/test45 @@ -4,6 +4,7 @@ HTTP HTTP GET followlocation +notxml # Server-side diff --git a/tests/data/test48 b/tests/data/test48 index 564e8f3a7419..c161ba5dca91 100644 --- a/tests/data/test48 +++ b/tests/data/test48 @@ -4,6 +4,7 @@ HTTP HTTP HEAD -G +notxml # diff --git a/tests/data/test568 b/tests/data/test568 index caadd95d1279..a2438916d46e 100644 --- a/tests/data/test568 +++ b/tests/data/test568 @@ -5,6 +5,7 @@ RTSP ANNOUNCE +notxml diff --git a/tests/data/test646 b/tests/data/test646 index 1ef0c9f21ba3..39fafa573ce5 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -3,6 +3,7 @@ SMTP MULTIPART +notxml diff --git a/tests/data/test733 b/tests/data/test733 index ffe058bf3486..0bf953cca210 100644 --- a/tests/data/test733 +++ b/tests/data/test733 @@ -2,6 +2,7 @@ IPFS +notxml diff --git a/tests/data/test734 b/tests/data/test734 index e8d40141a3d7..01107fbf6b3d 100644 --- a/tests/data/test734 +++ b/tests/data/test734 @@ -2,6 +2,7 @@ IPFS +notxml diff --git a/tests/data/test735 b/tests/data/test735 index d78c3cc99642..574d8bd492ba 100644 --- a/tests/data/test735 +++ b/tests/data/test735 @@ -2,6 +2,7 @@ IPFS +notxml diff --git a/tests/data/test739 b/tests/data/test739 index 41f3599e4d3d..3e712f513e39 100644 --- a/tests/data/test739 +++ b/tests/data/test739 @@ -2,6 +2,7 @@ IPFS +notxml diff --git a/tests/data/test787 b/tests/data/test787 index 798d2d368f38..e95a18d17bd8 100644 --- a/tests/data/test787 +++ b/tests/data/test787 @@ -3,6 +3,7 @@ HTTP --variable +notxml diff --git a/tests/data/test96 b/tests/data/test96 index a96b617623ec..de4b7c18ad3f 100644 --- a/tests/data/test96 +++ b/tests/data/test96 @@ -2,6 +2,7 @@ TrackMemory +notxml From 8bb8984e9d5882a9b3f92717441a9ab92f33ace5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 19 Nov 2025 01:36:28 +0100 Subject: [PATCH 443/885] curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` Based on these logs (non-Unicode, Unicode Schannel): https://github.com/curl/curl/actions/runs/19446115443/job/55640968722?pr=19175 https://github.com/curl/curl/actions/runs/19446115443/job/55640968764?pr=19175 Follow-up to 5fa2d8320c4196435c1d554b06dfdcca73824dec #19175 Closes #19597 --- lib/curl_setup.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 15688aab2cd4..f5b9111f6103 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -95,9 +95,10 @@ unlink(), etc. */ #endif #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for __sys_errlist, __sys_nerr, _wfopen(), - _wopen(), freopen(), getenv(), gmtime(), - sprintf(), strcpy(), wcscpy(), wcsncpy() +#define _CRT_SECURE_NO_WARNINGS /* for __sys_errlist, __sys_nerr, _open(), + _wfopen(), _wopen(), fopen(), freopen(), + getenv(), gmtime(), mbstowcs(), sprintf(), + strcpy(), wcscpy(), wcsncpy(), wcstombs(), in tests: localtime(), open(), sscanf() */ #endif #endif /* _MSC_VER */ From c255d2fdcbf27b4bfd668ae3784bb657449d6889 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 19 Nov 2025 08:32:41 +0100 Subject: [PATCH 444/885] tool_cfgable: free ssl-sessions at exit Also free the memory correctly in tool_ssls_load Closes #19602 --- src/tool_cfgable.c | 1 + src/tool_cfgable.h | 1 + src/tool_ssls.c | 12 ++++++------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 2ddb0ad2fcfc..086e4ac21659 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -260,6 +260,7 @@ static void free_globalconfig(void) curlx_fclose(global->trace_stream); global->trace_stream = NULL; + tool_safefree(global->ssl_sessions); tool_safefree(global->libcurl); #ifdef _WIN32 free(global->term.buf); diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index dc78f2db44f6..717d35a1f522 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -29,6 +29,7 @@ #include "tool_sdecls.h" #include "tool_urlglob.h" #include "var.h" +#include "memdebug.h" /* keep this as LAST include */ /* the type we use for storing a single boolean bit */ #ifndef BIT diff --git a/src/tool_ssls.c b/src/tool_ssls.c index 2b8cc1067266..ab78014c0a86 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -80,8 +80,8 @@ CURLcode tool_ssls_load(struct OperationConfig *config, i = imported = 0; while(my_get_line(fp, &buf, &error)) { ++i; - curl_free(shmac); - curl_free(sdata); + tool_safefree(shmac); + tool_safefree(sdata); line = curlx_dyn_ptr(&buf); c = memchr(line, ':', strlen(line)); @@ -125,8 +125,8 @@ CURLcode tool_ssls_load(struct OperationConfig *config, if(fp) curlx_fclose(fp); curlx_dyn_free(&buf); - curl_free(shmac); - curl_free(sdata); + free(shmac); + free(sdata); return r; } @@ -165,7 +165,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr, goto out; if(EOF == fputc(':', ctx->fp)) goto out; - curl_free(enc); + tool_safefree(enc); r = curlx_base64_encode((const char *)sdata, sdata_len, &enc, &enc_len); if(r) goto out; @@ -179,7 +179,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr, out: if(r) warnf("Warning: error saving SSL session for '%s': %d", session_key, r); - curl_free(enc); + free(enc); return r; } From abe6ea053116b9121571c685d6c13222f934c283 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 19 Nov 2025 08:30:49 +0100 Subject: [PATCH 445/885] curlinfo: add "ssl-sessions" as a feature to show To allow tests depend on it --- src/curlinfo.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/curlinfo.c b/src/curlinfo.c index da75a45876cf..852aee820161 100644 --- a/src/curlinfo.c +++ b/src/curlinfo.c @@ -235,6 +235,13 @@ static const char *disabled[]={ "ON" #else "OFF" +#endif + , + "ssl-sessions: " +#ifdef USE_SSLS_EXPORT + "ON" +#else + "OFF" #endif }; From b98e791e57200c7192fa391a5ecf19fc5d70e478 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 19 Nov 2025 08:32:13 +0100 Subject: [PATCH 446/885] test777: simple ---ssl-sessions test with wrong sessions --- tests/data/Makefile.am | 2 +- tests/data/test777 | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/data/test777 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index d417a70a4045..fc10723814e1 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -110,7 +110,7 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \ test745 test746 test747 test748 test749 test750 test751 test752 test753 \ test754 test755 test756 test757 test758 test759 test760 test761 test762 \ test763 test764 test765 test766 test767 test768 test769 test770 test771 \ -test772 test773 test774 test775 test776 \ +test772 test773 test774 test775 test776 test777 \ test780 test781 test782 test783 test784 test785 test786 test787 test788 \ test789 test790 test791 test792 test793 test794 test796 test797 \ \ diff --git a/tests/data/test777 b/tests/data/test777 new file mode 100644 index 000000000000..4f6f83785ce0 --- /dev/null +++ b/tests/data/test777 @@ -0,0 +1,48 @@ + + + +--ssl-sessions + + + +# +# Server-side + + +HTTP/1.1 200 +Date: Tue, 09 Nov 2030 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html + + + + +# +# Client-side + + +http + + +ssl-sessions + + +--ssl-sessions with weird sessions in file + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER --ssl-sessions "%LOGDIR/sessions" + + +# Your SSL session cache. https://curl.se/docs/ssl-sessions.html +# This file was generated by libcurl! Edit at your own risk. +%b64[this is a funny test]b64%:%b64[second sequence]b64% +%b64[also a funny test]b64%:%b64[second different sequence]b64% +bad base64:also!bad + + + +# +# Verify data after the test has been "shot" + + + From b0d23b901fd9dbc2eeef4e1048a53431a03f358b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 19 Nov 2025 04:53:55 +0100 Subject: [PATCH 447/885] GHA: set `--buildinfo` for `test-torture` jobs Only the `test-ci` build target sets `--buildinfo` automatically, since 985f39c0ce78b546e832c250588c14023123edfb. It needs to be set manually for other targets used in CI, such as `test-torture`, to enable the `buildinfo.txt` dump in the runtests step. For Test Clutch. In an attempt to re-sync `targetarch` with the rest of macOS jobs on the feature matrix page: https://testclutch.curl.se/static/reports/feature-matrix.html Before this patch and possibly since the breaking update It's `aarch64e` for torture jobs and `aarch64` for the rest (stricly speaking `aarch64e` is the correct value for all macOS jobs, but autotools and cmake report arm64/aarch64 without the `e`.) Regression from 985f39c0ce78b546e832c250588c14023123edfb #18147 Closes #19601 --- .github/workflows/linux.yml | 2 ++ .github/workflows/macos.yml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d164f08e41ee..39f7a4b13ae0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -770,6 +770,8 @@ jobs: if [[ "${MATRIX_INSTALL_PACKAGES}" = *'libgss-dev'* ]]; then TFLAGS+=' ~2077 ~2078' # memory leaks from Curl_auth_decode_spnego_message() -> gss_init_sec_context() fi + elif [ "${TEST_TARGET}" != 'test-ci' ]; then + TFLAGS+=' --buildinfo' # only test-ci sets this by default, set it manually for test-torture fi [ -f ~/venv/bin/activate ] && source ~/venv/bin/activate if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 56d895f6abfb..739809d47a95 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -497,6 +497,9 @@ jobs: TFLAGS: '${{ matrix.build.tflags }}' run: | TFLAGS="-j20 ${TFLAGS}" + if [ "${TEST_TARGET}" != 'test-ci' ]; then + TFLAGS+=' --buildinfo' # only test-ci sets this by default, set it manually for test-torture + fi source ~/venv/bin/activate if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then locale || true From 47b8e1dbd3ad27d246409402081dcd554d4e13d7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 19 Nov 2025 13:30:25 +0100 Subject: [PATCH 448/885] tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` To stop applying it where not needed (most uses) and make it visible where it's actually used (5 uses). Follow-up to f4e23950c7b1c389cf0dde8b91353d85b8361b64 #16142 Closes #19606 --- lib/curlx/multibyte.h | 2 +- src/tool_getparam.c | 8 ++++---- src/tool_operate.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index c60ce258c9bc..8b698c1b7357 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -78,6 +78,6 @@ typedef union { #endif /* UNICODE && _WIN32 */ /* the purpose of this macro is to free() without being traced by memdebug */ -#define curlx_unicodefree(ptr) (free)(CURL_UNCONST(ptr)) +#define curlx_unicodefree(ptr) (free)(ptr) #endif /* HEADER_CURL_MULTIBYTE_H */ diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 337ad33280f7..0bb1329b5495 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -3050,7 +3050,7 @@ ParameterError parse_args(int argc, argv_item_t argv[]) if(i < (argc - 1)) { nextarg = convert_tchar_to_UTF8(argv[i + 1]); if(!nextarg) { - unicodefree(orig_opt); + unicodefree(CURL_UNCONST(orig_opt)); return PARAM_NO_MEM; } } @@ -3058,7 +3058,7 @@ ParameterError parse_args(int argc, argv_item_t argv[]) result = getparameter(orig_opt, nextarg, &passarg, config, CONFIG_MAX_LEVELS); - unicodefree(nextarg); + unicodefree(CURL_UNCONST(nextarg)); config = global->last; if(result == PARAM_NEXT_OPERATION) { /* Reset result as PARAM_NEXT_OPERATION is only used here and not @@ -3096,7 +3096,7 @@ ParameterError parse_args(int argc, argv_item_t argv[]) } if(!result) { - unicodefree(orig_opt); + unicodefree(CURL_UNCONST(orig_opt)); orig_opt = NULL; } } @@ -3119,6 +3119,6 @@ ParameterError parse_args(int argc, argv_item_t argv[]) helpf("%s", reason); } - unicodefree(orig_opt); + unicodefree(CURL_UNCONST(orig_opt)); return result; } diff --git a/src/tool_operate.c b/src/tool_operate.c index 8949ce2a52f3..b969375422c3 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2249,7 +2249,7 @@ CURLcode operate(int argc, argv_item_t argv[]) } } - unicodefree(first_arg); + unicodefree(CURL_UNCONST(first_arg)); if(!result) { /* Parse the command line arguments */ From 9fb843ac8f3dc14cfeb4dd2902f1b23445a717ac Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 19 Nov 2025 14:07:03 +0100 Subject: [PATCH 449/885] ftp: use size_t instead of ssize_t Make type conversions unnecessary. Closes #19607 --- lib/ftp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index 7a0bb8ce01dd..ac4fdc25c96a 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -417,7 +417,7 @@ static const struct Curl_cwtype ftp_cw_lc = { #endif /* CURL_PREFER_LF_LINEENDS */ -static CURLcode getftpresponse(struct Curl_easy *data, ssize_t *nread, +static CURLcode getftpresponse(struct Curl_easy *data, size_t *nread, int *ftpcode); /*********************************************************************** @@ -431,7 +431,7 @@ static CURLcode ftp_check_ctrl_on_data_wait(struct Curl_easy *data, struct connectdata *conn = data->conn; curl_socket_t ctrl_sock = conn->sock[FIRSTSOCKET]; struct pingpong *pp = &ftpc->pp; - ssize_t nread; + size_t nread; int ftpcode; bool response = FALSE; @@ -602,7 +602,7 @@ static CURLcode ftp_readresp(struct Curl_easy *data, * */ static CURLcode getftpresponse(struct Curl_easy *data, - ssize_t *nreadp, /* return number of bytes + size_t *nreadp, /* return number of bytes read */ int *ftpcodep) /* return the ftp-code */ { @@ -3225,7 +3225,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, struct FTP *ftp = Curl_meta_get(data, CURL_META_FTP_EASY); struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN); struct pingpong *pp; - ssize_t nread; + size_t nread; int ftpcode; CURLcode result = CURLE_OK; @@ -3437,7 +3437,7 @@ CURLcode ftp_sendquote(struct Curl_easy *data, item = quote; while(item) { if(item->data) { - ssize_t nread; + size_t nread; char *cmd = item->data; bool acceptfail = FALSE; CURLcode result; From 30afc66b88a2020842d7ddb78116f44ac6b34310 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 19 Nov 2025 14:20:49 +0100 Subject: [PATCH 450/885] gopher: convert ssize_t to size_t Make type conversions unnecessary. Closes #19608 --- lib/gopher.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/gopher.c b/lib/gopher.c index 1d4c75295ccb..45d43f6ebdb1 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -139,11 +139,10 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) char *gopherpath; char *path = data->state.up.path; char *query = data->state.up.query; - char *sel = NULL; - char *sel_org = NULL; + const char *buf = NULL; + char *buf_alloc = NULL; + size_t nwritten, buf_len; timediff_t timeout_ms; - ssize_t k; - size_t amount, len; int what; *done = TRUE; /* unconditionally */ @@ -161,8 +160,8 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) /* Create selector. Degenerate cases: / and /1 => convert to "" */ if(strlen(gopherpath) <= 2) { - sel = (char *)CURL_UNCONST(""); - len = strlen(sel); + buf = ""; + buf_len = 0; free(gopherpath); } else { @@ -173,30 +172,28 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) newp += 2; /* ... and finally unescape */ - result = Curl_urldecode(newp, 0, &sel, &len, REJECT_ZERO); + result = Curl_urldecode(newp, 0, &buf_alloc, &buf_len, REJECT_ZERO); free(gopherpath); if(result) return result; - sel_org = sel; + buf = buf_alloc; } - k = curlx_uztosz(len); + for(; buf_len;) { - for(;;) { - /* Break out of the loop if the selector is empty because OpenSSL and/or - LibreSSL fail with errno 0 if this is the case. */ - if(strlen(sel) < 1) - break; - - result = Curl_xfer_send(data, sel, k, FALSE, &amount); + result = Curl_xfer_send(data, buf, buf_len, FALSE, &nwritten); if(!result) { /* Which may not have written it all! */ - result = Curl_client_write(data, CLIENTWRITE_HEADER, sel, amount); + result = Curl_client_write(data, CLIENTWRITE_HEADER, buf, nwritten); if(result) break; - k -= amount; - sel += amount; - if(k < 1) + if(nwritten > buf_len) { + DEBUGASSERT(0); + break; + } + buf_len -= nwritten; + buf += nwritten; + if(!buf_len) break; /* but it did write it all */ } else @@ -227,10 +224,10 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) } } - free(sel_org); + free(buf_alloc); if(!result) - result = Curl_xfer_send(data, "\r\n", 2, FALSE, &amount); + result = Curl_xfer_send(data, "\r\n", 2, FALSE, &nwritten); if(result) { failf(data, "Failed sending Gopher request"); return result; From 17dc43ce6cfe536e4a30c1be42de1a9cdd585a9a Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 19 Nov 2025 15:09:57 +0100 Subject: [PATCH 451/885] http: eliminate ssize_t Use size_t to avoid conversions. Closes #19610 --- lib/http1.c | 103 +++++++++++++++++++--------------------- lib/http1.h | 10 ++-- lib/http2.c | 11 ++--- lib/vquic/curl_ngtcp2.c | 12 ++--- lib/vquic/curl_osslq.c | 54 ++++++++++----------- lib/vquic/curl_quiche.c | 9 ++-- tests/unit/unit2603.c | 10 ++-- 7 files changed, 97 insertions(+), 112 deletions(-) diff --git a/lib/http1.c b/lib/http1.c index c487597e3492..b1d80976360a 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -80,57 +80,58 @@ static CURLcode trim_line(struct h1_req_parser *parser, int options) return CURLE_OK; } -static ssize_t detect_line(struct h1_req_parser *parser, - const char *buf, const size_t buflen, - CURLcode *err) +static CURLcode detect_line(struct h1_req_parser *parser, + const char *buf, const size_t buflen, + size_t *pnread) { const char *line_end; DEBUGASSERT(!parser->line); + *pnread = 0; line_end = memchr(buf, '\n', buflen); - if(!line_end) { - *err = CURLE_AGAIN; - return -1; - } + if(!line_end) + return CURLE_AGAIN; parser->line = buf; parser->line_len = line_end - buf + 1; - *err = CURLE_OK; - return (ssize_t)parser->line_len; + *pnread = parser->line_len; + return CURLE_OK; } -static ssize_t next_line(struct h1_req_parser *parser, - const char *buf, const size_t buflen, int options, - CURLcode *err) +static CURLcode next_line(struct h1_req_parser *parser, + const char *buf, const size_t buflen, int options, + size_t *pnread) { - ssize_t nread = 0; + CURLcode result; + *pnread = 0; if(parser->line) { parser->line = NULL; parser->line_len = 0; curlx_dyn_reset(&parser->scratch); } - nread = detect_line(parser, buf, buflen, err); - if(nread >= 0) { + result = detect_line(parser, buf, buflen, pnread); + if(!result) { if(curlx_dyn_len(&parser->scratch)) { /* append detected line to scratch to have the complete line */ - *err = curlx_dyn_addn(&parser->scratch, parser->line, parser->line_len); - if(*err) - return -1; + result = curlx_dyn_addn(&parser->scratch, parser->line, + parser->line_len); + if(result) + return result; parser->line = curlx_dyn_ptr(&parser->scratch); parser->line_len = curlx_dyn_len(&parser->scratch); } - *err = trim_line(parser, options); - if(*err) - return -1; + result = trim_line(parser, options); + if(result) + return result; } - else if(*err == CURLE_AGAIN) { + else if(result == CURLE_AGAIN) { /* no line end in `buf`, add it to our scratch */ - *err = curlx_dyn_addn(&parser->scratch, (const unsigned char *)buf, - buflen); - nread = (*err) ? -1 : (ssize_t)buflen; + result = curlx_dyn_addn(&parser->scratch, (const unsigned char *)buf, + buflen); + *pnread = buflen; } - return nread; + return result; } static CURLcode start_req(struct h1_req_parser *parser, @@ -264,29 +265,28 @@ static CURLcode start_req(struct h1_req_parser *parser, return result; } -ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, - const char *buf, size_t buflen, - const char *scheme_default, - const char *custom_method, - int options, CURLcode *err) +CURLcode Curl_h1_req_parse_read(struct h1_req_parser *parser, + const char *buf, size_t buflen, + const char *scheme_default, + const char *custom_method, + int options, size_t *pnread) { - ssize_t nread = 0, n; + CURLcode result = CURLE_OK; + size_t nread; - *err = CURLE_OK; + *pnread = 0; while(!parser->done) { - n = next_line(parser, buf, buflen, options, err); - if(n < 0) { - if(*err != CURLE_AGAIN) { - nread = -1; - } - *err = CURLE_OK; + result = next_line(parser, buf, buflen, options, &nread); + if(result) { + if(result == CURLE_AGAIN) + result = CURLE_OK; goto out; } /* Consume this line */ - nread += (size_t)n; - buf += (size_t)n; - buflen -= (size_t)n; + *pnread += nread; + buf += nread; + buflen -= nread; if(!parser->line) { /* consumed bytes, but line not complete */ @@ -294,17 +294,14 @@ ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, goto out; } else if(!parser->req) { - *err = start_req(parser, scheme_default, custom_method, options); - if(*err) { - nread = -1; + result = start_req(parser, scheme_default, custom_method, options); + if(result) goto out; - } } else if(parser->line_len == 0) { /* last, empty line, we are finished */ if(!parser->req) { - *err = CURLE_URL_MALFORMAT; - nread = -1; + result = CURLE_URL_MALFORMAT; goto out; } parser->done = TRUE; @@ -312,17 +309,15 @@ ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, /* last chance adjustments */ } else { - *err = Curl_dynhds_h1_add_line(&parser->req->headers, - parser->line, parser->line_len); - if(*err) { - nread = -1; + result = Curl_dynhds_h1_add_line(&parser->req->headers, + parser->line, parser->line_len); + if(result) goto out; - } } } out: - return nread; + return result; } CURLcode Curl_h1_req_write_head(struct httpreq *req, int http_minor, diff --git a/lib/http1.h b/lib/http1.h index 94b5a44e3143..944e9038dd98 100644 --- a/lib/http1.h +++ b/lib/http1.h @@ -48,11 +48,11 @@ struct h1_req_parser { void Curl_h1_req_parse_init(struct h1_req_parser *parser, size_t max_line_len); void Curl_h1_req_parse_free(struct h1_req_parser *parser); -ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, - const char *buf, size_t buflen, - const char *scheme_default, - const char *custom_method, - int options, CURLcode *err); +CURLcode Curl_h1_req_parse_read(struct h1_req_parser *parser, + const char *buf, size_t buflen, + const char *scheme_default, + const char *custom_method, + int options, size_t *pnread); CURLcode Curl_h1_req_dprint(const struct httpreq *req, struct dynbuf *dbuf); diff --git a/lib/http2.c b/lib/http2.c index 1565e0b9ead3..a1caa2020f7c 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2237,7 +2237,6 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, nghttp2_data_provider data_prd; int32_t stream_id; nghttp2_priority_spec pri_spec; - ssize_t rc; size_t nwritten; CURLcode result = CURLE_OK; @@ -2248,11 +2247,11 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, if(result) goto out; - rc = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, - !data->state.http_ignorecustom ? - data->set.str[STRING_CUSTOMREQUEST] : NULL, - 0, &result); - if(!curlx_sztouz(rc, &nwritten)) + result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, &nwritten); + if(result) goto out; *pnwritten = nwritten; if(!stream->h1.done) { diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index ce5786ca83e8..ecfa895a2eaf 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1513,7 +1513,6 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, nghttp3_nv *nva = NULL; int rc = 0; unsigned int i; - ssize_t nwritten = -1; nghttp3_data_reader reader; nghttp3_data_reader *preader = NULL; CURLcode result; @@ -1531,13 +1530,12 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, goto out; } - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, - !data->state.http_ignorecustom ? - data->set.str[STRING_CUSTOMREQUEST] : NULL, - 0, &result); - if(nwritten < 0) + result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, pnwritten); + if(result) goto out; - *pnwritten = (size_t)nwritten; if(!stream->h1.done) { /* need more data */ diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index f328c08e35b5..68666d591505 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1872,10 +1872,10 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, return result; } -static ssize_t h3_stream_open(struct Curl_cfilter *cf, - struct Curl_easy *data, - const void *buf, size_t len, - CURLcode *err) +static CURLcode h3_stream_open(struct Curl_cfilter *cf, + struct Curl_easy *data, + const void *buf, size_t len, + size_t *pnwritten) { struct cf_osslq_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = NULL; @@ -1884,27 +1884,27 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, nghttp3_nv *nva = NULL; int rc = 0; unsigned int i; - ssize_t nwritten = -1; nghttp3_data_reader reader; nghttp3_data_reader *preader = NULL; + CURLcode result; Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST); - *err = h3_data_setup(cf, data); - if(*err) + result = h3_data_setup(cf, data); + if(result) goto out; stream = H3_STREAM_CTX(ctx, data); DEBUGASSERT(stream); if(!stream) { - *err = CURLE_FAILED_INIT; + result = CURLE_FAILED_INIT; goto out; } - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, - !data->state.http_ignorecustom ? - data->set.str[STRING_CUSTOMREQUEST] : NULL, - 0, err); - if(nwritten < 0) + result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, pnwritten); + if(result) goto out; if(!stream->h1.done) { /* need more data */ @@ -1912,19 +1912,16 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, } DEBUGASSERT(stream->h1.req); - *err = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data); - if(*err) { - nwritten = -1; + result = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data); + if(result) goto out; - } /* no longer needed */ Curl_h1_req_parse_free(&stream->h1); nheader = Curl_dynhds_count(&h2_headers); nva = malloc(sizeof(nghttp3_nv) * nheader); if(!nva) { - *err = CURLE_OUT_OF_MEMORY; - nwritten = -1; + result = CURLE_OUT_OF_MEMORY; goto out; } @@ -1938,11 +1935,11 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, } DEBUGASSERT(stream->s.id == -1); - *err = cf_osslq_stream_open(&stream->s, ctx->tls.ossl.ssl, 0, - &ctx->stream_bufcp, data); - if(*err) { + result = cf_osslq_stream_open(&stream->s, ctx->tls.ossl.ssl, 0, + &ctx->stream_bufcp, data); + if(result) { failf(data, "cannot get bidi streams"); - *err = CURLE_SEND_ERROR; + result = CURLE_SEND_ERROR; goto out; } @@ -1983,8 +1980,7 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, stream->s.id, rc, nghttp3_strerror(rc)); break; } - *err = CURLE_SEND_ERROR; - nwritten = -1; + result = CURLE_SEND_ERROR; goto out; } @@ -2002,7 +1998,7 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, out: free(nva); Curl_dynhds_free(&h2_headers); - return nwritten; + return result; } static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -2012,7 +2008,6 @@ static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_osslq_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = NULL; struct cf_call_data save; - ssize_t nwritten; CURLcode result = CURLE_OK; (void)eos; /* use to end stream */ @@ -2032,13 +2027,12 @@ static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, stream = H3_STREAM_CTX(ctx, data); if(!stream || stream->s.id < 0) { - nwritten = h3_stream_open(cf, data, buf, len, &result); - if(nwritten < 0) { + result = h3_stream_open(cf, data, buf, len, pnwritten); + if(result) { CURL_TRC_CF(data, cf, "failed to open stream -> %d", result); goto out; } stream = H3_STREAM_CTX(ctx, data); - *pnwritten = (size_t)nwritten; } else if(stream->closed) { if(stream->resp_hds_complete) { diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 02b679ab8431..0ab7e0c296d0 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -977,7 +977,6 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, struct dynhds h2_headers; quiche_h3_header *nva = NULL; CURLcode result = CURLE_OK; - ssize_t nwritten; *pnwritten = 0; if(!stream) { @@ -991,11 +990,12 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST); DEBUGASSERT(stream); - nwritten = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, + + result = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, - 0, &result); - if(nwritten < 0) + 0, pnwritten); + if(result) goto out; if(!stream->h1.done) { /* need more data */ @@ -1025,7 +1025,6 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, nva[i].value_len = e->valuelen; } - *pnwritten = (size_t)nwritten; buf += *pnwritten; blen -= *pnwritten; diff --git a/tests/unit/unit2603.c b/tests/unit/unit2603.c index a8ed09f1c2b5..61295de37e1d 100644 --- a/tests/unit/unit2603.c +++ b/tests/unit/unit2603.c @@ -66,7 +66,7 @@ static void parse_success(const struct tcase *t) const char *buf; size_t buflen, i, in_len, in_consumed; CURLcode err; - ssize_t nread; + size_t nread; Curl_h1_req_parse_init(&p, 1024); in_len = in_consumed = 0; @@ -74,14 +74,14 @@ static void parse_success(const struct tcase *t) buf = t->input[i]; buflen = strlen(buf); in_len += buflen; - nread = Curl_h1_req_parse_read(&p, buf, buflen, t->default_scheme, - t->custom_method, 0, &err); - if(nread < 0) { + err = Curl_h1_req_parse_read(&p, buf, buflen, t->default_scheme, + t->custom_method, 0, &nread); + if(err) { curl_mfprintf(stderr, "got err %d parsing: '%s'\n", err, buf); fail("error consuming"); } in_consumed += (size_t)nread; - if((size_t)nread != buflen) { + if(nread != buflen) { if(!p.done) { curl_mfprintf(stderr, "only %zd/%zu consumed for: '%s'\n", nread, buflen, buf); From 991119051c2e54d2e9b6b002811f7f9da71c37eb Mon Sep 17 00:00:00 2001 From: Christian Schmitz Date: Wed, 19 Nov 2025 13:15:37 +0100 Subject: [PATCH 452/885] libssh2: add paths to error messages for quote commands We really like to know what path curl parsed from our input. Closes #19605 --- lib/vssh/libssh2.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index f5cb5f9a1d5d..3a7e14053fb9 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -2067,10 +2067,10 @@ static CURLcode ssh_state_sftp_quote_setstat(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "Attempt to set SFTP stats for \"%s\" failed: %s", + sshc->quote_path2, sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); - failf(data, "Attempt to set SFTP stats failed: %s", - sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; @@ -2093,10 +2093,11 @@ static CURLcode ssh_state_sftp_quote_symlink(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "symlink \"%s\" to \"%s\" failed: %s", + sshc->quote_path1, sshc->quote_path2, + sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); - failf(data, "symlink command failed: %s", - sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; @@ -2116,9 +2117,9 @@ static CURLcode ssh_state_sftp_quote_mkdir(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "mkdir \"%s\" failed: %s", + sshc->quote_path1, sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); - failf(data, "mkdir command failed: %s", - sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; @@ -2144,10 +2145,11 @@ static CURLcode ssh_state_sftp_quote_rename(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "rename \"%s\" to \"%s\" failed: %s", + sshc->quote_path1, sshc->quote_path2, + sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); - failf(data, "rename command failed: %s", - sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; @@ -2166,9 +2168,9 @@ static CURLcode ssh_state_sftp_quote_rmdir(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "rmdir \"%s\" failed: %s", + sshc->quote_path1, sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); - failf(data, "rmdir command failed: %s", - sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; @@ -2187,8 +2189,9 @@ static CURLcode ssh_state_sftp_quote_unlink(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "rm \"%s\" failed: %s", + sshc->quote_path1, sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); - failf(data, "rm command failed: %s", sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; @@ -2210,9 +2213,9 @@ static CURLcode ssh_state_sftp_quote_statvfs(struct Curl_easy *data, if(rc && !sshc->acceptfail) { unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "statvfs \"%s\" failed: %s", + sshc->quote_path1, sftp_libssh2_strerror(sftperr)); Curl_safefree(sshc->quote_path1); - failf(data, "statvfs command failed: %s", - sftp_libssh2_strerror(sftperr)); myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; return CURLE_QUOTE_ERROR; From 2decbb1c1f8a975425e2be5afebb3096b50de599 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 1 Nov 2025 03:07:36 +0100 Subject: [PATCH 453/885] runtests: add `-m=seconds` to override test curl command timeout To override the curl default of 5 minutes (300000 ms). Sometimes a simple test data change can result in a stuck test, this option makes it exit with an error early. Possible future use in CI or fast machines to prevent a single test taking 5 minutes and failing the whole job. Example hangers: tests/data/test65: ```diff - + ``` tests/data/tests993: ```diff -%repeat[1000 x 95 328485%0d%0a]% +%repeat[1000 x 95 328485%0d%0a]% + ``` Closes #19319 --- docs/runtests.md | 4 ++++ tests/data/test1400 | 1 + tests/data/test1401 | 1 + tests/data/test1402 | 1 + tests/data/test1403 | 1 + tests/data/test1404 | 1 + tests/data/test1405 | 1 + tests/data/test1406 | 1 + tests/data/test1407 | 1 + tests/data/test1420 | 1 + tests/data/test1465 | 1 + tests/data/test1481 | 1 + tests/data/test285 | 2 +- tests/globalconfig.pm | 2 ++ tests/runner.pm | 3 +++ tests/runtests.pl | 5 +++++ 16 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/runtests.md b/docs/runtests.md index 373f07618d5e..b449b3f4118d 100644 --- a/docs/runtests.md +++ b/docs/runtests.md @@ -180,6 +180,10 @@ regression test suite. Lists all test case names. +## `-m=[seconds]` + +Set timeout for curl commands in tests + ## `-n` Disable the check for and use of valgrind. diff --git a/tests/data/test1400 b/tests/data/test1400 index 1d2ece68e4ad..9c54240c2f1a 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -59,6 +59,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_HTTP09_ALLOWED/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1401 b/tests/data/test1401 index 31259e079f1d..e2f51f39112b 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -68,6 +68,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1402 b/tests/data/test1402 index c256611b0d1e..77c0798da287 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -62,6 +62,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1403 b/tests/data/test1403 index 2a2f3617cd86..94ada0fdd9cd 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -59,6 +59,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1404 b/tests/data/test1404 index 732c2678a693..3ffcde893903 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -104,6 +104,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ # CURL_DOES_CONVERSION generates an extra comment. $_ = '' if /\/\* "value" \*\// diff --git a/tests/data/test1405 b/tests/data/test1405 index a71a522cfaec..84ccd6a0fb59 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -144,6 +144,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_HTTP09_ALLOWED/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ diff --git a/tests/data/test1406 b/tests/data/test1406 index 5f935d2d075a..776c880dad67 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -131,6 +131,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_HTTP09_ALLOWED/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ diff --git a/tests/data/test1407 b/tests/data/test1407 index 9ab40cef40e3..f767622b0b04 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -109,6 +109,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_HTTP09_ALLOWED/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ diff --git a/tests/data/test1420 b/tests/data/test1420 index 4a6be824376e..22d918acf521 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -113,6 +113,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ diff --git a/tests/data/test1465 b/tests/data/test1465 index 686c28b0bac4..b9e85535bac0 100644 --- a/tests/data/test1465 +++ b/tests/data/test1465 @@ -65,6 +65,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1481 b/tests/data/test1481 index 209c3f87e0a7..30b6d420e1e7 100644 --- a/tests/data/test1481 +++ b/tests/data/test1481 @@ -61,6 +61,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ $_ = '' if /CURLOPT_HTTP09_ALLOWED/ $_ = '' if /CURLOPT_INTERLEAVEDATA/ +$_ = '' if /CURLOPT_TIMEOUT_MS/ /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test285 b/tests/data/test285 index 03dc96f6a080..edba1d33002a 100644 --- a/tests/data/test285 +++ b/tests/data/test285 @@ -16,7 +16,7 @@ tftp TFTP send --T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// --connect-timeout 549 +-T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// --connect-timeout 549 --max-time 599 a chunk of diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 6203b6274943..8543b3aec440 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -49,6 +49,7 @@ BEGIN { $buildinfo $LOCKDIR $LOGDIR + $maxtime $memanalyze $MEMDUMP $perlcmd @@ -103,6 +104,7 @@ our $anyway; # continue anyway, even if a test fail our $CURLVERSION=""; # curl's reported version number our $CURLVERNUM=""; # curl's reported version number (without -DEV) our $randseed = 0; # random number seed +our $maxtime; # curl command timeout override # paths our $pwd = getcwd(); # current working directory diff --git a/tests/runner.pm b/tests/runner.pm index 6113c1874527..a73f9d599934 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -972,6 +972,9 @@ sub singletest_run { if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-q/)) { $CMDLINE .= " -q"; } + if($maxtime) { + $CMDLINE .= " --max-time $maxtime"; + } } if(use_valgrind() && !$disablevalgrind) { diff --git a/tests/runtests.pl b/tests/runtests.pl index 354be91f08a9..54ac77e2e963 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -2421,6 +2421,10 @@ sub pickrunner { $short=1; $automakestyle=1; } + elsif($ARGV[0] =~ /-m=(\d+)/) { + my ($num)=($1); + $maxtime=$num; + } elsif($ARGV[0] eq "-n") { # no valgrind undef $valgrind; @@ -2563,6 +2567,7 @@ sub pickrunner { -k keep stdout and stderr files present after tests -L path require an additional perl library file to replace certain functions -l list all test case names/descriptions + -m=[seconds] set timeout for curl commands in tests -n no valgrind --no-debuginfod disable the valgrind debuginfod functionality -o variable=value set internal variable to the specified value From 3d80d37cf0bdfc25645bd150c692d122e94ef1cb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 19 Nov 2025 01:10:48 +0100 Subject: [PATCH 454/885] curlx: add and use `curlx_freopen()` To complement the existing `curlx_fopen()` internal API. It's used by the curl's `--stderr` option. `curlx_freopen()` adds two features to the bare `freopen()`: - tracing for debug-enabled builds. - Unicode and long-filename support for Windows builds. In effect this adds long-filename and enables Unicode support for the `--stderr ` curl command-line option on Windows. Also add to checksrc. Follow-up to 2f17a9b654121dd1ecf4fc043c6d08a9da3522db #10673 Closes #19598 --- docs/internals/CHECKSRC.md | 3 ++- lib/curl_setup.h | 3 +++ lib/curlx/fopen.c | 34 ++++++++++++++++++++++++++++++++++ lib/curlx/fopen.h | 18 ++++++++++++------ lib/memdebug.c | 16 ++++++++++++++-- scripts/checksrc.pl | 3 ++- src/tool_stderr.c | 2 +- 7 files changed, 68 insertions(+), 11 deletions(-) diff --git a/docs/internals/CHECKSRC.md b/docs/internals/CHECKSRC.md index 9c4f1428791e..1740b2bef591 100644 --- a/docs/internals/CHECKSRC.md +++ b/docs/internals/CHECKSRC.md @@ -76,7 +76,8 @@ warnings are: - `EXCLAMATIONSPACE`: space found after exclamations mark -- `FOPENMODE`: `curlx_fopen()` needs a macro for the mode string, use it +- `FOPENMODE`: `curlx_fopen()`, `curlx_freopen()` need a macro for the mode + string, use it - `INDENTATION`: detected a wrong start column for code. Note that this warning only checks some specific places and can certainly miss many bad diff --git a/lib/curl_setup.h b/lib/curl_setup.h index f5b9111f6103..0df96d5efd28 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -1041,6 +1041,9 @@ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fopen(const char *file, const char *mode, int line, const char *source); +CURL_EXTERN ALLOC_FUNC + FILE *curl_dbg_freopen(const char *file, const char *mode, FILE *fh, + int line, const char *source); CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode, int line, const char *source); diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index a5311874b8ae..333eff7de7e2 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -282,6 +282,40 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) return result; } +FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) +{ + FILE *result = NULL; + TCHAR *fixed = NULL; + const TCHAR *target = NULL; + +#ifdef _UNICODE + wchar_t *filename_w = curlx_convert_UTF8_to_wchar(filename); + wchar_t *mode_w = curlx_convert_UTF8_to_wchar(mode); + if(filename_w && mode_w) { + if(fix_excessive_path(filename_w, &fixed)) + target = fixed; + else + target = filename_w; + result = _wfreopen(target, mode_w, fp); + } + else + /* !checksrc! disable ERRNOVAR 1 */ + errno = EINVAL; + curlx_unicodefree(filename_w); + curlx_unicodefree(mode_w); +#else + if(fix_excessive_path(filename, &fixed)) + target = fixed; + else + target = filename; + /* !checksrc! disable BANNEDFUNC 1 */ + result = freopen(target, mode, fp); +#endif + + (free)(fixed); + return result; +} + int curlx_win32_stat(const char *path, struct_stat *buffer) { int result = -1; diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index da9eb55ec9dd..eeb3fda9469c 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -36,23 +36,29 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence); #ifdef _WIN32 FILE *curlx_win32_fopen(const char *filename, const char *mode); +FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fh); int curlx_win32_stat(const char *path, struct_stat *buffer); int curlx_win32_open(const char *filename, int oflag, ...); -#define CURLX_FOPEN_LOW(fname, mode) curlx_win32_fopen(fname, mode) -#define curlx_stat(fname, stp) curlx_win32_stat(fname, stp) -#define curlx_open curlx_win32_open +#define CURLX_FOPEN_LOW(fname, mode) curlx_win32_fopen(fname, mode) +#define CURLX_FREOPEN_LOW(fname, mode, fh) curlx_win32_freopen(fname, mode, fh) +#define curlx_stat(fname, stp) curlx_win32_stat(fname, stp) +#define curlx_open curlx_win32_open #else -#define CURLX_FOPEN_LOW fopen -#define curlx_stat(fname, stp) stat(fname, stp) -#define curlx_open open +#define CURLX_FOPEN_LOW fopen +#define CURLX_FREOPEN_LOW freopen +#define curlx_stat(fname, stp) stat(fname, stp) +#define curlx_open open #endif #ifdef CURLDEBUG #define curlx_fopen(file,mode) curl_dbg_fopen(file,mode,__LINE__,__FILE__) +#define curlx_freopen(file,mode,fh) \ + curl_dbg_freopen(file,mode,fh,__LINE__,__FILE__) #define curlx_fdopen(file,mode) curl_dbg_fdopen(file,mode,__LINE__,__FILE__) #define curlx_fclose(file) curl_dbg_fclose(file,__LINE__,__FILE__) #else #define curlx_fopen CURLX_FOPEN_LOW +#define curlx_freopen CURLX_FREOPEN_LOW #define curlx_fdopen fdopen #define curlx_fclose fclose #endif diff --git a/lib/memdebug.c b/lib/memdebug.c index 11e924a55b09..758c7b6aa7e2 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -29,7 +29,7 @@ #include #include "urldata.h" -#include "curlx/fopen.h" /* for CURLX_FOPEN_LOW() */ +#include "curlx/fopen.h" /* for CURLX_FOPEN_LOW(), CURLX_FREOPEN_LOW() */ /* The last 2 #include files should be in this order */ #include "curl_memory.h" @@ -424,7 +424,19 @@ FILE *curl_dbg_fopen(const char *file, const char *mode, FILE *res = CURLX_FOPEN_LOW(file, mode); if(source) curl_dbg_log("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n", - source, line, file, mode, (void *)res); + source, line, file, mode, (void *)res); + + return res; +} + +ALLOC_FUNC +FILE *curl_dbg_freopen(const char *file, const char *mode, FILE *fh, + int line, const char *source) +{ + FILE *res = CURLX_FREOPEN_LOW(file, mode, fh); + if(source) + curl_dbg_log("FILE %s:%d freopen(\"%s\",\"%s\",%p) = %p\n", + source, line, file, mode, (void *)fh, (void *)res); return res; } diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 5f9ea3352683..c9f008f1a1df 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -106,6 +106,7 @@ "fclose" => 1, "fdopen" => 1, "fopen" => 1, + "freopen" => 1, "open" => 1, "stat" => 1, ); @@ -961,7 +962,7 @@ sub scanfile { } # scan for use of non-binary fopen without the macro - if($l =~ /^(.*\W)(curlx_fopen|CURLX_FOPEN_LOW)\s*\([^,]*, *\"([^"]*)/) { + if($l =~ /^(.*\W)(curlx_fopen|CURLX_FOPEN_LOW|curlx_freopen|CURLX_FREOPEN_LOW)\s*\([^,]*, *\"([^"]*)/) { my $mode = $3; if($mode !~ /b/) { checkwarn("FOPENMODE", diff --git a/src/tool_stderr.c b/src/tool_stderr.c index 1116c3009255..8812f8bf8e52 100644 --- a/src/tool_stderr.c +++ b/src/tool_stderr.c @@ -60,7 +60,7 @@ void tool_set_stderr_file(const char *filename) /* freopen the actual stderr (stdio.h stderr) instead of tool_stderr since the latter may be set to stdout. */ /* !checksrc! disable STDERR 1 */ - fp = freopen(filename, FOPEN_WRITETEXT, stderr); + fp = curlx_freopen(filename, FOPEN_WRITETEXT, stderr); if(!fp) { /* stderr may have been closed by freopen. there is nothing to be done. */ DEBUGASSERT(0); From 7e8f36bf8e56e632e4f8be54b584f758e3aaa086 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 19 Nov 2025 23:33:52 +0100 Subject: [PATCH 455/885] cmake: honor `CURL_DISABLE_INSTALL` and `CURL_ENABLE_EXPORT_TARGET` in lib and src Based on existing code and commit history it appears `CURL_DISABLE_INSTALL` means to prevent calling `install()`; `CURL_ENABLE_EXPORT_TARGET` means to prevent calling `export()` and `install()`s with `EXPORT` in them. Fix them to also apply to the lib and src directories in that vain: - lib: honor `CURL_DISABLE_INSTALL` - src: honor `CURL_DISABLE_INSTALL` - src: honor `CURL_ENABLE_EXPORT_TARGET` https://cmake.org/cmake/help/v4.2/command/install.html https://cmake.org/cmake/help/v4.2/command/export.html - `CURL_DISABLE_INSTALL` follow-up to: aace27b0965c10394544d1dacc9c2cb2fe0de3d3 #12287 - `CURL_ENABLE_EXPORT_TARGET` follow-up to: 8698825106f7a9987ab3924128eee885278f66bb #9638 643ec296456ba98c536857fce3ecfd021d44d913 #7060 Closes #19144 --- docs/libcurl/opts/CMakeLists.txt | 1 + lib/CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 15 ++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/libcurl/opts/CMakeLists.txt b/docs/libcurl/opts/CMakeLists.txt index c3e2c2cc6b65..f8b5aaa2def7 100644 --- a/docs/libcurl/opts/CMakeLists.txt +++ b/docs/libcurl/opts/CMakeLists.txt @@ -28,6 +28,7 @@ include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") curl_add_manual_pages(man_MANS) add_custom_target(curl-opts-man DEPENDS ${man_MANS}) add_dependencies(curl-man curl-opts-man) + if(NOT CURL_DISABLE_INSTALL) set(_src "") foreach(_file IN LISTS man_MANS) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d9857a50c27f..b468eec0a2e4 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -304,7 +304,7 @@ add_library(${LIB_NAME} ALIAS ${LIB_SELECTED}) add_library(${PROJECT_NAME}::${LIB_NAME} ALIAS ${LIB_SELECTED}) if(CURL_ENABLE_EXPORT_TARGET) - if(BUILD_STATIC_LIBS) + if(NOT CURL_DISABLE_INSTALL AND BUILD_STATIC_LIBS) install(TARGETS ${LIB_STATIC} EXPORT ${TARGETS_EXPORT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -312,7 +312,7 @@ if(CURL_ENABLE_EXPORT_TARGET) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endif() - if(BUILD_SHARED_LIBS) + if(NOT CURL_DISABLE_INSTALL AND BUILD_SHARED_LIBS) install(TARGETS ${LIB_SHARED} EXPORT ${TARGETS_EXPORT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e2bbed8f06c..33f288b91591 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,8 +141,13 @@ endif() ################################################################################ -install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) -export(TARGETS ${EXE_NAME} - FILE "${PROJECT_BINARY_DIR}/curl-target.cmake" - NAMESPACE ${PROJECT_NAME}:: -) +if(CURL_ENABLE_EXPORT_TARGET) + if(NOT CURL_DISABLE_INSTALL) + install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + export(TARGETS ${EXE_NAME} + FILE "${PROJECT_BINARY_DIR}/curl-target.cmake" + NAMESPACE ${PROJECT_NAME}:: + ) +endif() From d9e9dd7f20344fbac78c17e85ada094f54b65782 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 10:37:46 +0100 Subject: [PATCH 456/885] h2-proxy: eliminate size_t cast Use curlx_sztouz() instead. Closes #19616 --- lib/cf-h2-proxy.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index 9a8312a04268..b963bb718ce9 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -42,6 +42,7 @@ #include "multiif.h" #include "sendf.h" #include "select.h" +#include "curlx/warnless.h" #include "cf-h2-proxy.h" /* The last 2 #include files should be in this order */ @@ -408,32 +409,30 @@ static CURLcode proxy_h2_nw_out_flush(struct Curl_cfilter *cf, * This function returns 0 if it succeeds, or -1 and error code will * be assigned to *err. */ -static int proxy_h2_process_pending_input(struct Curl_cfilter *cf, - struct Curl_easy *data, - CURLcode *err) +static CURLcode proxy_h2_process_pending_input(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct cf_h2_proxy_ctx *ctx = cf->ctx; const unsigned char *buf; - size_t blen; + size_t blen, nread; ssize_t rv; while(Curl_bufq_peek(&ctx->inbufq, &buf, &blen)) { rv = nghttp2_session_mem_recv(ctx->h2, (const uint8_t *)buf, blen); CURL_TRC_CF(data, cf, "[0] %zu bytes to nghttp2 -> %zd", blen, rv); - if(rv < 0) { + if(!curlx_sztouz(rv, &nread)) { failf(data, "process_pending_input: nghttp2_session_mem_recv() returned " "%zd:%s", rv, nghttp2_strerror((int)rv)); - *err = CURLE_RECV_ERROR; - return -1; + return CURLE_RECV_ERROR; } - else if(!rv) { + else if(!nread) { /* nghttp2 does not want to process more, but has no error. This * probably cannot happen, but be safe. */ break; } - Curl_bufq_skip(&ctx->inbufq, (size_t)rv); + Curl_bufq_skip(&ctx->inbufq, nread); if(Curl_bufq_is_empty(&ctx->inbufq)) { CURL_TRC_CF(data, cf, "[0] all data in connection buffer processed"); break; @@ -443,8 +442,7 @@ static int proxy_h2_process_pending_input(struct Curl_cfilter *cf, "in connection buffer", Curl_bufq_len(&ctx->inbufq)); } } - - return 0; + return CURLE_OK; } static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf, @@ -458,7 +456,8 @@ static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf, if(!Curl_bufq_is_empty(&ctx->inbufq)) { CURL_TRC_CF(data, cf, "[0] process %zu bytes in connection buffer", Curl_bufq_len(&ctx->inbufq)); - if(proxy_h2_process_pending_input(cf, data, &result) < 0) + result = proxy_h2_process_pending_input(cf, data); + if(result) return result; } @@ -484,7 +483,8 @@ static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf, break; } - if(proxy_h2_process_pending_input(cf, data, &result)) + result = proxy_h2_process_pending_input(cf, data); + if(result) return result; } @@ -1483,7 +1483,7 @@ static bool proxy_h2_connisalive(struct Curl_cfilter *cf, *input_pending = FALSE; result = Curl_cf_recv_bufq(cf->next, data, &ctx->inbufq, 0, &nread); if(!result) { - if(proxy_h2_process_pending_input(cf, data, &result) < 0) + if(proxy_h2_process_pending_input(cf, data)) /* immediate error, considered dead */ alive = FALSE; else { From b812be567a153ba4450d325a38e939aab94a15cc Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 11:40:23 +0100 Subject: [PATCH 457/885] mqtt: eliminate size_t cast Use new curlx_sotouz_fits() instead. Closes #19622 --- lib/curlx/warnless.c | 16 ++++++++++++++++ lib/curlx/warnless.h | 4 ++++ lib/mqtt.c | 9 +++++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/curlx/warnless.c b/lib/curlx/warnless.c index a0aa5eda13b1..5ed27b3e4cbf 100644 --- a/lib/curlx/warnless.c +++ b/lib/curlx/warnless.c @@ -317,6 +317,22 @@ bool curlx_sztouz(ssize_t sznum, size_t *puznum) return TRUE; } +bool curlx_sotouz_fits(curl_off_t sonum, size_t *puznum) +{ + if(sonum < 0) { + *puznum = 0; + return FALSE; + } +#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T + if(sonum > SIZE_MAX) { + *puznum = 0; + return FALSE; + } +#endif + *puznum = (size_t)sonum; + return TRUE; +} + curl_off_t curlx_uztoso(size_t uznum) { #if SIZEOF_SIZE_T >= SIZEOF_CURL_OFF_T diff --git a/lib/curlx/warnless.h b/lib/curlx/warnless.h index a128f71488a1..c8861d8488c3 100644 --- a/lib/curlx/warnless.h +++ b/lib/curlx/warnless.h @@ -69,6 +69,10 @@ curl_off_t curlx_uztoso(size_t uznum); /* Convert a ssize_t to size_t, return FALSE if negative and set 0 */ bool curlx_sztouz(ssize_t sznum, size_t *puznum); +/* Convert a curl_off_t to size_t, return FALSE if negative or + * too large and set 0 */ +bool curlx_sotouz_fits(curl_off_t sonum, size_t *puznum); + #ifdef _WIN32 #undef read #define read(fd, buf, count) (ssize_t)_read(fd, buf, curlx_uztoui(count)) diff --git a/lib/mqtt.c b/lib/mqtt.c index 58458a841639..9cbe800ded8e 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -192,7 +192,7 @@ static CURLcode mqtt_send(struct Curl_easy *data, if(result) return result; mq->lastTime = curlx_now(); - Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)n); + Curl_debug(data, CURLINFO_HEADER_OUT, buf, n); if(len != n) { size_t nsend = len - n; if(curlx_dyn_len(&mq->sendbuf)) { @@ -602,10 +602,11 @@ static CURLcode mqtt_publish(struct Curl_easy *data) DEBUGF(infof(data, "mqtt_publish without payload, return bad arg")); return CURLE_BAD_FUNCTION_ARGUMENT; } - if(postfieldsize < 0) + if(!curlx_sotouz_fits(postfieldsize, &payloadlen)) { + if(postfieldsize > 0) /* off_t does not fit into size_t */ + return CURLE_BAD_FUNCTION_ARGUMENT; payloadlen = strlen(payload); - else - payloadlen = (size_t)postfieldsize; + } result = mqtt_get_topic(data, &topic, &topiclen); if(result) From ffcf8c5ce4091457fea3457e918b60d729d36b2c Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 11:06:14 +0100 Subject: [PATCH 458/885] rtmp: eliminate size_t casts Use curlx_sztouz() instead. Closes #19619 --- lib/curl_rtmp.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 4a5e5cb637ac..2d2daf414897 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -335,15 +335,15 @@ static CURLcode rtmp_recv(struct Curl_easy *data, int sockindex, char *buf, struct connectdata *conn = data->conn; RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); CURLcode result = CURLE_OK; - ssize_t nread; + ssize_t rv; (void)sockindex; *pnread = 0; if(!r) return CURLE_FAILED_INIT; - nread = RTMP_Read(r, buf, curlx_uztosi(len)); - if(nread < 0) { + rv = RTMP_Read(r, buf, curlx_uztosi(len)); + if(!curlx_sztouz(rv, pnread)) { if(r->m_read.status == RTMP_READ_COMPLETE || r->m_read.status == RTMP_READ_EOF) { data->req.size = data->req.bytecount; @@ -351,8 +351,6 @@ static CURLcode rtmp_recv(struct Curl_easy *data, int sockindex, char *buf, else result = CURLE_RECV_ERROR; } - else - *pnread = (size_t)nread; return result; } @@ -363,7 +361,7 @@ static CURLcode rtmp_send(struct Curl_easy *data, int sockindex, { struct connectdata *conn = data->conn; RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); - ssize_t nwritten; + ssize_t rv; (void)sockindex; (void)eos; @@ -371,11 +369,10 @@ static CURLcode rtmp_send(struct Curl_easy *data, int sockindex, if(!r) return CURLE_FAILED_INIT; - nwritten = RTMP_Write(r, (const char *)buf, curlx_uztosi(len)); - if(nwritten < 0) + rv = RTMP_Write(r, (const char *)buf, curlx_uztosi(len)); + if(!curlx_sztouz(rv, pnwritten)) return CURLE_SEND_ERROR; - *pnwritten = (size_t)nwritten; return CURLE_OK; } From d2ab42d7867abc21e7f840c6ff46a0bc15ea5f4b Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 10:46:35 +0100 Subject: [PATCH 459/885] cf-socket: elminiate size_t casts Use curlx_sztouz() instead. Closes #19617 --- lib/cf-socket.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 80ed21272132..0055f2d48c92 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1432,7 +1432,7 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, { struct cf_socket_ctx *ctx = cf->ctx; curl_socket_t fdsave; - ssize_t nwritten; + ssize_t rv; size_t orig_len = len; CURLcode result = CURLE_OK; @@ -1463,15 +1463,15 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, #if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) /* Linux */ if(cf->conn->bits.tcp_fastopen) { - nwritten = sendto(ctx->sock, buf, len, MSG_FASTOPEN, - &ctx->addr.curl_sa_addr, ctx->addr.addrlen); + rv = sendto(ctx->sock, buf, len, MSG_FASTOPEN, + &ctx->addr.curl_sa_addr, ctx->addr.addrlen); cf->conn->bits.tcp_fastopen = FALSE; } else #endif - nwritten = swrite(ctx->sock, buf, len); + rv = swrite(ctx->sock, buf, len); - if(nwritten < 0) { + if(!curlx_sztouz(rv, pnwritten)) { int sockerr = SOCKERRNO; if( @@ -1498,8 +1498,6 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, result = CURLE_SEND_ERROR; } } - else - *pnwritten = (size_t)nwritten; #ifdef USE_WINSOCK if(!result) @@ -1517,7 +1515,7 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, { struct cf_socket_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; - ssize_t nread; + ssize_t rv; *pnread = 0; #ifdef DEBUGBUILD @@ -1538,9 +1536,9 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, } #endif - nread = sread(ctx->sock, buf, len); + rv = sread(ctx->sock, buf, len); - if(nread < 0) { + if(!curlx_sztouz(rv, pnread)) { int sockerr = SOCKERRNO; if( @@ -1566,8 +1564,6 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, result = CURLE_RECV_ERROR; } } - else - *pnread = (size_t)nread; CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, %zu", len, result, *pnread); if(!result && !ctx->got_first_byte) { From 6c55dd0028b5d12750d185abcae015aad2177a93 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 12:28:01 +0100 Subject: [PATCH 460/885] vquic: eliminate size_t casts Use new curlx_sotouz_fits() instead. Closes #19624 --- lib/vquic/vquic.c | 49 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 33f7fe092ba0..539d9bfeae36 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -34,6 +34,7 @@ #include "../bufq.h" #include "../curlx/dynbuf.h" #include "../curlx/fopen.h" +#include "../curlx/warnless.h" #include "../cfilters.h" #include "../curl_trc.h" #include "curl_ngtcp2.h" @@ -128,7 +129,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, #ifdef HAVE_SENDMSG struct iovec msg_iov; struct msghdr msg = {0}; - ssize_t sent; + ssize_t rv; #if defined(__linux__) && defined(UDP_SEGMENT) uint8_t msg_ctrl[32]; struct cmsghdr *cm; @@ -155,11 +156,11 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, } #endif - while((sent = sendmsg(qctx->sockfd, &msg, 0)) == -1 && + while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR) ; - if(sent == -1) { + if(!curlx_sztouz(rv, psent)) { switch(SOCKERRNO) { case EAGAIN: #if EAGAIN != SOCKEWOULDBLOCK @@ -172,41 +173,41 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, case EIO: if(pktlen > gsolen) { /* GSO failure */ - infof(data, "sendmsg() returned %zd (errno %d); disable GSO", sent, + infof(data, "sendmsg() returned %zd (errno %d); disable GSO", rv, SOCKERRNO); qctx->no_gso = TRUE; return send_packet_no_gso(cf, data, qctx, pkt, pktlen, gsolen, psent); } FALLTHROUGH(); default: - failf(data, "sendmsg() returned %zd (errno %d)", sent, SOCKERRNO); + failf(data, "sendmsg() returned %zd (errno %d)", rv, SOCKERRNO); result = CURLE_SEND_ERROR; goto out; } } - else if(pktlen != (size_t)sent) { - failf(data, "sendmsg() sent only %zd/%zu bytes", sent, pktlen); + else if(pktlen != *psent) { + failf(data, "sendmsg() sent only %zu/%zu bytes", *psent, pktlen); result = CURLE_SEND_ERROR; goto out; } #else - ssize_t sent; + ssize_t rv; (void)gsolen; *psent = 0; - while((sent = CURL_SEND(qctx->sockfd, (const char *)pkt, - (SEND_TYPE_ARG3)pktlen, 0)) == -1 && + while((rv = CURL_SEND(qctx->sockfd, (const char *)pkt, + (SEND_TYPE_ARG3)pktlen, 0)) == -1 && SOCKERRNO == SOCKEINTR) ; - if(sent == -1) { + if(!curlx_sztouz(rv, psent)) { if(SOCKERRNO == EAGAIN || SOCKERRNO == SOCKEWOULDBLOCK) { result = CURLE_AGAIN; goto out; } else { - failf(data, "send() returned %zd (errno %d)", sent, SOCKERRNO); + failf(data, "send() returned %zd (errno %d)", rv, SOCKERRNO); if(SOCKERRNO != SOCKEMSGSIZE) { result = CURLE_SEND_ERROR; goto out; @@ -217,7 +218,6 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, } #endif (void)cf; - *psent = pktlen; out: return result; @@ -506,7 +506,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, while((rc = recvmsg(qctx->sockfd, &msg, 0)) == -1 && (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE)) ; - if(rc == -1) { + if(!curlx_sztouz(rc, &nread)) { if(SOCKERRNO == EAGAIN || SOCKERRNO == SOCKEWOULDBLOCK) { goto out; } @@ -525,7 +525,6 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, goto out; } - nread = (size_t)rc; total_nread += nread; ++calls; @@ -559,19 +558,19 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, int bufsize = (int)sizeof(buf); struct sockaddr_storage remote_addr; socklen_t remote_addrlen = sizeof(remote_addr); - size_t total_nread, pkts, calls = 0; - ssize_t nread; + size_t total_nread, pkts, calls = 0, nread; + ssize_t rv; char errstr[STRERROR_LEN]; CURLcode result = CURLE_OK; DEBUGASSERT(max_pkts > 0); for(pkts = 0, total_nread = 0; pkts < max_pkts;) { - while((nread = recvfrom(qctx->sockfd, (char *)buf, bufsize, 0, - (struct sockaddr *)&remote_addr, - &remote_addrlen)) == -1 && + while((rv = recvfrom(qctx->sockfd, (char *)buf, bufsize, 0, + (struct sockaddr *)&remote_addr, + &remote_addrlen)) == -1 && (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE)) ; - if(nread == -1) { + if(!curlx_sztouz(rv, &nread)) { if(SOCKERRNO == EAGAIN || SOCKERRNO == SOCKEWOULDBLOCK) { CURL_TRC_CF(data, cf, "ingress, recvfrom -> EAGAIN"); goto out; @@ -586,16 +585,16 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, } curlx_strerror(SOCKERRNO, errstr, sizeof(errstr)); failf(data, "QUIC: recvfrom() unexpectedly returned %zd (errno=%d; %s)", - nread, SOCKERRNO, errstr); + rv, SOCKERRNO, errstr); result = CURLE_RECV_ERROR; goto out; } ++pkts; ++calls; - total_nread += (size_t)nread; - result = recv_cb(buf, (size_t)nread, (size_t)nread, - &remote_addr, remote_addrlen, 0, userp); + total_nread += nread; + result = recv_cb(buf, nread, nread, &remote_addr, remote_addrlen, + 0, userp); if(result) goto out; } From ad9b12d4114819b2c0704b89ae48c20033f05f7a Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 11:28:41 +0100 Subject: [PATCH 461/885] httpsrr/altsvc: eliminate size_t casts Treat alpn raw data as unsigned chars, avoids size_t and char* casts. Add method to convert a struct Curl_str to an alpnid. Closes #19621 --- lib/altsvc.c | 9 +++------ lib/connect.c | 17 ++++++++++++----- lib/connect.h | 4 +++- lib/httpsrr.c | 6 +++--- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index 357d3bc2090a..c05dff04e2c1 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -136,10 +136,8 @@ static struct altsvc *altsvc_create(struct Curl_str *srchost, size_t srcport, size_t dstport) { - enum alpnid dstalpnid = - Curl_alpn2alpnid(curlx_str(dstalpn), curlx_strlen(dstalpn)); - enum alpnid srcalpnid = - Curl_alpn2alpnid(curlx_str(srcalpn), curlx_strlen(srcalpn)); + enum alpnid dstalpnid = Curl_str2alpnid(dstalpn); + enum alpnid srcalpnid = Curl_str2alpnid(srcalpn); if(!srcalpnid || !dstalpnid) return NULL; return altsvc_createid(curlx_str(srchost), curlx_strlen(srchost), @@ -545,8 +543,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, do { if(!curlx_str_single(&p, '=')) { /* [protocol]="[host][:port], [protocol]="[host][:port]" */ - enum alpnid dstalpnid = - Curl_alpn2alpnid(curlx_str(&alpn), curlx_strlen(&alpn)); + enum alpnid dstalpnid = Curl_str2alpnid(&alpn); if(!curlx_str_single(&p, '\"')) { struct Curl_str dsthost; curl_off_t port = 0; diff --git a/lib/connect.c b/lib/connect.c index b5de9b4f5eb0..4f9453907b0c 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -66,6 +66,7 @@ #include "sockaddr.h" /* required for Curl_sockaddr_storage */ #include "curlx/inet_ntop.h" #include "curlx/inet_pton.h" +#include "curlx/strparse.h" #include "vtls/vtls.h" /* for vtsl cfilters */ #include "progress.h" #include "curlx/warnless.h" @@ -81,23 +82,29 @@ #if !defined(CURL_DISABLE_ALTSVC) || defined(USE_HTTPSRR) -enum alpnid Curl_alpn2alpnid(const char *name, size_t len) +enum alpnid Curl_alpn2alpnid(const unsigned char *name, size_t len) { if(len == 2) { - if(curl_strnequal(name, "h1", 2)) + if(!memcmp(name, "h1", 2)) return ALPN_h1; - if(curl_strnequal(name, "h2", 2)) + if(!memcmp(name, "h2", 2)) return ALPN_h2; - if(curl_strnequal(name, "h3", 2)) + if(!memcmp(name, "h3", 2)) return ALPN_h3; } else if(len == 8) { - if(curl_strnequal(name, "http/1.1", 8)) + if(!memcmp(name, "http/1.1", 8)) return ALPN_h1; } return ALPN_none; /* unknown, probably rubbish input */ } +enum alpnid Curl_str2alpnid(const struct Curl_str *cstr) +{ + return Curl_alpn2alpnid((const unsigned char *)curlx_str(cstr), + curlx_strlen(cstr)); +} + #endif /* diff --git a/lib/connect.h b/lib/connect.h index ebf756c562bd..b6d9b8e83698 100644 --- a/lib/connect.h +++ b/lib/connect.h @@ -31,8 +31,10 @@ struct Curl_dns_entry; struct ip_quadruple; +struct Curl_str; -enum alpnid Curl_alpn2alpnid(const char *name, size_t len); +enum alpnid Curl_alpn2alpnid(const unsigned char *name, size_t len); +enum alpnid Curl_str2alpnid(const struct Curl_str *str); /* generic function that returns how much time there is left to run, according to the timeouts set */ diff --git a/lib/httpsrr.c b/lib/httpsrr.c index c0392d16c451..0cf5b131bd31 100644 --- a/lib/httpsrr.c +++ b/lib/httpsrr.c @@ -37,7 +37,7 @@ #include "curl_memory.h" #include "memdebug.h" -static CURLcode httpsrr_decode_alpn(const char *cp, size_t len, +static CURLcode httpsrr_decode_alpn(const uint8_t *cp, size_t len, unsigned char *alpns) { /* @@ -49,7 +49,7 @@ static CURLcode httpsrr_decode_alpn(const char *cp, size_t len, int idnum = 0; while(len > 0) { - size_t tlen = (size_t) *cp++; + size_t tlen = *cp++; enum alpnid id; len--; if(tlen > len) @@ -84,7 +84,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data, CURL_TRC_DNS(data, "HTTPS RR MANDATORY left to implement"); break; case HTTPS_RR_CODE_ALPN: /* str_list */ - result = httpsrr_decode_alpn((const char *)val, vlen, hi->alpns); + result = httpsrr_decode_alpn(val, vlen, hi->alpns); CURL_TRC_DNS(data, "HTTPS RR ALPN: %u %u %u %u", hi->alpns[0], hi->alpns[1], hi->alpns[2], hi->alpns[3]); break; From 01623e26d06ecb31121e7c6a2b51871933dc0acc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Nov 2025 18:06:37 +0100 Subject: [PATCH 462/885] http: error on OOM when creating range header Closes #19630 --- lib/http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/http.c b/lib/http.c index a470c04449dd..095a9127a4ee 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2538,6 +2538,8 @@ static CURLcode http_range(struct Curl_easy *data, free(data->state.aptr.rangeline); data->state.aptr.rangeline = curl_maprintf("Range: bytes=%s\r\n", data->state.range); + if(!data->state.aptr.rangeline) + return CURLE_OUT_OF_MEMORY; } else if((httpreq == HTTPREQ_POST || httpreq == HTTPREQ_PUT) && !Curl_checkheaders(data, STRCONST("Content-Range"))) { From 92d9dbe4c008646dd467d23dea963fa32e16cf85 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 19 Nov 2025 16:35:25 +0100 Subject: [PATCH 463/885] INTERNALS: add release dates to the oldest supported dependencies Closes #19611 --- docs/INTERNALS.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index c21d5a9120f6..d957c69ab77a 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -24,19 +24,19 @@ versions of libs and build tools. We aim to support these or later versions. - - OpenSSL 3.0.0 - - LibreSSL 2.9.1 - - GnuTLS 3.1.10 - - mbedTLS 3.2.0 - - zlib 1.2.5.2 - - libssh2 1.9.0 - - c-ares 1.6.0 - - libssh 0.9.0 - - libidn2 2.0.0 - - wolfSSL 3.4.6 - - OpenLDAP 2.0 - - MIT Kerberos 1.3 - - nghttp2 1.15.0 + - OpenSSL 3.0.0 (2021-09-07) + - LibreSSL 2.9.1 (2019-04-22) + - GnuTLS 3.1.10 (2013-03-22) + - mbedTLS 3.2.0 (2022-07-11) + - zlib 1.2.5.2 (2011-12-11) + - libssh2 1.9.0 (2019-06-20) + - c-ares 1.6.0 (2008-12-09) + - libssh 0.9.0 (2019-06-28) + - libidn2 2.0.0 (2017-03-29) + - wolfSSL 3.4.6 (2017-09-22) + - OpenLDAP 2.0 (2000-08-01) + - MIT Kerberos 1.3 (2003-07-31) + - nghttp2 1.15.0 (2016-09-25) ## Build tools From c5ef882e900d8e949ab65cbf0c8e1dd8e967f626 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 16:40:52 +0000 Subject: [PATCH 464/885] GHA: update actions/checkout action to v6 from v5 Closes #19628 --- .github/workflows/checkdocs.yml | 10 +++++----- .github/workflows/checksrc.yml | 10 +++++----- .github/workflows/codeql.yml | 4 ++-- .github/workflows/configure-vs-cmake.yml | 6 +++--- .github/workflows/curl-for-win.yml | 12 ++++++------ .github/workflows/distcheck.yml | 8 ++++---- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux-old.yml | 2 +- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 6 +++--- .github/workflows/non-native.yml | 8 ++++---- .github/workflows/windows.yml | 10 +++++----- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index 8caf9479fde5..6f67b44fca89 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -95,7 +95,7 @@ jobs: name: 'linkcheck' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -106,7 +106,7 @@ jobs: name: 'pyspelling' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -135,7 +135,7 @@ jobs: name: 'badwords, synopsis' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -149,7 +149,7 @@ jobs: name: 'man-examples' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -161,7 +161,7 @@ jobs: runs-on: ubuntu-24.04-arm timeout-minutes: 5 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 607661735679..32f825214d6c 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -38,7 +38,7 @@ jobs: name: 'checksrc' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -49,7 +49,7 @@ jobs: name: 'spellcheck, linters, REUSE' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -111,7 +111,7 @@ jobs: sudo apt-get -o Dpkg::Use-Pty=0 install \ pmccabe - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -123,7 +123,7 @@ jobs: runs-on: macos-latest timeout-minutes: 1 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -142,7 +142,7 @@ jobs: - name: 'install prereqs' run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 87a041563c82..c7b6383cf1dc 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -45,7 +45,7 @@ jobs: permissions: security-events: write # To create/update security events steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -82,7 +82,7 @@ jobs: libnghttp2-dev libldap-dev libkrb5-dev librtmp-dev libgnutls28-dev libwolfssl-dev HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install c-ares gsasl libnghttp3 libngtcp2 mbedtls rustls-ffi - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/configure-vs-cmake.yml b/.github/workflows/configure-vs-cmake.yml index ade83e0c6028..53775a44fd83 100644 --- a/.github/workflows/configure-vs-cmake.yml +++ b/.github/workflows/configure-vs-cmake.yml @@ -41,7 +41,7 @@ jobs: name: 'Linux' runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -88,7 +88,7 @@ jobs: - name: 'toolchain versions' run: echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::' - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -137,7 +137,7 @@ jobs: sudo rm -f /var/lib/man-db/auto-update sudo apt-get -o Dpkg::Use-Pty=0 install gcc-mingw-w64-x86-64-win32 - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/curl-for-win.yml b/.github/workflows/curl-for-win.yml index a068f773d58d..f0214b2874cb 100644 --- a/.github/workflows/curl-for-win.yml +++ b/.github/workflows/curl-for-win.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: 'curl' @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: 'curl' @@ -103,7 +103,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: 'curl' @@ -132,7 +132,7 @@ jobs: env: CW_JOBS: '4' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: 'curl' @@ -150,7 +150,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: 'curl' @@ -177,7 +177,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: 'curl' diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index fef5de4f7b97..442a7f18a10c 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -214,7 +214,7 @@ jobs: timeout-minutes: 5 needs: maketgz-and-verify-in-tree steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -230,7 +230,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -302,7 +302,7 @@ jobs: printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Darwin-x86_64/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt fi - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 007f34612732..ff32e6c5d9d9 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -594,7 +594,7 @@ jobs: # lib dir # /home/runner/quiche/quiche/deps/boringssl/src/lib - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index 8ac42855e03a..f79cee94ac36 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -80,7 +80,7 @@ jobs: httrack --get https://deb.freexian.com/extended-lts/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 39f7a4b13ae0..a6823b4c9da4 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -662,7 +662,7 @@ jobs: source /opt/intel/oneapi/setvars.sh printenv >> "$GITHUB_ENV" - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 739809d47a95..cd72073155c3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -135,7 +135,7 @@ jobs: cmake --build . cmake --install . --verbose - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -383,7 +383,7 @@ jobs: echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::' - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -606,7 +606,7 @@ jobs: echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' echo '::group::brew packages preinstalled'; ls -l /opt/homebrew/opt; echo '::endgroup::' - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 7813c694a5d8..d05a0791a731 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -47,7 +47,7 @@ jobs: matrix: arch: ['x86_64'] steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: 'cmake' @@ -92,7 +92,7 @@ jobs: matrix: arch: ['x86_64'] steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: 'cmake' @@ -142,7 +142,7 @@ jobs: - { build: 'cmake' , arch: 'arm64' , compiler: 'clang' } fail-fast: false steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: '${{ matrix.build }}' @@ -261,7 +261,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 15a586b12fc7..d4019ed176cb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -75,7 +75,7 @@ jobs: libnghttp2-devel ${{ matrix.install }} - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -247,7 +247,7 @@ jobs: mingw-w64-${{ matrix.env }}-c-ares ${{ matrix.install }} - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -500,7 +500,7 @@ jobs: rm -r -f pack.bin ls -l - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -613,7 +613,7 @@ jobs: sudo rm -f /var/lib/man-db/auto-update sudo apt-get -o Dpkg::Use-Pty=0 install gcc-mingw-w64-x86-64-win32 - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -802,7 +802,7 @@ jobs: timeout-minutes: 45 run: vcpkg x-set-installed ${MATRIX_INSTALL_VCPKG} --triplet="${MATRIX_ARCH}-${MATRIX_PLAT}" - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false From 5f273fdddf76544de960bf342844a9d3f2a36392 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Nov 2025 09:58:14 +0100 Subject: [PATCH 465/885] tool_urlglob: clean up used memory on errors better Previously it had to realloc the pattern array to store the last entry even when that last entry triggered an error and could be only half filled in. Also cleaned up for readability and better reallocs for sets. Reported-by: letshack9707 on hackerone Closes #19614 --- src/tool_urlglob.c | 202 ++++++++++++++++++++++++++------------------- src/tool_urlglob.h | 3 +- 2 files changed, 121 insertions(+), 84 deletions(-) diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index 4a28376e1444..7185e80f66b1 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -40,21 +40,24 @@ static CURLcode globerror(struct URLGlob *glob, const char *err, static CURLcode glob_fixed(struct URLGlob *glob, char *fixed, size_t len) { - struct URLPattern *pat = &glob->pattern[glob->size]; + struct URLPattern *pat = &glob->pattern[glob->pnum]; pat->type = GLOB_SET; - pat->c.set.size = 1; - pat->c.set.idx = 0; pat->globindex = -1; - + pat->c.set.size = 0; + pat->c.set.idx = 0; pat->c.set.elem = malloc(sizeof(char *)); if(!pat->c.set.elem) return globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); pat->c.set.elem[0] = memdup0(fixed, len); - if(!pat->c.set.elem[0]) + if(!pat->c.set.elem[0]) { + tool_safefree(pat->c.set.elem); return globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); + } + pat->c.set.palloc = 1; + pat->c.set.size = 1; return CURLE_OK; } @@ -98,59 +101,66 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, const char *pattern = *patternp; const char *opattern = pattern; size_t opos = *posp-1; - - pat = &glob->pattern[glob->size]; - /* patterns 0,1,2,... correspond to size=1,3,5,... */ - pat->type = GLOB_SET; - pat->c.set.size = 0; - pat->c.set.idx = 0; - pat->c.set.elem = NULL; - pat->globindex = globindex; + CURLcode result = CURLE_OK; + size_t size = 0; + char **elem = NULL; + size_t palloc = 0; /* start with this */ while(!done) { switch(*pattern) { case '\0': /* URL ended while set was still open */ - return globerror(glob, "unmatched brace", opos, CURLE_URL_MALFORMAT); + result = globerror(glob, "unmatched brace", opos, CURLE_URL_MALFORMAT); + goto error; case '{': case '[': /* no nested expressions at this time */ - return globerror(glob, "nested brace", *posp, CURLE_URL_MALFORMAT); + result = globerror(glob, "nested brace", *posp, CURLE_URL_MALFORMAT); + goto error; case '}': /* set element completed */ - if(opattern == pattern) - return globerror(glob, "empty string within braces", *posp, - CURLE_URL_MALFORMAT); + if(opattern == pattern) { + result = globerror(glob, "empty string within braces", *posp, + CURLE_URL_MALFORMAT); + goto error; + } /* add 1 to size since it will be incremented below */ - if(multiply(amount, pat->c.set.size + 1)) - return globerror(glob, "range overflow", 0, CURLE_URL_MALFORMAT); + if(multiply(amount, size + 1)) { + result = globerror(glob, "range overflow", 0, CURLE_URL_MALFORMAT); + goto error; + } done = TRUE; FALLTHROUGH(); case ',': - if(pat->c.set.elem) { - char **arr; - - if(pat->c.set.size >= (curl_off_t)(SIZE_MAX/(sizeof(char *)))) - return globerror(glob, "range overflow", 0, CURLE_URL_MALFORMAT); - - arr = realloc(pat->c.set.elem, (size_t)(pat->c.set.size + 1) * - sizeof(char *)); - if(!arr) - return globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); + if(size >= 100000) + return globerror(glob, "range overflow", 0, CURLE_URL_MALFORMAT); - pat->c.set.elem = arr; + if(!palloc) { + palloc = 5; /* a reasonable default */ + elem = malloc(palloc * sizeof(char *)); + } + else if(size >= palloc) { + char **arr = realloc(elem, palloc * 2 * sizeof(char *)); + if(!arr) { + result = globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); + goto error; + } + elem = arr; + palloc *= 2; } - else - pat->c.set.elem = malloc(sizeof(char *)); - if(!pat->c.set.elem) - return globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); + if(!elem) { + result = globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); + goto error; + } - pat->c.set.elem[pat->c.set.size] = strdup(curlx_dyn_ptr(&glob->buf) ? - curlx_dyn_ptr(&glob->buf): ""); - if(!pat->c.set.elem[pat->c.set.size]) - return globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); - ++pat->c.set.size; + elem[size] = + strdup(curlx_dyn_ptr(&glob->buf) ? curlx_dyn_ptr(&glob->buf) : ""); + if(!elem[size]) { + result = globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); + goto error; + } + ++size; curlx_dyn_reset(&glob->buf); ++pattern; @@ -159,8 +169,9 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, break; case ']': /* illegal closing bracket */ - return globerror(glob, "unexpected close bracket", *posp, - CURLE_URL_MALFORMAT); + result = globerror(glob, "unexpected close bracket", *posp, + CURLE_URL_MALFORMAT); + goto error; case '\\': /* escaped character, skip '\' */ if(pattern[1]) { @@ -170,14 +181,33 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, FALLTHROUGH(); default: /* copy character to set element */ - if(curlx_dyn_addn(&glob->buf, pattern++, 1)) - return CURLE_OUT_OF_MEMORY; + if(curlx_dyn_addn(&glob->buf, pattern++, 1)) { + result = CURLE_OUT_OF_MEMORY; + goto error; + } ++(*posp); } } *patternp = pattern; /* return with the new position */ + + pat = &glob->pattern[glob->pnum]; + pat->type = GLOB_SET; + pat->globindex = globindex; + pat->c.set.elem = elem; + pat->c.set.size = size; + pat->c.set.idx = 0; + pat->c.set.palloc = palloc; + return CURLE_OK; +error: + { + size_t i; + for(i = 0; i < size; i++) + tool_safefree(elem[i]); + } + free(elem); + return result; } static CURLcode glob_range(struct URLGlob *glob, const char **patternp, @@ -194,7 +224,7 @@ static CURLcode glob_range(struct URLGlob *glob, const char **patternp, const char *pattern = *patternp; const char *c; - pat = &glob->pattern[glob->size]; + pat = &glob->pattern[glob->pnum]; pat->globindex = globindex; if(ISALPHA(*pattern)) { @@ -349,6 +379,25 @@ static bool peek_ipv6(const char *str, size_t *skip) return rc ? FALSE : TRUE; } +static CURLcode add_glob(struct URLGlob *glob, size_t pos) +{ + DEBUGASSERT(glob->pattern[glob->pnum].type); + + if(++glob->pnum >= glob->palloc) { + struct URLPattern *np = NULL; + glob->palloc *= 2; + if(glob->pnum < 255) { /* avoid ridiculous amounts */ + np = realloc(glob->pattern, glob->palloc * sizeof(struct URLPattern)); + if(!np) + return globerror(glob, NULL, pos, CURLE_OUT_OF_MEMORY); + } + else + return globerror(glob, "too many {} sets", pos, CURLE_URL_MALFORMAT); + glob->pattern = np; + } + return CURLE_OK; +} + static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, size_t pos, curl_off_t *amount) { @@ -381,8 +430,8 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, /* only allow \ to escape known "special letters" */ if(*pattern == '\\' && - (*(pattern + 1) == '{' || *(pattern + 1) == '[' || - *(pattern + 1) == '}' || *(pattern + 1) == ']') ) { + (pattern[1] == '{' || pattern[1] == '[' || + pattern[1] == '}' || pattern[1] == ']') ) { /* escape character, skip '\' */ ++pattern; @@ -397,41 +446,30 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, /* we got a literal string, add it as a single-item list */ res = glob_fixed(glob, curlx_dyn_ptr(&glob->buf), curlx_dyn_len(&glob->buf)); + if(!res) + res = add_glob(glob, pos); curlx_dyn_reset(&glob->buf); } else { - switch(*pattern) { - case '\0': /* done */ + if(!*pattern) /* done */ break; - - case '{': + else if(*pattern =='{') { /* process set pattern */ pattern++; pos++; res = glob_set(glob, &pattern, &pos, amount, globindex++); - break; - - case '[': + if(!res) + res = add_glob(glob, pos); + } + else if(*pattern == '[') { /* process range pattern */ pattern++; pos++; res = glob_range(glob, &pattern, &pos, amount, globindex++); - break; + if(!res) + res = add_glob(glob, pos); } } - - if(++glob->size >= glob->palloc) { - struct URLPattern *np = NULL; - glob->palloc *= 2; - if(glob->size < 255) { /* avoid ridiculous amounts */ - np = realloc(glob->pattern, glob->palloc * sizeof(struct URLPattern)); - if(!np) - return globerror(glob, NULL, pos, CURLE_OUT_OF_MEMORY); - } - else - return globerror(glob, "too many {} sets", pos, CURLE_URL_MALFORMAT); - glob->pattern = np; - } } return res; } @@ -459,9 +497,7 @@ CURLcode glob_url(struct URLGlob *glob, char *url, curl_off_t *urlnum, glob->palloc = 2; res = glob_parse(glob, url, 1, &amount); - if(!res) - *urlnum = amount; - else { + if(res) { if(error && glob->error) { char text[512]; const char *t; @@ -477,25 +513,24 @@ CURLcode glob_url(struct URLGlob *glob, char *url, curl_off_t *urlnum, /* send error description to the error-stream */ curl_mfprintf(error, "curl: (%d) %s\n", res, t); } - /* it failed, we cleanup */ - glob_cleanup(glob); *urlnum = 1; return res; } - + *urlnum = amount; return CURLE_OK; } void glob_cleanup(struct URLGlob *glob) { size_t i; - curl_off_t elem; if(glob->pattern) { - for(i = 0; i < glob->size; i++) { + for(i = 0; i < glob->pnum; i++) { + DEBUGASSERT(glob->pattern[i].type); if((glob->pattern[i].type == GLOB_SET) && (glob->pattern[i].c.set.elem)) { - for(elem = glob->pattern[i].c.set.size - 1; elem >= 0; --elem) + curl_off_t elem; + for(elem = 0; elem < glob->pattern[i].c.set.size; elem++) tool_safefree(glob->pattern[i].c.set.elem[elem]); tool_safefree(glob->pattern[i].c.set.elem); } @@ -521,9 +556,9 @@ CURLcode glob_next_url(char **globbed, struct URLGlob *glob) /* implement a counter over the index ranges of all patterns, starting with the rightmost pattern */ - for(i = 0; carry && (i < glob->size); i++) { + for(i = 0; carry && (i < glob->pnum); i++) { carry = FALSE; - pat = &glob->pattern[glob->size - 1 - i]; + pat = &glob->pattern[glob->pnum - 1 - i]; switch(pat->type) { case GLOB_SET: if((pat->c.set.elem) && (++pat->c.set.idx == pat->c.set.size)) { @@ -555,7 +590,7 @@ CURLcode glob_next_url(char **globbed, struct URLGlob *glob) } } - for(i = 0; i < glob->size; ++i) { + for(i = 0; i < glob->pnum; ++i) { pat = &glob->pattern[i]; switch(pat->type) { case GLOB_SET: @@ -581,7 +616,8 @@ CURLcode glob_next_url(char **globbed, struct URLGlob *glob) } } - *globbed = strdup(curlx_dyn_ptr(&glob->buf)); + *globbed = + strdup(curlx_dyn_ptr(&glob->buf) ? curlx_dyn_ptr(&glob->buf) : ""); if(!*globbed) return CURLE_OUT_OF_MEMORY; @@ -605,11 +641,11 @@ CURLcode glob_match_url(char **output, const char *filename, curl_off_t num; struct URLPattern *pat = NULL; filename++; - if(!curlx_str_number(&filename, &num, glob->size) && num) { + if(!curlx_str_number(&filename, &num, glob->pnum) && num) { size_t i; num--; /* make it zero based */ /* find the correct glob entry */ - for(i = 0; i < glob->size; i++) { + for(i = 0; i < glob->pnum; i++) { if(glob->pattern[i].globindex == (int)num) { pat = &glob->pattern[i]; break; diff --git a/src/tool_urlglob.h b/src/tool_urlglob.h index 4bcf229eccea..d0a807f79600 100644 --- a/src/tool_urlglob.h +++ b/src/tool_urlglob.h @@ -40,6 +40,7 @@ struct URLPattern { char **elem; curl_off_t size; curl_off_t idx; + size_t palloc; /* elem entries allocated */ } set; struct { int min; @@ -64,7 +65,7 @@ struct URLGlob { struct dynbuf buf; struct URLPattern *pattern; size_t palloc; /* number of pattern entries allocated */ - size_t size; + size_t pnum; /* number of patterns used */ char beenhere; const char *error; /* error message */ size_t pos; /* column position of error or 0 */ From 7a22141de1a3a1be9d01bdf84f11b4b761604b51 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 11:12:53 +0100 Subject: [PATCH 466/885] file: eliminate size_t cast Use curlx_sztouz() instead. Closes #19620 --- lib/file.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/file.c b/lib/file.c index 5fff5d0a82f0..826bed6d802c 100644 --- a/lib/file.c +++ b/lib/file.c @@ -373,8 +373,8 @@ static CURLcode file_upload(struct Curl_easy *data, goto out; while(!result && !eos) { - size_t nread; - ssize_t nwrite; + size_t nread, nwritten; + ssize_t rv; size_t readcount; result = Curl_client_read(data, xfer_ulbuf, xfer_ulblen, &readcount, &eos); @@ -403,13 +403,12 @@ static CURLcode file_upload(struct Curl_easy *data, sendbuf = xfer_ulbuf; /* write the data to the target */ - nwrite = write(fd, sendbuf, nread); - if((size_t)nwrite != nread) { + rv = write(fd, sendbuf, nread); + if(!curlx_sztouz(rv, &nwritten) || (nwritten != nread)) { result = CURLE_SEND_ERROR; break; } - - bytecount += nread; + bytecount += nwritten; Curl_pgrsSetUploadCounter(data, bytecount); From de1a6f80ebfa72e9e9bd6de70b38f88e88f3e027 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 12:12:52 +0100 Subject: [PATCH 467/885] quiche: eliminate size_t casts Use new curlx_sotouz_fits() instead. Remove an unnecessary cast in osslq code while we are here. Closes #19623 --- lib/vquic/curl_osslq.c | 2 +- lib/vquic/curl_quiche.c | 72 +++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 68666d591505..f447e8dddf0f 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -777,7 +777,7 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf, return result; if(!flow) - stream->recv_buf_nonflow += (size_t)nwritten; + stream->recv_buf_nonflow += nwritten; if(nwritten < memlen) { /* This MUST not happen. Our recbuf is dimensioned to hold the diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 0ab7e0c296d0..4fc25acad038 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -47,6 +47,7 @@ #include "../transfer.h" #include "../url.h" #include "../curlx/inet_pton.h" +#include "../curlx/warnless.h" #include "../vtls/openssl.h" #include "../vtls/keylog.h" #include "../vtls/vtls.h" @@ -408,12 +409,9 @@ static CURLcode stream_resp_read(void *reader_ctx, return CURLE_RECV_ERROR; nread = quiche_h3_recv_body(ctx->h3c, ctx->qconn, stream->id, buf, len); - if(nread >= 0) { - *pnread = (size_t)nread; - return CURLE_OK; - } - else + if(!curlx_sztouz(nread, pnread)) return CURLE_AGAIN; + return CURLE_OK; } static CURLcode cf_recv_body(struct Curl_cfilter *cf, @@ -633,8 +631,8 @@ static CURLcode cf_quiche_recv_pkts(const unsigned char *buf, size_t buflen, struct recv_ctx *r = userp; struct cf_quiche_ctx *ctx = r->cf->ctx; quiche_recv_info recv_info; - size_t pktlen, offset; - ssize_t nread; + size_t pktlen, offset, nread; + ssize_t rv; (void)ecn; @@ -645,11 +643,11 @@ static CURLcode cf_quiche_recv_pkts(const unsigned char *buf, size_t buflen, for(offset = 0; offset < buflen; offset += gso_size) { pktlen = ((offset + gso_size) <= buflen) ? gso_size : (buflen - offset); - nread = quiche_conn_recv(ctx->qconn, - (unsigned char *)CURL_UNCONST(buf + offset), - pktlen, &recv_info); - if(nread < 0) { - if(QUICHE_ERR_DONE == nread) { + rv = quiche_conn_recv(ctx->qconn, + (unsigned char *)CURL_UNCONST(buf + offset), + pktlen, &recv_info); + if(!curlx_sztouz(rv, &nread)) { + if(QUICHE_ERR_DONE == rv) { if(quiche_conn_is_draining(ctx->qconn)) { CURL_TRC_CF(r->data, r->cf, "ingress, connection is draining"); return CURLE_RECV_ERROR; @@ -661,7 +659,7 @@ static CURLcode cf_quiche_recv_pkts(const unsigned char *buf, size_t buflen, CURL_TRC_CF(r->data, r->cf, "ingress, quiche is DONE"); return CURLE_OK; } - else if(QUICHE_ERR_TLS_FAIL == nread) { + else if(QUICHE_ERR_TLS_FAIL == rv) { long verify_ok = SSL_get_verify_result(ctx->tls.ossl.ssl); if(verify_ok != X509_V_OK) { failf(r->data, "SSL certificate problem: %s", @@ -672,12 +670,12 @@ static CURLcode cf_quiche_recv_pkts(const unsigned char *buf, size_t buflen, return CURLE_RECV_ERROR; } else { - failf(r->data, "quiche reports error %zd on receive", nread); + failf(r->data, "quiche reports error %zd on receive", rv); return CURLE_RECV_ERROR; } } - else if((size_t)nread < pktlen) { - CURL_TRC_CF(r->data, r->cf, "ingress, quiche only read %zd/%zu bytes", + else if(nread < pktlen) { + CURL_TRC_CF(r->data, r->cf, "ingress, quiche only read %zu/%zu bytes", nread, pktlen); } ++r->pkts; @@ -728,18 +726,17 @@ static CURLcode read_pkt_to_send(void *userp, { struct read_ctx *x = userp; struct cf_quiche_ctx *ctx = x->cf->ctx; - ssize_t n; + ssize_t rv; *pnread = 0; - n = quiche_conn_send(ctx->qconn, buf, buflen, &x->send_info); - if(n == QUICHE_ERR_DONE) + rv = quiche_conn_send(ctx->qconn, buf, buflen, &x->send_info); + if(rv == QUICHE_ERR_DONE) return CURLE_AGAIN; - if(n < 0) { - failf(x->data, "quiche_conn_send returned %zd", n); + if(!curlx_sztouz(rv, pnread)) { + failf(x->data, "quiche_conn_send returned %zd", rv); return CURLE_SEND_ERROR; } - *pnread = (size_t)n; return CURLE_OK; } @@ -924,12 +921,12 @@ static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf, size_t *pnwritten) { struct cf_quiche_ctx *ctx = cf->ctx; - ssize_t nwritten; + ssize_t rv; *pnwritten = 0; - nwritten = quiche_h3_send_body(ctx->h3c, ctx->qconn, stream->id, - (uint8_t *)CURL_UNCONST(buf), len, eos); - if(nwritten == QUICHE_H3_ERR_DONE || (nwritten == 0 && len > 0)) { + rv = quiche_h3_send_body(ctx->h3c, ctx->qconn, stream->id, + (uint8_t *)CURL_UNCONST(buf), len, eos); + if(rv == QUICHE_H3_ERR_DONE || (rv == 0 && len > 0)) { /* Blocked on flow control and should HOLD sending. But when do we open * again? */ if(!quiche_conn_stream_writable(ctx->qconn, stream->id, len)) { @@ -939,28 +936,27 @@ static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf, } return CURLE_AGAIN; } - else if(nwritten == QUICHE_H3_TRANSPORT_ERR_INVALID_STREAM_STATE) { + else if(rv == QUICHE_H3_TRANSPORT_ERR_INVALID_STREAM_STATE) { CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " "-> invalid stream state", stream->id, len); return CURLE_HTTP3; } - else if(nwritten == QUICHE_H3_TRANSPORT_ERR_FINAL_SIZE) { + else if(rv == QUICHE_H3_TRANSPORT_ERR_FINAL_SIZE) { CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " "-> exceeds size", stream->id, len); return CURLE_SEND_ERROR; } - else if(nwritten < 0) { + else if(!curlx_sztouz(rv, pnwritten)) { CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " - "-> quiche err %zd", stream->id, len, nwritten); + "-> quiche err %zd", stream->id, len, rv); return CURLE_SEND_ERROR; } else { - if(eos && (len == (size_t)nwritten)) + if(eos && (len == *pnwritten)) stream->send_closed = TRUE; CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send body(len=%zu, " - "eos=%d) -> %zd", - stream->id, len, stream->send_closed, nwritten); - *pnwritten = (size_t)nwritten; + "eos=%d) -> %zu", + stream->id, len, stream->send_closed, *pnwritten); return CURLE_OK; } } @@ -1068,15 +1064,15 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, } if(blen) { /* after the headers, there was request BODY data */ - size_t bwritten; + size_t nwritten; CURLcode r2 = CURLE_OK; - r2 = cf_quiche_send_body(cf, data, stream, buf, blen, eos, &bwritten); + r2 = cf_quiche_send_body(cf, data, stream, buf, blen, eos, &nwritten); if(r2 && (CURLE_AGAIN != r2)) { /* real error, fail */ result = r2; } - else if(bwritten > 0) { - *pnwritten += (size_t)bwritten; + else if(nwritten > 0) { + *pnwritten += nwritten; } } From 8e1c7165bc25a440ebd80664048ae25fecbd7f0f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Nov 2025 22:42:32 +0100 Subject: [PATCH 468/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 87 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e24762bafde4..698357e43be3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3541 + Contributors: 3546 This release includes the following changes: @@ -15,50 +15,72 @@ This release includes the following changes: This release includes the following bugfixes: o _PROGRESS.md: add the E unit, mention kibibyte [24] + o AmigaOS: increase minimum stack size for tool_main [137] o asyn-thrdd: release rrname if ares_init_options fails [41] o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] + o badwords: fix issues found in scripts and other files [142] + o badwords: fix issues found in tests [156] + o build: exclude clang prereleases from compiler warning options [154] + o build: tidy-up MSVC CRT warning suppression macros [140] o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74] o cf-https-connect: allocate ctx at first in cf_hc_create() [79] + o cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime [157] o cf-socket: trace ignored errors [97] o checksrc.pl: detect assign followed by more than one space [26] o cmake: adjust defaults for target platforms not supporting shared libs [35] o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] + o cmake: honor `CURL_DISABLE_INSTALL` and `CURL_ENABLE_EXPORT_TARGET` [106] o code: minor indent fixes before closing braces [107] o config2setopts: bail out if curl_url_get() returns OOM [102] o config2setopts: exit if curl_url_set() fails on OOM [105] o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100] o cookie: propagate errors better, cleanup the internal API [118] + o cookie: return error on OOM [131] o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] + o curl_sasl: make Curl_sasl_decode_mech compare case insenstively [160] + o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124] o curl_setup.h: drop stray `#undef stat` (Windows) [103] o CURLINFO: remove 'get' and 'get the' from each short desc [50] o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48] o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example + o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] + o DISTROS.md: add OpenBSD [126] o docs: fix checksrc `EQUALSPACE` warnings [21] o docs: mention umask need when curl creates files [56] o examples/crawler: fix variable [92] o examples/multithread: fix race condition [101] + o examples: make functions/data static where missing [139] + o examples: tidy-up headers and includes [138] o ftp: refactor a piece of code by merging the repeated part [40] o ftp: remove #ifdef for define that is always defined [76] o getinfo: improve perf in debug mode [99] o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] o gtls: skip session resumption when verifystatus is set + o h2/h3: handle methods with spaces [146] o hostip: don't store negative lookup on OOM [61] + o hsts: propagate and error out correctly on OOM [130] + o http: avoid two strdup()s and do minor simplifications [144] + o http: error on OOM when creating range header [59] o http: replace atoi use in Curl_http_follow with curlx_str_number [65] + o http: the :authority header should never contain user+password [147] o INSTALL-CMAKE.md: document static option defaults more [37] o krb5_sspi: unify a part of error handling [80] o lib: cleanup for some typos about spaces and code style [3] o lib: eliminate size_t casts [112] + o lib: error for OOM when extracting URL query [127] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] - o libtests: replace `atoi()` with `curlx_str_number()` [120] + o libssh2: add paths to error messages for quote commands [114] o libssh2: cleanup ssh_force_knownhost_key_type [64] o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] + o libssh: properly free sftp_attributes [153] + o libtests: replace `atoi()` with `curlx_str_number()` [120] o limit-rate: add example using --limit-rate and --max-time together [89] o m4/sectrust: fix test(1) operator [4] o mbedtls: fix potential use of uninitialized `nread` [8] @@ -66,12 +88,17 @@ This release includes the following bugfixes: o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] o noproxy: replace atoi with curlx_str_number [67] + o openssl: exit properly on OOM when getting certchain [133] + o openssl: fix a potential memory leak of bio_out [150] + o openssl: fix a potential memory leak of params.cert [151] o openssl: release ssl_session if sess_reuse_cb fails [43] o openssl: remove code handling default version [28] o OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs [94] o OS400/makefile.sh: fix shellcheck warning SC2038 [86] o osslq: code readability [5] o progress: show fewer digits [78] + o projects/README.md: Markdown fixes [148] + o pytest fixes and improvements [159] o pytest: skip H2 tests if feature missing from curl [46] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] @@ -81,6 +108,7 @@ This release includes the following bugfixes: o rustls: minor adjustment of sizeof() [38] o schannel: fix memory leak of cert_store_path on four error paths [23] o schannel: replace atoi() with curlx_str_number() [119] + o schannel_verify: fix a memory leak of cert_context [152] o scripts: fix shellcheck SC2046 warnings [90] o scripts: use end-of-options marker in `find -exec` commands [87] o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] @@ -88,6 +116,7 @@ This release includes the following bugfixes: o sftp: fix range downloads in both SSH backends [82] o socks_sspi: use free() not FreeContextBuffer() [93] o telnet: replace atoi for BINARY handling with curlx_str_number [66] + o TEST-SUITE.md: correct the man page's path [136] o test07_22: fix flakiness [95] o test2045: replace HTML multi-line comment markup with `#` comments [36] o test363: delete stray character (typo) from a section tag [52] @@ -96,13 +125,18 @@ This release includes the following bugfixes: o tests/server: do not fall back to original data file in `test2fopen()` [32] o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110] o tftp: release filename if conn_get_remote_addr fails [42] + o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] o tool: consider (some) curl_easy_setopt errors fatal [7] + o tool_cfgable: free ssl-sessions at exit [123] + o tool_getparam: verify that a file exists for some options [134] o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] o tool_operate: exit on curl_share_setopt errors [108] o tool_operate: remove redundant condition [19] o tool_operate: use curlx_str_number instead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] + o tool_urlglob: clean up used memory on errors better [44] + o url: if OOM in parse_proxy() return error [132] o urlapi: fix mem-leaks in curl_url_get error paths [22] o verify-release: update to avoid shellcheck warning SC2034 [88] o vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally [96] @@ -134,13 +168,14 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Aleksandr Sergeev, Andrew Kirillov, Brad King, Dan Fandrich, Daniel McCarney, - Daniel Stenberg, Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang, - Juliusz Sosinowicz, Leonardo Taccari, nait-furry, Nick Korepanov, - Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot], - Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner, - Viktor Szakats, Xiaoke Wang - (23 contributors) + Aleksandr Sergeev, Andrew Kirillov, boingball, Brad King, Christian Schmitz, + Dan Fandrich, Daniel McCarney, Daniel Stenberg, Fd929c2CE5fA on github, + Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Leonardo Taccari, + letshack9707 on hackerone, Marcel Raad, nait-furry, Nick Korepanov, + Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro, + renovate[bot], Samuel Henrique, Stanislav Fort, Stefan Eissing, + Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang + (29 contributors) References to bug reports and discussions on issues: @@ -185,6 +220,7 @@ References to bug reports and discussions on issues: [41] = https://curl.se/bug/?i=19410 [42] = https://curl.se/bug/?i=19409 [43] = https://curl.se/bug/?i=19405 + [44] = https://curl.se/bug/?i=19614 [45] = https://curl.se/bug/?i=19544 [46] = https://curl.se/bug/?i=19412 [47] = https://curl.se/bug/?i=19402 @@ -197,6 +233,7 @@ References to bug reports and discussions on issues: [54] = https://curl.se/bug/?i=19399 [55] = https://curl.se/bug/?i=19336 [56] = https://curl.se/bug/?i=19396 + [59] = https://curl.se/bug/?i=19630 [60] = https://curl.se/bug/?i=18330 [61] = https://curl.se/bug/?i=19484 [62] = https://curl.se/bug/?i=17931 @@ -237,11 +274,43 @@ References to bug reports and discussions on issues: [102] = https://curl.se/bug/?i=19518 [103] = https://curl.se/bug/?i=19519 [105] = https://curl.se/bug/?i=19517 + [106] = https://curl.se/bug/?i=19144 [107] = https://curl.se/bug/?i=19512 [108] = https://curl.se/bug/?i=19513 [110] = https://curl.se/bug/?i=19510 [111] = https://curl.se/bug/?i=19509 [112] = https://curl.se/bug/?i=19495 + [114] = https://curl.se/bug/?i=19605 [118] = https://curl.se/bug/?i=19493 [119] = https://curl.se/bug/?i=19483 [120] = https://curl.se/bug/?i=19506 + [121] = https://curl.se/bug/?i=19606 + [123] = https://curl.se/bug/?i=19602 + [124] = https://curl.se/bug/?i=19597 + [126] = https://curl.se/bug/?i=19596 + [127] = https://curl.se/bug/?i=19594 + [130] = https://curl.se/bug/?i=19593 + [131] = https://curl.se/bug/?i=19591 + [132] = https://curl.se/bug/?i=19590 + [133] = https://curl.se/bug/?i=19471 + [134] = https://curl.se/bug/?i=19583 + [136] = https://curl.se/bug/?i=19586 + [137] = https://curl.se/bug/?i=19578 + [138] = https://curl.se/bug/?i=19580 + [139] = https://curl.se/bug/?i=19579 + [140] = https://curl.se/bug/?i=19175 + [142] = https://curl.se/bug/?i=19572 + [144] = https://curl.se/bug/?i=19571 + [146] = https://curl.se/bug/?i=19543 + [147] = https://curl.se/bug/?i=19568 + [148] = https://curl.se/bug/?i=19569 + [149] = https://curl.se/bug/?i=19567 + [150] = https://curl.se/bug/?i=19561 + [151] = https://curl.se/bug/?i=19560 + [152] = https://curl.se/bug/?i=19556 + [153] = https://curl.se/bug/?i=19564 + [154] = https://curl.se/bug/?i=19566 + [156] = https://curl.se/bug/?i=19541 + [157] = https://curl.se/bug/?i=19520 + [159] = https://curl.se/bug/?i=19540 + [160] = https://curl.se/bug/?i=19535 From 51f5d30a36a42f3ee73a1024500fee5dc6e931fe Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Nov 2025 23:59:10 +0100 Subject: [PATCH 469/885] RELEASE-NOTES: spellfix --- RELEASE-NOTES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 698357e43be3..3af5605c8dc6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -39,7 +39,7 @@ This release includes the following bugfixes: o cookie: return error on OOM [131] o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] - o curl_sasl: make Curl_sasl_decode_mech compare case insenstively [160] + o curl_sasl: make Curl_sasl_decode_mech compare case insensitively [160] o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124] o curl_setup.h: drop stray `#undef stat` (Windows) [103] o CURLINFO: remove 'get' and 'get the' from each short desc [50] From 27a7cf40bb7e8771c356fb3b16714f77f1d126d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 02:14:59 +0000 Subject: [PATCH 470/885] GHA: update dependency wolfSSL/wolfssl to v5.8.4 Closes #19633 --- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index ff32e6c5d9d9..223c6afbf46d 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -49,7 +49,7 @@ env: # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com GNUTLS_VERSION: 3.8.10 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com - WOLFSSL_VERSION: 5.8.2 + WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com NGHTTP3_VERSION: 1.12.0 # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a6823b4c9da4..0db8ca33b4ec 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -40,7 +40,7 @@ env: # renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com LIBRESSL_VERSION: 4.2.1 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com - WOLFSSL_VERSION: 5.8.2 + WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com MBEDTLS_VERSION: 4.0.0 # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver:^3.0.0 registryUrl=https://github.com From fdacf34aaeac79ad14fa48dcafae24a6de68823d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 02:44:08 +0100 Subject: [PATCH 471/885] GHA/codeql: add tweak to successfully build libtests for CodeQL Turns out the cause of CodeQL hangs (or probably just extreme long compile) is the header `curl/typecheck-gcc.h`. By accident I noticed that the preprocessed output of libtests.c is 75 MB (megabytes). This is much higher than the amounf of source code hinted, also compared to e.g. units.c or other build targets. The reason for the extreme size is each easy option call pulling in the large checker logic defined in this header. By compiling with `-DCURL_DISABLE_TYPECHECK`, preprocessed output drops to 2.2 MB (34x), and the libtests target builds without issues. Also build all tests and examples with the Linux HTTP/3 config, covering 3 more files. With these, CodeQL C coverage is 893 out of 930 (96%) (was: 645 69%) Follow-up to 71fc11e6bbf530b90bf6e93a02cb32bdaecc933b #18695 Follow-up to a333fd4411b95fc0c3061b2d675de9287b6123e0 #18557 Follow-up to b4922b1295333dc6679eb1d588ddc2fb6b7fd5b7 #18564 Closes https://github.com/vszakats/curl/pull/11 Closes #19632 --- .github/workflows/codeql.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c7b6383cf1dc..c42d71773567 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -109,24 +109,24 @@ jobs: # MultiSSL export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig" cmake -B _bld1 -G Ninja -DENABLE_DEBUG=ON \ + -DCMAKE_C_FLAGS=-DCURL_DISABLE_TYPECHECK \ -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \ -DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \ -DCURL_DISABLE_VERBOSE_STRINGS=ON cmake --build _bld1 - cmake --build _bld1 --target curlinfo - cmake --build _bld1 --target servers - cmake --build _bld1 --target tunits - cmake --build _bld1 --target units + cmake --build _bld1 --target testdeps cmake --build _bld1 --target curl-examples-build # HTTP/3 export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix libnghttp3)/lib/pkgconfig:$(brew --prefix libngtcp2)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig" cmake -B _bld2 -G Ninja \ + -DCMAKE_C_FLAGS=-DCURL_DISABLE_TYPECHECK \ -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \ -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \ -DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON cmake --build _bld2 - cmake --build _bld2 --target servers + cmake --build _bld2 --target testdeps + cmake --build _bld2 --target curl-examples-build _bld1/src/curl --disable --version _bld2/src/curl --disable --version From b4220bde0ba79486c63e60de71037df912134dfb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 03:52:04 +0100 Subject: [PATCH 472/885] GHA/checksrc: switch xmllint job to Linux (from macOS) macOS was chosen because xmllint comes preinstalled, saving the prereq install step. But, macOS's xmllint jobs sometimes doesn't finish in 1m (instead of under 1 second) and gets cancelled, causing flaky failures. Go with Linux and an install phase (of 15s) instead. Examples: https://github.com/curl/curl/actions/runs/19558021722/job/56004334495 Closes #19634 --- .github/workflows/checksrc.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 32f825214d6c..2f7b0b0e941c 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -120,9 +120,17 @@ jobs: xmllint: name: 'xmllint' - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 1 steps: + - name: 'install prereqs' + run: | + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo apt-get -o Dpkg::Use-Pty=0 update + sudo rm -f /var/lib/man-db/auto-update + sudo apt-get -o Dpkg::Use-Pty=0 install \ + libxml2-utils + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false From fd23d9505c7263814bfb2963e9c406a53b0295a2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 20 Nov 2025 17:39:53 +0100 Subject: [PATCH 473/885] src: move `memdebug.h` to be the last include `memdebug.h` must be included last within each source. This breaks when including it in a header, which ends up being included in the middle of other headers, and `memdebug.h` also ending up in the middle of includes. Follow-up to c255d2fdcbf27b4bfd668ae3784bb657449d6889 #19602 Closes #19629 --- src/tool_cfgable.h | 1 - src/tool_ssls.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 717d35a1f522..dc78f2db44f6 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -29,7 +29,6 @@ #include "tool_sdecls.h" #include "tool_urlglob.h" #include "var.h" -#include "memdebug.h" /* keep this as LAST include */ /* the type we use for storing a single boolean bit */ #ifndef BIT diff --git a/src/tool_ssls.c b/src/tool_ssls.c index ab78014c0a86..4c9d1ee00857 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -30,6 +30,8 @@ #include "tool_ssls.h" #include "tool_parsecfg.h" +#include "memdebug.h" /* keep this as LAST include */ + /* The maximum line length for an ecoded session ticket */ #define MAX_SSLS_LINE (64 * 1024) From 529f61388f8c235fc250aa466163396a8965b362 Mon Sep 17 00:00:00 2001 From: Marc Aldorasi Date: Wed, 19 Nov 2025 11:12:31 -0500 Subject: [PATCH 474/885] gnutls: implement CURLOPT_CAINFO_BLOB This adds support for in-memory CA certs using CURLOPT_CAINFO_BLOB to the GnuTLS backend. Closes #19612 --- docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md | 3 ++- lib/vtls/gtls.c | 27 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md b/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md index 149c9b795f61..99bfaf11e673 100644 --- a/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md @@ -13,6 +13,7 @@ See-also: - CURLOPT_SSL_VERIFYPEER (3) TLS-backend: - OpenSSL + - GnuTLS - mbedTLS - rustls - wolfSSL @@ -80,7 +81,7 @@ int main(void) # HISTORY This option is supported by the mbedTLS (since 7.81.0), Rustls (since 7.82.0), -wolfSSL (since 8.2.0), OpenSSL and Schannel backends. +wolfSSL (since 8.2.0), GnuTLS (since 8.18.0), OpenSSL and Schannel backends. # %AVAILABILITY% diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index eba5fb36f09f..c0e248642b25 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -477,7 +477,31 @@ static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, #endif } - if(config->CAfile) { + if(config->ca_info_blob) { + gnutls_datum_t ca_info_datum; + if(config->ca_info_blob->len > (size_t)UINT_MAX) { + failf(data, "certificate blob too long: %zu bytes", + config->ca_info_blob->len); + return CURLE_SSL_CACERT_BADFILE; + } + ca_info_datum.data = config->ca_info_blob->data; + ca_info_datum.size = (unsigned int)config->ca_info_blob->len; + rc = gnutls_certificate_set_x509_trust_mem(creds, &ca_info_datum, + GNUTLS_X509_FMT_PEM); + creds_are_empty = creds_are_empty && (rc <= 0); + if(rc < 0) { + infof(data, "error reading ca cert blob (%s)%s", gnutls_strerror(rc), + (creds_are_empty ? "" : ", continuing anyway")); + if(creds_are_empty) { + ssl_config->certverifyresult = rc; + return CURLE_SSL_CACERT_BADFILE; + } + } + else + infof(data, " CA Blob: %d certificates", rc); + } + /* CURLOPT_CAINFO_BLOB overrides CURLOPT_CAINFO */ + else if(config->CAfile) { /* set the trusted CA cert bundle file */ gnutls_certificate_set_verify_flags(creds, GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT); @@ -2335,6 +2359,7 @@ const struct Curl_ssl Curl_ssl_gnutls = { SSLSUPP_CERTINFO | SSLSUPP_PINNEDPUBKEY | SSLSUPP_HTTPS_PROXY | + SSLSUPP_CAINFO_BLOB | SSLSUPP_CIPHER_LIST | SSLSUPP_CA_CACHE, From 49ab46c9c50511dcc304a92f3a2e458d4a9fa131 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 19 Nov 2025 15:05:17 +0100 Subject: [PATCH 475/885] gtls: drop support for GnuTLS < 3.6.5 Release date 2018-12-01. Has TLS 1.3 support. Closes #19609 --- docs/INTERNALS.md | 2 +- lib/vtls/gtls.c | 49 ++--------------------------------------------- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index d957c69ab77a..e9bb82a33d8e 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -26,7 +26,7 @@ versions of libs and build tools. - OpenSSL 3.0.0 (2021-09-07) - LibreSSL 2.9.1 (2019-04-22) - - GnuTLS 3.1.10 (2013-03-22) + - GnuTLS 3.6.5 (2018-12-01) - mbedTLS 3.2.0 (2022-07-11) - zlib 1.2.5.2 (2011-12-11) - libssh2 1.9.0 (2019-06-20) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index c0e248642b25..dbb442f36314 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -73,7 +73,7 @@ static void tls_log_func(int level, const char *str) } #endif -#if !defined(GNUTLS_VERSION_NUMBER) || (GNUTLS_VERSION_NUMBER < 0x03010a) +#if !defined(GNUTLS_VERSION_NUMBER) || (GNUTLS_VERSION_NUMBER < 0x030605) #error "too old GnuTLS version" #endif @@ -767,10 +767,8 @@ int Curl_glts_get_ietf_proto(gnutls_session_t session) return CURL_IETF_PROTO_TLS1_1; case GNUTLS_TLS1_2: return CURL_IETF_PROTO_TLS1_2; -#if GNUTLS_VERSION_NUMBER >= 0x030603 case GNUTLS_TLS1_3: return CURL_IETF_PROTO_TLS1_3; -#endif default: return CURL_IETF_PROTO_UNKNOWN; } @@ -1841,51 +1839,8 @@ Curl_gtls_verifyserver(struct Curl_cfilter *cf, rc = (int)gnutls_x509_crt_check_hostname(x509_cert, peer->sni ? peer->sni : peer->hostname); -#if GNUTLS_VERSION_NUMBER < 0x030306 - /* Before 3.3.6, gnutls_x509_crt_check_hostname() did not check IP - addresses. */ - if(!rc) { -#ifdef USE_IPV6 - #define use_addr in6_addr -#else - #define use_addr in_addr -#endif - unsigned char addrbuf[sizeof(struct use_addr)]; - size_t addrlen = 0; - - if(curlx_inet_pton(AF_INET, peer->hostname, addrbuf) > 0) - addrlen = 4; -#ifdef USE_IPV6 - else if(curlx_inet_pton(AF_INET6, peer->hostname, addrbuf) > 0) - addrlen = 16; -#endif - - if(addrlen) { - unsigned char certaddr[sizeof(struct use_addr)]; - int i; - - for(i = 0; ; i++) { - size_t certaddrlen = sizeof(certaddr); - int ret = gnutls_x509_crt_get_subject_alt_name(x509_cert, i, certaddr, - &certaddrlen, NULL); - /* If this happens, it was not an IP address. */ - if(ret == GNUTLS_E_SHORT_MEMORY_BUFFER) - continue; - if(ret < 0) - break; - if(ret != GNUTLS_SAN_IPADDRESS) - continue; - if(certaddrlen == addrlen && !memcmp(addrbuf, certaddr, addrlen)) { - rc = 1; - break; - } - } - } - } -#endif - result = (!rc && config->verifyhost) ? - CURLE_PEER_FAILED_VERIFICATION : CURLE_OK; + CURLE_PEER_FAILED_VERIFICATION : CURLE_OK; gtls_msg_verify_result(data, peer, x509_cert, rc, config->verifyhost); if(result) goto out; From de7ee1c96265013c71a367575abbcf97b843fde3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 21 Nov 2025 09:19:21 +0100 Subject: [PATCH 476/885] GHA: disable TLS in the linux-old build There are no supported TLS libraries left in "stretch". --- .github/workflows/linux-old.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index f79cee94ac36..64958f4bd61c 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -72,7 +72,7 @@ jobs: dpkg -i freexian-archive-keyring_2022.06.08_all.deb echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list apt-get -o Dpkg::Use-Pty=0 update - apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libgnutls28-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 groff + apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 groff # GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on # gcc-8-base, but it does not actually seem used in our situation and is not available in # the main repo, so force the install. @@ -89,7 +89,7 @@ jobs: mkdir bld-1 cd bld-1 cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ - -DCURL_USE_GNUTLS=ON -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON + -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON - name: 'CM build-only build' run: VERBOSE=1 make -C bld-1 install @@ -113,7 +113,7 @@ jobs: mkdir bld-cares cd bld-cares cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ - -DCURL_USE_GNUTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \ + -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \ -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON - name: 'CM configure log' @@ -151,7 +151,7 @@ jobs: mkdir bld-am cd bld-am ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \ - --with-gnutls --enable-ares --without-libssh2 --with-zstd --with-gssapi --with-librtmp \ + --without-ssl --enable-ares --without-libssh2 --with-zstd --with-gssapi --with-librtmp \ --prefix="$PWD"/../curl-install-am - name: 'AM configure log' From dd36dacd3e1518c1744e233d4aa3ec5a3a1c7bbc Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 13:17:03 +0100 Subject: [PATCH 477/885] openssl: no verify failf message unless strict If verifypeer and verifyhost are disabled, to not generate a failf() message for failed verifications. Fixes #19615 Reported-by: ncaklovic on github Closes #19625 --- lib/vtls/openssl.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 80d01c31604b..909c9a135b24 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4557,7 +4557,7 @@ static CURLcode ossl_check_issuer(struct Curl_cfilter *cf, X509 *issuer = NULL; BIO *fp = NULL; char err_buf[256]=""; - bool strict = (conn_config->verifypeer || conn_config->verifyhost); + bool verify_enabled = (conn_config->verifypeer || conn_config->verifyhost); CURLcode result = CURLE_OK; /* e.g. match issuer name with provided issuer certificate */ @@ -4581,7 +4581,7 @@ static CURLcode ossl_check_issuer(struct Curl_cfilter *cf, } if(BIO_read_filename(fp, conn_config->issuercert) <= 0) { - if(strict) + if(verify_enabled) failf(data, "SSL: Unable to open issuer cert (%s)", conn_config->issuercert); result = CURLE_SSL_ISSUER_ERROR; @@ -4592,7 +4592,7 @@ static CURLcode ossl_check_issuer(struct Curl_cfilter *cf, if(fp) { issuer = PEM_read_bio_X509(fp, NULL, ZERO_NULL, NULL); if(!issuer) { - if(strict) + if(verify_enabled) failf(data, "SSL: Unable to read issuer cert (%s)", conn_config->issuercert); result = CURLE_SSL_ISSUER_ERROR; @@ -4600,7 +4600,7 @@ static CURLcode ossl_check_issuer(struct Curl_cfilter *cf, } if(X509_check_issued(issuer, server_cert) != X509_V_OK) { - if(strict) + if(verify_enabled) failf(data, "SSL: Certificate issuer check failed (%s)", conn_config->issuercert); result = CURLE_SSL_ISSUER_ERROR; @@ -4648,8 +4648,6 @@ static CURLcode ossl_infof_cert(struct Curl_cfilter *cf, struct Curl_easy *data, X509 *server_cert) { - struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - bool strict = (conn_config->verifypeer || conn_config->verifyhost); BIO *mem = NULL; struct dynbuf dname; char err_buf[256] = ""; @@ -4686,12 +4684,8 @@ static CURLcode ossl_infof_cert(struct Curl_cfilter *cf, (void)BIO_reset(mem); result = x509_name_oneline(X509_get_issuer_name(server_cert), &dname); - if(result) { - if(strict) - failf(data, "SSL: could not get X509-issuer name"); - result = CURLE_PEER_FAILED_VERIFICATION; + if(result) /* should be only fatal stuff like OOM */ goto out; - } infof(data, " issuer: %s", curlx_dyn_ptr(&dname)); out: @@ -4788,7 +4782,6 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); CURLcode result = CURLE_OK; long ossl_verify; - bool strict = (conn_config->verifypeer || conn_config->verifyhost); X509 *server_cert; bool verified = FALSE; #ifdef USE_APPLE_SECTRUST @@ -4805,7 +4798,8 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, server_cert = SSL_get1_peer_certificate(octx->ssl); if(!server_cert) { - if(!strict) + /* no verification at all, this maybe acceptable */ + if(!(conn_config->verifypeer || conn_config->verifyhost)) goto out; failf(data, "SSL: could not get peer certificate"); @@ -4825,6 +4819,7 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, if(result) goto out; } + /* `verifyhost` is either OK or not requested from here on */ ossl_verify = SSL_get_verify_result(octx->ssl); ssl_config->certverifyresult = ossl_verify; @@ -4853,11 +4848,12 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, if(!verified) { /* no trust established, report the OpenSSL status */ - failf(data, "SSL certificate OpenSSL verify result: %s (%ld)", - X509_verify_cert_error_string(ossl_verify), ossl_verify); - result = CURLE_PEER_FAILED_VERIFICATION; - if(conn_config->verifypeer) + if(conn_config->verifypeer) { + failf(data, "SSL certificate OpenSSL verify result: %s (%ld)", + X509_verify_cert_error_string(ossl_verify), ossl_verify); + result = CURLE_PEER_FAILED_VERIFICATION; goto out; + } infof(data, " SSL certificate verification failed, continuing anyway!"); } From 3561f2c7bfe8d6c4d535a038b67d5f731fe0012f Mon Sep 17 00:00:00 2001 From: x2018 Date: Wed, 19 Nov 2025 23:25:57 +0800 Subject: [PATCH 478/885] lib: cleanup some whitespace nits Closes #19588 --- lib/vtls/openssl.c | 2 +- src/tool_operhlp.c | 2 +- src/tool_setopt.c | 2 +- src/tool_ssls.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 909c9a135b24..5d35ba1a1530 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -277,7 +277,7 @@ static CURLcode X509V3_ext(struct Curl_easy *data, if(asn1_object_dump(obj, namebuf, sizeof(namebuf))) /* make sure the name is null-terminated */ - namebuf [ sizeof(namebuf) - 1] = 0; + namebuf[sizeof(namebuf) - 1] = 0; if(!X509V3_EXT_print(bio_out, ext, 0, 0)) ASN1_STRING_print(bio_out, (ASN1_STRING *)X509_EXTENSION_get_data(ext)); diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index e17955bec306..0d6c2cb6e0e5 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -92,7 +92,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename) if(uh) { char *ptr; uerr = curl_url_set(uh, CURLUPART_URL, *inurlp, - CURLU_GUESS_SCHEME|CURLU_NON_SUPPORT_SCHEME); + CURLU_GUESS_SCHEME|CURLU_NON_SUPPORT_SCHEME); if(uerr) { result = urlerr_cvt(uerr); goto fail; diff --git a/src/tool_setopt.c b/src/tool_setopt.c index ccecd3a7e030..b7039fbb4881 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -623,7 +623,7 @@ CURLcode tool_setopt_offt(CURL *curl, const char *name, CURLoption tag, if(global->libcurl && !ret && lval) { /* we only use this for real if --libcurl was used */ ret = easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, (curl_off_t)%" - CURL_FORMAT_CURL_OFF_T ");", name, lval); + CURL_FORMAT_CURL_OFF_T ");", name, lval); } return ret; diff --git a/src/tool_ssls.c b/src/tool_ssls.c index 4c9d1ee00857..40e67a8044c9 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -156,8 +156,8 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr, (void)earlydata_max; if(!ctx->exported) fputs("# Your SSL session cache. https://curl.se/docs/ssl-sessions.html\n" - "# This file was generated by libcurl! Edit at your own risk.\n", - ctx->fp); + "# This file was generated by libcurl! Edit at your own risk.\n", + ctx->fp); r = curlx_base64_encode((const char *)shmac, shmac_len, &enc, &enc_len); if(r) From eaa7651374898cef89e5783b0219bdffcc0eb60e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Nov 2025 23:49:15 +0100 Subject: [PATCH 479/885] lib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows) Replace: - curl_sspi: macro `_tcsncpy()` with `_tcsncpy_s()`. - curlx/fopen: `wcsncpy()` with `wcsncpy_s()`. - curlx/fopen: `wcscpy()` with `wcscpy_s()`. Use of the pre-existing functions were safe. This patch aims to use the recommended Windows CRT functions. Handle errors returned by them. Also to avoid the compiler warnings silenced via `_CRT_SECURE_NO_WARNINGS`: ``` lib/curl_sspi.c(152): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(161): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(162): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(174): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(175): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. ``` Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l https://learn.microsoft.com/cpp/c-runtime-library/security-features-in-the-crt Cherry-picked from #19581 (in part) Closes #19589 --- lib/curl_setup.h | 2 +- lib/curl_sspi.c | 7 +++++-- lib/curlx/fopen.c | 20 ++++++++++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 0df96d5efd28..05e6149f6139 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -98,7 +98,7 @@ #define _CRT_SECURE_NO_WARNINGS /* for __sys_errlist, __sys_nerr, _open(), _wfopen(), _wopen(), fopen(), freopen(), getenv(), gmtime(), mbstowcs(), sprintf(), - strcpy(), wcscpy(), wcsncpy(), wcstombs(), + strcpy(), wcstombs(), in tests: localtime(), open(), sscanf() */ #endif #endif /* _MSC_VER */ diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index 32b4c894d6b5..369cf18967a3 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -149,8 +149,11 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, curlx_unicodefree(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } - _tcsncpy(dup_domain.tchar_ptr, domain.tchar_ptr, domlen); - *(dup_domain.tchar_ptr + domlen) = TEXT('\0'); + if(_tcsncpy_s(dup_domain.tchar_ptr, domlen + 1, domain.tchar_ptr, domlen)) { + curlx_unicodefree(dup_domain.tchar_ptr); + curlx_unicodefree(useranddomain.tchar_ptr); + return CURLE_OUT_OF_MEMORY; + } identity->Domain = dup_domain.tbyte_ptr; identity->DomainLength = curlx_uztoul(domlen); dup_domain.tchar_ptr = NULL; diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index 333eff7de7e2..f33075316250 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -158,8 +158,14 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) if(!temp) goto cleanup; - wcsncpy(temp, L"\\\\?\\UNC\\", 8); - wcscpy(temp + 8, fbuf + 2); + if(wcsncpy_s(temp, needed, L"\\\\?\\UNC\\", 8)) { + (free)(temp); + goto cleanup; + } + if(wcscpy_s(temp + 8, needed, fbuf + 2)) { + (free)(temp); + goto cleanup; + } } else { /* "\\?\" + full path + null */ @@ -171,8 +177,14 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) if(!temp) goto cleanup; - wcsncpy(temp, L"\\\\?\\", 4); - wcscpy(temp + 4, fbuf); + if(wcsncpy_s(temp, needed, L"\\\\?\\", 4)) { + (free)(temp); + goto cleanup; + } + if(wcscpy_s(temp + 4, needed, fbuf)) { + (free)(temp); + goto cleanup; + } } (free)(fbuf); From 9e6f1c5efb7a70e1f33e467a738f3e3f652f3174 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 12:43:54 +0100 Subject: [PATCH 480/885] build: add build-level `CURL_DISABLE_TYPECHECK` options Usage: - autotools: `--disable-typecheck` (or `--enable-typecheck` (default)) - cmake: `-DCURL_DISABLE_TYPECHECK=ON`. To disable `curl_easy_setopt()`/`curl_easy_getinfo()` type checking with supported (new) gcc and clang compilers. It is useful to improve build performance for the `tests/libtest` target. In particular the CodeQL analyzer may take above an hour to compile with type checking enabled, and disabling it brings it down to seconds. On local machines it may also cut build times in half when build testdeps, depending on platform and compiler. Other than these cases, we recommend leaving type checking enabled. Ref: fdacf34aaeac79ad14fa48dcafae24a6de68823d #19632 Also: - GHA/codeql: use it. - test1165: check in `include/curl`. - lib1912: delete stray todo comment. - spelling and comment nits. Closes #19637 --- .github/workflows/codeql.yml | 6 +-- CMakeLists.txt | 4 +- configure.ac | 82 +++++++++++++++++++++++------------- docs/CURL-DISABLE.md | 10 ++++- docs/INSTALL-CMAKE.md | 3 +- include/curl/typecheck-gcc.h | 4 +- lib/curl_config.h.cmake | 5 ++- tests/libtest/lib1912.c | 3 +- tests/test1165.pl | 3 +- 9 files changed, 76 insertions(+), 44 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c42d71773567..9ee723cf73ec 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -108,8 +108,7 @@ jobs: # MultiSSL export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig" - cmake -B _bld1 -G Ninja -DENABLE_DEBUG=ON \ - -DCMAKE_C_FLAGS=-DCURL_DISABLE_TYPECHECK \ + cmake -B _bld1 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DENABLE_DEBUG=ON \ -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \ -DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \ -DCURL_DISABLE_VERBOSE_STRINGS=ON @@ -119,8 +118,7 @@ jobs: # HTTP/3 export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix libnghttp3)/lib/pkgconfig:$(brew --prefix libngtcp2)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig" - cmake -B _bld2 -G Ninja \ - -DCMAKE_C_FLAGS=-DCURL_DISABLE_TYPECHECK \ + cmake -B _bld2 -G Ninja -DCURL_DISABLE_TYPECHECK=ON \ -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \ -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \ -DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON diff --git a/CMakeLists.txt b/CMakeLists.txt index 7de2162c6cd3..20336e097c0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -462,7 +462,7 @@ option(CURL_DISABLE_SMB "Disable SMB" OFF) mark_as_advanced(CURL_DISABLE_SMB) option(CURL_DISABLE_SMTP "Disable SMTP" OFF) mark_as_advanced(CURL_DISABLE_SMTP) -option(CURL_DISABLE_SOCKETPAIR "Disable use of socketpair for curl_multi_poll" OFF) +option(CURL_DISABLE_SOCKETPAIR "Disable use of socketpair for curl_multi_poll()" OFF) mark_as_advanced(CURL_DISABLE_SOCKETPAIR) option(CURL_DISABLE_WEBSOCKETS "Disable WebSocket" OFF) mark_as_advanced(CURL_DISABLE_WEBSOCKETS) @@ -470,6 +470,8 @@ option(CURL_DISABLE_TELNET "Disable Telnet" OFF) mark_as_advanced(CURL_DISABLE_TELNET) option(CURL_DISABLE_TFTP "Disable TFTP" OFF) mark_as_advanced(CURL_DISABLE_TFTP) +option(CURL_DISABLE_TYPECHECK "Disable curl_easy_setopt()/curl_easy_getinfo() type checking" OFF) +mark_as_advanced(CURL_DISABLE_TYPECHECK) option(CURL_DISABLE_VERBOSE_STRINGS "Disable verbose strings" OFF) mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS) diff --git a/configure.ac b/configure.ac index 6c1b9c9ba666..d72b33d5287b 100644 --- a/configure.ac +++ b/configure.ac @@ -140,36 +140,37 @@ AC_SUBST(VERSIONNUM) dnl dnl initialize all the info variables - curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )" - curl_ssh_msg="no (--with-{libssh,libssh2})" - curl_zlib_msg="no (--with-zlib)" - curl_brotli_msg="no (--with-brotli)" - curl_zstd_msg="no (--with-zstd)" - curl_gss_msg="no (--with-gssapi)" - curl_gsasl_msg="no (--with-gsasl)" -curl_tls_srp_msg="no (--enable-tls-srp)" - curl_res_msg="blocking (--enable-ares / --enable-threaded-resolver)" - curl_ipv6_msg="no (--enable-ipv6)" -curl_unix_sockets_msg="no (--enable-unix-sockets)" - curl_idn_msg="no (--with-{libidn2,winidn})" - curl_docs_msg="enabled (--disable-docs)" - curl_manual_msg="no (--enable-manual)" -curl_libcurl_msg="enabled (--disable-libcurl-option)" -curl_verbose_msg="enabled (--disable-verbose)" - curl_sspi_msg="no (--enable-sspi)" - curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" - curl_ldaps_msg="no (--enable-ldaps)" - curl_ipfs_msg="no (--enable-ipfs)" - curl_rtsp_msg="no (--enable-rtsp)" - curl_rtmp_msg="no (--with-librtmp)" - curl_psl_msg="no (--with-libpsl)" - curl_altsvc_msg="enabled (--disable-alt-svc)" -curl_headers_msg="enabled (--disable-headers-api)" - curl_hsts_msg="enabled (--disable-hsts)" - ssl_backends= - curl_h1_msg="enabled (internal)" - curl_h2_msg="no (--with-nghttp2)" - curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic)" + curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )" + curl_ssh_msg="no (--with-{libssh,libssh2})" + curl_zlib_msg="no (--with-zlib)" + curl_brotli_msg="no (--with-brotli)" + curl_zstd_msg="no (--with-zstd)" + curl_gss_msg="no (--with-gssapi)" + curl_gsasl_msg="no (--with-gsasl)" + curl_tls_srp_msg="no (--enable-tls-srp)" + curl_res_msg="blocking (--enable-ares / --enable-threaded-resolver)" + curl_ipv6_msg="no (--enable-ipv6)" +curl_unix_sockets_msg="no (--enable-unix-sockets)" + curl_idn_msg="no (--with-{libidn2,winidn})" + curl_docs_msg="enabled (--disable-docs)" + curl_manual_msg="no (--enable-manual)" + curl_libcurl_msg="enabled (--disable-libcurl-option)" + curl_typecheck_msg="enabled (--disable-typecheck)" + curl_verbose_msg="enabled (--disable-verbose)" + curl_sspi_msg="no (--enable-sspi)" + curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" + curl_ldaps_msg="no (--enable-ldaps)" + curl_ipfs_msg="no (--enable-ipfs)" + curl_rtsp_msg="no (--enable-rtsp)" + curl_rtmp_msg="no (--with-librtmp)" + curl_psl_msg="no (--with-libpsl)" + curl_altsvc_msg="enabled (--disable-alt-svc)" + curl_headers_msg="enabled (--disable-headers-api)" + curl_hsts_msg="enabled (--disable-hsts)" + ssl_backends= + curl_h1_msg="enabled (internal)" + curl_h2_msg="no (--with-nghttp2)" + curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic)" enable_altsvc="yes" hsts="yes" @@ -4345,6 +4346,26 @@ AC_CHECK_HEADER(dirent.h, CURL_CONVERT_INCLUDE_TO_ISYSTEM +dnl ************************************************************ +dnl disable curl_easy_setopt()/curl_easy_getinfo() type checking +dnl +AC_MSG_CHECKING([whether to enable curl_easy_setopt()/curl_easy_getinfo() type checking]) +AC_ARG_ENABLE(typecheck, +AS_HELP_STRING([--enable-typecheck],[Enable type checking (default)]) +AS_HELP_STRING([--disable-typecheck],[Disable type checking]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_TYPECHECK, 1, [to disable type checking]) + curl_typecheck_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + dnl ************************************************************ dnl disable verbose text strings dnl @@ -5521,6 +5542,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: Build libcurl: Shared=${enable_shared}, Static=${enable_static} Built-in manual: ${curl_manual_msg} --libcurl option: ${curl_libcurl_msg} + Type checking: ${curl_typecheck_msg} Verbose errors: ${curl_verbose_msg} Code coverage: ${curl_coverage_msg} SSPI: ${curl_sspi_msg} diff --git a/docs/CURL-DISABLE.md b/docs/CURL-DISABLE.md index 63de4026a6d2..c266f0c0adc9 100644 --- a/docs/CURL-DISABLE.md +++ b/docs/CURL-DISABLE.md @@ -68,8 +68,8 @@ Disable the FTP (and FTPS) protocol ## `CURL_DISABLE_GETOPTIONS` -Disable the `curl_easy_options` API calls that lets users get information -about existing options to `curl_easy_setopt`. +Disable the `curl_easy_options()` API calls that lets users get information +about existing options to `curl_easy_setopt()`. ## `CURL_DISABLE_GOPHER` @@ -182,6 +182,12 @@ Disable the TELNET protocol Disable the TFTP protocol +## `CURL_DISABLE_TYPECHECK` + +Disable `curl_easy_setopt()`/`curl_easy_getinfo()` type checking. + +Useful to improve build performance for the `tests/libtest` test tool. + ## `CURL_DISABLE_VERBOSE_STRINGS` Disable verbose strings and error messages. diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index 9921fbf12c4c..bd9555b61461 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -317,10 +317,11 @@ target_link_libraries(my_target PRIVATE CURL::libcurl) - `CURL_DISABLE_SHUFFLE_DNS`: Disable shuffle DNS feature. Default: `OFF` - `CURL_DISABLE_SMB`: Disable SMB. Default: `OFF` - `CURL_DISABLE_SMTP`: Disable SMTP. Default: `OFF` -- `CURL_DISABLE_SOCKETPAIR`: Disable use of socketpair for curl_multi_poll. Default: `OFF` +- `CURL_DISABLE_SOCKETPAIR`: Disable use of socketpair for curl_multi_poll(). Default: `OFF` - `CURL_DISABLE_SRP`: Disable TLS-SRP support. Default: `OFF` - `CURL_DISABLE_TELNET`: Disable Telnet. Default: `OFF` - `CURL_DISABLE_TFTP`: Disable TFTP. Default: `OFF` +- `CURL_DISABLE_TYPECHECK`: Disable curl_easy_setopt()/curl_easy_getinfo() type checking. Default: `OFF` - `CURL_DISABLE_VERBOSE_STRINGS`: Disable verbose strings. Default: `OFF` - `CURL_DISABLE_WEBSOCKETS`: Disable WebSocket. Default: `OFF` - `HTTP_ONLY`: Disable all protocols except HTTP (This overrides all `CURL_DISABLE_*` options). Default: `OFF` diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index 063cea57e6f2..bf03e0d9359b 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -24,7 +24,7 @@ * ***************************************************************************/ -/* wraps curl_easy_setopt() with typechecking */ +/* wraps curl_easy_setopt() with type checking */ /* To add a new kind of warning, add an * if(curlcheck_sometype_option(_curl_opt)) @@ -159,7 +159,7 @@ curl_easy_setopt(handle, option, value); \ }) -/* wraps curl_easy_getinfo() with typechecking */ +/* wraps curl_easy_getinfo() with type checking */ #define curl_easy_getinfo(handle, info, arg) \ __extension__({ \ if(__builtin_constant_p(info)) { \ diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 88b991d7ef94..acbb428575cc 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -151,7 +151,7 @@ /* disabled WebSocket */ #cmakedefine CURL_DISABLE_WEBSOCKETS 1 -/* disables use of socketpair for curl_multi_poll */ +/* disables use of socketpair for curl_multi_poll() */ #cmakedefine CURL_DISABLE_SOCKETPAIR 1 /* disables TELNET */ @@ -160,6 +160,9 @@ /* disables TFTP */ #cmakedefine CURL_DISABLE_TFTP 1 +/* disables curl_easy_setopt()/curl_easy_getinfo() type checking */ +#cmakedefine CURL_DISABLE_TYPECHECK 1 + /* disables verbose strings */ #cmakedefine CURL_DISABLE_VERBOSE_STRINGS 1 diff --git a/tests/libtest/lib1912.c b/tests/libtest/lib1912.c index dd3e63881656..0dd246e4612b 100644 --- a/tests/libtest/lib1912.c +++ b/tests/libtest/lib1912.c @@ -31,7 +31,7 @@ static CURLcode test_lib1912(const char *URL) { -/* Only test if GCC typechecking is available */ +/* Only test if GCC/clang type checking is available */ int error = 0; #ifdef CURLINC_TYPECHECK_GCC_H const struct curl_easyoption *o; @@ -73,7 +73,6 @@ static CURLcode test_lib1912(const char *URL) print_err(o->name, "CURLOT_OBJECT"); error++; } - /* Todo: no gcc typecheck for CURLOPTTYPE_BLOB types? */ } #endif (void)URL; diff --git a/tests/test1165.pl b/tests/test1165.pl index 654a2ad64265..049b764647fd 100755 --- a/tests/test1165.pl +++ b/tests/test1165.pl @@ -86,7 +86,7 @@ sub scan_cmake_config_h { scanconf_cmake(\%disable_cmake_config_h, "$root/lib/curl_config.h.cmake"); } -my %whitelisted = ("CURL_DISABLE_TYPECHECK" => 1); +my %whitelisted = ('CURL_DISABLE_DEPRECATION' => 1); sub scan_file { my ($source)=@_; @@ -114,6 +114,7 @@ sub scan_dir { } sub scan_sources { + scan_dir("$root/include/curl"); scan_dir("$root/src"); scan_dir("$root/lib"); scan_dir("$root/lib/vtls"); From 6aa8fa3fdfdb1a0d4d022cc04e478f13e2b6b880 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 21 Nov 2025 13:06:00 +0100 Subject: [PATCH 481/885] apple-sectrust: always ask when `native_ca_store` is in use When OpenSSL fails to verify the peer certificate, we checked for one specific reason code and did not ask Apple SecTrust for any other failure. Always ask Apple SecTrust after OpenSSL fails when the `native_ca_store` is enabled. If the user configures a CAfile or CApath, the native store is disabled, so this does not affect use cases where users asks curl to use a specific set of trust anchors. Do the same for GnuTLS Fixes #19636 Reported-by: ffath-vo on github Closes #19638 --- lib/vtls/gtls.c | 3 +-- lib/vtls/openssl.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index dbb442f36314..55a75fa72150 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1687,8 +1687,7 @@ Curl_gtls_verifyserver(struct Curl_cfilter *cf, infof(data, " SSL certificate verified by GnuTLS"); #ifdef USE_APPLE_SECTRUST - if(!verified && ssl_config->native_ca_store && - (verify_status & GNUTLS_CERT_SIGNER_NOT_FOUND)) { + if(!verified && ssl_config->native_ca_store) { result = glts_apple_verify(cf, data, peer, &chain, &verified); if(result && (result != CURLE_PEER_FAILED_VERIFICATION)) goto out; /* unexpected error */ diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 5d35ba1a1530..8991d965d9be 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4829,9 +4829,7 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, infof(data, "SSL certificate verified via OpenSSL."); #ifdef USE_APPLE_SECTRUST - if(!verified && - conn_config->verifypeer && ssl_config->native_ca_store && - (ossl_verify == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY)) { + if(!verified && conn_config->verifypeer && ssl_config->native_ca_store) { /* we verify using Apple SecTrust *unless* OpenSSL already verified. * This may happen if the application intercepted the OpenSSL callback * and installed its own. */ From 047b36d7a698c952b7d76ea3ce303a3d58ae637a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 21 Nov 2025 14:34:31 +0100 Subject: [PATCH 482/885] smb: fix a size check to be overflow safe In smb_send_message, although it could never actually overflow it might as well be done correctly. Also do the check earlier. Closes #19640 --- lib/smb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/smb.c b/lib/smb.c index 2aa8e96644a9..4ef35c295d15 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -668,12 +668,12 @@ static CURLcode smb_send_message(struct Curl_easy *data, unsigned char cmd, const void *msg, size_t msg_len) { - smb_format_message(smbc, req, (struct smb_header *)smbc->send_buf, - cmd, msg_len); - if((sizeof(struct smb_header) + msg_len) > MAX_MESSAGE_SIZE) { + if((MAX_MESSAGE_SIZE - sizeof(struct smb_header)) < msg_len) { DEBUGASSERT(0); return CURLE_SEND_ERROR; } + smb_format_message(smbc, req, (struct smb_header *)smbc->send_buf, + cmd, msg_len); memcpy(smbc->send_buf + sizeof(struct smb_header), msg, msg_len); return smb_send(data, smbc, sizeof(struct smb_header) + msg_len, 0); From e2be5689744716b63477d2e250b53fcac1f8c3b4 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 20 Nov 2025 10:58:54 +0100 Subject: [PATCH 483/885] multi: make max_total_* members size_t Check size_t conversion on setting these members via CURLMIPT_*. Use members without casting. Closes #19618 --- lib/cshutdn.c | 3 +-- lib/curl_setup.h | 3 +++ lib/curlx/warnless.c | 12 ++++++++++++ lib/curlx/warnless.h | 4 ++++ lib/multi.c | 6 ++++-- lib/multihandle.h | 9 ++++----- lib/url.c | 2 +- 7 files changed, 29 insertions(+), 10 deletions(-) diff --git a/lib/cshutdn.c b/lib/cshutdn.c index f9f636640a03..e039d027625b 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -414,8 +414,7 @@ void Curl_cshutdn_add(struct cshutdn *cshutdn, size_t conns_in_pool) { struct Curl_easy *data = cshutdn->multi->admin; - size_t max_total = (cshutdn->multi->max_total_connections > 0) ? - (size_t)cshutdn->multi->max_total_connections : 0; + size_t max_total = cshutdn->multi->max_total_connections; /* Add the connection to our shutdown list for non-blocking shutdown * during multi processing. */ diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 05e6149f6139..d75de9416cbf 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -627,6 +627,9 @@ #endif #endif +#if SIZEOF_LONG > SIZEOF_SIZE_T +#error "unexpected: 'long' is larger than 'size_t'" +#endif /* * Arg 2 type for gethostname in case it has not been defined in config file. */ diff --git a/lib/curlx/warnless.c b/lib/curlx/warnless.c index 5ed27b3e4cbf..fafa83c98c97 100644 --- a/lib/curlx/warnless.c +++ b/lib/curlx/warnless.c @@ -333,6 +333,18 @@ bool curlx_sotouz_fits(curl_off_t sonum, size_t *puznum) return TRUE; } + +bool curlx_sltouz(long slnum, size_t *puznum) +{ + if(slnum < 0) { + *puznum = 0; + return FALSE; + } + /* We error in curl_setup.h if SIZEOF_LONG > SIZEOF_SIZE_T */ + *puznum = (size_t)slnum; + return TRUE; +} + curl_off_t curlx_uztoso(size_t uznum) { #if SIZEOF_SIZE_T >= SIZEOF_CURL_OFF_T diff --git a/lib/curlx/warnless.h b/lib/curlx/warnless.h index c8861d8488c3..52e7ec2a5c5d 100644 --- a/lib/curlx/warnless.h +++ b/lib/curlx/warnless.h @@ -73,6 +73,10 @@ bool curlx_sztouz(ssize_t sznum, size_t *puznum); * too large and set 0 */ bool curlx_sotouz_fits(curl_off_t sonum, size_t *puznum); +/* Convert a long to size_t, return FALSE if negative or too large + * and set 0 */ +bool curlx_sltouz(long sznum, size_t *puznum); + #ifdef _WIN32 #undef read #define read(fd, buf, count) (ssize_t)_read(fd, buf, curlx_uztoui(count)) diff --git a/lib/multi.c b/lib/multi.c index c52ee54c7723..3fc1c948f507 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -3271,10 +3271,12 @@ CURLMcode curl_multi_setopt(CURLM *m, multi->maxconnects = (unsigned int)uarg; break; case CURLMOPT_MAX_HOST_CONNECTIONS: - multi->max_host_connections = va_arg(param, long); + if(!curlx_sltouz(va_arg(param, long), &multi->max_host_connections)) + res = CURLM_BAD_FUNCTION_ARGUMENT; break; case CURLMOPT_MAX_TOTAL_CONNECTIONS: - multi->max_total_connections = va_arg(param, long); + if(!curlx_sltouz(va_arg(param, long), &multi->max_total_connections)) + res = CURLM_BAD_FUNCTION_ARGUMENT; break; /* options formerly used for pipelining */ case CURLMOPT_MAX_PIPELINE_LENGTH: diff --git a/lib/multihandle.h b/lib/multihandle.h index 69f977bb94ed..fbb8bdfeeb59 100644 --- a/lib/multihandle.h +++ b/lib/multihandle.h @@ -149,11 +149,10 @@ struct Curl_multi { struct cshutdn cshutdn; /* connection shutdown handling */ struct cpool cpool; /* connection pool (bundles) */ - long max_host_connections; /* if >0, a fixed limit of the maximum number - of connections per host */ - - long max_total_connections; /* if >0, a fixed limit of the maximum number - of connections in total */ + size_t max_host_connections; /* if >0, a fixed limit of the maximum number + of connections per host */ + size_t max_total_connections; /* if >0, a fixed limit of the maximum number + of connections in total */ /* timer callback and user data pointer for the *socket() API */ curl_multi_timer_callback timer_cb; diff --git a/lib/url.c b/lib/url.c index b4069e30f18b..7e4d455a8cd8 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3690,7 +3690,7 @@ static CURLcode create_conn(struct Curl_easy *data, CURL_TRC_M(data, "Allowing sub-requests (like DoH) to override " "max connection limit"); else { - infof(data, "No connections available, total of %ld reached.", + infof(data, "No connections available, total of %zu reached.", data->multi->max_total_connections); connections_available = FALSE; } From a439fc0e372c3de7df3b8ae3ca7752bc3cbca826 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 05:59:59 +0000 Subject: [PATCH 484/885] GHA: update gnutls/gnutls to 3.8.11 from 3.8.10 Closes #19613 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 223c6afbf46d..10aac5e0c699 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -47,7 +47,7 @@ env: # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251110.0 # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com - GNUTLS_VERSION: 3.8.10 + GNUTLS_VERSION: 3.8.11 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com From acfcc2b28806a1be7e027205673b1a33618ddfb5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 15:57:17 +0100 Subject: [PATCH 485/885] checksrc: ban `_tcsncpy`, `wcscpy`, `wcsncpy` Follow-up to eaa7651374898cef89e5783b0219bdffcc0eb60e #19589 Closes #19641 --- scripts/checksrc.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index c9f008f1a1df..88db59f116d1 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -78,11 +78,14 @@ "_mbsncat" => 1, "_tcscat" => 1, "_tcsdup" => 1, + "_tcsncpy" => 1, "_tcsncat" => 1, "_wcscat" => 1, "_wcsncat" => 1, "_wcsdup" => 1, "wcsdup" => 1, + "wcscpy" => 1, + "wcsncpy" => 1, "LoadLibrary" => 1, "LoadLibraryA" => 1, "LoadLibraryW" => 1, From 18b94293133c1e035b5ac5b4fde854d1f17418a3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 18 Nov 2025 01:48:04 +0100 Subject: [PATCH 486/885] curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows) They are used in Windows-specific `fopen()`, `freopen`, `open()` and `curlx_get_winapi_error()` calls, and in `fix_excessive_path()` in Unicode builds. Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-mbstowcs-l https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-s-mbstowcs-s-l https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-wcstombs-l https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-s-wcstombs-s-l Also ban these functions via checksrc. Co-authored-by: Jay Satiro Closes #19581 --- lib/curl_setup.h | 3 +-- lib/curlx/fopen.c | 22 ++++++++++++---------- lib/curlx/winapi.c | 30 +++++++++++++----------------- scripts/checksrc.pl | 2 ++ 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index d75de9416cbf..db438a8b0a47 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -97,8 +97,7 @@ #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS /* for __sys_errlist, __sys_nerr, _open(), _wfopen(), _wopen(), fopen(), freopen(), - getenv(), gmtime(), mbstowcs(), sprintf(), - strcpy(), wcstombs(), + getenv(), gmtime(), sprintf(), strcpy(), in tests: localtime(), open(), sscanf() */ #endif #endif /* _MSC_VER */ diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index f33075316250..dc1c2bb4e67d 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -97,15 +97,16 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) #ifndef _UNICODE /* convert multibyte input to unicode */ - needed = mbstowcs(NULL, in, 0); - if(needed == (size_t)-1 || needed >= max_path_len) + if(mbstowcs_s(&needed, NULL, 0, in, 0)) + goto cleanup; + if(!needed || needed >= max_path_len) goto cleanup; - ++needed; /* for NUL */ ibuf = (malloc)(needed * sizeof(wchar_t)); if(!ibuf) goto cleanup; - count = mbstowcs(ibuf, in, needed); - if(count == (size_t)-1 || count >= needed) + if(mbstowcs_s(&count, ibuf, needed, in, needed - 1)) + goto cleanup; + if(count != needed) goto cleanup; in_w = ibuf; #else @@ -193,15 +194,16 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) #ifndef _UNICODE /* convert unicode full path to multibyte output */ - needed = wcstombs(NULL, fbuf, 0); - if(needed == (size_t)-1 || needed >= max_path_len) + if(wcstombs_s(&needed, NULL, 0, fbuf, 0)) + goto cleanup; + if(!needed || needed >= max_path_len) goto cleanup; - ++needed; /* for NUL */ obuf = (malloc)(needed); if(!obuf) goto cleanup; - count = wcstombs(obuf, fbuf, needed); - if(count == (size_t)-1 || count >= needed) + if(wcstombs_s(&count, obuf, needed, fbuf, needed - 1)) + goto cleanup; + if(count != needed) goto cleanup; *out = obuf; obuf = NULL; diff --git a/lib/curlx/winapi.c b/lib/curlx/winapi.c index 2dc277c1c1fa..7b3d6b60369c 100644 --- a/lib/curlx/winapi.c +++ b/lib/curlx/winapi.c @@ -52,6 +52,7 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen) { char *p; wchar_t wbuf[256]; + DWORD wlen; if(!buflen) return NULL; @@ -62,23 +63,18 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen) /* We return the local codepage version of the error string because if it is output to the user's terminal it will likely be with functions which expect the local codepage (eg fprintf, failf, infof). */ - if(FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err, - LANG_NEUTRAL, wbuf, CURL_ARRAYSIZE(wbuf), NULL)) { - size_t written = wcstombs(buf, wbuf, buflen - 1); - if(written != (size_t)-1) - buf[written] = '\0'; - else - *buf = '\0'; - } - - /* Truncate multiple lines */ - p = strchr(buf, '\n'); - if(p) { - if(p > buf && *(p-1) == '\r') - *(p-1) = '\0'; - else - *p = '\0'; + wlen = FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err, + LANG_NEUTRAL, wbuf, CURL_ARRAYSIZE(wbuf), NULL); + if(wlen && !wcstombs_s(NULL, buf, buflen, wbuf, wlen)) { + /* Truncate multiple lines */ + p = strchr(buf, '\n'); + if(p) { + if(p > buf && *(p-1) == '\r') + *(p-1) = '\0'; + else + *p = '\0'; + } } return *buf ? buf : NULL; diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 88db59f116d1..a2f458b6c1ac 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -86,6 +86,8 @@ "wcsdup" => 1, "wcscpy" => 1, "wcsncpy" => 1, + "mbstowcs" => 1, + "wcstombs" => 1, "LoadLibrary" => 1, "LoadLibraryA" => 1, "LoadLibraryW" => 1, From 905b718de3fb9287c7c0037b2737aa395f01ad3c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 21 Nov 2025 16:53:51 +0100 Subject: [PATCH 487/885] Revert "GHA: update gnutls/gnutls to 3.8.11 from 3.8.10" This reverts commit a439fc0e372c3de7df3b8ae3ca7752bc3cbca826. It requires a version of libnettle that is not included in these Ubuntu versions: "Libnettle 3.10 was not found" Closes #19642 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 10aac5e0c699..223c6afbf46d 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -47,7 +47,7 @@ env: # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251110.0 # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com - GNUTLS_VERSION: 3.8.11 + GNUTLS_VERSION: 3.8.10 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com From 7d75c728a65be961c63169fcf9f307c3324e440b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Nov 2025 23:57:04 +0100 Subject: [PATCH 488/885] KNOWN_RISKS: known risks when running and using curl and libcurl Closes #19631 --- docs/KNOWN_RISKS.md | 138 ++++++++++++++++++++++++++++++++++++++++++++ docs/Makefile.am | 1 + 2 files changed, 139 insertions(+) create mode 100644 docs/KNOWN_RISKS.md diff --git a/docs/KNOWN_RISKS.md b/docs/KNOWN_RISKS.md new file mode 100644 index 000000000000..3773b94f86bd --- /dev/null +++ b/docs/KNOWN_RISKS.md @@ -0,0 +1,138 @@ + + +# Known Risks + +This is an incomplete list of known risks when running and using curl and +libcurl. + +## Insecure transfers + +When using curl to perform transfers with protocols that are insecure or the +server identity is unverified, everything that is sent and received can be +intercepted by eavesdroppers and the servers can easily be spoofed by +impostors. + +## Untrusted input + +You should **never** run curl command lines or use curl config files provided +to you from untrusted sources. + +curl can do a lot of things, and you should only ask it do things you want and +deem correct. + +Even just accepting just the URL part without careful vetting might make curl +do things you do not like. Like accessing internal hosts, like connecting to +rogue servers that redirect to even weirder places, like using ports or +protocols that play tricks on you. + +## Command line misuse + +The command line tool and its options should be used and be expected to work +as documented. Relying on undocumented functions or side-effects is unreliable +as they may cause problems or get changed behavior between releases. + +For several command line options, you can confuse either curl or the involved +server endpoint by using characters or byte sequences for the option that are +not expected. For example, adding line feeds and/or carriage returns to inputs +can produce unexpected, invalid, or insecure results. + +## API misuse + +Applications using the libcurl API in a way that is not documented to work or +even documented to not work, is unsafe and might cause security problems. We +only guarantee secure and proper functionality when the APIs are used as +documented. + +## Local attackers already present + +When there is a local attacker present locally, curl cannot prevent such an +adversary to use curl's full potential. Possibly in malicious ways. + +## Remote attackers already present + +When there is a remote attacker already present in the server, curl cannot +protect its operations against mischief. For example, if an attacker manages +to insert a symlink in your remote upload directory the upload may cause +havoc. Maybe the attacker makes certain responses come back with unexpected +content. + +## Debug & Experiments + +We encourage users to test curl experiments and use debug code, but only in +controlled environments and setups - never in production. + +Using debug builds and experimental curl features in production is a security +risk. Do not do that. + +The same applies to scripts and software which are not installed by default +through the make install rule: they are not intended or made for production +use. + +## URL inconsistencies + +URL parser inconsistencies between browsers and curl are expected and are not +considered security vulnerabilities. The WHATWG URL Specification and RFC +3986+ (the plus meaning that it is an extended version) [are not completely +interoperable](https://github.com/bagder/docs/blob/master/URL-interop.md). + +You must never expect two independent URL parsers to treat every URL +identically. + +## Visible command line arguments + +The curl command blanks the contents of a number of command line arguments to +prevent them from appearing in process listings. It does not blank all +arguments, even though some that are not blanked might contain sensitive data. + + - not all systems allow the arguments to be blanked in the first place + - since curl blanks the argument itself they are readable for a short moment + no matter what + - virtually every argument can contain sensitive data, depending on use + - blanking all arguments would make it impractical for users to differentiate + curl command lines in process listings + +## HTTP headers in redirects + +It is powerful to provide a set of custom headers to curl. Beware that when +asking curl to follow HTTP redirects, it also sends those headers to the new +URL which might be a different server. That might do another redirect etc. + +curl makes some limited attempts to not leak credentials this way when set +using the standard curl options, but when you pass on custom headers curl +cannot know what headers or details in those headers are sensitive. + +## Verbose logs + +When asked to provide verbose output and trace logging, curl may output and +show details that are private and sensitive. Like for example raw credentials +or the password weakly disguised using base64 encoding. + +## Terminal output and escape sequences + +Content that is transferred from a server and gets displayed in a terminal by +curl may contain escape sequences or use other tricks to fool the user. Escape +sequences, moving cursor, changing color etc, is also frequently used for +good. To reduce the risk of getting fooled, save files and browse them after +download using a display method that minimizes risks. + +## Legacy dependencies + +Every curl build is made to use a range of third party libraries. Each third +party library also needs to be safe and secure for the entire operation to be +risk-free. + +Relying on legacy dependencies is a risk. + +## Weak algorithms + +curl supports several cryptographic algorithms that are considered weak, like +DES and MD5. These algorithms are still in use because some protocols and +transfer options require use of them. For example NTLM or legacy HTTP Digest +authentication. + +curl users should consider switching to servers and options that use modern +and secure algorithms. diff --git a/docs/Makefile.am b/docs/Makefile.am index 65ba28c0eb50..5349c63cc22d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -108,6 +108,7 @@ EXTRA_DIST = \ INTERNALS.md \ IPFS.md \ KNOWN_BUGS \ + KNOWN_RISKS.md \ MAIL-ETIQUETTE.md \ MANUAL.md \ options-in-versions \ From 4ebef2f0d9e3d14c31bdc342235863ef30bdf7d1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 22 Nov 2025 18:03:40 +0100 Subject: [PATCH 489/885] tool_operate: fix case of ignoring return code in single_transfer When glob_url() returns error, stop. Closes #19649 --- src/tool_operate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index b969375422c3..eea5ff37a260 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1199,7 +1199,7 @@ static CURLcode single_transfer(struct OperationConfig *config, if(u->infile) { if(!config->globoff && !glob_inuse(&state->inglob)) result = glob_url(&state->inglob, u->infile, &state->upnum, err); - if(!state->uploadfile) { + if(!result && !state->uploadfile) { if(glob_inuse(&state->inglob)) result = glob_next_url(&state->uploadfile, &state->inglob); else if(!state->upidx) { From 36b9987acbc42734b1dab0e3f96d64aba1350839 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 22 Nov 2025 19:09:42 +0100 Subject: [PATCH 490/885] tool_operate: fix a case of ignoring return code in operate() If get_args() returns error, do not overwrite the variable in the next call. Also, avoid allocating memory for the default user-agent. Closes #19650 --- src/config2setopts.c | 4 +++- src/tool_operate.c | 24 +++++++++++++----------- src/tool_paramhlp.c | 17 ----------------- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/config2setopts.c b/src/config2setopts.c index 154319231f11..d3bd39c8647c 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -37,6 +37,7 @@ #include "tool_cb_see.h" #include "tool_cb_dbg.h" #include "tool_helpers.h" +#include "tool_version.h" #define BUFFER_SIZE 102400L @@ -874,7 +875,8 @@ CURLcode config2setopts(struct OperationConfig *config, if(proto_http || proto_rtsp) { MY_SETOPT_STR(curl, CURLOPT_REFERER, config->referer); - MY_SETOPT_STR(curl, CURLOPT_USERAGENT, config->useragent); + MY_SETOPT_STR(curl, CURLOPT_USERAGENT, config->useragent ? + config->useragent : CURL_NAME "/" CURL_VERSION); } if(use_proto == proto_http || use_proto == proto_https) { diff --git a/src/tool_operate.c b/src/tool_operate.c index eea5ff37a260..69cfef96d786 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2321,17 +2321,19 @@ CURLcode operate(int argc, argv_item_t argv[]) operation = operation->next; } while(!result && operation); - /* Set the current operation pointer */ - global->current = global->first; - - /* now run! */ - result = run_all_transfers(share, result); - - if(global->ssl_sessions && feature_ssls_export) { - CURLcode r2 = tool_ssls_save(global->first, share, - global->ssl_sessions); - if(r2 && !result) - result = r2; + if(!result) { + /* Set the current operation pointer */ + global->current = global->first; + + /* now run! */ + result = run_all_transfers(share, result); + + if(global->ssl_sessions && feature_ssls_export) { + CURLcode r2 = tool_ssls_save(global->first, share, + global->ssl_sessions); + if(r2 && !result) + result = r2; + } } } diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index 2e7b98f26eb0..15293c0cc6ce 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -650,14 +650,6 @@ long delegation(const char *str) return CURLGSSAPI_DELEGATION_NONE; } -/* - * my_useragent: returns allocated string with default user agent - */ -static char *my_useragent(void) -{ - return strdup(CURL_NAME "/" CURL_VERSION); -} - #define isheadersep(x) ((((x)==':') || ((x)==';'))) /* @@ -705,15 +697,6 @@ CURLcode get_args(struct OperationConfig *config, const size_t i) if(!result && config->proxyuserpwd) result = checkpasswd("proxy", i, last, &config->proxyuserpwd); - /* Check if we have a user agent */ - if(!result && !config->useragent) { - config->useragent = my_useragent(); - if(!config->useragent) { - errorf("out of memory"); - result = CURLE_OUT_OF_MEMORY; - } - } - return result; } From f13f320dee7ea37bc01cc7b4282450b6165373c9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 22 Nov 2025 22:44:39 +0100 Subject: [PATCH 491/885] tool_msgs: make voutf() use stack instead of heap For printf()ing the message to show. Closes #19651 --- src/tool_msgs.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/tool_msgs.c b/src/tool_msgs.c index 896788745c7c..ae0b6b983586 100644 --- a/src/tool_msgs.c +++ b/src/tool_msgs.c @@ -42,18 +42,15 @@ static void voutf(const char *prefix, const char *fmt, va_list ap) { - size_t width = (get_terminal_columns() - strlen(prefix)); size_t len; char *ptr; - char *print_buffer; + char buffer[1024]; + size_t termw = get_terminal_columns(); + size_t prefw = strlen(prefix); + size_t width = termw > prefw ? termw - prefw : SIZE_MAX; DEBUGASSERT(!strchr(fmt, '\n')); - - print_buffer = curl_mvaprintf(fmt, ap); - if(!print_buffer) - return; - len = strlen(print_buffer); - - ptr = print_buffer; + len = curl_mvsnprintf(buffer, sizeof(buffer), fmt, ap); + ptr = buffer; while(len > 0) { fputs(prefix, tool_stderr); @@ -79,7 +76,6 @@ static void voutf(const char *prefix, len = 0; } } - curl_free(print_buffer); } /* From 74f7505974836f633c955dbce7514f12f78ddc5b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 23 Nov 2025 14:42:59 +0100 Subject: [PATCH 492/885] asyn-ares: remove hostname free on OOM The freeing of the already allocated hostname is done by Curl_async_shutdown(). This extra free in the RR code path made a double-free. Presumably not detected because the CI torture tests don't run HTTPS-RR enabled? Follow-up to 8d0bfe74fb Closes #19658 --- lib/asyn-ares.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index ad9147a01c34..e01f7ba3d24e 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -748,10 +748,8 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, #ifdef USE_HTTPSRR if(port != 443) { rrname = curl_maprintf("_%d_.https.%s", port, hostname); - if(!rrname) { - free(data->state.async.hostname); + if(!rrname) return NULL; - } } #endif From 29b3b1ae6d7ce561700cfe81aaba3b3ebc8a7a6a Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Sun, 23 Nov 2025 16:59:40 +0100 Subject: [PATCH 493/885] wolfssl: fix cipher list, skip 5.8.4 regression - adjust cipher list in infof() statement for min/max TLS version - skip test_17_07 for wolfSSL 5.8.4 when CHACHA20 is negotiated due to regression with homebrew build on ARM systems. Fixes #19644 Reported-by: Viktor Szakats Closes #19662 --- lib/vtls/wolfssl.c | 52 +++++++++++++++++++++-------------- tests/http/test_17_ssl_use.py | 4 +++ 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index a8090d1bf1ad..c8fc8c4add1a 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1043,62 +1043,69 @@ static CURLcode client_certificate(struct Curl_easy *data, static CURLcode ssl_version(struct Curl_easy *data, struct ssl_primary_config *conn_config, - struct wssl_ctx *wctx) + struct wssl_ctx *wctx, + int *min_version, int *max_version) { int res; + *min_version = *max_version = 0; switch(conn_config->version) { case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: case CURL_SSLVERSION_TLSv1_0: - res = wolfSSL_CTX_set_min_proto_version(wctx->ssl_ctx, TLS1_VERSION); + *min_version = TLS1_VERSION; break; case CURL_SSLVERSION_TLSv1_1: - res = wolfSSL_CTX_set_min_proto_version(wctx->ssl_ctx, TLS1_1_VERSION); + *min_version = TLS1_1_VERSION; break; case CURL_SSLVERSION_TLSv1_2: - res = wolfSSL_CTX_set_min_proto_version(wctx->ssl_ctx, TLS1_2_VERSION); + *min_version = TLS1_2_VERSION; break; #ifdef WOLFSSL_TLS13 case CURL_SSLVERSION_TLSv1_3: - res = wolfSSL_CTX_set_min_proto_version(wctx->ssl_ctx, TLS1_3_VERSION); + *min_version = TLS1_3_VERSION; break; #endif default: failf(data, "wolfSSL: unsupported minimum TLS version value"); return CURLE_SSL_CONNECT_ERROR; } - if(res != WOLFSSL_SUCCESS) { - failf(data, "wolfSSL: failed set the minimum TLS version"); - return CURLE_SSL_CONNECT_ERROR; - } switch(conn_config->version_max) { #ifdef WOLFSSL_TLS13 case CURL_SSLVERSION_MAX_TLSv1_3: - res = wolfSSL_CTX_set_max_proto_version(wctx->ssl_ctx, TLS1_3_VERSION); + *max_version = TLS1_3_VERSION; break; #endif case CURL_SSLVERSION_MAX_TLSv1_2: - res = wolfSSL_CTX_set_max_proto_version(wctx->ssl_ctx, TLS1_2_VERSION); + *max_version = TLS1_2_VERSION; break; case CURL_SSLVERSION_MAX_TLSv1_1: - res = wolfSSL_CTX_set_max_proto_version(wctx->ssl_ctx, TLS1_1_VERSION); + *max_version = TLS1_1_VERSION; break; case CURL_SSLVERSION_MAX_TLSv1_0: - res = wolfSSL_CTX_set_max_proto_version(wctx->ssl_ctx, TLS1_VERSION); + *max_version = TLS1_VERSION; break; case CURL_SSLVERSION_MAX_DEFAULT: case CURL_SSLVERSION_MAX_NONE: - res = WOLFSSL_SUCCESS; break; default: failf(data, "wolfSSL: unsupported maximum TLS version value"); return CURLE_SSL_CONNECT_ERROR; } + + res = wolfSSL_CTX_set_min_proto_version(wctx->ssl_ctx, *min_version); if(res != WOLFSSL_SUCCESS) { - failf(data, "wolfSSL: failed set the maximum TLS version"); + failf(data, "wolfSSL: failed set the minimum TLS version"); return CURLE_SSL_CONNECT_ERROR; } + + if(*max_version) { + res = wolfSSL_CTX_set_max_proto_version(wctx->ssl_ctx, *max_version); + if(res != WOLFSSL_SUCCESS) { + failf(data, "wolfSSL: failed set the maximum TLS version"); + return CURLE_SSL_CONNECT_ERROR; + } + } return CURLE_OK; } @@ -1126,6 +1133,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, #endif CURLcode result = CURLE_FAILED_INIT; unsigned char transport; + int tls_min, tls_max; DEBUGASSERT(!wctx->ssl_ctx); DEBUGASSERT(!wctx->ssl); @@ -1159,7 +1167,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, goto out; } - result = ssl_version(data, conn_config, wctx); + result = ssl_version(data, conn_config, wctx, &tls_min, &tls_max); if(result) goto out; @@ -1183,12 +1191,14 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, struct dynbuf c; curlx_dyn_init(&c, MAX_CIPHER_LEN); - if(ciphers13) - result = curlx_dyn_add(&c, ciphers13); - else - result = wssl_add_default_ciphers(TRUE, &c); + if(!tls_max || (tls_max >= TLS1_3_VERSION)) { + if(ciphers13) + result = curlx_dyn_add(&c, ciphers13); + else + result = wssl_add_default_ciphers(TRUE, &c); + } - if(!result) { + if(!result && (tls_min < TLS1_3_VERSION)) { if(ciphers12) { if(curlx_dyn_len(&c)) result = curlx_dyn_addn(&c, ":", 1); diff --git a/tests/http/test_17_ssl_use.py b/tests/http/test_17_ssl_use.py index 58ad7fdf1576..85c43d568e2c 100644 --- a/tests/http/test_17_ssl_use.py +++ b/tests/http/test_17_ssl_use.py @@ -258,6 +258,10 @@ def test_17_07_ssl_ciphers(self, env: Env, httpd, configures_httpd, curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/sslinfo' # SSL backend specifics + # see wolfSSL/wolfssl#9462 + if env.curl_uses_lib('wolfssl') and env.curl_lib_version('wolfssl') == '5.8.4' \ + and ciphers13 and 'TLS_CHACHA20_POLY1305_SHA256' in ciphers13: + pytest.skip('wolfSSL 5.8.4 is borked on ARM with CHACHA20') if env.curl_uses_lib('gnutls'): pytest.skip('GnuTLS does not support setting ciphers') elif env.curl_uses_lib('boringssl'): From 74cf7725d7c47cb66818063bbb1773b4fc6e1247 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 23 Nov 2025 09:37:41 +0000 Subject: [PATCH 494/885] GHA: update ngtcp2/ngtcp2 to v1.18.0 from v1.17.0 Closes #19655 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 223c6afbf46d..e7406c16eb58 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -53,7 +53,7 @@ env: # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com NGHTTP3_VERSION: 1.12.0 # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com - NGTCP2_VERSION: 1.17.0 + NGTCP2_VERSION: 1.18.0 # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com NGHTTP2_VERSION: 1.68.0 # renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com From 4d04a0301629d1d37476e312202c0c62b5db309e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 23 Nov 2025 18:23:32 +0000 Subject: [PATCH 495/885] GHA: update ngtcp2/nghttp3 to v1.13.0 from v1.12.0 Closes #19654 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index e7406c16eb58..a6c5972cd948 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -51,7 +51,7 @@ env: # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com - NGHTTP3_VERSION: 1.12.0 + NGHTTP3_VERSION: 1.13.0 # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com NGTCP2_VERSION: 1.18.0 # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com From b5265b24b059c1d37512d76b767ff832a68ab817 Mon Sep 17 00:00:00 2001 From: bttrfl on github <33011292+bttrfl@users.noreply.github.com> Date: Sun, 23 Nov 2025 06:55:16 +0300 Subject: [PATCH 496/885] speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE When a trasfer is paused from a read callback with a CURL_READFUNC_PAUSE code, it should be excluded from the speedcheck. Currently only transfers paused from write callbacks are excluded, because the code only checks for "recv direction" of the transfer. This commit adds a check for "send direction". Issue similar to https://github.com/curl/curl/issues/6358 Closes #19653 --- lib/speedcheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/speedcheck.c b/lib/speedcheck.c index aede06001920..b074199c37d6 100644 --- a/lib/speedcheck.c +++ b/lib/speedcheck.c @@ -42,7 +42,7 @@ void Curl_speedinit(struct Curl_easy *data) CURLcode Curl_speedcheck(struct Curl_easy *data, struct curltime now) { - if(Curl_xfer_recv_is_paused(data)) + if(Curl_xfer_recv_is_paused(data) || Curl_xfer_send_is_paused(data)) /* A paused transfer is not qualified for speed checks */ return CURLE_OK; From c77bed81a2e1325ffdebc223c27e3d1355147529 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 14:29:09 +0100 Subject: [PATCH 497/885] memdebug: produce stack trace dump with libbacktrace Enable with "configure --enable-backtrace", inserts a backtrace in the memdump log when a torture test limit is reached. Closes #19657 --- configure.ac | 16 ++++++++++++++++ lib/memdebug.c | 38 ++++++++++++++++++++++++++++++++++++++ tests/memanalyze.pl | 5 ++++- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d72b33d5287b..1481a096b2bc 100644 --- a/configure.ac +++ b/configure.ac @@ -1108,6 +1108,22 @@ AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]), AC_MSG_RESULT(no) ) +AC_MSG_CHECKING([whether to use libbacktrace]) +AC_ARG_WITH(backtrace, +AS_HELP_STRING([--enable-backtrace],[use libbacktrace when linking]), +[ case "$enableval" in + yes) + LIBS="-lbacktrace $LIBS" + AC_DEFINE(USE_BACKTRACE, 1, [if libbacktrace is in use]) + AC_MSG_RESULT(yes) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + CURL_CHECK_LIB_XNET dnl gethostbyname without lib or in the nsl lib? diff --git a/lib/memdebug.c b/lib/memdebug.c index 758c7b6aa7e2..cbda4a2be144 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -31,6 +31,10 @@ #include "urldata.h" #include "curlx/fopen.h" /* for CURLX_FOPEN_LOW(), CURLX_FREOPEN_LOW() */ +#ifdef USE_BACKTRACE +#include "backtrace.h" +#endif + /* The last 2 #include files should be in this order */ #include "curl_memory.h" #include "memdebug.h" @@ -58,6 +62,9 @@ FILE *curl_dbg_logfile = NULL; static bool registered_cleanup = FALSE; /* atexit registered cleanup */ static bool memlimit = FALSE; /* enable memory limit */ static long memsize = 0; /* set number of mallocs allowed */ +#ifdef USE_BACKTRACE +struct backtrace_state *btstate; +#endif /* LeakSantizier (LSAN) calls _exit() instead of exit() when a leak is detected on exit so the logfile must be closed explicitly or data could be lost. @@ -73,6 +80,33 @@ static void curl_dbg_cleanup(void) } curl_dbg_logfile = NULL; } +#ifdef USE_BACKTRACE +static void error_callback(void *data, const char *message, int error_number) +{ + (void)data; + if(error_number == -1) + curl_dbg_log("compile with -g\n\n"); + else + curl_dbg_log("Backtrace error %d: %s\n", error_number, message); +} + +static int full_callback(void *data, uintptr_t pc, const char *pathname, + int line_number, const char *function) +{ + (void)data; + (void)pc; + if(pathname || function || line_number) + curl_dbg_log("BT %s:%d -- %s\n", pathname, line_number, function); + return 0; +} + +static void dump_bt(void) +{ + backtrace_full(btstate, 0, full_callback, error_callback, NULL); +} +#else +#define dump_bt() /* nothing to do */ +#endif /* this sets the log filename */ void curl_dbg_memdebug(const char *logname) @@ -88,6 +122,9 @@ void curl_dbg_memdebug(const char *logname) setbuf(curl_dbg_logfile, (char *)NULL); #endif } +#ifdef USE_BACKTRACE + btstate = backtrace_create_state(NULL, 0, error_callback, NULL); +#endif if(!registered_cleanup) registered_cleanup = !atexit(curl_dbg_cleanup); } @@ -115,6 +152,7 @@ static bool countcheck(const char *func, int line, const char *source) /* log to stderr also */ curl_mfprintf(stderr, "LIMIT %s:%d %s reached memlimit\n", source, line, func); + dump_bt(); fflush(curl_dbg_logfile); /* because it might crash now */ /* !checksrc! disable ERRNOVAR 1 */ errno = ENOMEM; diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index e35b2e7abadf..2b38e5e8a424 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -130,7 +130,10 @@ sub newtotal { chomp $_; my $line = $_; $lnum++; - if($line =~ /^LIMIT ([^ ]*):(\d*) (.*)/) { + if($line =~ /^BT/) { + # back-trace, ignore + } + elsif($line =~ /^LIMIT ([^ ]*):(\d*) (.*)/) { # new memory limit test prefix my $i = $3; my ($source, $linenum) = ($1, $2); From 039fb84cb4e05cc899bb00b2c8456677516529c1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Nov 2025 13:08:37 +0100 Subject: [PATCH 498/885] tool_writeout: bail out proper on OOM Closes #19667 --- src/tool_writeout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tool_writeout.c b/src/tool_writeout.c index cdfa23a752d9..52b35345f4a9 100644 --- a/src/tool_writeout.c +++ b/src/tool_writeout.c @@ -763,6 +763,8 @@ void ourWriteOut(struct OperationConfig *config, struct per_transfer *per, variables, CURL_ARRAYSIZE(variables), sizeof(variables[0]), matchvar); } + else + break; if(wv) { switch(wv->id) { case VAR_ONERROR: From d03712169b7a02e3a9b3c3a5c060395ed37b626e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Nov 2025 12:49:15 +0100 Subject: [PATCH 499/885] cmake: add support for libbacktrace, fix two build issues Also: - memdebug: fix symbol collision in unity builds. - memdebug: fix compiler warning by making a variable static. Follow-up to c77bed81a2e1325ffdebc223c27e3d1355147529 #19657 Closes #19666 --- .github/scripts/pyspelling.words | 1 + CMake/FindLibbacktrace.cmake | 52 ++++++++++++++++++++++++++++++++ CMakeLists.txt | 15 +++++++++ Makefile.am | 1 + docs/INSTALL-CMAKE.md | 3 ++ lib/curl_config.h.cmake | 3 ++ lib/memdebug.c | 9 +++--- 7 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 CMake/FindLibbacktrace.cmake diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index 5c96701cd09b..984424200b9e 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -434,6 +434,7 @@ LDAPS ldaps LF LGTM +libbacktrace libbrotlidec libc libcurl diff --git a/CMake/FindLibbacktrace.cmake b/CMake/FindLibbacktrace.cmake new file mode 100644 index 000000000000..444c5f90fdcf --- /dev/null +++ b/CMake/FindLibbacktrace.cmake @@ -0,0 +1,52 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### +# Find the libbacktrace library +# +# Input variables: +# +# - `LIBBACKTRACE_INCLUDE_DIR`: Absolute path to libbacktrace include directory. +# - `LIBBACKTRACE_LIBRARY`: Absolute path to `libbacktrace` library. +# +# Result variables: +# +# - `LIBBACKTRACE_FOUND`: System has libbacktrace. +# - `LIBBACKTRACE_INCLUDE_DIRS`: The libbacktrace include directories. +# - `LIBBACKTRACE_LIBRARIES`: The libbacktrace library names. + +find_path(LIBBACKTRACE_INCLUDE_DIR NAMES "backtrace.h") +find_library(LIBBACKTRACE_LIBRARY NAMES "backtrace" "libbacktrace") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libbacktrace + REQUIRED_VARS + LIBBACKTRACE_INCLUDE_DIR + LIBBACKTRACE_LIBRARY +) + +if(LIBBACKTRACE_FOUND) + set(LIBBACKTRACE_INCLUDE_DIRS ${LIBBACKTRACE_INCLUDE_DIR}) + set(LIBBACKTRACE_LIBRARIES ${LIBBACKTRACE_LIBRARY}) +endif() + +mark_as_advanced(LIBBACKTRACE_INCLUDE_DIR LIBBACKTRACE_LIBRARY) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20336e097c0e..5d6e7ca3e667 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1421,6 +1421,21 @@ if(CURL_USE_GSSAPI) endif() endif() +# libbacktrace +option(CURL_USE_LIBBACKTRACE "Use libbacktrace. Requires build with TrackMemory and DWARF debug information." OFF) +if(CURL_USE_LIBBACKTRACE) + if(NOT ENABLE_CURLDEBUG) + message(FATAL_ERROR "libbacktrace requires TrackMemory enabled") + endif() + if(NOT CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)") + message(FATAL_ERROR "libbacktrace requires debug information") + endif() + find_package(Libbacktrace REQUIRED) + list(APPEND CURL_LIBS ${LIBBACKTRACE_LIBRARIES}) + include_directories(SYSTEM ${LIBBACKTRACE_INCLUDE_DIRS}) + set(USE_BACKTRACE ON) +endif() + # libuv option(CURL_USE_LIBUV "Use libuv for event-based tests" OFF) if(CURL_USE_LIBUV) diff --git a/Makefile.am b/Makefile.am index 1ed54423e532..d289f33d5756 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,6 +37,7 @@ CMAKE_DIST = \ CMake/FindGnuTLS.cmake \ CMake/FindGSS.cmake \ CMake/FindLDAP.cmake \ + CMake/FindLibbacktrace.cmake \ CMake/FindLibgsasl.cmake \ CMake/FindLibidn2.cmake \ CMake/FindLibpsl.cmake \ diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index bd9555b61461..026db0762892 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -355,6 +355,7 @@ Details via CMake - `CURL_USE_GNUTLS`: Enable GnuTLS for SSL/TLS. Default: `OFF` - `CURL_USE_GSASL`: Use libgsasl. Default: `OFF` - `CURL_USE_GSSAPI`: Use GSSAPI implementation. Default: `OFF` +- `CURL_USE_LIBBACKTRACE`: Use [libbacktrace](https://github.com/ianlancetaylor/libbacktrace). Requires build with TrackMemory and DWARF debug information. Default: `OFF` - `CURL_USE_LIBPSL`: Use libpsl. Default: `ON` - `CURL_USE_LIBSSH2`: Use libssh2. Default: `ON` - `CURL_USE_LIBSSH`: Use libssh. Default: `OFF` @@ -411,6 +412,8 @@ Details via CMake - `LDAP_INCLUDE_DIR`: Absolute path to LDAP include directory. - `LDAP_LIBRARY`: Absolute path to `ldap` library. - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library. +- `LIBBACKTRACE_INCLUDE_DIR`: Absolute path to libbacktrace include directory (https://github.com/ianlancetaylor/libbacktrace). +- `LIBBACKTRACE_LIBRARY`: Absolute path to `libbacktrace` library. - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory. - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library. - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory. diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index acbb428575cc..37ec3d9a6551 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -730,6 +730,9 @@ ${SIZEOF_TIME_T_CODE} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UV_H 1 +/* if libbacktrace is in use */ +#cmakedefine USE_BACKTRACE 1 + /* Define to 1 if you do not want the OpenSSL configuration to be loaded automatically */ #cmakedefine CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1 diff --git a/lib/memdebug.c b/lib/memdebug.c index cbda4a2be144..6ec292654f80 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -63,7 +63,7 @@ static bool registered_cleanup = FALSE; /* atexit registered cleanup */ static bool memlimit = FALSE; /* enable memory limit */ static long memsize = 0; /* set number of mallocs allowed */ #ifdef USE_BACKTRACE -struct backtrace_state *btstate; +static struct backtrace_state *btstate; #endif /* LeakSantizier (LSAN) calls _exit() instead of exit() when a leak is detected @@ -81,7 +81,8 @@ static void curl_dbg_cleanup(void) curl_dbg_logfile = NULL; } #ifdef USE_BACKTRACE -static void error_callback(void *data, const char *message, int error_number) +static void error_bt_callback(void *data, const char *message, + int error_number) { (void)data; if(error_number == -1) @@ -102,7 +103,7 @@ static int full_callback(void *data, uintptr_t pc, const char *pathname, static void dump_bt(void) { - backtrace_full(btstate, 0, full_callback, error_callback, NULL); + backtrace_full(btstate, 0, full_callback, error_bt_callback, NULL); } #else #define dump_bt() /* nothing to do */ @@ -123,7 +124,7 @@ void curl_dbg_memdebug(const char *logname) #endif } #ifdef USE_BACKTRACE - btstate = backtrace_create_state(NULL, 0, error_callback, NULL); + btstate = backtrace_create_state(NULL, 0, error_bt_callback, NULL); #endif if(!registered_cleanup) registered_cleanup = !atexit(curl_dbg_cleanup); From 537987d8c66aac6ec96cde098ab45525e156b54e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 22 Nov 2025 01:20:44 +0100 Subject: [PATCH 500/885] curl_fopen: do not pass invalid mode flags to `open()` on Windows The safe (`_s`) variants of the Windows `open()` reject these flags, while the classic ones silently accepted them. Also: - also drop the now unused `stat()` call on Windows. - replace magic number with their equivalent Windows and Unix-specific `S_*` macros. Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen https://learn.microsoft.com/cpp/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32 Cherry-picked from #19643 Closes #19645 --- lib/curl_fopen.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/curl_fopen.c b/lib/curl_fopen.c index fd0c7c65d201..f16b3d6cde0d 100644 --- a/lib/curl_fopen.c +++ b/lib/curl_fopen.c @@ -93,11 +93,14 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, CURLcode result = CURLE_WRITE_ERROR; unsigned char randbuf[41]; char *tempstore = NULL; +#ifndef _WIN32 struct_stat sb; +#endif int fd = -1; char *dir = NULL; *tempname = NULL; +#ifndef _WIN32 *fh = curlx_fopen(filename, FOPEN_WRITETEXT); if(!*fh) goto fail; @@ -105,6 +108,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, return CURLE_OK; } curlx_fclose(*fh); +#endif *fh = NULL; result = Curl_rand_alnum(data, randbuf, sizeof(randbuf)); @@ -125,13 +129,16 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, } result = CURLE_WRITE_ERROR; -#if (defined(ANDROID) || defined(__ANDROID__)) && \ +#ifdef _WIN32 + fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL, + S_IREAD | S_IWRITE); +#elif (defined(ANDROID) || defined(__ANDROID__)) && \ (defined(__i386__) || defined(__arm__)) fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL, - (mode_t)(0600 | sb.st_mode)); + (mode_t)(S_IRUSR | S_IWUSR | sb.st_mode)); #else fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL, - 0600 | sb.st_mode); + S_IRUSR | S_IWUSR | sb.st_mode); #endif if(fd == -1) goto fail; From 82013066a6149aa906b1fda3f8f1f27bd272a6c2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 22 Nov 2025 01:42:15 +0100 Subject: [PATCH 501/885] file: do not pass invalid mode flags to `open()` on upload (Windows) Ref: https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen Ref: #19645 Cherry-picked from #19643 Closes #19647 --- lib/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/file.c b/lib/file.c index 826bed6d802c..69370690746e 100644 --- a/lib/file.c +++ b/lib/file.c @@ -343,7 +343,10 @@ static CURLcode file_upload(struct Curl_easy *data, else mode |= O_TRUNC; -#if (defined(ANDROID) || defined(__ANDROID__)) && \ +#ifdef _WIN32 + fd = curlx_open(file->path, mode, + data->set.new_file_perms & (_S_IREAD | _S_IWRITE)); +#elif (defined(ANDROID) || defined(__ANDROID__)) && \ (defined(__i386__) || defined(__arm__)) fd = curlx_open(file->path, mode, (mode_t)data->set.new_file_perms); #else From 1eca08a5417740320501448b64e8584de349126c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 15:55:33 +0100 Subject: [PATCH 502/885] curlx/strerr: use `strerror_s()` on Windows To replace deprecated, unsafe `sys_nerr`, `sys_errlist` global variables with the function suggested by the CRT warning silenced via `_CRT_SECURE_NO_WARNINGS`: ``` lib/curlx/strerr.c(291): warning C4996: '__sys_nerr': This function or variable may be unsafe. Consider using strerror instead. lib/curlx/strerr.c(292): warning C4996: '__sys_errlist': This function or variable may be unsafe. Consider using strerror instead. ``` (where `strerror` in turn suggests `strerror_s`...) Upside: returns an error and has a Unicode variant. Downaside: happy to return success when passing unrecognized error codes. Work it around by looking for the string "Unknown error" returned in such cases and falling back to other methods to retrieve a description. Refs: https://learn.microsoft.com/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr https://learn.microsoft.com/cpp/c-runtime-library/reference/strerror-s-strerror-s-wcserror-s-wcserror-s Closes #19646 --- lib/curl_setup.h | 6 +++--- lib/curlx/strerr.c | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index db438a8b0a47..886a8814936a 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -95,9 +95,9 @@ unlink(), etc. */ #endif #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for __sys_errlist, __sys_nerr, _open(), - _wfopen(), _wopen(), fopen(), freopen(), - getenv(), gmtime(), sprintf(), strcpy(), +#define _CRT_SECURE_NO_WARNINGS /* for _open(), _wfopen(), _wopen(), fopen(), + freopen(), getenv(), gmtime(), sprintf(), + strcpy(), in tests: localtime(), open(), sscanf() */ #endif #endif /* _MSC_VER */ diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index 047588ed183a..376f68b0b20d 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -287,17 +287,12 @@ const char *curlx_strerror(int err, char *buf, size_t buflen) *buf = '\0'; #ifdef _WIN32 - /* 'sys_nerr' is the maximum errno number, it is not widely portable */ - if(err >= 0 && err < sys_nerr) - SNPRINTF(buf, buflen, "%s", sys_errlist[err]); - else { - if( + if((!strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) && #ifdef USE_WINSOCK - !get_winsock_error(err, buf, buflen) && + !get_winsock_error(err, buf, buflen) && #endif - !curlx_get_winapi_error((DWORD)err, buf, buflen)) - SNPRINTF(buf, buflen, "Unknown error %d (%#x)", err, err); - } + !curlx_get_winapi_error((DWORD)err, buf, buflen)) + SNPRINTF(buf, buflen, "Unknown error %d (%#x)", err, err); #else /* !_WIN32 */ #if defined(HAVE_STRERROR_R) && defined(HAVE_POSIX_STRERROR_R) From 3696ac4e29836dd3e5e3b2101d53294846a6ec1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:43:14 +0000 Subject: [PATCH 503/885] GHA: update dependency ngtcp2/nghttp3 to v1.13.1 Closes #19664 --- .github/workflows/http3-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index a6c5972cd948..3f52c146563e 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -51,7 +51,7 @@ env: # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com - NGHTTP3_VERSION: 1.13.0 + NGHTTP3_VERSION: 1.13.1 # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com NGTCP2_VERSION: 1.18.0 # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com From fa1270a0d1c8234929e1d399ff06ef8f31a2b0b9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Nov 2025 14:43:49 +0100 Subject: [PATCH 504/885] vquic: do not pass invalid mode flags to `open()` (Windows) Follow-up to 82013066a6149aa906b1fda3f8f1f27bd272a6c2 #19647 Closes #19670 --- lib/vquic/vquic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 539d9bfeae36..562a99e4fee0 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -665,7 +665,11 @@ CURLcode Curl_qlogdir(struct Curl_easy *data, if(!result) { int qlogfd = curlx_open(curlx_dyn_ptr(&fname), O_WRONLY | O_CREAT | CURL_O_BINARY, - data->set.new_file_perms); + data->set.new_file_perms +#ifdef _WIN32 + & (_S_IREAD | _S_IWRITE) +#endif + ); if(qlogfd != -1) *qlogfdp = qlogfd; } From 2b7515ae8e1d448fd6da2fddb74d36c4867cca80 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Nov 2025 14:51:18 +0100 Subject: [PATCH 505/885] tftpd: fix/tidy up `open()` mode flags - replace 0777 with `S_I*` macros. - fix to not pass invalid flags on Windows. Follow-up to 537987d8c66aac6ec96cde098ab45525e156b54e #19645 Closes #19671 --- tests/server/tftpd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index dd7291c7ceb0..6631e2439b96 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -445,7 +445,15 @@ static ssize_t write_behind(struct testcase *test, int convert) if(!test->ofile) { char outfile[256]; snprintf(outfile, sizeof(outfile), "%s/upload.%ld", logdir, test->testno); - test->ofile = open(outfile, O_CREAT|O_RDWR|CURL_O_BINARY, 0777); + test->ofile = open(outfile, O_CREAT | O_RDWR | CURL_O_BINARY, +#ifdef _WIN32 + S_IREAD | S_IWRITE +#else + S_IRUSR | S_IWUSR | S_IXUSR | + S_IRGRP | S_IWGRP | S_IXGRP | + S_IROTH | S_IWOTH | S_IXOTH +#endif + ); if(test->ofile == -1) { logmsg("Could not create and/or open file %s for upload!", outfile); return -1; /* failure! */ From 2b57d415e5a0d0afceeb90c54b45a1644a4f8a40 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Nov 2025 19:38:34 +0100 Subject: [PATCH 506/885] content_encoding: drop a guard for brotli 1.0.0+ macro Also add comment with version requirement for the other guard. Refs: https://github.com/google/brotli/commit/19d86fb9a60aa7034d4981b69a5b656f5b90017e https://github.com/google/brotli/commit/03739d2b113afe60638069c4e1604dc2ac27380d Ref: #19672 Follow-up to e639d4ca4d794c222dde4680d9ff35053f501042 Closes #19673 --- lib/content_encoding.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/content_encoding.c b/lib/content_encoding.c index b724b576b41d..f128f7565f77 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -384,12 +384,10 @@ static CURLcode brotli_map_error(BrotliDecoderErrorCode be) case BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: case BROTLI_DECODER_ERROR_FORMAT_PADDING_1: case BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -#ifdef BROTLI_DECODER_ERROR_COMPOUND_DICTIONARY +#ifdef BROTLI_DECODER_ERROR_COMPOUND_DICTIONARY /* brotli v1.1.0+ */ case BROTLI_DECODER_ERROR_COMPOUND_DICTIONARY: #endif -#ifdef BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET case BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -#endif case BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: return CURLE_BAD_CONTENT_ENCODING; case BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: From be4462a415a96c203be5be9c59d956b24d43f5c2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Nov 2025 18:45:53 +0100 Subject: [PATCH 507/885] INTERNALS.md: add brotli and zstd version info And alpha-sort the dependency list Closes #19672 --- docs/INTERNALS.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index e9bb82a33d8e..acc4506e6722 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -24,19 +24,21 @@ versions of libs and build tools. We aim to support these or later versions. - - OpenSSL 3.0.0 (2021-09-07) - - LibreSSL 2.9.1 (2019-04-22) - - GnuTLS 3.6.5 (2018-12-01) - - mbedTLS 3.2.0 (2022-07-11) - - zlib 1.2.5.2 (2011-12-11) - - libssh2 1.9.0 (2019-06-20) + - brotli 1.0.0 (2017-09-21) - c-ares 1.6.0 (2008-12-09) - - libssh 0.9.0 (2019-06-28) + - GnuTLS 3.6.5 (2018-12-01) - libidn2 2.0.0 (2017-03-29) - - wolfSSL 3.4.6 (2017-09-22) - - OpenLDAP 2.0 (2000-08-01) + - LibreSSL 2.9.1 (2019-04-22) + - libssh 0.9.0 (2019-06-28) + - libssh2 1.9.0 (2019-06-20) + - mbedTLS 3.2.0 (2022-07-11) - MIT Kerberos 1.3 (2003-07-31) - nghttp2 1.15.0 (2016-09-25) + - OpenLDAP 2.0 (2000-08-01) + - OpenSSL 3.0.0 (2021-09-07) + - wolfSSL 3.4.6 (2017-09-22) + - zlib 1.2.5.2 (2011-12-11) + - zstd 1.0 (2016-08-31) ## Build tools From bfde7811213d482789683094510f0680ee0291e4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Nov 2025 23:32:59 +0100 Subject: [PATCH 508/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 56 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3af5605c8dc6..217f8c750446 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,22 +4,27 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3546 + Contributors: 3549 This release includes the following changes: o build: drop support for VS2008 (Windows) [62] o build: drop Windows CE / CeGCC support [69] + o gnutls: drop support for GnuTLS < 3.6.5 [167] + o gnutls: implement CURLOPT_CAINFO_BLOB [168] o openssl: bump minimum OpenSSL version to 3.0.0 [60] This release includes the following bugfixes: o _PROGRESS.md: add the E unit, mention kibibyte [24] o AmigaOS: increase minimum stack size for tool_main [137] + o apple-sectrust: always ask when `native_ca_store` is in use [162] + o asyn-ares: remove hostname free on OOM [122] o asyn-thrdd: release rrname if ares_init_options fails [41] o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] o badwords: fix issues found in scripts and other files [142] o badwords: fix issues found in tests [156] + o build: add build-level `CURL_DISABLE_TYPECHECK` options [163] o build: exclude clang prereleases from compiler warning options [154] o build: tidy-up MSVC CRT warning suppression macros [140] o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74] @@ -39,6 +44,7 @@ This release includes the following bugfixes: o cookie: return error on OOM [131] o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] + o curl_fopen: do not pass invalid mode flags to `open()` on Windows [84] o curl_sasl: make Curl_sasl_decode_mech compare case insensitively [160] o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124] o curl_setup.h: drop stray `#undef stat` (Windows) [103] @@ -47,6 +53,8 @@ This release includes the following bugfixes: o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example + o curlx/strerr: use `strerror_s()` on Windows [75] + o curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows) [143] o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] o DISTROS.md: add OpenBSD [126] @@ -56,6 +64,7 @@ This release includes the following bugfixes: o examples/multithread: fix race condition [101] o examples: make functions/data static where missing [139] o examples: tidy-up headers and includes [138] + o file: do not pass invalid mode flags to `open()` on upload (Windows) [83] o ftp: refactor a piece of code by merging the repeated part [40] o ftp: remove #ifdef for define that is always defined [76] o getinfo: improve perf in debug mode [99] @@ -76,6 +85,7 @@ This release includes the following bugfixes: o lib: error for OOM when extracting URL query [127] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] + o lib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows) [164] o libssh2: add paths to error messages for quote commands [114] o libssh2: cleanup ssh_force_knownhost_key_type [64] o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] @@ -87,10 +97,12 @@ This release includes the following bugfixes: o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] + o multi: make max_total_* members size_t [158] o noproxy: replace atoi with curlx_str_number [67] o openssl: exit properly on OOM when getting certchain [133] o openssl: fix a potential memory leak of bio_out [150] o openssl: fix a potential memory leak of params.cert [151] + o openssl: no verify failf message unless strict [166] o openssl: release ssl_session if sess_reuse_cb fails [43] o openssl: remove code handling default version [28] o OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs [94] @@ -114,7 +126,9 @@ This release includes the following bugfixes: o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] o setopt: when setting bad protocols, don't store them [9] o sftp: fix range downloads in both SSH backends [82] + o smb: fix a size check to be overflow safe [161] o socks_sspi: use free() not FreeContextBuffer() [93] + o speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE [113] o telnet: replace atoi for BINARY handling with curlx_str_number [66] o TEST-SUITE.md: correct the man page's path [136] o test07_22: fix flakiness [95] @@ -125,21 +139,27 @@ This release includes the following bugfixes: o tests/server: do not fall back to original data file in `test2fopen()` [32] o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110] o tftp: release filename if conn_get_remote_addr fails [42] + o tftpd: fix/tidy up `open()` mode flags [57] o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] o tool: consider (some) curl_easy_setopt errors fatal [7] o tool_cfgable: free ssl-sessions at exit [123] o tool_getparam: verify that a file exists for some options [134] o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] + o tool_msgs: make voutf() use stack instead of heap [125] o tool_operate: exit on curl_share_setopt errors [108] + o tool_operate: fix a case of ignoring return code in operate() [128] + o tool_operate: fix case of ignoring return code in single_transfer [129] o tool_operate: remove redundant condition [19] o tool_operate: use curlx_str_number instead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] o tool_urlglob: clean up used memory on errors better [44] + o tool_writeout: bail out proper on OOM [104] o url: if OOM in parse_proxy() return error [132] o urlapi: fix mem-leaks in curl_url_get error paths [22] o verify-release: update to avoid shellcheck warning SC2034 [88] o vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally [96] + o vquic: do not pass invalid mode flags to `open()` (Windows) [58] o vtls: fix CURLOPT_CAPATH use [51] o vtls: handle possible malicious certs_num from peer [53] o vtls: pinned key check [98] @@ -147,6 +167,7 @@ This release includes the following bugfixes: o wolfSSL: able to differentiate between IP and DNS in alt names [13] o wolfssl: avoid NULL dereference in OOM situation [77] o wolfssl: fix a potential memory leak of session [6] + o wolfssl: fix cipher list, skip 5.8.4 regression [117] o wolfssl: simplify wssl_send_earlydata [111] This release includes the following known bugs: @@ -160,6 +181,7 @@ For all changes ever done in curl: Planned upcoming removals include: o OpenSSL-QUIC + o RTMP support o Support for c-ares versions before 1.16.0 o Support for Windows XP/2003 @@ -168,14 +190,15 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Aleksandr Sergeev, Andrew Kirillov, boingball, Brad King, Christian Schmitz, - Dan Fandrich, Daniel McCarney, Daniel Stenberg, Fd929c2CE5fA on github, - Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Leonardo Taccari, - letshack9707 on hackerone, Marcel Raad, nait-furry, Nick Korepanov, + Aleksandr Sergeev, Andrew Kirillov, boingball, Brad King, bttrfl on github, + Christian Schmitz, Dan Fandrich, Daniel McCarney, Daniel Stenberg, + Fd929c2CE5fA on github, ffath-vo on github, Gisle Vanem, Jiyong Yang, + Juliusz Sosinowicz, Leonardo Taccari, letshack9707 on hackerone, + Marc Aldorasi, Marcel Raad, nait-furry, ncaklovic on github, Nick Korepanov, Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot], Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang - (29 contributors) + (33 contributors) References to bug reports and discussions on issues: @@ -233,6 +256,8 @@ References to bug reports and discussions on issues: [54] = https://curl.se/bug/?i=19399 [55] = https://curl.se/bug/?i=19336 [56] = https://curl.se/bug/?i=19396 + [57] = https://curl.se/bug/?i=19671 + [58] = https://curl.se/bug/?i=19670 [59] = https://curl.se/bug/?i=19630 [60] = https://curl.se/bug/?i=18330 [61] = https://curl.se/bug/?i=19484 @@ -248,6 +273,7 @@ References to bug reports and discussions on issues: [71] = https://curl.se/bug/?i=19461 [73] = https://curl.se/bug/?i=19359 [74] = https://curl.se/bug/?i=19465 + [75] = https://curl.se/bug/?i=19646 [76] = https://curl.se/bug/?i=19463 [77] = https://curl.se/bug/?i=19459 [78] = https://curl.se/bug/?i=19431 @@ -255,6 +281,8 @@ References to bug reports and discussions on issues: [80] = https://curl.se/bug/?i=19452 [81] = https://curl.se/bug/?i=19425 [82] = https://curl.se/bug/?i=19460 + [83] = https://curl.se/bug/?i=19647 + [84] = https://curl.se/bug/?i=19645 [86] = https://curl.se/bug/?i=19451 [87] = https://curl.se/bug/?i=19450 [88] = https://curl.se/bug/?i=19449 @@ -273,6 +301,7 @@ References to bug reports and discussions on issues: [101] = https://curl.se/bug/?i=19524 [102] = https://curl.se/bug/?i=19518 [103] = https://curl.se/bug/?i=19519 + [104] = https://curl.se/bug/?i=19667 [105] = https://curl.se/bug/?i=19517 [106] = https://curl.se/bug/?i=19144 [107] = https://curl.se/bug/?i=19512 @@ -280,15 +309,21 @@ References to bug reports and discussions on issues: [110] = https://curl.se/bug/?i=19510 [111] = https://curl.se/bug/?i=19509 [112] = https://curl.se/bug/?i=19495 + [113] = https://curl.se/bug/?i=19653 [114] = https://curl.se/bug/?i=19605 + [117] = https://curl.se/bug/?i=19644 [118] = https://curl.se/bug/?i=19493 [119] = https://curl.se/bug/?i=19483 [120] = https://curl.se/bug/?i=19506 [121] = https://curl.se/bug/?i=19606 + [122] = https://curl.se/bug/?i=19658 [123] = https://curl.se/bug/?i=19602 [124] = https://curl.se/bug/?i=19597 + [125] = https://curl.se/bug/?i=19651 [126] = https://curl.se/bug/?i=19596 [127] = https://curl.se/bug/?i=19594 + [128] = https://curl.se/bug/?i=19650 + [129] = https://curl.se/bug/?i=19649 [130] = https://curl.se/bug/?i=19593 [131] = https://curl.se/bug/?i=19591 [132] = https://curl.se/bug/?i=19590 @@ -300,6 +335,7 @@ References to bug reports and discussions on issues: [139] = https://curl.se/bug/?i=19579 [140] = https://curl.se/bug/?i=19175 [142] = https://curl.se/bug/?i=19572 + [143] = https://curl.se/bug/?i=19581 [144] = https://curl.se/bug/?i=19571 [146] = https://curl.se/bug/?i=19543 [147] = https://curl.se/bug/?i=19568 @@ -312,5 +348,13 @@ References to bug reports and discussions on issues: [154] = https://curl.se/bug/?i=19566 [156] = https://curl.se/bug/?i=19541 [157] = https://curl.se/bug/?i=19520 + [158] = https://curl.se/bug/?i=19618 [159] = https://curl.se/bug/?i=19540 [160] = https://curl.se/bug/?i=19535 + [161] = https://curl.se/bug/?i=19640 + [162] = https://curl.se/bug/?i=19636 + [163] = https://curl.se/bug/?i=19637 + [164] = https://curl.se/bug/?i=19589 + [166] = https://curl.se/bug/?i=19615 + [167] = https://curl.se/bug/?i=19609 + [168] = https://curl.se/bug/?i=19612 From 24b36fdd1585ea22e5e1f00791f1c20423433cde Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 11 Nov 2025 14:26:48 +0100 Subject: [PATCH 509/885] ratelimit: redesign Description of how this works in `docs/internal/RATELIMITS.ms`. Notable implementation changes: - KEEP_SEND_PAUSE/KEEP_SEND_HOLD and KEEP_RECV_PAUSE/KEEP_RECV_HOLD no longer exist. Pausing is down via blocked the new rlimits. - KEEP_SEND_TIMED no longer exists. Pausing "100-continue" transfers is done in the new `Curl_http_perform_pollset()` method. - HTTP/2 rate limiting implemented via window updates. When transfer initiaiting connection has a ratelimit, adjust the initial window size - HTTP/3 ngtcp2 rate limitin implemnented via ack updates - HTTP/3 quiche does not seem to support this via its API - the default progress-meter has been improved for accuracy in "current speed" results. pytest speed tests have been improved. Closes #19384 --- docs/Makefile.am | 1 + docs/internals/RATELIMITS.md | 100 +++++++++++ lib/Makefile.inc | 4 +- lib/cf-h1-proxy.c | 13 +- lib/file.c | 19 +- lib/ftp.c | 9 +- lib/http.c | 36 ++-- lib/http.h | 6 +- lib/http2.c | 113 ++++++++---- lib/imap.c | 5 +- lib/ldap.c | 2 +- lib/multi.c | 278 +++++++++++++++-------------- lib/multi_ev.c | 2 +- lib/multiif.h | 3 +- lib/pingpong.c | 7 +- lib/pop3.c | 5 +- lib/progress.c | 317 +++++++++++++++++---------------- lib/progress.h | 24 ++- lib/ratelimit.c | 200 +++++++++++++++++++++ lib/ratelimit.h | 92 ++++++++++ lib/request.c | 13 +- lib/request.h | 1 + lib/rtsp.c | 5 +- lib/select.c | 15 +- lib/select.h | 14 +- lib/sendf.c | 23 +++ lib/setopt.c | 2 + lib/smtp.c | 5 +- lib/speedcheck.c | 80 --------- lib/speedcheck.h | 35 ---- lib/telnet.c | 7 +- lib/tftp.c | 11 +- lib/transfer.c | 87 ++++----- lib/transfer.h | 3 - lib/url.c | 6 +- lib/urldata.h | 43 ++--- lib/vquic/curl_ngtcp2.c | 53 ++++-- lib/vssh/libssh.c | 12 +- lib/vssh/libssh2.c | 11 +- lib/vtls/schannel.c | 5 +- lib/ws.c | 8 +- tests/data/Makefile.am | 2 +- tests/data/test3216 | 19 ++ tests/http/test_02_download.py | 14 +- tests/http/test_07_upload.py | 4 +- tests/unit/Makefile.inc | 2 +- tests/unit/unit1606.c | 6 +- tests/unit/unit3216.c | 103 +++++++++++ 48 files changed, 1148 insertions(+), 677 deletions(-) create mode 100644 docs/internals/RATELIMITS.md create mode 100644 lib/ratelimit.c create mode 100644 lib/ratelimit.h delete mode 100644 lib/speedcheck.c delete mode 100644 lib/speedcheck.h create mode 100644 tests/data/test3216 create mode 100644 tests/unit/unit3216.c diff --git a/docs/Makefile.am b/docs/Makefile.am index 5349c63cc22d..da5812a0eb76 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -63,6 +63,7 @@ INTERNALDOCS = \ internals/MULTI-EV.md \ internals/NEW-PROTOCOL.md \ internals/PORTING.md \ + internals/RATELIMITS.md \ internals/README.md \ internals/SCORECARD.md \ internals/SPLAY.md \ diff --git a/docs/internals/RATELIMITS.md b/docs/internals/RATELIMITS.md new file mode 100644 index 000000000000..af72211b7874 --- /dev/null +++ b/docs/internals/RATELIMITS.md @@ -0,0 +1,100 @@ + + +# Rate Limiting Transfers + +Rate limiting a transfer means that no more than "n bytes per second" +shall be sent or received. It can be set individually for both directions +via `CURLOPT_MAX_RECV_SPEED_LARGE` and `CURLOPT_MAX_SEND_SPEED_LARGE`. These +options may be adjusted for an ongoing transfer. + +### Implementation Base + +`ratelimit.[ch]` implements `struct Curl_rlimit` and functions to manage +such limits. It has the following properties: + +* `rate_per_sec`: how many "tokens" can be used per second, 0 for infinite. +* `tokens`: the currently available tokens to consume +* `burst_per_sec`: an upper limit on tokens available +* `ts`: the microsecond timestamp of the last tokens update +* `spare_us`: elapsed microseconds that have not counted yet for a token update +* `blocked`: if the limit is blocked + +Tokens can be *drained* from an `rlimit`. This reduces `tokens`, even to +negative values. To enforce the limits, tokens should not be drained +further when they reach 0, but such things may happen. + +An `rlimit`can be asked how long to wait until `tokens` are positive again. +This is given in milliseconds. When token are available, this wait +time is 0. + +Ideally a user of `rlimit` would consume the available tokens to 0, then +get a wait times of 1000ms, after which the set rate of tokens has +regenerated. Rinse and repeat. + +Should a user drain twice the amount of the rate, tokens are negative +and the wait time is 2 seconds. The `spare_us` account for the +time that has passed for the consumption. When a user takes 250ms to +consume the rate, the wait time is then 750ms. + +When a user drains nothing for two seconds, the available tokens would +grow to twice the rate, unless a burst rate is set. + +Finally, an `rlimit` may be set to `blocked` and later unblocked again. +A blocked `rlimit` has no tokens available. This works also when the rate +is unlimited (`rate_per_sec` set to 0). + +### Downloads + +`rlimit` is in `data->progress.dl.rlimit`. `setopt.c` initializes it whenever +the application sets `CURLOPT_MAX_RECV_SPEED_LARGE`. This may be done +in the middle of a transfer. + +`rlimit` tokens are drained in the "protocol" client writer. Checks for +capacity depend on the protocol: + +* HTTP and other plain protocols: `transfer.c:sendrecv_dl()` reads only +up to capacity. +* HTTP/2: capacity is used to adjust a stream's window size. Since all +streams start with `64kb`, `rlimit` takes a few seconds to take effect. +* HTTP/3: ngtcp2 acknowledges stream data according to capacity. It +keeps track of bytes not acknowledged yet. This has the same effect as HTTP/2 +window sizes. + +(The quiche API does not offer control of `ACK`s and `rlimits` for download +do not work in that backend.) + +### Uploads + +`rlimit` is in `data->progress.ul.rlimit`. `setopt.c` initializes it whenever +the application sets `CURLOPT_MAX_SEND_SPEED_LARGE`. This may be done +in the middle of a transfer. + +The upload capacity is checked in `Curl_client_read()` and readers are +only asked to read bytes up to the `rlimit` capacity. This limits upload +of data for all protocols in the same way. + +### Pause/Unpause + +Pausing of up-/downloads sets the corresponding `rlimit` to blocked. Unpausing +removes that block. + +### Suspending transfers + +While obeying the `rlimit` for up-/download leads to the desired transfer +rates, the other issue that needs care is CPU consumption. + +`rlimits` are inspected when computing the "pollset" of a transfer. When +a transfer wants to send, but not send tokens are available, the `POLLOUT` +is removed from the pollset. Same for receiving. + +For a transfer that is, due to `rlimit`, not able to progress, the pollset +is then empty. No socket events are monitored, no CPU activity +happens. For paused transfers, this is sufficient. + +Draining `rlimit` happens when a transfer is in `PERFORM` state and +exhausted limits cause the timer `TOOFAST` to be set. When the fires, +the transfer runs again and `rlimit`s are re-evaluated. diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 4bdf293f8976..9c9d5c918691 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -234,6 +234,7 @@ LIB_CFILES = \ progress.c \ psl.c \ rand.c \ + ratelimit.c \ rename.c \ request.c \ rtsp.c \ @@ -249,7 +250,6 @@ LIB_CFILES = \ socks.c \ socks_gssapi.c \ socks_sspi.c \ - speedcheck.c \ splay.c \ strcase.c \ strdup.c \ @@ -366,6 +366,7 @@ LIB_HFILES = \ progress.h \ psl.h \ rand.h \ + ratelimit.h \ rename.h \ request.h \ rtsp.h \ @@ -383,7 +384,6 @@ LIB_HFILES = \ sockaddr.h \ socketpair.h \ socks.h \ - speedcheck.h \ splay.h \ strcase.h \ strdup.h \ diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 91d690e31a9e..985500f23e06 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -384,8 +384,8 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, /* socket buffer drained, return */ return CURLE_OK; - if(Curl_pgrsUpdate(data)) - return CURLE_ABORTED_BY_CALLBACK; + if(!result) + result = Curl_pgrsUpdate(data); if(result) { ts->keepon = KEEPON_DONE; @@ -565,10 +565,8 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, /* read what is there */ CURL_TRC_CF(data, cf, "CONNECT receive"); result = recv_CONNECT_resp(cf, data, ts, &done); - if(Curl_pgrsUpdate(data)) { - result = CURLE_ABORTED_BY_CALLBACK; - goto out; - } + if(!result) + result = Curl_pgrsUpdate(data); /* error or not complete yet. return for more multi-multi */ if(result || !done) goto out; @@ -671,8 +669,7 @@ static CURLcode cf_h1_proxy_connect(struct Curl_cfilter *cf, /* The real request will follow the CONNECT, reset request partially */ Curl_req_soft_reset(&data->req, data); Curl_client_reset(data); - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); + Curl_pgrsReset(data); tunnel_free(cf, data); } diff --git a/lib/file.c b/lib/file.c index 69370690746e..3de92408c490 100644 --- a/lib/file.c +++ b/lib/file.c @@ -60,7 +60,6 @@ #include "sendf.h" #include "escape.h" #include "file.h" -#include "speedcheck.h" #include "multiif.h" #include "transfer.h" #include "url.h" @@ -415,13 +414,10 @@ static CURLcode file_upload(struct Curl_easy *data, Curl_pgrsSetUploadCounter(data, bytecount); - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, curlx_now()); + result = Curl_pgrsCheck(data); } - if(!result && Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; + if(!result) + result = Curl_pgrsUpdate(data); out: close(fd); @@ -620,10 +616,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) if(result) goto out; - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, curlx_now()); + result = Curl_pgrsCheck(data); if(result) goto out; } @@ -657,8 +650,8 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) #endif } - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; + if(!result) + result = Curl_pgrsUpdate(data); out: Curl_multi_xfer_buf_release(data, xfer_buf); diff --git a/lib/ftp.c b/lib/ftp.c index ac4fdc25c96a..c289581fd5a4 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -65,7 +65,6 @@ #include "sockaddr.h" /* required for Curl_sockaddr_storage */ #include "multiif.h" #include "url.h" -#include "speedcheck.h" #include "curlx/warnless.h" #include "http_proxy.h" #include "socks.h" @@ -675,8 +674,7 @@ static CURLcode getftpresponse(struct Curl_easy *data, return CURLE_RECV_ERROR; } else if(ev == 0) { - if(Curl_pgrsUpdate(data)) - return CURLE_ABORTED_BY_CALLBACK; + result = Curl_pgrsUpdate(data); continue; /* just continue in our loop for the timeout duration */ } } @@ -4344,10 +4342,7 @@ CURLcode ftp_regular_transfer(struct Curl_easy *data, bool connected = FALSE; data->req.size = -1; /* make sure this is unknown at this point */ - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, -1); - Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsReset(data); ftpc->ctl_valid = TRUE; /* starts good */ diff --git a/lib/http.c b/lib/http.c index 095a9127a4ee..a1e449d35441 100644 --- a/lib/http.c +++ b/lib/http.c @@ -129,9 +129,9 @@ const struct Curl_handler Curl_handler_http = { ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_pollset */ - Curl_http_do_pollset, /* doing_pollset */ + Curl_http_doing_pollset, /* doing_pollset */ ZERO_NULL, /* domore_pollset */ - ZERO_NULL, /* perform_pollset */ + Curl_http_perform_pollset, /* perform_pollset */ ZERO_NULL, /* disconnect */ Curl_http_write_resp, /* write_resp */ Curl_http_write_resp_hd, /* write_resp_hd */ @@ -159,9 +159,9 @@ const struct Curl_handler Curl_handler_https = { NULL, /* connecting */ ZERO_NULL, /* doing */ NULL, /* proto_pollset */ - Curl_http_do_pollset, /* doing_pollset */ + Curl_http_doing_pollset, /* doing_pollset */ ZERO_NULL, /* domore_pollset */ - ZERO_NULL, /* perform_pollset */ + Curl_http_perform_pollset, /* perform_pollset */ ZERO_NULL, /* disconnect */ Curl_http_write_resp, /* write_resp */ Curl_http_write_resp_hd, /* write_resp_hd */ @@ -1560,13 +1560,30 @@ CURLcode Curl_http_connect(struct Curl_easy *data, bool *done) /* this returns the socket to wait for in the DO and DOING state for the multi interface and then we are always _sending_ a request and thus we wait for the single socket to become writable only */ -CURLcode Curl_http_do_pollset(struct Curl_easy *data, - struct easy_pollset *ps) +CURLcode Curl_http_doing_pollset(struct Curl_easy *data, + struct easy_pollset *ps) { /* write mode */ return Curl_pollset_add_out(data, ps, data->conn->sock[FIRSTSOCKET]); } +CURLcode Curl_http_perform_pollset(struct Curl_easy *data, + struct easy_pollset *ps) +{ + struct connectdata *conn = data->conn; + CURLcode result = CURLE_OK; + + if(CURL_WANT_RECV(data)) { + result = Curl_pollset_add_in(data, ps, conn->sock[FIRSTSOCKET]); + } + + /* on a "Expect: 100-continue" timed wait, do not poll for outgoing */ + if(!result && Curl_req_want_send(data) && !http_exp100_is_waiting(data)) { + result = Curl_pollset_add_out(data, ps, conn->sock[FIRSTSOCKET]); + } + return result; +} + /* * Curl_http_done() gets called after a single HTTP request has been * performed. @@ -4872,8 +4889,6 @@ static void http_exp100_continue(struct Curl_easy *data, struct cr_exp100_ctx *ctx = reader->ctx; if(ctx->state > EXP100_SEND_DATA) { ctx->state = EXP100_SEND_DATA; - data->req.keepon |= KEEP_SEND; - data->req.keepon &= ~KEEP_SEND_TIMED; Curl_expire_done(data, EXPIRE_100_TIMEOUT); } } @@ -4903,8 +4918,6 @@ static CURLcode cr_exp100_read(struct Curl_easy *data, ctx->state = EXP100_AWAITING_CONTINUE; ctx->start = curlx_now(); Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT); - data->req.keepon &= ~KEEP_SEND; - data->req.keepon |= KEEP_SEND_TIMED; *nread = 0; *eos = FALSE; return CURLE_OK; @@ -4917,8 +4930,6 @@ static CURLcode cr_exp100_read(struct Curl_easy *data, ms = curlx_timediff_ms(curlx_now(), ctx->start); if(ms < data->set.expect_100_timeout) { DEBUGF(infof(data, "cr_exp100_read, AWAITING_CONTINUE, not expired")); - data->req.keepon &= ~KEEP_SEND; - data->req.keepon |= KEEP_SEND_TIMED; *nread = 0; *eos = FALSE; return CURLE_OK; @@ -4938,7 +4949,6 @@ static void cr_exp100_done(struct Curl_easy *data, { struct cr_exp100_ctx *ctx = reader->ctx; ctx->state = premature ? EXP100_FAILED : EXP100_SEND_DATA; - data->req.keepon &= ~KEEP_SEND_TIMED; Curl_expire_done(data, EXPIRE_100_TIMEOUT); } diff --git a/lib/http.h b/lib/http.h index 67ef17f5b953..ef41d7bb2249 100644 --- a/lib/http.h +++ b/lib/http.h @@ -115,8 +115,10 @@ CURLcode Curl_http_setup_conn(struct Curl_easy *data, CURLcode Curl_http(struct Curl_easy *data, bool *done); CURLcode Curl_http_done(struct Curl_easy *data, CURLcode, bool premature); CURLcode Curl_http_connect(struct Curl_easy *data, bool *done); -CURLcode Curl_http_do_pollset(struct Curl_easy *data, - struct easy_pollset *ps); +CURLcode Curl_http_doing_pollset(struct Curl_easy *data, + struct easy_pollset *ps); +CURLcode Curl_http_perform_pollset(struct Curl_easy *data, + struct easy_pollset *ps); CURLcode Curl_http_write_resp(struct Curl_easy *data, const char *buf, size_t blen, bool is_eos); diff --git a/lib/http2.c b/lib/http2.c index a1caa2020f7c..5d1a502810fb 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -98,33 +98,6 @@ #define H2_SETTINGS_IV_LEN 3 #define H2_BINSETTINGS_LEN 80 -static size_t populate_settings(nghttp2_settings_entry *iv, - struct Curl_easy *data) -{ - iv[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS; - iv[0].value = Curl_multi_max_concurrent_streams(data->multi); - - iv[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; - iv[1].value = H2_STREAM_WINDOW_SIZE_INITIAL; - - iv[2].settings_id = NGHTTP2_SETTINGS_ENABLE_PUSH; - iv[2].value = data->multi->push_cb != NULL; - - return 3; -} - -static ssize_t populate_binsettings(uint8_t *binsettings, - struct Curl_easy *data) -{ - nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN]; - size_t ivlen; - - ivlen = populate_settings(iv, data); - /* this returns number of bytes it wrote or a negative number on error. */ - return nghttp2_pack_settings_payload(binsettings, H2_BINSETTINGS_LEN, - iv, ivlen); -} - struct cf_h2_ctx { nghttp2_session *h2; /* The easy handle used in the current filter call, cleared at return */ @@ -137,6 +110,7 @@ struct cf_h2_ctx { struct uint_hash streams; /* hash of `data->mid` to `h2_stream_ctx` */ size_t drain_total; /* sum of all stream's UrlState drain */ + uint32_t initial_win_size; /* current initial window size (settings) */ uint32_t max_concurrent_streams; uint32_t goaway_error; /* goaway error code from server */ int32_t remote_max_sid; /* max id processed by server */ @@ -204,6 +178,60 @@ static void cf_h2_ctx_close(struct cf_h2_ctx *ctx) } } +static uint32_t cf_h2_initial_win_size(struct Curl_easy *data) +{ +#if NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE + /* If the transfer has a rate-limit lower than the default initial + * stream window size, use that. It needs to be at least 8k or servers + * may be unhappy. */ + if(data->progress.dl.rlimit.rate_per_step && + (data->progress.dl.rlimit.rate_per_step < H2_STREAM_WINDOW_SIZE_INITIAL)) + return CURLMAX((uint32_t)data->progress.dl.rlimit.rate_per_step, 8192); +#endif + return H2_STREAM_WINDOW_SIZE_INITIAL; +} + +static size_t populate_settings(nghttp2_settings_entry *iv, + struct Curl_easy *data, + struct cf_h2_ctx *ctx) +{ + iv[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS; + iv[0].value = Curl_multi_max_concurrent_streams(data->multi); + + iv[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; + iv[1].value = cf_h2_initial_win_size(data); + if(ctx) + ctx->initial_win_size = iv[1].value; + iv[2].settings_id = NGHTTP2_SETTINGS_ENABLE_PUSH; + iv[2].value = data->multi->push_cb != NULL; + + return 3; +} + +static ssize_t populate_binsettings(uint8_t *binsettings, + struct Curl_easy *data) +{ + nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN]; + size_t ivlen; + + ivlen = populate_settings(iv, data, NULL); + /* this returns number of bytes it wrote or a negative number on error. */ + return nghttp2_pack_settings_payload(binsettings, H2_BINSETTINGS_LEN, + iv, ivlen); +} + +static CURLcode cf_h2_update_settings(struct cf_h2_ctx *ctx, + uint32_t initial_win_size) +{ + nghttp2_settings_entry entry; + entry.settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; + entry.value = initial_win_size; + if(nghttp2_submit_settings(ctx->h2, NGHTTP2_FLAG_NONE, &entry, 1)) + return CURLE_SEND_ERROR; + ctx->initial_win_size = initial_win_size; + return CURLE_OK; +} + static CURLcode nw_out_flush(struct Curl_cfilter *cf, struct Curl_easy *data); @@ -296,16 +324,18 @@ static void h2_stream_hash_free(unsigned int id, void *stream) static int32_t cf_h2_get_desired_local_win(struct Curl_cfilter *cf, struct Curl_easy *data) { + curl_off_t avail = Curl_rlimit_avail(&data->progress.dl.rlimit, + curlx_now()); + (void)cf; - if(data->set.max_recv_speed && data->set.max_recv_speed < INT32_MAX) { - /* The transfer should only receive `max_recv_speed` bytes per second. - * We restrict the stream's local window size, so that the server cannot - * send us "too much" at a time. - * This gets less precise the higher the latency. */ - return (int32_t)data->set.max_recv_speed; + if(avail < CURL_OFF_T_MAX) { /* limit in place */ + if(avail <= 0) + return 0; + else if(avail < INT32_MAX) + return (int32_t)avail; } #ifdef DEBUGBUILD - else { + { struct cf_h2_ctx *ctx = cf->ctx; CURL_TRC_CF(data, cf, "stream_win_max=%d", ctx->stream_win_max); return ctx->stream_win_max; @@ -580,7 +610,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN]; size_t ivlen; - ivlen = populate_settings(iv, data); + ivlen = populate_settings(iv, data, ctx); rc = nghttp2_submit_settings(ctx->h2, NGHTTP2_FLAG_NONE, iv, ivlen); if(rc) { @@ -2007,6 +2037,9 @@ static CURLcode stream_recv(struct Curl_cfilter *cf, struct Curl_easy *data, (void)len; *pnread = 0; + if(!stream->xfer_result) + stream->xfer_result = cf_h2_update_local_win(cf, data, stream); + if(stream->xfer_result) { CURL_TRC_CF(data, cf, "[%d] xfer write failed", stream->id); result = stream->xfer_result; @@ -2239,6 +2272,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, nghttp2_priority_spec pri_spec; size_t nwritten; CURLcode result = CURLE_OK; + uint32_t initial_win_size; *pnwritten = 0; Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST); @@ -2276,6 +2310,15 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, if(!nghttp2_session_check_request_allowed(ctx->h2)) CURL_TRC_CF(data, cf, "send request NOT allowed (via nghttp2)"); + /* Check the initial windows size of the transfer (rate-limits?) and + * send an updated settings on changes from previous value. */ + initial_win_size = cf_h2_initial_win_size(data); + if(initial_win_size != ctx->initial_win_size) { + result = cf_h2_update_settings(ctx, initial_win_size); + if(result) + goto out; + } + switch(data->state.httpreq) { case HTTPREQ_POST: case HTTPREQ_POST_FORM: diff --git a/lib/imap.c b/lib/imap.c index faa595561dfa..181b0d7009d6 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1938,10 +1938,7 @@ static CURLcode imap_regular_transfer(struct Curl_easy *data, data->req.size = -1; /* Set the progress data */ - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, -1); - Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsReset(data); /* Carry out the perform */ result = imap_perform(data, &connected, dophase_done); diff --git a/lib/ldap.c b/lib/ldap.c index f0bc2f2a3790..fa1a4a4d25c5 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -509,7 +509,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) goto quit; } - Curl_pgrsSetDownloadCounter(data, 0); + Curl_pgrsReset(data); rc = ldap_search_s(server, ludp->lud_dn, (curl_ldap_num_t)ludp->lud_scope, ludp->lud_filter, ludp->lud_attrs, 0, &ldapmsg); diff --git a/lib/multi.c b/lib/multi.c index 3fc1c948f507..5ea93348e4e5 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -43,7 +43,6 @@ #include "select.h" #include "curlx/warnless.h" #include "curlx/wait.h" -#include "speedcheck.h" #include "conncache.h" #include "multihandle.h" #include "sigpipe.h" @@ -923,79 +922,145 @@ void Curl_attach_connection(struct Curl_easy *data, conn->handler->attach(data, conn); } +/* adjust pollset for rate limits/pauses */ +static CURLcode multi_adjust_pollset(struct Curl_easy *data, + struct easy_pollset *ps) +{ + CURLcode result = CURLE_OK; + + if(ps->n) { + struct curltime now = curlx_now(); + bool send_blocked, recv_blocked; + + recv_blocked = (Curl_rlimit_avail(&data->progress.dl.rlimit, now) <= 0); + send_blocked = (Curl_rlimit_avail(&data->progress.ul.rlimit, now) <= 0); + if(send_blocked || recv_blocked) { + int i; + for(i = 0; i <= SECONDARYSOCKET; ++i) { + curl_socket_t sock = data->conn->sock[i]; + if(sock == CURL_SOCKET_BAD) + continue; + if(recv_blocked && Curl_pollset_want_recv(data, ps, sock)) { + result = Curl_pollset_remove_in(data, ps, sock); + if(result) + break; + } + if(send_blocked && Curl_pollset_want_send(data, ps, sock)) { + result = Curl_pollset_remove_out(data, ps, sock); + if(result) + break; + } + } + } + + /* Not blocked and wanting to receive. If there is data pending + * in the connection filters, make transfer run again. */ + if(!recv_blocked && + ((Curl_pollset_want_recv(data, ps, data->conn->sock[FIRSTSOCKET]) && + Curl_conn_data_pending(data, FIRSTSOCKET)) || + (Curl_pollset_want_recv(data, ps, data->conn->sock[SECONDARYSOCKET]) && + Curl_conn_data_pending(data, SECONDARYSOCKET)))) { + CURL_TRC_M(data, "pollset[] has POLLIN, but there is still " + "buffered input -> mark as dirty"); + Curl_multi_mark_dirty(data); + } + } + return result; +} + static CURLcode mstate_connecting_pollset(struct Curl_easy *data, struct easy_pollset *ps) { - if(data->conn) { - curl_socket_t sockfd = Curl_conn_get_first_socket(data); - if(sockfd != CURL_SOCKET_BAD) { - /* Default is to wait to something from the server */ - return Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0); - } + struct connectdata *conn = data->conn; + curl_socket_t sockfd; + CURLcode result = CURLE_OK; + + if(Curl_xfer_recv_is_paused(data)) + return CURLE_OK; + /* If a socket is set, receiving is default. If the socket + * has not been determined yet (eyeballing), always ask the + * connection filters for what to monitor. */ + sockfd = Curl_conn_get_first_socket(data); + if(sockfd != CURL_SOCKET_BAD) { + result = Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0); + if(!result) + result = multi_adjust_pollset(data, ps); } - return CURLE_OK; + if(!result) + result = Curl_conn_adjust_pollset(data, conn, ps); + return result; } static CURLcode mstate_protocol_pollset(struct Curl_easy *data, struct easy_pollset *ps) { struct connectdata *conn = data->conn; - if(conn) { - curl_socket_t sockfd; - if(conn->handler->proto_pollset) - return conn->handler->proto_pollset(data, ps); - sockfd = conn->sock[FIRSTSOCKET]; + CURLcode result = CURLE_OK; + + if(conn->handler->proto_pollset) + result = conn->handler->proto_pollset(data, ps); + else { + curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; if(sockfd != CURL_SOCKET_BAD) { /* Default is to wait to something from the server */ - return Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0); + result = Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0); } } - return CURLE_OK; + if(!result) + result = multi_adjust_pollset(data, ps); + if(!result) + result = Curl_conn_adjust_pollset(data, conn, ps); + return result; } static CURLcode mstate_do_pollset(struct Curl_easy *data, struct easy_pollset *ps) { struct connectdata *conn = data->conn; - if(conn) { - if(conn->handler->doing_pollset) - return conn->handler->doing_pollset(data, ps); - else if(CONN_SOCK_IDX_VALID(conn->send_idx)) { - /* Default is that we want to send something to the server */ - return Curl_pollset_add_out( - data, ps, conn->sock[conn->send_idx]); - } + CURLcode result = CURLE_OK; + + if(conn->handler->doing_pollset) + result = conn->handler->doing_pollset(data, ps); + else if(CONN_SOCK_IDX_VALID(conn->send_idx)) { + /* Default is that we want to send something to the server */ + result = Curl_pollset_add_out(data, ps, conn->sock[conn->send_idx]); } - return CURLE_OK; + if(!result) + result = multi_adjust_pollset(data, ps); + if(!result) + result = Curl_conn_adjust_pollset(data, conn, ps); + return result; } static CURLcode mstate_domore_pollset(struct Curl_easy *data, struct easy_pollset *ps) { struct connectdata *conn = data->conn; - if(conn) { - if(conn->handler->domore_pollset) - return conn->handler->domore_pollset(data, ps); - else if(CONN_SOCK_IDX_VALID(conn->send_idx)) { - /* Default is that we want to send something to the server */ - return Curl_pollset_add_out( - data, ps, conn->sock[conn->send_idx]); - } + CURLcode result = CURLE_OK; + + if(conn->handler->domore_pollset) + result = conn->handler->domore_pollset(data, ps); + else if(CONN_SOCK_IDX_VALID(conn->send_idx)) { + /* Default is that we want to send something to the server */ + result = Curl_pollset_add_out(data, ps, conn->sock[conn->send_idx]); } - return CURLE_OK; + if(!result) + result = multi_adjust_pollset(data, ps); + if(!result) + result = Curl_conn_adjust_pollset(data, conn, ps); + return result; } static CURLcode mstate_perform_pollset(struct Curl_easy *data, struct easy_pollset *ps) { struct connectdata *conn = data->conn; - if(!conn) - return CURLE_OK; - else if(conn->handler->perform_pollset) - return conn->handler->perform_pollset(data, ps); + CURLcode result = CURLE_OK; + + if(conn->handler->perform_pollset) + result = conn->handler->perform_pollset(data, ps); else { /* Default is to obey the data->req.keepon flags for send/recv */ - CURLcode result = CURLE_OK; if(CURL_WANT_RECV(data) && CONN_SOCK_IDX_VALID(conn->recv_idx)) { result = Curl_pollset_add_in( data, ps, conn->sock[conn->recv_idx]); @@ -1006,19 +1071,21 @@ static CURLcode mstate_perform_pollset(struct Curl_easy *data, result = Curl_pollset_add_out( data, ps, conn->sock[conn->send_idx]); } - return result; } + if(!result) + result = multi_adjust_pollset(data, ps); + if(!result) + result = Curl_conn_adjust_pollset(data, conn, ps); + return result; } /* Initializes `poll_set` with the current socket poll actions needed * for transfer `data`. */ CURLMcode Curl_multi_pollset(struct Curl_easy *data, - struct easy_pollset *ps, - const char *caller) + struct easy_pollset *ps) { CURLMcode mresult = CURLM_OK; CURLcode result = CURLE_OK; - bool expect_sockets = TRUE; /* If the transfer has no connection, this is fine. Happens when called via curl_multi_remove_handle() => Curl_multi_ev_assess() => @@ -1033,70 +1100,49 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data, case MSTATE_SETUP: case MSTATE_CONNECT: /* nothing to poll for yet */ - expect_sockets = FALSE; break; case MSTATE_RESOLVING: result = Curl_resolv_pollset(data, ps); - /* connection filters are not involved in this phase. It is OK if we get no - * sockets to wait for. Resolving can wake up from other sources. */ - expect_sockets = FALSE; break; case MSTATE_CONNECTING: case MSTATE_TUNNELING: - if(!Curl_xfer_recv_is_paused(data)) { - result = mstate_connecting_pollset(data, ps); - if(!result) - result = Curl_conn_adjust_pollset(data, data->conn, ps); - } - else - expect_sockets = FALSE; + result = mstate_connecting_pollset(data, ps); break; case MSTATE_PROTOCONNECT: case MSTATE_PROTOCONNECTING: result = mstate_protocol_pollset(data, ps); - if(!result) - result = Curl_conn_adjust_pollset(data, data->conn, ps); break; case MSTATE_DO: case MSTATE_DOING: result = mstate_do_pollset(data, ps); - if(!result) - result = Curl_conn_adjust_pollset(data, data->conn, ps); break; case MSTATE_DOING_MORE: result = mstate_domore_pollset(data, ps); - if(!result) - result = Curl_conn_adjust_pollset(data, data->conn, ps); break; case MSTATE_DID: /* same as PERFORMING in regard to polling */ case MSTATE_PERFORMING: result = mstate_perform_pollset(data, ps); - if(!result) - result = Curl_conn_adjust_pollset(data, data->conn, ps); break; case MSTATE_RATELIMITING: /* we need to let time pass, ignore socket(s) */ - expect_sockets = FALSE; break; case MSTATE_DONE: case MSTATE_COMPLETED: case MSTATE_MSGSENT: /* nothing more to poll for */ - expect_sockets = FALSE; break; default: failf(data, "multi_getsock: unexpected multi state %d", data->mstate); DEBUGASSERT(0); - expect_sockets = FALSE; break; } @@ -1110,39 +1156,27 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data, goto out; } - /* Unblocked and waiting to receive with buffered input. - * Make transfer run again at next opportunity. */ - if(!Curl_xfer_is_blocked(data) && !Curl_xfer_is_too_fast(data) && - ((Curl_pollset_want_read(data, ps, data->conn->sock[FIRSTSOCKET]) && - Curl_conn_data_pending(data, FIRSTSOCKET)) || - (Curl_pollset_want_read(data, ps, data->conn->sock[SECONDARYSOCKET]) && - Curl_conn_data_pending(data, SECONDARYSOCKET)))) { - CURL_TRC_M(data, "%s pollset[] has POLLIN, but there is still " - "buffered input to consume -> mark as dirty", caller); - Curl_multi_mark_dirty(data); - } - #ifndef CURL_DISABLE_VERBOSE_STRINGS if(CURL_TRC_M_is_verbose(data)) { size_t timeout_count = Curl_llist_count(&data->state.timeoutlist); switch(ps->n) { case 0: - CURL_TRC_M(data, "%s pollset[], timeouts=%zu, paused %d/%d (r/w)", - caller, timeout_count, + CURL_TRC_M(data, "pollset[], timeouts=%zu, paused %d/%d (r/w)", + timeout_count, Curl_xfer_send_is_paused(data), Curl_xfer_recv_is_paused(data)); break; case 1: - CURL_TRC_M(data, "%s pollset[fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", - caller, ps->sockets[0], + CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", + ps->sockets[0], (ps->actions[0] & CURL_POLL_IN) ? "IN" : "", (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "", timeout_count); break; case 2: - CURL_TRC_M(data, "%s pollset[fd=%" FMT_SOCKET_T " %s%s, " + CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s, " "fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", - caller, ps->sockets[0], + ps->sockets[0], (ps->actions[0] & CURL_POLL_IN) ? "IN" : "", (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "", ps->sockets[1], @@ -1151,27 +1185,14 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data, timeout_count); break; default: - CURL_TRC_M(data, "%s pollset[fds=%u], timeouts=%zu", - caller, ps->n, timeout_count); + CURL_TRC_M(data, "pollset[fds=%u], timeouts=%zu", + ps->n, timeout_count); break; } CURL_TRC_EASY_TIMERS(data); } #endif - if(expect_sockets && !ps->n && data->multi && - !Curl_uint_bset_contains(&data->multi->dirty, data->mid) && - !Curl_llist_count(&data->state.timeoutlist) && - !Curl_cwriter_is_paused(data) && !Curl_creader_is_paused(data) && - Curl_conn_is_ip_connected(data, FIRSTSOCKET)) { - /* We expected sockets for POLL monitoring, but none are set. - * We are not dirty (and run anyway). - * We are not waiting on any timer. - * None of the READ/WRITE directions are paused. - * We are connected to the server on IP level, at least. */ - infof(data, "WARNING: no socket in pollset or timer, transfer may stall!"); - DEBUGASSERT(0); - } out: return mresult; } @@ -1205,7 +1226,7 @@ CURLMcode curl_multi_fdset(CURLM *m, continue; } - Curl_multi_pollset(data, &ps, "curl_multi_fdset"); + Curl_multi_pollset(data, &ps); for(i = 0; i < ps.n; i++) { if(!FDSET_SOCK(ps.sockets[i])) /* pretend it does not exist */ @@ -1268,7 +1289,7 @@ CURLMcode curl_multi_waitfds(CURLM *m, Curl_uint_bset_remove(&multi->dirty, mid); continue; } - Curl_multi_pollset(data, &ps, "curl_multi_waitfds"); + Curl_multi_pollset(data, &ps); need += Curl_waitfds_add_ps(&cwfds, &ps); } while(Curl_uint_bset_next(&multi->process, mid, &mid)); @@ -1354,7 +1375,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, Curl_uint_bset_remove(&multi->dirty, mid); continue; } - Curl_multi_pollset(data, &ps, "multi_wait"); + Curl_multi_pollset(data, &ps); if(Curl_pollfds_add_ps(&cpfds, &ps)) { result = CURLM_OUT_OF_MEMORY; goto out; @@ -1907,35 +1928,28 @@ static CURLcode multi_follow(struct Curl_easy *data, } static CURLcode mspeed_check(struct Curl_easy *data, - struct curltime *nowp) + struct curltime now) { timediff_t recv_wait_ms = 0; timediff_t send_wait_ms = 0; - /* check if over send speed */ - if(data->set.max_send_speed) - send_wait_ms = Curl_pgrsLimitWaitTime(&data->progress.ul, - data->set.max_send_speed, - *nowp); - - /* check if over recv speed */ - if(data->set.max_recv_speed) - recv_wait_ms = Curl_pgrsLimitWaitTime(&data->progress.dl, - data->set.max_recv_speed, - *nowp); + /* check if our send/recv limits require idle waits */ + send_wait_ms = Curl_rlimit_wait_ms(&data->progress.ul.rlimit, now); + recv_wait_ms = Curl_rlimit_wait_ms(&data->progress.dl.rlimit, now); if(send_wait_ms || recv_wait_ms) { if(data->mstate != MSTATE_RATELIMITING) { - Curl_ratelimit(data, *nowp); multistate(data, MSTATE_RATELIMITING); } Curl_expire(data, CURLMAX(send_wait_ms, recv_wait_ms), EXPIRE_TOOFAST); Curl_multi_clear_dirty(data); + CURL_TRC_M(data, "[RLIMIT] waiting %" FMT_TIMEDIFF_T "ms", + CURLMAX(send_wait_ms, recv_wait_ms)); return CURLE_AGAIN; } else if(data->mstate != MSTATE_PERFORMING) { + CURL_TRC_M(data, "[RLIMIT] wait over, continue"); multistate(data, MSTATE_PERFORMING); - Curl_ratelimit(data, *nowp); } return CURLE_OK; } @@ -1951,7 +1965,7 @@ static CURLMcode state_performing(struct Curl_easy *data, CURLcode result = *resultp = CURLE_OK; *stream_errorp = FALSE; - if(mspeed_check(data, nowp) == CURLE_AGAIN) + if(mspeed_check(data, *nowp) == CURLE_AGAIN) return CURLM_OK; /* read/write data if it is ready to do so */ @@ -2073,7 +2087,8 @@ static CURLMcode state_performing(struct Curl_easy *data, } } else { /* not errored, not done */ - mspeed_check(data, nowp); + *nowp = curlx_now(); + mspeed_check(data, *nowp); } free(newurl); *resultp = result; @@ -2228,10 +2243,7 @@ static CURLMcode state_ratelimiting(struct Curl_easy *data, CURLMcode rc = CURLM_OK; DEBUGASSERT(data->conn); /* if both rates are within spec, resume transfer */ - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, *nowp); + result = Curl_pgrsCheck(data); if(result) { if(!(data->conn->handler->flags & PROTOPT_DUAL) && @@ -2242,7 +2254,7 @@ static CURLMcode state_ratelimiting(struct Curl_easy *data, multi_done(data, result, TRUE); } else { - if(!mspeed_check(data, nowp)) + if(!mspeed_check(data, *nowp)) rc = CURLM_CALL_MULTI_PERFORM; } *resultp = result; @@ -2387,6 +2399,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, (HTTP/2), or the full connection for older protocols */ bool stream_error = FALSE; rc = CURLM_OK; + /* update at start for continuous increase when looping */ + *nowp = curlx_now(); if(multi_ischanged(multi, TRUE)) { CURL_TRC_M(data, "multi changed, check CONNECT_PEND queue"); @@ -2704,16 +2718,18 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, rc = CURLM_CALL_MULTI_PERFORM; } /* if there is still a connection to use, call the progress function */ - else if(data->conn && Curl_pgrsUpdate(data)) { - /* aborted due to progress callback return code must close the - connection */ - result = CURLE_ABORTED_BY_CALLBACK; - streamclose(data->conn, "Aborted by callback"); - - /* if not yet in DONE state, go there, otherwise COMPLETED */ - multistate(data, (data->mstate < MSTATE_DONE) ? - MSTATE_DONE : MSTATE_COMPLETED); - rc = CURLM_CALL_MULTI_PERFORM; + else if(data->conn) { + result = Curl_pgrsUpdate(data); + if(result) { + /* aborted due to progress callback return code must close the + connection */ + streamclose(data->conn, "Aborted by callback"); + + /* if not yet in DONE state, go there, otherwise COMPLETED */ + multistate(data, (data->mstate < MSTATE_DONE) ? + MSTATE_DONE : MSTATE_COMPLETED); + rc = CURLM_CALL_MULTI_PERFORM; + } } } diff --git a/lib/multi_ev.c b/lib/multi_ev.c index f5000a456245..098f8da643af 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -508,7 +508,7 @@ static CURLMcode mev_assess(struct Curl_multi *multi, } } else - Curl_multi_pollset(data, &ps, "ev assess"); + Curl_multi_pollset(data, &ps); last_ps = mev_get_last_pollset(data, conn); if(!last_ps && ps.n) { diff --git a/lib/multiif.h b/lib/multiif.h index 1423d5a03d0c..81cf665bd3d8 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -73,8 +73,7 @@ CURLMcode Curl_multi_add_perform(struct Curl_multi *multi, unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi); CURLMcode Curl_multi_pollset(struct Curl_easy *data, - struct easy_pollset *ps, - const char *caller); + struct easy_pollset *ps); /** * Borrow the transfer buffer from the multi, suitable diff --git a/lib/pingpong.c b/lib/pingpong.c index 670d37c38e62..297389043f0e 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -33,7 +33,6 @@ #include "sendf.h" #include "select.h" #include "progress.h" -#include "speedcheck.h" #include "pingpong.h" #include "multiif.h" #include "vtls/vtls.h" @@ -122,11 +121,7 @@ CURLcode Curl_pp_statemach(struct Curl_easy *data, if(block) { /* if we did not wait, we do not have to spend time on this now */ - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, curlx_now()); - + result = Curl_pgrsCheck(data); if(result) return result; } diff --git a/lib/pop3.c b/lib/pop3.c index d469dc07660d..05203c1a074e 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -1503,10 +1503,7 @@ static CURLcode pop3_regular_transfer(struct Curl_easy *data, data->req.size = -1; /* Set the progress data */ - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, -1); - Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsReset(data); /* Carry out the perform */ result = pop3_perform(data, &connected, dophase_done); diff --git a/lib/progress.c b/lib/progress.c index 228f5dc19737..3985e1c1bfbd 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -28,6 +28,7 @@ #include "sendf.h" #include "multiif.h" #include "progress.h" +#include "transfer.h" #include "curlx/timeval.h" /* check rate limits within this many recent milliseconds, at minimum. */ @@ -92,6 +93,55 @@ static char *max6data(curl_off_t bytes, char *max6) } #endif +static void pgrs_speedinit(struct Curl_easy *data) +{ + memset(&data->state.keeps_speed, 0, sizeof(struct curltime)); +} + +/* + * @unittest: 1606 + */ +UNITTEST CURLcode pgrs_speedcheck(struct Curl_easy *data, + struct curltime *pnow) +{ + if(!data->set.low_speed_time || !data->set.low_speed_limit || + Curl_xfer_recv_is_paused(data) || Curl_xfer_send_is_paused(data)) + /* A paused transfer is not qualified for speed checks */ + return CURLE_OK; + + if((data->progress.current_speed >= 0) && data->set.low_speed_time) { + if(data->progress.current_speed < data->set.low_speed_limit) { + if(!data->state.keeps_speed.tv_sec) + /* under the limit at this moment */ + data->state.keeps_speed = *pnow; + else { + /* how long has it been under the limit */ + timediff_t howlong = curlx_timediff_ms(*pnow, data->state.keeps_speed); + + if(howlong >= data->set.low_speed_time * 1000) { + /* too long */ + failf(data, + "Operation too slow. " + "Less than %ld bytes/sec transferred the last %ld seconds", + data->set.low_speed_limit, + data->set.low_speed_time); + return CURLE_OPERATION_TIMEDOUT; + } + } + } + else + /* faster right now */ + data->state.keeps_speed.tv_sec = 0; + } + + if(data->set.low_speed_limit) + /* if low speed limit is enabled, set the expire timer to make this + connection's speed get checked again in a second */ + Curl_expire(data, 1000, EXPIRE_SPEEDCHECK); + + return CURLE_OK; +} + /* New proposed interface, 9th of February 2000: @@ -119,10 +169,19 @@ int Curl_pgrsDone(struct Curl_easy *data) * hidden */ curl_mfprintf(data->set.err, "\n"); - data->progress.speeder_c = 0; /* reset the progress meter display */ return 0; } +void Curl_pgrsReset(struct Curl_easy *data) +{ + Curl_pgrsSetUploadCounter(data, 0); + Curl_pgrsSetDownloadCounter(data, 0); + Curl_pgrsSetUploadSize(data, -1); + Curl_pgrsSetDownloadSize(data, -1); + data->progress.speeder_c = 0; /* reset speed records */ + pgrs_speedinit(data); +} + /* reset the known transfer sizes */ void Curl_pgrsResetTransferSizes(struct Curl_easy *data) { @@ -130,6 +189,14 @@ void Curl_pgrsResetTransferSizes(struct Curl_easy *data) Curl_pgrsSetUploadSize(data, -1); } +void Curl_pgrsRecvPause(struct Curl_easy *data, bool enable) +{ + if(!enable) { + data->progress.speeder_c = 0; /* reset speed records */ + pgrs_speedinit(data); /* reset low speed measurements */ + } +} + /* * * Curl_pgrsTimeWas(). Store the timestamp time at the given label. @@ -228,72 +295,11 @@ void Curl_pgrsStartNow(struct Curl_easy *data) p->speeder_c = 0; /* reset the progress meter display */ p->start = curlx_now(); p->is_t_startransfer_set = FALSE; - p->ul.limit.start = p->start; - p->dl.limit.start = p->start; - p->ul.limit.start_size = 0; - p->dl.limit.start_size = 0; p->dl.cur_size = 0; p->ul.cur_size = 0; /* the sizes are unknown at start */ p->dl_size_known = FALSE; p->ul_size_known = FALSE; - Curl_ratelimit(data, p->start); -} - -/* - * This is used to handle speed limits, calculating how many milliseconds to - * wait until we are back under the speed limit, if needed. - * - * The way it works is by having a "starting point" (time & amount of data - * transferred by then) used in the speed computation, to be used instead of - * the start of the transfer. This starting point is regularly moved as - * transfer goes on, to keep getting accurate values (instead of average over - * the entire transfer). - * - * This function takes the current amount of data transferred, the amount at - * the starting point, the limit (in bytes/s), the time of the starting point - * and the current time. - * - * Returns 0 if no waiting is needed or when no waiting is needed but the - * starting point should be reset (to current); or the number of milliseconds - * to wait to get back under the speed limit. - */ -timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, - curl_off_t bytes_per_sec, - struct curltime now) -{ - curl_off_t bytes = d->cur_size - d->limit.start_size; - timediff_t should_ms; - timediff_t took_ms; - - /* no limit or we did not get to any bytes yet */ - if(!bytes_per_sec || !bytes) - return 0; - - /* The time it took us to have `bytes` */ - took_ms = curlx_timediff_ceil_ms(now, d->limit.start); - - /* The time it *should* have taken us to have `bytes` - * when obeying the bytes_per_sec speed_limit. */ - if(bytes < CURL_OFF_T_MAX/1000) { - /* (1000 * bytes / (bytes / sec)) = 1000 * sec = ms */ - should_ms = (timediff_t) (1000 * bytes / bytes_per_sec); - } - else { - /* large `bytes`, first calc the seconds it should have taken. - * if that is small enough, convert to milliseconds. */ - should_ms = (timediff_t) (bytes / bytes_per_sec); - if(should_ms < TIMEDIFF_T_MAX/1000) - should_ms *= 1000; - else - should_ms = TIMEDIFF_T_MAX; - } - - if(took_ms < should_ms) { - /* when gotten to `bytes` too fast, wait the difference */ - return should_ms - took_ms; - } - return 0; } /* @@ -304,28 +310,6 @@ void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size) data->progress.dl.cur_size = size; } -/* - * Update the timestamp and sizestamp to use for rate limit calculations. - */ -void Curl_ratelimit(struct Curl_easy *data, struct curltime now) -{ - /* do not set a new stamp unless the time since last update is long enough */ - if(data->set.max_recv_speed) { - if(curlx_timediff_ms(now, data->progress.dl.limit.start) >= - MIN_RATE_LIMIT_PERIOD) { - data->progress.dl.limit.start = now; - data->progress.dl.limit.start_size = data->progress.dl.cur_size; - } - } - if(data->set.max_send_speed) { - if(curlx_timediff_ms(now, data->progress.ul.limit.start) >= - MIN_RATE_LIMIT_PERIOD) { - data->progress.ul.limit.start = now; - data->progress.ul.limit.start_size = data->progress.ul.cur_size; - } - } -} - /* * Set the number of uploaded bytes so far. */ @@ -378,75 +362,82 @@ static curl_off_t trspeed(curl_off_t size, /* number of bytes */ } /* returns TRUE if it is time to show the progress meter */ -static bool progress_calc(struct Curl_easy *data, struct curltime now) +static bool progress_calc(struct Curl_easy *data, struct curltime *pnow) { - bool timetoshow = FALSE; struct Progress * const p = &data->progress; + int i_next, i_oldest, i_latest; + timediff_t duration_ms; + curl_off_t amount; /* The time spent so far (from the start) in microseconds */ - p->timespent = curlx_timediff_us(now, p->start); + p->timespent = curlx_timediff_us(*pnow, p->start); p->dl.speed = trspeed(p->dl.cur_size, p->timespent); p->ul.speed = trspeed(p->ul.cur_size, p->timespent); - /* Calculations done at most once a second, unless end is reached */ - if(p->lastshow != now.tv_sec) { - int countindex; /* amount of seconds stored in the speeder array */ - int nowindex = p->speeder_c% CURR_TIME; - p->lastshow = now.tv_sec; - timetoshow = TRUE; - - /* Let's do the "current speed" thing, with the dl + ul speeds - combined. Store the speed at entry 'nowindex'. */ - p->speeder[ nowindex ] = p->dl.cur_size + p->ul.cur_size; - - /* remember the exact time for this moment */ - p->speeder_time [ nowindex ] = now; - - /* advance our speeder_c counter, which is increased every time we get - here and we expect it to never wrap as 2^32 is a lot of seconds! */ + if(!p->speeder_c) { /* no previous record exists */ + p->speed_amount[0] = p->dl.cur_size + p->ul.cur_size; + p->speed_time[0] = *pnow; p->speeder_c++; - - /* figure out how many index entries of data we have stored in our speeder - array. With N_ENTRIES filled in, we have about N_ENTRIES-1 seconds of - transfer. Imagine, after one second we have filled in two entries, - after two seconds we have filled in three entries etc. */ - countindex = ((p->speeder_c >= CURR_TIME) ? CURR_TIME : p->speeder_c) - 1; - - /* first of all, we do not do this if there is no counted seconds yet */ - if(countindex) { - int checkindex; - timediff_t span_ms; - curl_off_t amount; - - /* Get the index position to compare with the 'nowindex' position. - Get the oldest entry possible. While we have less than CURR_TIME - entries, the first entry will remain the oldest. */ - checkindex = (p->speeder_c >= CURR_TIME) ? p->speeder_c%CURR_TIME : 0; - - /* Figure out the exact time for the time span */ - span_ms = curlx_timediff_ms(now, p->speeder_time[checkindex]); - if(span_ms == 0) - span_ms = 1; /* at least one millisecond MUST have passed */ - - /* Calculate the average speed the last 'span_ms' milliseconds */ - amount = p->speeder[nowindex]- p->speeder[checkindex]; - - if(amount > (0xffffffff/1000)) - /* the 'amount' value is bigger than would fit in 32 bits if - multiplied with 1000, so we use the double math for this */ - p->current_speed = (curl_off_t) - ((double)amount/((double)span_ms/1000.0)); - else - /* the 'amount' value is small enough to fit within 32 bits even - when multiplied with 1000 */ - p->current_speed = amount * 1000/span_ms; + /* use the overall average at the start */ + p->current_speed = p->ul.speed + p->dl.speed; + p->lastshow = pnow->tv_sec; + return TRUE; + } + /* We have at least one record now. Where to put the next and + * where is the latest one? */ + i_next = p->speeder_c % CURL_SPEED_RECORDS; + i_latest = (i_next > 0) ? (i_next - 1) : (CURL_SPEED_RECORDS - 1); + + /* Make a new record only when some time has passed. + * Too frequent calls otherwise ruin the history. */ + if(curlx_timediff_ms(*pnow, p->speed_time[i_latest]) >= 1000) { + p->speeder_c++; + i_latest = i_next; + p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size; + p->speed_time[i_latest] = *pnow; + } + else if(data->req.done) { + /* When a transfer is done, and we did not have a current speed + * already, update the last record. Otherwise, stay at the speed + * we have. The last chunk of data, when rate limiting, would increase + * reported speed since it no longer measures a full second. */ + if(!p->current_speed) { + p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size; + p->speed_time[i_latest] = *pnow; } - else - /* the first second we use the average */ - p->current_speed = p->ul.speed + p->dl.speed; + } + else { + /* transfer ongoing, wait for more time to pass. */ + return FALSE; + } - } /* Calculations end */ - return timetoshow; + i_oldest = (p->speeder_c < CURL_SPEED_RECORDS) ? 0 : + ((i_latest + 1) % CURL_SPEED_RECORDS); + + /* How much we transferred between oldest and current records */ + amount = p->speed_amount[i_latest]- p->speed_amount[i_oldest]; + /* How long this took */ + duration_ms = curlx_timediff_ms(p->speed_time[i_latest], + p->speed_time[i_oldest]); + if(duration_ms <= 0) + duration_ms = 1; + + if(amount > (CURL_OFF_T_MAX/1000)) { + /* the 'amount' value is bigger than would fit in 64 bits if + multiplied with 1000, so we use the double math for this */ + p->current_speed = (curl_off_t) + (((double)amount * 1000.0)/(double)duration_ms); + } + else { + /* the 'amount' value is small enough to fit within 32 bits even + when multiplied with 1000 */ + p->current_speed = amount * 1000 / duration_ms; + } + + if((p->lastshow == pnow->tv_sec) && !data->req.done) + return FALSE; + p->lastshow = pnow->tv_sec; + return TRUE; } #ifndef CURL_DISABLE_PROGRESS_METER @@ -568,7 +559,7 @@ static void progress_meter(struct Curl_easy *data) * Curl_pgrsUpdate() returns 0 for success or the value returned by the * progress callback! */ -static int pgrsupdate(struct Curl_easy *data, bool showprogress) +static CURLcode pgrsupdate(struct Curl_easy *data, bool showprogress) { if(!data->progress.hide) { if(data->set.fxferinfo) { @@ -582,9 +573,11 @@ static int pgrsupdate(struct Curl_easy *data, bool showprogress) data->progress.ul.cur_size); Curl_set_in_callback(data, FALSE); if(result != CURL_PROGRESSFUNC_CONTINUE) { - if(result) + if(result) { failf(data, "Callback aborted"); - return result; + return CURLE_ABORTED_BY_CALLBACK; + } + return CURLE_OK; } } else if(data->set.fprogress) { @@ -598,9 +591,11 @@ static int pgrsupdate(struct Curl_easy *data, bool showprogress) (double)data->progress.ul.cur_size); Curl_set_in_callback(data, FALSE); if(result != CURL_PROGRESSFUNC_CONTINUE) { - if(result) + if(result) { failf(data, "Callback aborted"); - return result; + return CURLE_ABORTED_BY_CALLBACK; + } + return CURLE_OK; } } @@ -608,21 +603,37 @@ static int pgrsupdate(struct Curl_easy *data, bool showprogress) progress_meter(data); } - return 0; + return CURLE_OK; } -int Curl_pgrsUpdate(struct Curl_easy *data) +static CURLcode pgrs_update(struct Curl_easy *data, struct curltime *pnow) { - struct curltime now = curlx_now(); /* what time is it */ - bool showprogress = progress_calc(data, now); + bool showprogress = progress_calc(data, pnow); return pgrsupdate(data, showprogress); } +CURLcode Curl_pgrsUpdate(struct Curl_easy *data) +{ + struct curltime now = curlx_now(); /* what time is it */ + return pgrs_update(data, &now); +} + +CURLcode Curl_pgrsCheck(struct Curl_easy *data) +{ + struct curltime now = curlx_now(); + CURLcode result; + + result = pgrs_update(data, &now); + if(!result && !data->req.done) + result = pgrs_speedcheck(data, &now); + return result; +} + /* * Update all progress, do not do progress meter/callbacks. */ void Curl_pgrsUpdate_nometer(struct Curl_easy *data) { struct curltime now = curlx_now(); /* what time is it */ - (void)progress_calc(data, now); + (void)progress_calc(data, &now); } diff --git a/lib/progress.h b/lib/progress.h index 7a176b7554ac..96a26fe1a4d9 100644 --- a/lib/progress.h +++ b/lib/progress.h @@ -26,6 +26,7 @@ #include "curlx/timeval.h" +struct Curl_easy; typedef enum { TIMER_NONE, @@ -50,15 +51,23 @@ void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size); void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size); void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size); -void Curl_ratelimit(struct Curl_easy *data, struct curltime now); -int Curl_pgrsUpdate(struct Curl_easy *data); + +/* perform progress update, invoking callbacks at intervals */ +CURLcode Curl_pgrsUpdate(struct Curl_easy *data); +/* perform progress update, no callbacks invoked */ void Curl_pgrsUpdate_nometer(struct Curl_easy *data); +/* perform progress update with callbacks and speed checks */ +CURLcode Curl_pgrsCheck(struct Curl_easy *data); + +/* Inform progress/speedcheck about receive pausing */ +void Curl_pgrsRecvPause(struct Curl_easy *data, bool enable); +/* Reset sizes and couners for up- and download. */ +void Curl_pgrsReset(struct Curl_easy *data); +/* Reset sizes for up- and download. */ void Curl_pgrsResetTransferSizes(struct Curl_easy *data); + struct curltime Curl_pgrsTime(struct Curl_easy *data, timerid timer); -timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, - curl_off_t speed_limit, - struct curltime now); /** * Update progress timer with the elapsed time from its start to `timestamp`. * This allows updating timers later and is used by happy eyeballing, where @@ -69,4 +78,9 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, void Curl_pgrsEarlyData(struct Curl_easy *data, curl_off_t sent); +#ifdef UNITTESTS +UNITTEST CURLcode pgrs_speedcheck(struct Curl_easy *data, + struct curltime *pnow); +#endif + #endif /* HEADER_CURL_PROGRESS_H */ diff --git a/lib/ratelimit.c b/lib/ratelimit.c new file mode 100644 index 000000000000..8b34d77e1313 --- /dev/null +++ b/lib/ratelimit.c @@ -0,0 +1,200 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#include "curl_setup.h" + +#include "curlx/timeval.h" +#include "ratelimit.h" + + +#define CURL_US_PER_SEC 1000000 +#define CURL_RLIMIT_MIN_CHUNK (16 * 1024) +#define CURL_RLIMIT_MAX_STEPS 2 /* 500ms interval */ + +void Curl_rlimit_init(struct Curl_rlimit *r, + curl_off_t rate_per_s, + curl_off_t burst_per_s, + struct curltime ts) +{ + curl_off_t rate_steps; + + DEBUGASSERT(rate_per_s >= 0); + DEBUGASSERT(burst_per_s >= rate_per_s || !burst_per_s); + r->step_us = CURL_US_PER_SEC; + r->rate_per_step = rate_per_s; + r->burst_per_step = burst_per_s; + /* On rates that are multiples of CURL_RLIMIT_MIN_CHUNK, we reduce + * the interval `step_us` from 1 second to smaller steps with at + * most CURL_RLIMIT_MAX_STEPS. + * Smaller means more CPU, but also more precision. */ + rate_steps = rate_per_s / CURL_RLIMIT_MIN_CHUNK; + rate_steps = CURLMIN(rate_steps, CURL_RLIMIT_MAX_STEPS); + if(rate_steps >= 2) { + r->step_us /= rate_steps; + r->rate_per_step /= rate_steps; + r->burst_per_step /= rate_steps; + } + r->tokens = r->rate_per_step; + r->spare_us = 0; + r->ts = ts; + r->blocked = FALSE; +} + +void Curl_rlimit_start(struct Curl_rlimit *r, struct curltime ts) +{ + r->tokens = r->rate_per_step; + r->spare_us = 0; + r->ts = ts; +} + +bool Curl_rlimit_active(struct Curl_rlimit *r) +{ + return (r->rate_per_step > 0) || r->blocked; +} + +bool Curl_rlimit_is_blocked(struct Curl_rlimit *r) +{ + return r->blocked; +} + +static void ratelimit_update(struct Curl_rlimit *r, + struct curltime ts) +{ + timediff_t elapsed_us, elapsed_steps; + curl_off_t token_gain; + + DEBUGASSERT(r->rate_per_step); + if((r->ts.tv_sec == ts.tv_sec) && (r->ts.tv_usec == ts.tv_usec)) + return; + + elapsed_us = curlx_timediff_us(ts, r->ts); + if(elapsed_us < 0) { /* not going back in time */ + curl_mfprintf(stderr, "rlimit: neg elapsed time %" FMT_TIMEDIFF_T "us\n", + elapsed_us); + DEBUGASSERT(0); + return; + } + + elapsed_us += r->spare_us; + if(elapsed_us < r->step_us) + return; + + /* we do the update */ + r->ts = ts; + elapsed_steps = elapsed_us / r->step_us; + r->spare_us = elapsed_us % r->step_us; + + /* How many tokens did we gain since the last update? */ + if(r->rate_per_step > (CURL_OFF_T_MAX / elapsed_steps)) + token_gain = CURL_OFF_T_MAX; + else { + token_gain = r->rate_per_step * elapsed_steps; + } + + /* Limit the token again by the burst rate per second (if set), so we + * do not suddenly have a huge number of tokens after inactivity. */ + r->tokens += token_gain; + if(r->burst_per_step && (r->tokens > r->burst_per_step)) { + r->tokens = r->burst_per_step; + } +} + +curl_off_t Curl_rlimit_avail(struct Curl_rlimit *r, + struct curltime ts) +{ + if(r->blocked) + return 0; + else if(r->rate_per_step) { + ratelimit_update(r, ts); + return r->tokens; + } + else + return CURL_OFF_T_MAX; +} + +void Curl_rlimit_drain(struct Curl_rlimit *r, + size_t tokens, + struct curltime ts) +{ + if(r->blocked || !r->rate_per_step) + return; + + ratelimit_update(r, ts); +#if SIZEOF_CURL_OFF_T <= SIZEOF_SIZE_T + if(tokens > CURL_OFF_T_MAX) { + r->tokens = CURL_OFF_T_MIN; + return; + } + else +#endif + { + curl_off_t val = (curl_off_t)tokens; + if((CURL_OFF_T_MIN + val) < r->tokens) + r->tokens -= val; + else + r->tokens = CURL_OFF_T_MIN; + } +} + +timediff_t Curl_rlimit_wait_ms(struct Curl_rlimit *r, + struct curltime ts) +{ + timediff_t wait_us, elapsed_us; + + if(r->blocked || !r->rate_per_step) + return 0; + ratelimit_update(r, ts); + if(r->tokens > 0) + return 0; + + /* How much time will it take tokens to become positive again? + * Deduct `spare_us` and check against already elapsed time */ + wait_us = (1 + (-r->tokens / r->rate_per_step)) * r->step_us; + wait_us -= r->spare_us; + + elapsed_us = curlx_timediff_us(ts, r->ts); + if(elapsed_us >= wait_us) + return 0; + wait_us -= elapsed_us; + return (wait_us + 999) / 1000; /* in milliseconds */ +} + +void Curl_rlimit_block(struct Curl_rlimit *r, + bool activate, + struct curltime ts) +{ + if(!activate == !r->blocked) + return; + + r->ts = ts; + r->blocked = activate; + if(!r->blocked) { + /* Start rate limiting fresh. The amount of time this was blocked + * does not generate extra tokens. */ + Curl_rlimit_start(r, ts); + } + else { + r->tokens = 0; + } +} diff --git a/lib/ratelimit.h b/lib/ratelimit.h new file mode 100644 index 000000000000..53f803039145 --- /dev/null +++ b/lib/ratelimit.h @@ -0,0 +1,92 @@ +#ifndef HEADER_Curl_rlimit_H +#define HEADER_Curl_rlimit_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#include "curlx/timeval.h" + +/* This is a rate limiter that provides "tokens" to be consumed + * per second with a "burst" rate limitation. Example: + * A rate limit of 1 megabyte per second with a burst rate of 1.5MB. + * - initially 1 million tokens are available. + * - these are drained in the first second. + * - checking available tokens before the 2nd second will return 0. + * - at/after the 2nd second, 1 million tokens are available again. + * - nothing happens for a second, the 1 million tokens would grow + * to 2 million, however the burst limit caps those at 1.5 million. + * Thus: + * - setting "burst" to CURL_OFF_T_MAX would average tokens over the + * complete lifetime. E.g. for a download, at the *end* of it, the + * average rate from start to finish would be the rate limit. + * - setting "burst" to the same value as "rate" would make a + * download always try to stay *at/below* the rate and slow times will + * not generate extra tokens. + * A rate limit can be blocked, causing the available tokens to become + * always 0 until unblocked. After unblocking, the rate limiting starts + * again with no history of the past. + * Finally, a rate limiter with rate 0 will always have CURL_OFF_T_MAX + * tokens available, unless blocked. + */ + +struct Curl_rlimit { + curl_off_t rate_per_step; /* rate tokens are generated per step us */ + curl_off_t burst_per_step; /* burst rate of tokens per step us */ + timediff_t step_us; /* microseconds between token increases */ + curl_off_t tokens; /* tokens available in the next second */ + timediff_t spare_us; /* microseconds unaffecting tokens */ + struct curltime ts; /* time of the last update */ + BIT(blocked); /* blocking sets available tokens to 0 */ +}; + +void Curl_rlimit_init(struct Curl_rlimit *r, + curl_off_t rate_per_s, + curl_off_t burst_per_s, + struct curltime ts); + +/* Start ratelimiting with the given timestamp. Resets available tokens. */ +void Curl_rlimit_start(struct Curl_rlimit *r, struct curltime ts); + +/* How many milliseconds to wait until token are available again. */ +timediff_t Curl_rlimit_wait_ms(struct Curl_rlimit *r, + struct curltime ts); + +/* Return if rate limiting of tokens is active */ +bool Curl_rlimit_active(struct Curl_rlimit *r); +bool Curl_rlimit_is_blocked(struct Curl_rlimit *r); + +/* Return how many tokens are available to spend, may be negative */ +curl_off_t Curl_rlimit_avail(struct Curl_rlimit *r, + struct curltime ts); + +/* Drain tokens from the ratelimit, return how many are now available. */ +void Curl_rlimit_drain(struct Curl_rlimit *r, + size_t tokens, + struct curltime ts); + +/* Block/unblock ratelimiting. A blocked ratelimit has 0 tokens available. */ +void Curl_rlimit_block(struct Curl_rlimit *r, + bool activate, + struct curltime ts); + +#endif /* HEADER_Curl_rlimit_H */ diff --git a/lib/request.c b/lib/request.c index 9778a0c95372..5bfcdfbfb8c7 100644 --- a/lib/request.c +++ b/lib/request.c @@ -258,7 +258,7 @@ static CURLcode req_set_upload_done(struct Curl_easy *data) { DEBUGASSERT(!data->req.upload_done); data->req.upload_done = TRUE; - data->req.keepon &= ~(KEEP_SEND|KEEP_SEND_TIMED); /* we are done sending */ + data->req.keepon &= ~KEEP_SEND; /* we are done sending */ Curl_pgrsTime(data, TIMER_POSTRANSFER); Curl_creader_done(data, data->req.upload_aborted); @@ -420,9 +420,9 @@ bool Curl_req_want_send(struct Curl_easy *data) * - or request has buffered data to send * - or transfer connection has pending data to send */ return !data->req.done && - (((data->req.keepon & KEEP_SENDBITS) == KEEP_SEND) || - !Curl_req_sendbuf_empty(data) || - Curl_xfer_needs_flush(data)); + ((data->req.keepon & KEEP_SEND) || + !Curl_req_sendbuf_empty(data) || + Curl_xfer_needs_flush(data)); } bool Curl_req_done_sending(struct Curl_easy *data) @@ -458,8 +458,7 @@ CURLcode Curl_req_abort_sending(struct Curl_easy *data) if(!data->req.upload_done) { Curl_bufq_reset(&data->req.sendbuf); data->req.upload_aborted = TRUE; - /* no longer KEEP_SEND and KEEP_SEND_PAUSE */ - data->req.keepon &= ~KEEP_SENDBITS; + data->req.keepon &= ~KEEP_SEND; return req_set_upload_done(data); } return CURLE_OK; @@ -470,6 +469,6 @@ CURLcode Curl_req_stop_send_recv(struct Curl_easy *data) /* stop receiving and ALL sending as well, including PAUSE and HOLD. * We might still be paused on receive client writes though, so * keep those bits around. */ - data->req.keepon &= ~(KEEP_RECV|KEEP_SENDBITS); + data->req.keepon &= ~(KEEP_RECV|KEEP_SEND); return Curl_req_abort_sending(data); } diff --git a/lib/request.h b/lib/request.h index e12d5efdcb23..0f9e0a6ff4fc 100644 --- a/lib/request.h +++ b/lib/request.h @@ -130,6 +130,7 @@ struct SingleRequest { BIT(sendbuf_init); /* sendbuf is initialized */ BIT(shutdown); /* request end will shutdown connection */ BIT(shutdown_err_ignore); /* errors in shutdown will not fail request */ + BIT(reader_started); /* client reads have started */ }; /** diff --git a/lib/rtsp.c b/lib/rtsp.c index 95215b8d4bfa..b4b3d6dd556d 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -142,7 +142,7 @@ const struct Curl_handler Curl_handler_rtsp = { ZERO_NULL, /* proto_pollset */ rtsp_do_pollset, /* doing_pollset */ ZERO_NULL, /* domore_pollset */ - ZERO_NULL, /* perform_pollset */ + Curl_http_perform_pollset, /* perform_pollset */ ZERO_NULL, /* disconnect */ rtsp_rtp_write_resp, /* write_resp */ rtsp_rtp_write_resp_hd, /* write_resp_hd */ @@ -668,8 +668,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) /* if a request-body has been sent off, we make sure this progress is noted properly */ Curl_pgrsSetUploadCounter(data, data->req.writebytecount); - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; + result = Curl_pgrsUpdate(data); } out: curlx_dyn_free(&req_buffer); diff --git a/lib/select.c b/lib/select.c index 7818082e7543..041733973e9e 100644 --- a/lib/select.c +++ b/lib/select.c @@ -711,7 +711,7 @@ void Curl_pollset_check(struct Curl_easy *data, *pwant_read = *pwant_write = FALSE; } -bool Curl_pollset_want_read(struct Curl_easy *data, +bool Curl_pollset_want_recv(struct Curl_easy *data, struct easy_pollset *ps, curl_socket_t sock) { @@ -723,3 +723,16 @@ bool Curl_pollset_want_read(struct Curl_easy *data, } return FALSE; } + +bool Curl_pollset_want_send(struct Curl_easy *data, + struct easy_pollset *ps, + curl_socket_t sock) +{ + unsigned int i; + (void)data; + for(i = 0; i < ps->n; ++i) { + if((ps->sockets[i] == sock) && (ps->actions[i] & CURL_POLL_OUT)) + return TRUE; + } + return FALSE; +} diff --git a/lib/select.h b/lib/select.h index c1f975e9d79c..fb54686af3e2 100644 --- a/lib/select.h +++ b/lib/select.h @@ -163,8 +163,12 @@ CURLcode Curl_pollset_set(struct Curl_easy *data, #define Curl_pollset_add_in(data, ps, sock) \ Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0) +#define Curl_pollset_remove_in(data, ps, sock) \ + Curl_pollset_change((data), (ps), (sock), 0, CURL_POLL_IN) #define Curl_pollset_add_out(data, ps, sock) \ Curl_pollset_change((data), (ps), (sock), CURL_POLL_OUT, 0) +#define Curl_pollset_remove_out(data, ps, sock) \ + Curl_pollset_change((data), (ps), (sock), 0, CURL_POLL_OUT) #define Curl_pollset_add_inout(data, ps, sock) \ Curl_pollset_change((data), (ps), (sock), \ CURL_POLL_IN|CURL_POLL_OUT, 0) @@ -188,10 +192,12 @@ void Curl_pollset_check(struct Curl_easy *data, struct easy_pollset *ps, curl_socket_t sock, bool *pwant_read, bool *pwant_write); -/** - * Return TRUE if the pollset contains socket with CURL_POLL_IN. - */ -bool Curl_pollset_want_read(struct Curl_easy *data, +/* TRUE if the pollset contains socket with CURL_POLL_IN. */ +bool Curl_pollset_want_recv(struct Curl_easy *data, + struct easy_pollset *ps, + curl_socket_t sock); +/* TRUE if the pollset contains socket with CURL_POLL_OUT. */ +bool Curl_pollset_want_send(struct Curl_easy *data, struct easy_pollset *ps, curl_socket_t sock); diff --git a/lib/sendf.c b/lib/sendf.c index 655444a29504..f70abb5797bc 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -108,6 +108,7 @@ static void cl_reset_writer(struct Curl_easy *data) static void cl_reset_reader(struct Curl_easy *data) { struct Curl_creader *reader = data->req.reader_stack; + data->req.reader_started = FALSE; while(reader) { data->req.reader_stack = reader->next; reader->crt->do_close(data, reader); @@ -231,6 +232,7 @@ static CURLcode cw_download_write(struct Curl_easy *data, if(!is_connect && !ctx->started_response) { Curl_pgrsTime(data, TIMER_STARTTRANSFER); + Curl_rlimit_start(&data->progress.dl.rlimit, curlx_now()); ctx->started_response = TRUE; } @@ -301,7 +303,9 @@ static CURLcode cw_download_write(struct Curl_easy *data, if(result) return result; } + /* Update stats, write and report progress */ + Curl_rlimit_drain(&data->progress.dl.rlimit, nwrite, curlx_now()); data->req.bytecount += nwrite; Curl_pgrsSetDownloadCounter(data, data->req.bytecount); @@ -1198,9 +1202,28 @@ CURLcode Curl_client_read(struct Curl_easy *data, char *buf, size_t blen, return result; DEBUGASSERT(data->req.reader_stack); } + if(!data->req.reader_started) { + Curl_rlimit_start(&data->progress.ul.rlimit, curlx_now()); + data->req.reader_started = TRUE; + } + if(Curl_rlimit_active(&data->progress.ul.rlimit)) { + curl_off_t ul_avail = + Curl_rlimit_avail(&data->progress.ul.rlimit, curlx_now()); + if(ul_avail <= 0) { + result = CURLE_OK; + *eos = FALSE; + goto out; + } + if(ul_avail < (curl_off_t)blen) + blen = (size_t)ul_avail; + } result = Curl_creader_read(data, data->req.reader_stack, buf, blen, nread, eos); + if(!result) + Curl_rlimit_drain(&data->progress.ul.rlimit, *nread, curlx_now()); + +out: CURL_TRC_READ(data, "client_read(len=%zu) -> %d, nread=%zu, eos=%d", blen, result, *nread, *eos); return result; diff --git a/lib/setopt.c b/lib/setopt.c index 338e94d1bbf4..1147deb1162f 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2842,6 +2842,7 @@ static CURLcode setopt_offt(struct Curl_easy *data, CURLoption option, if(offt < 0) return CURLE_BAD_FUNCTION_ARGUMENT; s->max_send_speed = offt; + Curl_rlimit_init(&data->progress.ul.rlimit, offt, offt, curlx_now()); break; case CURLOPT_MAX_RECV_SPEED_LARGE: /* @@ -2851,6 +2852,7 @@ static CURLcode setopt_offt(struct Curl_easy *data, CURLoption option, if(offt < 0) return CURLE_BAD_FUNCTION_ARGUMENT; s->max_recv_speed = offt; + Curl_rlimit_init(&data->progress.dl.rlimit, offt, offt, curlx_now()); break; case CURLOPT_RESUME_FROM_LARGE: /* diff --git a/lib/smtp.c b/lib/smtp.c index f36459634ebb..af4676dc182d 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1697,10 +1697,7 @@ static CURLcode smtp_regular_transfer(struct Curl_easy *data, data->req.size = -1; /* Set the progress data */ - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, -1); - Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsReset(data); /* Carry out the perform */ result = smtp_perform(data, smtpc, smtp, &connected, dophase_done); diff --git a/lib/speedcheck.c b/lib/speedcheck.c deleted file mode 100644 index b074199c37d6..000000000000 --- a/lib/speedcheck.c +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include "curl_setup.h" - -#include -#include "urldata.h" -#include "sendf.h" -#include "transfer.h" -#include "multiif.h" -#include "speedcheck.h" - -void Curl_speedinit(struct Curl_easy *data) -{ - memset(&data->state.keeps_speed, 0, sizeof(struct curltime)); -} - -/* - * @unittest: 1606 - */ -CURLcode Curl_speedcheck(struct Curl_easy *data, - struct curltime now) -{ - if(Curl_xfer_recv_is_paused(data) || Curl_xfer_send_is_paused(data)) - /* A paused transfer is not qualified for speed checks */ - return CURLE_OK; - - if((data->progress.current_speed >= 0) && data->set.low_speed_time) { - if(data->progress.current_speed < data->set.low_speed_limit) { - if(!data->state.keeps_speed.tv_sec) - /* under the limit at this moment */ - data->state.keeps_speed = now; - else { - /* how long has it been under the limit */ - timediff_t howlong = curlx_timediff_ms(now, data->state.keeps_speed); - - if(howlong >= data->set.low_speed_time * 1000) { - /* too long */ - failf(data, - "Operation too slow. " - "Less than %ld bytes/sec transferred the last %ld seconds", - data->set.low_speed_limit, - data->set.low_speed_time); - return CURLE_OPERATION_TIMEDOUT; - } - } - } - else - /* faster right now */ - data->state.keeps_speed.tv_sec = 0; - } - - if(data->set.low_speed_limit) - /* if low speed limit is enabled, set the expire timer to make this - connection's speed get checked again in a second */ - Curl_expire(data, 1000, EXPIRE_SPEEDCHECK); - - return CURLE_OK; -} diff --git a/lib/speedcheck.h b/lib/speedcheck.h deleted file mode 100644 index f54365cadfac..000000000000 --- a/lib/speedcheck.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef HEADER_CURL_SPEEDCHECK_H -#define HEADER_CURL_SPEEDCHECK_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -#include "curl_setup.h" - -#include "curlx/timeval.h" -struct Curl_easy; -void Curl_speedinit(struct Curl_easy *data); -CURLcode Curl_speedcheck(struct Curl_easy *data, - struct curltime now); - -#endif /* HEADER_CURL_SPEEDCHECK_H */ diff --git a/lib/telnet.c b/lib/telnet.c index 45a70808ea6b..d0ca5a66ce11 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1659,9 +1659,10 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } } - if(Curl_pgrsUpdate(data)) { - result = CURLE_ABORTED_BY_CALLBACK; - break; + if(!result) { + result = Curl_pgrsUpdate(data); + if(result) + keepon = FALSE; } } #endif diff --git a/lib/tftp.c b/lib/tftp.c index c730f8499ec4..ce9d200f05e3 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -59,7 +59,6 @@ #include "multiif.h" #include "url.h" #include "strcase.h" -#include "speedcheck.h" #include "select.h" #include "escape.h" #include "curlx/strerr.h" @@ -1175,9 +1174,10 @@ static CURLcode tftp_receive_packet(struct Curl_easy *data, } /* Update the progress meter */ - if(Curl_pgrsUpdate(data)) { + result = Curl_pgrsUpdate(data); + if(result) { tftp_state_machine(state, TFTP_EVENT_ERROR); - return CURLE_ABORTED_BY_CALLBACK; + return result; } } return result; @@ -1297,10 +1297,7 @@ static CURLcode tftp_doing(struct Curl_easy *data, bool *dophase_done) /* The multi code does not have this logic for the DOING state so we provide it for TFTP since it may do the entire transfer in this state. */ - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, curlx_now()); + result = Curl_pgrsCheck(data); } return result; } diff --git a/lib/transfer.c b/lib/transfer.c index b576e6b88dbe..fbacdf429061 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -65,7 +65,6 @@ #include "cw-out.h" #include "transfer.h" #include "sendf.h" -#include "speedcheck.h" #include "progress.h" #include "http.h" #include "url.h" @@ -241,10 +240,9 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, char *buf, *xfer_buf; size_t blen, xfer_blen; int maxloops = 10; - curl_off_t total_received = 0; bool is_multiplex = FALSE; bool rcvd_eagain = FALSE; - bool is_eos = FALSE; + bool is_eos = FALSE, rate_limited = FALSE; result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen); if(result) @@ -265,15 +263,21 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, buf = xfer_buf; bytestoread = xfer_blen; - if(bytestoread && data->set.max_recv_speed > 0) { - /* In case of speed limit on receiving: if this loop already got - * a quarter of the quota, break out. We want to stutter a bit - * to keep in the limit, but too small receives will just cost - * cpu unnecessarily. */ - if(total_received && (total_received >= (data->set.max_recv_speed / 4))) + if(bytestoread && Curl_rlimit_active(&data->progress.dl.rlimit)) { + curl_off_t dl_avail = Curl_rlimit_avail(&data->progress.dl.rlimit, + curlx_now()); + /* DEBUGF(infof(data, "dl_rlimit, available=%" FMT_OFF_T, dl_avail)); + */ + /* In case of rate limited downloads: if this loop already got + * data and less than 16k is left in the limit, break out. + * We want to stutter a bit to keep in the limit, but too small + * receives will just cost cpu unnecessarily. */ + if(dl_avail <= 0) { + rate_limited = TRUE; break; - if(data->set.max_recv_speed < (curl_off_t)bytestoread) - bytestoread = (size_t)data->set.max_recv_speed; + } + if(dl_avail < (curl_off_t)bytestoread) + bytestoread = (size_t)dl_avail; } rcvd_eagain = FALSE; @@ -315,7 +319,6 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, if(k->eos_written) /* already did write this to client, leave */ break; } - total_received += blen; result = Curl_xfer_write_resp(data, buf, blen, is_eos); if(result || data->req.done) @@ -327,13 +330,13 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, if((!is_multiplex && data->req.download_done) || is_eos) { data->req.keepon &= ~KEEP_RECV; } - /* if we are PAUSEd or stopped receiving, leave the loop */ - if((k->keepon & KEEP_RECV_PAUSE) || !(k->keepon & KEEP_RECV)) + /* if we stopped receiving, leave the loop */ + if(!(k->keepon & KEEP_RECV)) break; } while(maxloops--); - if(!is_eos && !Curl_xfer_is_blocked(data) && + if(!is_eos && !rate_limited && CURL_WANT_RECV(data) && (!rcvd_eagain || data_pending(data, rcvd_eagain))) { /* Did not read until EAGAIN/EOS or there is still data pending * in buffers. Mark as read-again via simulated SELECT results. */ @@ -396,16 +399,13 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp) } /* If we still have writing to do, we check if we have a writable socket. */ - if(Curl_req_want_send(data) || (data->req.keepon & KEEP_SEND_TIMED)) { + if(Curl_req_want_send(data)) { result = sendrecv_ul(data); if(result) goto out; } - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, *nowp); + result = Curl_pgrsCheck(data); if(result) goto out; @@ -440,16 +440,14 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp) result = CURLE_PARTIAL_FILE; goto out; } - if(Curl_pgrsUpdate(data)) { - result = CURLE_ABORTED_BY_CALLBACK; - goto out; - } } /* If there is nothing more to send/recv, the request is done */ - if((k->keepon & (KEEP_RECVBITS|KEEP_SENDBITS)) == 0) + if((k->keepon & (KEEP_RECV|KEEP_SEND)) == 0) data->req.done = TRUE; + result = Curl_pgrsUpdate(data); + out: if(result) DEBUGF(infof(data, "Curl_sendrecv() -> %d", result)); @@ -913,51 +911,30 @@ bool Curl_xfer_is_blocked(struct Curl_easy *data) bool Curl_xfer_send_is_paused(struct Curl_easy *data) { - return (data->req.keepon & KEEP_SEND_PAUSE); + return Curl_rlimit_is_blocked(&data->progress.ul.rlimit); } bool Curl_xfer_recv_is_paused(struct Curl_easy *data) { - return (data->req.keepon & KEEP_RECV_PAUSE); + return Curl_rlimit_is_blocked(&data->progress.dl.rlimit); } CURLcode Curl_xfer_pause_send(struct Curl_easy *data, bool enable) { CURLcode result = CURLE_OK; - if(enable) { - data->req.keepon |= KEEP_SEND_PAUSE; - } - else { - data->req.keepon &= ~KEEP_SEND_PAUSE; - if(Curl_creader_is_paused(data)) - result = Curl_creader_unpause(data); - } + Curl_rlimit_block(&data->progress.ul.rlimit, enable, curlx_now()); + if(!enable && Curl_creader_is_paused(data)) + result = Curl_creader_unpause(data); return result; } CURLcode Curl_xfer_pause_recv(struct Curl_easy *data, bool enable) { CURLcode result = CURLE_OK; - if(enable) { - data->req.keepon |= KEEP_RECV_PAUSE; - } - else { - data->req.keepon &= ~KEEP_RECV_PAUSE; - if(Curl_cwriter_is_paused(data)) - result = Curl_cwriter_unpause(data); - } + Curl_rlimit_block(&data->progress.dl.rlimit, enable, curlx_now()); + if(!enable && Curl_cwriter_is_paused(data)) + result = Curl_cwriter_unpause(data); Curl_conn_ev_data_pause(data, enable); + Curl_pgrsRecvPause(data, enable); return result; } - -bool Curl_xfer_is_too_fast(struct Curl_easy *data) -{ - struct Curl_llist_node *e = Curl_llist_head(&data->state.timeoutlist); - while(e) { - struct time_node *n = Curl_node_elem(e); - e = Curl_node_next(e); - if(n->eid == EXPIRE_TOOFAST) - return TRUE; - } - return FALSE; -} diff --git a/lib/transfer.h b/lib/transfer.h index 6145efb4a5fd..b96629d97968 100644 --- a/lib/transfer.h +++ b/lib/transfer.h @@ -143,7 +143,4 @@ bool Curl_xfer_recv_is_paused(struct Curl_easy *data); CURLcode Curl_xfer_pause_send(struct Curl_easy *data, bool enable); CURLcode Curl_xfer_pause_recv(struct Curl_easy *data, bool enable); -/* Query if transfer has expire timeout TOOFAST set. */ -bool Curl_xfer_is_too_fast(struct Curl_easy *data); - #endif /* HEADER_CURL_TRANSFER_H */ diff --git a/lib/url.c b/lib/url.c index 7e4d455a8cd8..f9b1ed0808e7 100644 --- a/lib/url.c +++ b/lib/url.c @@ -88,7 +88,6 @@ #include "select.h" #include "multiif.h" #include "easyif.h" -#include "speedcheck.h" #include "curlx/warnless.h" #include "getinfo.h" #include "pop3.h" @@ -3884,7 +3883,6 @@ CURLcode Curl_connect(struct Curl_easy *data, CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn) { - /* if this is a pushed stream, we need this: */ CURLcode result; if(conn) { @@ -3904,9 +3902,7 @@ CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn) result = Curl_req_start(&data->req, data); if(!result) { - Curl_speedinit(data); - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); + Curl_pgrsReset(data); } return result; } diff --git a/lib/urldata.h b/lib/urldata.h index 4b112e7072dd..e4fc49753fd4 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -156,6 +156,7 @@ typedef unsigned int curl_prot_t; #include "curlx/dynbuf.h" #include "dynhds.h" #include "request.h" +#include "ratelimit.h" #include "netrc.h" /* On error return, the value of `pnwritten` has no meaning */ @@ -426,30 +427,11 @@ struct hostname { #define KEEP_NONE 0 #define KEEP_RECV (1<<0) /* there is or may be data to read */ #define KEEP_SEND (1<<1) /* there is or may be data to write */ -#define KEEP_RECV_HOLD (1<<2) /* when set, no reading should be done but there - might still be data to read */ -#define KEEP_SEND_HOLD (1<<3) /* when set, no writing should be done but there - might still be data to write */ -#define KEEP_RECV_PAUSE (1<<4) /* reading is paused */ -#define KEEP_SEND_PAUSE (1<<5) /* writing is paused */ - -/* KEEP_SEND_TIMED is set when the transfer should attempt sending - * at timer (or other) events. A transfer waiting on a timer will - * remove KEEP_SEND to suppress POLLOUTs of the connection. - * Adding KEEP_SEND_TIMED will then attempt to send whenever the transfer - * enters the "readwrite" loop, e.g. when a timer fires. - * This is used in HTTP for 'Expect: 100-continue' waiting. */ -#define KEEP_SEND_TIMED (1<<6) - -#define KEEP_RECVBITS (KEEP_RECV | KEEP_RECV_HOLD | KEEP_RECV_PAUSE) -#define KEEP_SENDBITS (KEEP_SEND | KEEP_SEND_HOLD | KEEP_SEND_PAUSE) - -/* transfer wants to send is not PAUSE or HOLD */ -#define CURL_WANT_SEND(data) \ - (((data)->req.keepon & KEEP_SENDBITS) == KEEP_SEND) -/* transfer receive is not on PAUSE or HOLD */ -#define CURL_WANT_RECV(data) \ - (((data)->req.keepon & KEEP_RECVBITS) == KEEP_RECV) + +/* transfer wants to send */ +#define CURL_WANT_SEND(data) ((data)->req.keepon & KEEP_SEND) +/* transfer wants to receive */ +#define CURL_WANT_RECV(data) ((data)->req.keepon & KEEP_RECV) #define FIRSTSOCKET 0 #define SECONDARYSOCKET 1 @@ -805,16 +787,11 @@ struct PureInfo { BIT(used_proxy); /* the transfer used a proxy */ }; -struct pgrs_measure { - struct curltime start; /* when measure started */ - curl_off_t start_size; /* the 'cur_size' the measure started at */ -}; - struct pgrs_dir { curl_off_t total_size; /* total expected bytes */ curl_off_t cur_size; /* transferred bytes so far */ curl_off_t speed; /* bytes per second transferred */ - struct pgrs_measure limit; + struct Curl_rlimit rlimit; /* speed limiting / pausing */ }; struct Progress { @@ -843,10 +820,10 @@ struct Progress { struct curltime t_startqueue; struct curltime t_acceptdata; -#define CURR_TIME (5 + 1) /* 6 entries for 5 seconds */ +#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */ - curl_off_t speeder[ CURR_TIME ]; - struct curltime speeder_time[ CURR_TIME ]; + curl_off_t speed_amount[ CURL_SPEED_RECORDS ]; + struct curltime speed_time[ CURL_SPEED_RECORDS ]; unsigned char speeder_c; BIT(hide); BIT(ul_size_known); diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index ecfa895a2eaf..f63162b34417 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -80,10 +80,9 @@ #define QUIC_HANDSHAKE_TIMEOUT (10*NGTCP2_SECONDS) /* A stream window is the maximum amount we need to buffer for - * each active transfer. We use HTTP/3 flow control and only ACK - * when we take things out of the buffer. + * each active transfer. * Chunk size is large enough to take a full DATA frame */ -#define H3_STREAM_WINDOW_SIZE (128 * 1024) +#define H3_STREAM_WINDOW_SIZE (64 * 1024) #define H3_STREAM_CHUNK_SIZE (16 * 1024) #if H3_STREAM_CHUNK_SIZE < NGTCP2_MAX_UDP_PAYLOAD_SIZE #error H3_STREAM_CHUNK_SIZE smaller than NGTCP2_MAX_UDP_PAYLOAD_SIZE @@ -242,6 +241,7 @@ struct h3_stream_ctx { size_t sendbuf_len_in_flight; /* sendbuf amount "in flight" */ curl_uint64_t error3; /* HTTP/3 stream error code */ curl_off_t upload_left; /* number of request bytes left to upload */ + uint64_t download_unacked; /* bytes not acknowledged yet */ int status_code; /* HTTP status code */ CURLcode xfer_result; /* result from xfer_resp_write(_hd) */ BIT(resp_hds_complete); /* we have a complete, final response */ @@ -472,7 +472,7 @@ static void quic_settings(struct cf_ngtcp2_ctx *ctx, s->handshake_timeout = (data->set.connecttimeout > 0) ? data->set.connecttimeout * NGTCP2_MILLISECONDS : QUIC_HANDSHAKE_TIMEOUT; s->max_window = 100 * ctx->max_stream_window; - s->max_stream_window = 10 * ctx->max_stream_window; + s->max_stream_window = ctx->max_stream_window; s->no_pmtud = FALSE; #ifdef NGTCP2_SETTINGS_V3 /* try ten times the ngtcp2 defaults here for problems with Caddy */ @@ -1057,6 +1057,35 @@ static void h3_xfer_write_resp(struct Curl_cfilter *cf, } } +static void cf_ngtcp2_ack_stream(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream) +{ + struct cf_ngtcp2_ctx *ctx = cf->ctx; + struct curltime now = curlx_now(); + curl_off_t avail; + uint64_t ack_len = 0; + + /* How many byte to ack on the stream? */ + + /* how much does rate limiting allow us to acknowledge? */ + avail = Curl_rlimit_avail(&data->progress.dl.rlimit, now); + if(avail == CURL_OFF_T_MAX) { /* no rate limit, ack all */ + ack_len = stream->download_unacked; + } + else if(avail > 0) { + ack_len = CURLMIN(stream->download_unacked, (uint64_t)avail); + } + + if(ack_len) { + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] ACK %" PRIu64 + "/%" PRIu64 " bytes of DATA", stream->id, + ack_len, stream->download_unacked); + ngtcp2_conn_extend_max_stream_offset(ctx->qconn, stream->id, ack_len); + stream->download_unacked -= ack_len; + } +} + static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, const uint8_t *buf, size_t blen, void *user_data, void *stream_user_data) @@ -1073,13 +1102,15 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, return NGHTTP3_ERR_CALLBACK_FAILURE; h3_xfer_write_resp(cf, data, stream, (const char *)buf, blen, FALSE); - if(blen) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] ACK %zu bytes of DATA", - stream->id, blen); - ngtcp2_conn_extend_max_stream_offset(ctx->qconn, stream->id, blen); - ngtcp2_conn_extend_max_offset(ctx->qconn, blen); - } CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu", stream->id, blen); + + ngtcp2_conn_extend_max_offset(ctx->qconn, blen); + if(UINT64_MAX - blen < stream->download_unacked) + stream->download_unacked = UINT64_MAX; /* unlikely */ + else + stream->download_unacked += blen; + + cf_ngtcp2_ack_stream(cf, data, stream); return 0; } @@ -1374,6 +1405,8 @@ static CURLcode cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, goto out; } + cf_ngtcp2_ack_stream(cf, data, stream); + if(cf_progress_ingress(cf, data, &pktx)) { result = CURLE_RECV_ERROR; goto out; diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 9428a20a5f39..77a915884aaf 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -54,7 +54,6 @@ #include "../http.h" /* for HTTP proxy tunnel stuff */ #include "ssh.h" #include "../url.h" -#include "../speedcheck.h" #include "../vtls/vtls.h" #include "../cfilters.h" #include "../connect.h" @@ -2481,17 +2480,13 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, while((sshc->state != SSH_STOP) && !result) { bool block; timediff_t left_ms = 1000; - struct curltime now = curlx_now(); result = myssh_statemach_act(data, sshc, sshp, &block); if(result) break; if(!disconnect) { - if(Curl_pgrsUpdate(data)) - return CURLE_ABORTED_BY_CALLBACK; - - result = Curl_speedcheck(data, now); + result = Curl_pgrsCheck(data); if(result) break; @@ -2746,10 +2741,7 @@ static CURLcode myssh_do_it(struct Curl_easy *data, bool *done) sshc->secondCreateDirs = 0; /* reset the create directory attempt state variable */ - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, -1); - Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsReset(data); if(conn->handler->protocol & CURLPROTO_SCP) result = scp_perform(data, &connected, done); diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 3a7e14053fb9..714e3953730a 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -53,7 +53,6 @@ #include "../http.h" /* for HTTP proxy tunnel stuff */ #include "ssh.h" #include "../url.h" -#include "../speedcheck.h" #include "../vtls/vtls.h" #include "../cfilters.h" #include "../connect.h" @@ -3135,10 +3134,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, break; if(!disconnect) { - if(Curl_pgrsUpdate(data)) - return CURLE_ABORTED_BY_CALLBACK; - - result = Curl_speedcheck(data, now); + result = Curl_pgrsCheck(data); if(result) break; @@ -3534,10 +3530,7 @@ static CURLcode ssh_do(struct Curl_easy *data, bool *done) sshc->secondCreateDirs = 0; /* reset the create directory attempt state variable */ - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, -1); - Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsReset(data); if(conn->handler->protocol & CURLPROTO_SCP) result = scp_perform(data, &connected, done); diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index a40c440234ae..f7e831f002e5 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1811,10 +1811,9 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, int what; timediff_t timeout_ms, remaining; - if(Curl_pgrsUpdate(data)) { - result = CURLE_ABORTED_BY_CALLBACK; + result = Curl_pgrsUpdate(data); + if(result) break; - } elapsed = curlx_timediff_ms(curlx_now(), rs->start_time); if(elapsed >= MAX_RENEG_BLOCK_TIME) { diff --git a/lib/ws.c b/lib/ws.c index 140bdece47d8..b5c02bda9555 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -1927,9 +1927,9 @@ const struct Curl_handler Curl_handler_ws = { ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_pollset */ - Curl_http_do_pollset, /* doing_pollset */ + Curl_http_doing_pollset, /* doing_pollset */ ZERO_NULL, /* domore_pollset */ - ZERO_NULL, /* perform_pollset */ + Curl_http_perform_pollset, /* perform_pollset */ ZERO_NULL, /* disconnect */ Curl_http_write_resp, /* write_resp */ Curl_http_write_resp_hd, /* write_resp_hd */ @@ -1954,9 +1954,9 @@ const struct Curl_handler Curl_handler_wss = { NULL, /* connecting */ ZERO_NULL, /* doing */ NULL, /* proto_pollset */ - Curl_http_do_pollset, /* doing_pollset */ + Curl_http_doing_pollset, /* doing_pollset */ ZERO_NULL, /* domore_pollset */ - ZERO_NULL, /* perform_pollset */ + Curl_http_perform_pollset, /* perform_pollset */ ZERO_NULL, /* disconnect */ Curl_http_write_resp, /* write_resp */ Curl_http_write_resp_hd, /* write_resp_hd */ diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index fc10723814e1..bc3abbc7d80c 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -280,7 +280,7 @@ test3032 test3033 test3034 test3035 \ test3100 test3101 test3102 test3103 test3104 test3105 \ \ test3200 test3201 test3202 test3203 test3204 test3205 test3206 test3207 test3208 \ -test3209 test3210 test3211 test3212 test3213 test3214 test3215 \ +test3209 test3210 test3211 test3212 test3213 test3214 test3215 test3216 \ test4000 test4001 EXTRA_DIST = $(TESTCASES) DISABLED data-xml1 diff --git a/tests/data/test3216 b/tests/data/test3216 new file mode 100644 index 000000000000..923090c70ac1 --- /dev/null +++ b/tests/data/test3216 @@ -0,0 +1,19 @@ + + + +unittest +ratelimit + + + +# +# Client-side + + +unittest + + +ratelimit unit tests + + + diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 9abe497539d2..8cfd68b20463 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -27,11 +27,9 @@ import difflib import filecmp import logging -import math import os import re import sys -from datetime import timedelta import pytest from testenv import Env, CurlClient, LocalClient @@ -424,15 +422,17 @@ def test_02_24_speed_limit(self, env: Env, httpd, nghttpx, proto): count = 1 url = f'https://{env.authority_for(env.domain1, proto)}/data-1m' curl = CurlClient(env=env) - speed_limit = 384 * 1024 - min_duration = math.floor((1024 * 1024)/speed_limit) + speed_limit = 256 * 1024 r = curl.http_download(urls=[url], alpn_proto=proto, extra_args=[ '--limit-rate', f'{speed_limit}' ]) r.check_response(count=count, http_status=200) - assert r.duration > timedelta(seconds=min_duration), \ - f'rate limited transfer should take more than {min_duration}s, '\ - f'not {r.duration}' + dl_speed = r.stats[0]['speed_download'] + # speed limit is only exact on long durations. Ideally this transfer + # would take 4 seconds, but it may end just after 3 because then + # we have downloaded the rest and will not wait for the rate + # limit to increase again. + assert dl_speed <= ((1024*1024)/3), f'{r.stats[0]}' # make extreme parallel h2 upgrades, check invalid conn reuse # before protocol switch has happened diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index 8d6901884146..9e49ad7f4737 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -557,7 +557,7 @@ def test_07_50_put_speed_limit(self, env: Env, httpd, nghttpx, proto): r.check_response(count=count, http_status=200) assert r.responses[0]['header']['received-length'] == f'{up_len}', f'{r.responses[0]}' up_speed = r.stats[0]['speed_upload'] - assert (speed_limit * 0.5) <= up_speed <= (speed_limit * 1.5), f'{r.stats[0]}' + assert up_speed <= (speed_limit * 1.1), f'{r.stats[0]}' # speed limited on echo handler @pytest.mark.parametrize("proto", Env.http_protos()) @@ -573,7 +573,7 @@ def test_07_51_echo_speed_limit(self, env: Env, httpd, nghttpx, proto): ]) r.check_response(count=count, http_status=200) up_speed = r.stats[0]['speed_upload'] - assert (speed_limit * 0.5) <= up_speed <= (speed_limit * 1.5), f'{r.stats[0]}' + assert up_speed <= (speed_limit * 1.1), f'{r.stats[0]}' # upload larger data, triggering "Expect: 100-continue" code paths @pytest.mark.parametrize("proto", ['http/1.1']) diff --git a/tests/unit/Makefile.inc b/tests/unit/Makefile.inc index 7027973d2f93..af5e2ebc7594 100644 --- a/tests/unit/Makefile.inc +++ b/tests/unit/Makefile.inc @@ -42,4 +42,4 @@ TESTS_C = \ unit1979.c unit1980.c \ unit2600.c unit2601.c unit2602.c unit2603.c unit2604.c unit2605.c \ unit3200.c unit3205.c \ - unit3211.c unit3212.c unit3213.c unit3214.c + unit3211.c unit3212.c unit3213.c unit3214.c unit3216.c diff --git a/tests/unit/unit1606.c b/tests/unit/unit1606.c index d323b5ce020b..4e290db72a76 100644 --- a/tests/unit/unit1606.c +++ b/tests/unit/unit1606.c @@ -23,7 +23,7 @@ ***************************************************************************/ #include "unitcheck.h" -#include "speedcheck.h" +#include "progress.h" #include "urldata.h" static CURLcode t1606_setup(struct Curl_easy **easy) @@ -58,12 +58,12 @@ static int runawhile(struct Curl_easy *easy, curl_easy_setopt(easy, CURLOPT_LOW_SPEED_LIMIT, speed_limit); curl_easy_setopt(easy, CURLOPT_LOW_SPEED_TIME, time_limit); - Curl_speedinit(easy); + Curl_pgrsReset(easy); do { /* fake the current transfer speed */ easy->progress.current_speed = speed; - res = Curl_speedcheck(easy, now); + res = pgrs_speedcheck(easy, &now); if(res) break; /* step the time */ diff --git a/tests/unit/unit3216.c b/tests/unit/unit3216.c new file mode 100644 index 000000000000..cbe9a5f0bf51 --- /dev/null +++ b/tests/unit/unit3216.c @@ -0,0 +1,103 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ +#include "unitcheck.h" + +#include "ratelimit.h" + +static CURLcode test_unit3216(const char *arg) +{ + UNITTEST_BEGIN_SIMPLE + struct Curl_rlimit r; + struct curltime ts; + + /* A ratelimit that is unlimited */ + ts = curlx_now(); + Curl_rlimit_init(&r, 0, 0, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == CURL_OFF_T_MAX, "inf"); + Curl_rlimit_drain(&r, 1000000, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == CURL_OFF_T_MAX, "drain keep inf"); + fail_unless(Curl_rlimit_wait_ms(&r, ts) == 0, "inf never waits"); + + Curl_rlimit_block(&r, TRUE, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 0, "inf blocked to 0"); + Curl_rlimit_drain(&r, 1000000, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 0, "blocked inf"); + Curl_rlimit_block(&r, FALSE, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == CURL_OFF_T_MAX, + "unblocked unlimited"); + + /* A ratelimit that give 10 tokens per second */ + ts = curlx_now(); + Curl_rlimit_init(&r, 10, 0, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 10, "initial 10"); + Curl_rlimit_drain(&r, 5, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 5, "drain to 5"); + Curl_rlimit_drain(&r, 3, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 2, "drain to 2"); + ts.tv_usec += 1000; /* 1ms */ + Curl_rlimit_drain(&r, 3, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == -1, "drain to -1"); + fail_unless(Curl_rlimit_wait_ms(&r, ts) == 999, "wait 999ms"); + ts.tv_usec += 1000; /* 1ms */ + fail_unless(Curl_rlimit_wait_ms(&r, ts) == 998, "wait 998ms"); + ts.tv_sec += 1; + fail_unless(Curl_rlimit_avail(&r, ts) == 9, "10 inc per sec"); + ts.tv_sec += 1; + fail_unless(Curl_rlimit_avail(&r, ts) == 19, "10 inc per sec(2)"); + + Curl_rlimit_block(&r, TRUE, curlx_now()); + fail_unless(Curl_rlimit_avail(&r, curlx_now()) == 0, "10 blocked to 0"); + Curl_rlimit_block(&r, FALSE, curlx_now()); + fail_unless(Curl_rlimit_avail(&r, curlx_now()) == 10, "unblocked 10"); + + /* A ratelimit that give 10 tokens per second, max burst 15/s */ + ts = curlx_now(); + Curl_rlimit_init(&r, 10, 15, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 10, "initial 10"); + Curl_rlimit_drain(&r, 5, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 5, "drain to 5"); + Curl_rlimit_drain(&r, 3, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 2, "drain to 2"); + Curl_rlimit_drain(&r, 3, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == -1, "drain to -1"); + ts.tv_sec += 1; + fail_unless(Curl_rlimit_avail(&r, ts) == 9, "10 inc per sec"); + ts.tv_sec += 1; + fail_unless(Curl_rlimit_avail(&r, ts) == 15, "10/15 burst limit"); + ts.tv_sec += 1; + fail_unless(Curl_rlimit_avail(&r, ts) == 15, "10/15 burst limit(2)"); + Curl_rlimit_drain(&r, 15, ts); + fail_unless(Curl_rlimit_avail(&r, ts) == 0, "drain to 0"); + fail_unless(Curl_rlimit_wait_ms(&r, ts) == 1000, "wait 1 sec"); + ts.tv_usec += 500000; /* half a sec, cheating on second carry */ + fail_unless(Curl_rlimit_avail(&r, ts) == 0, "0 after 0.5 sec"); + fail_unless(Curl_rlimit_wait_ms(&r, ts) == 500, "wait 0.5 sec"); + ts.tv_sec += 1; + fail_unless(Curl_rlimit_avail(&r, ts) == 10, "10 after 1.5 sec"); + fail_unless(Curl_rlimit_wait_ms(&r, ts) == 0, "wait 0"); + ts.tv_usec += 500000; /* half a sec, cheating on second carry */ + fail_unless(Curl_rlimit_avail(&r, ts) == 15, "10 after 2 sec"); + + UNITTEST_END_SIMPLE +} From 56f2479c1433bd4f886295fcdce2459d1333eecf Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Nov 2025 12:46:01 +0100 Subject: [PATCH 510/885] manage: expand the 'libcurl support required' message Example of old text: --dns-ipv4-addr requires that libcurl is built to support c-ares. New version: For --dns-ipv4-addr to work, it requires that the underlying libcurl is built to support c-ares. Closes #19665 --- scripts/managen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/managen b/scripts/managen index 61dae8cc1f0f..d8ff9bae5124 100755 --- a/scripts/managen +++ b/scripts/managen @@ -854,7 +854,7 @@ sub single { if($requires) { my $l = manpageify($long, $manpage); - push @foot, "$l requires that libcurl". + push @foot, "For $l to work, it requires that the underlying libcurl". " is built to support $requires.\n"; } if($mutexed) { From 3887069c661b40e76b053a4867eb565d4761ab3e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 20:36:26 +0100 Subject: [PATCH 511/885] lib: rename internal header `share.h` to `curl_share.h` to avoid collision Windows CRTs have a `share.h`. Before this patch when trying to `#include ` it, the compiler picked up curl's internal `lib/share.h` instead. Rename it to avoid this issue. CRT `share.h` has constants necessary for using safe open CRT functions. Also rename `lib/share.c` to keep matching the header. Ref: https://learn.microsoft.com/cpp/c-runtime-library/sharing-constants Ref: 625f2c1644da58b9617479775badea21f125ce6d #16949 #16991 Cherry-picked from #19643 Closes #19676 --- lib/Makefile.inc | 4 ++-- lib/asyn-ares.c | 2 +- lib/asyn-base.c | 2 +- lib/asyn-thrdd.c | 2 +- lib/cf-socket.c | 2 +- lib/conncache.c | 2 +- lib/connect.c | 2 +- lib/cookie.c | 2 +- lib/{share.c => curl_share.c} | 2 +- lib/{share.h => curl_share.h} | 0 lib/doh.c | 2 +- lib/easy.c | 2 +- lib/hostip.c | 2 +- lib/hostip4.c | 2 +- lib/hostip6.c | 2 +- lib/hsts.c | 2 +- lib/http.c | 2 +- lib/multi.c | 2 +- lib/psl.c | 2 +- lib/setopt.c | 2 +- lib/url.c | 2 +- lib/vtls/vtls.c | 2 +- lib/vtls/vtls_scache.c | 2 +- tests/unit/unit1607.c | 2 +- tests/unit/unit1609.c | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) rename lib/{share.c => curl_share.c} (99%) rename lib/{share.h => curl_share.h} (100%) diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 9c9d5c918691..cad02c823786 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -172,6 +172,7 @@ LIB_CFILES = \ curl_rtmp.c \ curl_sasl.c \ curl_sha512_256.c \ + curl_share.c \ curl_sspi.c \ curl_threads.c \ curl_trc.c \ @@ -242,7 +243,6 @@ LIB_CFILES = \ sendf.c \ setopt.c \ sha256.c \ - share.c \ slist.c \ smb.c \ smtp.c \ @@ -311,6 +311,7 @@ LIB_HFILES = \ curl_setup_once.h \ curl_sha256.h \ curl_sha512_256.h \ + curl_share.h \ curl_sspi.h \ curl_threads.h \ curl_trc.h \ @@ -376,7 +377,6 @@ LIB_HFILES = \ setup-os400.h \ setup-vms.h \ setup-win32.h \ - share.h \ sigpipe.h \ slist.h \ smb.h \ diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index e01f7ba3d24e..ab57d5e00b41 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -52,7 +52,7 @@ #include "sendf.h" #include "hostip.h" #include "hash.h" -#include "share.h" +#include "curl_share.h" #include "url.h" #include "multiif.h" #include "curlx/inet_pton.h" diff --git a/lib/asyn-base.c b/lib/asyn-base.c index a49e1752a57a..d7e8e7d15b86 100644 --- a/lib/asyn-base.c +++ b/lib/asyn-base.c @@ -51,7 +51,7 @@ #include "hash.h" #include "multiif.h" #include "select.h" -#include "share.h" +#include "curl_share.h" #include "url.h" #include "curl_memory.h" /* The last #include file should be: */ diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index 07b666304910..f4f57b547a01 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -59,7 +59,7 @@ #include "sendf.h" #include "hostip.h" #include "hash.h" -#include "share.h" +#include "curl_share.h" #include "url.h" #include "multiif.h" #include "curl_threads.h" diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 0055f2d48c92..2930f95fe24c 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -75,7 +75,7 @@ #include "conncache.h" #include "multihandle.h" #include "rand.h" -#include "share.h" +#include "curl_share.h" #include "strdup.h" #include "system_win32.h" #include "curlx/version_win32.h" diff --git a/lib/conncache.c b/lib/conncache.c index 86dcce7138e6..275e490f23e8 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -38,7 +38,7 @@ #include "conncache.h" #include "http_negotiate.h" #include "http_ntlm.h" -#include "share.h" +#include "curl_share.h" #include "sigpipe.h" #include "connect.h" #include "select.h" diff --git a/lib/connect.c b/lib/connect.c index 4f9453907b0c..fbb5dcabff26 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -72,7 +72,7 @@ #include "curlx/warnless.h" #include "conncache.h" #include "multihandle.h" -#include "share.h" +#include "curl_share.h" #include "http_proxy.h" #include "socks.h" diff --git a/lib/cookie.c b/lib/cookie.c index 85356d563bb1..6099c6ea560d 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -31,7 +31,7 @@ #include "psl.h" #include "sendf.h" #include "slist.h" -#include "share.h" +#include "curl_share.h" #include "strcase.h" #include "curl_fopen.h" #include "curl_get_line.h" diff --git a/lib/share.c b/lib/curl_share.c similarity index 99% rename from lib/share.c rename to lib/curl_share.c index fdb80f5f64ab..b65d16c6281f 100644 --- a/lib/share.c +++ b/lib/curl_share.c @@ -27,7 +27,7 @@ #include #include "urldata.h" #include "connect.h" -#include "share.h" +#include "curl_share.h" #include "psl.h" #include "vtls/vtls.h" #include "vtls/vtls_scache.h" diff --git a/lib/share.h b/lib/curl_share.h similarity index 100% rename from lib/share.h rename to lib/curl_share.h diff --git a/lib/doh.c b/lib/doh.c index 636f0f41cf24..45524edf4c0b 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -33,7 +33,7 @@ #include "sendf.h" #include "multiif.h" #include "url.h" -#include "share.h" +#include "curl_share.h" #include "curlx/base64.h" #include "connect.h" #include "strdup.h" diff --git a/lib/easy.c b/lib/easy.c index 54896a8d55b4..8c7b9c23da68 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -53,7 +53,7 @@ #include "url.h" #include "getinfo.h" #include "hostip.h" -#include "share.h" +#include "curl_share.h" #include "strdup.h" #include "progress.h" #include "easyif.h" diff --git a/lib/hostip.c b/lib/hostip.c index 48889dcb43bc..d5f753f4b4a7 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -50,7 +50,7 @@ #include "hostip.h" #include "hash.h" #include "rand.h" -#include "share.h" +#include "curl_share.h" #include "url.h" #include "curlx/inet_ntop.h" #include "curlx/inet_pton.h" diff --git a/lib/hostip4.c b/lib/hostip4.c index e1ed007aafa3..d543c1e14b19 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -47,7 +47,7 @@ #include "sendf.h" #include "hostip.h" #include "hash.h" -#include "share.h" +#include "curl_share.h" #include "url.h" /* The last 2 #include files should be in this order */ diff --git a/lib/hostip6.c b/lib/hostip6.c index 9419b9e4d5fe..0f628b3fb5ca 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -48,7 +48,7 @@ #include "sendf.h" #include "hostip.h" #include "hash.h" -#include "share.h" +#include "curl_share.h" #include "url.h" #include "curlx/inet_pton.h" #include "connect.h" diff --git a/lib/hsts.c b/lib/hsts.c index ec332392c429..836481cd4c36 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -37,7 +37,7 @@ #include "sendf.h" #include "parsedate.h" #include "rename.h" -#include "share.h" +#include "curl_share.h" #include "strdup.h" #include "curlx/strparse.h" diff --git a/lib/http.c b/lib/http.c index a1e449d35441..ae932cd7c93a 100644 --- a/lib/http.c +++ b/lib/http.c @@ -65,7 +65,7 @@ #include "http_aws_sigv4.h" #include "url.h" #include "urlapi-int.h" -#include "share.h" +#include "curl_share.h" #include "hostip.h" #include "dynhds.h" #include "http.h" diff --git a/lib/multi.c b/lib/multi.c index 5ea93348e4e5..00af3ca2bddf 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -33,7 +33,7 @@ #include "connect.h" #include "progress.h" #include "easyif.h" -#include "share.h" +#include "curl_share.h" #include "psl.h" #include "multiif.h" #include "multi_ev.h" diff --git a/lib/psl.c b/lib/psl.c index 832d6d21b94a..f645763d063b 100644 --- a/lib/psl.c +++ b/lib/psl.c @@ -29,7 +29,7 @@ #ifdef USE_LIBPSL #include "psl.h" -#include "share.h" +#include "curl_share.h" /* The last 2 #include files should be in this order */ #include "curl_memory.h" diff --git a/lib/setopt.c b/lib/setopt.c index 1147deb1162f..fc95389312ad 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -41,7 +41,7 @@ #include "progress.h" #include "content_encoding.h" #include "strcase.h" -#include "share.h" +#include "curl_share.h" #include "vtls/vtls.h" #include "curlx/warnless.h" #include "sendf.h" diff --git a/lib/url.c b/lib/url.c index f9b1ed0808e7..1d4c6b1fc419 100644 --- a/lib/url.c +++ b/lib/url.c @@ -81,7 +81,7 @@ #include "cookie.h" #include "strcase.h" #include "escape.h" -#include "share.h" +#include "curl_share.h" #include "content_encoding.h" #include "http_digest.h" #include "http_negotiate.h" diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index ed0af3d53b91..d116ec91edb3 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -63,7 +63,7 @@ #include "../strcase.h" #include "../url.h" #include "../progress.h" -#include "../share.h" +#include "../curl_share.h" #include "../multiif.h" #include "../curlx/fopen.h" #include "../curlx/timeval.h" diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 328b12403e9b..3524a25a4417 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -41,7 +41,7 @@ #include "../strcase.h" #include "../url.h" #include "../llist.h" -#include "../share.h" +#include "../curl_share.h" #include "../curl_trc.h" #include "../curl_sha256.h" #include "../rand.h" diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 089caa1c45b8..3e4d53d0be5e 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -25,7 +25,7 @@ #include "urldata.h" #include "connect.h" -#include "share.h" +#include "curl_share.h" #include "memdebug.h" /* LAST include file */ diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index 00164617f522..f3f318f2cf97 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -25,7 +25,7 @@ #include "urldata.h" #include "connect.h" -#include "share.h" +#include "curl_share.h" #include "memdebug.h" /* LAST include file */ From 56bfde6554716f302998a29a192c82bf681a62ee Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Nov 2025 23:55:57 +0100 Subject: [PATCH 512/885] INTERNALS.md: add release dates to build dependencies Also: - delete `roffit`, that's not used anymore. Follow-up to ea0b575dab86a3c44dd1d547dc500276266aa382 #12753 Follow-up to 92d9dbe4c008646dd467d23dea963fa32e16cf85 #19611 Closes #19677 --- docs/INTERNALS.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index acc4506e6722..75393a5d1c72 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -46,13 +46,12 @@ versions of libs and build tools. we use a few "build tools" and we make sure that we remain functional with these versions: - - GNU Libtool 1.4.2 - - GNU Autoconf 2.59 - - GNU Automake 1.7 - - GNU M4 1.4 - - perl 5.8 (5.22 on Windows) - - roffit 0.5 - - cmake 3.7 + - GNU libtool 1.4.2 (2001-09-11) + - GNU autoconf 2.59 (2003-11-06) + - GNU automake 1.7 (2002-09-25) + - GNU m4 1.4 (2007-09-21) + - perl 5.8 (2002-07-19), on Windows: 5.22 (2015-06-01) + - cmake 3.7 (2016-11-11) Library Symbols =============== From ee97c2a96a07bad19504973df1384b18419a8eac Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Nov 2025 15:55:17 +0100 Subject: [PATCH 513/885] tests/server: use curlx file open/close functions Replace: - `open()` with `curlx_open()` (1 call). - `fopen()` with `curlx_fopen()`. - `fclose()` with `curlx_fclose()`. To centralize interacting with the CRT in preparation for using "safe" alternatives on Windows. This also adds long-filename and Unicode support for these operations on Windows. Keep using `open()` in the signal handler to avoid any issues with calling code not allowed in signal handlers. Cherry-picked from #19643 Closes #19679 --- tests/server/.checksrc | 2 -- tests/server/dnsd.c | 10 +++++----- tests/server/mqttd.c | 10 +++++----- tests/server/rtspd.c | 14 +++++++------- tests/server/socksd.c | 8 ++++---- tests/server/sws.c | 18 +++++++++--------- tests/server/tftpd.c | 20 ++++++++++---------- tests/server/util.c | 18 +++++++++--------- 8 files changed, 49 insertions(+), 51 deletions(-) diff --git a/tests/server/.checksrc b/tests/server/.checksrc index a4e094e1c913..0386c677e6c3 100644 --- a/tests/server/.checksrc +++ b/tests/server/.checksrc @@ -3,8 +3,6 @@ # SPDX-License-Identifier: curl allowfunc accept -allowfunc fclose -allowfunc fopen allowfunc fprintf allowfunc freeaddrinfo allowfunc getaddrinfo diff --git a/tests/server/dnsd.c b/tests/server/dnsd.c index c541b05295b2..9b3a42e1590c 100644 --- a/tests/server/dnsd.c +++ b/tests/server/dnsd.c @@ -102,7 +102,7 @@ static int store_incoming(const unsigned char *data, size_t size, snprintf(dumpfile, sizeof(dumpfile), "%s/dnsd.input", logdir); /* Open request dump file. */ - server = fopen(dumpfile, "ab"); + server = curlx_fopen(dumpfile, "ab"); if(!server) { char errbuf[STRERROR_LEN]; int error = errno; @@ -162,7 +162,7 @@ static int store_incoming(const unsigned char *data, size_t size, if(*qlen > qbuflen) { logmsg("dnsd: query too large: %lu > %lu", (unsigned long)*qlen, (unsigned long)qbuflen); - fclose(server); + curlx_fclose(server); return -1; } memcpy(qbuf, qptr, *qlen); @@ -176,7 +176,7 @@ static int store_incoming(const unsigned char *data, size_t size, fprintf(server, "\n"); #endif - fclose(server); + curlx_fclose(server); return 0; } @@ -325,7 +325,7 @@ static void read_instructions(void) char file[256]; FILE *f; snprintf(file, sizeof(file), "%s/" INSTRUCTIONS, logdir); - f = fopen(file, FOPEN_READTEXT); + f = curlx_fopen(file, FOPEN_READTEXT); if(f) { char buf[256]; ancount_aaaa = ancount_a = 0; @@ -375,7 +375,7 @@ static void read_instructions(void) } } } - fclose(f); + curlx_fclose(f); } else logmsg("Error opening file '%s'", file); diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index 2701d61260e0..59c7540dcfc3 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -73,7 +73,7 @@ static void mqttd_resetdefaults(void) static void mqttd_getconfig(void) { - FILE *fp = fopen(configfile, FOPEN_READTEXT); + FILE *fp = curlx_fopen(configfile, FOPEN_READTEXT); mqttd_resetdefaults(); if(fp) { char buffer[512]; @@ -119,7 +119,7 @@ static void mqttd_getconfig(void) } } } - fclose(fp); + curlx_fclose(fp); } else { logmsg("No config file '%s' to read", configfile); @@ -430,7 +430,7 @@ static curl_socket_t mqttit(curl_socket_t fd) 0x04 /* protocol level */ }; snprintf(dumpfile, sizeof(dumpfile), "%s/%s", logdir, REQUEST_DUMP); - dump = fopen(dumpfile, "ab"); + dump = curlx_fopen(dumpfile, "ab"); if(!dump) goto end; @@ -636,9 +636,9 @@ static curl_socket_t mqttit(curl_socket_t fd) if(buffer) free(buffer); if(dump) - fclose(dump); + curlx_fclose(dump); if(stream) - fclose(stream); + curlx_fclose(stream); return CURL_SOCKET_BAD; } diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 5ffd0f28e5ee..335bbaaa69de 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -255,7 +255,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) /* get the custom server control "commands" */ int error = getpart(&cmd, &cmdsize, "reply", "servercmd", stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); req->open = FALSE; /* closes connection */ @@ -557,7 +557,7 @@ static void rtspd_storerequest(char *reqbuf, size_t totalsize) return; do { - dump = fopen(dumpfile, "ab"); + dump = curlx_fopen(dumpfile, "ab"); /* !checksrc! disable ERRNOVAR 1 */ } while(!dump && ((error = errno) == EINTR)); if(!dump) { @@ -589,7 +589,7 @@ static void rtspd_storerequest(char *reqbuf, size_t totalsize) storerequest_cleanup: - res = fclose(dump); + res = curlx_fclose(dump); if(res) logmsg("Error closing file %s error (%d) %s", dumpfile, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); @@ -815,7 +815,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) } else { error = getpart(&ptr, &count, "reply", partbuf, stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); return 0; @@ -841,7 +841,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) else { /* get the custom server control "commands" */ error = getpart(&cmd, &cmdsize, "reply", "postcmd", stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); free(ptr); @@ -870,7 +870,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) else rtspd_prevbounce = FALSE; - dump = fopen(responsedump, "ab"); + dump = curlx_fopen(responsedump, "ab"); if(!dump) { error = errno; logmsg("fopen() failed with error (%d) %s", @@ -928,7 +928,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) req->rtp_buffersize = 0; } - res = fclose(dump); + res = curlx_fclose(dump); if(res) logmsg("Error closing file %s error (%d) %s", responsedump, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); diff --git a/tests/server/socksd.c b/tests/server/socksd.c index 1a1d40113bf8..4205d26880bd 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -108,7 +108,7 @@ static void socksd_resetdefaults(void) static void socksd_getconfig(void) { - FILE *fp = fopen(configfile, FOPEN_READTEXT); + FILE *fp = curlx_fopen(configfile, FOPEN_READTEXT); socksd_resetdefaults(); if(fp) { char buffer[512]; @@ -180,7 +180,7 @@ static void socksd_getconfig(void) } } } - fclose(fp); + curlx_fclose(fp); } } @@ -470,7 +470,7 @@ static curl_socket_t sockit(curl_socket_t fd) { FILE *dump; - dump = fopen(reqlogfile, "ab"); + dump = curlx_fopen(reqlogfile, "ab"); if(dump) { int i; fprintf(dump, "atyp %u =>", type); @@ -493,7 +493,7 @@ static curl_socket_t sockit(curl_socket_t fd) fprintf(dump, "\n"); break; } - fclose(dump); + curlx_fclose(dump); } } diff --git a/tests/server/sws.c b/tests/server/sws.c index d590cd6fef69..b070614f525e 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -178,7 +178,7 @@ static bool socket_domain_is_ip(void) /* parse the file on disk that might have a test number for us */ static int parse_cmdfile(struct sws_httprequest *req) { - FILE *f = fopen(cmdfile, FOPEN_READTEXT); + FILE *f = curlx_fopen(cmdfile, FOPEN_READTEXT); if(f) { int testnum = DOCNUMBER_NOTHING; char buf[256]; @@ -188,7 +188,7 @@ static int parse_cmdfile(struct sws_httprequest *req) req->testno = testnum; } } - fclose(f); + curlx_fclose(f); } return 0; } @@ -220,7 +220,7 @@ static int sws_parse_servercmd(struct sws_httprequest *req) /* get the custom server control "commands" */ error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); req->open = FALSE; /* closes connection */ @@ -734,7 +734,7 @@ static void sws_storerequest(const char *reqbuf, size_t totalsize) return; do { - dump = fopen(dumpfile, "ab"); + dump = curlx_fopen(dumpfile, "ab"); /* !checksrc! disable ERRNOVAR 1 */ } while(!dump && ((error = errno) == EINTR)); if(!dump) { @@ -766,7 +766,7 @@ static void sws_storerequest(const char *reqbuf, size_t totalsize) storerequest_cleanup: - res = fclose(dump); + res = curlx_fclose(dump); if(res) logmsg("Error closing file %s error (%d) %s", dumpfile, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); @@ -1050,7 +1050,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) } else { error = getpart(&ptr, &count, "reply", partbuf, stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); return 0; @@ -1075,7 +1075,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) else { /* get the custom server control "commands" */ error = getpart(&cmd, &cmdsize, "reply", "postcmd", stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); free(ptr); @@ -1104,7 +1104,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) else sws_prevbounce = FALSE; - dump = fopen(responsedump, "ab"); + dump = curlx_fopen(responsedump, "ab"); if(!dump) { error = errno; logmsg("fopen() failed with error (%d) %s", @@ -1158,7 +1158,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) } } while((count > 0) && !got_exit_signal); - res = fclose(dump); + res = curlx_fclose(dump); if(res) logmsg("Error closing file %s error (%d) %s", responsedump, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 6631e2439b96..2eb31ff5ece8 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -445,13 +445,13 @@ static ssize_t write_behind(struct testcase *test, int convert) if(!test->ofile) { char outfile[256]; snprintf(outfile, sizeof(outfile), "%s/upload.%ld", logdir, test->testno); - test->ofile = open(outfile, O_CREAT | O_RDWR | CURL_O_BINARY, + test->ofile = curlx_open(outfile, O_CREAT | O_RDWR | CURL_O_BINARY, #ifdef _WIN32 - S_IREAD | S_IWRITE + S_IREAD | S_IWRITE #else - S_IRUSR | S_IWUSR | S_IXUSR | - S_IRGRP | S_IWGRP | S_IXGRP | - S_IROTH | S_IWOTH | S_IXOTH + S_IRUSR | S_IWUSR | S_IXUSR | + S_IRGRP | S_IWGRP | S_IXGRP | + S_IROTH | S_IWOTH | S_IXOTH #endif ); if(test->ofile == -1) { @@ -910,7 +910,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size) snprintf(dumpfile, sizeof(dumpfile), "%s/%s", logdir, REQUEST_DUMP); /* Open request dump file. */ - server = fopen(dumpfile, "ab"); + server = curlx_fopen(dumpfile, "ab"); if(!server) { char errbuf[STRERROR_LEN]; int error = errno; @@ -963,7 +963,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size) if(*cp || !mode) { nak(TFTP_EBADOP); - fclose(server); + curlx_fclose(server); return 3; } @@ -975,7 +975,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size) *cp = (char)tolower((int)*cp); /* store input protocol */ - fclose(server); + curlx_fclose(server); for(pf = formata; pf->f_mode; pf++) if(strcmp(pf->f_mode, mode) == 0) @@ -1036,7 +1036,7 @@ static int tftpd_parse_servercmd(struct testcase *req) /* get the custom server control "commands" */ error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); return 1; /* done */ @@ -1155,7 +1155,7 @@ static int validate_access(struct testcase *test, else { size_t count; int error = getpart(&test->buffer, &count, "reply", partbuf, stream); - fclose(stream); + curlx_fclose(stream); if(error) { logmsg("getpart() failed with error (%d)", error); return TFTP_EACCESS; diff --git a/tests/server/util.c b/tests/server/util.c index 6551e4742635..8d8bf12c99dd 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -115,12 +115,12 @@ void logmsg(const char *msg, ...) va_end(ap); do { - logfp = fopen(serverlogfile, "ab"); + logfp = curlx_fopen(serverlogfile, "ab"); /* !checksrc! disable ERRNOVAR 1 */ } while(!logfp && (errno == EINTR)); if(logfp) { fprintf(logfp, "%s %s\n", timebuf, buffer); - fclose(logfp); + curlx_fclose(logfp); } else { char errbuf[STRERROR_LEN]; @@ -193,7 +193,7 @@ FILE *test2fopen(long testno, const char *logdir2) char filename[256]; /* first try the alternative, preprocessed, file */ snprintf(filename, sizeof(filename), "%s/test%ld", logdir2, testno); - stream = fopen(filename, "rb"); + stream = curlx_fopen(filename, "rb"); return stream; } @@ -224,7 +224,7 @@ int write_pidfile(const char *filename) curl_off_t pid; pid = our_getpid(); - pidfile = fopen(filename, "wb"); + pidfile = curlx_fopen(filename, "wb"); if(!pidfile) { char errbuf[STRERROR_LEN]; logmsg("Could not write pid file: %s (%d) %s", filename, @@ -232,7 +232,7 @@ int write_pidfile(const char *filename) return 0; /* fail */ } fprintf(pidfile, "%ld\n", (long)pid); - fclose(pidfile); + curlx_fclose(pidfile); logmsg("Wrote pid %ld to %s", (long)pid, filename); return 1; /* success */ } @@ -240,7 +240,7 @@ int write_pidfile(const char *filename) /* store the used port number in a file */ int write_portfile(const char *filename, int port) { - FILE *portfile = fopen(filename, "wb"); + FILE *portfile = curlx_fopen(filename, "wb"); if(!portfile) { char errbuf[STRERROR_LEN]; logmsg("Could not write port file: %s (%d) %s", filename, @@ -248,7 +248,7 @@ int write_portfile(const char *filename, int port) return 0; /* fail */ } fprintf(portfile, "%d\n", port); - fclose(portfile); + curlx_fclose(portfile); logmsg("Wrote port %d to %s", port, filename); return 1; /* success */ } @@ -261,7 +261,7 @@ void set_advisor_read_lock(const char *filename) int res; do { - lockfile = fopen(filename, "wb"); + lockfile = curlx_fopen(filename, "wb"); /* !checksrc! disable ERRNOVAR 1 */ } while(!lockfile && ((error = errno) == EINTR)); if(!lockfile) { @@ -270,7 +270,7 @@ void set_advisor_read_lock(const char *filename) return; } - res = fclose(lockfile); + res = curlx_fclose(lockfile); if(res) logmsg("Error closing lock file %s error (%d) %s", filename, errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); From 1e7d0bafc6d25d98ec72ff419df65fda3cf147a7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 18 Nov 2025 01:32:43 +0100 Subject: [PATCH 514/885] curlx/fopen: replace open CRT functions their with `_s` counterparts (Windows) - `_wopen` -> `_wsopen_s` - `_open`, `open` -> `_sopen_s` - `_wfopen` -> `_wfopen_s` - `fopen` -> `fopen_s` - `_wfreopen` -> `_wfreopen_s` - `freopen` -> `freopen_s` For better error handling and for using the CRT functions recommended via warnings suppressed by `_CRT_SECURE_NO_WARNINGS`. Also: - add missing `freopen_s()` prototype when building with mingw-w64 <5. https://sourceforge.net/p/mingw-w64/mingw-w64/ci/a5d824654cdc57f6eac1bb581b078986f3eb6856/ - tests/server: replace `open()` in the signal handler with `_sopen_s()` on Windows. - tests/server: reduce scope of a checksrc exception to a single line. - checksrc: ban replaced functions. Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen https://learn.microsoft.com/cpp/c-runtime-library/reference/sopen-s-wsopen-s https://learn.microsoft.com/cpp/c-runtime-library/reference/freopen-wfreopen https://learn.microsoft.com/cpp/c-runtime-library/reference/fopen-wfopen https://learn.microsoft.com/cpp/c-runtime-library/reference/fopen-s-wfopen-s https://learn.microsoft.com/cpp/c-runtime-library/reference/freopen-s-wfreopen-s Closes #19643 --- lib/curl_setup.h | 5 ++--- lib/curlx/fopen.c | 21 +++++++++++++-------- scripts/checksrc.pl | 4 ++++ tests/server/.checksrc | 1 - tests/server/util.c | 16 ++++++++++++---- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 886a8814936a..0e5ebb60c9ef 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -95,10 +95,9 @@ unlink(), etc. */ #endif #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for _open(), _wfopen(), _wopen(), fopen(), - freopen(), getenv(), gmtime(), sprintf(), +#define _CRT_SECURE_NO_WARNINGS /* for getenv(), gmtime(), sprintf(), strcpy(), - in tests: localtime(), open(), sscanf() */ + in tests: localtime(), sscanf() */ #endif #endif /* _MSC_VER */ diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index dc1c2bb4e67d..0dc9699206cd 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -51,6 +51,8 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence) #include "multibyte.h" +#include /* for _SH_DENYNO */ + /* declare GetFullPathNameW for mingw-w64 UWP builds targeting old windows */ #if defined(CURL_WINDOWS_UWP) && defined(__MINGW32__) && \ (_WIN32_WINNT < _WIN32_WINNT_WIN10) @@ -244,7 +246,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) target = fixed; else target = filename_w; - result = _wopen(target, oflag, pmode); + errno = _wsopen_s(&result, target, oflag, _SH_DENYNO, pmode); curlx_unicodefree(filename_w); } else @@ -255,7 +257,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) target = fixed; else target = filename; - result = _open(target, oflag, pmode); + errno = _sopen_s(&result, target, oflag, _SH_DENYNO, pmode); #endif (free)(fixed); @@ -276,7 +278,7 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) target = fixed; else target = filename_w; - result = _wfopen(target, mode_w); + errno = _wfopen_s(&result, target, mode_w); } else /* !checksrc! disable ERRNOVAR 1 */ @@ -288,14 +290,18 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) target = fixed; else target = filename; - /* !checksrc! disable BANNEDFUNC 1 */ - result = fopen(target, mode); + errno = fopen_s(&result, target, mode); #endif (free)(fixed); return result; } +#if defined(__MINGW32__) && (__MINGW64_VERSION_MAJOR < 5) +_CRTIMP errno_t __cdecl freopen_s(FILE **file, const char *filename, + const char *mode, FILE *stream); +#endif + FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) { FILE *result = NULL; @@ -310,7 +316,7 @@ FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) target = fixed; else target = filename_w; - result = _wfreopen(target, mode_w, fp); + errno = _wfreopen_s(&result, target, mode_w, fp); } else /* !checksrc! disable ERRNOVAR 1 */ @@ -322,8 +328,7 @@ FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) target = fixed; else target = filename; - /* !checksrc! disable BANNEDFUNC 1 */ - result = freopen(target, mode, fp); + errno = freopen_s(&result, target, mode, fp); #endif (free)(fixed); diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index a2f458b6c1ac..d38ffecdb9b1 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -113,6 +113,10 @@ "fopen" => 1, "freopen" => 1, "open" => 1, + "_open" => 1, + "_wfopen" => 1, + "_wfreopen" => 1, + "_wopen" => 1, "stat" => 1, ); diff --git a/tests/server/.checksrc b/tests/server/.checksrc index 0386c677e6c3..163a217ee4be 100644 --- a/tests/server/.checksrc +++ b/tests/server/.checksrc @@ -6,7 +6,6 @@ allowfunc accept allowfunc fprintf allowfunc freeaddrinfo allowfunc getaddrinfo -allowfunc open allowfunc printf allowfunc recv allowfunc send diff --git a/tests/server/util.c b/tests/server/util.c index 8d8bf12c99dd..ae21ff8b1af8 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -27,6 +27,10 @@ #include #endif +#ifdef _WIN32 +#include +#endif + /* This function returns a pointer to STATIC memory. It converts the given * binary lump to a hex formatted string usable for output in logs or * whatever. @@ -359,13 +363,17 @@ static void exit_signal_handler(int signum) (void)!write(STDERR_FILENO, msg, sizeof(msg) - 1); } else { + int fd = -1; #ifdef _WIN32 -#define OPENMODE S_IREAD | S_IWRITE + if(!_sopen_s(&fd, serverlogfile, O_WRONLY | O_CREAT | O_APPEND, + _SH_DENYNO, S_IREAD | S_IWRITE) && + fd != -1) { #else -#define OPENMODE S_IRUSR | S_IWUSR -#endif - int fd = open(serverlogfile, O_WRONLY | O_CREAT | O_APPEND, OPENMODE); + /* !checksrc! disable BANNEDFUNC 1 */ + fd = open(serverlogfile, + O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); if(fd != -1) { +#endif static const char msg[] = "exit_signal_handler: called\n"; (void)!write(fd, msg, sizeof(msg) - 1); close(fd); From a075d1c0d8684c0151cebf50b5cb64be6505c59d Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 25 Nov 2025 08:29:32 +0100 Subject: [PATCH 515/885] examples: fix minor typo Closes #19683 --- docs/examples/https.c | 2 +- docs/examples/imap-ssl.c | 2 +- docs/examples/pop3-ssl.c | 2 +- docs/examples/smtp-ssl.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/https.c b/docs/examples/https.c index 905cdb07f23b..02fd8b87bd16 100644 --- a/docs/examples/https.c +++ b/docs/examples/https.c @@ -57,7 +57,7 @@ int main(void) #ifdef SKIP_HOSTNAME_VERIFICATION /* - * If the site you are connecting to uses a different hostname that what + * If the site you are connecting to uses a different hostname than what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. diff --git a/docs/examples/imap-ssl.c b/docs/examples/imap-ssl.c index d56d89331ac4..259eddc26f6a 100644 --- a/docs/examples/imap-ssl.c +++ b/docs/examples/imap-ssl.c @@ -67,7 +67,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif - /* If the site you are connecting to uses a different hostname that what + /* If the site you are connecting to uses a different hostname than what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. */ diff --git a/docs/examples/pop3-ssl.c b/docs/examples/pop3-ssl.c index 0f5ac3692d83..4dd808c3f114 100644 --- a/docs/examples/pop3-ssl.c +++ b/docs/examples/pop3-ssl.c @@ -66,7 +66,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif - /* If the site you are connecting to uses a different hostname that what + /* If the site you are connecting to uses a different hostname than what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. */ diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index a87a033fc4aa..4ebc58f1b5dd 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -115,7 +115,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif - /* If the site you are connecting to uses a different hostname that what + /* If the site you are connecting to uses a different hostname than what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl refuses to connect. You can skip this * check, but it makes the connection insecure. */ From ce06fe7771052549ff430c86173b2eaca91f8a9c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Nov 2025 14:00:09 +0100 Subject: [PATCH 516/885] hostip: make more functions return CURLcode - Curl_async_getaddrinfo() always returned NULL so it was pointless. Return proper curlcode instead to distinguish between errors. Same for Curl_doh(). - simplify the IP address handling - make Curl_str2addr() function return CURLcode Closes #19669 --- lib/asyn-ares.c | 22 +++---- lib/asyn-thrdd.c | 17 ++---- lib/asyn.h | 7 +-- lib/curl_addrinfo.c | 41 +++++++++---- lib/curl_addrinfo.h | 6 +- lib/doh.c | 22 ++++--- lib/doh.h | 11 ++-- lib/hostip.c | 132 +++++++++++++++++------------------------ tests/libtest/lib655.c | 4 +- 9 files changed, 117 insertions(+), 145 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index ab57d5e00b41..d459fd4a75cd 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -718,25 +718,18 @@ static void async_ares_rr_done(void *user_data, ares_status_t status, /* * Curl_async_getaddrinfo() - when using ares * - * Returns name information about the given hostname and port number. If - * successful, the 'hostent' is returned and the fourth argument will point to - * memory we need to free after use. That memory *MUST* be freed with - * Curl_freeaddrinfo(), nothing else. + * Starts a name resolve for the given hostname and port number. */ -struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version, - int *waitp) +CURLcode Curl_async_getaddrinfo(struct Curl_easy *data, const char *hostname, + int port, int ip_version) { struct async_ares_ctx *ares = &data->state.async.ares; #ifdef USE_HTTPSRR char *rrname = NULL; #endif - *waitp = 0; /* default to synchronous response */ if(async_ares_init_lazy(data)) - return NULL; + return CURLE_FAILED_INIT; data->state.async.done = FALSE; /* not done */ data->state.async.dns = NULL; /* clear */ @@ -744,12 +737,12 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, data->state.async.ip_version = ip_version; data->state.async.hostname = strdup(hostname); if(!data->state.async.hostname) - return NULL; + return CURLE_OUT_OF_MEMORY; #ifdef USE_HTTPSRR if(port != 443) { rrname = curl_maprintf("_%d_.https.%s", port, hostname); if(!rrname) - return NULL; + return CURLE_OUT_OF_MEMORY; } #endif @@ -836,9 +829,8 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, async_ares_rr_done, data, NULL); } #endif - *waitp = 1; /* expect asynchronous response */ - return NULL; /* no struct yet */ + return CURLE_OK; } /* Set what DNS server are is to use. This is called in 2 situations: diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index f4f57b547a01..71e31e6d0d16 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -755,15 +755,11 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, /* * Curl_async_getaddrinfo() - for getaddrinfo */ -struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version, - int *waitp) +CURLcode Curl_async_getaddrinfo(struct Curl_easy *data, const char *hostname, + int port, int ip_version) { struct addrinfo hints; int pf = PF_INET; - *waitp = 0; /* default to synchronous response */ CURL_TRC_DNS(data, "init threaded resolve of %s:%d", hostname, port); #ifdef CURLRES_IPV6 @@ -785,14 +781,11 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, SOCK_STREAM : SOCK_DGRAM; /* fire up a new resolver thread! */ - if(async_thrdd_init(data, hostname, port, ip_version, &hints)) { - *waitp = 1; /* expect asynchronous response */ - return NULL; - } + if(async_thrdd_init(data, hostname, port, ip_version, &hints)) + return CURLE_OK; failf(data, "getaddrinfo() thread failed to start"); - return NULL; - + return CURLE_FAILED_INIT; } #endif /* !HAVE_GETADDRINFO */ diff --git a/lib/asyn.h b/lib/asyn.h index 7863042bbe37..8da7dd9720cc 100644 --- a/lib/asyn.h +++ b/lib/asyn.h @@ -118,11 +118,8 @@ CURLcode Curl_async_await(struct Curl_easy *data, * Each resolver backend must of course make sure to return data in the * correct format to comply with this. */ -struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version, - int *waitp); +CURLcode Curl_async_getaddrinfo(struct Curl_easy *data, const char *hostname, + int port, int ip_version); #ifdef USE_ARES /* common functions for c-ares and threaded resolver with HTTPSRR */ diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index fc26bef8333d..cd9b52febaa7 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -347,7 +347,7 @@ Curl_he2ai(const struct hostent *he, int port) #endif /* - * Curl_ip2addr() + * ip2addr() * * This function takes an Internet address, in binary form, as input parameter * along with its address family and the string version of the address, and it @@ -355,8 +355,9 @@ Curl_he2ai(const struct hostent *he, int port) * given address/host */ -struct Curl_addrinfo * -Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port) +static CURLcode +ip2addr(struct Curl_addrinfo **addrp, + int af, const void *inaddr, const char *hostname, int port) { struct Curl_addrinfo *ai; size_t addrsize; @@ -369,6 +370,7 @@ Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port) DEBUGASSERT(inaddr && hostname); namelen = strlen(hostname) + 1; + *addrp = NULL; if(af == AF_INET) addrsize = sizeof(struct sockaddr_in); @@ -377,12 +379,12 @@ Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port) addrsize = sizeof(struct sockaddr_in6); #endif else - return NULL; + return CURLE_BAD_FUNCTION_ARGUMENT; /* allocate memory to hold the struct, the address and the name */ ai = calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen); if(!ai) - return NULL; + return CURLE_OUT_OF_MEMORY; /* put the address after the struct */ ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo)); /* then put the name after the address */ @@ -412,29 +414,46 @@ Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port) break; #endif } - - return ai; + *addrp = ai; + return CURLE_OK; } /* * Given an IPv4 or IPv6 dotted string address, this converts it to a proper * allocated Curl_addrinfo struct and returns it. */ -struct Curl_addrinfo *Curl_str2addr(char *address, int port) +CURLcode Curl_str2addr(const char *address, int port, + struct Curl_addrinfo **addrp) { struct in_addr in; if(curlx_inet_pton(AF_INET, address, &in) > 0) /* This is a dotted IP address 123.123.123.123-style */ - return Curl_ip2addr(AF_INET, &in, address, port); + return ip2addr(addrp, AF_INET, &in, address, port); +#ifdef USE_IPV6 + { + struct in6_addr in6; + if(curlx_inet_pton(AF_INET6, address, &in6) > 0) + /* This is a dotted IPv6 address ::1-style */ + return ip2addr(addrp, AF_INET6, &in6, address, port); + } +#endif + return CURLE_BAD_FUNCTION_ARGUMENT; /* bad input format */ +} + +bool Curl_is_ipaddr(const char *address) +{ + struct in_addr in; + if(curlx_inet_pton(AF_INET, address, &in) > 0) + return TRUE; #ifdef USE_IPV6 { struct in6_addr in6; if(curlx_inet_pton(AF_INET6, address, &in6) > 0) /* This is a dotted IPv6 address ::1-style */ - return Curl_ip2addr(AF_INET6, &in6, address, port); + return TRUE; } #endif - return NULL; /* bad input format */ + return FALSE; } #ifdef USE_UNIX_SOCKETS diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h index 2303e95e314e..9a26c6784912 100644 --- a/lib/curl_addrinfo.h +++ b/lib/curl_addrinfo.h @@ -76,10 +76,8 @@ struct Curl_addrinfo * Curl_he2ai(const struct hostent *he, int port); #endif -struct Curl_addrinfo * -Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port); - -struct Curl_addrinfo *Curl_str2addr(char *dotted, int port); +bool Curl_is_ipaddr(const char *address); +CURLcode Curl_str2addr(const char *dotted, int port, struct Curl_addrinfo **); #ifdef USE_UNIX_SOCKETS struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, diff --git a/lib/doh.c b/lib/doh.c index 45524edf4c0b..83a83f534672 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -441,15 +441,12 @@ static CURLcode doh_probe_run(struct Curl_easy *data, } /* - * Curl_doh() resolves a name using DoH. It resolves a name and returns a - * 'Curl_addrinfo *' with the address information. + * Curl_doh() starts a name resolve using DoH. It resolves a name and returns + * a 'Curl_addrinfo *' with the address information. */ -struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version, - int *waitp) +CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, + int port, int ip_version) { CURLcode result = CURLE_OK; struct doh_probes *dohp = NULL; @@ -467,12 +464,12 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, data->state.async.ip_version = ip_version; data->state.async.hostname = strdup(hostname); if(!data->state.async.hostname) - return NULL; + return CURLE_OUT_OF_MEMORY; /* start clean, consider allocating this struct on demand */ data->state.async.doh = dohp = calloc(1, sizeof(struct doh_probes)); if(!dohp) - return NULL; + return CURLE_OUT_OF_MEMORY; for(i = 0; i < DOH_SLOT_COUNT; ++i) { dohp->probe_resp[i].probe_mid = UINT_MAX; @@ -527,12 +524,11 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, dohp->pending++; } #endif - *waitp = TRUE; /* this never returns synchronously */ - return NULL; + return CURLE_OK; error: Curl_doh_cleanup(data); - return NULL; + return result; } static DOHcode doh_skipqname(const unsigned char *doh, size_t dohlen, @@ -1300,6 +1296,8 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, result = Curl_dnscache_add(data, dns); *dnsp = data->state.async.dns; } + else + Curl_freeaddrinfo(ai); } /* address processing done */ /* All done */ diff --git a/lib/doh.h b/lib/doh.h index 3fd7de2c1c57..726fb9f73557 100644 --- a/lib/doh.h +++ b/lib/doh.h @@ -112,15 +112,12 @@ struct doh_probes { }; /* - * Curl_doh() resolve a name using DoH (DNS-over-HTTPS). It resolves a name - * and returns a 'Curl_addrinfo *' with the address information. + * Curl_doh() starts a name resolve using DoH (DNS-over-HTTPS). It resolves a + * name and returns a 'Curl_addrinfo *' with the address information. */ -struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version, - int *waitp); +CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, + int port, int ip_version); CURLcode Curl_doh_is_resolved(struct Curl_easy *data, struct Curl_dns_entry **dns); diff --git a/lib/hostip.c b/lib/hostip.c index d5f753f4b4a7..4c1bb9236776 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -509,10 +509,8 @@ Curl_dnscache_mk_entry(struct Curl_easy *data, /* shuffle addresses if requested */ if(data->set.dns_shuffle_addresses) { CURLcode result = Curl_shuffle_addr(data, &addr); - if(result) { - Curl_freeaddrinfo(addr); + if(result) return NULL; - } } #else (void)data; @@ -522,10 +520,8 @@ Curl_dnscache_mk_entry(struct Curl_easy *data, /* Create a new cache entry */ dns = calloc(1, sizeof(struct Curl_dns_entry) + hostlen); - if(!dns) { - Curl_freeaddrinfo(addr); + if(!dns) return NULL; - } dns->refcount = 1; /* the cache has the first reference */ dns->addr = addr; /* this is the address(es) */ @@ -569,6 +565,7 @@ dnscache_add_addr(struct Curl_easy *data, dns2 = Curl_hash_add(&dnscache->entries, entry_id, entry_len + 1, (void *)dns); if(!dns2) { + dns->addr = NULL; dnscache_entry_free(dns); return NULL; } @@ -744,40 +741,6 @@ static bool tailmatch(const char *full, size_t flen, return curl_strnequal(part, &full[flen - plen], plen); } -static struct Curl_addrinfo * -convert_ipaddr_direct(const char *hostname, int port, bool *is_ipaddr) -{ - struct in_addr in; - *is_ipaddr = FALSE; - /* First check if this is an IPv4 address string */ - if(curlx_inet_pton(AF_INET, hostname, &in) > 0) { - /* This is a dotted IP address 123.123.123.123-style */ - *is_ipaddr = TRUE; -#ifdef USE_RESOLVE_ON_IPS - (void)port; - return NULL; -#else - return Curl_ip2addr(AF_INET, &in, hostname, port); -#endif - } -#ifdef USE_IPV6 - else { - struct in6_addr in6; - /* check if this is an IPv6 address string */ - if(curlx_inet_pton(AF_INET6, hostname, &in6) > 0) { - /* This is an IPv6 address literal */ - *is_ipaddr = TRUE; -#ifdef USE_RESOLVE_ON_IPS - return NULL; -#else - return Curl_ip2addr(AF_INET6, &in6, hostname, port); -#endif - } - } -#endif /* USE_IPV6 */ - return NULL; -} - static bool can_resolve_ip_version(struct Curl_easy *data, int ip_version) { #ifdef CURLRES_IPV6 @@ -841,10 +804,10 @@ CURLcode Curl_resolv(struct Curl_easy *data, struct Curl_dnscache *dnscache = dnscache_get(data); struct Curl_dns_entry *dns = NULL; struct Curl_addrinfo *addr = NULL; - int respwait = 0; - bool is_ipaddr; + bool respwait = FALSE; size_t hostname_len; bool keep_negative = TRUE; /* cache a negative result */ + CURLcode result = CURLE_COULDNT_RESOLVE_HOST; *entry = NULL; @@ -853,8 +816,11 @@ CURLcode Curl_resolv(struct Curl_easy *data, #else (void)allowDOH; #endif - if(!dnscache) + DEBUGASSERT(dnscache); + if(!dnscache) { + result = CURLE_BAD_FUNCTION_ARGUMENT; goto error; + } /* We should intentionally error and not resolve .onion TLDs */ hostname_len = strlen(hostname); @@ -874,6 +840,7 @@ CURLcode Curl_resolv(struct Curl_easy *data, dnscache_unlock(data, dnscache); if(dns) { infof(data, "Hostname %s was found in DNS cache", hostname); + result = CURLE_OK; goto out; } @@ -882,7 +849,8 @@ CURLcode Curl_resolv(struct Curl_easy *data, void *resolver = NULL; int st; #ifdef CURLRES_ASYNCH - if(Curl_async_get_impl(data, &resolver)) + result = Curl_async_get_impl(data, &resolver); + if(result) goto error; #endif Curl_set_in_callback(data, TRUE); @@ -891,57 +859,58 @@ CURLcode Curl_resolv(struct Curl_easy *data, Curl_set_in_callback(data, FALSE); if(st) { keep_negative = FALSE; + result = CURLE_ABORTED_BY_CALLBACK; goto error; } } - /* shortcut literal IP addresses, if we are not told to resolve them. */ - addr = convert_ipaddr_direct(hostname, port, &is_ipaddr); - if(addr) - goto out; - + if(Curl_is_ipaddr(hostname)) { #ifndef USE_RESOLVE_ON_IPS - /* allowed to convert, hostname is IP address, then NULL means error */ - if(is_ipaddr) { - keep_negative = FALSE; - goto error; - } + /* shortcut literal IP addresses, if we are not told to resolve them. */ + result = Curl_str2addr(hostname, port, &addr); + if(result) + goto error; + goto out; #endif + } - /* Really need a resolver for hostname. */ - if(ip_version == CURL_IPRESOLVE_V6 && !Curl_ipv6works(data)) - goto error; - - if(!is_ipaddr && - (curl_strequal(hostname, "localhost") || - curl_strequal(hostname, "localhost.") || - tailmatch(hostname, hostname_len, STRCONST(".localhost")) || - tailmatch(hostname, hostname_len, STRCONST(".localhost.")))) { + if(curl_strequal(hostname, "localhost") || + curl_strequal(hostname, "localhost.") || + tailmatch(hostname, hostname_len, STRCONST(".localhost")) || + tailmatch(hostname, hostname_len, STRCONST(".localhost."))) { addr = get_localhost(port, hostname); + result = addr ? CURLE_OK : CURLE_OUT_OF_MEMORY; } #ifndef CURL_DISABLE_DOH - else if(!is_ipaddr && allowDOH && data->set.doh) { - addr = Curl_doh(data, hostname, port, ip_version, &respwait); + else if(!Curl_is_ipaddr(hostname) && allowDOH && data->set.doh) { + result = Curl_doh(data, hostname, port, ip_version); + respwait = TRUE; } #endif else { /* Can we provide the requested IP specifics in resolving? */ - if(!can_resolve_ip_version(data, ip_version)) + if(!can_resolve_ip_version(data, ip_version)) { + result = CURLE_COULDNT_RESOLVE_HOST; goto error; + } #ifdef CURLRES_ASYNCH - addr = Curl_async_getaddrinfo(data, hostname, port, ip_version, &respwait); + result = Curl_async_getaddrinfo(data, hostname, port, ip_version); + respwait = TRUE; #else - respwait = 0; /* no async waiting here */ + respwait = FALSE; /* no async waiting here */ addr = Curl_sync_getaddrinfo(data, hostname, port, ip_version); + if(addr) + result = CURLE_OK; #endif } out: - /* We either have found a `dns` or looked up the `addr` - * or `respwait` is set for an async operation. - * Everything else is a failure to resolve. */ - if(dns) { + /* We either have found a `dns` or looked up the `addr` or `respwait` is set + * for an async operation. Everything else is a failure to resolve. */ + if(result) + ; + else if(dns) { if(!dns->addr) { infof(data, "Negative DNS entry"); dns->refcount--; @@ -955,7 +924,12 @@ CURLcode Curl_resolv(struct Curl_easy *data, dns = Curl_dnscache_mk_entry(data, addr, hostname, 0, port, FALSE); if(!dns || Curl_dnscache_add(data, dns)) { /* this is OOM or similar, do not store such negative resolves */ + Curl_freeaddrinfo(addr); + if(dns) + /* avoid a dangling pointer to addr in the dying dns entry */ + dns->addr = NULL; keep_negative = FALSE; + result = CURLE_OUT_OF_MEMORY; goto error; } show_resolve_info(data, dns); @@ -967,6 +941,7 @@ CURLcode Curl_resolv(struct Curl_easy *data, *entry = dns; return dns ? CURLE_OK : CURLE_AGAIN; } + result = CURLE_COULDNT_RESOLVE_HOST; } error: if(dns) @@ -974,7 +949,8 @@ CURLcode Curl_resolv(struct Curl_easy *data, Curl_async_shutdown(data); if(keep_negative) store_negative_resolve(data, hostname, port); - return CURLE_COULDNT_RESOLVE_HOST; + DEBUGASSERT(result); + return result; } CURLcode Curl_resolv_blocking(struct Curl_easy *data, @@ -1338,6 +1314,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) while(*host) { struct Curl_str target; struct Curl_addrinfo *ai; + CURLcode result; if(!curlx_str_single(&host, '[')) { if(curlx_str_until(&host, &target, MAX_IPADR_LEN, ']') || @@ -1368,8 +1345,8 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) memcpy(address, curlx_str(&target), curlx_strlen(&target)); address[curlx_strlen(&target)] = '\0'; - ai = Curl_str2addr(address, (int)port); - if(!ai) { + result = Curl_str2addr(address, (int)port, &ai); + if(result) { infof(data, "Resolve address '%s' found illegal", address); goto err; } @@ -1428,11 +1405,12 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) /* put this new host in the cache */ dns = dnscache_add_addr(data, dnscache, head, curlx_str(&source), curlx_strlen(&source), (int)port, permanent); - if(dns) { + if(dns) /* release the returned reference; the cache itself will keep the * entry alive: */ dns->refcount--; - } + else + Curl_freeaddrinfo(head); dnscache_unlock(data, dnscache); diff --git a/tests/libtest/lib655.c b/tests/libtest/lib655.c index 07392cbd86b7..a213a1c493b3 100644 --- a/tests/libtest/lib655.c +++ b/tests/libtest/lib655.c @@ -82,9 +82,9 @@ static CURLcode test_lib655(const char *URL) /* this should fail */ res = curl_easy_perform(curl); - if(res != CURLE_COULDNT_RESOLVE_HOST) { + if(res != CURLE_ABORTED_BY_CALLBACK) { curl_mfprintf(stderr, "curl_easy_perform should have returned " - "CURLE_COULDNT_RESOLVE_HOST but instead returned error %d\n", + "CURLE_ABORTED_BY_CALLBACK but instead returned error %d\n", res); if(res == CURLE_OK) res = TEST_ERR_FAILURE; From 729f36e90fa8927ce85c4f1f7b67724988c35f00 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Nov 2025 08:53:59 +0100 Subject: [PATCH 517/885] sendf: fix uninitialized variable in trace output Initialize *nread early on. Pointed out by CodeSonar Closes #19684 --- lib/sendf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sendf.c b/lib/sendf.c index f70abb5797bc..4eabc14402da 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -1195,6 +1195,7 @@ CURLcode Curl_client_read(struct Curl_easy *data, char *buf, size_t blen, DEBUGASSERT(blen); DEBUGASSERT(nread); DEBUGASSERT(eos); + *nread = 0; if(!data->req.reader_stack) { result = Curl_creader_set_fread(data, data->state.infilesize); From d0ad652552564cbcf5c2f14869db0add4ff4ac50 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Nov 2025 09:09:50 +0100 Subject: [PATCH 518/885] progress: remove two redundant variable checks The entry condition in the function already exits early if either low_speed_time or low_speed_limit is not set. Pointed out by CodeSonar Closes #19686 --- lib/progress.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/progress.c b/lib/progress.c index 3985e1c1bfbd..59c5b9a00f28 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -109,7 +109,7 @@ UNITTEST CURLcode pgrs_speedcheck(struct Curl_easy *data, /* A paused transfer is not qualified for speed checks */ return CURLE_OK; - if((data->progress.current_speed >= 0) && data->set.low_speed_time) { + if(data->progress.current_speed >= 0) { if(data->progress.current_speed < data->set.low_speed_limit) { if(!data->state.keeps_speed.tv_sec) /* under the limit at this moment */ @@ -134,10 +134,9 @@ UNITTEST CURLcode pgrs_speedcheck(struct Curl_easy *data, data->state.keeps_speed.tv_sec = 0; } - if(data->set.low_speed_limit) - /* if low speed limit is enabled, set the expire timer to make this - connection's speed get checked again in a second */ - Curl_expire(data, 1000, EXPIRE_SPEEDCHECK); + /* since low speed limit is enabled, set the expire timer to make this + connection's speed get checked again in a second */ + Curl_expire(data, 1000, EXPIRE_SPEEDCHECK); return CURLE_OK; } From b8f83738c3ab01c214a314981626c86c9ffaca72 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Nov 2025 10:07:30 +0100 Subject: [PATCH 519/885] asyn-ares: handle Curl_dnscache_mk_entry() OOM error To avoid leaking memory. Follow-up to ce06fe7771052549ff430 Closes #19688 --- lib/asyn-ares.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index d459fd4a75cd..1bc0f3247b78 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -343,7 +343,8 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, Curl_dnscache_mk_entry(data, ares->temp_ai, data->state.async.hostname, 0, data->state.async.port, FALSE); - ares->temp_ai = NULL; /* temp_ai now owned by entry */ + if(data->state.async.dns) + ares->temp_ai = NULL; /* temp_ai now owned by entry */ #ifdef HTTPSRR_WORKS if(data->state.async.dns) { struct Curl_https_rrinfo *lhrr = Curl_httpsrr_dup_move(&ares->hinfo); From 6069c340b42a2a4d05f5dc76c49cd3e20e09ccb7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Nov 2025 10:14:28 +0100 Subject: [PATCH 520/885] tool_doswin: clear pointer when thread takes ownership Attempt to address #19675 Closes #19689 --- src/tool_doswin.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 6204296a8b51..cd0ec3b9c1b1 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -801,10 +801,7 @@ static DWORD WINAPI win_stdin_thread_func(void *thread_data) if(socket_w != CURL_SOCKET_BAD) sclose(socket_w); - if(tdata) { - free(tdata); - } - + free(tdata); return 0; } @@ -884,6 +881,7 @@ curl_socket_t win32_stdin_read_thread(void) errorf("CreateThread error: 0x%08lx", GetLastError()); break; } + tdata = NULL; /* win_stdin_thread_func owns it now */ /* Connect to the thread and rearrange our own STDIN handles */ socket_r = CURL_SOCKET(AF_INET, SOCK_STREAM, IPPROTO_TCP); From ba65073037152555aae279a5ef8eae808e3e675e Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 09:30:34 +0100 Subject: [PATCH 521/885] speedlimit: also reset on send unpausing The low speedlimit currently counts both up- and download speed accumulated. So, when unpausing upload, also reset the counter. Closes #19687 --- lib/progress.c | 8 ++++++++ lib/progress.h | 3 ++- lib/transfer.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/progress.c b/lib/progress.c index 59c5b9a00f28..7124a307d1f5 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -196,6 +196,14 @@ void Curl_pgrsRecvPause(struct Curl_easy *data, bool enable) } } +void Curl_pgrsSendPause(struct Curl_easy *data, bool enable) +{ + if(!enable) { + data->progress.speeder_c = 0; /* reset speed records */ + pgrs_speedinit(data); /* reset low speed measurements */ + } +} + /* * * Curl_pgrsTimeWas(). Store the timestamp time at the given label. diff --git a/lib/progress.h b/lib/progress.h index 96a26fe1a4d9..5535c69cbff5 100644 --- a/lib/progress.h +++ b/lib/progress.h @@ -59,8 +59,9 @@ void Curl_pgrsUpdate_nometer(struct Curl_easy *data); /* perform progress update with callbacks and speed checks */ CURLcode Curl_pgrsCheck(struct Curl_easy *data); -/* Inform progress/speedcheck about receive pausing */ +/* Inform progress/speedcheck about receive/send pausing */ void Curl_pgrsRecvPause(struct Curl_easy *data, bool enable); +void Curl_pgrsSendPause(struct Curl_easy *data, bool enable); /* Reset sizes and couners for up- and download. */ void Curl_pgrsReset(struct Curl_easy *data); diff --git a/lib/transfer.c b/lib/transfer.c index fbacdf429061..04a013361ebd 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -925,6 +925,7 @@ CURLcode Curl_xfer_pause_send(struct Curl_easy *data, bool enable) Curl_rlimit_block(&data->progress.ul.rlimit, enable, curlx_now()); if(!enable && Curl_creader_is_paused(data)) result = Curl_creader_unpause(data); + Curl_pgrsSendPause(data, enable); return result; } From 92e6782d1f0dbf0f011fe01ecc4c17b4109561b2 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Mon, 24 Nov 2025 19:50:26 +0100 Subject: [PATCH 522/885] doc: some returned in-memory data may not be altered Some public prototypes do not declare return values or out parameters as const where they should be. Avoid changing the public interface, but document those values as read-only. Closes #19692 --- docs/libcurl/curl_easy_escape.md | 3 ++- docs/libcurl/curl_easy_unescape.md | 3 ++- docs/libcurl/curl_escape.md | 3 ++- docs/libcurl/curl_getenv.md | 3 ++- docs/libcurl/curl_mprintf.md | 2 +- docs/libcurl/curl_multi_get_handles.md | 3 ++- docs/libcurl/curl_pushheader_byname.md | 3 ++- docs/libcurl/curl_pushheader_bynum.md | 3 ++- docs/libcurl/curl_slist_append.md | 4 ++-- docs/libcurl/curl_unescape.md | 3 ++- docs/libcurl/curl_url.md | 3 +++ docs/libcurl/curl_url_get.md | 1 + 12 files changed, 23 insertions(+), 11 deletions(-) diff --git a/docs/libcurl/curl_easy_escape.md b/docs/libcurl/curl_easy_escape.md index b10500ac2619..1480a75c591a 100644 --- a/docs/libcurl/curl_easy_escape.md +++ b/docs/libcurl/curl_easy_escape.md @@ -30,7 +30,8 @@ char *curl_easy_escape(CURL *curl, const char *string, int length); This function converts the given input *string* to a URL encoded string and returns that as a new allocated string. All input characters that are not a-z, A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version -(**%NN** where **NN** is a two-digit hexadecimal number). +(**%NN** where **NN** is a two-digit hexadecimal number). Although not +constrained by its type, the returned string may not be altered. If *length* is set to 0 (zero), curl_easy_escape(3) uses strlen() on the input *string* to find out the size. This function does not accept input strings diff --git a/docs/libcurl/curl_easy_unescape.md b/docs/libcurl/curl_easy_unescape.md index 2e78ad5d9f07..49e4c6bf269a 100644 --- a/docs/libcurl/curl_easy_unescape.md +++ b/docs/libcurl/curl_easy_unescape.md @@ -30,7 +30,8 @@ char *curl_easy_unescape(CURL *curl, const char *input, This function converts the URL encoded string **input** to a "plain string" and returns that in an allocated memory area. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to their -binary versions. +binary versions. Although not constrained by its type, the returned data may +not be altered. If the **length** argument is set to 0 (zero), curl_easy_unescape(3) uses strlen() on **input** to find out the size. diff --git a/docs/libcurl/curl_escape.md b/docs/libcurl/curl_escape.md index c24d1890d493..967d375a9758 100644 --- a/docs/libcurl/curl_escape.md +++ b/docs/libcurl/curl_escape.md @@ -31,7 +31,8 @@ Obsolete function. Use curl_easy_escape(3) instead. This function converts the given input **string** to a URL encoded string and return that as a new allocated string. All input characters that are not a-z, A-Z or 0-9 are converted to their "URL escaped" version (**%NN** where -**NN** is a two-digit hexadecimal number). +**NN** is a two-digit hexadecimal number). Although not constrained by its +type, the returned string may not be altered. If the **length** argument is set to 0, curl_escape(3) uses strlen() on **string** to find out the size. diff --git a/docs/libcurl/curl_getenv.md b/docs/libcurl/curl_getenv.md index 2cfb58148ce7..047c913f2530 100644 --- a/docs/libcurl/curl_getenv.md +++ b/docs/libcurl/curl_getenv.md @@ -29,7 +29,8 @@ curl_getenv() is a portable wrapper for the getenv() function, meant to emulate its behavior and provide an identical interface for all operating systems libcurl builds on (including Windows). -You must curl_free(3) the returned string when you are done with it. +You must curl_free(3) the returned string when you are done with it and, +although not constrained by its type, it may not be altered. # %PROTOCOLS% diff --git a/docs/libcurl/curl_mprintf.md b/docs/libcurl/curl_mprintf.md index 4f5c090579ba..a592cfb3e661 100644 --- a/docs/libcurl/curl_mprintf.md +++ b/docs/libcurl/curl_mprintf.md @@ -67,7 +67,7 @@ the value of *ap* is undefined after the call. The functions **curl_maprintf()** and **curl_mvaprintf()** return the output string as pointer to a newly allocated memory area. The returned string -must be curl_free(3)ed by the receiver. +may not be overwritten and must be curl_free(3)ed by the receiver. All of these functions write the output under the control of a format string that specifies how subsequent arguments are converted for output. diff --git a/docs/libcurl/curl_multi_get_handles.md b/docs/libcurl/curl_multi_get_handles.md index f94436a889ba..56da272b8abf 100644 --- a/docs/libcurl/curl_multi_get_handles.md +++ b/docs/libcurl/curl_multi_get_handles.md @@ -41,7 +41,8 @@ are out of sync. The order of the easy handles within the array is not guaranteed. -The returned array must be freed with a call to curl_free(3) after use. +The returned array may not be overwritten and must be freed with a call to +curl_free(3) after use. # %PROTOCOLS% diff --git a/docs/libcurl/curl_pushheader_byname.md b/docs/libcurl/curl_pushheader_byname.md index d066ea7b85b5..e2968fcd4621 100644 --- a/docs/libcurl/curl_pushheader_byname.md +++ b/docs/libcurl/curl_pushheader_byname.md @@ -33,7 +33,8 @@ elsewhere and it has no function then. It returns the value for the given header field name (or NULL) for the incoming server push request. This is a shortcut so that the application does not have to loop through all headers to find the one it is interested in. The -data this function points to is freed when this callback returns. If more than +data this function points to is freed when this callback returns and, +although not constrained by its type, may not be altered. If more than one header field use the same name, this returns only the first one. # %PROTOCOLS% diff --git a/docs/libcurl/curl_pushheader_bynum.md b/docs/libcurl/curl_pushheader_bynum.md index 12555c57f0c1..2431ff446bb1 100644 --- a/docs/libcurl/curl_pushheader_bynum.md +++ b/docs/libcurl/curl_pushheader_bynum.md @@ -33,7 +33,8 @@ elsewhere and it has no function then. It returns the value for the header field at the given index **num**, for the incoming server push request or NULL. The data pointed to is freed by libcurl when this callback returns. The returned pointer points to a -"name:value" string that gets freed when this callback returns. +"name:value" string that gets freed when this callback returns; although +not constrained by its type, this string may not be altered. # %PROTOCOLS% diff --git a/docs/libcurl/curl_slist_append.md b/docs/libcurl/curl_slist_append.md index b2766f728db0..3ebc19e35418 100644 --- a/docs/libcurl/curl_slist_append.md +++ b/docs/libcurl/curl_slist_append.md @@ -33,8 +33,8 @@ new list. The specified **string** has been appended when this function returns. curl_slist_append(3) copies the string. The **string** argument must be a valid string pointer and cannot be NULL. -The list should be freed again (after usage) with -curl_slist_free_all(3). +The list should be freed (after usage) with curl_slist_free_all(3). +Its nodes and pointed content may not be altered outside this function. # %PROTOCOLS% diff --git a/docs/libcurl/curl_unescape.md b/docs/libcurl/curl_unescape.md index 2600f1436110..453fd53145b9 100644 --- a/docs/libcurl/curl_unescape.md +++ b/docs/libcurl/curl_unescape.md @@ -33,7 +33,8 @@ Deprecated. Use curl_easy_unescape(3) instead. This function converts the URL encoded string **input** to a "plain string" and return that as a new allocated string. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to -their plain text versions. +their plain text versions. Although not constrained by its type, the returned +data may not be altered. If the **length** argument is set to 0, curl_unescape(3) calls strlen() on **input** to find out the size. diff --git a/docs/libcurl/curl_url.md b/docs/libcurl/curl_url.md index 5872134e139a..8053e630b8af 100644 --- a/docs/libcurl/curl_url.md +++ b/docs/libcurl/curl_url.md @@ -38,6 +38,9 @@ single URL. When the object is first created, there is of course no components stored. They are then set in the object with the curl_url_set(3) function. +The object must be destroyed with a call to curl_url_cleanup(3) when no +longer needed. + # %PROTOCOLS% # EXAMPLE diff --git a/docs/libcurl/curl_url_get.md b/docs/libcurl/curl_url_get.md index a9bb0bdc23fb..bed1c02f1747 100644 --- a/docs/libcurl/curl_url_get.md +++ b/docs/libcurl/curl_url_get.md @@ -43,6 +43,7 @@ allocated string with the contents. The *flags* argument is a bitmask with individual features. The returned content pointer must be freed with curl_free(3) after use. +Although not constrained by its type, the pointed string may not be altered. # FLAGS From 74bd3e2f98b26b283dbdb5af543e0c43e61a6155 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Mon, 24 Nov 2025 14:57:38 +0100 Subject: [PATCH 523/885] slist: constify Curl_slist_append_nodup() string argument Although finally stored as a non-const pointer, the string is intended to be left unchanged. This change allows using the function without the need of a cast for const pointers. Closes #19692 --- lib/slist.c | 5 +++-- lib/slist.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/slist.c b/lib/slist.c index 366b24760959..88fdd8a2bae2 100644 --- a/lib/slist.c +++ b/lib/slist.c @@ -58,7 +58,8 @@ static struct curl_slist *slist_get_last(struct curl_slist *list) * If an error occurs, NULL is returned and the string argument is NOT * released. */ -struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, char *data) +struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, + const char *data) { struct curl_slist *last; struct curl_slist *new_item; @@ -70,7 +71,7 @@ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, char *data) return NULL; new_item->next = NULL; - new_item->data = data; + new_item->data = CURL_UNCONST(data); /* if this is the first item, then new_item *is* the list */ if(!list) diff --git a/lib/slist.h b/lib/slist.h index 9561fd022686..47a30824db01 100644 --- a/lib/slist.h +++ b/lib/slist.h @@ -36,6 +36,6 @@ struct curl_slist *Curl_slist_duplicate(struct curl_slist *inlist); * it to the list. */ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, - char *data); + const char *data); #endif /* HEADER_CURL_SLIST_H */ From 62683ad3f49aeb60ab311cf52aacc5630116418a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 25 Nov 2025 03:35:40 +0100 Subject: [PATCH 524/885] curlx: replace `sprintf` with `snprintf` To avoid using a deprecated function on Windows. Also: de-dupe `SNPRINTF` definition in curlx. Closes #19681 --- lib/Makefile.inc | 1 + lib/curl_setup.h | 3 +-- lib/curlx/inet_ntop.c | 14 +++++++------- lib/curlx/snprintf.h | 36 ++++++++++++++++++++++++++++++++++++ lib/curlx/strerr.c | 15 +-------------- lib/curlx/winapi.c | 15 +-------------- src/Makefile.inc | 1 + 7 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 lib/curlx/snprintf.h diff --git a/lib/Makefile.inc b/lib/Makefile.inc index cad02c823786..85faa875e072 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -50,6 +50,7 @@ LIB_CURLX_HFILES = \ curlx/inet_pton.h \ curlx/multibyte.h \ curlx/nonblock.h \ + curlx/snprintf.h \ curlx/strerr.h \ curlx/strparse.h \ curlx/timediff.h \ diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 0e5ebb60c9ef..664aa1432532 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -95,8 +95,7 @@ unlink(), etc. */ #endif #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for getenv(), gmtime(), sprintf(), - strcpy(), +#define _CRT_SECURE_NO_WARNINGS /* for getenv(), gmtime(), strcpy(), in tests: localtime(), sscanf() */ #endif #endif /* _MSC_VER */ diff --git a/lib/curlx/inet_ntop.c b/lib/curlx/inet_ntop.c index d4053f1a60f2..771af81474e7 100644 --- a/lib/curlx/inet_ntop.c +++ b/lib/curlx/inet_ntop.c @@ -32,6 +32,7 @@ #endif #include "inet_ntop.h" +#include "snprintf.h" #define IN6ADDRSZ 16 /* #define INADDRSZ 4 */ @@ -61,13 +62,12 @@ static char *inet_ntop4(const unsigned char *src, char *dst, size_t size) DEBUGASSERT(size >= 16); - /* this sprintf() does not overflow the buffer. Avoids snprintf to work more - widely. Avoids the msnprintf family to work as a curlx function. */ - (void)(sprintf)(tmp, "%d.%d.%d.%d", - ((int)((unsigned char)src[0])) & 0xff, - ((int)((unsigned char)src[1])) & 0xff, - ((int)((unsigned char)src[2])) & 0xff, - ((int)((unsigned char)src[3])) & 0xff); + /* this snprintf() does not overflow the buffer. */ + SNPRINTF(tmp, sizeof(tmp), "%d.%d.%d.%d", + ((int)((unsigned char)src[0])) & 0xff, + ((int)((unsigned char)src[1])) & 0xff, + ((int)((unsigned char)src[2])) & 0xff, + ((int)((unsigned char)src[3])) & 0xff); len = strlen(tmp); if(len == 0 || len >= size) { diff --git a/lib/curlx/snprintf.h b/lib/curlx/snprintf.h new file mode 100644 index 000000000000..266ea137fae6 --- /dev/null +++ b/lib/curlx/snprintf.h @@ -0,0 +1,36 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +/* Raw snprintf() for curlx */ + +#ifdef WITHOUT_LIBCURL /* when built for the test servers */ +#if defined(_MSC_VER) && (_MSC_VER < 1900) /* adjust for old MSVC */ +#define SNPRINTF _snprintf +#else +#define SNPRINTF snprintf +#endif +#else /* !WITHOUT_LIBCURL */ +#include +#define SNPRINTF curl_msnprintf +#endif /* WITHOUT_LIBCURL */ diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index 376f68b0b20d..c33d10701125 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -34,21 +34,8 @@ #include -#ifndef WITHOUT_LIBCURL -#include -#define SNPRINTF curl_msnprintf -#else -/* when built for the test servers */ - -/* adjust for old MSVC */ -#if defined(_MSC_VER) && (_MSC_VER < 1900) -#define SNPRINTF _snprintf -#else -#define SNPRINTF snprintf -#endif -#endif /* !WITHOUT_LIBCURL */ - #include "winapi.h" +#include "snprintf.h" #include "strerr.h" /* The last 2 #include files should be in this order */ #include "../curl_memory.h" diff --git a/lib/curlx/winapi.c b/lib/curlx/winapi.c index 7b3d6b60369c..4cacbcb618ea 100644 --- a/lib/curlx/winapi.c +++ b/lib/curlx/winapi.c @@ -29,20 +29,7 @@ */ #ifdef _WIN32 #include "winapi.h" - -#ifndef WITHOUT_LIBCURL -#include -#define SNPRINTF curl_msnprintf -#else -/* when built for the test servers */ - -/* adjust for old MSVC */ -#if defined(_MSC_VER) && (_MSC_VER < 1900) -#define SNPRINTF _snprintf -#else -#define SNPRINTF snprintf -#endif -#endif /* !WITHOUT_LIBCURL */ +#include "snprintf.h" /* This is a helper function for curlx_strerror that converts Windows API error * codes (GetLastError) to error messages. diff --git a/src/Makefile.inc b/src/Makefile.inc index fa5583755203..6e5e31f806e9 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -54,6 +54,7 @@ CURLX_HFILES = \ ../lib/curlx/fopen.h \ ../lib/curlx/multibyte.h \ ../lib/curlx/nonblock.h \ + ../lib/curlx/snprintf.h \ ../lib/curlx/strerr.h \ ../lib/curlx/strparse.h \ ../lib/curlx/timediff.h \ From 4f807db155815800fde49c3ef8291a3f7c345429 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 25 Nov 2025 10:42:07 +0100 Subject: [PATCH 525/885] INTERNALS.md: add more dependency versions and dates Closes #19691 --- docs/INTERNALS.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index 75393a5d1c72..222d9ab5ed69 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -36,6 +36,7 @@ versions of libs and build tools. - nghttp2 1.15.0 (2016-09-25) - OpenLDAP 2.0 (2000-08-01) - OpenSSL 3.0.0 (2021-09-07) + - Windows XP 5.1 (2001-08-24 - 2009-04-14) - wolfSSL 3.4.6 (2017-09-22) - zlib 1.2.5.2 (2011-12-11) - zstd 1.0 (2016-08-31) @@ -46,12 +47,14 @@ versions of libs and build tools. we use a few "build tools" and we make sure that we remain functional with these versions: - - GNU libtool 1.4.2 (2001-09-11) - - GNU autoconf 2.59 (2003-11-06) - - GNU automake 1.7 (2002-09-25) - - GNU m4 1.4 (2007-09-21) - - perl 5.8 (2002-07-19), on Windows: 5.22 (2015-06-01) - - cmake 3.7 (2016-11-11) + - cmake 3.7 (2016-11-11) + - GNU autoconf 2.59 (2003-11-06) + - GNU automake 1.7 (2002-09-25) + - GNU libtool 1.4.2 (2001-09-11) + - GNU m4 1.4 (2007-09-21) + - mingw-w64 3.0 (2013-09-20) + - perl 5.8 (2002-07-19), on Windows: 5.22 (2015-06-01) + - Visual Studio 2010 10.0 (2010-04-12 - 2020-07-14) Library Symbols =============== From 2b0ca15c49e2f437741603d6de29aaa7a7928d18 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 11:39:04 +0100 Subject: [PATCH 526/885] ratelimit: remove a debug mprintf Follow-up to 24b36fdd1585ea22e5e Closes #19694 --- lib/ratelimit.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 8b34d77e1313..c3593d593756 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -90,8 +90,6 @@ static void ratelimit_update(struct Curl_rlimit *r, elapsed_us = curlx_timediff_us(ts, r->ts); if(elapsed_us < 0) { /* not going back in time */ - curl_mfprintf(stderr, "rlimit: neg elapsed time %" FMT_TIMEDIFF_T "us\n", - elapsed_us); DEBUGASSERT(0); return; } From fc09a2da4ad0595292ecabda6f50f5d415b70527 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Sun, 23 Nov 2025 21:29:46 +0200 Subject: [PATCH 527/885] tool: log when loading .curlrc in verbose mode Inspired by @vszakats in https://github.com/curl/curl/pull/19631#issuecomment-3560803674 Closes #19663 --- src/tool_getparam.c | 2 +- src/tool_operate.c | 10 +++++++++- src/tool_parsecfg.c | 8 +++++++- src/tool_parsecfg.h | 3 ++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 0bb1329b5495..76113e45bd0d 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -2225,7 +2225,7 @@ static ParameterError opt_file(struct OperationConfig *config, err = PARAM_BAD_USE; } else { - err = parseconfig(nextarg, max_recursive); + err = parseconfig(nextarg, max_recursive, NULL); } break; case C_CRLFILE: /* --crlfile */ diff --git a/src/tool_operate.c b/src/tool_operate.c index 69cfef96d786..eb591935db4f 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2227,6 +2227,8 @@ CURLcode operate(int argc, argv_item_t argv[]) { CURLcode result = CURLE_OK; const char *first_arg; + char *curlrc_path = NULL; + bool found_curlrc = FALSE; first_arg = argc > 1 ? convert_tchar_to_UTF8(argv[1]) : NULL; @@ -2240,7 +2242,8 @@ CURLcode operate(int argc, argv_item_t argv[]) if((argc == 1) || (first_arg && strncmp(first_arg, "-q", 2) && strcmp(first_arg, "--disable"))) { - parseconfig(NULL, CONFIG_MAX_LEVELS); /* ignore possible failure */ + if(!parseconfig(NULL, CONFIG_MAX_LEVELS, &curlrc_path)) + found_curlrc = TRUE; /* If we had no arguments then make sure a URL was specified in .curlrc */ if((argc < 2) && (!global->first->url_list)) { @@ -2254,6 +2257,11 @@ CURLcode operate(int argc, argv_item_t argv[]) if(!result) { /* Parse the command line arguments */ ParameterError res = parse_args(argc, argv); + if(found_curlrc) { + /* After parse_args so notef knows the verbosity */ + notef("Read config file from '%s'", curlrc_path); + free(curlrc_path); + } if(res) { result = CURLE_OK; diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 53b63746b5ac..e7a00cf70883 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -81,7 +81,8 @@ static int unslashquote(const char *line, struct dynbuf *param) #define MAX_CONFIG_LINE_LENGTH (10*1024*1024) /* return 0 on everything-is-fine, and non-zero otherwise */ -ParameterError parseconfig(const char *filename, int max_recursive) +ParameterError parseconfig(const char *filename, int max_recursive, + char **resolved) { FILE *file = NULL; bool usedarg = FALSE; @@ -264,6 +265,11 @@ ParameterError parseconfig(const char *filename, int max_recursive) if((err == PARAM_READ_ERROR) && filename) errorf("cannot read config from '%s'", filename); + if(!err && resolved) { + *resolved = strdup(filename); + if(!*resolved) + err = PARAM_NO_MEM; + } free(pathalloc); return err; } diff --git a/src/tool_parsecfg.h b/src/tool_parsecfg.h index 3aad9bdd9cbd..860b9df38eda 100644 --- a/src/tool_parsecfg.h +++ b/src/tool_parsecfg.h @@ -27,7 +27,8 @@ /* only allow this many levels of recursive --config use */ #define CONFIG_MAX_LEVELS 5 -ParameterError parseconfig(const char *filename, int max_recursive); +ParameterError parseconfig(const char *filename, int max_recursive, + char **resolved); bool my_get_line(FILE *fp, struct dynbuf *db, bool *error); #endif /* HEADER_CURL_TOOL_PARSECFG_H */ From 208a6aebf223200293a5f0c1bdc3cced36d5af1f Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 10:00:23 +0100 Subject: [PATCH 528/885] lib: timer stats improvements * move the TIMER_POSTQUEUE to the time a connection is chosen, so that TIMER_NAMELOOKUP always happens afterwards * client writer: do not trigger TIMER_STARTTRANSFER on CLIENTWRITE_INFO as ftp and other pingpong protocols write that before starting anything that is the tranfer itself * Elimnating debug trancing of "closed stream/connection - bailing" as confusing, as connection is not really closed on most cases. * Setting 'data->req.upload_done` correctly, so that no "abort upload" is happening at the end of a perfectly fine download. * Adding test cases with up-/download of 0-length files. * pytest: add a "timeline" of timer value checks to Resulst in curl.py, so that this can be used in several test cases, replacing the local stuff in test_16 * add timeline checks to ftp test cases Closes #19269 --- lib/cfilters.c | 13 +++--- lib/multi.c | 2 +- lib/request.c | 10 ++++- lib/sendf.c | 3 +- lib/transfer.c | 13 +----- lib/url.c | 1 + lib/vquic/curl_osslq.c | 8 ++++ tests/http/test_02_download.py | 6 ++- tests/http/test_16_info.py | 56 ++--------------------- tests/http/test_30_vsftpd.py | 21 ++++++--- tests/http/test_31_vsftpds.py | 5 +++ tests/http/test_32_ftps_vsftpd.py | 6 +++ tests/http/testenv/curl.py | 74 +++++++++++++++++++++++++++++++ tests/libtest/lib500.c | 5 ++- 14 files changed, 141 insertions(+), 82 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index 507512f8aa46..f0da4778a685 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -63,8 +63,8 @@ CURLcode Curl_cf_def_shutdown(struct Curl_cfilter *cf, return CURLE_OK; } -static void conn_report_connect_stats(struct Curl_easy *data, - struct connectdata *conn); +static void conn_report_connect_stats(struct Curl_cfilter *cf, + struct Curl_easy *data); CURLcode Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -508,7 +508,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, * persist information at the connection. E.g. cf-socket sets the * socket and ip related information. */ cf_cntrl_update_info(data, data->conn); - conn_report_connect_stats(data, data->conn); + conn_report_connect_stats(cf, data); data->conn->keepalive = curlx_now(); #ifndef CURL_DISABLE_VERBOSE_STRINGS result = cf_verboseconnect(data, cf); @@ -518,7 +518,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, else if(result) { CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %d", result); - conn_report_connect_stats(data, data->conn); + conn_report_connect_stats(cf, data); goto out; } @@ -1008,10 +1008,9 @@ static void cf_cntrl_update_info(struct Curl_easy *data, /** * Update connection statistics */ -static void conn_report_connect_stats(struct Curl_easy *data, - struct connectdata *conn) +static void conn_report_connect_stats(struct Curl_cfilter *cf, + struct Curl_easy *data) { - struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET]; if(cf) { struct curltime connected; struct curltime appconnected; diff --git a/lib/multi.c b/lib/multi.c index 00af3ca2bddf..db04d64c231b 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2337,7 +2337,7 @@ static CURLMcode state_connect(struct Curl_multi *multi, process_pending_handles(data->multi); if(!result) { - *nowp = Curl_pgrsTime(data, TIMER_POSTQUEUE); + *nowp = curlx_now(); if(async) /* We are now waiting for an asynchronous name lookup */ multistate(data, MSTATE_RESOLVING); diff --git a/lib/request.c b/lib/request.c index 5bfcdfbfb8c7..324c4c48f96d 100644 --- a/lib/request.c +++ b/lib/request.c @@ -393,6 +393,11 @@ CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *req, return result; buf += nwritten; blen -= nwritten; + if(!blen) { + result = req_set_upload_done(data); + if(result) + return result; + } } if(blen) { @@ -469,6 +474,9 @@ CURLcode Curl_req_stop_send_recv(struct Curl_easy *data) /* stop receiving and ALL sending as well, including PAUSE and HOLD. * We might still be paused on receive client writes though, so * keep those bits around. */ + CURLcode result = CURLE_OK; + if(data->req.keepon & KEEP_SEND) + result = Curl_req_abort_sending(data); data->req.keepon &= ~(KEEP_RECV|KEEP_SEND); - return Curl_req_abort_sending(data); + return result; } diff --git a/lib/sendf.c b/lib/sendf.c index 4eabc14402da..6731cd874b6b 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -230,7 +230,8 @@ static CURLcode cw_download_write(struct Curl_easy *data, size_t nwrite, excess_len = 0; bool is_connect = !!(type & CLIENTWRITE_CONNECT); - if(!is_connect && !ctx->started_response) { + if(!ctx->started_response && + !(type & (CLIENTWRITE_INFO|CLIENTWRITE_CONNECT))) { Curl_pgrsTime(data, TIMER_STARTTRANSFER); Curl_rlimit_start(&data->progress.dl.rlimit, curlx_now()); ctx->started_response = TRUE; diff --git a/lib/transfer.c b/lib/transfer.c index 04a013361ebd..f2df2cef8cba 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -301,18 +301,7 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, /* We only get a 0-length receive at the end of the response */ is_eos = (blen == 0); - if(!blen && (conn->recv[FIRSTSOCKET] == Curl_cf_recv)) { - /* if we receive 0 or less here and the protocol handler did not - replace the connection's `recv` callback, either the data transfer - is done or the server closed the connection and - we bail out from this! - With a `recv` replacement, we assume the protocol handler knows - what it is doing and a 0-length receive is fine. For example, - SFTP downloads of an empty file would show this. See #19165. */ - if(is_multiplex) - DEBUGF(infof(data, "nread == 0, stream closed, bailing")); - else - DEBUGF(infof(data, "nread <= 0, server closed connection, bailing")); + if(!blen) { result = Curl_req_stop_send_recv(data); if(result) goto out; diff --git a/lib/url.c b/lib/url.c index 1d4c6b1fc419..d953734dce9b 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3834,6 +3834,7 @@ CURLcode Curl_connect(struct Curl_easy *data, if(!result) { DEBUGASSERT(conn); + Curl_pgrsTime(data, TIMER_POSTQUEUE); if(reused) { if(CONN_ATTACHED(conn) > 1) /* multiplexed */ diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index f447e8dddf0f..b890a8d9516d 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1803,6 +1803,14 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, if(err == 1) { /* connected */ + if(!ctx->got_first_byte) { + /* if not recorded yet, take the timestamp before we called + * SSL_do_handshake() as the time we received the first packet. */ + ctx->got_first_byte = TRUE; + ctx->first_byte_at = now; + } + /* Record the handshake complete with a new time stamp. */ + now = curlx_now(); ctx->handshake_at = now; ctx->q.last_io = now; CURL_TRC_CF(data, cf, "handshake complete after %" FMT_TIMEDIFF_T "ms", diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 8cfd68b20463..dcfe9690bcb4 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -43,6 +43,7 @@ class TestDownload: @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env, httpd): indir = httpd.docs_dir + env.make_data_file(indir=indir, fname="data-0k", fsize=0) env.make_data_file(indir=indir, fname="data-10k", fsize=10*1024) env.make_data_file(indir=indir, fname="data-100k", fsize=100*1024) env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024) @@ -52,9 +53,10 @@ def _class_scope(self, env, httpd): # download 1 file @pytest.mark.parametrize("proto", Env.http_protos()) - def test_02_01_download_1(self, env: Env, httpd, nghttpx, proto): + @pytest.mark.parametrize("docname", ['data.json', 'data-0k', 'data-10k', 'data-100k']) + def test_02_01_download_1(self, env: Env, httpd, nghttpx, proto, docname): curl = CurlClient(env=env) - url = f'https://{env.authority_for(env.domain1, proto)}/data.json' + url = f'https://{env.authority_for(env.domain1, proto)}/{docname}' r = curl.http_download(urls=[url], alpn_proto=proto) r.check_response(http_status=200) diff --git a/tests/http/test_16_info.py b/tests/http/test_16_info.py index 4e0d1ed5b1a9..80984a284ee1 100644 --- a/tests/http/test_16_info.py +++ b/tests/http/test_16_info.py @@ -56,6 +56,7 @@ def test_16_01_info_download(self, env: Env, httpd, nghttpx, proto): remote_ip='127.0.0.1') for idx, s in enumerate(r.stats): self.check_stat(idx, s, r, dl_size=30, ul_size=0) + r.check_stats_timeline(idx) # download plain file with a 302 redirect @pytest.mark.parametrize("proto", Env.http_protos()) @@ -71,6 +72,7 @@ def test_16_02_info_302_download(self, env: Env, httpd, nghttpx, proto): remote_ip='127.0.0.1') for idx, s in enumerate(r.stats): self.check_stat(idx, s, r, dl_size=30, ul_size=0) + r.check_stats_timeline(idx) @pytest.mark.parametrize("proto", Env.http_protos()) def test_16_03_info_upload(self, env: Env, httpd, nghttpx, proto): @@ -89,6 +91,7 @@ def test_16_03_info_upload(self, env: Env, httpd, nghttpx, proto): remote_ip='127.0.0.1') for idx, s in enumerate(r.stats): self.check_stat(idx, s, r, dl_size=fsize, ul_size=fsize) + r.check_stats_timeline(idx) # download plain file via http: ('time_appconnect' is 0) @pytest.mark.parametrize("proto", ['http/1.1']) @@ -101,9 +104,9 @@ def test_16_04_info_http_download(self, env: Env, httpd, nghttpx, proto): remote_port=env.http_port, remote_ip='127.0.0.1') for idx, s in enumerate(r.stats): self.check_stat(idx, s, r, dl_size=30, ul_size=0) + r.check_stats_timeline(idx) def check_stat(self, idx, s, r, dl_size=None, ul_size=None): - self.check_stat_times(s, idx) # we always send something self.check_stat_positive(s, idx, 'size_request') # we always receive response headers @@ -118,54 +121,3 @@ def check_stat(self, idx, s, r, dl_size=None, ul_size=None): def check_stat_positive(self, s, idx, key): assert key in s, f'stat #{idx} "{key}" missing: {s}' assert s[key] > 0, f'stat #{idx} "{key}" not positive: {s}' - - def check_stat_positive_or_0(self, s, idx, key): - assert key in s, f'stat #{idx} "{key}" missing: {s}' - assert s[key] >= 0, f'stat #{idx} "{key}" not positive: {s}' - - def check_stat_zero(self, s, key): - assert key in s, f'stat "{key}" missing: {s}' - assert s[key] == 0, f'stat "{key}" not zero: {s}' - - def check_stat_times(self, s, idx): - # check timings reported on a transfer for consistency - url = s['url_effective'] - # connect time is sometimes reported as 0 by openssl-quic (sigh) - self.check_stat_positive_or_0(s, idx, 'time_connect') - # all stat keys which reporting timings - all_keys = { - 'time_appconnect', 'time_redirect', - 'time_pretransfer', 'time_starttransfer', 'time_total' - } - # stat keys where we expect a positive value - pos_keys = {'time_pretransfer', 'time_starttransfer', 'time_total', 'time_queue'} - if s['num_connects'] > 0: - if url.startswith('https:'): - pos_keys.add('time_appconnect') - if s['num_redirects'] > 0: - pos_keys.add('time_redirect') - zero_keys = all_keys - pos_keys - # assert all zeros are zeros and the others are positive - for key in zero_keys: - self.check_stat_zero(s, key) - for key in pos_keys: - self.check_stat_positive(s, idx, key) - # assert that all timers before "time_pretransfer" are less or equal - for key in ['time_appconnect', 'time_connect', 'time_namelookup']: - assert s[key] < s['time_pretransfer'], f'time "{key}" larger than' \ - f'"time_pretransfer": {s}' - # assert transfer total is after pretransfer. - # (in MOST situations, pretransfer is before starttransfer, BUT - # in protocols like HTTP we might get a server response already before - # we transition to multi state DID.) - assert s['time_pretransfer'] <= s['time_total'], f'"time_pretransfer" '\ - f'greater than "time_total", {s}' - # assert that transfer start is before total - assert s['time_starttransfer'] <= s['time_total'], f'"time_starttransfer" '\ - f'greater than "time_total", {s}' - if s['num_redirects'] > 0: - assert s['time_queue'] < s['time_starttransfer'], f'"time_queue" '\ - f'greater/equal than "time_starttransfer", {s}' - else: - assert s['time_queue'] <= s['time_starttransfer'], f'"time_queue" '\ - f'greater than "time_starttransfer", {s}' diff --git a/tests/http/test_30_vsftpd.py b/tests/http/test_30_vsftpd.py index bffeae35cf7b..7d113d5363fe 100644 --- a/tests/http/test_30_vsftpd.py +++ b/tests/http/test_30_vsftpd.py @@ -63,10 +63,12 @@ def _class_scope(self, env, vsftpd): shutil.rmtree(vsftpd.docs_dir) if not os.path.exists(vsftpd.docs_dir): os.makedirs(vsftpd.docs_dir) + self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-0k', fsize=0) self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-1k', fsize=1024) self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-10k', fsize=10*1024) self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-1m', fsize=1024*1024) self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-10m', fsize=10*1024*1024) + env.make_data_file(indir=env.gen_dir, fname="upload-0k", fsize=0) env.make_data_file(indir=env.gen_dir, fname="upload-1k", fsize=1024) env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100*1024) env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024*1024) @@ -77,11 +79,12 @@ def test_30_01_list_dir(self, env: Env, vsftpd: VsFTPD): r = curl.ftp_get(urls=[url], with_stats=True) r.check_stats(count=1, http_status=226) lines = open(os.path.join(curl.run_dir, 'download_#1.data')).readlines() - assert len(lines) == 4, f'list: {lines}' + assert len(lines) == 5, f'list: {lines}' + r.check_stats_timelines() # download 1 file, no SSL @pytest.mark.parametrize("docname", [ - 'data-1k', 'data-1m', 'data-10m' + 'data-0k', 'data-1k', 'data-1m', 'data-10m' ]) def test_30_02_download_1(self, env: Env, vsftpd: VsFTPD, docname): curl = CurlClient(env=env) @@ -91,9 +94,10 @@ def test_30_02_download_1(self, env: Env, vsftpd: VsFTPD, docname): r = curl.ftp_get(urls=[url], with_stats=True) r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ - 'data-1k', 'data-1m', 'data-10m' + 'data-0k', 'data-1k', 'data-1m', 'data-10m' ]) def test_30_03_download_10_serial(self, env: Env, vsftpd: VsFTPD, docname): curl = CurlClient(env=env) @@ -104,9 +108,10 @@ def test_30_03_download_10_serial(self, env: Env, vsftpd: VsFTPD, docname): r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) assert r.total_connects == count + 1, 'should reuse the control conn' + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ - 'data-1k', 'data-1m', 'data-10m' + 'data-0k', 'data-1k', 'data-1m', 'data-10m' ]) def test_30_04_download_10_parallel(self, env: Env, vsftpd: VsFTPD, docname): curl = CurlClient(env=env) @@ -119,9 +124,10 @@ def test_30_04_download_10_parallel(self, env: Env, vsftpd: VsFTPD, docname): r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) assert r.total_connects > count + 1, 'should have used several control conns' + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ - 'upload-1k', 'upload-100k', 'upload-1m' + 'upload-0k', 'upload-1k', 'upload-100k', 'upload-1m' ]) def test_30_05_upload_1(self, env: Env, vsftpd: VsFTPD, docname): curl = CurlClient(env=env) @@ -133,6 +139,7 @@ def test_30_05_upload_1(self, env: Env, vsftpd: VsFTPD, docname): r = curl.ftp_upload(urls=[url], fupload=f'{srcfile}', with_stats=True) r.check_stats(count=count, http_status=226) self.check_upload(env, vsftpd, docname=docname) + r.check_stats_timelines() def _rmf(self, path): if os.path.exists(path): @@ -188,6 +195,7 @@ def test_30_08_active_download(self, env: Env, vsftpd: VsFTPD): ]) r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) + r.check_stats_timelines() def test_30_09_active_up_file(self, env: Env, vsftpd: VsFTPD): docname = 'upload-1k' @@ -202,6 +210,7 @@ def test_30_09_active_up_file(self, env: Env, vsftpd: VsFTPD): ]) r.check_stats(count=count, http_status=226) self.check_upload(env, vsftpd, docname=docname) + r.check_stats_timelines() def test_30_10_active_up_ascii(self, env: Env, vsftpd: VsFTPD): docname = 'upload-1k' @@ -216,6 +225,7 @@ def test_30_10_active_up_ascii(self, env: Env, vsftpd: VsFTPD): ]) r.check_stats(count=count, http_status=226) self.check_upload(env, vsftpd, docname=docname, binary=False) + r.check_stats_timelines() def test_30_11_download_non_existing(self, env: Env, vsftpd: VsFTPD): curl = CurlClient(env=env) @@ -223,6 +233,7 @@ def test_30_11_download_non_existing(self, env: Env, vsftpd: VsFTPD): r = curl.ftp_get(urls=[url], with_stats=True) r.check_exit_code(78) r.check_stats(count=1, exitcode=78) + r.check_stats_timelines() def check_downloads(self, client, srcfile: str, count: int, complete: bool = True): diff --git a/tests/http/test_31_vsftpds.py b/tests/http/test_31_vsftpds.py index f7e32cb77b77..93fef708ccdd 100644 --- a/tests/http/test_31_vsftpds.py +++ b/tests/http/test_31_vsftpds.py @@ -85,6 +85,7 @@ def test_31_01_list_dir(self, env: Env, vsftpds: VsFTPD): r.check_stats(count=1, http_status=226) lines = open(os.path.join(curl.run_dir, 'download_#1.data')).readlines() assert len(lines) == 4, f'list: {lines}' + r.check_stats_timelines() # download 1 file, no SSL @pytest.mark.parametrize("docname", [ @@ -98,6 +99,7 @@ def test_31_02_download_1(self, env: Env, vsftpds: VsFTPD, docname): r = curl.ftp_ssl_get(urls=[url], with_stats=True) r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ 'data-1k', 'data-1m', 'data-10m' @@ -111,6 +113,7 @@ def test_31_03_download_10_serial(self, env: Env, vsftpds: VsFTPD, docname): r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) assert r.total_connects == count + 1, 'should reuse the control conn' + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ 'data-1k', 'data-1m', 'data-10m' @@ -126,6 +129,7 @@ def test_31_04_download_10_parallel(self, env: Env, vsftpds: VsFTPD, docname): r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) assert r.total_connects > count + 1, 'should have used several control conns' + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ 'upload-1k', 'upload-100k', 'upload-1m' @@ -140,6 +144,7 @@ def test_31_05_upload_1(self, env: Env, vsftpds: VsFTPD, docname): r = curl.ftp_ssl_upload(urls=[url], fupload=f'{srcfile}', with_stats=True) r.check_stats(count=count, http_status=226) self.check_upload(env, vsftpds, docname=docname) + r.check_stats_timelines() def _rmf(self, path): if os.path.exists(path): diff --git a/tests/http/test_32_ftps_vsftpd.py b/tests/http/test_32_ftps_vsftpd.py index 46690a84355e..7a849d374044 100644 --- a/tests/http/test_32_ftps_vsftpd.py +++ b/tests/http/test_32_ftps_vsftpd.py @@ -85,6 +85,7 @@ def test_32_01_list_dir(self, env: Env, vsftpds: VsFTPD): r.check_stats(count=1, http_status=226) lines = open(os.path.join(curl.run_dir, 'download_#1.data')).readlines() assert len(lines) == 4, f'list: {lines}' + r.check_stats_timelines() # download 1 file, no SSL @pytest.mark.parametrize("docname", [ @@ -98,6 +99,7 @@ def test_32_02_download_1(self, env: Env, vsftpds: VsFTPD, docname): r = curl.ftp_get(urls=[url], with_stats=True) r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ 'data-1k', 'data-1m', 'data-10m' @@ -111,6 +113,7 @@ def test_32_03_download_10_serial(self, env: Env, vsftpds: VsFTPD, docname): r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) assert r.total_connects == count + 1, 'should reuse the control conn' + r.check_stats_timelines() # 2 serial transfers, first with 'ftps://' and second with 'ftp://' # we want connection reuse in this case @@ -123,6 +126,7 @@ def test_32_03b_ftp_compat_ftps(self, env: Env, vsftpds: VsFTPD): r = curl.ftp_get(urls=[url1, url2], with_stats=True) r.check_stats(count=count, http_status=226) assert r.total_connects == count + 1, 'should reuse the control conn' + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ 'data-1k', 'data-1m', 'data-10m' @@ -138,6 +142,7 @@ def test_32_04_download_10_parallel(self, env: Env, vsftpds: VsFTPD, docname): r.check_stats(count=count, http_status=226) self.check_downloads(curl, srcfile, count) assert r.total_connects > count + 1, 'should have used several control conns' + r.check_stats_timelines() @pytest.mark.parametrize("docname", [ 'upload-1k', 'upload-100k', 'upload-1m' @@ -152,6 +157,7 @@ def test_32_05_upload_1(self, env: Env, vsftpds: VsFTPD, docname): r = curl.ftp_upload(urls=[url], fupload=f'{srcfile}', with_stats=True) r.check_stats(count=count, http_status=226) self.check_upload(env, vsftpds, docname=docname) + r.check_stats_timelines() def _rmf(self, path): if os.path.exists(path): diff --git a/tests/http/testenv/curl.py b/tests/http/testenv/curl.py index a92e4f681f34..e486715fa79b 100644 --- a/tests/http/testenv/curl.py +++ b/tests/http/testenv/curl.py @@ -493,6 +493,80 @@ def check_stats(self, count: int, http_status: Optional[int] = None, f'status #{idx} remote_ip: expected {remote_ip}, '\ f'got {x["remote_ip"]}\n{self.dump_stat(x)}' + def check_stat_positive(self, s, idx, key): + assert key in s, f'stat #{idx} "{key}" missing: {s}' + assert s[key] > 0, f'stat #{idx} "{key}" not positive: {s}' + + def check_stat_positive_or_0(self, s, idx, key): + assert key in s, f'stat #{idx} "{key}" missing: {s}' + assert s[key] >= 0, f'stat #{idx} "{key}" not positive: {s}' + + def check_stat_zero(self, s, key): + assert key in s, f'stat "{key}" missing: {s}' + assert s[key] == 0, f'stat "{key}" not zero: {s}' + + def check_stats_timelines(self): + for i in range(len(self._stats)): + self.check_stats_timeline(i) + + def check_stats_timeline(self, idx): + # check timings reported on a transfer for consistency + s = self._stats[idx] + + url = s['url_effective'] + # connect time is sometimes reported as 0 by openssl-quic (sigh) + self.check_stat_positive_or_0(s, idx, 'time_connect') + # all stat keys which reporting timings + all_keys = { + 'time_queue', 'time_namelookup', + 'time_connect', 'time_appconnect', + 'time_pretransfer', 'time_posttransfer', + 'time_starttransfer', 'time_total', + } + # stat keys where we expect a positive value + ref_tl = [] + exact_match = True + # redirects mess up the queue time, only count without + if s['time_redirect'] == 0: + ref_tl += ['time_queue'] + else: + exact_match = False + # connect events? + if url.startswith('ftp'): + # ftp is messy with connect events for its DATA connection + exact_match = False + elif s['num_connects'] > 0: + ref_tl += ['time_namelookup', 'time_connect'] + if url.startswith('https:'): + ref_tl += ['time_appconnect'] + # what kind of transfer was it? + if s['size_upload'] == 0 and s['size_download'] > 0: + # this is a download + dl_tl = ['time_pretransfer', 'time_starttransfer'] + if s['size_request'] > 0: + dl_tl = ['time_posttransfer'] + dl_tl + ref_tl += dl_tl + elif s['size_upload'] > 0 and s['size_download'] == 0: + # this is an upload + ul_tl = ['time_pretransfer', 'time_posttransfer'] + ref_tl += ul_tl + else: + # could be a 0-length upload or 0-length download, not sure + exact_match = False + # always there at the end + ref_tl += ['time_total'] + + # assert all events in reference timeline are > 0 + for key in ref_tl: + self.check_stat_positive(s, idx, key) + if exact_match: + # assert all events not in reference timeline are 0 + for key in [key for key in all_keys if key not in ref_tl]: + self.check_stat_zero(s, key) + # calculate the timeline that did happen + seen_tl = sorted(ref_tl, key=lambda ts: s[ts]) + assert seen_tl == ref_tl, f'{[f"{ts}: {s[ts]}" for ts in seen_tl]}' + def dump_logs(self): lines = ['>>--stdout ----------------------------------------------\n'] lines.extend(self._stdout) diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c index ffb974f4f0cb..ff886a05ca60 100644 --- a/tests/libtest/lib500.c +++ b/tests/libtest/lib500.c @@ -128,7 +128,10 @@ static CURLcode test_lib500(const char *URL) (time_pretransfer / 1000000), (long)(time_pretransfer % 1000000)); } - if(time_pretransfer > time_posttransfer) { + if(time_posttransfer > time_pretransfer) { + /* counter-intuitive: on a GET request, all bytes are sent *before* + * PRETRANSFER happens. Thus POSTTRANSFER has to be smaller. + * The reverse would be true for a POST/PUT. */ curl_mfprintf(moo, "pretransfer vs posttransfer: %" CURL_FORMAT_CURL_OFF_T ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", From 16b44f6a3ad13386a25dfc005794696a69f949b0 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 19 Nov 2025 11:54:36 +0100 Subject: [PATCH 529/885] multi: simplify admin handle processing Fold the special connection pool shutdown handling in multi the things the admin handle cares about. Add the admin handle to the 'process' bitset, deduce it from the 'running' count. The admin handle is the processed like any other transfer, but has a special case in `multi_runsingle()`. Simplifies all other multi processing parts. Closes #19604 --- lib/multi.c | 82 ++++++++++++++++++++++---------------------------- lib/multi_ev.c | 5 ++- lib/multi_ev.h | 3 +- 3 files changed, 39 insertions(+), 51 deletions(-) diff --git a/lib/multi.c b/lib/multi.c index db04d64c231b..5789861026af 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -101,9 +101,9 @@ static void move_pending_to_connect(struct Curl_multi *multi, static CURLMcode add_next_timeout(struct curltime now, struct Curl_multi *multi, struct Curl_easy *d); -static CURLMcode multi_timeout(struct Curl_multi *multi, - struct curltime *expire_time, - long *timeout_ms); +static void multi_timeout(struct Curl_multi *multi, + struct curltime *expire_time, + long *timeout_ms); static void process_pending_handles(struct Curl_multi *multi); static void multi_xfer_bufs_free(struct Curl_multi *multi); #ifdef DEBUGBUILD @@ -273,11 +273,13 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, multi->admin->multi = multi; multi->admin->state.internal = TRUE; Curl_llist_init(&multi->admin->state.timeoutlist, NULL); + #ifdef DEBUGBUILD if(getenv("CURL_DEBUG")) multi->admin->set.verbose = TRUE; #endif Curl_uint_tbl_add(&multi->xfers, multi->admin, &multi->admin->mid); + Curl_uint_bset_add(&multi->process, multi->admin->mid); if(Curl_cshutdn_init(&multi->cshutdn, multi)) goto error; @@ -413,7 +415,6 @@ static CURLMcode multi_xfers_add(struct Curl_multi *multi, return CURLM_OK; } - CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) { CURLMcode rc; @@ -500,6 +501,7 @@ CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) /* Make sure the new handle will run */ Curl_multi_mark_dirty(data); + /* Necessary in event based processing, where dirty handles trigger * a timeout callback invocation. */ rc = Curl_update_timer(multi); @@ -1441,7 +1443,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, * poll. Collecting the sockets may install new timers by protocols * and connection filters. * Use the shorter one of the internal and the caller requested timeout. */ - (void)multi_timeout(multi, &expire_time, &timeout_internal); + multi_timeout(multi, &expire_time, &timeout_internal); if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms)) timeout_ms = (int)timeout_internal; @@ -1562,7 +1564,8 @@ static CURLMcode multi_wait(struct Curl_multi *multi, long sleep_ms = 0; /* Avoid busy-looping when there is nothing particular to wait for */ - if(!curl_multi_timeout(multi, &sleep_ms) && sleep_ms) { + multi_timeout(multi, &expire_time, &sleep_ms); + if(sleep_ms) { if(sleep_ms > timeout_ms) sleep_ms = timeout_ms; /* when there are no easy handles in the multi, this holds a -1 @@ -2394,6 +2397,11 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, * again during processing, triggering a re-run later. */ Curl_uint_bset_remove(&multi->dirty, data->mid); + if(data == multi->admin) { + Curl_cshutdn_perform(&multi->cshutdn, multi->admin, CURL_SOCKET_TIMEOUT); + return CURLM_OK; + } + do { /* A "stream" here is a logical stream if the protocol can handle that (HTTP/2), or the full connection for older protocols */ @@ -2810,19 +2818,13 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) Curl_uint_bset_remove(&multi->dirty, mid); continue; } - if(data != multi->admin) { - /* admin handle is processed below */ - sigpipe_apply(data, &pipe_st); - result = multi_runsingle(multi, &now, data); - if(result) - returncode = result; - } + sigpipe_apply(data, &pipe_st); + result = multi_runsingle(multi, &now, data); + if(result) + returncode = result; } while(Curl_uint_bset_next(&multi->process, mid, &mid)); } - - sigpipe_apply(multi->admin, &pipe_st); - Curl_cshutdn_perform(&multi->cshutdn, multi->admin, CURL_SOCKET_TIMEOUT); sigpipe_restore(&pipe_st); if(multi_ischanged(m, TRUE)) @@ -3077,7 +3079,6 @@ struct multi_run_ctx { struct curltime now; size_t run_xfers; SIGPIPE_MEMBER(pipe_st); - bool run_cpool; }; static void multi_mark_expired_as_dirty(struct multi_run_ctx *mrc) @@ -3127,12 +3128,7 @@ static CURLMcode multi_run_dirty(struct multi_run_ctx *mrc) if(data) { CURL_TRC_M(data, "multi_run_dirty"); - if(data == multi->admin) { - Curl_uint_bset_remove(&multi->dirty, mid); - mrc->run_cpool = TRUE; - continue; - } - else if(!Curl_uint_bset_contains(&multi->process, mid)) { + if(!Curl_uint_bset_contains(&multi->process, mid)) { /* We are no longer processing this transfer */ Curl_uint_bset_remove(&multi->dirty, mid); continue; @@ -3185,13 +3181,12 @@ static CURLMcode multi_socket(struct Curl_multi *multi, /* Reassess event status of all active transfers */ result = Curl_multi_ev_assess_xfer_bset(multi, &multi->process); } - mrc.run_cpool = TRUE; goto out; } if(s != CURL_SOCKET_TIMEOUT) { /* Mark all transfers of that socket as dirty */ - Curl_multi_ev_dirty_xfers(multi, s, &mrc.run_cpool); + Curl_multi_ev_dirty_xfers(multi, s); } else { /* Asked to run due to time-out. Clear the 'last_expire_ts' variable to @@ -3200,7 +3195,6 @@ static CURLMcode multi_socket(struct Curl_multi *multi, handles the case when the application asks libcurl to run the timeout prematurely. */ memset(&multi->last_expire_ts, 0, sizeof(multi->last_expire_ts)); - mrc.run_cpool = TRUE; } multi_mark_expired_as_dirty(&mrc); @@ -3220,10 +3214,6 @@ static CURLMcode multi_socket(struct Curl_multi *multi, } out: - if(mrc.run_cpool) { - sigpipe_apply(multi->admin, &mrc.pipe_st); - Curl_cshutdn_perform(&multi->cshutdn, multi->admin, s); - } sigpipe_restore(&mrc.pipe_st); if(multi_ischanged(multi, TRUE)) @@ -3394,9 +3384,9 @@ static bool multi_has_dirties(struct Curl_multi *multi) return FALSE; } -static CURLMcode multi_timeout(struct Curl_multi *multi, - struct curltime *expire_time, - long *timeout_ms) +static void multi_timeout(struct Curl_multi *multi, + struct curltime *expire_time, + long *timeout_ms) { static const struct curltime tv_zero = {0, 0}; #ifndef CURL_DISABLE_VERBOSE_STRINGS @@ -3405,13 +3395,13 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, if(multi->dead) { *timeout_ms = 0; - return CURLM_OK; + return; } if(multi_has_dirties(multi)) { *expire_time = curlx_now(); *timeout_ms = 0; - return CURLM_OK; + return; } else if(multi->timetree) { /* we have a tree of expire times */ @@ -3462,8 +3452,6 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, } } #endif - - return CURLM_OK; } CURLMcode curl_multi_timeout(CURLM *m, @@ -3479,7 +3467,8 @@ CURLMcode curl_multi_timeout(CURLM *m, if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - return multi_timeout(multi, &expire_time, timeout_ms); + multi_timeout(multi, &expire_time, timeout_ms); + return CURLM_OK; } /* @@ -3495,9 +3484,7 @@ CURLMcode Curl_update_timer(struct Curl_multi *multi) if(!multi->timer_cb || multi->dead) return CURLM_OK; - if(multi_timeout(multi, &expire_ts, &timeout_ms)) { - return CURLM_OK; - } + multi_timeout(multi, &expire_ts, &timeout_ms); if(timeout_ms < 0 && multi->last_timeout_ms < 0) { /* nothing to do */ @@ -3836,6 +3823,7 @@ CURLMcode curl_multi_get_offt(CURLM *m, curl_off_t *pvalue) { struct Curl_multi *multi = m; + unsigned int n; if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -3843,15 +3831,17 @@ CURLMcode curl_multi_get_offt(CURLM *m, return CURLM_BAD_FUNCTION_ARGUMENT; switch(info) { - case CURLMINFO_XFERS_CURRENT: { - unsigned int n = Curl_uint_tbl_count(&multi->xfers); + case CURLMINFO_XFERS_CURRENT: + n = Curl_uint_tbl_count(&multi->xfers); if(n && multi->admin) --n; *pvalue = (curl_off_t)n; return CURLM_OK; - } case CURLMINFO_XFERS_RUNNING: - *pvalue = (curl_off_t)Curl_uint_bset_count(&multi->process); + n = Curl_uint_bset_count(&multi->process); + if(n && Curl_uint_bset_contains(&multi->process, multi->admin->mid)) + --n; + *pvalue = (curl_off_t)n; return CURLM_OK; case CURLMINFO_XFERS_PENDING: *pvalue = (curl_off_t)Curl_uint_bset_count(&multi->pending); @@ -4037,7 +4027,7 @@ static void multi_xfer_bufs_free(struct Curl_multi *multi) struct Curl_easy *Curl_multi_get_easy(struct Curl_multi *multi, unsigned int mid) { - struct Curl_easy *data = mid ? Curl_uint_tbl_get(&multi->xfers, mid) : NULL; + struct Curl_easy *data = Curl_uint_tbl_get(&multi->xfers, mid); if(data && GOOD_EASY_HANDLE(data)) return data; CURL_TRC_M(multi->admin, "invalid easy handle in xfer table for mid=%u", diff --git a/lib/multi_ev.c b/lib/multi_ev.c index 098f8da643af..086b037527a4 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -574,8 +574,7 @@ CURLMcode Curl_multi_ev_assign(struct Curl_multi *multi, } void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, - curl_socket_t s, - bool *run_cpool) + curl_socket_t s) { struct mev_sh_entry *entry; @@ -606,7 +605,7 @@ void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, } if(entry->conn) - *run_cpool = TRUE; + Curl_multi_mark_dirty(multi->admin); } } diff --git a/lib/multi_ev.h b/lib/multi_ev.h index 20c1aeac81a6..34548c323232 100644 --- a/lib/multi_ev.h +++ b/lib/multi_ev.h @@ -63,8 +63,7 @@ CURLMcode Curl_multi_ev_assess_conn(struct Curl_multi *multi, /* Mark all transfers tied to the given socket as dirty */ void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, - curl_socket_t s, - bool *run_cpool); + curl_socket_t s); /* Socket will be closed, forget anything we know about it. */ void Curl_multi_ev_socket_done(struct Curl_multi *multi, From 7e5f379d71b60f35f2a6b24e4bd5cf1935400c13 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 10:24:14 +0100 Subject: [PATCH 530/885] bufq: use uint8_t instead of unsigned char Closes #19690 --- lib/bufq.c | 30 +++++++++++++++--------------- lib/bufq.h | 16 ++++++++-------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/bufq.c b/lib/bufq.c index e429ccf8e375..d38b78c6d5b2 100644 --- a/lib/bufq.c +++ b/lib/bufq.c @@ -51,9 +51,9 @@ static void chunk_reset(struct buf_chunk *chunk) } static size_t chunk_append(struct buf_chunk *chunk, - const unsigned char *buf, size_t len) + const uint8_t *buf, size_t len) { - unsigned char *p = &chunk->x.data[chunk->w_offset]; + uint8_t *p = &chunk->x.data[chunk->w_offset]; size_t n = chunk->dlen - chunk->w_offset; DEBUGASSERT(chunk->dlen >= chunk->w_offset); if(n) { @@ -65,9 +65,9 @@ static size_t chunk_append(struct buf_chunk *chunk, } static size_t chunk_read(struct buf_chunk *chunk, - unsigned char *buf, size_t len) + uint8_t *buf, size_t len) { - unsigned char *p = &chunk->x.data[chunk->r_offset]; + uint8_t *p = &chunk->x.data[chunk->r_offset]; size_t n = chunk->w_offset - chunk->r_offset; DEBUGASSERT(chunk->w_offset >= chunk->r_offset); if(!n) { @@ -89,7 +89,7 @@ static CURLcode chunk_slurpn(struct buf_chunk *chunk, size_t max_len, Curl_bufq_reader *reader, void *reader_ctx, size_t *pnread) { - unsigned char *p = &chunk->x.data[chunk->w_offset]; + uint8_t *p = &chunk->x.data[chunk->w_offset]; size_t n = chunk->dlen - chunk->w_offset; /* free amount */ CURLcode result; @@ -108,7 +108,7 @@ static CURLcode chunk_slurpn(struct buf_chunk *chunk, size_t max_len, } static void chunk_peek(const struct buf_chunk *chunk, - const unsigned char **pbuf, size_t *plen) + const uint8_t **pbuf, size_t *plen) { DEBUGASSERT(chunk->w_offset >= chunk->r_offset); *pbuf = &chunk->x.data[chunk->r_offset]; @@ -116,7 +116,7 @@ static void chunk_peek(const struct buf_chunk *chunk, } static void chunk_peek_at(const struct buf_chunk *chunk, size_t offset, - const unsigned char **pbuf, size_t *plen) + const uint8_t **pbuf, size_t *plen) { offset += chunk->r_offset; DEBUGASSERT(chunk->w_offset >= offset); @@ -370,7 +370,7 @@ static struct buf_chunk *get_non_full_tail(struct bufq *q) } CURLcode Curl_bufq_write(struct bufq *q, - const unsigned char *buf, size_t len, + const uint8_t *buf, size_t len, size_t *pnwritten) { struct buf_chunk *tail; @@ -400,10 +400,10 @@ CURLcode Curl_bufq_cwrite(struct bufq *q, const char *buf, size_t len, size_t *pnwritten) { - return Curl_bufq_write(q, (const unsigned char *)buf, len, pnwritten); + return Curl_bufq_write(q, (const uint8_t *)buf, len, pnwritten); } -CURLcode Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len, +CURLcode Curl_bufq_read(struct bufq *q, uint8_t *buf, size_t len, size_t *pnread) { *pnread = 0; @@ -422,11 +422,11 @@ CURLcode Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len, CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len, size_t *pnread) { - return Curl_bufq_read(q, (unsigned char *)buf, len, pnread); + return Curl_bufq_read(q, (uint8_t *)buf, len, pnread); } bool Curl_bufq_peek(struct bufq *q, - const unsigned char **pbuf, size_t *plen) + const uint8_t **pbuf, size_t *plen) { if(q->head && chunk_is_empty(q->head)) { prune_head(q); @@ -441,7 +441,7 @@ bool Curl_bufq_peek(struct bufq *q, } bool Curl_bufq_peek_at(struct bufq *q, size_t offset, - const unsigned char **pbuf, size_t *plen) + const uint8_t **pbuf, size_t *plen) { struct buf_chunk *c = q->head; size_t clen; @@ -477,7 +477,7 @@ void Curl_bufq_skip(struct bufq *q, size_t amount) CURLcode Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer, void *writer_ctx, size_t *pwritten) { - const unsigned char *buf; + const uint8_t *buf; size_t blen; CURLcode result = CURLE_OK; @@ -507,7 +507,7 @@ CURLcode Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer, } CURLcode Curl_bufq_write_pass(struct bufq *q, - const unsigned char *buf, size_t len, + const uint8_t *buf, size_t len, Curl_bufq_writer *writer, void *writer_ctx, size_t *pwritten) { diff --git a/lib/bufq.h b/lib/bufq.h index ad8e6435fae1..9557e5d33bba 100644 --- a/lib/bufq.h +++ b/lib/bufq.h @@ -38,7 +38,7 @@ struct buf_chunk { size_t r_offset; /* first unread bytes */ size_t w_offset; /* one after last written byte */ union { - unsigned char data[1]; /* the buffer for `dlen` bytes */ + uint8_t data[1]; /* the buffer for `dlen` bytes */ void *dummy; /* alignment */ } x; }; @@ -166,7 +166,7 @@ bool Curl_bufq_is_full(const struct bufq *q); * CURLE_AGAIN is returned if the buffer queue is full. */ CURLcode Curl_bufq_write(struct bufq *q, - const unsigned char *buf, size_t len, + const uint8_t *buf, size_t len, size_t *pnwritten); CURLcode Curl_bufq_cwrite(struct bufq *q, @@ -177,7 +177,7 @@ CURLcode Curl_bufq_cwrite(struct bufq *q, * Read buf from the start of the buffer queue. The buf is copied * and the amount of copied bytes is returned. */ -CURLcode Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len, +CURLcode Curl_bufq_read(struct bufq *q, uint8_t *buf, size_t len, size_t *pnread); CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len, @@ -193,10 +193,10 @@ CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len, * is modified, see `Curl_bufq_skip()`` */ bool Curl_bufq_peek(struct bufq *q, - const unsigned char **pbuf, size_t *plen); + const uint8_t **pbuf, size_t *plen); bool Curl_bufq_peek_at(struct bufq *q, size_t offset, - const unsigned char **pbuf, size_t *plen); + const uint8_t **pbuf, size_t *plen); /** * Tell the buffer queue to discard `amount` buf bytes at the head @@ -206,7 +206,7 @@ bool Curl_bufq_peek_at(struct bufq *q, size_t offset, void Curl_bufq_skip(struct bufq *q, size_t amount); typedef CURLcode Curl_bufq_writer(void *writer_ctx, - const unsigned char *buf, size_t len, + const uint8_t *buf, size_t len, size_t *pwritten); /** * Passes the chunks in the buffer queue to the writer and returns @@ -221,7 +221,7 @@ CURLcode Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer, void *writer_ctx, size_t *pwritten); typedef CURLcode Curl_bufq_reader(void *reader_ctx, - unsigned char *buf, size_t len, + uint8_t *buf, size_t len, size_t *pnread); /** @@ -253,7 +253,7 @@ CURLcode Curl_bufq_sipn(struct bufq *q, size_t max_len, * amount buffered, chunk size, etc. */ CURLcode Curl_bufq_write_pass(struct bufq *q, - const unsigned char *buf, size_t len, + const uint8_t *buf, size_t len, Curl_bufq_writer *writer, void *writer_ctx, size_t *pwritten); From 0f6ad5ab7d040bf1b9dcc16d12430209079378a6 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 13:03:04 +0100 Subject: [PATCH 531/885] ngtcp2: use stdint types Use int64_t and uint64_t directly without needing to cast to curl_int64_t and curl_uint64_t. Closes #19696 --- lib/vquic/curl_ngtcp2.c | 138 ++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 75 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index f63162b34417..d6439287846e 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -215,10 +215,10 @@ static void cf_ngtcp2_setup_keep_alive(struct Curl_cfilter *cf, ngtcp2_duration keep_ns; keep_ns = (rp->max_idle_timeout > 1) ? (rp->max_idle_timeout / 2) : 1; ngtcp2_conn_set_keep_alive_timeout(ctx->qconn, keep_ns); - CURL_TRC_CF(data, cf, "peer idle timeout is %" FMT_PRIu64 "ms, " - "set keep-alive to %" FMT_PRIu64 " ms.", - (curl_uint64_t)(rp->max_idle_timeout / NGTCP2_MILLISECONDS), - (curl_uint64_t)(keep_ns / NGTCP2_MILLISECONDS)); + CURL_TRC_CF(data, cf, "peer idle timeout is %" PRIu64 "ms, " + "set keep-alive to %" PRIu64 " ms.", + (rp->max_idle_timeout / NGTCP2_MILLISECONDS), + (keep_ns / NGTCP2_MILLISECONDS)); } } @@ -235,11 +235,11 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, * All about the H3 internals of a stream */ struct h3_stream_ctx { - curl_int64_t id; /* HTTP/3 protocol identifier */ + int64_t id; /* HTTP/3 protocol identifier */ struct bufq sendbuf; /* h3 request body */ struct h1_req_parser h1; /* h1 request parsing */ size_t sendbuf_len_in_flight; /* sendbuf amount "in flight" */ - curl_uint64_t error3; /* HTTP/3 stream error code */ + uint64_t error3; /* HTTP/3 stream error code */ curl_off_t upload_left; /* number of request bytes left to upload */ uint64_t download_unacked; /* bytes not acknowledged yet */ int status_code; /* HTTP status code */ @@ -301,7 +301,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, #if NGTCP2_VERSION_NUM < 0x011100 struct cf_ngtcp2_sfind_ctx { - curl_int64_t stream_id; + int64_t stream_id; struct h3_stream_ctx *stream; unsigned int mid; }; @@ -320,7 +320,7 @@ static bool cf_ngtcp2_sfind(unsigned int mid, void *value, void *user_data) } static struct h3_stream_ctx * -cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, curl_int64_t stream_id) +cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, int64_t stream_id) { struct cf_ngtcp2_sfind_ctx fctx; fctx.stream_id = stream_id; @@ -330,7 +330,7 @@ cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, curl_int64_t stream_id) } #else static struct h3_stream_ctx *cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, - curl_int64_t stream_id) + int64_t stream_id) { struct Curl_easy *data = ngtcp2_conn_get_stream_user_data(ctx->qconn, stream_id); @@ -360,7 +360,7 @@ static void cf_ngtcp2_stream_close(struct Curl_cfilter *cf, NGHTTP3_H3_REQUEST_CANCELLED); result = cf_progress_egress(cf, data, NULL); if(result) - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cancel stream -> %d", + CURL_TRC_CF(data, cf, "[%" PRId64 "] cancel stream -> %d", stream->id, result); } } @@ -371,7 +371,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)cf; if(stream) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] easy handle is done", + CURL_TRC_CF(data, cf, "[%" PRId64 "] easy handle is done", stream->id); cf_ngtcp2_stream_close(cf, data, stream); Curl_uint_hash_remove(&ctx->streams, data->mid); @@ -518,12 +518,11 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data) const ngtcp2_transport_params *rp; rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn); CURL_TRC_CF(data, cf, "handshake complete after %" FMT_TIMEDIFF_T - "ms, remote transport[max_udp_payload=%" FMT_PRIu64 - ", initial_max_data=%" FMT_PRIu64 + "ms, remote transport[max_udp_payload=%" PRIu64 + ", initial_max_data=%" PRIu64 "]", curlx_timediff_ms(ctx->handshake_at, ctx->started_at), - (curl_uint64_t)rp->max_udp_payload_size, - (curl_uint64_t)rp->initial_max_data); + rp->max_udp_payload_size, rp->initial_max_data); } #endif @@ -607,13 +606,12 @@ static void cf_ngtcp2_h3_err_set(struct Curl_cfilter *cf, } static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags, - int64_t sid, uint64_t offset, + int64_t stream_id, uint64_t offset, const uint8_t *buf, size_t buflen, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; - curl_int64_t stream_id = (curl_int64_t)sid; nghttp3_ssize nconsumed; int fin = (flags & NGTCP2_STREAM_DATA_FLAG_FIN) ? 1 : 0; struct Curl_easy *data = stream_user_data; @@ -625,12 +623,12 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags, if(!data) data = CF_DATA_CURRENT(cf); if(data) - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read_stream(len=%zu) -> %zd", + CURL_TRC_CF(data, cf, "[%" PRId64 "] read_stream(len=%zu) -> %zd", stream_id, buflen, nconsumed); if(nconsumed < 0) { struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(data && stream) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] error on known stream, " + CURL_TRC_CF(data, cf, "[%" PRId64 "] error on known stream, " "reset=%d, closed=%d", stream_id, stream->reset, stream->closed); } @@ -669,13 +667,12 @@ cb_acked_stream_data_offset(ngtcp2_conn *tconn, int64_t stream_id, } static int cb_stream_close(ngtcp2_conn *tconn, uint32_t flags, - int64_t sid, uint64_t app_error_code, + int64_t stream_id, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - curl_int64_t stream_id = (curl_int64_t)sid; int rv; (void)tconn; @@ -690,9 +687,8 @@ static int cb_stream_close(ngtcp2_conn *tconn, uint32_t flags, } rv = nghttp3_conn_close_stream(ctx->h3conn, stream_id, app_error_code); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] quic close(app_error=%" - FMT_PRIu64 ") -> %d", stream_id, (curl_uint64_t)app_error_code, - rv); + CURL_TRC_CF(data, cf, "[%" PRId64 "] quic close(app_error=%" + PRIu64 ") -> %d", stream_id, app_error_code, rv); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { cf_ngtcp2_h3_err_set(cf, data, rv); return NGTCP2_ERR_CALLBACK_FAILURE; @@ -701,13 +697,12 @@ static int cb_stream_close(ngtcp2_conn *tconn, uint32_t flags, return 0; } -static int cb_stream_reset(ngtcp2_conn *tconn, int64_t sid, +static int cb_stream_reset(ngtcp2_conn *tconn, int64_t stream_id, uint64_t final_size, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; - curl_int64_t stream_id = (curl_int64_t)sid; struct Curl_easy *data = stream_user_data; int rv; (void)tconn; @@ -716,7 +711,7 @@ static int cb_stream_reset(ngtcp2_conn *tconn, int64_t sid, (void)data; rv = nghttp3_conn_shutdown_stream_read(ctx->h3conn, stream_id); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); + CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { return NGTCP2_ERR_CALLBACK_FAILURE; } @@ -754,9 +749,8 @@ static int cb_extend_max_local_streams_bidi(ngtcp2_conn *tconn, (void)tconn; ctx->max_bidi_streams = max_streams; if(data) - CURL_TRC_CF(data, cf, "max bidi streams now %" FMT_PRIu64 - ", used %" FMT_PRIu64, (curl_uint64_t)ctx->max_bidi_streams, - (curl_uint64_t)ctx->used_bidi_streams); + CURL_TRC_CF(data, cf, "max bidi streams now %" PRIu64 ", used %" PRIu64, + ctx->max_bidi_streams, ctx->used_bidi_streams); return 0; } @@ -778,8 +772,7 @@ static int cb_extend_max_stream_data(ngtcp2_conn *tconn, int64_t stream_id, } stream = H3_STREAM_CTX(ctx, s_data); if(stream && stream->quic_flow_blocked) { - CURL_TRC_CF(s_data, cf, "[%" FMT_PRId64 "] unblock quic flow", - (curl_int64_t)stream_id); + CURL_TRC_CF(s_data, cf, "[%" PRId64 "] unblock quic flow", stream_id); stream->quic_flow_blocked = FALSE; Curl_multi_mark_dirty(s_data); } @@ -986,14 +979,13 @@ static CURLcode cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, return result; } -static int cb_h3_stream_close(nghttp3_conn *conn, int64_t sid, +static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - curl_int64_t stream_id = (curl_int64_t)sid; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)stream_id; @@ -1003,15 +995,15 @@ static int cb_h3_stream_close(nghttp3_conn *conn, int64_t sid, return 0; stream->closed = TRUE; - stream->error3 = (curl_uint64_t)app_error_code; + stream->error3 = app_error_code; if(stream->error3 != NGHTTP3_H3_NO_ERROR) { stream->reset = TRUE; stream->send_closed = TRUE; - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] RESET: error %" FMT_PRIu64, + CURL_TRC_CF(data, cf, "[%" PRId64 "] RESET: error %" PRIu64, stream->id, stream->error3); } else { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] CLOSED", stream->id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] CLOSED", stream->id); } Curl_multi_mark_dirty(data); return 0; @@ -1031,7 +1023,7 @@ static void h3_xfer_write_resp_hd(struct Curl_cfilter *cf, if(!stream->xfer_result) { stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos); if(stream->xfer_result) - CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] error %d writing %zu " + CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu " "bytes of headers", stream->id, stream->xfer_result, blen); } } @@ -1051,8 +1043,8 @@ static void h3_xfer_write_resp(struct Curl_cfilter *cf, stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos); /* If the transfer write is errored, we do not want any more data */ if(stream->xfer_result) { - CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] error %d writing %zu bytes " - "of data", stream->id, stream->xfer_result, blen); + CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu bytes of data", + stream->id, stream->xfer_result, blen); } } } @@ -1078,7 +1070,7 @@ static void cf_ngtcp2_ack_stream(struct Curl_cfilter *cf, } if(ack_len) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] ACK %" PRIu64 + CURL_TRC_CF(data, cf, "[%" PRId64 "] ACK %" PRIu64 "/%" PRIu64 " bytes of DATA", stream->id, ack_len, stream->download_unacked); ngtcp2_conn_extend_max_stream_offset(ctx->qconn, stream->id, ack_len); @@ -1102,7 +1094,7 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, return NGHTTP3_ERR_CALLBACK_FAILURE; h3_xfer_write_resp(cf, data, stream, (const char *)buf, blen, FALSE); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu", stream->id, blen); + CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu", stream->id, blen); ngtcp2_conn_extend_max_offset(ctx->qconn, blen); if(UINT64_MAX - blen < stream->download_unacked) @@ -1130,13 +1122,12 @@ static int cb_h3_deferred_consume(nghttp3_conn *conn, int64_t stream3_id, return 0; } -static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, +static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, int fin, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - curl_int64_t stream_id = (curl_int64_t)sid; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)stream_id; @@ -1148,7 +1139,7 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, /* add a CRLF only if we have received some headers */ h3_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), stream->closed); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] end_headers, status=%d", + CURL_TRC_CF(data, cf, "[%" PRId64 "] end_headers, status=%d", stream_id, stream->status_code); if(stream->status_code / 100 != 1) { stream->resp_hds_complete = TRUE; @@ -1157,14 +1148,13 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, return 0; } -static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, +static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, int32_t token, nghttp3_rcbuf *name, nghttp3_rcbuf *value, uint8_t flags, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; - curl_int64_t stream_id = (curl_int64_t)sid; nghttp3_vec h3name = nghttp3_rcbuf_get_buf(name); nghttp3_vec h3val = nghttp3_rcbuf_get_buf(value); struct Curl_easy *data = stream_user_data; @@ -1196,7 +1186,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, if(!result) h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch), curlx_dyn_len(&ctx->scratch), FALSE); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] status: %s", + CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s", stream_id, curlx_dyn_ptr(&ctx->scratch)); if(result) { return NGHTTP3_ERR_CALLBACK_FAILURE; @@ -1204,7 +1194,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, } else { /* store as an HTTP1-style header */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] header: %.*s: %.*s", + CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s", stream_id, (int)h3name.len, h3name.base, (int)h3val.len, h3val.base); curlx_dyn_reset(&ctx->scratch); @@ -1243,13 +1233,12 @@ static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id, return 0; } -static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t sid, +static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; - curl_int64_t stream_id = (curl_int64_t)sid; struct Curl_easy *data = stream_user_data; int rv; (void)conn; @@ -1257,7 +1246,7 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t sid, rv = ngtcp2_conn_shutdown_stream_write(ctx->qconn, 0, stream_id, app_error_code); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); + CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv); if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) { return NGHTTP3_ERR_CALLBACK_FAILURE; } @@ -1359,12 +1348,12 @@ static CURLcode recv_closed_stream(struct Curl_cfilter *cf, (void)cf; *pnread = 0; if(stream->reset) { - failf(data, "HTTP/3 stream %" FMT_PRId64 " reset by server", stream->id); + failf(data, "HTTP/3 stream %" PRId64 " reset by server", stream->id); return data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; } else if(!stream->resp_hds_complete) { failf(data, - "HTTP/3 stream %" FMT_PRId64 " was closed cleanly, but before " + "HTTP/3 stream %" PRId64 " was closed cleanly, but before " "getting all response header fields, treated as error", stream->id); return CURLE_HTTP3; @@ -1413,7 +1402,7 @@ static CURLcode cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, } if(stream->xfer_result) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] xfer write failed", stream->id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] xfer write failed", stream->id); cf_ngtcp2_stream_close(cf, data, stream); result = stream->xfer_result; goto out; @@ -1428,7 +1417,7 @@ static CURLcode cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, result = Curl_1st_err(result, cf_progress_egress(cf, data, &pktx)); result = Curl_1st_err(result, check_and_set_expiry(cf, data, &pktx)); denied: - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(blen=%zu) -> %d, %zu", + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv(blen=%zu) -> %d, %zu", stream ? stream->id : -1, blen, result, *pnread); CF_DATA_RESTORE(cf, save); return result; @@ -1519,12 +1508,12 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, } else if(!nwritten) { /* Not EOF, and nothing to give, we signal WOULDBLOCK. */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> AGAIN", + CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> AGAIN", stream->id); return NGHTTP3_ERR_WOULDBLOCK; } - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> " + CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> " "%d vecs%s with %zu (buffered=%zu, left=%" FMT_OFF_T ")", stream->id, (int)nvecs, *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "", @@ -1605,7 +1594,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, result = CURLE_SEND_ERROR; goto out; } - stream->id = (curl_int64_t)sid; + stream->id = sid; ++ctx->used_bidi_streams; switch(data->state.httpreq) { @@ -1637,11 +1626,11 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, if(rc) { switch(rc) { case NGHTTP3_ERR_CONN_CLOSING: - CURL_TRC_CF(data, cf, "h3sid[%" FMT_PRId64 "] failed to send, " + CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send, " "connection is closing", stream->id); break; default: - CURL_TRC_CF(data, cf, "h3sid[%" FMT_PRId64 "] failed to send -> " + CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send -> " "%d (%s)", stream->id, rc, nghttp3_strerror(rc)); break; } @@ -1651,10 +1640,10 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, } if(Curl_trc_is_verbose(data)) { - infof(data, "[HTTP/3] [%" FMT_PRId64 "] OPENED stream for %s", + infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", stream->id, data->state.url); for(i = 0; i < nheader; ++i) { - infof(data, "[HTTP/3] [%" FMT_PRId64 "] [%.*s: %.*s]", stream->id, + infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->id, (int)nva[i].namelen, nva[i].name, (int)nva[i].valuelen, nva[i].value); } @@ -1708,7 +1697,7 @@ static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, stream = H3_STREAM_CTX(ctx, data); } else if(stream->xfer_result) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] xfer write failed", stream->id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] xfer write failed", stream->id); cf_ngtcp2_stream_close(cf, data, stream); result = stream->xfer_result; goto out; @@ -1720,13 +1709,13 @@ static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, * body. This happens on 30x or 40x responses. * We silently discard the data sent, since this is not a transport * error situation. */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] discarding data" + CURL_TRC_CF(data, cf, "[%" PRId64 "] discarding data" "on closed stream with response", stream->id); result = CURLE_OK; *pnwritten = len; goto out; } - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " "-> stream closed", stream->id, len); result = CURLE_HTTP3; goto out; @@ -1738,7 +1727,7 @@ static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, } else { result = Curl_bufq_write(&stream->sendbuf, buf, len, pnwritten); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send, add to " + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send, add to " "sendbuf(len=%zu) -> %d, %zu", stream->id, len, result, *pnwritten); if(result) @@ -1755,7 +1744,7 @@ static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, out: result = Curl_1st_err(result, check_and_set_expiry(cf, data, &pktx)); denied: - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %d, %zu", + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu) -> %d, %zu", stream ? stream->id : -1, len, result, *pnwritten); CF_DATA_RESTORE(cf, save); return result; @@ -1886,8 +1875,8 @@ static CURLcode read_pkt_to_send(void *userp, struct h3_stream_ctx *stream; DEBUGASSERT(ndatalen == -1); nghttp3_conn_block_stream(ctx->h3conn, stream_id); - CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRId64 "] block quic flow", - (curl_int64_t)stream_id); + CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] block quic flow", + stream_id); stream = cf_ngtcp2_get_stream(ctx, stream_id); if(stream) /* it might be not one of our h3 streams? */ stream->quic_flow_blocked = TRUE; @@ -2171,8 +2160,8 @@ static CURLcode cf_ngtcp2_shutdown(struct Curl_cfilter *cf, (uint8_t *)buffer, sizeof(buffer), &ctx->last_error, pktx.ts); CURL_TRC_CF(data, cf, "start shutdown(err_type=%d, err_code=%" - FMT_PRIu64 ") -> %d", ctx->last_error.type, - (curl_uint64_t)ctx->last_error.error_code, (int)nwritten); + PRIu64 ") -> %d", ctx->last_error.type, + ctx->last_error.error_code, (int)nwritten); /* there are cases listed in ngtcp2 documentation where this call * may fail. Since we are doing a connection shutdown as graceful * as we can, such an error is ignored here. */ @@ -2670,9 +2659,8 @@ static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf, result = CURLE_COULDNT_CONNECT; if(cerr) { - CURL_TRC_CF(data, cf, "connect error, type=%d, code=%" - FMT_PRIu64, - cerr->type, (curl_uint64_t)cerr->error_code); + CURL_TRC_CF(data, cf, "connect error, type=%d, code=%" PRIu64, + cerr->type, cerr->error_code); switch(cerr->type) { case NGTCP2_CCERR_TYPE_VERSION_NEGOTIATION: CURL_TRC_CF(data, cf, "error in version negotiation"); From ef4f791337cd13da7dd39e1867e7b038ee98f3a5 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 13:21:25 +0100 Subject: [PATCH 532/885] quiche: use stdint types Use int64_t and uint64_t directly without needing to cast to curl_int64_t and curl_uint64_t. Closes #19697 --- lib/vquic/curl_quiche.c | 120 +++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 62 deletions(-) diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 4fc25acad038..51cadd2e6ead 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -171,10 +171,10 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, * All about the H3 internals of a stream */ struct h3_stream_ctx { - curl_uint64_t id; /* HTTP/3 protocol stream identifier */ + uint64_t id; /* HTTP/3 protocol stream identifier */ struct bufq recvbuf; /* h3 response */ struct h1_req_parser h1; /* h1 request parsing */ - curl_uint64_t error3; /* HTTP/3 stream error code */ + uint64_t error3; /* HTTP/3 stream error code */ BIT(opened); /* TRUE after stream has been opened */ BIT(closed); /* TRUE on stream close */ BIT(reset); /* TRUE on stream reset */ @@ -243,7 +243,7 @@ static bool cf_quiche_do_resume(struct Curl_cfilter *cf, if(stream->quic_flow_blocked) { stream->quic_flow_blocked = FALSE; Curl_multi_mark_dirty(sdata); - CURL_TRC_CF(sdata, cf, "[%"FMT_PRIu64"] unblock", stream->id); + CURL_TRC_CF(sdata, cf, "[%" PRIu64 "] unblock", stream->id); } return TRUE; } @@ -294,7 +294,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) (void)cf; if(stream) { - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] easy handle is done", stream->id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] easy handle is done", stream->id); if(ctx->qconn && !stream->closed) { quiche_conn_stream_shutdown(ctx->qconn, stream->id, QUICHE_SHUTDOWN_READ, CURL_H3_NO_ERROR); @@ -368,7 +368,7 @@ static int cb_each_header(uint8_t *name, size_t name_len, return CURLE_OK; if((name_len == 7) && !strncmp(HTTP_PSEUDO_STATUS, (char *)name, 7)) { - CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRIu64 "] status: %.*s", + CURL_TRC_CF(x->data, x->cf, "[%" PRIu64 "] status: %.*s", stream->id, (int)value_len, value); result = write_resp_raw(x->cf, x->data, "HTTP/3 ", sizeof("HTTP/3 ") - 1); if(!result) @@ -377,7 +377,7 @@ static int cb_each_header(uint8_t *name, size_t name_len, result = write_resp_raw(x->cf, x->data, " \r\n", 3); } else { - CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRIu64 "] header: %.*s: %.*s", + CURL_TRC_CF(x->data, x->cf, "[%" PRIu64 "] header: %.*s: %.*s", stream->id, (int)name_len, name, (int)value_len, value); result = write_resp_raw(x->cf, x->data, name, name_len); @@ -389,7 +389,7 @@ static int cb_each_header(uint8_t *name, size_t name_len, result = write_resp_raw(x->cf, x->data, "\r\n", 2); } if(result) { - CURL_TRC_CF(x->data, x->cf, "[%"FMT_PRIu64"] on header error %d", + CURL_TRC_CF(x->data, x->cf, "[%" PRIu64 "] on header error %d", stream->id, result); } return result; @@ -439,9 +439,9 @@ static CURLcode cf_recv_body(struct Curl_cfilter *cf, stream_resp_read, &cb_ctx, &nread); if(result && result != CURLE_AGAIN) { - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] recv_body error %zu", + CURL_TRC_CF(data, cf, "[%" PRIu64 "] recv_body error %zu", stream->id, nread); - failf(data, "Error %d in HTTP/3 response body for stream[%"FMT_PRIu64"]", + failf(data, "Error %d in HTTP/3 response body for stream[%" PRIu64 "]", result, stream->id); stream->closed = TRUE; stream->reset = TRUE; @@ -492,11 +492,11 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, cb_ctx.data = data; rc = quiche_h3_event_for_each_header(ev, cb_each_header, &cb_ctx); if(rc) { - failf(data, "Error %d in HTTP/3 response header for stream[%" - FMT_PRIu64"]", rc, stream->id); + failf(data, "Error %d in HTTP/3 response header for stream[%" PRIu64 "]", + rc, stream->id); return CURLE_RECV_ERROR; } - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] <- [HEADERS]", stream->id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] <- [HEADERS]", stream->id); break; case QUICHE_H3_EVENT_DATA: @@ -506,7 +506,7 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, break; case QUICHE_H3_EVENT_RESET: - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] RESET", stream->id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] RESET", stream->id); stream->closed = TRUE; stream->reset = TRUE; stream->send_closed = TRUE; @@ -514,7 +514,7 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, break; case QUICHE_H3_EVENT_FINISHED: - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] CLOSED", stream->id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] CLOSED", stream->id); if(!stream->resp_hds_complete) { result = write_resp_raw(cf, data, "\r\n", 2); if(result) @@ -526,11 +526,11 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, break; case QUICHE_H3_EVENT_GOAWAY: - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] <- [GOAWAY]", stream->id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] <- [GOAWAY]", stream->id); break; default: - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] recv, unhandled event %d", + CURL_TRC_CF(data, cf, "[%" PRIu64 "] recv, unhandled event %d", stream->id, quiche_h3_event_type(ev)); break; } @@ -545,14 +545,13 @@ static CURLcode cf_quiche_ev_process(struct Curl_cfilter *cf, CURLcode result = h3_process_event(cf, data, stream, ev); Curl_multi_mark_dirty(data); if(result) - CURL_TRC_CF(data, cf, "error processing event %s " - "for [%"FMT_PRIu64"] -> %d", cf_ev_name(ev), - stream->id, result); + CURL_TRC_CF(data, cf, "error processing event %s for [%" PRIu64 "] -> %d", + cf_ev_name(ev), stream->id, result); return result; } struct cf_quich_disp_ctx { - curl_uint64_t stream_id; + uint64_t stream_id; struct Curl_cfilter *cf; struct Curl_multi *multi; quiche_h3_event *ev; @@ -582,17 +581,17 @@ static CURLcode cf_poll_events(struct Curl_cfilter *cf, /* Take in the events and distribute them to the transfers. */ while(ctx->h3c) { - curl_int64_t stream3_id = quiche_h3_conn_poll(ctx->h3c, ctx->qconn, &ev); - if(stream3_id == QUICHE_H3_ERR_DONE) { + int64_t rv = quiche_h3_conn_poll(ctx->h3c, ctx->qconn, &ev); + if(rv == QUICHE_H3_ERR_DONE) { break; } - else if(stream3_id < 0) { - CURL_TRC_CF(data, cf, "error poll: %"FMT_PRId64, stream3_id); + else if(rv < 0) { + CURL_TRC_CF(data, cf, "error poll: %" PRId64, rv); return CURLE_HTTP3; } else { struct cf_quich_disp_ctx dctx; - dctx.stream_id = (curl_uint64_t)stream3_id; + dctx.stream_id = (uint64_t)rv; dctx.cf = cf; dctx.multi = data->multi; dctx.ev = ev; @@ -750,8 +749,8 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, struct cf_quiche_ctx *ctx = cf->ctx; size_t nread; CURLcode result; - curl_int64_t expiry_ns; - curl_int64_t timeout_ns; + int64_t expiry_ns; + int64_t timeout_ns; struct read_ctx readx; size_t pkt_count, gsolen; @@ -837,15 +836,13 @@ static CURLcode recv_closed_stream(struct Curl_cfilter *cf, DEBUGASSERT(stream); *pnread = 0; if(stream->reset) { - failf(data, - "HTTP/3 stream %" FMT_PRIu64 " reset by server", stream->id); + failf(data, "HTTP/3 stream %" PRIu64 " reset by server", stream->id); result = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_recv, was reset -> %d", + CURL_TRC_CF(data, cf, "[%" PRIu64 "] cf_recv, was reset -> %d", stream->id, result); } else if(!stream->resp_got_header) { - failf(data, - "HTTP/3 stream %" FMT_PRIu64 " was closed cleanly, but before " + failf(data, "HTTP/3 stream %" PRIu64 " was closed cleanly, but before " "getting all response header fields, treated as error", stream->id); result = CURLE_HTTP3; @@ -868,7 +865,7 @@ static CURLcode cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(!Curl_bufq_is_empty(&stream->recvbuf)) { result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] read recvbuf(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRIu64 "] read recvbuf(len=%zu) " "-> %d, %zu", stream->id, len, result, *pnread); if(result) goto out; @@ -883,7 +880,7 @@ static CURLcode cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, /* recvbuf had nothing before, maybe after progressing ingress? */ if(!*pnread && !Curl_bufq_is_empty(&stream->recvbuf)) { result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] read recvbuf(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRIu64 "] read recvbuf(len=%zu) " "-> %d, %zu", stream->id, len, result, *pnread); if(result) goto out; @@ -908,7 +905,7 @@ static CURLcode cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, result = Curl_1st_err(result, cf_flush_egress(cf, data)); if(*pnread > 0) ctx->data_recvd += *pnread; - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] cf_recv(total=%" + CURL_TRC_CF(data, cf, "[%" PRIu64 "] cf_recv(total=%" FMT_OFF_T ") -> %d, %zu", stream->id, ctx->data_recvd, result, *pnread); return result; @@ -930,32 +927,31 @@ static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf, /* Blocked on flow control and should HOLD sending. But when do we open * again? */ if(!quiche_conn_stream_writable(ctx->qconn, stream->id, len)) { - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRIu64 "] send_body(len=%zu) " "-> window exhausted", stream->id, len); stream->quic_flow_blocked = TRUE; } return CURLE_AGAIN; } else if(rv == QUICHE_H3_TRANSPORT_ERR_INVALID_STREAM_STATE) { - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRIu64 "] send_body(len=%zu) " "-> invalid stream state", stream->id, len); return CURLE_HTTP3; } else if(rv == QUICHE_H3_TRANSPORT_ERR_FINAL_SIZE) { - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " - "-> exceeds size", stream->id, len); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] send_body(len=%zu) -> exceeds size", + stream->id, len); return CURLE_SEND_ERROR; } else if(!curlx_sztouz(rv, pnwritten)) { - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " - "-> quiche err %zd", stream->id, len, rv); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] send_body(len=%zu) -> quiche err %zd", + stream->id, len, rv); return CURLE_SEND_ERROR; } else { if(eos && (len == *pnwritten)) stream->send_closed = TRUE; - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send body(len=%zu, " - "eos=%d) -> %zu", + CURL_TRC_CF(data, cf, "[%" PRIu64 "] send body(len=%zu, eos=%d) -> %zu", stream->id, len, stream->send_closed, *pnwritten); return CURLE_OK; } @@ -969,7 +965,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, struct cf_quiche_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); size_t nheader, i; - curl_int64_t stream3_id; + int64_t rv; struct dynhds h2_headers; quiche_h3_header *nva = NULL; CURLcode result = CURLE_OK; @@ -1027,37 +1023,37 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, if(eos && !blen) stream->send_closed = TRUE; - stream3_id = quiche_h3_send_request(ctx->h3c, ctx->qconn, nva, nheader, - stream->send_closed); - CURL_TRC_CF(data, cf, "quiche_send_request() -> %" FMT_PRIu64, stream3_id); - if(stream3_id < 0) { - if(QUICHE_H3_ERR_STREAM_BLOCKED == stream3_id) { + rv = quiche_h3_send_request(ctx->h3c, ctx->qconn, nva, nheader, + stream->send_closed); + CURL_TRC_CF(data, cf, "quiche_send_request() -> %" PRId64, rv); + if(rv < 0) { + if(QUICHE_H3_ERR_STREAM_BLOCKED == rv) { /* quiche seems to report this error if the connection window is * exhausted. Which happens frequently and intermittent. */ - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] blocked", stream->id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] blocked", stream->id); stream->quic_flow_blocked = TRUE; result = CURLE_AGAIN; goto out; } else { - CURL_TRC_CF(data, cf, "send_request(%s) -> %" FMT_PRIu64, - data->state.url, stream3_id); + CURL_TRC_CF(data, cf, "send_request(%s) -> %" PRId64, + data->state.url, rv); } result = CURLE_SEND_ERROR; goto out; } DEBUGASSERT(!stream->opened); - stream->id = stream3_id; + stream->id = (uint64_t)rv; stream->opened = TRUE; stream->closed = FALSE; stream->reset = FALSE; if(Curl_trc_is_verbose(data)) { - infof(data, "[HTTP/3] [%" FMT_PRIu64 "] OPENED stream for %s", + infof(data, "[HTTP/3] [%" PRIu64 "] OPENED stream for %s", stream->id, data->state.url); for(i = 0; i < nheader; ++i) { - infof(data, "[HTTP/3] [%" FMT_PRIu64 "] [%.*s: %.*s]", stream->id, + infof(data, "[HTTP/3] [%" PRIu64 "] [%.*s: %.*s]", stream->id, (int)nva[i].name_len, nva[i].name, (int)nva[i].value_len, nva[i].value); } @@ -1113,13 +1109,13 @@ static CURLcode cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data, * sending the 30x response. * This is sort of a race: had the transfer loop called recv first, * it would see the response and stop/discard sending on its own- */ - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] discarding data" + CURL_TRC_CF(data, cf, "[%" PRIu64 "] discarding data" "on closed stream with response", stream->id); result = CURLE_OK; *pnwritten = len; goto out; } - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRIu64 "] send_body(len=%zu) " "-> stream closed", stream->id, len); result = CURLE_HTTP3; goto out; @@ -1131,8 +1127,8 @@ static CURLcode cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data, out: result = Curl_1st_err(result, cf_flush_egress(cf, data)); - CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_send(len=%zu) -> %d, %zu", - stream ? stream->id : (curl_uint64_t)~0, len, + CURL_TRC_CF(data, cf, "[%" PRIu64 "] cf_send(len=%zu) -> %d, %zu", + stream ? stream->id : (uint64_t)~0, len, result, *pnwritten); return result; } @@ -1144,7 +1140,7 @@ static bool stream_is_writeable(struct Curl_cfilter *cf, struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); return stream && (quiche_conn_stream_writable( - ctx->qconn, (curl_uint64_t)stream->id, 1) > 0); + ctx->qconn, stream->id, 1) > 0); } static CURLcode cf_quiche_adjust_pollset(struct Curl_cfilter *cf, @@ -1229,7 +1225,7 @@ static CURLcode cf_quiche_cntrl(struct Curl_cfilter *cf, stream->send_closed = TRUE; body[0] = 'X'; result = cf_quiche_send(cf, data, body, 0, TRUE, &sent); - CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] DONE_SEND -> %d, %zu", + CURL_TRC_CF(data, cf, "[%" PRIu64 "] DONE_SEND -> %d, %zu", stream->id, result, sent); } break; @@ -1520,7 +1516,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf, switch(query) { case CF_QUERY_MAX_CONCURRENT: { - curl_uint64_t max_streams = CONN_ATTACHED(cf->conn); + uint64_t max_streams = CONN_ATTACHED(cf->conn); if(!ctx->goaway && ctx->qconn) { max_streams += quiche_conn_peer_streams_left_bidi(ctx->qconn); } From bb63518ba71c3d7bb58e6eb605bb0a5962d7835e Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 13:39:35 +0100 Subject: [PATCH 533/885] openssl-quic: use stdint types Use int64_t and uint64_t directly without needing to cast to curl_int64_t and curl_uint64_t. Closes #19698 --- lib/vquic/curl_osslq.c | 106 ++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index b890a8d9516d..9d0193d55440 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -207,7 +207,7 @@ static CURLcode make_bio_addr(BIO_ADDR **pbio_addr, /* QUIC stream (not necessarily H3) */ struct cf_osslq_stream { - curl_int64_t id; + int64_t id; SSL *ssl; struct bufq recvbuf; /* QUIC war data recv buffer */ BIT(recvd_eos); @@ -228,7 +228,7 @@ static CURLcode cf_osslq_stream_open(struct cf_osslq_stream *s, if(!s->ssl) { return CURLE_FAILED_INIT; } - s->id = (curl_int64_t)SSL_get_stream_id(s->ssl); + s->id = SSL_get_stream_id(s->ssl); SSL_set_app_data(s->ssl, user_data); return CURLE_OK; } @@ -450,7 +450,7 @@ static CURLcode cf_osslq_h3conn_add_stream(struct cf_osslq_h3conn *h3, struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; - curl_int64_t stream_id = (curl_int64_t)SSL_get_stream_id(stream_ssl); + int64_t stream_id = (int64_t)SSL_get_stream_id(stream_ssl); int stype = SSL_get_stream_type(stream_ssl); /* This could be a GREASE stream, e.g. HTTP/3 rfc9114 ch 6.2.3 * reserved stream type that is supposed to be discarded silently. @@ -461,7 +461,7 @@ static CURLcode cf_osslq_h3conn_add_stream(struct cf_osslq_h3conn *h3, struct cf_osslq_stream *nstream; if(h3->remote_ctrl_n >= CURL_ARRAYSIZE(h3->remote_ctrl)) { /* rejected, we are full */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reject remote uni stream", + CURL_TRC_CF(data, cf, "[%" PRId64 "] reject remote uni stream", stream_id); SSL_free(stream_ssl); return CURLE_OK; @@ -470,12 +470,12 @@ static CURLcode cf_osslq_h3conn_add_stream(struct cf_osslq_h3conn *h3, nstream->id = stream_id; nstream->ssl = stream_ssl; Curl_bufq_initp(&nstream->recvbuf, &ctx->stream_bufcp, 1, BUFQ_OPT_NONE); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] accepted remote uni stream", + CURL_TRC_CF(data, cf, "[%" PRId64 "] accepted remote uni stream", stream_id); return CURLE_OK; } default: - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reject remote %s" + CURL_TRC_CF(data, cf, "[%" PRId64 "] reject remote %s" " stream, type=%x", stream_id, (stype == SSL_STREAM_TYPE_BIDI) ? "bidi" : "write", stype); SSL_free(stream_ssl); @@ -579,7 +579,7 @@ struct h3_stream_ctx { struct h1_req_parser h1; /* h1 request parsing */ size_t sendbuf_len_in_flight; /* sendbuf amount "in flight" */ size_t recv_buf_nonflow; /* buffered bytes, not counting for flow control */ - curl_uint64_t error3; /* HTTP/3 stream error code */ + uint64_t error3; /* HTTP/3 stream error code */ curl_off_t upload_left; /* number of request bytes left to upload */ curl_off_t download_recvd; /* number of response DATA bytes received */ int status_code; /* HTTP status code */ @@ -649,7 +649,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) (void)cf; if(stream) { - CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] easy handle is done", + CURL_TRC_CF(data, cf, "[%" PRIu64 "] easy handle is done", stream->s.id); if(ctx->h3.conn && (stream->s.id >= 0) && !stream->closed) { nghttp3_conn_shutdown_stream_read(ctx->h3.conn, stream->s.id); @@ -664,7 +664,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) } struct cf_ossq_find_ctx { - curl_int64_t stream_id; + int64_t stream_id; struct h3_stream_ctx *stream; }; @@ -743,11 +743,11 @@ static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, if(stream->error3 != NGHTTP3_H3_NO_ERROR) { stream->reset = TRUE; stream->send_closed = TRUE; - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] RESET: error %" FMT_PRIu64, + CURL_TRC_CF(data, cf, "[%" PRId64 "] RESET: error %" PRIu64, stream->s.id, stream->error3); } else { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] CLOSED", stream->s.id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] CLOSED", stream->s.id); } Curl_multi_mark_dirty(data); return 0; @@ -806,12 +806,12 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, result = write_resp_raw(cf, data, buf, buflen, TRUE); if(result) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu, ERROR %d", + CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, ERROR %d", stream->s.id, buflen, result); return NGHTTP3_ERR_CALLBACK_FAILURE; } stream->download_recvd += (curl_off_t)buflen; - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu, total=%" FMT_OFF_T, + CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, total=%" FMT_OFF_T, stream->s.id, buflen, stream->download_recvd); Curl_multi_mark_dirty(data); return 0; @@ -829,18 +829,17 @@ static int cb_h3_deferred_consume(nghttp3_conn *conn, int64_t stream_id, (void)conn; (void)stream_id; if(stream) - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] deferred consume %zu bytes", + CURL_TRC_CF(data, cf, "[%" PRId64 "] deferred consume %zu bytes", stream->s.id, consumed); return 0; } -static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, +static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, int32_t token, nghttp3_rcbuf *name, nghttp3_rcbuf *value, uint8_t flags, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; - curl_int64_t stream_id = sid; struct cf_osslq_ctx *ctx = cf->ctx; nghttp3_vec h3name = nghttp3_rcbuf_get_buf(name); nghttp3_vec h3val = nghttp3_rcbuf_get_buf(value); @@ -867,7 +866,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, return -1; ncopy = curl_msnprintf(line, sizeof(line), "HTTP/3 %03d \r\n", stream->status_code); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] status: %s", stream_id, line); + CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s", stream_id, line); result = write_resp_raw(cf, data, line, ncopy, FALSE); if(result) { return -1; @@ -875,7 +874,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, } else { /* store as an HTTP1-style header */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] header: %.*s: %.*s", + CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s", stream_id, (int)h3name.len, h3name.base, (int)h3val.len, h3val.base); result = write_resp_raw(cf, data, h3name.base, h3name.len, FALSE); @@ -898,13 +897,12 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, return 0; } -static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, +static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, int fin, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - curl_int64_t stream_id = sid; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; (void)conn; @@ -920,7 +918,7 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, return -1; } - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] end_headers, status=%d", + CURL_TRC_CF(data, cf, "[%" PRId64 "] end_headers, status=%d", stream_id, stream->status_code); if(stream->status_code / 100 != 1) { stream->resp_hds_complete = TRUE; @@ -929,14 +927,13 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, return 0; } -static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t sid, +static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - curl_int64_t stream_id = sid; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)app_error_code; @@ -944,19 +941,18 @@ static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t sid, if(!stream || !stream->s.ssl) return 0; - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] stop_sending", stream_id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] stop_sending", stream_id); cf_osslq_stream_close(&stream->s); return 0; } -static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t sid, +static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - curl_int64_t stream_id = sid; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); int rv; (void)conn; @@ -965,7 +961,7 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t sid, SSL_STREAM_RESET_ARGS args = {0}; args.quic_error_code = app_error_code; rv = !SSL_stream_reset(stream->s.ssl, &args, sizeof(args)); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); + CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv); if(!rv) { return NGHTTP3_ERR_CALLBACK_FAILURE; } @@ -1025,12 +1021,12 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, } else if(!nwritten) { /* Not EOF, and nothing to give, we signal WOULDBLOCK. */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> AGAIN", + CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> AGAIN", stream->s.id); return NGHTTP3_ERR_WOULDBLOCK; } - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> " + CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> " "%d vecs%s with %zu (buffered=%zu, left=%" FMT_OFF_T ")", stream->s.id, (int)nvecs, *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "", @@ -1262,7 +1258,7 @@ static CURLcode h3_quic_recv(void *reader_ctx, return CURLE_AGAIN; } else if(detail == SSL_ERROR_ZERO_RETURN) { - CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRId64 "] h3_quic_recv -> EOS", + CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] h3_quic_recv -> EOS", x->s->id); x->s->recvd_eos = TRUE; return CURLE_OK; @@ -1275,7 +1271,7 @@ static CURLcode h3_quic_recv(void *reader_ctx, return CURLE_RECV_ERROR; } else { - CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRId64 "] h3_quic_recv -> RESET, " + CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] h3_quic_recv -> RESET, " "rv=%d, app_err=%" FMT_PRIu64, x->s->id, rv, (curl_uint64_t)app_error_code); if(app_error_code != NGHTTP3_H3_NO_ERROR) @@ -1332,7 +1328,7 @@ static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, while(Curl_bufq_peek(&s->recvbuf, &buf, &blen)) { nread = nghttp3_conn_read_stream(ctx->h3.conn, s->id, buf, blen, 0); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] forward %zu bytes " + CURL_TRC_CF(data, cf, "[%" PRId64 "] forward %zu bytes " "to nghttp3 -> %zd", s->id, blen, nread); if(nread < 0) { failf(data, "nghttp3_conn_read_stream(len=%zu) error: %s", @@ -1372,7 +1368,7 @@ static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, rv = nghttp3_conn_close_stream(ctx->h3.conn, s->id, NGHTTP3_H3_NO_ERROR); s->closed = TRUE; - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] close nghttp3 stream -> %d", + CURL_TRC_CF(data, cf, "[%" PRId64 "] close nghttp3 stream -> %d", s->id, rv); if(rv < 0 && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { failf(data, "nghttp3_conn_close_stream returned error: %s", @@ -1385,7 +1381,7 @@ static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, } out: if(result) - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_osslq_stream_recv -> %d", + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_osslq_stream_recv -> %d", s->id, result); return result; } @@ -1609,7 +1605,7 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, s = cf_osslq_get_qstream(cf, data, stream_id); if(!s) { failf(data, "nghttp3_conn_writev_stream gave unknown stream %" - FMT_PRId64, (curl_int64_t)stream_id); + PRId64, stream_id); result = CURLE_SEND_ERROR; goto out; } @@ -1630,7 +1626,7 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, if(ok) { /* As OpenSSL buffers the data, we count this as acknowledged * from nghttp3's point of view */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send %zu bytes to QUIC ok", + CURL_TRC_CF(data, cf, "[%" PRId64 "] send %zu bytes to QUIC ok", s->id, vec[i].len); acked_len += vec[i].len; } @@ -1640,14 +1636,14 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: /* QUIC blocked us from writing more */ - CURL_TRC_CF(data, cf, "[%"FMT_PRId64 "] send %zu bytes to " + CURL_TRC_CF(data, cf, "[%" PRId64 "] send %zu bytes to " "QUIC blocked", s->id, vec[i].len); written = 0; nghttp3_conn_block_stream(ctx->h3.conn, s->id); s->send_blocked = blocked = TRUE; break; default: - failf(data, "[%"FMT_PRId64 "] send %zu bytes to QUIC, SSL error %d", + failf(data, "[%" PRId64 "] send %zu bytes to QUIC, SSL error %d", s->id, vec[i].len, detail); result = cf_osslq_ssl_err(cf, data, detail, CURLE_HTTP3); goto out; @@ -1673,13 +1669,13 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, result = CURLE_SEND_ERROR; goto out; } - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] forwarded %zu/%zu h3 bytes " + CURL_TRC_CF(data, cf, "[%" PRId64 "] forwarded %zu/%zu h3 bytes " "to QUIC, eos=%d", s->id, acked_len, total_len, eos); } if(eos && !s->send_blocked && !eos_written) { /* wrote everything and H3 indicates end of stream */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] closing QUIC stream", s->id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] closing QUIC stream", s->id); SSL_stream_conclude(s->ssl, 0); } } @@ -1980,11 +1976,11 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, if(rc) { switch(rc) { case NGHTTP3_ERR_CONN_CLOSING: - CURL_TRC_CF(data, cf, "h3sid[%"FMT_PRId64"] failed to send, " + CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send, " "connection is closing", stream->s.id); break; default: - CURL_TRC_CF(data, cf, "h3sid[%"FMT_PRId64 "] failed to send -> %d (%s)", + CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send -> %d (%s)", stream->s.id, rc, nghttp3_strerror(rc)); break; } @@ -1993,10 +1989,10 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, } if(Curl_trc_is_verbose(data)) { - infof(data, "[HTTP/3] [%" FMT_PRId64 "] OPENED stream for %s", + infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", stream->s.id, data->state.url); for(i = 0; i < nheader; ++i) { - infof(data, "[HTTP/3] [%" FMT_PRId64 "] [%.*s: %.*s]", + infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->s.id, (int)nva[i].namelen, nva[i].name, (int)nva[i].valuelen, nva[i].value); @@ -2049,20 +2045,20 @@ static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, * body. This happens on 30x or 40x responses. * We silently discard the data sent, since this is not a transport * error situation. */ - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] discarding data" + CURL_TRC_CF(data, cf, "[%" PRId64 "] discarding data" "on closed stream with response", stream->s.id); result = CURLE_OK; *pnwritten = len; goto out; } - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " "-> stream closed", stream->s.id, len); result = CURLE_HTTP3; goto out; } else { result = Curl_bufq_write(&stream->sendbuf, buf, len, pnwritten); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send, add to " + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send, add to " "sendbuf(len=%zu) -> %d, %zu", stream->s.id, len, result, *pnwritten); if(result) @@ -2075,7 +2071,7 @@ static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, out: result = Curl_1st_err(result, check_and_set_expiry(cf, data)); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %d, %zu", + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu) -> %d, %zu", stream ? stream->s.id : -1, len, result, *pnwritten); CF_DATA_RESTORE(cf, save); return result; @@ -2090,13 +2086,13 @@ static CURLcode recv_closed_stream(struct Curl_cfilter *cf, *pnread = 0; if(stream->reset) { failf(data, - "HTTP/3 stream %" FMT_PRId64 " reset by server", + "HTTP/3 stream %" PRId64 " reset by server", stream->s.id); return data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; } else if(!stream->resp_hds_complete) { failf(data, - "HTTP/3 stream %" FMT_PRId64 + "HTTP/3 stream %" PRId64 " was closed cleanly, but before getting" " all response header fields, treated as error", stream->s.id); @@ -2128,8 +2124,8 @@ static CURLcode cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(!Curl_bufq_is_empty(&stream->recvbuf)) { result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); if(result) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read recvbuf(len=%zu) " - "-> %d, %zu", stream->s.id, len, result, *pnread); + CURL_TRC_CF(data, cf, "[%" PRId64 "] read recvbuf(len=%zu) -> %d, %zu", + stream->s.id, len, result, *pnread); goto out; } } @@ -2142,8 +2138,8 @@ static CURLcode cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(!*pnread && !Curl_bufq_is_empty(&stream->recvbuf)) { result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); if(result) { - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read recvbuf(len=%zu) " - "-> %d, %zu", stream->s.id, len, result, *pnread); + CURL_TRC_CF(data, cf, "[%" PRId64 "] read recvbuf(len=%zu) -> %d, %zu", + stream->s.id, len, result, *pnread); goto out; } } @@ -2163,7 +2159,7 @@ static CURLcode cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, result = Curl_1st_err(result, cf_progress_egress(cf, data)); result = Curl_1st_err(result, check_and_set_expiry(cf, data)); - CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(len=%zu) -> %d, %zu", + CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv(len=%zu) -> %d, %zu", stream ? stream->s.id : -1, len, result, *pnread); CF_DATA_RESTORE(cf, save); return result; From 4701a6d2ae9f0b66a0feac4061868e944353449b Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 25 Nov 2025 11:33:38 +0100 Subject: [PATCH 534/885] lib: change uint sets to operate on uint32_t - clarify names and change types - make multi's `mid` a uint32_t - update documentation Closes #19695 --- docs/internals/UINT_SETS.md | 40 ++--- lib/doh.c | 16 +- lib/doh.h | 2 +- lib/easy.c | 6 +- lib/http2.c | 10 +- lib/multi.c | 282 ++++++++++++++++++------------------ lib/multi_ev.c | 36 ++--- lib/multi_ev.h | 4 +- lib/multi_ntfy.c | 22 +-- lib/multi_ntfy.h | 2 +- lib/multihandle.h | 10 +- lib/multiif.h | 2 +- lib/uint-bset.c | 102 ++++++------- lib/uint-bset.h | 38 ++--- lib/uint-hash.c | 94 ++++++------ lib/uint-hash.h | 40 ++--- lib/uint-spbset.c | 128 ++++++++-------- lib/uint-spbset.h | 42 +++--- lib/uint-table.c | 82 +++++------ lib/uint-table.h | 40 ++--- lib/url.c | 10 +- lib/urldata.h | 10 +- lib/vquic/curl_ngtcp2.c | 20 +-- lib/vquic/curl_osslq.c | 24 +-- lib/vquic/curl_quiche.c | 16 +- lib/vquic/vquic_int.h | 2 +- tests/unit/unit1616.c | 18 +-- tests/unit/unit3211.c | 65 +++++---- tests/unit/unit3212.c | 82 ++++++----- tests/unit/unit3213.c | 38 ++--- 30 files changed, 645 insertions(+), 638 deletions(-) diff --git a/docs/internals/UINT_SETS.md b/docs/internals/UINT_SETS.md index de00b9b47a30..85952c9803fe 100644 --- a/docs/internals/UINT_SETS.md +++ b/docs/internals/UINT_SETS.md @@ -4,23 +4,23 @@ Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl --> -# Unsigned Int Sets +# `uint32_t` Sets -The multi handle tracks added easy handles via an unsigned int -it calls an `mid`. There are four data structures for unsigned int +The multi handle tracks added easy handles via an `uint32_t` +it calls an `mid`. There are four data structures for `uint32_t` optimized for the multi use case. -## `uint_tbl` +## `uint32_tbl` -`uint_table`, implemented in `uint-table.[ch]` manages an array -of `void *`. The unsigned int are the index into this array. It is +`uint32_table`, implemented in `uint-table.[ch]` manages an array +of `void *`. The `uint32_t` is the index into this array. It is created with a *capacity* which can be *resized*. The table assigns the index when a `void *` is *added*. It keeps track of the last assigned index and uses the next available larger index for a subsequent add. Reaching *capacity* it wraps around. The table *can not* store `NULL` values. The largest possible index -is `UINT_MAX - 1`. +is `UINT32_MAX - 1`. The table is iterated over by asking for the *first* existing index, meaning the smallest number that has an entry, if the table is not @@ -29,10 +29,10 @@ iteration step. It does not matter if the previous index is still in the table. Sample code for a table iteration would look like this: ```c -unsigned int mid; +uint32_t int mid; void *entry; -if(Curl_uint_tbl_first(tbl, &mid, &entry)) { +if(Curl_uint32_tbl_first(tbl, &mid, &entry)) { do { /* operate on entry with index mid */ } @@ -51,7 +51,7 @@ This iteration has the following properties: ### Memory For storing 1000 entries, the table would allocate one block of 8KB on a 64-bit system, -plus the 2 pointers and 3 unsigned int in its base `struct uint_tbl`. A resize +plus the 2 pointers and 3 `uint32_t` in its base `struct uint32_tbl`. A resize allocates a completely new pointer array, copy the existing entries and free the previous one. ### Performance @@ -77,17 +77,17 @@ For these reasons, the simple implementation was preferred. Should this become a concern, there are options like "free index lists" or, alternatively, an internal bitset that scans better. -## `uint_bset` +## `uint32_bset` -A bitset for unsigned integers, allowing fast add/remove operations. It is initialized +A bitset for `uint32_t` values, allowing fast add/remove operations. It is initialized with a *capacity*, meaning it can store only the numbers in the range `[0, capacity-1]`. -It can be *resized* and safely *iterated*. `uint_bset` is designed to operate in combination with `uint_tbl`. +It can be *resized* and safely *iterated*. `uint32_bset` is designed to operate in combination with `uint_tbl`. -The bitset keeps an array of `curl_uint64_t`. The first array entry keeps the numbers 0 to 63, the +The bitset keeps an array of `uint64_t`. The first array entry keeps the numbers 0 to 63, the second 64 to 127 and so on. A bitset with capacity 1024 would therefore allocate an array of 16 64-bit values (128 bytes). Operations for an unsigned int divide it by 64 for the array index and then check/set/clear the bit of the remainder. -Iterator works the same as with `uint_tbl`: ask the bitset for the *first* number present and +Iterator works the same as with `uint32_tbl`: ask the bitset for the *first* number present and then use that to get the *next* higher number present. Like the table, this safe for adds/removes and growing the set while iterating. @@ -102,14 +102,14 @@ Operations for add/remove/check are O(1). Iteration needs to scan for the next b number of scans is small (see memory footprint) and, for checking bits, many compilers offer primitives for special CPU instructions. -## `uint_spbset` +## `uint32_spbset` -While the memory footprint of `uint_bset` is good, it still needs 5KB to store the single number 40000. This +While the memory footprint of `uint32_bset` is good, it still needs 5KB to store the single number 40000. This is not optimal when many are needed. For example, in event based processing, each socket needs to keep track of the transfers involved. There are many sockets potentially, but each one mostly tracks a single transfer or few (on HTTP/2 connection borderline up to 100). -For such uses cases, the `uint_spbset` is intended: track a small number of unsigned int, potentially +For such uses cases, the `uint32_spbset` is intended: track a small number of unsigned int, potentially rather "close" together. It keeps "chunks" with an offset and has no capacity limit. Example: adding the number 40000 to an empty sparse bitset would have one chunk with offset 39936, keeping @@ -121,8 +121,8 @@ would need to be allocated and linked, resulting in overall 4 KB of memory used. Iterating a sparse bitset works the same as for bitset and table. -## `uint_hash` +## `uint32_hash` At last, there are places in libcurl such as the HTTP/2 and HTTP/3 protocol implementations that need -to store their own data related to a transfer. `uint_hash` allows then to associate an unsigned int, +to store their own data related to a transfer. `uint32_hash` allows then to associate an unsigned int, e.g. the transfer's `mid`, to their own data. diff --git a/lib/doh.c b/lib/doh.c index 83a83f534672..0712981a97ec 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -286,7 +286,7 @@ static CURLcode doh_probe_run(struct Curl_easy *data, DNStype dnstype, const char *host, const char *url, CURLM *multi, - unsigned int *pmid) + uint32_t *pmid) { struct Curl_easy *doh = NULL; CURLcode result = CURLE_OK; @@ -294,7 +294,7 @@ static CURLcode doh_probe_run(struct Curl_easy *data, struct doh_request *doh_req; DOHcode d; - *pmid = UINT_MAX; + *pmid = UINT32_MAX; doh_req = calloc(1, sizeof(*doh_req)); if(!doh_req) @@ -472,7 +472,7 @@ CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, return CURLE_OUT_OF_MEMORY; for(i = 0; i < DOH_SLOT_COUNT; ++i) { - dohp->probe_resp[i].probe_mid = UINT_MAX; + dohp->probe_resp[i].probe_mid = UINT32_MAX; curlx_dyn_init(&dohp->probe_resp[i].body, DYN_DOH_RESPONSE); } @@ -1222,8 +1222,8 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, if(!dohp) return CURLE_OUT_OF_MEMORY; - if(dohp->probe_resp[DOH_SLOT_IPV4].probe_mid == UINT_MAX && - dohp->probe_resp[DOH_SLOT_IPV6].probe_mid == UINT_MAX) { + if(dohp->probe_resp[DOH_SLOT_IPV4].probe_mid == UINT32_MAX && + dohp->probe_resp[DOH_SLOT_IPV6].probe_mid == UINT32_MAX) { failf(data, "Could not DoH-resolve: %s", dohp->host); return CONN_IS_PROXIED(data->conn) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST; @@ -1318,13 +1318,13 @@ void Curl_doh_close(struct Curl_easy *data) struct doh_probes *doh = data->state.async.doh; if(doh && data->multi) { struct Curl_easy *probe_data; - unsigned int mid; + uint32_t mid; size_t slot; for(slot = 0; slot < DOH_SLOT_COUNT; slot++) { mid = doh->probe_resp[slot].probe_mid; - if(mid == UINT_MAX) + if(mid == UINT32_MAX) continue; - doh->probe_resp[slot].probe_mid = UINT_MAX; + doh->probe_resp[slot].probe_mid = UINT32_MAX; /* should have been called before data is removed from multi handle */ DEBUGASSERT(data->multi); probe_data = data->multi ? Curl_multi_get_easy(data->multi, mid) : diff --git a/lib/doh.h b/lib/doh.h index 726fb9f73557..ffd0cb087913 100644 --- a/lib/doh.h +++ b/lib/doh.h @@ -96,7 +96,7 @@ struct doh_request { }; struct doh_response { - unsigned int probe_mid; + uint32_t probe_mid; struct dynbuf body; DNStype dnstype; CURLcode result; diff --git a/lib/easy.c b/lib/easy.c index 8c7b9c23da68..db6c419c5771 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -988,8 +988,8 @@ CURL *curl_easy_duphandle(CURL *d) outcurl->state.lastconnect_id = -1; outcurl->state.recent_conn_id = -1; outcurl->id = -1; - outcurl->mid = UINT_MAX; - outcurl->master_mid = UINT_MAX; + outcurl->mid = UINT32_MAX; + outcurl->master_mid = UINT32_MAX; #ifndef CURL_DISABLE_HTTP Curl_llist_init(&outcurl->state.httphdrs, NULL); @@ -1126,7 +1126,7 @@ void curl_easy_reset(CURL *d) #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH) Curl_http_auth_cleanup_digest(data); #endif - data->master_mid = UINT_MAX; + data->master_mid = UINT32_MAX; } /* diff --git a/lib/http2.c b/lib/http2.c index 5d1a502810fb..7b94930a21a7 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -140,7 +140,7 @@ static void cf_h2_ctx_init(struct cf_h2_ctx *ctx, bool via_h1_upgrade) Curl_bufq_initp(&ctx->inbufq, &ctx->stream_bufcp, H2_NW_RECV_CHUNKS, 0); Curl_bufq_initp(&ctx->outbufq, &ctx->stream_bufcp, H2_NW_SEND_CHUNKS, 0); curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); - Curl_uint_hash_init(&ctx->streams, 63, h2_stream_hash_free); + Curl_uint32_hash_init(&ctx->streams, 63, h2_stream_hash_free); ctx->remote_max_sid = 2147483647; ctx->via_h1_upgrade = via_h1_upgrade; #ifdef DEBUGBUILD @@ -165,7 +165,7 @@ static void cf_h2_ctx_free(struct cf_h2_ctx *ctx) Curl_bufq_free(&ctx->outbufq); Curl_bufcp_free(&ctx->stream_bufcp); curlx_dyn_free(&ctx->scratch); - Curl_uint_hash_destroy(&ctx->streams); + Curl_uint32_hash_destroy(&ctx->streams); memset(ctx, 0, sizeof(*ctx)); } free(ctx); @@ -269,7 +269,7 @@ struct h2_stream_ctx { #define H2_STREAM_CTX(ctx,data) \ ((struct h2_stream_ctx *)( \ - data? Curl_uint_hash_get(&(ctx)->streams, (data)->mid) : NULL)) + data? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL)) static struct h2_stream_ctx *h2_stream_ctx_create(struct cf_h2_ctx *ctx) { @@ -426,7 +426,7 @@ static CURLcode http2_data_setup(struct Curl_cfilter *cf, if(!stream) return CURLE_OUT_OF_MEMORY; - if(!Curl_uint_hash_set(&ctx->streams, data->mid, stream)) { + if(!Curl_uint32_hash_set(&ctx->streams, data->mid, stream)) { h2_stream_ctx_free(stream); return CURLE_OUT_OF_MEMORY; } @@ -466,7 +466,7 @@ static void http2_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) } } - Curl_uint_hash_remove(&ctx->streams, data->mid); + Curl_uint32_hash_remove(&ctx->streams, data->mid); } static int h2_client_new(struct Curl_cfilter *cf, diff --git a/lib/multi.c b/lib/multi.c index 5789861026af..57c574a68176 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -180,11 +180,11 @@ static void mstate(struct Curl_easy *data, CURLMstate state if(oldstate < MSTATE_DONE) CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE); /* changing to COMPLETED means it is in process and needs to go */ - DEBUGASSERT(Curl_uint_bset_contains(&data->multi->process, data->mid)); - Curl_uint_bset_remove(&data->multi->process, data->mid); - Curl_uint_bset_remove(&data->multi->pending, data->mid); /* to be sure */ + DEBUGASSERT(Curl_uint32_bset_contains(&data->multi->process, data->mid)); + Curl_uint32_bset_remove(&data->multi->process, data->mid); + Curl_uint32_bset_remove(&data->multi->pending, data->mid); /* to be sure */ - if(Curl_uint_bset_empty(&data->multi->process)) { + if(Curl_uint32_bset_empty(&data->multi->process)) { /* free the transfer buffer when we have no more active transfers */ multi_xfer_bufs_free(data->multi); } @@ -229,7 +229,7 @@ static void multi_addmsg(struct Curl_multi *multi, struct Curl_message *msg) Curl_llist_append(&multi->msglist, msg, &msg->list); } -struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, +struct Curl_multi *Curl_multi_handle(uint32_t xfer_table_size, size_t ev_hashsize, /* event hash */ size_t chashsize, /* connection hash */ size_t dnssize, /* dns hash */ @@ -245,11 +245,11 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, Curl_dnscache_init(&multi->dnscache, dnssize); Curl_mntfy_init(multi); Curl_multi_ev_init(multi, ev_hashsize); - Curl_uint_tbl_init(&multi->xfers, NULL); - Curl_uint_bset_init(&multi->process); - Curl_uint_bset_init(&multi->dirty); - Curl_uint_bset_init(&multi->pending); - Curl_uint_bset_init(&multi->msgsent); + Curl_uint32_tbl_init(&multi->xfers, NULL); + Curl_uint32_bset_init(&multi->process); + Curl_uint32_bset_init(&multi->dirty); + Curl_uint32_bset_init(&multi->pending); + Curl_uint32_bset_init(&multi->msgsent); Curl_hash_init(&multi->proto_hash, 23, Curl_hash_str, curlx_str_key_compare, ph_freeentry); Curl_llist_init(&multi->msglist, NULL); @@ -259,11 +259,11 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, multi->last_timeout_ms = -1; if(Curl_mntfy_resize(multi) || - Curl_uint_bset_resize(&multi->process, xfer_table_size) || - Curl_uint_bset_resize(&multi->pending, xfer_table_size) || - Curl_uint_bset_resize(&multi->dirty, xfer_table_size) || - Curl_uint_bset_resize(&multi->msgsent, xfer_table_size) || - Curl_uint_tbl_resize(&multi->xfers, xfer_table_size)) + Curl_uint32_bset_resize(&multi->process, xfer_table_size) || + Curl_uint32_bset_resize(&multi->pending, xfer_table_size) || + Curl_uint32_bset_resize(&multi->dirty, xfer_table_size) || + Curl_uint32_bset_resize(&multi->msgsent, xfer_table_size) || + Curl_uint32_tbl_resize(&multi->xfers, xfer_table_size)) goto error; multi->admin = curl_easy_init(); @@ -278,8 +278,8 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, if(getenv("CURL_DEBUG")) multi->admin->set.verbose = TRUE; #endif - Curl_uint_tbl_add(&multi->xfers, multi->admin, &multi->admin->mid); - Curl_uint_bset_add(&multi->process, multi->admin->mid); + Curl_uint32_tbl_add(&multi->xfers, multi->admin, &multi->admin->mid); + Curl_uint32_bset_add(&multi->process, multi->admin->mid); if(Curl_cshutdn_init(&multi->cshutdn, multi)) goto error; @@ -322,11 +322,11 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, } Curl_mntfy_cleanup(multi); - Curl_uint_bset_destroy(&multi->process); - Curl_uint_bset_destroy(&multi->dirty); - Curl_uint_bset_destroy(&multi->pending); - Curl_uint_bset_destroy(&multi->msgsent); - Curl_uint_tbl_destroy(&multi->xfers); + Curl_uint32_bset_destroy(&multi->process); + Curl_uint32_bset_destroy(&multi->dirty); + Curl_uint32_bset_destroy(&multi->pending); + Curl_uint32_bset_destroy(&multi->msgsent); + Curl_uint32_tbl_destroy(&multi->xfers); free(multi); return NULL; @@ -359,12 +359,12 @@ static void multi_warn_debug(struct Curl_multi *multi, struct Curl_easy *data) static CURLMcode multi_xfers_add(struct Curl_multi *multi, struct Curl_easy *data) { - unsigned int capacity = Curl_uint_tbl_capacity(&multi->xfers); - unsigned int new_size = 0; + uint32_t capacity = Curl_uint32_tbl_capacity(&multi->xfers); + uint32_t new_size = 0; /* Prepare to make this into a CURLMOPT_MAX_TRANSFERS, because some * applications may want to prevent a run-away of their memory use. */ /* UINT_MAX is our "invalid" id, do not let the table grow up to that. */ - const unsigned int max_capacity = UINT_MAX - 1; + const uint32_t max_capacity = UINT_MAX - 1; if(capacity < max_capacity) { /* We want `multi->xfers` to have "sufficient" free rows, so that we do @@ -372,9 +372,9 @@ static CURLMcode multi_xfers_add(struct Curl_multi *multi, * Since uint_tbl and uint_bset are quite memory efficient, * regard less than 25% free as insufficient. * (for low capacities, e.g. multi_easy, 4 or less). */ - unsigned int used = Curl_uint_tbl_count(&multi->xfers); - unsigned int unused = capacity - used; - unsigned int min_unused = CURLMAX(capacity >> 2, 4); + uint32_t used = Curl_uint32_tbl_count(&multi->xfers); + uint32_t unused = capacity - used; + uint32_t min_unused = CURLMAX(capacity >> 2, 4); if(unused <= min_unused) { /* Make sure the uint arithmetic here works on the corner * cases where we are close to max_capacity or UINT_MAX */ @@ -397,19 +397,19 @@ static CURLMcode multi_xfers_add(struct Curl_multi *multi, * to work properly when larger than the table, but not * the other way around. */ CURL_TRC_M(data, "increasing xfer table size to %u", new_size); - if(Curl_uint_bset_resize(&multi->process, new_size) || - Curl_uint_bset_resize(&multi->dirty, new_size) || - Curl_uint_bset_resize(&multi->pending, new_size) || - Curl_uint_bset_resize(&multi->msgsent, new_size) || - Curl_uint_tbl_resize(&multi->xfers, new_size)) + if(Curl_uint32_bset_resize(&multi->process, new_size) || + Curl_uint32_bset_resize(&multi->dirty, new_size) || + Curl_uint32_bset_resize(&multi->pending, new_size) || + Curl_uint32_bset_resize(&multi->msgsent, new_size) || + Curl_uint32_tbl_resize(&multi->xfers, new_size)) return CURLM_OUT_OF_MEMORY; } /* Insert the easy into the table now */ - if(!Curl_uint_tbl_add(&multi->xfers, data, &data->mid)) { + if(!Curl_uint32_tbl_add(&multi->xfers, data, &data->mid)) { /* MUST only happen when table is full */ - DEBUGASSERT(Curl_uint_tbl_capacity(&multi->xfers) <= - Curl_uint_tbl_count(&multi->xfers)); + DEBUGASSERT(Curl_uint32_tbl_capacity(&multi->xfers) <= + Curl_uint32_tbl_count(&multi->xfers)); return CURLM_OUT_OF_MEMORY; } return CURLM_OK; @@ -441,14 +441,14 @@ CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) handles are still alive - but if there are none alive anymore, it is fine to start over and unmark the "deadness" of this handle. This means only the admin handle MUST be present. */ - if((Curl_uint_tbl_count(&multi->xfers) != 1) || - !Curl_uint_tbl_contains(&multi->xfers, 0)) + if((Curl_uint32_tbl_count(&multi->xfers) != 1) || + !Curl_uint32_tbl_contains(&multi->xfers, 0)) return CURLM_ABORTED_BY_CALLBACK; multi->dead = FALSE; - Curl_uint_bset_clear(&multi->process); - Curl_uint_bset_clear(&multi->dirty); - Curl_uint_bset_clear(&multi->pending); - Curl_uint_bset_clear(&multi->msgsent); + Curl_uint32_bset_clear(&multi->process); + Curl_uint32_bset_clear(&multi->dirty); + Curl_uint32_bset_clear(&multi->pending); + Curl_uint32_bset_clear(&multi->msgsent); } if(data->multi_easy) { @@ -492,7 +492,7 @@ CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) #endif /* add the easy handle to the process set */ - Curl_uint_bset_add(&multi->process, data->mid); + Curl_uint32_bset_add(&multi->process, data->mid); ++multi->xfers_alive; ++multi->xfers_total_ever; @@ -507,8 +507,8 @@ CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) rc = Curl_update_timer(multi); if(rc) { data->multi = NULL; /* not anymore */ - Curl_uint_tbl_remove(&multi->xfers, data->mid); - data->mid = UINT_MAX; + Curl_uint32_tbl_remove(&multi->xfers, data->mid); + data->mid = UINT32_MAX; return rc; } @@ -523,7 +523,7 @@ CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) CURL_TRC_M(data, "added to multi, mid=%u, running=%u, total=%u", data->mid, Curl_multi_xfers_running(multi), - Curl_uint_tbl_count(&multi->xfers)); + Curl_uint32_tbl_count(&multi->xfers)); return CURLM_OK; } @@ -572,11 +572,11 @@ static void multi_done_locked(struct connectdata *conn, Curl_detach_connection(data); CURL_TRC_M(data, "multi_done_locked, in use=%u", - Curl_uint_spbset_count(&conn->xfers_attached)); + Curl_uint32_spbset_count(&conn->xfers_attached)); if(CONN_INUSE(conn)) { /* Stop if still used. */ CURL_TRC_M(data, "Connection still in use %u, no more multi_done now!", - Curl_uint_spbset_count(&conn->xfers_attached)); + Curl_uint32_spbset_count(&conn->xfers_attached)); return; } @@ -740,7 +740,7 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) struct Curl_llist_node *e; CURLMcode rc; bool removed_timer = FALSE; - unsigned int mid; + uint32_t mid; /* First, make some basic checks that the CURLM handle is a good handle */ if(!GOOD_MULTI_HANDLE(multi)) @@ -758,11 +758,11 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) if(data->multi != multi) return CURLM_BAD_EASY_HANDLE; - if(data->mid == UINT_MAX) { + if(data->mid == UINT32_MAX) { DEBUGASSERT(0); return CURLM_INTERNAL_ERROR; } - if(Curl_uint_tbl_get(&multi->xfers, data->mid) != data) { + if(Curl_uint32_tbl_get(&multi->xfers, data->mid) != data) { DEBUGASSERT(0); return CURLM_INTERNAL_ERROR; } @@ -797,7 +797,7 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) removed_timer = Curl_expire_clear(data); /* If in `msgsent`, it was deducted from `multi->xfers_alive` already. */ - if(!Curl_uint_bset_contains(&multi->msgsent, data->mid)) + if(!Curl_uint32_bset_contains(&multi->msgsent, data->mid)) --multi->xfers_alive; Curl_wildcard_dtor(&data->wildcard); @@ -853,15 +853,15 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) /* clear the association to this multi handle */ mid = data->mid; - DEBUGASSERT(Curl_uint_tbl_contains(&multi->xfers, mid)); - Curl_uint_tbl_remove(&multi->xfers, mid); - Curl_uint_bset_remove(&multi->process, mid); - Curl_uint_bset_remove(&multi->dirty, mid); - Curl_uint_bset_remove(&multi->pending, mid); - Curl_uint_bset_remove(&multi->msgsent, mid); + DEBUGASSERT(Curl_uint32_tbl_contains(&multi->xfers, mid)); + Curl_uint32_tbl_remove(&multi->xfers, mid); + Curl_uint32_bset_remove(&multi->process, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->pending, mid); + Curl_uint32_bset_remove(&multi->msgsent, mid); data->multi = NULL; - data->mid = UINT_MAX; - data->master_mid = UINT_MAX; + data->mid = UINT32_MAX; + data->master_mid = UINT32_MAX; /* NOTE NOTE NOTE We do not touch the easy handle here! */ @@ -875,7 +875,7 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) CURL_TRC_M(data, "removed from multi, mid=%u, running=%u, total=%u", mid, Curl_multi_xfers_running(multi), - Curl_uint_tbl_count(&multi->xfers)); + Curl_uint32_tbl_count(&multi->xfers)); return CURLM_OK; } @@ -895,8 +895,8 @@ void Curl_detach_connection(struct Curl_easy *data) { struct connectdata *conn = data->conn; if(conn) { - Curl_uint_spbset_remove(&conn->xfers_attached, data->mid); - if(Curl_uint_spbset_empty(&conn->xfers_attached)) + Curl_uint32_spbset_remove(&conn->xfers_attached, data->mid); + if(Curl_uint32_spbset_empty(&conn->xfers_attached)) conn->attached_multi = NULL; } data->conn = NULL; @@ -914,7 +914,7 @@ void Curl_attach_connection(struct Curl_easy *data, DEBUGASSERT(!data->conn); DEBUGASSERT(conn); data->conn = conn; - Curl_uint_spbset_add(&conn->xfers_attached, data->mid); + Curl_uint32_spbset_add(&conn->xfers_attached, data->mid); /* all attached transfers must be from the same multi */ if(!conn->attached_multi) conn->attached_multi = data->multi; @@ -1219,7 +1219,7 @@ CURLMcode curl_multi_fdset(CURLM *m, return CURLM_RECURSIVE_API_CALL; Curl_pollset_init(&ps); - if(Curl_uint_bset_first(&multi->process, &mid)) { + if(Curl_uint32_bset_first(&multi->process, &mid)) { do { struct Curl_easy *data = Curl_multi_get_easy(multi, mid); @@ -1248,7 +1248,7 @@ CURLMcode curl_multi_fdset(CURLM *m, this_max_fd = (int)ps.sockets[i]; } } - while(Curl_uint_bset_next(&multi->process, mid, &mid)); + while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } Curl_cshutdn_setfds(&multi->cshutdn, multi->admin, @@ -1282,19 +1282,19 @@ CURLMcode curl_multi_waitfds(CURLM *m, Curl_pollset_init(&ps); Curl_waitfds_init(&cwfds, ufds, size); - if(Curl_uint_bset_first(&multi->process, &mid)) { + if(Curl_uint32_bset_first(&multi->process, &mid)) { do { struct Curl_easy *data = Curl_multi_get_easy(multi, mid); if(!data) { DEBUGASSERT(0); - Curl_uint_bset_remove(&multi->process, mid); - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->process, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); continue; } Curl_multi_pollset(data, &ps); need += Curl_waitfds_add_ps(&cwfds, &ps); } - while(Curl_uint_bset_next(&multi->process, mid, &mid)); + while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } need += Curl_cshutdn_add_waitfds(&multi->cshutdn, multi->admin, &cwfds); @@ -1345,7 +1345,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, unsigned int curl_nfds = 0; /* how many pfds are for curl transfers */ struct Curl_easy *data = NULL; CURLMcode result = CURLM_OK; - unsigned int mid; + uint32_t mid; #ifdef USE_WINSOCK WSANETWORKEVENTS wsa_events; @@ -1368,13 +1368,13 @@ static CURLMcode multi_wait(struct Curl_multi *multi, Curl_pollfds_init(&cpfds, a_few_on_stack, NUM_POLLS_ON_STACK); /* Add the curl handles to our pollfds first */ - if(Curl_uint_bset_first(&multi->process, &mid)) { + if(Curl_uint32_bset_first(&multi->process, &mid)) { do { data = Curl_multi_get_easy(multi, mid); if(!data) { DEBUGASSERT(0); - Curl_uint_bset_remove(&multi->process, mid); - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->process, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); continue; } Curl_multi_pollset(data, &ps); @@ -1383,7 +1383,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, goto out; } } - while(Curl_uint_bset_next(&multi->process, mid, &mid)); + while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } if(Curl_cshutdn_add_pollfds(&multi->cshutdn, multi->admin, &cpfds)) { @@ -2330,9 +2330,9 @@ static CURLMcode state_connect(struct Curl_multi *multi, wait for an available connection. */ multistate(data, MSTATE_PENDING); /* move from process to pending set */ - Curl_uint_bset_remove(&multi->process, data->mid); - Curl_uint_bset_remove(&multi->dirty, data->mid); - Curl_uint_bset_add(&multi->pending, data->mid); + Curl_uint32_bset_remove(&multi->process, data->mid); + Curl_uint32_bset_remove(&multi->dirty, data->mid); + Curl_uint32_bset_add(&multi->pending, data->mid); *resultp = CURLE_OK; return rc; } @@ -2395,7 +2395,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, /* transfer runs now, clear the dirty bit. This may be set * again during processing, triggering a re-run later. */ - Curl_uint_bset_remove(&multi->dirty, data->mid); + Curl_uint32_bset_remove(&multi->dirty, data->mid); if(data == multi->admin) { Curl_cshutdn_perform(&multi->cshutdn, multi->admin, CURL_SOCKET_TIMEOUT); @@ -2742,7 +2742,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, } if(MSTATE_COMPLETED == data->mstate) { - if(data->master_mid != UINT_MAX) { + if(data->master_mid != UINT32_MAX) { /* A sub transfer, not for msgsent to application */ struct Curl_easy *mdata; @@ -2773,10 +2773,10 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, multistate(data, MSTATE_MSGSENT); /* remove from the other sets, add to msgsent */ - Curl_uint_bset_remove(&multi->process, data->mid); - Curl_uint_bset_remove(&multi->dirty, data->mid); - Curl_uint_bset_remove(&multi->pending, data->mid); - Curl_uint_bset_add(&multi->msgsent, data->mid); + Curl_uint32_bset_remove(&multi->process, data->mid); + Curl_uint32_bset_remove(&multi->dirty, data->mid); + Curl_uint32_bset_remove(&multi->pending, data->mid); + Curl_uint32_bset_add(&multi->msgsent, data->mid); --multi->xfers_alive; return CURLM_OK; } @@ -2793,7 +2793,7 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) struct Curl_tree *t = NULL; struct curltime now = curlx_now(); struct Curl_multi *multi = m; - unsigned int mid; + uint32_t mid; SIGPIPE_VARIABLE(pipe_st); if(!GOOD_MULTI_HANDLE(multi)) @@ -2806,7 +2806,7 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) return CURLM_RECURSIVE_API_CALL; sigpipe_init(&pipe_st); - if(Curl_uint_bset_first(&multi->process, &mid)) { + if(Curl_uint32_bset_first(&multi->process, &mid)) { CURL_TRC_M(multi->admin, "multi_perform(running=%u)", Curl_multi_xfers_running(multi)); do { @@ -2814,8 +2814,8 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) CURLMcode result; if(!data) { DEBUGASSERT(0); - Curl_uint_bset_remove(&multi->process, mid); - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->process, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); continue; } sigpipe_apply(data, &pipe_st); @@ -2823,7 +2823,7 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) if(result) returncode = result; } - while(Curl_uint_bset_next(&multi->process, mid, &mid)); + while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } sigpipe_restore(&pipe_st); @@ -2876,7 +2876,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) struct Curl_multi *multi = m; if(GOOD_MULTI_HANDLE(multi)) { void *entry; - unsigned int mid; + uint32_t mid; if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; if(multi->in_ntfy_callback) @@ -2884,7 +2884,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) /* First remove all remaining easy handles, * close internal ones. admin handle is special */ - if(Curl_uint_tbl_first(&multi->xfers, &mid, &entry)) { + if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) { do { struct Curl_easy *data = entry; if(!GOOD_EASY_HANDLE(data)) @@ -2906,8 +2906,8 @@ CURLMcode curl_multi_cleanup(CURLM *m) (void)multi_done(data, CURLE_OK, TRUE); data->multi = NULL; /* clear the association */ - Curl_uint_tbl_remove(&multi->xfers, mid); - data->mid = UINT_MAX; + Curl_uint32_tbl_remove(&multi->xfers, mid); + data->mid = UINT32_MAX; #ifdef USE_LIBPSL if(data->psl == &multi->psl) @@ -2916,7 +2916,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) if(data->state.internal) Curl_close(&data); } - while(Curl_uint_tbl_next(&multi->xfers, mid, &mid, &entry)); + while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)); } Curl_cpool_destroy(&multi->cpool); @@ -2924,7 +2924,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) if(multi->admin) { CURL_TRC_M(multi->admin, "multi_cleanup, closing admin handle, done"); multi->admin->multi = NULL; - Curl_uint_tbl_remove(&multi->xfers, multi->admin->mid); + Curl_uint32_tbl_remove(&multi->xfers, multi->admin->mid); Curl_close(&multi->admin); } @@ -2952,16 +2952,16 @@ CURLMcode curl_multi_cleanup(CURLM *m) multi_xfer_bufs_free(multi); Curl_mntfy_cleanup(multi); #ifdef DEBUGBUILD - if(Curl_uint_tbl_count(&multi->xfers)) { + if(Curl_uint32_tbl_count(&multi->xfers)) { multi_xfer_tbl_dump(multi); DEBUGASSERT(0); } #endif - Curl_uint_bset_destroy(&multi->process); - Curl_uint_bset_destroy(&multi->dirty); - Curl_uint_bset_destroy(&multi->pending); - Curl_uint_bset_destroy(&multi->msgsent); - Curl_uint_tbl_destroy(&multi->xfers); + Curl_uint32_bset_destroy(&multi->process); + Curl_uint32_bset_destroy(&multi->dirty); + Curl_uint32_bset_destroy(&multi->pending); + Curl_uint32_bset_destroy(&multi->msgsent); + Curl_uint32_tbl_destroy(&multi->xfers); free(multi); return CURLM_OK; @@ -3120,17 +3120,17 @@ static CURLMcode multi_run_dirty(struct multi_run_ctx *mrc) { struct Curl_multi *multi = mrc->multi; CURLMcode result = CURLM_OK; - unsigned int mid; + uint32_t mid; - if(Curl_uint_bset_first(&multi->dirty, &mid)) { + if(Curl_uint32_bset_first(&multi->dirty, &mid)) { do { struct Curl_easy *data = Curl_multi_get_easy(multi, mid); if(data) { CURL_TRC_M(data, "multi_run_dirty"); - if(!Curl_uint_bset_contains(&multi->process, mid)) { + if(!Curl_uint32_bset_contains(&multi->process, mid)) { /* We are no longer processing this transfer */ - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); continue; } @@ -3148,10 +3148,10 @@ static CURLMcode multi_run_dirty(struct multi_run_ctx *mrc) } else { CURL_TRC_M(multi->admin, "multi_run_dirty, %u no longer found", mid); - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); } } - while(Curl_uint_bset_next(&multi->dirty, mid, &mid)); + while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); } out: @@ -3364,22 +3364,22 @@ CURLMcode curl_multi_socket_all(CURLM *m, int *running_handles) static bool multi_has_dirties(struct Curl_multi *multi) { - unsigned int mid; - if(Curl_uint_bset_first(&multi->dirty, &mid)) { + uint32_t mid; + if(Curl_uint32_bset_first(&multi->dirty, &mid)) { do { struct Curl_easy *data = Curl_multi_get_easy(multi, mid); if(data) { - if(Curl_uint_bset_contains(&multi->process, mid)) + if(Curl_uint32_bset_contains(&multi->process, mid)) return TRUE; /* We are no longer processing this transfer */ - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); } else { CURL_TRC_M(multi->admin, "dirty transfer %u no longer found", mid); - Curl_uint_bset_remove(&multi->dirty, mid); + Curl_uint32_bset_remove(&multi->dirty, mid); } } - while(Curl_uint_bset_next(&multi->dirty, mid, &mid)); + while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); } return FALSE; } @@ -3739,8 +3739,8 @@ static void move_pending_to_connect(struct Curl_multi *multi, DEBUGASSERT(data->mstate == MSTATE_PENDING); /* Remove this node from the pending set, add into process set */ - Curl_uint_bset_remove(&multi->pending, data->mid); - Curl_uint_bset_add(&multi->process, data->mid); + Curl_uint32_bset_remove(&multi->pending, data->mid); + Curl_uint32_bset_add(&multi->process, data->mid); multistate(data, MSTATE_CONNECT); Curl_multi_mark_dirty(data); /* make it run */ @@ -3762,8 +3762,8 @@ static void move_pending_to_connect(struct Curl_multi *multi, */ static void process_pending_handles(struct Curl_multi *multi) { - unsigned int mid; - if(Curl_uint_bset_first(&multi->pending, &mid)) { + uint32_t mid; + if(Curl_uint32_bset_first(&multi->pending, &mid)) { do { struct Curl_easy *data = Curl_multi_get_easy(multi, mid); if(data) { @@ -3771,10 +3771,10 @@ static void process_pending_handles(struct Curl_multi *multi) break; } /* transfer no longer known, should not happen */ - Curl_uint_bset_remove(&multi->pending, mid); + Curl_uint32_bset_remove(&multi->pending, mid); DEBUGASSERT(0); } - while(Curl_uint_bset_next(&multi->pending, mid, &mid)); + while(Curl_uint32_bset_next(&multi->pending, mid, &mid)); } } @@ -3799,19 +3799,19 @@ CURL **curl_multi_get_handles(CURLM *m) { struct Curl_multi *multi = m; void *entry; - unsigned int count = Curl_uint_tbl_count(&multi->xfers); + unsigned int count = Curl_uint32_tbl_count(&multi->xfers); CURL **a = malloc(sizeof(struct Curl_easy *) * (count + 1)); if(a) { unsigned int i = 0, mid; - if(Curl_uint_tbl_first(&multi->xfers, &mid, &entry)) { + if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) { do { struct Curl_easy *data = entry; DEBUGASSERT(i < count); if(!data->state.internal) a[i++] = data; } - while(Curl_uint_tbl_next(&multi->xfers, mid, &mid, &entry)); + while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)); } a[i] = NULL; /* last entry is a NULL */ } @@ -3823,7 +3823,7 @@ CURLMcode curl_multi_get_offt(CURLM *m, curl_off_t *pvalue) { struct Curl_multi *multi = m; - unsigned int n; + uint32_t n; if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -3832,22 +3832,22 @@ CURLMcode curl_multi_get_offt(CURLM *m, switch(info) { case CURLMINFO_XFERS_CURRENT: - n = Curl_uint_tbl_count(&multi->xfers); + n = Curl_uint32_tbl_count(&multi->xfers); if(n && multi->admin) --n; *pvalue = (curl_off_t)n; return CURLM_OK; case CURLMINFO_XFERS_RUNNING: - n = Curl_uint_bset_count(&multi->process); - if(n && Curl_uint_bset_contains(&multi->process, multi->admin->mid)) + n = Curl_uint32_bset_count(&multi->process); + if(n && Curl_uint32_bset_contains(&multi->process, multi->admin->mid)) --n; *pvalue = (curl_off_t)n; return CURLM_OK; case CURLMINFO_XFERS_PENDING: - *pvalue = (curl_off_t)Curl_uint_bset_count(&multi->pending); + *pvalue = (curl_off_t)Curl_uint32_bset_count(&multi->pending); return CURLM_OK; case CURLMINFO_XFERS_DONE: - *pvalue = (curl_off_t)Curl_uint_bset_count(&multi->msgsent); + *pvalue = (curl_off_t)Curl_uint32_bset_count(&multi->msgsent); return CURLM_OK; case CURLMINFO_XFERS_ADDED: *pvalue = multi->xfers_total_ever; @@ -4025,14 +4025,14 @@ static void multi_xfer_bufs_free(struct Curl_multi *multi) } struct Curl_easy *Curl_multi_get_easy(struct Curl_multi *multi, - unsigned int mid) + uint32_t mid) { - struct Curl_easy *data = Curl_uint_tbl_get(&multi->xfers, mid); + struct Curl_easy *data = Curl_uint32_tbl_get(&multi->xfers, mid); if(data && GOOD_EASY_HANDLE(data)) return data; CURL_TRC_M(multi->admin, "invalid easy handle in xfer table for mid=%u", mid); - Curl_uint_tbl_remove(&multi->xfers, mid); + Curl_uint32_tbl_remove(&multi->xfers, mid); return NULL; } @@ -4043,14 +4043,14 @@ unsigned int Curl_multi_xfers_running(struct Curl_multi *multi) void Curl_multi_mark_dirty(struct Curl_easy *data) { - if(data->multi && data->mid != UINT_MAX) - Curl_uint_bset_add(&data->multi->dirty, data->mid); + if(data->multi && data->mid != UINT32_MAX) + Curl_uint32_bset_add(&data->multi->dirty, data->mid); } void Curl_multi_clear_dirty(struct Curl_easy *data) { - if(data->multi && data->mid != UINT_MAX) - Curl_uint_bset_remove(&data->multi->dirty, data->mid); + if(data->multi && data->mid != UINT32_MAX) + Curl_uint32_bset_remove(&data->multi->dirty, data->mid); } CURLMcode curl_multi_notify_enable(CURLM *m, unsigned int notification) @@ -4072,7 +4072,7 @@ CURLMcode curl_multi_notify_disable(CURLM *m, unsigned int notification) } #ifdef DEBUGBUILD -static void multi_xfer_dump(struct Curl_multi *multi, unsigned int mid, +static void multi_xfer_dump(struct Curl_multi *multi, uint32_t mid, void *entry) { struct Curl_easy *data = entry; @@ -4092,14 +4092,14 @@ static void multi_xfer_dump(struct Curl_multi *multi, unsigned int mid, static void multi_xfer_tbl_dump(struct Curl_multi *multi) { - unsigned int mid; + uint32_t mid; void *entry; curl_mfprintf(stderr, "=== multi xfer table (count=%u, capacity=%u\n", - Curl_uint_tbl_count(&multi->xfers), - Curl_uint_tbl_capacity(&multi->xfers)); - if(Curl_uint_tbl_first(&multi->xfers, &mid, &entry)) { + Curl_uint32_tbl_count(&multi->xfers), + Curl_uint32_tbl_capacity(&multi->xfers)); + if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) { multi_xfer_dump(multi, mid, entry); - while(Curl_uint_tbl_next(&multi->xfers, mid, &mid, &entry)) + while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)) multi_xfer_dump(multi, mid, entry); } curl_mfprintf(stderr, "===\n"); diff --git a/lib/multi_ev.c b/lib/multi_ev.c index 086b037527a4..d5db331cf1f1 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -55,7 +55,7 @@ static void mev_in_callback(struct Curl_multi *multi, bool value) * what to supervise (CURL_POLL_IN/CURL_POLL_OUT/CURL_POLL_REMOVE) */ struct mev_sh_entry { - struct uint_spbset xfers; /* bitset of transfers `mid`s on this socket */ + struct uint32_spbset xfers; /* bitset of transfers `mid`s on this socket */ struct connectdata *conn; /* connection using this socket or NULL */ void *user_data; /* libcurl app data via curl_multi_assign() */ unsigned int action; /* CURL_POLL_IN/CURL_POLL_OUT we last told the @@ -84,7 +84,7 @@ static size_t mev_sh_entry_compare(void *k1, size_t k1_len, static void mev_sh_entry_dtor(void *freethis) { struct mev_sh_entry *entry = (struct mev_sh_entry *)freethis; - Curl_uint_spbset_destroy(&entry->xfers); + Curl_uint32_spbset_destroy(&entry->xfers); free(entry); } @@ -116,7 +116,7 @@ mev_sh_entry_add(struct Curl_hash *sh, curl_socket_t s) if(!check) return NULL; /* major failure */ - Curl_uint_spbset_init(&check->xfers); + Curl_uint32_spbset_init(&check->xfers); /* make/add new hash entry */ if(!Curl_hash_add(sh, (char *)&s, sizeof(curl_socket_t), check)) { @@ -135,13 +135,13 @@ static void mev_sh_entry_kill(struct Curl_multi *multi, curl_socket_t s) static size_t mev_sh_entry_user_count(struct mev_sh_entry *e) { - return Curl_uint_spbset_count(&e->xfers) + (e->conn ? 1 : 0); + return Curl_uint32_spbset_count(&e->xfers) + (e->conn ? 1 : 0); } static bool mev_sh_entry_xfer_known(struct mev_sh_entry *e, struct Curl_easy *data) { - return Curl_uint_spbset_contains(&e->xfers, data->mid); + return Curl_uint32_spbset_contains(&e->xfers, data->mid); } static bool mev_sh_entry_conn_known(struct mev_sh_entry *e, @@ -155,7 +155,7 @@ static bool mev_sh_entry_xfer_add(struct mev_sh_entry *e, { /* detect weird values */ DEBUGASSERT(mev_sh_entry_user_count(e) < 100000); - return Curl_uint_spbset_add(&e->xfers, data->mid); + return Curl_uint32_spbset_add(&e->xfers, data->mid); } static bool mev_sh_entry_conn_add(struct mev_sh_entry *e, @@ -174,9 +174,9 @@ static bool mev_sh_entry_conn_add(struct mev_sh_entry *e, static bool mev_sh_entry_xfer_remove(struct mev_sh_entry *e, struct Curl_easy *data) { - bool present = Curl_uint_spbset_contains(&e->xfers, data->mid); + bool present = Curl_uint32_spbset_contains(&e->xfers, data->mid); if(present) - Curl_uint_spbset_remove(&e->xfers, data->mid); + Curl_uint32_spbset_remove(&e->xfers, data->mid); return present; } @@ -356,7 +356,7 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, ", total=%u/%d (xfer/conn)", s, conn ? "connection" : "transfer", conn ? conn->connection_id : data->mid, - Curl_uint_spbset_count(&entry->xfers), + Curl_uint32_spbset_count(&entry->xfers), entry->conn ? 1 : 0); } else { @@ -424,7 +424,7 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, return mresult; CURL_TRC_M(data, "ev entry fd=%" FMT_SOCKET_T ", removed transfer, " "total=%u/%d (xfer/conn)", s, - Curl_uint_spbset_count(&entry->xfers), + Curl_uint32_spbset_count(&entry->xfers), entry->conn ? 1 : 0); } else { @@ -545,18 +545,18 @@ CURLMcode Curl_multi_ev_assess_conn(struct Curl_multi *multi, } CURLMcode Curl_multi_ev_assess_xfer_bset(struct Curl_multi *multi, - struct uint_bset *set) + struct uint32_bset *set) { - unsigned int mid; + uint32_t mid; CURLMcode result = CURLM_OK; - if(multi && multi->socket_cb && Curl_uint_bset_first(set, &mid)) { + if(multi && multi->socket_cb && Curl_uint32_bset_first(set, &mid)) { do { struct Curl_easy *data = Curl_multi_get_easy(multi, mid); if(data) result = Curl_multi_ev_assess_xfer(multi, data); } - while(!result && Curl_uint_bset_next(set, mid, &mid)); + while(!result && Curl_uint32_bset_next(set, mid, &mid)); } return result; } @@ -588,9 +588,9 @@ void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, and just move on. */ if(entry) { struct Curl_easy *data; - unsigned int mid; + uint32_t mid; - if(Curl_uint_spbset_first(&entry->xfers, &mid)) { + if(Curl_uint32_spbset_first(&entry->xfers, &mid)) { do { data = Curl_multi_get_easy(multi, mid); if(data) { @@ -598,10 +598,10 @@ void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, } else { CURL_TRC_M(multi->admin, "socket transfer %u no longer found", mid); - Curl_uint_spbset_remove(&entry->xfers, mid); + Curl_uint32_spbset_remove(&entry->xfers, mid); } } - while(Curl_uint_spbset_next(&entry->xfers, mid, &mid)); + while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid)); } if(entry->conn) diff --git a/lib/multi_ev.h b/lib/multi_ev.h index 34548c323232..4e5b2a454d26 100644 --- a/lib/multi_ev.h +++ b/lib/multi_ev.h @@ -29,7 +29,7 @@ struct Curl_easy; struct Curl_multi; struct easy_pollset; -struct uint_bset; +struct uint32_bset; /* meta key for event pollset at easy handle or connection */ #define CURL_META_MEV_POLLSET "meta:mev:ps" @@ -55,7 +55,7 @@ CURLMcode Curl_multi_ev_assess_xfer(struct Curl_multi *multi, struct Curl_easy *data); /* Assess all easy handles on the list */ CURLMcode Curl_multi_ev_assess_xfer_bset(struct Curl_multi *multi, - struct uint_bset *set); + struct uint32_bset *set); /* Assess the connection by getting its current pollset */ CURLMcode Curl_multi_ev_assess_conn(struct Curl_multi *multi, struct Curl_easy *data, diff --git a/lib/multi_ntfy.c b/lib/multi_ntfy.c index fe7cc0503a76..d7913bbbfc97 100644 --- a/lib/multi_ntfy.c +++ b/lib/multi_ntfy.c @@ -39,8 +39,8 @@ struct mntfy_entry { - unsigned int mid; - unsigned int type; + uint32_t mid; + uint32_t type; }; #define CURL_MNTFY_CHUNK_SIZE 128 @@ -69,7 +69,7 @@ static void mnfty_chunk_reset(struct mntfy_chunk *chunk) static bool mntfy_chunk_append(struct mntfy_chunk *chunk, struct Curl_easy *data, - unsigned int type) + uint32_t type) { struct mntfy_entry *e; @@ -116,7 +116,7 @@ static void mntfy_chunk_dispatch_all(struct Curl_multi *multi, e = &chunk->entries[chunk->r_offset]; data = e->mid ? Curl_multi_get_easy(multi, e->mid) : multi->admin; /* only when notification has not been disabled in the meantime */ - if(data && Curl_uint_bset_contains(&multi->ntfy.enabled, e->type)) { + if(data && Curl_uint32_bset_contains(&multi->ntfy.enabled, e->type)) { /* this may cause new notifications to be added! */ CURL_TRC_M(multi->admin, "[NTFY] dispatch %d to xfer %u", e->type, e->mid); @@ -132,12 +132,12 @@ static void mntfy_chunk_dispatch_all(struct Curl_multi *multi, void Curl_mntfy_init(struct Curl_multi *multi) { memset(&multi->ntfy, 0, sizeof(multi->ntfy)); - Curl_uint_bset_init(&multi->ntfy.enabled); + Curl_uint32_bset_init(&multi->ntfy.enabled); } CURLMcode Curl_mntfy_resize(struct Curl_multi *multi) { - if(Curl_uint_bset_resize(&multi->ntfy.enabled, CURLMNOTIFY_EASY_DONE + 1)) + if(Curl_uint32_bset_resize(&multi->ntfy.enabled, CURLMNOTIFY_EASY_DONE + 1)) return CURLM_OUT_OF_MEMORY; return CURLM_OK; } @@ -150,14 +150,14 @@ void Curl_mntfy_cleanup(struct Curl_multi *multi) mnfty_chunk_destroy(chunk); } multi->ntfy.tail = NULL; - Curl_uint_bset_destroy(&multi->ntfy.enabled); + Curl_uint32_bset_destroy(&multi->ntfy.enabled); } CURLMcode Curl_mntfy_enable(struct Curl_multi *multi, unsigned int type) { if(type > CURLMNOTIFY_EASY_DONE) return CURLM_UNKNOWN_OPTION; - Curl_uint_bset_add(&multi->ntfy.enabled, type); + Curl_uint32_bset_add(&multi->ntfy.enabled, type); return CURLM_OK; } @@ -165,7 +165,7 @@ CURLMcode Curl_mntfy_disable(struct Curl_multi *multi, unsigned int type) { if(type > CURLMNOTIFY_EASY_DONE) return CURLM_UNKNOWN_OPTION; - Curl_uint_bset_remove(&multi->ntfy.enabled, type); + Curl_uint32_bset_remove(&multi->ntfy.enabled, (uint32_t)type); return CURLM_OK; } @@ -173,12 +173,12 @@ void Curl_mntfy_add(struct Curl_easy *data, unsigned int type) { struct Curl_multi *multi = data ? data->multi : NULL; if(multi && multi->ntfy.ntfy_cb && !multi->ntfy.failure && - Curl_uint_bset_contains(&multi->ntfy.enabled, type)) { + Curl_uint32_bset_contains(&multi->ntfy.enabled, (uint32_t)type)) { /* append to list of outstanding notifications */ struct mntfy_chunk *tail = mntfy_non_full_tail(&multi->ntfy); CURL_TRC_M(data, "[NTFY] add %d for xfer %u", type, data->mid); if(tail) - mntfy_chunk_append(tail, data, type); + mntfy_chunk_append(tail, data, (uint32_t)type); else multi->ntfy.failure = CURLM_OUT_OF_MEMORY; } diff --git a/lib/multi_ntfy.h b/lib/multi_ntfy.h index d920b3295d4b..c3094a9ebe71 100644 --- a/lib/multi_ntfy.h +++ b/lib/multi_ntfy.h @@ -32,7 +32,7 @@ struct Curl_multi; struct curl_multi_ntfy { curl_notify_callback ntfy_cb; void *ntfy_cb_data; - struct uint_bset enabled; + struct uint32_bset enabled; CURLMcode failure; struct mntfy_chunk *head; struct mntfy_chunk *tail; diff --git a/lib/multihandle.h b/lib/multihandle.h index fbb8bdfeeb59..a267a209ee56 100644 --- a/lib/multihandle.h +++ b/lib/multihandle.h @@ -91,12 +91,12 @@ struct Curl_multi { unsigned int xfers_alive; /* amount of added transfers that have not yet reached COMPLETE state */ curl_off_t xfers_total_ever; /* total of added transfers, ever. */ - struct uint_tbl xfers; /* transfers added to this multi */ + struct uint32_tbl xfers; /* transfers added to this multi */ /* Each transfer's mid may be present in at most one of these */ - struct uint_bset process; /* transfer being processed */ - struct uint_bset dirty; /* transfer to be run NOW, e.g. ASAP. */ - struct uint_bset pending; /* transfers in waiting (conn limit etc.) */ - struct uint_bset msgsent; /* transfers done with message for application */ + struct uint32_bset process; /* transfer being processed */ + struct uint32_bset dirty; /* transfer to be run NOW, e.g. ASAP. */ + struct uint32_bset pending; /* transfers in waiting (conn limit etc.) */ + struct uint32_bset msgsent; /* transfers done with message for application */ struct Curl_llist msglist; /* a list of messages from completed transfers */ diff --git a/lib/multiif.h b/lib/multiif.h index 81cf665bd3d8..62c68c9cedf3 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -153,7 +153,7 @@ void Curl_multi_xfer_sockbuf_release(struct Curl_easy *data, char *buf); * Returns NULL if not found. */ struct Curl_easy *Curl_multi_get_easy(struct Curl_multi *multi, - unsigned int mid); + uint32_t mid); /* Get the # of transfers current in process/pending. */ unsigned int Curl_multi_xfers_running(struct Curl_multi *multi); diff --git a/lib/uint-bset.c b/lib/uint-bset.c index 7b822344c1f6..82440c56378a 100644 --- a/lib/uint-bset.c +++ b/lib/uint-bset.c @@ -30,32 +30,32 @@ #include "memdebug.h" #ifdef DEBUGBUILD -#define CURL_UINT_BSET_MAGIC 0x62757473 +#define CURL_UINT32_BSET_MAGIC 0x62757473 #endif -void Curl_uint_bset_init(struct uint_bset *bset) +void Curl_uint32_bset_init(struct uint32_bset *bset) { memset(bset, 0, sizeof(*bset)); #ifdef DEBUGBUILD - bset->init = CURL_UINT_BSET_MAGIC; + bset->init = CURL_UINT32_BSET_MAGIC; #endif } -CURLcode Curl_uint_bset_resize(struct uint_bset *bset, unsigned int nmax) +CURLcode Curl_uint32_bset_resize(struct uint32_bset *bset, uint32_t nmax) { - unsigned int nslots = (nmax < (UINT_MAX-63)) ? - ((nmax + 63) / 64) : (UINT_MAX / 64); + uint32_t nslots = (nmax < (UINT32_MAX-63)) ? + ((nmax + 63) / 64) : (UINT32_MAX / 64); - DEBUGASSERT(bset->init == CURL_UINT_BSET_MAGIC); + DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC); if(nslots != bset->nslots) { - curl_uint64_t *slots = calloc(nslots, sizeof(curl_uint64_t)); + uint64_t *slots = calloc(nslots, sizeof(uint64_t)); if(!slots) return CURLE_OUT_OF_MEMORY; if(bset->slots) { memcpy(slots, bset->slots, - (CURLMIN(nslots, bset->nslots) * sizeof(curl_uint64_t))); + (CURLMIN(nslots, bset->nslots) * sizeof(uint64_t))); free(bset->slots); } bset->slots = slots; @@ -66,24 +66,24 @@ CURLcode Curl_uint_bset_resize(struct uint_bset *bset, unsigned int nmax) } -void Curl_uint_bset_destroy(struct uint_bset *bset) +void Curl_uint32_bset_destroy(struct uint32_bset *bset) { - DEBUGASSERT(bset->init == CURL_UINT_BSET_MAGIC); + DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC); free(bset->slots); memset(bset, 0, sizeof(*bset)); } #ifdef UNITTESTS -UNITTEST unsigned int Curl_uint_bset_capacity(struct uint_bset *bset) +UNITTEST uint32_t Curl_uint32_bset_capacity(struct uint32_bset *bset) { return bset->nslots * 64; } #endif -unsigned int Curl_uint_bset_count(struct uint_bset *bset) +uint32_t Curl_uint32_bset_count(struct uint32_bset *bset) { - unsigned int i; - unsigned int n = 0; + uint32_t i; + uint32_t n = 0; for(i = 0; i < bset->nslots; ++i) { if(bset->slots[i]) n += CURL_POPCOUNT64(bset->slots[i]); @@ -91,9 +91,9 @@ unsigned int Curl_uint_bset_count(struct uint_bset *bset) return n; } -bool Curl_uint_bset_empty(struct uint_bset *bset) +bool Curl_uint32_bset_empty(struct uint32_bset *bset) { - unsigned int i; + uint32_t i; for(i = bset->first_slot_used; i < bset->nslots; ++i) { if(bset->slots[i]) return FALSE; @@ -102,47 +102,47 @@ bool Curl_uint_bset_empty(struct uint_bset *bset) } -void Curl_uint_bset_clear(struct uint_bset *bset) +void Curl_uint32_bset_clear(struct uint32_bset *bset) { if(bset->nslots) { - memset(bset->slots, 0, bset->nslots * sizeof(curl_uint64_t)); - bset->first_slot_used = UINT_MAX; + memset(bset->slots, 0, bset->nslots * sizeof(uint64_t)); + bset->first_slot_used = UINT32_MAX; } } -bool Curl_uint_bset_add(struct uint_bset *bset, unsigned int i) +bool Curl_uint32_bset_add(struct uint32_bset *bset, uint32_t i) { - unsigned int islot = i / 64; + uint32_t islot = i / 64; if(islot >= bset->nslots) return FALSE; - bset->slots[islot] |= ((curl_uint64_t)1 << (i % 64)); + bset->slots[islot] |= ((uint64_t)1 << (i % 64)); if(islot < bset->first_slot_used) bset->first_slot_used = islot; return TRUE; } -void Curl_uint_bset_remove(struct uint_bset *bset, unsigned int i) +void Curl_uint32_bset_remove(struct uint32_bset *bset, uint32_t i) { size_t islot = i / 64; if(islot < bset->nslots) - bset->slots[islot] &= ~((curl_uint64_t)1 << (i % 64)); + bset->slots[islot] &= ~((uint64_t)1 << (i % 64)); } -bool Curl_uint_bset_contains(struct uint_bset *bset, unsigned int i) +bool Curl_uint32_bset_contains(struct uint32_bset *bset, uint32_t i) { - unsigned int islot = i / 64; + uint32_t islot = i / 64; if(islot >= bset->nslots) return FALSE; - return (bset->slots[islot] & ((curl_uint64_t)1 << (i % 64))) != 0; + return (bset->slots[islot] & ((uint64_t)1 << (i % 64))) != 0; } -bool Curl_uint_bset_first(struct uint_bset *bset, unsigned int *pfirst) +bool Curl_uint32_bset_first(struct uint32_bset *bset, uint32_t *pfirst) { - unsigned int i; + uint32_t i; for(i = bset->first_slot_used; i < bset->nslots; ++i) { if(bset->slots[i]) { *pfirst = (i * 64) + CURL_CTZ64(bset->slots[i]); @@ -150,15 +150,15 @@ bool Curl_uint_bset_first(struct uint_bset *bset, unsigned int *pfirst) return TRUE; } } - bset->first_slot_used = *pfirst = UINT_MAX; + bset->first_slot_used = *pfirst = UINT32_MAX; return FALSE; } -bool Curl_uint_bset_next(struct uint_bset *bset, unsigned int last, - unsigned int *pnext) +bool Curl_uint32_bset_next(struct uint32_bset *bset, uint32_t last, + uint32_t *pnext) { - unsigned int islot; - curl_uint64_t x; + uint32_t islot; + uint64_t x; ++last; /* look for number one higher than last */ islot = last / 64; /* the slot this would be in */ @@ -178,42 +178,42 @@ bool Curl_uint_bset_next(struct uint_bset *bset, unsigned int last, } } } - *pnext = UINT_MAX; /* a value we cannot store */ + *pnext = UINT32_MAX; /* a value we cannot store */ return FALSE; } #ifdef CURL_POPCOUNT64_IMPLEMENT -unsigned int Curl_popcount64(curl_uint64_t x) +uint32_t Curl_popcount64(uint64_t x) { /* Compute the "Hamming Distance" between 'x' and 0, * which is the number of set bits in 'x'. * See: https://en.wikipedia.org/wiki/Hamming_weight */ - const curl_uint64_t m1 = 0x5555555555555555LL; /* 0101+ */ - const curl_uint64_t m2 = 0x3333333333333333LL; /* 00110011+ */ - const curl_uint64_t m4 = 0x0f0f0f0f0f0f0f0fLL; /* 00001111+ */ + const uint64_t m1 = 0x5555555555555555LL; /* 0101+ */ + const uint64_t m2 = 0x3333333333333333LL; /* 00110011+ */ + const uint64_t m4 = 0x0f0f0f0f0f0f0f0fLL; /* 00001111+ */ /* 1 + 256^1 + 256^2 + 256^3 + ... + 256^7 */ - const curl_uint64_t h01 = 0x0101010101010101LL; + const uint64_t h01 = 0x0101010101010101LL; x -= (x >> 1) & m1; /* replace every 2 bits with bits present */ x = (x & m2) + ((x >> 2) & m2); /* replace every nibble with bits present */ x = (x + (x >> 4)) & m4; /* replace every byte with bits present */ /* top 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... which makes the * top byte the sum of all individual 8 bytes, throw away the rest */ - return (unsigned int)((x * h01) >> 56); + return (uint32_t)((x * h01) >> 56); } #endif /* CURL_POPCOUNT64_IMPLEMENT */ #ifdef CURL_CTZ64_IMPLEMENT -unsigned int Curl_ctz64(curl_uint64_t x) +uint32_t Curl_ctz64(uint64_t x) { - /* count trailing zeros in a curl_uint64_t. + /* count trailing zeros in a uint64_t. * divide and conquer to find the number of lower 0 bits */ - const curl_uint64_t ml32 = 0xFFFFFFFF; /* lower 32 bits */ - const curl_uint64_t ml16 = 0x0000FFFF; /* lower 16 bits */ - const curl_uint64_t ml8 = 0x000000FF; /* lower 8 bits */ - const curl_uint64_t ml4 = 0x0000000F; /* lower 4 bits */ - const curl_uint64_t ml2 = 0x00000003; /* lower 2 bits */ - unsigned int n; + const uint64_t ml32 = 0xFFFFFFFF; /* lower 32 bits */ + const uint64_t ml16 = 0x0000FFFF; /* lower 16 bits */ + const uint64_t ml8 = 0x000000FF; /* lower 8 bits */ + const uint64_t ml4 = 0x0000000F; /* lower 4 bits */ + const uint64_t ml2 = 0x00000003; /* lower 2 bits */ + uint32_t n; if(!x) return 64; @@ -238,6 +238,6 @@ unsigned int Curl_ctz64(curl_uint64_t x) n = n + 2; x = x >> 2; } - return n - (unsigned int)(x & 1); + return n - (uint32_t)(x & 1); } #endif /* CURL_CTZ64_IMPLEMENT */ diff --git a/lib/uint-bset.h b/lib/uint-bset.h index cc405cc656e3..5e5bbdb8fc0b 100644 --- a/lib/uint-bset.h +++ b/lib/uint-bset.h @@ -39,51 +39,51 @@ * the price of slightly slower operations. */ -struct uint_bset { - curl_uint64_t *slots; - unsigned int nslots; - unsigned int first_slot_used; +struct uint32_bset { + uint64_t *slots; + uint32_t nslots; + uint32_t first_slot_used; #ifdef DEBUGBUILD int init; #endif }; /* Initialize the bitset with capacity 0. */ -void Curl_uint_bset_init(struct uint_bset *bset); +void Curl_uint32_bset_init(struct uint32_bset *bset); /* Resize the bitset capacity to hold numbers from 0 to `nmax`, * which rounds up `nmax` to the next multiple of 64. */ -CURLcode Curl_uint_bset_resize(struct uint_bset *bset, unsigned int nmax); +CURLcode Curl_uint32_bset_resize(struct uint32_bset *bset, uint32_t nmax); /* Destroy the bitset, freeing all resources. */ -void Curl_uint_bset_destroy(struct uint_bset *bset); +void Curl_uint32_bset_destroy(struct uint32_bset *bset); /* Get the bitset capacity, e.g. can hold numbers from 0 to capacity - 1. */ -unsigned int Curl_uint_bset_capacity(struct uint_bset *bset); +uint32_t Curl_uint32_bset_capacity(struct uint32_bset *bset); /* Get the cardinality of the bitset, e.g. numbers present in the set. */ -unsigned int Curl_uint_bset_count(struct uint_bset *bset); +uint32_t Curl_uint32_bset_count(struct uint32_bset *bset); /* TRUE of bitset is empty */ -bool Curl_uint_bset_empty(struct uint_bset *bset); +bool Curl_uint32_bset_empty(struct uint32_bset *bset); /* Clear the bitset, making it empty. */ -void Curl_uint_bset_clear(struct uint_bset *bset); +void Curl_uint32_bset_clear(struct uint32_bset *bset); /* Add the number `i` to the bitset. Return FALSE if the number is * outside the set's capacity. * Numbers can be added more than once, without making a difference. */ -bool Curl_uint_bset_add(struct uint_bset *bset, unsigned int i); +bool Curl_uint32_bset_add(struct uint32_bset *bset, uint32_t i); /* Remove the number `i` from the bitset. */ -void Curl_uint_bset_remove(struct uint_bset *bset, unsigned int i); +void Curl_uint32_bset_remove(struct uint32_bset *bset, uint32_t i); /* Return TRUE if the bitset contains number `i`. */ -bool Curl_uint_bset_contains(struct uint_bset *bset, unsigned int i); +bool Curl_uint32_bset_contains(struct uint32_bset *bset, uint32_t i); /* Get the first number in the bitset, e.g. the smallest. * Returns FALSE when the bitset is empty. */ -bool Curl_uint_bset_first(struct uint_bset *bset, unsigned int *pfirst); +bool Curl_uint32_bset_first(struct uint32_bset *bset, uint32_t *pfirst); /* Get the next number in the bitset, following `last` in natural order. * Put another way, this is the smallest number greater than `last` in @@ -96,20 +96,20 @@ bool Curl_uint_bset_first(struct uint_bset *bset, unsigned int *pfirst); * - added numbers lower than 'last' will not show up. * - removed numbers lower or equal to 'last' will not show up. * - removed numbers higher than 'last' will not be visited. */ -bool Curl_uint_bset_next(struct uint_bset *bset, unsigned int last, - unsigned int *pnext); +bool Curl_uint32_bset_next(struct uint32_bset *bset, uint32_t last, + uint32_t *pnext); #ifndef CURL_POPCOUNT64 #define CURL_POPCOUNT64(x) Curl_popcount64(x) #define CURL_POPCOUNT64_IMPLEMENT -unsigned int Curl_popcount64(curl_uint64_t x); +uint32_t Curl_popcount64(uint64_t x); #endif /* !CURL_POPCOUNT64 */ #ifndef CURL_CTZ64 #define CURL_CTZ64(x) Curl_ctz64(x) #define CURL_CTZ64_IMPLEMENT -unsigned int Curl_ctz64(curl_uint64_t x); +uint32_t Curl_ctz64(uint64_t x); #endif /* !CURL_CTZ64 */ #endif /* HEADER_CURL_UINT_BSET_H */ diff --git a/lib/uint-hash.c b/lib/uint-hash.c index 6c665078876c..4677c6ac9128 100644 --- a/lib/uint-hash.c +++ b/lib/uint-hash.c @@ -34,10 +34,10 @@ /* random patterns for API verification */ #ifdef DEBUGBUILD -#define CURL_UINTHASHINIT 0x7117e779 +#define CURL_UINT32_HASHINIT 0x7117e779 #endif -static unsigned int uint_hash_hash(unsigned int id, unsigned int slots) +static uint32_t uint32_hash_hash(uint32_t id, uint32_t slots) { return (id % slots); } @@ -46,12 +46,12 @@ static unsigned int uint_hash_hash(unsigned int id, unsigned int slots) struct uint_hash_entry { struct uint_hash_entry *next; void *value; - unsigned int id; + uint32_t id; }; -void Curl_uint_hash_init(struct uint_hash *h, - unsigned int slots, - Curl_uint_hash_dtor *dtor) +void Curl_uint32_hash_init(struct uint_hash *h, + uint32_t slots, + Curl_uint32_hash_dtor *dtor) { DEBUGASSERT(h); DEBUGASSERT(slots); @@ -61,11 +61,11 @@ void Curl_uint_hash_init(struct uint_hash *h, h->size = 0; h->slots = slots; #ifdef DEBUGBUILD - h->init = CURL_UINTHASHINIT; + h->init = CURL_UINT32_HASHINIT; #endif } -static struct uint_hash_entry *uint_hash_mk_entry(unsigned int id, void *value) +static struct uint_hash_entry *uint32_hash_mk_entry(uint32_t id, void *value) { struct uint_hash_entry *e; @@ -79,8 +79,8 @@ static struct uint_hash_entry *uint_hash_mk_entry(unsigned int id, void *value) return e; } -static void uint_hash_entry_clear(struct uint_hash *h, - struct uint_hash_entry *e) +static void uint32_hash_entry_clear(struct uint_hash *h, + struct uint_hash_entry *e) { DEBUGASSERT(h); DEBUGASSERT(e); @@ -91,78 +91,78 @@ static void uint_hash_entry_clear(struct uint_hash *h, } } -static void uint_hash_entry_destroy(struct uint_hash *h, - struct uint_hash_entry *e) +static void uint32_hash_entry_destroy(struct uint_hash *h, + struct uint_hash_entry *e) { - uint_hash_entry_clear(h, e); + uint32_hash_entry_clear(h, e); free(e); } -static void uint_hash_entry_unlink(struct uint_hash *h, - struct uint_hash_entry **he_anchor, - struct uint_hash_entry *he) +static void uint32_hash_entry_unlink(struct uint_hash *h, + struct uint_hash_entry **he_anchor, + struct uint_hash_entry *he) { *he_anchor = he->next; --h->size; } -static void uint_hash_elem_link(struct uint_hash *h, - struct uint_hash_entry **he_anchor, - struct uint_hash_entry *he) +static void uint32_hash_elem_link(struct uint_hash *h, + struct uint_hash_entry **he_anchor, + struct uint_hash_entry *he) { he->next = *he_anchor; *he_anchor = he; ++h->size; } -#define CURL_UINT_HASH_SLOT(h,id) h->table[uint_hash_hash(id, h->slots)] -#define CURL_UINT_HASH_SLOT_ADDR(h,id) &CURL_UINT_HASH_SLOT(h,id) +#define CURL_UINT32_HASH_SLOT(h,id) h->table[uint32_hash_hash(id, h->slots)] +#define CURL_UINT32_HASH_SLOT_ADDR(h,id) &CURL_UINT32_HASH_SLOT(h,id) -bool Curl_uint_hash_set(struct uint_hash *h, unsigned int id, void *value) +bool Curl_uint32_hash_set(struct uint_hash *h, uint32_t id, void *value) { struct uint_hash_entry *he, **slot; DEBUGASSERT(h); DEBUGASSERT(h->slots); - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); if(!h->table) { h->table = calloc(h->slots, sizeof(*he)); if(!h->table) return FALSE; /* OOM */ } - slot = CURL_UINT_HASH_SLOT_ADDR(h, id); + slot = CURL_UINT32_HASH_SLOT_ADDR(h, id); for(he = *slot; he; he = he->next) { if(he->id == id) { /* existing key entry, overwrite by clearing old pointer */ - uint_hash_entry_clear(h, he); + uint32_hash_entry_clear(h, he); he->value = value; return TRUE; } } - he = uint_hash_mk_entry(id, value); + he = uint32_hash_mk_entry(id, value); if(!he) return FALSE; /* OOM */ - uint_hash_elem_link(h, slot, he); + uint32_hash_elem_link(h, slot, he); return TRUE; } -bool Curl_uint_hash_remove(struct uint_hash *h, unsigned int id) +bool Curl_uint32_hash_remove(struct uint_hash *h, uint32_t id) { DEBUGASSERT(h); DEBUGASSERT(h->slots); - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); if(h->table) { struct uint_hash_entry *he, **he_anchor; - he_anchor = CURL_UINT_HASH_SLOT_ADDR(h, id); + he_anchor = CURL_UINT32_HASH_SLOT_ADDR(h, id); while(*he_anchor) { he = *he_anchor; if(id == he->id) { - uint_hash_entry_unlink(h, he_anchor, he); - uint_hash_entry_destroy(h, he); + uint32_hash_entry_unlink(h, he_anchor, he); + uint32_hash_entry_destroy(h, he); return TRUE; } he_anchor = &he->next; @@ -171,14 +171,14 @@ bool Curl_uint_hash_remove(struct uint_hash *h, unsigned int id) return FALSE; } -void *Curl_uint_hash_get(struct uint_hash *h, unsigned int id) +void *Curl_uint32_hash_get(struct uint_hash *h, uint32_t id) { DEBUGASSERT(h); - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); if(h->table) { struct uint_hash_entry *he; DEBUGASSERT(h->slots); - he = CURL_UINT_HASH_SLOT(h, id); + he = CURL_UINT32_HASH_SLOT(h, id); while(he) { if(id == he->id) { return he->value; @@ -194,28 +194,28 @@ static void uint_hash_clear(struct uint_hash *h) if(h && h->table) { struct uint_hash_entry *he, **he_anchor; size_t i; - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); for(i = 0; i < h->slots; ++i) { he_anchor = &h->table[i]; while(*he_anchor) { he = *he_anchor; - uint_hash_entry_unlink(h, he_anchor, he); - uint_hash_entry_destroy(h, he); + uint32_hash_entry_unlink(h, he_anchor, he); + uint32_hash_entry_destroy(h, he); } } } } #ifdef UNITTESTS -UNITTEST void Curl_uint_hash_clear(struct uint_hash *h) +UNITTEST void Curl_uint32_hash_clear(struct uint_hash *h) { uint_hash_clear(h); } #endif -void Curl_uint_hash_destroy(struct uint_hash *h) +void Curl_uint32_hash_destroy(struct uint_hash *h) { - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); if(h->table) { uint_hash_clear(h); Curl_safefree(h->table); @@ -224,20 +224,20 @@ void Curl_uint_hash_destroy(struct uint_hash *h) h->slots = 0; } -unsigned int Curl_uint_hash_count(struct uint_hash *h) +uint32_t Curl_uint32_hash_count(struct uint_hash *h) { - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); return h->size; } -void Curl_uint_hash_visit(struct uint_hash *h, - Curl_uint_hash_visit_cb *cb, - void *user_data) +void Curl_uint32_hash_visit(struct uint_hash *h, + Curl_uint32_hash_visit_cb *cb, + void *user_data) { if(h && h->table && cb) { struct uint_hash_entry *he; size_t i; - DEBUGASSERT(h->init == CURL_UINTHASHINIT); + DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); for(i = 0; i < h->slots; ++i) { for(he = h->table[i]; he; he = he->next) { if(!cb(he->id, he->value, user_data)) diff --git a/lib/uint-hash.h b/lib/uint-hash.h index 1b52dba4c470..330f61208bfa 100644 --- a/lib/uint-hash.h +++ b/lib/uint-hash.h @@ -30,39 +30,39 @@ #include "llist.h" -/* A version with unsigned int as key */ -typedef void Curl_uint_hash_dtor(unsigned int id, void *value); +/* A version with uint32_t as key */ +typedef void Curl_uint32_hash_dtor(uint32_t id, void *value); struct uint_hash_entry; -/* Hash for `unsigned int` as key */ +/* Hash for `uint32_t` as key */ struct uint_hash { struct uint_hash_entry **table; - Curl_uint_hash_dtor *dtor; - unsigned int slots; - unsigned int size; + Curl_uint32_hash_dtor *dtor; + uint32_t slots; + uint32_t size; #ifdef DEBUGBUILD int init; #endif }; -void Curl_uint_hash_init(struct uint_hash *h, - unsigned int slots, - Curl_uint_hash_dtor *dtor); -void Curl_uint_hash_destroy(struct uint_hash *h); -void Curl_uint_hash_clear(struct uint_hash *h); +void Curl_uint32_hash_init(struct uint_hash *h, + uint32_t slots, + Curl_uint32_hash_dtor *dtor); +void Curl_uint32_hash_destroy(struct uint_hash *h); +void Curl_uint32_hash_clear(struct uint_hash *h); -bool Curl_uint_hash_set(struct uint_hash *h, unsigned int id, void *value); -bool Curl_uint_hash_remove(struct uint_hash *h, unsigned int id); -void *Curl_uint_hash_get(struct uint_hash *h, unsigned int id); -unsigned int Curl_uint_hash_count(struct uint_hash *h); +bool Curl_uint32_hash_set(struct uint_hash *h, uint32_t id, void *value); +bool Curl_uint32_hash_remove(struct uint_hash *h, uint32_t id); +void *Curl_uint32_hash_get(struct uint_hash *h, uint32_t id); +uint32_t Curl_uint32_hash_count(struct uint_hash *h); -typedef bool Curl_uint_hash_visit_cb(unsigned int id, void *value, - void *user_data); +typedef bool Curl_uint32_hash_visit_cb(uint32_t id, void *value, + void *user_data); -void Curl_uint_hash_visit(struct uint_hash *h, - Curl_uint_hash_visit_cb *cb, - void *user_data); +void Curl_uint32_hash_visit(struct uint_hash *h, + Curl_uint32_hash_visit_cb *cb, + void *user_data); #endif /* HEADER_CURL_UINT_HASH_H */ diff --git a/lib/uint-spbset.c b/lib/uint-spbset.c index 2e8e2a139e74..f250bcb1b43f 100644 --- a/lib/uint-spbset.c +++ b/lib/uint-spbset.c @@ -31,33 +31,33 @@ #include "memdebug.h" #ifdef DEBUGBUILD -#define CURL_UINT_SPBSET_MAGIC 0x70737362 +#define CURL_UINT32_SPBSET_MAGIC 0x70737362 #endif /* Clear the bitset, making it empty. */ -UNITTEST void Curl_uint_spbset_clear(struct uint_spbset *bset); +UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset); -void Curl_uint_spbset_init(struct uint_spbset *bset) +void Curl_uint32_spbset_init(struct uint32_spbset *bset) { memset(bset, 0, sizeof(*bset)); #ifdef DEBUGBUILD - bset->init = CURL_UINT_SPBSET_MAGIC; + bset->init = CURL_UINT32_SPBSET_MAGIC; #endif } -void Curl_uint_spbset_destroy(struct uint_spbset *bset) +void Curl_uint32_spbset_destroy(struct uint32_spbset *bset) { - DEBUGASSERT(bset->init == CURL_UINT_SPBSET_MAGIC); - Curl_uint_spbset_clear(bset); + DEBUGASSERT(bset->init == CURL_UINT32_SPBSET_MAGIC); + Curl_uint32_spbset_clear(bset); } -unsigned int Curl_uint_spbset_count(struct uint_spbset *bset) +uint32_t Curl_uint32_spbset_count(struct uint32_spbset *bset) { - struct uint_spbset_chunk *chunk; - unsigned int i, n = 0; + struct uint32_spbset_chunk *chunk; + uint32_t i, n = 0; for(chunk = &bset->head; chunk; chunk = chunk->next) { - for(i = 0; i < CURL_UINT_SPBSET_CH_SLOTS; ++i) { + for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) { if(chunk->slots[i]) n += CURL_POPCOUNT64(chunk->slots[i]); } @@ -65,13 +65,13 @@ unsigned int Curl_uint_spbset_count(struct uint_spbset *bset) return n; } -bool Curl_uint_spbset_empty(struct uint_spbset *bset) +bool Curl_uint32_spbset_empty(struct uint32_spbset *bset) { - struct uint_spbset_chunk *chunk; - unsigned int i; + struct uint32_spbset_chunk *chunk; + uint32_t i; for(chunk = &bset->head; chunk; chunk = chunk->next) { - for(i = 0; i < CURL_UINT_SPBSET_CH_SLOTS; ++i) { + for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) { if(chunk->slots[i]) return FALSE; } @@ -79,9 +79,9 @@ bool Curl_uint_spbset_empty(struct uint_spbset *bset) return TRUE; } -UNITTEST void Curl_uint_spbset_clear(struct uint_spbset *bset) +UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset) { - struct uint_spbset_chunk *next, *chunk; + struct uint32_spbset_chunk *next, *chunk; for(chunk = bset->head.next; chunk; chunk = next) { next = chunk->next; @@ -91,11 +91,11 @@ UNITTEST void Curl_uint_spbset_clear(struct uint_spbset *bset) } -static struct uint_spbset_chunk * -uint_spbset_get_chunk(struct uint_spbset *bset, unsigned int i, bool grow) +static struct uint32_spbset_chunk * +uint32_spbset_get_chunk(struct uint32_spbset *bset, uint32_t i, bool grow) { - struct uint_spbset_chunk *chunk, **panchor = NULL; - unsigned int i_offset = (i & ~CURL_UINT_SPBSET_CH_MASK); + struct uint32_spbset_chunk *chunk, **panchor = NULL; + uint32_t i_offset = (i & ~CURL_UINT32_SPBSET_CH_MASK); if(!bset) return NULL; @@ -134,61 +134,61 @@ uint_spbset_get_chunk(struct uint_spbset *bset, unsigned int i, bool grow) } -bool Curl_uint_spbset_add(struct uint_spbset *bset, unsigned int i) +bool Curl_uint32_spbset_add(struct uint32_spbset *bset, uint32_t i) { - struct uint_spbset_chunk *chunk; - unsigned int i_chunk; + struct uint32_spbset_chunk *chunk; + uint32_t i_chunk; - chunk = uint_spbset_get_chunk(bset, i, TRUE); + chunk = uint32_spbset_get_chunk(bset, i, TRUE); if(!chunk) return FALSE; DEBUGASSERT(i >= chunk->offset); i_chunk = (i - chunk->offset); - DEBUGASSERT((i_chunk / 64) < CURL_UINT_SPBSET_CH_SLOTS); - chunk->slots[(i_chunk / 64)] |= ((curl_uint64_t)1 << (i_chunk % 64)); + DEBUGASSERT((i_chunk / 64) < CURL_UINT32_SPBSET_CH_SLOTS); + chunk->slots[(i_chunk / 64)] |= ((uint64_t)1 << (i_chunk % 64)); return TRUE; } -void Curl_uint_spbset_remove(struct uint_spbset *bset, unsigned int i) +void Curl_uint32_spbset_remove(struct uint32_spbset *bset, uint32_t i) { - struct uint_spbset_chunk *chunk; - unsigned int i_chunk; + struct uint32_spbset_chunk *chunk; + uint32_t i_chunk; - chunk = uint_spbset_get_chunk(bset, i, FALSE); + chunk = uint32_spbset_get_chunk(bset, i, FALSE); if(chunk) { DEBUGASSERT(i >= chunk->offset); i_chunk = (i - chunk->offset); - DEBUGASSERT((i_chunk / 64) < CURL_UINT_SPBSET_CH_SLOTS); - chunk->slots[(i_chunk / 64)] &= ~((curl_uint64_t)1 << (i_chunk % 64)); + DEBUGASSERT((i_chunk / 64) < CURL_UINT32_SPBSET_CH_SLOTS); + chunk->slots[(i_chunk / 64)] &= ~((uint64_t)1 << (i_chunk % 64)); } } -bool Curl_uint_spbset_contains(struct uint_spbset *bset, unsigned int i) +bool Curl_uint32_spbset_contains(struct uint32_spbset *bset, uint32_t i) { - struct uint_spbset_chunk *chunk; - unsigned int i_chunk; + struct uint32_spbset_chunk *chunk; + uint32_t i_chunk; - chunk = uint_spbset_get_chunk(bset, i, FALSE); + chunk = uint32_spbset_get_chunk(bset, i, FALSE); if(chunk) { DEBUGASSERT(i >= chunk->offset); i_chunk = (i - chunk->offset); - DEBUGASSERT((i_chunk / 64) < CURL_UINT_SPBSET_CH_SLOTS); + DEBUGASSERT((i_chunk / 64) < CURL_UINT32_SPBSET_CH_SLOTS); return (chunk->slots[i_chunk / 64] & - ((curl_uint64_t)1 << (i_chunk % 64))) != 0; + ((uint64_t)1 << (i_chunk % 64))) != 0; } return FALSE; } -bool Curl_uint_spbset_first(struct uint_spbset *bset, unsigned int *pfirst) +bool Curl_uint32_spbset_first(struct uint32_spbset *bset, uint32_t *pfirst) { - struct uint_spbset_chunk *chunk; - unsigned int i; + struct uint32_spbset_chunk *chunk; + uint32_t i; for(chunk = &bset->head; chunk; chunk = chunk->next) { - for(i = 0; i < CURL_UINT_SPBSET_CH_SLOTS; ++i) { + for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) { if(chunk->slots[i]) { *pfirst = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i])); return TRUE; @@ -200,29 +200,29 @@ bool Curl_uint_spbset_first(struct uint_spbset *bset, unsigned int *pfirst) } -static bool uint_spbset_chunk_first(struct uint_spbset_chunk *chunk, - unsigned int *pfirst) +static bool uint32_spbset_chunk_first(struct uint32_spbset_chunk *chunk, + uint32_t *pfirst) { - unsigned int i; - for(i = 0; i < CURL_UINT_SPBSET_CH_SLOTS; ++i) { + uint32_t i; + for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) { if(chunk->slots[i]) { *pfirst = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i])); return TRUE; } } - *pfirst = UINT_MAX; /* a value we cannot store */ + *pfirst = UINT32_MAX; /* a value we cannot store */ return FALSE; } -static bool uint_spbset_chunk_next(struct uint_spbset_chunk *chunk, - unsigned int last, - unsigned int *pnext) +static bool uint32_spbset_chunk_next(struct uint32_spbset_chunk *chunk, + uint32_t last, + uint32_t *pnext) { if(chunk->offset <= last) { - curl_uint64_t x; - unsigned int i = ((last - chunk->offset) / 64); - if(i < CURL_UINT_SPBSET_CH_SLOTS) { + uint64_t x; + uint32_t i = ((last - chunk->offset) / 64); + if(i < CURL_UINT32_SPBSET_CH_SLOTS) { x = (chunk->slots[i] >> (last % 64)); if(x) { /* more bits set, next is `last` + trailing0s of the shifted slot */ @@ -230,7 +230,7 @@ static bool uint_spbset_chunk_next(struct uint_spbset_chunk *chunk, return TRUE; } /* no more bits set in the last slot, scan forward */ - for(i = i + 1; i < CURL_UINT_SPBSET_CH_SLOTS; ++i) { + for(i = i + 1; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) { if(chunk->slots[i]) { *pnext = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i])); return TRUE; @@ -238,18 +238,18 @@ static bool uint_spbset_chunk_next(struct uint_spbset_chunk *chunk, } } } - *pnext = UINT_MAX; + *pnext = UINT32_MAX; return FALSE; } -bool Curl_uint_spbset_next(struct uint_spbset *bset, unsigned int last, - unsigned int *pnext) +bool Curl_uint32_spbset_next(struct uint32_spbset *bset, uint32_t last, + uint32_t *pnext) { - struct uint_spbset_chunk *chunk; - unsigned int last_offset; + struct uint32_spbset_chunk *chunk; + uint32_t last_offset; ++last; /* look for the next higher number */ - last_offset = (last & ~CURL_UINT_SPBSET_CH_MASK); + last_offset = (last & ~CURL_UINT32_SPBSET_CH_MASK); for(chunk = &bset->head; chunk; chunk = chunk->next) { if(chunk->offset >= last_offset) { @@ -259,17 +259,17 @@ bool Curl_uint_spbset_next(struct uint_spbset *bset, unsigned int last, if(chunk && (chunk->offset == last_offset)) { /* is there a number higher than last in this chunk? */ - if(uint_spbset_chunk_next(chunk, last, pnext)) + if(uint32_spbset_chunk_next(chunk, last, pnext)) return TRUE; /* not in this chunk */ chunk = chunk->next; } /* look for the first in the "higher" chunks, if there are any. */ while(chunk) { - if(uint_spbset_chunk_first(chunk, pnext)) + if(uint32_spbset_chunk_first(chunk, pnext)) return TRUE; chunk = chunk->next; } - *pnext = UINT_MAX; + *pnext = UINT32_MAX; return FALSE; } diff --git a/lib/uint-spbset.h b/lib/uint-spbset.h index bd2347902c3b..8c46ce4aa8ea 100644 --- a/lib/uint-spbset.h +++ b/lib/uint-spbset.h @@ -27,8 +27,8 @@ #include -/* A "sparse" bitset for unsigned int values. - * It can hold any unsigned int value. +/* A "sparse" bitset for uint32_t values. + * It can hold any uint32_t value. * * Optimized for the case where only a small set of numbers need * to be kept, especially when "close" together. Then storage space @@ -36,48 +36,48 @@ */ /* 4 slots = 256 bits, keep this a 2^n value. */ -#define CURL_UINT_SPBSET_CH_SLOTS 4 -#define CURL_UINT_SPBSET_CH_MASK ((CURL_UINT_SPBSET_CH_SLOTS * 64) - 1) +#define CURL_UINT32_SPBSET_CH_SLOTS 4 +#define CURL_UINT32_SPBSET_CH_MASK ((CURL_UINT32_SPBSET_CH_SLOTS * 64) - 1) /* store the uint value from offset to - * (offset + (CURL_UINT_SPBSET_CHUNK_SLOTS * 64) - 1 */ -struct uint_spbset_chunk { - struct uint_spbset_chunk *next; - curl_uint64_t slots[CURL_UINT_SPBSET_CH_SLOTS]; - unsigned int offset; + * (offset + (CURL_UINT32_SPBSET_CHUNK_SLOTS * 64) - 1 */ +struct uint32_spbset_chunk { + struct uint32_spbset_chunk *next; + uint64_t slots[CURL_UINT32_SPBSET_CH_SLOTS]; + uint32_t offset; }; -struct uint_spbset { - struct uint_spbset_chunk head; +struct uint32_spbset { + struct uint32_spbset_chunk head; #ifdef DEBUGBUILD int init; #endif }; -void Curl_uint_spbset_init(struct uint_spbset *bset); +void Curl_uint32_spbset_init(struct uint32_spbset *bset); -void Curl_uint_spbset_destroy(struct uint_spbset *bset); +void Curl_uint32_spbset_destroy(struct uint32_spbset *bset); /* Get the cardinality of the bitset, e.g. numbers present in the set. */ -unsigned int Curl_uint_spbset_count(struct uint_spbset *bset); +uint32_t Curl_uint32_spbset_count(struct uint32_spbset *bset); /* TRUE of bitset is empty */ -bool Curl_uint_spbset_empty(struct uint_spbset *bset); +bool Curl_uint32_spbset_empty(struct uint32_spbset *bset); /* Add the number `i` to the bitset. * Numbers can be added more than once, without making a difference. * Returns FALSE if allocations failed. */ -bool Curl_uint_spbset_add(struct uint_spbset *bset, unsigned int i); +bool Curl_uint32_spbset_add(struct uint32_spbset *bset, uint32_t i); /* Remove the number `i` from the bitset. */ -void Curl_uint_spbset_remove(struct uint_spbset *bset, unsigned int i); +void Curl_uint32_spbset_remove(struct uint32_spbset *bset, uint32_t i); /* Return TRUE if the bitset contains number `i`. */ -bool Curl_uint_spbset_contains(struct uint_spbset *bset, unsigned int i); +bool Curl_uint32_spbset_contains(struct uint32_spbset *bset, uint32_t i); /* Get the first number in the bitset, e.g. the smallest. * Returns FALSE when the bitset is empty. */ -bool Curl_uint_spbset_first(struct uint_spbset *bset, unsigned int *pfirst); +bool Curl_uint32_spbset_first(struct uint32_spbset *bset, uint32_t *pfirst); /* Get the next number in the bitset, following `last` in natural order. * Put another way, this is the smallest number greater than `last` in @@ -90,7 +90,7 @@ bool Curl_uint_spbset_first(struct uint_spbset *bset, unsigned int *pfirst); * - added numbers lower than 'last' will not show up. * - removed numbers lower or equal to 'last' will not show up. * - removed numbers higher than 'last' will not be visited. */ -bool Curl_uint_spbset_next(struct uint_spbset *bset, unsigned int last, - unsigned int *pnext); +bool Curl_uint32_spbset_next(struct uint32_spbset *bset, uint32_t last, + uint32_t *pnext); #endif /* HEADER_CURL_UINT_SPBSET_H */ diff --git a/lib/uint-table.c b/lib/uint-table.c index 5077363ab0f3..5516ab634bf1 100644 --- a/lib/uint-table.c +++ b/lib/uint-table.c @@ -30,29 +30,29 @@ #include "memdebug.h" #ifdef DEBUGBUILD -#define CURL_UINT_TBL_MAGIC 0x62757473 +#define CURL_UINT32_TBL_MAGIC 0x62757473 #endif /* Clear the table, making it empty. */ -UNITTEST void Curl_uint_tbl_clear(struct uint_tbl *tbl); +UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl); -void Curl_uint_tbl_init(struct uint_tbl *tbl, - Curl_uint_tbl_entry_dtor *entry_dtor) +void Curl_uint32_tbl_init(struct uint32_tbl *tbl, + Curl_uint32_tbl_entry_dtor *entry_dtor) { memset(tbl, 0, sizeof(*tbl)); tbl->entry_dtor = entry_dtor; - tbl->last_key_added = UINT_MAX; + tbl->last_key_added = UINT32_MAX; #ifdef DEBUGBUILD - tbl->init = CURL_UINT_TBL_MAGIC; + tbl->init = CURL_UINT32_TBL_MAGIC; #endif } -static void uint_tbl_clear_rows(struct uint_tbl *tbl, - unsigned int from, - unsigned int upto_excluding) +static void uint32_tbl_clear_rows(struct uint32_tbl *tbl, + uint32_t from, + uint32_t upto_excluding) { - unsigned int i, end; + uint32_t i, end; end = CURLMIN(upto_excluding, tbl->nrows); for(i = from; i < end; ++i) { @@ -66,10 +66,10 @@ static void uint_tbl_clear_rows(struct uint_tbl *tbl, } -CURLcode Curl_uint_tbl_resize(struct uint_tbl *tbl, unsigned int nrows) +CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nrows) { /* we use `tbl->nrows + 1` during iteration, want that to work */ - DEBUGASSERT(tbl->init == CURL_UINT_TBL_MAGIC); + DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC); if(!nrows) return CURLE_BAD_FUNCTION_ARGUMENT; if(nrows != tbl->nrows) { @@ -79,7 +79,7 @@ CURLcode Curl_uint_tbl_resize(struct uint_tbl *tbl, unsigned int nrows) if(tbl->rows) { memcpy(rows, tbl->rows, (CURLMIN(nrows, tbl->nrows) * sizeof(void *))); if(nrows < tbl->nrows) - uint_tbl_clear_rows(tbl, nrows, tbl->nrows); + uint32_tbl_clear_rows(tbl, nrows, tbl->nrows); free(tbl->rows); } tbl->rows = rows; @@ -89,49 +89,49 @@ CURLcode Curl_uint_tbl_resize(struct uint_tbl *tbl, unsigned int nrows) } -void Curl_uint_tbl_destroy(struct uint_tbl *tbl) +void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl) { - DEBUGASSERT(tbl->init == CURL_UINT_TBL_MAGIC); - Curl_uint_tbl_clear(tbl); + DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC); + Curl_uint32_tbl_clear(tbl); free(tbl->rows); memset(tbl, 0, sizeof(*tbl)); } -UNITTEST void Curl_uint_tbl_clear(struct uint_tbl *tbl) +UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl) { - DEBUGASSERT(tbl->init == CURL_UINT_TBL_MAGIC); - uint_tbl_clear_rows(tbl, 0, tbl->nrows); + DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC); + uint32_tbl_clear_rows(tbl, 0, tbl->nrows); DEBUGASSERT(!tbl->nentries); - tbl->last_key_added = UINT_MAX; + tbl->last_key_added = UINT32_MAX; } -unsigned int Curl_uint_tbl_capacity(struct uint_tbl *tbl) +uint32_t Curl_uint32_tbl_capacity(struct uint32_tbl *tbl) { return tbl->nrows; } -unsigned int Curl_uint_tbl_count(struct uint_tbl *tbl) +uint32_t Curl_uint32_tbl_count(struct uint32_tbl *tbl) { return tbl->nentries; } -void *Curl_uint_tbl_get(struct uint_tbl *tbl, unsigned int key) +void *Curl_uint32_tbl_get(struct uint32_tbl *tbl, uint32_t key) { return (key < tbl->nrows) ? tbl->rows[key] : NULL; } -bool Curl_uint_tbl_add(struct uint_tbl *tbl, void *entry, unsigned int *pkey) +bool Curl_uint32_tbl_add(struct uint32_tbl *tbl, void *entry, uint32_t *pkey) { - unsigned int key, start_pos; + uint32_t key, start_pos; - DEBUGASSERT(tbl->init == CURL_UINT_TBL_MAGIC); + DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC); if(!entry || !pkey) return FALSE; - *pkey = UINT_MAX; + *pkey = UINT32_MAX; if(tbl->nentries == tbl->nrows) /* full */ return FALSE; @@ -161,20 +161,20 @@ bool Curl_uint_tbl_add(struct uint_tbl *tbl, void *entry, unsigned int *pkey) } -void Curl_uint_tbl_remove(struct uint_tbl *tbl, unsigned int key) +void Curl_uint32_tbl_remove(struct uint32_tbl *tbl, uint32_t key) { - uint_tbl_clear_rows(tbl, key, key + 1); + uint32_tbl_clear_rows(tbl, key, key + 1); } -bool Curl_uint_tbl_contains(struct uint_tbl *tbl, unsigned int key) +bool Curl_uint32_tbl_contains(struct uint32_tbl *tbl, uint32_t key) { return (key < tbl->nrows) ? !!tbl->rows[key] : FALSE; } -static bool uint_tbl_next_at(struct uint_tbl *tbl, unsigned int key, - unsigned int *pkey, void **pentry) +static bool uint32_tbl_next_at(struct uint32_tbl *tbl, uint32_t key, + uint32_t *pkey, void **pentry) { for(; key < tbl->nrows; ++key) { if(tbl->rows[key]) { @@ -183,33 +183,33 @@ static bool uint_tbl_next_at(struct uint_tbl *tbl, unsigned int key, return TRUE; } } - *pkey = UINT_MAX; /* always invalid */ + *pkey = UINT32_MAX; /* always invalid */ *pentry = NULL; return FALSE; } -bool Curl_uint_tbl_first(struct uint_tbl *tbl, - unsigned int *pkey, void **pentry) +bool Curl_uint32_tbl_first(struct uint32_tbl *tbl, + uint32_t *pkey, void **pentry) { if(!pkey || !pentry) return FALSE; - if(tbl->nentries && uint_tbl_next_at(tbl, 0, pkey, pentry)) + if(tbl->nentries && uint32_tbl_next_at(tbl, 0, pkey, pentry)) return TRUE; DEBUGASSERT(!tbl->nentries); - *pkey = UINT_MAX; /* always invalid */ + *pkey = UINT32_MAX; /* always invalid */ *pentry = NULL; return FALSE; } -bool Curl_uint_tbl_next(struct uint_tbl *tbl, unsigned int last_key, - unsigned int *pkey, void **pentry) +bool Curl_uint32_tbl_next(struct uint32_tbl *tbl, uint32_t last_key, + uint32_t *pkey, void **pentry) { if(!pkey || !pentry) return FALSE; - if(uint_tbl_next_at(tbl, last_key + 1, pkey, pentry)) + if(uint32_tbl_next_at(tbl, last_key + 1, pkey, pentry)) return TRUE; - *pkey = UINT_MAX; /* always invalid */ + *pkey = UINT32_MAX; /* always invalid */ *pentry = NULL; return FALSE; } diff --git a/lib/uint-table.h b/lib/uint-table.h index c74ec7ad634d..f3169fbc8fa2 100644 --- a/lib/uint-table.h +++ b/lib/uint-table.h @@ -28,14 +28,14 @@ #include /* Destructor for a single table entry */ -typedef void Curl_uint_tbl_entry_dtor(unsigned int key, void *entry); +typedef void Curl_uint32_tbl_entry_dtor(uint32_t key, void *entry); -struct uint_tbl { +struct uint32_tbl { void **rows; /* array of void* holding entries */ - Curl_uint_tbl_entry_dtor *entry_dtor; - unsigned int nrows; /* length of `rows` array */ - unsigned int nentries; /* entries in table */ - unsigned int last_key_added; /* UINT_MAX or last key added */ + Curl_uint32_tbl_entry_dtor *entry_dtor; + uint32_t nrows; /* length of `rows` array */ + uint32_t nentries; /* entries in table */ + uint32_t last_key_added; /* UINT_MAX or last key added */ #ifdef DEBUGBUILD int init; #endif @@ -44,42 +44,42 @@ struct uint_tbl { /* Initialize the table with 0 capacity. * The optional `entry_dtor` is called when a table entry is removed, * Passing NULL means no action is taken on removal. */ -void Curl_uint_tbl_init(struct uint_tbl *tbl, - Curl_uint_tbl_entry_dtor *entry_dtor); +void Curl_uint32_tbl_init(struct uint32_tbl *tbl, + Curl_uint32_tbl_entry_dtor *entry_dtor); /* Resize the table to change capacity `nmax`. When `nmax` is reduced, * all present entries with key equal or larger to `nmax` are removed. */ -CURLcode Curl_uint_tbl_resize(struct uint_tbl *tbl, unsigned int nmax); +CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nmax); /* Destroy the table, freeing all entries. */ -void Curl_uint_tbl_destroy(struct uint_tbl *tbl); +void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl); /* Get the table capacity. */ -unsigned int Curl_uint_tbl_capacity(struct uint_tbl *tbl); +uint32_t Curl_uint32_tbl_capacity(struct uint32_tbl *tbl); /* Get the number of entries in the table. */ -unsigned int Curl_uint_tbl_count(struct uint_tbl *tbl); +uint32_t Curl_uint32_tbl_count(struct uint32_tbl *tbl); /* Get the entry for key or NULL if not present */ -void *Curl_uint_tbl_get(struct uint_tbl *tbl, unsigned int key); +void *Curl_uint32_tbl_get(struct uint32_tbl *tbl, uint32_t key); /* Add a new entry to the table and assign it a free key. * Returns FALSE if the table is full. * * Keys are assigned in a round-robin manner. * No matter the capacity, UINT_MAX is never assigned. */ -bool Curl_uint_tbl_add(struct uint_tbl *tbl, void *entry, unsigned int *pkey); +bool Curl_uint32_tbl_add(struct uint32_tbl *tbl, void *entry, uint32_t *pkey); /* Remove the entry with `key`. */ -void Curl_uint_tbl_remove(struct uint_tbl *tbl, unsigned int key); +void Curl_uint32_tbl_remove(struct uint32_tbl *tbl, uint32_t key); /* Return TRUE if the table contains an tryn with that keys. */ -bool Curl_uint_tbl_contains(struct uint_tbl *tbl, unsigned int key); +bool Curl_uint32_tbl_contains(struct uint32_tbl *tbl, uint32_t key); /* Get the first entry in the table (with the smallest `key`). * Returns FALSE if the table is empty. */ -bool Curl_uint_tbl_first(struct uint_tbl *tbl, - unsigned int *pkey, void **pentry); +bool Curl_uint32_tbl_first(struct uint32_tbl *tbl, + uint32_t *pkey, void **pentry); /* Get the next key in the table, following `last_key` in natural order. * Put another way, this is the smallest key greater than `last_key` in @@ -92,7 +92,7 @@ bool Curl_uint_tbl_first(struct uint_tbl *tbl, * - added keys lower than 'last_key' will not show up. * - removed keys lower or equal to 'last_key' will not show up. * - removed keys higher than 'last_key' will not be visited. */ -bool Curl_uint_tbl_next(struct uint_tbl *tbl, unsigned int last_key, - unsigned int *pkey, void **pentry); +bool Curl_uint32_tbl_next(struct uint32_tbl *tbl, uint32_t last_key, + uint32_t *pkey, void **pentry); #endif /* HEADER_CURL_UINT_TABLE_H */ diff --git a/lib/url.c b/lib/url.c index d953734dce9b..8b3f7f5ab738 100644 --- a/lib/url.c +++ b/lib/url.c @@ -513,8 +513,8 @@ CURLcode Curl_open(struct Curl_easy **curl) data->state.recent_conn_id = -1; /* and not assigned an id yet */ data->id = -1; - data->mid = UINT_MAX; - data->master_mid = UINT_MAX; + data->mid = UINT32_MAX; + data->master_mid = UINT32_MAX; data->progress.hide = TRUE; data->state.current_speed = -1; /* init to negative == impossible */ @@ -575,7 +575,7 @@ void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn) Curl_safefree(conn->unix_domain_socket); #endif Curl_safefree(conn->destination); - Curl_uint_spbset_destroy(&conn->xfers_attached); + Curl_uint32_spbset_destroy(&conn->xfers_attached); Curl_hash_destroy(&conn->meta_hash); free(conn); /* free all the connection oriented data */ @@ -1407,7 +1407,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */ /* Initialize the attached xfers bitset */ - Curl_uint_spbset_init(&conn->xfers_attached); + Curl_uint32_spbset_init(&conn->xfers_attached); /* Store the local bind parameters that will be used for this connection */ if(data->set.str[STRING_DEVICE]) { @@ -3685,7 +3685,7 @@ static CURLcode create_conn(struct Curl_easy *data, connections_available = FALSE; break; case CPOOL_LIMIT_TOTAL: - if(data->master_mid != UINT_MAX) + if(data->master_mid != UINT32_MAX) CURL_TRC_M(data, "Allowing sub-requests (like DoH) to override " "max connection limit"); else { diff --git a/lib/urldata.h b/lib/urldata.h index e4fc49753fd4..c71607ea7d2b 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -610,8 +610,8 @@ struct connectdata { handle is still used by one or more easy handles and can only used by any other easy handle without careful consideration (== only for multiplexing) and it cannot be used by another multi handle! */ -#define CONN_INUSE(c) (!Curl_uint_spbset_empty(&(c)->xfers_attached)) -#define CONN_ATTACHED(c) Curl_uint_spbset_count(&(c)->xfers_attached) +#define CONN_INUSE(c) (!Curl_uint32_spbset_empty(&(c)->xfers_attached)) +#define CONN_ATTACHED(c) Curl_uint32_spbset_count(&(c)->xfers_attached) /**** Fields set when inited and not modified again */ curl_off_t connection_id; /* Contains a unique number to make it easier to @@ -671,7 +671,7 @@ struct connectdata { was used on this connection. */ struct curltime keepalive; - struct uint_spbset xfers_attached; /* mids of attached transfers */ + struct uint32_spbset xfers_attached; /* mids of attached transfers */ /* A connection cache from a SHARE might be used in several multi handles. * We MUST not reuse connections that are running in another multi, * for concurrency reasons. That multi might run in another thread. @@ -1631,8 +1631,8 @@ struct Curl_easy { /* once an easy handle is added to a multi, either explicitly by the * libcurl application or implicitly during `curl_easy_perform()`, * a unique identifier inside this one multi instance. */ - unsigned int mid; - unsigned int master_mid; /* if set, this transfer belongs to a master */ + uint32_t mid; + uint32_t master_mid; /* if set, this transfer belongs to a master */ multi_sub_xfer_done_cb *sub_xfer_done; struct connectdata *conn; diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index d6439287846e..ad1f2b2b25c8 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -168,7 +168,7 @@ static void cf_ngtcp2_ctx_init(struct cf_ngtcp2_ctx *ctx) Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, H3_STREAM_POOL_SPARES); curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); - Curl_uint_hash_init(&ctx->streams, 63, h3_stream_hash_free); + Curl_uint32_hash_init(&ctx->streams, 63, h3_stream_hash_free); ctx->initialized = TRUE; } @@ -179,7 +179,7 @@ static void cf_ngtcp2_ctx_free(struct cf_ngtcp2_ctx *ctx) vquic_ctx_free(&ctx->q); Curl_bufcp_free(&ctx->stream_bufcp); curlx_dyn_free(&ctx->scratch); - Curl_uint_hash_destroy(&ctx->streams); + Curl_uint32_hash_destroy(&ctx->streams); Curl_ssl_peer_cleanup(&ctx->peer); } free(ctx); @@ -207,7 +207,7 @@ static void cf_ngtcp2_setup_keep_alive(struct Curl_cfilter *cf, ngtcp2_conn_set_keep_alive_timeout(ctx->qconn, UINT64_MAX); CURL_TRC_CF(data, cf, "no peer idle timeout, unset keep-alive"); } - else if(!Curl_uint_hash_count(&ctx->streams)) { + else if(!Curl_uint32_hash_count(&ctx->streams)) { ngtcp2_conn_set_keep_alive_timeout(ctx->qconn, UINT64_MAX); CURL_TRC_CF(data, cf, "no active streams, unset keep-alive"); } @@ -288,12 +288,12 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, stream->sendbuf_len_in_flight = 0; Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); - if(!Curl_uint_hash_set(&ctx->streams, data->mid, stream)) { + if(!Curl_uint32_hash_set(&ctx->streams, data->mid, stream)) { h3_stream_ctx_free(stream); return CURLE_OUT_OF_MEMORY; } - if(Curl_uint_hash_count(&ctx->streams) == 1) + if(Curl_uint32_hash_count(&ctx->streams) == 1) cf_ngtcp2_setup_keep_alive(cf, data); return CURLE_OK; @@ -303,10 +303,10 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct cf_ngtcp2_sfind_ctx { int64_t stream_id; struct h3_stream_ctx *stream; - unsigned int mid; + uint32_t mid; }; -static bool cf_ngtcp2_sfind(unsigned int mid, void *value, void *user_data) +static bool cf_ngtcp2_sfind(uint32_t mid, void *value, void *user_data) { struct cf_ngtcp2_sfind_ctx *fctx = user_data; struct h3_stream_ctx *stream = value; @@ -325,7 +325,7 @@ cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, int64_t stream_id) struct cf_ngtcp2_sfind_ctx fctx; fctx.stream_id = stream_id; fctx.stream = NULL; - Curl_uint_hash_visit(&ctx->streams, cf_ngtcp2_sfind, &fctx); + Curl_uint32_hash_visit(&ctx->streams, cf_ngtcp2_sfind, &fctx); return fctx.stream; } #else @@ -374,8 +374,8 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) CURL_TRC_CF(data, cf, "[%" PRId64 "] easy handle is done", stream->id); cf_ngtcp2_stream_close(cf, data, stream); - Curl_uint_hash_remove(&ctx->streams, data->mid); - if(!Curl_uint_hash_count(&ctx->streams)) + Curl_uint32_hash_remove(&ctx->streams, data->mid); + if(!Curl_uint32_hash_count(&ctx->streams)) cf_ngtcp2_setup_keep_alive(cf, data); } } diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 9d0193d55440..ade94bf40aa7 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -305,7 +305,7 @@ static void cf_osslq_ctx_init(struct cf_osslq_ctx *ctx) DEBUGASSERT(!ctx->initialized); Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, H3_STREAM_POOL_SPARES); - Curl_uint_hash_init(&ctx->streams, 63, h3_stream_hash_free); + Curl_uint32_hash_init(&ctx->streams, 63, h3_stream_hash_free); ctx->poll_items = NULL; ctx->curl_items = NULL; ctx->items_max = 0; @@ -316,7 +316,7 @@ static void cf_osslq_ctx_free(struct cf_osslq_ctx *ctx) { if(ctx && ctx->initialized) { Curl_bufcp_free(&ctx->stream_bufcp); - Curl_uint_hash_destroy(&ctx->streams); + Curl_uint32_hash_destroy(&ctx->streams); Curl_ssl_peer_cleanup(&ctx->peer); free(ctx->poll_items); free(ctx->curl_items); @@ -634,7 +634,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, stream->recv_buf_nonflow = 0; Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); - if(!Curl_uint_hash_set(&ctx->streams, data->mid, stream)) { + if(!Curl_uint32_hash_set(&ctx->streams, data->mid, stream)) { h3_stream_ctx_free(stream); return CURLE_OUT_OF_MEMORY; } @@ -659,7 +659,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) stream->closed = TRUE; } - Curl_uint_hash_remove(&ctx->streams, data->mid); + Curl_uint32_hash_remove(&ctx->streams, data->mid); } } @@ -668,7 +668,7 @@ struct cf_ossq_find_ctx { struct h3_stream_ctx *stream; }; -static bool cf_osslq_find_stream(unsigned int mid, void *val, void *user_data) +static bool cf_osslq_find_stream(uint32_t mid, void *val, void *user_data) { struct h3_stream_ctx *stream = val; struct cf_ossq_find_ctx *fctx = user_data; @@ -704,7 +704,7 @@ static struct cf_osslq_stream *cf_osslq_get_qstream(struct Curl_cfilter *cf, struct cf_ossq_find_ctx fctx; fctx.stream_id = stream_id; fctx.stream = NULL; - Curl_uint_hash_visit(&ctx->streams, cf_osslq_find_stream, &fctx); + Curl_uint32_hash_visit(&ctx->streams, cf_osslq_find_stream, &fctx); if(fctx.stream) return &fctx.stream->s; } @@ -1392,7 +1392,7 @@ struct cf_ossq_recv_ctx { CURLcode result; }; -static bool cf_osslq_iter_recv(unsigned int mid, void *val, void *user_data) +static bool cf_osslq_iter_recv(uint32_t mid, void *val, void *user_data) { struct h3_stream_ctx *stream = val; struct cf_ossq_recv_ctx *rctx = user_data; @@ -1455,7 +1455,7 @@ static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, rctx.cf = cf; rctx.multi = data->multi; rctx.result = CURLE_OK; - Curl_uint_hash_visit(&ctx->streams, cf_osslq_iter_recv, &rctx); + Curl_uint32_hash_visit(&ctx->streams, cf_osslq_iter_recv, &rctx); result = rctx.result; } @@ -1470,7 +1470,7 @@ struct cf_ossq_fill_ctx { size_t n; }; -static bool cf_osslq_collect_block_send(unsigned int mid, void *val, +static bool cf_osslq_collect_block_send(uint32_t mid, void *val, void *user_data) { struct h3_stream_ctx *stream = val; @@ -1508,8 +1508,8 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, if(ctx->h3.conn) { struct cf_ossq_fill_ctx fill_ctx; - if(ctx->items_max < Curl_uint_hash_count(&ctx->streams)) { - size_t nmax = Curl_uint_hash_count(&ctx->streams); + if(ctx->items_max < Curl_uint32_hash_count(&ctx->streams)) { + size_t nmax = Curl_uint32_hash_count(&ctx->streams); ctx->items_max = 0; tmpptr = realloc(ctx->poll_items, nmax * sizeof(SSL_POLL_ITEM)); if(!tmpptr) { @@ -1534,7 +1534,7 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, fill_ctx.ctx = ctx; fill_ctx.multi = data->multi; fill_ctx.n = 0; - Curl_uint_hash_visit(&ctx->streams, cf_osslq_collect_block_send, + Curl_uint32_hash_visit(&ctx->streams, cf_osslq_collect_block_send, &fill_ctx); poll_count = fill_ctx.n; if(poll_count) { diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 51cadd2e6ead..5082dc750bb5 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -125,7 +125,7 @@ static void cf_quiche_ctx_init(struct cf_quiche_ctx *ctx) #endif Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, H3_STREAM_POOL_SPARES); - Curl_uint_hash_init(&ctx->streams, 63, h3_stream_hash_free); + Curl_uint32_hash_init(&ctx->streams, 63, h3_stream_hash_free); ctx->data_recvd = 0; ctx->initialized = TRUE; } @@ -139,7 +139,7 @@ static void cf_quiche_ctx_free(struct cf_quiche_ctx *ctx) Curl_ssl_peer_cleanup(&ctx->peer); vquic_ctx_free(&ctx->q); Curl_bufcp_free(&ctx->stream_bufcp); - Curl_uint_hash_destroy(&ctx->streams); + Curl_uint32_hash_destroy(&ctx->streams); } free(ctx); } @@ -210,7 +210,7 @@ struct cf_quiche_visit_ctx { void *user_data; }; -static bool cf_quiche_stream_do(unsigned int mid, void *val, void *user_data) +static bool cf_quiche_stream_do(uint32_t mid, void *val, void *user_data) { struct cf_quiche_visit_ctx *vctx = user_data; struct h3_stream_ctx *stream = val; @@ -231,7 +231,7 @@ static void cf_quiche_for_all_streams(struct Curl_cfilter *cf, vctx.multi = multi; vctx.cb = do_cb; vctx.user_data = user_data; - Curl_uint_hash_visit(&ctx->streams, cf_quiche_stream_do, &vctx); + Curl_uint32_hash_visit(&ctx->streams, cf_quiche_stream_do, &vctx); } static bool cf_quiche_do_resume(struct Curl_cfilter *cf, @@ -278,7 +278,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, H3_STREAM_RECV_CHUNKS, BUFQ_OPT_SOFT_LIMIT); Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); - if(!Curl_uint_hash_set(&ctx->streams, data->mid, stream)) { + if(!Curl_uint32_hash_set(&ctx->streams, data->mid, stream)) { h3_stream_ctx_free(stream); return CURLE_OUT_OF_MEMORY; } @@ -308,7 +308,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) if(result) CURL_TRC_CF(data, cf, "data_done, flush egress -> %d", result); } - Curl_uint_hash_remove(&ctx->streams, data->mid); + Curl_uint32_hash_remove(&ctx->streams, data->mid); } } @@ -558,7 +558,7 @@ struct cf_quich_disp_ctx { CURLcode result; }; -static bool cf_quiche_disp_event(unsigned int mid, void *val, void *user_data) +static bool cf_quiche_disp_event(uint32_t mid, void *val, void *user_data) { struct cf_quich_disp_ctx *dctx = user_data; struct h3_stream_ctx *stream = val; @@ -607,7 +607,7 @@ static CURLcode cf_poll_events(struct Curl_cfilter *cf, else { /* another transfer, do not return errors, as they are not for * the calling transfer */ - Curl_uint_hash_visit(&ctx->streams, cf_quiche_disp_event, &dctx); + Curl_uint32_hash_visit(&ctx->streams, cf_quiche_disp_event, &dctx); quiche_h3_event_free(ev); } } diff --git a/lib/vquic/vquic_int.h b/lib/vquic/vquic_int.h index 4e5959a4f803..ef92ab21b730 100644 --- a/lib/vquic/vquic_int.h +++ b/lib/vquic/vquic_int.h @@ -52,7 +52,7 @@ struct cf_quic_ctx { }; #define H3_STREAM_CTX(ctx,data) \ - (data ? Curl_uint_hash_get(&(ctx)->streams, (data)->mid) : NULL) + (data ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL) CURLcode vquic_ctx_init(struct cf_quic_ctx *qctx); void vquic_ctx_free(struct cf_quic_ctx *qctx); diff --git a/tests/unit/unit1616.c b/tests/unit/unit1616.c index 7641cbeace94..5d1e6f247e76 100644 --- a/tests/unit/unit1616.c +++ b/tests/unit/unit1616.c @@ -36,13 +36,13 @@ static void t1616_mydtor(unsigned int id, void *elem) static CURLcode t1616_setup(struct uint_hash *hash) { - Curl_uint_hash_init(hash, 15, t1616_mydtor); + Curl_uint32_hash_init(hash, 15, t1616_mydtor); return CURLE_OK; } static void t1616_stop(struct uint_hash *hash) { - Curl_uint_hash_destroy(hash); + Curl_uint32_hash_destroy(hash); } static CURLcode test_unit1616(const char *arg) @@ -61,27 +61,27 @@ static CURLcode test_unit1616(const char *arg) value = malloc(sizeof(int)); abort_unless(value != NULL, "Out of memory"); *value = 199; - ok = Curl_uint_hash_set(&hash, key, value); + ok = Curl_uint32_hash_set(&hash, key, value); if(!ok) free(value); abort_unless(ok, "insertion into hash failed"); - v = Curl_uint_hash_get(&hash, key); + v = Curl_uint32_hash_get(&hash, key); abort_unless(v == value, "lookup present entry failed"); - v = Curl_uint_hash_get(&hash, key2); + v = Curl_uint32_hash_get(&hash, key2); abort_unless(!v, "lookup missing entry failed"); - Curl_uint_hash_clear(&hash); + Curl_uint32_hash_clear(&hash); /* Attempt to add another key/value pair */ value2 = malloc(sizeof(int)); abort_unless(value2 != NULL, "Out of memory"); *value2 = 204; - ok = Curl_uint_hash_set(&hash, key2, value2); + ok = Curl_uint32_hash_set(&hash, key2, value2); if(!ok) free(value2); abort_unless(ok, "insertion into hash failed"); - v = Curl_uint_hash_get(&hash, key2); + v = Curl_uint32_hash_get(&hash, key2); abort_unless(v == value2, "lookup present entry failed"); - v = Curl_uint_hash_get(&hash, key); + v = Curl_uint32_hash_get(&hash, key); abort_unless(!v, "lookup missing entry failed"); UNITTEST_END(t1616_stop(&hash)) diff --git a/tests/unit/unit3211.c b/tests/unit/unit3211.c index c2fac4bbc52c..1ec30ac9a2af 100644 --- a/tests/unit/unit3211.c +++ b/tests/unit/unit3211.c @@ -30,36 +30,38 @@ static void check_set(const char *name, unsigned int capacity, const unsigned int *s, size_t slen) { - struct uint_bset bset; + struct uint32_bset bset; size_t i, j; unsigned int n, c; curl_mfprintf(stderr, "test %s, capacity=%u, %zu numbers\n", name, capacity, slen); - Curl_uint_bset_init(&bset); - fail_unless(!Curl_uint_bset_resize(&bset, capacity), "bset resize failed"); - c = Curl_uint_bset_capacity(&bset); + Curl_uint32_bset_init(&bset); + fail_unless(!Curl_uint32_bset_resize(&bset, capacity), "bset resize failed"); + c = Curl_uint32_bset_capacity(&bset); fail_unless(c == (((capacity + 63) / 64) * 64), "wrong capacity"); - Curl_uint_bset_clear(&bset); - c = Curl_uint_bset_count(&bset); + Curl_uint32_bset_clear(&bset); + c = Curl_uint32_bset_count(&bset); fail_unless(c == 0, "set count is not 0"); for(i = 0; i < slen; ++i) { /* add all */ - fail_unless(Curl_uint_bset_add(&bset, s[i]), "failed to add"); + fail_unless(Curl_uint32_bset_add(&bset, s[i]), "failed to add"); for(j = i + 1; j < slen; ++j) - fail_unless(!Curl_uint_bset_contains(&bset, s[j]), "unexpectedly found"); + fail_unless(!Curl_uint32_bset_contains(&bset, s[j]), + "unexpectedly found"); } for(i = 0; i < slen; ++i) { /* all present */ - fail_unless(Curl_uint_bset_contains(&bset, s[i]), "failed presence check"); + fail_unless(Curl_uint32_bset_contains(&bset, s[i]), + "failed presence check"); } /* iterator over all numbers */ - fail_unless(Curl_uint_bset_first(&bset, &n), "first failed"); + fail_unless(Curl_uint32_bset_first(&bset, &n), "first failed"); fail_unless(n == s[0], "first not correct number"); for(i = 1; i < slen; ++i) { - fail_unless(Curl_uint_bset_next(&bset, n, &n), "next failed"); + fail_unless(Curl_uint32_bset_next(&bset, n, &n), "next failed"); if(n != s[i]) { curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n); fail_unless(n == s[i], "next not correct number"); @@ -67,57 +69,58 @@ static void check_set(const char *name, unsigned int capacity, } /* Adding capacity number does not work (0 - capacity-1) */ - c = Curl_uint_bset_capacity(&bset); - fail_unless(!Curl_uint_bset_add(&bset, c), "add out of range worked"); + c = Curl_uint32_bset_capacity(&bset); + fail_unless(!Curl_uint32_bset_add(&bset, c), "add out of range worked"); /* The count it correct */ - c = Curl_uint_bset_count(&bset); + c = Curl_uint32_bset_count(&bset); fail_unless(c == slen, "set count is wrong"); for(i = 0; i < slen; i += 2) { /* remove every 2nd */ - Curl_uint_bset_remove(&bset, s[i]); - fail_unless(!Curl_uint_bset_contains(&bset, s[i]), "unexpectedly found"); + Curl_uint32_bset_remove(&bset, s[i]); + fail_unless(!Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly found"); } for(i = 1; i < slen; i += 2) { /* others still there */ - fail_unless(Curl_uint_bset_contains(&bset, s[i]), "unexpectedly gone"); + fail_unless(Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly gone"); } /* The count is half */ - c = Curl_uint_bset_count(&bset); + c = Curl_uint32_bset_count(&bset); fail_unless(c == slen/2, "set count is wrong"); - Curl_uint_bset_clear(&bset); - c = Curl_uint_bset_count(&bset); + Curl_uint32_bset_clear(&bset); + c = Curl_uint32_bset_count(&bset); fail_unless(c == 0, "set count is not 0"); for(i = 0; i < slen; i++) { /* none present any longer */ - fail_unless(!Curl_uint_bset_contains(&bset, s[i]), "unexpectedly there"); + fail_unless(!Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly there"); } for(i = 0; i < slen; ++i) { /* add all again */ - fail_unless(Curl_uint_bset_add(&bset, s[i]), "failed to add"); + fail_unless(Curl_uint32_bset_add(&bset, s[i]), "failed to add"); } - fail_unless(!Curl_uint_bset_resize(&bset, capacity * 2), + fail_unless(!Curl_uint32_bset_resize(&bset, capacity * 2), "resize double failed"); for(i = 0; i < slen; i++) { /* all still present after resize */ - fail_unless(Curl_uint_bset_contains(&bset, s[i]), "unexpectedly lost"); + fail_unless(Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly lost"); } - fail_unless(!Curl_uint_bset_resize(&bset, capacity), "resize back failed"); + fail_unless(!Curl_uint32_bset_resize(&bset, capacity), "resize back failed"); for(i = 0; i < slen; i++) /* all still present after resize back */ - fail_unless(Curl_uint_bset_contains(&bset, s[i]), "unexpectedly lost"); + fail_unless(Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly lost"); - fail_unless(!Curl_uint_bset_resize(&bset, capacity/2), "resize half failed"); + fail_unless(!Curl_uint32_bset_resize(&bset, capacity/2), + "resize half failed"); /* halved the size, what numbers remain in set? */ - c = Curl_uint_bset_capacity(&bset); + c = Curl_uint32_bset_capacity(&bset); n = 0; for(i = 0; i < slen; ++i) { if(s[i] < c) ++n; } - fail_unless(n == Curl_uint_bset_count(&bset), "set count(halved) wrong"); + fail_unless(n == Curl_uint32_bset_count(&bset), "set count(halved) wrong"); for(i = 0; i < n; i++) /* still present after resize half */ - fail_unless(Curl_uint_bset_contains(&bset, s[i]), "unexpectedly lost"); + fail_unless(Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly lost"); - Curl_uint_bset_destroy(&bset); + Curl_uint32_bset_destroy(&bset); } static CURLcode test_unit3211(const char *arg) diff --git a/tests/unit/unit3212.c b/tests/unit/unit3212.c index 261d294528fe..0bffd1f79ce3 100644 --- a/tests/unit/unit3212.c +++ b/tests/unit/unit3212.c @@ -30,20 +30,20 @@ #define TBL_SIZE 100 -static CURLcode t3212_setup(struct uint_tbl *tbl) +static CURLcode t3212_setup(struct uint32_tbl *tbl) { - Curl_uint_tbl_init(tbl, NULL); - return Curl_uint_tbl_resize(tbl, TBL_SIZE); + Curl_uint32_tbl_init(tbl, NULL); + return Curl_uint32_tbl_resize(tbl, TBL_SIZE); } -static void t3212_stop(struct uint_tbl *tbl) +static void t3212_stop(struct uint32_tbl *tbl) { - Curl_uint_tbl_destroy(tbl); + Curl_uint32_tbl_destroy(tbl); } static CURLcode test_unit3212(const char *arg) { - struct uint_tbl tbl; + struct uint32_tbl tbl; int dummy; UNITTEST_BEGIN(t3212_setup(&tbl)) @@ -51,83 +51,85 @@ static CURLcode test_unit3212(const char *arg) unsigned int i, key, n; void *entry; - fail_unless(Curl_uint_tbl_capacity(&tbl) == TBL_SIZE, "wrong capacity"); + fail_unless(Curl_uint32_tbl_capacity(&tbl) == TBL_SIZE, "wrong capacity"); for(i = 0; i < TBL_SIZE; ++i) { - fail_unless(Curl_uint_tbl_add(&tbl, &dummy, &key), "failed to add"); + fail_unless(Curl_uint32_tbl_add(&tbl, &dummy, &key), "failed to add"); fail_unless(key == i, "unexpected key assigned"); } /* table should be full now */ - fail_unless(Curl_uint_tbl_count(&tbl) == TBL_SIZE, "wrong count"); - fail_unless(!Curl_uint_tbl_add(&tbl, &dummy, &key), "could add more"); + fail_unless(Curl_uint32_tbl_count(&tbl) == TBL_SIZE, "wrong count"); + fail_unless(!Curl_uint32_tbl_add(&tbl, &dummy, &key), "could add more"); /* remove every 2nd entry, from full table */ n = TBL_SIZE; for(i = 0; i < TBL_SIZE; i += 2) { - Curl_uint_tbl_remove(&tbl, i); + Curl_uint32_tbl_remove(&tbl, i); --n; - fail_unless(Curl_uint_tbl_count(&tbl) == n, "wrong count after remove"); + fail_unless(Curl_uint32_tbl_count(&tbl) == n, "wrong count after remove"); } /* remove same again, should not change count */ for(i = 0; i < TBL_SIZE; i += 2) { - Curl_uint_tbl_remove(&tbl, i); - fail_unless(Curl_uint_tbl_count(&tbl) == n, "wrong count after remove"); + Curl_uint32_tbl_remove(&tbl, i); + fail_unless(Curl_uint32_tbl_count(&tbl) == n, "wrong count after remove"); } /* still contains all odd entries */ for(i = 1; i < TBL_SIZE; i += 2) { - fail_unless(Curl_uint_tbl_contains(&tbl, i), "does not contain"); - fail_unless(Curl_uint_tbl_get(&tbl, i) == &dummy, + fail_unless(Curl_uint32_tbl_contains(&tbl, i), "does not contain"); + fail_unless(Curl_uint32_tbl_get(&tbl, i) == &dummy, "does not contain dummy"); } /* get the first key */ - fail_unless(Curl_uint_tbl_first(&tbl, &key, &entry), "first failed"); + fail_unless(Curl_uint32_tbl_first(&tbl, &key, &entry), "first failed"); fail_unless(key == 1, "unexpected first key"); fail_unless(entry == &dummy, "unexpected first entry"); /* get the second key */ - fail_unless(Curl_uint_tbl_next(&tbl, 1, &key, &entry), "next1 failed"); + fail_unless(Curl_uint32_tbl_next(&tbl, 1, &key, &entry), "next1 failed"); fail_unless(key == 3, "unexpected second key"); fail_unless(entry == &dummy, "unexpected second entry"); /* get the key after 42 */ - fail_unless(Curl_uint_tbl_next(&tbl, 42, &key, &entry), "next42 failed"); + fail_unless(Curl_uint32_tbl_next(&tbl, 42, &key, &entry), "next42 failed"); fail_unless(key == 43, "unexpected next42 key"); fail_unless(entry == &dummy, "unexpected next42 entry"); /* double capacity */ - n = Curl_uint_tbl_count(&tbl); - fail_unless(!Curl_uint_tbl_resize(&tbl, TBL_SIZE * 2), + n = Curl_uint32_tbl_count(&tbl); + fail_unless(!Curl_uint32_tbl_resize(&tbl, TBL_SIZE * 2), "error doubling size"); - fail_unless(Curl_uint_tbl_count(&tbl) == n, "wrong resize count"); + fail_unless(Curl_uint32_tbl_count(&tbl) == n, "wrong resize count"); /* resize to half of original */ - fail_unless(!Curl_uint_tbl_resize(&tbl, TBL_SIZE / 2), "error halving size"); - fail_unless(Curl_uint_tbl_count(&tbl) == n / 2, "wrong half size count"); + fail_unless(!Curl_uint32_tbl_resize(&tbl, TBL_SIZE / 2), + "error halving size"); + fail_unless(Curl_uint32_tbl_count(&tbl) == n / 2, "wrong half size count"); for(i = 1; i < TBL_SIZE / 2; i += 2) { - fail_unless(Curl_uint_tbl_contains(&tbl, i), "does not contain"); - fail_unless(Curl_uint_tbl_get(&tbl, i) == &dummy, + fail_unless(Curl_uint32_tbl_contains(&tbl, i), "does not contain"); + fail_unless(Curl_uint32_tbl_get(&tbl, i) == &dummy, "does not contain dummy"); } /* clear */ - Curl_uint_tbl_clear(&tbl); - fail_unless(!Curl_uint_tbl_count(&tbl), "count not 0 after clear"); + Curl_uint32_tbl_clear(&tbl); + fail_unless(!Curl_uint32_tbl_count(&tbl), "count not 0 after clear"); for(i = 0; i < TBL_SIZE / 2; ++i) { - fail_unless(!Curl_uint_tbl_contains(&tbl, i), "does contain, should not"); + fail_unless(!Curl_uint32_tbl_contains(&tbl, i), + "does contain, should not"); } /* add after clear gets key 0 again */ - fail_unless(Curl_uint_tbl_add(&tbl, &dummy, &key), "failed to add"); + fail_unless(Curl_uint32_tbl_add(&tbl, &dummy, &key), "failed to add"); fail_unless(key == 0, "unexpected key assigned"); /* remove it again and add, should get key 1 */ - Curl_uint_tbl_remove(&tbl, key); - fail_unless(Curl_uint_tbl_add(&tbl, &dummy, &key), "failed to add"); + Curl_uint32_tbl_remove(&tbl, key); + fail_unless(Curl_uint32_tbl_add(&tbl, &dummy, &key), "failed to add"); fail_unless(key == 1, "unexpected key assigned"); /* clear, fill, remove one, add, should get the removed key again */ - Curl_uint_tbl_clear(&tbl); - for(i = 0; i < Curl_uint_tbl_capacity(&tbl); ++i) - fail_unless(Curl_uint_tbl_add(&tbl, &dummy, &key), "failed to add"); - fail_unless(!Curl_uint_tbl_add(&tbl, &dummy, &key), "add on full"); - Curl_uint_tbl_remove(&tbl, 17); - fail_unless(Curl_uint_tbl_add(&tbl, &dummy, &key), "failed to add again"); + Curl_uint32_tbl_clear(&tbl); + for(i = 0; i < Curl_uint32_tbl_capacity(&tbl); ++i) + fail_unless(Curl_uint32_tbl_add(&tbl, &dummy, &key), "failed to add"); + fail_unless(!Curl_uint32_tbl_add(&tbl, &dummy, &key), "add on full"); + Curl_uint32_tbl_remove(&tbl, 17); + fail_unless(Curl_uint32_tbl_add(&tbl, &dummy, &key), "failed to add again"); fail_unless(key == 17, "unexpected key assigned"); /* and again, triggering key search wrap around */ - Curl_uint_tbl_remove(&tbl, 17); - fail_unless(Curl_uint_tbl_add(&tbl, &dummy, &key), "failed to add again"); + Curl_uint32_tbl_remove(&tbl, 17); + fail_unless(Curl_uint32_tbl_add(&tbl, &dummy, &key), "failed to add again"); fail_unless(key == 17, "unexpected key assigned"); UNITTEST_END(t3212_stop(&tbl)) diff --git a/tests/unit/unit3213.c b/tests/unit/unit3213.c index 850b275c86cf..b0d4d2ced557 100644 --- a/tests/unit/unit3213.c +++ b/tests/unit/unit3213.c @@ -30,35 +30,35 @@ static void check_spbset(const char *name, const unsigned int *s, size_t slen) { - struct uint_spbset bset; + struct uint32_spbset bset; size_t i, j; unsigned int n, c; curl_mfprintf(stderr, "test %s, %zu numbers\n", name, slen); - Curl_uint_spbset_init(&bset); + Curl_uint32_spbset_init(&bset); - Curl_uint_spbset_clear(&bset); - c = Curl_uint_spbset_count(&bset); + Curl_uint32_spbset_clear(&bset); + c = Curl_uint32_spbset_count(&bset); fail_unless(c == 0, "set count is not 0"); for(i = 0; i < slen; ++i) { /* add all */ - fail_unless(Curl_uint_spbset_add(&bset, s[i]), "failed to add"); + fail_unless(Curl_uint32_spbset_add(&bset, s[i]), "failed to add"); for(j = i + 1; j < slen; ++j) - fail_unless(!Curl_uint_spbset_contains(&bset, s[j]), + fail_unless(!Curl_uint32_spbset_contains(&bset, s[j]), "unexpectedly found"); } for(i = 0; i < slen; ++i) { /* all present */ - fail_unless(Curl_uint_spbset_contains(&bset, s[i]), + fail_unless(Curl_uint32_spbset_contains(&bset, s[i]), "failed presence check"); } /* iterator over all numbers */ - fail_unless(Curl_uint_spbset_first(&bset, &n), "first failed"); + fail_unless(Curl_uint32_spbset_first(&bset, &n), "first failed"); fail_unless(n == s[0], "first not correct number"); for(i = 1; i < slen; ++i) { - fail_unless(Curl_uint_spbset_next(&bset, n, &n), "next failed"); + fail_unless(Curl_uint32_spbset_next(&bset, n, &n), "next failed"); if(n != s[i]) { curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n); fail_unless(n == s[i], "next not correct number"); @@ -66,28 +66,30 @@ static void check_spbset(const char *name, const unsigned int *s, size_t slen) } for(i = 0; i < slen; i += 2) { /* remove every 2nd */ - Curl_uint_spbset_remove(&bset, s[i]); - fail_unless(!Curl_uint_spbset_contains(&bset, s[i]), "unexpectedly found"); + Curl_uint32_spbset_remove(&bset, s[i]); + fail_unless(!Curl_uint32_spbset_contains(&bset, s[i]), + "unexpectedly found"); } for(i = 1; i < slen; i += 2) { /* others still there */ - fail_unless(Curl_uint_spbset_contains(&bset, s[i]), "unexpectedly gone"); + fail_unless(Curl_uint32_spbset_contains(&bset, s[i]), "unexpectedly gone"); } /* The count is half */ - c = Curl_uint_spbset_count(&bset); + c = Curl_uint32_spbset_count(&bset); fail_unless(c == slen/2, "set count is wrong"); - Curl_uint_spbset_clear(&bset); - c = Curl_uint_spbset_count(&bset); + Curl_uint32_spbset_clear(&bset); + c = Curl_uint32_spbset_count(&bset); fail_unless(c == 0, "set count is not 0"); for(i = 0; i < slen; i++) { /* none present any longer */ - fail_unless(!Curl_uint_spbset_contains(&bset, s[i]), "unexpectedly there"); + fail_unless(!Curl_uint32_spbset_contains(&bset, s[i]), + "unexpectedly there"); } for(i = 0; i < slen; ++i) { /* add all again */ - fail_unless(Curl_uint_spbset_add(&bset, s[i]), "failed to add"); + fail_unless(Curl_uint32_spbset_add(&bset, s[i]), "failed to add"); } - Curl_uint_spbset_destroy(&bset); + Curl_uint32_spbset_destroy(&bset); } static CURLcode test_unit3213(const char *arg) From 31b1527c1d78d7d91c60abdd132f0d788ec95cfd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Nov 2025 23:03:33 +0100 Subject: [PATCH 535/885] hostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST Follow-up from ce06fe77710525 This allows us to drop the 'keep_negative' variable completely. Closes #19701 --- lib/hostip.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/hostip.c b/lib/hostip.c index 4c1bb9236776..58a7712cf485 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -806,7 +806,6 @@ CURLcode Curl_resolv(struct Curl_easy *data, struct Curl_addrinfo *addr = NULL; bool respwait = FALSE; size_t hostname_len; - bool keep_negative = TRUE; /* cache a negative result */ CURLcode result = CURLE_COULDNT_RESOLVE_HOST; *entry = NULL; @@ -858,7 +857,6 @@ CURLcode Curl_resolv(struct Curl_easy *data, data->set.resolver_start_client); Curl_set_in_callback(data, FALSE); if(st) { - keep_negative = FALSE; result = CURLE_ABORTED_BY_CALLBACK; goto error; } @@ -928,7 +926,6 @@ CURLcode Curl_resolv(struct Curl_easy *data, if(dns) /* avoid a dangling pointer to addr in the dying dns entry */ dns->addr = NULL; - keep_negative = FALSE; result = CURLE_OUT_OF_MEMORY; goto error; } @@ -947,7 +944,7 @@ CURLcode Curl_resolv(struct Curl_easy *data, if(dns) Curl_resolv_unlink(data, &dns); Curl_async_shutdown(data); - if(keep_negative) + if(result == CURLE_COULDNT_RESOLVE_HOST) store_negative_resolve(data, hostname, port); DEBUGASSERT(result); return result; From 4041eea61edd8cf66c6f85c47a430bb5774f017c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 25 Nov 2025 02:34:26 +0100 Subject: [PATCH 536/885] GHA/http3-linux: build nettle manually for GnuTLS 3.8.11+ GnuTLS 3.8.11 started requiring a nettle version new enough to be missing from Ubuntu LTS released a year ago. To keep up testing it, build nettle from source. Besides the necessary one time effort this has the downside that nettle updates now need to be done manually a couple of times per year when renovate detects one. (if I got the renovate formula correct to catch the tag format). Also: - switch the local GnuTLS build to use the release tarball instead of the Git repo and calling the script `bootstrap`. The script could potentially download source code using the cleartext `git:` protocol. It's also downloading lots of content, including a full OpenSSL repo. Ref: https://github.com/gnutls/gnutls/blob/955f7a7fc223642d1ede6d55f094961cb97bfa68/NEWS#L41-L44 Follow-up to 905b718de3fb9287c7c0037b2737aa395f01ad3c #19642 Follow-up to a439fc0e372c3de7df3b8ae3ca7752bc3cbca826 #19613 Closes #19680 --- .github/workflows/http3-linux.yml | 78 +++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 3f52c146563e..06e8e2e97507 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -46,8 +46,10 @@ env: AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251110.0 - # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com - GNUTLS_VERSION: 3.8.10 + # renovate: datasource=github-tags depName=gnutls/nettle versioning=semver registryUrl=https://github.com + NETTLE_VERSION: 3.10.2 + # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver extractVersion=^nettle_?(?.+)_release_.+$ registryUrl=https://github.com + GNUTLS_VERSION: 3.8.11 # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com WOLFSSL_VERSION: 5.8.4 # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com @@ -101,6 +103,15 @@ jobs: path: ~/boringssl/build key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }} + - name: 'cache nettle' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: cache-nettle + env: + cache-name: cache-nettle + with: + path: ~/nettle/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }} + - name: 'cache gnutls' uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 id: cache-gnutls @@ -108,7 +119,7 @@ jobs: cache-name: cache-gnutls with: path: ~/gnutls/build - key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }} + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }} - name: 'cache wolfssl' uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 @@ -135,7 +146,7 @@ jobs: cache-name: cache-ngtcp2 with: path: ~/ngtcp2/build - key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }} + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }} - name: 'cache ngtcp2 boringssl' uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 @@ -161,6 +172,7 @@ jobs: steps.cache-libressl.outputs.cache-hit != 'true' || steps.cache-awslc.outputs.cache-hit != 'true' || steps.cache-boringssl.outputs.cache-hit != 'true' || + steps.cache-nettle.outputs.cache-hit != 'true' || steps.cache-gnutls.outputs.cache-hit != 'true' || steps.cache-wolfssl.outputs.cache-hit != 'true' || steps.cache-nghttp3.outputs.cache-hit != 'true' || @@ -181,7 +193,7 @@ jobs: libbrotli-dev libzstd-dev zlib1g-dev \ libev-dev \ libc-ares-dev \ - nettle-dev libp11-kit-dev autopoint bison gperf gtk-doc-tools libtasn1-bin # for GnuTLS + libp11-kit-dev autopoint bison gperf gtk-doc-tools libtasn1-bin # for GnuTLS echo 'CC=gcc-12' >> "$GITHUB_ENV" echo 'CXX=g++-12' >> "$GITHUB_ENV" @@ -228,19 +240,30 @@ jobs: cmake --build . cmake --install . + - name: 'build nettle' + if: ${{ steps.cache-nettle.outputs.cache-hit != 'true' }} + run: | + cd ~ + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ + --location "https://ftpmirror.gnu.org/nettle/nettle-${NETTLE_VERSION}.tar.gz" | tar -xz + cd "nettle-${NETTLE_VERSION}" + ./configure --disable-dependency-tracking --prefix=/home/runner/nettle/build \ + --disable-silent-rules --disable-static --disable-openssl --disable-documentation + make install + - name: 'build gnutls' if: ${{ steps.cache-gnutls.outputs.cache-hit != 'true' }} run: | cd ~ - git clone --quiet --depth 1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls - cd gnutls - # required: nettle-dev libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin - ./bootstrap - ./configure --disable-dependency-tracking --prefix="$PWD"/build \ - LDFLAGS="-Wl,-rpath,$PWD/build/lib -L$PWD/build/lib" \ + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \ + "https://www.gnupg.org/ftp/gcrypt/gnutls/v${GNUTLS_VERSION%.*}/gnutls-${GNUTLS_VERSION}.tar.xz" | tar -xJ + cd "gnutls-${GNUTLS_VERSION}" + # required: libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin + ./configure --disable-dependency-tracking --prefix=/home/runner/gnutls/build \ + PKG_CONFIG_PATH=/home/runner/nettle/build/lib64/pkgconfig \ + LDFLAGS=-Wl,-rpath,/home/runner/nettle/build/lib64 \ --with-included-libtasn1 --with-included-unistring \ --disable-guile --disable-doc --disable-tests --disable-tools - make make install - name: 'build wolfssl' @@ -280,7 +303,7 @@ jobs: make install make clean ./configure --disable-dependency-tracking --prefix="$PWD"/build \ - PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/wolfssl/build/lib/pkgconfig \ + PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig:/home/runner/nettle/build/lib64/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/wolfssl/build/lib/pkgconfig \ --enable-lib-only --with-openssl --with-gnutls --with-wolfssl --with-boringssl \ BORINGSSL_LIBS='-L/home/runner/awslc/build/lib -lssl -lcrypto' \ BORINGSSL_CFLAGS='-I/home/runner/awslc/build/include' @@ -383,16 +406,18 @@ jobs: -DCMAKE_UNITY_BUILD=ON - name: 'gnutls' - install_packages: nettle-dev libp11-kit-dev + install_packages: libp11-kit-dev install_steps: skipall - PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/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:/home/runner/nghttp2/build/lib/pkgconfig + LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib -Wl,-rpath,/home/runner/nettle/build/lib64 -L/home/runner/nettle/build/lib64 -Wl,-rpath,/home/runner/ngtcp2/build/lib + CPPFLAGS: -I/home/runner/nettle/build/include configure: >- - LDFLAGS=-Wl,-rpath,/home/runner/gnutls/build/lib --with-gnutls=/home/runner/gnutls/build --with-ngtcp2 --enable-ssls-export - name: 'gnutls' - install_packages: nettle-dev libp11-kit-dev - PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig + install_packages: libp11-kit-dev + 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:/home/runner/nghttp2/build/lib/pkgconfig + LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib generate: >- -DCURL_USE_GNUTLS=ON -DUSE_NGTCP2=ON -DCMAKE_UNITY_BUILD=ON @@ -502,6 +527,17 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }} fail-on-cache-miss: true + - name: 'cache nettle' + if: ${{ matrix.build.name == 'gnutls' }} + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: cache-nettle + env: + cache-name: cache-nettle + with: + path: ~/nettle/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }} + fail-on-cache-miss: true + - name: 'cache gnutls' if: ${{ matrix.build.name == 'gnutls' }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 @@ -510,7 +546,7 @@ jobs: cache-name: cache-gnutls with: path: ~/gnutls/build - key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }} + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }} fail-on-cache-miss: true - name: 'cache wolfssl' @@ -541,7 +577,7 @@ jobs: cache-name: cache-ngtcp2 with: path: ~/ngtcp2/build - key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }} + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }} fail-on-cache-miss: true - name: 'cache ngtcp2 boringssl' @@ -604,6 +640,8 @@ jobs: - name: 'configure' env: + CPPFLAGS: '${{ matrix.build.CPPFLAGS }}' + LDFLAGS: '${{ matrix.build.LDFLAGS }}' MATRIX_CONFIGURE: '${{ matrix.build.configure }}' MATRIX_GENERATE: '${{ matrix.build.generate }}' MATRIX_PKG_CONFIG_PATH: '${{ matrix.build.PKG_CONFIG_PATH }}' From ea7df8d07671240536f6ab03eaee5ffb49ddc5f7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Nov 2025 00:47:04 +0100 Subject: [PATCH 537/885] docs: spell it Rustls with a capital R I believe this is how the project itself uses it. Closes #19702 --- docs/INSTALL.md | 2 +- docs/cmdline-opts/ca-native.md | 4 ++-- docs/cmdline-opts/tls-earlydata.md | 2 +- docs/libcurl/opts/CURLINFO_CERTINFO.md | 2 +- docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md | 2 +- docs/libcurl/opts/CURLOPT_CERTINFO.md | 2 +- docs/libcurl/opts/CURLOPT_CRLFILE.md | 2 +- docs/libcurl/opts/CURLOPT_ECH.md | 4 ++-- docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md | 2 +- docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md | 2 +- docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md | 4 ++-- docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md | 2 +- scripts/cd2nroff | 2 +- 15 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index f3db34da280a..1859dc21ae7f 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -141,7 +141,7 @@ These options are provided to select the TLS backend to use. - GnuTLS: `--with-gnutls`. - mbedTLS: `--with-mbedtls` - OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls) - - rustls: `--with-rustls` + - Rustls: `--with-rustls` - Schannel: `--with-schannel` - wolfSSL: `--with-wolfssl` diff --git a/docs/cmdline-opts/ca-native.md b/docs/cmdline-opts/ca-native.md index a8e8c5e9a8ae..4a887df558a6 100644 --- a/docs/cmdline-opts/ca-native.md +++ b/docs/cmdline-opts/ca-native.md @@ -34,8 +34,8 @@ Fedora, RHEL), macOS, Android and iOS. (Added in 8.3.0) This option works with GnuTLS (Added in 8.5.0) and also uses Apple SecTrust when libcurl is built with it. (Added in 8.17.0) -This option works with rustls on Windows, macOS, Android and iOS. On Linux it -is equivalent to using the Mozilla CA certificate bundle. When used with rustls +This option works with Rustls on Windows, macOS, Android and iOS. On Linux it +is equivalent to using the Mozilla CA certificate bundle. When used with Rustls _only_ the native CA store is consulted, not other locations set at run time or build time. (Added in 8.13.0) diff --git a/docs/cmdline-opts/tls-earlydata.md b/docs/cmdline-opts/tls-earlydata.md index 642897798304..8e344758be5e 100644 --- a/docs/cmdline-opts/tls-earlydata.md +++ b/docs/cmdline-opts/tls-earlydata.md @@ -21,7 +21,7 @@ Enable the use of TLSv1.3 early data, also known as '0RTT' where possible. This has security implications for the requests sent that way. This option can be used when curl is built to use GnuTLS, wolfSSL, quictls and -OpenSSL as a TLS provider (but not BoringSSL, AWS-LC, or rustls). +OpenSSL as a TLS provider (but not BoringSSL, AWS-LC, or Rustls). If a server supports this TLSv1.3 feature, and to what extent, is announced as part of the TLS "session" sent back to curl. Until curl has seen such diff --git a/docs/libcurl/opts/CURLINFO_CERTINFO.md b/docs/libcurl/opts/CURLINFO_CERTINFO.md index f9fd0ad51c6d..d97c311cc8cd 100644 --- a/docs/libcurl/opts/CURLINFO_CERTINFO.md +++ b/docs/libcurl/opts/CURLINFO_CERTINFO.md @@ -14,7 +14,7 @@ TLS-backend: - OpenSSL - GnuTLS - Schannel - - rustls + - Rustls Added-in: 7.19.1 --- diff --git a/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md b/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md index 99bfaf11e673..eb0e24f36aff 100644 --- a/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md @@ -15,7 +15,7 @@ TLS-backend: - OpenSSL - GnuTLS - mbedTLS - - rustls + - Rustls - wolfSSL - Schannel Added-in: 7.77.0 diff --git a/docs/libcurl/opts/CURLOPT_CERTINFO.md b/docs/libcurl/opts/CURLOPT_CERTINFO.md index 7c6641a9fd3e..baddc3079702 100644 --- a/docs/libcurl/opts/CURLOPT_CERTINFO.md +++ b/docs/libcurl/opts/CURLOPT_CERTINFO.md @@ -16,7 +16,7 @@ TLS-backend: - OpenSSL - GnuTLS - Schannel - - rustls + - Rustls Added-in: 7.19.1 --- diff --git a/docs/libcurl/opts/CURLOPT_CRLFILE.md b/docs/libcurl/opts/CURLOPT_CRLFILE.md index d5452db19bdc..0c4eca6c784f 100644 --- a/docs/libcurl/opts/CURLOPT_CRLFILE.md +++ b/docs/libcurl/opts/CURLOPT_CRLFILE.md @@ -14,7 +14,7 @@ TLS-backend: - GnuTLS - mbedTLS - OpenSSL - - rustls + - Rustls Added-in: 7.19.0 --- diff --git a/docs/libcurl/opts/CURLOPT_ECH.md b/docs/libcurl/opts/CURLOPT_ECH.md index 9ac65a73a05d..0cb2d7e4fd75 100644 --- a/docs/libcurl/opts/CURLOPT_ECH.md +++ b/docs/libcurl/opts/CURLOPT_ECH.md @@ -11,7 +11,7 @@ Protocol: TLS-backend: - OpenSSL - wolfSSL - - rustls + - Rustls Added-in: 8.8.0 --- @@ -33,7 +33,7 @@ ECH is only compatible with TLSv1.3. This experimental feature requires a special build of OpenSSL, as ECH is not yet supported in OpenSSL releases. In contrast ECH is supported by the latest -BoringSSL, wolfSSL and rustls-ffi releases. +BoringSSL, wolfSSL and Rustls-ffi releases. There is also a known issue with using wolfSSL which does not support ECH when the HelloRetryRequest mechanism is used. diff --git a/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md b/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md index a352886e061f..16af56e5cda6 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md @@ -18,7 +18,7 @@ Protocol: - TLS TLS-backend: - OpenSSL - - rustls + - Rustls - Schannel Added-in: 7.77.0 --- diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md b/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md index 239ce03c73dd..718b2617491c 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md @@ -17,7 +17,7 @@ TLS-backend: - Schannel - wolfSSL - mbedTLS - - rustls + - Rustls Added-in: 7.52.0 --- diff --git a/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md b/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md index ee17d27e99c1..18b5516c5e65 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md @@ -16,7 +16,7 @@ TLS-backend: - OpenSSL - wolfSSL - mbedTLS - - rustls + - Rustls Added-in: 7.61.0 --- diff --git a/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md b/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md index c71a58d6850d..a177d5231722 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md +++ b/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md @@ -17,7 +17,7 @@ TLS-backend: - Schannel - wolfSSL - mbedTLS - - rustls + - Rustls - GnuTLS Added-in: 7.9 --- diff --git a/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md b/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md index 79ced71ea76d..ddd7965ee2ef 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md @@ -79,8 +79,8 @@ Works with wolfSSL on Windows, Linux (Debian, Ubuntu, Gentoo, Fedora, RHEL), macOS, Android and iOS (added in 8.3.0); with GnuTLS (added in 8.5.0) and with OpenSSL and its forks (LibreSSL, BoringSSL, etc) on Windows (Added in 7.71.0). -This works with rustls on Windows, macOS, Android and iOS. On Linux it is -equivalent to using the Mozilla CA certificate bundle. When used with rustls +This works with Rustls on Windows, macOS, Android and iOS. On Linux it is +equivalent to using the Mozilla CA certificate bundle. When used with Rustls _only_ the native CA store is consulted, not other locations set at run time or build time. (Added in 8.13.0) diff --git a/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md b/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md index 62f734f9633b..41cdec07bc51 100644 --- a/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md +++ b/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md @@ -17,7 +17,7 @@ TLS-backend: - OpenSSL - wolfSSL - mbedTLS - - rustls + - Rustls Added-in: 7.61.0 --- diff --git a/scripts/cd2nroff b/scripts/cd2nroff index 3f1162a7396c..e97d1299ddbd 100755 --- a/scripts/cd2nroff +++ b/scripts/cd2nroff @@ -189,7 +189,7 @@ my %knowntls = ( 'GnuTLS' => 1, 'mbedTLS' => 1, 'OpenSSL' => 1, - 'rustls' => 1, + 'Rustls' => 1, 'Schannel' => 1, 'wolfSSL' => 1, 'All' => 1, From cb722b32ad163ecdf12b408f2ea86346fe83e199 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Nov 2025 08:23:04 +0100 Subject: [PATCH 538/885] urlapi: handle OOM properly when setting URL Closes #19704 --- lib/urlapi.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/urlapi.c b/lib/urlapi.c index a3d9efdb919f..9d3eb0f8cf0f 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -1687,22 +1687,31 @@ static CURLUcode set_url(CURLU *u, const char *url, size_t part_size, if(!part_size) { /* a blank URL is not a valid URL unless we already have a complete one and this is a redirect */ - if(!curl_url_get(u, CURLUPART_URL, &oldurl, flags)) { + uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags); + if(!uc) { /* success, meaning the "" is a fine relative URL, but nothing changes */ free(oldurl); return CURLUE_OK; } + if(uc == CURLUE_OUT_OF_MEMORY) + return uc; return CURLUE_MALFORMED_INPUT; } - /* if the new thing is absolute or the old one is not (we could not get an - * absolute URL in 'oldurl'), then replace the existing with the new. */ + /* if the new URL is absolute replace the existing with the new. */ if(Curl_is_absolute_url(url, NULL, 0, - flags & (CURLU_GUESS_SCHEME|CURLU_DEFAULT_SCHEME)) - || curl_url_get(u, CURLUPART_URL, &oldurl, flags)) { + flags & (CURLU_GUESS_SCHEME|CURLU_DEFAULT_SCHEME))) return parseurl_and_replace(url, u, flags); - } + + /* if the old URL is incomplete (we cannot get an absolute URL in + 'oldurl'), replace the existing with the new */ + uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags); + if(uc == CURLUE_OUT_OF_MEMORY) + return uc; + else if(uc) + return parseurl_and_replace(url, u, flags); + DEBUGASSERT(oldurl); /* it is set here */ /* apply the relative part to create a new URL */ uc = redirect_url(oldurl, url, u, flags); From 0d2bb9c7c6d6ccdc48bb0414b80204acbd29f923 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Nov 2025 11:01:09 +0100 Subject: [PATCH 539/885] http: fix OOM exit in Curl_http_follow Spotted by "strict torture" tests. Closes #19705 --- lib/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index ae932cd7c93a..144a898ea0eb 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1282,7 +1282,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, CURLU_ALLOW_SPACE | (data->set.path_as_is ? CURLU_PATH_AS_IS : 0))); if(uc) { - if(type != FOLLOW_FAKE) { + if((uc == CURLUE_OUT_OF_MEMORY) || (type != FOLLOW_FAKE)) { failf(data, "The redirect target URL could not be parsed: %s", curl_url_strerror(uc)); return Curl_uc_to_curlcode(uc); From 2acdc4f549ac4aee691ed5782b32a1c5c9f86dbe Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 26 Nov 2025 02:03:29 +0100 Subject: [PATCH 540/885] autotools: add nettle library detection via pkg-config (for GnuTLS) Also: - fix to restore full state when gnutls canary function is not found. - fix indentation. Closes #19703 --- .github/workflows/http3-linux.yml | 4 +- m4/curl-gnutls.m4 | 73 ++++++++++++++++++++++++++----- 2 files changed, 62 insertions(+), 15 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 06e8e2e97507..87738dd79138 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -409,8 +409,7 @@ jobs: install_packages: libp11-kit-dev install_steps: skipall 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:/home/runner/nghttp2/build/lib/pkgconfig - LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib -Wl,-rpath,/home/runner/nettle/build/lib64 -L/home/runner/nettle/build/lib64 -Wl,-rpath,/home/runner/ngtcp2/build/lib - CPPFLAGS: -I/home/runner/nettle/build/include + LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib -Wl,-rpath,/home/runner/nettle/build/lib64 -Wl,-rpath,/home/runner/ngtcp2/build/lib configure: >- --with-gnutls=/home/runner/gnutls/build --with-ngtcp2 --enable-ssls-export @@ -640,7 +639,6 @@ jobs: - name: 'configure' env: - CPPFLAGS: '${{ matrix.build.CPPFLAGS }}' LDFLAGS: '${{ matrix.build.LDFLAGS }}' MATRIX_CONFIGURE: '${{ matrix.build.configure }}' MATRIX_GENERATE: '${{ matrix.build.generate }}' diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index 9fa7e2451570..f1aa04d3faf6 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -100,18 +100,20 @@ if test "x$OPT_GNUTLS" != xno; then dnl this function is selected since it was introduced in 3.1.10 AC_CHECK_LIB(gnutls, gnutls_x509_crt_get_dn2, - [ + [ AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) GNUTLS_ENABLED=1 USE_GNUTLS="yes" ssl_msg="GnuTLS" QUIC_ENABLED=yes test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" - ]) + ], + [ + LIBS="$CLEANLIBS" + CPPFLAGS="$CLEANCPPFLAGS" + LDFLAGS="$CLEANLDFLAGS" + LDFLAGSPC="$CLEANLDFLAGSPC" + ]) if test "x$USE_GNUTLS" = "xyes"; then AC_MSG_NOTICE([detected GnuTLS version $version]) @@ -127,9 +129,8 @@ if test "x$OPT_GNUTLS" != xno; then AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH]) fi fi - LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gnutls nettle" + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gnutls" fi - fi fi dnl GNUTLS not disabled @@ -147,12 +148,60 @@ if test "$GNUTLS_ENABLED" = "1"; then # If not, try linking directly to both of them to see if they are available if test "$USE_GNUTLS_NETTLE" = ""; then - AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) + + dnl this is with no particular path given + CURL_CHECK_PKGCONFIG(nettle) + + if test "$PKGCONFIG" != "no" ; then + addlib=`$PKGCONFIG --libs-only-l nettle` + addld=`$PKGCONFIG --libs-only-L nettle` + addcflags=`$PKGCONFIG --cflags-only-I nettle` + version=`$PKGCONFIG --modversion nettle` + gtlslib=`echo $addld | $SED -e 's/^-L//'` + + if test -n "$addlib"; then + + CLEANLIBS="$LIBS" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + + LIBS="$addlib $LIBS" + LDFLAGS="$LDFLAGS $addld" + LDFLAGSPC="$LDFLAGSPC $addld" + if test "$addcflags" != "-I/usr/include"; then + CPPFLAGS="$CPPFLAGS $addcflags" + fi + + AC_CHECK_LIB(nettle, nettle_MD5Init, + [ + USE_GNUTLS_NETTLE=1 + ], + [ + LIBS="$CLEANLIBS" + CPPFLAGS="$CLEANCPPFLAGS" + LDFLAGS="$CLEANLDFLAGS" + LDFLAGSPC="$CLEANLDFLAGSPC" + ]) + + if test "$USE_GNUTLS_NETTLE" = "1"; then + if test -z "$version"; then + version="unknown" + fi + AC_MSG_NOTICE([detected nettle version $version]) + fi + fi + fi + if test "$USE_GNUTLS_NETTLE" = ""; then + AC_MSG_ERROR([GnuTLS found, but nettle was not found]) + fi + else + LIBS="-lnettle $LIBS" fi - if test "$USE_GNUTLS_NETTLE" = ""; then - AC_MSG_ERROR([GnuTLS found, but nettle was not found]) + + if test "$USE_GNUTLS_NETTLE" = "1"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE nettle" fi - LIBS="-lnettle $LIBS" dnl --- dnl We require GnuTLS with SRP support. From c722346518365c401b572f8dbe5fa6792ba923cd Mon Sep 17 00:00:00 2001 From: BANADDA Date: Sat, 15 Nov 2025 02:08:10 +0000 Subject: [PATCH 541/885] examples/multi-uv: fix invalid req->data access The on_uv_timeout callback was trying to access req->data as a curl_context pointer, but uv.timeout.data was never initialized, making it always NULL. This rendered the code inside the if(context) block unreachable. Fixes #19462 Closes #19538 --- docs/examples/multi-uv.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index 190bed3ef475..75fec20199b3 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -160,12 +160,19 @@ static void on_uv_socket(uv_poll_t *req, int status, int events) /* callback from libuv when timeout expires */ static void on_uv_timeout(uv_timer_t *req) { - struct curl_context *context = (struct curl_context *) req->data; - if(context) { - int running_handles; - curl_multi_socket_action(context->uv->multi, CURL_SOCKET_TIMEOUT, 0, - &running_handles); - check_multi_info(context); + /* get the datauv struct from the timer handle */ + struct datauv *uv = (struct datauv *)req; + int running_handles; + + curl_multi_socket_action(uv->multi, CURL_SOCKET_TIMEOUT, 0, + &running_handles); + + /* We do not have a curl_context here, so we need to check messages + differently. Create a temporary context just for the check. */ + if(running_handles) { + struct curl_context temp_context; + temp_context.uv = uv; + check_multi_info(&temp_context); } } From 0b09ad8ecbb1e80bc5f621fc012080ab2abf61c4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 26 Nov 2025 12:56:44 +0100 Subject: [PATCH 542/885] examples/multi-uv: simplify passing `uv` struct Reported-by: st751228051 on github Follow-up to c722346518365c401b572f8dbe5fa6792ba923cd #19538 #19462 Closes #19707 --- docs/examples/multi-uv.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index 75fec20199b3..1dac32048927 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -104,7 +104,7 @@ static void add_download(const char *url, int num, CURLM *multi) fprintf(stderr, "Added download %s -> %s\n", url, filename); } -static void check_multi_info(struct curl_context *context) +static void check_multi_info(struct datauv *uv) { char *done_url; CURLMsg *message; @@ -112,7 +112,7 @@ static void check_multi_info(struct curl_context *context) CURL *curl; FILE *file; - while((message = curl_multi_info_read(context->uv->multi, &pending))) { + while((message = curl_multi_info_read(uv->multi, &pending))) { switch(message->msg) { case CURLMSG_DONE: /* Do not use message data after calling curl_multi_remove_handle() and @@ -126,7 +126,7 @@ static void check_multi_info(struct curl_context *context) curl_easy_getinfo(curl, CURLINFO_PRIVATE, &file); printf("%s DONE\n", done_url); - curl_multi_remove_handle(context->uv->multi, curl); + curl_multi_remove_handle(uv->multi, curl); curl_easy_cleanup(curl); if(file) { fclose(file); @@ -154,7 +154,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events) curl_multi_socket_action(context->uv->multi, context->sockfd, flags, &running_handles); - check_multi_info(context); + check_multi_info(context->uv); } /* callback from libuv when timeout expires */ @@ -167,13 +167,8 @@ static void on_uv_timeout(uv_timer_t *req) curl_multi_socket_action(uv->multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); - /* We do not have a curl_context here, so we need to check messages - differently. Create a temporary context just for the check. */ - if(running_handles) { - struct curl_context temp_context; - temp_context.uv = uv; - check_multi_info(&temp_context); - } + if(running_handles) + check_multi_info(uv); } /* callback from libcurl to update the timeout expiry */ From 94ce87c39124d9845aa1e3ce170b9b227ddece89 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 26 Nov 2025 12:02:02 +0100 Subject: [PATCH 543/885] types: remove curl_int64_t/curl_uint64_t These types and the definitions surrounding them are no longer needed. Closes #19706 --- lib/curl_setup.h | 14 ---- lib/curl_sha512_256.c | 180 ++++++++++++++++++++--------------------- lib/vquic/curl_osslq.c | 7 +- src/tool_util.c | 8 +- 4 files changed, 97 insertions(+), 112 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 664aa1432532..48b9ea9ea9f9 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -571,20 +571,6 @@ #endif #define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1) -#if (SIZEOF_CURL_OFF_T != 8) -# error "curl_off_t must be exactly 64 bits" -#else - typedef unsigned CURL_TYPEOF_CURL_OFF_T curl_uint64_t; - typedef CURL_TYPEOF_CURL_OFF_T curl_int64_t; -# ifndef CURL_SUFFIX_CURL_OFF_TU -# error "CURL_SUFFIX_CURL_OFF_TU must be defined" -# endif -# define CURL_UINT64_SUFFIX CURL_SUFFIX_CURL_OFF_TU -# define CURL_UINT64_C(val) CURL_CONC_MACROS(val,CURL_UINT64_SUFFIX) -# define FMT_PRId64 CURL_FORMAT_CURL_OFF_T -# define FMT_PRIu64 CURL_FORMAT_CURL_OFF_TU -#endif - #define FMT_OFF_T CURL_FORMAT_CURL_OFF_T #define FMT_OFF_TU CURL_FORMAT_CURL_OFF_TU diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index 070d1722cbce..af768fd2aa5f 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -287,30 +287,30 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, Can be moved to other headers to reuse. */ #define CURL_GET_64BIT_BE(ptr) \ - ( ((curl_uint64_t)(((const unsigned char*)(ptr))[0]) << 56) | \ - ((curl_uint64_t)(((const unsigned char*)(ptr))[1]) << 48) | \ - ((curl_uint64_t)(((const unsigned char*)(ptr))[2]) << 40) | \ - ((curl_uint64_t)(((const unsigned char*)(ptr))[3]) << 32) | \ - ((curl_uint64_t)(((const unsigned char*)(ptr))[4]) << 24) | \ - ((curl_uint64_t)(((const unsigned char*)(ptr))[5]) << 16) | \ - ((curl_uint64_t)(((const unsigned char*)(ptr))[6]) << 8) | \ - (curl_uint64_t)(((const unsigned char*)(ptr))[7]) ) + ( ((uint64_t)(((const uint8_t*)(ptr))[0]) << 56) | \ + ((uint64_t)(((const uint8_t*)(ptr))[1]) << 48) | \ + ((uint64_t)(((const uint8_t*)(ptr))[2]) << 40) | \ + ((uint64_t)(((const uint8_t*)(ptr))[3]) << 32) | \ + ((uint64_t)(((const uint8_t*)(ptr))[4]) << 24) | \ + ((uint64_t)(((const uint8_t*)(ptr))[5]) << 16) | \ + ((uint64_t)(((const uint8_t*)(ptr))[6]) << 8) | \ + (uint64_t)(((const uint8_t*)(ptr))[7]) ) #define CURL_PUT_64BIT_BE(ptr,val) do { \ - ((unsigned char*)(ptr))[7]=(unsigned char)((curl_uint64_t)(val)); \ - ((unsigned char*)(ptr))[6]=(unsigned char)(((curl_uint64_t)(val)) >> 8); \ - ((unsigned char*)(ptr))[5]=(unsigned char)(((curl_uint64_t)(val)) >> 16); \ - ((unsigned char*)(ptr))[4]=(unsigned char)(((curl_uint64_t)(val)) >> 24); \ - ((unsigned char*)(ptr))[3]=(unsigned char)(((curl_uint64_t)(val)) >> 32); \ - ((unsigned char*)(ptr))[2]=(unsigned char)(((curl_uint64_t)(val)) >> 40); \ - ((unsigned char*)(ptr))[1]=(unsigned char)(((curl_uint64_t)(val)) >> 48); \ - ((unsigned char*)(ptr))[0]=(unsigned char)(((curl_uint64_t)(val)) >> 56); \ + ((uint8_t*)(ptr))[7]=(uint8_t)((uint64_t)(val)); \ + ((uint8_t*)(ptr))[6]=(uint8_t)(((uint64_t)(val)) >> 8); \ + ((uint8_t*)(ptr))[5]=(uint8_t)(((uint64_t)(val)) >> 16); \ + ((uint8_t*)(ptr))[4]=(uint8_t)(((uint64_t)(val)) >> 24); \ + ((uint8_t*)(ptr))[3]=(uint8_t)(((uint64_t)(val)) >> 32); \ + ((uint8_t*)(ptr))[2]=(uint8_t)(((uint64_t)(val)) >> 40); \ + ((uint8_t*)(ptr))[1]=(uint8_t)(((uint64_t)(val)) >> 48); \ + ((uint8_t*)(ptr))[0]=(uint8_t)(((uint64_t)(val)) >> 56); \ } while(0) /* Defined as a function. The macro version may duplicate the binary code * size as each argument is used twice, so if any calculation is used * as an argument, the calculation could be done twice. */ -static CURL_FORCEINLINE curl_uint64_t Curl_rotr64(curl_uint64_t value, +static CURL_FORCEINLINE uint64_t Curl_rotr64(uint64_t value, unsigned int bits) { bits %= 64; @@ -376,22 +376,22 @@ struct Curl_sha512_256ctx { * compilers may automatically use fast load/store instruction for big * endian data on little endian machine. */ - curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS]; + uint64_t H[SHA512_256_HASH_SIZE_WORDS]; /** * SHA-512/256 input data buffer. The buffer is properly aligned. Smart * compilers may automatically use fast load/store instruction for big * endian data on little endian machine. */ - curl_uint64_t buffer[SHA512_256_BLOCK_SIZE_WORDS]; + uint64_t buffer[SHA512_256_BLOCK_SIZE_WORDS]; /** * The number of bytes, lower part */ - curl_uint64_t count; + uint64_t count; /** * The number of bits, high part. Unlike lower part, this counts the number * of bits, not bytes. */ - curl_uint64_t count_bits_hi; + uint64_t count_bits_hi; }; /** @@ -413,23 +413,23 @@ static CURLcode Curl_sha512_256_init(void *context) /* Check whether the header and this file use the same numbers */ DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE); - DEBUGASSERT(sizeof(curl_uint64_t) == 8); + DEBUGASSERT(sizeof(uint64_t) == 8); /* Initial hash values, see FIPS PUB 180-4 section 5.3.6.2 */ /* Values generated by "IV Generation Function" as described in * section 5.3.6 */ - ctx->H[0] = CURL_UINT64_C(0x22312194FC2BF72C); - ctx->H[1] = CURL_UINT64_C(0x9F555FA3C84C64C2); - ctx->H[2] = CURL_UINT64_C(0x2393B86B6F53B151); - ctx->H[3] = CURL_UINT64_C(0x963877195940EABD); - ctx->H[4] = CURL_UINT64_C(0x96283EE2A88EFFE3); - ctx->H[5] = CURL_UINT64_C(0xBE5E1E2553863992); - ctx->H[6] = CURL_UINT64_C(0x2B0199FC2C85B8AA); - ctx->H[7] = CURL_UINT64_C(0x0EB72DDC81C52CA2); + ctx->H[0] = UINT64_C(0x22312194FC2BF72C); + ctx->H[1] = UINT64_C(0x9F555FA3C84C64C2); + ctx->H[2] = UINT64_C(0x2393B86B6F53B151); + ctx->H[3] = UINT64_C(0x963877195940EABD); + ctx->H[4] = UINT64_C(0x96283EE2A88EFFE3); + ctx->H[5] = UINT64_C(0xBE5E1E2553863992); + ctx->H[6] = UINT64_C(0x2B0199FC2C85B8AA); + ctx->H[7] = UINT64_C(0x0EB72DDC81C52CA2); /* Initialise number of bytes and high part of number of bits. */ - ctx->count = CURL_UINT64_C(0); - ctx->count_bits_hi = CURL_UINT64_C(0); + ctx->count = UINT64_C(0); + ctx->count_bits_hi = UINT64_C(0); return CURLE_OK; } @@ -442,23 +442,23 @@ static CURLcode Curl_sha512_256_init(void *context) * @param data the data buffer with #CURL_SHA512_256_BLOCK_SIZE bytes block */ static -void Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], +void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], const void *data) { /* Working variables, see FIPS PUB 180-4 section 6.7, 6.4. */ - curl_uint64_t a = H[0]; - curl_uint64_t b = H[1]; - curl_uint64_t c = H[2]; - curl_uint64_t d = H[3]; - curl_uint64_t e = H[4]; - curl_uint64_t f = H[5]; - curl_uint64_t g = H[6]; - curl_uint64_t h = H[7]; + uint64_t a = H[0]; + uint64_t b = H[1]; + uint64_t c = H[2]; + uint64_t d = H[3]; + uint64_t e = H[4]; + uint64_t f = H[5]; + uint64_t g = H[6]; + uint64_t h = H[7]; /* Data buffer, used as a cyclic buffer. See FIPS PUB 180-4 section 5.2.2, 6.7, 6.4. */ - curl_uint64_t W[16]; + uint64_t W[16]; /* 'Ch' and 'Maj' macro functions are defined with widely-used optimization. See FIPS PUB 180-4 formulae 4.8, 4.9. */ @@ -480,47 +480,47 @@ void Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], unsigned int t; /* K constants array. See FIPS PUB 180-4 section 4.2.3 for K values. */ - static const curl_uint64_t K[80] = { - CURL_UINT64_C(0x428a2f98d728ae22), CURL_UINT64_C(0x7137449123ef65cd), - CURL_UINT64_C(0xb5c0fbcfec4d3b2f), CURL_UINT64_C(0xe9b5dba58189dbbc), - CURL_UINT64_C(0x3956c25bf348b538), CURL_UINT64_C(0x59f111f1b605d019), - CURL_UINT64_C(0x923f82a4af194f9b), CURL_UINT64_C(0xab1c5ed5da6d8118), - CURL_UINT64_C(0xd807aa98a3030242), CURL_UINT64_C(0x12835b0145706fbe), - CURL_UINT64_C(0x243185be4ee4b28c), CURL_UINT64_C(0x550c7dc3d5ffb4e2), - CURL_UINT64_C(0x72be5d74f27b896f), CURL_UINT64_C(0x80deb1fe3b1696b1), - CURL_UINT64_C(0x9bdc06a725c71235), CURL_UINT64_C(0xc19bf174cf692694), - CURL_UINT64_C(0xe49b69c19ef14ad2), CURL_UINT64_C(0xefbe4786384f25e3), - CURL_UINT64_C(0x0fc19dc68b8cd5b5), CURL_UINT64_C(0x240ca1cc77ac9c65), - CURL_UINT64_C(0x2de92c6f592b0275), CURL_UINT64_C(0x4a7484aa6ea6e483), - CURL_UINT64_C(0x5cb0a9dcbd41fbd4), CURL_UINT64_C(0x76f988da831153b5), - CURL_UINT64_C(0x983e5152ee66dfab), CURL_UINT64_C(0xa831c66d2db43210), - CURL_UINT64_C(0xb00327c898fb213f), CURL_UINT64_C(0xbf597fc7beef0ee4), - CURL_UINT64_C(0xc6e00bf33da88fc2), CURL_UINT64_C(0xd5a79147930aa725), - CURL_UINT64_C(0x06ca6351e003826f), CURL_UINT64_C(0x142929670a0e6e70), - CURL_UINT64_C(0x27b70a8546d22ffc), CURL_UINT64_C(0x2e1b21385c26c926), - CURL_UINT64_C(0x4d2c6dfc5ac42aed), CURL_UINT64_C(0x53380d139d95b3df), - CURL_UINT64_C(0x650a73548baf63de), CURL_UINT64_C(0x766a0abb3c77b2a8), - CURL_UINT64_C(0x81c2c92e47edaee6), CURL_UINT64_C(0x92722c851482353b), - CURL_UINT64_C(0xa2bfe8a14cf10364), CURL_UINT64_C(0xa81a664bbc423001), - CURL_UINT64_C(0xc24b8b70d0f89791), CURL_UINT64_C(0xc76c51a30654be30), - CURL_UINT64_C(0xd192e819d6ef5218), CURL_UINT64_C(0xd69906245565a910), - CURL_UINT64_C(0xf40e35855771202a), CURL_UINT64_C(0x106aa07032bbd1b8), - CURL_UINT64_C(0x19a4c116b8d2d0c8), CURL_UINT64_C(0x1e376c085141ab53), - CURL_UINT64_C(0x2748774cdf8eeb99), CURL_UINT64_C(0x34b0bcb5e19b48a8), - CURL_UINT64_C(0x391c0cb3c5c95a63), CURL_UINT64_C(0x4ed8aa4ae3418acb), - CURL_UINT64_C(0x5b9cca4f7763e373), CURL_UINT64_C(0x682e6ff3d6b2b8a3), - CURL_UINT64_C(0x748f82ee5defb2fc), CURL_UINT64_C(0x78a5636f43172f60), - CURL_UINT64_C(0x84c87814a1f0ab72), CURL_UINT64_C(0x8cc702081a6439ec), - CURL_UINT64_C(0x90befffa23631e28), CURL_UINT64_C(0xa4506cebde82bde9), - CURL_UINT64_C(0xbef9a3f7b2c67915), CURL_UINT64_C(0xc67178f2e372532b), - CURL_UINT64_C(0xca273eceea26619c), CURL_UINT64_C(0xd186b8c721c0c207), - CURL_UINT64_C(0xeada7dd6cde0eb1e), CURL_UINT64_C(0xf57d4f7fee6ed178), - CURL_UINT64_C(0x06f067aa72176fba), CURL_UINT64_C(0x0a637dc5a2c898a6), - CURL_UINT64_C(0x113f9804bef90dae), CURL_UINT64_C(0x1b710b35131c471b), - CURL_UINT64_C(0x28db77f523047d84), CURL_UINT64_C(0x32caab7b40c72493), - CURL_UINT64_C(0x3c9ebe0a15c9bebc), CURL_UINT64_C(0x431d67c49c100d4c), - CURL_UINT64_C(0x4cc5d4becb3e42b6), CURL_UINT64_C(0x597f299cfc657e2a), - CURL_UINT64_C(0x5fcb6fab3ad6faec), CURL_UINT64_C(0x6c44198c4a475817) + static const uint64_t K[80] = { + UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), + UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), + UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019), + UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118), + UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe), + UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2), + UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1), + UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694), + UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3), + UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65), + UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483), + UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5), + UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210), + UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4), + UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725), + UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70), + UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926), + UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df), + UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8), + UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b), + UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001), + UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30), + UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910), + UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8), + UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53), + UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8), + UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb), + UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3), + UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60), + UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec), + UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9), + UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b), + UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207), + UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178), + UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6), + UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b), + UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493), + UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c), + UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a), + UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817) }; /* One step of SHA-512/256 computation, @@ -541,7 +541,7 @@ void Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], see FIPS PUB 180-4 section 6.4.2 step 3. This macro version reassigns all working variables on each step. */ #define SHA2STEP64RV(vA,vB,vC,vD,vE,vF,vG,vH,kt,wt) do { \ - curl_uint64_t tmp_h_ = (vH); \ + uint64_t tmp_h_ = (vH); \ SHA2STEP64((vA),(vB),(vC),(vD),(vE),(vF),(vG),tmp_h_,(kt),(wt)); \ (vH) = (vG); \ (vG) = (vF); \ @@ -558,7 +558,7 @@ void Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], see FIPS PUB 180-4 section 3.1.2. */ #define SHA512_GET_W_FROM_DATA(buf,t) \ CURL_GET_64BIT_BE( \ - ((const unsigned char*) (buf)) + (t) * SHA512_256_BYTES_IN_WORD) + ((const uint8_t*) (buf)) + (t) * SHA512_256_BYTES_IN_WORD) /* During first 16 steps, before making any calculation on each step, the W element is read from the input data buffer as a big-endian value and @@ -573,9 +573,9 @@ void Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], As only the last 16 'W' are used in calculations, it is possible to use 16 elements array of W as a cyclic buffer. Note: ((t-16) & 15) have same value as (t & 15) */ -#define Wgen(w,t) \ - (curl_uint64_t)( (w)[(t - 16) & 15] + sig1((w)[((t) - 2) & 15]) \ - + (w)[((t) - 7) & 15] + sig0((w)[((t) - 15) & 15]) ) +#define Wgen(w,t) \ + (uint64_t)( (w)[(t - 16) & 15] + sig1((w)[((t) - 2) & 15]) \ + + (w)[((t) - 7) & 15] + sig0((w)[((t) - 15) & 15]) ) /* During the last 64 steps, before making any calculation on each step, current W element is generated from other W elements of the cyclic @@ -628,7 +628,7 @@ static CURLcode Curl_sha512_256_update(void *context, if(length > ctx->count) ctx->count_bits_hi += 1U << 3; /* Value wrap */ ctx->count_bits_hi += ctx->count >> 61; - ctx->count &= CURL_UINT64_C(0x1FFFFFFFFFFFFFFF); + ctx->count &= UINT64_C(0x1FFFFFFFFFFFFFFF); if(bytes_have) { unsigned int bytes_left = CURL_SHA512_256_BLOCK_SIZE - bytes_have; @@ -685,7 +685,7 @@ static CURLcode Curl_sha512_256_update(void *context, static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; - curl_uint64_t num_bits; /**< Number of processed bits */ + uint64_t num_bits; /**< Number of processed bits */ unsigned int bytes_have; /**< Number of bytes in the context buffer */ /* the void pointer here is required to mute Intel compiler warning */ void *const ctx_buf = ctx->buffer; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index ade94bf40aa7..0f7cc7a91a2a 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1272,8 +1272,8 @@ static CURLcode h3_quic_recv(void *reader_ctx, } else { CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] h3_quic_recv -> RESET, " - "rv=%d, app_err=%" FMT_PRIu64, - x->s->id, rv, (curl_uint64_t)app_error_code); + "rv=%d, app_err=%" PRIu64, + x->s->id, rv, app_error_code); if(app_error_code != NGHTTP3_H3_NO_ERROR) x->s->reset = TRUE; } @@ -2246,8 +2246,7 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf, "assume connection is dead."); goto out; } - CURL_TRC_CF(data, cf, "negotiated idle timeout: %" FMT_PRIu64 "ms", - (curl_uint64_t)idle_ms); + CURL_TRC_CF(data, cf, "negotiated idle timeout: %" PRIu64 "ms", idle_ms); idletime = curlx_timediff_ms(curlx_now(), ctx->q.last_io); if(idle_ms && idletime > 0 && (uint64_t)idletime > idle_ms) goto out; diff --git a/src/tool_util.c b/src/tool_util.c index a2798876ea06..cb64f9a0b921 100644 --- a/src/tool_util.c +++ b/src/tool_util.c @@ -31,16 +31,16 @@ struct timeval tvrealnow(void) { /* UNIX EPOCH (1970-01-01) in FILETIME (1601-01-01) as 64-bit value */ - static const curl_uint64_t EPOCH = (curl_uint64_t)116444736000000000ULL; + static const uint64_t EPOCH = UINT64_C(116444736000000000); SYSTEMTIME systime; FILETIME ftime; /* 100ns since 1601-01-01, as double 32-bit value */ - curl_uint64_t time; /* 100ns since 1601-01-01, as 64-bit value */ + uint64_t time; /* 100ns since 1601-01-01, as 64-bit value */ struct timeval now; GetSystemTime(&systime); SystemTimeToFileTime(&systime, &ftime); - time = ((curl_uint64_t)ftime.dwLowDateTime); - time += ((curl_uint64_t)ftime.dwHighDateTime) << 32; + time = ((uint64_t)ftime.dwLowDateTime); + time += ((uint64_t)ftime.dwHighDateTime) << 32; now.tv_sec = (long)((time - EPOCH) / 10000000L); /* unit is 100ns */ now.tv_usec = (long)(systime.wMilliseconds * 1000); From 9ea6f2bc6979addeaaab94f8012ad96ae5abfc83 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Wed, 26 Nov 2025 15:58:40 +0200 Subject: [PATCH 544/885] docs: add rustls to supported backends for CERT and KEY Followup to 1c8c93ae15c692c547e3238c4f067f76616a53e8 Closes #19709 --- docs/libcurl/opts/CURLOPT_SSLCERT.md | 6 +----- docs/libcurl/opts/CURLOPT_SSLKEY.md | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/libcurl/opts/CURLOPT_SSLCERT.md b/docs/libcurl/opts/CURLOPT_SSLCERT.md index 20e7d1a17649..40c3a21c25af 100644 --- a/docs/libcurl/opts/CURLOPT_SSLCERT.md +++ b/docs/libcurl/opts/CURLOPT_SSLCERT.md @@ -11,11 +11,7 @@ See-also: Protocol: - TLS TLS-backend: - - OpenSSL - - GnuTLS - - mbedTLS - - Schannel - - wolfSSL + - All Added-in: 7.1 --- diff --git a/docs/libcurl/opts/CURLOPT_SSLKEY.md b/docs/libcurl/opts/CURLOPT_SSLKEY.md index 7d311aeec89d..bbc486d21fb3 100644 --- a/docs/libcurl/opts/CURLOPT_SSLKEY.md +++ b/docs/libcurl/opts/CURLOPT_SSLKEY.md @@ -15,6 +15,7 @@ TLS-backend: - mbedTLS - Schannel - wolfSSL + - Rustls Added-in: 7.9.3 --- From c273de193e6072c4123c4aa95cae316cd728a69f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Nov 2025 16:14:43 +0100 Subject: [PATCH 545/885] test433: verify "Note: Read config file from..." Which was added in fc09a2da4ad0595292 Closes #19699 --- tests/data/test2080 | 1 + tests/data/test433 | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/data/test2080 b/tests/data/test2080 index 44d16b6ee331..52860addb053 100644 --- a/tests/data/test2080 +++ b/tests/data/test2080 @@ -3,6 +3,7 @@ FILE config +--config diff --git a/tests/data/test433 b/tests/data/test433 index 63c884fdbe48..034f84e0b6db 100644 --- a/tests/data/test433 +++ b/tests/data/test433 @@ -36,8 +36,12 @@ CURL_HOME Verify XDG_CONFIG_HOME use to find curlrc +# set the terminal wide to avoid word wrap in the message + +COLUMNS=300 + -%HOSTIP:%HTTPPORT/%TESTNUMBER +%HOSTIP:%HTTPPORT/%TESTNUMBER --no-progress-meter @@ -55,5 +59,13 @@ Content-Type: application/x-www-form-urlencoded curlrc read + +# On Windows curl may use a backslash, convert that for the comparison + +s:\\:/:g + + +Note: Read config file from '%PWD/%LOGDIR/curlrc' + From 9bb5c0578b39e5b086b6a9db5c6eb299a0fe1c5c Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 27 Nov 2025 12:11:39 +0100 Subject: [PATCH 546/885] ngtcp2+openssl: fix leak of session Fix return value indicating to OpenSSL if reference to session is kept (it is not), so OpenSSL frees it. Reported-by: Aleksei Bavshin Fixes #19717 Closes #19718 --- lib/vquic/curl_ngtcp2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index ad1f2b2b25c8..61b233e4ffc0 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -2277,7 +2277,6 @@ static int quic_ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) #endif Curl_ossl_add_session(cf, data, ctx->peer.scache_key, ssl_sessionid, SSL_version(ssl), "h3", quic_tp, quic_tp_len); - return 1; } return 0; } From a9e7a027ed866b791c12a3c701dc40304f4e00cb Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 27 Nov 2025 10:23:43 +0100 Subject: [PATCH 547/885] vquic: do_sendmsg full init When passing a `msg_ctrl` to sendmsg() as part of GSO handling, zero the complete array. This fixes any false positives by valgrind that complain about uninitialised memory, even though the kernel only ever accesses the first two bytes. Reported-by: Aleksei Bavshin Fixes #19714 Closes #19715 --- lib/vquic/vquic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 562a99e4fee0..aa0011c577c4 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -145,6 +145,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, if(pktlen > gsolen) { /* Only set this, when we need it. macOS, for example, * does not seem to like a msg_control of length 0. */ + memset(msg_ctrl, 0, sizeof(msg_ctrl)); msg.msg_control = msg_ctrl; assert(sizeof(msg_ctrl) >= CMSG_SPACE(sizeof(int))); msg.msg_controllen = CMSG_SPACE(sizeof(int)); From feea96851230c7a5a11feaffa0a5e4a4d30e5e63 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 3 Nov 2025 13:12:50 +0100 Subject: [PATCH 548/885] conncontrol: reuse handling Add protocol handler flag `PROTOPT_CONN_REUSE` to indicate that the protocol allows reusing connections for other tranfers. Add that to all handlers that support it. Create connections with `conn->bits.close = FALSE` and remove all the `connkeep()` calls in protocol handlers setup/connect implementations. `PROTOPT_CONN_REUSE` assures that the default behaviour applies at the end of a transfer without need to juggle the close bit. `conn->bits.close` now serves as an additional indication that a connection cannot be reused. Only protocol handles that allow reuse need to set it to override the default behaviour. Remove all `connclose()` and `connkeep()` calls from connection filters. Filters should not modify connection flags. They are supposed to run in eyeballing situations where a filter is just one of many determining the outcome. Fix http response header handling to only honour `Connection: close` for HTTP/1.x versions. Closes #19333 --- lib/cf-h1-proxy.c | 4 --- lib/cf-h2-proxy.c | 6 +--- lib/conncache.c | 1 - lib/ftp.c | 9 +++--- lib/http.c | 17 ++++------ lib/http2.c | 9 +++--- lib/imap.c | 11 +++---- lib/multi.c | 70 ++++++++++++++++++++++++----------------- lib/openldap.c | 7 +++-- lib/pop3.c | 11 +++---- lib/rtsp.c | 2 +- lib/smb.c | 7 ++--- lib/smtp.c | 11 +++---- lib/url.c | 9 +++--- lib/urldata.h | 1 + lib/vquic/curl_ngtcp2.c | 1 - lib/vquic/curl_osslq.c | 1 - lib/vquic/curl_quiche.c | 4 --- lib/vssh/libssh.c | 11 +++---- lib/vssh/libssh2.c | 12 +++---- lib/vtls/openssl.c | 3 +- 21 files changed, 93 insertions(+), 114 deletions(-) diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 985500f23e06..e496d7634dce 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -127,7 +127,6 @@ static CURLcode tunnel_init(struct Curl_cfilter *cf, Curl_httpchunk_init(data, &ts->ch, TRUE); *pts = ts; - connkeep(cf->conn, "HTTP proxy CONNECT"); return tunnel_reinit(cf, data, ts); } @@ -591,7 +590,6 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "CONNECT need to close+open"); infof(data, "Connect me again please"); Curl_conn_cf_close(cf, data); - connkeep(conn, "HTTP proxy CONNECT"); result = Curl_conn_cf_connect(cf->next, data, &done); goto out; } @@ -612,8 +610,6 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, if(data->info.httpproxycode/100 != 2) { /* a non-2xx response and we have no next URL to try. */ Curl_safefree(data->req.newurl); - /* failure, close this connection to avoid reuse */ - streamclose(conn, "proxy CONNECT failure"); h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data); failf(data, "CONNECT tunnel failed, response %d", data->req.httpcode); return CURLE_RECV_ERROR; diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index b963bb718ce9..89bc7cc23f48 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -488,10 +488,6 @@ static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf, return result; } - if(ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) { - connclose(cf->conn, "GOAWAY received"); - } - return CURLE_OK; } @@ -1265,7 +1261,7 @@ static CURLcode h2_handle_tunnel_close(struct Curl_cfilter *cf, if(ctx->tunnel.error == NGHTTP2_REFUSED_STREAM) { CURL_TRC_CF(data, cf, "[%d] REFUSED_STREAM, try again on a new " "connection", ctx->tunnel.stream_id); - connclose(cf->conn, "REFUSED_STREAM"); /* do not use this anymore */ + failf(data, "proxy server refused HTTP/2 stream"); return CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */ } else if(ctx->tunnel.error != NGHTTP2_NO_ERROR) { diff --git a/lib/conncache.c b/lib/conncache.c index 275e490f23e8..9d3b69bec356 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -220,7 +220,6 @@ void Curl_cpool_destroy(struct cpool *cpool) while(conn) { cpool_remove_conn(cpool, conn); sigpipe_apply(cpool->idata, &pipe_st); - connclose(conn, "kill all"); cpool_discard_conn(cpool, cpool->idata, conn, FALSE); conn = cpool_get_first(cpool); } diff --git a/lib/ftp.c b/lib/ftp.c index c289581fd5a4..ce4001226823 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -270,7 +270,8 @@ const struct Curl_handler Curl_handler_ftp = { CURLPROTO_FTP, /* family */ PROTOPT_DUAL | PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY | PROTOPT_PROXY_AS_HTTP | - PROTOPT_WILDCARD | PROTOPT_SSL_REUSE /* flags */ + PROTOPT_WILDCARD | PROTOPT_SSL_REUSE | + PROTOPT_CONN_REUSE /* flags */ }; @@ -302,7 +303,8 @@ const struct Curl_handler Curl_handler_ftps = { CURLPROTO_FTPS, /* protocol */ CURLPROTO_FTP, /* family */ PROTOPT_SSL | PROTOPT_DUAL | PROTOPT_CLOSEACTION | - PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY | PROTOPT_WILDCARD /* flags */ + PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY | PROTOPT_WILDCARD | + PROTOPT_CONN_REUSE /* flags */ }; #endif @@ -3183,9 +3185,6 @@ static CURLcode ftp_connect(struct Curl_easy *data, if(!ftpc) return CURLE_FAILED_INIT; pp = &ftpc->pp; - /* We always support persistent connections on ftp */ - connkeep(conn, "FTP default"); - PINGPONG_SETUP(pp, ftp_pp_statemachine, ftp_endofresp); if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) { diff --git a/lib/http.c b/lib/http.c index 144a898ea0eb..0319be3b657b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -142,7 +142,8 @@ const struct Curl_handler Curl_handler_http = { CURLPROTO_HTTP, /* protocol */ CURLPROTO_HTTP, /* family */ PROTOPT_CREDSPERREQUEST | /* flags */ - PROTOPT_USERPWDCTRL + PROTOPT_USERPWDCTRL | PROTOPT_CONN_REUSE + }; #ifdef USE_SSL @@ -172,7 +173,7 @@ const struct Curl_handler Curl_handler_https = { CURLPROTO_HTTPS, /* protocol */ CURLPROTO_HTTP, /* family */ PROTOPT_SSL | PROTOPT_CREDSPERREQUEST | PROTOPT_ALPN | /* flags */ - PROTOPT_USERPWDCTRL + PROTOPT_USERPWDCTRL | PROTOPT_CONN_REUSE }; #endif @@ -220,7 +221,6 @@ CURLcode Curl_http_setup_conn(struct Curl_easy *data, { /* allocate the HTTP-specific struct for the Curl_easy, only to survive during this request */ - connkeep(conn, "HTTP default"); if(data->state.http_neg.wanted == CURL_HTTP_V3x) { /* only HTTP/3, needs to work */ CURLcode result = Curl_conn_may_http3(data, conn, conn->transport_wanted); @@ -1548,12 +1548,6 @@ Curl_compareheader(const char *headerline, /* line to check */ */ CURLcode Curl_http_connect(struct Curl_easy *data, bool *done) { - struct connectdata *conn = data->conn; - - /* We default to persistent connections. We set this already in this connect - function to make the reuse checks properly be able to check this bit. */ - connkeep(conn, "HTTP default"); - return Curl_conn_connect(data, FIRSTSOCKET, FALSE, done); } @@ -3257,14 +3251,15 @@ static CURLcode http_header_c(struct Curl_easy *data, } return CURLE_OK; } - if(HD_IS_AND_SAYS(hd, hdlen, "Connection:", "close")) { + if((k->httpversion < 20) && + HD_IS_AND_SAYS(hd, hdlen, "Connection:", "close")) { /* * [RFC 2616, section 8.1.2.1] * "Connection: close" is HTTP/1.1 language and means that * the connection will close when this request has been * served. */ - streamclose(conn, "Connection: close used"); + connclose(conn, "Connection: close used"); return CURLE_OK; } if((k->httpversion == 10) && diff --git a/lib/http2.c b/lib/http2.c index 7b94930a21a7..4f5f5ea52dd3 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2071,7 +2071,7 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf, size_t nread; if(should_close_session(ctx)) { - CURL_TRC_CF(data, cf, "progress ingress, session is closed"); + CURL_TRC_CF(data, cf, "[0] ingress: session is closed"); return CURLE_HTTP2; } @@ -2128,15 +2128,16 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf, result = h2_process_pending_input(cf, data); if(result) return result; - CURL_TRC_CF(data, cf, "[0] progress ingress: inbufg=%zu", + CURL_TRC_CF(data, cf, "[0] ingress: nw-in buffered %zu", Curl_bufq_len(&ctx->inbufq)); } if(ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) { - connclose(cf->conn, "GOAWAY received"); + connclose(cf->conn, ctx->rcvd_goaway ? "server closed with GOAWAY" : + "server closed abruptly"); } - CURL_TRC_CF(data, cf, "[0] progress ingress: done"); + CURL_TRC_CF(data, cf, "[0] ingress: done"); return CURLE_OK; } diff --git a/lib/imap.c b/lib/imap.c index 181b0d7009d6..af9b124d1e72 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -210,9 +210,9 @@ const struct Curl_handler Curl_handler_imap = { PORT_IMAP, /* defport */ CURLPROTO_IMAP, /* protocol */ CURLPROTO_IMAP, /* family */ - PROTOPT_CLOSEACTION| /* flags */ - PROTOPT_URLOPTIONS| - PROTOPT_SSL_REUSE + PROTOPT_CLOSEACTION | /* flags */ + PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | + PROTOPT_CONN_REUSE }; #ifdef USE_SSL @@ -243,7 +243,7 @@ const struct Curl_handler Curl_handler_imaps = { CURLPROTO_IMAPS, /* protocol */ CURLPROTO_IMAP, /* family */ PROTOPT_CLOSEACTION | PROTOPT_SSL | /* flags */ - PROTOPT_URLOPTIONS + PROTOPT_URLOPTIONS | PROTOPT_CONN_REUSE }; #endif @@ -1680,9 +1680,6 @@ static CURLcode imap_connect(struct Curl_easy *data, bool *done) if(!imapc) return CURLE_FAILED_INIT; - /* We always support persistent connections in IMAP */ - connkeep(data->conn, "IMAP default"); - /* Parse the URL options */ result = imap_parse_url_options(data->conn, imapc); if(result) diff --git a/lib/multi.c b/lib/multi.c index 57c574a68176..f7265a94a9ec 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -547,6 +547,47 @@ struct multi_done_ctx { BIT(premature); }; +static bool multi_conn_should_close(struct connectdata *conn, + struct Curl_easy *data, + bool premature) +{ + /* if conn->bits.close is TRUE, it means that the connection should be + closed in spite of everything else. */ + if(conn->bits.close) + return TRUE; + + /* if data->set.reuse_forbid is TRUE, it means the libcurl client has + forced us to close this connection. This is ignored for requests taking + place in a NTLM/NEGOTIATE authentication handshake. */ + if(data->set.reuse_forbid +#ifdef USE_NTLM + && !(conn->http_ntlm_state == NTLMSTATE_TYPE2 || + conn->proxy_ntlm_state == NTLMSTATE_TYPE2) +#endif +#ifdef USE_SPNEGO + && !(conn->http_negotiate_state == GSS_AUTHRECV || + conn->proxy_negotiate_state == GSS_AUTHRECV) +#endif + ) + return TRUE; + + /* Unless this connection is for a "connect-only" transfer, it + * needs to be closed if the protocol handler does not support reuse. */ + if(!data->set.connect_only && conn->handler && + !(conn->handler->flags & PROTOPT_CONN_REUSE)) + return TRUE; + + /* if premature is TRUE, it means this connection was said to be DONE before + the entire request operation is complete and thus we cannot know in what + state it is for reusing, so we are forced to close it. In a perfect world + we can add code that keep track of if we really must close it here or not, + but currently we have no such detail knowledge. */ + if(premature && !Curl_conn_is_multiplex(conn, FIRSTSOCKET)) + return TRUE; + + return FALSE; +} + static void multi_done_locked(struct connectdata *conn, struct Curl_easy *data, void *userdata) @@ -587,32 +628,7 @@ static void multi_done_locked(struct connectdata *conn, Curl_resolv_unlink(data, &data->state.dns[1]); Curl_dnscache_prune(data); - /* if data->set.reuse_forbid is TRUE, it means the libcurl client has - forced us to close this connection. This is ignored for requests taking - place in a NTLM/NEGOTIATE authentication handshake - - if conn->bits.close is TRUE, it means that the connection should be - closed in spite of all our efforts to be nice, due to protocol - restrictions in our or the server's end - - if premature is TRUE, it means this connection was said to be DONE before - the entire request operation is complete and thus we cannot know in what - state it is for reusing, so we are forced to close it. In a perfect world - we can add code that keep track of if we really must close it here or not, - but currently we have no such detail knowledge. - */ - - if((data->set.reuse_forbid -#ifdef USE_NTLM - && !(conn->http_ntlm_state == NTLMSTATE_TYPE2 || - conn->proxy_ntlm_state == NTLMSTATE_TYPE2) -#endif -#ifdef USE_SPNEGO - && !(conn->http_negotiate_state == GSS_AUTHRECV || - conn->proxy_negotiate_state == GSS_AUTHRECV) -#endif - ) || conn->bits.close - || (mdctx->premature && !Curl_conn_is_multiplex(conn, FIRSTSOCKET))) { + if(multi_conn_should_close(conn, data, mdctx->premature)) { #ifndef CURL_DISABLE_VERBOSE_STRINGS CURL_TRC_M(data, "multi_done, terminating conn #%" FMT_OFF_T " to %s:%d, " "forbid=%d, close=%d, premature=%d, conn_multiplex=%d", @@ -2127,8 +2143,6 @@ static CURLMcode state_do(struct Curl_easy *data, } if(data->set.connect_only && !data->set.connect_only_ws) { - /* keep connection open for application to use the socket */ - connkeep(data->conn, "CONNECT_ONLY"); multistate(data, MSTATE_DONE); rc = CURLM_CALL_MULTI_PERFORM; } diff --git a/lib/openldap.c b/lib/openldap.c index 9d6174defe37..41419df21b20 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -139,7 +139,8 @@ const struct Curl_handler Curl_handler_ldap = { PORT_LDAP, /* defport */ CURLPROTO_LDAP, /* protocol */ CURLPROTO_LDAP, /* family */ - PROTOPT_SSL_REUSE /* flags */ + PROTOPT_SSL_REUSE | /* flags */ + PROTOPT_CONN_REUSE }; #ifdef USE_SSL @@ -169,7 +170,8 @@ const struct Curl_handler Curl_handler_ldaps = { PORT_LDAPS, /* defport */ CURLPROTO_LDAPS, /* protocol */ CURLPROTO_LDAP, /* family */ - PROTOPT_SSL /* flags */ + PROTOPT_SSL | /* flags */ + PROTOPT_CONN_REUSE }; #endif @@ -992,7 +994,6 @@ static CURLcode oldap_do(struct Curl_easy *data, bool *done) if(!li) return CURLE_FAILED_INIT; - connkeep(conn, "OpenLDAP do"); infof(data, "LDAP local: %s", data->state.url); diff --git a/lib/pop3.c b/lib/pop3.c index 05203c1a074e..503f4ecb2bd5 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -200,7 +200,8 @@ const struct Curl_handler Curl_handler_pop3 = { CURLPROTO_POP3, /* protocol */ CURLPROTO_POP3, /* family */ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY | /* flags */ - PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE + PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | + PROTOPT_CONN_REUSE }; #ifdef USE_SSL @@ -230,8 +231,9 @@ const struct Curl_handler Curl_handler_pop3s = { PORT_POP3S, /* defport */ CURLPROTO_POP3S, /* protocol */ CURLPROTO_POP3, /* family */ - PROTOPT_CLOSEACTION | PROTOPT_SSL - | PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS /* flags */ + PROTOPT_CLOSEACTION | PROTOPT_SSL | /* flags */ + PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS | + PROTOPT_CONN_REUSE }; #endif @@ -1295,9 +1297,6 @@ static CURLcode pop3_connect(struct Curl_easy *data, bool *done) if(!pop3c) return CURLE_FAILED_INIT; - /* We always support persistent connections in POP3 */ - connkeep(conn, "POP3 default"); - PINGPONG_SETUP(pp, pop3_statemachine, pop3_endofresp); /* Set the default preferred authentication type and mechanism */ diff --git a/lib/rtsp.c b/lib/rtsp.c index b4b3d6dd556d..dd49ebc42b4d 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -152,7 +152,7 @@ const struct Curl_handler Curl_handler_rtsp = { PORT_RTSP, /* defport */ CURLPROTO_RTSP, /* protocol */ CURLPROTO_RTSP, /* family */ - PROTOPT_NONE /* flags */ + PROTOPT_CONN_REUSE /* flags */ }; #define MAX_RTP_BUFFERSIZE 1000000 /* arbitrary */ diff --git a/lib/smb.c b/lib/smb.c index 4ef35c295d15..e5fca3ec0bef 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -329,7 +329,7 @@ const struct Curl_handler Curl_handler_smb = { PORT_SMB, /* defport */ CURLPROTO_SMB, /* protocol */ CURLPROTO_SMB, /* family */ - PROTOPT_NONE /* flags */ + PROTOPT_CONN_REUSE /* flags */ }; #ifdef USE_SSL @@ -358,7 +358,7 @@ const struct Curl_handler Curl_handler_smbs = { PORT_SMBS, /* defport */ CURLPROTO_SMBS, /* protocol */ CURLPROTO_SMB, /* family */ - PROTOPT_SSL /* flags */ + PROTOPT_SSL | PROTOPT_CONN_REUSE /* flags */ }; #endif @@ -513,9 +513,6 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done) if(!smbc->send_buf) return CURLE_OUT_OF_MEMORY; - /* Multiple requests are allowed with this connection */ - connkeep(conn, "SMB default"); - /* Parse the username, domain, and password */ slash = strchr(conn->user, '/'); if(!slash) diff --git a/lib/smtp.c b/lib/smtp.c index af4676dc182d..eca27f146525 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -205,7 +205,8 @@ const struct Curl_handler Curl_handler_smtp = { CURLPROTO_SMTP, /* protocol */ CURLPROTO_SMTP, /* family */ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY | /* flags */ - PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE + PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | + PROTOPT_CONN_REUSE }; #ifdef USE_SSL @@ -235,8 +236,9 @@ const struct Curl_handler Curl_handler_smtps = { PORT_SMTPS, /* defport */ CURLPROTO_SMTPS, /* protocol */ CURLPROTO_SMTP, /* family */ - PROTOPT_CLOSEACTION | PROTOPT_SSL - | PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS /* flags */ + PROTOPT_CLOSEACTION | PROTOPT_SSL | /* flags */ + PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS | + PROTOPT_CONN_REUSE }; #endif @@ -1440,9 +1442,6 @@ static CURLcode smtp_connect(struct Curl_easy *data, bool *done) if(!smtpc) return CURLE_FAILED_INIT; - /* We always support persistent connections in SMTP */ - connkeep(data->conn, "SMTP default"); - PINGPONG_SETUP(&smtpc->pp, smtp_pp_statemachine, smtp_endofresp); /* Initialize the SASL storage */ diff --git a/lib/url.c b/lib/url.c index 8b3f7f5ab738..b6a60feb38b2 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1364,11 +1364,6 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->connection_id = -1; /* no ID */ conn->remote_port = -1; /* unknown at this point */ - /* Default protocol-independent behavior does not support persistent - connections, so we set this to force-close. Protocols that support - this need to set this to FALSE in their "curl_do" functions. */ - connclose(conn, "Default to force-close"); - /* Store creation time to help future close decision making */ conn->created = curlx_now(); @@ -1428,6 +1423,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) #ifdef HAVE_GSSAPI conn->gssapi_delegation = data->set.gssapi_delegation; #endif + DEBUGF(infof(data, "alloc connection, bits.close=%d", conn->bits.close)); return conn; error: @@ -2035,11 +2031,13 @@ static CURLcode setup_connection_internals(struct Curl_easy *data, int port; CURLcode result; + DEBUGF(infof(data, "setup connection, bits.close=%d", conn->bits.close)); if(conn->handler->setup_connection) { result = conn->handler->setup_connection(data, conn); if(result) return result; } + DEBUGF(infof(data, "setup connection, bits.close=%d", conn->bits.close)); /* Now create the destination name */ #ifndef CURL_DISABLE_PROXY @@ -3664,6 +3662,7 @@ static CURLcode create_conn(struct Curl_easy *data, /* We have decided that we want a new connection. However, we may not be able to do that if we have reached the limit of how many connections we are allowed to open. */ + DEBUGF(infof(data, "new connection, bits.close=%d", conn->bits.close)); if(conn->handler->flags & PROTOPT_ALPN) { /* The protocol wants it, so set the bits if enabled in the easy handle diff --git a/lib/urldata.h b/lib/urldata.h index c71607ea7d2b..37ecd1ff9db7 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -567,6 +567,7 @@ struct Curl_handler { #define PROTOPT_SSL_REUSE (1<<15) /* this protocol may reuse an existing SSL connection in the same family without having PROTOPT_SSL. */ +#define PROTOPT_CONN_REUSE (1<<16) /* this protocol can reuse connections */ #define CONNCHECK_NONE 0 /* No checks */ #define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 61b233e4ffc0..de767f28dc04 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -2647,7 +2647,6 @@ static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "peer verified"); cf->connected = TRUE; *done = TRUE; - connkeep(cf->conn, "HTTP/3 default"); } } diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 0f7cc7a91a2a..376705e51667 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1816,7 +1816,6 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "peer verified"); cf->connected = TRUE; *done = TRUE; - connkeep(cf->conn, "HTTP/3 default"); } } else { diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 5082dc750bb5..927492979013 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -446,7 +446,6 @@ static CURLcode cf_recv_body(struct Curl_cfilter *cf, stream->closed = TRUE; stream->reset = TRUE; stream->send_closed = TRUE; - streamclose(cf->conn, "Reset of stream"); return result; } return CURLE_OK; @@ -510,7 +509,6 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, stream->closed = TRUE; stream->reset = TRUE; stream->send_closed = TRUE; - streamclose(cf->conn, "Reset of stream"); break; case QUICHE_H3_EVENT_FINISHED: @@ -522,7 +520,6 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, stream->resp_hds_complete = TRUE; } stream->closed = TRUE; - streamclose(cf->conn, "End of stream"); break; case QUICHE_H3_EVENT_GOAWAY: @@ -1415,7 +1412,6 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf, } cf->connected = TRUE; *done = TRUE; - connkeep(cf->conn, "HTTP/3 default"); } } else if(quiche_conn_is_draining(ctx->qconn)) { diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 77a915884aaf..c76478bc2a57 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -156,7 +156,8 @@ const struct Curl_handler Curl_handler_scp = { PORT_SSH, /* defport */ CURLPROTO_SCP, /* protocol */ CURLPROTO_SCP, /* family */ - PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */ + PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | /* flags */ + PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE }; /* @@ -185,8 +186,8 @@ const struct Curl_handler Curl_handler_sftp = { PORT_SSH, /* defport */ CURLPROTO_SFTP, /* protocol */ CURLPROTO_SFTP, /* family */ - PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION - | PROTOPT_NOURLQUERY /* flags */ + PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | /* flags */ + PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE }; static CURLcode sftp_error_to_CURLE(int err) @@ -2572,10 +2573,6 @@ static CURLcode myssh_connect(struct Curl_easy *data, bool *done) if(!sshc || !ssh) return CURLE_FAILED_INIT; - /* We default to persistent connections. We set this already in this connect - function to make the reuse checks properly be able to check this bit. */ - connkeep(conn, "SSH default"); - if(conn->handler->protocol & CURLPROTO_SCP) { conn->recv[FIRSTSOCKET] = scp_recv; conn->send[FIRSTSOCKET] = scp_send; diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 714e3953730a..1c9fe5ac0154 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -123,8 +123,8 @@ const struct Curl_handler Curl_handler_scp = { PORT_SSH, /* defport */ CURLPROTO_SCP, /* protocol */ CURLPROTO_SCP, /* family */ - PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION - | PROTOPT_NOURLQUERY /* flags */ + PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | /* flags */ + PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE }; @@ -154,8 +154,8 @@ const struct Curl_handler Curl_handler_sftp = { PORT_SSH, /* defport */ CURLPROTO_SFTP, /* protocol */ CURLPROTO_SFTP, /* family */ - PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION - | PROTOPT_NOURLQUERY /* flags */ + PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | /* flags */ + PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE }; static void @@ -3323,10 +3323,6 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done) if(!sshc) return CURLE_FAILED_INIT; - /* We default to persistent connections. We set this already in this connect - function to make the reuse checks properly be able to check this bit. */ - connkeep(conn, "SSH default"); - infof(data, "User: '%s'", conn->user); #ifdef CURL_LIBSSH2_DEBUG infof(data, "Password: %s", conn->passwd); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 8991d965d9be..2f526479c5f4 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5175,7 +5175,6 @@ static CURLcode ossl_recv(struct Curl_cfilter *cf, char error_buffer[256]; unsigned long sslerror; int buffsize; - struct connectdata *conn = cf->conn; struct ssl_connect_data *connssl = cf->ctx; struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; CURLcode result = CURLE_OK; @@ -5205,7 +5204,7 @@ static CURLcode ossl_recv(struct Curl_cfilter *cf, if(cf->sockindex == FIRSTSOCKET) /* mark the connection for close if it is indeed the control connection */ - connclose(conn, "TLS close_notify"); + CURL_TRC_CF(data, cf, "TLS close_notify"); break; case SSL_ERROR_WANT_READ: connssl->io_need = CURL_SSL_IO_NEED_RECV; From c4f29cc5081b4b70ba435c64bd8ee81f02b3ceeb Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 26 Nov 2025 14:05:46 +0100 Subject: [PATCH 549/885] ip_quadruple/proxy: make port uint16_t Make `port` member in these struct of type `uint16_t`. add `uint8_t transport` to `struct ip_quadruple Define TRNSPRT_NONE as 0. By assigning a valid transport only on a successful connection, it is clear when the ip_quadruple members are valid. Also, for transports not involving ports, the getinfos for `CURLINFO_PRIMARY_PORT` and `CURLINFO_LOCAL_PORT` will now always return -1. Make all `transport` members and parameters of type `uint8_t`. Document the return value of `CURLINFO_LOCAL_PORT` and `CURLINFO_PRIMARY_PORT` in this regard. Add tests that writeout stats report ports correctly. Closes #19708 --- docs/libcurl/opts/CURLINFO_LOCAL_PORT.md | 3 +++ docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md | 5 +++++ lib/cf-https-connect.c | 10 ++++----- lib/cf-ip-happy.c | 24 ++++++++++---------- lib/cf-ip-happy.h | 6 ++--- lib/cf-socket.c | 17 +++++++------- lib/cf-socket.h | 8 +++---- lib/connect.c | 16 ++++++------- lib/connect.h | 4 ++-- lib/getinfo.c | 12 ++++++---- lib/setopt.c | 4 ++-- lib/url.c | 14 +++++------- lib/urldata.h | 26 +++++++++++++--------- lib/vquic/vquic.c | 2 +- lib/vquic/vquic.h | 2 +- tests/http/test_01_basic.py | 3 +++ tests/http/test_11_unix.py | 6 +++++ tests/unit/unit1607.c | 2 +- tests/unit/unit1609.c | 2 +- tests/unit/unit2600.c | 4 ++-- 20 files changed, 97 insertions(+), 73 deletions(-) diff --git a/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md b/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md index 67d73b71650e..40d1f5fb6a87 100644 --- a/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md +++ b/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md @@ -35,6 +35,9 @@ connection done with this **curl** handle. If the connection was done using QUIC, the port number is a UDP port number, otherwise it is a TCP port number. +If no connection was established or if the protocol does not use ports, -1 +is returned. + # %PROTOCOLS% # EXAMPLE diff --git a/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md b/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md index b98f246042da..85f5767423a4 100644 --- a/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md +++ b/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md @@ -36,6 +36,11 @@ If a proxy was used for the most recent transfer, this is the port number of the proxy, if no proxy was used it is the port number of the most recently accessed URL. +If the connection was done using QUIC, the port number is a UDP port number. + +If no connection was established or if the protocol does not use ports, -1 +is returned. + # %PROTOCOLS% # EXAMPLE diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index dfd82bd9a117..5491d7968d7e 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -55,7 +55,7 @@ struct cf_hc_baller { CURLcode result; struct curltime started; int reply_ms; - unsigned char transport; + uint8_t transport; enum alpnid alpn_id; BIT(shutdown); }; @@ -124,7 +124,7 @@ struct cf_hc_ctx { static void cf_hc_baller_assign(struct cf_hc_baller *b, enum alpnid alpn_id, - unsigned char def_transport) + uint8_t def_transport) { b->alpn_id = alpn_id; b->transport = def_transport; @@ -148,7 +148,7 @@ static void cf_hc_baller_assign(struct cf_hc_baller *b, static void cf_hc_baller_init(struct cf_hc_baller *b, struct Curl_cfilter *cf, struct Curl_easy *data, - int transport) + uint8_t transport) { struct Curl_cfilter *save = cf->next; @@ -581,7 +581,7 @@ struct Curl_cftype Curl_cft_http_connect = { static CURLcode cf_hc_create(struct Curl_cfilter **pcf, struct Curl_easy *data, enum alpnid *alpnids, size_t alpn_count, - unsigned char def_transport) + uint8_t def_transport) { struct Curl_cfilter *cf = NULL; struct cf_hc_ctx *ctx; @@ -626,7 +626,7 @@ static CURLcode cf_http_connect_add(struct Curl_easy *data, struct connectdata *conn, int sockindex, enum alpnid *alpn_ids, size_t alpn_count, - unsigned char def_transport) + uint8_t def_transport) { struct Curl_cfilter *cf; CURLcode result = CURLE_OK; diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 2e522322c384..eb62cd4c73d3 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -66,7 +66,7 @@ struct transport_provider { - int transport; + uint8_t transport; cf_ip_connect_create *cf_create; }; @@ -87,7 +87,7 @@ struct transport_provider transport_providers[] = { #endif }; -static cf_ip_connect_create *get_cf_create(int transport) +static cf_ip_connect_create *get_cf_create(uint8_t transport) { size_t i; for(i = 0; i < CURL_ARRAYSIZE(transport_providers); ++i) { @@ -99,7 +99,7 @@ static cf_ip_connect_create *get_cf_create(int transport) #ifdef UNITTESTS /* used by unit2600.c */ -void Curl_debug_set_transport_provider(int transport, +void Curl_debug_set_transport_provider(uint8_t transport, cf_ip_connect_create *cf_create) { size_t i; @@ -172,7 +172,7 @@ struct cf_ip_attempt { struct curltime started; /* start of current attempt */ CURLcode result; int ai_family; - int transport; + uint8_t transport; int error; BIT(connected); /* cf has connected */ BIT(shutdown); /* cf has shutdown */ @@ -195,7 +195,7 @@ static CURLcode cf_ip_attempt_new(struct cf_ip_attempt **pa, struct Curl_easy *data, const struct Curl_addrinfo *addr, int ai_family, - int transport, + uint8_t transport, cf_ip_connect_create *cf_create) { struct Curl_cfilter *wcf; @@ -264,7 +264,7 @@ struct cf_ip_ballers { struct curltime last_attempt_started; timediff_t attempt_delay_ms; int last_attempt_ai_family; - int transport; + uint8_t transport; }; static CURLcode cf_ip_attempt_restart(struct cf_ip_attempt *a, @@ -315,7 +315,7 @@ static void cf_ip_ballers_clear(struct Curl_cfilter *cf, static CURLcode cf_ip_ballers_init(struct cf_ip_ballers *bs, int ip_version, const struct Curl_addrinfo *addr_list, cf_ip_connect_create *cf_create, - int transport, + uint8_t transport, timediff_t attempt_delay_ms) { memset(bs, 0, sizeof(*bs)); @@ -626,7 +626,7 @@ typedef enum { } cf_connect_state; struct cf_ip_happy_ctx { - int transport; + uint8_t transport; cf_ip_connect_create *cf_create; cf_connect_state state; struct cf_ip_ballers ballers; @@ -713,7 +713,7 @@ static CURLcode start_connect(struct Curl_cfilter *cf, return CURLE_OPERATION_TIMEDOUT; } - CURL_TRC_CF(data, cf, "init ip ballers for transport %d", ctx->transport); + CURL_TRC_CF(data, cf, "init ip ballers for transport %u", ctx->transport); ctx->started = curlx_now(); return cf_ip_ballers_init(&ctx->ballers, cf->conn->ip_version, dns->addr, ctx->cf_create, ctx->transport, @@ -933,7 +933,7 @@ static CURLcode cf_ip_happy_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, cf_ip_connect_create *cf_create, - int transport) + uint8_t transport) { struct cf_ip_happy_ctx *ctx = NULL; CURLcode result; @@ -961,7 +961,7 @@ static CURLcode cf_ip_happy_create(struct Curl_cfilter **pcf, CURLcode cf_ip_happy_insert_after(struct Curl_cfilter *cf_at, struct Curl_easy *data, - int transport) + uint8_t transport) { cf_ip_connect_create *cf_create; struct Curl_cfilter *cf; @@ -971,7 +971,7 @@ CURLcode cf_ip_happy_insert_after(struct Curl_cfilter *cf_at, DEBUGASSERT(cf_at); cf_create = get_cf_create(transport); if(!cf_create) { - CURL_TRC_CF(data, cf_at, "unsupported transport type %d", transport); + CURL_TRC_CF(data, cf_at, "unsupported transport type %u", transport); return CURLE_UNSUPPORTED_PROTOCOL; } result = cf_ip_happy_create(&cf, data, cf_at->conn, cf_create, transport); diff --git a/lib/cf-ip-happy.h b/lib/cf-ip-happy.h index 96e619ae4303..2930f21418bf 100644 --- a/lib/cf-ip-happy.h +++ b/lib/cf-ip-happy.h @@ -43,16 +43,16 @@ typedef CURLcode cf_ip_connect_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport); + uint8_t transport); CURLcode cf_ip_happy_insert_after(struct Curl_cfilter *cf_at, struct Curl_easy *data, - int transport); + uint8_t transport); extern struct Curl_cftype Curl_cft_ip_happy; #ifdef UNITTESTS -void Curl_debug_set_transport_provider(int transport, +void Curl_debug_set_transport_provider(uint8_t transport, cf_ip_connect_create *cf_create); #endif diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 2930f95fe24c..c657330ec6ed 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -303,7 +303,7 @@ tcpkeepalive(struct Curl_cfilter *cf, */ static CURLcode sock_assign_addr(struct Curl_sockaddr_ex *dest, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { /* * The Curl_sockaddr_ex structure is basically libcurl's external API @@ -404,7 +404,7 @@ static CURLcode socket_open(struct Curl_easy *data, CURLcode Curl_socket_open(struct Curl_easy *data, const struct Curl_addrinfo *ai, struct Curl_sockaddr_ex *addr, - int transport, + uint8_t transport, curl_socket_t *sockfd) { struct Curl_sockaddr_ex dummy; @@ -909,7 +909,7 @@ static CURLcode socket_connect_result(struct Curl_easy *data, } struct cf_socket_ctx { - int transport; + uint8_t transport; struct Curl_sockaddr_ex addr; /* address to connect to */ curl_socket_t sock; /* current attempt socket */ struct ip_quadruple ip; /* The IP quadruple 2x(addr+port) */ @@ -936,7 +936,7 @@ struct cf_socket_ctx { static CURLcode cf_socket_ctx_init(struct cf_socket_ctx *ctx, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { CURLcode result; @@ -1035,7 +1035,7 @@ static void set_local_ip(struct Curl_cfilter *cf, { struct cf_socket_ctx *ctx = cf->ctx; ctx->ip.local_ip[0] = 0; - ctx->ip.local_port = -1; + ctx->ip.local_port = 0; #ifdef HAVE_GETSOCKNAME if((ctx->sock != CURL_SOCKET_BAD) && @@ -1069,6 +1069,7 @@ static CURLcode set_remote_ip(struct Curl_cfilter *cf, struct cf_socket_ctx *ctx = cf->ctx; /* store remote address and port used in this connection attempt */ + ctx->ip.transport = ctx->transport; if(!Curl_addr2string(&ctx->addr.curl_sa_addr, (curl_socklen_t)ctx->addr.addrlen, ctx->ip.remote_ip, &ctx->ip.remote_port)) { @@ -1743,7 +1744,7 @@ CURLcode Curl_cf_tcp_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { struct cf_socket_ctx *ctx = NULL; struct Curl_cfilter *cf = NULL; @@ -1910,7 +1911,7 @@ CURLcode Curl_cf_udp_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { struct cf_socket_ctx *ctx = NULL; struct Curl_cfilter *cf = NULL; @@ -1964,7 +1965,7 @@ CURLcode Curl_cf_unix_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { struct cf_socket_ctx *ctx = NULL; struct Curl_cfilter *cf = NULL; diff --git a/lib/cf-socket.h b/lib/cf-socket.h index e5fc176ee19c..432b0870451d 100644 --- a/lib/cf-socket.h +++ b/lib/cf-socket.h @@ -71,7 +71,7 @@ CURLcode Curl_parse_interface(const char *input, CURLcode Curl_socket_open(struct Curl_easy *data, const struct Curl_addrinfo *ai, struct Curl_sockaddr_ex *addr, - int transport, + uint8_t transport, curl_socket_t *sockfd); int Curl_socket_close(struct Curl_easy *data, struct connectdata *conn, @@ -103,7 +103,7 @@ CURLcode Curl_cf_tcp_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport); + uint8_t transport); /** * Creates a cfilter that opens a UDP socket to the given address @@ -116,7 +116,7 @@ CURLcode Curl_cf_udp_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport); + uint8_t transport); /** * Creates a cfilter that opens a UNIX socket to the given address @@ -129,7 +129,7 @@ CURLcode Curl_cf_unix_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport); + uint8_t transport); /** * Creates a cfilter that keeps a listening socket. diff --git a/lib/connect.c b/lib/connect.c index fbb5dcabff26..e29c2f51bcf8 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -238,7 +238,7 @@ bool Curl_shutdown_started(struct Curl_easy *data, int sockindex) /* retrieves ip address and port from a sockaddr structure. note it calls curlx_inet_ntop which sets errno on fail, not SOCKERRNO. */ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, - char *addr, int *port) + char *addr, uint16_t *port) { struct sockaddr_in *si = NULL; #ifdef USE_IPV6 @@ -254,8 +254,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, case AF_INET: si = (struct sockaddr_in *)(void *) sa; if(curlx_inet_ntop(sa->sa_family, &si->sin_addr, addr, MAX_IPADR_LEN)) { - unsigned short us_port = ntohs(si->sin_port); - *port = us_port; + *port = ntohs(si->sin_port); return TRUE; } break; @@ -264,8 +263,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, si6 = (struct sockaddr_in6 *)(void *) sa; if(curlx_inet_ntop(sa->sa_family, &si6->sin6_addr, addr, MAX_IPADR_LEN)) { - unsigned short us_port = ntohs(si6->sin6_port); - *port = us_port; + *port = ntohs(si6->sin6_port); return TRUE; } break; @@ -366,7 +364,7 @@ typedef enum { struct cf_setup_ctx { cf_setup_state state; int ssl_mode; - int transport; + uint8_t transport; }; static CURLcode cf_setup_connect(struct Curl_cfilter *cf, @@ -521,7 +519,7 @@ struct Curl_cftype Curl_cft_setup = { static CURLcode cf_setup_create(struct Curl_cfilter **pcf, struct Curl_easy *data, - int transport, + uint8_t transport, int ssl_mode) { struct Curl_cfilter *cf = NULL; @@ -554,7 +552,7 @@ static CURLcode cf_setup_create(struct Curl_cfilter **pcf, static CURLcode cf_setup_add(struct Curl_easy *data, struct connectdata *conn, int sockindex, - int transport, + uint8_t transport, int ssl_mode) { struct Curl_cfilter *cf; @@ -571,7 +569,7 @@ static CURLcode cf_setup_add(struct Curl_easy *data, CURLcode Curl_cf_setup_insert_after(struct Curl_cfilter *cf_at, struct Curl_easy *data, - int transport, + uint8_t transport, int ssl_mode) { struct Curl_cfilter *cf; diff --git a/lib/connect.h b/lib/connect.h index b6d9b8e83698..9060591dcec6 100644 --- a/lib/connect.h +++ b/lib/connect.h @@ -74,7 +74,7 @@ curl_socket_t Curl_getconnectinfo(struct Curl_easy *data, struct connectdata **connp); bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, - char *addr, int *port); + char *addr, uint16_t *port); /* * Curl_conncontrol() marks the end of a connection/stream. The 'closeit' @@ -111,7 +111,7 @@ void Curl_conncontrol(struct connectdata *conn, CURLcode Curl_cf_setup_insert_after(struct Curl_cfilter *cf_at, struct Curl_easy *data, - int transport, + uint8_t transport, int ssl_mode); /** diff --git a/lib/getinfo.c b/lib/getinfo.c index 6a16258b13e1..01c727935620 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -81,8 +81,6 @@ void Curl_initinfo(struct Curl_easy *data) info->wouldredirect = NULL; memset(&info->primary, 0, sizeof(info->primary)); - info->primary.remote_port = -1; - info->primary.local_port = -1; info->retry_after = 0; info->conn_scheme = 0; @@ -304,11 +302,17 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, break; case CURLINFO_PRIMARY_PORT: /* Return the (remote) port of the most recent (primary) connection */ - *param_longp = data->info.primary.remote_port; + if(CUR_IP_QUAD_HAS_PORTS(&data->info.primary)) + *param_longp = data->info.primary.remote_port; + else + *param_longp = -1; break; case CURLINFO_LOCAL_PORT: /* Return the local port of the most recent (primary) connection */ - *param_longp = data->info.primary.local_port; + if(CUR_IP_QUAD_HAS_PORTS(&data->info.primary)) + *param_longp = data->info.primary.local_port; + else + *param_longp = -1; break; case CURLINFO_PROXY_ERROR: *param_longp = (long)data->info.pxcode; diff --git a/lib/setopt.c b/lib/setopt.c index fc95389312ad..36f447cdc5bb 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1001,9 +1001,9 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, #endif #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXYPORT: - if((arg < 0) || (arg > 65535)) + if((arg < 0) || (arg > UINT16_MAX)) return CURLE_BAD_FUNCTION_ARGUMENT; - s->proxyport = (unsigned short)arg; + s->proxyport = (uint16_t)arg; break; case CURLOPT_PROXYAUTH: diff --git a/lib/url.c b/lib/url.c index b6a60feb38b2..e7f39d5471d1 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2171,7 +2171,6 @@ static CURLcode parse_proxy(struct Curl_easy *data, long proxytype) { char *portptr = NULL; - int port = -1; char *proxyuser = NULL; char *proxypasswd = NULL; char *host = NULL; @@ -2293,24 +2292,23 @@ static CURLcode parse_proxy(struct Curl_easy *data, if(portptr) { curl_off_t num; const char *p = portptr; - if(!curlx_str_number(&p, &num, 0xffff)) - port = (int)num; + if(!curlx_str_number(&p, &num, UINT16_MAX)) + proxyinfo->port = (uint16_t)num; + /* Should we not error out when the port number is invalid? */ free(portptr); } else { if(data->set.proxyport) /* None given in the proxy string, then get the default one if it is given */ - port = (int)data->set.proxyport; + proxyinfo->port = data->set.proxyport; else { if(IS_HTTPS_PROXY(proxytype)) - port = CURL_DEFAULT_HTTPS_PROXY_PORT; + proxyinfo->port = CURL_DEFAULT_HTTPS_PROXY_PORT; else - port = CURL_DEFAULT_PROXY_PORT; + proxyinfo->port = CURL_DEFAULT_PROXY_PORT; } } - if(port >= 0) - proxyinfo->port = port; /* now, clone the proxy hostname */ uc = curl_url_get(uhp, CURLUPART_HOST, &host, CURLU_URLDECODE); diff --git a/lib/urldata.h b/lib/urldata.h index 37ecd1ff9db7..debc2a3e0aa0 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -528,7 +528,7 @@ struct Curl_handler { CURLcode (*follow)(struct Curl_easy *data, const char *newurl, followtype type); - int defport; /* Default port. */ + uint16_t defport; /* Default port. */ curl_prot_t protocol; /* See CURLPROTO_* - this needs to be the single specific protocol bit */ curl_prot_t family; /* single bit for protocol family; basically the @@ -576,26 +576,32 @@ struct Curl_handler { #define CONNRESULT_NONE 0 /* No extra information. */ #define CONNRESULT_DEAD (1<<0) /* The connection is dead. */ +#define TRNSPRT_NONE 0 +#define TRNSPRT_TCP 3 +#define TRNSPRT_UDP 4 +#define TRNSPRT_QUIC 5 +#define TRNSPRT_UNIX 6 + struct ip_quadruple { char remote_ip[MAX_IPADR_LEN]; char local_ip[MAX_IPADR_LEN]; - int remote_port; - int local_port; + uint16_t remote_port; + uint16_t local_port; + uint8_t transport; }; +#define CUR_IP_QUAD_HAS_PORTS(x) (((x)->transport == TRNSPRT_TCP) || \ + ((x)->transport == TRNSPRT_UDP) || \ + ((x)->transport == TRNSPRT_QUIC)) + struct proxy_info { struct hostname host; - int port; + uint16_t port; unsigned char proxytype; /* what kind of proxy that is in use */ char *user; /* proxy username string, allocated */ char *passwd; /* proxy password string, allocated */ }; -#define TRNSPRT_TCP 3 -#define TRNSPRT_UDP 4 -#define TRNSPRT_QUIC 5 -#define TRNSPRT_UNIX 6 - /* * The connectdata struct contains all fields and variables that should be * unique for an entire connection. @@ -1364,7 +1370,7 @@ struct UserDefined { #ifndef CURL_DISABLE_PROXY struct ssl_config_data proxy_ssl; /* user defined SSL stuff for proxy */ struct curl_slist *proxyheaders; /* linked list of extra CONNECT headers */ - unsigned short proxyport; /* If non-zero, use this port number by + uint16_t proxyport; /* If non-zero, use this port number by default. If the proxy string features a ":[port]" that one will override this. */ unsigned char proxytype; /* what kind of proxy */ diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index aa0011c577c4..8b4d678d8118 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -687,7 +687,7 @@ CURLcode Curl_cf_quic_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { (void)transport; DEBUGASSERT(transport == TRNSPRT_QUIC); diff --git a/lib/vquic/vquic.h b/lib/vquic/vquic.h index 0f81334f2937..fd2dac7c22eb 100644 --- a/lib/vquic/vquic.h +++ b/lib/vquic/vquic.h @@ -45,7 +45,7 @@ CURLcode Curl_cf_quic_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport); + uint8_t transport); extern struct Curl_cftype Curl_cft_http3; diff --git a/tests/http/test_01_basic.py b/tests/http/test_01_basic.py index aa94238c3f01..14a8dec957fc 100644 --- a/tests/http/test_01_basic.py +++ b/tests/http/test_01_basic.py @@ -96,6 +96,9 @@ def test_01_06_timings(self, env: Env, httpd, nghttpx, proto): # there are cases where time_connect is reported as 0 assert r.stats[0]['time_connect'] >= 0, f'{r.stats[0]}' assert r.stats[0]['time_appconnect'] > 0, f'{r.stats[0]}' + # ports are reported correctly + assert r.stats[0]['remote_port'] == env.port_for(proto), f'{r.dump_logs()}' + assert r.stats[0]['local_port'] > 0, f'{r.dump_logs()}' # simple https: HEAD @pytest.mark.parametrize("proto", Env.http_protos()) diff --git a/tests/http/test_11_unix.py b/tests/http/test_11_unix.py index 2f2db483f404..1432797da26c 100644 --- a/tests/http/test_11_unix.py +++ b/tests/http/test_11_unix.py @@ -109,6 +109,8 @@ def test_11_01_unix_connect_http(self, env: Env, httpd, uds_faker): '--unix-socket', uds_faker.path, ]) r.check_response(count=1, http_status=200) + assert r.stats[0]['remote_port'] == -1, f'{r.dump_logs()}' + assert r.stats[0]['local_port'] == -1, f'{r.dump_logs()}' # download https: via Unix socket @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @@ -120,6 +122,8 @@ def test_11_02_unix_connect_http(self, env: Env, httpd, uds_faker): '--unix-socket', uds_faker.path, ]) r.check_response(exitcode=35, http_status=None) + assert r.stats[0]['remote_port'] == -1, f'{r.dump_logs()}' + assert r.stats[0]['local_port'] == -1, f'{r.dump_logs()}' # download HTTP/3 via Unix socket @pytest.mark.skipif(condition=not Env.have_h3(), reason='h3 not supported') @@ -132,3 +136,5 @@ def test_11_03_unix_connect_quic(self, env: Env, httpd, uds_faker): '--unix-socket', uds_faker.path, ]) r.check_response(exitcode=96, http_status=None) + assert r.stats[0]['remote_port'] == -1, f'{r.dump_logs()}' + assert r.stats[0]['local_port'] == -1, f'{r.dump_logs()}' diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 3e4d53d0be5e..f60b5b58a1e4 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -141,7 +141,7 @@ static CURLcode test_unit1607(const char *arg) addr = dns ? dns->addr : NULL; for(j = 0; j < addressnum; ++j) { - int port = 0; + uint16_t port = 0; char ipaddress[MAX_IPADR_LEN] = {0}; if(!addr && !tests[i].address[j]) diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index f3f318f2cf97..2a3098c6ef2e 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -143,7 +143,7 @@ static CURLcode test_unit1609(const char *arg) addr = dns ? dns->addr : NULL; for(j = 0; j < addressnum; ++j) { - int port = 0; + uint16_t port = 0; char ipaddress[MAX_IPADR_LEN] = {0}; if(!addr && !tests[i].address[j]) diff --git a/tests/unit/unit2600.c b/tests/unit/unit2600.c index 6a03c438dcd9..f2adc50eddd4 100644 --- a/tests/unit/unit2600.c +++ b/tests/unit/unit2600.c @@ -110,7 +110,7 @@ static int test_idx; struct cf_test_ctx { int idx; int ai_family; - int transport; + uint8_t transport; char id[16]; struct curltime started; timediff_t fail_delay_ms; @@ -166,7 +166,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai, - int transport) + uint8_t transport) { static const struct Curl_cftype cft_test = { "TEST", From fd5a117a6715326749b0e0d18362c50d767e8268 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 27 Nov 2025 12:50:04 +0100 Subject: [PATCH 550/885] ws: use uint8_t Convert `unsigned char` use to `uint8_t`. Closes #19721 --- lib/ws.c | 82 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/ws.c b/lib/ws.c index b5c02bda9555..36191b2fac0d 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -91,7 +91,7 @@ struct ws_decoder { int frame_flags; /* See the CURLWS_* defines */ curl_off_t payload_offset; /* the offset parsing is at */ curl_off_t payload_len; - unsigned char head[10]; + uint8_t head[10]; int head_len, head_total; enum ws_dec_state state; int cont_flags; @@ -103,8 +103,8 @@ struct ws_encoder { curl_off_t payload_len; /* payload length of current frame */ curl_off_t payload_remain; /* remaining payload of current */ unsigned int xori; /* xor index */ - unsigned char mask[4]; /* 32-bit mask for this connection */ - unsigned char firstbyte; /* first byte of frame we encode */ + uint8_t mask[4]; /* 32-bit mask for this connection */ + uint8_t firstbyte; /* first byte of frame we encode */ BIT(contfragment); /* set TRUE if the previous fragment sent was not final */ }; @@ -114,7 +114,7 @@ struct ws_encoder { struct ws_cntrl_frame { unsigned int type; size_t payload_len; - unsigned char payload[WS_MAX_CNTRL_LEN]; + uint8_t payload[WS_MAX_CNTRL_LEN]; }; /* A websocket connection with en- and decoder that treat frames @@ -131,7 +131,7 @@ struct websocket { }; -static const char *ws_frame_name_of_op(unsigned char firstbyte) +static const char *ws_frame_name_of_op(uint8_t firstbyte) { switch(firstbyte & WSBIT_OPCODE_MASK) { case WSBIT_OPCODE_CONT: @@ -152,7 +152,7 @@ static const char *ws_frame_name_of_op(unsigned char firstbyte) } static int ws_frame_firstbyte2flags(struct Curl_easy *data, - unsigned char firstbyte, int cont_flags) + uint8_t firstbyte, int cont_flags) { switch(firstbyte) { /* 0x00 - intermediate TEXT/BINARY fragment */ @@ -233,7 +233,7 @@ static int ws_frame_firstbyte2flags(struct Curl_easy *data, static CURLcode ws_frame_flags2firstbyte(struct Curl_easy *data, unsigned int flags, bool contfragment, - unsigned char *pfirstbyte) + uint8_t *pfirstbyte) { *pfirstbyte = 0; switch(flags & ~CURLWS_OFFSET) { @@ -326,7 +326,7 @@ static CURLcode ws_send_raw_blocking(struct Curl_easy *data, struct websocket *ws, const char *buffer, size_t buflen); -typedef CURLcode ws_write_payload(const unsigned char *buf, size_t buflen, +typedef CURLcode ws_write_payload(const uint8_t *buf, size_t buflen, int frame_age, int frame_flags, curl_off_t payload_offset, curl_off_t payload_len, @@ -364,7 +364,7 @@ static CURLcode ws_dec_read_head(struct ws_decoder *dec, struct Curl_easy *data, struct bufq *inraw) { - const unsigned char *inbuf; + const uint8_t *inbuf; size_t inlen; while(Curl_bufq_peek(inraw, &inbuf, &inlen)) { @@ -486,7 +486,7 @@ static CURLcode ws_dec_pass_payload(struct ws_decoder *dec, ws_write_payload *write_cb, void *write_ctx) { - const unsigned char *inbuf; + const uint8_t *inbuf; size_t inlen; size_t nwritten; CURLcode result; @@ -544,7 +544,7 @@ static CURLcode ws_dec_pass(struct ws_decoder *dec, dec->state = WS_DEC_PAYLOAD; if(dec->payload_len == 0) { size_t nwritten; - const unsigned char tmp = '\0'; + const uint8_t tmp = '\0'; /* special case of a 0 length frame, need to write once */ result = write_cb(&tmp, 0, dec->frame_age, dec->frame_flags, 0, 0, write_ctx, &nwritten); @@ -617,7 +617,7 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, bool blocking); static CURLcode ws_enc_send(struct Curl_easy *data, struct websocket *ws, - const unsigned char *buffer, + const uint8_t *buffer, size_t buflen, curl_off_t fragsize, unsigned int flags, @@ -627,7 +627,7 @@ static CURLcode ws_enc_add_pending(struct Curl_easy *data, static CURLcode ws_enc_add_cntrl(struct Curl_easy *data, struct websocket *ws, - const unsigned char *payload, + const uint8_t *payload, size_t plen, unsigned int frame_type) { @@ -663,7 +663,7 @@ static curl_off_t ws_payload_remain(curl_off_t payload_total, return remain - buffered; } -static CURLcode ws_cw_dec_next(const unsigned char *buf, size_t buflen, +static CURLcode ws_cw_dec_next(const uint8_t *buf, size_t buflen, int frame_age, int frame_flags, curl_off_t payload_offset, curl_off_t payload_len, @@ -729,7 +729,7 @@ static CURLcode ws_cw_write(struct Curl_easy *data, if(nbytes) { size_t nwritten; - result = Curl_bufq_write(&ctx->buf, (const unsigned char *)buf, + result = Curl_bufq_write(&ctx->buf, (const uint8_t *)buf, nbytes, &nwritten); if(result) { infof(data, "[WS] error adding data to buffer %d", result); @@ -827,8 +827,8 @@ static CURLcode ws_enc_add_frame(struct Curl_easy *data, curl_off_t payload_len, struct bufq *out) { - unsigned char firstb = 0; - unsigned char head[14]; + uint8_t firstb = 0; + uint8_t head[14]; CURLcode result; size_t hlen, nwritten; @@ -871,24 +871,24 @@ static CURLcode ws_enc_add_frame(struct Curl_easy *data, head[0] = enc->firstbyte = firstb; if(payload_len > 65535) { head[1] = 127 | WSBIT_MASK; - head[2] = (unsigned char)((payload_len >> 56) & 0xff); - head[3] = (unsigned char)((payload_len >> 48) & 0xff); - head[4] = (unsigned char)((payload_len >> 40) & 0xff); - head[5] = (unsigned char)((payload_len >> 32) & 0xff); - head[6] = (unsigned char)((payload_len >> 24) & 0xff); - head[7] = (unsigned char)((payload_len >> 16) & 0xff); - head[8] = (unsigned char)((payload_len >> 8) & 0xff); - head[9] = (unsigned char)(payload_len & 0xff); + head[2] = (uint8_t)((payload_len >> 56) & 0xff); + head[3] = (uint8_t)((payload_len >> 48) & 0xff); + head[4] = (uint8_t)((payload_len >> 40) & 0xff); + head[5] = (uint8_t)((payload_len >> 32) & 0xff); + head[6] = (uint8_t)((payload_len >> 24) & 0xff); + head[7] = (uint8_t)((payload_len >> 16) & 0xff); + head[8] = (uint8_t)((payload_len >> 8) & 0xff); + head[9] = (uint8_t)(payload_len & 0xff); hlen = 10; } else if(payload_len >= 126) { head[1] = 126 | WSBIT_MASK; - head[2] = (unsigned char)((payload_len >> 8) & 0xff); - head[3] = (unsigned char)(payload_len & 0xff); + head[2] = (uint8_t)((payload_len >> 8) & 0xff); + head[3] = (uint8_t)(payload_len & 0xff); hlen = 4; } else { - head[1] = (unsigned char)payload_len | WSBIT_MASK; + head[1] = (uint8_t)payload_len | WSBIT_MASK; hlen = 2; } @@ -897,7 +897,7 @@ static CURLcode ws_enc_add_frame(struct Curl_easy *data, /* 4 bytes random */ - result = Curl_rand(data, (unsigned char *)&enc->mask, sizeof(enc->mask)); + result = Curl_rand(data, (uint8_t *)&enc->mask, sizeof(enc->mask)); if(result) return result; @@ -943,7 +943,7 @@ static CURLcode ws_enc_write_head(struct Curl_easy *data, static CURLcode ws_enc_write_payload(struct ws_encoder *enc, struct Curl_easy *data, - const unsigned char *buf, size_t buflen, + const uint8_t *buf, size_t buflen, struct bufq *out, size_t *pnwritten) { CURLcode result; @@ -960,7 +960,7 @@ static CURLcode ws_enc_write_payload(struct ws_encoder *enc, len = remain; for(i = 0; i < len; ++i) { - unsigned char c = buf[i] ^ enc->mask[enc->xori]; + uint8_t c = buf[i] ^ enc->mask[enc->xori]; result = Curl_bufq_write(out, &c, 1, &n); if(result) { if((result != CURLE_AGAIN) || !i) @@ -1020,7 +1020,7 @@ static CURLcode ws_enc_add_pending(struct Curl_easy *data, static CURLcode ws_enc_send(struct Curl_easy *data, struct websocket *ws, - const unsigned char *buffer, + const uint8_t *buffer, size_t buflen, curl_off_t fragsize, unsigned int flags, @@ -1198,7 +1198,7 @@ static CURLcode cr_ws_read(struct Curl_easy *data, goto out; } - result = ws_enc_write_payload(&ws->enc, data, (unsigned char *)buf, + result = ws_enc_write_payload(&ws->enc, data, (uint8_t *)buf, nread, &ws->sendbuf, &n); if(result) goto out; @@ -1244,7 +1244,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) { unsigned int i; CURLcode result = CURLE_OK; - unsigned char rand[16]; + uint8_t rand[16]; char *randstr; size_t randlen; char keyval[40]; @@ -1273,7 +1273,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) heads[2].val = &keyval[0]; /* 16 bytes random */ - result = Curl_rand(data, (unsigned char *)rand, sizeof(rand)); + result = Curl_rand(data, rand, sizeof(rand)); if(result) return result; result = curlx_base64_encode((char *)rand, sizeof(rand), &randstr, &randlen); @@ -1393,7 +1393,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data, /* In CONNECT_ONLY setup, the payloads from `mem` need to be received * when using `curl_ws_recv` later on after this transfer is already * marked as DONE. */ - result = Curl_bufq_write(&ws->recvbuf, (const unsigned char *)mem, + result = Curl_bufq_write(&ws->recvbuf, (const uint8_t *)mem, nread, &nwritten); if(result) goto out; @@ -1452,7 +1452,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data, struct ws_collect { struct Curl_easy *data; struct websocket *ws; - unsigned char *buffer; + uint8_t *buffer; size_t buflen; size_t bufidx; int frame_age; @@ -1462,7 +1462,7 @@ struct ws_collect { bool written; }; -static CURLcode ws_client_collect(const unsigned char *buf, size_t buflen, +static CURLcode ws_client_collect(const uint8_t *buf, size_t buflen, int frame_age, int frame_flags, curl_off_t payload_offset, curl_off_t payload_len, @@ -1519,7 +1519,7 @@ static CURLcode ws_client_collect(const unsigned char *buf, size_t buflen, } static CURLcode nw_in_recv(void *reader_ctx, - unsigned char *buf, size_t buflen, + uint8_t *buf, size_t buflen, size_t *pnread) { struct Curl_easy *data = reader_ctx; @@ -1628,7 +1628,7 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, { if(!Curl_bufq_is_empty(&ws->sendbuf)) { CURLcode result; - const unsigned char *out; + const uint8_t *out; size_t outlen, n; #ifdef DEBUGBUILD /* Simulate a blocking send after this chunk has been sent */ @@ -1766,7 +1766,7 @@ CURLcode curl_ws_send(CURL *d, const void *buffer_arg, unsigned int flags) { struct websocket *ws; - const unsigned char *buffer = buffer_arg; + const uint8_t *buffer = buffer_arg; CURLcode result = CURLE_OK; struct Curl_easy *data = d; size_t ndummy; From bbb929112b13643842eb9dbfa060bd83a5b5cf03 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 27 Nov 2025 13:18:09 +0100 Subject: [PATCH 551/885] curlx_base64_encode: use uint8_t* for input Change `inputbuff` parameter from `const char *` to `const uint8_t *` to reflect the binary nature of the input bytes. Half the code was casting unsigned char to signed already in calling. Closes #19722 --- lib/curl_sasl.c | 2 +- lib/curlx/base64.c | 10 +++++----- lib/curlx/base64.h | 6 +++--- lib/http.c | 3 ++- lib/http2.c | 3 +-- lib/http_ntlm.c | 4 ++-- lib/ldap.c | 3 ++- lib/openldap.c | 3 ++- lib/vauth/digest.c | 2 +- lib/vauth/spnego_sspi.c | 2 +- lib/vssh/libssh2.c | 2 +- lib/vtls/openssl.c | 4 ++-- lib/vtls/vtls.c | 2 +- lib/vtls/wolfssl.c | 2 +- lib/vtls/x509asn1.c | 2 +- lib/ws.c | 2 +- src/tool_ssls.c | 4 ++-- src/var.c | 2 +- tests/unit/unit1302.c | 5 +++-- 19 files changed, 33 insertions(+), 30 deletions(-) diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 1c9f259de471..f6ec668bfd45 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -267,7 +267,7 @@ static CURLcode build_message(struct SASL *sasl, struct bufref *msg) char *base64; size_t base64len; - result = curlx_base64_encode((const char *) Curl_bufref_ptr(msg), + result = curlx_base64_encode(Curl_bufref_ptr(msg), Curl_bufref_len(msg), &base64, &base64len); if(!result) Curl_bufref_set(msg, base64, base64len, curl_free); diff --git a/lib/curlx/base64.c b/lib/curlx/base64.c index ef07243dd3c5..3fcd709d1ce8 100644 --- a/lib/curlx/base64.c +++ b/lib/curlx/base64.c @@ -66,7 +66,7 @@ static const unsigned char decodetable[] = * @unittest: 1302 */ CURLcode curlx_base64_decode(const char *src, - unsigned char **outptr, size_t *outlen) + uint8_t **outptr, size_t *outlen) { size_t srclen = 0; size_t padding = 0; @@ -170,8 +170,8 @@ CURLcode curlx_base64_decode(const char *src, } static CURLcode base64_encode(const char *table64, - unsigned char padbyte, - const char *inputbuff, size_t insize, + uint8_t padbyte, + const uint8_t *inputbuff, size_t insize, char **outptr, size_t *outlen) { char *output; @@ -245,7 +245,7 @@ static CURLcode base64_encode(const char *table64, * * @unittest: 1302 */ -CURLcode curlx_base64_encode(const char *inputbuff, size_t insize, +CURLcode curlx_base64_encode(const uint8_t *inputbuff, size_t insize, char **outptr, size_t *outlen) { return base64_encode(Curl_base64encdec, '=', @@ -267,7 +267,7 @@ CURLcode curlx_base64_encode(const char *inputbuff, size_t insize, * * @unittest: 1302 */ -CURLcode curlx_base64url_encode(const char *inputbuff, size_t insize, +CURLcode curlx_base64url_encode(const uint8_t *inputbuff, size_t insize, char **outptr, size_t *outlen) { return base64_encode(base64url, 0, inputbuff, insize, outptr, outlen); diff --git a/lib/curlx/base64.h b/lib/curlx/base64.h index 31cfcb36e767..3c97ecc9fec1 100644 --- a/lib/curlx/base64.h +++ b/lib/curlx/base64.h @@ -24,12 +24,12 @@ * ***************************************************************************/ -CURLcode curlx_base64_encode(const char *inputbuff, size_t insize, +CURLcode curlx_base64_encode(const uint8_t *inputbuff, size_t insize, char **outptr, size_t *outlen); -CURLcode curlx_base64url_encode(const char *inputbuff, size_t insize, +CURLcode curlx_base64url_encode(const uint8_t *inputbuff, size_t insize, char **outptr, size_t *outlen); CURLcode curlx_base64_decode(const char *src, - unsigned char **outptr, size_t *outlen); + uint8_t **outptr, size_t *outlen); extern const char Curl_base64encdec[]; diff --git a/lib/http.c b/lib/http.c index 0319be3b657b..672183db0ef2 100644 --- a/lib/http.c +++ b/lib/http.c @@ -367,7 +367,8 @@ static CURLcode http_output_basic(struct Curl_easy *data, bool proxy) if(!out) return CURLE_OUT_OF_MEMORY; - result = curlx_base64_encode(out, strlen(out), &authorization, &size); + result = curlx_base64_encode((uint8_t *)out, strlen(out), + &authorization, &size); if(result) goto fail; diff --git a/lib/http2.c b/lib/http2.c index 4f5f5ea52dd3..4f49efe768b4 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1847,8 +1847,7 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req, return CURLE_FAILED_INIT; } - result = curlx_base64url_encode((const char *)binsettings, binlen, - &base64, &blen); + result = curlx_base64url_encode(binsettings, binlen, &base64, &blen); if(result) { curlx_dyn_free(req); return result; diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index fa375b49bfc6..8cb6403fdb8b 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -205,7 +205,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) hostname, ntlm, &ntlmmsg); if(!result) { DEBUGASSERT(Curl_bufref_len(&ntlmmsg) != 0); - result = curlx_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg), + result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { free(*allocuserpwd); @@ -224,7 +224,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) result = Curl_auth_create_ntlm_type3_message(data, userp, passwdp, ntlm, &ntlmmsg); if(!result && Curl_bufref_len(&ntlmmsg)) { - result = curlx_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg), + result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { free(*allocuserpwd); diff --git a/lib/ldap.c b/lib/ldap.c index fa1a4a4d25c5..7f2af3664325 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -626,7 +626,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) curl_strequal(";binary", attr + (attr_len - 7)) ) { /* Binary attribute, encode to base64. */ if(vals[i]->bv_len) { - result = curlx_base64_encode(vals[i]->bv_val, vals[i]->bv_len, + result = curlx_base64_encode((uint8_t *)vals[i]->bv_val, + vals[i]->bv_len, &val_b64, &val_b64_sz); if(result) { ldap_value_free_len(vals); diff --git a/lib/openldap.c b/lib/openldap.c index 41419df21b20..806ccb33ccd1 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -1213,7 +1213,8 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, /* Binary value, encode to base64. */ if(bvals[i].bv_len) - result = curlx_base64_encode(bvals[i].bv_val, bvals[i].bv_len, + result = curlx_base64_encode((uint8_t *)bvals[i].bv_val, + bvals[i].bv_len, &val_b64, &val_b64_sz); if(!result) result = client_write(data, STRCONST(": "), val_b64, val_b64_sz, diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index c1c0ab2ab219..16045707fd1e 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -710,7 +710,7 @@ static CURLcode auth_create_digest_http_message( if(result) return result; - result = curlx_base64_encode(cnoncebuf, sizeof(cnoncebuf), + result = curlx_base64_encode((uint8_t *)cnoncebuf, sizeof(cnoncebuf), &cnonce, &cnonce_sz); if(result) return result; diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 9cf554d3b061..b36535557bd9 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -301,7 +301,7 @@ CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego, char **outptr, size_t *outlen) { /* Base64 encode the already generated response */ - CURLcode result = curlx_base64_encode((const char *)nego->output_token, + CURLcode result = curlx_base64_encode(nego->output_token, nego->output_token_length, outptr, outlen); if(!result && (!*outptr || !*outlen)) { diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 1c9fe5ac0154..e4ceda8c3494 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -602,7 +602,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data, /* The length of fingerprint is 32 bytes for SHA256. * See libssh2_hostkey_hash documentation. */ - if(curlx_base64_encode(fingerprint, 32, &fingerprint_b64, + if(curlx_base64_encode((const uint8_t *)fingerprint, 32, &fingerprint_b64, &fingerprint_b64_len) != CURLE_OK) { myssh_state(data, sshc, SSH_SESSION_FREE); return CURLE_PEER_FAILED_VERIFICATION; diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 2f526479c5f4..7ff5698e7c30 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4132,7 +4132,7 @@ static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL* ssl, int rv = 1; # ifndef HAVE_BORINGSSL_LIKE char *inner = NULL; - unsigned char *rcs = NULL; + uint8_t *rcs = NULL; char *outer = NULL; # else const char *inner = NULL; @@ -4156,7 +4156,7 @@ static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL* ssl, char *b64str = NULL; size_t blen = 0; - result = curlx_base64_encode((const char *)rcs, rcl, &b64str, &blen); + result = curlx_base64_encode(rcs, rcl, &b64str, &blen); if(!result && b64str) { infof(data, "ECH: retry_configs %s", b64str); free(b64str); diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index d116ec91edb3..9c76ca7ed32c 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -790,7 +790,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, sha256sumdigest, CURL_SHA256_DIGEST_LENGTH); if(!encode) - encode = curlx_base64_encode((char *)sha256sumdigest, + encode = curlx_base64_encode(sha256sumdigest, CURL_SHA256_DIGEST_LENGTH, &cert_hash, &cert_hash_len); Curl_safefree(sha256sumdigest); diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index c8fc8c4add1a..e622f909e50b 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1816,7 +1816,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, char *b64str = NULL; size_t blen = 0; - result = curlx_base64_encode((const char *)echConfigs, echConfigsLen, + result = curlx_base64_encode(echConfigs, echConfigsLen, &b64str, &blen); if(!result && b64str) infof(data, "ECH: (not yet) retry_configs %s", b64str); diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index 96eb512b9038..417a5382d873 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -1228,7 +1228,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, curlx_dyn_reset(&out); /* Generate PEM certificate. */ - result = curlx_base64_encode(cert.certificate.beg, + result = curlx_base64_encode((const uint8_t *)cert.certificate.beg, cert.certificate.end - cert.certificate.beg, &certptr, &clen); if(result) diff --git a/lib/ws.c b/lib/ws.c index 36191b2fac0d..15dc2e9aea7e 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -1276,7 +1276,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) result = Curl_rand(data, rand, sizeof(rand)); if(result) return result; - result = curlx_base64_encode((char *)rand, sizeof(rand), &randstr, &randlen); + result = curlx_base64_encode(rand, sizeof(rand), &randstr, &randlen); if(result) return result; DEBUGASSERT(randlen < sizeof(keyval)); diff --git a/src/tool_ssls.c b/src/tool_ssls.c index 40e67a8044c9..2b67be9baaf8 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -159,7 +159,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr, "# This file was generated by libcurl! Edit at your own risk.\n", ctx->fp); - r = curlx_base64_encode((const char *)shmac, shmac_len, &enc, &enc_len); + r = curlx_base64_encode(shmac, shmac_len, &enc, &enc_len); if(r) goto out; r = CURLE_WRITE_ERROR; @@ -168,7 +168,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr, if(EOF == fputc(':', ctx->fp)) goto out; tool_safefree(enc); - r = curlx_base64_encode((const char *)sdata, sdata_len, &enc, &enc_len); + r = curlx_base64_encode(sdata, sdata_len, &enc, &enc_len); if(r) goto out; r = CURLE_WRITE_ERROR; diff --git a/src/var.c b/src/var.c index 94d79695acc9..5cedf1d24a2c 100644 --- a/src/var.c +++ b/src/var.c @@ -150,7 +150,7 @@ static ParameterError varfunc(char *c, /* content */ if(clen) { char *enc; size_t elen; - CURLcode result = curlx_base64_encode(c, clen, &enc, &elen); + CURLcode result = curlx_base64_encode((uint8_t *)c, clen, &enc, &elen); if(result) { err = PARAM_NO_MEM; break; diff --git a/tests/unit/unit1302.c b/tests/unit/unit1302.c index 2c4404d72702..911432a8c833 100644 --- a/tests/unit/unit1302.c +++ b/tests/unit/unit1302.c @@ -133,7 +133,7 @@ static CURLcode test_unit1302(const char *arg) size_t dlen; /* first encode */ - rc = curlx_base64_encode(e->input, e->ilen, &out, &olen); + rc = curlx_base64_encode((const uint8_t *)e->input, e->ilen, &out, &olen); abort_unless(rc == CURLE_OK, "return code should be CURLE_OK"); abort_unless(olen == e->olen, "wrong output size"); if(memcmp(out, e->output, e->olen)) { @@ -166,7 +166,8 @@ static CURLcode test_unit1302(const char *arg) struct etest *e = &url[i]; char *out; size_t olen; - rc = curlx_base64url_encode(e->input, e->ilen, &out, &olen); + rc = curlx_base64url_encode((const uint8_t *)e->input, e->ilen, + &out, &olen); abort_unless(rc == CURLE_OK, "return code should be CURLE_OK"); if(olen != e->olen) { curl_mfprintf(stderr, "Test %u URL encoded output length %zu " From 71e9920fcd2683bc63ba1f227307560010ce7deb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 14:19:48 +0100 Subject: [PATCH 552/885] GHA: add timeouts to mitigate hung brew install step Ref: https://github.com/curl/curl/actions/runs/19736703410/job/56550251534?pr=19723 Closes #19726 --- .github/workflows/checksrc.yml | 2 ++ .github/workflows/configure-vs-cmake.yml | 1 + .github/workflows/distcheck.yml | 1 + .github/workflows/macos.yml | 2 ++ 4 files changed, 6 insertions(+) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 2f7b0b0e941c..d3ef758b4872 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -73,6 +73,7 @@ jobs: .github/scripts/codespell.sh - name: 'typos' + timeout-minutes: 2 run: | HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install typos-cli eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" @@ -148,6 +149,7 @@ jobs: timeout-minutes: 5 steps: - name: 'install prereqs' + timeout-minutes: 2 run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 diff --git a/.github/workflows/configure-vs-cmake.yml b/.github/workflows/configure-vs-cmake.yml index 53775a44fd83..778b306b65ca 100644 --- a/.github/workflows/configure-vs-cmake.yml +++ b/.github/workflows/configure-vs-cmake.yml @@ -81,6 +81,7 @@ jobs: runs-on: macos-latest steps: - name: 'install packages' + timeout-minutes: 2 run: | # shellcheck disable=SC2181,SC2034 while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index 442a7f18a10c..86c05fd0f0cc 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -279,6 +279,7 @@ jobs: mingw-w64-x86_64-zlib mingw-w64-x86_64-zstd mingw-w64-x86_64-libpsl mingw-w64-x86_64-libssh2 mingw-w64-x86_64-nghttp2 mingw-w64-x86_64-openssl - name: 'install prereqs' + timeout-minutes: 3 run: | if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then cd ~ diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cd72073155c3..25ac41c61ee1 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -94,6 +94,7 @@ jobs: steps: - name: 'brew install' if: ${{ matrix.build.configure }} + timeout-minutes: 5 run: | # shellcheck disable=SC2181,SC2034 while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done @@ -350,6 +351,7 @@ jobs: steps: - name: 'brew install' + timeout-minutes: 5 # Run this command with retries because of spurious failures seen # while running the tests, for example # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true From eae2df837e8927bc43ab5b8994252f8b0b0f097a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 13:02:49 +0100 Subject: [PATCH 553/885] runtests: fix showing `nghttpx-h3` in the `Env:` log when detected Ref: #19723 Closes #19728 --- tests/runtests.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index 54ac77e2e963..3d557d1435ed 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -891,7 +891,7 @@ sub checksystemfeatures { $valgrind?"Valgrind ":"", $run_duphandle?"test-duphandle ":"", $run_event_based?"event-based ":"", - $nghttpx_h3, + $nghttpx_h3?"nghttpx-h3 " :"", $libtool?"Libtool ":""); if($env) { logmsg "* Env: $env\n"; From 7a10f493222cad24a1625bfb283523e73647a6f0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 13:46:53 +0100 Subject: [PATCH 554/885] badwords: make some words match case-insensitively Also: - wcurl.md: sync with upstream to pass the badwords check. Ref: https://github.com/curl/wcurl/commit/11f840cddd840e03b4281cb7408b246c0d09da0f Ref: https://github.com/curl/wcurl/pull/79 Closes #19713 --- .github/scripts/badwords.txt | 10 +++++----- docs/wcurl.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index d8f4461d2675..9e43c03fa827 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -17,7 +17,7 @@ could've:could have couldn't:could not didn't:did not doesn't:does not -don't=do not +don't:do not haven't:have not i'd:I would i'll:I will @@ -74,10 +74,10 @@ file names\b:filenames \buser names\b:usernames \bpass phrase:passphrase \bwill\b:rewrite to present tense -\b32bit=32-bit -\b64bit=64-bit -32 bit\b=32-bit -64 bit\b=64-bit +\b32bit:32-bit +\b64bit:64-bit +32 bit\b:32-bit +64 bit\b:64-bit 64-bits:64 bits or 64-bit 32-bits:32 bits or 32-bit \bvery\b:rephrase using an alternative word diff --git a/docs/wcurl.md b/docs/wcurl.md index 7d1200b2ea70..ab5c3aaa9722 100644 --- a/docs/wcurl.md +++ b/docs/wcurl.md @@ -87,7 +87,7 @@ last value is considered. ## --no-decode-filename -Don't percent-decode the output filename, even if the percent-encoding in the +Do not percent-decode the output filename, even if the percent-encoding in the URL was done by **wcurl**, e.g.: The URL contained whitespace. ## --dry-run From 0081c5b12627ddfb5d6e71198475dc9f95c0a53e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 15:37:19 +0100 Subject: [PATCH 555/885] pytest: disable two H3 earlydata tests for all platforms (was: macOS) Follow-up to 692c7f133e6f9a5053a87b1fffbf3c41697a7742 #19252 Follow-up to eefd03c572996e5de4dec4fe295ad6f103e0eefc #18703 Ref: #19719 Ref: #19723 Fixes #19724 Closes #19730 --- tests/http/test_02_download.py | 8 ++++---- tests/http/test_07_upload.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index dcfe9690bcb4..9fbc116caf0a 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -566,10 +566,10 @@ def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): pytest.skip("h3 early data not supported") if proto != 'h3' and sys.platform.startswith('darwin') and env.ci_run: pytest.skip('failing on macOS CI runners') - if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('wolfssl'): - pytest.skip('h3 wolfssl early data failing on macOS') - if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('gnutls'): - pytest.skip('h3 gnutls early data failing on macOS') + if proto == 'h3' and env.curl_uses_lib('wolfssl'): + pytest.skip('h3 wolfssl early data failing') + if proto == 'h3' and env.curl_uses_lib('gnutls'): + pytest.skip('h3 gnutls early data failing') count = 2 docname = 'data-10k' # we want this test to always connect to nghttpx, since it is diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index 9e49ad7f4737..495ec7a98955 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -663,10 +663,10 @@ def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, pytest.skip("h3 not supported") if proto != 'h3' and sys.platform.startswith('darwin') and env.ci_run: pytest.skip('failing on macOS CI runners') - if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('wolfssl'): - pytest.skip('h3 wolfssl early data failing on macOS') - if proto == 'h3' and sys.platform.startswith('darwin') and env.curl_uses_lib('gnutls'): - pytest.skip('h3 gnutls early data failing on macOS') + if proto == 'h3' and env.curl_uses_lib('wolfssl'): + pytest.skip('h3 wolfssl early data failing') + if proto == 'h3' and env.curl_uses_lib('gnutls'): + pytest.skip('h3 gnutls early data failing') count = 2 # we want this test to always connect to nghttpx, since it is # the only server we have that supports TLS earlydata From c8b76ff42f5228b0c8e3a9d51755ec7f318af6ba Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 13:44:27 +0100 Subject: [PATCH 556/885] GHA/http3-linux: fix broken h3 server in non-openssl jobs, for more pytests It also revealed 3 failing earlydata tests with two backends on Linux, seen earlier on macOS: ``` LibreSSL before: 571 passed, 141 skipped in 45.34s LibreSSL after: 736 passed, 95 skipped in 68.08s aws-lc before: 571 passed, 141 skipped in 78.87s aws-lc after: 736 passed, 95 skipped in 66.71s BoringSSL before: 511 passed, 201 skipped in 46.47s BoringSSL after: 676 passed, 155 skipped in 63.96s GnuTLS before: 515 passed, 197 skipped in 48.31s GnuTLS after: 688 passed, 140 skipped in 67.79s (3 failed) wolfSSL before: 541 passed, 171 skipped in 52.49s wolfSSL after: 714 passed, 114 skipped in 83.84s (3 failed) OpenSSL before: 757 passed, 74 skipped in 65.43s OpenSSL after: 757 passed, 74 skipped in 65.06s OpenSSL-quic before: 741 passed, 90 skipped in 62.85s OpenSSL-quic after: 741 passed, 90 skipped in 57.20s quiche before: 511 passed, 201 skipped in 45.94s quiche after: 664 passed, 167 skipped in 59.57s ``` Before: https://github.com/curl/curl/actions/runs/19734972379 After: https://github.com/curl/curl/actions/runs/19736703398?pr=19723 Failures address via: 0081c5b12627ddfb5d6e71198475dc9f95c0a53e #19730 Ref: #19724 Closes #19723 --- .github/workflows/http3-linux.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 87738dd79138..353c36814219 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -486,7 +486,6 @@ jobs: echo 'CXX=g++-12' >> "$GITHUB_ENV" - name: 'cache openssl' - if: ${{ matrix.build.name == 'openssl' || matrix.build.name == 'openssl-quic' }} uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 id: cache-openssl-http3-no-deprecated env: From a59a3cc7f1593784e496172b9fb4d82ed6fae487 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Nov 2025 14:25:43 +0100 Subject: [PATCH 557/885] cfilters: make conn_forget_socket a private libssh function It is only used for (old) libssh builds. Closes #19727 --- lib/cfilters.c | 13 ------------- lib/vssh/libssh.c | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index f0da4778a685..31c7b07747c1 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -931,19 +931,6 @@ Curl_conn_get_remote_addr(struct Curl_easy *data, int sockindex) return cf ? cf_get_remote_addr(cf, data) : NULL; } -void Curl_conn_forget_socket(struct Curl_easy *data, int sockindex) -{ - struct connectdata *conn = data->conn; - if(conn && CONN_SOCK_IDX_VALID(sockindex)) { - struct Curl_cfilter *cf = conn->cfilter[sockindex]; - if(cf) - (void)Curl_conn_cf_cntrl(cf, data, TRUE, - CF_CTRL_FORGET_SOCKET, 0, NULL); - fake_sclose(conn->sock[sockindex]); - conn->sock[sockindex] = CURL_SOCKET_BAD; - } -} - static CURLcode cf_cntrl_all(struct connectdata *conn, struct Curl_easy *data, bool ignore_result, diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index c76478bc2a57..4b003bd71ca9 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1874,6 +1874,19 @@ static int myssh_in_SFTP_QUOTE_STAT(struct Curl_easy *data, return SSH_NO_ERROR; } +static void conn_forget_socket(struct Curl_easy *data, int sockindex) +{ + struct connectdata *conn = data->conn; + if(conn && CONN_SOCK_IDX_VALID(sockindex)) { + struct Curl_cfilter *cf = conn->cfilter[sockindex]; + if(cf) + (void)Curl_conn_cf_cntrl(cf, data, TRUE, + CF_CTRL_FORGET_SOCKET, 0, NULL); + fake_sclose(conn->sock[sockindex]); + conn->sock[sockindex] = CURL_SOCKET_BAD; + } +} + /* * ssh_statemach_act() runs the SSH state machine as far as it can without * blocking and without reaching the end. The data the pointer 'block' points @@ -2376,7 +2389,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, /* conn->sock[FIRSTSOCKET] is closed by ssh_disconnect behind our back, tell the connection to forget about it. This libssh bug is fixed in 0.10.0. */ - Curl_conn_forget_socket(data, FIRSTSOCKET); + conn_forget_socket(data, FIRSTSOCKET); } SSH_STRING_FREE_CHAR(sshc->homedir); From 1e048e932acfe8e46a1e33fb5d7d51406b12e23b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Nov 2025 14:19:34 +0100 Subject: [PATCH 558/885] ngtcp2: remove the unused Curl_conn_is_ngtcp2 function Closes #19725 --- lib/vquic/curl_ngtcp2.c | 16 ---------------- lib/vquic/curl_ngtcp2.h | 4 ---- 2 files changed, 20 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index de767f28dc04..22ea0e3ef493 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -2880,20 +2880,4 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf, return result; } -bool Curl_conn_is_ngtcp2(const struct Curl_easy *data, - const struct connectdata *conn, - int sockindex) -{ - struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; - - (void)data; - for(; cf; cf = cf->next) { - if(cf->cft == &Curl_cft_http3) - return TRUE; - if(cf->cft->flags & CF_TYPE_IP_CONNECT) - return FALSE; - } - return FALSE; -} - #endif diff --git a/lib/vquic/curl_ngtcp2.h b/lib/vquic/curl_ngtcp2.h index 86753a3a6ba8..7933e924e1c7 100644 --- a/lib/vquic/curl_ngtcp2.h +++ b/lib/vquic/curl_ngtcp2.h @@ -55,10 +55,6 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, const struct Curl_addrinfo *ai); - -bool Curl_conn_is_ngtcp2(const struct Curl_easy *data, - const struct connectdata *conn, - int sockindex); #endif #endif /* HEADER_CURL_VQUIC_CURL_NGTCP2_H */ From 56e88e7c14dd1a529f9a4f23db5f791302bba6e7 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 27 Nov 2025 15:13:11 +0100 Subject: [PATCH 559/885] cfilter: send uint8_t bytes Change the send parameter from `const void *` to `const uint8_t *` and adapt calling code. Several had already unsigned chars and were casting. Closes #19729 --- lib/cf-h1-proxy.c | 4 ++-- lib/cf-h2-proxy.c | 6 +++--- lib/cf-haproxy.c | 2 +- lib/cf-socket.c | 2 +- lib/cfilters.c | 9 ++++----- lib/cfilters.h | 6 +++--- lib/http2.c | 6 +++--- lib/socks_gssapi.c | 12 +++++------- lib/socks_sspi.c | 13 +++++-------- lib/vquic/curl_ngtcp2.c | 6 +++--- lib/vquic/curl_osslq.c | 6 +++--- lib/vquic/curl_quiche.c | 8 ++++---- lib/vtls/mbedtls.c | 3 +-- lib/vtls/openssl.c | 3 ++- lib/vtls/rustls.c | 2 +- lib/vtls/schannel.c | 12 ++++++++---- lib/vtls/vtls.c | 4 ++-- lib/vtls/wolfssl.c | 3 ++- 18 files changed, 53 insertions(+), 54 deletions(-) diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index e496d7634dce..417b4df67e29 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -246,7 +246,7 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf, struct h1_tunnel_state *ts, bool *done) { - char *buf = curlx_dyn_ptr(&ts->request_data); + uint8_t *buf = curlx_dyn_uptr(&ts->request_data); size_t request_len = curlx_dyn_len(&ts->request_data); size_t blen = request_len; CURLcode result = CURLE_OK; @@ -267,7 +267,7 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf, DEBUGASSERT(blen >= nwritten); ts->nsent += nwritten; - Curl_debug(data, CURLINFO_HEADER_OUT, buf, nwritten); + Curl_debug(data, CURLINFO_HEADER_OUT, (char *)buf, nwritten); out: if(result) diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index 89bc7cc23f48..fca916a2c24f 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -225,7 +225,7 @@ static void drain_tunnel(struct Curl_cfilter *cf, } static CURLcode proxy_h2_nw_out_writer(void *writer_ctx, - const unsigned char *buf, size_t buflen, + const uint8_t *buf, size_t buflen, size_t *pnwritten) { struct Curl_cfilter *cf = writer_ctx; @@ -233,7 +233,7 @@ static CURLcode proxy_h2_nw_out_writer(void *writer_ctx, if(cf) { struct Curl_easy *data = CF_DATA_CURRENT(cf); CURLcode result; - result = Curl_conn_cf_send(cf->next, data, (const char *)buf, buflen, + result = Curl_conn_cf_send(cf->next, data, buf, buflen, FALSE, pnwritten); CURL_TRC_CF(data, cf, "[0] nw_out_writer(len=%zu) -> %d, %zu", buflen, result, *pnwritten); @@ -1356,7 +1356,7 @@ static CURLcode cf_h2_proxy_recv(struct Curl_cfilter *cf, static CURLcode cf_h2_proxy_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_h2_proxy_ctx *ctx = cf->ctx; diff --git a/lib/cf-haproxy.c b/lib/cf-haproxy.c index 3231791097ed..8912604504d8 100644 --- a/lib/cf-haproxy.c +++ b/lib/cf-haproxy.c @@ -133,7 +133,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, if(len > 0) { size_t nwritten; result = Curl_conn_cf_send(cf->next, data, - curlx_dyn_ptr(&ctx->data_out), len, FALSE, + curlx_dyn_uptr(&ctx->data_out), len, FALSE, &nwritten); if(result) { if(result != CURLE_AGAIN) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index c657330ec6ed..6e5333602c34 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1428,7 +1428,7 @@ static void win_update_sndbuf_size(struct cf_socket_ctx *ctx) #endif /* USE_WINSOCK */ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_socket_ctx *ctx = cf->ctx; diff --git a/lib/cfilters.c b/lib/cfilters.c index 31c7b07747c1..7cb10f39282f 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -85,7 +85,7 @@ bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, } CURLcode Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { if(cf->next) @@ -296,12 +296,11 @@ CURLcode Curl_cf_recv_bufq(struct Curl_cfilter *cf, } static CURLcode cf_bufq_writer(void *writer_ctx, - const unsigned char *buf, size_t buflen, + const uint8_t *buf, size_t buflen, size_t *pnwritten) { struct cf_io_ctx *io = writer_ctx; - return Curl_conn_cf_send(io->cf, io->data, (const char *)buf, - buflen, FALSE, pnwritten); + return Curl_conn_cf_send(io->cf, io->data, buf, buflen, FALSE, pnwritten); } CURLcode Curl_cf_send_bufq(struct Curl_cfilter *cf, @@ -422,7 +421,7 @@ void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) } CURLcode Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { if(cf) diff --git a/lib/cfilters.h b/lib/cfilters.h index 6cb4a6909c36..5d39725088ed 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -89,7 +89,7 @@ typedef bool Curl_cft_data_pending(struct Curl_cfilter *cf, typedef CURLcode Curl_cft_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* transfer */ - const void *buf, /* data to write */ + const uint8_t *buf, /* data to write */ size_t len, /* amount to write */ bool eos, /* last chunk */ size_t *pnwritten); /* how much sent */ @@ -250,7 +250,7 @@ CURLcode Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data); CURLcode Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten); CURLcode Curl_cf_def_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, size_t *pnread); @@ -323,7 +323,7 @@ CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, bool *done); void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data); CURLcode Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten); CURLcode Curl_conn_cf_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, size_t *pnread); diff --git a/lib/http2.c b/lib/http2.c index 4f49efe768b4..2e8649c10502 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2258,7 +2258,7 @@ static CURLcode cf_h2_body_send(struct Curl_cfilter *cf, static CURLcode h2_submit(struct h2_stream_ctx **pstream, struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_h2_ctx *ctx = cf->ctx; @@ -2281,7 +2281,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, if(result) goto out; - result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, &nwritten); @@ -2391,7 +2391,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, } static CURLcode cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_h2_ctx *ctx = cf->ctx; diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 30fefa5a6d3c..61c88be60528 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -211,7 +211,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = htons((unsigned short)gss_send_token.length); memcpy(socksreq + 2, &us_length, sizeof(short)); - code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, + code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &nwritten); if(code || (nwritten != 4)) { failf(data, "Failed to send GSS-API authentication request."); @@ -222,7 +222,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } code = Curl_conn_cf_send(cf->next, data, - (char *)gss_send_token.value, + gss_send_token.value, gss_send_token.length, FALSE, &nwritten); if(code || (gss_send_token.length != nwritten)) { failf(data, "Failed to send GSS-API authentication token."); @@ -409,8 +409,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, memcpy(socksreq + 2, &us_length, sizeof(short)); } - code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE, - &nwritten); + code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &nwritten); if(code || (nwritten != 4)) { failf(data, "Failed to send GSS-API encryption request."); gss_release_buffer(&gss_status, &gss_w_token); @@ -420,8 +419,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(data->set.socks5_gssapi_nec) { memcpy(socksreq, &gss_enc, 1); - code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE, - &nwritten); + code = Curl_conn_cf_send(cf->next, data, socksreq, 1, FALSE, &nwritten); if(code || (nwritten != 1)) { failf(data, "Failed to send GSS-API encryption type."); Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); @@ -429,7 +427,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } } else { - code = Curl_conn_cf_send(cf->next, data, (char *)gss_w_token.value, + code = Curl_conn_cf_send(cf->next, data, gss_w_token.value, gss_w_token.length, FALSE, &nwritten); if(code || (gss_w_token.length != nwritten)) { failf(data, "Failed to send GSS-API encryption type."); diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 975172576c35..14025371ce37 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -88,7 +88,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, unsigned char socksreq[4]; /* room for GSS-API exchange header only */ const char *service = data->set.str[STRING_PROXY_SERVICE_NAME] ? data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd"; - char *etbuf; + uint8_t *etbuf; size_t etbuf_size; /* GSS-API request looks like @@ -201,8 +201,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = htons((unsigned short)sspi_send_token.cbBuffer); memcpy(socksreq + 2, &us_length, sizeof(short)); - code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE, - &written); + code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &written); if(code || (written != 4)) { failf(data, "Failed to send SSPI authentication request."); result = CURLE_COULDNT_CONNECT; @@ -210,7 +209,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } code = Curl_conn_cf_send(cf->next, data, - (char *)sspi_send_token.pvBuffer, + sspi_send_token.pvBuffer, sspi_send_token.cbBuffer, FALSE, &written); if(code || (sspi_send_token.cbBuffer != written)) { failf(data, "Failed to send SSPI authentication token."); @@ -433,8 +432,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, memcpy(socksreq + 2, &us_length, sizeof(short)); } - code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE, - &written); + code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &written); if(code || (written != 4)) { failf(data, "Failed to send SSPI encryption request."); result = CURLE_COULDNT_CONNECT; @@ -443,8 +441,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(data->set.socks5_gssapi_nec) { memcpy(socksreq, &gss_enc, 1); - code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE, - &written); + code = Curl_conn_cf_send(cf->next, data, socksreq, 1, FALSE, &written); if(code || (written != 1)) { failf(data, "Failed to send SSPI encryption type."); result = CURLE_COULDNT_CONNECT; diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 22ea0e3ef493..86f7428048e1 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1524,7 +1524,7 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, static CURLcode h3_stream_open(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, + const uint8_t *buf, size_t len, size_t *pnwritten) { struct cf_ngtcp2_ctx *ctx = cf->ctx; @@ -1552,7 +1552,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, goto out; } - result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, pnwritten); @@ -1656,7 +1656,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, } static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_ngtcp2_ctx *ctx = cf->ctx; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 376705e51667..d6672ce13252 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1877,7 +1877,7 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, static CURLcode h3_stream_open(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, + const uint8_t *buf, size_t len, size_t *pnwritten) { struct cf_osslq_ctx *ctx = cf->ctx; @@ -1903,7 +1903,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, goto out; } - result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, + result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, pnwritten); @@ -2005,7 +2005,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, } static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_osslq_ctx *ctx = cf->ctx; diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 927492979013..f8fbadeebb1f 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -911,7 +911,7 @@ static CURLcode cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf, struct Curl_easy *data, struct h3_stream_ctx *stream, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_quiche_ctx *ctx = cf->ctx; @@ -956,7 +956,7 @@ static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf, static CURLcode h3_open_stream(struct Curl_cfilter *cf, struct Curl_easy *data, - const char *buf, size_t blen, bool eos, + const uint8_t *buf, size_t blen, bool eos, size_t *pnwritten) { struct cf_quiche_ctx *ctx = cf->ctx; @@ -980,7 +980,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, DEBUGASSERT(stream); - result = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, + result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, blen, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, pnwritten); @@ -1076,7 +1076,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, } static CURLcode cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct cf_quiche_ctx *ctx = cf->ctx; diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 9a307499595a..2ea3670c1bf2 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -187,8 +187,7 @@ static int mbedtls_bio_cf_write(void *bio, if(!data) return 0; - result = Curl_conn_cf_send(cf->next, data, (const char *)buf, blen, FALSE, - &nwritten); + result = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &nwritten); CURL_TRC_CF(data, cf, "mbedtls_bio_cf_out_write(len=%zu) -> %d, %zu", blen, result, nwritten); if(CURLE_AGAIN == result) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 7ff5698e7c30..d8f99b21c371 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -597,7 +597,8 @@ static int ossl_bio_cf_out_write(BIO *bio, const char *buf, int blen) if(blen < 0) return 0; - result = Curl_conn_cf_send(cf->next, data, buf, (size_t)blen, FALSE, + result = Curl_conn_cf_send(cf->next, data, + (const uint8_t *)buf, (size_t)blen, FALSE, &nwritten); CURL_TRC_CF(data, cf, "ossl_bio_cf_out_write(len=%d) -> %d, %zu", blen, result, nwritten); diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 3b5bea2c6fe7..cc19a328eda1 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -133,7 +133,7 @@ write_cb(void *userdata, const uint8_t *buf, uintptr_t len, uintptr_t *out_n) size_t nwritten; result = Curl_conn_cf_send(io_ctx->cf->next, io_ctx->data, - (const char *)buf, len, FALSE, &nwritten); + buf, len, FALSE, &nwritten); if(result) { nwritten = 0; if(CURLE_AGAIN == result) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index f7e831f002e5..e5fbe40a8c1a 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1074,7 +1074,8 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* send initial handshake data which is now stored in output buffer */ result = Curl_conn_cf_send(cf->next, data, - outbuf.pvBuffer, outbuf.cbBuffer, FALSE, + (const uint8_t *)outbuf.pvBuffer, + outbuf.cbBuffer, FALSE, &written); Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer); if(result || (outbuf.cbBuffer != written)) { @@ -1307,7 +1308,8 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* send handshake token to server */ result = Curl_conn_cf_send(cf->next, data, - outbuf[i].pvBuffer, outbuf[i].cbBuffer, + (const uint8_t *)outbuf[i].pvBuffer, + outbuf[i].cbBuffer, FALSE, &written); if(result || (outbuf[i].cbBuffer != written)) { failf(data, "schannel: failed to send next handshake data: " @@ -2004,7 +2006,8 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* socket is writable */ result = Curl_conn_cf_send(cf->next, data, - ptr + *pnwritten, len - *pnwritten, + (const uint8_t *)ptr + *pnwritten, + len - *pnwritten, FALSE, &this_write); if(result == CURLE_AGAIN) continue; @@ -2450,7 +2453,8 @@ static CURLcode schannel_shutdown(struct Curl_cfilter *cf, size_t written; result = Curl_conn_cf_send(cf->next, data, - outbuf.pvBuffer, outbuf.cbBuffer, + (const uint8_t *)outbuf.pvBuffer, + outbuf.cbBuffer, FALSE, &written); Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer); if(!result) { diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 9c76ca7ed32c..3b242fd485d2 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1477,7 +1477,7 @@ static bool ssl_cf_data_pending(struct Curl_cfilter *cf, static CURLcode ssl_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t blen, + const uint8_t *buf, size_t blen, bool eos, size_t *pnwritten) { struct ssl_connect_data *connssl = cf->ctx; @@ -1509,7 +1509,7 @@ static CURLcode ssl_cf_send(struct Curl_cfilter *cf, } else { *pnwritten = connssl->earlydata_skip; - buf = ((const char *)buf) + connssl->earlydata_skip; + buf = buf + connssl->earlydata_skip; blen -= connssl->earlydata_skip; connssl->earlydata_skip = 0; } diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index e622f909e50b..2ad033f98899 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -334,7 +334,8 @@ static int wssl_bio_cf_out_write(WOLFSSL_BIO *bio, skiplen = (ssize_t)(blen - wssl->io_send_blocked_len); blen = wssl->io_send_blocked_len; } - result = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &nwritten); + result = Curl_conn_cf_send(cf->next, data, + (const uint8_t *)buf, blen, FALSE, &nwritten); wssl->io_result = result; CURL_TRC_CF(data, cf, "bio_write(len=%d) -> %d, %zu", blen, result, nwritten); From c1deea4c58f385b172e31a75157931acf278dd74 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 12:17:27 +0100 Subject: [PATCH 560/885] GHA/http3-linux: add H3 valgrind tests Ref: #19714 Ref: #19717 Closes #19719 --- .github/workflows/http3-linux.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 353c36814219..a9117e146ef9 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -479,7 +479,7 @@ jobs: sudo rm -f /var/lib/man-db/auto-update sudo apt-get -o Dpkg::Use-Pty=0 install \ libtool autoconf automake pkgconf \ - libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libidn2-0-dev libldap-dev libuv1-dev \ + libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libidn2-0-dev libldap-dev libuv1-dev valgrind \ ${INSTALL_PACKAGES} \ ${MATRIX_INSTALL_PACKAGES} echo 'CC=gcc-12' >> "$GITHUB_ENV" @@ -701,6 +701,18 @@ jobs: - name: 'run tests' if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }} run: | + export TFLAGS='-n' + source ~/venv/bin/activate + if [ "${MATRIX_BUILD}" = 'cmake' ]; then + cmake --build bld --verbose --target test-ci + else + make -C bld V=1 test-ci + fi + + - name: 'run tests (valgrind)' + if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }} + run: | + export TFLAGS='-j6 HTTP/3' source ~/venv/bin/activate if [ "${MATRIX_BUILD}" = 'cmake' ]; then cmake --build bld --verbose --target test-ci @@ -714,7 +726,7 @@ jobs: [ -d ~/venv ] || python3 -m venv ~/venv ~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt - - name: 'run pytest event based' + - name: 'run pytest (event based)' if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }} env: CURL_TEST_EVENT: 1 From 53775baa1d6ba0301a6c041a60350d0914065b7f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Nov 2025 15:55:47 +0100 Subject: [PATCH 561/885] tests: allow 2500-2503 to use ~2MB malloc On Linux using UDP_GRO, curl might allocate a (single) 1.5MB buffer for maximum performance. Fixes #19716 Closes #19731 --- tests/data/test2500 | 4 ++++ tests/data/test2501 | 3 +++ tests/data/test2502 | 3 +++ tests/data/test2503 | 3 +++ 4 files changed, 13 insertions(+) diff --git a/tests/data/test2500 b/tests/data/test2500 index f92cabfd32b6..bc6790c2c1f1 100644 --- a/tests/data/test2500 +++ b/tests/data/test2500 @@ -73,5 +73,9 @@ via: 1.1 nghttpx s/^server: nghttpx.*\r?\n// + +Allocations: 150 +Maximum allocated: 1800000 + diff --git a/tests/data/test2501 b/tests/data/test2501 index 99167ec48e86..01505f4ce27f 100644 --- a/tests/data/test2501 +++ b/tests/data/test2501 @@ -65,5 +65,8 @@ Via: 3 nghttpx moo + +Maximum allocated: 1900000 + diff --git a/tests/data/test2502 b/tests/data/test2502 index 627cfdccad8e..ac6cd3cf588c 100644 --- a/tests/data/test2502 +++ b/tests/data/test2502 @@ -101,5 +101,8 @@ Via: 3 nghttpx $_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) + +Maximum allocated: 1800000 + diff --git a/tests/data/test2503 b/tests/data/test2503 index 722d0ceb7adf..9e8d4c3d490c 100644 --- a/tests/data/test2503 +++ b/tests/data/test2503 @@ -65,5 +65,8 @@ via: 1.1 nghttpx "via":["1.1 nghttpx"] } + +Maximum allocated: 1800000 + From aa9342058fbf0ce1d387b7c590e674e6acabbda8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Nov 2025 16:14:37 +0100 Subject: [PATCH 562/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 75 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 217f8c750446..2dbac34d0f65 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3549 + Contributors: 3553 This release includes the following changes: @@ -19,8 +19,10 @@ This release includes the following bugfixes: o _PROGRESS.md: add the E unit, mention kibibyte [24] o AmigaOS: increase minimum stack size for tool_main [137] o apple-sectrust: always ask when `native_ca_store` is in use [162] + o asyn-ares: handle Curl_dnscache_mk_entry() OOM error [199] o asyn-ares: remove hostname free on OOM [122] o asyn-thrdd: release rrname if ares_init_options fails [41] + o autotools: add nettle library detection via pkg-config (for GnuTLS) [178] o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] o badwords: fix issues found in scripts and other files [142] o badwords: fix issues found in tests [156] @@ -31,6 +33,7 @@ This release includes the following bugfixes: o cf-https-connect: allocate ctx at first in cf_hc_create() [79] o cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime [157] o cf-socket: trace ignored errors [97] + o cfilters: make conn_forget_socket a private libssh function [109] o checksrc.pl: detect assign followed by more than one space [26] o cmake: adjust defaults for target platforms not supporting shared libs [35] o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] @@ -39,6 +42,7 @@ This release includes the following bugfixes: o config2setopts: bail out if curl_url_get() returns OOM [102] o config2setopts: exit if curl_url_set() fails on OOM [105] o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] + o conncontrol: reuse handling [170] o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100] o cookie: propagate errors better, cleanup the internal API [118] o cookie: return error on OOM [131] @@ -53,15 +57,21 @@ This release includes the following bugfixes: o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example + o curlx/fopen: replace open CRT functions their with `_s` counterparts (Windows) [204] o curlx/strerr: use `strerror_s()` on Windows [75] o curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows) [143] + o curlx: replace `sprintf` with `snprintf` [194] o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] o DISTROS.md: add OpenBSD [126] + o doc: some returned in-memory data may not be altered [196] o docs: fix checksrc `EQUALSPACE` warnings [21] o docs: mention umask need when curl creates files [56] + o docs: spell it Rustls with a capital R [181] o examples/crawler: fix variable [92] + o examples/multi-uv: fix invalid req->data access [177] o examples/multithread: fix race condition [101] + o examples: fix minor typo [203] o examples: make functions/data static where missing [139] o examples: tidy-up headers and includes [138] o file: do not pass invalid mode flags to `open()` on upload (Windows) [83] @@ -73,9 +83,12 @@ This release includes the following bugfixes: o gtls: skip session resumption when verifystatus is set o h2/h3: handle methods with spaces [146] o hostip: don't store negative lookup on OOM [61] + o hostip: make more functions return CURLcode [202] + o hostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST [183] o hsts: propagate and error out correctly on OOM [130] o http: avoid two strdup()s and do minor simplifications [144] o http: error on OOM when creating range header [59] + o http: fix OOM exit in Curl_http_follow [179] o http: replace atoi use in Curl_http_follow with curlx_str_number [65] o http: the :authority header should never contain user+password [147] o INSTALL-CMAKE.md: document static option defaults more [37] @@ -86,6 +99,7 @@ This release includes the following bugfixes: o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] o lib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows) [164] + o lib: timer stats improvements [190] o libssh2: add paths to error messages for quote commands [114] o libssh2: cleanup ssh_force_knownhost_key_type [64] o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] @@ -93,11 +107,15 @@ This release includes the following bugfixes: o libtests: replace `atoi()` with `curlx_str_number()` [120] o limit-rate: add example using --limit-rate and --max-time together [89] o m4/sectrust: fix test(1) operator [4] + o manage: expand the 'libcurl support required' message [208] o mbedtls: fix potential use of uninitialized `nread` [8] o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] o multi: make max_total_* members size_t [158] + o multi: simplify admin handle processing [189] + o ngtcp2+openssl: fix leak of session [172] + o ngtcp2: remove the unused Curl_conn_is_ngtcp2 function [85] o noproxy: replace atoi with curlx_str_number [67] o openssl: exit properly on OOM when getting certchain [133] o openssl: fix a potential memory leak of bio_out [150] @@ -111,7 +129,9 @@ This release includes the following bugfixes: o progress: show fewer digits [78] o projects/README.md: Markdown fixes [148] o pytest fixes and improvements [159] + o pytest: disable two H3 earlydata tests for all platforms (was: macOS) [116] o pytest: skip H2 tests if feature missing from curl [46] + o ratelimit: redesign [209] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] o runtests: detect bad libssh differently for test 1459 [11] @@ -126,9 +146,11 @@ This release includes the following bugfixes: o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30] o setopt: when setting bad protocols, don't store them [9] o sftp: fix range downloads in both SSH backends [82] + o slist: constify Curl_slist_append_nodup() string argument [195] o smb: fix a size check to be overflow safe [161] o socks_sspi: use free() not FreeContextBuffer() [93] o speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE [113] + o speedlimit: also reset on send unpausing [197] o telnet: replace atoi for BINARY handling with curlx_str_number [66] o TEST-SUITE.md: correct the man page's path [136] o test07_22: fix flakiness [95] @@ -138,11 +160,14 @@ This release includes the following bugfixes: o tests/data: support using native newlines on disk, drop `.gitattributes` [91] o tests/server: do not fall back to original data file in `test2fopen()` [32] o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110] + o tests: allow 2500-2503 to use ~2MB malloc [31] o tftp: release filename if conn_get_remote_addr fails [42] o tftpd: fix/tidy up `open()` mode flags [57] o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] o tool: consider (some) curl_easy_setopt errors fatal [7] + o tool: log when loading .curlrc in verbose mode [191] o tool_cfgable: free ssl-sessions at exit [123] + o tool_doswin: clear pointer when thread takes ownership [198] o tool_getparam: verify that a file exists for some options [134] o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] @@ -157,9 +182,11 @@ This release includes the following bugfixes: o tool_writeout: bail out proper on OOM [104] o url: if OOM in parse_proxy() return error [132] o urlapi: fix mem-leaks in curl_url_get error paths [22] + o urlapi: handle OOM properly when setting URL [180] o verify-release: update to avoid shellcheck warning SC2034 [88] o vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally [96] o vquic: do not pass invalid mode flags to `open()` (Windows) [58] + o vquic: do_sendmsg full init [171] o vtls: fix CURLOPT_CAPATH use [51] o vtls: handle possible malicious certs_num from peer [53] o vtls: pinned key check [98] @@ -190,15 +217,16 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Aleksandr Sergeev, Andrew Kirillov, boingball, Brad King, bttrfl on github, - Christian Schmitz, Dan Fandrich, Daniel McCarney, Daniel Stenberg, - Fd929c2CE5fA on github, ffath-vo on github, Gisle Vanem, Jiyong Yang, - Juliusz Sosinowicz, Leonardo Taccari, letshack9707 on hackerone, - Marc Aldorasi, Marcel Raad, nait-furry, ncaklovic on github, Nick Korepanov, - Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro, - renovate[bot], Samuel Henrique, Stanislav Fort, Stefan Eissing, - Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang - (33 contributors) + Aleksandr Sergeev, Aleksei Bavshin, Andrew Kirillov, BANADDA, boingball, + Brad King, bttrfl on github, Christian Schmitz, Dan Fandrich, + Daniel McCarney, Daniel Stenberg, Fd929c2CE5fA on github, ffath-vo on github, + Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Leonardo Taccari, + letshack9707 on hackerone, Marc Aldorasi, Marcel Raad, nait-furry, + ncaklovic on github, Nick Korepanov, Omdahake on github, Patrick Monnerat, + pelioro on hackerone, Ray Satiro, renovate[bot], Samuel Henrique, + st751228051 on github, Stanislav Fort, Stefan Eissing, Sunny, + Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang, Yedaya Katsman + (38 contributors) References to bug reports and discussions on issues: @@ -232,6 +260,7 @@ References to bug reports and discussions on issues: [28] = https://curl.se/bug/?i=19354 [29] = https://curl.se/bug/?i=19430 [30] = https://curl.se/bug/?i=19434 + [31] = https://curl.se/bug/?i=19716 [32] = https://curl.se/bug/?i=19429 [33] = https://curl.se/bug/?i=19427 [35] = https://curl.se/bug/?i=19420 @@ -283,6 +312,7 @@ References to bug reports and discussions on issues: [82] = https://curl.se/bug/?i=19460 [83] = https://curl.se/bug/?i=19647 [84] = https://curl.se/bug/?i=19645 + [85] = https://curl.se/bug/?i=19725 [86] = https://curl.se/bug/?i=19451 [87] = https://curl.se/bug/?i=19450 [88] = https://curl.se/bug/?i=19449 @@ -306,11 +336,13 @@ References to bug reports and discussions on issues: [106] = https://curl.se/bug/?i=19144 [107] = https://curl.se/bug/?i=19512 [108] = https://curl.se/bug/?i=19513 + [109] = https://curl.se/bug/?i=19727 [110] = https://curl.se/bug/?i=19510 [111] = https://curl.se/bug/?i=19509 [112] = https://curl.se/bug/?i=19495 [113] = https://curl.se/bug/?i=19653 [114] = https://curl.se/bug/?i=19605 + [116] = https://curl.se/bug/?i=19724 [117] = https://curl.se/bug/?i=19644 [118] = https://curl.se/bug/?i=19493 [119] = https://curl.se/bug/?i=19483 @@ -358,3 +390,26 @@ References to bug reports and discussions on issues: [166] = https://curl.se/bug/?i=19615 [167] = https://curl.se/bug/?i=19609 [168] = https://curl.se/bug/?i=19612 + [170] = https://curl.se/bug/?i=19333 + [171] = https://curl.se/bug/?i=19714 + [172] = https://curl.se/bug/?i=19717 + [177] = https://curl.se/bug/?i=19462 + [178] = https://curl.se/bug/?i=19703 + [179] = https://curl.se/bug/?i=19705 + [180] = https://curl.se/bug/?i=19704 + [181] = https://curl.se/bug/?i=19702 + [183] = https://curl.se/bug/?i=19701 + [189] = https://curl.se/bug/?i=19604 + [190] = https://curl.se/bug/?i=19269 + [191] = https://curl.se/bug/?i=19663 + [194] = https://curl.se/bug/?i=19681 + [195] = https://curl.se/bug/?i=19692 + [196] = https://curl.se/bug/?i=19692 + [197] = https://curl.se/bug/?i=19687 + [198] = https://curl.se/bug/?i=19689 + [199] = https://curl.se/bug/?i=19688 + [202] = https://curl.se/bug/?i=19669 + [203] = https://curl.se/bug/?i=19683 + [204] = https://curl.se/bug/?i=19643 + [208] = https://curl.se/bug/?i=19665 + [209] = https://curl.se/bug/?i=19384 From 5c22bd5384e732755fa00d2fc7fef2ce19e3418b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Nov 2025 17:42:55 +0100 Subject: [PATCH 563/885] mbedtls_threadlock: avoid calloc, use array Closes #19732 --- lib/vtls/mbedtls_threadlock.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/vtls/mbedtls_threadlock.c b/lib/vtls/mbedtls_threadlock.c index ed70308b739d..82590929cd78 100644 --- a/lib/vtls/mbedtls_threadlock.c +++ b/lib/vtls/mbedtls_threadlock.c @@ -44,17 +44,13 @@ /* number of thread locks */ #define NUMT 2 -/* This array will store all of the mutexes available to Mbedtls. */ -static MBEDTLS_MUTEX_T *mutex_buf = NULL; +/* This array stores the mutexes available to Mbedtls */ +static MBEDTLS_MUTEX_T mutex_buf[NUMT]; int Curl_mbedtlsthreadlock_thread_setup(void) { int i; - mutex_buf = calloc(1, NUMT * sizeof(MBEDTLS_MUTEX_T)); - if(!mutex_buf) - return 0; /* error, no number of threads defined */ - for(i = 0; i < NUMT; i++) { #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_init(&mutex_buf[i], NULL)) @@ -73,9 +69,6 @@ int Curl_mbedtlsthreadlock_thread_cleanup(void) { int i; - if(!mutex_buf) - return 0; /* error, no threads locks defined */ - for(i = 0; i < NUMT; i++) { #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_destroy(&mutex_buf[i])) @@ -85,8 +78,6 @@ int Curl_mbedtlsthreadlock_thread_cleanup(void) return 0; /* CloseHandle failed */ #endif /* USE_THREADS_POSIX && HAVE_PTHREAD_H */ } - free(mutex_buf); - mutex_buf = NULL; return 1; /* OK */ } From 986e6d4eae316f408f188b3079b1af62dce35850 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 18:32:35 +0100 Subject: [PATCH 564/885] CODE_STYLE.md: sync banned function list with checksrc.pl Also alpha sort the list in checksrc.pl. Closes #19733 --- docs/internals/CODE_STYLE.md | 36 +++++++++++++ scripts/checksrc.pl | 102 +++++++++++++++++------------------ 2 files changed, 87 insertions(+), 51 deletions(-) diff --git a/docs/internals/CODE_STYLE.md b/docs/internals/CODE_STYLE.md index 0d072c04c306..7d37df4805ec 100644 --- a/docs/internals/CODE_STYLE.md +++ b/docs/internals/CODE_STYLE.md @@ -334,14 +334,31 @@ This is the full list of functions generally banned. _access _mbscat _mbsncat + _open _tcscat _tcsdup _tcsncat + _tcsncpy _waccess _wcscat _wcsdup _wcsncat + _wfopen + _wfreopen + _wopen + accept + accept4 access + aprintf + atoi + atol + fclose + fdopen + fopen + fprintf + freeaddrinfo + freopen + getaddrinfo gets gmtime LoadLibrary @@ -351,9 +368,19 @@ This is the full list of functions generally banned. LoadLibraryExW LoadLibraryW localtime + mbstowcs + msnprintf + mvsnprintf + open + printf + recv + send snprintf + socket + socketpair sprintf sscanf + stat strcat strerror strncat @@ -362,6 +389,15 @@ This is the full list of functions generally banned. strtok_r strtol strtoul + vaprintf + vfprintf + vprintf vsnprintf vsprintf + wcscpy wcsdup + wcsncpy + wcstombs + WSASocket + WSASocketA + WSASocketW diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index d38ffecdb9b1..49290ff137a5 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -48,76 +48,76 @@ my @ignore_line; my %banfunc = ( - "gmtime" => 1, - "localtime" => 1, - "gets" => 1, - "strtok" => 1, - "sprintf" => 1, - "snprintf" => 1, - "vsprintf" => 1, - "vsnprintf" => 1, + "_access" => 1, + "_mbscat" => 1, + "_mbsncat" => 1, + "_open" => 1, + "_tcscat" => 1, + "_tcsdup" => 1, + "_tcsncat" => 1, + "_tcsncpy" => 1, + "_waccess" => 1, + "_wcscat" => 1, + "_wcsdup" => 1, + "_wcsncat" => 1, + "_wfopen" => 1, + "_wfreopen" => 1, + "_wopen" => 1, + "accept" => 1, + "accept4" => 1, + "access" => 1, "aprintf" => 1, + "atoi" => 1, + "atol" => 1, + "fclose" => 1, + "fdopen" => 1, + "fopen" => 1, "fprintf" => 1, + "freeaddrinfo" => 1, + "freopen" => 1, + "getaddrinfo" => 1, + "gets" => 1, + "gmtime" => 1, + "LoadLibrary" => 1, + "LoadLibraryA" => 1, + "LoadLibraryEx" => 1, + "LoadLibraryExA" => 1, + "LoadLibraryExW" => 1, + "LoadLibraryW" => 1, + "localtime" => 1, + "mbstowcs" => 1, "msnprintf" => 1, "mvsnprintf" => 1, + "open" => 1, "printf" => 1, - "vaprintf" => 1, - "vfprintf" => 1, - "vprintf" => 1, + "recv" => 1, + "send" => 1, + "snprintf" => 1, + "socket" => 1, + "socketpair" => 1, + "sprintf" => 1, "sscanf" => 1, + "stat" => 1, "strcat" => 1, "strerror" => 1, "strncat" => 1, "strncpy" => 1, "strtok_r" => 1, + "strtok" => 1, "strtol" => 1, "strtoul" => 1, - "atoi" => 1, - "atol" => 1, - "_mbscat" => 1, - "_mbsncat" => 1, - "_tcscat" => 1, - "_tcsdup" => 1, - "_tcsncpy" => 1, - "_tcsncat" => 1, - "_wcscat" => 1, - "_wcsncat" => 1, - "_wcsdup" => 1, - "wcsdup" => 1, + "vaprintf" => 1, + "vfprintf" => 1, + "vprintf" => 1, + "vsnprintf" => 1, + "vsprintf" => 1, "wcscpy" => 1, + "wcsdup" => 1, "wcsncpy" => 1, - "mbstowcs" => 1, "wcstombs" => 1, - "LoadLibrary" => 1, - "LoadLibraryA" => 1, - "LoadLibraryW" => 1, - "LoadLibraryEx" => 1, - "LoadLibraryExA" => 1, - "LoadLibraryExW" => 1, "WSASocket" => 1, "WSASocketA" => 1, "WSASocketW" => 1, - "_waccess" => 1, - "_access" => 1, - "access" => 1, - "accept" => 1, - "accept4" => 1, - "freeaddrinfo" => 1, - "getaddrinfo" => 1, - "recv" => 1, - "send" => 1, - "socket" => 1, - "socketpair" => 1, - "fclose" => 1, - "fdopen" => 1, - "fopen" => 1, - "freopen" => 1, - "open" => 1, - "_open" => 1, - "_wfopen" => 1, - "_wfreopen" => 1, - "_wopen" => 1, - "stat" => 1, ); my %warnings_extended = ( From 63eb0627b1c6cb2fa267585b4c21f839867e19d2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 20:08:43 +0100 Subject: [PATCH 565/885] curl_setup.h: drop superfluous parenthesis from `Curl_safefree` macro Cherry-picked from #19626 Closes #19734 --- lib/curl_setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 48b9ea9ea9f9..6236a7153923 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -941,7 +941,7 @@ extern curl_calloc_callback Curl_ccalloc; * This macro also assigns NULL to given pointer when free'd. */ #define Curl_safefree(ptr) \ - do { free((ptr)); (ptr) = NULL;} while(0) + do { free(ptr); (ptr) = NULL;} while(0) #include /* for CURL_EXTERN, mprintf.h */ From 6dc82c80468941a3f08646454bceccd839e46e00 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 20 Nov 2025 03:57:45 +0100 Subject: [PATCH 566/885] memdebug: replace `(fwrite)` with `fwrite` Cherry-picked from #19626 Closes #19735 --- lib/memdebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/memdebug.c b/lib/memdebug.c index 6ec292654f80..1121dc26f550 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -526,7 +526,7 @@ void curl_dbg_log(const char *format, ...) nchars = (int)sizeof(buf) - 1; if(nchars > 0) - (fwrite)(buf, 1, (size_t)nchars, curl_dbg_logfile); + fwrite(buf, 1, (size_t)nchars, curl_dbg_logfile); } #endif /* CURLDEBUG */ From 376c7bddc48974d30c9bcc82aa183fe92478d67f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 20:48:43 +0100 Subject: [PATCH 567/885] unit1653: replace local macro with `Curl_safefree()` Cherry-picked from #19626 Closes #19736 --- tests/unit/unit1653.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/unit/unit1653.c b/tests/unit/unit1653.c index 714b52a8e60f..8f6a5a51cc55 100644 --- a/tests/unit/unit1653.c +++ b/tests/unit/unit1653.c @@ -27,8 +27,6 @@ #include "curl/urlapi.h" #include "urlapi-int.h" -#define free_and_clear(x) free(x); x = NULL - static CURLUcode parse_port(CURLU *url, char *h, bool has_scheme) { struct dynbuf host; @@ -62,7 +60,7 @@ static CURLcode test_unit1653(const char *arg) fail_unless(ret == CURLUE_OK, "parse_port returned error"); ret = curl_url_get(u, CURLUPART_PORT, &portnum, CURLU_NO_DEFAULT_PORT); fail_unless(ret != CURLUE_OK, "curl_url_get portnum returned something"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Invalid IPv6 */ @@ -74,7 +72,7 @@ static CURLcode test_unit1653(const char *arg) goto fail; ret = parse_port(u, ipv6port, FALSE); fail_unless(ret != CURLUE_OK, "parse_port true on error"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); u = curl_url(); @@ -90,7 +88,7 @@ static CURLcode test_unit1653(const char *arg) fail_unless(portnum && !strcmp(portnum, "808"), "Check portnumber"); curl_free(portnum); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Valid IPv6 with zone index and port number */ @@ -106,7 +104,7 @@ static CURLcode test_unit1653(const char *arg) fail_unless(ret == CURLUE_OK, "curl_url_get portnum returned error"); fail_unless(portnum && !strcmp(portnum, "80"), "Check portnumber"); curl_free(portnum); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Valid IPv6 with zone index without port number */ @@ -118,7 +116,7 @@ static CURLcode test_unit1653(const char *arg) goto fail; ret = parse_port(u, ipv6port, FALSE); fail_unless(ret == CURLUE_OK, "parse_port returned error"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Valid IPv6 with port number */ @@ -134,7 +132,7 @@ static CURLcode test_unit1653(const char *arg) fail_unless(ret == CURLUE_OK, "curl_url_get portnum returned error"); fail_unless(portnum && !strcmp(portnum, "81"), "Check portnumber"); curl_free(portnum); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Valid IPv6 with syntax error in the port number */ @@ -146,7 +144,7 @@ static CURLcode test_unit1653(const char *arg) goto fail; ret = parse_port(u, ipv6port, FALSE); fail_unless(ret != CURLUE_OK, "parse_port true on error"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); u = curl_url(); @@ -157,7 +155,7 @@ static CURLcode test_unit1653(const char *arg) goto fail; ret = parse_port(u, ipv6port, FALSE); fail_unless(ret != CURLUE_OK, "parse_port true on error"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Valid IPv6 with no port after the colon, should use default if a scheme @@ -170,7 +168,7 @@ static CURLcode test_unit1653(const char *arg) goto fail; ret = parse_port(u, ipv6port, TRUE); fail_unless(ret == CURLUE_OK, "parse_port returned error"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Incorrect zone index syntax, but the port extractor does not care */ @@ -186,7 +184,7 @@ static CURLcode test_unit1653(const char *arg) fail_unless(ret == CURLUE_OK, "curl_url_get portnum returned error"); fail_unless(portnum && !strcmp(portnum, "180"), "Check portnumber"); curl_free(portnum); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* Non percent-encoded zone index */ @@ -198,7 +196,7 @@ static CURLcode test_unit1653(const char *arg) goto fail; ret = parse_port(u, ipv6port, FALSE); fail_unless(ret == CURLUE_OK, "parse_port returned error"); - free_and_clear(ipv6port); + Curl_safefree(ipv6port); curl_url_cleanup(u); /* No scheme and no digits following the colon - not accepted. Because that From c9e50e9e393508c6a28c695abcf62980b3c1b023 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 23:23:18 +0100 Subject: [PATCH 568/885] appveyor: add support for using custom CMake versions To allow more flexibility and not be limited by defaults offered by the runner machines: - Visual Studio 2013: CMake 3.12.2 - Visual Studio 2015, 2017: CMake 3.16.2 Ref: https://www.appveyor.com/docs/windows-images-software/ Start using 3.18.4, 3.19.8, 3.20.6 in older VS jobs to add variations. Time cost is a couple of seconds per job. Ref: #18704 (Discussion) Ref: #16973 Closes #19737 --- appveyor.sh | 17 +++++++++++++++++ appveyor.yml | 3 +++ 2 files changed, 20 insertions(+) diff --git a/appveyor.sh b/appveyor.sh index b20838da427b..56f8cc35277a 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -42,6 +42,23 @@ elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then fi if [ "${BUILD_SYSTEM}" = 'CMake' ]; then + # Install custom cmake version + if [ -n "${CMAKE_VERSION:-}" ]; then + cmake_ver=$(printf '%02d%02d' \ + "$(echo "$CMAKE_VERSION" | cut -f1 -d.)" \ + "$(echo "$CMAKE_VERSION" | cut -f2 -d.)") + if [ "${cmake_ver}" -ge '0320' ]; then + fn="cmake-${CMAKE_VERSION}-windows-x86_64" + else + fn="cmake-${CMAKE_VERSION}-win64-x64" + fi + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \ + --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.zip" --output bin.zip + 7z x -y bin.zip >/dev/null + rm -f bin.zip + PATH="$PWD/${fn}/bin:$PATH" + fi + # Set env CHKPREFILL to the value '_chkprefill' to compare feature detection # results with and without the pre-fill feature. They have to match. for _chkprefill in '' ${CHKPREFILL:-}; do diff --git a/appveyor.yml b/appveyor.yml index d10f8d39612f..91a425c7faca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -79,6 +79,7 @@ environment: SHARED: 'ON' - job_name: 'CM VS2013, Debug, x64, Schannel, Shared, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + CMAKE_VERSION: '3.18.4' PRJ_GEN: 'Visual Studio 12 2013' TARGET: '-A x64' PRJ_CFG: Debug @@ -87,6 +88,7 @@ environment: TFLAGS: 'skipall' - job_name: 'CM VS2015, Debug, x64, Schannel, Static, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + CMAKE_VERSION: '3.19.8' PRJ_GEN: 'Visual Studio 14 2015' TARGET: '-A x64' PRJ_CFG: Debug @@ -94,6 +96,7 @@ environment: TFLAGS: 'skipall' - job_name: 'CM VS2017, Debug, x64, Schannel, Shared, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + CMAKE_VERSION: '3.20.6' PRJ_GEN: 'Visual Studio 15 2017' TARGET: '-A x64' PRJ_CFG: Debug From 5c275f7fef5337c8e743febc238735298315f902 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Nov 2025 02:40:19 +0100 Subject: [PATCH 569/885] GHA/linux-old: stop installing `groff`, it is unused --- .github/workflows/linux-old.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index 64958f4bd61c..59da60987c96 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -72,7 +72,7 @@ jobs: dpkg -i freexian-archive-keyring_2022.06.08_all.deb echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list apt-get -o Dpkg::Use-Pty=0 update - apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 groff + apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 # GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on # gcc-8-base, but it does not actually seem used in our situation and is not available in # the main repo, so force the install. From e7c2f5bf53838871be4ebd7a9b2521da2a7f9226 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 01:19:06 +0000 Subject: [PATCH 570/885] GHA: update dependency google/boringssl to v0.20251124.0 Closes #19685 --- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index a9117e146ef9..77fd1edc09aa 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -45,7 +45,7 @@ env: # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com - BORINGSSL_VERSION: 0.20251110.0 + BORINGSSL_VERSION: 0.20251124.0 # renovate: datasource=github-tags depName=gnutls/nettle versioning=semver registryUrl=https://github.com NETTLE_VERSION: 3.10.2 # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver extractVersion=^nettle_?(?.+)_release_.+$ registryUrl=https://github.com diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0db8ca33b4ec..390cab72923f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -48,7 +48,7 @@ env: # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com AWSLC_VERSION: 1.63.0 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com - BORINGSSL_VERSION: 0.20251110.0 + BORINGSSL_VERSION: 0.20251124.0 # handled in renovate.json OPENSSL_VERSION: 3.6.0 # renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com From 9d059e27d1dd7d7baa863a6f7673488c965b3756 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 01:01:01 +0000 Subject: [PATCH 571/885] GHA: update dependency pyspelling to v2.12.1 Closes #19712 --- .github/scripts/requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/requirements-docs.txt b/.github/scripts/requirements-docs.txt index fa26c105d095..6850461de7bc 100644 --- a/.github/scripts/requirements-docs.txt +++ b/.github/scripts/requirements-docs.txt @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: curl -pyspelling==2.12 +pyspelling==2.12.1 From 48939a4575d5db6e875add0ccae93242f56fe581 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Nov 2025 01:23:57 +0100 Subject: [PATCH 572/885] GHA/linux-old: add support for using custom CMake versions Install CMake from the Kitware GitHub release archive. To allow choosing its version independently from the OS. Switch to 3.7.0 (from 3.7.2) to test the earliest supported version. Also tested OK with 3.18.4 and 3.7.2. The download and install step takes 1-2 seconds. Follow-up to c9e50e9e393508c6a28c695abcf62980b3c1b023 #19737 Closes #19738 --- .github/workflows/linux-old.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index 59da60987c96..e282b1c47196 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -60,6 +60,8 @@ jobs: runs-on: 'ubuntu-latest' container: 'debian:stretch' + env: + CMAKE_VERSION: '3.7.0' # Earliest version supported by curl steps: - name: 'install prereqs' # Remember, this shell is dash, not bash @@ -72,7 +74,7 @@ jobs: dpkg -i freexian-archive-keyring_2022.06.08_all.deb echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list apt-get -o Dpkg::Use-Pty=0 update - apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 + apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 # GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on # gcc-8-base, but it does not actually seem used in our situation and is not available in # the main repo, so force the install. @@ -80,6 +82,15 @@ jobs: httrack --get https://deb.freexian.com/extended-lts/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb + - name: 'install prereqs (cmake)' + run: | + cd ~ + fn="cmake-${CMAKE_VERSION}-linux-x86_64" + httrack --get "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.tar.gz" + tar -xf "${fn}".tar*.gz + rm -f "${fn}".tar*.gz + mv "cmake-${CMAKE_VERSION}-Linux-x86_64" cmake + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -88,7 +99,7 @@ jobs: run: | mkdir bld-1 cd bld-1 - cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ + "$HOME"/cmake/bin/cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON - name: 'CM build-only build' @@ -112,7 +123,7 @@ jobs: run: | mkdir bld-cares cd bld-cares - cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ + "$HOME"/cmake/bin/cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \ -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON From bfc3d131b6b5be7b7219dc016ff600f58e279c6c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 28 Nov 2025 09:43:27 +0100 Subject: [PATCH 573/885] http: add asserts for null terminator for input strings http_rw_hd() assumes the null terminator is present. These asserts make sure this remains true. Closes #19741 --- lib/http.c | 2 ++ lib/transfer.c | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/http.c b/lib/http.c index 672183db0ef2..8223c6f0e213 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4142,6 +4142,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data, CURLcode result = CURLE_OK; struct SingleRequest *k = &data->req; int writetype; + DEBUGASSERT(!hd[hdlen]); /* null terminated */ *pconsumed = 0; if((0x0a == *hd) || (0x0d == *hd)) { @@ -4426,6 +4427,7 @@ CURLcode Curl_http_write_resp_hd(struct Curl_easy *data, CURLcode result; size_t consumed; char tmp = 0; + DEBUGASSERT(!hd[hdlen]); /* null terminated */ result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed); if(!result && is_eos) { diff --git a/lib/transfer.c b/lib/transfer.c index f2df2cef8cba..f0ce3c501271 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -820,6 +820,7 @@ CURLcode Curl_xfer_write_resp_hd(struct Curl_easy *data, const char *hd0, size_t hdlen, bool is_eos) { if(data->conn->handler->write_resp_hd) { + DEBUGASSERT(!hd0[hdlen]); /* null terminated */ /* protocol handlers offering this function take full responsibility * for writing all received download data to the client. */ return data->conn->handler->write_resp_hd(data, hd0, hdlen, is_eos); From 193cb00ce9b47e75d42157c650cc3de3fd96d35d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 8 Oct 2025 02:33:19 +0200 Subject: [PATCH 574/885] build: stop overriding standard memory allocation functions Before this patch curl used the C preprocessor to override standard memory allocation symbols: malloc, calloc, strdup, realloc, free. The goal of these is to replace them with curl's debug wrappers in `CURLDEBUG` builds, another was to replace them with the wrappers calling user-defined allocators in libcurl. This solution needed a bunch of workarounds to avoid breaking external headers: it relied on include order to do the overriding last. For "unity" builds it needed to reset overrides before external includes. Also in test apps, which are always built as single source files. It also needed the `(symbol)` trick to avoid overrides in some places. This would still not fix cases where the standard symbols were macros. It was also fragile and difficult to figure out which was the actual function behind an alloc or free call in a specific piece of code. This in turn caused bugs where the wrong allocator was accidentally called. To avoid these problems, this patch replaces this solution with `curlx_`-prefixed allocator macros, and mapping them _once_ to either the libcurl wrappers, the debug wrappers or the standard ones, matching the rest of the code in libtests. This concludes the long journey to avoid redefining standard functions in the curl codebase. Note: I did not update `packages/OS400/*.c` sources. They did not `#include` `curl_setup.h`, `curl_memory.h` or `memdebug.h`, meaning the overrides were never applied to them. This may or may not have been correct. For now I suppressed the direct use of standard allocators via a local `.checksrc`. Probably they (except for `curlcl.c`) should be updated to include `curl_setup.h` and use the `curlx_` macros. This patch changes mappings in two places: - `lib/curl_threads.c` in libtests: Before this patch it mapped to libcurl allocators. After, it maps to standard allocators, like the rest of libtests code. - `units`: before this patch it mapped to standard allocators. After, it maps to libcurl allocators. Also: - drop all position-dependent `curl_memory.h` and `memdebug.h` includes, and delete the now unnecessary headers. - rename `Curl_tcsdup` macro to `curlx_tcsdup` and define like the other allocators. - map `curlx_strdup()` to `_strdup()` on Windows (was: `strdup()`). To fix warnings silenced via `_CRT_NONSTDC_NO_DEPRECATE`. - multibyte: map `curlx_convert_*()` to `_strdup()` on Windows (was: `strdup()`). - src: do not reuse the `strdup` name for the local replacement. - lib509: call `_strdup()` on Windows (was: `strdup()`). - test1132: delete test obsoleted by this patch. - CHECKSRC.md: update text for `SNPRINTF`. - checksrc: ban standard allocator symbols. Follow-up to b12da22db1f11da51082977dc21a7edee7858911 #18866 Follow-up to db98daab05aec251bcb6615d2d38dfebec291736 #18844 Follow-up to 4deea9396bc7dd25c6362fa746a57bf309c74ada #18814 Follow-up to 9678ff5b1bfea1c847aee4f9edf023e8f01c9293 #18776 Follow-up to 10bac43b873fe45869e15b36aac1c1e5bc89b6e0 #18774 Follow-up to 20142f5d06f7120ba94cbcc25c998e8d81aec85b #18634 Follow-up to bf7375ecc50e857760b0d0a668c436e208a400bd #18503 Follow-up to 9863599d69b79d290928a89bf9160f4e4e023d4e #18502 Follow-up to 3bb5e58c105d7be450b667858d1b8e7ae3ded555 #17827 Closes #19626 --- docs/examples/.checksrc | 5 + docs/internals/CHECKSRC.md | 2 +- docs/internals/CODE_STYLE.md | 5 + lib/Makefile.inc | 3 - lib/altsvc.c | 24 ++-- lib/amigaos.c | 8 +- lib/asyn-ares.c | 8 +- lib/asyn-base.c | 3 - lib/asyn-thrdd.c | 20 ++-- lib/bufq.c | 14 +-- lib/bufref.c | 3 - lib/cf-h1-proxy.c | 12 +- lib/cf-h2-proxy.c | 10 +- lib/cf-haproxy.c | 8 +- lib/cf-https-connect.c | 8 +- lib/cf-ip-happy.c | 12 +- lib/cf-socket.c | 16 +-- lib/cfilters.c | 8 +- lib/conncache.c | 8 +- lib/connect.c | 8 +- lib/content_encoding.c | 10 +- lib/cookie.c | 54 +++++---- lib/cshutdn.c | 4 - lib/curl_addrinfo.c | 17 ++- lib/curl_fnmatch.c | 4 - lib/curl_fopen.c | 8 +- lib/curl_get_line.c | 3 - lib/curl_gssapi.c | 24 ++-- lib/curl_mem_undef.h | 37 ------- lib/curl_memory.h | 89 --------------- lib/curl_memrchr.c | 4 - lib/curl_ntlm_core.c | 16 +-- lib/curl_rtmp.c | 4 - lib/curl_sasl.c | 4 - lib/curl_setup.h | 54 ++++++++- lib/curl_share.c | 10 +- lib/curl_sspi.c | 10 +- lib/curl_threads.c | 17 ++- lib/curl_trc.c | 4 - lib/curlx/base64.c | 12 +- lib/curlx/dynbuf.c | 8 +- lib/curlx/fopen.c | 59 ++++++---- lib/curlx/multibyte.c | 19 ++-- lib/curlx/multibyte.h | 18 +-- lib/curlx/strerr.c | 3 - lib/curlx/version_win32.c | 4 - lib/cw-out.c | 8 +- lib/cw-pause.c | 8 +- lib/dict.c | 11 +- lib/dllmain.c | 4 - lib/doh.c | 18 ++- lib/dynhds.c | 14 +-- lib/easy.c | 24 ++-- lib/escape.c | 10 +- lib/fake_addrinfo.c | 8 +- lib/file.c | 10 +- lib/fileinfo.c | 7 +- lib/formdata.c | 44 ++++---- lib/ftp.c | 68 ++++++------ lib/ftplistparser.c | 14 +-- lib/getenv.c | 11 +- lib/getinfo.c | 10 +- lib/gopher.c | 12 +- lib/hash.c | 10 +- lib/headers.c | 10 +- lib/hmac.c | 10 +- lib/hostip.c | 22 ++-- lib/hostip4.c | 14 +-- lib/hostip6.c | 4 - lib/hsts.c | 24 ++-- lib/http.c | 106 +++++++++--------- lib/http1.c | 4 - lib/http2.c | 30 +++-- lib/http_aws_sigv4.c | 30 +++-- lib/http_chunks.c | 4 - lib/http_digest.c | 10 +- lib/http_negotiate.c | 10 +- lib/http_ntlm.c | 12 +- lib/http_proxy.c | 12 +- lib/httpsrr.c | 14 +-- lib/idn.c | 18 ++- lib/if2ip.c | 4 - lib/imap.c | 42 ++++--- lib/ldap.c | 38 +++---- lib/llist.c | 4 - lib/md4.c | 4 - lib/md5.c | 18 ++- lib/memdebug.c | 4 - lib/memdebug.h | 56 ---------- lib/mime.c | 34 +++--- lib/mprintf.c | 6 +- lib/mqtt.c | 28 ++--- lib/multi.c | 34 +++--- lib/multi_ev.c | 10 +- lib/multi_ntfy.c | 9 +- lib/netrc.c | 28 ++--- lib/openldap.c | 16 +-- lib/pingpong.c | 4 - lib/pop3.c | 12 +- lib/psl.c | 4 - lib/rand.c | 4 - lib/rename.c | 4 - lib/request.c | 4 - lib/rtsp.c | 20 ++-- lib/select.c | 30 +++-- lib/sendf.c | 20 ++-- lib/setopt.c | 26 ++--- lib/sha256.c | 4 - lib/slist.c | 12 +- lib/smb.c | 25 ++--- lib/smtp.c | 32 +++--- lib/socketpair.c | 4 - lib/socks.c | 8 +- lib/socks_gssapi.c | 12 +- lib/socks_sspi.c | 32 +++--- lib/strdup.c | 16 +-- lib/strerror.c | 4 - lib/system_win32.c | 9 +- lib/telnet.c | 8 +- lib/tftp.c | 16 +-- lib/transfer.c | 14 +-- lib/uint-bset.c | 10 +- lib/uint-hash.c | 10 +- lib/uint-spbset.c | 8 +- lib/uint-table.c | 10 +- lib/url.c | 146 ++++++++++++------------- lib/urlapi.c | 86 +++++++-------- lib/vauth/cleartext.c | 4 - lib/vauth/cram.c | 4 - lib/vauth/digest.c | 74 ++++++------- lib/vauth/digest_sspi.c | 52 ++++----- lib/vauth/gsasl.c | 4 - lib/vauth/krb5_gssapi.c | 14 +-- lib/vauth/krb5_sspi.c | 28 ++--- lib/vauth/ntlm.c | 8 +- lib/vauth/ntlm_sspi.c | 14 +-- lib/vauth/oauth2.c | 4 - lib/vauth/spnego_gssapi.c | 8 +- lib/vauth/spnego_sspi.c | 18 ++- lib/vauth/vauth.c | 24 ++-- lib/vquic/curl_ngtcp2.c | 16 +-- lib/vquic/curl_osslq.c | 29 +++-- lib/vquic/curl_quiche.c | 16 +-- lib/vquic/vquic-tls.c | 4 - lib/vquic/vquic.c | 6 +- lib/vssh/libssh.c | 28 +++-- lib/vssh/libssh2.c | 48 ++++---- lib/vssh/vssh.c | 12 +- lib/vtls/apple.c | 10 +- lib/vtls/gtls.c | 25 ++--- lib/vtls/hostcheck.c | 4 - lib/vtls/keylog.c | 4 - lib/vtls/mbedtls.c | 28 ++--- lib/vtls/mbedtls_threadlock.c | 4 - lib/vtls/openssl.c | 36 +++--- lib/vtls/rustls.c | 10 +- lib/vtls/schannel.c | 63 +++++------ lib/vtls/schannel_verify.c | 8 +- lib/vtls/vtls.c | 38 +++---- lib/vtls/vtls_scache.c | 45 ++++---- lib/vtls/vtls_spack.c | 6 +- lib/vtls/wolfssl.c | 24 ++-- lib/vtls/x509asn1.c | 6 +- lib/ws.c | 12 +- packages/Makefile.am | 1 + packages/OS400/.checksrc | 9 ++ scripts/checksrc.pl | 5 + src/mkhelp.pl | 15 ++- src/slist_wc.c | 7 +- src/terminal.c | 1 - src/tool_bname.c | 2 - src/tool_cb_dbg.c | 2 - src/tool_cb_hdr.c | 10 +- src/tool_cb_prg.c | 2 - src/tool_cb_rea.c | 2 - src/tool_cb_see.c | 2 - src/tool_cb_wrt.c | 6 +- src/tool_cfgable.c | 11 +- src/tool_cfgable.h | 2 +- src/tool_dirhie.c | 2 - src/tool_doswin.c | 29 +++-- src/tool_easysrc.c | 2 - src/tool_findfile.c | 4 +- src/tool_formparse.c | 20 ++-- src/tool_getparam.c | 42 ++++--- src/tool_getpass.c | 2 - src/tool_help.c | 6 +- src/tool_helpers.c | 1 - src/tool_ipfs.c | 11 +- src/tool_libinfo.c | 1 - src/tool_libinfo.h | 1 - src/tool_main.c | 9 +- src/tool_msgs.c | 2 - src/tool_operate.c | 46 ++++---- src/tool_operhlp.c | 9 +- src/tool_paramhlp.c | 12 +- src/tool_parsecfg.c | 7 +- src/tool_setopt.c | 17 ++- src/tool_setup.h | 2 + src/tool_ssls.c | 8 +- src/tool_ssls.h | 1 - src/tool_stderr.c | 2 - src/tool_strdup.c | 7 +- src/tool_strdup.h | 2 +- src/tool_urlglob.c | 20 ++-- src/tool_util.c | 1 - src/tool_vms.c | 1 - src/tool_writeout.c | 1 - src/tool_xattr.c | 2 - src/var.c | 15 ++- tests/Makefile.am | 1 - tests/data/Makefile.am | 2 +- tests/data/test1132 | 21 ---- tests/libtest/cli_h2_pausing.c | 1 - tests/libtest/cli_h2_serverpush.c | 1 - tests/libtest/cli_h2_upgrade_extreme.c | 1 - tests/libtest/cli_hx_download.c | 14 +-- tests/libtest/cli_hx_upload.c | 5 +- tests/libtest/cli_tls_session_reuse.c | 1 - tests/libtest/cli_upload_pausing.c | 1 - tests/libtest/cli_ws_data.c | 17 ++- tests/libtest/cli_ws_pingpong.c | 1 - tests/libtest/first.c | 2 - tests/libtest/lib1156.c | 2 - tests/libtest/lib1485.c | 2 - tests/libtest/lib1500.c | 2 - tests/libtest/lib1501.c | 2 - tests/libtest/lib1502.c | 2 - tests/libtest/lib1506.c | 2 - tests/libtest/lib1507.c | 2 - tests/libtest/lib1508.c | 2 - tests/libtest/lib1509.c | 2 - tests/libtest/lib1510.c | 2 - tests/libtest/lib1511.c | 2 - tests/libtest/lib1512.c | 2 - tests/libtest/lib1513.c | 2 - tests/libtest/lib1514.c | 2 - tests/libtest/lib1515.c | 1 - tests/libtest/lib1517.c | 2 - tests/libtest/lib1518.c | 2 - tests/libtest/lib1520.c | 2 - tests/libtest/lib1522.c | 1 - tests/libtest/lib1523.c | 2 - tests/libtest/lib1525.c | 2 - tests/libtest/lib1526.c | 2 - tests/libtest/lib1527.c | 2 - tests/libtest/lib1528.c | 2 - tests/libtest/lib1529.c | 2 - tests/libtest/lib1530.c | 2 - tests/libtest/lib1531.c | 2 - tests/libtest/lib1532.c | 2 - tests/libtest/lib1533.c | 2 - tests/libtest/lib1534.c | 2 - tests/libtest/lib1535.c | 2 - tests/libtest/lib1536.c | 2 - tests/libtest/lib1537.c | 2 - tests/libtest/lib1538.c | 2 - tests/libtest/lib1540.c | 1 - tests/libtest/lib1541.c | 2 - tests/libtest/lib1542.c | 1 - tests/libtest/lib1549.c | 1 - tests/libtest/lib1550.c | 2 - tests/libtest/lib1551.c | 2 - tests/libtest/lib1552.c | 2 - tests/libtest/lib1553.c | 1 - tests/libtest/lib1554.c | 2 - tests/libtest/lib1555.c | 2 - tests/libtest/lib1556.c | 2 - tests/libtest/lib1557.c | 2 - tests/libtest/lib1558.c | 2 - tests/libtest/lib1559.c | 6 +- tests/libtest/lib1560.c | 2 - tests/libtest/lib1564.c | 2 - tests/libtest/lib1565.c | 2 - tests/libtest/lib1567.c | 2 - tests/libtest/lib1568.c | 2 - tests/libtest/lib1569.c | 2 - tests/libtest/lib1571.c | 2 - tests/libtest/lib1576.c | 2 - tests/libtest/lib1582.c | 2 - tests/libtest/lib1591.c | 2 - tests/libtest/lib1593.c | 2 - tests/libtest/lib1594.c | 2 - tests/libtest/lib1597.c | 2 - tests/libtest/lib1598.c | 2 - tests/libtest/lib1900.c | 2 - tests/libtest/lib1901.c | 2 - tests/libtest/lib1902.c | 2 - tests/libtest/lib1903.c | 2 - tests/libtest/lib1905.c | 2 - tests/libtest/lib1906.c | 2 - tests/libtest/lib1907.c | 2 - tests/libtest/lib1908.c | 2 - tests/libtest/lib1910.c | 2 - tests/libtest/lib1911.c | 2 - tests/libtest/lib1912.c | 2 - tests/libtest/lib1913.c | 2 - tests/libtest/lib1915.c | 1 - tests/libtest/lib1916.c | 2 - tests/libtest/lib1918.c | 2 - tests/libtest/lib1919.c | 2 - tests/libtest/lib1933.c | 2 - tests/libtest/lib1934.c | 2 - tests/libtest/lib1935.c | 2 - tests/libtest/lib1936.c | 2 - tests/libtest/lib1937.c | 2 - tests/libtest/lib1938.c | 2 - tests/libtest/lib1939.c | 2 - tests/libtest/lib1940.c | 2 - tests/libtest/lib1945.c | 2 - tests/libtest/lib1947.c | 2 - tests/libtest/lib1955.c | 2 - tests/libtest/lib1956.c | 2 - tests/libtest/lib1957.c | 2 - tests/libtest/lib1958.c | 2 - tests/libtest/lib1959.c | 2 - tests/libtest/lib1960.c | 2 - tests/libtest/lib1964.c | 2 - tests/libtest/lib1970.c | 2 - tests/libtest/lib1971.c | 2 - tests/libtest/lib1972.c | 2 - tests/libtest/lib1973.c | 2 - tests/libtest/lib1974.c | 2 - tests/libtest/lib1975.c | 2 - tests/libtest/lib1977.c | 2 - tests/libtest/lib1978.c | 2 - tests/libtest/lib2023.c | 6 +- tests/libtest/lib2032.c | 8 +- tests/libtest/lib2302.c | 4 +- tests/libtest/lib2402.c | 2 - tests/libtest/lib2404.c | 2 - tests/libtest/lib2405.c | 2 - tests/libtest/lib2502.c | 1 - tests/libtest/lib2700.c | 1 - tests/libtest/lib3010.c | 2 - tests/libtest/lib3025.c | 2 - tests/libtest/lib3027.c | 2 - tests/libtest/lib3033.c | 2 - tests/libtest/lib3100.c | 2 - tests/libtest/lib3101.c | 2 - tests/libtest/lib3102.c | 2 - tests/libtest/lib3103.c | 2 - tests/libtest/lib3104.c | 2 - tests/libtest/lib3105.c | 2 - tests/libtest/lib3207.c | 6 +- tests/libtest/lib3208.c | 2 - tests/libtest/lib500.c | 1 - tests/libtest/lib501.c | 2 - tests/libtest/lib502.c | 2 - tests/libtest/lib503.c | 2 - tests/libtest/lib504.c | 2 - tests/libtest/lib505.c | 2 - tests/libtest/lib506.c | 1 - tests/libtest/lib507.c | 2 - tests/libtest/lib508.c | 2 - tests/libtest/lib509.c | 29 +++-- tests/libtest/lib510.c | 2 - tests/libtest/lib511.c | 2 - tests/libtest/lib512.c | 2 - tests/libtest/lib513.c | 2 - tests/libtest/lib514.c | 2 - tests/libtest/lib515.c | 2 - tests/libtest/lib516.c | 2 - tests/libtest/lib517.c | 2 - tests/libtest/lib518.c | 35 +++--- tests/libtest/lib519.c | 2 - tests/libtest/lib520.c | 2 - tests/libtest/lib521.c | 2 - tests/libtest/lib523.c | 2 - tests/libtest/lib524.c | 2 - tests/libtest/lib525.c | 2 - tests/libtest/lib526.c | 2 - tests/libtest/lib530.c | 14 +-- tests/libtest/lib533.c | 2 - tests/libtest/lib536.c | 2 - tests/libtest/lib537.c | 36 +++--- tests/libtest/lib539.c | 2 - tests/libtest/lib540.c | 2 - tests/libtest/lib541.c | 2 - tests/libtest/lib542.c | 2 - tests/libtest/lib543.c | 2 - tests/libtest/lib544.c | 2 - tests/libtest/lib547.c | 2 - tests/libtest/lib549.c | 2 - tests/libtest/lib552.c | 1 - tests/libtest/lib553.c | 2 - tests/libtest/lib554.c | 2 - tests/libtest/lib555.c | 2 - tests/libtest/lib556.c | 2 - tests/libtest/lib557.c | 2 - tests/libtest/lib558.c | 4 +- tests/libtest/lib559.c | 2 - tests/libtest/lib560.c | 2 - tests/libtest/lib562.c | 2 - tests/libtest/lib564.c | 1 - tests/libtest/lib566.c | 2 - tests/libtest/lib567.c | 2 - tests/libtest/lib568.c | 1 - tests/libtest/lib569.c | 1 - tests/libtest/lib570.c | 1 - tests/libtest/lib571.c | 1 - tests/libtest/lib572.c | 1 - tests/libtest/lib573.c | 1 - tests/libtest/lib574.c | 2 - tests/libtest/lib575.c | 2 - tests/libtest/lib576.c | 2 - tests/libtest/lib578.c | 2 - tests/libtest/lib579.c | 2 - tests/libtest/lib582.c | 8 +- tests/libtest/lib583.c | 2 - tests/libtest/lib586.c | 2 - tests/libtest/lib589.c | 2 - tests/libtest/lib590.c | 2 - tests/libtest/lib591.c | 2 - tests/libtest/lib597.c | 2 - tests/libtest/lib598.c | 2 - tests/libtest/lib599.c | 2 - tests/libtest/lib643.c | 2 - tests/libtest/lib650.c | 2 - tests/libtest/lib651.c | 2 - tests/libtest/lib652.c | 2 - tests/libtest/lib653.c | 2 - tests/libtest/lib654.c | 2 - tests/libtest/lib655.c | 2 - tests/libtest/lib658.c | 2 - tests/libtest/lib659.c | 2 - tests/libtest/lib661.c | 2 - tests/libtest/lib666.c | 2 - tests/libtest/lib667.c | 2 - tests/libtest/lib668.c | 2 - tests/libtest/lib670.c | 2 - tests/libtest/lib674.c | 2 - tests/libtest/lib676.c | 2 - tests/libtest/lib677.c | 2 - tests/libtest/lib678.c | 8 +- tests/libtest/lib694.c | 2 - tests/libtest/lib695.c | 2 - tests/libtest/lib751.c | 2 - tests/libtest/lib753.c | 1 - tests/libtest/lib757.c | 2 - tests/libtest/lib758.c | 12 +- tests/libtest/lib766.c | 2 - tests/libtest/memptr.c | 2 - tests/libtest/mk-lib1521.pl | 1 - tests/libtest/testtrace.c | 2 - tests/libtest/testutil.c | 2 - tests/server/.checksrc | 5 + tests/test1132.pl | 98 ----------------- tests/tunit/tool1394.c | 6 +- tests/tunit/tool1604.c | 16 ++- tests/tunit/tool1621.c | 2 - tests/unit/unit1302.c | 1 - tests/unit/unit1303.c | 1 - tests/unit/unit1304.c | 13 +-- tests/unit/unit1305.c | 13 +-- tests/unit/unit1330.c | 4 +- tests/unit/unit1395.c | 3 +- tests/unit/unit1602.c | 12 +- tests/unit/unit1603.c | 2 - tests/unit/unit1607.c | 4 +- tests/unit/unit1609.c | 4 +- tests/unit/unit1616.c | 12 +- tests/unit/unit1620.c | 8 +- tests/unit/unit1653.c | 28 ++--- tests/unit/unit1661.c | 5 +- tests/unit/unit1663.c | 8 +- tests/unit/unit1664.c | 2 - tests/unit/unit2600.c | 9 +- tests/unit/unit2604.c | 5 +- tests/unit/unit2605.c | 1 - tests/unit/unit3200.c | 1 - 471 files changed, 1456 insertions(+), 2785 deletions(-) delete mode 100644 lib/curl_mem_undef.h delete mode 100644 lib/curl_memory.h delete mode 100644 lib/memdebug.h create mode 100644 packages/OS400/.checksrc delete mode 100644 tests/data/test1132 delete mode 100755 tests/test1132.pl diff --git a/docs/examples/.checksrc b/docs/examples/.checksrc index c47627467ff3..8c7b0c901e80 100644 --- a/docs/examples/.checksrc +++ b/docs/examples/.checksrc @@ -4,17 +4,22 @@ allowfunc atoi allowfunc atol +allowfunc calloc allowfunc fclose allowfunc fdopen allowfunc fopen allowfunc fprintf +allowfunc free allowfunc gmtime allowfunc localtime +allowfunc malloc allowfunc open allowfunc printf +allowfunc realloc allowfunc snprintf allowfunc socket allowfunc sscanf +allowfunc strdup allowfunc strerror allowfunc vsnprintf diff --git a/docs/internals/CHECKSRC.md b/docs/internals/CHECKSRC.md index 1740b2bef591..091a4d3107e6 100644 --- a/docs/internals/CHECKSRC.md +++ b/docs/internals/CHECKSRC.md @@ -107,7 +107,7 @@ warnings are: `sizeof(int)` style. - `SNPRINTF` - Found use of `snprintf()`. Since we use an internal replacement - with a different return code etc, we prefer `msnprintf()`. + with a different return code etc, we prefer `curl_msnprintf()`. - `SPACEAFTERPAREN`: there was a space after open parenthesis, `( text`. diff --git a/docs/internals/CODE_STYLE.md b/docs/internals/CODE_STYLE.md index 7d37df4805ec..43b873be9b37 100644 --- a/docs/internals/CODE_STYLE.md +++ b/docs/internals/CODE_STYLE.md @@ -352,10 +352,12 @@ This is the full list of functions generally banned. aprintf atoi atol + calloc fclose fdopen fopen fprintf + free freeaddrinfo freopen getaddrinfo @@ -368,11 +370,13 @@ This is the full list of functions generally banned. LoadLibraryExW LoadLibraryW localtime + malloc mbstowcs msnprintf mvsnprintf open printf + realloc recv send snprintf @@ -382,6 +386,7 @@ This is the full list of functions generally banned. sscanf stat strcat + strdup strerror strncat strncpy diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 85faa875e072..cdd5587ec80b 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -300,8 +300,6 @@ LIB_HFILES = \ curl_ldap.h \ curl_md4.h \ curl_md5.h \ - curl_mem_undef.h \ - curl_memory.h \ curl_memrchr.h \ curl_ntlm_core.h \ curl_printf.h \ @@ -353,7 +351,6 @@ LIB_HFILES = \ imap.h \ llist.h \ macos.h \ - memdebug.h \ mime.h \ mqtt.h \ multihandle.h \ diff --git a/lib/altsvc.c b/lib/altsvc.c index c05dff04e2c1..84f6c1b44547 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -42,10 +42,6 @@ #include "curlx/strparse.h" #include "connect.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define MAX_ALTSVC_LINE 4095 #define MAX_ALTSVC_DATELEN 256 #define MAX_ALTSVC_HOSTLEN 2048 @@ -71,9 +67,9 @@ const char *Curl_alpnid2str(enum alpnid id) static void altsvc_free(struct altsvc *as) { - free(as->src.host); - free(as->dst.host); - free(as); + curlx_free(as->src.host); + curlx_free(as->dst.host); + curlx_free(as); } static struct altsvc *altsvc_createid(const char *srchost, @@ -85,7 +81,7 @@ static struct altsvc *altsvc_createid(const char *srchost, size_t srcport, size_t dstport) { - struct altsvc *as = calloc(1, sizeof(struct altsvc)); + struct altsvc *as = curlx_calloc(1, sizeof(struct altsvc)); if(!as) return NULL; DEBUGASSERT(hlen); @@ -219,8 +215,8 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file) /* we need a private copy of the filename so that the altsvc cache file name survives an easy handle reset */ - free(asi->filename); - asi->filename = strdup(file); + curlx_free(asi->filename); + asi->filename = curlx_strdup(file); if(!asi->filename) return CURLE_OUT_OF_MEMORY; @@ -299,7 +295,7 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp) */ struct altsvcinfo *Curl_altsvc_init(void) { - struct altsvcinfo *asi = calloc(1, sizeof(struct altsvcinfo)); + struct altsvcinfo *asi = curlx_calloc(1, sizeof(struct altsvcinfo)); if(!asi) return NULL; Curl_llist_init(&asi->list, NULL); @@ -350,8 +346,8 @@ void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) n = Curl_node_next(e); altsvc_free(as); } - free(altsvc->filename); - free(altsvc); + curlx_free(altsvc->filename); + curlx_free(altsvc); *altsvcp = NULL; /* clear the pointer */ } } @@ -399,7 +395,7 @@ CURLcode Curl_altsvc_save(struct Curl_easy *data, if(result && tempstore) unlink(tempstore); } - free(tempstore); + curlx_free(tempstore); return result; } diff --git a/lib/amigaos.c b/lib/amigaos.c index e51236d1260a..e4b678d54185 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -42,10 +42,6 @@ # endif #endif -/* The last #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef HAVE_PROTO_BSDSOCKET_H #ifdef __amigaos4__ @@ -135,7 +131,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, LONG h_errnop = 0; struct hostent *buf; - buf = calloc(1, CURL_HOSTENT_SIZE); + buf = curlx_calloc(1, CURL_HOSTENT_SIZE); if(buf) { h = gethostbyname_r((STRPTR)hostname, buf, (char *)buf + sizeof(struct hostent), @@ -144,7 +140,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, if(h) { ai = Curl_he2ai(h, port); } - free(buf); + curlx_free(buf); } } else { diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 1bc0f3247b78..e3ba512b77ff 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -104,10 +104,6 @@ #define HTTPSRR_WORKS #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define CARES_TIMEOUT_PER_ATTEMPT 2000 static int ares_ver = 0; @@ -633,7 +629,7 @@ async_ares_node2addr(struct ares_addrinfo_node *node) if((size_t)ai->ai_addrlen < ss_size) continue; - ca = malloc(sizeof(struct Curl_addrinfo) + ss_size); + ca = curlx_malloc(sizeof(struct Curl_addrinfo) + ss_size); if(!ca) { error = EAI_MEMORY; break; @@ -736,7 +732,7 @@ CURLcode Curl_async_getaddrinfo(struct Curl_easy *data, const char *hostname, data->state.async.dns = NULL; /* clear */ data->state.async.port = port; data->state.async.ip_version = ip_version; - data->state.async.hostname = strdup(hostname); + data->state.async.hostname = curlx_strdup(hostname); if(!data->state.async.hostname) return CURLE_OUT_OF_MEMORY; #ifdef USE_HTTPSRR diff --git a/lib/asyn-base.c b/lib/asyn-base.c index d7e8e7d15b86..6338a3fc6e25 100644 --- a/lib/asyn-base.c +++ b/lib/asyn-base.c @@ -53,9 +53,6 @@ #include "select.h" #include "curl_share.h" #include "url.h" -#include "curl_memory.h" -/* The last #include file should be: */ -#include "memdebug.h" /*********************************************************************** * Only for builds using asynchronous name resolves diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index 71e31e6d0d16..6c2e02fd1871 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -72,10 +72,6 @@ #endif #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Curl_async_global_init() @@ -136,7 +132,7 @@ static void addr_ctx_unlink(struct async_thrdd_addr_ctx **paddr_ctx, if(destroy) { Curl_mutex_destroy(&addr_ctx->mutx); - free(addr_ctx->hostname); + curlx_free(addr_ctx->hostname); if(addr_ctx->res) Curl_freeaddrinfo(addr_ctx->res); #ifndef CURL_DISABLE_SOCKETPAIR @@ -145,7 +141,7 @@ static void addr_ctx_unlink(struct async_thrdd_addr_ctx **paddr_ctx, #endif wakeup_close(addr_ctx->sock_pair[0]); #endif - free(addr_ctx); + curlx_free(addr_ctx); } *paddr_ctx = NULL; } @@ -156,7 +152,7 @@ addr_ctx_create(struct Curl_easy *data, const char *hostname, int port, const struct addrinfo *hints) { - struct async_thrdd_addr_ctx *addr_ctx = calloc(1, sizeof(*addr_ctx)); + struct async_thrdd_addr_ctx *addr_ctx = curlx_calloc(1, sizeof(*addr_ctx)); if(!addr_ctx) return NULL; @@ -186,7 +182,7 @@ addr_ctx_create(struct Curl_easy *data, /* Copying hostname string because original can be destroyed by parent * thread during gethostbyname execution. */ - addr_ctx->hostname = strdup(hostname); + addr_ctx->hostname = curlx_strdup(hostname); if(!addr_ctx->hostname) goto err_exit; @@ -376,7 +372,7 @@ static CURLcode async_rr_start(struct Curl_easy *data, int port) status = ares_init_options(&thrdd->rr.channel, NULL, 0); if(status != ARES_SUCCESS) { thrdd->rr.channel = NULL; - free(rrname); + curlx_free(rrname); return CURLE_FAILED_INIT; } #ifdef CURLDEBUG @@ -384,7 +380,7 @@ static CURLcode async_rr_start(struct Curl_easy *data, int port) const char *servers = getenv("CURL_DNS_SERVER"); status = ares_set_servers_ports_csv(thrdd->rr.channel, servers); if(status) { - free(rrname); + curlx_free(rrname); return CURLE_FAILED_INIT; } } @@ -435,8 +431,8 @@ static bool async_thrdd_init(struct Curl_easy *data, data->state.async.done = FALSE; data->state.async.port = port; data->state.async.ip_version = ip_version; - free(data->state.async.hostname); - data->state.async.hostname = strdup(hostname); + curlx_free(data->state.async.hostname); + data->state.async.hostname = curlx_strdup(hostname); if(!data->state.async.hostname) goto err_exit; diff --git a/lib/bufq.c b/lib/bufq.c index d38b78c6d5b2..5a77fc52d4b3 100644 --- a/lib/bufq.c +++ b/lib/bufq.c @@ -25,10 +25,6 @@ #include "curl_setup.h" #include "bufq.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static bool chunk_is_empty(const struct buf_chunk *chunk) { return chunk->r_offset >= chunk->w_offset; @@ -143,7 +139,7 @@ static void chunk_list_free(struct buf_chunk **anchor) while(*anchor) { chunk = *anchor; *anchor = chunk->next; - free(chunk); + curlx_free(chunk); } } @@ -178,7 +174,7 @@ static CURLcode bufcp_take(struct bufc_pool *pool, return CURLE_OUT_OF_MEMORY; } - chunk = calloc(1, sizeof(*chunk) + pool->chunk_size); + chunk = curlx_calloc(1, sizeof(*chunk) + pool->chunk_size); if(!chunk) { *pchunk = NULL; return CURLE_OUT_OF_MEMORY; @@ -192,7 +188,7 @@ static void bufcp_put(struct bufc_pool *pool, struct buf_chunk *chunk) { if(pool->spare_count >= pool->spare_max) { - free(chunk); + curlx_free(chunk); } else { chunk_reset(chunk); @@ -311,7 +307,7 @@ static struct buf_chunk *get_spare(struct bufq *q) return NULL; } - chunk = calloc(1, sizeof(*chunk) + q->chunk_size); + chunk = curlx_calloc(1, sizeof(*chunk) + q->chunk_size); if(!chunk) return NULL; chunk->dlen = q->chunk_size; @@ -338,7 +334,7 @@ static void prune_head(struct bufq *q) /* SOFT_LIMIT allowed us more than max. free spares until * we are at max again. Or free them if we are configured * to not use spares. */ - free(chunk); + curlx_free(chunk); --q->chunk_count; } else { diff --git a/lib/bufref.c b/lib/bufref.c index ac0612071d6c..d5181a5da662 100644 --- a/lib/bufref.c +++ b/lib/bufref.c @@ -27,9 +27,6 @@ #include "bufref.h" #include "strdup.h" -#include "curl_memory.h" -#include "memdebug.h" - #ifdef DEBUGBUILD #define SIGNATURE 0x5c48e9b2 /* Random pattern. */ #endif diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 417b4df67e29..84ba3d6193fa 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -46,10 +46,6 @@ #include "multiif.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - typedef enum { H1_TUNNEL_INIT, /* init/default/no tunnel state */ @@ -116,7 +112,7 @@ static CURLcode tunnel_init(struct Curl_cfilter *cf, return CURLE_UNSUPPORTED_PROTOCOL; } - ts = calloc(1, sizeof(*ts)); + ts = curlx_calloc(1, sizeof(*ts)); if(!ts) return CURLE_OUT_OF_MEMORY; @@ -194,7 +190,7 @@ static void tunnel_free(struct Curl_cfilter *cf, curlx_dyn_free(&ts->rcvbuf); curlx_dyn_free(&ts->request_data); Curl_httpchunk_free(data, &ts->ch); - free(ts); + curlx_free(ts); cf->ctx = NULL; } } @@ -215,7 +211,7 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, /* This only happens if we have looped here due to authentication reasons, and we do not really use the newly cloned URL here - then. Just free() it. */ + then. Just free it. */ Curl_safefree(data->req.newurl); result = Curl_http_proxy_create_CONNECT(&req, cf, data, 1); @@ -298,7 +294,7 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "CONNECT: fwd auth header '%s'", header); result = Curl_http_input_auth(data, proxy, auth); - free(auth); + curlx_free(auth); if(result) return result; diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index fca916a2c24f..7066db3b4c4a 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -45,10 +45,6 @@ #include "curlx/warnless.h" #include "cf-h2-proxy.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define PROXY_H2_CHUNK_SIZE (16*1024) #define PROXY_HTTP2_HUGE_WINDOW_SIZE (100 * 1024 * 1024) @@ -209,7 +205,7 @@ static void cf_h2_proxy_ctx_free(struct cf_h2_proxy_ctx *ctx) { if(ctx) { cf_h2_proxy_ctx_clear(ctx); - free(ctx); + curlx_free(ctx); } } @@ -919,7 +915,7 @@ static CURLcode proxy_h2_submit(int32_t *pstream_id, result = CURLE_OK; out: - free(nva); + curlx_free(nva); Curl_dynhds_free(&h2_headers); *pstream_id = stream_id; return result; @@ -1594,7 +1590,7 @@ CURLcode Curl_cf_h2_proxy_insert_after(struct Curl_cfilter *cf, CURLcode result = CURLE_OUT_OF_MEMORY; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) goto out; diff --git a/lib/cf-haproxy.c b/lib/cf-haproxy.c index 8912604504d8..a1793c0071ec 100644 --- a/lib/cf-haproxy.c +++ b/lib/cf-haproxy.c @@ -34,10 +34,6 @@ #include "multiif.h" #include "select.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - typedef enum { HAPROXY_INIT, /* init/default/no tunnel state */ @@ -61,7 +57,7 @@ static void cf_haproxy_ctx_free(struct cf_haproxy_ctx *ctx) { if(ctx) { curlx_dyn_free(&ctx->data_out); - free(ctx); + curlx_free(ctx); } } @@ -217,7 +213,7 @@ static CURLcode cf_haproxy_create(struct Curl_cfilter **pcf, CURLcode result; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index 5491d7968d7e..ad815a0fe734 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -38,10 +38,6 @@ #include "select.h" #include "vquic/vquic.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - typedef enum { CF_HC_INIT, CF_HC_CONNECT, @@ -588,7 +584,7 @@ static CURLcode cf_hc_create(struct Curl_cfilter **pcf, CURLcode result = CURLE_OK; size_t i; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -618,7 +614,7 @@ static CURLcode cf_hc_create(struct Curl_cfilter **pcf, out: *pcf = result ? NULL : cf; - free(ctx); + curlx_free(ctx); return result; } diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index eb62cd4c73d3..8901db02c283 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -60,10 +60,6 @@ #include "select.h" #include "vquic/vquic.h" /* for quic cfilters */ -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - struct transport_provider { uint8_t transport; @@ -186,7 +182,7 @@ static void cf_ip_attempt_free(struct cf_ip_attempt *a, if(a) { if(a->cf) Curl_conn_cf_discard_chain(&a->cf, data); - free(a); + curlx_free(a); } } @@ -203,7 +199,7 @@ static CURLcode cf_ip_attempt_new(struct cf_ip_attempt **pa, CURLcode result = CURLE_OK; *pa = NULL; - a = calloc(1, sizeof(*a)); + a = curlx_calloc(1, sizeof(*a)); if(!a) return CURLE_OUT_OF_MEMORY; @@ -941,7 +937,7 @@ static CURLcode cf_ip_happy_create(struct Curl_cfilter **pcf, (void)data; (void)conn; *pcf = NULL; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -954,7 +950,7 @@ static CURLcode cf_ip_happy_create(struct Curl_cfilter **pcf, out: if(result) { Curl_safefree(*pcf); - free(ctx); + curlx_free(ctx); } return result; } diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 6e5333602c34..3172aee5b9c9 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -82,10 +82,6 @@ #include "curlx/strerr.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(USE_IPV6) && defined(IPV6_V6ONLY) && defined(_WIN32) /* It makes support for IPv4-mapped IPv6 addresses. @@ -555,7 +551,7 @@ CURLcode Curl_parse_interface(const char *input, ++host_part; *host = Curl_memdup0(host_part, len - (host_part - input)); if(!*host) { - free(*iface); + curlx_free(*iface); *iface = NULL; return CURLE_OUT_OF_MEMORY; } @@ -1026,7 +1022,7 @@ static void cf_socket_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) cf_socket_close(cf, data); CURL_TRC_CF(data, cf, "destroy"); - free(ctx); + curlx_free(ctx); cf->ctx = NULL; } @@ -1758,7 +1754,7 @@ CURLcode Curl_cf_tcp_create(struct Curl_cfilter **pcf, goto out; } - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -1920,7 +1916,7 @@ CURLcode Curl_cf_udp_create(struct Curl_cfilter **pcf, (void)data; (void)conn; DEBUGASSERT(transport == TRNSPRT_UDP || transport == TRNSPRT_QUIC); - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -1974,7 +1970,7 @@ CURLcode Curl_cf_unix_create(struct Curl_cfilter **pcf, (void)data; (void)conn; DEBUGASSERT(transport == TRNSPRT_UNIX); - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -2199,7 +2195,7 @@ CURLcode Curl_conn_tcp_listen_set(struct Curl_easy *data, Curl_conn_cf_discard_all(data, conn, sockindex); DEBUGASSERT(conn->sock[sockindex] == CURL_SOCKET_BAD); - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/cfilters.c b/lib/cfilters.c index 7cb10f39282f..7d1f0c3d9e4f 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -37,10 +37,6 @@ #include "curlx/warnless.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static void cf_cntrl_update_info(struct Curl_easy *data, struct connectdata *conn); @@ -143,7 +139,7 @@ void Curl_conn_cf_discard_chain(struct Curl_cfilter **pcf, */ cf->next = NULL; cf->cft->destroy(cf, data); - free(cf); + curlx_free(cf); cf = cfn; } } @@ -332,7 +328,7 @@ CURLcode Curl_cf_create(struct Curl_cfilter **pcf, CURLcode result = CURLE_OUT_OF_MEMORY; DEBUGASSERT(cft); - cf = calloc(1, sizeof(*cf)); + cf = curlx_calloc(1, sizeof(*cf)); if(!cf) goto out; diff --git a/lib/conncache.c b/lib/conncache.c index 9d3b69bec356..7f38a1875790 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -45,10 +45,6 @@ #include "curlx/strparse.h" #include "uint-table.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define CPOOL_IS_LOCKED(c) ((c) && (c)->locked) @@ -92,7 +88,7 @@ static struct cpool_bundle *cpool_bundle_create(const char *dest) struct cpool_bundle *bundle; size_t dest_len = strlen(dest) + 1; - bundle = calloc(1, sizeof(*bundle) + dest_len - 1); + bundle = curlx_calloc(1, sizeof(*bundle) + dest_len - 1); if(!bundle) return NULL; Curl_llist_init(&bundle->conns, NULL); @@ -104,7 +100,7 @@ static struct cpool_bundle *cpool_bundle_create(const char *dest) static void cpool_bundle_destroy(struct cpool_bundle *bundle) { DEBUGASSERT(!Curl_llist_count(&bundle->conns)); - free(bundle); + curlx_free(bundle); } /* Add a connection to a bundle */ diff --git a/lib/connect.c b/lib/connect.c index e29c2f51bcf8..72a27fae1cd9 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -76,10 +76,6 @@ #include "http_proxy.h" #include "socks.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if !defined(CURL_DISABLE_ALTSVC) || defined(USE_HTTPSRR) enum alpnid Curl_alpn2alpnid(const unsigned char *name, size_t len) @@ -527,7 +523,7 @@ static CURLcode cf_setup_create(struct Curl_cfilter **pcf, CURLcode result = CURLE_OK; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -544,7 +540,7 @@ static CURLcode cf_setup_create(struct Curl_cfilter **pcf, out: *pcf = result ? NULL : cf; if(ctx) { - free(ctx); + curlx_free(ctx); } return result; } diff --git a/lib/content_encoding.c b/lib/content_encoding.c index f128f7565f77..84ed86c1df3d 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -52,10 +52,6 @@ #include "http.h" #include "content_encoding.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define CONTENT_ENCODING_DEFAULT "identity" #ifndef CURL_DISABLE_HTTP @@ -95,15 +91,15 @@ static voidpf zalloc_cb(voidpf opaque, unsigned int items, unsigned int size) { (void)opaque; - /* not a typo, keep it calloc() */ - return (voidpf) calloc(items, size); + /* not a typo, keep it curlx_calloc() */ + return (voidpf)curlx_calloc(items, size); } static void zfree_cb(voidpf opaque, voidpf ptr) { (void)opaque; - free(ptr); + curlx_free(ptr); } static CURLcode diff --git a/lib/cookie.c b/lib/cookie.c index 6099c6ea560d..250c7390ce12 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -42,10 +42,6 @@ #include "llist.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static void strstore(char **str, const char *newstr, size_t len); /* number of seconds in 400 days */ @@ -70,12 +66,12 @@ static void cap_expires(time_t now, struct Cookie *co) static void freecookie(struct Cookie *co) { - free(co->domain); - free(co->path); - free(co->spath); - free(co->name); - free(co->value); - free(co); + curlx_free(co->domain); + curlx_free(co->path); + curlx_free(co->spath); + curlx_free(co->name); + curlx_free(co->value); + curlx_free(co); } static bool cookie_tailmatch(const char *cookie_domain, @@ -246,7 +242,7 @@ static char *sanitize_cookie_path(const char *cookie_path) /* RFC6265 5.2.4 The Path Attribute */ if(cookie_path[0] != '/') /* Let cookie-path be the default-path. */ - return strdup("/"); + return curlx_strdup("/"); /* remove trailing slash when path is non-empty */ /* convert /hoge/ to /hoge */ @@ -268,7 +264,7 @@ static char *sanitize_cookie_path(const char *cookie_path) static void strstore(char **str, const char *newstr, size_t len) { DEBUGASSERT(str); - free(*str); + curlx_free(*str); if(!len) { len++; newstr = ""; @@ -506,7 +502,7 @@ parse_cookie_header(struct Curl_easy *data, strstore(&co->path, curlx_str(&val), curlx_strlen(&val)); if(!co->path) return CURLE_OUT_OF_MEMORY; - free(co->spath); /* if this is set again */ + curlx_free(co->spath); /* if this is set again */ co->spath = sanitize_cookie_path(co->path); if(!co->spath) return CURLE_OUT_OF_MEMORY; @@ -631,7 +627,7 @@ parse_cookie_header(struct Curl_easy *data, if(!co->domain && domain) { /* no domain was given in the header line, set the default */ - co->domain = strdup(domain); + co->domain = curlx_strdup(domain); if(!co->domain) return CURLE_OUT_OF_MEMORY; } @@ -739,10 +735,10 @@ parse_netscape(struct Cookie *co, break; } /* this does not look like a path, make one up! */ - co->path = strdup("/"); + co->path = curlx_strdup("/"); if(!co->path) return CURLE_OUT_OF_MEMORY; - co->spath = strdup("/"); + co->spath = curlx_strdup("/"); if(!co->spath) return CURLE_OUT_OF_MEMORY; fields++; /* add a field and fall down to secure */ @@ -781,7 +777,7 @@ parse_netscape(struct Cookie *co, } if(fields == 6) { /* we got a cookie with blank contents, fix it */ - co->value = strdup(""); + co->value = curlx_strdup(""); if(!co->value) return CURLE_OUT_OF_MEMORY; else @@ -981,7 +977,7 @@ Curl_cookie_add(struct Curl_easy *data, return CURLE_OK; /* silently ignore */ /* First, alloc and init a new struct for it */ - co = calloc(1, sizeof(struct Cookie)); + co = curlx_calloc(1, sizeof(struct Cookie)); if(!co) return CURLE_OUT_OF_MEMORY; /* bail out if we are this low on memory */ @@ -1081,7 +1077,7 @@ Curl_cookie_add(struct Curl_easy *data, struct CookieInfo *Curl_cookie_init(void) { int i; - struct CookieInfo *ci = calloc(1, sizeof(struct CookieInfo)); + struct CookieInfo *ci = curlx_calloc(1, sizeof(struct CookieInfo)); if(!ci) return NULL; @@ -1343,7 +1339,7 @@ CURLcode Curl_cookie_getlist(struct Curl_easy *data, size_t i; /* alloc an array and store all cookie pointers */ - array = malloc(sizeof(struct Cookie *) * matches); + array = curlx_malloc(sizeof(struct Cookie *) * matches); if(!array) { result = CURLE_OUT_OF_MEMORY; goto fail; @@ -1363,7 +1359,7 @@ CURLcode Curl_cookie_getlist(struct Curl_easy *data, for(i = 0; i < matches; i++) Curl_llist_append(list, array[i], &array[i]->getnode); - free(array); /* remove the temporary data again */ + curlx_free(array); /* remove the temporary data again */ } *okay = TRUE; @@ -1435,7 +1431,7 @@ void Curl_cookie_cleanup(struct CookieInfo *ci) { if(ci) { Curl_cookie_clearall(ci); - free(ci); /* free the base struct as well */ + curlx_free(ci); /* free the base struct as well */ } } @@ -1518,7 +1514,7 @@ static CURLcode cookie_output(struct Curl_easy *data, struct Cookie **array; struct Curl_llist_node *n; - array = calloc(1, sizeof(struct Cookie *) * ci->numcookies); + array = curlx_calloc(1, sizeof(struct Cookie *) * ci->numcookies); if(!array) { error = CURLE_OUT_OF_MEMORY; goto error; @@ -1540,15 +1536,15 @@ static CURLcode cookie_output(struct Curl_easy *data, for(i = 0; i < nvalid; i++) { char *format_ptr = get_netscape_format(array[i]); if(!format_ptr) { - free(array); + curlx_free(array); error = CURLE_OUT_OF_MEMORY; goto error; } curl_mfprintf(out, "%s\n", format_ptr); - free(format_ptr); + curlx_free(format_ptr); } - free(array); + curlx_free(array); } if(!use_stdout) { @@ -1565,7 +1561,7 @@ static CURLcode cookie_output(struct Curl_easy *data, * no need to inspect the error, any error case should have jumped into the * error block below. */ - free(tempstore); + curlx_free(tempstore); return CURLE_OK; error: @@ -1573,7 +1569,7 @@ static CURLcode cookie_output(struct Curl_easy *data, curlx_fclose(out); if(tempstore) { unlink(tempstore); - free(tempstore); + curlx_free(tempstore); } return error; } @@ -1605,7 +1601,7 @@ static struct curl_slist *cookie_list(struct Curl_easy *data) } beg = Curl_slist_append_nodup(list, line); if(!beg) { - free(line); + curlx_free(line); curl_slist_free_all(list); return NULL; } diff --git a/lib/cshutdn.c b/lib/cshutdn.c index e039d027625b..0a4ab416473f 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -42,10 +42,6 @@ #include "select.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static void cshutdn_run_conn_handler(struct Curl_easy *data, struct connectdata *conn) diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index cd9b52febaa7..67c2f4177d5f 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -54,10 +54,6 @@ #include "curlx/inet_pton.h" #include "curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Curl_freeaddrinfo() * @@ -83,7 +79,7 @@ Curl_freeaddrinfo(struct Curl_addrinfo *cahead) for(ca = cahead; ca; ca = canext) { canext = ca->ai_next; - free(ca); + curlx_free(ca); } } @@ -146,7 +142,7 @@ Curl_getaddrinfo_ex(const char *nodename, if((size_t)ai->ai_addrlen < ss_size) continue; - ca = malloc(sizeof(struct Curl_addrinfo) + ss_size + namelen); + ca = curlx_malloc(sizeof(struct Curl_addrinfo) + ss_size + namelen); if(!ca) { error = EAI_MEMORY; break; @@ -285,7 +281,7 @@ Curl_he2ai(const struct hostent *he, int port) ss_size = sizeof(struct sockaddr_in); /* allocate memory to hold the struct, the address and the name */ - ai = calloc(1, sizeof(struct Curl_addrinfo) + ss_size + namelen); + ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + namelen); if(!ai) { result = CURLE_OUT_OF_MEMORY; break; @@ -382,7 +378,7 @@ ip2addr(struct Curl_addrinfo **addrp, return CURLE_BAD_FUNCTION_ARGUMENT; /* allocate memory to hold the struct, the address and the name */ - ai = calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen); + ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen); if(!ai) return CURLE_OUT_OF_MEMORY; /* put the address after the struct */ @@ -471,7 +467,8 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, *longpath = FALSE; - ai = calloc(1, sizeof(struct Curl_addrinfo) + sizeof(struct sockaddr_un)); + ai = curlx_calloc(1, + sizeof(struct Curl_addrinfo) + sizeof(struct sockaddr_un)); if(!ai) return NULL; ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo)); @@ -482,7 +479,7 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, /* sun_path must be able to store the null-terminated path */ path_len = strlen(path) + 1; if(path_len > sizeof(sa_un->sun_path)) { - free(ai); + curlx_free(ai); *longpath = TRUE; return NULL; } diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c index 3148c472e299..918be89d4bf1 100644 --- a/lib/curl_fnmatch.c +++ b/lib/curl_fnmatch.c @@ -27,10 +27,6 @@ #include #include "curl_fnmatch.h" -#include "curl_memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" #ifndef HAVE_FNMATCH diff --git a/lib/curl_fopen.c b/lib/curl_fopen.c index f16b3d6cde0d..cccf849acb7d 100644 --- a/lib/curl_fopen.c +++ b/lib/curl_fopen.c @@ -31,10 +31,6 @@ #include "rand.h" #include "curl_fopen.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* The dirslash() function breaks a null-terminated pathname string into directory and filename components then returns the directory component up @@ -120,7 +116,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, /* The temp filename should not end up too long for the target file system */ tempstore = curl_maprintf("%s%s.tmp", dir, randbuf); - free(dir); + curlx_free(dir); } if(!tempstore) { @@ -156,7 +152,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, unlink(tempstore); } - free(tempstore); + curlx_free(tempstore); return result; } diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c index d5ab7b842720..ea31eb182fa3 100644 --- a/lib/curl_get_line.c +++ b/lib/curl_get_line.c @@ -28,9 +28,6 @@ !defined(CURL_DISABLE_HSTS) || !defined(CURL_DISABLE_NETRC) #include "curl_get_line.h" -#include "curl_memory.h" -/* The last #include file should be: */ -#include "memdebug.h" #define appendnl(b) \ curlx_dyn_addn(buf, "\n", 1) diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index 947bb9c00631..edd555db7923 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -31,10 +31,8 @@ #ifdef DEBUGBUILD #if defined(HAVE_GSSGNU) || !defined(_WIN32) -/* To avoid memdebug macro replacement, wrap the name in parentheses to call - the original version. It is freed via the GSS API gss_release_buffer(). */ -#define Curl_gss_alloc (malloc) -#define Curl_gss_free (free) +#define Curl_gss_alloc malloc /* freed via the GSS API gss_release_buffer() */ +#define Curl_gss_free free /* pair of the above */ #define CURL_GSS_STUB /* For correctness this would be required for all platforms, not only Windows, but, as of v1.22.1, MIT Kerberos uses a special allocator only for Windows, @@ -51,10 +49,6 @@ #endif #endif /* DEBUGBUILD */ -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef __GNUC__ #define CURL_ALIGN8 __attribute__((aligned(8))) #else @@ -208,7 +202,7 @@ stub_gss_init_sec_context(OM_uint32 *min, return GSS_S_FAILURE; } - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; @@ -225,7 +219,7 @@ stub_gss_init_sec_context(OM_uint32 *min, else if(ctx->have_ntlm) ctx->sent = STUB_GSS_NTLM1; else { - free(ctx); + curlx_free(ctx); *min = STUB_GSS_NO_MECH; return GSS_S_FAILURE; } @@ -236,7 +230,7 @@ stub_gss_init_sec_context(OM_uint32 *min, token = Curl_gss_alloc(length); if(!token) { - free(ctx); + curlx_free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; } @@ -250,14 +244,14 @@ stub_gss_init_sec_context(OM_uint32 *min, &target_desc, &name_type); if(GSS_ERROR(major_status)) { Curl_gss_free(token); - free(ctx); + curlx_free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; } if(strlen(creds) + target_desc.length + 5 >= sizeof(ctx->creds)) { Curl_gss_free(token); - free(ctx); + curlx_free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; } @@ -273,7 +267,7 @@ stub_gss_init_sec_context(OM_uint32 *min, if(used >= length) { Curl_gss_free(token); - free(ctx); + curlx_free(ctx); *min = STUB_GSS_NO_MEMORY; return GSS_S_FAILURE; } @@ -308,7 +302,7 @@ stub_gss_delete_sec_context(OM_uint32 *min, return GSS_S_FAILURE; } - free(*context); + curlx_free(*context); *context = NULL; *min = 0; diff --git a/lib/curl_mem_undef.h b/lib/curl_mem_undef.h deleted file mode 100644 index 2be114cbd5e6..000000000000 --- a/lib/curl_mem_undef.h +++ /dev/null @@ -1,37 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* Unset redefined system symbols. */ - -#undef strdup -#undef malloc -#undef calloc -#undef realloc -#undef free -#ifdef _WIN32 -#undef Curl_tcsdup -#endif - -#undef HEADER_CURL_MEMORY_H -#undef HEADER_CURL_MEMDEBUG_H diff --git a/lib/curl_memory.h b/lib/curl_memory.h deleted file mode 100644 index 7793bb63a389..000000000000 --- a/lib/curl_memory.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef HEADER_CURL_MEMORY_H -#define HEADER_CURL_MEMORY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* - * Nasty internal details ahead... - * - * File curl_memory.h must be included by _all_ *.c source files - * that use memory related functions strdup, malloc, calloc, realloc - * or free, and given source file is used to build libcurl library. - * It should be included immediately before memdebug.h as the last files - * included to avoid undesired interaction with other memory function - * headers in dependent libraries. - * - * There is nearly no exception to above rule. All libcurl source - * files in 'lib' subdirectory as well as those living deep inside - * 'packages' subdirectories and linked together in order to build - * libcurl library shall follow it. - * - * File lib/strdup.c is an exception, given that it provides a strdup - * clone implementation while using malloc. Extra care needed inside - * this one. - * - * The need for curl_memory.h inclusion is due to libcurl's feature - * of allowing library user to provide memory replacement functions, - * memory callbacks, at runtime with curl_global_init_mem() - * - * Any *.c source file used to build libcurl library that does not - * include curl_memory.h and uses any memory function of the five - * mentioned above will compile without any indication, but it will - * trigger weird memory related issues at runtime. - * - */ - -#ifndef CURLDEBUG - -/* - * libcurl's 'memory tracking' system defines strdup, malloc, calloc, - * realloc and free, along with others, in memdebug.h in a different - * way although still using memory callbacks forward declared above. - * When using the 'memory tracking' system (CURLDEBUG defined) we do - * not define here the five memory functions given that definitions - * from memdebug.h are the ones that shall be used. - */ - -#undef strdup -#define strdup(ptr) Curl_cstrdup(ptr) -#undef malloc -#define malloc(size) Curl_cmalloc(size) -#undef calloc -#define calloc(nbelem,size) Curl_ccalloc(nbelem, size) -#undef realloc -#define realloc(ptr,size) Curl_crealloc(ptr, size) -#undef free -#define free(ptr) Curl_cfree(ptr) - -#ifdef _WIN32 -#undef Curl_tcsdup -#ifdef UNICODE -#define Curl_tcsdup(ptr) Curl_wcsdup(ptr) -#else -#define Curl_tcsdup(ptr) Curl_cstrdup(ptr) -#endif -#endif /* _WIN32 */ - -#endif /* CURLDEBUG */ -#endif /* HEADER_CURL_MEMORY_H */ diff --git a/lib/curl_memrchr.c b/lib/curl_memrchr.c index 5b6a39c022cc..81464584070c 100644 --- a/lib/curl_memrchr.c +++ b/lib/curl_memrchr.c @@ -27,10 +27,6 @@ #include #include "curl_memrchr.h" -#include "curl_memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" #ifndef HAVE_MEMRCHR /* diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index d013929d4da6..f2c8c2d2a659 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -122,10 +122,6 @@ #include "curl_endian.h" #include "curl_md4.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef USE_CURL_DES_SET_ODD_PARITY /* * curl_des_set_odd_parity() @@ -437,7 +433,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(const char *password, CURLcode result; if(len > SIZE_MAX/2) /* avoid integer overflow */ return CURLE_OUT_OF_MEMORY; - pw = len ? malloc(len * 2) : (unsigned char *)strdup(""); + pw = len ? curlx_malloc(len * 2) : (unsigned char *)curlx_strdup(""); if(!pw) return CURLE_OUT_OF_MEMORY; @@ -448,7 +444,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(const char *password, if(!result) memset(ntbuffer + 16, 0, 21 - 16); - free(pw); + curlx_free(pw); return result; } @@ -525,7 +521,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, return CURLE_OUT_OF_MEMORY; identity_len = (userlen + domlen) * 2; - identity = malloc(identity_len + 1); + identity = curlx_malloc(identity_len + 1); if(!identity) return CURLE_OUT_OF_MEMORY; @@ -535,7 +531,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, result = Curl_hmacit(&Curl_HMAC_MD5, ntlmhash, 16, identity, identity_len, ntlmv2hash); - free(identity); + curlx_free(identity); return result; } @@ -598,7 +594,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, len = HMAC_MD5_LENGTH + NTLMv2_BLOB_LEN; /* Allocate the response */ - ptr = calloc(1, len); + ptr = curlx_calloc(1, len); if(!ptr) return CURLE_OUT_OF_MEMORY; @@ -622,7 +618,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, result = Curl_hmacit(&Curl_HMAC_MD5, ntlmv2hash, HMAC_MD5_LENGTH, ptr + 8, NTLMv2_BLOB_LEN + 8, hmac_output); if(result) { - free(ptr); + curlx_free(ptr); return result; } diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 2d2daf414897..351c9f494c3f 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -37,10 +37,6 @@ #include #include -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(_WIN32) && !defined(USE_LWIPSOCK) #define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e) #define SET_RCVTIMEO(tv,s) int tv = s*1000 diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index f6ec668bfd45..aef47dc0162e 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -51,10 +51,6 @@ #include "curlx/warnless.h" #include "sendf.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* Supported mechanisms */ static const struct { const char *name; /* Name */ diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 6236a7153923..6acac0d17ad0 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -941,7 +941,7 @@ extern curl_calloc_callback Curl_ccalloc; * This macro also assigns NULL to given pointer when free'd. */ #define Curl_safefree(ptr) \ - do { free(ptr); (ptr) = NULL;} while(0) + do { curlx_free(ptr); (ptr) = NULL;} while(0) #include /* for CURL_EXTERN, mprintf.h */ @@ -1077,6 +1077,56 @@ CURL_EXTERN ALLOC_FUNC #endif /* CURLDEBUG */ +/* Allocator macros */ + +#ifdef CURLDEBUG + +#define curlx_strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__) +#define curlx_malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__) +#define curlx_calloc(nbelem,size) \ + curl_dbg_calloc(nbelem, size, __LINE__, __FILE__) +#define curlx_realloc(ptr,size) \ + curl_dbg_realloc(ptr, size, __LINE__, __FILE__) +#define curlx_free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__) + +#ifdef _WIN32 +#ifdef UNICODE +#define curlx_tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) +#else +#define curlx_tcsdup(ptr) curlx_strdup(ptr) +#endif +#endif /* _WIN32 */ + +#else /* !CURLDEBUG */ + +#ifdef BUILDING_LIBCURL +#define curlx_strdup(ptr) Curl_cstrdup(ptr) +#define curlx_malloc(size) Curl_cmalloc(size) +#define curlx_calloc(nbelem,size) Curl_ccalloc(nbelem, size) +#define curlx_realloc(ptr,size) Curl_crealloc(ptr, size) +#define curlx_free(ptr) Curl_cfree(ptr) +#else /* !BUILDING_LIBCURL */ +#ifdef _WIN32 +#define curlx_strdup(ptr) _strdup(ptr) +#else +#define curlx_strdup(ptr) strdup(ptr) +#endif +#define curlx_malloc(size) malloc(size) +#define curlx_calloc(nbelem,size) calloc(nbelem, size) +#define curlx_realloc(ptr,size) realloc(ptr, size) +#define curlx_free(ptr) free(ptr) +#endif /* BUILDING_LIBCURL */ + +#ifdef _WIN32 +#ifdef UNICODE +#define curlx_tcsdup(ptr) Curl_wcsdup(ptr) +#else +#define curlx_tcsdup(ptr) curlx_strdup(ptr) +#endif +#endif /* _WIN32 */ + +#endif /* CURLDEBUG */ + /* Some versions of the Android NDK is missing the declaration */ #if defined(HAVE_GETPWUID_R) && \ defined(__ANDROID_API__) && (__ANDROID_API__ < 21) @@ -1167,5 +1217,3 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, #endif #endif /* HEADER_CURL_SETUP_H */ - -#include "curl_mem_undef.h" diff --git a/lib/curl_share.c b/lib/curl_share.c index b65d16c6281f..c6b51267046f 100644 --- a/lib/curl_share.c +++ b/lib/curl_share.c @@ -34,21 +34,17 @@ #include "hsts.h" #include "url.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - CURLSH * curl_share_init(void) { - struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); + struct Curl_share *share = curlx_calloc(1, sizeof(struct Curl_share)); if(share) { share->magic = CURL_GOOD_SHARE; share->specifier |= (1 << CURL_LOCK_DATA_SHARE); Curl_dnscache_init(&share->dnscache, 23); share->admin = curl_easy_init(); if(!share->admin) { - free(share); + curlx_free(share); return NULL; } /* admin handles have mid 0 */ @@ -272,7 +268,7 @@ curl_share_cleanup(CURLSH *sh) if(share->unlockfunc) share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); share->magic = 0; - free(share); + curlx_free(share); return CURLSHE_OK; } diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index 369cf18967a3..264703d8cd70 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -33,10 +33,6 @@ #include "system_win32.h" #include "curlx/warnless.h" -/* The last #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - /* Pointer to SSPI dispatch table */ PSecurityFunctionTable Curl_pSecFn = NULL; @@ -134,7 +130,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, } /* Setup the identity's user and length */ - dup_user.tchar_ptr = Curl_tcsdup(user.tchar_ptr); + dup_user.tchar_ptr = curlx_tcsdup(user.tchar_ptr); if(!dup_user.tchar_ptr) { curlx_unicodefree(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; @@ -144,7 +140,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, dup_user.tchar_ptr = NULL; /* Setup the identity's domain and length */ - dup_domain.tchar_ptr = malloc(sizeof(TCHAR) * (domlen + 1)); + dup_domain.tchar_ptr = curlx_malloc(sizeof(TCHAR) * (domlen + 1)); if(!dup_domain.tchar_ptr) { curlx_unicodefree(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; @@ -164,7 +160,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, passwd.tchar_ptr = curlx_convert_UTF8_to_tchar(passwdp); if(!passwd.tchar_ptr) return CURLE_OUT_OF_MEMORY; - dup_passwd.tchar_ptr = Curl_tcsdup(passwd.tchar_ptr); + dup_passwd.tchar_ptr = curlx_tcsdup(passwd.tchar_ptr); if(!dup_passwd.tchar_ptr) { curlx_unicodefree(passwd.tchar_ptr); return CURLE_OUT_OF_MEMORY; diff --git a/lib/curl_threads.c b/lib/curl_threads.c index a0308f06b2dc..e4536078be39 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -31,9 +31,6 @@ #endif #include "curl_threads.h" -#include "curl_memory.h" -/* The last #include FILE should be: */ -#include "memdebug.h" #ifdef USE_THREADS_POSIX @@ -48,7 +45,7 @@ static void *curl_thread_create_thunk(void *arg) unsigned int (*func)(void *) = ac->func; void *real_arg = ac->arg; - free(ac); + curlx_free(ac); (*func)(real_arg); @@ -58,8 +55,8 @@ static void *curl_thread_create_thunk(void *arg) curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T (CURL_STDCALL *func) (void *), void *arg) { - curl_thread_t t = malloc(sizeof(pthread_t)); - struct Curl_actual_call *ac = malloc(sizeof(struct Curl_actual_call)); + curl_thread_t t = curlx_malloc(sizeof(pthread_t)); + struct Curl_actual_call *ac = curlx_malloc(sizeof(struct Curl_actual_call)); int rc; if(!(ac && t)) goto err; @@ -76,8 +73,8 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T return t; err: - free(t); - free(ac); + curlx_free(t); + curlx_free(ac); return curl_thread_t_null; } @@ -85,7 +82,7 @@ void Curl_thread_destroy(curl_thread_t *hnd) { if(*hnd != curl_thread_t_null) { pthread_detach(**hnd); - free(*hnd); + curlx_free(*hnd); *hnd = curl_thread_t_null; } } @@ -94,7 +91,7 @@ int Curl_thread_join(curl_thread_t *hnd) { int ret = (pthread_join(**hnd, NULL) == 0); - free(*hnd); + curlx_free(*hnd); *hnd = curl_thread_t_null; return ret; diff --git a/lib/curl_trc.c b/lib/curl_trc.c index 0b91315e3668..cc06c77e9d9a 100644 --- a/lib/curl_trc.c +++ b/lib/curl_trc.c @@ -47,10 +47,6 @@ #include "vtls/vtls.h" #include "vquic/vquic.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static void trc_write(struct Curl_easy *data, curl_infotype type, const char *ptr, size_t size) { diff --git a/lib/curlx/base64.c b/lib/curlx/base64.c index 3fcd709d1ce8..6a24c20ebdfb 100644 --- a/lib/curlx/base64.c +++ b/lib/curlx/base64.c @@ -30,12 +30,6 @@ #include "warnless.h" #include "base64.h" -/* The last 2 #include files should be in this order */ -#ifdef BUILDING_LIBCURL -#include "../curl_memory.h" -#endif -#include "../memdebug.h" - /* ---- Base64 Encoding/Decoding Table --- */ const char Curl_base64encdec[]= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -103,7 +97,7 @@ CURLcode curlx_base64_decode(const char *src, rawlen = (numQuantums * 3) - padding; /* Allocate our buffer including room for a null-terminator */ - newstr = malloc(rawlen + 1); + newstr = curlx_malloc(rawlen + 1); if(!newstr) return CURLE_OUT_OF_MEMORY; @@ -165,7 +159,7 @@ CURLcode curlx_base64_decode(const char *src, return CURLE_OK; bad: - free(newstr); + curlx_free(newstr); return CURLE_BAD_CONTENT_ENCODING; } @@ -189,7 +183,7 @@ static CURLcode base64_encode(const char *table64, if(insize > CURL_MAX_BASE64_INPUT) return CURLE_TOO_LARGE; - base64data = output = malloc((insize + 2) / 3 * 4 + 1); + base64data = output = curlx_malloc((insize + 2) / 3 * 4 + 1); if(!output) return CURLE_OUT_OF_MEMORY; diff --git a/lib/curlx/dynbuf.c b/lib/curlx/dynbuf.c index 447203e42a8a..e54865f933c7 100644 --- a/lib/curlx/dynbuf.c +++ b/lib/curlx/dynbuf.c @@ -25,10 +25,6 @@ #include "../curl_setup.h" #include "dynbuf.h" #include "../curl_printf.h" -#ifdef BUILDING_LIBCURL -#include "../curl_memory.h" -#endif -#include "../memdebug.h" #define MIN_FIRST_ALLOC 32 @@ -108,7 +104,7 @@ static CURLcode dyn_nappend(struct dynbuf *s, if(a != s->allc) { /* this logic is not using Curl_saferealloc() to make the tool not have to include that as well when it uses this code */ - void *p = realloc(s->bufr, a); + void *p = curlx_realloc(s->bufr, a); if(!p) { curlx_dyn_free(s); return CURLE_OUT_OF_MEMORY; @@ -212,7 +208,7 @@ CURLcode curlx_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) if(str) { CURLcode result = dyn_nappend(s, (const unsigned char *)str, strlen(str)); - free(str); + curlx_free(str); return result; } /* If we failed, we cleanup the whole buffer and return error */ diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index 0dc9699206cd..c8dff428fc94 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) Daniel Stenberg, , et al. + * Copyright (C) Danieal Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,11 +23,8 @@ ***************************************************************************/ /* - * This file is 'mem-include-scan' clean, which means its memory allocations - * are not tracked by the curl memory tracker memdebug, so they must not use - * `CURLDEBUG` macro replacements in memdebug.h for free, malloc, etc. To avoid - * these macro replacements, wrap the names in parentheses to call the original - * versions: `ptr = (malloc)(123)`, `(free)(ptr)`, etc. + * Use system allocators to avoid infinite recursion when called by curl's + * memory tracker memdebug functions. */ #include "../curl_setup.h" @@ -103,7 +100,8 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) goto cleanup; if(!needed || needed >= max_path_len) goto cleanup; - ibuf = (malloc)(needed * sizeof(wchar_t)); + /* !checksrc! disable BANNEDFUNC 1 */ + ibuf = malloc(needed * sizeof(wchar_t)); if(!ibuf) goto cleanup; if(mbstowcs_s(&count, ibuf, needed, in, needed - 1)) @@ -124,7 +122,8 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) /* skip paths that are not excessive and do not need modification */ if(needed <= MAX_PATH) goto cleanup; - fbuf = (malloc)(needed * sizeof(wchar_t)); + /* !checksrc! disable BANNEDFUNC 1 */ + fbuf = malloc(needed * sizeof(wchar_t)); if(!fbuf) goto cleanup; count = (size_t)GetFullPathNameW(in_w, (DWORD)needed, fbuf, NULL); @@ -157,16 +156,19 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) if(needed > max_path_len) goto cleanup; - temp = (malloc)(needed * sizeof(wchar_t)); + /* !checksrc! disable BANNEDFUNC 1 */ + temp = malloc(needed * sizeof(wchar_t)); if(!temp) goto cleanup; if(wcsncpy_s(temp, needed, L"\\\\?\\UNC\\", 8)) { - (free)(temp); + /* !checksrc! disable BANNEDFUNC 1 */ + free(temp); goto cleanup; } if(wcscpy_s(temp + 8, needed, fbuf + 2)) { - (free)(temp); + /* !checksrc! disable BANNEDFUNC 1 */ + free(temp); goto cleanup; } } @@ -176,21 +178,25 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) if(needed > max_path_len) goto cleanup; - temp = (malloc)(needed * sizeof(wchar_t)); + /* !checksrc! disable BANNEDFUNC 1 */ + temp = malloc(needed * sizeof(wchar_t)); if(!temp) goto cleanup; if(wcsncpy_s(temp, needed, L"\\\\?\\", 4)) { - (free)(temp); + /* !checksrc! disable BANNEDFUNC 1 */ + free(temp); goto cleanup; } if(wcscpy_s(temp + 4, needed, fbuf)) { - (free)(temp); + /* !checksrc! disable BANNEDFUNC 1 */ + free(temp); goto cleanup; } } - (free)(fbuf); + /* !checksrc! disable BANNEDFUNC 1 */ + free(fbuf); fbuf = temp; } @@ -200,7 +206,8 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) goto cleanup; if(!needed || needed >= max_path_len) goto cleanup; - obuf = (malloc)(needed); + /* !checksrc! disable BANNEDFUNC 1 */ + obuf = malloc(needed); if(!obuf) goto cleanup; if(wcstombs_s(&count, obuf, needed, fbuf, needed - 1)) @@ -215,10 +222,12 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) #endif cleanup: - (free)(fbuf); + /* !checksrc! disable BANNEDFUNC 1 */ + free(fbuf); #ifndef _UNICODE - (free)(ibuf); - (free)(obuf); + /* !checksrc! disable BANNEDFUNC 2 */ + free(ibuf); + free(obuf); #endif return *out ? true : false; } @@ -260,7 +269,8 @@ int curlx_win32_open(const char *filename, int oflag, ...) errno = _sopen_s(&result, target, oflag, _SH_DENYNO, pmode); #endif - (free)(fixed); + /* !checksrc! disable BANNEDFUNC 1 */ + free(fixed); return result; } @@ -293,7 +303,8 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) errno = fopen_s(&result, target, mode); #endif - (free)(fixed); + /* !checksrc! disable BANNEDFUNC 1 */ + free(fixed); return result; } @@ -331,7 +342,8 @@ FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) errno = freopen_s(&result, target, mode, fp); #endif - (free)(fixed); + /* !checksrc! disable BANNEDFUNC 1 */ + free(fixed); return result; } @@ -370,7 +382,8 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) #endif #endif - (free)(fixed); + /* !checksrc! disable BANNEDFUNC 1 */ + free(fixed); return result; } diff --git a/lib/curlx/multibyte.c b/lib/curlx/multibyte.c index 9e60edf7e3e2..2583f3087031 100644 --- a/lib/curlx/multibyte.c +++ b/lib/curlx/multibyte.c @@ -23,11 +23,8 @@ ***************************************************************************/ /* - * This file is 'mem-include-scan' clean, which means its memory allocations - * are not tracked by the curl memory tracker memdebug, so they must not use - * `CURLDEBUG` macro replacements in memdebug.h for free, malloc, etc. To avoid - * these macro replacements, wrap the names in parentheses to call the original - * versions: `ptr = (malloc)(123)`, `(free)(ptr)`, etc. + * Use system allocators to avoid infinite recursion when called by curl's + * memory tracker memdebug functions. */ #include "../curl_setup.h" @@ -48,11 +45,13 @@ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8) int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str_utf8, -1, NULL, 0); if(str_w_len > 0) { - str_w = (malloc)(str_w_len * sizeof(wchar_t)); + /* !checksrc! disable BANNEDFUNC 1 */ + str_w = malloc(str_w_len * sizeof(wchar_t)); if(str_w) { if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, str_w_len) == 0) { - (free)(str_w); + /* !checksrc! disable BANNEDFUNC 1 */ + free(str_w); return NULL; } } @@ -70,11 +69,13 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w) int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL, 0, NULL, NULL); if(bytes > 0) { - str_utf8 = (malloc)(bytes); + /* !checksrc! disable BANNEDFUNC 1 */ + str_utf8 = malloc(bytes); if(str_utf8) { if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, bytes, NULL, NULL) == 0) { - (free)(str_utf8); + /* !checksrc! disable BANNEDFUNC 1 */ + free(str_utf8); return NULL; } } diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index 8b698c1b7357..c992214a9575 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -44,11 +44,8 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); * * Allocated memory should be free'd with curlx_unicodefree(). * - * Note: Because these are curlx functions their memory usage is not tracked - * by the curl memory tracker memdebug. you will notice that curlx - * function-like macros call free and strdup in parentheses, eg (strdup)(ptr), - * and that is to ensure that the curl memdebug override macros do not replace - * them. + * Use system allocators to avoid infinite recursion when called by curl's + * memory tracker memdebug functions. */ #if defined(UNICODE) && defined(_WIN32) @@ -65,8 +62,13 @@ typedef union { #else -#define curlx_convert_UTF8_to_tchar(ptr) (strdup)(ptr) -#define curlx_convert_tchar_to_UTF8(ptr) (strdup)(ptr) +#ifdef _WIN32 +#define curlx_convert_UTF8_to_tchar(ptr) _strdup(ptr) +#define curlx_convert_tchar_to_UTF8(ptr) _strdup(ptr) +#else +#define curlx_convert_UTF8_to_tchar(ptr) strdup(ptr) +#define curlx_convert_tchar_to_UTF8(ptr) strdup(ptr) +#endif typedef union { char *tchar_ptr; @@ -78,6 +80,6 @@ typedef union { #endif /* UNICODE && _WIN32 */ /* the purpose of this macro is to free() without being traced by memdebug */ -#define curlx_unicodefree(ptr) (free)(ptr) +#define curlx_unicodefree(ptr) free(ptr) #endif /* HEADER_CURL_MULTIBYTE_H */ diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index c33d10701125..3dbeab82ee57 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -37,9 +37,6 @@ #include "winapi.h" #include "snprintf.h" #include "strerr.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" #ifdef USE_WINSOCK /* This is a helper function for curlx_strerror that converts Winsock error diff --git a/lib/curlx/version_win32.c b/lib/curlx/version_win32.c index cc86b71d3e3d..9ab72c2fd5b9 100644 --- a/lib/curlx/version_win32.c +++ b/lib/curlx/version_win32.c @@ -30,10 +30,6 @@ #include "version_win32.h" #include "warnless.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* This Unicode version struct works for VerifyVersionInfoW (OSVERSIONINFOEXW) and RtlVerifyVersionInfo (RTLOSVERSIONINFOEXW) */ struct OUR_OSVERSIONINFOEXW { diff --git a/lib/cw-out.c b/lib/cw-out.c index 36cfc36aca04..4561546d197d 100644 --- a/lib/cw-out.c +++ b/lib/cw-out.c @@ -35,10 +35,6 @@ #include "cw-out.h" #include "cw-pause.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /** * OVERALL DESIGN of this client writer @@ -85,7 +81,7 @@ struct cw_out_buf { static struct cw_out_buf *cw_out_buf_create(cw_out_type otype) { - struct cw_out_buf *cwbuf = calloc(1, sizeof(*cwbuf)); + struct cw_out_buf *cwbuf = curlx_calloc(1, sizeof(*cwbuf)); if(cwbuf) { cwbuf->type = otype; curlx_dyn_init(&cwbuf->b, DYN_PAUSE_BUFFER); @@ -97,7 +93,7 @@ static void cw_out_buf_free(struct cw_out_buf *cwbuf) { if(cwbuf) { curlx_dyn_free(&cwbuf->b); - free(cwbuf); + curlx_free(cwbuf); } } diff --git a/lib/cw-pause.c b/lib/cw-pause.c index 1af4e8fa4192..2a98667ae4ff 100644 --- a/lib/cw-pause.c +++ b/lib/cw-pause.c @@ -34,10 +34,6 @@ #include "sendf.h" #include "cw-pause.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* body dynbuf sizes */ #define CW_PAUSE_BUF_CHUNK (16 * 1024) @@ -52,7 +48,7 @@ struct cw_pause_buf { static struct cw_pause_buf *cw_pause_buf_create(int type, size_t buflen) { - struct cw_pause_buf *cwbuf = calloc(1, sizeof(*cwbuf)); + struct cw_pause_buf *cwbuf = curlx_calloc(1, sizeof(*cwbuf)); if(cwbuf) { cwbuf->type = type; if(type & CLIENTWRITE_BODY) @@ -68,7 +64,7 @@ static void cw_pause_buf_free(struct cw_pause_buf *cwbuf) { if(cwbuf) { Curl_bufq_free(&cwbuf->b); - free(cwbuf); + curlx_free(cwbuf); } } diff --git a/lib/dict.c b/lib/dict.c index 5c7ba7f6229f..f208892f7302 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -60,11 +60,6 @@ #include "progress.h" #include "dict.h" -/* The last 2 #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - - #define DICT_MATCH "/MATCH:" #define DICT_MATCH2 "/M:" #define DICT_MATCH3 "/FIND:" @@ -172,7 +167,7 @@ static CURLcode sendf(struct Curl_easy *data, const char *fmt, ...) break; } - free(s); /* free the output string */ + curlx_free(s); /* free the output string */ return result; } @@ -310,8 +305,8 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done) } error: - free(eword); - free(path); + curlx_free(eword); + curlx_free(path); return result; } #endif /* CURL_DISABLE_DICT */ diff --git a/lib/dllmain.c b/lib/dllmain.c index 011090589bb0..7b7d3c7e2e10 100644 --- a/lib/dllmain.c +++ b/lib/dllmain.c @@ -28,10 +28,6 @@ #include #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* DllMain() must only be defined for Windows DLL builds. */ #if defined(_WIN32) && !defined(CURL_STATICLIB) diff --git a/lib/doh.c b/lib/doh.c index 0712981a97ec..d7b1d54c25e8 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -41,10 +41,6 @@ #include "escape.h" #include "urlapi-int.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define DNS_CLASS_IN 0x01 #ifndef CURL_DISABLE_VERBOSE_STRINGS @@ -269,7 +265,7 @@ static void doh_probe_dtor(void *key, size_t klen, void *e) struct doh_request *doh_req = e; curl_slist_free_all(doh_req->req_hds); curlx_dyn_free(&doh_req->resp_body); - free(e); + curlx_free(e); } } @@ -296,7 +292,7 @@ static CURLcode doh_probe_run(struct Curl_easy *data, *pmid = UINT32_MAX; - doh_req = calloc(1, sizeof(*doh_req)); + doh_req = curlx_calloc(1, sizeof(*doh_req)); if(!doh_req) return CURLE_OUT_OF_MEMORY; doh_req->dnstype = dnstype; @@ -462,12 +458,12 @@ CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, data->state.async.done = FALSE; data->state.async.port = port; data->state.async.ip_version = ip_version; - data->state.async.hostname = strdup(hostname); + data->state.async.hostname = curlx_strdup(hostname); if(!data->state.async.hostname) return CURLE_OUT_OF_MEMORY; /* start clean, consider allocating this struct on demand */ - data->state.async.doh = dohp = calloc(1, sizeof(struct doh_probes)); + data->state.async.doh = dohp = curlx_calloc(1, sizeof(struct doh_probes)); if(!dohp) return CURLE_OUT_OF_MEMORY; @@ -518,7 +514,7 @@ CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, qname ? qname : hostname, data->set.str[STRING_DOH], data->multi, &dohp->probe_resp[DOH_SLOT_HTTPS_RR].probe_mid); - free(qname); + curlx_free(qname); if(result) goto error; dohp->pending++; @@ -963,7 +959,7 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname, addrtype = AF_INET; } - ai = calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen); + ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen); if(!ai) { result = CURLE_OUT_OF_MEMORY; break; @@ -1130,7 +1126,7 @@ UNITTEST CURLcode doh_resp_decode_httpsrr(struct Curl_easy *data, *hrr = NULL; if(len <= 2) return CURLE_BAD_FUNCTION_ARGUMENT; - lhrr = calloc(1, sizeof(struct Curl_https_rrinfo)); + lhrr = curlx_calloc(1, sizeof(struct Curl_https_rrinfo)); if(!lhrr) return CURLE_OUT_OF_MEMORY; lhrr->priority = doh_get16bit(cp, 0); diff --git a/lib/dynhds.c b/lib/dynhds.c index 95d415bf0b49..ebe1beae5856 100644 --- a/lib/dynhds.c +++ b/lib/dynhds.c @@ -31,10 +31,6 @@ #include #endif /* USE_NGHTTP2 */ -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static struct dynhds_entry * entry_new(const char *name, size_t namelen, @@ -45,7 +41,7 @@ entry_new(const char *name, size_t namelen, DEBUGASSERT(name); DEBUGASSERT(value); - e = calloc(1, sizeof(*e) + namelen + valuelen + 2); + e = curlx_calloc(1, sizeof(*e) + namelen + valuelen + 2); if(!e) return NULL; e->name = p = ((char *)e) + sizeof(*e); @@ -68,7 +64,7 @@ entry_append(struct dynhds_entry *e, char *p; DEBUGASSERT(value); - e2 = calloc(1, sizeof(*e) + e->namelen + valuelen2 + 2); + e2 = curlx_calloc(1, sizeof(*e) + e->namelen + valuelen2 + 2); if(!e2) return NULL; e2->name = p = ((char *)e2) + sizeof(*e2); @@ -85,7 +81,7 @@ entry_append(struct dynhds_entry *e, static void entry_free(struct dynhds_entry *e) { - free(e); + curlx_free(e); } void Curl_dynhds_init(struct dynhds *dynhds, size_t max_entries, @@ -186,7 +182,7 @@ entry = entry_new(name, namelen, value, valuelen, dynhds->opts); if(dynhds->max_entries && nallc > dynhds->max_entries) nallc = dynhds->max_entries; - nhds = calloc(nallc, sizeof(struct dynhds_entry *)); + nhds = curlx_calloc(nallc, sizeof(struct dynhds_entry *)); if(!nhds) goto out; if(dynhds->hds) { @@ -374,7 +370,7 @@ CURLcode Curl_dynhds_h1_dprint(struct dynhds *dynhds, struct dynbuf *dbuf) nghttp2_nv *Curl_dynhds_to_nva(struct dynhds *dynhds, size_t *pcount) { - nghttp2_nv *nva = calloc(1, sizeof(nghttp2_nv) * dynhds->hds_len); + nghttp2_nv *nva = curlx_calloc(1, sizeof(nghttp2_nv) * dynhds->hds_len); size_t i; *pcount = 0; diff --git a/lib/easy.c b/lib/easy.c index db6c419c5771..476f63c74dff 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -80,10 +80,6 @@ #include "easy_lock.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* true globals -- for curl_global_init() and curl_global_cleanup() */ static unsigned int initialized; static long easy_init_flags; @@ -198,7 +194,7 @@ static CURLcode global_init(long flags, bool memoryfuncs) #ifdef DEBUGBUILD if(getenv("CURL_GLOBAL_INIT")) /* alloc data that will leak if *cleanup() is not called! */ - leakpointer = malloc(1); + leakpointer = curlx_malloc(1); #endif return CURLE_OK; @@ -297,7 +293,7 @@ void curl_global_cleanup(void) Curl_ssh_cleanup(); #ifdef DEBUGBUILD - free(leakpointer); + curlx_free(leakpointer); #endif easy_init_flags = 0; @@ -478,7 +474,7 @@ static int events_socket(CURL *easy, /* easy handle */ prev->next = nxt; else ev->list = nxt; - free(m); + curlx_free(m); infof(data, "socket cb: socket %" FMT_SOCKET_T " REMOVED", s); } else { @@ -504,7 +500,7 @@ static int events_socket(CURL *easy, /* easy handle */ DEBUGASSERT(0); } else { - m = malloc(sizeof(struct socketmonitor)); + m = curlx_malloc(sizeof(struct socketmonitor)); if(m) { m->next = ev->list; m->socket.fd = s; @@ -927,7 +923,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src) i = STRING_COPYPOSTFIELDS; if(src->set.str[i]) { if(src->set.postfieldsize == -1) - dst->set.str[i] = strdup(src->set.str[i]); + dst->set.str[i] = curlx_strdup(src->set.str[i]); else /* postfieldsize is curl_off_t, Curl_memdup() takes a size_t ... */ dst->set.str[i] = Curl_memdup(src->set.str[i], @@ -968,7 +964,7 @@ CURL *curl_easy_duphandle(CURL *d) if(!GOOD_EASY_HANDLE(data)) goto fail; - outcurl = calloc(1, sizeof(struct Curl_easy)); + outcurl = curlx_calloc(1, sizeof(struct Curl_easy)); if(!outcurl) goto fail; @@ -1022,14 +1018,14 @@ CURL *curl_easy_duphandle(CURL *d) #endif if(data->state.url) { - outcurl->state.url = strdup(data->state.url); + outcurl->state.url = curlx_strdup(data->state.url); if(!outcurl->state.url) goto fail; outcurl->state.url_alloc = TRUE; } if(data->state.referer) { - outcurl->state.referer = strdup(data->state.referer); + outcurl->state.referer = curlx_strdup(data->state.referer); if(!outcurl->state.referer) goto fail; outcurl->state.referer_alloc = TRUE; @@ -1073,13 +1069,13 @@ CURL *curl_easy_duphandle(CURL *d) if(outcurl) { #ifndef CURL_DISABLE_COOKIES - free(outcurl->cookies); + curlx_free(outcurl->cookies); #endif curlx_dyn_free(&outcurl->state.headerb); Curl_altsvc_cleanup(&outcurl->asi); Curl_hsts_cleanup(&outcurl->hsts); Curl_freeset(outcurl); - free(outcurl); + curlx_free(outcurl); } return NULL; diff --git a/lib/escape.c b/lib/escape.c index fdc6e438ab3e..04b46f7a9e26 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -37,10 +37,6 @@ struct Curl_easy; #include "curlx/strparse.h" #include "curl_printf.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* for ABI-compatibility with previous versions */ char *curl_escape(const char *string, int inlength) { @@ -68,7 +64,7 @@ char *curl_easy_escape(CURL *data, const char *string, length = (inlength ? (size_t)inlength : strlen(string)); if(!length) - return strdup(""); + return curlx_strdup(""); curlx_dyn_init(&d, length * 3 + 1); @@ -120,7 +116,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */ alloc = (length ? length : strlen(string)); - ns = malloc(alloc + 1); + ns = curlx_malloc(alloc + 1); if(!ns) return CURLE_OUT_OF_MEMORY; @@ -196,7 +192,7 @@ char *curl_easy_unescape(CURL *data, const char *string, the library's memory system */ void curl_free(void *p) { - free(p); + curlx_free(p); } /* diff --git a/lib/fake_addrinfo.c b/lib/fake_addrinfo.c index 9789d1ef62bd..7d5da09ead53 100644 --- a/lib/fake_addrinfo.c +++ b/lib/fake_addrinfo.c @@ -31,10 +31,6 @@ #include #include -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - void r_freeaddrinfo(struct addrinfo *cahead) { struct addrinfo *canext; @@ -42,7 +38,7 @@ void r_freeaddrinfo(struct addrinfo *cahead) for(ca = cahead; ca; ca = canext) { canext = ca->ai_next; - free(ca); + curlx_free(ca); } } @@ -90,7 +86,7 @@ static struct addrinfo *mk_getaddrinfo(const struct ares_addrinfo *aihead) if((size_t)ai->ai_addrlen < ss_size) continue; - ca = malloc(sizeof(struct addrinfo) + ss_size + namelen); + ca = curlx_malloc(sizeof(struct addrinfo) + ss_size + namelen); if(!ca) { r_freeaddrinfo(cafirst); return NULL; diff --git a/lib/file.c b/lib/file.c index 3de92408c490..2f30a0297ca6 100644 --- a/lib/file.c +++ b/lib/file.c @@ -68,10 +68,6 @@ #include "curlx/warnless.h" #include "curl_range.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(_WIN32) || defined(MSDOS) #define DOS_FILESYSTEM 1 #elif defined(__amigaos4__) @@ -148,7 +144,7 @@ static void file_easy_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; file_cleanup(file); - free(file); + curlx_free(file); } static CURLcode file_setup_connection(struct Curl_easy *data, @@ -157,7 +153,7 @@ static CURLcode file_setup_connection(struct Curl_easy *data, struct FILEPROTO *filep; (void)conn; /* allocate the FILE specific struct */ - filep = calloc(1, sizeof(*filep)); + filep = curlx_calloc(1, sizeof(*filep)); if(!filep || Curl_meta_set(data, CURL_META_FILE_EASY, filep, file_easy_dtor)) return CURLE_OUT_OF_MEMORY; @@ -269,7 +265,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done) file->path = real_path; #endif #endif - free(file->freepath); + curlx_free(file->freepath); file->freepath = real_path; /* free this when done */ file->fd = fd; diff --git a/lib/fileinfo.c b/lib/fileinfo.c index bddd3fe6fbb1..83d2ef0d005f 100644 --- a/lib/fileinfo.c +++ b/lib/fileinfo.c @@ -27,13 +27,10 @@ #ifndef CURL_DISABLE_FTP #include "fileinfo.h" -#include "curl_memory.h" -/* The last #include file should be: */ -#include "memdebug.h" struct fileinfo *Curl_fileinfo_alloc(void) { - return calloc(1, sizeof(struct fileinfo)); + return curlx_calloc(1, sizeof(struct fileinfo)); } void Curl_fileinfo_cleanup(struct fileinfo *finfo) @@ -42,7 +39,7 @@ void Curl_fileinfo_cleanup(struct fileinfo *finfo) return; curlx_dyn_free(&finfo->buf); - free(finfo); + curlx_free(finfo); } #endif diff --git a/lib/formdata.c b/lib/formdata.c index 416bcad4f57d..d4bfed89beaa 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -40,10 +40,6 @@ struct Curl_easy; #include "curlx/fopen.h" #include "curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define HTTPPOST_PTRNAME CURL_HTTPPOST_PTRNAME #define HTTPPOST_FILENAME CURL_HTTPPOST_FILENAME @@ -76,7 +72,7 @@ AddHttpPost(struct FormInfo *src, if((src->bufferlength > LONG_MAX) || (namelength > LONG_MAX)) /* avoid overflow in typecasts below */ return NULL; - post = calloc(1, sizeof(struct curl_httppost)); + post = curlx_calloc(1, sizeof(struct curl_httppost)); if(post) { post->name = src->name; post->namelength = (long)namelength; @@ -127,7 +123,7 @@ static struct FormInfo *AddFormInfo(char *value, struct FormInfo *parent_form_info) { struct FormInfo *form_info; - form_info = calloc(1, sizeof(struct FormInfo)); + form_info = curlx_calloc(1, sizeof(struct FormInfo)); if(!form_info) return NULL; if(value) @@ -262,7 +258,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, type = FILE_CONTENTTYPE_DEFAULT; /* our contenttype is missing */ - form->contenttype = strdup(type); + form->contenttype = curlx_strdup(type); if(!form->contenttype) return CURL_FORMADD_MEMORY; @@ -320,7 +316,7 @@ static void free_chain(struct curl_httppost *c) struct curl_httppost *next = c->next; if(c->more) free_chain(c->more); - free(c); + curlx_free(c); c = next; } } @@ -346,7 +342,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, /* * We need to allocate the first struct to fill in. */ - first_form = calloc(1, sizeof(struct FormInfo)); + first_form = curlx_calloc(1, sizeof(struct FormInfo)); if(!first_form) return CURL_FORMADD_MEMORY; @@ -458,7 +454,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, if(!array_state) avalue = va_arg(params, char *); if(avalue) { - curr->value = strdup(avalue); + curr->value = curlx_strdup(avalue); if(!curr->value) retval = CURL_FORMADD_MEMORY; else { @@ -479,13 +475,13 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->value) { if(curr->flags & HTTPPOST_FILENAME) { if(avalue) { - char *fname = strdup(avalue); + char *fname = curlx_strdup(avalue); if(!fname) retval = CURL_FORMADD_MEMORY; else { form = AddFormInfo(fname, NULL, curr); if(!form) { - free(fname); + curlx_free(fname); retval = CURL_FORMADD_MEMORY; } else { @@ -503,7 +499,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, } else { if(avalue) { - curr->value = strdup(avalue); + curr->value = curlx_strdup(avalue); if(!curr->value) retval = CURL_FORMADD_MEMORY; else { @@ -566,13 +562,13 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->contenttype) { if(curr->flags & HTTPPOST_FILENAME) { if(avalue) { - char *type = strdup(avalue); + char *type = curlx_strdup(avalue); if(!type) retval = CURL_FORMADD_MEMORY; else { form = AddFormInfo(NULL, type, curr); if(!form) { - free(type); + curlx_free(type); retval = CURL_FORMADD_MEMORY; } else { @@ -590,7 +586,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, } else { if(avalue) { - curr->contenttype = strdup(avalue); + curr->contenttype = curlx_strdup(avalue); if(!curr->contenttype) retval = CURL_FORMADD_MEMORY; else @@ -623,7 +619,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->showfilename) retval = CURL_FORMADD_OPTION_TWICE; else { - curr->showfilename = strdup(avalue); + curr->showfilename = curlx_strdup(avalue); if(!curr->showfilename) retval = CURL_FORMADD_MEMORY; else @@ -650,7 +646,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, now by the httppost linked list */ while(first_form) { struct FormInfo *ptr = first_form->more; - free(first_form); + curlx_free(first_form); first_form = ptr; } @@ -743,14 +739,14 @@ void curl_formfree(struct curl_httppost *form) curl_formfree(form->more); if(!(form->flags & HTTPPOST_PTRNAME)) - free(form->name); /* free the name */ + curlx_free(form->name); /* free the name */ if(!(form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_BUFFER|HTTPPOST_CALLBACK)) ) - free(form->contents); /* free the contents */ - free(form->contenttype); /* free the content type */ - free(form->showfilename); /* free the faked filename */ - free(form); /* free the struct */ + curlx_free(form->contents); /* free the contents */ + curlx_free(form->contenttype); /* free the content type */ + curlx_free(form->showfilename); /* free the faked filename */ + curlx_free(form); /* free the struct */ form = next; } while(form); /* continue */ } @@ -768,7 +764,7 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) if(!zname) return CURLE_OUT_OF_MEMORY; res = curl_mime_name(part, zname); - free(zname); + curlx_free(zname); return res; } diff --git a/lib/ftp.c b/lib/ftp.c index ce4001226823..b2b15a89dcd3 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -72,10 +72,6 @@ #include "curlx/strerr.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif @@ -1419,7 +1415,7 @@ static CURLcode ftp_state_list(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd); - free(cmd); + curlx_free(cmd); if(!result) ftp_state(data, ftpc, FTP_LIST); @@ -1770,12 +1766,12 @@ static CURLcode ftp_control_addr_dup(struct Curl_easy *data, not the ftp host. */ #ifndef CURL_DISABLE_PROXY if(conn->bits.tunnel_proxy || conn->bits.socksproxy) - *newhostp = strdup(conn->host.name); + *newhostp = curlx_strdup(conn->host.name); else #endif if(!Curl_conn_get_ip_info(data, conn, FIRSTSOCKET, &is_ipv6, &ipquad) && *ipquad.remote_ip) - *newhostp = strdup(ipquad.remote_ip); + *newhostp = curlx_strdup(ipquad.remote_ip); else { /* failed to get the remote_ip of the DATA connection */ failf(data, "unable to get peername of DATA connection"); @@ -1934,7 +1930,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, /* postponed address resolution in case of tcp fastopen */ if(conn->bits.tcp_fastopen && !conn->bits.reuse && !newhost[0]) { - free(newhost); + curlx_free(newhost); result = ftp_control_addr_dup(data, &newhost); if(result) goto error; @@ -1956,7 +1952,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, if(result) { if(ftpc->count1 == 0 && ftpcode == 229) { - free(newhost); + curlx_free(newhost); return ftp_epsv_disable(data, ftpc, conn); } @@ -1973,9 +1969,9 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, /* this just dumps information about this second connection */ ftp_pasv_verbose(data, dns->addr, newhost, connectport); - free(conn->secondaryhostname); + curlx_free(conn->secondaryhostname); conn->secondary_port = newport; - conn->secondaryhostname = strdup(newhost); + conn->secondaryhostname = curlx_strdup(newhost); if(!conn->secondaryhostname) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -1985,7 +1981,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, ftp_state(data, ftpc, FTP_STOP); /* this phase is completed */ error: - free(newhost); + curlx_free(newhost); return result; } @@ -2723,17 +2719,17 @@ static CURLcode ftp_pwd_resp(struct Curl_easy *data, if(!ftpc->server_os && dir[0] != '/') { result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SYST"); if(result) { - free(dir); + curlx_free(dir); return result; } } - free(ftpc->entrypath); + curlx_free(ftpc->entrypath); ftpc->entrypath = dir; /* remember this */ infof(data, "Entry path is '%s'", ftpc->entrypath); /* also save it where getinfo can access it: */ - free(data->state.most_recent_ftp_entrypath); - data->state.most_recent_ftp_entrypath = strdup(ftpc->entrypath); + curlx_free(data->state.most_recent_ftp_entrypath); + data->state.most_recent_ftp_entrypath = curlx_strdup(ftpc->entrypath); if(!data->state.most_recent_ftp_entrypath) return CURLE_OUT_OF_MEMORY; @@ -2961,18 +2957,18 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, /* Force OS400 name format 1. */ result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SITE NAMEFMT 1"); if(result) { - free(os); + curlx_free(os); return result; } /* remember target server OS */ - free(ftpc->server_os); + curlx_free(ftpc->server_os); ftpc->server_os = os; ftp_state(data, ftpc, FTP_NAMEFMT); break; } /* Nothing special for the target server. */ /* remember target server OS */ - free(ftpc->server_os); + curlx_free(ftpc->server_os); ftpc->server_os = os; } else { @@ -3277,7 +3273,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, * the error path) */ ftpc->ctl_valid = FALSE; /* mark control connection as bad */ connclose(conn, "FTP: out of memory!"); /* mark for connection closure */ - free(ftpc->prevpath); + curlx_free(ftpc->prevpath); ftpc->prevpath = NULL; /* no path remembering */ } else { /* remember working directory for connection reuse */ @@ -3288,7 +3284,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, else { size_t pathLen = strlen(ftpc->rawpath); - free(ftpc->prevpath); + curlx_free(ftpc->prevpath); if(!ftpc->cwdfail) { if(data->set.ftp_filemethod == FTPFILE_NOCWD) @@ -3757,7 +3753,7 @@ static void wc_data_dtor(void *ptr) struct ftp_wc *ftpwc = ptr; if(ftpwc && ftpwc->parser) Curl_ftp_parselist_data_free(&ftpwc->parser); - free(ftpwc); + curlx_free(ftpwc); } static CURLcode init_wc_data(struct Curl_easy *data, @@ -3777,14 +3773,14 @@ static CURLcode init_wc_data(struct Curl_easy *data, wildcard->state = CURLWC_CLEAN; return ftp_parse_url_path(data, ftpc, ftp); } - wildcard->pattern = strdup(last_slash); + wildcard->pattern = curlx_strdup(last_slash); if(!wildcard->pattern) return CURLE_OUT_OF_MEMORY; last_slash[0] = '\0'; /* cut file from path */ } else { /* there is only 'wildcard pattern' or nothing */ if(path[0]) { - wildcard->pattern = strdup(path); + wildcard->pattern = curlx_strdup(path); if(!wildcard->pattern) return CURLE_OUT_OF_MEMORY; path[0] = '\0'; @@ -3799,7 +3795,7 @@ static CURLcode init_wc_data(struct Curl_easy *data, resources for wildcard transfer */ /* allocate ftp protocol specific wildcard data */ - ftpwc = calloc(1, sizeof(struct ftp_wc)); + ftpwc = curlx_calloc(1, sizeof(struct ftp_wc)); if(!ftpwc) { result = CURLE_OUT_OF_MEMORY; goto fail; @@ -3825,7 +3821,7 @@ static CURLcode init_wc_data(struct Curl_easy *data, goto fail; } - wildcard->path = strdup(ftp->path); + wildcard->path = curlx_strdup(ftp->path); if(!wildcard->path) { result = CURLE_OUT_OF_MEMORY; goto fail; @@ -3846,7 +3842,7 @@ static CURLcode init_wc_data(struct Curl_easy *data, fail: if(ftpwc) { Curl_ftp_parselist_data_free(&ftpwc->parser); - free(ftpwc); + curlx_free(ftpwc); } Curl_safefree(wildcard->pattern); wildcard->dtor = ZERO_NULL; @@ -3904,7 +3900,7 @@ static CURLcode wc_statemach(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; /* switch default ftp->path and tmp_path */ - free(ftp->pathalloc); + curlx_free(ftp->pathalloc); ftp->pathalloc = ftp->path = tmp_path; infof(data, "Wildcard - START of \"%s\"", finfo->filename); @@ -4179,7 +4175,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data, if(dirlen == 0) dirlen = 1; - ftpc->dirs = calloc(1, sizeof(ftpc->dirs[0])); + ftpc->dirs = curlx_calloc(1, sizeof(ftpc->dirs[0])); if(!ftpc->dirs) return CURLE_OUT_OF_MEMORY; @@ -4205,7 +4201,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data, return CURLE_URL_MALFORMAT; if(dirAlloc) { - ftpc->dirs = calloc(dirAlloc, sizeof(ftpc->dirs[0])); + ftpc->dirs = curlx_calloc(dirAlloc, sizeof(ftpc->dirs[0])); if(!ftpc->dirs) return CURLE_OUT_OF_MEMORY; @@ -4372,7 +4368,7 @@ static void ftp_easy_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; Curl_safefree(ftp->pathalloc); - free(ftp); + curlx_free(ftp); } static void ftp_conn_dtor(void *key, size_t klen, void *entry) @@ -4387,7 +4383,7 @@ static void ftp_conn_dtor(void *key, size_t klen, void *entry) Curl_safefree(ftpc->prevpath); Curl_safefree(ftpc->server_os); Curl_pp_disconnect(&ftpc->pp); - free(ftpc); + curlx_free(ftpc); } static void type_url_check(struct Curl_easy *data, struct FTP *ftp) @@ -4426,19 +4422,19 @@ static CURLcode ftp_setup_connection(struct Curl_easy *data, CURLcode result = CURLE_OK; struct ftp_conn *ftpc; - ftp = calloc(1, sizeof(*ftp)); + ftp = curlx_calloc(1, sizeof(*ftp)); if(!ftp || Curl_meta_set(data, CURL_META_FTP_EASY, ftp, ftp_easy_dtor)) return CURLE_OUT_OF_MEMORY; - ftpc = calloc(1, sizeof(*ftpc)); + ftpc = curlx_calloc(1, sizeof(*ftpc)); if(!ftpc || Curl_conn_meta_set(conn, CURL_META_FTP_CONN, ftpc, ftp_conn_dtor)) return CURLE_OUT_OF_MEMORY; /* clone connection related data that is FTP specific */ if(data->set.str[STRING_FTP_ACCOUNT]) { - ftpc->account = strdup(data->set.str[STRING_FTP_ACCOUNT]); + ftpc->account = curlx_strdup(data->set.str[STRING_FTP_ACCOUNT]); if(!ftpc->account) { Curl_conn_meta_remove(conn, CURL_META_FTP_CONN); return CURLE_OUT_OF_MEMORY; @@ -4446,7 +4442,7 @@ static CURLcode ftp_setup_connection(struct Curl_easy *data, } if(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]) { ftpc->alternative_to_user = - strdup(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]); + curlx_strdup(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]); if(!ftpc->alternative_to_user) { Curl_safefree(ftpc->account); Curl_conn_meta_remove(conn, CURL_META_FTP_CONN); diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index d8d155d5c2eb..b62fa47f6542 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -52,10 +52,6 @@ #include "multiif.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - typedef enum { PL_UNIX_TOTALSIZE = 0, PL_UNIX_FILETYPE, @@ -205,18 +201,18 @@ void Curl_wildcard_dtor(struct WildcardData **wcp) DEBUGASSERT(wc->ftpwc == NULL); Curl_llist_destroy(&wc->filelist, NULL); - free(wc->path); + curlx_free(wc->path); wc->path = NULL; - free(wc->pattern); + curlx_free(wc->pattern); wc->pattern = NULL; wc->state = CURLWC_INIT; - free(wc); + curlx_free(wc); *wcp = NULL; } struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void) { - return calloc(1, sizeof(struct ftp_parselist_data)); + return curlx_calloc(1, sizeof(struct ftp_parselist_data)); } @@ -225,7 +221,7 @@ void Curl_ftp_parselist_data_free(struct ftp_parselist_data **parserp) struct ftp_parselist_data *parser = *parserp; if(parser) Curl_fileinfo_cleanup(parser->file_data); - free(parser); + curlx_free(parser); *parserp = NULL; } diff --git a/lib/getenv.c b/lib/getenv.c index a2d8056fcc72..73c62d99cd23 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -25,9 +25,6 @@ #include "curl_setup.h" #include -#include "curl_memory.h" - -#include "memdebug.h" static char *GetEnv(const char *variable) { @@ -45,9 +42,9 @@ static char *GetEnv(const char *variable) const DWORD max = 32768; /* max env var size from MSCRT source */ for(;;) { - tmp = realloc(buf, rc); + tmp = curlx_realloc(buf, rc); if(!tmp) { - free(buf); + curlx_free(buf); return NULL; } @@ -58,7 +55,7 @@ static char *GetEnv(const char *variable) Since getenv does not make that distinction we ignore it as well. */ rc = GetEnvironmentVariableA(variable, buf, bufsize); if(!rc || rc == bufsize || rc > max) { - free(buf); + curlx_free(buf); return NULL; } @@ -70,7 +67,7 @@ static char *GetEnv(const char *variable) } #else char *env = getenv(variable); - return (env && env[0]) ? strdup(env) : NULL; + return (env && env[0]) ? curlx_strdup(env) : NULL; #endif } diff --git a/lib/getinfo.c b/lib/getinfo.c index 01c727935620..14244d087b06 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -34,10 +34,6 @@ #include "progress.h" #include "curlx/strparse.h" -/* The last #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Initialize statistical and informational data. * @@ -74,10 +70,10 @@ void Curl_initinfo(struct Curl_easy *data) info->httpauthpicked = 0; info->numconnects = 0; - free(info->contenttype); + curlx_free(info->contenttype); info->contenttype = NULL; - free(info->wouldredirect); + curlx_free(info->wouldredirect); info->wouldredirect = NULL; memset(&info->primary, 0, sizeof(info->primary)); @@ -137,7 +133,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, case CURLINFO_FTP_ENTRY_PATH: /* Return the entrypath string from the most recent connection. This pointer was copied from the connectdata structure by FTP. - The actual string may be free()ed by subsequent libcurl calls so + The actual string may be freed by subsequent libcurl calls so it must be copied to a safer area before the next libcurl call. Callers must never free it themselves. */ *param_charp = data->state.most_recent_ftp_entrypath; diff --git a/lib/gopher.c b/lib/gopher.c index 45d43f6ebdb1..93e9287c99b9 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -40,10 +40,6 @@ #include "escape.h" #include "curlx/warnless.h" -/* The last 2 #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Forward declarations. */ @@ -153,7 +149,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) if(query) gopherpath = curl_maprintf("%s?%s", path, query); else - gopherpath = strdup(path); + gopherpath = curlx_strdup(path); if(!gopherpath) return CURLE_OUT_OF_MEMORY; @@ -162,7 +158,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) if(strlen(gopherpath) <= 2) { buf = ""; buf_len = 0; - free(gopherpath); + curlx_free(gopherpath); } else { char *newp; @@ -173,7 +169,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) /* ... and finally unescape */ result = Curl_urldecode(newp, 0, &buf_alloc, &buf_len, REJECT_ZERO); - free(gopherpath); + curlx_free(gopherpath); if(result) return result; buf = buf_alloc; @@ -224,7 +220,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) } } - free(buf_alloc); + curlx_free(buf_alloc); if(!result) result = Curl_xfer_send(data, "\r\n", 2, FALSE, &nwritten); diff --git a/lib/hash.c b/lib/hash.c index 8312fbf050fd..2d91c855e614 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -28,10 +28,6 @@ #include "hash.h" #include "llist.h" -#include "curl_memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" /* random patterns for API verification */ #ifdef DEBUGBUILD @@ -115,7 +111,7 @@ hash_elem_create(const void *key, size_t key_len, const void *p, struct Curl_hash_element *he; /* allocate the struct plus memory after it to store the key */ - he = malloc(sizeof(struct Curl_hash_element) + key_len); + he = curlx_malloc(sizeof(struct Curl_hash_element) + key_len); if(he) { he->next = NULL; /* copy the key */ @@ -145,7 +141,7 @@ static void hash_elem_destroy(struct Curl_hash *h, struct Curl_hash_element *he) { hash_elem_clear_ptr(h, he); - free(he); + curlx_free(he); } static void hash_elem_unlink(struct Curl_hash *h, @@ -177,7 +173,7 @@ void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, DEBUGASSERT(h->slots); DEBUGASSERT(h->init == HASHINIT); if(!h->table) { - h->table = calloc(h->slots, sizeof(struct Curl_hash_element *)); + h->table = curlx_calloc(h->slots, sizeof(struct Curl_hash_element *)); if(!h->table) return NULL; /* OOM */ } diff --git a/lib/headers.c b/lib/headers.c index feb52e087de8..91715fd51d3a 100644 --- a/lib/headers.c +++ b/lib/headers.c @@ -30,10 +30,6 @@ #include "headers.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HEADERS_API) /* Generate the curl_header struct for the user. This function MUST assign all @@ -317,7 +313,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, return CURLE_TOO_LARGE; } - hs = calloc(1, sizeof(*hs) + hlen); + hs = curlx_calloc(1, sizeof(*hs) + hlen); if(!hs) return CURLE_OUT_OF_MEMORY; memcpy(hs->buffer, header, hlen); @@ -336,7 +332,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, } else { failf(data, "Invalid response header"); - free(hs); + curlx_free(hs); } return result; } @@ -417,7 +413,7 @@ CURLcode Curl_headers_cleanup(struct Curl_easy *data) for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) { struct Curl_header_store *hs = Curl_node_elem(e); n = Curl_node_next(e); - free(hs); + curlx_free(hs); } headers_reset(data); return CURLE_OK; diff --git a/lib/hmac.c b/lib/hmac.c index 7842f0601b06..4f226e6434f8 100644 --- a/lib/hmac.c +++ b/lib/hmac.c @@ -33,12 +33,8 @@ #include #include "curl_hmac.h" -#include "curl_memory.h" #include "curlx/warnless.h" -/* The last #include file should be: */ -#include "memdebug.h" - /* * Generic HMAC algorithm. * @@ -62,7 +58,7 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, /* Create HMAC context. */ i = sizeof(*ctxt) + 2 * hashparams->ctxtsize + hashparams->resultlen; - ctxt = malloc(i); + ctxt = curlx_malloc(i); if(!ctxt) return ctxt; @@ -103,7 +99,7 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, return ctxt; fail: - free(ctxt); + curlx_free(ctxt); return NULL; } @@ -130,7 +126,7 @@ int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output) hashparams->hfinal(output, ctxt->hashctxt1); hashparams->hupdate(ctxt->hashctxt2, output, hashparams->resultlen); hashparams->hfinal(output, ctxt->hashctxt2); - free(ctxt); + curlx_free(ctxt); return 0; } diff --git a/lib/hostip.c b/lib/hostip.c index 58a7712cf485..e81886995eda 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -62,10 +62,6 @@ #include "easy_lock.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(CURLRES_SYNCH) && \ defined(HAVE_ALARM) && \ defined(SIGALRM) && \ @@ -451,7 +447,7 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, struct Curl_addrinfo **nodes; infof(data, "Shuffling %i addresses", num_addrs); - nodes = malloc(num_addrs*sizeof(*nodes)); + nodes = curlx_malloc(num_addrs*sizeof(*nodes)); if(nodes) { int i; unsigned int *rnd; @@ -463,7 +459,7 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, nodes[i] = nodes[i-1]->ai_next; } - rnd = malloc(rnd_size); + rnd = curlx_malloc(rnd_size); if(rnd) { /* Fisher-Yates shuffle */ if(Curl_rand(data, (unsigned char *)rnd, rnd_size) == CURLE_OK) { @@ -482,11 +478,11 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, nodes[num_addrs-1]->ai_next = NULL; *addr = nodes[0]; } - free(rnd); + curlx_free(rnd); } else result = CURLE_OUT_OF_MEMORY; - free(nodes); + curlx_free(nodes); } else result = CURLE_OUT_OF_MEMORY; @@ -519,7 +515,7 @@ Curl_dnscache_mk_entry(struct Curl_easy *data, hostlen = strlen(hostname); /* Create a new cache entry */ - dns = calloc(1, sizeof(struct Curl_dns_entry) + hostlen); + dns = curlx_calloc(1, sizeof(struct Curl_dns_entry) + hostlen); if(!dns) return NULL; @@ -609,7 +605,7 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name) struct sockaddr_in6 sa6; unsigned char ipv6[16]; unsigned short port16 = (unsigned short)(port & 0xffff); - ca = calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen + 1); + ca = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen + 1); if(!ca) return NULL; @@ -658,7 +654,7 @@ static struct Curl_addrinfo *get_localhost(int port, const char *name) return NULL; memcpy(&sa.sin_addr, &ipv4, sizeof(ipv4)); - ca = calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen + 1); + ca = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen + 1); if(!ca) return NULL; ca->ai_flags = 0; @@ -1178,10 +1174,10 @@ static void dnscache_entry_free(struct Curl_dns_entry *dns) #ifdef USE_HTTPSRR if(dns->hinfo) { Curl_httpsrr_cleanup(dns->hinfo); - free(dns->hinfo); + curlx_free(dns->hinfo); } #endif - free(dns); + curlx_free(dns); } /* diff --git a/lib/hostip4.c b/lib/hostip4.c index d543c1e14b19..f01e902fd684 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -50,10 +50,6 @@ #include "curl_share.h" #include "url.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef CURLRES_SYNCH @@ -139,7 +135,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, */ int h_errnop; - buf = calloc(1, CURL_HOSTENT_SIZE); + buf = curlx_calloc(1, CURL_HOSTENT_SIZE); if(!buf) return NULL; /* major failure */ /* @@ -253,8 +249,8 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, * Since we do not know how big buffer this particular lookup required, * we cannot realloc down the huge alloc without doing closer analysis of * the returned data. Thus, we always use CURL_HOSTENT_SIZE for every - * name lookup. Fixing this would require an extra malloc() and then - * calling Curl_addrinfo_copy() that subsequent realloc()s down the new + * name lookup. Fixing this would require an extra allocation and then + * calling Curl_addrinfo_copy() that subsequent reallocation down the new * memory area to the actually used amount. */ } @@ -262,7 +258,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, #endif /* HAVE_...BYNAME_R_5 || HAVE_...BYNAME_R_6 || HAVE_...BYNAME_R_3 */ { h = NULL; /* set return code to NULL */ - free(buf); + curlx_free(buf); } #else /* (HAVE_GETADDRINFO && HAVE_GETADDRINFO_THREADSAFE) || HAVE_GETHOSTBYNAME_R */ @@ -280,7 +276,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, ai = Curl_he2ai(h, port); if(buf) /* used a *_r() function */ - free(buf); + curlx_free(buf); } #endif diff --git a/lib/hostip6.c b/lib/hostip6.c index 0f628b3fb5ca..cfba2a5cbf27 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -53,10 +53,6 @@ #include "curlx/inet_pton.h" #include "connect.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef CURLRES_SYNCH #ifdef DEBUG_ADDRINFO diff --git a/lib/hsts.c b/lib/hsts.c index 836481cd4c36..22add0395732 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -41,10 +41,6 @@ #include "strdup.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define MAX_HSTS_LINE 4095 #define MAX_HSTS_HOSTLEN 2048 #define MAX_HSTS_DATELEN 256 @@ -72,7 +68,7 @@ static time_t hsts_debugtime(void *unused) struct hsts *Curl_hsts_init(void) { - struct hsts *h = calloc(1, sizeof(struct hsts)); + struct hsts *h = curlx_calloc(1, sizeof(struct hsts)); if(h) { Curl_llist_init(&h->list, NULL); } @@ -81,8 +77,8 @@ struct hsts *Curl_hsts_init(void) static void hsts_free(struct stsentry *e) { - free(CURL_UNCONST(e->host)); - free(e); + curlx_free(CURL_UNCONST(e->host)); + curlx_free(e); } void Curl_hsts_cleanup(struct hsts **hp) @@ -96,8 +92,8 @@ void Curl_hsts_cleanup(struct hsts **hp) n = Curl_node_next(e); hsts_free(sts); } - free(h->filename); - free(h); + curlx_free(h->filename); + curlx_free(h); *hp = NULL; } } @@ -116,13 +112,13 @@ static CURLcode hsts_create(struct hsts *h, --hlen; if(hlen) { char *duphost; - struct stsentry *sts = calloc(1, sizeof(struct stsentry)); + struct stsentry *sts = curlx_calloc(1, sizeof(struct stsentry)); if(!sts) return CURLE_OUT_OF_MEMORY; duphost = Curl_memdup0(hostname, hlen); if(!duphost) { - free(sts); + curlx_free(sts); return CURLE_OUT_OF_MEMORY; } @@ -385,7 +381,7 @@ CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, if(result && tempstore) unlink(tempstore); } - free(tempstore); + curlx_free(tempstore); skipsave: if(data->set.hsts_write) { /* if there is a write callback */ @@ -518,8 +514,8 @@ static CURLcode hsts_load(struct hsts *h, const char *file) /* we need a private copy of the filename so that the hsts cache file name survives an easy handle reset */ - free(h->filename); - h->filename = strdup(file); + curlx_free(h->filename); + h->filename = curlx_strdup(file); if(!h->filename) return CURLE_OUT_OF_MEMORY; diff --git a/lib/http.c b/lib/http.c index 8223c6f0e213..f09d96ee0607 100644 --- a/lib/http.c +++ b/lib/http.c @@ -87,10 +87,6 @@ #include "curl_ctype.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Forward declarations. */ @@ -277,7 +273,7 @@ static bool http_header_is_empty(const char *header) /* * Strip off leading and trailing whitespace from the value in the given HTTP - * header line and return a strdup()ed copy in 'valp' - returns an empty + * header line and return a strdup-ed copy in 'valp' - returns an empty * string if the header value consists entirely of whitespace. * * If the header is provided as "name;", ending with a semicolon, it returns a @@ -305,7 +301,7 @@ static CURLcode copy_custom_value(const char *header, char **valp) /* * Strip off leading and trailing whitespace from the value in the given HTTP - * header line and return a strdup()ed copy in 'valp' - returns an empty + * header line and return a strdup-ed copy in 'valp' - returns an empty * string if the header value consists entirely of whitespace. * * This function MUST be used after the header has already been confirmed to @@ -377,18 +373,18 @@ static CURLcode http_output_basic(struct Curl_easy *data, bool proxy) goto fail; } - free(*userp); + curlx_free(*userp); *userp = curl_maprintf("%sAuthorization: Basic %s\r\n", proxy ? "Proxy-" : "", authorization); - free(authorization); + curlx_free(authorization); if(!*userp) { result = CURLE_OUT_OF_MEMORY; goto fail; } fail: - free(out); + curlx_free(out); return result; } @@ -407,7 +403,7 @@ static CURLcode http_output_bearer(struct Curl_easy *data) CURLcode result = CURLE_OK; userp = &data->state.aptr.userpwd; - free(*userp); + curlx_free(*userp); *userp = curl_maprintf("Authorization: Bearer %s\r\n", data->set.str[STRING_BEARER]); @@ -615,8 +611,8 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) /* In case this is GSS auth, the newurl field is already allocated so we must make sure to free it before allocating a new one. As figured out in bug #2284386 */ - free(data->req.newurl); - data->req.newurl = strdup(data->state.url); /* clone URL */ + curlx_free(data->req.newurl); + data->req.newurl = curlx_strdup(data->state.url); /* clone URL */ if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; } @@ -629,7 +625,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) we did not try HEAD or GET */ if((data->state.httpreq != HTTPREQ_GET) && (data->state.httpreq != HTTPREQ_HEAD)) { - data->req.newurl = strdup(data->state.url); /* clone URL */ + data->req.newurl = curlx_strdup(data->state.url); /* clone URL */ if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authhost.done = TRUE; @@ -916,8 +912,8 @@ static CURLcode auth_spnego(struct Curl_easy *data, curlnegotiate *negstate = proxy ? &conn->proxy_negotiate_state : &conn->http_negotiate_state; if(!result) { - free(data->req.newurl); - data->req.newurl = strdup(data->state.url); + curlx_free(data->req.newurl); + data->req.newurl = curlx_strdup(data->state.url); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authproblem = FALSE; @@ -1291,7 +1287,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, /* the URL could not be parsed for some reason, but since this is FAKE mode, just duplicate the field as-is */ - follow_url = strdup(newurl); + follow_url = curlx_strdup(newurl); if(!follow_url) return CURLE_OUT_OF_MEMORY; } @@ -1316,13 +1312,13 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, uc = curl_url_get(data->state.uh, CURLUPART_PORT, &portnum, CURLU_DEFAULT_PORT); if(uc) { - free(follow_url); + curlx_free(follow_url); return Curl_uc_to_curlcode(uc); } p = portnum; curlx_str_number(&p, &value, 0xffff); port = (int)value; - free(portnum); + curlx_free(portnum); } if(port != data->info.conn_remote_port) { infof(data, "Clear auth, redirects to port from %u to %u", @@ -1334,7 +1330,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, const struct Curl_handler *p; uc = curl_url_get(data->state.uh, CURLUPART_SCHEME, &scheme, 0); if(uc) { - free(follow_url); + curlx_free(follow_url); return Curl_uc_to_curlcode(uc); } @@ -1344,7 +1340,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, data->info.conn_scheme, scheme); clear = TRUE; } - free(scheme); + curlx_free(scheme); } if(clear) { Curl_safefree(data->state.aptr.user); @@ -1917,7 +1913,7 @@ static CURLcode http_useragent(struct Curl_easy *data) with the user-agent string specified, we erase the previously made string here. */ if(Curl_checkheaders(data, STRCONST("User-Agent"))) { - free(data->state.aptr.uagent); + curlx_free(data->state.aptr.uagent); data->state.aptr.uagent = NULL; } return CURLE_OK; @@ -1932,9 +1928,9 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data) if(!data->state.this_is_a_follow) { /* Free to avoid leaking memory on multiple requests */ - free(data->state.first_host); + curlx_free(data->state.first_host); - data->state.first_host = strdup(conn->host.name); + data->state.first_host = curlx_strdup(conn->host.name); if(!data->state.first_host) return CURLE_OUT_OF_MEMORY; @@ -1958,7 +1954,7 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data) return result; if(!*cookiehost) /* ignore empty data */ - free(cookiehost); + curlx_free(cookiehost); else { /* If the host begins with '[', we start searching for the port after the bracket has been closed */ @@ -1977,7 +1973,7 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data) if(colon) *colon = 0; /* The host must not include an embedded port number */ } - free(aptr->cookiehost); + curlx_free(aptr->cookiehost); aptr->cookiehost = cookiehost; } #endif @@ -2086,7 +2082,7 @@ static CURLcode http_target(struct Curl_easy *data, /* target or URL */ result = curlx_dyn_add(r, data->set.str[STRING_TARGET] ? data->set.str[STRING_TARGET] : url); - free(url); + curlx_free(url); if(result) return result; @@ -2142,7 +2138,7 @@ static CURLcode set_post_reader(struct Curl_easy *data, Curl_HttpReq httpreq) /* Convert the form structure into a mime structure, then keep the conversion */ if(!data->state.formp) { - data->state.formp = calloc(1, sizeof(curl_mimepart)); + data->state.formp = curlx_calloc(1, sizeof(curl_mimepart)); if(!data->state.formp) return CURLE_OUT_OF_MEMORY; Curl_mime_cleanpart(data->state.formp); @@ -2547,7 +2543,7 @@ static CURLcode http_range(struct Curl_easy *data, if(((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) && !Curl_checkheaders(data, STRCONST("Range"))) { /* if a line like this was already allocated, free the previous one */ - free(data->state.aptr.rangeline); + curlx_free(data->state.aptr.rangeline); data->state.aptr.rangeline = curl_maprintf("Range: bytes=%s\r\n", data->state.range); if(!data->state.aptr.rangeline) @@ -2557,7 +2553,7 @@ static CURLcode http_range(struct Curl_easy *data, !Curl_checkheaders(data, STRCONST("Content-Range"))) { curl_off_t req_clen = Curl_creader_total_length(data); /* if a line like this was already allocated, free the previous one */ - free(data->state.aptr.rangeline); + curlx_free(data->state.aptr.rangeline); if(data->set.set_resume_from < 0) { /* Upload resume was asked for, but we do not know the size of the @@ -2723,7 +2719,7 @@ static CURLcode http_add_connection_hd(struct Curl_easy *data, return result; result = curlx_dyn_addf(req, "%s%s", sep, value); sep = ", "; - free(value); + curlx_free(value); break; /* leave, having added 1st one */ } } @@ -3000,7 +2996,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) } result = Curl_http_output_auth(data, data->conn, method, httpreq, (pq ? pq : data->state.up.path), FALSE); - free(pq); + curlx_free(pq); } if(result) goto out; @@ -3245,9 +3241,9 @@ static CURLcode http_header_c(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; if(!*contenttype) /* ignore empty data */ - free(contenttype); + curlx_free(contenttype); else { - free(data->info.contenttype); + curlx_free(data->info.contenttype); data->info.contenttype = contenttype; } return CURLE_OK; @@ -3333,14 +3329,14 @@ static CURLcode http_header_l(struct Curl_easy *data, if(!*location || (data->req.location && !strcmp(data->req.location, location))) { /* ignore empty header, or exact repeat of a previous one */ - free(location); + curlx_free(location); return CURLE_OK; } else { /* has value and is not an exact repeat */ if(data->req.location) { failf(data, "Multiple Location headers"); - free(location); + curlx_free(location); return CURLE_WEIRD_SERVER_REPLY; } data->req.location = location; @@ -3349,7 +3345,7 @@ static CURLcode http_header_l(struct Curl_easy *data, data->set.http_follow_mode) { CURLcode result; DEBUGASSERT(!data->req.newurl); - data->req.newurl = strdup(data->req.location); /* clone */ + data->req.newurl = curlx_strdup(data->req.location); /* clone */ if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; @@ -3407,7 +3403,7 @@ static CURLcode http_header_p(struct Curl_easy *data, CURLcode result = auth ? CURLE_OK : CURLE_OUT_OF_MEMORY; if(!result) { result = Curl_http_input_auth(data, TRUE, auth); - free(auth); + curlx_free(auth); } return result; } @@ -3426,7 +3422,7 @@ static CURLcode http_header_p(struct Curl_easy *data, negdata->havenoauthpersist = TRUE; infof(data, "Negotiate: noauthpersist -> %d, header part: %s", negdata->noauthpersist, persistentauth); - free(persistentauth); + curlx_free(persistentauth); } } #endif @@ -3587,7 +3583,7 @@ static CURLcode http_header_w(struct Curl_easy *data, result = CURLE_OUT_OF_MEMORY; else { result = Curl_http_input_auth(data, FALSE, auth); - free(auth); + curlx_free(auth); } } return result; @@ -4065,7 +4061,7 @@ static CURLcode http_on_response(struct Curl_easy *data, data->state.disableexpect = TRUE; Curl_req_abort_sending(data); DEBUGASSERT(!data->req.newurl); - data->req.newurl = strdup(data->state.url); + data->req.newurl = curlx_strdup(data->state.url); if(!data->req.newurl) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -4533,7 +4529,7 @@ CURLcode Curl_http_req_make(struct httpreq **preq, DEBUGASSERT(method && m_len); - req = calloc(1, sizeof(*req) + m_len); + req = curlx_calloc(1, sizeof(*req) + m_len); if(!req) goto out; #if defined(__GNUC__) && __GNUC__ >= 13 @@ -4606,8 +4602,8 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) } req->authority = curlx_dyn_ptr(&buf); out: - free(host); - free(port); + curlx_free(host); + curlx_free(port); if(result) curlx_dyn_free(&buf); return result; @@ -4645,8 +4641,8 @@ static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url) result = CURLE_OK; out: - free(path); - free(query); + curlx_free(path); + curlx_free(query); if(result) curlx_dyn_free(&buf); return result; @@ -4662,7 +4658,7 @@ CURLcode Curl_http_req_make2(struct httpreq **preq, DEBUGASSERT(method && m_len); - req = calloc(1, sizeof(*req) + m_len); + req = curlx_calloc(1, sizeof(*req) + m_len); if(!req) goto out; memcpy(req->method, method, m_len); @@ -4671,7 +4667,7 @@ CURLcode Curl_http_req_make2(struct httpreq **preq, if(uc && uc != CURLUE_NO_SCHEME) goto out; if(!req->scheme && scheme_default) { - req->scheme = strdup(scheme_default); + req->scheme = curlx_strdup(scheme_default); if(!req->scheme) goto out; } @@ -4697,12 +4693,12 @@ CURLcode Curl_http_req_make2(struct httpreq **preq, void Curl_http_req_free(struct httpreq *req) { if(req) { - free(req->scheme); - free(req->authority); - free(req->path); + curlx_free(req->scheme); + curlx_free(req->authority); + curlx_free(req->path); Curl_dynhds_free(&req->headers); Curl_dynhds_free(&req->trailers); - free(req); + curlx_free(req); } } @@ -4840,13 +4836,13 @@ CURLcode Curl_http_resp_make(struct http_resp **presp, struct http_resp *resp; CURLcode result = CURLE_OUT_OF_MEMORY; - resp = calloc(1, sizeof(*resp)); + resp = curlx_calloc(1, sizeof(*resp)); if(!resp) goto out; resp->status = status; if(description) { - resp->description = strdup(description); + resp->description = curlx_strdup(description); if(!resp->description) goto out; } @@ -4864,12 +4860,12 @@ CURLcode Curl_http_resp_make(struct http_resp **presp, void Curl_http_resp_free(struct http_resp *resp) { if(resp) { - free(resp->description); + curlx_free(resp->description); Curl_dynhds_free(&resp->headers); Curl_dynhds_free(&resp->trailers); if(resp->prev) Curl_http_resp_free(resp->prev); - free(resp); + curlx_free(resp); } } diff --git a/lib/http1.c b/lib/http1.c index b1d80976360a..0a80fedfc722 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -32,10 +32,6 @@ #include "http1.h" #include "urlapi-int.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define H1_MAX_URL_LEN (8*1024) diff --git a/lib/http2.c b/lib/http2.c index 2e8649c10502..baaefd439d4f 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -48,10 +48,6 @@ #include "curlx/warnless.h" #include "headers.h" -/* The last 3 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if (NGHTTP2_VERSION_NUM < 0x010c00) #error too old nghttp2 version, upgrade! #endif @@ -168,7 +164,7 @@ static void cf_h2_ctx_free(struct cf_h2_ctx *ctx) Curl_uint32_hash_destroy(&ctx->streams); memset(ctx, 0, sizeof(*ctx)); } - free(ctx); + curlx_free(ctx); } static void cf_h2_ctx_close(struct cf_h2_ctx *ctx) @@ -276,7 +272,7 @@ static struct h2_stream_ctx *h2_stream_ctx_create(struct cf_h2_ctx *ctx) struct h2_stream_ctx *stream; (void)ctx; - stream = calloc(1, sizeof(*stream)); + stream = curlx_calloc(1, sizeof(*stream)); if(!stream) return NULL; @@ -299,7 +295,7 @@ static void free_push_headers(struct h2_stream_ctx *stream) { size_t i; for(i = 0; i < stream->push_headers_used; i++) - free(stream->push_headers[i]); + curlx_free(stream->push_headers[i]); Curl_safefree(stream->push_headers); stream->push_headers_used = 0; } @@ -310,7 +306,7 @@ static void h2_stream_ctx_free(struct h2_stream_ctx *stream) Curl_h1_req_parse_free(&stream->h1); Curl_dynhds_free(&stream->resp_trailers); free_push_headers(stream); - free(stream); + curlx_free(stream); } static void h2_stream_hash_free(unsigned int id, void *stream) @@ -952,7 +948,7 @@ static int set_transfer_url(struct Curl_easy *data, return rc; if(data->state.url_alloc) - free(data->state.url); + curlx_free(data->state.url); data->state.url_alloc = TRUE; data->state.url = url; return 0; @@ -1642,15 +1638,15 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, stream_id, NGHTTP2_PROTOCOL_ERROR); rc = NGHTTP2_ERR_CALLBACK_FAILURE; } - free(check); + curlx_free(check); if(rc) return rc; } if(!stream->push_headers) { stream->push_headers_alloc = 10; - stream->push_headers = malloc(stream->push_headers_alloc * - sizeof(char *)); + stream->push_headers = curlx_malloc(stream->push_headers_alloc * + sizeof(char *)); if(!stream->push_headers) return NGHTTP2_ERR_CALLBACK_FAILURE; stream->push_headers_used = 0; @@ -1665,8 +1661,8 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, return NGHTTP2_ERR_CALLBACK_FAILURE; } stream->push_headers_alloc *= 2; - headp = realloc(stream->push_headers, - stream->push_headers_alloc * sizeof(char *)); + headp = curlx_realloc(stream->push_headers, + stream->push_headers_alloc * sizeof(char *)); if(!headp) { free_push_headers(stream); return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -1859,7 +1855,7 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req, "Upgrade: %s\r\n" "HTTP2-Settings: %s\r\n", NGHTTP2_CLEARTEXT_PROTO_VERSION_ID, base64); - free(base64); + curlx_free(base64); k->upgr101 = UPGR101_H2; data->conn->bits.upgrade_in_progress = TRUE; @@ -2881,7 +2877,7 @@ static CURLcode http2_cfilter_add(struct Curl_cfilter **pcf, CURLcode result = CURLE_OUT_OF_MEMORY; DEBUGASSERT(data->conn); - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) goto out; cf_h2_ctx_init(ctx, via_h1_upgrade); @@ -2909,7 +2905,7 @@ static CURLcode http2_cfilter_insert_after(struct Curl_cfilter *cf, CURLcode result = CURLE_OUT_OF_MEMORY; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) goto out; cf_h2_ctx_init(ctx, via_h1_upgrade); diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index d3d4760be780..0ef18b6feabe 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -39,10 +39,6 @@ #include -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #include "slist.h" #define HMAC_SHA256(k, kl, d, dl, o) \ @@ -210,12 +206,12 @@ static CURLcode merge_duplicate_headers(struct curl_slist *head) if(result) return result; - free(curr->data); + curlx_free(curr->data); curr->data = curlx_dyn_ptr(&buf); curr->next = next->next; - free(next->data); - free(next); + curlx_free(next->data); + curlx_free(next); } else { curr = curr->next; @@ -269,7 +265,7 @@ static CURLcode make_headers(struct Curl_easy *data, if(fullhost) head = Curl_slist_append_nodup(NULL, fullhost); if(!head) { - free(fullhost); + curlx_free(fullhost); goto fail; } } @@ -307,13 +303,13 @@ static CURLcode make_headers(struct Curl_easy *data, ; if(!*ptr && ptr != sep + 1) /* a value of whitespace only */ continue; - dupdata = strdup(l->data); + dupdata = curlx_strdup(l->data); if(!dupdata) goto fail; dupdata[sep - l->data] = ':'; tmp_head = Curl_slist_append_nodup(head, dupdata); if(!tmp_head) { - free(dupdata); + curlx_free(dupdata); goto fail; } head = tmp_head; @@ -964,7 +960,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) Curl_strntoupper(&auth_headers[sizeof("Authorization: ") - 1], curlx_str(&provider0), curlx_strlen(&provider0)); - free(data->state.aptr.userpwd); + curlx_free(data->state.aptr.userpwd); data->state.aptr.userpwd = auth_headers; data->state.authhost.done = TRUE; result = CURLE_OK; @@ -974,12 +970,12 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) curlx_dyn_free(&canonical_path); curlx_dyn_free(&canonical_headers); curlx_dyn_free(&signed_headers); - free(canonical_request); - free(request_type); - free(credential_scope); - free(str_to_sign); - free(secret); - free(date_header); + curlx_free(canonical_request); + curlx_free(request_type); + curlx_free(credential_scope); + curlx_free(str_to_sign); + curlx_free(secret); + curlx_free(date_header); return result; } diff --git a/lib/http_chunks.c b/lib/http_chunks.c index 005d34e7b905..9d0a0b324cdd 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -36,10 +36,6 @@ #include "curlx/strparse.h" #include "curlx/warnless.h" -/* The last #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Chunk format (simplified): * diff --git a/lib/http_digest.c b/lib/http_digest.c index 097c81fd716a..2ca1a12d5daf 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -32,10 +32,6 @@ #include "http_digest.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* Test example headers: WWW-Authenticate: Digest realm="testrealm", nonce="1053604598" @@ -152,20 +148,20 @@ CURLcode Curl_output_digest(struct Curl_easy *data, } } if(!tmp) - path = (unsigned char *)strdup((const char *) uripath); + path = (unsigned char *)curlx_strdup((const char *) uripath); if(!path) return CURLE_OUT_OF_MEMORY; result = Curl_auth_create_digest_http_message(data, userp, passwdp, request, path, digest, &response, &len); - free(path); + curlx_free(path); if(result) return result; *allocuserpwd = curl_maprintf("%sAuthorization: Digest %s\r\n", proxy ? "Proxy-" : "", response); - free(response); + curlx_free(response); if(!*allocuserpwd) return CURLE_OUT_OF_MEMORY; diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index 136cb07641c4..fc80f80fa350 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -34,10 +34,6 @@ #include "vtls/vtls.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static void http_auth_nego_reset(struct connectdata *conn, struct negotiatedata *neg_ctx, @@ -223,16 +219,16 @@ CURLcode Curl_output_negotiate(struct Curl_easy *data, if(proxy) { #ifndef CURL_DISABLE_PROXY - free(data->state.aptr.proxyuserpwd); + curlx_free(data->state.aptr.proxyuserpwd); data->state.aptr.proxyuserpwd = userp; #endif } else { - free(data->state.aptr.userpwd); + curlx_free(data->state.aptr.userpwd); data->state.aptr.userpwd = userp; } - free(base64); + curlx_free(base64); if(!userp) { return CURLE_OUT_OF_MEMORY; diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index 8cb6403fdb8b..2856745c34c4 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -49,10 +49,6 @@ #include "curl_sspi.h" #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - CURLcode Curl_input_ntlm(struct Curl_easy *data, bool proxy, /* if proxy or not */ const char *header) /* rest of the www-authenticate: @@ -208,11 +204,11 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { - free(*allocuserpwd); + curlx_free(*allocuserpwd); *allocuserpwd = curl_maprintf("%sAuthorization: NTLM %s\r\n", proxy ? "Proxy-" : "", base64); - free(base64); + curlx_free(base64); if(!*allocuserpwd) result = CURLE_OUT_OF_MEMORY; } @@ -227,11 +223,11 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { - free(*allocuserpwd); + curlx_free(*allocuserpwd); *allocuserpwd = curl_maprintf("%sAuthorization: NTLM %s\r\n", proxy ? "Proxy-" : "", base64); - free(base64); + curlx_free(base64); if(!*allocuserpwd) result = CURLE_OUT_OF_MEMORY; else { diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 9bde118baff2..21f0cc6211c1 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -44,10 +44,6 @@ #include "vauth/vauth.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static CURLcode dynhds_add_custom(struct Curl_easy *data, bool is_connect, int httpversion, struct dynhds *hds) @@ -270,7 +266,7 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, Curl_http_req_free(req); req = NULL; } - free(authority); + curlx_free(authority); *preq = req; return result; } @@ -386,7 +382,7 @@ static void http_proxy_cf_destroy(struct Curl_cfilter *cf, (void)data; CURL_TRC_CF(data, cf, "destroy"); - free(ctx); + curlx_free(ctx); } static void http_proxy_cf_close(struct Curl_cfilter *cf, @@ -425,7 +421,7 @@ CURLcode Curl_cf_http_proxy_insert_after(struct Curl_cfilter *cf_at, CURLcode result; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -437,7 +433,7 @@ CURLcode Curl_cf_http_proxy_insert_after(struct Curl_cfilter *cf_at, Curl_conn_cf_insert_after(cf_at, cf); out: - free(ctx); + curlx_free(ctx); return result; } diff --git a/lib/httpsrr.c b/lib/httpsrr.c index 0cf5b131bd31..34d081b50264 100644 --- a/lib/httpsrr.c +++ b/lib/httpsrr.c @@ -33,10 +33,6 @@ #include "sendf.h" #include "strdup.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static CURLcode httpsrr_decode_alpn(const uint8_t *cp, size_t len, unsigned char *alpns) { @@ -97,7 +93,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data, case HTTPS_RR_CODE_IPV4: /* addr4 list */ if(!vlen || (vlen & 3)) /* the size must be 4-byte aligned */ return CURLE_BAD_FUNCTION_ARGUMENT; - free(hi->ipv4hints); + curlx_free(hi->ipv4hints); hi->ipv4hints = Curl_memdup(val, vlen); if(!hi->ipv4hints) return CURLE_OUT_OF_MEMORY; @@ -107,7 +103,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data, case HTTPS_RR_CODE_ECH: if(!vlen) return CURLE_BAD_FUNCTION_ARGUMENT; - free(hi->echconfiglist); + curlx_free(hi->echconfiglist); hi->echconfiglist = Curl_memdup(val, vlen); if(!hi->echconfiglist) return CURLE_OUT_OF_MEMORY; @@ -117,7 +113,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data, case HTTPS_RR_CODE_IPV6: /* addr6 list */ if(!vlen || (vlen & 15)) /* the size must be 16-byte aligned */ return CURLE_BAD_FUNCTION_ARGUMENT; - free(hi->ipv6hints); + curlx_free(hi->ipv6hints); hi->ipv6hints = Curl_memdup(val, vlen); if(!hi->ipv6hints) return CURLE_OUT_OF_MEMORY; @@ -189,8 +185,8 @@ CURLcode Curl_httpsrr_from_ares(struct Curl_easy *data, is in ServiceMode */ target = ares_dns_rr_get_str(rr, ARES_RR_HTTPS_TARGET); if(target && target[0]) { - free(hinfo->target); - hinfo->target = strdup(target); + curlx_free(hinfo->target); + hinfo->target = curlx_strdup(target); if(!hinfo->target) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/idn.c b/lib/idn.c index 7e324db6c4b0..1c404f6543f3 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -45,10 +45,6 @@ #endif #endif /* USE_LIBIDN2 */ -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* for macOS and iOS targets */ #ifdef USE_APPLE_IDN #include @@ -108,7 +104,7 @@ static CURLcode mac_idn_to_ascii(const char *in, char **out) buffer, sizeof(buffer) - 1, &info, &err); uidna_close(idna); if(!U_FAILURE(err) && !info.errors) { - *out = strdup(buffer); + *out = curlx_strdup(buffer); if(*out) return CURLE_OK; else @@ -136,7 +132,7 @@ static CURLcode mac_ascii_to_idn(const char *in, char **out) sizeof(buffer) - 1, &info, &err); uidna_close(idna); if(!U_FAILURE(err)) { - *out = strdup(buffer); + *out = curlx_strdup(buffer); if(*out) return CURLE_OK; else @@ -179,7 +175,7 @@ static CURLcode win32_idn_to_ascii(const char *in, char **out) if(chars) { char *mstr = curlx_convert_wchar_to_UTF8(punycode); if(mstr) { - *out = strdup(mstr); + *out = curlx_strdup(mstr); curlx_unicodefree(mstr); if(!*out) return CURLE_OUT_OF_MEMORY; @@ -209,7 +205,7 @@ static CURLcode win32_ascii_to_idn(const char *in, char **output) /* 'chars' is "the number of characters retrieved" */ char *mstr = curlx_convert_wchar_to_UTF8(idn); if(mstr) { - out = strdup(mstr); + out = curlx_strdup(mstr); curlx_unicodefree(mstr); if(!out) return CURLE_OUT_OF_MEMORY; @@ -314,7 +310,7 @@ CURLcode Curl_idn_decode(const char *input, char **output) CURLcode result = idn_decode(input, &d); #ifdef USE_LIBIDN2 if(!result) { - char *c = strdup(d); + char *c = curlx_strdup(d); idn2_free(d); if(c) d = c; @@ -325,7 +321,7 @@ CURLcode Curl_idn_decode(const char *input, char **output) if(!result) { if(!d[0]) { /* ended up zero length, not acceptable */ result = CURLE_URL_MALFORMAT; - free(d); + curlx_free(d); } else *output = d; @@ -339,7 +335,7 @@ CURLcode Curl_idn_encode(const char *puny, char **output) CURLcode result = idn_encode(puny, &d); #ifdef USE_LIBIDN2 if(!result) { - char *c = strdup(d); + char *c = curlx_strdup(d); idn2_free(d); if(c) d = c; diff --git a/lib/if2ip.c b/lib/if2ip.c index 79b0599106de..c2b8aafc4d7e 100644 --- a/lib/if2ip.c +++ b/lib/if2ip.c @@ -55,10 +55,6 @@ #include "curlx/inet_ntop.h" #include "if2ip.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* ------------------------------------------------------------------ */ #ifdef USE_IPV6 diff --git a/lib/imap.c b/lib/imap.c index af9b124d1e72..d093e46d33ab 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -78,10 +78,6 @@ #include "curlx/warnless.h" #include "curl_ctype.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* meta key for storing protocol meta at easy handle */ #define CURL_META_IMAP_EASY "meta:proto:imap:easy" @@ -617,8 +613,8 @@ static CURLcode imap_perform_login(struct Curl_easy *data, result = imap_sendf(data, imapc, "LOGIN %s %s", user ? user : "", passwd ? passwd : ""); - free(user); - free(passwd); + curlx_free(user); + curlx_free(passwd); if(!result) imap_state(data, imapc, IMAP_LOGIN); @@ -751,14 +747,14 @@ static CURLcode imap_perform_list(struct Curl_easy *data, else { /* Make sure the mailbox is in the correct atom format if necessary */ char *mailbox = imap->mailbox ? imap_atom(imap->mailbox, TRUE) - : strdup(""); + : curlx_strdup(""); if(!mailbox) return CURLE_OUT_OF_MEMORY; /* Send the LIST command */ result = imap_sendf(data, imapc, "LIST \"%s\" *", mailbox); - free(mailbox); + curlx_free(mailbox); } if(!result) @@ -797,7 +793,7 @@ static CURLcode imap_perform_select(struct Curl_easy *data, /* Send the SELECT command */ result = imap_sendf(data, imapc, "SELECT %s", mailbox); - free(mailbox); + curlx_free(mailbox); if(!result) imap_state(data, imapc, IMAP_SELECT); @@ -947,7 +943,7 @@ static CURLcode imap_perform_append(struct Curl_easy *data, cleanup: curlx_dyn_free(&flags); - free(mailbox); + curlx_free(mailbox); if(!result) imap_state(data, imapc, IMAP_APPEND); @@ -1338,7 +1334,7 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, else { /* Note the currently opened mailbox on this connection */ DEBUGASSERT(!imapc->mailbox); - imapc->mailbox = strdup(imap->mailbox); + imapc->mailbox = curlx_strdup(imap->mailbox); if(!imapc->mailbox) return CURLE_OUT_OF_MEMORY; @@ -1967,7 +1963,7 @@ static void imap_easy_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; imap_easy_reset(imap); - free(imap); + curlx_free(imap); } static void imap_conn_dtor(void *key, size_t klen, void *entry) @@ -1978,7 +1974,7 @@ static void imap_conn_dtor(void *key, size_t klen, void *entry) Curl_pp_disconnect(&imapc->pp); curlx_dyn_free(&imapc->dyn); Curl_safefree(imapc->mailbox); - free(imapc); + curlx_free(imapc); } static CURLcode imap_setup_connection(struct Curl_easy *data, @@ -1988,7 +1984,7 @@ static CURLcode imap_setup_connection(struct Curl_easy *data, struct pingpong *pp; struct IMAP *imap; - imapc = calloc(1, sizeof(*imapc)); + imapc = curlx_calloc(1, sizeof(*imapc)); if(!imapc) return CURLE_OUT_OF_MEMORY; @@ -2005,7 +2001,7 @@ static CURLcode imap_setup_connection(struct Curl_easy *data, if(Curl_conn_meta_set(conn, CURL_META_IMAP_CONN, imapc, imap_conn_dtor)) return CURLE_OUT_OF_MEMORY; - imap = calloc(1, sizeof(struct IMAP)); + imap = curlx_calloc(1, sizeof(struct IMAP)); if(!imap || Curl_meta_set(data, CURL_META_IMAP_EASY, imap, imap_easy_dtor)) return CURLE_OUT_OF_MEMORY; @@ -2078,7 +2074,7 @@ static char *imap_atom(const char *str, bool escape_only) nclean = strcspn(str, "() {%*]\\\""); if(len == nclean) /* nothing to escape, return a strdup */ - return strdup(str); + return curlx_strdup(str); curlx_dyn_init(&line, 2000); @@ -2258,7 +2254,7 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data, result = Curl_urldecode(begin, ptr - begin, &value, &valuelen, REJECT_CTRL); if(result) { - free(name); + curlx_free(name); return result; } @@ -2279,7 +2275,7 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data, imap->uidvalidity = (unsigned int)num; imap->uidvalidity_set = TRUE; } - free(value); + curlx_free(value); } else if(curl_strequal(name, "UID") && !imap->uid) { imap->uid = value; @@ -2294,15 +2290,15 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data, imap->partial = value; } else { - free(name); - free(value); + curlx_free(name); + curlx_free(value); return CURLE_URL_MALFORMAT; } } else /* blank? */ - free(value); - free(name); + curlx_free(value); + curlx_free(name); } /* Does the URL contain a query parameter? Only valid when we have a mailbox @@ -2346,7 +2342,7 @@ static CURLcode imap_parse_custom_request(struct Curl_easy *data, params++; if(*params) { - imap->custom_params = strdup(params); + imap->custom_params = curlx_strdup(params); imap->custom[params - imap->custom] = '\0'; if(!imap->custom_params) diff --git a/lib/ldap.c b/lib/ldap.c index 7f2af3664325..6c6207038571 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -94,10 +94,6 @@ #include "curlx/base64.h" #include "connect.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef USE_WIN32_LDAP #define FREE_ON_WINLDAP(x) curlx_unicodefree(x) #define curl_ldap_num_t ULONG @@ -642,7 +638,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) if(val_b64_sz > 0) { result = Curl_client_write(data, CLIENTWRITE_BODY, val_b64, val_b64_sz); - free(val_b64); + curlx_free(val_b64); if(result) { ldap_value_free_len(vals); FREE_ON_WINLDAP(attr); @@ -809,15 +805,15 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, ludp->lud_host = conn->host.name; /* Duplicate the path */ - p = path = strdup(data->state.up.path + 1); + p = path = curlx_strdup(data->state.up.path + 1); if(!path) return LDAP_NO_MEMORY; /* Duplicate the query if present */ if(data->state.up.query) { - q = query = strdup(data->state.up.query); + q = query = curlx_strdup(data->state.up.query); if(!query) { - free(path); + curlx_free(path); return LDAP_NO_MEMORY; } } @@ -843,7 +839,7 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, ludp->lud_dn = curlx_convert_UTF8_to_tchar(unescaped); /* Free the unescaped string as we are done with it */ - free(unescaped); + curlx_free(unescaped); if(!ludp->lud_dn) { rc = LDAP_NO_MEMORY; @@ -870,9 +866,9 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, /* Allocate our array (+1 for the NULL entry) */ #ifdef USE_WIN32_LDAP - ludp->lud_attrs = calloc(count + 1, sizeof(TCHAR *)); + ludp->lud_attrs = curlx_calloc(count + 1, sizeof(TCHAR *)); #else - ludp->lud_attrs = calloc(count + 1, sizeof(char *)); + ludp->lud_attrs = curlx_calloc(count + 1, sizeof(char *)); #endif if(!ludp->lud_attrs) { rc = LDAP_NO_MEMORY; @@ -902,7 +898,7 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, ludp->lud_attrs[i] = curlx_convert_UTF8_to_tchar(unescaped); /* Free the unescaped string as we are done with it */ - free(unescaped); + curlx_free(unescaped); if(!ludp->lud_attrs[i]) { rc = LDAP_NO_MEMORY; @@ -966,7 +962,7 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, ludp->lud_filter = curlx_convert_UTF8_to_tchar(unescaped); /* Free the unescaped string as we are done with it */ - free(unescaped); + curlx_free(unescaped); if(!ludp->lud_filter) { rc = LDAP_NO_MEMORY; @@ -986,8 +982,8 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, } quit: - free(path); - free(query); + curlx_free(path); + curlx_free(query); return rc; } @@ -996,7 +992,7 @@ static curl_ldap_num_t ldap_url_parse_low(struct Curl_easy *data, const struct connectdata *conn, LDAPURLDesc **ludpp) { - LDAPURLDesc *ludp = calloc(1, sizeof(*ludp)); + LDAPURLDesc *ludp = curlx_calloc(1, sizeof(*ludp)); curl_ldap_num_t rc; *ludpp = NULL; @@ -1021,8 +1017,8 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp) curlx_unicodefree(ludp->lud_dn); curlx_unicodefree(ludp->lud_filter); #else - free(ludp->lud_dn); - free(ludp->lud_filter); + curlx_free(ludp->lud_dn); + curlx_free(ludp->lud_filter); #endif if(ludp->lud_attrs) { @@ -1031,13 +1027,13 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp) #ifdef USE_WIN32_LDAP curlx_unicodefree(ludp->lud_attrs[i]); #else - free(ludp->lud_attrs[i]); + curlx_free(ludp->lud_attrs[i]); #endif } - free(ludp->lud_attrs); + curlx_free(ludp->lud_attrs); } - free(ludp); + curlx_free(ludp); } #endif /* !HAVE_LDAP_URL_PARSE */ diff --git a/lib/llist.c b/lib/llist.c index c9a7d4a8a789..ebcda82a04ed 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -27,10 +27,6 @@ #include #include "llist.h" -#include "curl_memory.h" - -/* this must be the last include file */ -#include "memdebug.h" #ifdef DEBUGBUILD #define LLISTINIT 0x100cc001 /* random pattern */ diff --git a/lib/md4.c b/lib/md4.c index 0cc62f815233..7929e57f65c0 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -71,10 +71,6 @@ #include #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4) diff --git a/lib/md5.c b/lib/md5.c index 4b38bb070b32..a579b02c63ae 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -81,10 +81,6 @@ #include #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef USE_GNUTLS typedef struct md5_ctx my_md5_ctx; @@ -604,23 +600,23 @@ struct MD5_context *Curl_MD5_init(const struct MD5_params *md5params) struct MD5_context *ctxt; /* Create MD5 context */ - ctxt = malloc(sizeof(*ctxt)); + ctxt = curlx_malloc(sizeof(*ctxt)); if(!ctxt) return ctxt; - ctxt->md5_hashctx = malloc(md5params->md5_ctxtsize); + ctxt->md5_hashctx = curlx_malloc(md5params->md5_ctxtsize); if(!ctxt->md5_hashctx) { - free(ctxt); + curlx_free(ctxt); return NULL; } ctxt->md5_hash = md5params; if((*md5params->md5_init_func)(ctxt->md5_hashctx)) { - free(ctxt->md5_hashctx); - free(ctxt); + curlx_free(ctxt->md5_hashctx); + curlx_free(ctxt); return NULL; } @@ -640,8 +636,8 @@ CURLcode Curl_MD5_final(struct MD5_context *context, unsigned char *result) { (*context->md5_hash->md5_final_func)(result, context->md5_hashctx); - free(context->md5_hashctx); - free(context); + curlx_free(context->md5_hashctx); + curlx_free(context); return CURLE_OK; } diff --git a/lib/memdebug.c b/lib/memdebug.c index 1121dc26f550..f5b88731ee35 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -35,10 +35,6 @@ #include "backtrace.h" #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - struct memdebug { size_t size; union { diff --git a/lib/memdebug.h b/lib/memdebug.h deleted file mode 100644 index c2b7fad9528b..000000000000 --- a/lib/memdebug.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef HEADER_CURL_MEMDEBUG_H -#define HEADER_CURL_MEMDEBUG_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ - -/* - * CAUTION: this header is designed to work when included by the app-side - * as well as the library. Do not mix with library internals! - */ - -#ifdef CURLDEBUG - -/* Set this symbol on the command-line, recompile all lib-sources */ -#undef strdup -#define strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__) -#undef malloc -#define malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__) -#undef calloc -#define calloc(nbelem,size) curl_dbg_calloc(nbelem, size, __LINE__, __FILE__) -#undef realloc -#define realloc(ptr,size) curl_dbg_realloc(ptr, size, __LINE__, __FILE__) -#undef free -#define free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__) - -#ifdef _WIN32 -#undef Curl_tcsdup -#ifdef UNICODE -#define Curl_tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) -#else -#define Curl_tcsdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__) -#endif -#endif /* _WIN32 */ - -#endif /* CURLDEBUG */ -#endif /* HEADER_CURL_MEMDEBUG_H */ diff --git a/lib/mime.c b/lib/mime.c index b1f432c0b044..7ebe47315de9 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -50,10 +50,6 @@ struct Curl_easy; #include "slist.h" #include "curlx/dynbuf.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef _WIN32 # ifndef R_OK # define R_OK 4 @@ -357,13 +353,13 @@ static char *strippath(const char *fullfile) { char *filename; char *base; - filename = strdup(fullfile); /* duplicate since basename() may ruin the - buffer it works on */ + filename = curlx_strdup(fullfile); /* duplicate since basename() may ruin + the buffer it works on */ if(!filename) return NULL; - base = strdup(basename(filename)); + base = curlx_strdup(basename(filename)); - free(filename); /* free temporary buffer */ + curlx_free(filename); /* free temporary buffer */ return base; /* returns an allocated string or NULL ! */ } @@ -1190,9 +1186,9 @@ void curl_mime_free(curl_mime *mime) part = mime->firstpart; mime->firstpart = part->nextpart; Curl_mime_cleanpart(part); - free(part); + curlx_free(part); } - free(mime); + curlx_free(mime); } } @@ -1282,7 +1278,7 @@ curl_mime *curl_mime_init(void *easy) { curl_mime *mime; - mime = (curl_mime *) malloc(sizeof(*mime)); + mime = (curl_mime *)curlx_malloc(sizeof(*mime)); if(mime) { mime->parent = NULL; @@ -1294,7 +1290,7 @@ curl_mime *curl_mime_init(void *easy) (unsigned char *) &mime->boundary[MIME_BOUNDARY_DASHES], MIME_RAND_BOUNDARY_CHARS + 1)) { /* failed to get random separator, bail out */ - free(mime); + curlx_free(mime); return NULL; } mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL); @@ -1319,7 +1315,7 @@ curl_mimepart *curl_mime_addpart(curl_mime *mime) if(!mime) return NULL; - part = (curl_mimepart *) malloc(sizeof(*part)); + part = (curl_mimepart *)curlx_malloc(sizeof(*part)); if(part) { Curl_mime_initpart(part); @@ -1345,7 +1341,7 @@ CURLcode curl_mime_name(curl_mimepart *part, const char *name) Curl_safefree(part->name); if(name) { - part->name = strdup(name); + part->name = curlx_strdup(name); if(!part->name) return CURLE_OUT_OF_MEMORY; } @@ -1362,7 +1358,7 @@ CURLcode curl_mime_filename(curl_mimepart *part, const char *filename) Curl_safefree(part->filename); if(filename) { - part->filename = strdup(filename); + part->filename = curlx_strdup(filename); if(!part->filename) return CURLE_OUT_OF_MEMORY; } @@ -1415,7 +1411,7 @@ CURLcode curl_mime_filedata(curl_mimepart *part, const char *filename) if(curlx_stat(filename, &sbuf)) result = CURLE_READ_ERROR; else { - part->data = strdup(filename); + part->data = curlx_strdup(filename); if(!part->data) result = CURLE_OUT_OF_MEMORY; else { @@ -1438,7 +1434,7 @@ CURLcode curl_mime_filedata(curl_mimepart *part, const char *filename) result = CURLE_OUT_OF_MEMORY; else { result = curl_mime_filename(part, base); - free(base); + curlx_free(base); } } } @@ -1455,7 +1451,7 @@ CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype) Curl_safefree(part->mimetype); if(mimetype) { - part->mimetype = strdup(mimetype); + part->mimetype = curlx_strdup(mimetype); if(!part->mimetype) return CURLE_OUT_OF_MEMORY; } @@ -1696,7 +1692,7 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) if(hdr) *slp = hdr; else - free(s); + curlx_free(s); } return hdr ? CURLE_OK : CURLE_OUT_OF_MEMORY; diff --git a/lib/mprintf.c b/lib/mprintf.c index 176f8a3e4b78..046917aeb5f0 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -27,10 +27,6 @@ #include "curl_printf.h" #include "curlx/strparse.h" -#include "curl_memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - #ifdef HAVE_LONGLONG # define LONG_LONG_TYPE long long # define HAVE_LONG_LONG_TYPE @@ -1177,7 +1173,7 @@ char *curl_mvaprintf(const char *format, va_list ap_save) } if(curlx_dyn_len(info.b)) return curlx_dyn_ptr(info.b); - return strdup(""); + return curlx_strdup(""); } char *curl_maprintf(const char *format, ...) diff --git a/lib/mqtt.c b/lib/mqtt.c index 9cbe800ded8e..a8975d53919b 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -40,10 +40,6 @@ #include "multiif.h" #include "rand.h" -/* The last 2 #includes file should be: */ -#include "curl_memory.h" -#include "memdebug.h" - /* first byte is command. second byte is for flags. */ #define MQTT_MSG_CONNECT 0x10 @@ -146,14 +142,14 @@ static void mqtt_easy_dtor(void *key, size_t klen, void *entry) (void)klen; curlx_dyn_free(&mq->sendbuf); curlx_dyn_free(&mq->recvbuf); - free(mq); + curlx_free(mq); } static void mqtt_conn_dtor(void *key, size_t klen, void *entry) { (void)key; (void)klen; - free(entry); + curlx_free(entry); } static CURLcode mqtt_setup_conn(struct Curl_easy *data, @@ -163,12 +159,12 @@ static CURLcode mqtt_setup_conn(struct Curl_easy *data, struct mqtt_conn *mqtt; struct MQTT *mq; - mqtt = calloc(1, sizeof(*mqtt)); + mqtt = curlx_calloc(1, sizeof(*mqtt)); if(!mqtt || Curl_conn_meta_set(conn, CURL_META_MQTT_CONN, mqtt, mqtt_conn_dtor)) return CURLE_OUT_OF_MEMORY; - mq = calloc(1, sizeof(struct MQTT)); + mq = curlx_calloc(1, sizeof(struct MQTT)); if(!mq) return CURLE_OUT_OF_MEMORY; curlx_dyn_init(&mq->recvbuf, DYN_MQTT_RECV); @@ -350,7 +346,7 @@ static CURLcode mqtt_connect(struct Curl_easy *data) /* allocating packet */ if(packetlen > 0xFFFFFFF) return CURLE_WEIRD_SERVER_REPLY; - packet = calloc(1, packetlen); + packet = curlx_calloc(1, packetlen); if(!packet) return CURLE_OUT_OF_MEMORY; @@ -400,7 +396,7 @@ static CURLcode mqtt_connect(struct Curl_easy *data) end: if(packet) - free(packet); + curlx_free(packet); Curl_safefree(data->state.aptr.user); Curl_safefree(data->state.aptr.passwd); return result; @@ -524,7 +520,7 @@ static CURLcode mqtt_subscribe(struct Curl_easy *data) n = mqtt_encode_len((char *)encodedsize, packetlen); packetlen += n + 1; /* add one for the control packet type byte */ - packet = malloc(packetlen); + packet = curlx_malloc(packetlen); if(!packet) { result = CURLE_OUT_OF_MEMORY; goto fail; @@ -542,8 +538,8 @@ static CURLcode mqtt_subscribe(struct Curl_easy *data) result = mqtt_send(data, (const char *)packet, packetlen); fail: - free(topic); - free(packet); + curlx_free(topic); + curlx_free(packet); return result; } @@ -620,7 +616,7 @@ static CURLcode mqtt_publish(struct Curl_easy *data) } /* add the control byte and the encoded remaining length */ - pkt = malloc(remaininglength + 1 + encodelen); + pkt = curlx_malloc(remaininglength + 1 + encodelen); if(!pkt) { result = CURLE_OUT_OF_MEMORY; goto fail; @@ -639,8 +635,8 @@ static CURLcode mqtt_publish(struct Curl_easy *data) result = mqtt_send(data, (const char *)pkt, i); fail: - free(pkt); - free(topic); + curlx_free(pkt); + curlx_free(topic); return result; } diff --git a/lib/multi.c b/lib/multi.c index f7265a94a9ec..c5b78f53e446 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -54,10 +54,6 @@ #include "socks.h" #include "urlapi-int.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* initial multi->xfers table size for a full multi */ #define CURL_XFER_TABLE_SIZE 512 @@ -235,7 +231,7 @@ struct Curl_multi *Curl_multi_handle(uint32_t xfer_table_size, size_t dnssize, /* dns hash */ size_t sesssize) /* TLS session cache */ { - struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi)); + struct Curl_multi *multi = curlx_calloc(1, sizeof(struct Curl_multi)); if(!multi) return NULL; @@ -328,7 +324,7 @@ struct Curl_multi *Curl_multi_handle(uint32_t xfer_table_size, Curl_uint32_bset_destroy(&multi->msgsent); Curl_uint32_tbl_destroy(&multi->xfers); - free(multi); + curlx_free(multi); return NULL; } @@ -2022,7 +2018,7 @@ static CURLMcode state_performing(struct Curl_easy *data, data->state.errorbuf = FALSE; if(!newurl) /* typically for HTTP_1_1_REQUIRED error on first flight */ - newurl = strdup(data->state.url); + newurl = curlx_strdup(data->state.url); if(!newurl) { result = CURLE_OUT_OF_MEMORY; } @@ -2068,7 +2064,7 @@ static CURLMcode state_performing(struct Curl_easy *data, if(!retry) { /* if the URL is a follow-location and not just a retried request then figure out the URL here */ - free(newurl); + curlx_free(newurl); newurl = data->req.newurl; data->req.newurl = NULL; follow = FOLLOW_REDIR; @@ -2089,7 +2085,7 @@ static CURLMcode state_performing(struct Curl_easy *data, /* but first check to see if we got a location info even though we are not following redirects */ if(data->req.location) { - free(newurl); + curlx_free(newurl); newurl = data->req.location; data->req.location = NULL; result = multi_follow(data, handler, newurl, FOLLOW_FAKE); @@ -2109,7 +2105,7 @@ static CURLMcode state_performing(struct Curl_easy *data, *nowp = curlx_now(); mspeed_check(data, *nowp); } - free(newurl); + curlx_free(newurl); *resultp = result; return rc; } @@ -2237,7 +2233,7 @@ static CURLMcode state_do(struct Curl_easy *data, /* Have error handler disconnect conn if we cannot retry */ *stream_errorp = TRUE; } - free(newurl); + curlx_free(newurl); } else { /* failure detected */ @@ -2976,7 +2972,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) Curl_uint32_bset_destroy(&multi->pending); Curl_uint32_bset_destroy(&multi->msgsent); Curl_uint32_tbl_destroy(&multi->xfers); - free(multi); + curlx_free(multi); return CURLM_OK; } @@ -3814,7 +3810,7 @@ CURL **curl_multi_get_handles(CURLM *m) struct Curl_multi *multi = m; void *entry; unsigned int count = Curl_uint32_tbl_count(&multi->xfers); - CURL **a = malloc(sizeof(struct Curl_easy *) * (count + 1)); + CURL **a = curlx_malloc(sizeof(struct Curl_easy *) * (count + 1)); if(a) { unsigned int i = 0, mid; @@ -3895,13 +3891,13 @@ CURLcode Curl_multi_xfer_buf_borrow(struct Curl_easy *data, if(data->multi->xfer_buf && data->set.buffer_size > data->multi->xfer_buf_len) { /* not large enough, get a new one */ - free(data->multi->xfer_buf); + curlx_free(data->multi->xfer_buf); data->multi->xfer_buf = NULL; data->multi->xfer_buf_len = 0; } if(!data->multi->xfer_buf) { - data->multi->xfer_buf = malloc(curlx_uitouz(data->set.buffer_size)); + data->multi->xfer_buf = curlx_malloc(curlx_uitouz(data->set.buffer_size)); if(!data->multi->xfer_buf) { failf(data, "could not allocate xfer_buf of %u bytes", data->set.buffer_size); @@ -3948,14 +3944,14 @@ CURLcode Curl_multi_xfer_ulbuf_borrow(struct Curl_easy *data, if(data->multi->xfer_ulbuf && data->set.upload_buffer_size > data->multi->xfer_ulbuf_len) { /* not large enough, get a new one */ - free(data->multi->xfer_ulbuf); + curlx_free(data->multi->xfer_ulbuf); data->multi->xfer_ulbuf = NULL; data->multi->xfer_ulbuf_len = 0; } if(!data->multi->xfer_ulbuf) { data->multi->xfer_ulbuf = - malloc(curlx_uitouz(data->set.upload_buffer_size)); + curlx_malloc(curlx_uitouz(data->set.upload_buffer_size)); if(!data->multi->xfer_ulbuf) { failf(data, "could not allocate xfer_ulbuf of %u bytes", data->set.upload_buffer_size); @@ -3996,13 +3992,13 @@ CURLcode Curl_multi_xfer_sockbuf_borrow(struct Curl_easy *data, if(data->multi->xfer_sockbuf && blen > data->multi->xfer_sockbuf_len) { /* not large enough, get a new one */ - free(data->multi->xfer_sockbuf); + curlx_free(data->multi->xfer_sockbuf); data->multi->xfer_sockbuf = NULL; data->multi->xfer_sockbuf_len = 0; } if(!data->multi->xfer_sockbuf) { - data->multi->xfer_sockbuf = malloc(blen); + data->multi->xfer_sockbuf = curlx_malloc(blen); if(!data->multi->xfer_sockbuf) { failf(data, "could not allocate xfer_sockbuf of %zu bytes", blen); return CURLE_OUT_OF_MEMORY; diff --git a/lib/multi_ev.c b/lib/multi_ev.c index d5db331cf1f1..026cbd29968e 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -41,10 +41,6 @@ #include "multihandle.h" #include "socks.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static void mev_in_callback(struct Curl_multi *multi, bool value) { @@ -85,7 +81,7 @@ static void mev_sh_entry_dtor(void *freethis) { struct mev_sh_entry *entry = (struct mev_sh_entry *)freethis; Curl_uint32_spbset_destroy(&entry->xfers); - free(entry); + curlx_free(entry); } /* look up a given socket in the socket hash, skip invalid sockets */ @@ -112,7 +108,7 @@ mev_sh_entry_add(struct Curl_hash *sh, curl_socket_t s) } /* not present, add it */ - check = calloc(1, sizeof(struct mev_sh_entry)); + check = curlx_calloc(1, sizeof(struct mev_sh_entry)); if(!check) return NULL; /* major failure */ @@ -446,7 +442,7 @@ static void mev_pollset_dtor(void *key, size_t klen, void *entry) (void)klen; if(ps) { Curl_pollset_cleanup(ps); - free(ps); + curlx_free(ps); } } diff --git a/lib/multi_ntfy.c b/lib/multi_ntfy.c index d7913bbbfc97..43e4db9e8270 100644 --- a/lib/multi_ntfy.c +++ b/lib/multi_ntfy.c @@ -32,11 +32,6 @@ #include "multiif.h" #include "multi_ntfy.h" -/* The last 3 #include files should be in this order */ -#include "curl_printf.h" -#include "curl_memory.h" -#include "memdebug.h" - struct mntfy_entry { uint32_t mid; @@ -54,12 +49,12 @@ struct mntfy_chunk { static struct mntfy_chunk *mnfty_chunk_create(void) { - return calloc(1, sizeof(struct mntfy_chunk)); + return curlx_calloc(1, sizeof(struct mntfy_chunk)); } static void mnfty_chunk_destroy(struct mntfy_chunk *chunk) { - free(chunk); + curlx_free(chunk); } static void mnfty_chunk_reset(struct mntfy_chunk *chunk) diff --git a/lib/netrc.c b/lib/netrc.c index 9c5c6c7f20c8..f8de4082972c 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -42,10 +42,6 @@ #include "curlx/fopen.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* Get user and password from .netrc when given a machine name */ enum host_lookup_state { @@ -277,8 +273,8 @@ static NETRCcode parsenetrc(struct store_netrc *store, our_login = !Curl_timestrcmp(login, tok); else { our_login = TRUE; - free(login); - login = strdup(tok); + curlx_free(login); + login = curlx_strdup(tok); if(!login) { retcode = NETRC_OUT_OF_MEMORY; /* allocation failed */ goto out; @@ -288,8 +284,8 @@ static NETRCcode parsenetrc(struct store_netrc *store, keyword = NONE; } else if(keyword == PASSWORD) { - free(password); - password = strdup(tok); + curlx_free(password); + password = curlx_strdup(tok); if(!password) { retcode = NETRC_OUT_OF_MEMORY; /* allocation failed */ goto out; @@ -346,7 +342,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, if(!retcode) { if(!password && our_login) { /* success without a password, set a blank one */ - password = strdup(""); + password = curlx_strdup(""); if(!password) retcode = NETRC_OUT_OF_MEMORY; /* out of memory */ } @@ -364,8 +360,8 @@ static NETRCcode parsenetrc(struct store_netrc *store, curlx_dyn_free(filebuf); store->loaded = FALSE; if(!specific_login) - free(login); - free(password); + curlx_free(login); + curlx_free(password); } return retcode; @@ -444,25 +440,25 @@ NETRCcode Curl_parsenetrc(struct store_netrc *store, const char *host, filealloc = curl_maprintf("%s%s.netrc", home, DIR_CHAR); if(!filealloc) { - free(homea); + curlx_free(homea); return NETRC_OUT_OF_MEMORY; } } retcode = parsenetrc(store, host, loginp, passwordp, filealloc); - free(filealloc); + curlx_free(filealloc); #ifdef _WIN32 if(retcode == NETRC_FILE_MISSING) { /* fallback to the old-style "_netrc" file */ filealloc = curl_maprintf("%s%s_netrc", home, DIR_CHAR); if(!filealloc) { - free(homea); + curlx_free(homea); return NETRC_OUT_OF_MEMORY; } retcode = parsenetrc(store, host, loginp, passwordp, filealloc); - free(filealloc); + curlx_free(filealloc); } #endif - free(homea); + curlx_free(homea); } else retcode = parsenetrc(store, host, loginp, passwordp, netrcfile); diff --git a/lib/openldap.c b/lib/openldap.c index 806ccb33ccd1..107f6da832a5 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -53,10 +53,6 @@ #include "curl_sasl.h" #include "strcase.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Uncommenting this will enable the built-in debug logging of the openldap * library. The debug log level can be set using the CURL_OPENLDAP_TRACE @@ -577,7 +573,7 @@ static void oldap_easy_dtor(void *key, size_t klen, void *entry) struct ldapreqinfo *lr = entry; (void)key; (void)klen; - free(lr); + curlx_free(lr); } static void oldap_conn_dtor(void *key, size_t klen, void *entry) @@ -589,7 +585,7 @@ static void oldap_conn_dtor(void *key, size_t klen, void *entry) ldap_unbind_ext(li->ld, NULL, NULL); li->ld = NULL; } - free(li); + curlx_free(li); } static CURLcode oldap_connect(struct Curl_easy *data, bool *done) @@ -606,7 +602,7 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done) (void)done; - li = calloc(1, sizeof(struct ldapconninfo)); + li = curlx_calloc(1, sizeof(struct ldapconninfo)); if(!li) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -697,7 +693,7 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done) result = oldap_perform_bind(data, OLDAP_BIND); out: - free(hosturl); + curlx_free(hosturl); return result; } @@ -1023,7 +1019,7 @@ static CURLcode oldap_do(struct Curl_easy *data, bool *done) goto out; } - lr = calloc(1, sizeof(struct ldapreqinfo)); + lr = curlx_calloc(1, sizeof(struct ldapreqinfo)); if(!lr || Curl_meta_set(data, CURL_META_LDAP_EASY, lr, oldap_easy_dtor)) { ldap_abandon_ext(li->ld, msgid, NULL, NULL); @@ -1219,7 +1215,7 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, if(!result) result = client_write(data, STRCONST(": "), val_b64, val_b64_sz, STRCONST("\n")); - free(val_b64); + curlx_free(val_b64); } else result = client_write(data, STRCONST(" "), diff --git a/lib/pingpong.c b/lib/pingpong.c index 297389043f0e..7ac321af7244 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -37,10 +37,6 @@ #include "multiif.h" #include "vtls/vtls.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef USE_PINGPONG /* Returns timeout in ms. 0 or negative number means the timeout has already diff --git a/lib/pop3.c b/lib/pop3.c index 503f4ecb2bd5..f10108229b6a 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -78,10 +78,6 @@ #include "curlx/warnless.h" #include "strdup.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* Authentication type flags */ #define POP3_TYPE_CLEARTEXT (1 << 0) #define POP3_TYPE_APOP (1 << 1) @@ -1523,7 +1519,7 @@ static void pop3_easy_dtor(void *key, size_t klen, void *entry) /* Cleanup our per-request based variables */ Curl_safefree(pop3->id); Curl_safefree(pop3->custom); - free(pop3); + curlx_free(pop3); } static void pop3_conn_dtor(void *key, size_t klen, void *entry) @@ -1534,19 +1530,19 @@ static void pop3_conn_dtor(void *key, size_t klen, void *entry) DEBUGASSERT(pop3c); Curl_pp_disconnect(&pop3c->pp); Curl_safefree(pop3c->apoptimestamp); - free(pop3c); + curlx_free(pop3c); } static CURLcode pop3_setup_connection(struct Curl_easy *data, struct connectdata *conn) { struct pop3_conn *pop3c; - struct POP3 *pop3 = calloc(1, sizeof(*pop3)); + struct POP3 *pop3 = curlx_calloc(1, sizeof(*pop3)); if(!pop3 || Curl_meta_set(data, CURL_META_POP3_EASY, pop3, pop3_easy_dtor)) return CURLE_OUT_OF_MEMORY; - pop3c = calloc(1, sizeof(*pop3c)); + pop3c = curlx_calloc(1, sizeof(*pop3c)); if(!pop3c || Curl_conn_meta_set(conn, CURL_META_POP3_CONN, pop3c, pop3_conn_dtor)) return CURLE_OUT_OF_MEMORY; diff --git a/lib/psl.c b/lib/psl.c index f645763d063b..5bf96d09bd88 100644 --- a/lib/psl.c +++ b/lib/psl.c @@ -31,10 +31,6 @@ #include "psl.h" #include "curl_share.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - void Curl_psl_destroy(struct PslCache *pslcache) { if(pslcache->psl) { diff --git a/lib/rand.c b/lib/rand.c index 5eace0283349..8c5a2cf71e44 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -38,10 +38,6 @@ #include "rand.h" #include "escape.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef _WIN32 #if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA && \ diff --git a/lib/rename.c b/lib/rename.c index 911afca57563..d3f80422e641 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -32,10 +32,6 @@ #include "curlx/multibyte.h" #include "curlx/timeval.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* return 0 on success, 1 on error */ int Curl_rename(const char *oldpath, const char *newpath) { diff --git a/lib/request.c b/lib/request.c index 324c4c48f96d..581d7d14537a 100644 --- a/lib/request.c +++ b/lib/request.c @@ -36,10 +36,6 @@ #include "url.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - void Curl_req_init(struct SingleRequest *req) { memset(req, 0, sizeof(*req)); diff --git a/lib/rtsp.c b/lib/rtsp.c index dd49ebc42b4d..5a46dc62c407 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -42,10 +42,6 @@ #include "strdup.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* meta key for storing protocol meta at easy handle */ #define CURL_META_RTSP_EASY "meta:proto:rtsp:easy" @@ -162,7 +158,7 @@ static void rtsp_easy_dtor(void *key, size_t klen, void *entry) struct RTSP *rtsp = entry; (void)key; (void)klen; - free(rtsp); + curlx_free(rtsp); } static void rtsp_conn_dtor(void *key, size_t klen, void *entry) @@ -171,7 +167,7 @@ static void rtsp_conn_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; curlx_dyn_free(&rtspc->buf); - free(rtspc); + curlx_free(rtspc); } static CURLcode rtsp_setup_connection(struct Curl_easy *data, @@ -180,14 +176,14 @@ static CURLcode rtsp_setup_connection(struct Curl_easy *data, struct rtsp_conn *rtspc; struct RTSP *rtsp; - rtspc = calloc(1, sizeof(*rtspc)); + rtspc = curlx_calloc(1, sizeof(*rtspc)); if(!rtspc) return CURLE_OUT_OF_MEMORY; curlx_dyn_init(&rtspc->buf, MAX_RTP_BUFFERSIZE); if(Curl_conn_meta_set(conn, CURL_META_RTSP_CONN, rtspc, rtsp_conn_dtor)) return CURLE_OUT_OF_MEMORY; - rtsp = calloc(1, sizeof(struct RTSP)); + rtsp = curlx_calloc(1, sizeof(struct RTSP)); if(!rtsp || Curl_meta_set(data, CURL_META_RTSP_EASY, rtsp, rtsp_easy_dtor)) return CURLE_OUT_OF_MEMORY; @@ -392,7 +388,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) to this origin */ if(!data->state.first_host) { - data->state.first_host = strdup(conn->host.name); + data->state.first_host = curlx_strdup(conn->host.name); if(!data->state.first_host) return CURLE_OUT_OF_MEMORY; @@ -481,7 +477,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) if(rtspreq == RTSPREQ_SETUP && !p_transport) { /* New Transport: setting? */ if(data->set.str[STRING_RTSP_TRANSPORT]) { - free(data->state.aptr.rtsp_transport); + curlx_free(data->state.aptr.rtsp_transport); data->state.aptr.rtsp_transport = curl_maprintf("Transport: %s\r\n", data->set.str[STRING_RTSP_TRANSPORT]); @@ -507,7 +503,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) /* Accept-Encoding header */ if(!Curl_checkheaders(data, STRCONST("Accept-Encoding")) && data->set.str[STRING_ENCODING]) { - free(data->state.aptr.accept_encoding); + curlx_free(data->state.aptr.accept_encoding); data->state.aptr.accept_encoding = curl_maprintf("Accept-Encoding: %s\r\n", data->set.str[STRING_ENCODING]); @@ -563,7 +559,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) /* Check to see if there is a range set in the custom headers */ if(!Curl_checkheaders(data, STRCONST("Range")) && data->state.range) { - free(data->state.aptr.rangeline); + curlx_free(data->state.aptr.rangeline); data->state.aptr.rangeline = curl_maprintf("Range: %s\r\n", data->state.range); p_range = data->state.aptr.rangeline; diff --git a/lib/select.c b/lib/select.c index 041733973e9e..5692fc020d1f 100644 --- a/lib/select.c +++ b/lib/select.c @@ -46,10 +46,6 @@ #include "curlx/wait.h" #include "curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifndef HAVE_POLL /* * This is a wrapper around select() to aid in Windows compatibility. A @@ -364,7 +360,7 @@ void Curl_pollfds_cleanup(struct curl_pollfds *cpfds) { DEBUGASSERT(cpfds); if(cpfds->allocated_pfds) { - free(cpfds->pfds); + curlx_free(cpfds->pfds); } memset(cpfds, 0, sizeof(*cpfds)); } @@ -374,13 +370,13 @@ static CURLcode cpfds_increase(struct curl_pollfds *cpfds, unsigned int inc) struct pollfd *new_fds; unsigned int new_count = cpfds->count + inc; - new_fds = calloc(new_count, sizeof(struct pollfd)); + new_fds = curlx_calloc(new_count, sizeof(struct pollfd)); if(!new_fds) return CURLE_OUT_OF_MEMORY; memcpy(new_fds, cpfds->pfds, cpfds->count * sizeof(struct pollfd)); if(cpfds->allocated_pfds) - free(cpfds->pfds); + curlx_free(cpfds->pfds); cpfds->pfds = new_fds; cpfds->count = new_count; cpfds->allocated_pfds = TRUE; @@ -521,7 +517,7 @@ void Curl_pollset_init(struct easy_pollset *ps) struct easy_pollset *Curl_pollset_create(void) { - struct easy_pollset *ps = calloc(1, sizeof(*ps)); + struct easy_pollset *ps = curlx_calloc(1, sizeof(*ps)); if(ps) Curl_pollset_init(ps); return ps; @@ -533,11 +529,11 @@ void Curl_pollset_cleanup(struct easy_pollset *ps) DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC); #endif if(ps->sockets != ps->def_sockets) { - free(ps->sockets); + curlx_free(ps->sockets); ps->sockets = ps->def_sockets; } if(ps->actions != ps->def_actions) { - free(ps->actions); + curlx_free(ps->actions); ps->actions = ps->def_actions; } ps->count = CURL_ARRAYSIZE(ps->def_sockets); @@ -614,21 +610,21 @@ CURLcode Curl_pollset_change(struct Curl_easy *data, ps->count, new_count); if(new_count <= ps->count) return CURLE_OUT_OF_MEMORY; - nsockets = calloc(new_count, sizeof(nsockets[0])); + nsockets = curlx_calloc(new_count, sizeof(nsockets[0])); if(!nsockets) return CURLE_OUT_OF_MEMORY; - nactions = calloc(new_count, sizeof(nactions[0])); + nactions = curlx_calloc(new_count, sizeof(nactions[0])); if(!nactions) { - free(nsockets); + curlx_free(nsockets); return CURLE_OUT_OF_MEMORY; } memcpy(nsockets, ps->sockets, ps->count * sizeof(ps->sockets[0])); memcpy(nactions, ps->actions, ps->count * sizeof(ps->actions[0])); if(ps->sockets != ps->def_sockets) - free(ps->sockets); + curlx_free(ps->sockets); ps->sockets = nsockets; if(ps->actions != ps->def_actions) - free(ps->actions); + curlx_free(ps->actions); ps->actions = nactions; ps->count = new_count; } @@ -668,7 +664,7 @@ int Curl_pollset_poll(struct Curl_easy *data, if(!ps->n) return curlx_wait_ms(timeout_ms); - pfds = calloc(ps->n, sizeof(*pfds)); + pfds = curlx_calloc(ps->n, sizeof(*pfds)); if(!pfds) return -1; @@ -689,7 +685,7 @@ int Curl_pollset_poll(struct Curl_easy *data, } result = Curl_poll(pfds, npfds, timeout_ms); - free(pfds); + curlx_free(pfds); return result; } diff --git a/lib/sendf.c b/lib/sendf.c index 6731cd874b6b..1d73291c92d2 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -55,10 +55,6 @@ #include "curlx/warnless.h" #include "ws.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static CURLcode do_init_writer_stack(struct Curl_easy *data); @@ -100,7 +96,7 @@ static void cl_reset_writer(struct Curl_easy *data) while(writer) { data->req.writer_stack = writer->next; writer->cwt->do_close(data, writer); - free(writer); + curlx_free(writer); writer = data->req.writer_stack; } } @@ -112,7 +108,7 @@ static void cl_reset_reader(struct Curl_easy *data) while(reader) { data->req.reader_stack = reader->next; reader->crt->do_close(data, reader); - free(reader); + curlx_free(reader); reader = data->req.reader_stack; } } @@ -374,7 +370,7 @@ CURLcode Curl_cwriter_create(struct Curl_cwriter **pwriter, void *p; DEBUGASSERT(cwt->cwriter_size >= sizeof(struct Curl_cwriter)); - p = calloc(1, cwt->cwriter_size); + p = curlx_calloc(1, cwt->cwriter_size); if(!p) goto out; @@ -387,7 +383,7 @@ CURLcode Curl_cwriter_create(struct Curl_cwriter **pwriter, out: *pwriter = result ? NULL : writer; if(result) - free(writer); + curlx_free(writer); return result; } @@ -396,7 +392,7 @@ void Curl_cwriter_free(struct Curl_easy *data, { if(writer) { writer->cwt->do_close(data, writer); - free(writer); + curlx_free(writer); } } @@ -938,7 +934,7 @@ CURLcode Curl_creader_create(struct Curl_creader **preader, void *p; DEBUGASSERT(crt->creader_size >= sizeof(struct Curl_creader)); - p = calloc(1, crt->creader_size); + p = curlx_calloc(1, crt->creader_size); if(!p) goto out; @@ -951,7 +947,7 @@ CURLcode Curl_creader_create(struct Curl_creader **preader, out: *preader = result ? NULL : reader; if(result) - free(reader); + curlx_free(reader); return result; } @@ -959,7 +955,7 @@ void Curl_creader_free(struct Curl_easy *data, struct Curl_creader *reader) { if(reader) { reader->crt->do_close(data, reader); - free(reader); + curlx_free(reader); } } diff --git a/lib/setopt.c b/lib/setopt.c index 36f447cdc5bb..b4ca361ce35f 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -55,10 +55,6 @@ #include "strdup.h" #include "escape.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - static CURLcode setopt_set_timeout_sec(timediff_t *ptimeout_ms, long secs) { if(secs < 0) @@ -98,7 +94,7 @@ CURLcode Curl_setstropt(char **charp, const char *s) if(strlen(s) > CURL_MAX_INPUT_LENGTH) return CURLE_BAD_FUNCTION_ARGUMENT; - *charp = strdup(s); + *charp = curlx_strdup(s); if(!*charp) return CURLE_OUT_OF_MEMORY; } @@ -119,8 +115,8 @@ CURLcode Curl_setblobopt(struct curl_blob **blobp, if(blob->len > CURL_MAX_INPUT_LENGTH) return CURLE_BAD_FUNCTION_ARGUMENT; nblob = (struct curl_blob *) - malloc(sizeof(struct curl_blob) + - ((blob->flags & CURL_BLOB_COPY) ? blob->len : 0)); + curlx_malloc(sizeof(struct curl_blob) + + ((blob->flags & CURL_BLOB_COPY) ? blob->len : 0)); if(!nblob) return CURLE_OUT_OF_MEMORY; *nblob = *blob; @@ -158,10 +154,10 @@ static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp) return result; } - free(*userp); + curlx_free(*userp); *userp = user; - free(*passwdp); + curlx_free(*passwdp); *passwdp = passwd; return CURLE_OK; @@ -185,13 +181,13 @@ static CURLcode setstropt_interface(char *option, char **devp, if(result) return result; } - free(*devp); + curlx_free(*devp); *devp = dev; - free(*ifacep); + curlx_free(*ifacep); *ifacep = iface; - free(*hostp); + curlx_free(*hostp); *hostp = host; return CURLE_OK; @@ -1706,7 +1702,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, if(!p) return CURLE_OUT_OF_MEMORY; else { - free(s->str[STRING_COPYPOSTFIELDS]); + curlx_free(s->str[STRING_COPYPOSTFIELDS]); s->str[STRING_COPYPOSTFIELDS] = p; } } @@ -2040,8 +2036,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, result = Curl_urldecode(p, 0, &s->str[STRING_PROXYPASSWORD], NULL, REJECT_ZERO); } - free(u); - free(p); + curlx_free(u); + curlx_free(p); } break; case CURLOPT_PROXYUSERNAME: diff --git a/lib/sha256.c b/lib/sha256.c index 3e3205e36bf3..977ad3edc402 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -59,10 +59,6 @@ #include #endif -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* Please keep the SSL backend-specific #if branches in this order: * * 1. USE_OPENSSL diff --git a/lib/slist.c b/lib/slist.c index 88fdd8a2bae2..469ee0ef3b5b 100644 --- a/lib/slist.c +++ b/lib/slist.c @@ -28,10 +28,6 @@ #include "slist.h" -/* The last #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - /* returns last node in linked list */ static struct curl_slist *slist_get_last(struct curl_slist *list) { @@ -66,7 +62,7 @@ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, DEBUGASSERT(data); - new_item = malloc(sizeof(struct curl_slist)); + new_item = curlx_malloc(sizeof(struct curl_slist)); if(!new_item) return NULL; @@ -92,14 +88,14 @@ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, struct curl_slist *curl_slist_append(struct curl_slist *list, const char *data) { - char *dupdata = strdup(data); + char *dupdata = curlx_strdup(data); if(!dupdata) return NULL; list = Curl_slist_append_nodup(list, dupdata); if(!list) - free(dupdata); + curlx_free(dupdata); return list; } @@ -141,7 +137,7 @@ void curl_slist_free_all(struct curl_slist *list) do { next = item->next; Curl_safefree(item->data); - free(item); + curlx_free(item); item = next; } while(next); } diff --git a/lib/smb.c b/lib/smb.c index e5fca3ec0bef..338464961b21 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -42,10 +42,6 @@ #include "escape.h" #include "curl_endian.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* meta key for storing protocol meta at easy handle */ #define CURL_META_SMB_EASY "meta:proto:smb:easy" @@ -451,7 +447,7 @@ static void smb_easy_dtor(void *key, size_t klen, void *entry) /* `req->path` points to somewhere in `struct smb_conn` which is * kept at the connection meta. If the connection is destroyed first, * req->path points to free'd memory. */ - free(req); + curlx_free(req); } static void smb_conn_dtor(void *key, size_t klen, void *entry) @@ -463,7 +459,7 @@ static void smb_conn_dtor(void *key, size_t klen, void *entry) Curl_safefree(smbc->domain); Curl_safefree(smbc->recv_buf); Curl_safefree(smbc->send_buf); - free(smbc); + curlx_free(smbc); } /* this should setup things in the connection, not in the easy @@ -475,13 +471,13 @@ static CURLcode smb_setup_connection(struct Curl_easy *data, struct smb_request *req; /* Initialize the connection state */ - smbc = calloc(1, sizeof(*smbc)); + smbc = curlx_calloc(1, sizeof(*smbc)); if(!smbc || Curl_conn_meta_set(conn, CURL_META_SMB_CONN, smbc, smb_conn_dtor)) return CURLE_OUT_OF_MEMORY; /* Initialize the request state */ - req = calloc(1, sizeof(*req)); + req = curlx_calloc(1, sizeof(*req)); if(!req || Curl_meta_set(data, CURL_META_SMB_EASY, req, smb_easy_dtor)) return CURLE_OUT_OF_MEMORY; @@ -506,10 +502,10 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done) /* Initialize the connection state */ smbc->state = SMB_CONNECTING; - smbc->recv_buf = malloc(MAX_MESSAGE_SIZE); + smbc->recv_buf = curlx_malloc(MAX_MESSAGE_SIZE); if(!smbc->recv_buf) return CURLE_OUT_OF_MEMORY; - smbc->send_buf = malloc(MAX_MESSAGE_SIZE); + smbc->send_buf = curlx_malloc(MAX_MESSAGE_SIZE); if(!smbc->send_buf) return CURLE_OUT_OF_MEMORY; @@ -520,14 +516,14 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done) if(slash) { smbc->user = slash + 1; - smbc->domain = strdup(conn->user); + smbc->domain = curlx_strdup(conn->user); if(!smbc->domain) return CURLE_OUT_OF_MEMORY; smbc->domain[slash - conn->user] = 0; } else { smbc->user = conn->user; - smbc->domain = strdup(conn->host.name); + smbc->domain = curlx_strdup(conn->host.name); if(!smbc->domain) return CURLE_OUT_OF_MEMORY; } @@ -1246,8 +1242,9 @@ static CURLcode smb_parse_url_path(struct Curl_easy *data, return result; /* Parse the path for the share */ - smbc->share = strdup((*path == '/' || *path == '\\') ? path + 1 : path); - free(path); + smbc->share = curlx_strdup((*path == '/' || *path == '\\') + ? path + 1 : path); + curlx_free(path); if(!smbc->share) return CURLE_OUT_OF_MEMORY; diff --git a/lib/smtp.c b/lib/smtp.c index eca27f146525..55a15b36c08d 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -81,10 +81,6 @@ #include "idn.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* meta key for storing protocol meta at easy handle */ #define CURL_META_SMTP_EASY "meta:proto:smtp:easy" /* meta key for storing protocol meta at connection */ @@ -646,7 +642,7 @@ static CURLcode smtp_perform_command(struct Curl_easy *data, utf8 ? " SMTPUTF8" : ""); Curl_free_idnconverted_hostname(&host); - free(address); + curlx_free(address); } else { /* Establish whether we should report that we support SMTPUTF8 for EXPN @@ -722,11 +718,11 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data, worry about that and reply with a 501 error */ from = curl_maprintf("<%s>%s", address, suffix); - free(address); + curlx_free(address); } else /* Null reverse-path, RFC-5321, sect. 3.6.3 */ - from = strdup("<>"); + from = curlx_strdup("<>"); if(!from) { result = CURLE_OUT_OF_MEMORY; @@ -763,11 +759,11 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data, /* An invalid mailbox was provided but we will simply let the server worry about it */ auth = curl_maprintf("<%s>%s", address, suffix); - free(address); + curlx_free(address); } else /* Empty AUTH, RFC-2554, sect. 5 */ - auth = strdup("<>"); + auth = curlx_strdup("<>"); if(!auth) { result = CURLE_OUT_OF_MEMORY; @@ -848,9 +844,9 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data, : ""); /* included in our envelope */ out: - free(from); - free(auth); - free(size); + curlx_free(from); + curlx_free(auth); + curlx_free(size); if(!result) smtp_state(data, smtpc, SMTP_MAIL); @@ -892,7 +888,7 @@ static CURLcode smtp_perform_rcpt_to(struct Curl_easy *data, address, suffix); Curl_free_idnconverted_hostname(&host); - free(address); + curlx_free(address); if(!result) smtp_state(data, smtpc, SMTP_RCPT); @@ -1716,7 +1712,7 @@ static void smtp_easy_dtor(void *key, size_t klen, void *entry) struct SMTP *smtp = entry; (void)key; (void)klen; - free(smtp); + curlx_free(smtp); } static void smtp_conn_dtor(void *key, size_t klen, void *entry) @@ -1726,7 +1722,7 @@ static void smtp_conn_dtor(void *key, size_t klen, void *entry) (void)klen; Curl_pp_disconnect(&smtpc->pp); Curl_safefree(smtpc->domain); - free(smtpc); + curlx_free(smtpc); } static CURLcode smtp_setup_connection(struct Curl_easy *data, @@ -1736,14 +1732,14 @@ static CURLcode smtp_setup_connection(struct Curl_easy *data, struct SMTP *smtp; CURLcode result = CURLE_OK; - smtpc = calloc(1, sizeof(*smtpc)); + smtpc = curlx_calloc(1, sizeof(*smtpc)); if(!smtpc || Curl_conn_meta_set(conn, CURL_META_SMTP_CONN, smtpc, smtp_conn_dtor)) { result = CURLE_OUT_OF_MEMORY; goto out; } - smtp = calloc(1, sizeof(*smtp)); + smtp = curlx_calloc(1, sizeof(*smtp)); if(!smtp || Curl_meta_set(data, CURL_META_SMTP_EASY, smtp, smtp_easy_dtor)) result = CURLE_OUT_OF_MEMORY; @@ -1877,7 +1873,7 @@ static CURLcode smtp_parse_address(const char *fqma, char **address, /* Duplicate the fully qualified email address so we can manipulate it, ensuring it does not contain the delimiters if specified */ - char *dup = strdup(fqma[0] == '<' ? fqma + 1 : fqma); + char *dup = curlx_strdup(fqma[0] == '<' ? fqma + 1 : fqma); if(!dup) return CURLE_OUT_OF_MEMORY; diff --git a/lib/socketpair.c b/lib/socketpair.c index 08753c8a8c21..0b6111204446 100644 --- a/lib/socketpair.c +++ b/lib/socketpair.c @@ -134,10 +134,6 @@ int Curl_socketpair(int domain, int type, int protocol, #include "curlx/timeval.h" /* needed before select.h */ #include "select.h" /* for Curl_poll */ -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - int Curl_socketpair(int domain, int type, int protocol, curl_socket_t socks[2], bool nonblocking) { diff --git a/lib/socks.c b/lib/socks.c index 3434030c839f..7160dd150698 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -45,10 +45,6 @@ #include "curlx/inet_pton.h" #include "url.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) #define DEBUG_AND_VERBOSE #endif @@ -1215,7 +1211,7 @@ static void socks_proxy_cf_free(struct Curl_cfilter *cf) struct socks_state *sxstate = cf->ctx; if(sxstate) { Curl_bufq_free(&sxstate->iobuf); - free(sxstate); + curlx_free(sxstate); cf->ctx = NULL; } } @@ -1247,7 +1243,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, return result; if(!sx) { - cf->ctx = sx = calloc(1, sizeof(*sx)); + cf->ctx = sx = curlx_calloc(1, sizeof(*sx)); if(!sx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 61c88be60528..6f8a90139ded 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -37,10 +37,6 @@ #include "curlx/warnless.h" #include "strdup.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if defined(__GNUC__) && defined(__APPLE__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -151,8 +147,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, (gss_OID) GSS_C_NULL_OID, &server); } else { - service.value = malloc(serviceptr_length + - strlen(conn->socks_proxy.host.name) + 2); + service.value = curlx_malloc(serviceptr_length + + strlen(conn->socks_proxy.host.name) + 2); if(!service.value) return CURLE_OUT_OF_MEMORY; service.length = serviceptr_length + @@ -277,7 +273,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = ntohs(us_length); gss_recv_token.length = us_length; - gss_recv_token.value = malloc(gss_recv_token.length); + gss_recv_token.value = curlx_malloc(gss_recv_token.length); if(!gss_recv_token.value) { failf(data, "Could not allocate memory for GSS-API authentication " @@ -464,7 +460,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = ntohs(us_length); gss_recv_token.length = us_length; - gss_recv_token.value = malloc(gss_recv_token.length); + gss_recv_token.value = curlx_malloc(gss_recv_token.length); if(!gss_recv_token.value) { Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_OUT_OF_MEMORY; diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 14025371ce37..92592c5ce007 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -38,10 +38,6 @@ #include "curlx/multibyte.h" #include "curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* * Helper sspi error functions. */ @@ -101,7 +97,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, /* prepare service name */ if(strchr(service, '/')) - service_name = strdup(service); + service_name = curlx_strdup(service); else service_name = curl_maprintf("%s/%s", service, conn->socks_proxy.host.name); @@ -267,7 +263,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = ntohs(us_length); sspi_recv_token.cbBuffer = us_length; - sspi_recv_token.pvBuffer = malloc(us_length); + sspi_recv_token.pvBuffer = curlx_malloc(us_length); if(!sspi_recv_token.pvBuffer) { result = CURLE_OUT_OF_MEMORY; @@ -371,7 +367,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, sspi_w_token[0].cbBuffer = sspi_sizes.cbSecurityTrailer; sspi_w_token[0].BufferType = SECBUFFER_TOKEN; - sspi_w_token[0].pvBuffer = malloc(sspi_sizes.cbSecurityTrailer); + sspi_w_token[0].pvBuffer = curlx_malloc(sspi_sizes.cbSecurityTrailer); if(!sspi_w_token[0].pvBuffer) { result = CURLE_OUT_OF_MEMORY; @@ -379,7 +375,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } sspi_w_token[1].cbBuffer = 1; - sspi_w_token[1].pvBuffer = malloc(1); + sspi_w_token[1].pvBuffer = curlx_malloc(1); if(!sspi_w_token[1].pvBuffer) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -388,7 +384,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, memcpy(sspi_w_token[1].pvBuffer, &gss_enc, 1); sspi_w_token[2].BufferType = SECBUFFER_PADDING; sspi_w_token[2].cbBuffer = sspi_sizes.cbBlockSize; - sspi_w_token[2].pvBuffer = malloc(sspi_sizes.cbBlockSize); + sspi_w_token[2].pvBuffer = curlx_malloc(sspi_sizes.cbBlockSize); if(!sspi_w_token[2].pvBuffer) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -409,7 +405,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, result = CURLE_COULDNT_CONNECT; goto error; } - etbuf = malloc(etbuf_size); + etbuf = curlx_malloc(etbuf_size); if(!etbuf) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -486,7 +482,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = ntohs(us_length); sspi_w_token[0].cbBuffer = us_length; - sspi_w_token[0].pvBuffer = malloc(us_length); + sspi_w_token[0].pvBuffer = curlx_malloc(us_length); if(!sspi_w_token[0].pvBuffer) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -514,7 +510,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, /* since sspi_w_token[1].pvBuffer is allocated by the SSPI in this case, it must be freed in this block using FreeContextBuffer() instead of - potentially in error cleanup using free(). */ + potentially in error cleanup using curlx_free(). */ if(check_sspi_err(data, status, "DecryptMessage")) { failf(data, "Failed to query security context attributes."); @@ -577,18 +573,18 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, return CURLE_OK; error: (void)curlx_nonblock(sock, TRUE); - free(service_name); + curlx_free(service_name); Curl_pSecFn->DeleteSecurityContext(&sspi_context); Curl_pSecFn->FreeCredentialsHandle(&cred_handle); - free(sspi_recv_token.pvBuffer); + curlx_free(sspi_recv_token.pvBuffer); if(sspi_send_token.pvBuffer) Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); if(names.sUserName) Curl_pSecFn->FreeContextBuffer(names.sUserName); - free(sspi_w_token[0].pvBuffer); - free(sspi_w_token[1].pvBuffer); - free(sspi_w_token[2].pvBuffer); - free(etbuf); + curlx_free(sspi_w_token[0].pvBuffer); + curlx_free(sspi_w_token[1].pvBuffer); + curlx_free(sspi_w_token[2].pvBuffer); + curlx_free(etbuf); return result; } #endif diff --git a/lib/strdup.c b/lib/strdup.c index 3339e909ee79..375f0f50442a 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -31,10 +31,6 @@ #endif #include "strdup.h" -#include "curl_memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" #ifndef HAVE_STRDUP char *Curl_strdup(const char *str) @@ -47,7 +43,7 @@ char *Curl_strdup(const char *str) len = strlen(str) + 1; - newstr = malloc(len); + newstr = curlx_malloc(len); if(!newstr) return (char *)NULL; @@ -90,7 +86,7 @@ wchar_t *Curl_wcsdup(const wchar_t *src) ***************************************************************************/ void *Curl_memdup(const void *src, size_t length) { - void *buffer = malloc(length); + void *buffer = curlx_malloc(length); if(!buffer) return NULL; /* fail */ @@ -111,7 +107,7 @@ void *Curl_memdup(const void *src, size_t length) ***************************************************************************/ void *Curl_memdup0(const char *src, size_t length) { - char *buf = (length < SIZE_MAX) ? malloc(length + 1) : NULL; + char *buf = (length < SIZE_MAX) ? curlx_malloc(length + 1) : NULL; if(!buf) return NULL; if(length) { @@ -126,7 +122,7 @@ void *Curl_memdup0(const char *src, size_t length) * * Curl_saferealloc(ptr, size) * - * Does a normal realloc(), but will free the data pointer if the realloc + * Does a normal curlx_realloc(), but will free the data pointer if the realloc * fails. If 'size' is non-zero, it will free the data and return a failure. * * This convenience function is provided and used to help us avoid a common @@ -138,9 +134,9 @@ void *Curl_memdup0(const char *src, size_t length) ***************************************************************************/ void *Curl_saferealloc(void *ptr, size_t size) { - void *datap = realloc(ptr, size); + void *datap = curlx_realloc(ptr, size); if(size && !datap) /* only free 'ptr' if size was non-zero */ - free(ptr); + curlx_free(ptr); return datap; } diff --git a/lib/strerror.c b/lib/strerror.c index afe69756bcbc..4b957bef2312 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -34,10 +34,6 @@ #include "curlx/winapi.h" #include "strerror.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - const char * curl_easy_strerror(CURLcode error) { diff --git a/lib/system_win32.c b/lib/system_win32.c index bdbed66162eb..f8a6cbfcccd6 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -32,10 +32,6 @@ #include "curl_sspi.h" #include "curlx/warnless.h" -/* The last #include files should be: */ -#include "curl_memory.h" -#include "memdebug.h" - #ifndef HAVE_IF_NAMETOINDEX /* Handle of iphlpapp.dll */ static HMODULE s_hIpHlpApiDll = NULL; @@ -218,7 +214,8 @@ static HMODULE curl_load_library(LPCTSTR filename) /* Allocate space for the full DLL path (Room for the null-terminator is included in systemdirlen) */ size_t filenamelen = _tcslen(filename); - TCHAR *path = malloc(sizeof(TCHAR) * (systemdirlen + 1 + filenamelen)); + TCHAR *path = curlx_malloc(sizeof(TCHAR) * + (systemdirlen + 1 + filenamelen)); if(path && GetSystemDirectory(path, systemdirlen)) { /* Calculate the full DLL path */ _tcscpy(path + _tcslen(path), TEXT("\\")); @@ -230,7 +227,7 @@ static HMODULE curl_load_library(LPCTSTR filename) pLoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) : LoadLibrary(path); } - free(path); + curlx_free(path); } } return hModule; diff --git a/lib/telnet.c b/lib/telnet.c index d0ca5a66ce11..5319130b90f3 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -60,10 +60,6 @@ #include "curlx/warnless.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #define SUBBUFSIZE 512 #define CURL_SB_CLEAR(x) x->subpointer = x->subbuffer @@ -211,7 +207,7 @@ static void telnet_easy_dtor(void *key, size_t klen, void *entry) (void)klen; curl_slist_free_all(tn->telnet_vars); curlx_dyn_free(&tn->out); - free(tn); + curlx_free(tn); } static @@ -219,7 +215,7 @@ CURLcode init_telnet(struct Curl_easy *data) { struct TELNET *tn; - tn = calloc(1, sizeof(struct TELNET)); + tn = curlx_calloc(1, sizeof(struct TELNET)); if(!tn) return CURLE_OUT_OF_MEMORY; diff --git a/lib/tftp.c b/lib/tftp.c index ce9d200f05e3..5311a4c683a2 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -64,10 +64,6 @@ #include "curlx/strerr.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /* RFC2348 allows the block size to be negotiated */ #define TFTP_BLKSIZE_DEFAULT 512 #define TFTP_OPTION_BLKSIZE "blksize" @@ -470,7 +466,7 @@ static CURLcode tftp_send_first(struct tftp_conn *state, if(strlen(filename) > (state->blksize - strlen(mode) - 4)) { failf(data, "TFTP filename too long"); - free(filename); + curlx_free(filename); return CURLE_TFTP_ILLEGAL; /* too long filename field */ } @@ -478,7 +474,7 @@ static CURLcode tftp_send_first(struct tftp_conn *state, state->blksize, "%s%c%s%c", filename, '\0', mode, '\0'); sbytes = 4 + strlen(filename) + strlen(mode); - free(filename); + curlx_free(filename); /* optional addition of TFTP options */ if(!data->set.tftp_no_options) { @@ -946,7 +942,7 @@ static void tftp_conn_dtor(void *key, size_t klen, void *entry) (void)klen; Curl_safefree(state->rpacket.data); Curl_safefree(state->spacket.data); - free(state); + curlx_free(state); } /********************************************************** @@ -967,7 +963,7 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done) blksize = TFTP_BLKSIZE_DEFAULT; - state = calloc(1, sizeof(*state)); + state = curlx_calloc(1, sizeof(*state)); if(!state || Curl_conn_meta_set(conn, CURL_META_TFTP_CONN, state, tftp_conn_dtor)) return CURLE_OUT_OF_MEMORY; @@ -983,14 +979,14 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done) need_blksize = TFTP_BLKSIZE_DEFAULT; if(!state->rpacket.data) { - state->rpacket.data = calloc(1, need_blksize + 2 + 2); + state->rpacket.data = curlx_calloc(1, need_blksize + 2 + 2); if(!state->rpacket.data) return CURLE_OUT_OF_MEMORY; } if(!state->spacket.data) { - state->spacket.data = calloc(1, need_blksize + 2 + 2); + state->spacket.data = curlx_calloc(1, need_blksize + 2 + 2); if(!state->spacket.data) return CURLE_OUT_OF_MEMORY; diff --git a/lib/transfer.c b/lib/transfer.c index f0ce3c501271..d8a0d6c0ba2e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -81,10 +81,6 @@ #include "headers.h" #include "curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ !defined(CURL_DISABLE_IMAP) /* @@ -479,7 +475,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) is allowed to be changed by the user between transfers */ if(data->set.uh) { CURLUcode uc; - free(data->set.str[STRING_SET_URL]); + curlx_free(data->set.str[STRING_SET_URL]); uc = curl_url_get(data->set.uh, CURLUPART_URL, &data->set.str[STRING_SET_URL], 0); if(uc) { @@ -574,7 +570,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) if(data->state.wildcardmatch) { struct WildcardData *wc; if(!data->wildcard) { - data->wildcard = calloc(1, sizeof(struct WildcardData)); + data->wildcard = curlx_calloc(1, sizeof(struct WildcardData)); if(!data->wildcard) return CURLE_OUT_OF_MEMORY; } @@ -597,7 +593,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) * protocol. */ if(!result && data->set.str[STRING_USERAGENT]) { - free(data->state.aptr.uagent); + curlx_free(data->state.aptr.uagent); data->state.aptr.uagent = curl_maprintf("User-Agent: %s\r\n", data->set.str[STRING_USERAGENT]); if(!data->state.aptr.uagent) @@ -629,7 +625,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) /* Returns CURLE_OK *and* sets '*url' if a request retry is wanted. - NOTE: that the *url is malloc()ed. */ + NOTE: that the *url is curlx_malloc()ed. */ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) { struct connectdata *conn = data->conn; @@ -680,7 +676,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) } infof(data, "Connection died, retrying a fresh connect (retry count: %d)", data->state.retrycount); - *url = strdup(data->state.url); + *url = curlx_strdup(data->state.url); if(!*url) return CURLE_OUT_OF_MEMORY; diff --git a/lib/uint-bset.c b/lib/uint-bset.c index 82440c56378a..dcad94e42a6e 100644 --- a/lib/uint-bset.c +++ b/lib/uint-bset.c @@ -25,10 +25,6 @@ #include "curl_setup.h" #include "uint-bset.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef DEBUGBUILD #define CURL_UINT32_BSET_MAGIC 0x62757473 #endif @@ -49,14 +45,14 @@ CURLcode Curl_uint32_bset_resize(struct uint32_bset *bset, uint32_t nmax) DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC); if(nslots != bset->nslots) { - uint64_t *slots = calloc(nslots, sizeof(uint64_t)); + uint64_t *slots = curlx_calloc(nslots, sizeof(uint64_t)); if(!slots) return CURLE_OUT_OF_MEMORY; if(bset->slots) { memcpy(slots, bset->slots, (CURLMIN(nslots, bset->nslots) * sizeof(uint64_t))); - free(bset->slots); + curlx_free(bset->slots); } bset->slots = slots; bset->nslots = nslots; @@ -69,7 +65,7 @@ CURLcode Curl_uint32_bset_resize(struct uint32_bset *bset, uint32_t nmax) void Curl_uint32_bset_destroy(struct uint32_bset *bset) { DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC); - free(bset->slots); + curlx_free(bset->slots); memset(bset, 0, sizeof(*bset)); } diff --git a/lib/uint-hash.c b/lib/uint-hash.c index 4677c6ac9128..166a9ab99ba5 100644 --- a/lib/uint-hash.c +++ b/lib/uint-hash.c @@ -27,10 +27,6 @@ #include #include "uint-hash.h" -#include "curl_memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" /* random patterns for API verification */ #ifdef DEBUGBUILD @@ -70,7 +66,7 @@ static struct uint_hash_entry *uint32_hash_mk_entry(uint32_t id, void *value) struct uint_hash_entry *e; /* allocate the struct for the hash entry */ - e = malloc(sizeof(*e)); + e = curlx_malloc(sizeof(*e)); if(e) { e->id = id; e->next = NULL; @@ -95,7 +91,7 @@ static void uint32_hash_entry_destroy(struct uint_hash *h, struct uint_hash_entry *e) { uint32_hash_entry_clear(h, e); - free(e); + curlx_free(e); } static void uint32_hash_entry_unlink(struct uint_hash *h, @@ -126,7 +122,7 @@ bool Curl_uint32_hash_set(struct uint_hash *h, uint32_t id, void *value) DEBUGASSERT(h->slots); DEBUGASSERT(h->init == CURL_UINT32_HASHINIT); if(!h->table) { - h->table = calloc(h->slots, sizeof(*he)); + h->table = curlx_calloc(h->slots, sizeof(*he)); if(!h->table) return FALSE; /* OOM */ } diff --git a/lib/uint-spbset.c b/lib/uint-spbset.c index f250bcb1b43f..c726bfb900c1 100644 --- a/lib/uint-spbset.c +++ b/lib/uint-spbset.c @@ -26,10 +26,6 @@ #include "uint-bset.h" #include "uint-spbset.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef DEBUGBUILD #define CURL_UINT32_SPBSET_MAGIC 0x70737362 #endif @@ -85,7 +81,7 @@ UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset) for(chunk = bset->head.next; chunk; chunk = next) { next = chunk->next; - free(chunk); + curlx_free(chunk); } memset(&bset->head, 0, sizeof(bset->head)); } @@ -116,7 +112,7 @@ uint32_spbset_get_chunk(struct uint32_spbset *bset, uint32_t i, bool grow) return NULL; /* need a new one */ - chunk = calloc(1, sizeof(*chunk)); + chunk = curlx_calloc(1, sizeof(*chunk)); if(!chunk) return NULL; diff --git a/lib/uint-table.c b/lib/uint-table.c index 5516ab634bf1..05b53766f30a 100644 --- a/lib/uint-table.c +++ b/lib/uint-table.c @@ -25,10 +25,6 @@ #include "curl_setup.h" #include "uint-table.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef DEBUGBUILD #define CURL_UINT32_TBL_MAGIC 0x62757473 #endif @@ -73,14 +69,14 @@ CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nrows) if(!nrows) return CURLE_BAD_FUNCTION_ARGUMENT; if(nrows != tbl->nrows) { - void **rows = calloc(nrows, sizeof(void *)); + void **rows = curlx_calloc(nrows, sizeof(void *)); if(!rows) return CURLE_OUT_OF_MEMORY; if(tbl->rows) { memcpy(rows, tbl->rows, (CURLMIN(nrows, tbl->nrows) * sizeof(void *))); if(nrows < tbl->nrows) uint32_tbl_clear_rows(tbl, nrows, tbl->nrows); - free(tbl->rows); + curlx_free(tbl->rows); } tbl->rows = rows; tbl->nrows = nrows; @@ -93,7 +89,7 @@ void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl) { DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC); Curl_uint32_tbl_clear(tbl); - free(tbl->rows); + curlx_free(tbl->rows); memset(tbl, 0, sizeof(*tbl)); } diff --git a/lib/url.c b/lib/url.c index e7f39d5471d1..b4c33236cd67 100644 --- a/lib/url.c +++ b/lib/url.c @@ -126,10 +126,6 @@ #include "curlx/strerr.h" #include "curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef USE_NGHTTP2 static void data_priority_cleanup(struct Curl_easy *data); #else @@ -257,7 +253,7 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_expire_clear(data); /* shut off any timers left */ if(data->state.rangestringalloc) - free(data->state.range); + curlx_free(data->state.range); /* release any resolve information this transfer kept */ Curl_async_destroy(data); @@ -346,7 +342,7 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_freeset(data); Curl_headers_cleanup(data); Curl_netrc_cleanup(&data->state.netrc); - free(data); + curlx_free(data); return CURLE_OK; } @@ -500,7 +496,7 @@ CURLcode Curl_open(struct Curl_easy **curl) struct Curl_easy *data; /* simple start-up: alloc the struct, init it with zeroes and return */ - data = calloc(1, sizeof(struct Curl_easy)); + data = curlx_calloc(1, sizeof(struct Curl_easy)); if(!data) { /* this is a serious error */ DEBUGF(curl_mfprintf(stderr, "Error: calloc of Curl_easy failed\n")); @@ -578,7 +574,7 @@ void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn) Curl_uint32_spbset_destroy(&conn->xfers_attached); Curl_hash_destroy(&conn->meta_hash); - free(conn); /* free all the connection oriented data */ + curlx_free(conn); /* free all the connection oriented data */ } /* @@ -1351,7 +1347,7 @@ ConnectionExists(struct Curl_easy *data, */ static struct connectdata *allocate_conn(struct Curl_easy *data) { - struct connectdata *conn = calloc(1, sizeof(struct connectdata)); + struct connectdata *conn = curlx_calloc(1, sizeof(struct connectdata)); if(!conn) return NULL; @@ -1406,7 +1402,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) /* Store the local bind parameters that will be used for this connection */ if(data->set.str[STRING_DEVICE]) { - conn->localdev = strdup(data->set.str[STRING_DEVICE]); + conn->localdev = curlx_strdup(data->set.str[STRING_DEVICE]); if(!conn->localdev) goto error; } @@ -1427,8 +1423,8 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) return conn; error: - free(conn->localdev); - free(conn); + curlx_free(conn->localdev); + curlx_free(conn); return NULL; } @@ -1747,7 +1743,7 @@ static void zonefrom_url(CURLU *uh, struct Curl_easy *data, } #endif /* HAVE_IF_NAMETOINDEX || _WIN32 */ - free(zoneid); + curlx_free(zoneid); } } #else @@ -1787,7 +1783,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, if(!url) return CURLE_OUT_OF_MEMORY; if(data->state.url_alloc) - free(data->state.url); + curlx_free(data->state.url); data->state.url = url; data->state.url_alloc = TRUE; } @@ -1810,7 +1806,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, if(uc) return Curl_uc_to_curlcode(uc); if(data->state.url_alloc) - free(data->state.url); + curlx_free(data->state.url); data->state.url = newurl; data->state.url_alloc = TRUE; } @@ -1844,7 +1840,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, } /* make sure the connect struct gets its own copy of the hostname */ - conn->host.rawalloc = strdup(hostname ? hostname : ""); + conn->host.rawalloc = curlx_strdup(hostname ? hostname : ""); if(!conn->host.rawalloc) return CURLE_OUT_OF_MEMORY; conn->host.name = conn->host.rawalloc; @@ -1874,7 +1870,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, return Curl_uc_to_curlcode(uc); uc = curl_url_get(uh, CURLUPART_SCHEME, &data->state.up.scheme, 0); if(uc) { - free(url); + curlx_free(url); return Curl_uc_to_curlcode(uc); } data->state.url = url; @@ -1937,7 +1933,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, uc = curl_url_get(uh, CURLUPART_OPTIONS, &data->state.up.options, CURLU_URLDECODE); if(!uc) { - conn->options = strdup(data->state.up.options); + conn->options = curlx_strdup(data->state.up.options); if(!conn->options) return CURLE_OUT_OF_MEMORY; } @@ -1993,12 +1989,12 @@ static CURLcode setup_range(struct Curl_easy *data) s->resume_from = data->set.set_resume_from; if(s->resume_from || data->set.str[STRING_SET_RANGE]) { if(s->rangestringalloc) - free(s->range); + curlx_free(s->range); if(s->resume_from) s->range = curl_maprintf("%" FMT_OFF_T "-", s->resume_from); else - s->range = strdup(data->set.str[STRING_SET_RANGE]); + s->range = curlx_strdup(data->set.str[STRING_SET_RANGE]); if(!s->range) return CURLE_OUT_OF_MEMORY; @@ -2261,7 +2257,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, goto error; if(proxyuser || proxypasswd) { - free(proxyinfo->user); + curlx_free(proxyinfo->user); proxyinfo->user = proxyuser; result = Curl_setstropt(&data->state.aptr.proxyuser, proxyuser); proxyuser = NULL; @@ -2269,7 +2265,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, goto error; Curl_safefree(proxyinfo->passwd); if(!proxypasswd) { - proxypasswd = strdup(""); + proxypasswd = curlx_strdup(""); if(!proxypasswd) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -2295,7 +2291,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, if(!curlx_str_number(&p, &num, UINT16_MAX)) proxyinfo->port = (uint16_t)num; /* Should we not error out when the port number is invalid? */ - free(portptr); + curlx_free(portptr); } else { if(data->set.proxyport) @@ -2326,13 +2322,13 @@ static CURLcode parse_proxy(struct Curl_easy *data, /* path will be "/", if no path was found */ if(strcmp("/", path)) { is_unix_proxy = TRUE; - free(host); + curlx_free(host); host = curl_maprintf(UNIX_SOCKET_PREFIX"%s", path); if(!host) { result = CURLE_OUT_OF_MEMORY; goto error; } - free(proxyinfo->host.rawalloc); + curlx_free(proxyinfo->host.rawalloc); proxyinfo->host.rawalloc = host; proxyinfo->host.name = host; host = NULL; @@ -2341,7 +2337,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, if(!is_unix_proxy) { #endif - free(proxyinfo->host.rawalloc); + curlx_free(proxyinfo->host.rawalloc); proxyinfo->host.rawalloc = host; if(host[0] == '[') { /* this is a numerical IPv6, strip off the brackets */ @@ -2357,12 +2353,12 @@ static CURLcode parse_proxy(struct Curl_easy *data, #endif error: - free(proxyuser); - free(proxypasswd); - free(host); - free(scheme); + curlx_free(proxyuser); + curlx_free(proxypasswd); + curlx_free(host); + curlx_free(scheme); #ifdef USE_UNIX_SOCKETS - free(path); + curlx_free(path); #endif curl_url_cleanup(uhp); return result; @@ -2380,9 +2376,9 @@ static CURLcode parse_proxy_auth(struct Curl_easy *data, data->state.aptr.proxypasswd : ""; CURLcode result = CURLE_OUT_OF_MEMORY; - conn->http_proxy.user = strdup(proxyuser); + conn->http_proxy.user = curlx_strdup(proxyuser); if(conn->http_proxy.user) { - conn->http_proxy.passwd = strdup(proxypasswd); + conn->http_proxy.passwd = curlx_strdup(proxypasswd); if(conn->http_proxy.passwd) result = CURLE_OK; else @@ -2414,7 +2410,7 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, * Detect what (if any) proxy to use *************************************************************/ if(data->set.str[STRING_PROXY]) { - proxy = strdup(data->set.str[STRING_PROXY]); + proxy = curlx_strdup(data->set.str[STRING_PROXY]); /* if global proxy is set, this is it */ if(!proxy) { failf(data, "memory shortage"); @@ -2424,7 +2420,7 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, } if(data->set.str[STRING_PRE_PROXY]) { - socksproxy = strdup(data->set.str[STRING_PRE_PROXY]); + socksproxy = curlx_strdup(data->set.str[STRING_PRE_PROXY]); /* if global socks proxy is set, this is it */ if(!socksproxy) { failf(data, "memory shortage"); @@ -2460,20 +2456,21 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, #ifdef USE_UNIX_SOCKETS /* For the time being do not mix proxy and Unix domain sockets. See #1274 */ if(proxy && conn->unix_domain_socket) { - free(proxy); + curlx_free(proxy); proxy = NULL; } #endif if(proxy && (!*proxy || (conn->handler->flags & PROTOPT_NONETWORK))) { - free(proxy); /* Do not bother with an empty proxy string or if the - protocol does not work with network */ + curlx_free(proxy); /* Do not bother with an empty proxy string + or if the protocol does not work with network */ proxy = NULL; } if(socksproxy && (!*socksproxy || (conn->handler->flags & PROTOPT_NONETWORK))) { - free(socksproxy); /* Do not bother with an empty socks proxy string or if - the protocol does not work with network */ + curlx_free(socksproxy); /* Do not bother with an empty socks proxy string + or if the protocol does not work with + network */ socksproxy = NULL; } @@ -2528,7 +2525,7 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, if(!conn->socks_proxy.user) { conn->socks_proxy.user = conn->http_proxy.user; conn->http_proxy.user = NULL; - free(conn->socks_proxy.passwd); + curlx_free(conn->socks_proxy.passwd); conn->socks_proxy.passwd = conn->http_proxy.passwd; conn->http_proxy.passwd = NULL; } @@ -2558,8 +2555,8 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, out: - free(socksproxy); - free(proxy); + curlx_free(socksproxy); + curlx_free(proxy); return result; } #endif /* CURL_DISABLE_PROXY */ @@ -2653,8 +2650,8 @@ CURLcode Curl_parse_login_details(const char *login, const size_t len, *passwdp = pbuf; return CURLE_OK; error: - free(ubuf); - free(pbuf); + curlx_free(ubuf); + curlx_free(pbuf); return CURLE_OUT_OF_MEMORY; } @@ -2712,8 +2709,8 @@ static CURLcode override_login(struct Curl_easy *data, char **optionsp = &conn->options; if(data->set.str[STRING_OPTIONS]) { - free(*optionsp); - *optionsp = strdup(data->set.str[STRING_OPTIONS]); + curlx_free(*optionsp); + *optionsp = curlx_strdup(data->set.str[STRING_OPTIONS]); if(!*optionsp) return CURLE_OUT_OF_MEMORY; } @@ -2767,14 +2764,14 @@ static CURLcode override_login(struct Curl_easy *data, } } if(url_provided) { - free(conn->user); - conn->user = strdup(*userp); + curlx_free(conn->user); + conn->user = curlx_strdup(*userp); if(!conn->user) return CURLE_OUT_OF_MEMORY; } /* no user was set but a password, set a blank user */ if(!*userp && *passwdp) { - *userp = strdup(""); + *userp = curlx_strdup(""); if(!*userp) return CURLE_OUT_OF_MEMORY; } @@ -2798,7 +2795,7 @@ static CURLcode override_login(struct Curl_easy *data, if(uc) return Curl_uc_to_curlcode(uc); if(!*userp) { - *userp = strdup(data->state.aptr.user); + *userp = curlx_strdup(data->state.aptr.user); if(!*userp) return CURLE_OUT_OF_MEMORY; } @@ -2815,7 +2812,7 @@ static CURLcode override_login(struct Curl_easy *data, if(uc) return Curl_uc_to_curlcode(uc); if(!*passwdp) { - *passwdp = strdup(data->state.aptr.passwd); + *passwdp = curlx_strdup(data->state.aptr.passwd); if(!*passwdp) return CURLE_OUT_OF_MEMORY; } @@ -2843,14 +2840,14 @@ static CURLcode set_login(struct Curl_easy *data, } /* Store the default user */ if(!conn->user) { - conn->user = strdup(setuser); + conn->user = curlx_strdup(setuser); if(!conn->user) return CURLE_OUT_OF_MEMORY; } /* Store the default password */ if(!conn->passwd) { - conn->passwd = strdup(setpasswd); + conn->passwd = curlx_strdup(setpasswd); if(!conn->passwd) result = CURLE_OUT_OF_MEMORY; } @@ -2885,7 +2882,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, if(!host || !*host) return CURLE_OK; - host_dup = strdup(host); + host_dup = curlx_strdup(host); if(!host_dup) return CURLE_OUT_OF_MEMORY; @@ -2947,7 +2944,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, /* now, clone the cleaned hostname */ DEBUGASSERT(hostptr); - *hostname_result = strdup(hostptr); + *hostname_result = curlx_strdup(hostptr); if(!*hostname_result) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -2956,7 +2953,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, *port_result = port; error: - free(host_dup); + curlx_free(host_dup); return result; } @@ -2995,7 +2992,7 @@ static CURLcode parse_connect_to_string(struct Curl_easy *data, hostname_to_match_len = strlen(hostname_to_match); host_match = curl_strnequal(ptr, hostname_to_match, hostname_to_match_len); - free(hostname_to_match); + curlx_free(hostname_to_match); ptr += hostname_to_match_len; host_match = host_match && *ptr == ':'; @@ -3136,7 +3133,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, } if(hit) { - char *hostd = strdup((char *)as->dst.host); + char *hostd = curlx_strdup((char *)as->dst.host); if(!hostd) return CURLE_OUT_OF_MEMORY; conn->conn_to_host.rawalloc = hostd; @@ -3188,7 +3185,7 @@ static CURLcode resolve_unix(struct Curl_easy *data, /* Unix domain sockets are local. The host gets ignored, just use the * specified domain socket address. Do not cache "DNS entries". There is * no DNS involved and we already have the file system path available. */ - hostaddr = calloc(1, sizeof(struct Curl_dns_entry)); + hostaddr = curlx_calloc(1, sizeof(struct Curl_dns_entry)); if(!hostaddr) return CURLE_OUT_OF_MEMORY; @@ -3198,7 +3195,7 @@ static CURLcode resolve_unix(struct Curl_easy *data, if(longpath) /* Long paths are not supported for now */ failf(data, "Unix socket path too long: '%s'", unix_path); - free(hostaddr); + curlx_free(hostaddr); return longpath ? CURLE_COULDNT_RESOLVE_HOST : CURLE_OUT_OF_MEMORY; } @@ -3261,7 +3258,7 @@ static CURLcode resolve_server(struct Curl_easy *data, } /* Resolve target host right on */ - conn->hostname_resolve = strdup(ehost->name); + conn->hostname_resolve = curlx_strdup(ehost->name); if(!conn->hostname_resolve) return CURLE_OUT_OF_MEMORY; @@ -3308,8 +3305,8 @@ static void reuse_conn(struct Curl_easy *data, * be new for this request even when we reuse an existing connection */ if(temp->user) { /* use the new username and password though */ - free(existing->user); - free(existing->passwd); + curlx_free(existing->user); + curlx_free(existing->passwd); existing->user = temp->user; existing->passwd = temp->passwd; temp->user = NULL; @@ -3320,10 +3317,10 @@ static void reuse_conn(struct Curl_easy *data, existing->bits.proxy_user_passwd = temp->bits.proxy_user_passwd; if(existing->bits.proxy_user_passwd) { /* use the new proxy username and proxy password though */ - free(existing->http_proxy.user); - free(existing->socks_proxy.user); - free(existing->http_proxy.passwd); - free(existing->socks_proxy.passwd); + curlx_free(existing->http_proxy.user); + curlx_free(existing->socks_proxy.user); + curlx_free(existing->http_proxy.passwd); + curlx_free(existing->socks_proxy.passwd); existing->http_proxy.user = temp->http_proxy.user; existing->socks_proxy.user = temp->socks_proxy.user; existing->http_proxy.passwd = temp->http_proxy.passwd; @@ -3354,7 +3351,7 @@ static void reuse_conn(struct Curl_easy *data, existing->conn_to_port = temp->conn_to_port; existing->remote_port = temp->remote_port; - free(existing->hostname_resolve); + curlx_free(existing->hostname_resolve); existing->hostname_resolve = temp->hostname_resolve; temp->hostname_resolve = NULL; @@ -3436,7 +3433,7 @@ static CURLcode create_conn(struct Curl_easy *data, goto out; if(data->set.str[STRING_SASL_AUTHZID]) { - conn->sasl_authzid = strdup(data->set.str[STRING_SASL_AUTHZID]); + conn->sasl_authzid = curlx_strdup(data->set.str[STRING_SASL_AUTHZID]); if(!conn->sasl_authzid) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -3444,7 +3441,7 @@ static CURLcode create_conn(struct Curl_easy *data, } if(data->set.str[STRING_BEARER]) { - conn->oauth_bearer = strdup(data->set.str[STRING_BEARER]); + conn->oauth_bearer = curlx_strdup(data->set.str[STRING_BEARER]); if(!conn->oauth_bearer) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -3453,7 +3450,8 @@ static CURLcode create_conn(struct Curl_easy *data, #ifdef USE_UNIX_SOCKETS if(data->set.str[STRING_UNIX_SOCKET_PATH]) { - conn->unix_domain_socket = strdup(data->set.str[STRING_UNIX_SOCKET_PATH]); + conn->unix_domain_socket = + curlx_strdup(data->set.str[STRING_UNIX_SOCKET_PATH]); if(!conn->unix_domain_socket) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -3924,7 +3922,7 @@ static void priority_remove_child(struct Curl_easy *parent, DEBUGASSERT(pnode); if(pnode) { *pnext = pnode->next; - free(pnode); + curlx_free(pnode); } child->set.priority.parent = 0; @@ -3943,7 +3941,7 @@ CURLcode Curl_data_priority_add_child(struct Curl_easy *parent, struct Curl_data_prio_node **tail; struct Curl_data_prio_node *pnode; - pnode = calloc(1, sizeof(*pnode)); + pnode = curlx_calloc(1, sizeof(*pnode)); if(!pnode) return CURLE_OUT_OF_MEMORY; pnode->data = child; diff --git a/lib/urlapi.c b/lib/urlapi.c index 9d3eb0f8cf0f..ad4d367dc34c 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -37,10 +37,6 @@ #include "curlx/strparse.h" #include "curl_memrchr.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - #ifdef _WIN32 /* MS-DOS/Windows style drive prefix, eg c: in c:foo */ #define STARTS_WITH_DRIVE_PREFIX(str) \ @@ -94,16 +90,16 @@ static CURLUcode parseurl_and_replace(const char *url, CURLU *u, static void free_urlhandle(struct Curl_URL *u) { - free(u->scheme); - free(u->user); - free(u->password); - free(u->options); - free(u->host); - free(u->zoneid); - free(u->port); - free(u->path); - free(u->query); - free(u->fragment); + curlx_free(u->scheme); + curlx_free(u->user); + curlx_free(u->password); + curlx_free(u->options); + curlx_free(u->host); + curlx_free(u->zoneid); + curlx_free(u->port); + curlx_free(u->path); + curlx_free(u->query); + curlx_free(u->fragment); } /* @@ -384,17 +380,17 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u, result = CURLUE_USER_NOT_ALLOWED; goto out; } - free(u->user); + curlx_free(u->user); u->user = userp; } if(passwdp) { - free(u->password); + curlx_free(u->password); u->password = passwdp; } if(optionsp) { - free(u->options); + curlx_free(u->options); u->options = optionsp; } @@ -404,9 +400,9 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u, out: - free(userp); - free(passwdp); - free(optionsp); + curlx_free(userp); + curlx_free(passwdp); + curlx_free(optionsp); u->user = NULL; u->password = NULL; u->options = NULL; @@ -459,7 +455,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, u->portnum = (unsigned short) port; /* generate a new port number string to get rid of leading zeroes etc */ - free(u->port); + curlx_free(u->port); u->port = curl_maprintf("%" CURL_FORMAT_CURL_OFF_T, port); if(!u->port) return CURLUE_OUT_OF_MEMORY; @@ -497,7 +493,7 @@ static CURLUcode ipv6_parse(struct Curl_URL *u, char *hostname, if(!i || (']' != *h)) return CURLUE_BAD_IPV6; zoneid[i] = 0; - u->zoneid = strdup(zoneid); + u->zoneid = curlx_strdup(zoneid); if(!u->zoneid) return CURLUE_OUT_OF_MEMORY; hostname[len] = ']'; /* insert end bracket */ @@ -675,7 +671,7 @@ static CURLUcode urldecode_host(struct dynbuf *host) return CURLUE_BAD_HOSTNAME; curlx_dyn_reset(host); result = curlx_dyn_addn(host, decoded, dlen); - free(decoded); + curlx_free(decoded); if(result) return cc2cu(result); } @@ -750,7 +746,7 @@ CURLUcode Curl_url_set_authority(CURLU *u, const char *authority) if(result) curlx_dyn_free(&host); else { - free(u->host); + curlx_free(u->host); u->host = curlx_dyn_ptr(&host); } return result; @@ -894,7 +890,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) if(curlx_dyn_len(&out)) *outp = curlx_dyn_ptr(&out); else { - *outp = strdup(""); + *outp = curlx_strdup(""); if(!*outp) return 1; } @@ -940,7 +936,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) path = &url[5]; pathlen = urllen - 5; - u->scheme = strdup("file"); + u->scheme = curlx_strdup("file"); if(!u->scheme) { result = CURLUE_OUT_OF_MEMORY; goto fail; @@ -1087,7 +1083,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) } if(schemep) { - u->scheme = strdup(schemep); + u->scheme = curlx_strdup(schemep); if(!u->scheme) { result = CURLUE_OUT_OF_MEMORY; goto fail; @@ -1124,7 +1120,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) else schemep = "http"; - u->scheme = strdup(schemep); + u->scheme = curlx_strdup(schemep); if(!u->scheme) { result = CURLUE_OUT_OF_MEMORY; goto fail; @@ -1197,7 +1193,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) } else { /* single byte query */ - u->query = strdup(""); + u->query = curlx_strdup(""); if(!u->query) { result = CURLUE_OUT_OF_MEMORY; goto fail; @@ -1241,7 +1237,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) goto fail; } if(dedot) { - free(u->path); + curlx_free(u->path); u->path = dedot; } } @@ -1277,21 +1273,21 @@ static CURLUcode parseurl_and_replace(const char *url, CURLU *u, */ CURLU *curl_url(void) { - return calloc(1, sizeof(struct Curl_URL)); + return curlx_calloc(1, sizeof(struct Curl_URL)); } void curl_url_cleanup(CURLU *u) { if(u) { free_urlhandle(u); - free(u); + curlx_free(u); } } #define DUP(dest, src, name) \ do { \ if(src->name) { \ - dest->name = strdup(src->name); \ + dest->name = curlx_strdup(src->name); \ if(!dest->name) \ goto fail; \ } \ @@ -1299,7 +1295,7 @@ void curl_url_cleanup(CURLU *u) CURLU *curl_url_dup(const CURLU *in) { - struct Curl_URL *u = calloc(1, sizeof(struct Curl_URL)); + struct Curl_URL *u = curlx_calloc(1, sizeof(struct Curl_URL)); if(u) { DUP(u, in, scheme); DUP(u, in, user); @@ -1373,7 +1369,7 @@ static CURLUcode urlget_format(const CURLU *u, CURLUPart what, /* this unconditional rejection of control bytes is documented API behavior */ CURLcode res = Curl_urldecode(part, partlen, &decoded, &dlen, REJECT_CTRL); - free(part); + curlx_free(part); if(res) return CURLUE_URLDECODE; part = decoded; @@ -1383,7 +1379,7 @@ static CURLUcode urlget_format(const CURLU *u, CURLUPart what, struct dynbuf enc; curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); uc = urlencode_str(&enc, part, partlen, TRUE, what == CURLUPART_QUERY); - free(part); + curlx_free(part); if(uc) return uc; part = curlx_dyn_ptr(&enc); @@ -1392,7 +1388,7 @@ static CURLUcode urlget_format(const CURLU *u, CURLUPart what, if(!Curl_is_ASCII_name(u->host)) { char *punyversion = NULL; uc = host_decode(part, &punyversion); - free(part); + curlx_free(part); if(uc) return uc; part = punyversion; @@ -1402,7 +1398,7 @@ static CURLUcode urlget_format(const CURLU *u, CURLUPart what, if(Curl_is_ASCII_name(u->host)) { char *unpunified = NULL; uc = host_encode(part, &unpunified); - free(part); + curlx_free(part); if(uc) return uc; part = unpunified; @@ -1520,7 +1516,7 @@ static CURLUcode urlget_url(const CURLU *u, char **part, unsigned int flags) u->query ? u->query : "", show_fragment ? "#": "", u->fragment ? u->fragment : ""); - free(allochost); + curlx_free(allochost); } if(!url) return CURLUE_OUT_OF_MEMORY; @@ -1666,7 +1662,7 @@ static CURLUcode set_url_port(CURLU *u, const char *provided_port) tmp = curl_maprintf("%" CURL_FORMAT_CURL_OFF_T, port); if(!tmp) return CURLUE_OUT_OF_MEMORY; - free(u->port); + curlx_free(u->port); u->port = tmp; u->portnum = (unsigned short)port; return CURLUE_OK; @@ -1691,7 +1687,7 @@ static CURLUcode set_url(CURLU *u, const char *url, size_t part_size, if(!uc) { /* success, meaning the "" is a fine relative URL, but nothing changes */ - free(oldurl); + curlx_free(oldurl); return CURLUE_OK; } if(uc == CURLUE_OUT_OF_MEMORY) @@ -1715,7 +1711,7 @@ static CURLUcode set_url(CURLU *u, const char *url, size_t part_size, DEBUGASSERT(oldurl); /* it is set here */ /* apply the relative part to create a new URL */ uc = redirect_url(oldurl, url, u, flags); - free(oldurl); + curlx_free(oldurl); return uc; } @@ -1930,7 +1926,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, if(curlx_dyn_add(&qbuf, newp)) goto nomem; curlx_dyn_free(&enc); - free(*storep); + curlx_free(*storep); *storep = curlx_dyn_ptr(&qbuf); return CURLUE_OK; nomem: @@ -1957,7 +1953,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, Curl_urldecode(newp, n, &decoded, &dlen, REJECT_CTRL); if(result || hostname_check(u, decoded, dlen)) bad = TRUE; - free(decoded); + curlx_free(decoded); } else if(hostname_check(u, (char *)CURL_UNCONST(newp), n)) bad = TRUE; @@ -1968,7 +1964,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, } } - free(*storep); + curlx_free(*storep); *storep = (char *)CURL_UNCONST(newp); } return CURLUE_OK; diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index 884ebce0f268..d259bc42b5b2 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -38,10 +38,6 @@ #include "../curlx/warnless.h" #include "../sendf.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_create_plain_message() * diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index 2754ddc4a29f..3b02e5751fcc 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -36,10 +36,6 @@ #include "../curl_md5.h" #include "../curlx/warnless.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_create_cram_md5_message() diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 16045707fd1e..850891f17535 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -44,10 +44,6 @@ #include "../curlx/strparse.h" #include "../rand.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #ifndef USE_WINDOWS_SSPI #define SESSION_ALGO 1 /* for algos with this bit set */ @@ -174,7 +170,7 @@ static char *auth_digest_string_quoted(const char *source) ++s; } - dest = malloc(n); + dest = curlx_malloc(n); if(dest) { char *d = dest; s = source; @@ -426,7 +422,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, /* Calculate H(A2) */ ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) { - free(spn); + curlx_free(spn); return CURLE_OUT_OF_MEMORY; } @@ -444,7 +440,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, /* Now calculate the response hash */ ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) { - free(spn); + curlx_free(spn); return CURLE_OUT_OF_MEMORY; } @@ -477,7 +473,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, "response=%s,qop=%s", userp, realm, nonce, cnonce, nonceCount, spn, resp_hash_hex, qop); - free(spn); + curlx_free(spn); if(!response) return CURLE_OUT_OF_MEMORY; @@ -522,8 +518,8 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, /* Extract a value=content pair */ if(Curl_auth_digest_get_pair(chlg, value, content, &chlg)) { if(curl_strequal(value, "nonce")) { - free(digest->nonce); - digest->nonce = strdup(content); + curlx_free(digest->nonce); + digest->nonce = curlx_strdup(content); if(!digest->nonce) return CURLE_OUT_OF_MEMORY; } @@ -534,14 +530,14 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, } } else if(curl_strequal(value, "realm")) { - free(digest->realm); - digest->realm = strdup(content); + curlx_free(digest->realm); + digest->realm = curlx_strdup(content); if(!digest->realm) return CURLE_OUT_OF_MEMORY; } else if(curl_strequal(value, "opaque")) { - free(digest->opaque); - digest->opaque = strdup(content); + curlx_free(digest->opaque); + digest->opaque = curlx_strdup(content); if(!digest->opaque) return CURLE_OUT_OF_MEMORY; } @@ -567,21 +563,21 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, /* Select only auth or auth-int. Otherwise, ignore */ if(foundAuth) { - free(digest->qop); - digest->qop = strdup(DIGEST_QOP_VALUE_STRING_AUTH); + curlx_free(digest->qop); + digest->qop = curlx_strdup(DIGEST_QOP_VALUE_STRING_AUTH); if(!digest->qop) return CURLE_OUT_OF_MEMORY; } else if(foundAuthInt) { - free(digest->qop); - digest->qop = strdup(DIGEST_QOP_VALUE_STRING_AUTH_INT); + curlx_free(digest->qop); + digest->qop = curlx_strdup(DIGEST_QOP_VALUE_STRING_AUTH_INT); if(!digest->qop) return CURLE_OUT_OF_MEMORY; } } else if(curl_strequal(value, "algorithm")) { - free(digest->algorithm); - digest->algorithm = strdup(content); + curlx_free(digest->algorithm); + digest->algorithm = curlx_strdup(content); if(!digest->algorithm) return CURLE_OUT_OF_MEMORY; @@ -725,7 +721,7 @@ static CURLcode auth_create_digest_http_message( return CURLE_OUT_OF_MEMORY; result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); - free(hashthis); + curlx_free(hashthis); if(result) return result; convert_to_ascii(hashbuf, (unsigned char *)userh); @@ -748,7 +744,7 @@ static CURLcode auth_create_digest_http_message( return CURLE_OUT_OF_MEMORY; result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); - free(hashthis); + curlx_free(hashthis); if(result) return result; convert_to_ascii(hashbuf, ha1); @@ -760,7 +756,7 @@ static CURLcode auth_create_digest_http_message( return CURLE_OUT_OF_MEMORY; result = hash(hashbuf, (unsigned char *) tmp, strlen(tmp)); - free(tmp); + curlx_free(tmp); if(result) return result; convert_to_ascii(hashbuf, ha1); @@ -790,13 +786,13 @@ static CURLcode auth_create_digest_http_message( result = hash(hashbuf, (const unsigned char *)"", 0); if(result) { - free(hashthis); + curlx_free(hashthis); return result; } convert_to_ascii(hashbuf, (unsigned char *)hashed); hashthis2 = curl_maprintf("%s:%s", hashthis, hashed); - free(hashthis); + curlx_free(hashthis); hashthis = hashthis2; } @@ -804,7 +800,7 @@ static CURLcode auth_create_digest_http_message( return CURLE_OUT_OF_MEMORY; result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); - free(hashthis); + curlx_free(hashthis); if(result) return result; convert_to_ascii(hashbuf, ha2); @@ -821,7 +817,7 @@ static CURLcode auth_create_digest_http_message( return CURLE_OUT_OF_MEMORY; result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); - free(hashthis); + curlx_free(hashthis); if(result) return result; convert_to_ascii(hashbuf, request_digest); @@ -845,18 +841,18 @@ static CURLcode auth_create_digest_http_message( if(digest->realm) realm_quoted = auth_digest_string_quoted(digest->realm); else { - realm_quoted = malloc(1); + realm_quoted = curlx_malloc(1); if(realm_quoted) realm_quoted[0] = 0; } if(!realm_quoted) { - free(userp_quoted); + curlx_free(userp_quoted); return CURLE_OUT_OF_MEMORY; } nonce_quoted = auth_digest_string_quoted(digest->nonce); if(!nonce_quoted) { - free(realm_quoted); - free(userp_quoted); + curlx_free(realm_quoted); + curlx_free(userp_quoted); return CURLE_OUT_OF_MEMORY; } @@ -893,9 +889,9 @@ static CURLcode auth_create_digest_http_message( uripath, request_digest); } - free(nonce_quoted); - free(realm_quoted); - free(userp_quoted); + curlx_free(nonce_quoted); + curlx_free(realm_quoted); + curlx_free(userp_quoted); if(!response) return CURLE_OUT_OF_MEMORY; @@ -905,12 +901,12 @@ static CURLcode auth_create_digest_http_message( /* Append the opaque */ opaque_quoted = auth_digest_string_quoted(digest->opaque); if(!opaque_quoted) { - free(response); + curlx_free(response); return CURLE_OUT_OF_MEMORY; } tmp = curl_maprintf("%s, opaque=\"%s\"", response, opaque_quoted); - free(response); - free(opaque_quoted); + curlx_free(response); + curlx_free(opaque_quoted); if(!tmp) return CURLE_OUT_OF_MEMORY; @@ -920,7 +916,7 @@ static CURLcode auth_create_digest_http_message( if(digest->algorithm) { /* Append the algorithm */ tmp = curl_maprintf("%s, algorithm=%s", response, digest->algorithm); - free(response); + curlx_free(response); if(!tmp) return CURLE_OUT_OF_MEMORY; @@ -930,7 +926,7 @@ static CURLcode auth_create_digest_http_message( if(digest->userhash) { /* Append the userhash */ tmp = curl_maprintf("%s, userhash=true", response); - free(response); + curlx_free(response); if(!tmp) return CURLE_OUT_OF_MEMORY; diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index f730c52987a3..ea6a66af9fac 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -41,10 +41,6 @@ #include "../strcase.h" #include "../strerror.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_is_digest_supported() * @@ -135,14 +131,14 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our response buffer */ - output_token = malloc(token_max); + output_token = curlx_malloc(token_max); if(!output_token) return CURLE_OUT_OF_MEMORY; /* Generate our SPN */ spn = Curl_auth_build_spn(service, data->conn->host.name, NULL); if(!spn) { - free(output_token); + curlx_free(output_token); return CURLE_OUT_OF_MEMORY; } @@ -150,8 +146,8 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, /* Populate our identity structure */ result = Curl_create_sspi_identity(userp, passwdp, &identity); if(result) { - free(spn); - free(output_token); + curlx_free(spn); + curlx_free(output_token); return result; } @@ -171,8 +167,8 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, if(status != SEC_E_OK) { Curl_sspi_free_identity(p_identity); - free(spn); - free(output_token); + curlx_free(spn); + curlx_free(output_token); return CURLE_LOGIN_DENIED; } @@ -208,8 +204,8 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); - free(spn); - free(output_token); + curlx_free(spn); + curlx_free(output_token); if(status == SEC_E_INSUFFICIENT_MEMORY) return CURLE_OUT_OF_MEMORY; @@ -233,7 +229,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, Curl_sspi_free_identity(p_identity); /* Free the SPN */ - free(spn); + curlx_free(spn); return result; } @@ -276,13 +272,13 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, if(!domain.tchar_ptr) return CURLE_OUT_OF_MEMORY; - dup_domain.tchar_ptr = Curl_tcsdup(domain.tchar_ptr); + dup_domain.tchar_ptr = curlx_tcsdup(domain.tchar_ptr); if(!dup_domain.tchar_ptr) { curlx_unicodefree(domain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } - free(identity->Domain); + curlx_free(identity->Domain); identity->Domain = dup_domain.tbyte_ptr; identity->DomainLength = curlx_uztoul(_tcslen(dup_domain.tchar_ptr)); dup_domain.tchar_ptr = NULL; @@ -429,7 +425,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, /* Allocate the output buffer according to the max token size as indicated by the security package */ - output_token = malloc(token_max); + output_token = curlx_malloc(token_max); if(!output_token) { return CURLE_OUT_OF_MEMORY; } @@ -495,7 +491,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, if(userp && *userp) { /* Populate our identity structure */ if(Curl_create_sspi_identity(userp, passwdp, &identity)) { - free(output_token); + curlx_free(output_token); return CURLE_OUT_OF_MEMORY; } @@ -503,7 +499,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, if(Curl_override_sspi_http_realm((const char *) digest->input_token, &identity)) { Curl_sspi_free_identity(&identity); - free(output_token); + curlx_free(output_token); return CURLE_OUT_OF_MEMORY; } @@ -515,20 +511,20 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, p_identity = NULL; if(userp) { - digest->user = strdup(userp); + digest->user = curlx_strdup(userp); if(!digest->user) { - free(output_token); + curlx_free(output_token); Curl_sspi_free_identity(p_identity); return CURLE_OUT_OF_MEMORY; } } if(passwdp) { - digest->passwd = strdup(passwdp); + digest->passwd = curlx_strdup(passwdp); if(!digest->passwd) { - free(output_token); + curlx_free(output_token); Curl_sspi_free_identity(p_identity); Curl_safefree(digest->user); return CURLE_OUT_OF_MEMORY; @@ -543,7 +539,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, &credentials, NULL); if(status != SEC_E_OK) { Curl_sspi_free_identity(p_identity); - free(output_token); + curlx_free(output_token); return CURLE_LOGIN_DENIED; } @@ -575,18 +571,18 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); - free(output_token); + curlx_free(output_token); return CURLE_OUT_OF_MEMORY; } /* Allocate our new context handle */ - digest->http_context = calloc(1, sizeof(CtxtHandle)); + digest->http_context = curlx_calloc(1, sizeof(CtxtHandle)); if(!digest->http_context) { Curl_pSecFn->FreeCredentialsHandle(&credentials); curlx_unicodefree(spn); Curl_sspi_free_identity(p_identity); - free(output_token); + curlx_free(output_token); return CURLE_OUT_OF_MEMORY; } @@ -610,7 +606,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); - free(output_token); + curlx_free(output_token); Curl_safefree(digest->http_context); @@ -632,7 +628,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, } resp = Curl_memdup0((const char *)output_token, output_token_len); - free(output_token); + curlx_free(output_token); if(!resp) { return CURLE_OUT_OF_MEMORY; } diff --git a/lib/vauth/gsasl.c b/lib/vauth/gsasl.c index 119c392cda13..debeda0604e2 100644 --- a/lib/vauth/gsasl.c +++ b/lib/vauth/gsasl.c @@ -36,10 +36,6 @@ #include -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - bool Curl_auth_gsasl_is_supported(struct Curl_easy *data, const char *mech, struct gsasldata *gsasl) diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index a414d0a35961..9ea36171faec 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -37,10 +37,6 @@ #include "../curl_gssapi.h" #include "../sendf.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #if defined(__GNUC__) && defined(__APPLE__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -120,12 +116,12 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, Curl_gss_log_error(data, "gss_import_name() failed: ", major_status, minor_status); - free(spn); + curlx_free(spn); return CURLE_AUTH_ERROR; } - free(spn); + curlx_free(spn); } if(chlg) { @@ -258,7 +254,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, messagelen = 4; if(authzid) messagelen += strlen(authzid); - message = malloc(messagelen); + message = curlx_malloc(messagelen); if(!message) return CURLE_OUT_OF_MEMORY; @@ -285,7 +281,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, if(GSS_ERROR(major_status)) { Curl_gss_log_error(data, "gss_wrap() failed: ", major_status, minor_status); - free(message); + curlx_free(message); return CURLE_AUTH_ERROR; } @@ -295,7 +291,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, gss_release_buffer(&unused_status, &output_token); /* Free the message buffer */ - free(message); + curlx_free(message); return result; } diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index cad2412d1794..10fbac7644db 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -36,10 +36,6 @@ #include "../curlx/multibyte.h" #include "../sendf.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_is_gssapi_supported() * @@ -131,7 +127,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our response buffer */ - krb5->output_token = malloc(krb5->token_max); + krb5->output_token = curlx_malloc(krb5->token_max); if(!krb5->output_token) return CURLE_OUT_OF_MEMORY; } @@ -152,7 +148,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, krb5->p_identity = NULL; /* Allocate our credentials handle */ - krb5->credentials = calloc(1, sizeof(CredHandle)); + krb5->credentials = curlx_calloc(1, sizeof(CredHandle)); if(!krb5->credentials) return CURLE_OUT_OF_MEMORY; @@ -166,7 +162,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, return CURLE_LOGIN_DENIED; /* Allocate our new context handle */ - krb5->context = calloc(1, sizeof(CtxtHandle)); + krb5->context = curlx_calloc(1, sizeof(CtxtHandle)); if(!krb5->context) return CURLE_OUT_OF_MEMORY; } @@ -340,7 +336,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, } /* Allocate the trailer */ - trailer = malloc(sizes.cbSecurityTrailer); + trailer = curlx_malloc(sizes.cbSecurityTrailer); if(!trailer) return CURLE_OUT_OF_MEMORY; @@ -348,7 +344,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, messagelen = 4; if(authzid) messagelen += strlen(authzid); - message = malloc(messagelen); + message = curlx_malloc(messagelen); if(!message) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -367,7 +363,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, memcpy(message + 4, authzid, messagelen - 4); /* Allocate the padding */ - padding = malloc(sizes.cbBlockSize); + padding = curlx_malloc(sizes.cbBlockSize); if(!padding) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -401,7 +397,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, /* Allocate the encryption (wrap) buffer */ appdatalen = wrap_buf[0].cbBuffer + wrap_buf[1].cbBuffer + wrap_buf[2].cbBuffer; - appdata = malloc(appdatalen); + appdata = curlx_malloc(appdatalen); if(!appdata) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -416,9 +412,9 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, out: /* Free all of our local buffers */ - free(padding); - free(message); - free(trailer); + curlx_free(padding); + curlx_free(message); + curlx_free(trailer); if(result) return result; @@ -443,14 +439,14 @@ void Curl_auth_cleanup_gssapi(struct kerberos5data *krb5) /* Free our security context */ if(krb5->context) { Curl_pSecFn->DeleteSecurityContext(krb5->context); - free(krb5->context); + curlx_free(krb5->context); krb5->context = NULL; } /* Free our credentials handle */ if(krb5->credentials) { Curl_pSecFn->FreeCredentialsHandle(krb5->credentials); - free(krb5->credentials); + curlx_free(krb5->credentials); krb5->credentials = NULL; } diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 1e9b629d8f49..a757d1c8f9fd 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -48,10 +48,6 @@ #include "vauth.h" #include "../curl_endian.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* NTLM buffer fixed size, large enough for long user + host + domain */ #define NTLM_BUFSIZE 1024 @@ -282,7 +278,7 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data, return CURLE_BAD_CONTENT_ENCODING; } - free(ntlm->target_info); /* replace any previous data */ + curlx_free(ntlm->target_info); /* replace any previous data */ ntlm->target_info = Curl_memdup(&type2[target_info_offset], target_info_len); if(!ntlm->target_info) @@ -842,7 +838,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, result = Curl_bufref_memdup(out, ntlmbuf, size); error: - free(ntlmv2resp); /* Free the dynamic buffer allocated for NTLMv2 */ + curlx_free(ntlmv2resp); /* Free the dynamic buffer allocated for NTLMv2 */ Curl_auth_cleanup_ntlm(ntlm); diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index 071617182e7e..d976bc5d2131 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -36,10 +36,6 @@ #include "../sendf.h" #include "../strdup.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_is_ntlm_supported() * @@ -117,7 +113,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our output buffer */ - ntlm->output_token = malloc(ntlm->token_max); + ntlm->output_token = curlx_malloc(ntlm->token_max); if(!ntlm->output_token) return CURLE_OUT_OF_MEMORY; @@ -137,7 +133,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, ntlm->p_identity = NULL; /* Allocate our credentials handle */ - ntlm->credentials = calloc(1, sizeof(CredHandle)); + ntlm->credentials = curlx_calloc(1, sizeof(CredHandle)); if(!ntlm->credentials) return CURLE_OUT_OF_MEMORY; @@ -151,7 +147,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, return CURLE_LOGIN_DENIED; /* Allocate our new context handle */ - ntlm->context = calloc(1, sizeof(CtxtHandle)); + ntlm->context = curlx_calloc(1, sizeof(CtxtHandle)); if(!ntlm->context) return CURLE_OUT_OF_MEMORY; @@ -343,14 +339,14 @@ void Curl_auth_cleanup_ntlm(struct ntlmdata *ntlm) /* Free our security context */ if(ntlm->context) { Curl_pSecFn->DeleteSecurityContext(ntlm->context); - free(ntlm->context); + curlx_free(ntlm->context); ntlm->context = NULL; } /* Free our credentials handle */ if(ntlm->credentials) { Curl_pSecFn->FreeCredentialsHandle(ntlm->credentials); - free(ntlm->credentials); + curlx_free(ntlm->credentials); ntlm->credentials = NULL; } diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c index cf7addf53597..0bb7a9d6bdab 100644 --- a/lib/vauth/oauth2.c +++ b/lib/vauth/oauth2.c @@ -36,10 +36,6 @@ #include "vauth.h" #include "../curlx/warnless.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_create_oauth_bearer_message() * diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index 4e9125ba4400..f956f2c03e81 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -38,10 +38,6 @@ #include "../curlx/multibyte.h" #include "../sendf.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #if defined(__GNUC__) && defined(__APPLE__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -131,12 +127,12 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, Curl_gss_log_error(data, "gss_import_name() failed: ", major_status, minor_status); - free(spn); + curlx_free(spn); return CURLE_AUTH_ERROR; } - free(spn); + curlx_free(spn); } if(chlg64 && *chlg64) { diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index b36535557bd9..90e622da3d4e 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -38,10 +38,6 @@ #include "../sendf.h" #include "../strerror.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_is_spnego_supported() * @@ -140,7 +136,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our output buffer */ - nego->output_token = malloc(nego->token_max); + nego->output_token = curlx_malloc(nego->token_max); if(!nego->output_token) return CURLE_OUT_OF_MEMORY; } @@ -161,7 +157,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, nego->p_identity = NULL; /* Allocate our credentials handle */ - nego->credentials = calloc(1, sizeof(CredHandle)); + nego->credentials = curlx_calloc(1, sizeof(CredHandle)); if(!nego->credentials) return CURLE_OUT_OF_MEMORY; @@ -175,7 +171,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, return CURLE_AUTH_ERROR; /* Allocate our new context handle */ - nego->context = calloc(1, sizeof(CtxtHandle)); + nego->context = curlx_calloc(1, sizeof(CtxtHandle)); if(!nego->context) return CURLE_OUT_OF_MEMORY; } @@ -248,7 +244,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, &resp_desc, &attrs, NULL); /* Free the decoded challenge as it is not required anymore */ - free(chlg); + curlx_free(chlg); if(GSS_ERROR(nego->status)) { char buffer[STRERROR_LEN]; @@ -305,7 +301,7 @@ CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego, nego->output_token_length, outptr, outlen); if(!result && (!*outptr || !*outlen)) { - free(*outptr); + curlx_free(*outptr); result = CURLE_REMOTE_ACCESS_DENIED; } @@ -327,14 +323,14 @@ void Curl_auth_cleanup_spnego(struct negotiatedata *nego) /* Free our security context */ if(nego->context) { Curl_pSecFn->DeleteSecurityContext(nego->context); - free(nego->context); + curlx_free(nego->context); nego->context = NULL; } /* Free our credentials handle */ if(nego->credentials) { Curl_pSecFn->FreeCredentialsHandle(nego->credentials); - free(nego->credentials); + curlx_free(nego->credentials); nego->credentials = NULL; } diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index 6ee687dcab22..6626ace8bc6a 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -32,10 +32,6 @@ #include "../curlx/multibyte.h" #include "../url.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Curl_auth_build_spn() * @@ -96,10 +92,10 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host, must be freed by curlx_unicodefree we will dupe the result so that the pointer this function returns can be normally free'd. */ tchar_spn = curlx_convert_UTF8_to_tchar(utf8_spn); - free(utf8_spn); + curlx_free(utf8_spn); if(!tchar_spn) return NULL; - dupe_tchar_spn = Curl_tcsdup(tchar_spn); + dupe_tchar_spn = curlx_tcsdup(tchar_spn); curlx_unicodefree(tchar_spn); return dupe_tchar_spn; } @@ -170,7 +166,7 @@ static void ntlm_conn_dtor(void *key, size_t klen, void *entry) (void)klen; DEBUGASSERT(ntlm); Curl_auth_cleanup_ntlm(ntlm); - free(ntlm); + curlx_free(ntlm); } struct ntlmdata *Curl_auth_ntlm_get(struct connectdata *conn, bool proxy) @@ -179,7 +175,7 @@ struct ntlmdata *Curl_auth_ntlm_get(struct connectdata *conn, bool proxy) CURL_META_NTLM_CONN; struct ntlmdata *ntlm = Curl_conn_meta_get(conn, key); if(!ntlm) { - ntlm = calloc(1, sizeof(*ntlm)); + ntlm = curlx_calloc(1, sizeof(*ntlm)); if(!ntlm || Curl_conn_meta_set(conn, key, ntlm, ntlm_conn_dtor)) return NULL; @@ -204,14 +200,14 @@ static void krb5_conn_dtor(void *key, size_t klen, void *entry) (void)klen; DEBUGASSERT(krb5); Curl_auth_cleanup_gssapi(krb5); - free(krb5); + curlx_free(krb5); } struct kerberos5data *Curl_auth_krb5_get(struct connectdata *conn) { struct kerberos5data *krb5 = Curl_conn_meta_get(conn, CURL_META_KRB5_CONN); if(!krb5) { - krb5 = calloc(1, sizeof(*krb5)); + krb5 = curlx_calloc(1, sizeof(*krb5)); if(!krb5 || Curl_conn_meta_set(conn, CURL_META_KRB5_CONN, krb5, krb5_conn_dtor)) return NULL; @@ -230,14 +226,14 @@ static void gsasl_conn_dtor(void *key, size_t klen, void *entry) (void)klen; DEBUGASSERT(gsasl); Curl_auth_gsasl_cleanup(gsasl); - free(gsasl); + curlx_free(gsasl); } struct gsasldata *Curl_auth_gsasl_get(struct connectdata *conn) { struct gsasldata *gsasl = Curl_conn_meta_get(conn, CURL_META_GSASL_CONN); if(!gsasl) { - gsasl = calloc(1, sizeof(*gsasl)); + gsasl = curlx_calloc(1, sizeof(*gsasl)); if(!gsasl || Curl_conn_meta_set(conn, CURL_META_GSASL_CONN, gsasl, gsasl_conn_dtor)) return NULL; @@ -256,7 +252,7 @@ static void nego_conn_dtor(void *key, size_t klen, void *entry) (void)klen; DEBUGASSERT(nego); Curl_auth_cleanup_spnego(nego); - free(nego); + curlx_free(nego); } struct negotiatedata *Curl_auth_nego_get(struct connectdata *conn, bool proxy) @@ -265,7 +261,7 @@ struct negotiatedata *Curl_auth_nego_get(struct connectdata *conn, bool proxy) CURL_META_NEGO_CONN; struct negotiatedata *nego = Curl_conn_meta_get(conn, key); if(!nego) { - nego = calloc(1, sizeof(*nego)); + nego = curlx_calloc(1, sizeof(*nego)); if(!nego || Curl_conn_meta_set(conn, key, nego, nego_conn_dtor)) return NULL; diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 86f7428048e1..4767780a922d 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -71,10 +71,6 @@ #include "../curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - #define QUIC_MAX_STREAMS (256*1024) #define QUIC_HANDSHAKE_TIMEOUT (10*NGTCP2_SECONDS) @@ -182,7 +178,7 @@ static void cf_ngtcp2_ctx_free(struct cf_ngtcp2_ctx *ctx) Curl_uint32_hash_destroy(&ctx->streams); Curl_ssl_peer_cleanup(&ctx->peer); } - free(ctx); + curlx_free(ctx); } static void cf_ngtcp2_setup_keep_alive(struct Curl_cfilter *cf, @@ -255,7 +251,7 @@ static void h3_stream_ctx_free(struct h3_stream_ctx *stream) { Curl_bufq_free(&stream->sendbuf); Curl_h1_req_parse_free(&stream->h1); - free(stream); + curlx_free(stream); } static void h3_stream_hash_free(unsigned int id, void *stream) @@ -277,7 +273,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, if(stream) return CURLE_OK; - stream = calloc(1, sizeof(*stream)); + stream = curlx_calloc(1, sizeof(*stream)); if(!stream) return CURLE_OUT_OF_MEMORY; @@ -1573,7 +1569,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, Curl_h1_req_parse_free(&stream->h1); nheader = Curl_dynhds_count(&h2_headers); - nva = malloc(sizeof(nghttp3_nv) * nheader); + nva = curlx_malloc(sizeof(nghttp3_nv) * nheader); if(!nva) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -1650,7 +1646,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, } out: - free(nva); + curlx_free(nva); Curl_dynhds_free(&h2_headers); return result; } @@ -2851,7 +2847,7 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf, CURLcode result; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index d6672ce13252..1c3f0c55b66e 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -57,10 +57,6 @@ #include "../curlx/warnless.h" #include "../curlx/strerr.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* A stream window is the maximum amount we need to buffer for * each active transfer. We use HTTP/3 flow control and only ACK * when we take things out of the buffer. @@ -318,10 +314,10 @@ static void cf_osslq_ctx_free(struct cf_osslq_ctx *ctx) Curl_bufcp_free(&ctx->stream_bufcp); Curl_uint32_hash_destroy(&ctx->streams); Curl_ssl_peer_cleanup(&ctx->peer); - free(ctx->poll_items); - free(ctx->curl_items); + curlx_free(ctx->poll_items); + curlx_free(ctx->curl_items); } - free(ctx); + curlx_free(ctx); } static void cf_osslq_ctx_close(struct cf_osslq_ctx *ctx) @@ -596,7 +592,7 @@ static void h3_stream_ctx_free(struct h3_stream_ctx *stream) Curl_bufq_free(&stream->sendbuf); Curl_bufq_free(&stream->recvbuf); Curl_h1_req_parse_free(&stream->h1); - free(stream); + curlx_free(stream); } static void h3_stream_hash_free(unsigned int id, void *stream) @@ -618,7 +614,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, if(stream) return CURLE_OK; - stream = calloc(1, sizeof(*stream)); + stream = curlx_calloc(1, sizeof(*stream)); if(!stream) return CURLE_OUT_OF_MEMORY; @@ -1511,18 +1507,19 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, if(ctx->items_max < Curl_uint32_hash_count(&ctx->streams)) { size_t nmax = Curl_uint32_hash_count(&ctx->streams); ctx->items_max = 0; - tmpptr = realloc(ctx->poll_items, nmax * sizeof(SSL_POLL_ITEM)); + tmpptr = curlx_realloc(ctx->poll_items, nmax * sizeof(SSL_POLL_ITEM)); if(!tmpptr) { - free(ctx->poll_items); + curlx_free(ctx->poll_items); ctx->poll_items = NULL; res = CURLE_OUT_OF_MEMORY; goto out; } ctx->poll_items = tmpptr; - tmpptr = realloc(ctx->curl_items, nmax * sizeof(struct Curl_easy *)); + tmpptr = curlx_realloc(ctx->curl_items, + nmax * sizeof(struct Curl_easy *)); if(!tmpptr) { - free(ctx->curl_items); + curlx_free(ctx->curl_items); ctx->curl_items = NULL; res = CURLE_OUT_OF_MEMORY; goto out; @@ -1922,7 +1919,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, Curl_h1_req_parse_free(&stream->h1); nheader = Curl_dynhds_count(&h2_headers); - nva = malloc(sizeof(nghttp3_nv) * nheader); + nva = curlx_malloc(sizeof(nghttp3_nv) * nheader); if(!nva) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -1999,7 +1996,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, } out: - free(nva); + curlx_free(nva); Curl_dynhds_free(&h2_headers); return result; } @@ -2407,7 +2404,7 @@ CURLcode Curl_cf_osslq_create(struct Curl_cfilter **pcf, CURLcode result; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index f8fbadeebb1f..c182e1490d23 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -52,10 +52,6 @@ #include "../vtls/keylog.h" #include "../vtls/vtls.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* HTTP/3 error values defined in RFC 9114, ch. 8.1 */ #define CURL_H3_NO_ERROR (0x0100) @@ -141,7 +137,7 @@ static void cf_quiche_ctx_free(struct cf_quiche_ctx *ctx) Curl_bufcp_free(&ctx->stream_bufcp); Curl_uint32_hash_destroy(&ctx->streams); } - free(ctx); + curlx_free(ctx); } static void cf_quiche_ctx_close(struct cf_quiche_ctx *ctx) @@ -188,7 +184,7 @@ static void h3_stream_ctx_free(struct h3_stream_ctx *stream) { Curl_bufq_free(&stream->recvbuf); Curl_h1_req_parse_free(&stream->h1); - free(stream); + curlx_free(stream); } static void h3_stream_hash_free(unsigned int id, void *stream) @@ -269,7 +265,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, if(stream) return CURLE_OK; - stream = calloc(1, sizeof(*stream)); + stream = curlx_calloc(1, sizeof(*stream)); if(!stream) return CURLE_OUT_OF_MEMORY; @@ -1000,7 +996,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, Curl_h1_req_parse_free(&stream->h1); nheader = Curl_dynhds_count(&h2_headers); - nva = malloc(sizeof(quiche_h3_header) * nheader); + nva = curlx_malloc(sizeof(quiche_h3_header) * nheader); if(!nva) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -1070,7 +1066,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, } out: - free(nva); + curlx_free(nva); Curl_dynhds_free(&h2_headers); return result; } @@ -1633,7 +1629,7 @@ CURLcode Curl_cf_quiche_create(struct Curl_cfilter **pcf, (void)data; (void)conn; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index 46bb4c7d4c25..7a3c99b58441 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -53,10 +53,6 @@ #include "../vtls/vtls_scache.h" #include "vquic-tls.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - CURLcode Curl_vquic_tls_init(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data, diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 8b4d678d8118..c1267cef9ed0 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -47,10 +47,6 @@ #include "../curlx/strerr.h" #include "../curlx/strparse.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - #if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) @@ -675,7 +671,7 @@ CURLcode Curl_qlogdir(struct Curl_easy *data, *qlogfdp = qlogfd; } curlx_dyn_free(&fname); - free(qlog_dir); + curlx_free(qlog_dir); if(result) return result; } diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 4b003bd71ca9..a5997a6f6cf9 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -72,10 +72,6 @@ #include #endif -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* A recent macro provided by libssh. Or make our own. */ #ifndef SSH_STRING_FREE_CHAR #define SSH_STRING_FREE_CHAR(x) \ @@ -491,10 +487,12 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc) cleanup: if(found_base64) { - (free)(found_base64); + /* !checksrc! disable BANNEDFUNC 1 */ + free(found_base64); /* allocated by libssh, deallocate with system free */ } if(known_base64) { - (free)(known_base64); + /* !checksrc! disable BANNEDFUNC 1 */ + free(known_base64); /* allocated by libssh, deallocate with system free */ } if(hash) ssh_clean_pubkey_hash(&hash); @@ -605,7 +603,7 @@ static int myssh_in_SFTP_READDIR(struct Curl_easy *data, } result = Curl_client_write(data, CLIENTWRITE_BODY, tmpLine, sshc->readdir_len + 1); - free(tmpLine); + curlx_free(tmpLine); if(result) { myssh_to(data, sshc, SSH_STOP); @@ -787,7 +785,7 @@ static int myssh_in_SFTP_QUOTE_STATVFS(struct Curl_easy *data, if(!result) { result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); - free(tmp); + curlx_free(tmp); } if(result) { myssh_to(data, sshc, SSH_SFTP_CLOSE); @@ -1478,8 +1476,8 @@ static int myssh_in_SFTP_REALPATH(struct Curl_easy *data, if(!sshc->homedir) return myssh_to_ERROR(data, sshc, CURLE_COULDNT_CONNECT); - free(data->state.most_recent_ftp_entrypath); - data->state.most_recent_ftp_entrypath = strdup(sshc->homedir); + curlx_free(data->state.most_recent_ftp_entrypath); + data->state.most_recent_ftp_entrypath = curlx_strdup(sshc->homedir); if(!data->state.most_recent_ftp_entrypath) return myssh_to_ERROR(data, sshc, CURLE_OUT_OF_MEMORY); @@ -1577,7 +1575,7 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data, the current directory can be read similar to how it is read when using ordinary FTP. */ result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); - free(tmp); + curlx_free(tmp); if(result) { myssh_to(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; @@ -2529,7 +2527,7 @@ static void myssh_easy_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; Curl_safefree(sshp->path); - free(sshp); + curlx_free(sshp); } static void myssh_conn_dtor(void *key, size_t klen, void *entry) @@ -2538,7 +2536,7 @@ static void myssh_conn_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; sshc_cleanup(sshc); - free(sshc); + curlx_free(sshc); } /* @@ -2550,7 +2548,7 @@ static CURLcode myssh_setup_connection(struct Curl_easy *data, struct SSHPROTO *sshp; struct ssh_conn *sshc; - sshc = calloc(1, sizeof(*sshc)); + sshc = curlx_calloc(1, sizeof(*sshc)); if(!sshc) return CURLE_OUT_OF_MEMORY; @@ -2559,7 +2557,7 @@ static CURLcode myssh_setup_connection(struct Curl_easy *data, if(Curl_conn_meta_set(conn, CURL_META_SSH_CONN, sshc, myssh_conn_dtor)) return CURLE_OUT_OF_MEMORY; - sshp = calloc(1, sizeof(*sshp)); + sshp = curlx_calloc(1, sizeof(*sshp)); if(!sshp || Curl_meta_set(data, CURL_META_SSH_EASY, sshp, myssh_easy_dtor)) return CURLE_OUT_OF_MEMORY; diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index e4ceda8c3494..4ac9d89f1ad5 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -66,10 +66,6 @@ #include "../curlx/strparse.h" #include "../curlx/base64.h" /* for base64 encoding/decoding */ -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* Local functions: */ static const char *sftp_libssh2_strerror(unsigned long err); static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc); @@ -181,7 +177,7 @@ kbd_callback(const char *name, int name_len, const char *instruction, #endif /* CURL_LIBSSH2_DEBUG */ if(num_prompts == 1) { struct connectdata *conn = data->conn; - responses[0].text = strdup(conn->passwd); + responses[0].text = curlx_strdup(conn->passwd); responses[0].length = responses[0].text == NULL ? 0 : curlx_uztoui(strlen(conn->passwd)); } @@ -635,12 +631,12 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data, failf(data, "Denied establishing ssh session: mismatch sha256 fingerprint. " "Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256); - free(fingerprint_b64); + curlx_free(fingerprint_b64); myssh_state(data, sshc, SSH_SESSION_FREE); return CURLE_PEER_FAILED_VERIFICATION; } - free(fingerprint_b64); + curlx_free(fingerprint_b64); infof(data, "SHA256 checksum match"); } @@ -881,7 +877,7 @@ static CURLcode sftp_quote(struct Curl_easy *data, the current directory can be read similar to how it is read when using ordinary FTP. */ result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); - free(tmp); + curlx_free(tmp); if(!result) myssh_state(data, sshc, SSH_SFTP_NEXT_QUOTE); return result; @@ -1204,7 +1200,7 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, sshc->rsa_pub = sshc->rsa = NULL; if(data->set.str[STRING_SSH_PRIVATE_KEY]) - sshc->rsa = strdup(data->set.str[STRING_SSH_PRIVATE_KEY]); + sshc->rsa = curlx_strdup(data->set.str[STRING_SSH_PRIVATE_KEY]); else { /* To ponder about: should really the lib be messing about with the HOME environment variable etc? */ @@ -1218,7 +1214,7 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, if(!sshc->rsa) out_of_memory = TRUE; else if(curlx_stat(sshc->rsa, &sbuf)) { - free(sshc->rsa); + curlx_free(sshc->rsa); sshc->rsa = curl_maprintf("%s/.ssh/id_dsa", home); if(!sshc->rsa) out_of_memory = TRUE; @@ -1226,19 +1222,19 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, Curl_safefree(sshc->rsa); } } - free(home); + curlx_free(home); } if(!out_of_memory && !sshc->rsa) { /* Nothing found; try the current dir. */ - sshc->rsa = strdup("id_rsa"); + sshc->rsa = curlx_strdup("id_rsa"); if(sshc->rsa && curlx_stat(sshc->rsa, &sbuf)) { - free(sshc->rsa); - sshc->rsa = strdup("id_dsa"); + curlx_free(sshc->rsa); + sshc->rsa = curlx_strdup("id_dsa"); if(sshc->rsa && curlx_stat(sshc->rsa, &sbuf)) { - free(sshc->rsa); + curlx_free(sshc->rsa); /* Out of guesses. Set to the empty string to avoid * surprising info messages. */ - sshc->rsa = strdup(""); + sshc->rsa = curlx_strdup(""); } } } @@ -1252,7 +1248,7 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, if(data->set.str[STRING_SSH_PUBLIC_KEY] /* treat empty string the same way as NULL */ && data->set.str[STRING_SSH_PUBLIC_KEY][0]) { - sshc->rsa_pub = strdup(data->set.str[STRING_SSH_PUBLIC_KEY]); + sshc->rsa_pub = curlx_strdup(data->set.str[STRING_SSH_PUBLIC_KEY]); if(!sshc->rsa_pub) out_of_memory = TRUE; } @@ -1936,12 +1932,12 @@ static CURLcode ssh_state_sftp_realpath(struct Curl_easy *data, myssh_state(data, sshc, SSH_STOP); if(rc > 0) { - free(sshc->homedir); - sshc->homedir = strdup(sshp->readdir_filename); + curlx_free(sshc->homedir); + sshc->homedir = curlx_strdup(sshp->readdir_filename); if(!sshc->homedir) return CURLE_OUT_OF_MEMORY; - free(data->state.most_recent_ftp_entrypath); - data->state.most_recent_ftp_entrypath = strdup(sshc->homedir); + curlx_free(data->state.most_recent_ftp_entrypath); + data->state.most_recent_ftp_entrypath = curlx_strdup(sshc->homedir); if(!data->state.most_recent_ftp_entrypath) return CURLE_OUT_OF_MEMORY; } @@ -2251,7 +2247,7 @@ static CURLcode ssh_state_sftp_quote_statvfs(struct Curl_easy *data, } result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); - free(tmp); + curlx_free(tmp); if(result) { myssh_state(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; @@ -3177,7 +3173,7 @@ static void myssh_easy_dtor(void *key, size_t klen, void *entry) Curl_safefree(sshp->path); curlx_dyn_free(&sshp->readdir); curlx_dyn_free(&sshp->readdir_link); - free(sshp); + curlx_free(sshp); } static void myssh_conn_dtor(void *key, size_t klen, void *entry) @@ -3186,7 +3182,7 @@ static void myssh_conn_dtor(void *key, size_t klen, void *entry) (void)key; (void)klen; sshc_cleanup(sshc, NULL, TRUE); - free(sshc); + curlx_free(sshc); } /* @@ -3199,14 +3195,14 @@ static CURLcode ssh_setup_connection(struct Curl_easy *data, struct SSHPROTO *sshp; (void)conn; - sshc = calloc(1, sizeof(*sshc)); + sshc = curlx_calloc(1, sizeof(*sshc)); if(!sshc) return CURLE_OUT_OF_MEMORY; if(Curl_conn_meta_set(conn, CURL_META_SSH_CONN, sshc, myssh_conn_dtor)) return CURLE_OUT_OF_MEMORY; - sshp = calloc(1, sizeof(*sshp)); + sshp = curlx_calloc(1, sizeof(*sshp)); if(!sshp) return CURLE_OUT_OF_MEMORY; diff --git a/lib/vssh/vssh.c b/lib/vssh/vssh.c index e33386a16aa5..a23f9e8e981f 100644 --- a/lib/vssh/vssh.c +++ b/lib/vssh/vssh.c @@ -30,9 +30,7 @@ #include #include "../curlx/strparse.h" #include "../curl_trc.h" -#include "../curl_memory.h" #include "../escape.h" -#include "../memdebug.h" #define MAX_SSHPATH_LEN 100000 /* arbitrary */ @@ -59,7 +57,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, (working_path_len > 3) && (!memcmp(working_path, "/~/", 3))) { /* It is referenced to the home directory, so strip the leading '/~/' */ if(curlx_dyn_addn(&npath, &working_path[3], working_path_len - 3)) { - free(working_path); + curlx_free(working_path); return CURLE_OUT_OF_MEMORY; } } @@ -67,7 +65,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, (!strcmp("/~", working_path) || ((working_path_len > 2) && !memcmp(working_path, "/~/", 3)))) { if(curlx_dyn_add(&npath, homedir)) { - free(working_path); + curlx_free(working_path); return CURLE_OUT_OF_MEMORY; } if(working_path_len > 2) { @@ -82,20 +80,20 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, if(curlx_dyn_addn(&npath, &working_path[copyfrom], working_path_len - copyfrom)) { - free(working_path); + curlx_free(working_path); return CURLE_OUT_OF_MEMORY; } } else { if(curlx_dyn_add(&npath, "/")) { - free(working_path); + curlx_free(working_path); return CURLE_OUT_OF_MEMORY; } } } if(curlx_dyn_len(&npath)) { - free(working_path); + curlx_free(working_path); /* store the pointer for the caller to receive */ *path = curlx_dyn_ptr(&npath); diff --git a/lib/vtls/apple.c b/lib/vtls/apple.c index 297ebc39f393..62bb9e3bd194 100644 --- a/lib/vtls/apple.c +++ b/lib/vtls/apple.c @@ -50,10 +50,6 @@ #include #endif -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #ifdef USE_APPLE_SECTRUST #define SSL_SYSTEM_VERIFIER @@ -244,11 +240,11 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf, if(error_ref) { CFIndex size = CFStringGetMaximumSizeForEncoding( CFStringGetLength(error_ref), kCFStringEncodingUTF8); - err_desc = malloc(size + 1); + err_desc = curlx_malloc(size + 1); if(err_desc) { if(!CFStringGetCString(error_ref, err_desc, size, kCFStringEncodingUTF8)) { - free(err_desc); + curlx_free(err_desc); err_desc = NULL; } } @@ -276,7 +272,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf, } out: - free(err_desc); + curlx_free(err_desc); if(error_ref) CFRelease(error_ref); if(error) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 55a75fa72150..c05ab8427b89 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -59,9 +59,6 @@ #include "../curlx/warnless.h" #include "x509asn1.h" #include "../multiif.h" -#include "../curl_memory.h" -/* The last #include file should be: */ -#include "../memdebug.h" /* Enable GnuTLS debugging by defining GTLSDEBUG */ /*#define GTLSDEBUG */ @@ -215,10 +212,10 @@ static gnutls_datum_t load_file(const char *file) if(fseek(f, 0, SEEK_END) != 0 || (filelen = ftell(f)) < 0 || fseek(f, 0, SEEK_SET) != 0 - || !(ptr = malloc((size_t)filelen))) + || !(ptr = curlx_malloc((size_t)filelen))) goto out; if(fread(ptr, 1, (size_t)filelen, f) < (size_t)filelen) { - free(ptr); + curlx_free(ptr); goto out; } @@ -231,7 +228,7 @@ static gnutls_datum_t load_file(const char *file) static void unload_file(gnutls_datum_t data) { - free(data.data); + curlx_free(data.data); } @@ -404,14 +401,14 @@ CURLcode Curl_gtls_shared_creds_create(struct Curl_easy *data, int rc; *pcreds = NULL; - shared = calloc(1, sizeof(*shared)); + shared = curlx_calloc(1, sizeof(*shared)); if(!shared) return CURLE_OUT_OF_MEMORY; rc = gnutls_certificate_allocate_credentials(&shared->creds); if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_cert_all_cred() failed: %s", gnutls_strerror(rc)); - free(shared); + curlx_free(shared); return CURLE_SSL_CONNECT_ERROR; } @@ -439,8 +436,8 @@ void Curl_gtls_shared_creds_free(struct gtls_shared_creds **pcreds) --shared->refcount; if(!shared->refcount) { gnutls_certificate_free_credentials(shared->creds); - free(shared->CAfile); - free(shared); + curlx_free(shared->CAfile); + curlx_free(shared); } } } @@ -629,7 +626,7 @@ static void gtls_set_cached_creds(struct Curl_cfilter *cf, return; if(conn_config->CAfile) { - sc->CAfile = strdup(conn_config->CAfile); + sc->CAfile = curlx_strdup(conn_config->CAfile); if(!sc->CAfile) return; } @@ -723,7 +720,7 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf, if(!sdata_len) /* gnutls does this for some version combinations */ return CURLE_OK; - sdata = malloc(sdata_len); /* get a buffer for it */ + sdata = curlx_malloc(sdata_len); /* get a buffer for it */ if(!sdata) return CURLE_OUT_OF_MEMORY; @@ -737,7 +734,7 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf, if(quic_tp && quic_tp_len) { qtp_clone = Curl_memdup0((char *)quic_tp, quic_tp_len); if(!qtp_clone) { - free(sdata); + curlx_free(sdata); return CURLE_OUT_OF_MEMORY; } } @@ -1312,7 +1309,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, if(ret != GNUTLS_E_SHORT_MEMORY_BUFFER || len1 == 0) break; /* failed */ - buff1 = malloc(len1); + buff1 = curlx_malloc(len1); if(!buff1) break; /* failed */ diff --git a/lib/vtls/hostcheck.c b/lib/vtls/hostcheck.c index 23ba33951f17..672f473db42a 100644 --- a/lib/vtls/hostcheck.c +++ b/lib/vtls/hostcheck.c @@ -37,10 +37,6 @@ #include "hostcheck.h" #include "../hostip.h" -#include "../curl_memory.h" -/* The last #include file should be: */ -#include "../memdebug.h" - /* check the two input strings with given length, but do not assume they end in nul-bytes */ static bool pmatch(const char *hostname, size_t hostlen, diff --git a/lib/vtls/keylog.c b/lib/vtls/keylog.c index 9179d38fe76f..397bac1a366a 100644 --- a/lib/vtls/keylog.c +++ b/lib/vtls/keylog.c @@ -35,10 +35,6 @@ #include "../escape.h" #include "../curlx/fopen.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* The fp for the open SSLKEYLOGFILE, or NULL if not open */ static FILE *keylog_file_fp; diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 2ea3670c1bf2..9e13ed4641d9 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -75,10 +75,6 @@ #include "../strdup.h" #include "../curl_sha256.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* ALPN for http2 */ #if defined(USE_HTTP2) && defined(MBEDTLS_SSL_ALPN) # define HAS_ALPN_MBEDTLS @@ -355,7 +351,7 @@ mbed_set_selected_ciphers(struct Curl_easy *data, for(i = 0; supported[i] != 0; i++); supported_len = i; - selected = malloc(sizeof(int) * (supported_len + 1)); + selected = curlx_malloc(sizeof(int) * (supported_len + 1)); if(!selected) return CURLE_OUT_OF_MEMORY; @@ -433,7 +429,7 @@ mbed_set_selected_ciphers(struct Curl_easy *data, selected[count] = 0; if(count == 0) { - free(selected); + curlx_free(selected); failf(data, "mbedTLS: no supported cipher in list"); return CURLE_SSL_CIPHER; } @@ -452,7 +448,7 @@ mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) (void)data, (void)crt; #else const size_t bufsize = 16384; - char *p, *buffer = malloc(bufsize); + char *p, *buffer = curlx_malloc(bufsize); if(buffer && mbedtls_x509_crt_info(buffer, bufsize, " ", crt) > 0) { infof(data, "Server certificate:"); @@ -465,7 +461,7 @@ mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) else infof(data, "Unable to dump certificate information"); - free(buffer); + curlx_free(buffer); #endif } @@ -597,7 +593,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OUT_OF_MEMORY; ret = mbedtls_x509_crt_parse(&backend->cacert, newblob, ca_info_blob->len + 1); - free(newblob); + curlx_free(newblob); if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); failf(data, "Error importing ca cert blob - mbedTLS: (-0x%04X) %s", @@ -670,7 +666,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OUT_OF_MEMORY; ret = mbedtls_x509_crt_parse(&backend->clicert, newblob, ssl_cert_blob->len + 1); - free(newblob); + curlx_free(newblob); if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); @@ -1027,12 +1023,12 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_SSL_PINNEDPUBKEYNOTMATCH; } - p = calloc(1, sizeof(*p)); + p = curlx_calloc(1, sizeof(*p)); if(!p) return CURLE_OUT_OF_MEMORY; - pubkey = malloc(PUB_DER_MAX_BYTES); + pubkey = curlx_malloc(PUB_DER_MAX_BYTES); if(!pubkey) { result = CURLE_OUT_OF_MEMORY; @@ -1064,8 +1060,8 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) &pubkey[PUB_DER_MAX_BYTES - size], size); pinnedpubkey_error: mbedtls_x509_crt_free(p); - free(p); - free(pubkey); + curlx_free(p); + curlx_free(pubkey); if(result) return result; } @@ -1122,7 +1118,7 @@ mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) goto out; } - sdata = malloc(slen); + sdata = curlx_malloc(slen); if(!sdata) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -1147,7 +1143,7 @@ mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) out: if(msession_alloced) mbedtls_ssl_session_free(&session); - free(sdata); + curlx_free(sdata); return result; } diff --git a/lib/vtls/mbedtls_threadlock.c b/lib/vtls/mbedtls_threadlock.c index 82590929cd78..91de9eceb59b 100644 --- a/lib/vtls/mbedtls_threadlock.c +++ b/lib/vtls/mbedtls_threadlock.c @@ -37,10 +37,6 @@ #include "mbedtls_threadlock.h" -/* The last 2 #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* number of thread locks */ #define NUMT 2 diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index d8f99b21c371..bdfe527acd83 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -132,10 +132,6 @@ static void ossl_provider_cleanup(struct Curl_easy *data); #include "../curlx/warnless.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #if defined(USE_OPENSSL_ENGINE) || defined(OPENSSL_HAS_PROVIDERS) #include #endif @@ -1831,7 +1827,7 @@ static CURLcode ossl_set_provider(struct Curl_easy *data, const char *iname) if(!libctx) return CURLE_OUT_OF_MEMORY; if(propq) { - data->state.propq = strdup(propq); + data->state.propq = curlx_strdup(propq); if(!data->state.propq) { OSSL_LIB_CTX_free(libctx); return CURLE_OUT_OF_MEMORY; @@ -2738,7 +2734,7 @@ CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, goto out; } - der_session_buf = der_session_ptr = malloc(der_session_size); + der_session_buf = der_session_ptr = curlx_malloc(der_session_size); if(!der_session_buf) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -2775,7 +2771,7 @@ CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, } out: - free(der_session_buf); + curlx_free(der_session_buf); return result; } @@ -2932,7 +2928,7 @@ static CURLcode ossl_win_load_store(struct Curl_easy *data, */ if(CertGetEnhancedKeyUsage(pContext, 0, NULL, &req_size)) { if(req_size && req_size > enhkey_usage_size) { - void *tmp = realloc(enhkey_usage, req_size); + void *tmp = curlx_realloc(enhkey_usage, req_size); if(!tmp) { failf(data, "SSL: Out of memory allocating for OID list"); @@ -2990,7 +2986,7 @@ static CURLcode ossl_win_load_store(struct Curl_easy *data, X509_free(x509); } - free(enhkey_usage); + curlx_free(enhkey_usage); CertFreeCertificateContext(pContext); CertCloseStore(hStore, 0); @@ -3233,8 +3229,8 @@ static void oss_x509_share_free(void *key, size_t key_len, void *p) if(share->store) { X509_STORE_free(share->store); } - free(share->CAfile); - free(share); + curlx_free(share->CAfile); + curlx_free(share); } static bool @@ -3304,14 +3300,14 @@ static void ossl_set_cached_x509_store(struct Curl_cfilter *cf, sizeof(MPROTO_OSSL_X509_KEY)-1); if(!share) { - share = calloc(1, sizeof(*share)); + share = curlx_calloc(1, sizeof(*share)); if(!share) return; if(!Curl_hash_add2(&multi->proto_hash, CURL_UNCONST(MPROTO_OSSL_X509_KEY), sizeof(MPROTO_OSSL_X509_KEY)-1, share, oss_x509_share_free)) { - free(share); + curlx_free(share); return; } } @@ -3320,7 +3316,7 @@ static void ossl_set_cached_x509_store(struct Curl_cfilter *cf, char *CAfile = NULL; if(conn_config->CAfile) { - CAfile = strdup(conn_config->CAfile); + CAfile = curlx_strdup(conn_config->CAfile); if(!CAfile) { X509_STORE_free(store); return; @@ -3329,7 +3325,7 @@ static void ossl_set_cached_x509_store(struct Curl_cfilter *cf, if(share->store) { X509_STORE_free(share->store); - free(share->CAfile); + curlx_free(share->CAfile); } share->time = curlx_now(); @@ -3516,11 +3512,11 @@ static CURLcode ossl_init_ech(struct ossl_ctx *octx, ech_config_len) != 1) { infof(data, "ECH: SSL_ECH_set1_ech_config_list failed"); if(data->set.tls_ech & CURLECH_HARD) { - free(ech_config); + curlx_free(ech_config); return CURLE_SSL_CONNECT_ERROR; } } - free(ech_config); + curlx_free(ech_config); trying_ech_now = 1; # else ech_config = (unsigned char *) data->set.str[STRING_ECH_CONFIG]; @@ -4160,7 +4156,7 @@ static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL* ssl, result = curlx_base64_encode(rcs, rcl, &b64str, &blen); if(!result && b64str) { infof(data, "ECH: retry_configs %s", b64str); - free(b64str); + curlx_free(b64str); #ifndef HAVE_BORINGSSL_LIKE rv = SSL_ech_get1_status(ssl, &inner, &outer); infof(data, "ECH: retry_configs for %s from %s, %d %d", @@ -4446,7 +4442,7 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert, if(len1 < 1) break; /* failed */ - buff1 = temp = malloc(len1); + buff1 = temp = curlx_malloc(len1); if(!buff1) break; /* failed */ @@ -4468,7 +4464,7 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert, } while(0); if(buff1) - free(buff1); + curlx_free(buff1); return result; } diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index cc19a328eda1..e4251a915198 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -42,10 +42,6 @@ #include "cipher_suite.h" #include "x509asn1.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - struct rustls_ssl_backend_data { const struct rustls_client_config *config; @@ -586,7 +582,7 @@ init_config_builder(struct Curl_easy *data, } #endif /* USE_ECH */ - cipher_suites = malloc(sizeof(*cipher_suites) * (cipher_suites_len)); + cipher_suites = curlx_malloc(sizeof(*cipher_suites) * (cipher_suites_len)); if(!cipher_suites) { result = CURLE_OUT_OF_MEMORY; goto cleanup; @@ -643,7 +639,7 @@ init_config_builder(struct Curl_easy *data, cleanup: if(cipher_suites) { - free(cipher_suites); + curlx_free(cipher_suites); } if(custom_provider_builder) { rustls_crypto_provider_builder_free(custom_provider_builder); @@ -1004,7 +1000,7 @@ init_config_builder_ech(struct Curl_easy *data, cleanup: /* if we base64 decoded, we can free now */ if(data->set.tls_ech & CURLECH_CLA_CFG && data->set.str[STRING_ECH_CONFIG]) { - free(ech_config); + curlx_free(ech_config); } if(dns) { Curl_resolv_unlink(data, &dns); diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index e5fbe40a8c1a..49a4516cdfc8 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -60,10 +60,6 @@ #include "../progress.h" #include "../curl_sha256.h" -/* The last #include file should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* Some verbose debug messages are wrapped by SCH_DEV() instead of DEBUGF() * and only shown if CURL_SCHANNEL_DEV_DEBUG was defined at build time. These * messages are extra verbose and intended for curl developers debugging @@ -427,7 +423,7 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, return CURLE_SSL_CERTPROBLEM; *sep = TEXT('\0'); - *store_path = Curl_tcsdup(store_path_start); + *store_path = curlx_tcsdup(store_path_start); *sep = TEXT('\\'); if(!*store_path) return CURLE_OUT_OF_MEMORY; @@ -571,7 +567,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, failf(data, "schannel: certificate format compatibility error " " for %s", blob ? "(memory blob)" : data->set.ssl.primary.clientcert); - free(cert_store_path); + curlx_free(cert_store_path); curlx_unicodefree(cert_path); if(fInCert) curlx_fclose(fInCert); @@ -589,7 +585,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, int cert_find_flags; const char *cert_showfilename_error = blob ? "(memory blob)" : data->set.ssl.primary.clientcert; - free(cert_store_path); + curlx_free(cert_store_path); curlx_unicodefree(cert_path); if(fInCert) { long cert_tell = 0; @@ -603,7 +599,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_SET) == 0; if(continue_reading) - certdata = malloc(certsize + 1); + certdata = curlx_malloc(certsize + 1); if((!certdata) || ((int) fread(certdata, certsize, 1, fInCert) != 1)) continue_reading = FALSE; @@ -611,7 +607,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, if(!continue_reading) { failf(data, "schannel: Failed to read cert file %s", data->set.ssl.primary.clientcert); - free(certdata); + curlx_free(certdata); return CURLE_SSL_CERTPROBLEM; } } @@ -622,7 +618,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, if(data->set.ssl.key_passwd) pwd_len = strlen(data->set.ssl.key_passwd); - pszPassword = (WCHAR*)malloc(sizeof(WCHAR)*(pwd_len + 1)); + pszPassword = (WCHAR*)curlx_malloc(sizeof(WCHAR)*(pwd_len + 1)); if(pszPassword) { if(pwd_len > 0) str_w_len = MultiByteToWideChar(CP_UTF8, @@ -642,10 +638,10 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, else cert_store = PFXImportCertStore(&datablob, pszPassword, 0); - free(pszPassword); + curlx_free(pszPassword); } if(!blob) - free(certdata); + curlx_free(certdata); if(!cert_store) { DWORD errorcode = GetLastError(); if(errorcode == ERROR_INVALID_PASSWORD) @@ -699,12 +695,12 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, cert_store_name, (path_utf8 ? path_utf8 : "(unknown)"), GetLastError()); - free(cert_store_path); + curlx_free(cert_store_path); curlx_unicodefree(path_utf8); curlx_unicodefree(cert_path); return CURLE_SSL_CERTPROBLEM; } - free(cert_store_path); + curlx_free(cert_store_path); cert_thumbprint.pbData = cert_thumbprint_data; cert_thumbprint.cbData = CERT_THUMBPRINT_DATA_LEN; @@ -738,7 +734,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, /* allocate memory for the reusable credential handle */ backend->cred = (struct Curl_schannel_cred *) - calloc(1, sizeof(struct Curl_schannel_cred)); + curlx_calloc(1, sizeof(struct Curl_schannel_cred)); if(!backend->cred) { failf(data, "schannel: unable to allocate memory"); @@ -1019,7 +1015,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* allocate memory for the security context handle */ backend->ctxt = (struct Curl_schannel_ctxt *) - calloc(1, sizeof(struct Curl_schannel_ctxt)); + curlx_calloc(1, sizeof(struct Curl_schannel_ctxt)); if(!backend->ctxt) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; @@ -1170,7 +1166,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) if(!backend->decdata_buffer) { backend->decdata_offset = 0; backend->decdata_length = CURL_SCHANNEL_BUFFER_INIT_SIZE; - backend->decdata_buffer = malloc(backend->decdata_length); + backend->decdata_buffer = curlx_malloc(backend->decdata_length); if(!backend->decdata_buffer) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; @@ -1182,7 +1178,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) backend->encdata_is_incomplete = FALSE; backend->encdata_offset = 0; backend->encdata_length = CURL_SCHANNEL_BUFFER_INIT_SIZE; - backend->encdata_buffer = malloc(backend->encdata_length); + backend->encdata_buffer = curlx_malloc(backend->encdata_length); if(!backend->encdata_buffer) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; @@ -1195,8 +1191,8 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* increase internal encrypted data buffer */ size_t reallocated_length = backend->encdata_offset + CURL_SCHANNEL_BUFFER_FREE_SIZE; - reallocated_buffer = realloc(backend->encdata_buffer, - reallocated_length); + reallocated_buffer = curlx_realloc(backend->encdata_buffer, + reallocated_length); if(!reallocated_buffer) { failf(data, "schannel: unable to re-allocate memory"); @@ -1247,7 +1243,8 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) backend->encdata_offset, backend->encdata_length)); /* setup input buffers */ - InitSecBuffer(&inbuf[0], SECBUFFER_TOKEN, malloc(backend->encdata_offset), + InitSecBuffer(&inbuf[0], SECBUFFER_TOKEN, + curlx_malloc(backend->encdata_offset), curlx_uztoul(backend->encdata_offset)); InitSecBuffer(&inbuf[1], SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&inbuf_desc, inbuf, 2); @@ -1274,7 +1271,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) if(!SOCKET_WRITABLE(Curl_conn_cf_get_socket(cf, data), 0)) { SCH_DEV(infof(data, "schannel: handshake waiting for writeable socket")); connssl->io_need = CURL_SSL_IO_NEED_SEND; - free(inbuf[0].pvBuffer); + curlx_free(inbuf[0].pvBuffer); return CURLE_OK; } @@ -1931,7 +1928,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* calculate the complete message length and allocate a buffer for it */ data_len = backend->stream_sizes.cbHeader + len + backend->stream_sizes.cbTrailer; - ptr = (unsigned char *)malloc(data_len); + ptr = (unsigned char *)curlx_malloc(data_len); if(!ptr) { return CURLE_OUT_OF_MEMORY; } @@ -2110,8 +2107,8 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(reallocated_length < min_encdata_length) { reallocated_length = min_encdata_length; } - reallocated_buffer = realloc(backend->encdata_buffer, - reallocated_length); + reallocated_buffer = curlx_realloc(backend->encdata_buffer, + reallocated_length); if(!reallocated_buffer) { result = CURLE_OUT_OF_MEMORY; failf(data, "schannel: unable to re-allocate memory"); @@ -2196,8 +2193,8 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(reallocated_length < len) { reallocated_length = len; } - reallocated_buffer = realloc(backend->decdata_buffer, - reallocated_length); + reallocated_buffer = curlx_realloc(backend->decdata_buffer, + reallocated_length); if(!reallocated_buffer) { result = CURLE_OUT_OF_MEMORY; failf(data, "schannel: unable to re-allocate memory"); @@ -2819,8 +2816,8 @@ static void schannel_cert_share_free(void *key, size_t key_len, void *p) if(share->cert_store) { CertCloseStore(share->cert_store, 0); } - free(share->CAfile); - free(share); + curlx_free(share->CAfile); + curlx_free(share); } bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, @@ -2844,7 +2841,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, CURL_UNCONST(MPROTO_SCHANNEL_CERT_SHARE_KEY), sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1); if(!share) { - share = calloc(1, sizeof(*share)); + share = curlx_calloc(1, sizeof(*share)); if(!share) { return FALSE; } @@ -2852,7 +2849,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, CURL_UNCONST(MPROTO_SCHANNEL_CERT_SHARE_KEY), sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1, share, schannel_cert_share_free)) { - free(share); + curlx_free(share); return FALSE; } } @@ -2866,7 +2863,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, } else { if(conn_config->CAfile) { - CAfile = strdup(conn_config->CAfile); + CAfile = curlx_strdup(conn_config->CAfile); if(!CAfile) { return FALSE; } @@ -2877,7 +2874,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, if(share->cert_store) { CertCloseStore(share->cert_store, 0); } - free(share->CAfile); + curlx_free(share->CAfile); share->time = curlx_now(); share->cert_store = cert_store; diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index 72c42ed35341..4ff7b5d536a1 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -49,10 +49,6 @@ #include "hostcheck.h" #include "../curlx/version_win32.h" -/* The last #include file should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend) #define MAX_CAFILE_SIZE 1048576 /* 1 MiB */ @@ -319,7 +315,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, } ca_file_bufsize = (size_t)file_size.QuadPart; - ca_file_buffer = (char *)malloc(ca_file_bufsize + 1); + ca_file_buffer = (char *)curlx_malloc(ca_file_bufsize + 1); if(!ca_file_buffer) { result = CURLE_OUT_OF_MEMORY; goto cleanup; @@ -606,7 +602,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, /* CertGetNameString guarantees that the returned name will not contain * embedded null bytes. This appears to be undocumented behavior. */ - cert_hostname_buff = (LPTSTR)malloc(len * sizeof(TCHAR)); + cert_hostname_buff = (LPTSTR)curlx_malloc(len * sizeof(TCHAR)); if(!cert_hostname_buff) { result = CURLE_OUT_OF_MEMORY; goto cleanup; diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 3b242fd485d2..6eb60e41cf99 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -81,15 +81,11 @@ #include #endif -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #define CLONE_STRING(var) \ do { \ if(source->var) { \ - dest->var = strdup(source->var); \ + dest->var = curlx_strdup(source->var); \ if(!dest->var) \ return FALSE; \ } \ @@ -111,7 +107,7 @@ static CURLcode blobdup(struct curl_blob **dest, if(src) { /* only if there is data to dupe! */ struct curl_blob *d; - d = malloc(sizeof(struct curl_blob) + src->len); + d = curlx_malloc(sizeof(struct curl_blob) + src->len); if(!d) return CURLE_OUT_OF_MEMORY; d->len = src->len; @@ -503,16 +499,16 @@ static struct ssl_connect_data *cf_ctx_new(struct Curl_easy *data, struct ssl_connect_data *ctx; (void)data; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) return NULL; ctx->ssl_impl = Curl_ssl; ctx->alpn = alpn; Curl_bufq_init2(&ctx->earlydata, CURL_SSL_EARLY_MAX, 1, BUFQ_OPT_NO_SPARES); - ctx->backend = calloc(1, ctx->ssl_impl->sizeof_ssl_backend_data); + ctx->backend = curlx_calloc(1, ctx->ssl_impl->sizeof_ssl_backend_data); if(!ctx->backend) { - free(ctx); + curlx_free(ctx); return NULL; } return ctx; @@ -523,8 +519,8 @@ static void cf_ctx_free(struct ssl_connect_data *ctx) if(ctx) { Curl_safefree(ctx->negotiated.alpn); Curl_bufq_free(&ctx->earlydata); - free(ctx->backend); - free(ctx); + curlx_free(ctx->backend); + curlx_free(ctx); } } @@ -617,7 +613,7 @@ void Curl_ssl_free_certinfo(struct Curl_easy *data) ci->certinfo[i] = NULL; } - free(ci->certinfo); /* free the actual array too */ + curlx_free(ci->certinfo); /* free the actual array too */ ci->certinfo = NULL; ci->num_of_certs = 0; } @@ -632,7 +628,7 @@ CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num) Curl_ssl_free_certinfo(data); /* Allocate the required certificate information structures */ - table = calloc((size_t) num, sizeof(struct curl_slist *)); + table = curlx_calloc((size_t) num, sizeof(struct curl_slist *)); if(!table) return CURLE_OUT_OF_MEMORY; @@ -783,7 +779,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, } /* compute sha256sum of public key */ - sha256sumdigest = malloc(CURL_SHA256_DIGEST_LENGTH); + sha256sumdigest = curlx_malloc(CURL_SHA256_DIGEST_LENGTH); if(!sha256sumdigest) return CURLE_OUT_OF_MEMORY; encode = Curl_ssl->sha256sum(pubkey, pubkeylen, @@ -1118,7 +1114,7 @@ static int multissl_setup(const struct Curl_ssl *backend) for(i = 0; available_backends[i]; i++) { if(curl_strequal(env, available_backends[i]->info.name)) { Curl_ssl = available_backends[i]; - free(env); + curlx_free(env); return 0; } } @@ -1129,7 +1125,7 @@ static int multissl_setup(const struct Curl_ssl *backend) if(curl_strequal(CURL_DEFAULT_SSL_BACKEND, available_backends[i]->info.name)) { Curl_ssl = available_backends[i]; - free(env); + curlx_free(env); return 0; } } @@ -1137,7 +1133,7 @@ static int multissl_setup(const struct Curl_ssl *backend) /* Fall back to first available backend */ Curl_ssl = available_backends[0]; - free(env); + curlx_free(env); return 0; } @@ -1190,7 +1186,7 @@ void Curl_ssl_peer_cleanup(struct ssl_peer *peer) { Curl_safefree(peer->sni); if(peer->dispname != peer->hostname) - free(peer->dispname); + curlx_free(peer->dispname); peer->dispname = NULL; Curl_safefree(peer->hostname); Curl_safefree(peer->scache_key); @@ -1266,13 +1262,13 @@ CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, goto out; } - peer->hostname = strdup(ehostname); + peer->hostname = curlx_strdup(ehostname); if(!peer->hostname) goto out; if(!edispname || !strcmp(ehostname, edispname)) peer->dispname = peer->hostname; else { - peer->dispname = strdup(edispname); + peer->dispname = curlx_strdup(edispname); if(!peer->dispname) goto out; } @@ -1284,7 +1280,7 @@ CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, if(len && (peer->hostname[len-1] == '.')) len--; if(len < USHRT_MAX) { - peer->sni = calloc(1, len + 1); + peer->sni = curlx_calloc(1, len + 1); if(!peer->sni) goto out; Curl_strntolower(peer->sni, peer->hostname, len); diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 3524a25a4417..21dfe2eaa032 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -47,10 +47,6 @@ #include "../rand.h" #include "../curlx/warnless.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - static bool cf_ssl_peer_key_is_global(const char *peer_key); @@ -104,10 +100,10 @@ static void cf_ssl_scache_session_ldestroy(void *udata, void *obj) { struct Curl_ssl_session *s = obj; (void)udata; - free(CURL_UNCONST(s->sdata)); - free(CURL_UNCONST(s->quic_tp)); - free((void *)s->alpn); - free(s); + curlx_free(CURL_UNCONST(s->sdata)); + curlx_free(CURL_UNCONST(s->quic_tp)); + curlx_free((void *)s->alpn); + curlx_free(s); } CURLcode @@ -131,15 +127,15 @@ Curl_ssl_session_create2(void *sdata, size_t sdata_len, struct Curl_ssl_session *s; if(!sdata || !sdata_len) { - free(sdata); + curlx_free(sdata); return CURLE_BAD_FUNCTION_ARGUMENT; } *psession = NULL; - s = calloc(1, sizeof(*s)); + s = curlx_calloc(1, sizeof(*s)); if(!s) { - free(sdata); - free(quic_tp); + curlx_free(sdata); + curlx_free(quic_tp); return CURLE_OUT_OF_MEMORY; } @@ -151,7 +147,7 @@ Curl_ssl_session_create2(void *sdata, size_t sdata_len, s->quic_tp = quic_tp; s->quic_tp_len = quic_tp_len; if(alpn) { - s->alpn = strdup(alpn); + s->alpn = curlx_strdup(alpn); if(!s->alpn) { cf_ssl_scache_session_ldestroy(NULL, s); return CURLE_OUT_OF_MEMORY; @@ -231,7 +227,7 @@ cf_ssl_scache_peer_init(struct Curl_ssl_scache_peer *peer, DEBUGASSERT(!peer->ssl_peer_key); if(ssl_peer_key) { - peer->ssl_peer_key = strdup(ssl_peer_key); + peer->ssl_peer_key = curlx_strdup(ssl_peer_key); if(!peer->ssl_peer_key) goto out; peer->hmac_set = FALSE; @@ -246,17 +242,17 @@ cf_ssl_scache_peer_init(struct Curl_ssl_scache_peer *peer, goto out; } if(clientcert) { - peer->clientcert = strdup(clientcert); + peer->clientcert = curlx_strdup(clientcert); if(!peer->clientcert) goto out; } if(srp_username) { - peer->srp_username = strdup(srp_username); + peer->srp_username = curlx_strdup(srp_username); if(!peer->srp_username) goto out; } if(srp_password) { - peer->srp_password = strdup(srp_password); + peer->srp_password = curlx_strdup(srp_password); if(!peer->srp_password) goto out; } @@ -315,13 +311,13 @@ CURLcode Curl_ssl_scache_create(size_t max_peers, size_t i; *pscache = NULL; - peers = calloc(max_peers, sizeof(*peers)); + peers = curlx_calloc(max_peers, sizeof(*peers)); if(!peers) return CURLE_OUT_OF_MEMORY; - scache = calloc(1, sizeof(*scache)); + scache = curlx_calloc(1, sizeof(*scache)); if(!scache) { - free(peers); + curlx_free(peers); return CURLE_OUT_OF_MEMORY; } @@ -348,8 +344,8 @@ void Curl_ssl_scache_destroy(struct Curl_ssl_scache *scache) for(i = 0; i < scache->peer_count; ++i) { cf_ssl_scache_clear_peer(&scache->peers[i]); } - free(scache->peers); - free(scache); + curlx_free(scache->peers); + curlx_free(scache); } } @@ -396,7 +392,8 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf, char *abspath = realpath(path, NULL); if(abspath) { CURLcode r = curlx_dyn_addf(buf, ":%s-%s", name, abspath); - (free)(abspath); /* allocated by libc, free without memdebug */ + /* !checksrc! disable BANNEDFUNC 1 */ + free(abspath); /* allocated by libc, free without memdebug */ return r; } *is_local = TRUE; @@ -675,7 +672,7 @@ cf_ssl_find_peer_by_key(struct Curl_easy *data, /* remember peer_key for future lookups */ CURL_TRC_SSLS(data, "peer entry %zu key recovered: %s", i, ssl_peer_key); - scache->peers[i].ssl_peer_key = strdup(ssl_peer_key); + scache->peers[i].ssl_peer_key = curlx_strdup(ssl_peer_key); if(!scache->peers[i].ssl_peer_key) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/vtls/vtls_spack.c b/lib/vtls/vtls_spack.c index d86f31d72721..070bb485a350 100644 --- a/lib/vtls/vtls_spack.c +++ b/lib/vtls/vtls_spack.c @@ -32,10 +32,6 @@ #include "vtls_spack.h" #include "../strdup.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #ifndef UINT16_MAX #define UINT16_MAX 0xffff #endif @@ -267,7 +263,7 @@ CURLcode Curl_ssl_session_unpack(struct Curl_easy *data, goto out; } - s = calloc(1, sizeof(*s)); + s = curlx_calloc(1, sizeof(*s)); if(!s) { r = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 2ad033f98899..eae17078fd35 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -75,10 +75,6 @@ #include #include "wolfssl.h" -/* The last #include files should be: */ -#include "../curl_memory.h" -#include "../memdebug.h" - #ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG #define USE_ECH_WOLFSSL #endif @@ -447,7 +443,7 @@ CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, result = CURLE_FAILED_INIT; goto out; } - sdata = calloc(1, sdata_len); + sdata = curlx_calloc(1, sdata_len); if(!sdata) { failf(data, "unable to allocate session buffer of %u bytes", sdata_len); result = CURLE_OUT_OF_MEMORY; @@ -462,7 +458,7 @@ CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, if(quic_tp && quic_tp_len) { qtp_clone = Curl_memdup0((char *)quic_tp, quic_tp_len); if(!qtp_clone) { - free(sdata); + curlx_free(sdata); return CURLE_OUT_OF_MEMORY; } } @@ -483,7 +479,7 @@ CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, } out: - free(sdata); + curlx_free(sdata); return result; } @@ -726,8 +722,8 @@ static void wssl_x509_share_free(void *key, size_t key_len, void *p) if(share->store) { wolfSSL_X509_STORE_free(share->store); } - free(share->CAfile); - free(share); + curlx_free(share->CAfile); + curlx_free(share); } static bool @@ -792,14 +788,14 @@ static void wssl_set_cached_x509_store(struct Curl_cfilter *cf, sizeof(MPROTO_WSSL_X509_KEY)-1); if(!share) { - share = calloc(1, sizeof(*share)); + share = curlx_calloc(1, sizeof(*share)); if(!share) return; if(!Curl_hash_add2(&multi->proto_hash, CURL_UNCONST(MPROTO_WSSL_X509_KEY), sizeof(MPROTO_WSSL_X509_KEY)-1, share, wssl_x509_share_free)) { - free(share); + curlx_free(share); return; } } @@ -808,7 +804,7 @@ static void wssl_set_cached_x509_store(struct Curl_cfilter *cf, char *CAfile = NULL; if(conn_config->CAfile) { - CAfile = strdup(conn_config->CAfile); + CAfile = curlx_strdup(conn_config->CAfile); if(!CAfile) { wolfSSL_X509_STORE_free(store); return; @@ -817,7 +813,7 @@ static void wssl_set_cached_x509_store(struct Curl_cfilter *cf, if(share->store) { wolfSSL_X509_STORE_free(share->store); - free(share->CAfile); + curlx_free(share->CAfile); } share->time = curlx_now(); @@ -1821,7 +1817,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, &b64str, &blen); if(!result && b64str) infof(data, "ECH: (not yet) retry_configs %s", b64str); - free(b64str); + curlx_free(b64str); } return CURLE_SSL_CONNECT_ERROR; } diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index 417a5382d873..fcc0d0e1daf2 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -49,10 +49,6 @@ #include "x509asn1.h" #include "../curlx/dynbuf.h" -/* The last 2 #include files should be in this order */ -#include "../curl_memory.h" -#include "../memdebug.h" - /* * Constants. */ @@ -1260,7 +1256,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, if(!result) result = curlx_dyn_add(&out, "-----END CERTIFICATE-----\n"); } - free(certptr); + curlx_free(certptr); if(!result) if(data->set.ssl.certinfo) result = ssl_push_certinfo_dyn(data, certnum, "Cert", &out); diff --git a/lib/ws.c b/lib/ws.c index 15dc2e9aea7e..93e13e1ac184 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -43,10 +43,6 @@ #include "curlx/strparse.h" #include "curlx/warnless.h" -/* The last 2 #include files should be in this order */ -#include "curl_memory.h" -#include "memdebug.h" - /*** RFC 6455 Section 5.2 @@ -1281,11 +1277,11 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) return result; DEBUGASSERT(randlen < sizeof(keyval)); if(randlen >= sizeof(keyval)) { - free(randstr); + curlx_free(randstr); return CURLE_FAILED_INIT; } strcpy(keyval, randstr); - free(randstr); + curlx_free(randstr); for(i = 0; !result && (i < CURL_ARRAYSIZE(heads)); i++) { if(!Curl_checkheaders(data, heads[i].name, strlen(heads[i].name))) { result = curlx_dyn_addf(req, "%s: %s\r\n", heads[i].name, @@ -1305,7 +1301,7 @@ static void ws_conn_dtor(void *key, size_t klen, void *entry) (void)klen; Curl_bufq_free(&ws->recvbuf); Curl_bufq_free(&ws->sendbuf); - free(ws); + curlx_free(ws); } /* @@ -1325,7 +1321,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data, ws = Curl_conn_meta_get(data->conn, CURL_META_PROTO_WS_CONN); if(!ws) { size_t chunk_size = WS_CHUNK_SIZE; - ws = calloc(1, sizeof(*ws)); + ws = curlx_calloc(1, sizeof(*ws)); if(!ws) return CURLE_OUT_OF_MEMORY; #ifdef DEBUGBUILD diff --git a/packages/Makefile.am b/packages/Makefile.am index 43e544a0195c..8b6d4dc4b242 100644 --- a/packages/Makefile.am +++ b/packages/Makefile.am @@ -24,6 +24,7 @@ SUBDIRS = vms EXTRA_DIST = README.md \ + OS400/.checksrc \ OS400/README.OS400 \ OS400/rpg-examples \ OS400/ccsidcurl.c \ diff --git a/packages/OS400/.checksrc b/packages/OS400/.checksrc new file mode 100644 index 000000000000..aae405506b9e --- /dev/null +++ b/packages/OS400/.checksrc @@ -0,0 +1,9 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +# Possible not what we want, but cannot test, just silence the warnings +allowfunc calloc +allowfunc free +allowfunc malloc +allowfunc realloc diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 49290ff137a5..87b72af96326 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -69,10 +69,12 @@ "aprintf" => 1, "atoi" => 1, "atol" => 1, + "calloc" => 1, "fclose" => 1, "fdopen" => 1, "fopen" => 1, "fprintf" => 1, + "free" => 1, "freeaddrinfo" => 1, "freopen" => 1, "getaddrinfo" => 1, @@ -85,11 +87,13 @@ "LoadLibraryExW" => 1, "LoadLibraryW" => 1, "localtime" => 1, + "malloc" => 1, "mbstowcs" => 1, "msnprintf" => 1, "mvsnprintf" => 1, "open" => 1, "printf" => 1, + "realloc" => 1, "recv" => 1, "send" => 1, "snprintf" => 1, @@ -99,6 +103,7 @@ "sscanf" => 1, "stat" => 1, "strcat" => 1, + "strdup" => 1, "strerror" => 1, "strncat" => 1, "strncpy" => 1, diff --git a/src/mkhelp.pl b/src/mkhelp.pl index d1a040c0cc63..b3a6c5abdce7 100755 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -78,7 +78,6 @@ print < -#include /* keep this as LAST include */ static const unsigned char hugehelpgz[] = { /* This mumbo-jumbo is the huge help text compressed with gzip. Thanks to this operation, the size of this data shrank from $gzip @@ -105,13 +104,13 @@ static voidpf zalloc_func(voidpf opaque, unsigned int items, unsigned int size) { (void)opaque; - /* not a typo, keep it calloc() */ - return (voidpf) calloc(items, size); + /* not a typo, keep it curlx_calloc() */ + return (voidpf)curlx_calloc(items, size); } static void zfree_func(voidpf opaque, voidpf ptr) { (void)opaque; - free(ptr); + curlx_free(ptr); } #define HEADERLEN 10 @@ -136,7 +135,7 @@ if(inflateInit2(&z, -MAX_WBITS) != Z_OK) return; - buf = malloc(BUF_SIZE); + buf = curlx_malloc(BUF_SIZE); if(buf) { while(1) { z.avail_out = BUF_SIZE; @@ -150,7 +149,7 @@ else break; /* error */ } - free(buf); + curlx_free(buf); } inflateEnd(&z); } @@ -176,7 +175,7 @@ if(inflateInit2(&z, -MAX_WBITS) != Z_OK) return; - buf = malloc(BUF_SIZE); + buf = curlx_malloc(BUF_SIZE); if(buf) { while(1) { z.avail_out = BUF_SIZE; @@ -192,7 +191,7 @@ else break; /* error */ } - free(buf); + curlx_free(buf); } inflateEnd(&z); } diff --git a/src/slist_wc.c b/src/slist_wc.c index 7f1e8f19be8d..26a91362b8e3 100644 --- a/src/slist_wc.c +++ b/src/slist_wc.c @@ -28,9 +28,6 @@ #include "slist_wc.h" -/* The last #include files should be: */ -#include "memdebug.h" - /* * slist_wc_append() appends a string to the linked list. This function can be * used as an initialization function as well as an append function. @@ -44,7 +41,7 @@ struct slist_wc *slist_wc_append(struct slist_wc *list, return NULL; if(!list) { - list = malloc(sizeof(struct slist_wc)); + list = curlx_malloc(sizeof(struct slist_wc)); if(!list) { curl_slist_free_all(new_item); @@ -68,7 +65,7 @@ void slist_wc_free_all(struct slist_wc *list) return; curl_slist_free_all(list->first); - free(list); + curlx_free(list); } #endif /* CURL_DISABLE_LIBCURL_OPTION */ diff --git a/src/terminal.c b/src/terminal.c index 867ca6edcf88..bb3e2ac61184 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -28,7 +28,6 @@ #endif #include "terminal.h" -#include "memdebug.h" /* keep this as LAST include */ #ifdef HAVE_TERMIOS_H # include diff --git a/src/tool_bname.c b/src/tool_bname.c index 4ba1a3b8eeac..50d77abb9644 100644 --- a/src/tool_bname.c +++ b/src/tool_bname.c @@ -25,8 +25,6 @@ #include "tool_bname.h" -#include "memdebug.h" /* keep this as LAST include */ - #ifndef HAVE_BASENAME char *tool_basename(char *path) diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c index 043daef26dd0..b858b6688e6e 100644 --- a/src/tool_cb_dbg.c +++ b/src/tool_cb_dbg.c @@ -28,8 +28,6 @@ #include "tool_cb_dbg.h" #include "tool_util.h" -#include "memdebug.h" /* keep this as LAST include */ - static void dump(const char *timebuf, const char *idsbuf, const char *text, FILE *stream, const unsigned char *ptr, size_t size, trace tracetype, curl_infotype infotype); diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index d4431a74b951..7a5a475981d5 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -36,8 +36,6 @@ #include "tool_libinfo.h" #include "tool_strdup.h" -#include "memdebug.h" /* keep this as LAST include */ - static char *parse_filename(const char *ptr, size_t len); #ifdef _WIN32 @@ -212,14 +210,14 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) if(filename) { if(outs->stream) { /* indication of problem, get out! */ - free(filename); + curlx_free(filename); return CURL_WRITEFUNC_ERROR; } if(per->config->output_dir) { outs->filename = curl_maprintf("%s/%s", per->config->output_dir, filename); - free(filename); + curlx_free(filename); if(!outs->filename) return CURL_WRITEFUNC_ERROR; } @@ -252,7 +250,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) if(clone) { struct curl_slist *old = hdrcbdata->headlist; hdrcbdata->headlist = curl_slist_append(old, clone); - free(clone); + curlx_free(clone); if(!hdrcbdata->headlist) { curl_slist_free_all(old); return CURL_WRITEFUNC_ERROR; @@ -479,7 +477,7 @@ static void write_linked_location(CURL *curl, const char *location, curl_free(finalurl); curl_free(scheme); curl_url_cleanup(u); - free(copyloc); + curlx_free(copyloc); } } #endif diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index 5f33c7c29c05..6ae53b3ba227 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -29,8 +29,6 @@ #include "tool_operate.h" #include "terminal.h" -#include "memdebug.h" /* keep this as LAST include */ - #define MAX_BARLENGTH 400 #define MIN_BARLENGTH 20 diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index cc7ef5a55079..0f2bf8177198 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -38,8 +38,6 @@ #include "tool_util.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ - #ifndef _WIN32 /* Wait up to a number of milliseconds for socket activity. This function waits on read activity on a file descriptor that is not a socket which diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index fd1b4c563c80..ea5c8e313b40 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -27,8 +27,6 @@ #include "tool_operate.h" #include "tool_cb_see.h" -#include "memdebug.h" /* keep this as LAST include */ - /* ** callback for CURLOPT_SEEKFUNCTION ** diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 48f5fea3c9b9..5696df2a5935 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -28,8 +28,6 @@ #include "tool_cb_wrt.h" #include "tool_operate.h" -#include "memdebug.h" /* keep this as LAST include */ - #ifdef _WIN32 #define OPENMODE S_IREAD | S_IWRITE #else @@ -211,8 +209,8 @@ static size_t win_console(intptr_t fhnd, struct OutStruct *outs, /* grow the buffer if needed */ if(len > global->term.len) { - wchar_t *buf = (wchar_t *) realloc(global->term.buf, - len * sizeof(wchar_t)); + wchar_t *buf = (wchar_t *)curlx_realloc(global->term.buf, + len * sizeof(wchar_t)); if(!buf) return CURL_WRITEFUNC_ERROR; global->term.len = len; diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 086e4ac21659..ab4892b06578 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -28,7 +28,6 @@ #include "tool_paramhlp.h" #include "tool_main.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ static struct GlobalConfig globalconf; struct GlobalConfig *global; @@ -36,7 +35,7 @@ struct GlobalConfig *global; struct OperationConfig *config_alloc(void) { struct OperationConfig *config = - calloc(1, sizeof(struct OperationConfig)); + curlx_calloc(1, sizeof(struct OperationConfig)); if(!config) return NULL; @@ -199,7 +198,7 @@ void config_free(struct OperationConfig *config) struct OperationConfig *prev = last->prev; free_config_fields(last); - free(last); + curlx_free(last); last = prev; } @@ -236,12 +235,12 @@ CURLcode globalconf_init(void) if(result) { errorf("error retrieving curl library information"); - free(global->first); + curlx_free(global->first); } } else { errorf("error initializing curl library"); - free(global->first); + curlx_free(global->first); } } else { @@ -263,7 +262,7 @@ static void free_globalconfig(void) tool_safefree(global->ssl_sessions); tool_safefree(global->libcurl); #ifdef _WIN32 - free(global->term.buf); + curlx_free(global->term.buf); #endif } diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index dc78f2db44f6..0eac0185f280 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -42,7 +42,7 @@ #define checkprefix(a,b) curl_strnequal(b, STRCONST(a)) #define tool_safefree(ptr) \ - do { free((ptr)); (ptr) = NULL;} while(0) + do { curlx_free((ptr)); (ptr) = NULL;} while(0) extern struct GlobalConfig *global; diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index 17b2d01e9bc6..31962bd1c546 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -30,8 +30,6 @@ #include "tool_dirhie.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ - #if defined(_WIN32) || (defined(MSDOS) && !defined(__DJGPP__)) # define mkdir(x,y) (mkdir)((x)) # ifndef F_OK diff --git a/src/tool_doswin.c b/src/tool_doswin.c index cd0ec3b9c1b1..ee236178c276 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -40,8 +40,6 @@ #include "tool_doswin.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ - #ifdef _WIN32 # undef PATH_MAX # define PATH_MAX MAX_PATH @@ -133,7 +131,7 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, if(len > max_sanitized_len) return SANITIZE_ERR_INVALID_PATH; - target = strdup(file_name); + target = curlx_strdup(file_name); if(!target) return SANITIZE_ERR_OUT_OF_MEMORY; @@ -183,28 +181,28 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, #ifdef MSDOS sc = msdosify(&p, target, flags); - free(target); + curlx_free(target); if(sc) return sc; target = p; len = strlen(target); if(len > max_sanitized_len) { - free(target); + curlx_free(target); return SANITIZE_ERR_INVALID_PATH; } #endif if(!(flags & SANITIZE_ALLOW_RESERVED)) { sc = rename_if_reserved_dos(&p, target, flags); - free(target); + curlx_free(target); if(sc) return sc; target = p; len = strlen(target); if(len > max_sanitized_len) { - free(target); + curlx_free(target); return SANITIZE_ERR_INVALID_PATH; } } @@ -415,7 +413,7 @@ static SANITIZEcode msdosify(char **const sanitized, const char *file_name, return SANITIZE_ERR_INVALID_PATH; } - *sanitized = strdup(dos_name); + *sanitized = curlx_strdup(dos_name); return *sanitized ? SANITIZE_ERR_OK : SANITIZE_ERR_OUT_OF_MEMORY; } #endif /* MSDOS */ @@ -457,7 +455,7 @@ static SANITIZEcode rename_if_reserved_dos(char **const sanitized, #ifndef MSDOS if((flags & SANITIZE_ALLOW_PATH) && file_name[0] == '\\' && file_name[1] == '\\') { - *sanitized = strdup(file_name); + *sanitized = curlx_strdup(file_name); if(!*sanitized) return SANITIZE_ERR_OUT_OF_MEMORY; return SANITIZE_ERR_OK; @@ -544,7 +542,7 @@ static SANITIZEcode rename_if_reserved_dos(char **const sanitized, } #endif - *sanitized = strdup(fname); + *sanitized = curlx_strdup(fname); return *sanitized ? SANITIZE_ERR_OK : SANITIZE_ERR_OUT_OF_MEMORY; } @@ -597,7 +595,7 @@ CURLcode FindWin32CACert(struct OperationConfig *config, char *mstr = curlx_convert_tchar_to_UTF8(buf); tool_safefree(config->cacert); if(mstr) - config->cacert = strdup(mstr); + config->cacert = curlx_strdup(mstr); curlx_unicodefree(mstr); if(!config->cacert) result = CURLE_OUT_OF_MEMORY; @@ -801,7 +799,7 @@ static DWORD WINAPI win_stdin_thread_func(void *thread_data) if(socket_w != CURL_SOCKET_BAD) sclose(socket_w); - free(tdata); + curlx_free(tdata); return 0; } @@ -824,9 +822,10 @@ curl_socket_t win32_stdin_read_thread(void) do { /* Prepare handles for thread */ - tdata = (struct win_thread_data*)calloc(1, sizeof(struct win_thread_data)); + tdata = (struct win_thread_data*) + curlx_calloc(1, sizeof(struct win_thread_data)); if(!tdata) { - errorf("calloc() error"); + errorf("curlx_calloc() error"); break; } /* Create the listening socket for the thread. When it starts, it will @@ -937,7 +936,7 @@ curl_socket_t win32_stdin_read_thread(void) if(tdata->socket_l != CURL_SOCKET_BAD) sclose(tdata->socket_l); - free(tdata); + curlx_free(tdata); } return CURL_SOCKET_BAD; diff --git a/src/tool_easysrc.c b/src/tool_easysrc.c index 65d01d5f85a6..4747f6dfe6bb 100644 --- a/src/tool_easysrc.c +++ b/src/tool_easysrc.c @@ -31,8 +31,6 @@ #include "tool_easysrc.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ - /* global variable definitions, for easy-interface source code generation */ struct slist_wc *easysrc_decl; /* Variable declarations */ diff --git a/src/tool_findfile.c b/src/tool_findfile.c index 6e9fbdfd6003..4dbd7bccb470 100644 --- a/src/tool_findfile.c +++ b/src/tool_findfile.c @@ -36,8 +36,6 @@ #include "tool_findfile.h" #include "tool_cfgable.h" -#include "memdebug.h" /* keep this as LAST include */ - struct finder { const char *env; const char *append; @@ -75,7 +73,7 @@ static char *checkhome(const char *home, const char *fname, bool dotscore) if(c) { int fd = curlx_open(c, O_RDONLY); if(fd >= 0) { - char *path = strdup(c); + char *path = curlx_strdup(c); close(fd); curl_free(c); return path; diff --git a/src/tool_formparse.c b/src/tool_formparse.c index c1e9abe9d0b8..181abf7b8627 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -30,13 +30,11 @@ #include "tool_formparse.h" #include "tool_parsecfg.h" -#include "memdebug.h" /* keep this as LAST include */ - /* tool_mime functions. */ static struct tool_mime *tool_mime_new(struct tool_mime *parent, toolmimekind kind) { - struct tool_mime *m = (struct tool_mime *) calloc(1, sizeof(*m)); + struct tool_mime *m = (struct tool_mime *)curlx_calloc(1, sizeof(*m)); if(m) { m->kind = kind; @@ -60,11 +58,11 @@ static struct tool_mime *tool_mime_new_data(struct tool_mime *parent, char *mime_data_copy; struct tool_mime *m = NULL; - mime_data_copy = strdup(mime_data); + mime_data_copy = curlx_strdup(mime_data); if(mime_data_copy) { m = tool_mime_new(parent, TOOLMIME_DATA); if(!m) - free(mime_data_copy); + curlx_free(mime_data_copy); else m->data = mime_data_copy; } @@ -107,11 +105,11 @@ static struct tool_mime *tool_mime_new_filedata(struct tool_mime *parent, *errcode = CURLE_OUT_OF_MEMORY; if(strcmp(filename, "-")) { /* This is a normal file. */ - char *filedup = strdup(filename); + char *filedup = curlx_strdup(filename); if(filedup) { m = tool_mime_new(parent, TOOLMIME_FILE); if(!m) - free(filedup); + curlx_free(filedup); else { m->data = filedup; if(!isremotefile) @@ -152,7 +150,7 @@ static struct tool_mime *tool_mime_new_filedata(struct tool_mime *parent, default: if(!stdinsize) { /* Zero-length data has been freed. Re-create it. */ - data = strdup(""); + data = curlx_strdup(""); if(!data) return m; } @@ -190,7 +188,7 @@ void tool_mime_free(struct tool_mime *mime) tool_safefree(mime->encoder); tool_safefree(mime->data); curl_slist_free_all(mime->headers); - free(mime); + curlx_free(mime); } } @@ -711,7 +709,7 @@ static int get_param_part(char endchar, #define SET_TOOL_MIME_PTR(m, field) \ do { \ if(field) { \ - (m)->field = strdup(field); \ + (m)->field = curlx_strdup(field); \ if(!(m)->field) \ goto fail; \ } \ @@ -745,7 +743,7 @@ int formparse(const char *input, } /* Make a copy we can overwrite. */ - contents = strdup(input); + contents = curlx_strdup(input); if(!contents) goto fail; diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 76113e45bd0d..7afb0c5fc051 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -38,22 +38,20 @@ #include "tool_help.h" #include "var.h" -#include "memdebug.h" /* keep this as LAST include */ - #define ALLOW_BLANK TRUE #define DENY_BLANK FALSE static ParameterError getstr(char **str, const char *val, bool allowblank) { if(*str) { - free(*str); + curlx_free(*str); *str = NULL; } DEBUGASSERT(val); if(!allowblank && !val[0]) return PARAM_BLANK_STRING; - *str = strdup(val); + *str = curlx_strdup(val); if(!*str) return PARAM_NO_MEM; @@ -64,14 +62,14 @@ static ParameterError getstrn(char **str, const char *val, size_t len, bool allowblank) { if(*str) { - free(*str); + curlx_free(*str); *str = NULL; } DEBUGASSERT(val); if(!allowblank && !val[0]) return PARAM_BLANK_STRING; - *str = malloc(len + 1); + *str = curlx_malloc(len + 1); if(!*str) return PARAM_NO_MEM; @@ -407,13 +405,13 @@ ParameterError parse_cert_parameter(const char *cert_parameter, * means no passphrase was given and no characters escaped */ if(curl_strnequal(cert_parameter, "pkcs11:", 7) || !strpbrk(cert_parameter, ":\\")) { - *certname = strdup(cert_parameter); + *certname = curlx_strdup(cert_parameter); if(!*certname) return PARAM_NO_MEM; return PARAM_OK; } /* deal with escaped chars; find unescaped colon if it exists */ - certname_place = malloc(param_length + 1); + certname_place = curlx_malloc(param_length + 1); if(!certname_place) { err = PARAM_NO_MEM; goto done; @@ -475,7 +473,7 @@ ParameterError parse_cert_parameter(const char *cert_parameter, * above; if we are still here, this is a separating colon */ param_place++; if(*param_place) { - *passphrase = strdup(param_place); + *passphrase = curlx_strdup(param_place); if(!*passphrase) err = PARAM_NO_MEM; } @@ -527,10 +525,10 @@ GetFileAndPassword(const char *nextarg, char **file, char **password) /* nextarg is never NULL here */ err = parse_cert_parameter(nextarg, &certname, &passphrase); if(!err) { - free(*file); + curlx_free(*file); *file = certname; if(passphrase) { - free(*password); + curlx_free(*password); *password = passphrase; } } @@ -668,7 +666,7 @@ static ParameterError data_urlencode(const char *nextarg, if(!postdata) { /* no data from the file, point to a zero byte string to make this get sent as a POST anyway */ - postdata = strdup(""); + postdata = curlx_strdup(""); if(!postdata) return PARAM_NO_MEM; size = 0; @@ -870,7 +868,7 @@ static ParameterError url_query(const char *nextarg, if(*nextarg == '+') { /* use without encoding */ - query = strdup(&nextarg[1]); + query = curlx_strdup(&nextarg[1]); if(!query) err = PARAM_NO_MEM; } @@ -880,11 +878,11 @@ static ParameterError url_query(const char *nextarg, if(!err) { if(config->query) { CURLcode result = curlx_dyn_addf(&dyn, "%s&%s", config->query, query); - free(query); + curlx_free(query); if(result) err = PARAM_NO_MEM; else { - free(config->query); + curlx_free(config->query); config->query = curlx_dyn_ptr(&dyn); } } @@ -944,7 +942,7 @@ static ParameterError set_data(cmdline_t cmd, if(!postdata) { /* no data from the file, point to a zero byte string to make this get sent as a POST anyway */ - postdata = strdup(""); + postdata = curlx_strdup(""); if(!postdata) return PARAM_NO_MEM; } @@ -1240,7 +1238,7 @@ static ParameterError parse_ech(struct OperationConfig *config, if(err) return err; config->ech_config = curl_maprintf("ecl:%s",tmpcfg); - free(tmpcfg); + curlx_free(tmpcfg); if(!config->ech_config) return PARAM_NO_MEM; } /* file done */ @@ -1424,8 +1422,8 @@ static ParameterError parse_range(struct OperationConfig *config, "Appending one for you"); curl_msnprintf(buffer, sizeof(buffer), "%" CURL_FORMAT_CURL_OFF_T "-", value); - free(config->range); - config->range = strdup(buffer); + curlx_free(config->range); + config->range = curlx_strdup(buffer); if(!config->range) err = PARAM_NO_MEM; } @@ -1509,8 +1507,8 @@ static ParameterError parse_verbose(bool toggle) switch(global->verbosity) { case 0: global->verbosity = 1; - free(global->trace_dump); - global->trace_dump = strdup("%"); + curlx_free(global->trace_dump); + global->trace_dump = curlx_strdup("%"); if(!global->trace_dump) err = PARAM_NO_MEM; else { @@ -3021,7 +3019,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ error: if(nextalloc) - free(CURL_UNCONST(nextarg)); + curlx_free(CURL_UNCONST(nextarg)); return err; } diff --git a/src/tool_getpass.c b/src/tool_getpass.c index 014c22813acf..b0316510bc23 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -51,8 +51,6 @@ #endif #include "tool_getpass.h" -#include "memdebug.h" /* keep this as LAST include */ - #ifdef __VMS /* VMS implementation */ char *getpass_r(const char *prompt, char *buffer, size_t buflen) diff --git a/src/tool_help.c b/src/tool_help.c index 4509fa2b949d..bbe8dc68a4c3 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -33,8 +33,6 @@ #include "tool_cfgable.h" #include "terminal.h" -#include "memdebug.h" /* keep this as LAST include */ - struct category_descriptors { const char *opt; const char *desc; @@ -364,7 +362,7 @@ void tool_version_info(void) #ifdef CURL_CA_EMBED ++feat_ext_count; #endif - feat_ext = malloc(sizeof(*feature_names) * (feat_ext_count + 1)); + feat_ext = curlx_malloc(sizeof(*feature_names) * (feat_ext_count + 1)); if(feat_ext) { memcpy((void *)feat_ext, feature_names, sizeof(*feature_names) * feature_count); @@ -379,7 +377,7 @@ void tool_version_info(void) for(builtin = feat_ext; *builtin; ++builtin) curl_mprintf(" %s", *builtin); puts(""); /* newline */ - free((void *)feat_ext); + curlx_free((void *)feat_ext); } } if(strcmp(CURL_VERSION, curlinfo->version)) { diff --git a/src/tool_helpers.c b/src/tool_helpers.c index b36bd4af1d87..2e308a248f13 100644 --- a/src/tool_helpers.c +++ b/src/tool_helpers.c @@ -27,7 +27,6 @@ #include "tool_msgs.h" #include "tool_getparam.h" #include "tool_helpers.h" -#include "memdebug.h" /* keep this as LAST include */ /* ** Helper functions that are used from more than one source file. diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index 0214a2004f1e..c1d27fc99b09 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -28,7 +28,6 @@ #include "tool_cfgable.h" #include "tool_msgs.h" #include "tool_ipfs.h" -#include "memdebug.h" /* keep this as LAST include */ /* input string ends in slash? */ static bool has_trailing_slash(const char *input) @@ -45,7 +44,7 @@ static char *ipfs_gateway(void) char *gateway_env = getenv("IPFS_GATEWAY"); if(gateway_env) - return strdup(gateway_env); + return curlx_strdup(gateway_env); /* Try to find the gateway in the IPFS data folder. */ ipfs_path_c = curl_getenv("IPFS_PATH"); @@ -133,7 +132,7 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, if(config->ipfs_gateway) { if(!curl_url_set(gatewayurl, CURLUPART_URL, config->ipfs_gateway, CURLU_GUESS_SCHEME)) { - gateway = strdup(config->ipfs_gateway); + gateway = curlx_strdup(config->ipfs_gateway); if(!gateway) { result = CURLE_URL_MALFORMAT; goto clean; @@ -200,8 +199,8 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, if(curl_url_get(uh, CURLUPART_URL, &cloneurl, CURLU_URLENCODE)) { goto clean; } - /* we need to strdup the URL so that we can call free() on it later */ - *url = strdup(cloneurl); + /* we need to strdup the URL so that we can call curlx_free() on it later */ + *url = curlx_strdup(cloneurl); curl_free(cloneurl); if(!*url) goto clean; @@ -209,7 +208,7 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, result = CURLE_OK; clean: - free(gateway); + curlx_free(gateway); curl_free(gwhost); curl_free(gwpath); curl_free(gwquery); diff --git a/src/tool_libinfo.c b/src/tool_libinfo.c index d755532652c8..1687005481a9 100644 --- a/src/tool_libinfo.c +++ b/src/tool_libinfo.c @@ -24,7 +24,6 @@ #include "tool_setup.h" #include "tool_libinfo.h" -#include "memdebug.h" /* keep this as LAST include */ /* global variable definitions, for libcurl runtime info */ diff --git a/src/tool_libinfo.h b/src/tool_libinfo.h index 5e6e1de24c43..ddc41a133867 100644 --- a/src/tool_libinfo.h +++ b/src/tool_libinfo.h @@ -27,7 +27,6 @@ /* global variable declarations, for libcurl runtime info */ - extern curl_version_info_data *curlinfo; extern const char * const *built_in_protos; diff --git a/src/tool_main.c b/src/tool_main.c index 8047e663c8f7..eb15ae740dd1 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -42,13 +42,6 @@ #include "tool_libinfo.h" #include "tool_stderr.h" -/* - * This is low-level hard-hacking memory leak tracking and similar. Using - * the library level code from this client-side is ugly, but we do this - * anyway for convenience. - */ -#include "memdebug.h" /* keep this as LAST include */ - #ifdef __VMS /* * vms_show is a global variable, used in main() as parameter for @@ -121,7 +114,7 @@ static void memory_tracking_init(void) curl_free(env); curl_dbg_memdebug(fname); /* this weird stuff here is to make curl_free() get called before - curl_dbg_memdebug() as otherwise memory tracking will log a free() + curl_dbg_memdebug() as otherwise memory tracking will log a curlx_free() without an alloc! */ } /* if CURL_MEMLIMIT is set, this enables fail-on-alloc-number-N feature */ diff --git a/src/tool_msgs.c b/src/tool_msgs.c index ae0b6b983586..b385f75cf8b8 100644 --- a/src/tool_msgs.c +++ b/src/tool_msgs.c @@ -28,8 +28,6 @@ #include "tool_cb_prg.h" #include "terminal.h" -#include "memdebug.h" /* keep this as LAST include */ - #define WARN_PREFIX "Warning: " #define NOTE_PREFIX "Note: " #define ERROR_PREFIX "curl: " diff --git a/src/tool_operate.c b/src/tool_operate.c index eb591935db4f..968dc864f9f6 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -90,8 +90,6 @@ CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy); #endif -#include "memdebug.h" /* keep this as LAST include */ - #ifdef CURL_CA_EMBED #ifndef CURL_DECLARED_CURL_CA_EMBED #define CURL_DECLARED_CURL_CA_EMBED @@ -204,7 +202,7 @@ static struct per_transfer *transfersl; /* last node */ static CURLcode add_per_transfer(struct per_transfer **per) { struct per_transfer *p; - p = calloc(1, sizeof(struct per_transfer)); + p = curlx_calloc(1, sizeof(struct per_transfer)); if(!p) return CURLE_OUT_OF_MEMORY; if(!transfers) @@ -246,7 +244,7 @@ static struct per_transfer *del_per_transfer(struct per_transfer *per) else transfersl = p; - free(per); + curlx_free(per); return n; } @@ -770,10 +768,10 @@ static CURLcode post_per_transfer(struct per_transfer *per, curl_easy_cleanup(per->curl); if(outs->alloc_filename) - free(outs->filename); - free(per->url); - free(per->outfile); - free(per->uploadfile); + curlx_free(outs->filename); + curlx_free(per->url); + curlx_free(per->outfile); + curlx_free(per->uploadfile); curl_slist_free_all(per->hdrcbdata.headlist); per->hdrcbdata.headlist = NULL; return result; @@ -785,7 +783,7 @@ static CURLcode set_cert_types(struct OperationConfig *config) /* Check if config->cert is a PKCS#11 URI and set the config->cert_type if * necessary */ if(config->cert && !config->cert_type && is_pkcs11_uri(config->cert)) { - config->cert_type = strdup("ENG"); + config->cert_type = curlx_strdup("ENG"); if(!config->cert_type) return CURLE_OUT_OF_MEMORY; } @@ -793,7 +791,7 @@ static CURLcode set_cert_types(struct OperationConfig *config) /* Check if config->key is a PKCS#11 URI and set the config->key_type if * necessary */ if(config->key && !config->key_type && is_pkcs11_uri(config->key)) { - config->key_type = strdup("ENG"); + config->key_type = curlx_strdup("ENG"); if(!config->key_type) return CURLE_OUT_OF_MEMORY; } @@ -802,7 +800,7 @@ static CURLcode set_cert_types(struct OperationConfig *config) * config->proxy_type if necessary */ if(config->proxy_cert && !config->proxy_cert_type && is_pkcs11_uri(config->proxy_cert)) { - config->proxy_cert_type = strdup("ENG"); + config->proxy_cert_type = curlx_strdup("ENG"); if(!config->proxy_cert_type) return CURLE_OUT_OF_MEMORY; } @@ -811,7 +809,7 @@ static CURLcode set_cert_types(struct OperationConfig *config) * config->proxy_key_type if necessary */ if(config->proxy_key && !config->proxy_key_type && is_pkcs11_uri(config->proxy_key)) { - config->proxy_key_type = strdup("ENG"); + config->proxy_key_type = curlx_strdup("ENG"); if(!config->proxy_key_type) return CURLE_OUT_OF_MEMORY; } @@ -844,7 +842,7 @@ static CURLcode append2query(struct OperationConfig *config, if(uerr) result = urlerr_cvt(uerr); else { - free(per->url); /* free previous URL */ + curlx_free(per->url); /* free previous URL */ per->url = updated; /* use our new URL instead! */ } } @@ -1022,7 +1020,7 @@ static CURLcode setup_outfile(struct OperationConfig *config, char *d = curl_maprintf("%s/%s", config->output_dir, per->outfile); if(!d) return CURLE_WRITE_ERROR; - free(per->outfile); + curlx_free(per->outfile); per->outfile = d; } /* Create the directory hierarchy, if not pre-existent to a multiple @@ -1264,7 +1262,7 @@ static CURLcode single_transfer(struct OperationConfig *config, } per->etag_save = etag_first; /* copy the whole struct */ if(state->uploadfile) { - per->uploadfile = strdup(state->uploadfile); + per->uploadfile = curlx_strdup(state->uploadfile); if(!per->uploadfile || SetHTTPrequest(TOOL_HTTPREQ_PUT, &config->httpreq)) { tool_safefree(per->uploadfile); @@ -1300,7 +1298,7 @@ static CURLcode single_transfer(struct OperationConfig *config, if(glob_inuse(&state->urlglob)) result = glob_next_url(&per->url, &state->urlglob); else if(!state->urlidx) { - per->url = strdup(u->url); + per->url = curlx_strdup(u->url); if(!per->url) result = CURLE_OUT_OF_MEMORY; } @@ -1312,7 +1310,7 @@ static CURLcode single_transfer(struct OperationConfig *config, return result; if(u->outfile) { - per->outfile = strdup(u->outfile); + per->outfile = curlx_strdup(u->outfile); if(!per->outfile) return CURLE_OUT_OF_MEMORY; } @@ -1586,7 +1584,7 @@ static struct contextuv *create_context(curl_socket_t sockfd, { struct contextuv *c; - c = (struct contextuv *) malloc(sizeof(*c)); + c = (struct contextuv *)curlx_malloc(sizeof(*c)); c->sockfd = sockfd; c->uv = uv; @@ -1600,7 +1598,7 @@ static struct contextuv *create_context(curl_socket_t sockfd, static void close_cb(uv_handle_t *handle) { struct contextuv *c = (struct contextuv *) handle->data; - free(c); + curlx_free(c); } static void destroy_context(struct contextuv *c) @@ -2053,7 +2051,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) env = curl_getenv("CURL_CA_BUNDLE"); if(env) { - config->cacert = strdup(env); + config->cacert = curlx_strdup(env); curl_free(env); if(!config->cacert) { result = CURLE_OUT_OF_MEMORY; @@ -2063,7 +2061,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) else { env = curl_getenv("SSL_CERT_DIR"); if(env) { - config->capath = strdup(env); + config->capath = curlx_strdup(env); curl_free(env); if(!config->capath) { result = CURLE_OUT_OF_MEMORY; @@ -2072,7 +2070,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) } env = curl_getenv("SSL_CERT_FILE"); if(env) { - config->cacert = strdup(env); + config->cacert = curlx_strdup(env); curl_free(env); if(!config->cacert) { result = CURLE_OUT_OF_MEMORY; @@ -2088,7 +2086,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) FILE *cafile = tool_execpath("curl-ca-bundle.crt", &cacert); if(cafile) { curlx_fclose(cafile); - config->cacert = strdup(cacert); + config->cacert = curlx_strdup(cacert); if(!config->cacert) { result = CURLE_OUT_OF_MEMORY; goto fail; @@ -2260,7 +2258,7 @@ CURLcode operate(int argc, argv_item_t argv[]) if(found_curlrc) { /* After parse_args so notef knows the verbosity */ notef("Read config file from '%s'", curlrc_path); - free(curlrc_path); + curlx_free(curlrc_path); } if(res) { result = CURLE_OK; diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index 0d6c2cb6e0e5..a8b5e9497570 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -28,7 +28,6 @@ #include "tool_doswin.h" #include "tool_operhlp.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ void clean_getout(struct OperationConfig *config) { @@ -144,7 +143,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename) if(!newpath) goto fail; uerr = curl_url_set(uh, CURLUPART_PATH, newpath, 0); - free(newpath); + curlx_free(newpath); if(uerr) { result = urlerr_cvt(uerr); goto fail; @@ -154,7 +153,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename) result = urlerr_cvt(uerr); goto fail; } - free(*inurlp); + curlx_free(*inurlp); *inurlp = newurl; result = CURLE_OK; } @@ -206,11 +205,11 @@ CURLcode get_url_file_name(char **filename, const char *url) if(pc) { /* duplicate the string beyond the slash */ - *filename = strdup(pc + 1); + *filename = curlx_strdup(pc + 1); } else { /* no slash => empty string, use default */ - *filename = strdup("curl_response"); + *filename = curlx_strdup("curl_response"); warnf("No remote filename, uses \"%s\"", *filename); } diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index 15293c0cc6ce..b16fc42906d8 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -32,11 +32,9 @@ #include "tool_util.h" #include "tool_version.h" -#include "memdebug.h" /* keep this as LAST include */ - struct getout *new_getout(struct OperationConfig *config) { - struct getout *node = calloc(1, sizeof(struct getout)); + struct getout *node = curlx_calloc(1, sizeof(struct getout)); struct getout *last = config->url_last; if(node) { static int outnum = 0; @@ -401,7 +399,7 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str) curlx_dyn_init(&obuf, MAX_PROTOSTRING); - protoset = malloc((proto_count + 1) * sizeof(*protoset)); + protoset = curlx_malloc((proto_count + 1) * sizeof(*protoset)); if(!protoset) return PARAM_NO_MEM; @@ -499,14 +497,14 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str) for(proto = 0; protoset[proto] && !result; proto++) result = curlx_dyn_addf(&obuf, "%s%s", curlx_dyn_len(&obuf) ? "," : "", protoset[proto]); - free((char *) protoset); + curlx_free((char *)protoset); if(result) return PARAM_NO_MEM; if(!curlx_dyn_len(&obuf)) { curlx_dyn_free(&obuf); return PARAM_BAD_USE; } - free(*ostr); + curlx_free(*ostr); *ostr = curlx_dyn_ptr(&obuf); return PARAM_OK; } @@ -592,7 +590,7 @@ static CURLcode checkpasswd(const char *kind, /* for what purpose */ return CURLE_OUT_OF_MEMORY; /* return the new string */ - free(*userpwd); + curlx_free(*userpwd); *userpwd = curlx_dyn_ptr(&dyn); } diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index e7a00cf70883..f901e69e7849 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -30,7 +30,6 @@ #include "tool_msgs.h" #include "tool_parsecfg.h" #include "tool_util.h" -#include "memdebug.h" /* keep this as LAST include */ /* only acknowledge colon or equals as separators if the option was not specified with an initial dash! */ @@ -96,7 +95,7 @@ ParameterError parseconfig(const char *filename, int max_recursive, if(curlrc) { file = curlx_fopen(curlrc, FOPEN_READTEXT); if(!file) { - free(curlrc); + curlx_free(curlrc); return PARAM_READ_ERROR; } filename = pathalloc = curlrc; @@ -266,11 +265,11 @@ ParameterError parseconfig(const char *filename, int max_recursive, errorf("cannot read config from '%s'", filename); if(!err && resolved) { - *resolved = strdup(filename); + *resolved = curlx_strdup(filename); if(!*resolved) err = PARAM_NO_MEM; } - free(pathalloc); + curlx_free(pathalloc); return err; } diff --git a/src/tool_setopt.c b/src/tool_setopt.c index b7039fbb4881..97d469d76daa 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -30,7 +30,6 @@ #ifndef CURL_DISABLE_LIBCURL_OPTION #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ /* Lookup tables for converting setopt values back to symbols */ /* For enums, values may be in any order. */ @@ -385,7 +384,7 @@ static CURLcode libcurl_generate_slist(struct curl_slist *slist, int *slistno) ret = easysrc_addf(&easysrc_data, "slist%d = curl_slist_append(slist%d, \"%s\");", *slistno, *slistno, escaped); - free(escaped); + curlx_free(escaped); } return ret; @@ -439,7 +438,7 @@ static CURLcode libcurl_generate_mime_part(CURL *curl, easysrc_addf(&easysrc_code, "curl_mime_data(part%d, \"%s\", CURL_ZERO_TERMINATED);", mimeno, escaped); - free(escaped); + curlx_free(escaped); } break; @@ -452,7 +451,7 @@ static CURLcode libcurl_generate_mime_part(CURL *curl, ret = easysrc_addf(&easysrc_code, "curl_mime_filename(part%d, NULL);", mimeno); } - free(escaped); + curlx_free(escaped); break; } @@ -477,28 +476,28 @@ static CURLcode libcurl_generate_mime_part(CURL *curl, char *escaped = c_escape(part->encoder, ZERO_TERMINATED); ret = easysrc_addf(&easysrc_code, "curl_mime_encoder(part%d, \"%s\");", mimeno, escaped); - free(escaped); + curlx_free(escaped); } if(!ret && filename) { char *escaped = c_escape(filename, ZERO_TERMINATED); ret = easysrc_addf(&easysrc_code, "curl_mime_filename(part%d, \"%s\");", mimeno, escaped); - free(escaped); + curlx_free(escaped); } if(!ret && part->name) { char *escaped = c_escape(part->name, ZERO_TERMINATED); ret = easysrc_addf(&easysrc_code, "curl_mime_name(part%d, \"%s\");", mimeno, escaped); - free(escaped); + curlx_free(escaped); } if(!ret && part->type) { char *escaped = c_escape(part->type, ZERO_TERMINATED); ret = easysrc_addf(&easysrc_code, "curl_mime_type(part%d, \"%s\");", mimeno, escaped); - free(escaped); + curlx_free(escaped); } if(!ret && part->headers) { @@ -687,7 +686,7 @@ CURLcode tool_setopt_str(CURL *curl, struct OperationConfig *config, result = easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, \"%s\");", name, escaped); - free(escaped); + curlx_free(escaped); } else result = CURLE_OUT_OF_MEMORY; diff --git a/src/tool_setup.h b/src/tool_setup.h index 17c2f420b582..f693fc1dae70 100644 --- a/src/tool_setup.h +++ b/src/tool_setup.h @@ -68,6 +68,8 @@ extern FILE *tool_stderr; #ifndef HAVE_STRDUP #include "tool_strdup.h" +#undef Curl_strdup +#define Curl_strdup tool_strdup #endif #ifndef tool_nop_stmt diff --git a/src/tool_ssls.c b/src/tool_ssls.c index 2b67be9baaf8..7ffd6f707420 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -30,8 +30,6 @@ #include "tool_ssls.h" #include "tool_parsecfg.h" -#include "memdebug.h" /* keep this as LAST include */ - /* The maximum line length for an ecoded session ticket */ #define MAX_SSLS_LINE (64 * 1024) @@ -127,8 +125,8 @@ CURLcode tool_ssls_load(struct OperationConfig *config, if(fp) curlx_fclose(fp); curlx_dyn_free(&buf); - free(shmac); - free(sdata); + curlx_free(shmac); + curlx_free(sdata); return r; } @@ -181,7 +179,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr, out: if(r) warnf("Warning: error saving SSL session for '%s': %d", session_key, r); - free(enc); + curlx_free(enc); return r; } diff --git a/src/tool_ssls.h b/src/tool_ssls.h index 7a1b95194d35..c06e9427cf4a 100644 --- a/src/tool_ssls.h +++ b/src/tool_ssls.h @@ -26,7 +26,6 @@ #include "tool_setup.h" #include "tool_operate.h" - CURLcode tool_ssls_load(struct OperationConfig *config, CURLSH *share, const char *filename); CURLcode tool_ssls_save(struct OperationConfig *config, diff --git a/src/tool_stderr.c b/src/tool_stderr.c index 8812f8bf8e52..7871ebc0ccb5 100644 --- a/src/tool_stderr.c +++ b/src/tool_stderr.c @@ -26,8 +26,6 @@ #include "tool_stderr.h" #include "tool_msgs.h" -#include "memdebug.h" /* keep this as LAST include */ - FILE *tool_stderr; void tool_init_stderr(void) diff --git a/src/tool_strdup.c b/src/tool_strdup.c index ff80b56b9263..c799d1acdfde 100644 --- a/src/tool_strdup.c +++ b/src/tool_strdup.c @@ -22,10 +22,9 @@ * ***************************************************************************/ #include "tool_strdup.h" -#include "memdebug.h" /* keep this as LAST include */ #ifndef HAVE_STRDUP -char *strdup(const char *str) +char *tool_strdup(const char *str) { size_t len; char *newstr; @@ -35,7 +34,7 @@ char *strdup(const char *str) len = strlen(str) + 1; - newstr = malloc(len); + newstr = curlx_malloc(len); if(!newstr) return (char *)NULL; @@ -46,7 +45,7 @@ char *strdup(const char *str) char *memdup0(const char *data, size_t len) { - char *p = malloc(len + 1); + char *p = curlx_malloc(len + 1); if(!p) return NULL; if(len) diff --git a/src/tool_strdup.h b/src/tool_strdup.h index 275be7c5d907..0f121e20fdff 100644 --- a/src/tool_strdup.h +++ b/src/tool_strdup.h @@ -26,7 +26,7 @@ #include "tool_setup.h" #ifndef HAVE_STRDUP -extern char *strdup(const char *str); +extern char *tool_strdup(const char *str); #endif char *memdup0(const char *data, size_t len); diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index 7185e80f66b1..9ea8a274fa0d 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -28,7 +28,6 @@ #include "tool_urlglob.h" #include "tool_vms.h" #include "tool_strdup.h" -#include "memdebug.h" /* keep this as LAST include */ static CURLcode globerror(struct URLGlob *glob, const char *err, size_t pos, CURLcode error) @@ -45,7 +44,7 @@ static CURLcode glob_fixed(struct URLGlob *glob, char *fixed, size_t len) pat->globindex = -1; pat->c.set.size = 0; pat->c.set.idx = 0; - pat->c.set.elem = malloc(sizeof(char *)); + pat->c.set.elem = curlx_malloc(sizeof(char *)); if(!pat->c.set.elem) return globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); @@ -137,10 +136,10 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, if(!palloc) { palloc = 5; /* a reasonable default */ - elem = malloc(palloc * sizeof(char *)); + elem = curlx_malloc(palloc * sizeof(char *)); } else if(size >= palloc) { - char **arr = realloc(elem, palloc * 2 * sizeof(char *)); + char **arr = curlx_realloc(elem, palloc * 2 * sizeof(char *)); if(!arr) { result = globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); goto error; @@ -154,8 +153,8 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, goto error; } - elem[size] = - strdup(curlx_dyn_ptr(&glob->buf) ? curlx_dyn_ptr(&glob->buf) : ""); + elem[size] = curlx_strdup(curlx_dyn_ptr(&glob->buf) ? + curlx_dyn_ptr(&glob->buf) : ""); if(!elem[size]) { result = globerror(glob, NULL, 0, CURLE_OUT_OF_MEMORY); goto error; @@ -206,7 +205,7 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, for(i = 0; i < size; i++) tool_safefree(elem[i]); } - free(elem); + curlx_free(elem); return result; } @@ -387,7 +386,8 @@ static CURLcode add_glob(struct URLGlob *glob, size_t pos) struct URLPattern *np = NULL; glob->palloc *= 2; if(glob->pnum < 255) { /* avoid ridiculous amounts */ - np = realloc(glob->pattern, glob->palloc * sizeof(struct URLPattern)); + np = curlx_realloc(glob->pattern, + glob->palloc * sizeof(struct URLPattern)); if(!np) return globerror(glob, NULL, pos, CURLE_OUT_OF_MEMORY); } @@ -491,7 +491,7 @@ CURLcode glob_url(struct URLGlob *glob, char *url, curl_off_t *urlnum, memset(glob, 0, sizeof(struct URLGlob)); curlx_dyn_init(&glob->buf, 1024*1024); - glob->pattern = malloc(2 * sizeof(struct URLPattern)); + glob->pattern = curlx_malloc(2 * sizeof(struct URLPattern)); if(!glob->pattern) return CURLE_OUT_OF_MEMORY; glob->palloc = 2; @@ -617,7 +617,7 @@ CURLcode glob_next_url(char **globbed, struct URLGlob *glob) } *globbed = - strdup(curlx_dyn_ptr(&glob->buf) ? curlx_dyn_ptr(&glob->buf) : ""); + curlx_strdup(curlx_dyn_ptr(&glob->buf) ? curlx_dyn_ptr(&glob->buf) : ""); if(!*globbed) return CURLE_OUT_OF_MEMORY; diff --git a/src/tool_util.c b/src/tool_util.c index cb64f9a0b921..43dd096783cc 100644 --- a/src/tool_util.c +++ b/src/tool_util.c @@ -24,7 +24,6 @@ #include "tool_setup.h" #include "tool_util.h" -#include "memdebug.h" /* keep this as LAST include */ #ifdef _WIN32 diff --git a/src/tool_vms.c b/src/tool_vms.c index fac0cfc4dd72..75aa7d5370ee 100644 --- a/src/tool_vms.c +++ b/src/tool_vms.c @@ -32,7 +32,6 @@ #include "curlmsg_vms.h" #include "tool_vms.h" -#include "memdebug.h" /* keep this as LAST include */ void decc$__posix_exit(int __status); void decc$exit(int __status); diff --git a/src/tool_writeout.c b/src/tool_writeout.c index 52b35345f4a9..f846add4e311 100644 --- a/src/tool_writeout.c +++ b/src/tool_writeout.c @@ -26,7 +26,6 @@ #include "tool_cfgable.h" #include "tool_writeout.h" #include "tool_writeout_json.h" -#include "memdebug.h" /* keep this as LAST include */ static int writeTime(FILE *stream, const struct writeoutvar *wovar, struct per_transfer *per, CURLcode per_result, diff --git a/src/tool_xattr.c b/src/tool_xattr.c index fb0669106e4b..b111c7b843e4 100644 --- a/src/tool_xattr.c +++ b/src/tool_xattr.c @@ -24,8 +24,6 @@ #include "tool_setup.h" #include "tool_xattr.h" -#include "memdebug.h" /* keep this as LAST include */ - #ifdef USE_XATTR /* mapping table of curl metadata to extended attribute names */ diff --git a/src/var.c b/src/var.c index 5cedf1d24a2c..08269e1db704 100644 --- a/src/var.c +++ b/src/var.c @@ -33,7 +33,6 @@ #include "tool_writeout_json.h" #include "tool_strdup.h" #include "var.h" -#include "memdebug.h" /* keep this as LAST include */ #define MAX_EXPAND_CONTENT 10000000 #define MAX_VAR_LEN 128 /* max length of a name */ @@ -45,8 +44,8 @@ void varcleanup(void) while(list) { struct tool_var *t = list; list = list->next; - free(CURL_UNCONST(t->content)); - free(t); + curlx_free(CURL_UNCONST(t->content)); + curlx_free(t); } } @@ -192,7 +191,7 @@ static ParameterError varfunc(char *c, /* content */ break; } if(alloc) - free(c); + curlx_free(c); clen = curlx_dyn_len(out); c = memdup0(curlx_dyn_ptr(out), clen); @@ -203,7 +202,7 @@ static ParameterError varfunc(char *c, /* content */ alloc = TRUE; } if(alloc) - free(c); + curlx_free(c); if(err) curlx_dyn_free(out); return err; @@ -359,7 +358,7 @@ static ParameterError addvariable(const char *name, if(check) notef("Overwriting variable '%s'", check->name); - p = calloc(1, sizeof(struct tool_var) + nlen); + p = curlx_calloc(1, sizeof(struct tool_var) + nlen); if(p) { memcpy(p->name, name, nlen); /* the null termination byte is already present from above */ @@ -372,7 +371,7 @@ static ParameterError addvariable(const char *name, global->variables = p; return PARAM_OK; } - free(p); + curlx_free(p); } return PARAM_NO_MEM; } @@ -496,7 +495,7 @@ ParameterError setvariable(const char *input) err = addvariable(name, nlen, content, clen, contalloc); if(err) { if(contalloc) - free(content); + curlx_free(content); } return err; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 677a17cd99fe..0371159d68d8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,7 +25,6 @@ # scripts used in test cases TESTSCRIPTS = \ test1119.pl \ - test1132.pl \ test1135.pl \ test1139.pl \ test1140.pl \ diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index bc3abbc7d80c..18c6969391be 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -152,7 +152,7 @@ test1093 test1094 test1095 test1096 test1097 test1098 test1099 test1100 \ test1101 test1102 test1103 test1104 test1105 test1106 test1107 test1108 \ test1109 test1110 test1111 test1112 test1113 test1114 test1115 test1116 \ test1117 test1118 test1119 test1120 test1121 test1122 test1123 test1124 \ -test1125 test1126 test1127 test1128 test1129 test1130 test1131 test1132 \ +test1125 test1126 test1127 test1128 test1129 test1130 test1131 \ test1133 test1134 test1135 test1136 test1137 test1138 test1139 test1140 \ test1141 test1142 test1143 test1144 test1145 test1146 test1147 test1148 \ test1149 test1150 test1151 test1152 test1153 test1154 test1155 test1156 \ diff --git a/tests/data/test1132 b/tests/data/test1132 deleted file mode 100644 index d0ef42a24e6f..000000000000 --- a/tests/data/test1132 +++ /dev/null @@ -1,21 +0,0 @@ - - - -source analysis -memory-includes - - - -# -# Client-side - - -Verify memory #include files in libcurl's C source files - - - -%SRCDIR/test1132.pl %SRCDIR/../lib - - - - diff --git a/tests/libtest/cli_h2_pausing.c b/tests/libtest/cli_h2_pausing.c index 0f06dadd5204..25b798af4b2b 100644 --- a/tests/libtest/cli_h2_pausing.c +++ b/tests/libtest/cli_h2_pausing.c @@ -26,7 +26,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static void usage_h2_pausing(const char *msg) { diff --git a/tests/libtest/cli_h2_serverpush.c b/tests/libtest/cli_h2_serverpush.c index ad3ae4f91406..80d8c031367f 100644 --- a/tests/libtest/cli_h2_serverpush.c +++ b/tests/libtest/cli_h2_serverpush.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static FILE *out_download = NULL; diff --git a/tests/libtest/cli_h2_upgrade_extreme.c b/tests/libtest/cli_h2_upgrade_extreme.c index b5c6c31b1b59..bc28a6f4d05e 100644 --- a/tests/libtest/cli_h2_upgrade_extreme.c +++ b/tests/libtest/cli_h2_upgrade_extreme.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static size_t write_h2_upg_extreme_cb(char *ptr, size_t size, size_t nmemb, void *opaque) diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index 82e8c1b70da7..a7f5d200903c 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -25,8 +25,6 @@ #include "testtrace.h" -#include "curl_mem_undef.h" - #if defined(USE_QUICHE) || defined(USE_OPENSSL) #include #endif @@ -45,8 +43,6 @@ #include #endif -#include "memdebug.h" - static int verbose_d = 1; struct transfer_d { @@ -346,8 +342,8 @@ static CURLcode test_cli_hx_download(const char *URL) pause_offset = (size_t)num; break; case 'r': - free(resolve); - resolve = strdup(coptarg); + curlx_free(resolve); + resolve = curlx_strdup(coptarg); break; case 'T': if(!curlx_str_number(&opt, &num, LONG_MAX)) @@ -407,7 +403,7 @@ static CURLcode test_cli_hx_download(const char *URL) curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_PSL); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_HSTS); - transfer_d = calloc(transfer_count_d, sizeof(*transfer_d)); + transfer_d = curlx_calloc(transfer_count_d, sizeof(*transfer_d)); if(!transfer_d) { curl_mfprintf(stderr, "error allocating transfer structs\n"); res = (CURLcode)1; @@ -559,7 +555,7 @@ static CURLcode test_cli_hx_download(const char *URL) else /* on success we expect ssl to have been checked */ assert(t->checked_ssl); } - free(transfer_d); + curlx_free(transfer_d); } curl_share_cleanup(share); @@ -569,7 +565,7 @@ static CURLcode test_cli_hx_download(const char *URL) optcleanup: - free(resolve); + curlx_free(resolve); return res; } diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index f0183f6df2bf..f7036509fea2 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static int verbose_u = 1; @@ -358,7 +357,7 @@ static CURLcode test_cli_hx_upload(const char *URL) curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_PSL); curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_HSTS); - transfer_u = calloc(transfer_count_u, sizeof(*transfer_u)); + transfer_u = curlx_calloc(transfer_count_u, sizeof(*transfer_u)); if(!transfer_u) { curl_mfprintf(stderr, "error allocating transfer structs\n"); res = (CURLcode)1; @@ -539,7 +538,7 @@ static CURLcode test_cli_hx_upload(const char *URL) curl_mime_free(t->mime); } } - free(transfer_u); + curlx_free(transfer_u); } curl_share_cleanup(share); diff --git a/tests/libtest/cli_tls_session_reuse.c b/tests/libtest/cli_tls_session_reuse.c index 2f6bde43e384..aa56a0e28c66 100644 --- a/tests/libtest/cli_tls_session_reuse.c +++ b/tests/libtest/cli_tls_session_reuse.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static int tse_found_tls_session = FALSE; diff --git a/tests/libtest/cli_upload_pausing.c b/tests/libtest/cli_upload_pausing.c index 441ce899a09e..042eddd7d7dc 100644 --- a/tests/libtest/cli_upload_pausing.c +++ b/tests/libtest/cli_upload_pausing.c @@ -26,7 +26,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static size_t total_read = 0; diff --git a/tests/libtest/cli_ws_data.c b/tests/libtest/cli_ws_data.c index aa43bc6058ca..2276f0c92ce1 100644 --- a/tests/libtest/cli_ws_data.c +++ b/tests/libtest/cli_ws_data.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" #ifndef CURL_DISABLE_WEBSOCKETS @@ -83,8 +82,8 @@ static CURLcode test_ws_data_m2_echo(const char *url, size_t i, scount = count, rcount = count; int rblock, sblock; - send_buf = calloc(1, plen_max + 1); - recv_buf = calloc(1, plen_max + 1); + send_buf = curlx_calloc(1, plen_max + 1); + recv_buf = curlx_calloc(1, plen_max + 1); if(!send_buf || !recv_buf) { r = CURLE_OUT_OF_MEMORY; goto out; @@ -184,8 +183,8 @@ static CURLcode test_ws_data_m2_echo(const char *url, ws_close(curl); curl_easy_cleanup(curl); } - free(send_buf); - free(recv_buf); + curlx_free(send_buf); + curlx_free(recv_buf); return r; } @@ -294,8 +293,8 @@ static CURLcode test_ws_data_m1_echo(const char *url, curl_mfprintf(stderr, "test_ws_data_m1_echo(min=%zu, max=%zu)\n", plen_min, plen_max); memset(&m1_ctx, 0, sizeof(m1_ctx)); - m1_ctx.send_buf = calloc(1, plen_max + 1); - m1_ctx.recv_buf = calloc(1, plen_max + 1); + m1_ctx.send_buf = curlx_calloc(1, plen_max + 1); + m1_ctx.recv_buf = curlx_calloc(1, plen_max + 1); if(!m1_ctx.send_buf || !m1_ctx.recv_buf) { r = CURLE_OUT_OF_MEMORY; goto out; @@ -389,8 +388,8 @@ static CURLcode test_ws_data_m1_echo(const char *url, if(m1_ctx.curl) { curl_easy_cleanup(m1_ctx.curl); } - free(m1_ctx.send_buf); - free(m1_ctx.recv_buf); + curlx_free(m1_ctx.send_buf); + curlx_free(m1_ctx.recv_buf); return r; } diff --git a/tests/libtest/cli_ws_pingpong.c b/tests/libtest/cli_ws_pingpong.c index 0a8e957aa411..8449b9d1278f 100644 --- a/tests/libtest/cli_ws_pingpong.c +++ b/tests/libtest/cli_ws_pingpong.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" #ifndef CURL_DISABLE_WEBSOCKETS diff --git a/tests/libtest/first.c b/tests/libtest/first.c index a8e2e91cf0cc..2f6553088211 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -27,8 +27,6 @@ #include /* for setlocale() */ #endif -#include "memdebug.h" - int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc, struct timeval *tv) { diff --git a/tests/libtest/lib1156.c b/tests/libtest/lib1156.c index 6ceb6894e785..758f6e3f1ae9 100644 --- a/tests/libtest/lib1156.c +++ b/tests/libtest/lib1156.c @@ -34,8 +34,6 @@ */ -#include "memdebug.h" - #define F_RESUME (1 << 0) /* resume/range. */ #define F_HTTP416 (1 << 1) /* Server returns http code 416. */ #define F_FAIL (1 << 2) /* Fail on error. */ diff --git a/tests/libtest/lib1485.c b/tests/libtest/lib1485.c index 7fea83317c06..828e1ede74df 100644 --- a/tests/libtest/lib1485.c +++ b/tests/libtest/lib1485.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t1485_transfer_status { CURL *curl; curl_off_t out_len; diff --git a/tests/libtest/lib1500.c b/tests/libtest/lib1500.c index 5fe8e7ab4faf..921d1ce8b182 100644 --- a/tests/libtest/lib1500.c +++ b/tests/libtest/lib1500.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1500(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib1501.c b/tests/libtest/lib1501.c index 5b5e64c48cca..cd1cd874f777 100644 --- a/tests/libtest/lib1501.c +++ b/tests/libtest/lib1501.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1501(const char *URL) { static const long HANG_TIMEOUT = 30 * 1000; diff --git a/tests/libtest/lib1502.c b/tests/libtest/lib1502.c index 527f969b116f..1546acfaa8ad 100644 --- a/tests/libtest/lib1502.c +++ b/tests/libtest/lib1502.c @@ -31,8 +31,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1502(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib1506.c b/tests/libtest/lib1506.c index 5790f3baebad..8b986c59a029 100644 --- a/tests/libtest/lib1506.c +++ b/tests/libtest/lib1506.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1506(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1507.c b/tests/libtest/lib1507.c index d9f85a3318aa..ffdaa50df6d3 100644 --- a/tests/libtest/lib1507.c +++ b/tests/libtest/lib1507.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t1507_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { (void)ptr; diff --git a/tests/libtest/lib1508.c b/tests/libtest/lib1508.c index b7b47daa3f9e..446e8231a528 100644 --- a/tests/libtest/lib1508.c +++ b/tests/libtest/lib1508.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1508(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1509.c b/tests/libtest/lib1509.c index 3ab4feea8b8e..16935de7a757 100644 --- a/tests/libtest/lib1509.c +++ b/tests/libtest/lib1509.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t realHeaderSize = 0; static size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib1510.c b/tests/libtest/lib1510.c index e914d48eb78c..7a70763813d8 100644 --- a/tests/libtest/lib1510.c +++ b/tests/libtest/lib1510.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1510(const char *URL) { static const int NUM_URLS = 4; diff --git a/tests/libtest/lib1511.c b/tests/libtest/lib1511.c index de09d2a6fa93..fb65dcae988f 100644 --- a/tests/libtest/lib1511.c +++ b/tests/libtest/lib1511.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1511(const char *URL) { long unmet; diff --git a/tests/libtest/lib1512.c b/tests/libtest/lib1512.c index dd80163d43d4..16648d7e56f4 100644 --- a/tests/libtest/lib1512.c +++ b/tests/libtest/lib1512.c @@ -30,8 +30,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1512(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1513.c b/tests/libtest/lib1513.c index c86c5185e23e..8bf1613fa17b 100644 --- a/tests/libtest/lib1513.c +++ b/tests/libtest/lib1513.c @@ -30,8 +30,6 @@ #include "first.h" -#include "memdebug.h" - static int progressKiller(void *arg, double dltotal, double dlnow, diff --git a/tests/libtest/lib1514.c b/tests/libtest/lib1514.c index fc7e33e3d3b3..fa0aa0742439 100644 --- a/tests/libtest/lib1514.c +++ b/tests/libtest/lib1514.c @@ -28,8 +28,6 @@ #include "first.h" -#include "memdebug.h" - struct t1514_WriteThis { char *readptr; size_t sizeleft; diff --git a/tests/libtest/lib1515.c b/tests/libtest/lib1515.c index 679a413c69a3..7833f06a10f6 100644 --- a/tests/libtest/lib1515.c +++ b/tests/libtest/lib1515.c @@ -31,7 +31,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" #define DNS_TIMEOUT 1L diff --git a/tests/libtest/lib1517.c b/tests/libtest/lib1517.c index d8ad3b753bb2..cebdeab0a1b4 100644 --- a/tests/libtest/lib1517.c +++ b/tests/libtest/lib1517.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t1517_WriteThis { const char *readptr; size_t sizeleft; diff --git a/tests/libtest/lib1518.c b/tests/libtest/lib1518.c index 63e861910dd1..1ebe957af3f7 100644 --- a/tests/libtest/lib1518.c +++ b/tests/libtest/lib1518.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* Test inspired by github issue 3340 */ static size_t t1518_write_cb(char *buffer, size_t size, size_t nitems, diff --git a/tests/libtest/lib1520.c b/tests/libtest/lib1520.c index e61727eadc22..4cf54388eb1a 100644 --- a/tests/libtest/lib1520.c +++ b/tests/libtest/lib1520.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct upload_status { int lines_read; }; diff --git a/tests/libtest/lib1522.c b/tests/libtest/lib1522.c index 3423f4777c95..1ac2332e8121 100644 --- a/tests/libtest/lib1522.c +++ b/tests/libtest/lib1522.c @@ -26,7 +26,6 @@ /* test case and code based on https://github.com/curl/curl/issues/2847 */ #include "testtrace.h" -#include "memdebug.h" static int sockopt_callback(void *clientp, curl_socket_t curlfd, curlsocktype purpose) diff --git a/tests/libtest/lib1523.c b/tests/libtest/lib1523.c index 5c9a01a5eb1b..711aa3f7140f 100644 --- a/tests/libtest/lib1523.c +++ b/tests/libtest/lib1523.c @@ -25,8 +25,6 @@ /* test case and code based on https://github.com/curl/curl/issues/3927 */ -#include "memdebug.h" - static int dload_progress_cb(void *a, curl_off_t b, curl_off_t c, curl_off_t d, curl_off_t e) { diff --git a/tests/libtest/lib1525.c b/tests/libtest/lib1525.c index 7e7d98ef7997..c9a1e1514f80 100644 --- a/tests/libtest/lib1525.c +++ b/tests/libtest/lib1525.c @@ -30,8 +30,6 @@ #include "first.h" -#include "memdebug.h" - static const char t1525_testdata[] = "Hello Cloud!\n"; static size_t t1525_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib1526.c b/tests/libtest/lib1526.c index bf2a07ee9dfe..031f8bfd2746 100644 --- a/tests/libtest/lib1526.c +++ b/tests/libtest/lib1526.c @@ -29,8 +29,6 @@ #include "first.h" -#include "memdebug.h" - static const char t1526_testdata[] = "Hello Cloud!\n"; static size_t t1526_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib1527.c b/tests/libtest/lib1527.c index 362472868799..1d9a5821324b 100644 --- a/tests/libtest/lib1527.c +++ b/tests/libtest/lib1527.c @@ -29,8 +29,6 @@ #include "first.h" -#include "memdebug.h" - static const char t1527_testdata[] = "Hello Cloud!\n"; static size_t t1527_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib1528.c b/tests/libtest/lib1528.c index 98bd2bdaf18a..e1dd3657fe42 100644 --- a/tests/libtest/lib1528.c +++ b/tests/libtest/lib1528.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1528(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib1529.c b/tests/libtest/lib1529.c index ae86b61a5e67..24cdd78b0315 100644 --- a/tests/libtest/lib1529.c +++ b/tests/libtest/lib1529.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1529(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib1530.c b/tests/libtest/lib1530.c index 19b0d9cbde38..6cb6d59e874f 100644 --- a/tests/libtest/lib1530.c +++ b/tests/libtest/lib1530.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static curl_socket_t opensocket(void *clientp, curlsocktype purpose, struct curl_sockaddr *address) diff --git a/tests/libtest/lib1531.c b/tests/libtest/lib1531.c index 65b20c2993b4..a3554434e643 100644 --- a/tests/libtest/lib1531.c +++ b/tests/libtest/lib1531.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1531(const char *URL) { static char const testData[] = ".abc\0xyz"; diff --git a/tests/libtest/lib1532.c b/tests/libtest/lib1532.c index 83a826de32d2..e1c5c0470278 100644 --- a/tests/libtest/lib1532.c +++ b/tests/libtest/lib1532.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* Test CURLINFO_RESPONSE_CODE */ static CURLcode test_lib1532(const char *URL) diff --git a/tests/libtest/lib1533.c b/tests/libtest/lib1533.c index 1c6017273410..a2d541c4124f 100644 --- a/tests/libtest/lib1533.c +++ b/tests/libtest/lib1533.c @@ -31,8 +31,6 @@ #include "first.h" -#include "memdebug.h" - struct cb_data { CURL *curl; int response_received; diff --git a/tests/libtest/lib1534.c b/tests/libtest/lib1534.c index af1c0bd52020..377df3b2fe19 100644 --- a/tests/libtest/lib1534.c +++ b/tests/libtest/lib1534.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* Test CURLINFO_FILETIME */ static CURLcode test_lib1534(const char *URL) diff --git a/tests/libtest/lib1535.c b/tests/libtest/lib1535.c index c0e0689d98ba..c49c3076dfee 100644 --- a/tests/libtest/lib1535.c +++ b/tests/libtest/lib1535.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* Test CURLINFO_PROTOCOL */ static CURLcode test_lib1535(const char *URL) diff --git a/tests/libtest/lib1536.c b/tests/libtest/lib1536.c index 3219724b9aef..f89b50a19583 100644 --- a/tests/libtest/lib1536.c +++ b/tests/libtest/lib1536.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* Test CURLINFO_SCHEME */ static CURLcode test_lib1536(const char *URL) diff --git a/tests/libtest/lib1537.c b/tests/libtest/lib1537.c index cb35fb19087c..f521986ebc54 100644 --- a/tests/libtest/lib1537.c +++ b/tests/libtest/lib1537.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1537(const char *URL) { const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, diff --git a/tests/libtest/lib1538.c b/tests/libtest/lib1538.c index 9aaec8171a18..2a8830c5cce9 100644 --- a/tests/libtest/lib1538.c +++ b/tests/libtest/lib1538.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1538(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1540.c b/tests/libtest/lib1540.c index 7f9123435632..849431e79633 100644 --- a/tests/libtest/lib1540.c +++ b/tests/libtest/lib1540.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" struct t1540_transfer_status { CURL *curl; diff --git a/tests/libtest/lib1541.c b/tests/libtest/lib1541.c index 150fd2e30bc9..c39bee989cd7 100644 --- a/tests/libtest/lib1541.c +++ b/tests/libtest/lib1541.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t1541_transfer_status { CURL *curl; int hd_count; diff --git a/tests/libtest/lib1542.c b/tests/libtest/lib1542.c index 9fc9f17efb46..9a6ba0b36e0a 100644 --- a/tests/libtest/lib1542.c +++ b/tests/libtest/lib1542.c @@ -33,7 +33,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static CURLcode test_lib1542(const char *URL) { diff --git a/tests/libtest/lib1549.c b/tests/libtest/lib1549.c index 10d318381027..fa9515e4f6cb 100644 --- a/tests/libtest/lib1549.c +++ b/tests/libtest/lib1549.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static CURLcode test_lib1549(const char *URL) { diff --git a/tests/libtest/lib1550.c b/tests/libtest/lib1550.c index 566cbfa1928a..b328dd27bc2a 100644 --- a/tests/libtest/lib1550.c +++ b/tests/libtest/lib1550.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #include static CURLcode test_lib1550(const char *URL) diff --git a/tests/libtest/lib1551.c b/tests/libtest/lib1551.c index 80020f55566d..ce4989a6163d 100644 --- a/tests/libtest/lib1551.c +++ b/tests/libtest/lib1551.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #include static CURLcode test_lib1551(const char *URL) diff --git a/tests/libtest/lib1552.c b/tests/libtest/lib1552.c index d0c3469d4cea..bceacd354cdf 100644 --- a/tests/libtest/lib1552.c +++ b/tests/libtest/lib1552.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1552(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib1553.c b/tests/libtest/lib1553.c index fa753ac23102..d1eaefee4a4e 100644 --- a/tests/libtest/lib1553.c +++ b/tests/libtest/lib1553.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static int t1553_xferinfo(void *p, curl_off_t dltotal, curl_off_t dlnow, diff --git a/tests/libtest/lib1554.c b/tests/libtest/lib1554.c index a23d713e63d7..f330b2df7d90 100644 --- a/tests/libtest/lib1554.c +++ b/tests/libtest/lib1554.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static const char *ldata_names[] = { "NONE", "SHARE", diff --git a/tests/libtest/lib1555.c b/tests/libtest/lib1555.c index 4ebde5c74c6d..001a8f5bae7e 100644 --- a/tests/libtest/lib1555.c +++ b/tests/libtest/lib1555.c @@ -27,8 +27,6 @@ #include "first.h" -#include "memdebug.h" - static CURL *t1555_curl; static int progressCallback(void *arg, diff --git a/tests/libtest/lib1556.c b/tests/libtest/lib1556.c index 4987fc9f0969..e852bb322471 100644 --- a/tests/libtest/lib1556.c +++ b/tests/libtest/lib1556.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct headerinfo { size_t largest; }; diff --git a/tests/libtest/lib1557.c b/tests/libtest/lib1557.c index 1c2785dbe33e..28162a1b0342 100644 --- a/tests/libtest/lib1557.c +++ b/tests/libtest/lib1557.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1557(const char *URL) { CURLM *multi = NULL; diff --git a/tests/libtest/lib1558.c b/tests/libtest/lib1558.c index 1bbc0f77b75f..d299405fe214 100644 --- a/tests/libtest/lib1558.c +++ b/tests/libtest/lib1558.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1558(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1559.c b/tests/libtest/lib1559.c index 1aa0f830c75d..c6851918a685 100644 --- a/tests/libtest/lib1559.c +++ b/tests/libtest/lib1559.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1559(const char *URL) { static const int EXCESSIVE = 10*1000*1000; @@ -38,7 +36,7 @@ static CURLcode test_lib1559(const char *URL) global_init(CURL_GLOBAL_ALL); easy_init(curl); - longurl = malloc(EXCESSIVE); + longurl = curlx_malloc(EXCESSIVE); if(!longurl) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; @@ -70,7 +68,7 @@ static CURLcode test_lib1559(const char *URL) } test_cleanup: - free(longurl); + curlx_free(longurl); curl_easy_cleanup(curl); curl_global_cleanup(); diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index db85fe738239..2f6608108cca 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -35,8 +35,6 @@ #define USE_IDN #endif -#include "memdebug.h" /* LAST include file */ - static int checkparts(CURLU *u, const char *in, const char *wanted, unsigned int getflags) { diff --git a/tests/libtest/lib1564.c b/tests/libtest/lib1564.c index 42b3a07d1a91..23d0c2cd6f43 100644 --- a/tests/libtest/lib1564.c +++ b/tests/libtest/lib1564.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #define WAKEUP_NUM 10 static CURLcode test_lib1564(const char *URL) diff --git a/tests/libtest/lib1565.c b/tests/libtest/lib1565.c index 7e983978e7bf..506959dd9083 100644 --- a/tests/libtest/lib1565.c +++ b/tests/libtest/lib1565.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #ifdef HAVE_PTHREAD_H #include diff --git a/tests/libtest/lib1567.c b/tests/libtest/lib1567.c index e0016157256e..539da3c34f86 100644 --- a/tests/libtest/lib1567.c +++ b/tests/libtest/lib1567.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #include static CURLcode test_lib1567(const char *URL) diff --git a/tests/libtest/lib1568.c b/tests/libtest/lib1568.c index 89dd83480dad..0db1e49e2f7a 100644 --- a/tests/libtest/lib1568.c +++ b/tests/libtest/lib1568.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1568(const char *URL) { CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib1569.c b/tests/libtest/lib1569.c index c2fd27bfe195..44d77a5d455b 100644 --- a/tests/libtest/lib1569.c +++ b/tests/libtest/lib1569.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1569(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1571.c b/tests/libtest/lib1571.c index 622be2f643d0..8b29a9a1bf17 100644 --- a/tests/libtest/lib1571.c +++ b/tests/libtest/lib1571.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1571(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib1576.c b/tests/libtest/lib1576.c index 203ef2b9891e..9a5d415193e3 100644 --- a/tests/libtest/lib1576.c +++ b/tests/libtest/lib1576.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static char t1576_testdata[] = "request indicates that the client, which made"; static size_t t1576_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib1582.c b/tests/libtest/lib1582.c index 0e209beee450..e1877a99ac5a 100644 --- a/tests/libtest/lib1582.c +++ b/tests/libtest/lib1582.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1582(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib1591.c b/tests/libtest/lib1591.c index 3031ba1bb71c..42761c3065d2 100644 --- a/tests/libtest/lib1591.c +++ b/tests/libtest/lib1591.c @@ -29,8 +29,6 @@ #include "first.h" -#include "memdebug.h" - static size_t consumed = 0; static size_t t1591_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib1593.c b/tests/libtest/lib1593.c index 5b6e57d4f752..f8d7be9d7273 100644 --- a/tests/libtest/lib1593.c +++ b/tests/libtest/lib1593.c @@ -26,8 +26,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1593(const char *URL) { struct curl_slist *header = NULL; diff --git a/tests/libtest/lib1594.c b/tests/libtest/lib1594.c index 5c8db3ae92ae..6cf5cace5335 100644 --- a/tests/libtest/lib1594.c +++ b/tests/libtest/lib1594.c @@ -26,8 +26,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1594(const char *URL) { struct curl_slist *header = NULL; diff --git a/tests/libtest/lib1597.c b/tests/libtest/lib1597.c index 251016641e7a..a338a53944fb 100644 --- a/tests/libtest/lib1597.c +++ b/tests/libtest/lib1597.c @@ -26,8 +26,6 @@ #include "first.h" -#include "memdebug.h" - struct pair { const char *in; CURLcode *exp; diff --git a/tests/libtest/lib1598.c b/tests/libtest/lib1598.c index 4120916ff0ab..8d9ec7eb8e6b 100644 --- a/tests/libtest/lib1598.c +++ b/tests/libtest/lib1598.c @@ -29,8 +29,6 @@ #include "first.h" -#include "memdebug.h" - /* * carefully not leak memory on OOM */ diff --git a/tests/libtest/lib1900.c b/tests/libtest/lib1900.c index 2f0954bb6c52..04ce5aa9f197 100644 --- a/tests/libtest/lib1900.c +++ b/tests/libtest/lib1900.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1900(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1901.c b/tests/libtest/lib1901.c index cb66001f9bb2..4494633b94f3 100644 --- a/tests/libtest/lib1901.c +++ b/tests/libtest/lib1901.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t1901_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { static const char *chunks[] = { diff --git a/tests/libtest/lib1902.c b/tests/libtest/lib1902.c index 8e5929e33827..e114554ec526 100644 --- a/tests/libtest/lib1902.c +++ b/tests/libtest/lib1902.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1902(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1903.c b/tests/libtest/lib1903.c index fc2858d5eecb..19c2f50e197a 100644 --- a/tests/libtest/lib1903.c +++ b/tests/libtest/lib1903.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1903(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1905.c b/tests/libtest/lib1905.c index 600e6962383e..d1fdba4d2ea5 100644 --- a/tests/libtest/lib1905.c +++ b/tests/libtest/lib1905.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1905(const char *URL) { CURLSH *share = NULL; diff --git a/tests/libtest/lib1906.c b/tests/libtest/lib1906.c index da0f9f56b900..07404f8b9054 100644 --- a/tests/libtest/lib1906.c +++ b/tests/libtest/lib1906.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1906(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1907.c b/tests/libtest/lib1907.c index 0a3556719b61..ebf106d3b1e4 100644 --- a/tests/libtest/lib1907.c +++ b/tests/libtest/lib1907.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1907(const char *URL) { char *url_after; diff --git a/tests/libtest/lib1908.c b/tests/libtest/lib1908.c index ac841ca1a18b..2ceb04d5a243 100644 --- a/tests/libtest/lib1908.c +++ b/tests/libtest/lib1908.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1908(const char *URL) { CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib1910.c b/tests/libtest/lib1910.c index ebe86c12453c..4f2277752692 100644 --- a/tests/libtest/lib1910.c +++ b/tests/libtest/lib1910.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1910(const char *URL) { CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib1911.c b/tests/libtest/lib1911.c index 46c73ffb361d..0f88752b6fbd 100644 --- a/tests/libtest/lib1911.c +++ b/tests/libtest/lib1911.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* The maximum string length limit (CURL_MAX_INPUT_LENGTH) is an internal define not publicly exposed so we set our own */ #define MAX_INPUT_LENGTH 8000000 diff --git a/tests/libtest/lib1912.c b/tests/libtest/lib1912.c index 0dd246e4612b..76ba51c4479f 100644 --- a/tests/libtest/lib1912.c +++ b/tests/libtest/lib1912.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #define print_err(name, exp) \ curl_mfprintf(stderr, "Type mismatch for CURLOPT_%s (expected %s)\n", \ name, exp) diff --git a/tests/libtest/lib1913.c b/tests/libtest/lib1913.c index cea7a6c6ec81..b4b4ab720f83 100644 --- a/tests/libtest/lib1913.c +++ b/tests/libtest/lib1913.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1913(const char *URL) { CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib1915.c b/tests/libtest/lib1915.c index e47ae9ee8028..367533aef64f 100644 --- a/tests/libtest/lib1915.c +++ b/tests/libtest/lib1915.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" struct state { int index; diff --git a/tests/libtest/lib1916.c b/tests/libtest/lib1916.c index 24583ab8a189..4c66b1b97ead 100644 --- a/tests/libtest/lib1916.c +++ b/tests/libtest/lib1916.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1916(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1918.c b/tests/libtest/lib1918.c index de9252107bfb..d99563916416 100644 --- a/tests/libtest/lib1918.c +++ b/tests/libtest/lib1918.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1918(const char *URL) { const struct curl_easyoption *o; diff --git a/tests/libtest/lib1919.c b/tests/libtest/lib1919.c index a619850dc718..79d31810a466 100644 --- a/tests/libtest/lib1919.c +++ b/tests/libtest/lib1919.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1919(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1933.c b/tests/libtest/lib1933.c index bdd914a641ef..8b02f16aa7f8 100644 --- a/tests/libtest/lib1933.c +++ b/tests/libtest/lib1933.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1933(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1934.c b/tests/libtest/lib1934.c index 2cffaa9bc790..465dfeb5dec6 100644 --- a/tests/libtest/lib1934.c +++ b/tests/libtest/lib1934.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1934(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1935.c b/tests/libtest/lib1935.c index 4f6a1ebb731c..61382399a32f 100644 --- a/tests/libtest/lib1935.c +++ b/tests/libtest/lib1935.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1935(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1936.c b/tests/libtest/lib1936.c index 438cf92c58e0..20b170397e3c 100644 --- a/tests/libtest/lib1936.c +++ b/tests/libtest/lib1936.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1936(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1937.c b/tests/libtest/lib1937.c index 4903f7409a5c..c6fb120b6ad6 100644 --- a/tests/libtest/lib1937.c +++ b/tests/libtest/lib1937.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1937(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1938.c b/tests/libtest/lib1938.c index c0bfb6b8ced9..b585c53c0114 100644 --- a/tests/libtest/lib1938.c +++ b/tests/libtest/lib1938.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1938(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1939.c b/tests/libtest/lib1939.c index 9985af5adc28..b3d79fc68dd1 100644 --- a/tests/libtest/lib1939.c +++ b/tests/libtest/lib1939.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1939(const char *URL) { CURLM *multi; diff --git a/tests/libtest/lib1940.c b/tests/libtest/lib1940.c index 283128dc31d6..75b8f7818c02 100644 --- a/tests/libtest/lib1940.c +++ b/tests/libtest/lib1940.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t1940_write_cb(char *data, size_t n, size_t l, void *userp) { /* take care of the data here, ignored in this example */ diff --git a/tests/libtest/lib1945.c b/tests/libtest/lib1945.c index ee8e69f10016..99044880cfe8 100644 --- a/tests/libtest/lib1945.c +++ b/tests/libtest/lib1945.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static void t1945_showem(CURL *curl, unsigned int type) { struct curl_header *header = NULL; diff --git a/tests/libtest/lib1947.c b/tests/libtest/lib1947.c index 19fbcb7af417..acbc260aa1d5 100644 --- a/tests/libtest/lib1947.c +++ b/tests/libtest/lib1947.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t1947_write_cb(char *data, size_t n, size_t l, void *userp) { /* ignore the data */ diff --git a/tests/libtest/lib1955.c b/tests/libtest/lib1955.c index e47a52275e74..3fe118269e82 100644 --- a/tests/libtest/lib1955.c +++ b/tests/libtest/lib1955.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1955(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1956.c b/tests/libtest/lib1956.c index 0f1c72e3d2e2..a86a4c9e4ca3 100644 --- a/tests/libtest/lib1956.c +++ b/tests/libtest/lib1956.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1956(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1957.c b/tests/libtest/lib1957.c index 8eeed09b7c34..c7864a150c47 100644 --- a/tests/libtest/lib1957.c +++ b/tests/libtest/lib1957.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1957(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1958.c b/tests/libtest/lib1958.c index 7a94c76709a3..9a7f12f286ab 100644 --- a/tests/libtest/lib1958.c +++ b/tests/libtest/lib1958.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1958(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1959.c b/tests/libtest/lib1959.c index d718149772e3..6739cfe3ab9e 100644 --- a/tests/libtest/lib1959.c +++ b/tests/libtest/lib1959.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1959(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1960.c b/tests/libtest/lib1960.c index 152b1053f133..2dbdf5995fd3 100644 --- a/tests/libtest/lib1960.c +++ b/tests/libtest/lib1960.c @@ -32,8 +32,6 @@ #include #endif -#include "memdebug.h" - /* to prevent libcurl from closing our socket */ static int closesocket_cb(void *clientp, curl_socket_t item) { diff --git a/tests/libtest/lib1964.c b/tests/libtest/lib1964.c index cbad31dcc00f..9536575ba82d 100644 --- a/tests/libtest/lib1964.c +++ b/tests/libtest/lib1964.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1964(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1970.c b/tests/libtest/lib1970.c index 5ba51f6a58f2..fa110462c2c6 100644 --- a/tests/libtest/lib1970.c +++ b/tests/libtest/lib1970.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1970(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1971.c b/tests/libtest/lib1971.c index bc25226bded6..982f06b28629 100644 --- a/tests/libtest/lib1971.c +++ b/tests/libtest/lib1971.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t1971_read_cb(char *ptr, size_t size, size_t nitems, void *userp) { (void)ptr; diff --git a/tests/libtest/lib1972.c b/tests/libtest/lib1972.c index ec9c9b06988f..7931e866bf70 100644 --- a/tests/libtest/lib1972.c +++ b/tests/libtest/lib1972.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1972(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1973.c b/tests/libtest/lib1973.c index e887e80c2e0b..2cc1c8ebfe0c 100644 --- a/tests/libtest/lib1973.c +++ b/tests/libtest/lib1973.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1973(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1974.c b/tests/libtest/lib1974.c index b2d0b59450ea..1534cfadeeba 100644 --- a/tests/libtest/lib1974.c +++ b/tests/libtest/lib1974.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1974(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib1975.c b/tests/libtest/lib1975.c index d6c05a1251f2..c5b6568a07b1 100644 --- a/tests/libtest/lib1975.c +++ b/tests/libtest/lib1975.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t1975_read_cb(char *ptr, size_t size, size_t nitems, void *userp) { (void)ptr; diff --git a/tests/libtest/lib1977.c b/tests/libtest/lib1977.c index dae8bcbae70b..10412f66c0c4 100644 --- a/tests/libtest/lib1977.c +++ b/tests/libtest/lib1977.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1977(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib1978.c b/tests/libtest/lib1978.c index 113f06da8f3b..6c06e727dcb1 100644 --- a/tests/libtest/lib1978.c +++ b/tests/libtest/lib1978.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib1978(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib2023.c b/tests/libtest/lib2023.c index 8c181fa09338..1475deb2d3f8 100644 --- a/tests/libtest/lib2023.c +++ b/tests/libtest/lib2023.c @@ -28,14 +28,12 @@ #include "first.h" -#include "memdebug.h" - static CURLcode send_request(CURL *curl, const char *url, int seq, long auth_scheme, const char *userpwd) { CURLcode res; size_t len = strlen(url) + 4 + 1; - char *full_url = malloc(len); + char *full_url = curlx_malloc(len); if(!full_url) { curl_mfprintf(stderr, "Not enough memory for full url\n"); return CURLE_OUT_OF_MEMORY; @@ -54,7 +52,7 @@ static CURLcode send_request(CURL *curl, const char *url, int seq, res = curl_easy_perform(curl); test_cleanup: - free(full_url); + curlx_free(full_url); return res; } diff --git a/tests/libtest/lib2032.c b/tests/libtest/lib2032.c index e0f9990f59f4..a733f34e6fc0 100644 --- a/tests/libtest/lib2032.c +++ b/tests/libtest/lib2032.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #define MAX_EASY_HANDLES 3 static int ntlm_counter[MAX_EASY_HANDLES]; @@ -92,7 +90,7 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ int num_handles = 0; enum HandleState state = ReadyForNewHandle; size_t urllen = strlen(URL) + 4 + 1; - char *full_url = malloc(urllen); + char *full_url = curlx_malloc(urllen); start_test_timing(); @@ -108,7 +106,7 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ res_global_init(CURL_GLOBAL_ALL); if(res) { - free(full_url); + curlx_free(full_url); return res; } @@ -230,7 +228,7 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ curl_multi_cleanup(multi); curl_global_cleanup(); - free(full_url); + curlx_free(full_url); return res; } diff --git a/tests/libtest/lib2302.c b/tests/libtest/lib2302.c index 47276197bb08..aa0be3d5140d 100644 --- a/tests/libtest/lib2302.c +++ b/tests/libtest/lib2302.c @@ -102,7 +102,7 @@ static CURLcode test_lib2302(const char *URL) global_init(CURL_GLOBAL_ALL); memset(&ws_data, 0, sizeof(ws_data)); - ws_data.buf = (char *)calloc(LIB2302_BUFSIZE, 1); + ws_data.buf = (char *)curlx_calloc(LIB2302_BUFSIZE, 1); if(ws_data.buf) { curl = curl_easy_init(); if(curl) { @@ -120,7 +120,7 @@ static CURLcode test_lib2302(const char *URL) curl_easy_cleanup(curl); flush_data(&ws_data); } - free(ws_data.buf); + curlx_free(ws_data.buf); } curl_global_cleanup(); return res; diff --git a/tests/libtest/lib2402.c b/tests/libtest/lib2402.c index 1695208716b1..58c1b6c431fe 100644 --- a/tests/libtest/lib2402.c +++ b/tests/libtest/lib2402.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib2402(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib2404.c b/tests/libtest/lib2404.c index 42d81d8d4ae6..93a3ef926f40 100644 --- a/tests/libtest/lib2404.c +++ b/tests/libtest/lib2404.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib2404(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib2405.c b/tests/libtest/lib2405.c index 4f3c8015c64e..97d0d5d231e5 100644 --- a/tests/libtest/lib2405.c +++ b/tests/libtest/lib2405.c @@ -39,8 +39,6 @@ #include "first.h" -#include "memdebug.h" - /* ---------------------------------------------------------------- */ #define test_check(expected_fds) \ diff --git a/tests/libtest/lib2502.c b/tests/libtest/lib2502.c index b9a2cabd798c..4b5e0ef6833e 100644 --- a/tests/libtest/lib2502.c +++ b/tests/libtest/lib2502.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static CURLcode test_lib2502(const char *URL) { diff --git a/tests/libtest/lib2700.c b/tests/libtest/lib2700.c index f50908964543..1760d243ea1a 100644 --- a/tests/libtest/lib2700.c +++ b/tests/libtest/lib2700.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" #ifndef CURL_DISABLE_WEBSOCKETS diff --git a/tests/libtest/lib3010.c b/tests/libtest/lib3010.c index 4595f4de3577..0f805c2d6f7f 100644 --- a/tests/libtest/lib3010.c +++ b/tests/libtest/lib3010.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3010(const char *URL) { CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib3025.c b/tests/libtest/lib3025.c index b0056193b772..7d94c4062684 100644 --- a/tests/libtest/lib3025.c +++ b/tests/libtest/lib3025.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3025(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib3027.c b/tests/libtest/lib3027.c index 5cd2bd757d86..7a25c214bb9b 100644 --- a/tests/libtest/lib3027.c +++ b/tests/libtest/lib3027.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3027(const char *URL) { CURLcode ret = CURLE_OK; diff --git a/tests/libtest/lib3033.c b/tests/libtest/lib3033.c index b00bba9e7466..428de8afc31d 100644 --- a/tests/libtest/lib3033.c +++ b/tests/libtest/lib3033.c @@ -25,8 +25,6 @@ #include "testtrace.h" -#include "memdebug.h" - static CURLcode t3033_req_test(CURLM *multi, CURL *curl, const char *URL, int index) { diff --git a/tests/libtest/lib3100.c b/tests/libtest/lib3100.c index b661aa76ceb1..e9a2b4111c77 100644 --- a/tests/libtest/lib3100.c +++ b/tests/libtest/lib3100.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3100(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib3101.c b/tests/libtest/lib3101.c index 3f5cbce17cbf..d95167f0ce6d 100644 --- a/tests/libtest/lib3101.c +++ b/tests/libtest/lib3101.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3101(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib3102.c b/tests/libtest/lib3102.c index 9cc87543dc87..72da47551e40 100644 --- a/tests/libtest/lib3102.c +++ b/tests/libtest/lib3102.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Verify correct order of certificates in the chain by comparing the * subject and issuer attributes of each certificate. diff --git a/tests/libtest/lib3103.c b/tests/libtest/lib3103.c index 5b25e1cd4175..4e3a0d79fd4d 100644 --- a/tests/libtest/lib3103.c +++ b/tests/libtest/lib3103.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3103(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib3104.c b/tests/libtest/lib3104.c index dd1500ede55c..278aa515b1de 100644 --- a/tests/libtest/lib3104.c +++ b/tests/libtest/lib3104.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3104(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib3105.c b/tests/libtest/lib3105.c index 808fd98ca4de..a3cbf28bb8b5 100644 --- a/tests/libtest/lib3105.c +++ b/tests/libtest/lib3105.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3105(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib3207.c b/tests/libtest/lib3207.c index 8ba88e4a66b6..7757643a269b 100644 --- a/tests/libtest/lib3207.c +++ b/tests/libtest/lib3207.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #ifdef USE_THREADS_POSIX #include #endif @@ -48,7 +46,7 @@ static size_t write_memory_callback(char *contents, size_t size, /* append the data to contents */ size_t realsize = size * nmemb; struct Ctx *mem = (struct Ctx *)userp; - char *data = (char *)malloc(realsize + 1); + char *data = (char *)curlx_malloc(realsize + 1); struct curl_slist *item_append = NULL; if(!data) { curl_mprintf("not enough memory (malloc returned NULL)\n"); @@ -57,7 +55,7 @@ static size_t write_memory_callback(char *contents, size_t size, memcpy(data, contents, realsize); data[realsize] = '\0'; item_append = curl_slist_append(mem->contents, data); - free(data); + curlx_free(data); if(item_append) { mem->contents = item_append; } diff --git a/tests/libtest/lib3208.c b/tests/libtest/lib3208.c index 39585c159775..befa92e6d0ca 100644 --- a/tests/libtest/lib3208.c +++ b/tests/libtest/lib3208.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib3208(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c index ff886a05ca60..0d01b0102649 100644 --- a/tests/libtest/lib500.c +++ b/tests/libtest/lib500.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static int testcounter; diff --git a/tests/libtest/lib501.c b/tests/libtest/lib501.c index d761c8a63604..3dbed1cd4ff5 100644 --- a/tests/libtest/lib501.c +++ b/tests/libtest/lib501.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib501(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib502.c b/tests/libtest/lib502.c index c33783ea687a..4e1fc14a97a7 100644 --- a/tests/libtest/lib502.c +++ b/tests/libtest/lib502.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Get a single URL without select(). */ diff --git a/tests/libtest/lib503.c b/tests/libtest/lib503.c index 34a6105bf7ae..48f0b671b91a 100644 --- a/tests/libtest/lib503.c +++ b/tests/libtest/lib503.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Source code in here hugely as reported in bug report 651460 by * Christopher R. Palmer. diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c index fa9338f262ec..996130c246d4 100644 --- a/tests/libtest/lib504.c +++ b/tests/libtest/lib504.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Source code in here hugely as reported in bug report 651464 by * Christopher R. Palmer. diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index 37cc1e0b3f8c..b28a01a9ce05 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * This example shows an FTP upload, with a rename of the file just after * a successful upload. diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index 928c33b13cc3..3d2a3556fdb0 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" #define THREADS 2 diff --git a/tests/libtest/lib507.c b/tests/libtest/lib507.c index 9a306d39a656..0496099ce204 100644 --- a/tests/libtest/lib507.c +++ b/tests/libtest/lib507.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib507(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib508.c b/tests/libtest/lib508.c index a4c25b7918f6..697505150056 100644 --- a/tests/libtest/lib508.c +++ b/tests/libtest/lib508.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t508_WriteThis { const char *readptr; size_t sizeleft; diff --git a/tests/libtest/lib509.c b/tests/libtest/lib509.c index a8be3eae5221..b5a0c583e072 100644 --- a/tests/libtest/lib509.c +++ b/tests/libtest/lib509.c @@ -29,9 +29,8 @@ * libcurl and that it works unconditionally no matter how libcurl is built, * nothing more. * - * Do not include memdebug.h in this source file, and do not use directly - * memory related functions in this file except those used inside custom - * memory callbacks which should be calling 'the real thing'. + * Do not use directly memory related functions in this file except those used + * inside custom memory callbacks which should be calling 'the real thing'. */ static int seen; @@ -39,31 +38,40 @@ static int seen; static void *custom_calloc(size_t nmemb, size_t size) { seen++; - return (calloc)(nmemb, size); + /* !checksrc! disable BANNEDFUNC 1 */ + return calloc(nmemb, size); } static void *custom_malloc(size_t size) { seen++; - return (malloc)(size); + /* !checksrc! disable BANNEDFUNC 1 */ + return malloc(size); } static char *custom_strdup(const char *ptr) { seen++; - return (strdup)(ptr); +#ifdef _WIN32 + return _strdup(ptr); +#else + /* !checksrc! disable BANNEDFUNC 1 */ + return strdup(ptr); +#endif } static void *custom_realloc(void *ptr, size_t size) { seen++; - return (realloc)(ptr, size); + /* !checksrc! disable BANNEDFUNC 1 */ + return realloc(ptr, size); } static void custom_free(void *ptr) { seen++; - (free)(ptr); + /* !checksrc! disable BANNEDFUNC 1 */ + free(ptr); } @@ -95,10 +103,11 @@ static CURLcode test_lib509(const char *URL) return TEST_ERR_MAJOR_BAD; } - test_setopt(curl, CURLOPT_USERAGENT, "test509"); /* uses strdup() */ + test_setopt(curl, CURLOPT_USERAGENT, "test509"); /* uses curlx_strdup() */ asize = (int)sizeof(a); - str = curl_easy_escape(curl, (const char *)a, asize); /* uses realloc() */ + /* uses curlx_realloc() */ + str = curl_easy_escape(curl, (const char *)a, asize); if(seen) curl_mprintf("Callbacks were invoked!\n"); diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c index da270c1c9213..d2df0eaf203b 100644 --- a/tests/libtest/lib510.c +++ b/tests/libtest/lib510.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t510_WriteThis { int counter; }; diff --git a/tests/libtest/lib511.c b/tests/libtest/lib511.c index 1db409378098..c4e78a1117ec 100644 --- a/tests/libtest/lib511.c +++ b/tests/libtest/lib511.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib511(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib512.c b/tests/libtest/lib512.c index 59a1cd7595d5..be7187542a14 100644 --- a/tests/libtest/lib512.c +++ b/tests/libtest/lib512.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* Test case code based on source in a bug report filed by James Bursa on 28 Apr 2004 */ diff --git a/tests/libtest/lib513.c b/tests/libtest/lib513.c index 3d0afb1191b9..1458971007ec 100644 --- a/tests/libtest/lib513.c +++ b/tests/libtest/lib513.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static size_t t513_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { (void)ptr; diff --git a/tests/libtest/lib514.c b/tests/libtest/lib514.c index f47cdb321d58..0ce96f5be81f 100644 --- a/tests/libtest/lib514.c +++ b/tests/libtest/lib514.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib514(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib515.c b/tests/libtest/lib515.c index d9814525df55..b0d3a65d5073 100644 --- a/tests/libtest/lib515.c +++ b/tests/libtest/lib515.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib515(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib516.c b/tests/libtest/lib516.c index b7778a6a76c8..42b63c9d87d0 100644 --- a/tests/libtest/lib516.c +++ b/tests/libtest/lib516.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib516(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c index 01d3ac4bad1a..843c5c03f0ef 100644 --- a/tests/libtest/lib517.c +++ b/tests/libtest/lib517.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib517(const char *URL) { struct dcheck { diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index b8a9ec4a6a84..d785857bb1c0 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" #ifndef FD_SETSIZE #error "this test requires FD_SETSIZE" @@ -65,7 +64,7 @@ static void t518_close_file_descriptors(void) t518_num_open.rlim_cur++) if(t518_testfd[t518_num_open.rlim_cur] > 0) close(t518_testfd[t518_num_open.rlim_cur]); - free(t518_testfd); + curlx_free(t518_testfd); t518_testfd = NULL; } @@ -213,8 +212,8 @@ static int t518_test_rlimit(int keep_open) * avoid a low memory condition once the file descriptors are * open. System conditions that could make the test fail should * be addressed in the precheck phase. This chunk of memory shall - * be always free()ed before exiting the t518_test_rlimit() function so - * that it becomes available to the test. + * be always curlx_free()ed before exiting the t518_test_rlimit() + * function so that it becomes available to the test. */ for(nitems = i = 1; nitems <= i; i *= 2) @@ -225,7 +224,7 @@ static int t518_test_rlimit(int keep_open) t518_num_open.rlim_max = sizeof(*memchunk) * nitems; tutil_rlim2str(strbuff, sizeof(strbuff), t518_num_open.rlim_max); curl_mfprintf(stderr, "allocating memchunk %s byte array\n", strbuff); - memchunk = malloc(sizeof(*memchunk) * (size_t)nitems); + memchunk = curlx_malloc(sizeof(*memchunk) * (size_t)nitems); if(!memchunk) { curl_mfprintf(stderr, "memchunk, malloc() failed\n"); nitems /= 2; @@ -248,7 +247,7 @@ static int t518_test_rlimit(int keep_open) t518_num_open.rlim_max = NUM_OPEN; - /* verify that we do not overflow size_t in malloc() */ + /* verify that we do not overflow size_t in curlx_malloc() */ if((size_t)(t518_num_open.rlim_max) > ((size_t)-1) / sizeof(*t518_testfd)) { tutil_rlim2str(strbuff1, sizeof(strbuff1), t518_num_open.rlim_max); @@ -257,7 +256,7 @@ static int t518_test_rlimit(int keep_open) "file descriptors, would overflow size_t", strbuff1); t518_store_errmsg(strbuff, 0); curl_mfprintf(stderr, "%s\n", t518_msgbuff); - free(memchunk); + curlx_free(memchunk); return -6; } @@ -266,12 +265,12 @@ static int t518_test_rlimit(int keep_open) tutil_rlim2str(strbuff, sizeof(strbuff), t518_num_open.rlim_max); curl_mfprintf(stderr, "allocating array for %s file descriptors\n", strbuff); - t518_testfd = malloc(sizeof(*t518_testfd) * - (size_t)(t518_num_open.rlim_max)); + t518_testfd = curlx_malloc(sizeof(*t518_testfd) * + (size_t)(t518_num_open.rlim_max)); if(!t518_testfd) { t518_store_errmsg("testfd, malloc() failed", errno); curl_mfprintf(stderr, "%s\n", t518_msgbuff); - free(memchunk); + curlx_free(memchunk); return -7; } @@ -294,9 +293,9 @@ static int t518_test_rlimit(int keep_open) curl_msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); t518_store_errmsg(strbuff, errno); curl_mfprintf(stderr, "%s\n", t518_msgbuff); - free(t518_testfd); + curlx_free(t518_testfd); t518_testfd = NULL; - free(memchunk); + curlx_free(memchunk); return -8; } @@ -335,9 +334,9 @@ static int t518_test_rlimit(int keep_open) t518_testfd[t518_num_open.rlim_cur] >= 0; t518_num_open.rlim_cur++) close(t518_testfd[t518_num_open.rlim_cur]); - free(t518_testfd); + curlx_free(t518_testfd); t518_testfd = NULL; - free(memchunk); + curlx_free(memchunk); return -9; } } @@ -365,7 +364,7 @@ static int t518_test_rlimit(int keep_open) t518_store_errmsg(strbuff, 0); curl_mfprintf(stderr, "%s\n", t518_msgbuff); t518_close_file_descriptors(); - free(memchunk); + curlx_free(memchunk); return -10; } @@ -380,7 +379,7 @@ static int t518_test_rlimit(int keep_open) t518_store_errmsg(strbuff, 0); curl_mfprintf(stderr, "%s\n", t518_msgbuff); t518_close_file_descriptors(); - free(memchunk); + curlx_free(memchunk); return -11; } } @@ -405,14 +404,14 @@ static int t518_test_rlimit(int keep_open) "fopen fails with lots of fds open"); t518_store_errmsg(strbuff, 0); t518_close_file_descriptors(); - free(memchunk); + curlx_free(memchunk); return -12; } /* free the chunk of memory we were reserving so that it becomes available to the test */ - free(memchunk); + curlx_free(memchunk); /* close file descriptors unless instructed to keep them */ diff --git a/tests/libtest/lib519.c b/tests/libtest/lib519.c index 615e8aac8a52..0d2f23e0d355 100644 --- a/tests/libtest/lib519.c +++ b/tests/libtest/lib519.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib519(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib520.c b/tests/libtest/lib520.c index 34f7c541e222..b3e67864e21e 100644 --- a/tests/libtest/lib520.c +++ b/tests/libtest/lib520.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib520(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib521.c b/tests/libtest/lib521.c index acfec703811f..0d2bacd16de1 100644 --- a/tests/libtest/lib521.c +++ b/tests/libtest/lib521.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib521(const char *URL) { CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib523.c b/tests/libtest/lib523.c index 3b56ada894e8..60648a7da1fc 100644 --- a/tests/libtest/lib523.c +++ b/tests/libtest/lib523.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib523(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib524.c b/tests/libtest/lib524.c index e015e58637eb..5b7e01c087b5 100644 --- a/tests/libtest/lib524.c +++ b/tests/libtest/lib524.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib524(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c index 4ca7ab7d6545..abc75644ce5b 100644 --- a/tests/libtest/lib525.c +++ b/tests/libtest/lib525.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib525(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c index 6f586c5a3e54..a4d5ab6b1a1e 100644 --- a/tests/libtest/lib526.c +++ b/tests/libtest/lib526.c @@ -42,8 +42,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib526(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index e7e86a32ccbb..429a4869f5c9 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -30,9 +30,6 @@ #include "first.h" -#include "memdebug.h" - - static struct t530_ctx { int socket_calls; int max_socket_calls; @@ -106,14 +103,15 @@ static int t530_addFd(struct t530_Sockets *sockets, curl_socket_t fd, * Allocate array storage when required. */ if(!sockets->sockets) { - sockets->sockets = malloc(sizeof(curl_socket_t) * 20U); + sockets->sockets = curlx_malloc(sizeof(curl_socket_t) * 20U); if(!sockets->sockets) return 1; sockets->max_count = 20; } else if(sockets->count + 1 > sockets->max_count) { - curl_socket_t *ptr = realloc(sockets->sockets, sizeof(curl_socket_t) * - (sockets->max_count + 20)); + curl_socket_t *ptr = curlx_realloc(sockets->sockets, + sizeof(curl_socket_t) * + (sockets->max_count + 20)); if(!ptr) /* cleanup in test_cleanup */ return 1; @@ -390,8 +388,8 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) curl_global_cleanup(); /* free local memory */ - free(sockets.read.sockets); - free(sockets.write.sockets); + curlx_free(sockets.read.sockets); + curlx_free(sockets.write.sockets); t530_msg("done"); return res; diff --git a/tests/libtest/lib533.c b/tests/libtest/lib533.c index 8f3b0f1474c0..b730960695a6 100644 --- a/tests/libtest/lib533.c +++ b/tests/libtest/lib533.c @@ -25,8 +25,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib533(const char *URL) { CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c index c0107ed9cbdc..4810aba83fc3 100644 --- a/tests/libtest/lib536.c +++ b/tests/libtest/lib536.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static void proxystat(CURL *curl) { long wasproxy; diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index 02d4a89b26a6..8027a09c0286 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" #if !defined(HAVE_POLL) && !defined(USE_WINSOCK) && !defined(FD_SETSIZE) #error "this test requires FD_SETSIZE" @@ -62,7 +61,7 @@ static void t537_close_file_descriptors(void) t537_num_open.rlim_cur++) if(t537_testfd[t537_num_open.rlim_cur] > 0) close(t537_testfd[t537_num_open.rlim_cur]); - free(t537_testfd); + curlx_free(t537_testfd); t537_testfd = NULL; } @@ -193,8 +192,8 @@ static int t537_test_rlimit(int keep_open) * avoid a low memory condition once the file descriptors are * open. System conditions that could make the test fail should * be addressed in the precheck phase. This chunk of memory shall - * be always free()ed before exiting the t537_test_rlimit() function so - * that it becomes available to the test. + * be always curlx_free()ed before exiting the t537_test_rlimit() + * function so that it becomes available to the test. */ for(nitems = i = 1; nitems <= i; i *= 2) @@ -205,7 +204,7 @@ static int t537_test_rlimit(int keep_open) t537_num_open.rlim_max = sizeof(*memchunk) * nitems; tutil_rlim2str(strbuff, sizeof(strbuff), t537_num_open.rlim_max); curl_mfprintf(stderr, "allocating memchunk %s byte array\n", strbuff); - memchunk = malloc(sizeof(*memchunk) * (size_t)nitems); + memchunk = curlx_malloc(sizeof(*memchunk) * (size_t)nitems); if(!memchunk) { curl_mfprintf(stderr, "memchunk, malloc() failed\n"); nitems /= 2; @@ -243,7 +242,7 @@ static int t537_test_rlimit(int keep_open) t537_num_open.rlim_max = nitems; } - /* verify that we do not overflow size_t in malloc() */ + /* verify that we do not overflow size_t in curlx_malloc() */ if((size_t)(t537_num_open.rlim_max) > ((size_t)-1) / sizeof(*t537_testfd)) { tutil_rlim2str(strbuff1, sizeof(strbuff1), t537_num_open.rlim_max); @@ -252,7 +251,7 @@ static int t537_test_rlimit(int keep_open) "file descriptors, would overflow size_t", strbuff1); t537_store_errmsg(strbuff, 0); curl_mfprintf(stderr, "%s\n", t537_msgbuff); - free(memchunk); + curlx_free(memchunk); return -5; } @@ -263,8 +262,8 @@ static int t537_test_rlimit(int keep_open) curl_mfprintf(stderr, "allocating array for %s file descriptors\n", strbuff); - t537_testfd = malloc(sizeof(*t537_testfd) * - (size_t)(t537_num_open.rlim_max)); + t537_testfd = curlx_malloc(sizeof(*t537_testfd) * + (size_t)(t537_num_open.rlim_max)); if(!t537_testfd) { curl_mfprintf(stderr, "testfd, malloc() failed\n"); t537_num_open.rlim_max /= 2; @@ -273,7 +272,7 @@ static int t537_test_rlimit(int keep_open) if(!t537_testfd) { t537_store_errmsg("testfd, malloc() failed", errno); curl_mfprintf(stderr, "%s\n", t537_msgbuff); - free(memchunk); + curlx_free(memchunk); return -6; } @@ -296,9 +295,9 @@ static int t537_test_rlimit(int keep_open) curl_msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); t537_store_errmsg(strbuff, errno); curl_mfprintf(stderr, "%s\n", t537_msgbuff); - free(t537_testfd); + curlx_free(t537_testfd); t537_testfd = NULL; - free(memchunk); + curlx_free(memchunk); return -7; } @@ -345,8 +344,9 @@ static int t537_test_rlimit(int keep_open) /* we do not care if we cannot shrink it */ - tmpfd = realloc(t537_testfd, - sizeof(*t537_testfd) * (size_t)(t537_num_open.rlim_max)); + tmpfd = curlx_realloc(t537_testfd, + sizeof(*t537_testfd) * + (size_t)(t537_num_open.rlim_max)); if(tmpfd) { t537_testfd = tmpfd; tmpfd = NULL; @@ -379,7 +379,7 @@ static int t537_test_rlimit(int keep_open) t537_store_errmsg(strbuff, 0); curl_mfprintf(stderr, "%s\n", t537_msgbuff); t537_close_file_descriptors(); - free(memchunk); + curlx_free(memchunk); return -8; } @@ -394,7 +394,7 @@ static int t537_test_rlimit(int keep_open) t537_store_errmsg(strbuff, 0); curl_mfprintf(stderr, "%s\n", t537_msgbuff); t537_close_file_descriptors(); - free(memchunk); + curlx_free(memchunk); return -9; } } @@ -419,14 +419,14 @@ static int t537_test_rlimit(int keep_open) "fopen fails with lots of fds open"); t537_store_errmsg(strbuff, 0); t537_close_file_descriptors(); - free(memchunk); + curlx_free(memchunk); return -10; } /* free the chunk of memory we were reserving so that it becomes available to the test */ - free(memchunk); + curlx_free(memchunk); /* close file descriptors unless instructed to keep them */ diff --git a/tests/libtest/lib539.c b/tests/libtest/lib539.c index e4e26c204a13..1e6c0fb0ef2f 100644 --- a/tests/libtest/lib539.c +++ b/tests/libtest/lib539.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib539(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index 55d5adad0742..5e8890d98421 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -32,8 +32,6 @@ #include "first.h" -#include "memdebug.h" - static CURL *t540_curl[2]; static CURLcode init(int num, CURLM *multi, const char *url, diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c index ebab472456b5..891c2de52585 100644 --- a/tests/libtest/lib541.c +++ b/tests/libtest/lib541.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Two FTP uploads, the second with no content sent. */ diff --git a/tests/libtest/lib542.c b/tests/libtest/lib542.c index b29a2733fffd..d6689517c7d2 100644 --- a/tests/libtest/lib542.c +++ b/tests/libtest/lib542.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * FTP get with NOBODY but no HEADER */ diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c index 579a71a6117c..9938d269addc 100644 --- a/tests/libtest/lib543.c +++ b/tests/libtest/lib543.c @@ -25,8 +25,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib543(const char *URL) { static const unsigned char a[] = { diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c index d0ed914051ed..0d72af3042d5 100644 --- a/tests/libtest/lib544.c +++ b/tests/libtest/lib544.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib544(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index 9184d933a882..8f51fef088d8 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -28,8 +28,6 @@ #include "first.h" -#include "memdebug.h" - static const char t547_uploadthis[] = "this is the blurb we want to upload\n"; #define T547_DATALEN (sizeof(t547_uploadthis)-1) diff --git a/tests/libtest/lib549.c b/tests/libtest/lib549.c index 4eaacf5868a4..2793f92bcb51 100644 --- a/tests/libtest/lib549.c +++ b/tests/libtest/lib549.c @@ -28,8 +28,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib549(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index 3d5b09c1ec3f..403ad6fec196 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -28,7 +28,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static size_t current_offset = 0; static char databuf[70000]; /* MUST be more than 64k OR diff --git a/tests/libtest/lib553.c b/tests/libtest/lib553.c index 0d44573131ec..4bc2568a46fd 100644 --- a/tests/libtest/lib553.c +++ b/tests/libtest/lib553.c @@ -28,8 +28,6 @@ #include "first.h" -#include "memdebug.h" - #define POSTLEN 40960 static size_t myreadfunc(char *ptr, size_t size, size_t nmemb, void *stream) diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c index 230da065a1b4..dd8c690ddbc3 100644 --- a/tests/libtest/lib554.c +++ b/tests/libtest/lib554.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t554_WriteThis { const char *readptr; size_t sizeleft; diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index 19e0480e2a51..005fefe72ff8 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -32,8 +32,6 @@ #include "first.h" -#include "memdebug.h" - static const char t555_uploadthis[] = "this is the blurb we want to upload\n"; #define T555_DATALEN (sizeof(t555_uploadthis)-1) diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index daf92fe1e600..cdf9ebe94194 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib556(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 38d93a687e81..fa1ee2fa2fbc 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -33,8 +33,6 @@ # include /* for setlocale() */ #endif -#include "memdebug.h" - #if defined(CURL_GNUC_DIAG) || defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat" diff --git a/tests/libtest/lib558.c b/tests/libtest/lib558.c index c82b6ee969de..94dd7f57b80f 100644 --- a/tests/libtest/lib558.c +++ b/tests/libtest/lib558.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib558(const char *URL) { unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, @@ -40,7 +38,7 @@ static CURLcode test_lib558(const char *URL) return TEST_ERR_MAJOR_BAD; } - ptr = malloc(558); + ptr = curlx_malloc(558); Curl_safefree(ptr); asize = (int)sizeof(a); diff --git a/tests/libtest/lib559.c b/tests/libtest/lib559.c index 36a557512652..bf9cd86e639e 100644 --- a/tests/libtest/lib559.c +++ b/tests/libtest/lib559.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib559(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib560.c b/tests/libtest/lib560.c index 45f137aabeb7..fc156f43d795 100644 --- a/tests/libtest/lib560.c +++ b/tests/libtest/lib560.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Simply download an HTTPS file! * diff --git a/tests/libtest/lib562.c b/tests/libtest/lib562.c index 3f2c912c9173..fbe2560147df 100644 --- a/tests/libtest/lib562.c +++ b/tests/libtest/lib562.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * From "KNOWN_BUGS" April 2009: diff --git a/tests/libtest/lib564.c b/tests/libtest/lib564.c index b105fc710e6b..56acfe40f72a 100644 --- a/tests/libtest/lib564.c +++ b/tests/libtest/lib564.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" static CURLcode test_lib564(const char *URL) { diff --git a/tests/libtest/lib566.c b/tests/libtest/lib566.c index 79f48f235b2c..89adbdbd9c75 100644 --- a/tests/libtest/lib566.c +++ b/tests/libtest/lib566.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib566(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib567.c b/tests/libtest/lib567.c index a11a6c31f010..95b66f102c25 100644 --- a/tests/libtest/lib567.c +++ b/tests/libtest/lib567.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Test a simple OPTIONS request with a custom header */ diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index 5465ca0c8be8..260061f5191f 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" /* * Test the Client->Server ANNOUNCE functionality (PUT style) diff --git a/tests/libtest/lib569.c b/tests/libtest/lib569.c index 1c44153d009f..77e0471e5f4e 100644 --- a/tests/libtest/lib569.c +++ b/tests/libtest/lib569.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" /* * Test Session ID capture diff --git a/tests/libtest/lib570.c b/tests/libtest/lib570.c index 300881efa7b7..f5ada6770b2e 100644 --- a/tests/libtest/lib570.c +++ b/tests/libtest/lib570.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" static CURLcode test_lib570(const char *URL) { diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c index 509557f0f50b..678141b1c545 100644 --- a/tests/libtest/lib571.c +++ b/tests/libtest/lib571.c @@ -34,7 +34,6 @@ #endif #include "testutil.h" -#include "memdebug.h" #define RTP_PKT_CHANNEL(p) ((int)((unsigned char)((p)[1]))) diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c index 2865372f5fef..4e20cb3da5b8 100644 --- a/tests/libtest/lib572.c +++ b/tests/libtest/lib572.c @@ -24,7 +24,6 @@ #include "first.h" #include "testutil.h" -#include "memdebug.h" /* * Test GET_PARAMETER: PUT, HEARTBEAT, and POST diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c index 38612df7b58c..ed00bbb04243 100644 --- a/tests/libtest/lib573.c +++ b/tests/libtest/lib573.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" /* * Get a single URL without select(). diff --git a/tests/libtest/lib574.c b/tests/libtest/lib574.c index e82be6c0d663..f74371e97383 100644 --- a/tests/libtest/lib574.c +++ b/tests/libtest/lib574.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static int new_fnmatch(void *ptr, const char *pattern, const char *string) { diff --git a/tests/libtest/lib575.c b/tests/libtest/lib575.c index 36efe6ef5a66..4709708a52bd 100644 --- a/tests/libtest/lib575.c +++ b/tests/libtest/lib575.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* 3x download! * 1. normal * 2. dup handle diff --git a/tests/libtest/lib576.c b/tests/libtest/lib576.c index 11c0f76d1390..7ee7bc9525d4 100644 --- a/tests/libtest/lib576.c +++ b/tests/libtest/lib576.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct chunk_data { int remains; int print_content; diff --git a/tests/libtest/lib578.c b/tests/libtest/lib578.c index b6be1600f4c9..799821123df2 100644 --- a/tests/libtest/lib578.c +++ b/tests/libtest/lib578.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* The size of data should be kept below MAX_INITIAL_POST_SIZE! */ static char t578_testdata[] = "this is a short string.\n"; diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index 9e626c130002..aaa81baedeb1 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t579_WriteThis { int counter; }; diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index 4318096e1f79..e99d5febdfab 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t582_Sockets { curl_socket_t *sockets; int count; /* number of sockets actually stored in array */ @@ -72,7 +70,7 @@ static void t582_addFd(struct t582_Sockets *sockets, curl_socket_t fd, * Allocate array storage when required. */ if(!sockets->sockets) { - sockets->sockets = malloc(sizeof(curl_socket_t) * 20U); + sockets->sockets = curlx_malloc(sizeof(curl_socket_t) * 20U); if(!sockets->sockets) return; sockets->max_count = 20; @@ -359,8 +357,8 @@ static CURLcode test_lib582(const char *URL) curlx_fclose(hd_src); /* free local memory */ - free(sockets.read.sockets); - free(sockets.write.sockets); + curlx_free(sockets.read.sockets); + curlx_free(sockets.write.sockets); return res; } diff --git a/tests/libtest/lib583.c b/tests/libtest/lib583.c index 510c5a3bdcf6..8f29e310c7ed 100644 --- a/tests/libtest/lib583.c +++ b/tests/libtest/lib583.c @@ -28,8 +28,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib583(const char *URL) { int stillRunning; diff --git a/tests/libtest/lib586.c b/tests/libtest/lib586.c index dac6751b3587..d0671b18fec3 100644 --- a/tests/libtest/lib586.c +++ b/tests/libtest/lib586.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #define THREADS 2 /* struct containing data of a thread */ diff --git a/tests/libtest/lib589.c b/tests/libtest/lib589.c index 9b912ab037d8..46b2a22a05f2 100644 --- a/tests/libtest/lib589.c +++ b/tests/libtest/lib589.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib589(const char *URL) { CURL *curl; diff --git a/tests/libtest/lib590.c b/tests/libtest/lib590.c index c804f995dee9..bba31e9da4e2 100644 --- a/tests/libtest/lib590.c +++ b/tests/libtest/lib590.c @@ -37,8 +37,6 @@ - Start the request */ -#include "memdebug.h" - static CURLcode test_lib590(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib591.c b/tests/libtest/lib591.c index c30bde5e8be4..521cbb7503ab 100644 --- a/tests/libtest/lib591.c +++ b/tests/libtest/lib591.c @@ -25,8 +25,6 @@ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib591(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib597.c b/tests/libtest/lib597.c index e82d061a222e..38e60c084486 100644 --- a/tests/libtest/lib597.c +++ b/tests/libtest/lib597.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Test case for below scenario: * - Connect to an FTP server using CONNECT_ONLY option diff --git a/tests/libtest/lib598.c b/tests/libtest/lib598.c index 56330c4a2448..b42743845d62 100644 --- a/tests/libtest/lib598.c +++ b/tests/libtest/lib598.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib598(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib599.c b/tests/libtest/lib599.c index 199ef90dbf8c..a216aa13a38e 100644 --- a/tests/libtest/lib599.c +++ b/tests/libtest/lib599.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static int t599_progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { diff --git a/tests/libtest/lib643.c b/tests/libtest/lib643.c index d74d7ea9ee03..52ea1eb664cc 100644 --- a/tests/libtest/lib643.c +++ b/tests/libtest/lib643.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t643_WriteThis { const char *readptr; curl_off_t sizeleft; diff --git a/tests/libtest/lib650.c b/tests/libtest/lib650.c index 069e94f8e5ce..4aa6ea9d8bb4 100644 --- a/tests/libtest/lib650.c +++ b/tests/libtest/lib650.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* This test attempts to use all form API features that are not * used elsewhere. */ diff --git a/tests/libtest/lib651.c b/tests/libtest/lib651.c index 05e9e381da9c..7d1d28563f15 100644 --- a/tests/libtest/lib651.c +++ b/tests/libtest/lib651.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib651(const char *URL) { static char testbuf[17000]; /* more than 16K */ diff --git a/tests/libtest/lib652.c b/tests/libtest/lib652.c index dcbc5a3ab3f8..4fae340042b0 100644 --- a/tests/libtest/lib652.c +++ b/tests/libtest/lib652.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib652(const char *URL) { static char testbuf[17000]; /* more than 16K */ diff --git a/tests/libtest/lib653.c b/tests/libtest/lib653.c index 21948a5720e6..8447706958e0 100644 --- a/tests/libtest/lib653.c +++ b/tests/libtest/lib653.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib653(const char *URL) { CURL *curl = NULL; diff --git a/tests/libtest/lib654.c b/tests/libtest/lib654.c index 5b2236ebb044..1d93798d7c10 100644 --- a/tests/libtest/lib654.c +++ b/tests/libtest/lib654.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t654_WriteThis { const char *readptr; curl_off_t sizeleft; diff --git a/tests/libtest/lib655.c b/tests/libtest/lib655.c index a213a1c493b3..3a8e0df43473 100644 --- a/tests/libtest/lib655.c +++ b/tests/libtest/lib655.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static const char *TEST_DATA_STRING = "Test data"; static int cb_count = 0; diff --git a/tests/libtest/lib658.c b/tests/libtest/lib658.c index 4f0f867d65de..edcb26333822 100644 --- a/tests/libtest/lib658.c +++ b/tests/libtest/lib658.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Get a single URL without select(). */ diff --git a/tests/libtest/lib659.c b/tests/libtest/lib659.c index 84c3ecc8cd46..5071e7fa267d 100644 --- a/tests/libtest/lib659.c +++ b/tests/libtest/lib659.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Get a single URL without select(). */ diff --git a/tests/libtest/lib661.c b/tests/libtest/lib661.c index 10a4ab99cee7..7cf6d091339b 100644 --- a/tests/libtest/lib661.c +++ b/tests/libtest/lib661.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib661(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib666.c b/tests/libtest/lib666.c index cff244dafb1c..f47bacb9a807 100644 --- a/tests/libtest/lib666.c +++ b/tests/libtest/lib666.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib666(const char *URL) { static char testbuf[17000]; /* more than 16K */ diff --git a/tests/libtest/lib667.c b/tests/libtest/lib667.c index 2827d0051194..1bd612f37797 100644 --- a/tests/libtest/lib667.c +++ b/tests/libtest/lib667.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t667_WriteThis { const char *readptr; curl_off_t sizeleft; diff --git a/tests/libtest/lib668.c b/tests/libtest/lib668.c index 488f86215247..5011391736b1 100644 --- a/tests/libtest/lib668.c +++ b/tests/libtest/lib668.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - struct t668_WriteThis { const char *readptr; curl_off_t sizeleft; diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index b30d097f68ff..e97b04319e3c 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - #define PAUSE_TIME 5 struct t670_ReadThis { diff --git a/tests/libtest/lib674.c b/tests/libtest/lib674.c index 668ecdf32d14..c84d1af05db8 100644 --- a/tests/libtest/lib674.c +++ b/tests/libtest/lib674.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Get a single URL without select(). */ diff --git a/tests/libtest/lib676.c b/tests/libtest/lib676.c index 63437523df88..17494b73e7de 100644 --- a/tests/libtest/lib676.c +++ b/tests/libtest/lib676.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib676(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib677.c b/tests/libtest/lib677.c index 526e1706c376..089202b5c591 100644 --- a/tests/libtest/lib677.c +++ b/tests/libtest/lib677.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib677(const char *URL) { static const char testcmd[] = "A1 IDLE\r\n"; diff --git a/tests/libtest/lib678.c b/tests/libtest/lib678.c index 2a2e21321f79..ed8731d20d5b 100644 --- a/tests/libtest/lib678.c +++ b/tests/libtest/lib678.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static int loadfile(const char *filename, void **filedata, size_t *filesize) { size_t datasize = 0; @@ -44,13 +42,13 @@ static int loadfile(const char *filename, void **filedata, size_t *filesize) if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_SET) == 0; if(continue_reading) - data = malloc(datasize + 1); + data = curlx_malloc(datasize + 1); if((!data) || ((int)fread(data, datasize, 1, fInCert) != 1)) continue_reading = FALSE; curlx_fclose(fInCert); if(!continue_reading) { - free(data); + curlx_free(data); datasize = 0; data = NULL; } @@ -86,7 +84,7 @@ static CURLcode test_cert_blob(const char *url, const char *cafile) blob.len = certsize; blob.flags = CURL_BLOB_COPY; curl_easy_setopt(curl, CURLOPT_CAINFO_BLOB, &blob); - free(certdata); + curlx_free(certdata); code = curl_easy_perform(curl); } curl_easy_cleanup(curl); diff --git a/tests/libtest/lib694.c b/tests/libtest/lib694.c index 5b477ecebd44..25db2694c6d7 100644 --- a/tests/libtest/lib694.c +++ b/tests/libtest/lib694.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - static CURLcode test_lib694(const char *URL) { CURLcode res; diff --git a/tests/libtest/lib695.c b/tests/libtest/lib695.c index 325897c357c9..1177a529fd64 100644 --- a/tests/libtest/lib695.c +++ b/tests/libtest/lib695.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* write callback that does nothing */ static size_t write_it(char *ptr, size_t size, size_t nmemb, void *userdata) { diff --git a/tests/libtest/lib751.c b/tests/libtest/lib751.c index 42c1aeb1176e..898ba8d7efcb 100644 --- a/tests/libtest/lib751.c +++ b/tests/libtest/lib751.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* * Get a single URL without select(). */ diff --git a/tests/libtest/lib753.c b/tests/libtest/lib753.c index 19194c4646a5..f01fa3f5c806 100644 --- a/tests/libtest/lib753.c +++ b/tests/libtest/lib753.c @@ -24,7 +24,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" struct t753_transfer_status { CURL *curl; diff --git a/tests/libtest/lib757.c b/tests/libtest/lib757.c index 632818f94605..f3a1e0fdb408 100644 --- a/tests/libtest/lib757.c +++ b/tests/libtest/lib757.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "memdebug.h" - /* write callback that does nothing */ static size_t write_757(char *ptr, size_t size, size_t nmemb, void *userdata) { diff --git a/tests/libtest/lib758.c b/tests/libtest/lib758.c index ab6ce481b779..bc6a490d3d39 100644 --- a/tests/libtest/lib758.c +++ b/tests/libtest/lib758.c @@ -31,7 +31,6 @@ #include "first.h" #include "testtrace.h" -#include "memdebug.h" #ifdef USE_OPENSSL @@ -121,14 +120,15 @@ static int t758_addFd(struct t758_Sockets *sockets, curl_socket_t fd, * Allocate array storage when required. */ if(!sockets->sockets) { - sockets->sockets = malloc(sizeof(curl_socket_t) * 20U); + sockets->sockets = curlx_malloc(sizeof(curl_socket_t) * 20U); if(!sockets->sockets) return 1; sockets->max_count = 20; } else if(sockets->count + 1 > sockets->max_count) { - curl_socket_t *ptr = realloc(sockets->sockets, sizeof(curl_socket_t) * - (sockets->max_count + 20)); + curl_socket_t *ptr = curlx_realloc(sockets->sockets, + sizeof(curl_socket_t) * + (sockets->max_count + 20)); if(!ptr) /* cleanup in test_cleanup */ return 1; @@ -487,8 +487,8 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, curl_global_cleanup(); /* free local memory */ - free(sockets.read.sockets); - free(sockets.write.sockets); + curlx_free(sockets.read.sockets); + curlx_free(sockets.write.sockets); t758_msg("done"); return res; diff --git a/tests/libtest/lib766.c b/tests/libtest/lib766.c index 53f1dd97b551..bba08e263b84 100644 --- a/tests/libtest/lib766.c +++ b/tests/libtest/lib766.c @@ -24,8 +24,6 @@ #include "first.h" -#include "memdebug.h" - static int sockopt_766(void *clientp, curl_socket_t curlfd, curlsocktype purpose) diff --git a/tests/libtest/memptr.c b/tests/libtest/memptr.c index 64e9fd7f8a1a..400e72c41ab9 100644 --- a/tests/libtest/memptr.c +++ b/tests/libtest/memptr.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "first.h" -#include "curl_memory.h" - #ifndef CURL_STATICLIB #if defined(_MSC_VER) && defined(_DLL) diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index 156422eccc42..bfb0e590e78f 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -206,7 +206,6 @@ * ***************************************************************************/ #include "first.h" -#include "memdebug.h" /* This source code is generated by mk-lib1521.pl ! */ diff --git a/tests/libtest/testtrace.c b/tests/libtest/testtrace.c index 7c4517378751..a541d4e55c18 100644 --- a/tests/libtest/testtrace.c +++ b/tests/libtest/testtrace.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "testtrace.h" -#include "memdebug.h" - struct libtest_trace_cfg debug_config; static time_t epoch_offset; /* for test time tracing */ diff --git a/tests/libtest/testutil.c b/tests/libtest/testutil.c index b5cfa70369b7..02c041c4b132 100644 --- a/tests/libtest/testutil.c +++ b/tests/libtest/testutil.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "testutil.h" -#include "memdebug.h" - /* build request URL */ char *tutil_suburl(const char *base, int i) { diff --git a/tests/server/.checksrc b/tests/server/.checksrc index 163a217ee4be..2fb655e159fa 100644 --- a/tests/server/.checksrc +++ b/tests/server/.checksrc @@ -3,13 +3,18 @@ # SPDX-License-Identifier: curl allowfunc accept +allowfunc calloc allowfunc fprintf +allowfunc free allowfunc freeaddrinfo allowfunc getaddrinfo +allowfunc malloc allowfunc printf +allowfunc realloc allowfunc recv allowfunc send allowfunc snprintf allowfunc socket allowfunc sscanf +allowfunc strdup allowfunc vsnprintf diff --git a/tests/test1132.pl b/tests/test1132.pl deleted file mode 100755 index 966bd09a489a..000000000000 --- a/tests/test1132.pl +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env perl -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at https://curl.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# SPDX-License-Identifier: curl -# -########################################################################### -# -# This script scans C source files. If they seem to use memory functions, -# it also makes sure that it #includes the correct two header files! -# -# You can also mark a C source as fine by using 'mem-include-scan' anywhere in -# it. -# - -use strict; -use warnings; - -my $dir = $ARGV[0] || die "specify directory!"; - -sub scanfile { - my ($file) = @_; - my $memfunc; - my $memdebug; - my $curlmem; - - print STDERR "checking $file...\n"; - - open(my $f, "<", "$file"); - while(<$f>) { - if($_ =~ /\W(free|alloc|strdup)\(/) { - $memfunc++; - } - elsif($_ =~ /^ *# *include \"memdebug.h\"/) { - $memdebug++; - } - elsif($_ =~ /^ *# *include \"curl_memory.h\"/) { - $curlmem++; - } - elsif($_ =~ /mem-include-scan/) { - # free pass - close($f); - return 0; - } - if($memfunc && $memdebug && $curlmem) { - last; - } - } - close($f); - - - if($memfunc) { - if($memdebug && $curlmem) { - return 0; - } - else { - if(!$memdebug) { - print STDERR "$file does not include \"memdebug.h\"!\n"; - } - if(!$curlmem) { - print STDERR "$file does not include \"curl_memory.h\"!\n"; - } - return 1; - } - } - return 0; -} - -opendir(my $dh, $dir) || die "cannot opendir $dir: $!"; -my @cfiles = grep { /\.c\z/ && -f "$dir/$_" } readdir($dh); -closedir $dh; - -my $errs; -for(@cfiles) { - $errs += scanfile("$dir/$_"); -} - -if($errs) { - print STDERR "----\n$errs errors detected!\n"; - exit 2; -} diff --git a/tests/tunit/tool1394.c b/tests/tunit/tool1394.c index 71be2c87c478..9d97dbb0de8f 100644 --- a/tests/tunit/tool1394.c +++ b/tests/tunit/tool1394.c @@ -25,8 +25,6 @@ #include "tool_getparam.h" -#include "memdebug.h" /* LAST include file */ - static CURLcode test_tool1394(const char *arg) { UNITTEST_BEGIN_SIMPLE @@ -120,9 +118,9 @@ static CURLcode test_tool1394(const char *arg) } } if(certname) - free(certname); + curlx_free(certname); if(passphrase) - free(passphrase); + curlx_free(passphrase); } UNITTEST_END_SIMPLE diff --git a/tests/tunit/tool1604.c b/tests/tunit/tool1604.c index 3b6f006e7cfd..dcfee4cbac62 100644 --- a/tests/tunit/tool1604.c +++ b/tests/tunit/tool1604.c @@ -26,12 +26,10 @@ #include "tool_cfgable.h" #include "tool_doswin.h" -#include "memdebug.h" /* LAST include file */ - #if defined(_WIN32) || defined(MSDOS) static char *getflagstr(int flags) { - char *buf = malloc(256); + char *buf = curlx_malloc(256); if(buf) { curl_msnprintf(buf, 256, "%s,%s", ((flags & SANITIZE_ALLOW_PATH) ? @@ -44,7 +42,7 @@ static char *getflagstr(int flags) static char *getcurlcodestr(int cc) { - char *buf = malloc(256); + char *buf = curlx_malloc(256); if(buf) { curl_msnprintf(buf, 256, "%s (%d)", (cc == SANITIZE_ERR_OK ? "SANITIZE_ERR_OK" : @@ -212,7 +210,7 @@ static CURLcode test_tool1604(const char *arg) ((!output && !data[i].expected_output) || (output && data[i].expected_output && !strcmp(output, data[i].expected_output)))) { /* OK */ - free(output); + curlx_free(output); continue; } @@ -240,10 +238,10 @@ static CURLcode test_tool1604(const char *arg) data[i].expected_output ? data[i].expected_output : "(null)", expected_ccstr); - free(output); - free(flagstr); - free(received_ccstr); - free(expected_ccstr); + curlx_free(output); + curlx_free(flagstr); + curlx_free(received_ccstr); + curlx_free(expected_ccstr); } /* END sanitize_file_name */ #else diff --git a/tests/tunit/tool1621.c b/tests/tunit/tool1621.c index bb709cf39d21..ba9e28029446 100644 --- a/tests/tunit/tool1621.c +++ b/tests/tunit/tool1621.c @@ -25,8 +25,6 @@ #include "tool_xattr.h" -#include "memdebug.h" /* LAST include file */ - static CURLcode test_tool1621(const char *arg) { UNITTEST_BEGIN_SIMPLE diff --git a/tests/unit/unit1302.c b/tests/unit/unit1302.c index 911432a8c833..d56f7b09f779 100644 --- a/tests/unit/unit1302.c +++ b/tests/unit/unit1302.c @@ -25,7 +25,6 @@ #include "urldata.h" #include "url.h" /* for Curl_safefree */ -#include "memdebug.h" /* LAST include file */ struct etest { const char *input; diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c index 03673c544e29..9bed1ebff6f4 100644 --- a/tests/unit/unit1303.c +++ b/tests/unit/unit1303.c @@ -25,7 +25,6 @@ #include "urldata.h" #include "connect.h" -#include "memdebug.h" /* LAST include file */ static CURLcode t1303_setup(struct Curl_easy **easy) { diff --git a/tests/unit/unit1304.c b/tests/unit/unit1304.c index 041ce42691dd..100f3f58287e 100644 --- a/tests/unit/unit1304.c +++ b/tests/unit/unit1304.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "unitcheck.h" #include "netrc.h" -#include "memdebug.h" /* LAST include file */ #ifndef CURL_DISABLE_NETRC @@ -120,8 +119,8 @@ static CURLcode test_unit1304(const char *arg) * Test for the first existing host in our netrc file * with login[0] != 0. */ - free(password); - free(login); + curlx_free(password); + curlx_free(login); password = NULL; login = NULL; Curl_netrc_init(&store); @@ -139,9 +138,9 @@ static CURLcode test_unit1304(const char *arg) * Test for the second existing host in our netrc file * with login[0] = 0. */ - free(password); + curlx_free(password); password = NULL; - free(login); + curlx_free(login); login = NULL; Curl_netrc_init(&store); result = Curl_parsenetrc(&store, @@ -158,9 +157,9 @@ static CURLcode test_unit1304(const char *arg) * Test for the second existing host in our netrc file * with login[0] != 0. */ - free(password); + curlx_free(password); password = NULL; - free(login); + curlx_free(login); login = NULL; Curl_netrc_init(&store); result = Curl_parsenetrc(&store, diff --git a/tests/unit/unit1305.c b/tests/unit/unit1305.c index e95e2994535d..404d90bec9a9 100644 --- a/tests/unit/unit1305.c +++ b/tests/unit/unit1305.c @@ -36,8 +36,6 @@ #include "hash.h" #include "hostip.h" -#include "memdebug.h" /* LAST include file */ - static struct Curl_dnscache hp; static char *data_key; static struct Curl_dns_entry *data_node; @@ -52,9 +50,9 @@ static void t1305_stop(void) { if(data_node) { Curl_freeaddrinfo(data_node->addr); - free(data_node); + curlx_free(data_node); } - free(data_key); + curlx_free(data_key); Curl_dnscache_destroy(&hp); } @@ -64,8 +62,9 @@ static struct Curl_addrinfo *fake_ai(void) static const char dummy[] = "dummy"; size_t namelen = sizeof(dummy); /* including the null-terminator */ - ai = calloc(1, sizeof(struct Curl_addrinfo) + sizeof(struct sockaddr_in) + - namelen); + ai = curlx_calloc(1, + sizeof(struct Curl_addrinfo) + sizeof(struct sockaddr_in) + + namelen); if(!ai) return NULL; @@ -86,7 +85,7 @@ static CURLcode create_node(void) if(!data_key) return CURLE_OUT_OF_MEMORY; - data_node = calloc(1, sizeof(struct Curl_dns_entry)); + data_node = curlx_calloc(1, sizeof(struct Curl_dns_entry)); if(!data_node) return CURLE_OUT_OF_MEMORY; diff --git a/tests/unit/unit1330.c b/tests/unit/unit1330.c index bd7fc6e2592b..a98393b5325c 100644 --- a/tests/unit/unit1330.c +++ b/tests/unit/unit1330.c @@ -23,13 +23,11 @@ ***************************************************************************/ #include "unitcheck.h" -#include "memdebug.h" - static CURLcode test_unit1330(const char *arg) { UNITTEST_BEGIN_SIMPLE - char *ptr = malloc(1330); + char *ptr = curlx_malloc(1330); Curl_safefree(ptr); UNITTEST_END_SIMPLE diff --git a/tests/unit/unit1395.c b/tests/unit/unit1395.c index e6ac18f08107..395f3e7707d7 100644 --- a/tests/unit/unit1395.c +++ b/tests/unit/unit1395.c @@ -22,7 +22,6 @@ * ***************************************************************************/ #include "unitcheck.h" -#include "memdebug.h" #include "unitprotos.h" static CURLcode test_unit1395(const char *arg) @@ -133,7 +132,7 @@ static CURLcode test_unit1395(const char *arg) } else curl_mfprintf(stderr, "Test %u: OK\n", i); - free(out); + curlx_free(out); } fail_if(fails, "output mismatched"); diff --git a/tests/unit/unit1602.c b/tests/unit/unit1602.c index e397bdb5ca5f..5841717691e0 100644 --- a/tests/unit/unit1602.c +++ b/tests/unit/unit1602.c @@ -25,12 +25,10 @@ #include "hash.h" -#include "memdebug.h" /* LAST include file */ - static void t1602_mydtor(void *p) { int *ptr = (int *)p; - free(ptr); + curlx_free(ptr); } static CURLcode t1602_setup(struct Curl_hash *hash) @@ -59,22 +57,22 @@ static CURLcode test_unit1602(const char *arg) int key = 20; int key2 = 25; - value = malloc(sizeof(int)); + value = curlx_malloc(sizeof(int)); abort_unless(value != NULL, "Out of memory"); *value = 199; nodep = Curl_hash_add(&hash, &key, klen, value); if(!nodep) - free(value); + curlx_free(value); abort_unless(nodep, "insertion into hash failed"); Curl_hash_clean(&hash); /* Attempt to add another key/value pair */ - value2 = malloc(sizeof(int)); + value2 = curlx_malloc(sizeof(int)); abort_unless(value2 != NULL, "Out of memory"); *value2 = 204; nodep = Curl_hash_add(&hash, &key2, klen, value2); if(!nodep) - free(value2); + curlx_free(value2); abort_unless(nodep, "insertion into hash failed"); UNITTEST_END(t1602_stop(&hash)) diff --git a/tests/unit/unit1603.c b/tests/unit/unit1603.c index b4ec152936ee..81db398cb19e 100644 --- a/tests/unit/unit1603.c +++ b/tests/unit/unit1603.c @@ -25,8 +25,6 @@ #include "hash.h" -#include "memdebug.h" /* LAST include file */ - static const size_t slots = 3; static void t1603_mydtor(void *p) diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index f60b5b58a1e4..233866da18b6 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -27,8 +27,6 @@ #include "connect.h" #include "curl_share.h" -#include "memdebug.h" /* LAST include file */ - static CURLcode t1607_setup(void) { CURLcode res = CURLE_OK; @@ -135,7 +133,7 @@ static CURLcode test_unit1607(const char *arg) goto error; dns = Curl_hash_pick(&multi->dnscache.entries, entry_id, strlen(entry_id) + 1); - free(entry_id); + curlx_free(entry_id); entry_id = NULL; addr = dns ? dns->addr : NULL; diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index 2a3098c6ef2e..bf912b99cd1a 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -27,8 +27,6 @@ #include "connect.h" #include "curl_share.h" -#include "memdebug.h" /* LAST include file */ - static CURLcode t1609_setup(void) { CURLcode res = CURLE_OK; @@ -137,7 +135,7 @@ static CURLcode test_unit1609(const char *arg) dns = Curl_hash_pick(&multi->dnscache.entries, entry_id, strlen(entry_id) + 1); - free(entry_id); + curlx_free(entry_id); entry_id = NULL; addr = dns ? dns->addr : NULL; diff --git a/tests/unit/unit1616.c b/tests/unit/unit1616.c index 5d1e6f247e76..d898444613ce 100644 --- a/tests/unit/unit1616.c +++ b/tests/unit/unit1616.c @@ -25,13 +25,11 @@ #include "uint-hash.h" -#include "memdebug.h" /* LAST include file */ - static void t1616_mydtor(unsigned int id, void *elem) { int *ptr = (int *)elem; (void)id; - free(ptr); + curlx_free(ptr); } static CURLcode t1616_setup(struct uint_hash *hash) @@ -58,12 +56,12 @@ static CURLcode test_unit1616(const char *arg) unsigned int key = 20; unsigned int key2 = 25; - value = malloc(sizeof(int)); + value = curlx_malloc(sizeof(int)); abort_unless(value != NULL, "Out of memory"); *value = 199; ok = Curl_uint32_hash_set(&hash, key, value); if(!ok) - free(value); + curlx_free(value); abort_unless(ok, "insertion into hash failed"); v = Curl_uint32_hash_get(&hash, key); abort_unless(v == value, "lookup present entry failed"); @@ -72,12 +70,12 @@ static CURLcode test_unit1616(const char *arg) Curl_uint32_hash_clear(&hash); /* Attempt to add another key/value pair */ - value2 = malloc(sizeof(int)); + value2 = curlx_malloc(sizeof(int)); abort_unless(value2 != NULL, "Out of memory"); *value2 = 204; ok = Curl_uint32_hash_set(&hash, key2, value2); if(!ok) - free(value2); + curlx_free(value2); abort_unless(ok, "insertion into hash failed"); v = Curl_uint32_hash_get(&hash, key2); abort_unless(v == value2, "lookup present entry failed"); diff --git a/tests/unit/unit1620.c b/tests/unit/unit1620.c index 4851602eaa71..4c1674f5bd54 100644 --- a/tests/unit/unit1620.c +++ b/tests/unit/unit1620.c @@ -26,8 +26,6 @@ #include "urldata.h" #include "url.h" -#include "memdebug.h" /* LAST include file */ - static CURLcode t1620_setup(void) { CURLcode res = CURLE_OK; @@ -64,9 +62,9 @@ static void t1620_parse( "options should be equal to exp_options"); } - free(userstr); - free(passwdstr); - free(options); + curlx_free(userstr); + curlx_free(passwdstr); + curlx_free(options); } static CURLcode test_unit1620(const char *arg) diff --git a/tests/unit/unit1653.c b/tests/unit/unit1653.c index 8f6a5a51cc55..7ea7e380a80b 100644 --- a/tests/unit/unit1653.c +++ b/tests/unit/unit1653.c @@ -53,7 +53,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15]"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15]"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -67,7 +67,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15|"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15|"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -78,7 +78,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff;fea7:da15]:808"); + ipv6port = curlx_strdup("[fe80::250:56ff;fea7:da15]:808"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -95,7 +95,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15%25eth3]:80"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15%25eth3]:80"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -111,7 +111,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15%25eth3]"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15%25eth3]"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -123,7 +123,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15]:81"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15]:81"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -139,7 +139,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15];81"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15];81"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -150,7 +150,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15]80"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15]80"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -163,7 +163,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15]:"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15]:"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, TRUE); @@ -175,7 +175,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15!25eth3]:180"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15!25eth3]:180"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -191,7 +191,7 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("[fe80::250:56ff:fea7:da15%eth3]:80"); + ipv6port = curlx_strdup("[fe80::250:56ff:fea7:da15%eth3]:80"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); @@ -204,14 +204,14 @@ static CURLcode test_unit1653(const char *arg) u = curl_url(); if(!u) goto fail; - ipv6port = strdup("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaa:"); + ipv6port = curlx_strdup("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaa:"); if(!ipv6port) goto fail; ret = parse_port(u, ipv6port, FALSE); fail_unless(ret == CURLUE_BAD_PORT_NUMBER, "parse_port did wrong"); fail: - free(ipv6port); + curlx_free(ipv6port); curl_url_cleanup(u); UNITTEST_END_SIMPLE diff --git a/tests/unit/unit1661.c b/tests/unit/unit1661.c index 6cc448554401..d9aa2a61f14e 100644 --- a/tests/unit/unit1661.c +++ b/tests/unit/unit1661.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "unitcheck.h" #include "bufref.h" -#include "memdebug.h" static int freecount = 0; @@ -31,7 +30,7 @@ static void test_free(void *p) { fail_unless(p, "pointer to free may not be NULL"); freecount++; - free(p); + curlx_free(p); } static CURLcode t1661_setup(struct bufref *bufref) @@ -68,7 +67,7 @@ static CURLcode test_unit1661(const char *arg) /** * testing Curl_bufref_set */ - buffer = malloc(13); + buffer = curlx_malloc(13); abort_unless(buffer, "Out of memory"); Curl_bufref_set(&bufref, buffer, 13, test_free); diff --git a/tests/unit/unit1663.c b/tests/unit/unit1663.c index 0d6fb4bbbe50..e4431930a410 100644 --- a/tests/unit/unit1663.c +++ b/tests/unit/unit1663.c @@ -32,8 +32,6 @@ #include "cf-socket.h" -#include "memdebug.h" /* LAST include file */ - static CURLcode t1663_setup(void) { CURLcode res = CURLE_OK; @@ -67,9 +65,9 @@ static void t1663_parse( "host should be equal to exp_host"); } - free(dev); - free(iface); - free(host); + curlx_free(dev); + curlx_free(iface); + curlx_free(host); } static CURLcode test_unit1663(const char *arg) diff --git a/tests/unit/unit1664.c b/tests/unit/unit1664.c index 6903c70e9298..a24a859e5272 100644 --- a/tests/unit/unit1664.c +++ b/tests/unit/unit1664.c @@ -30,8 +30,6 @@ #include #endif -#include "memdebug.h" /* LAST include file */ - static CURLcode t1664_setup(void) { CURLcode res = CURLE_OK; diff --git a/tests/unit/unit2600.c b/tests/unit/unit2600.c index f2adc50eddd4..b69b675b3b1a 100644 --- a/tests/unit/unit2600.c +++ b/tests/unit/unit2600.c @@ -47,7 +47,6 @@ #include "multiif.h" #include "select.h" #include "curl_trc.h" -#include "memdebug.h" static CURLcode t2600_setup(CURL **easy) { @@ -126,7 +125,7 @@ static void cf_test_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) #else (void)data; #endif - free(ctx); + curlx_free(ctx); cf->ctx = NULL; } @@ -193,7 +192,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, (void)data; (void)conn; - ctx = calloc(1, sizeof(*ctx)); + ctx = curlx_calloc(1, sizeof(*ctx)); if(!ctx) { res = CURLE_OUT_OF_MEMORY; goto out; @@ -233,8 +232,8 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, out: *pcf = (!res) ? cf : NULL; if(res) { - free(cf); - free(ctx); + curlx_free(cf); + curlx_free(ctx); } return res; } diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index 695b1210071e..fb05189714c3 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "unitcheck.h" #include "vssh/vssh.h" -#include "memdebug.h" static CURLcode test_unit2604(const char *arg) { @@ -79,7 +78,7 @@ static CURLcode test_unit2604(const char *arg) #pragma GCC diagnostic pop #endif - char *cp0 = calloc(1, too_long + 1); + char *cp0 = curlx_calloc(1, too_long + 1); fail_unless(cp0, "could not alloc too long value"); memset(cp0, 'a', too_long); @@ -108,7 +107,7 @@ static CURLcode test_unit2604(const char *arg) } } - free(cp0); + curlx_free(cp0); #endif diff --git a/tests/unit/unit2605.c b/tests/unit/unit2605.c index 71c37f32cfcb..49d0b0b000e9 100644 --- a/tests/unit/unit2605.c +++ b/tests/unit/unit2605.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "unitcheck.h" #include "vssh/vssh.h" -#include "memdebug.h" static CURLcode test_unit2605(const char *arg) { diff --git a/tests/unit/unit3200.c b/tests/unit/unit3200.c index 0b3c87691157..fe00da939d57 100644 --- a/tests/unit/unit3200.c +++ b/tests/unit/unit3200.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "unitcheck.h" #include "curl_get_line.h" -#include "memdebug.h" static CURLcode test_unit3200(const char *arg) { From c10dda9ebb6ccaaff7b71000c7c54b86dbd80cc7 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Fri, 28 Nov 2025 15:48:03 +0200 Subject: [PATCH 575/885] curlx/fopen: fix typo in copyright Follow-up to 193cb00ce9b47e75d42157c650cc3de3fd96d35d #19626 Closes #19747 --- lib/curlx/fopen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index c8dff428fc94..caf4978af163 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) Danieal Stenberg, , et al. + * Copyright (C) Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms From aad3c2e8e14317c99838e3766df6cd2ce8f3f279 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Nov 2025 14:19:18 +0100 Subject: [PATCH 576/885] example: fix formatting nits Also: - drop non-portable `__STRING()` macro use where still used. Closes #19746 --- docs/examples/10-at-a-time.c | 2 +- docs/examples/anyauthput.c | 8 +-- docs/examples/block_ip.c | 6 +- docs/examples/certinfo.c | 4 +- docs/examples/cookie_interface.c | 3 +- docs/examples/crawler.c | 15 +++-- docs/examples/ephiperfifo.c | 65 +++++++++++---------- docs/examples/evhiperfifo.c | 35 ++++++------ docs/examples/externalsocket.c | 5 +- docs/examples/ftp-wildcard.c | 5 +- docs/examples/ftpget.c | 1 - docs/examples/ftpgetresp.c | 2 +- docs/examples/ftpuploadfrommem.c | 4 +- docs/examples/getinmemory.c | 7 +-- docs/examples/getredirect.c | 3 +- docs/examples/ghiper.c | 31 +++++----- docs/examples/headerapi.c | 1 - docs/examples/hiperfifo.c | 75 ++++++++++++++----------- docs/examples/hsts-preload.c | 3 +- docs/examples/htmltidy.c | 4 +- docs/examples/htmltitle.cpp | 7 +-- docs/examples/http2-pushinmemory.c | 1 - docs/examples/httpput-postfields.c | 2 +- docs/examples/httpput.c | 2 +- docs/examples/imap-append.c | 4 +- docs/examples/imap-ssl.c | 2 +- docs/examples/log_failed_transfers.c | 2 +- docs/examples/multi-app.c | 2 +- docs/examples/multi-event.c | 18 +++--- docs/examples/multi-legacy.c | 6 +- docs/examples/multi-uv.c | 18 +++--- docs/examples/multithread.c | 2 - docs/examples/netrc.c | 3 +- docs/examples/post-callback.c | 2 +- docs/examples/postinmemory.c | 5 +- docs/examples/sftpget.c | 4 +- docs/examples/sftpuploadresume.c | 1 - docs/examples/shared-connection-cache.c | 4 +- docs/examples/simplessl.c | 8 +-- docs/examples/smooth-gtk-thread.c | 9 ++- docs/examples/smtp-authzid.c | 4 +- docs/examples/smtp-mail.c | 4 +- docs/examples/smtp-multi.c | 4 +- docs/examples/smtp-ssl.c | 4 +- docs/examples/smtp-tls.c | 4 +- docs/examples/sslbackend.c | 2 +- docs/examples/synctime.c | 33 ++++++----- docs/examples/threaded-ssl.c | 2 +- docs/examples/usercertinmem.c | 4 +- docs/examples/xmlstream.c | 10 ++-- 50 files changed, 225 insertions(+), 227 deletions(-) diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index bddcd1563740..22db7c5fc461 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -81,7 +81,7 @@ static const char *urls[] = { }; #define MAX_PARALLEL 10 /* number of simultaneous transfers */ -#define NUM_URLS sizeof(urls)/sizeof(char *) +#define NUM_URLS (sizeof(urls) / sizeof(char *)) static size_t write_cb(char *data, size_t n, size_t l, void *userp) { diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index eb5959ca2263..247d4d0d3b3a 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -65,9 +65,9 @@ /* seek callback function */ static int my_seek(void *userp, curl_off_t offset, int origin) { - FILE *fp = (FILE *) userp; + FILE *fp = (FILE *)userp; - if(fseek(fp, (long) offset, origin) == -1) + if(fseek(fp, (long)offset, origin) == -1) /* could not seek */ return CURL_SEEKFUNC_CANTSEEK; @@ -128,13 +128,13 @@ int main(int argc, char **argv) curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); /* which file to upload */ - curl_easy_setopt(curl, CURLOPT_READDATA, (void *) fp); + curl_easy_setopt(curl, CURLOPT_READDATA, (void *)fp); /* set the seek function */ curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, my_seek); /* pass the file descriptor to the seek callback as well */ - curl_easy_setopt(curl, CURLOPT_SEEKDATA, (void *) fp); + curl_easy_setopt(curl, CURLOPT_SEEKDATA, (void *)fp); /* enable "uploading" (which means PUT when doing HTTP) */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index ef7056dc4340..bf2193a26359 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -31,7 +31,11 @@ #ifdef __AMIGA__ #include -int main(void) { printf("Platform not supported.\n"); return 1; } +int main(void) +{ + printf("Platform not supported.\n"); + return 1; +} #else #ifdef _MSC_VER diff --git a/docs/examples/certinfo.c b/docs/examples/certinfo.c index 3176d0a1fcfc..e799cfc92879 100644 --- a/docs/examples/certinfo.c +++ b/docs/examples/certinfo.c @@ -29,7 +29,7 @@ #include -static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { (void)stream; (void)ptr; @@ -74,10 +74,8 @@ int main(void) for(slist = certinfo->certinfo[i]; slist; slist = slist->next) printf("%s\n", slist->data); - } } - } curl_easy_cleanup(curl); diff --git a/docs/examples/cookie_interface.c b/docs/examples/cookie_interface.c index a031380f1207..0398cdf164ff 100644 --- a/docs/examples/cookie_interface.c +++ b/docs/examples/cookie_interface.c @@ -71,8 +71,7 @@ static int print_cookies(CURL *curl) return 0; } -int -main(void) +int main(void) { CURL *curl; CURLcode res; diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index 419ceab26d06..9207199cdfc9 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -65,7 +65,7 @@ struct memory { static size_t write_cb(void *contents, size_t sz, size_t nmemb, void *ctx) { size_t realsize = sz * nmemb; - struct memory *mem = (struct memory*) ctx; + struct memory *mem = (struct memory *)ctx; char *ptr = realloc(mem->buf, mem->size + realsize); if(!ptr) { /* out of memory */ @@ -109,7 +109,7 @@ static CURL *make_handle(const char *url) curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, 2000L); /* skip files larger than a gigabyte */ curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, - (curl_off_t)1024*1024*1024); + (curl_off_t)1024 * 1024 * 1024); curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); curl_easy_setopt(curl, CURLOPT_USERAGENT, "mini crawler"); @@ -121,8 +121,7 @@ static CURL *make_handle(const char *url) } /* HREF finder implemented in libxml2 but could be any HTML parser */ -static size_t follow_links(CURLM *multi, struct memory *mem, - const char *url) +static size_t follow_links(CURLM *multi, struct memory *mem, const char *url) { int opts = HTML_PARSE_NOBLANKS | HTML_PARSE_NOERROR | \ HTML_PARSE_NOWARNING | HTML_PARSE_NONET; @@ -135,7 +134,7 @@ static size_t follow_links(CURLM *multi, struct memory *mem, xmlXPathObjectPtr result; if(!doc) return 0; - xpath = (xmlChar*) "//a/@href"; + xpath = (xmlChar *)"//a/@href"; context = xmlXPathNewContext(doc); result = xmlXPathEvalExpression(xpath, context); xmlXPathFreeContext(context); @@ -155,10 +154,10 @@ static size_t follow_links(CURLM *multi, struct memory *mem, char *link; if(follow_relative_links) { xmlChar *orig = href; - href = xmlBuildURI(href, (xmlChar *) url); + href = xmlBuildURI(href, (xmlChar *)url); xmlFree(orig); } - link = (char *) href; + link = (char *)href; if(!link || strlen(link) < 20) continue; if(!strncmp(link, "http://", 7) || !strncmp(link, "https://", 8)) { @@ -240,7 +239,7 @@ int main(void) } } else { - printf("[%d] HTTP %d: %s\n", complete, (int) res_status, url); + printf("[%d] HTTP %d: %s\n", complete, (int)res_status, url); } } else { diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index b47cbbedbfb1..e572fffad887 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -58,7 +58,6 @@ This is purely a demo app, all retrieved data is simply discarded by the write callback. */ - #include #include #include @@ -77,7 +76,6 @@ callback. #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ - /* Global information, common to all connections */ struct GlobalInfo { int epfd; /* epoll filedescriptor */ @@ -105,23 +103,35 @@ struct SockInfo { struct GlobalInfo *global; }; -#define mycase(code) \ - case code: s = __STRING(code) - /* Die if we get a bad CURLMcode somewhere */ static void mcode_or_die(const char *where, CURLMcode code) { if(CURLM_OK != code) { const char *s; switch(code) { - mycase(CURLM_BAD_HANDLE); break; - mycase(CURLM_BAD_EASY_HANDLE); break; - mycase(CURLM_OUT_OF_MEMORY); break; - mycase(CURLM_INTERNAL_ERROR); break; - mycase(CURLM_UNKNOWN_OPTION); break; - mycase(CURLM_LAST); break; - default: s = "CURLM_unknown"; break; - mycase(CURLM_BAD_SOCKET); + case CURLM_BAD_HANDLE: + s = "CURLM_BAD_HANDLE"; + break; + case CURLM_BAD_EASY_HANDLE: + s = "CURLM_BAD_EASY_HANDLE"; + break; + case CURLM_OUT_OF_MEMORY: + s = "CURLM_OUT_OF_MEMORY"; + break; + case CURLM_INTERNAL_ERROR: + s = "CURLM_INTERNAL_ERROR"; + break; + case CURLM_UNKNOWN_OPTION: + s = "CURLM_UNKNOWN_OPTION"; + break; + case CURLM_LAST: + s = "CURLM_LAST"; + break; + default: + s = "CURLM_unknown"; + break; + case CURLM_BAD_SOCKET: + s = "CURLM_BAD_SOCKET"; fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); /* ignore this error */ return; @@ -161,7 +171,7 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g) memset(&its, 0, sizeof(its)); } - timerfd_settime(g->tfd, /* flags= */0, &its, NULL); + timerfd_settime(g->tfd, /* flags= */ 0, &its, NULL); return 0; } @@ -281,7 +291,7 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act, static void addsock(curl_socket_t s, CURL *curl, int action, struct GlobalInfo *g) { - struct SockInfo *fdp = (struct SockInfo*)calloc(1, sizeof(struct SockInfo)); + struct SockInfo *fdp = (struct SockInfo *)calloc(1, sizeof(struct SockInfo)); fdp->global = g; setsock(fdp, s, curl, action, g); @@ -291,12 +301,11 @@ static void addsock(curl_socket_t s, CURL *curl, int action, /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { - struct GlobalInfo *g = (struct GlobalInfo*) cbp; - struct SockInfo *fdp = (struct SockInfo*) sockp; - const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; + struct GlobalInfo *g = (struct GlobalInfo *)cbp; + struct SockInfo *fdp = (struct SockInfo *)sockp; + const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; - fprintf(MSG_OUT, - "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); + fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { fprintf(MSG_OUT, "\n"); remsock(fdp, g); @@ -307,8 +316,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) addsock(s, e, what, g); } else { - fprintf(MSG_OUT, - "Changing action from %s to %s\n", + fprintf(MSG_OUT, "Changing action from %s to %s\n", whatstr[fdp->action], whatstr[what]); setsock(fdp, s, e, what, g); } @@ -342,7 +350,7 @@ static void new_conn(const char *url, struct GlobalInfo *g) struct ConnInfo *conn; CURLMcode rc; - conn = (struct ConnInfo*)calloc(1, sizeof(*conn)); + conn = (struct ConnInfo *)calloc(1, sizeof(*conn)); conn->error[0] = '\0'; conn->curl = curl_easy_init(); @@ -364,8 +372,8 @@ static void new_conn(const char *url, struct GlobalInfo *g) curl_easy_setopt(conn->curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_TIME, 3L); curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_LIMIT, 10L); - fprintf(MSG_OUT, - "Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + fprintf(MSG_OUT, "Adding easy %p to multi %p (%s)\n", + conn->curl, g->multi, url); rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); @@ -381,9 +389,9 @@ static void fifo_cb(struct GlobalInfo *g, int revents) int n = 0; do { - s[0]='\0'; + s[0] = '\0'; rv = fscanf(g->input, "%1023s%n", s, &n); - s[n]='\0'; + s[n] = '\0'; if(n && s[0]) { new_conn(s, g); /* if we read a URL, go get it! */ } @@ -437,7 +445,6 @@ static void clean_fifo(struct GlobalInfo *g) unlink(fifo); } - int g_should_exit_ = 0; void sigint_handler(int signo) @@ -506,7 +513,7 @@ int main(int argc, char **argv) while(!g_should_exit_) { int idx; int err = epoll_wait(g.epfd, events, - sizeof(events)/sizeof(struct epoll_event), 10000); + sizeof(events) / sizeof(struct epoll_event), 10000); if(err == -1) { /* !checksrc! disable ERRNOVAR 1 */ if(errno == EINTR) { diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index b6b957d54eb6..178be018a3a6 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -61,7 +61,6 @@ This is purely a demo app, all retrieved data is simply discarded by the write callback. */ - #include #include #include @@ -79,7 +78,6 @@ callback. #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ - /* Global information, common to all connections */ struct GlobalInfo { struct ev_loop *loop; @@ -119,7 +117,7 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g) ev_timer_stop(g->loop, &g->timer_event); if(timeout_ms >= 0) { /* -1 means delete, other values are timeout times in milliseconds */ - double t = timeout_ms / 1000; + double t = timeout_ms / 1000; ev_timer_init(&g->timer_event, timer_cb, t, 0.); ev_timer_start(g->loop, &g->timer_event); } @@ -196,7 +194,7 @@ static void event_cb(EV_P_ struct ev_io *w, int revents) int action; printf("%s w %p revents %i\n", __PRETTY_FUNCTION__, (void *)w, revents); - g = (struct GlobalInfo*) w->data; + g = (struct GlobalInfo *)w->data; action = ((revents & EV_READ) ? CURL_POLL_IN : 0) | ((revents & EV_WRITE) ? CURL_POLL_OUT : 0); @@ -270,15 +268,14 @@ static void addsock(curl_socket_t s, CURL *curl, int action, /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { - struct GlobalInfo *g = (struct GlobalInfo*) cbp; - struct SockInfo *fdp = (struct SockInfo*) sockp; - const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"}; + struct GlobalInfo *g = (struct GlobalInfo *)cbp; + struct SockInfo *fdp = (struct SockInfo *)sockp; + const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; printf("%s e %p s %i what %i cbp %p sockp %p\n", __PRETTY_FUNCTION__, e, s, what, cbp, sockp); - fprintf(MSG_OUT, - "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); + fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { fprintf(MSG_OUT, "\n"); remsock(fdp, g); @@ -289,8 +286,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) addsock(s, e, what, g); } else { - fprintf(MSG_OUT, - "Changing action from %s to %s\n", + fprintf(MSG_OUT, "Changing action from %s to %s\n", whatstr[fdp->action], whatstr[what]); setsock(fdp, s, e, what, g); } @@ -302,7 +298,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; - struct ConnInfo *conn = (struct ConnInfo*) data; + struct ConnInfo *conn = (struct ConnInfo *)data; (void)ptr; (void)conn; return realsize; @@ -316,8 +312,9 @@ static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow, (void)ult; (void)uln; - fprintf(MSG_OUT, "Progress: %s (%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T ")\n", conn->url, dlnow, dltotal); + fprintf(MSG_OUT, "Progress: %s (%" CURL_FORMAT_CURL_OFF_T "/" + "%" CURL_FORMAT_CURL_OFF_T ")\n", + conn->url, dlnow, dltotal); return 0; } @@ -328,7 +325,7 @@ static void new_conn(const char *url, struct GlobalInfo *g) CURLMcode rc; conn = calloc(1, sizeof(*conn)); - conn->error[0]='\0'; + conn->error[0] = '\0'; conn->curl = curl_easy_init(); if(!conn->curl) { @@ -349,8 +346,8 @@ static void new_conn(const char *url, struct GlobalInfo *g) curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_TIME, 3L); curl_easy_setopt(conn->curl, CURLOPT_LOW_SPEED_LIMIT, 10L); - fprintf(MSG_OUT, - "Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + fprintf(MSG_OUT, "Adding easy %p to multi %p (%s)\n", + conn->curl, g->multi, url); rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); @@ -369,9 +366,9 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents) (void)revents; do { - s[0]='\0'; + s[0] = '\0'; rv = fscanf(g->input, "%1023s%n", s, &n); - s[n]='\0'; + s[n] = '\0'; if(n && s[0]) { new_conn(s, g); /* if we read a URL, go get it! */ } diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 610a835272a6..632d5f298168 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -124,7 +124,7 @@ int main(void) memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; - servaddr.sin_port = htons(PORTNUM); + servaddr.sin_port = htons(PORTNUM); servaddr.sin_addr.s_addr = inet_addr(IPADDR); if(INADDR_NONE == servaddr.sin_addr.s_addr) { @@ -132,8 +132,7 @@ int main(void) return 2; } - if(connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) == - -1) { + if(connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == -1) { close(sockfd); printf("client error: connect: %s\n", strerror(errno)); return 1; diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c index 3bd2f690832b..fa66628f1655 100644 --- a/docs/examples/ftp-wildcard.c +++ b/docs/examples/ftp-wildcard.c @@ -85,8 +85,7 @@ static long file_is_downloaded(void *input) return CURL_CHUNK_END_FUNC_OK; } -static size_t write_cb(char *buff, size_t size, size_t nmemb, - void *cb_data) +static size_t write_cb(char *buff, size_t size, size_t nmemb, void *cb_data) { struct callback_data *data = cb_data; size_t written = 0; @@ -104,7 +103,7 @@ int main(int argc, char **argv) CURL *curl; /* help data */ - struct callback_data data = { 0 }; + struct callback_data data = {0}; /* global initialization */ CURLcode res = curl_global_init(CURL_GLOBAL_ALL); diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c index f57974de1fb1..400102207474 100644 --- a/docs/examples/ftpget.c +++ b/docs/examples/ftpget.c @@ -52,7 +52,6 @@ static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) return fwrite(buffer, size, nmemb, out->stream); } - int main(void) { CURL *curl; diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c index eec727bf943b..53ada7ccaee6 100644 --- a/docs/examples/ftpgetresp.c +++ b/docs/examples/ftpgetresp.c @@ -90,7 +90,7 @@ int main(void) curl_easy_cleanup(curl); } - fclose(ftpfile); /* close the local file */ + fclose(ftpfile); /* close the local file */ fclose(respfile); /* close the response file */ curl_global_cleanup(); diff --git a/docs/examples/ftpuploadfrommem.c b/docs/examples/ftpuploadfrommem.c index af88f52f1a7b..7c75f2b8d759 100644 --- a/docs/examples/ftpuploadfrommem.c +++ b/docs/examples/ftpuploadfrommem.c @@ -30,7 +30,7 @@ #include -static const char data[]= +static const char data[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " "___ rhoncus odio id venenatis volutpat. Vestibulum dapibus " "bibendum ullamcorper. Maecenas finibus elit augue, vel " @@ -64,7 +64,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) return copylen; } - return 0; /* no more data left to deliver */ + return 0; /* no more data left to deliver */ } int main(void) diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c index 1deeeda26667..d4d8960487a1 100644 --- a/docs/examples/getinmemory.c +++ b/docs/examples/getinmemory.c @@ -37,8 +37,7 @@ struct MemoryStruct { size_t size; }; -static size_t write_cb(void *contents, size_t size, size_t nmemb, - void *userp) +static size_t write_cb(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)userp; @@ -69,8 +68,8 @@ int main(void) if(res) return (int)res; - chunk.memory = malloc(1); /* grown as needed by the realloc above */ - chunk.size = 0; /* no data at this point */ + chunk.memory = malloc(1); /* grown as needed by the realloc above */ + chunk.size = 0; /* no data at this point */ /* init the curl session */ curl = curl_easy_init(); diff --git a/docs/examples/getredirect.c b/docs/examples/getredirect.c index b1f42dc9fdf4..6ad9b9c1aa5c 100644 --- a/docs/examples/getredirect.c +++ b/docs/examples/getredirect.c @@ -54,8 +54,7 @@ int main(void) curl_easy_strerror(res)); else { res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); - if((res == CURLE_OK) && - ((response_code / 100) != 3)) { + if((res == CURLE_OK) && ((response_code / 100) != 3)) { /* a redirect implies a 3xx response code */ fprintf(stderr, "Not a redirect.\n"); } diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index f27521971cd5..d7b19abb9be3 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -171,8 +171,8 @@ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp) { struct timeval timeout; struct GlobalInfo *g = (struct GlobalInfo *)userp; - timeout.tv_sec = timeout_ms/1000; - timeout.tv_usec = (timeout_ms%1000)*1000; + timeout.tv_sec = timeout_ms / 1000; + timeout.tv_usec = (timeout_ms % 1000) * 1000; MSG_OUT("*** update_timeout_cb %ld => %ld:%ld ***\n", timeout_ms, timeout.tv_sec, timeout.tv_usec); @@ -191,7 +191,7 @@ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp) /* Called by glib when we get action on a multi socket */ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data) { - struct GlobalInfo *g = (struct GlobalInfo*) data; + struct GlobalInfo *g = (struct GlobalInfo *)data; CURLMcode rc; int fd = g_io_channel_unix_get_fd(ch); @@ -259,9 +259,9 @@ static void addsock(curl_socket_t s, CURL *curl, int action, /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { - struct GlobalInfo *g = (struct GlobalInfo*) cbp; - struct SockInfo *fdp = (struct SockInfo*) sockp; - static const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; + struct GlobalInfo *g = (struct GlobalInfo *)cbp; + struct SockInfo *fdp = (struct SockInfo *)sockp; + static const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { @@ -276,8 +276,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) addsock(s, e, what, g); } else { - MSG_OUT( - "Changing action from %d to %d\n", fdp->action, what); + MSG_OUT("Changing action from %d to %d\n", fdp->action, what); setsock(fdp, s, e, what, g); } } @@ -288,7 +287,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; - struct ConnInfo *conn = (struct ConnInfo*) data; + struct ConnInfo *conn = (struct ConnInfo *)data; (void)ptr; (void)conn; return realsize; @@ -302,8 +301,8 @@ static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow, (void)ult; (void)uln; - fprintf(MSG_OUT, "Progress: %s (%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T ")\n", conn->url, dlnow, dltotal); + fprintf(MSG_OUT, "Progress: %s (%" CURL_FORMAT_CURL_OFF_T "/" + "%" CURL_FORMAT_CURL_OFF_T ")\n", conn->url, dlnow, dltotal); return 0; } @@ -357,18 +356,18 @@ static gboolean fifo_cb(GIOChannel *ch, GIOCondition condition, gpointer data) rv = g_io_channel_read_line(ch, &buf, &len, &tp, &err); if(buf) { if(tp) { - buf[tp]='\0'; + buf[tp] = '\0'; } - new_conn(buf, (struct GlobalInfo*)data); + new_conn(buf, (struct GlobalInfo *)data); g_free(buf); } else { buf = g_malloc(BUF_SIZE + 1); while(TRUE) { - buf[BUF_SIZE]='\0'; + buf[BUF_SIZE] = '\0'; g_io_channel_read_chars(ch, buf, BUF_SIZE, &len, &err); if(len) { - buf[len]='\0'; + buf[len] = '\0'; if(all) { tmp = all; all = g_strdup_printf("%s%s", tmp, buf); @@ -383,7 +382,7 @@ static gboolean fifo_cb(GIOChannel *ch, GIOCondition condition, gpointer data) } } if(all) { - new_conn(all, (struct GlobalInfo*)data); + new_conn(all, (struct GlobalInfo *)data); g_free(all); } g_free(buf); diff --git a/docs/examples/headerapi.c b/docs/examples/headerapi.c index 089a23a07013..e1fa33b8f62d 100644 --- a/docs/examples/headerapi.c +++ b/docs/examples/headerapi.c @@ -76,7 +76,6 @@ int main(void) printf(" %s: %s (%u)\n", h->name, h->value, (unsigned int)h->amount); prev = h; } while(h); - } /* always cleanup */ curl_easy_cleanup(curl); diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index 60288b4bd263..576bbb8d2c2f 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -77,7 +77,6 @@ callback. #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ - /* Global information, common to all connections */ struct GlobalInfo { struct event_base *evbase; @@ -107,23 +106,35 @@ struct SockInfo { struct GlobalInfo *global; }; -#define mycase(code) \ - case code: s = __STRING(code) - /* Die if we get a bad CURLMcode somewhere */ static void mcode_or_die(const char *where, CURLMcode code) { if(CURLM_OK != code) { const char *s; switch(code) { - mycase(CURLM_BAD_HANDLE); break; - mycase(CURLM_BAD_EASY_HANDLE); break; - mycase(CURLM_OUT_OF_MEMORY); break; - mycase(CURLM_INTERNAL_ERROR); break; - mycase(CURLM_UNKNOWN_OPTION); break; - mycase(CURLM_LAST); break; - default: s = "CURLM_unknown"; break; - mycase(CURLM_BAD_SOCKET); + case CURLM_BAD_HANDLE: + s = "CURLM_BAD_HANDLE"; + break; + case CURLM_BAD_EASY_HANDLE: + s = "CURLM_BAD_EASY_HANDLE"; + break; + case CURLM_OUT_OF_MEMORY: + s = "CURLM_OUT_OF_MEMORY"; + break; + case CURLM_INTERNAL_ERROR: + s = "CURLM_INTERNAL_ERROR"; + break; + case CURLM_UNKNOWN_OPTION: + s = "CURLM_UNKNOWN_OPTION"; + break; + case CURLM_LAST: + s = "CURLM_LAST"; + break; + default: + s = "CURLM_unknown"; + break; + case CURLM_BAD_SOCKET: + s = "CURLM_BAD_SOCKET"; fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); /* ignore this error */ return; @@ -139,8 +150,8 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g) struct timeval timeout; (void)multi; - timeout.tv_sec = timeout_ms/1000; - timeout.tv_usec = (timeout_ms%1000)*1000; + timeout.tv_sec = timeout_ms / 1000; + timeout.tv_usec = (timeout_ms % 1000) * 1000; fprintf(MSG_OUT, "multi_timer_cb: Setting timeout to %ld ms\n", timeout_ms); /* @@ -185,7 +196,7 @@ static void check_multi_info(struct GlobalInfo *g) /* Called by libevent when we get action on a multi socket */ static void event_cb(int fd, short kind, void *userp) { - struct GlobalInfo *g = (struct GlobalInfo*) userp; + struct GlobalInfo *g = (struct GlobalInfo *)userp; CURLMcode rc; int action = @@ -261,12 +272,11 @@ static void addsock(curl_socket_t s, CURL *curl, int action, /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { - struct GlobalInfo *g = (struct GlobalInfo*) cbp; - struct SockInfo *fdp = (struct SockInfo*) sockp; - const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; + struct GlobalInfo *g = (struct GlobalInfo *)cbp; + struct SockInfo *fdp = (struct SockInfo *)sockp; + const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; - fprintf(MSG_OUT, - "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); + fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { fprintf(MSG_OUT, "\n"); remsock(fdp); @@ -277,8 +287,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) addsock(s, e, what, g); } else { - fprintf(MSG_OUT, - "Changing action from %s to %s\n", + fprintf(MSG_OUT, "Changing action from %s to %s\n", whatstr[fdp->action], whatstr[what]); setsock(fdp, s, e, what, g); } @@ -302,8 +311,8 @@ static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow, (void)ult; (void)uln; - fprintf(MSG_OUT, "Progress: %s (%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T ")\n", conn->url, dlnow, dltotal); + fprintf(MSG_OUT, "Progress: %s (%" CURL_FORMAT_CURL_OFF_T "/" + "%" CURL_FORMAT_CURL_OFF_T ")\n", conn->url, dlnow, dltotal); return 0; } @@ -333,8 +342,8 @@ static void new_conn(const char *url, struct GlobalInfo *g) curl_easy_setopt(conn->curl, CURLOPT_XFERINFOFUNCTION, xferinfo_cb); curl_easy_setopt(conn->curl, CURLOPT_PROGRESSDATA, conn); curl_easy_setopt(conn->curl, CURLOPT_FOLLOWLOCATION, 1L); - fprintf(MSG_OUT, - "Adding easy %p to multi %p (%s)\n", conn->curl, g->multi, url); + fprintf(MSG_OUT, "Adding easy %p to multi %p (%s)\n", + conn->curl, g->multi, url); rc = curl_multi_add_handle(g->multi, conn->curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); @@ -353,9 +362,9 @@ static void fifo_cb(int fd, short event, void *arg) (void)event; do { - s[0]='\0'; + s[0] = '\0'; rv = fscanf(g->input, "%1023s%n", s, &n); - s[n]='\0'; + s[n] = '\0'; if(n && s[0]) { if(!strcmp(s, "stop")) { g->stopped = 1; @@ -386,7 +395,7 @@ static int init_fifo(struct GlobalInfo *g) } } unlink(fifo); - if(mkfifo (fifo, 0600) == -1) { + if(mkfifo(fifo, 0600) == -1) { perror("mkfifo"); return 1; } @@ -398,7 +407,7 @@ static int init_fifo(struct GlobalInfo *g) g->input = fdopen(sockfd, "r"); fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo); - event_assign(&g->fifo_event, g->evbase, sockfd, EV_READ|EV_PERSIST, + event_assign(&g->fifo_event, g->evbase, sockfd, EV_READ | EV_PERSIST, fifo_cb, g); event_add(&g->fifo_event, NULL); return 0; @@ -406,9 +415,9 @@ static int init_fifo(struct GlobalInfo *g) static void clean_fifo(struct GlobalInfo *g) { - event_del(&g->fifo_event); - fclose(g->input); - unlink(fifo); + event_del(&g->fifo_event); + fclose(g->input); + unlink(fifo); } int main(int argc, char **argv) diff --git a/docs/examples/hsts-preload.c b/docs/examples/hsts-preload.c index ad71c62cad96..b029df2a0a30 100644 --- a/docs/examples/hsts-preload.c +++ b/docs/examples/hsts-preload.c @@ -53,8 +53,7 @@ struct state { /* "read" is from the point of the library, it wants data from us. One domain entry per invoke. */ -static CURLSTScode hstsread(CURL *curl, struct curl_hstsentry *e, - void *userp) +static CURLSTScode hstsread(CURL *curl, struct curl_hstsentry *e, void *userp) { const char *host; const char *expire; diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index 04b4809317a9..9865a633efcd 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -48,14 +48,14 @@ static uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) static void dumpNode(TidyDoc doc, TidyNode tnod, int indent) { TidyNode child; - for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) { + for(child = tidyGetChild(tnod); child; child = tidyGetNext(child)) { ctmbstr name = tidyNodeGetName(child); if(name) { /* if it has a name, then it is an HTML tag ... */ TidyAttr attr; printf("%*.*s%s ", indent, indent, "<", name); /* walk the attribute list */ - for(attr = tidyAttrFirst(child); attr; attr = tidyAttrNext(attr) ) { + for(attr = tidyAttrFirst(child); attr; attr = tidyAttrNext(attr)) { printf("%s", tidyAttrName(attr)); tidyAttrValue(attr) ? printf("=\"%s\" ", tidyAttrValue(attr)) : printf(" "); diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index 97b924b1802d..a6f944ff0eb9 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -55,9 +55,8 @@ // libxml callback context structure // -struct Context -{ - Context(): addTitle(false) { } +struct Context { + Context() : addTitle(false) {} bool addTitle; std::string title; @@ -79,7 +78,7 @@ static size_t writer(char *data, size_t size, size_t nmemb, if(writerData == NULL) return 0; - writerData->append(data, size*nmemb); + writerData->append(data, size * nmemb); return size * nmemb; } diff --git a/docs/examples/http2-pushinmemory.c b/docs/examples/http2-pushinmemory.c index 14f37dbbbcd3..df896e1af5d1 100644 --- a/docs/examples/http2-pushinmemory.c +++ b/docs/examples/http2-pushinmemory.c @@ -115,7 +115,6 @@ static int server_push_callback(CURL *parent, return CURL_PUSH_OK; } - /* * Download a file over HTTP/2, take care of server push. */ diff --git a/docs/examples/httpput-postfields.c b/docs/examples/httpput-postfields.c index 29fd6273d7eb..4fd92aaffbef 100644 --- a/docs/examples/httpput-postfields.c +++ b/docs/examples/httpput-postfields.c @@ -30,7 +30,7 @@ #include -static const char olivertwist[]= +static const char olivertwist[] = "Among other public buildings in a certain town, which for many reasons " "it will be prudent to refrain from mentioning, and to which I will assign " "no fictitious name, there is one anciently common to most towns, great or " diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 5c3fc314b801..026fde1210ea 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -77,7 +77,7 @@ int main(int argc, char **argv) { CURL *curl; CURLcode res; - FILE * hd_src; + FILE *hd_src; struct stat file_info; char *file; diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c index 81ca682ffd26..91cbac69151a 100644 --- a/docs/examples/imap-append.c +++ b/docs/examples/imap-append.c @@ -64,7 +64,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) const char *data; size_t room = size * nmemb; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } @@ -95,7 +95,7 @@ int main(void) if(curl) { size_t filesize; long infilesize = LONG_MAX; - struct upload_status upload_ctx = { 0 }; + struct upload_status upload_ctx = {0}; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); diff --git a/docs/examples/imap-ssl.c b/docs/examples/imap-ssl.c index 259eddc26f6a..52448f492d16 100644 --- a/docs/examples/imap-ssl.c +++ b/docs/examples/imap-ssl.c @@ -51,7 +51,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This fetches message 1 from the user's inbox. Note the use of - * imaps:// rather than imap:// to request an SSL based connection. */ + * imaps:// rather than imap:// to request an SSL based connection. */ curl_easy_setopt(curl, CURLOPT_URL, "imaps://imap.example.com/INBOX/;UID=1"); diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index a0d209ffc395..0c5c1a3b5494 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -236,7 +236,7 @@ int main(void) curl_global_trace("all"); #endif - for(i = 0; i < sizeof(transfer)/sizeof(transfer[0]); ++i) { + for(i = 0; i < sizeof(transfer) / sizeof(transfer[0]); ++i) { int failed = 0; struct transfer *t = &transfer[i]; diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index 460c93057ad5..d58181e027f4 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -66,7 +66,7 @@ int main(void) int still_running = 1; /* keep number of running handles */ - CURLMsg *msg; /* for picking up messages with the transfer status */ + CURLMsg *msg; /* for picking up messages with the transfer status */ int msgs_left; /* how many messages are left */ /* add the individual transfers */ diff --git a/docs/examples/multi-event.c b/docs/examples/multi-event.c index 2698e24678f9..901d7dd6e765 100644 --- a/docs/examples/multi-event.c +++ b/docs/examples/multi-event.c @@ -47,7 +47,7 @@ static struct curl_context *create_curl_context(curl_socket_t sockfd) { struct curl_context *context; - context = (struct curl_context *) malloc(sizeof(*context)); + context = (struct curl_context *)malloc(sizeof(*context)); context->sockfd = sockfd; @@ -134,10 +134,9 @@ static void curl_perform(int fd, short event, void *arg) if(event & EV_WRITE) flags |= CURL_CSELECT_OUT; - context = (struct curl_context *) arg; + context = (struct curl_context *)arg; - curl_multi_socket_action(multi, context->sockfd, flags, - &running_handles); + curl_multi_socket_action(multi, context->sockfd, flags, &running_handles); check_multi_info(); } @@ -148,8 +147,7 @@ static void on_timeout(evutil_socket_t fd, short events, void *arg) (void)fd; (void)events; (void)arg; - curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, - &running_handles); + curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); check_multi_info(); } @@ -186,9 +184,9 @@ static int handle_socket(CURL *curl, curl_socket_t s, int action, void *userp, case CURL_POLL_OUT: case CURL_POLL_INOUT: curl_context = socketp ? - (struct curl_context *) socketp : create_curl_context(s); + (struct curl_context *)socketp : create_curl_context(s); - curl_multi_assign(multi, s, (void *) curl_context); + curl_multi_assign(multi, s, (void *)curl_context); if(action != CURL_POLL_IN) events |= EV_WRITE; @@ -205,8 +203,8 @@ static int handle_socket(CURL *curl, curl_socket_t s, int action, void *userp, break; case CURL_POLL_REMOVE: if(socketp) { - event_del(((struct curl_context*) socketp)->event); - destroy_curl_context((struct curl_context*) socketp); + event_del(((struct curl_context *)socketp)->event); + destroy_curl_context((struct curl_context *)socketp); curl_multi_assign(multi, s, NULL); } break; diff --git a/docs/examples/multi-legacy.c b/docs/examples/multi-legacy.c index ca2c0a4c7afb..e34d1cd710a2 100644 --- a/docs/examples/multi-legacy.c +++ b/docs/examples/multi-legacy.c @@ -72,7 +72,7 @@ int main(void) int still_running = 0; /* keep number of running handles */ - CURLMsg *msg; /* for picking up messages with the transfer status */ + CURLMsg *msg; /* for picking up messages with the transfer status */ int msgs_left; /* how many messages are left */ /* add the individual transfers */ @@ -85,7 +85,7 @@ int main(void) while(still_running) { struct timeval timeout; - int rc; /* select() return code */ + int rc; /* select() return code */ CURLMcode mc; /* curl_multi_fdset() return code */ fd_set fdread; @@ -155,7 +155,7 @@ int main(void) case -1: /* select error */ break; - case 0: /* timeout */ + case 0: /* timeout */ default: /* action */ curl_multi_perform(multi, &still_running); break; diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index 1dac32048927..4053cb906112 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -60,7 +60,7 @@ static struct curl_context *create_curl_context(curl_socket_t sockfd, { struct curl_context *context; - context = (struct curl_context *) malloc(sizeof(*context)); + context = (struct curl_context *)malloc(sizeof(*context)); context->sockfd = sockfd; context->uv = uv; @@ -73,13 +73,13 @@ static struct curl_context *create_curl_context(curl_socket_t sockfd, static void curl_close_cb(uv_handle_t *handle) { - struct curl_context *context = (struct curl_context *) handle->data; + struct curl_context *context = (struct curl_context *)handle->data; free(context); } static void destroy_curl_context(struct curl_context *context) { - uv_close((uv_handle_t *) &context->poll_handle, curl_close_cb); + uv_close((uv_handle_t *)&context->poll_handle, curl_close_cb); } static void add_download(const char *url, int num, CURLM *multi) @@ -145,7 +145,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events) { int running_handles; int flags = 0; - struct curl_context *context = (struct curl_context *) req->data; + struct curl_context *context = (struct curl_context *)req->data; (void)status; if(events & UV_READABLE) flags |= CURL_CSELECT_IN; @@ -202,9 +202,9 @@ static int cb_socket(CURL *curl, curl_socket_t s, int action, case CURL_POLL_OUT: case CURL_POLL_INOUT: curl_context = socketp ? - (struct curl_context *) socketp : create_curl_context(s, uv); + (struct curl_context *)socketp : create_curl_context(s, uv); - curl_multi_assign(uv->multi, s, (void *) curl_context); + curl_multi_assign(uv->multi, s, (void *)curl_context); if(action != CURL_POLL_IN) events |= UV_WRITABLE; @@ -215,8 +215,8 @@ static int cb_socket(CURL *curl, curl_socket_t s, int action, break; case CURL_POLL_REMOVE: if(socketp) { - uv_poll_stop(&((struct curl_context*)socketp)->poll_handle); - destroy_curl_context((struct curl_context*) socketp); + uv_poll_stop(&((struct curl_context *)socketp)->poll_handle); + destroy_curl_context((struct curl_context *)socketp); curl_multi_assign(uv->multi, s, NULL); } break; @@ -230,7 +230,7 @@ static int cb_socket(CURL *curl, curl_socket_t s, int action, int main(int argc, char **argv) { CURLcode res; - struct datauv uv = { 0 }; + struct datauv uv = {0}; int running_handles; if(argc <= 1) diff --git a/docs/examples/multithread.c b/docs/examples/multithread.c index 7de1baea9085..308c1168e284 100644 --- a/docs/examples/multithread.c +++ b/docs/examples/multithread.c @@ -56,7 +56,6 @@ struct targ { const char *url; }; - static void *pull_one_url(void *p) { CURL *curl; @@ -72,7 +71,6 @@ static void *pull_one_url(void *p) return NULL; } - /* int pthread_create(pthread_t *new_thread_ID, const pthread_attr_t *attr, diff --git a/docs/examples/netrc.c b/docs/examples/netrc.c index 91f8df96dc31..a9eaebff88ee 100644 --- a/docs/examples/netrc.c +++ b/docs/examples/netrc.c @@ -40,8 +40,7 @@ int main(void) curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL); - curl_easy_setopt(curl, CURLOPT_NETRC_FILE, - "/home/daniel/s3cr3ts.txt"); + curl_easy_setopt(curl, CURLOPT_NETRC_FILE, "/home/daniel/s3cr3ts.txt"); curl_easy_setopt(curl, CURLOPT_URL, "https://curl.se/"); res = curl_easy_perform(curl); diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index bbab00279091..c463e3785ceb 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -47,7 +47,7 @@ struct WriteThis { static size_t read_cb(char *dest, size_t size, size_t nmemb, void *userp) { struct WriteThis *wt = (struct WriteThis *)userp; - size_t buffer_size = size*nmemb; + size_t buffer_size = size * nmemb; if(wt->sizeleft) { /* copy as much as possible from the source to the destination */ diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index fc42251ddd12..089d9a9c743c 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -36,8 +36,7 @@ struct MemoryStruct { size_t size; }; -static size_t write_cb(void *contents, size_t size, size_t nmemb, - void *userp) +static size_t write_cb(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)userp; @@ -104,7 +103,7 @@ int main(void) * * Do something nice with it! */ - printf("%s\n",chunk.memory); + printf("%s\n", chunk.memory); } /* always cleanup */ diff --git a/docs/examples/sftpget.c b/docs/examples/sftpget.c index 287d5b253efb..470474cafd6c 100644 --- a/docs/examples/sftpget.c +++ b/docs/examples/sftpget.c @@ -50,8 +50,7 @@ struct FtpFile { FILE *stream; }; -static size_t write_cb(void *buffer, size_t size, size_t nmemb, - void *stream) +static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out = (struct FtpFile *)stream; if(!out->stream) { @@ -63,7 +62,6 @@ static size_t write_cb(void *buffer, size_t size, size_t nmemb, return fwrite(buffer, size, nmemb, out->stream); } - int main(void) { CURL *curl; diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index 84bb42554939..9b78f96ee4ab 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -83,7 +83,6 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) return remoteFileSizeByte; } - static int sftpResumeUpload(CURL *curl, const char *remotepath, const char *localpath) { diff --git a/docs/examples/shared-connection-cache.c b/docs/examples/shared-connection-cache.c index bc1239428ba4..acaa610dec11 100644 --- a/docs/examples/shared-connection-cache.c +++ b/docs/examples/shared-connection-cache.c @@ -29,8 +29,8 @@ #include -static void my_lock(CURL *curl, curl_lock_data data, - curl_lock_access laccess, void *useptr) +static void my_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, + void *useptr) { (void)curl; (void)data; diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index a41a9ac29e6a..3cf4b462bd50 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -68,11 +68,11 @@ int main(void) const char *pKeyType; #ifdef USE_ENGINE - pKeyName = "rsa_test"; - pKeyType = "ENG"; + pKeyName = "rsa_test"; + pKeyType = "ENG"; #else - pKeyName = "testkey.pem"; - pKeyType = "PEM"; + pKeyName = "testkey.pem"; + pKeyType = "PEM"; #endif res = curl_global_init(CURL_GLOBAL_ALL); diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 2a3cdbc0ef3c..6bf8946721aa 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -108,11 +108,10 @@ static void *pull_one_url(void *NaN) return NULL; } - static gboolean pulse_bar(gpointer data) { gdk_threads_enter(); - gtk_progress_bar_pulse(GTK_PROGRESS_BAR (data)); + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(data)); gdk_threads_leave(); /* Return true so the function is called again; returning false removes this @@ -127,7 +126,7 @@ static void *create_thread(void *progress_bar) int i; /* Make sure I do not create more threads than urls. */ - for(i = 0; i < NUMT && i < num_urls ; i++) { + for(i = 0; i < NUMT && i < num_urls; i++) { int error = pthread_create(&tid[i], NULL, /* default attributes please */ pull_one_url, @@ -196,7 +195,7 @@ int main(int argc, char **argv) /* Progress bar */ progress_bar = gtk_progress_bar_new(); - gtk_progress_bar_pulse(GTK_PROGRESS_BAR (progress_bar)); + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progress_bar)); /* Make uniform pulsing */ gint pulse_ref = g_timeout_add(300, pulse_bar, progress_bar); g_object_set_data(G_OBJECT(progress_bar), "pulse_id", @@ -206,7 +205,7 @@ int main(int argc, char **argv) gtk_widget_show_all(top_window); printf("gtk_widget_show_all\n"); - g_signal_connect(G_OBJECT (top_window), "delete-event", + g_signal_connect(G_OBJECT(top_window), "delete-event", G_CALLBACK(cb_delete), NULL); if(!g_thread_create(&create_thread, progress_bar, FALSE, NULL) != 0) diff --git a/docs/examples/smtp-authzid.c b/docs/examples/smtp-authzid.c index a375d839b131..e7dd20f59093 100644 --- a/docs/examples/smtp-authzid.c +++ b/docs/examples/smtp-authzid.c @@ -73,7 +73,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) size_t room = size * nmemb; size_t len; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } @@ -99,7 +99,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = { 0 }; + struct upload_status upload_ctx = {0}; /* This is the URL for your mailserver. In this example we connect to the smtp-submission port as we require an authenticated connection. */ diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c index e6e77b97a39d..d5074abbf2f5 100644 --- a/docs/examples/smtp-mail.c +++ b/docs/examples/smtp-mail.c @@ -70,7 +70,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) size_t room = size * nmemb; size_t len; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } @@ -96,7 +96,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = { 0 }; + struct upload_status upload_ctx = {0}; /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index ab7165cd5277..8cb5e65a26b9 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -63,7 +63,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) size_t room = size * nmemb; size_t len; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } @@ -94,7 +94,7 @@ int main(void) if(multi) { int still_running = 1; struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = { 0 }; + struct upload_status upload_ctx = {0}; /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index 4ebc58f1b5dd..3b140c904c5c 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -67,7 +67,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) size_t room = size * nmemb; size_t len; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } @@ -93,7 +93,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = { 0 }; + struct upload_status upload_ctx = {0}; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index f6b3bb6053c4..3bf3b0cddf11 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -67,7 +67,7 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *userp) size_t room = size * nmemb; size_t len; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } @@ -93,7 +93,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = { 0 }; + struct upload_status upload_ctx = {0}; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); diff --git a/docs/examples/sslbackend.c b/docs/examples/sslbackend.c index fd2b57534e65..5615bec72dc6 100644 --- a/docs/examples/sslbackend.c +++ b/docs/examples/sslbackend.c @@ -38,7 +38,7 @@ * SSL backend has to be configured). * * **** This example only works with libcurl 7.56.0 and later! **** -*/ + */ int main(int argc, char **argv) { diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index a9a746c30a20..b2a3b926072d 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -66,7 +66,11 @@ #include #ifndef _WIN32 -int main(void) { printf("Platform not supported.\n"); return 1; } +int main(void) +{ + printf("Platform not supported.\n"); + return 1; +} #else #if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)) || \ @@ -79,7 +83,11 @@ int main(void) { printf("Platform not supported.\n"); return 1; } #endif #ifdef CURL_WINDOWS_UWP -int main(void) { printf("Platform not supported.\n"); return 1; } +int main(void) +{ + printf("Platform not supported.\n"); + return 1; +} #else #include @@ -123,8 +131,7 @@ static SYSTEMTIME LOCALTime; #define HTTP_COMMAND_HEAD 0 #define HTTP_COMMAND_GET 1 -static size_t write_cb(void *ptr, size_t size, size_t nmemb, - void *stream) +static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr, size, nmemb, stream); return nmemb * size; @@ -280,7 +287,7 @@ int main(int argc, char *argv[]) snprintf(conf->http_proxy, MAX_STRING, "%s", &argv[OptionIndex][8]); if((strcmp(argv[OptionIndex], "--help") == 0) || - (strcmp(argv[OptionIndex], "/?") == 0)) { + (strcmp(argv[OptionIndex], "/?") == 0)) { showUsage(); return 0; } @@ -317,9 +324,9 @@ int main(int argc, char *argv[]) gmt = gmtime(&tt); tt_gmt = mktime(gmt); tzonediffFloat = difftime(tt_local, tt_gmt); - tzonediffWord = (int)(tzonediffFloat/3600.0); + tzonediffWord = (int)(tzonediffFloat / 3600.0); - if(tzonediffWord == (int)(tzonediffFloat/3600.0)) + if(tzonediffWord == (int)(tzonediffFloat / 3600.0)) snprintf(tzoneBuf, sizeof(tzoneBuf), "%+03d'00'", tzonediffWord); else snprintf(tzoneBuf, sizeof(tzoneBuf), "%+03d'30'", tzonediffWord); @@ -329,9 +336,8 @@ int main(int argc, char *argv[]) GetLocalTime(&LOCALTime); snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ", DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay, - MthStr[LOCALTime.wMonth-1], LOCALTime.wYear, - LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond, - LOCALTime.wMilliseconds); + MthStr[LOCALTime.wMonth - 1], LOCALTime.wYear, LOCALTime.wHour, + LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds); fprintf(stderr, "Fetch: %s\n\n", conf->timeserver); fprintf(stderr, "Before HTTP. Date: %s%s\n\n", timeBuf, tzoneBuf); @@ -343,9 +349,8 @@ int main(int argc, char *argv[]) GetLocalTime(&LOCALTime); snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ", DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay, - MthStr[LOCALTime.wMonth-1], LOCALTime.wYear, - LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond, - LOCALTime.wMilliseconds); + MthStr[LOCALTime.wMonth - 1], LOCALTime.wYear, LOCALTime.wHour, + LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds); fprintf(stderr, "\nAfter HTTP. Date: %s%s\n", timeBuf, tzoneBuf); if(AutoSyncTime == 3) { @@ -359,7 +364,7 @@ int main(int argc, char *argv[]) GetLocalTime(&LOCALTime); snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ", DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay, - MthStr[LOCALTime.wMonth-1], LOCALTime.wYear, + MthStr[LOCALTime.wMonth - 1], LOCALTime.wYear, LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds); fprintf(stderr, "\nNew System's Date: %s%s\n", timeBuf, tzoneBuf); diff --git a/docs/examples/threaded-ssl.c b/docs/examples/threaded-ssl.c index 8119113695ea..8d5d1234fcb2 100644 --- a/docs/examples/threaded-ssl.c +++ b/docs/examples/threaded-ssl.c @@ -46,7 +46,7 @@ #define NUMT 4 /* List of URLs to fetch.*/ -static const char * const urls[]= { +static const char * const urls[] = { "https://www.example.com/", "https://www2.example.com/", "https://www3.example.com/", diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index 175dae11514f..44a0a15bc7b1 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -114,7 +114,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) } /* tell SSL to use the X509 certificate */ - ret = SSL_CTX_use_certificate((SSL_CTX*)sslctx, cert); + ret = SSL_CTX_use_certificate((SSL_CTX *)sslctx, cert); if(ret != 1) { printf("Use certificate failed\n"); } @@ -132,7 +132,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) } /* tell SSL to use the RSA key from memory */ - ret = SSL_CTX_use_RSAPrivateKey((SSL_CTX*)sslctx, rsa); + ret = SSL_CTX_use_RSAPrivateKey((SSL_CTX *)sslctx, rsa); if(ret != 1) { printf("Use Key failed\n"); } diff --git a/docs/examples/xmlstream.c b/docs/examples/xmlstream.c index 0aec24cc67a7..5b35d048619a 100644 --- a/docs/examples/xmlstream.c +++ b/docs/examples/xmlstream.c @@ -55,7 +55,7 @@ struct ParserStruct { static void startElement(void *userData, const XML_Char *name, const XML_Char **atts) { - struct ParserStruct *state = (struct ParserStruct *) userData; + struct ParserStruct *state = (struct ParserStruct *)userData; state->tags++; state->depth++; @@ -70,7 +70,7 @@ static void startElement(void *userData, const XML_Char *name, static void characterDataHandler(void *userData, const XML_Char *s, int len) { - struct ParserStruct *state = (struct ParserStruct *) userData; + struct ParserStruct *state = (struct ParserStruct *)userData; struct MemoryStruct *mem = &state->characters; char *ptr = realloc(mem->memory, mem->size + (unsigned long)len + 1); @@ -89,7 +89,7 @@ static void characterDataHandler(void *userData, const XML_Char *s, int len) static void endElement(void *userData, const XML_Char *name) { - struct ParserStruct *state = (struct ParserStruct *) userData; + struct ParserStruct *state = (struct ParserStruct *)userData; state->depth--; printf("%5lu %10lu %s\n", state->depth, state->characters.size, name); @@ -98,9 +98,9 @@ static void endElement(void *userData, const XML_Char *name) static size_t write_cb(void *contents, size_t length, size_t nmemb, void *userp) { - XML_Parser parser = (XML_Parser) userp; + XML_Parser parser = (XML_Parser)userp; size_t real_size = length * nmemb; - struct ParserStruct *state = (struct ParserStruct *) XML_GetUserData(parser); + struct ParserStruct *state = (struct ParserStruct *)XML_GetUserData(parser); /* Only parse if we are not already in a failure state. */ if(state->ok && XML_Parse(parser, contents, (int)real_size, 0) == 0) { From e25a3c6734458328412c55d236d3a2370593585c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Nov 2025 15:16:08 +0100 Subject: [PATCH 577/885] GHA/curl-for-win: drop WINE install, do not run curl after build To reduce to amount of Debian packages to install, which hopefully removes some flakiness due to sometimes very slow Azure package distro servers. Possible also making these jobs finish 20s faster. Windows from Debian | llvm | gcc :------------------ | :----------------: | :----------------: build time | 2m41s -> 2m20s | 3m19s -> 2m57s installed packages | 288 -> 142 | 247 -> 99 downloads | 403 MB -> 240 MB | 297 MB -> 134 MB disk space | 2132 MB -> 1289 MB | 1582 MB -> 739 MB Before: https://github.com/curl/curl/actions/runs/19765983026 After: https://github.com/curl/curl/actions/runs/19766373960?pr=19749 Ref: https://github.com/curl/curl-for-win/commit/02149b7e364a1830d8fa2c947cfc713d925c186d Closes #19749 --- .github/workflows/curl-for-win.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/curl-for-win.yml b/.github/workflows/curl-for-win.yml index f0214b2874cb..f352529f723e 100644 --- a/.github/workflows/curl-for-win.yml +++ b/.github/workflows/curl-for-win.yml @@ -159,7 +159,7 @@ jobs: run: | git clone --depth 1 https://github.com/curl/curl-for-win mv curl-for-win/* . - export CW_CONFIG='-main-werror-unitybatch-win-x64' + export CW_CONFIG='-main-werror-unitybatch-win-x64-noWINE' export CW_REVISION="${GITHUB_SHA}" . ./_versions.sh sudo podman image trust set --type reject default @@ -186,7 +186,7 @@ jobs: run: | git clone --depth 1 https://github.com/curl/curl-for-win mv curl-for-win/* . - export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-zlibold' + export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-zlibold-noWINE' export CW_REVISION="${GITHUB_SHA}" . ./_versions.sh sudo podman image trust set --type reject default From 12a3182fc39cb948792e9cc189887cd85b587bb0 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 28 Nov 2025 12:49:16 +0100 Subject: [PATCH 578/885] ssh: tracing and better pollset handling Remove connection member `waitfor` and keep it in the SSH connection meta. Add `ssh` to supported tracing features, convert many DEBUGF printgs to traces. Closes #19745 --- docs/libcurl/curl_global_trace.md | 4 + lib/curl_trc.c | 28 +++++++ lib/curl_trc.h | 13 ++++ lib/urldata.h | 1 - lib/vssh/libssh.c | 124 ++++++++++++++++-------------- lib/vssh/libssh2.c | 112 +++++++++++++++------------ lib/vssh/ssh.h | 3 +- 7 files changed, 178 insertions(+), 107 deletions(-) diff --git a/docs/libcurl/curl_global_trace.md b/docs/libcurl/curl_global_trace.md index 0459eab6747d..10ec21b4bd43 100644 --- a/docs/libcurl/curl_global_trace.md +++ b/docs/libcurl/curl_global_trace.md @@ -130,6 +130,10 @@ states. Traces reading of upload data from the application in order to send it to the server. +## `ssh` + +Tracing of SSH related protocols SCP and SFTP. + ## `ssls` Tracing of SSL Session handling, e.g. caching/import/export. diff --git a/lib/curl_trc.c b/lib/curl_trc.c index cc06c77e9d9a..42711ed01c05 100644 --- a/lib/curl_trc.c +++ b/lib/curl_trc.c @@ -453,6 +453,24 @@ void Curl_trc_ssls(struct Curl_easy *data, const char *fmt, ...) } #endif /* USE_SSL */ +#ifdef USE_SSH +struct curl_trc_feat Curl_trc_feat_ssh = { + "SSH", + CURL_LOG_LVL_NONE, +}; + +void Curl_trc_ssh(struct Curl_easy *data, const char *fmt, ...) +{ + DEBUGASSERT(!strchr(fmt, '\n')); + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) { + va_list ap; + va_start(ap, fmt); + trc_infof(data, &Curl_trc_feat_ssh, NULL, 0, fmt, ap); + va_end(ap); + } +} +#endif /* USE_SSH */ + #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) struct curl_trc_feat Curl_trc_feat_ws = { "WS", @@ -500,6 +518,9 @@ static struct trc_feat_def trc_feats[] = { #ifdef USE_SSL { &Curl_trc_feat_ssls, TRC_CT_NETWORK }, #endif +#ifdef USE_SSH + { &Curl_trc_feat_ssh, TRC_CT_PROTOCOL }, +#endif #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) { &Curl_trc_feat_ws, TRC_CT_PROTOCOL }, #endif @@ -696,6 +717,13 @@ void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...) (void)data; (void)fmt; } #endif +#ifdef USE_SSH +void Curl_trc_ssh(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; + (void)fmt; +} +#endif #ifdef USE_SSL void Curl_trc_ssls(struct Curl_easy *data, const char *fmt, ...) { diff --git a/lib/curl_trc.h b/lib/curl_trc.h index 1a3f8f374e2d..0ce76ed7effa 100644 --- a/lib/curl_trc.h +++ b/lib/curl_trc.h @@ -117,6 +117,11 @@ extern struct curl_trc_feat Curl_trc_feat_ssls; void Curl_trc_ssls(struct Curl_easy *data, const char *fmt, ...) CURL_PRINTF(2, 3); #endif +#ifdef USE_SSH +extern struct curl_trc_feat Curl_trc_feat_ssh; +void Curl_trc_ssh(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) extern struct curl_trc_feat Curl_trc_feat_ws; void Curl_trc_ws(struct Curl_easy *data, @@ -168,6 +173,11 @@ void Curl_trc_ws(struct Curl_easy *data, do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \ Curl_trc_ssls(data, __VA_ARGS__); } while(0) #endif /* USE_SSL */ +#ifdef USE_SSH +#define CURL_TRC_SSH(data, ...) \ + do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) \ + Curl_trc_ssh(data, __VA_ARGS__); } while(0) +#endif /* USE_SSH */ #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) #define CURL_TRC_WS(data, ...) \ do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) \ @@ -193,6 +203,9 @@ void Curl_trc_ws(struct Curl_easy *data, #ifdef USE_SSL #define CURL_TRC_SSLS Curl_trc_ssls #endif +#ifdef USE_SSH +#define CURL_TRC_SSH Curl_trc_ssh +#endif #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) #define CURL_TRC_WS Curl_trc_ws #endif diff --git a/lib/urldata.h b/lib/urldata.h index debc2a3e0aa0..2d28718181a9 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -713,7 +713,6 @@ struct connectdata { wrong connections. */ char *localdev; unsigned short localportrange; - int waitfor; /* current READ/WRITE bits to wait for */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) int socks5_gssapi_enctype; #endif diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index a5997a6f6cf9..2b605e4a6184 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -210,26 +210,9 @@ static CURLcode sftp_error_to_CURLE(int err) return CURLE_SSH; } -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) -#define myssh_to(x,y,z) myssh_set_state(x,y,z, __LINE__) -#else -#define myssh_to(x,y,z) myssh_set_state(x,y,z) -#endif - -/* - * SSH State machine related code - */ -/* This is the ONLY way to change SSH state! */ -static void myssh_set_state(struct Curl_easy *data, - struct ssh_conn *sshc, - sshstate nowstate -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - , int lineno -#endif - ) +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) +static const char *myssh_statename(sshstate state) { -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - /* for debug purposes */ static const char *const names[] = { "SSH_STOP", "SSH_INIT", @@ -292,14 +275,34 @@ static void myssh_set_state(struct Curl_easy *data, "SSH_SESSION_FREE", "QUIT" }; + /* a precaution to make sure the lists are in sync */ + DEBUGASSERT(CURL_ARRAYSIZE(names) == SSH_LAST); + return ((size_t)state < CURL_ARRAYSIZE(names)) ? names[state] : ""; +} +#else +#define myssh_statename(x) "" +#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ + +#define myssh_to(x,y,z) myssh_set_state(x,y,z) + +/* + * SSH State machine related code + */ +/* This is the ONLY way to change SSH state! */ +static void myssh_set_state(struct Curl_easy *data, + struct ssh_conn *sshc, + sshstate nowstate) +{ +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) if(sshc->state != nowstate) { - infof(data, "SSH %p state change from %s to %s (line %d)", - (void *) sshc, names[sshc->state], names[nowstate], - lineno); + CURL_TRC_SSH(data, "[%s] -> [%s]", + myssh_statename(sshc->state), + myssh_statename(nowstate)); } -#endif +#else (void)data; +#endif sshc->state = nowstate; } @@ -887,7 +890,7 @@ static int myssh_in_S_STARTUP(struct Curl_easy *data, myssh_block2waitfor(conn, sshc, (rc == SSH_AGAIN)); if(rc == SSH_AGAIN) { - DEBUGF(infof(data, "ssh_connect -> EAGAIN")); + CURL_TRC_SSH(data, "connect -> EAGAIN"); } else if(rc != SSH_OK) { failf(data, "Failure establishing ssh session"); @@ -1259,10 +1262,6 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data, /* not set by Curl_xfer_setup to preserve keepon bits */ data->conn->recv_idx = FIRSTSOCKET; - /* store this original bitmask setup to use later on if we cannot - figure out a "real" bitmask */ - sshc->orig_waitfor = data->req.keepon; - /* since we do not really wait for anything at this point, we want the state machine to move on as soon as possible so we mark this as dirty */ Curl_multi_mark_dirty(data); @@ -1401,7 +1400,7 @@ static int myssh_in_SFTP_CLOSE(struct Curl_easy *data, } Curl_safefree(sshp->path); - DEBUGF(infof(data, "SFTP DONE done")); + CURL_TRC_SSH(data, "SFTP DONE done"); /* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT After nextstate is executed, the control should come back to @@ -1485,7 +1484,7 @@ static int myssh_in_SFTP_REALPATH(struct Curl_easy *data, we get the homedir here, we get the "workingpath" in the DO action since the homedir will remain the same between request but the working path will not. */ - DEBUGF(infof(data, "SSH CONNECT phase done")); + CURL_TRC_SSH(data, "CONNECT phase done"); myssh_to(data, sshc, SSH_STOP); return SSH_NO_ERROR; } @@ -2285,10 +2284,6 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, /* not set by Curl_xfer_setup to preserve keepon bits */ data->conn->recv_idx = FIRSTSOCKET; - /* store this original bitmask setup to use later on if we cannot - figure out a "real" bitmask */ - sshc->orig_waitfor = data->req.keepon; - myssh_to(data, sshc, SSH_STOP); break; @@ -2357,7 +2352,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, ssh_scp_free(sshc->scp_session); sshc->scp_session = NULL; } - DEBUGF(infof(data, "SCP DONE phase complete")); + CURL_TRC_SSH(data, "SCP DONE phase complete"); ssh_set_blocking(sshc->ssh_session, 0); @@ -2422,7 +2417,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, } if(!result && (sshc->state == SSH_STOP)) result = sshc->actualcode; - DEBUGF(infof(data, "SSH: myssh_statemach_act -> %d", result)); + CURL_TRC_SSH(data, "[%s] statemachine() -> %d, block=%d", + myssh_statename(sshc->state), result, *block); return result; } @@ -2432,33 +2428,45 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, static CURLcode myssh_pollset(struct Curl_easy *data, struct easy_pollset *ps) { - int flags = 0; struct connectdata *conn = data->conn; - if(conn->waitfor & KEEP_RECV) - flags |= CURL_POLL_IN; - if(conn->waitfor & KEEP_SEND) - flags |= CURL_POLL_OUT; - if(!conn->waitfor) - flags |= CURL_POLL_OUT; - return flags ? - Curl_pollset_change(data, ps, conn->sock[FIRSTSOCKET], flags, 0) : - CURLE_OK; + struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); + curl_socket_t sock = conn->sock[FIRSTSOCKET]; + int waitfor; + + if(!sshc || (sock == CURL_SOCKET_BAD)) + return CURLE_FAILED_INIT; + + waitfor = sshc->waitfor ? sshc->waitfor : data->req.keepon; + if(waitfor) { + int flags = 0; + if(waitfor & KEEP_RECV) + flags |= CURL_POLL_IN; + if(waitfor & KEEP_SEND) + flags |= CURL_POLL_OUT; + DEBUGASSERT(flags); + CURL_TRC_SSH(data, "pollset, flags=%x", flags); + return Curl_pollset_change(data, ps, sock, flags, 0); + } + /* While we still have a session, we listen incoming data. */ + if(sshc->ssh_session) + return Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0); + return CURLE_OK; } static void myssh_block2waitfor(struct connectdata *conn, struct ssh_conn *sshc, bool block) { + (void)conn; if(block) { int dir = ssh_get_poll_flags(sshc->ssh_session); /* translate the libssh define bits into our own bit defines */ - conn->waitfor = + sshc->waitfor = ((dir & SSH_READ_PENDING) ? KEEP_RECV : 0) | ((dir & SSH_WRITE_PENDING) ? KEEP_SEND : 0); } else - /* if it did not block, use the original set */ - conn->waitfor = sshc->orig_waitfor; + sshc->waitfor = 0; } /* called repeatedly until done from multi.c */ @@ -2584,6 +2592,7 @@ static CURLcode myssh_connect(struct Curl_easy *data, bool *done) if(!sshc || !ssh) return CURLE_FAILED_INIT; + CURL_TRC_SSH(data, "myssh_connect"); if(conn->handler->protocol & CURLPROTO_SCP) { conn->recv[FIRSTSOCKET] = scp_recv; conn->send[FIRSTSOCKET] = scp_send; @@ -2618,6 +2627,7 @@ static CURLcode myssh_connect(struct Curl_easy *data, bool *done) /* ignore */ } + CURL_TRC_SSH(data, "myssh_connect, set socket=%" FMT_SOCKET_T, sock); rc = ssh_options_set(sshc->ssh_session, SSH_OPTIONS_FD, &sock); if(rc != SSH_OK) { failf(data, "Could not set socket"); @@ -2691,7 +2701,7 @@ static CURLcode scp_doing(struct Curl_easy *data, bool *dophase_done) result = myssh_multi_statemach(data, dophase_done); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; } @@ -2712,7 +2722,7 @@ CURLcode scp_perform(struct Curl_easy *data, CURLcode result = CURLE_OK; struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); - DEBUGF(infof(data, "DO phase starts")); + CURL_TRC_SSH(data, "DO phase starts"); *dophase_done = FALSE; /* not done yet */ if(!sshc) @@ -2726,7 +2736,7 @@ CURLcode scp_perform(struct Curl_easy *data, *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; @@ -2959,7 +2969,7 @@ CURLcode sftp_perform(struct Curl_easy *data, struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); CURLcode result = CURLE_OK; - DEBUGF(infof(data, "DO phase starts")); + CURL_TRC_SSH(data, "DO phase starts"); *dophase_done = FALSE; /* not done yet */ if(!sshc) @@ -2974,7 +2984,7 @@ CURLcode sftp_perform(struct Curl_easy *data, *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; @@ -2986,7 +2996,7 @@ static CURLcode sftp_doing(struct Curl_easy *data, { CURLcode result = myssh_multi_statemach(data, dophase_done); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; } @@ -3003,7 +3013,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, CURLcode result = CURLE_OK; (void)dead_connection; - DEBUGF(infof(data, "SSH DISCONNECT starts now")); + CURL_TRC_SSH(data, "DISCONNECT starts now"); if(sshc && sshc->ssh_session) { /* only if there is a session still around to use! */ @@ -3011,7 +3021,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, result = myssh_block_statemach(data, sshc, sshp, TRUE); } - DEBUGF(infof(data, "SSH DISCONNECT is done")); + CURL_TRC_SSH(data, "DISCONNECT is done"); return result; } diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 4ac9d89f1ad5..31ef5092d3da 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -280,17 +280,10 @@ static LIBSSH2_FREE_FUNC(my_libssh2_free) Curl_cfree(ptr); } -/* - * SSH State machine related code - */ -/* This is the ONLY way to change SSH state! */ -static void myssh_state(struct Curl_easy *data, - struct ssh_conn *sshc, - sshstate nowstate) +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) +static const char *myssh_statename(sshstate state) { -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - /* for debug purposes */ - static const char * const names[] = { + static const char *const names[] = { "SSH_STOP", "SSH_INIT", "SSH_S_STARTUP", @@ -352,16 +345,34 @@ static void myssh_state(struct Curl_easy *data, "SSH_SESSION_FREE", "QUIT" }; - /* a precaution to make sure the lists are in sync */ DEBUGASSERT(CURL_ARRAYSIZE(names) == SSH_LAST); + return ((size_t)state < CURL_ARRAYSIZE(names)) ? names[state] : ""; +} +#else +#define myssh_statename(x) "" +#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ + +#define myssh_state(x,y,z) myssh_set_state(x,y,z) + +/* + * SSH State machine related code + */ +/* This is the ONLY way to change SSH state! */ +static void myssh_set_state(struct Curl_easy *data, + struct ssh_conn *sshc, + sshstate nowstate) +{ +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) if(sshc->state != nowstate) { - infof(data, "SFTP %p state change from %s to %s", - (void *)sshc, names[sshc->state], names[nowstate]); + CURL_TRC_SSH(data, "[%s] -> [%s]", + myssh_statename(sshc->state), + myssh_statename(nowstate)); } -#endif +#else (void)data; +#endif sshc->state = nowstate; } @@ -1172,10 +1183,6 @@ sftp_upload_init(struct Curl_easy *data, /* not set by Curl_xfer_setup to preserve keepon bits */ data->conn->recv_idx = FIRSTSOCKET; - /* store this original bitmask setup to use later on if we cannot - figure out a "real" bitmask */ - sshc->orig_waitfor = data->req.keepon; - /* since we do not really wait for anything at this point, we want the state machine to move on as soon as possible so mark this as dirty */ Curl_multi_mark_dirty(data); @@ -1951,8 +1958,7 @@ static CURLcode ssh_state_sftp_realpath(struct Curl_easy *data, /* in this case, the error was not in the SFTP level but for example a time-out or similar */ result = CURLE_SSH; - DEBUGF(infof(data, "error = %lu makes libcurl = %d", - sftperr, (int)result)); + CURL_TRC_SSH(data, "error = %lu makes libcurl = %d", sftperr, (int)result); return result; } @@ -1960,7 +1966,7 @@ static CURLcode ssh_state_sftp_realpath(struct Curl_easy *data, get the homedir here, we get the "workingpath" in the DO action since the homedir will remain the same between request but the working path will not. */ - DEBUGF(infof(data, "SSH CONNECT phase done")); + CURL_TRC_SSH(data, "CONNECT phase done"); return CURLE_OK; } @@ -2418,7 +2424,7 @@ static CURLcode ssh_state_sftp_close(struct Curl_easy *data, Curl_safefree(sshp->path); - DEBUGF(infof(data, "SFTP DONE done")); + CURL_TRC_SSH(data, "SFTP DONE done"); /* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT After nextstate is executed, the control should come back to @@ -2542,10 +2548,6 @@ static CURLcode ssh_state_scp_upload_init(struct Curl_easy *data, /* not set by Curl_xfer_setup to preserve keepon bits */ data->conn->recv_idx = FIRSTSOCKET; - /* store this original bitmask setup to use later on if we cannot - figure out a "real" bitmask */ - sshc->orig_waitfor = data->req.keepon; - myssh_state(data, sshc, SSH_STOP); return CURLE_OK; @@ -3008,7 +3010,7 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, } sshc->ssh_channel = NULL; } - DEBUGF(infof(data, "SCP DONE phase complete")); + CURL_TRC_SSH(data, "SCP DONE phase complete"); myssh_state(data, sshc, SSH_STOP); break; @@ -3042,6 +3044,8 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, *block = TRUE; result = CURLE_OK; } + CURL_TRC_SSH(data, "[%s] statemachine() -> %d, block=%d", + myssh_statename(sshc->state), result, *block); return result; } @@ -3051,15 +3055,29 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, static CURLcode ssh_pollset(struct Curl_easy *data, struct easy_pollset *ps) { - int flags = 0; struct connectdata *conn = data->conn; - if(conn->waitfor & KEEP_RECV) - flags |= CURL_POLL_IN; - if(conn->waitfor & KEEP_SEND) - flags |= CURL_POLL_OUT; - return flags ? - Curl_pollset_change(data, ps, conn->sock[FIRSTSOCKET], flags, 0) : - CURLE_OK; + struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); + curl_socket_t sock = conn->sock[FIRSTSOCKET]; + int waitfor; + + if(!sshc || (sock == CURL_SOCKET_BAD)) + return CURLE_FAILED_INIT; + + waitfor = sshc->waitfor ? sshc->waitfor : data->req.keepon; + if(waitfor) { + int flags = 0; + if(waitfor & KEEP_RECV) + flags |= CURL_POLL_IN; + if(waitfor & KEEP_SEND) + flags |= CURL_POLL_OUT; + DEBUGASSERT(flags); + CURL_TRC_SSH(data, "pollset, flags=%x", flags); + return Curl_pollset_change(data, ps, sock, flags, 0); + } + /* While we still have a session, we listen incoming data. */ + if(sshc->ssh_session) + return Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0); + return CURLE_OK; } /* @@ -3073,20 +3091,18 @@ static void ssh_block2waitfor(struct Curl_easy *data, struct ssh_conn *sshc, bool block) { - struct connectdata *conn = data->conn; int dir = 0; + (void)data; if(block) { dir = libssh2_session_block_directions(sshc->ssh_session); if(dir) { /* translate the libssh2 define bits into our own bit defines */ - conn->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND) ? KEEP_RECV : 0) | + sshc->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND) ? KEEP_RECV : 0) | ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND) ? KEEP_SEND : 0); } } if(!dir) - /* It did not block or libssh2 did not reveal in which direction, put back - the original set */ - conn->waitfor = sshc->orig_waitfor; + sshc->waitfor = 0; } /* called repeatedly until done from multi.c */ @@ -3468,7 +3484,7 @@ CURLcode scp_perform(struct Curl_easy *data, struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); CURLcode result = CURLE_OK; - DEBUGF(infof(data, "DO phase starts")); + CURL_TRC_SSH(data, "DO phase starts"); *dophase_done = FALSE; /* not done yet */ if(!sshc) @@ -3483,7 +3499,7 @@ CURLcode scp_perform(struct Curl_easy *data, *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; @@ -3497,7 +3513,7 @@ static CURLcode scp_doing(struct Curl_easy *data, result = ssh_multi_statemach(data, dophase_done); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; } @@ -3778,7 +3794,7 @@ CURLcode sftp_perform(struct Curl_easy *data, struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); CURLcode result = CURLE_OK; - DEBUGF(infof(data, "DO phase starts")); + CURL_TRC_SSH(data, "DO phase starts"); *dophase_done = FALSE; /* not done yet */ if(!sshc) @@ -3793,7 +3809,7 @@ CURLcode sftp_perform(struct Curl_easy *data, *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; @@ -3806,7 +3822,7 @@ static CURLcode sftp_doing(struct Curl_easy *data, CURLcode result = ssh_multi_statemach(data, dophase_done); if(*dophase_done) { - DEBUGF(infof(data, "DO phase is complete")); + CURL_TRC_SSH(data, "DO phase is complete"); } return result; } @@ -3825,10 +3841,10 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, if(sshc) { if(sshc->ssh_session) { /* only if there is a session still around to use! */ - DEBUGF(infof(data, "SSH DISCONNECT starts now")); + CURL_TRC_SSH(data, "DISCONNECT starts now"); myssh_state(data, sshc, SSH_SFTP_SHUTDOWN); result = ssh_block_statemach(data, sshc, sshp, TRUE); - DEBUGF(infof(data, "SSH DISCONNECT is done -> %d", result)); + CURL_TRC_SSH(data, "DISCONNECT is done -> %d", result); } sshc_cleanup(sshc, data, TRUE); } diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 5317351478fc..92ae72a6a761 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -156,7 +156,8 @@ struct ssh_conn { int secondCreateDirs; /* counter use by the code to see if the second attempt has been made to change to/create a directory */ - int orig_waitfor; /* default READ/WRITE bits wait for */ + int waitfor; /* KEEP_RECV/KEEP_SEND bits overriding + pollset given flags */ char *slash_pos; /* used by the SFTP_CREATE_DIRS state */ #ifdef USE_LIBSSH From b06cd929bd9bdda2fe4dfced73a60bd503be6155 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 28 Nov 2025 14:05:34 +0100 Subject: [PATCH 579/885] libssh: fix state machine loop to progress as it should --- lib/vssh/libssh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 2b605e4a6184..d0f3d3de5cca 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -2408,7 +2408,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, break; } - } while(!rc && (sshc->state != SSH_STOP)); + /* break the loop only on STOP or SSH_AGAIN. If `rc` is some + * other error code, we will have progressed the state accordingly. */ + } while((rc != SSH_AGAIN) && (sshc->state != SSH_STOP)); if(rc == SSH_AGAIN) { /* we would block, we need to wait for the socket to be ready (in the From 8c68887d2d145b00a912824cc6962d0d64cb8419 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 28 Nov 2025 10:25:59 +0100 Subject: [PATCH 580/885] http1: parse header from uint8_t buffer To save casting the passed buffer when parsing HTTP/1 request headers from an uint8_t buffer. Closes #19742 --- lib/http1.c | 10 +++++----- lib/http1.h | 2 +- lib/http2.c | 2 +- lib/vquic/curl_ngtcp2.c | 2 +- lib/vquic/curl_osslq.c | 2 +- lib/vquic/curl_quiche.c | 2 +- tests/unit/unit2603.c | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/http1.c b/lib/http1.c index 0a80fedfc722..657a674105fa 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -77,7 +77,7 @@ static CURLcode trim_line(struct h1_req_parser *parser, int options) } static CURLcode detect_line(struct h1_req_parser *parser, - const char *buf, const size_t buflen, + const uint8_t *buf, const size_t buflen, size_t *pnread) { const char *line_end; @@ -87,14 +87,14 @@ static CURLcode detect_line(struct h1_req_parser *parser, line_end = memchr(buf, '\n', buflen); if(!line_end) return CURLE_AGAIN; - parser->line = buf; - parser->line_len = line_end - buf + 1; + parser->line = (const char *)buf; + parser->line_len = line_end - parser->line + 1; *pnread = parser->line_len; return CURLE_OK; } static CURLcode next_line(struct h1_req_parser *parser, - const char *buf, const size_t buflen, int options, + const uint8_t *buf, const size_t buflen, int options, size_t *pnread) { CURLcode result; @@ -262,7 +262,7 @@ static CURLcode start_req(struct h1_req_parser *parser, } CURLcode Curl_h1_req_parse_read(struct h1_req_parser *parser, - const char *buf, size_t buflen, + const uint8_t *buf, size_t buflen, const char *scheme_default, const char *custom_method, int options, size_t *pnread) diff --git a/lib/http1.h b/lib/http1.h index 944e9038dd98..88bd99798e05 100644 --- a/lib/http1.h +++ b/lib/http1.h @@ -49,7 +49,7 @@ void Curl_h1_req_parse_init(struct h1_req_parser *parser, size_t max_line_len); void Curl_h1_req_parse_free(struct h1_req_parser *parser); CURLcode Curl_h1_req_parse_read(struct h1_req_parser *parser, - const char *buf, size_t buflen, + const uint8_t *buf, size_t buflen, const char *scheme_default, const char *custom_method, int options, size_t *pnread); diff --git a/lib/http2.c b/lib/http2.c index baaefd439d4f..e75d7431e72c 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2277,7 +2277,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, if(result) goto out; - result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL, + result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, &nwritten); diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 4767780a922d..62255285b6a0 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1548,7 +1548,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, goto out; } - result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL, + result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, pnwritten); diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 1c3f0c55b66e..7bca97b4086d 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1900,7 +1900,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, goto out; } - result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL, + result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, pnwritten); diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index c182e1490d23..5aca750c2cb9 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -976,7 +976,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, DEBUGASSERT(stream); - result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, blen, NULL, + result = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, !data->state.http_ignorecustom ? data->set.str[STRING_CUSTOMREQUEST] : NULL, 0, pnwritten); diff --git a/tests/unit/unit2603.c b/tests/unit/unit2603.c index 61295de37e1d..1de774d26f8b 100644 --- a/tests/unit/unit2603.c +++ b/tests/unit/unit2603.c @@ -63,7 +63,7 @@ struct tcase { static void parse_success(const struct tcase *t) { struct h1_req_parser p; - const char *buf; + const uint8_t *buf; size_t buflen, i, in_len, in_consumed; CURLcode err; size_t nread; @@ -71,8 +71,8 @@ static void parse_success(const struct tcase *t) Curl_h1_req_parse_init(&p, 1024); in_len = in_consumed = 0; for(i = 0; t->input[i]; ++i) { - buf = t->input[i]; - buflen = strlen(buf); + buf = (const uint8_t *)t->input[i]; + buflen = strlen(t->input[i]); in_len += buflen; err = Curl_h1_req_parse_read(&p, buf, buflen, t->default_scheme, t->custom_method, 0, &nread); From 38961528434e6efdd4c1fba19e67ae0f0585007c Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 28 Nov 2025 10:44:05 +0100 Subject: [PATCH 581/885] connection: give send methods/prototypes an uint8_t buffer To conclude changing the send buffer type from `const void *` to `const uint8_t *`, change the top level send function and its implementations. Closes #19743 --- lib/cfilters.c | 2 +- lib/cfilters.h | 2 +- lib/curl_rtmp.c | 2 +- lib/urldata.h | 2 +- lib/vssh/libssh.c | 4 ++-- lib/vssh/libssh2.c | 9 +++++---- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index 7d1f0c3d9e4f..dd4cb5210acc 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -242,7 +242,7 @@ CURLcode Curl_cf_recv(struct Curl_easy *data, int num, char *buf, } CURLcode Curl_cf_send(struct Curl_easy *data, int num, - const void *mem, size_t len, bool eos, + const uint8_t *mem, size_t len, bool eos, size_t *pnwritten) { struct Curl_cfilter *cf; diff --git a/lib/cfilters.h b/lib/cfilters.h index 5d39725088ed..a3bd97a9f166 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -508,7 +508,7 @@ CURLcode Curl_cf_recv(struct Curl_easy *data, int sockindex, char *buf, * in `*pnwritten` or on error. */ CURLcode Curl_cf_send(struct Curl_easy *data, int sockindex, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten); /** diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 351c9f494c3f..b2dd937008a5 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -352,7 +352,7 @@ static CURLcode rtmp_recv(struct Curl_easy *data, int sockindex, char *buf, } static CURLcode rtmp_send(struct Curl_easy *data, int sockindex, - const void *buf, size_t len, bool eos, + const uint8_t *buf, size_t len, bool eos, size_t *pnwritten) { struct connectdata *conn = data->conn; diff --git a/lib/urldata.h b/lib/urldata.h index 2d28718181a9..561db56ecd8a 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -162,7 +162,7 @@ typedef unsigned int curl_prot_t; /* On error return, the value of `pnwritten` has no meaning */ typedef CURLcode (Curl_send)(struct Curl_easy *data, /* transfer */ int sockindex, /* socketindex */ - const void *buf, /* data to write */ + const uint8_t *buf, /* data to write */ size_t len, /* amount to send */ bool eos, /* last chunk */ size_t *pnwritten); /* how much sent */ diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index d0f3d3de5cca..db80bcbf8c96 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -2887,7 +2887,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, } static CURLcode scp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, bool eos, + const uint8_t *mem, size_t len, bool eos, size_t *pnwritten) { int rc; @@ -3048,7 +3048,7 @@ static CURLcode sftp_done(struct Curl_easy *data, CURLcode status, /* return number of sent bytes */ static CURLcode sftp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, bool eos, + const uint8_t *mem, size_t len, bool eos, size_t *pnwritten) { struct connectdata *conn = data->conn; diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 31ef5092d3da..ce593d54874a 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3715,7 +3715,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, } static CURLcode scp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, bool eos, + const uint8_t *mem, size_t len, bool eos, size_t *pnwritten) { struct connectdata *conn = data->conn; @@ -3731,7 +3731,8 @@ static CURLcode scp_send(struct Curl_easy *data, int sockindex, return CURLE_FAILED_INIT; /* libssh2_channel_write() returns int! */ - nwritten = (ssize_t) libssh2_channel_write(sshc->ssh_channel, mem, len); + nwritten = (ssize_t) libssh2_channel_write(sshc->ssh_channel, + (const char *)mem, len); ssh_block2waitfor(data, sshc, (nwritten == LIBSSH2_ERROR_EAGAIN)); @@ -3874,7 +3875,7 @@ static CURLcode sftp_done(struct Curl_easy *data, CURLcode status, /* return number of sent bytes */ static CURLcode sftp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, bool eos, + const uint8_t *mem, size_t len, bool eos, size_t *pnwritten) { struct connectdata *conn = data->conn; @@ -3888,7 +3889,7 @@ static CURLcode sftp_send(struct Curl_easy *data, int sockindex, if(!sshc) return CURLE_FAILED_INIT; - nwrite = libssh2_sftp_write(sshc->sftp_handle, mem, len); + nwrite = libssh2_sftp_write(sshc->sftp_handle, (const char *)mem, len); ssh_block2waitfor(data, sshc, (nwrite == LIBSSH2_ERROR_EAGAIN)); From 02aa75a8c240af1a8912145497806e8925859a87 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 28 Nov 2025 17:41:59 +0100 Subject: [PATCH 582/885] runtests: allow a test to switch off memdebug Test 3207 now uses this as its multi-threading is not fully memdebug compliant. Closes #19752 --- docs/tests/FILEFORMAT.md | 5 ++++- lib/memdebug.c | 2 -- tests/data/test3207 | 2 +- tests/runner.pm | 11 +++++++++++ tests/runtests.pl | 6 ++++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 7851e08e2597..1f3aa78991b8 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -586,7 +586,7 @@ command has been run. If the variable name has no assignment, no `=`, then that variable is just deleted. -### `` +### `` Command line to run. If the command spans multiple lines, they are concatenated with a space added @@ -608,6 +608,9 @@ otherwise written to verify stdout. Set `option="no-include"` to prevent the test script to slap on the `--include` argument. +Set `option="no-memdebug"` to make the test run without the memdebug tracking +system. For tests that are incompatible - multi-threaded for example. + Set `option="no-q"` avoid using `-q` as the first argument in the curl command line. diff --git a/lib/memdebug.c b/lib/memdebug.c index f5b88731ee35..9fd54d026b69 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -111,8 +111,6 @@ void curl_dbg_memdebug(const char *logname) if(!curl_dbg_logfile) { if(logname && *logname) curl_dbg_logfile = CURLX_FOPEN_LOW(logname, FOPEN_WRITETEXT); - else - curl_dbg_logfile = stderr; #ifdef MEMDEBUG_LOG_SYNC /* Flush the log file after every line so the log is not lost in a crash */ if(curl_dbg_logfile) diff --git a/tests/data/test3207 b/tests/data/test3207 index 4806ef5474d6..9aa3ee5a365f 100644 --- a/tests/data/test3207 +++ b/tests/data/test3207 @@ -37,7 +37,7 @@ concurrent HTTPS GET using shared ssl session cache lib%TESTNUMBER # provide URL and ca-cert - + https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt diff --git a/tests/runner.pm b/tests/runner.pm index a73f9d599934..b69bbf2420aa 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -840,6 +840,7 @@ sub singletest_run { $tool = $tool_name . exe_ext('TOOL'); } + my $oldmemdebug; my $disablevalgrind; my $CMDLINE=""; my $cmdargs; @@ -1025,6 +1026,11 @@ sub singletest_run { # timestamp starting of test command $$testtimings{"timetoolini"} = Time::HiRes::time(); + if($cmdhash{'option'} && ($cmdhash{'option'} =~ /no-memdebug/)) { + $oldmemdebug = $ENV{'CURL_MEMDEBUG'}; + delete $ENV{'CURL_MEMDEBUG'}; + } + # run the command line we built if($torture) { $cmdres = torture($CMDLINE, @@ -1048,6 +1054,11 @@ sub singletest_run { ($cmdres, $dumped_core) = normalize_cmdres(runclient("$CMDLINE")); } + # restore contents + if($oldmemdebug) { + $ENV{'CURL_MEMDEBUG'} = $oldmemdebug; + } + # timestamp finishing of test command $$testtimings{"timetoolend"} = Time::HiRes::time(); diff --git a/tests/runtests.pl b/tests/runtests.pl index 3d557d1435ed..648666fd301e 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1763,8 +1763,10 @@ sub singletest_check { if(! -f "$logdir/$MEMDUMP") { my %cmdhash = getpartattr("client", "command"); my $cmdtype = $cmdhash{'type'} || "default"; - logmsg "\n** ALERT! memory tracking with no output file?\n" - if($cmdtype ne "perl"); + if($cmdhash{'option'} !~ /no-memdebug/) { + logmsg "\n** ALERT! memory tracking with no output file?\n" + if($cmdtype ne "perl"); + } $ok .= "-"; # problem with memory checking } else { From 4be6707910192681c5cb52e7d9eb6c0947b28600 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Nov 2025 17:39:04 +0100 Subject: [PATCH 583/885] curlx/multibyte: stop setting macros for non-Windows These macros are not used for non-Windows. Drop them with the unused mappings to standard allocators. Closes #19751 --- lib/curlx/multibyte.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index c992214a9575..fac07c2eeb24 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -26,10 +26,6 @@ #include "../curl_setup.h" #ifdef _WIN32 -/* MultiByte conversions using Windows kernel32 library. */ -wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); -char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); -#endif /* * Macros curlx_convert_UTF8_to_tchar(), curlx_convert_tchar_to_UTF8() @@ -48,7 +44,14 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); * memory tracker memdebug functions. */ -#if defined(UNICODE) && defined(_WIN32) +/* MultiByte conversions using Windows kernel32 library. */ +wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); +char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); + +/* the purpose of this macro is to free() without being traced by memdebug */ +#define curlx_unicodefree(ptr) free(ptr) + +#ifdef UNICODE #define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) #define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) @@ -60,15 +63,10 @@ typedef union { const unsigned short *const_tbyte_ptr; } xcharp_u; -#else +#else /* !UNICODE */ -#ifdef _WIN32 #define curlx_convert_UTF8_to_tchar(ptr) _strdup(ptr) #define curlx_convert_tchar_to_UTF8(ptr) _strdup(ptr) -#else -#define curlx_convert_UTF8_to_tchar(ptr) strdup(ptr) -#define curlx_convert_tchar_to_UTF8(ptr) strdup(ptr) -#endif typedef union { char *tchar_ptr; @@ -77,9 +75,7 @@ typedef union { const unsigned char *const_tbyte_ptr; } xcharp_u; -#endif /* UNICODE && _WIN32 */ - -/* the purpose of this macro is to free() without being traced by memdebug */ -#define curlx_unicodefree(ptr) free(ptr) +#endif /* UNICODE */ +#endif /* _WIN32 */ #endif /* HEADER_CURL_MULTIBYTE_H */ From d73efc62c15f2d2a3da4b27b90825975298e5c88 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Nov 2025 21:17:58 +0100 Subject: [PATCH 584/885] tests: fix formatting nits Also: - lib1948: fix checksrc error TYPEDEFSTRUCT. (detected after formatting) Closes #19754 --- .../http/testenv/mod_curltest/mod_curltest.c | 29 +- tests/libtest/cli_h2_pausing.c | 7 +- tests/libtest/cli_h2_upgrade_extreme.c | 2 +- tests/libtest/cli_hx_download.c | 6 +- tests/libtest/cli_hx_upload.c | 3 +- tests/libtest/cli_tls_session_reuse.c | 6 +- tests/libtest/cli_upload_pausing.c | 2 +- tests/libtest/cli_ws_data.c | 9 +- tests/libtest/first.c | 3 +- tests/libtest/first.h | 2 +- tests/libtest/lib1156.c | 18 +- tests/libtest/lib1308.c | 2 +- tests/libtest/lib1514.c | 2 +- tests/libtest/lib1517.c | 1 - tests/libtest/lib1520.c | 2 +- tests/libtest/lib1522.c | 2 +- tests/libtest/lib1523.c | 2 +- tests/libtest/lib1525.c | 2 +- tests/libtest/lib1526.c | 2 +- tests/libtest/lib1527.c | 2 +- tests/libtest/lib1533.c | 1 - tests/libtest/lib1534.c | 8 +- tests/libtest/lib1535.c | 8 +- tests/libtest/lib1536.c | 8 +- tests/libtest/lib1559.c | 4 +- tests/libtest/lib1560.c | 4 +- tests/libtest/lib1597.c | 2 +- tests/libtest/lib1662.c | 2 +- tests/libtest/lib1915.c | 3 +- tests/libtest/lib1919.c | 4 +- tests/libtest/lib1940.c | 2 +- tests/libtest/lib1945.c | 4 +- tests/libtest/lib1947.c | 6 +- tests/libtest/lib1948.c | 9 +- tests/libtest/lib1960.c | 8 +- tests/libtest/lib1977.c | 3 - tests/libtest/lib2023.c | 2 +- tests/libtest/lib2032.c | 6 +- tests/libtest/lib2402.c | 6 +- tests/libtest/lib2404.c | 6 +- tests/libtest/lib2405.c | 7 +- tests/libtest/lib2502.c | 6 +- tests/libtest/lib2700.c | 3 +- tests/libtest/lib3033.c | 3 +- tests/libtest/lib3102.c | 10 +- tests/libtest/lib3207.c | 6 +- tests/libtest/lib505.c | 3 +- tests/libtest/lib506.c | 92 +++--- tests/libtest/lib508.c | 2 +- tests/libtest/lib509.c | 1 - tests/libtest/lib510.c | 4 +- tests/libtest/lib526.c | 1 - tests/libtest/lib530.c | 2 +- tests/libtest/lib536.c | 3 +- tests/libtest/lib537.c | 2 +- tests/libtest/lib540.c | 4 +- tests/libtest/lib547.c | 2 +- tests/libtest/lib552.c | 8 +- tests/libtest/lib554.c | 2 +- tests/libtest/lib555.c | 2 +- tests/libtest/lib557.c | 43 +-- tests/libtest/lib568.c | 2 +- tests/libtest/lib570.c | 2 +- tests/libtest/lib572.c | 2 +- tests/libtest/lib573.c | 2 +- tests/libtest/lib574.c | 3 +- tests/libtest/lib579.c | 2 +- tests/libtest/lib582.c | 2 +- tests/libtest/lib586.c | 75 +++-- tests/libtest/lib591.c | 4 +- tests/libtest/lib597.c | 6 +- tests/libtest/lib643.c | 17 +- tests/libtest/lib650.c | 7 +- tests/libtest/lib651.c | 6 +- tests/libtest/lib652.c | 2 +- tests/libtest/lib654.c | 6 +- tests/libtest/lib666.c | 2 +- tests/libtest/lib667.c | 7 +- tests/libtest/lib668.c | 8 +- tests/libtest/lib670.c | 8 +- tests/libtest/lib678.c | 5 +- tests/libtest/lib758.c | 8 +- tests/server/dnsd.c | 17 +- tests/server/getpart.c | 17 +- tests/server/mqttd.c | 17 +- tests/server/resolve.c | 4 +- tests/server/rtspd.c | 46 ++- tests/server/sockfilt.c | 294 +++++++++--------- tests/server/socksd.c | 15 +- tests/server/sws.c | 67 ++-- tests/server/tftpd.c | 20 +- tests/server/util.c | 55 ++-- tests/unit/unit1300.c | 2 +- tests/unit/unit1302.c | 4 +- tests/unit/unit1304.c | 33 +- tests/unit/unit1307.c | 2 +- tests/unit/unit1309.c | 12 +- tests/unit/unit1397.c | 2 +- tests/unit/unit1398.c | 20 +- tests/unit/unit1601.c | 2 +- tests/unit/unit1606.c | 18 +- tests/unit/unit1610.c | 4 +- tests/unit/unit1611.c | 4 +- tests/unit/unit1612.c | 8 +- tests/unit/unit1614.c | 14 +- tests/unit/unit1615.c | 14 +- tests/unit/unit1620.c | 3 +- tests/unit/unit1650.c | 16 +- tests/unit/unit1651.c | 4 +- tests/unit/unit1655.c | 2 +- tests/unit/unit1656.c | 2 +- tests/unit/unit1657.c | 2 +- tests/unit/unit1660.c | 2 +- tests/unit/unit1661.c | 2 +- tests/unit/unit1663.c | 11 +- tests/unit/unit2600.c | 6 +- tests/unit/unit2601.c | 10 +- tests/unit/unit2602.c | 12 +- tests/unit/unit3200.c | 124 ++++---- tests/unit/unit3205.c | 4 +- tests/unit/unit3211.c | 4 +- tests/unit/unit3213.c | 2 +- tests/unit/unit3216.c | 2 +- 123 files changed, 680 insertions(+), 801 deletions(-) diff --git a/tests/http/testenv/mod_curltest/mod_curltest.c b/tests/http/testenv/mod_curltest/mod_curltest.c index cb236557e0a5..b45fd95286b2 100644 --- a/tests/http/testenv/mod_curltest/mod_curltest.c +++ b/tests/http/testenv/mod_curltest/mod_curltest.c @@ -62,7 +62,8 @@ static int curltest_post_config(apr_pool_t *p, apr_pool_t *plog, void *data = NULL; const char *key = "mod_curltest_init_counter"; - (void)plog;(void)ptemp; + (void)plog; + (void)ptemp; apr_pool_userdata_get(&data, key, s->process->pool); if(!data) { @@ -93,8 +94,8 @@ static void curltest_hooks(apr_pool_t *pool) ap_hook_handler(curltest_sslinfo_handler, NULL, NULL, APR_HOOK_MIDDLE); } -#define SECS_PER_HOUR (60*60) -#define SECS_PER_DAY (24*SECS_PER_HOUR) +#define SECS_PER_HOUR (60 * 60) +#define SECS_PER_DAY (24 * SECS_PER_HOUR) static apr_status_t duration_parse(apr_interval_time_t *ptimeout, const char *value, const char *def_unit) @@ -124,12 +125,12 @@ static apr_status_t duration_parse(apr_interval_time_t *ptimeout, break; case 's': case 'S': - *ptimeout = (apr_interval_time_t) apr_time_from_sec(n); + *ptimeout = (apr_interval_time_t)apr_time_from_sec(n); break; case 'h': case 'H': /* Time is in hours */ - *ptimeout = (apr_interval_time_t) apr_time_from_sec(n * SECS_PER_HOUR); + *ptimeout = (apr_interval_time_t)apr_time_from_sec(n * SECS_PER_HOUR); break; case 'm': case 'M': @@ -137,12 +138,12 @@ static apr_status_t duration_parse(apr_interval_time_t *ptimeout, /* Time is in milliseconds */ case 's': case 'S': - *ptimeout = (apr_interval_time_t) n * 1000; + *ptimeout = (apr_interval_time_t)n * 1000; break; /* Time is in minutes */ case 'i': case 'I': - *ptimeout = (apr_interval_time_t) apr_time_from_sec(n * 60); + *ptimeout = (apr_interval_time_t)apr_time_from_sec(n * 60); break; default: return APR_EGENERAL; @@ -154,7 +155,7 @@ static apr_status_t duration_parse(apr_interval_time_t *ptimeout, /* Time is in microseconds */ case 's': case 'S': - *ptimeout = (apr_interval_time_t) n; + *ptimeout = (apr_interval_time_t)n; break; default: return APR_EGENERAL; @@ -266,8 +267,7 @@ static int curltest_echo_handler(request_rec *r) apr_table_get(r->headers_in, "TE")); if(read_delay) { - ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, - "put_handler: read_delay"); + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "put_handler: read_delay"); apr_sleep(read_delay); } @@ -343,7 +343,7 @@ static int curltest_tweak_handler(request_rec *r) apr_bucket_brigade *bb; apr_bucket *b; apr_status_t rv; - char buffer[16*1024]; + char buffer[16 * 1024]; int i, chunks = 3, error_bucket = 1; size_t chunk_size = sizeof(buffer); const char *request_id = "none"; @@ -579,7 +579,7 @@ static int curltest_put_handler(request_rec *r) apr_bucket_brigade *bb; apr_bucket *b; apr_status_t rv; - char buffer[128*1024]; + char buffer[128 * 1024]; const char *ct; apr_off_t rbody_len = 0; apr_off_t rbody_max_len = -1; @@ -650,8 +650,7 @@ static int curltest_put_handler(request_rec *r) ap_set_content_type(r, ct ? ct : "text/plain"); if(read_delay) { - ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, - "put_handler: read_delay"); + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "put_handler: read_delay"); apr_sleep(read_delay); } bb = apr_brigade_create(r->pool, c->bucket_alloc); @@ -674,7 +673,7 @@ static int curltest_put_handler(request_rec *r) } } /* we are done */ - s_rbody_len = apr_psprintf(r->pool, "%"APR_OFF_T_FMT, rbody_len); + s_rbody_len = apr_psprintf(r->pool, "%" APR_OFF_T_FMT, rbody_len); apr_table_setn(r->headers_out, "Received-Length", s_rbody_len); rv = apr_brigade_puts(bb, NULL, NULL, s_rbody_len); if(APR_SUCCESS != rv) diff --git a/tests/libtest/cli_h2_pausing.c b/tests/libtest/cli_h2_pausing.c index 25b798af4b2b..30bcfcf043a6 100644 --- a/tests/libtest/cli_h2_pausing.c +++ b/tests/libtest/cli_h2_pausing.c @@ -38,8 +38,7 @@ static void usage_h2_pausing(const char *msg) ); } -struct handle -{ +struct handle { size_t idx; int paused; int resumed; @@ -51,7 +50,7 @@ struct handle static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) { size_t realsize = size * nmemb; - struct handle *handle = (struct handle *) clientp; + struct handle *handle = (struct handle *)clientp; curl_off_t totalsize; (void)data; @@ -163,7 +162,7 @@ static CURLcode test_cli_h2_pausing(const char *URL) goto cleanup; } memset(&resolve, 0, sizeof(resolve)); - curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", + curl_msnprintf(resolve_buf, sizeof(resolve_buf) - 1, "%s:%s:127.0.0.1", host, port); resolve = curl_slist_append(resolve, resolve_buf); diff --git a/tests/libtest/cli_h2_upgrade_extreme.c b/tests/libtest/cli_h2_upgrade_extreme.c index bc28a6f4d05e..8d5bf8d82ca6 100644 --- a/tests/libtest/cli_h2_upgrade_extreme.c +++ b/tests/libtest/cli_h2_upgrade_extreme.c @@ -120,7 +120,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL) curl_easy_getinfo(msg->easy_handle, CURLINFO_XFER_ID, &xfer_id); curl_easy_getinfo(msg->easy_handle, CURLINFO_RESPONSE_CODE, &status); if(msg->data.result == CURLE_SEND_ERROR || - msg->data.result == CURLE_RECV_ERROR) { + msg->data.result == CURLE_RECV_ERROR) { /* We get these if the server had a GOAWAY in transit on * reusing a connection */ } diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index a7f5d200903c..2a3614412369 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -88,7 +88,7 @@ static size_t my_write_d_cb(char *buf, size_t nitems, size_t buflen, "pause_at=%" CURL_FORMAT_CURL_OFF_T "\n", t->idx, blen, t->recv_size, t->pause_at); if(!t->out) { - curl_msnprintf(t->filename, sizeof(t->filename)-1, "download_%zu.data", + curl_msnprintf(t->filename, sizeof(t->filename) - 1, "download_%zu.data", t->idx); t->out = curlx_fopen(t->filename, "wb"); if(!t->out) @@ -149,7 +149,7 @@ static int my_progress_d_cb(void *userdata, switch(tls->backend) { #if defined(USE_QUICHE) || defined(USE_OPENSSL) case CURLSSLBACKEND_OPENSSL: { - const char *version = SSL_get_version((SSL*)tls->internals); + const char *version = SSL_get_version((SSL *)tls->internals); assert(version); assert(strcmp(version, "unknown")); curl_mfprintf(stderr, "[t-%zu] info OpenSSL using %s\n", @@ -159,7 +159,7 @@ static int my_progress_d_cb(void *userdata, #endif #ifdef USE_WOLFSSL case CURLSSLBACKEND_WOLFSSL: { - const char *version = wolfSSL_get_version((WOLFSSL*)tls->internals); + const char *version = wolfSSL_get_version((WOLFSSL *)tls->internals); assert(version); assert(strcmp(version, "unknown")); curl_mfprintf(stderr, "[t-%zu] info wolfSSL using %s\n", diff --git a/tests/libtest/cli_hx_upload.c b/tests/libtest/cli_hx_upload.c index f7036509fea2..1ffb7c243f94 100644 --- a/tests/libtest/cli_hx_upload.c +++ b/tests/libtest/cli_hx_upload.c @@ -72,7 +72,7 @@ static size_t my_write_u_cb(char *buf, size_t nitems, size_t buflen, "pause_at=%" CURL_FORMAT_CURL_OFF_T "\n", t->idx, blen, t->recv_size, t->pause_at); if(!t->out) { - curl_msnprintf(t->filename, sizeof(t->filename)-1, "download_%zu.data", + curl_msnprintf(t->filename, sizeof(t->filename) - 1, "download_%zu.data", t->idx); t->out = curlx_fopen(t->filename, "wb"); if(!t->out) @@ -462,7 +462,6 @@ static CURLcode test_cli_hx_upload(const char *URL) } } - /* nothing happening, maintenance */ if(abort_paused) { /* abort paused transfers */ diff --git a/tests/libtest/cli_tls_session_reuse.c b/tests/libtest/cli_tls_session_reuse.c index aa56a0e28c66..a0e5901e5539 100644 --- a/tests/libtest/cli_tls_session_reuse.c +++ b/tests/libtest/cli_tls_session_reuse.c @@ -83,7 +83,6 @@ static CURL *tse_add_transfer(CURLM *multi, CURLSH *share, if(resolve) curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve); - mc = curl_multi_add_handle(multi, curl); if(mc != CURLM_OK) { curl_mfprintf(stderr, "curl_multi_add_handle: %s\n", @@ -144,7 +143,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) goto cleanup; } - curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", + curl_msnprintf(resolve_buf, sizeof(resolve_buf) - 1, "%s:%s:127.0.0.1", host, port); resolve = curl_slist_append(resolve, resolve_buf); @@ -161,7 +160,6 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) } curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); - if(!tse_add_transfer(multi, share, resolve, URL, http_version)) goto cleanup; ++ongoing; @@ -205,7 +203,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL) curl_easy_getinfo(msg->easy_handle, CURLINFO_XFER_ID, &xfer_id); curl_easy_getinfo(msg->easy_handle, CURLINFO_RESPONSE_CODE, &status); if(msg->data.result == CURLE_SEND_ERROR || - msg->data.result == CURLE_RECV_ERROR) { + msg->data.result == CURLE_RECV_ERROR) { /* We get these if the server had a GOAWAY in transit on * reusing a connection */ } diff --git a/tests/libtest/cli_upload_pausing.c b/tests/libtest/cli_upload_pausing.c index 042eddd7d7dc..cb94bcf0a83f 100644 --- a/tests/libtest/cli_upload_pausing.c +++ b/tests/libtest/cli_upload_pausing.c @@ -154,7 +154,7 @@ static CURLcode test_cli_upload_pausing(const char *URL) goto cleanup; } memset(&resolve, 0, sizeof(resolve)); - curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", + curl_msnprintf(resolve_buf, sizeof(resolve_buf) - 1, "%s:%s:127.0.0.1", host, port); resolve = curl_slist_append(resolve, resolve_buf); diff --git a/tests/libtest/cli_ws_data.c b/tests/libtest/cli_ws_data.c index 2276f0c92ce1..35da27788683 100644 --- a/tests/libtest/cli_ws_data.c +++ b/tests/libtest/cli_ws_data.c @@ -27,10 +27,9 @@ #ifndef CURL_DISABLE_WEBSOCKETS -static CURLcode -test_ws_data_m2_check_recv(const struct curl_ws_frame *frame, - size_t r_offset, size_t nread, - size_t exp_len) +static CURLcode test_ws_data_m2_check_recv(const struct curl_ws_frame *frame, + size_t r_offset, size_t nread, + size_t exp_len) { if(!frame) return CURLE_OK; @@ -362,7 +361,6 @@ static CURLcode test_ws_data_m1_echo(const char *url, r = CURLE_RECV_ERROR; goto out; } - } curl_multi_remove_handle(multi, m1_ctx.curl); @@ -393,7 +391,6 @@ static CURLcode test_ws_data_m1_echo(const char *url, return r; } - static void test_ws_data_usage(const char *msg) { if(msg) diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 2f6553088211..e384971c7efc 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -62,7 +62,7 @@ int unitfail; /* for unittests */ int coptind; const char *coptarg; -int cgetopt(int argc, const char * const argv[], const char *optstring) +int cgetopt(int argc, const char *const argv[], const char *optstring) { static int optpos = 1; int coptopt; @@ -204,7 +204,6 @@ void ws_close(CURL *curl) } #endif /* CURL_DISABLE_WEBSOCKETS */ - int main(int argc, const char **argv) { const char *URL = ""; diff --git a/tests/libtest/first.h b/tests/libtest/first.h index f5cbc6023783..5fa587686b56 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -79,7 +79,7 @@ extern struct curltime tv_test_start; /* for test timing */ extern int coptind; extern const char *coptarg; -int cgetopt(int argc, const char * const argv[], const char *optstring); +int cgetopt(int argc, const char *const argv[], const char *optstring); extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc, struct timeval *tv); diff --git a/tests/libtest/lib1156.c b/tests/libtest/lib1156.c index 758f6e3f1ae9..1468b35e1cc7 100644 --- a/tests/libtest/lib1156.c +++ b/tests/libtest/lib1156.c @@ -96,27 +96,27 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p, test_setopt(curl, CURLOPT_VERBOSE, 1L); test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME) ? 3L : 0L); test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME) ? - "3-1000000": (char *)NULL); + "3-1000000" : (char *)NULL); test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL) ? 1L : 0L); hasbody = 0; res = curl_easy_perform(curl); if(res != p->res) { curl_mprintf("%zu: bad error code (%d): resume=%s, fail=%s, http416=%s, " "content-range=%s, expected=%d\n", num, res, - (p->flags & F_RESUME) ? "yes": "no", - (p->flags & F_FAIL) ? "yes": "no", - (p->flags & F_HTTP416) ? "yes": "no", - (p->flags & F_CONTENTRANGE) ? "yes": "no", + (p->flags & F_RESUME) ? "yes" : "no", + (p->flags & F_FAIL) ? "yes" : "no", + (p->flags & F_HTTP416) ? "yes" : "no", + (p->flags & F_CONTENTRANGE) ? "yes" : "no", p->res); return 1; } if(hasbody && (p->flags & F_IGNOREBODY)) { curl_mprintf("body should be ignored and is not: resume=%s, fail=%s, " "http416=%s, content-range=%s\n", - (p->flags & F_RESUME) ? "yes": "no", - (p->flags & F_FAIL) ? "yes": "no", - (p->flags & F_HTTP416) ? "yes": "no", - (p->flags & F_CONTENTRANGE) ? "yes": "no"); + (p->flags & F_RESUME) ? "yes" : "no", + (p->flags & F_FAIL) ? "yes" : "no", + (p->flags & F_HTTP416) ? "yes" : "no", + (p->flags & F_CONTENTRANGE) ? "yes" : "no"); return 1; } return 0; diff --git a/tests/libtest/lib1308.c b/tests/libtest/lib1308.c index 6f7b9c264eef..6a7e71d7923d 100644 --- a/tests/libtest/lib1308.c +++ b/tests/libtest/lib1308.c @@ -26,7 +26,7 @@ static size_t print_httppost_callback(void *arg, const char *buf, size_t len) { fwrite(buf, len, 1, stdout); - (*(size_t *) arg) += len; + (*(size_t *)arg) += len; return len; } diff --git a/tests/libtest/lib1514.c b/tests/libtest/lib1514.c index fa0aa0742439..0ae61d41e88e 100644 --- a/tests/libtest/lib1514.c +++ b/tests/libtest/lib1514.c @@ -37,7 +37,7 @@ static size_t t1514_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct t1514_WriteThis *pooh = (struct t1514_WriteThis *)userp; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; if(pooh->sizeleft) { diff --git a/tests/libtest/lib1517.c b/tests/libtest/lib1517.c index cebdeab0a1b4..ab18efe11314 100644 --- a/tests/libtest/lib1517.c +++ b/tests/libtest/lib1517.c @@ -98,7 +98,6 @@ static CURLcode test_lib1517(const char *URL) /* detect HTTP error codes >= 400 */ /* test_setopt(curl, CURLOPT_FAILONERROR, 1L); */ - /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); diff --git a/tests/libtest/lib1520.c b/tests/libtest/lib1520.c index 4cf54388eb1a..076ab564d016 100644 --- a/tests/libtest/lib1520.c +++ b/tests/libtest/lib1520.c @@ -46,7 +46,7 @@ static size_t t1520_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; - if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { + if((size == 0) || (nmemb == 0) || ((size * nmemb) < 1)) { return 0; } diff --git a/tests/libtest/lib1522.c b/tests/libtest/lib1522.c index 1ac2332e8121..e90b39bc5676 100644 --- a/tests/libtest/lib1522.c +++ b/tests/libtest/lib1522.c @@ -78,7 +78,7 @@ static CURLcode test_lib1522(const char *URL) curl_mprintf("uploadSize = %" CURL_FORMAT_CURL_OFF_T "\n", uploadSize); - if((size_t) uploadSize == sizeof(g_Data)) { + if((size_t)uploadSize == sizeof(g_Data)) { curl_mprintf("!!!!!!!!!! PASS\n"); } else { diff --git a/tests/libtest/lib1523.c b/tests/libtest/lib1523.c index 711aa3f7140f..23ec23d82305 100644 --- a/tests/libtest/lib1523.c +++ b/tests/libtest/lib1523.c @@ -41,7 +41,7 @@ static size_t t1523_write_cb(char *d, size_t n, size_t l, void *p) /* take care of the data here, ignored in this example */ (void)d; (void)p; - return n*l; + return n * l; } static CURLcode run(CURL *curl, long limit, long time) diff --git a/tests/libtest/lib1525.c b/tests/libtest/lib1525.c index c9a1e1514f80..66c18df21e40 100644 --- a/tests/libtest/lib1525.c +++ b/tests/libtest/lib1525.c @@ -34,7 +34,7 @@ static const char t1525_testdata[] = "Hello Cloud!\n"; static size_t t1525_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { - size_t amount = nmemb * size; /* Total bytes curl wants */ + size_t amount = nmemb * size; /* Total bytes curl wants */ if(amount < strlen(t1525_testdata)) { return strlen(t1525_testdata); } diff --git a/tests/libtest/lib1526.c b/tests/libtest/lib1526.c index 031f8bfd2746..400544b8e038 100644 --- a/tests/libtest/lib1526.c +++ b/tests/libtest/lib1526.c @@ -33,7 +33,7 @@ static const char t1526_testdata[] = "Hello Cloud!\n"; static size_t t1526_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { - size_t amount = nmemb * size; /* Total bytes curl wants */ + size_t amount = nmemb * size; /* Total bytes curl wants */ if(amount < strlen(t1526_testdata)) { return strlen(t1526_testdata); } diff --git a/tests/libtest/lib1527.c b/tests/libtest/lib1527.c index 1d9a5821324b..e55672a3c0cc 100644 --- a/tests/libtest/lib1527.c +++ b/tests/libtest/lib1527.c @@ -33,7 +33,7 @@ static const char t1527_testdata[] = "Hello Cloud!\n"; static size_t t1527_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { - size_t amount = nmemb * size; /* Total bytes curl wants */ + size_t amount = nmemb * size; /* Total bytes curl wants */ if(amount < strlen(t1527_testdata)) { return strlen(t1527_testdata); } diff --git a/tests/libtest/lib1533.c b/tests/libtest/lib1533.c index a2d541c4124f..b859ee36649c 100644 --- a/tests/libtest/lib1533.c +++ b/tests/libtest/lib1533.c @@ -119,7 +119,6 @@ static CURLcode perform_and_check_connections(CURL *curl, return TEST_ERR_SUCCESS; } - static CURLcode test_lib1533(const char *URL) { struct cb_data data; diff --git a/tests/libtest/lib1534.c b/tests/libtest/lib1534.c index 377df3b2fe19..94a02c2986b1 100644 --- a/tests/libtest/lib1534.c +++ b/tests/libtest/lib1534.c @@ -36,7 +36,7 @@ static CURLcode test_lib1534(const char *URL) easy_init(curl); /* Test that a filetime is properly initialized on curl_easy_init. - */ + */ res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); if(res) { @@ -65,7 +65,7 @@ static CURLcode test_lib1534(const char *URL) } /* Test that a filetime is properly set after receiving an HTTP resource. - */ + */ res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); if(res) { @@ -83,7 +83,7 @@ static CURLcode test_lib1534(const char *URL) } /* Test that a filetime is properly initialized on curl_easy_duphandle. - */ + */ dupe = curl_easy_duphandle(curl); if(!dupe) { @@ -109,7 +109,7 @@ static CURLcode test_lib1534(const char *URL) } /* Test that a filetime is properly initialized on curl_easy_reset. - */ + */ curl_easy_reset(curl); diff --git a/tests/libtest/lib1535.c b/tests/libtest/lib1535.c index c49c3076dfee..a9480429faaf 100644 --- a/tests/libtest/lib1535.c +++ b/tests/libtest/lib1535.c @@ -36,7 +36,7 @@ static CURLcode test_lib1535(const char *URL) easy_init(curl); /* Test that protocol is properly initialized on curl_easy_init. - */ + */ res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); @@ -65,7 +65,7 @@ static CURLcode test_lib1535(const char *URL) } /* Test that a protocol is properly set after receiving an HTTP resource. - */ + */ res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); @@ -85,7 +85,7 @@ static CURLcode test_lib1535(const char *URL) } /* Test that a protocol is properly initialized on curl_easy_duphandle. - */ + */ dupe = curl_easy_duphandle(curl); if(!dupe) { @@ -112,7 +112,7 @@ static CURLcode test_lib1535(const char *URL) } /* Test that a protocol is properly initialized on curl_easy_reset. - */ + */ curl_easy_reset(curl); diff --git a/tests/libtest/lib1536.c b/tests/libtest/lib1536.c index f89b50a19583..f03e9d98ed8e 100644 --- a/tests/libtest/lib1536.c +++ b/tests/libtest/lib1536.c @@ -36,7 +36,7 @@ static CURLcode test_lib1536(const char *URL) easy_init(curl); /* Test that scheme is properly initialized on curl_easy_init. - */ + */ res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme); if(res) { @@ -64,7 +64,7 @@ static CURLcode test_lib1536(const char *URL) } /* Test that a scheme is properly set after receiving an HTTP resource. - */ + */ res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme); if(res) { @@ -83,7 +83,7 @@ static CURLcode test_lib1536(const char *URL) } /* Test that a scheme is properly initialized on curl_easy_duphandle. - */ + */ dupe = curl_easy_duphandle(curl); if(!dupe) { @@ -108,7 +108,7 @@ static CURLcode test_lib1536(const char *URL) } /* Test that a scheme is properly initialized on curl_easy_reset. - */ + */ curl_easy_reset(curl); diff --git a/tests/libtest/lib1559.c b/tests/libtest/lib1559.c index c6851918a685..30773add7356 100644 --- a/tests/libtest/lib1559.c +++ b/tests/libtest/lib1559.c @@ -25,7 +25,7 @@ static CURLcode test_lib1559(const char *URL) { - static const int EXCESSIVE = 10*1000*1000; + static const int EXCESSIVE = 10 * 1000 * 1000; CURLcode res = CURLE_OK; CURL *curl = NULL; @@ -43,7 +43,7 @@ static CURLcode test_lib1559(const char *URL) } memset(longurl, 'a', EXCESSIVE); - longurl[EXCESSIVE-1] = 0; + longurl[EXCESSIVE - 1] = 0; res = curl_easy_setopt(curl, CURLOPT_URL, longurl); curl_mprintf("CURLOPT_URL %d bytes URL == %d\n", diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 2f6608108cca..d080d38aa87e 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -68,10 +68,10 @@ static int checkparts(CURLU *u, const char *in, const char *wanted, size_t n; rc = curl_url_get(u, parts[i].part, &p, getflags); if(!rc && p) { - curl_msnprintf(bufp, len, "%s%s", buf[0]?" | ":"", p); + curl_msnprintf(bufp, len, "%s%s", buf[0] ? " | " : "", p); } else - curl_msnprintf(bufp, len, "%s[%d]", buf[0]?" | ":"", rc); + curl_msnprintf(bufp, len, "%s[%d]", buf[0] ? " | " : "", rc); n = strlen(bufp); bufp += n; diff --git a/tests/libtest/lib1597.c b/tests/libtest/lib1597.c index a338a53944fb..0e86517eadb1 100644 --- a/tests/libtest/lib1597.c +++ b/tests/libtest/lib1597.c @@ -80,7 +80,7 @@ static CURLcode test_lib1597(const char *URL) n = 0; for(proto = curlinfo->protocols; *proto; proto++) { - if((size_t) n >= sizeof(protolist)) { + if((size_t)n >= sizeof(protolist)) { puts("protolist buffer too small\n"); res = TEST_ERR_FAILURE; goto test_cleanup; diff --git a/tests/libtest/lib1662.c b/tests/libtest/lib1662.c index 41a1bc0bd4bb..f1e7b55df414 100644 --- a/tests/libtest/lib1662.c +++ b/tests/libtest/lib1662.c @@ -34,7 +34,7 @@ static size_t t1662_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t1662_WriteThis *pooh = (struct t1662_WriteThis *)userp; size_t len = strlen(testdata); - if(size*nmemb < len) + if(size * nmemb < len) return 0; if(pooh->sizeleft) { diff --git a/tests/libtest/lib1915.c b/tests/libtest/lib1915.c index 367533aef64f..adb589a8c0fb 100644 --- a/tests/libtest/lib1915.c +++ b/tests/libtest/lib1915.c @@ -30,8 +30,7 @@ struct state { }; /* "read" is from the point of the library, it wants data from us */ -static CURLSTScode hstsread(CURL *curl, struct curl_hstsentry *e, - void *userp) +static CURLSTScode hstsread(CURL *curl, struct curl_hstsentry *e, void *userp) { struct entry { const char *name; diff --git a/tests/libtest/lib1919.c b/tests/libtest/lib1919.c index 79d31810a466..1a436b00cea3 100644 --- a/tests/libtest/lib1919.c +++ b/tests/libtest/lib1919.c @@ -33,9 +33,9 @@ static CURLcode test_lib1919(const char *URL) easy_init(curl); easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BEARER); easy_setopt(curl, CURLOPT_XOAUTH2_BEARER, - "c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1"); + "c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca1"); easy_setopt(curl, CURLOPT_SASL_AUTHZID, - "c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca2"); + "c4e448d652a961fda0ab64f882c8c161d5985f805d45d80c9ddca2"); easy_setopt(curl, CURLOPT_URL, URL); for(i = 0; i < 2; i++) { diff --git a/tests/libtest/lib1940.c b/tests/libtest/lib1940.c index 75b8f7818c02..1d9975534ad9 100644 --- a/tests/libtest/lib1940.c +++ b/tests/libtest/lib1940.c @@ -28,7 +28,7 @@ static size_t t1940_write_cb(char *data, size_t n, size_t l, void *userp) /* take care of the data here, ignored in this example */ (void)data; (void)userp; - return n*l; + return n * l; } static void t1940_showem(CURL *curl, int header_request, unsigned int type) diff --git a/tests/libtest/lib1945.c b/tests/libtest/lib1945.c index 99044880cfe8..07a010951415 100644 --- a/tests/libtest/lib1945.c +++ b/tests/libtest/lib1945.c @@ -41,7 +41,7 @@ static size_t t1945_write_cb(char *data, size_t n, size_t l, void *userp) /* take care of the data here, ignored in this example */ (void)data; (void)userp; - return n*l; + return n * l; } static CURLcode test_lib1945(const char *URL) @@ -67,7 +67,7 @@ static CURLcode test_lib1945(const char *URL) if(res) { curl_mprintf("badness: %d\n", res); } - t1945_showem(curl, CURLH_CONNECT|CURLH_HEADER|CURLH_TRAILER|CURLH_1XX); + t1945_showem(curl, CURLH_CONNECT | CURLH_HEADER | CURLH_TRAILER | CURLH_1XX); test_cleanup: curl_easy_cleanup(curl); diff --git a/tests/libtest/lib1947.c b/tests/libtest/lib1947.c index acbc260aa1d5..43e4c274b825 100644 --- a/tests/libtest/lib1947.c +++ b/tests/libtest/lib1947.c @@ -28,7 +28,7 @@ static size_t t1947_write_cb(char *data, size_t n, size_t l, void *userp) /* ignore the data */ (void)data; (void)userp; - return n*l; + return n * l; } static CURLcode test_lib1947(const char *URL) @@ -56,8 +56,8 @@ static CURLcode test_lib1947(const char *URL) /* count the number of requests by reading the first header of each request. */ - origins = (CURLH_HEADER|CURLH_TRAILER|CURLH_CONNECT| - CURLH_1XX|CURLH_PSEUDO); + origins = CURLH_HEADER | CURLH_TRAILER | CURLH_CONNECT | CURLH_1XX | + CURLH_PSEUDO; do { h = curl_easy_nextheader(curl, origins, count, NULL); if(h) diff --git a/tests/libtest/lib1948.c b/tests/libtest/lib1948.c index 2a138ac69554..024080e3e491 100644 --- a/tests/libtest/lib1948.c +++ b/tests/libtest/lib1948.c @@ -23,15 +23,14 @@ ***************************************************************************/ #include "first.h" -typedef struct -{ +struct put_buffer { const char *buf; size_t len; -} put_buffer; +}; static size_t put_callback(char *ptr, size_t size, size_t nmemb, void *stream) { - put_buffer *putdata = (put_buffer *)stream; + struct put_buffer *putdata = (struct put_buffer *)stream; size_t totalsize = size * nmemb; size_t tocopy = (putdata->len < totalsize) ? putdata->len : totalsize; memcpy(ptr, putdata->buf, tocopy); @@ -45,7 +44,7 @@ static CURLcode test_lib1948(const char *URL) CURL *curl; CURLcode res = CURLE_OK; static const char *testput = "This is test PUT data\n"; - put_buffer pbuf; + struct put_buffer pbuf; curl_global_init(CURL_GLOBAL_DEFAULT); diff --git a/tests/libtest/lib1960.c b/tests/libtest/lib1960.c index 2dbdf5995fd3..ff8ad76bc12b 100644 --- a/tests/libtest/lib1960.c +++ b/tests/libtest/lib1960.c @@ -63,12 +63,11 @@ static int sockopt_cb(void *clientp, } #ifdef __AMIGA__ -#define my_inet_pton(x,y,z) inet_pton(x,(unsigned char *)y,z) +#define my_inet_pton(x, y, z) inet_pton(x, (unsigned char *)y, z) #else -#define my_inet_pton(x,y,z) inet_pton(x,y,z) +#define my_inet_pton(x, y, z) inet_pton(x, y, z) #endif - /* Expected args: URL IP PORT */ static CURLcode test_lib1960(const char *URL) { @@ -109,7 +108,8 @@ static CURLcode test_lib1960(const char *URL) goto test_cleanup; } - status = connect(client_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); + status = connect(client_fd, (struct sockaddr *)&serv_addr, + sizeof(serv_addr)); if(status < 0) { curl_mfprintf(stderr, "connection failed\n"); goto test_cleanup; diff --git a/tests/libtest/lib1977.c b/tests/libtest/lib1977.c index 10412f66c0c4..06ab698c365e 100644 --- a/tests/libtest/lib1977.c +++ b/tests/libtest/lib1977.c @@ -48,7 +48,6 @@ static CURLcode test_lib1977(const char *URL) goto test_cleanup; curl_mprintf("effective URL: %s\n", effective); - /* second transfer: set URL + query in the second CURLU handle */ curl_url_set(curlu_2, CURLUPART_URL, URL, CURLU_DEFAULT_SCHEME); curl_url_set(curlu_2, CURLUPART_QUERY, "foo", 0); @@ -64,7 +63,6 @@ static CURLcode test_lib1977(const char *URL) goto test_cleanup; curl_mprintf("effective URL: %s\n", effective); - /* third transfer: append extra query in the second CURLU handle, but do not set CURLOPT_CURLU again. this is to test that the contents of the handle is allowed to change between transfers and is used without having to set @@ -81,7 +79,6 @@ static CURLcode test_lib1977(const char *URL) goto test_cleanup; curl_mprintf("effective URL: %s\n", effective); - test_cleanup: curl_easy_cleanup(curl); curl_url_cleanup(curlu); diff --git a/tests/libtest/lib2023.c b/tests/libtest/lib2023.c index 1475deb2d3f8..660d528b2a37 100644 --- a/tests/libtest/lib2023.c +++ b/tests/libtest/lib2023.c @@ -90,7 +90,7 @@ static CURLcode test_lib2023(const char *URL) /* libauthretry */ long fallback_auth_scheme = parse_auth_name(libtest_arg3); if(main_auth_scheme == CURLAUTH_NONE || - fallback_auth_scheme == CURLAUTH_NONE) { + fallback_auth_scheme == CURLAUTH_NONE) { curl_mfprintf(stderr, "auth schemes not found on commandline\n"); return TEST_ERR_MAJOR_BAD; } diff --git a/tests/libtest/lib2032.c b/tests/libtest/lib2032.c index a733f34e6fc0..a9cb29857130 100644 --- a/tests/libtest/lib2032.c +++ b/tests/libtest/lib2032.c @@ -32,7 +32,7 @@ static CURLcode ntlmcb_res = CURLE_OK; static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) { - ssize_t idx = ((CURL **) data) - ntlm_curls; + ssize_t idx = ((CURL **)data) - ntlm_curls; curl_socket_t sock; long longdata; CURLcode code; @@ -195,8 +195,8 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ #else itimeout = (int)timeout; #endif - interval.tv_sec = itimeout/1000; - interval.tv_usec = (itimeout%1000)*1000; + interval.tv_sec = itimeout / 1000; + interval.tv_usec = (itimeout % 1000) * 1000; } else { interval.tv_sec = 0; diff --git a/tests/libtest/lib2402.c b/tests/libtest/lib2402.c index 58c1b6c431fe..49d87d1cd4f1 100644 --- a/tests/libtest/lib2402.c +++ b/tests/libtest/lib2402.c @@ -38,8 +38,7 @@ static CURLcode test_lib2402(const char *URL) (void)URL; - curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", - port, address); + curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", port, address); curl_mprintf("%s\n", dnsentry); slist = curl_slist_append(slist, dnsentry); if(!slist) { @@ -61,8 +60,7 @@ static CURLcode test_lib2402(const char *URL) easy_init(curl[i]); /* specify target */ curl_msnprintf(target_url, sizeof(target_url), - "https://localhost:%s/path/2402%04zu", - port, i + 1); + "https://localhost:%s/path/2402%04zu", port, i + 1); target_url[sizeof(target_url) - 1] = '\0'; easy_setopt(curl[i], CURLOPT_URL, target_url); /* go http2 */ diff --git a/tests/libtest/lib2404.c b/tests/libtest/lib2404.c index 93a3ef926f40..c20259744771 100644 --- a/tests/libtest/lib2404.c +++ b/tests/libtest/lib2404.c @@ -38,8 +38,7 @@ static CURLcode test_lib2404(const char *URL) (void)URL; - curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", - port, address); + curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", port, address); curl_mprintf("%s\n", dnsentry); slist = curl_slist_append(slist, dnsentry); if(!slist) { @@ -61,8 +60,7 @@ static CURLcode test_lib2404(const char *URL) easy_init(curl[i]); /* specify target */ curl_msnprintf(target_url, sizeof(target_url), - "https://localhost:%s/path/2404%04zu", - port, i + 1); + "https://localhost:%s/path/2404%04zu", port, i + 1); target_url[sizeof(target_url) - 1] = '\0'; easy_setopt(curl[i], CURLOPT_URL, target_url); /* go http2 */ diff --git a/tests/libtest/lib2405.c b/tests/libtest/lib2405.c index 97d0d5d231e5..89ab659bdd4e 100644 --- a/tests/libtest/lib2405.c +++ b/tests/libtest/lib2405.c @@ -66,9 +66,10 @@ enum { TEST_USE_HTTP2_MPLEX }; -static size_t emptyWriteFunc(char *ptr, size_t size, size_t nmemb, - void *data) { - (void)ptr; (void)data; +static size_t emptyWriteFunc(char *ptr, size_t size, size_t nmemb, void *data) +{ + (void)ptr; + (void)data; return size * nmemb; } diff --git a/tests/libtest/lib2502.c b/tests/libtest/lib2502.c index 4b5e0ef6833e..48a8a93f0f8e 100644 --- a/tests/libtest/lib2502.c +++ b/tests/libtest/lib2502.c @@ -40,8 +40,7 @@ static CURLcode test_lib2502(const char *URL) (void)URL; - curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", - port, address); + curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", port, address); curl_mprintf("%s\n", dnsentry); slist = curl_slist_append(slist, dnsentry); if(!slist) { @@ -63,8 +62,7 @@ static CURLcode test_lib2502(const char *URL) easy_init(curl[i]); /* specify target */ curl_msnprintf(target_url, sizeof(target_url), - "https://localhost:%s/path/2502%04zu", - port, i + 1); + "https://localhost:%s/path/2502%04zu", port, i + 1); target_url[sizeof(target_url) - 1] = '\0'; easy_setopt(curl[i], CURLOPT_URL, target_url); /* go http2 */ diff --git a/tests/libtest/lib2700.c b/tests/libtest/lib2700.c index 1760d243ea1a..1c38f073d58c 100644 --- a/tests/libtest/lib2700.c +++ b/tests/libtest/lib2700.c @@ -120,8 +120,7 @@ static CURLcode send_chunk(CURL *curl, int flags, const char *buffer, size_t nsent; retry: - res = curl_ws_send(curl, buffer + *offset, size - *offset, &nsent, 0, - flags); + res = curl_ws_send(curl, buffer + *offset, size - *offset, &nsent, 0, flags); if(res == CURLE_AGAIN) { assert(nsent == 0); goto retry; diff --git a/tests/libtest/lib3033.c b/tests/libtest/lib3033.c index 428de8afc31d..e2f0099615f5 100644 --- a/tests/libtest/lib3033.c +++ b/tests/libtest/lib3033.c @@ -33,8 +33,7 @@ static CURLcode t3033_req_test(CURLM *multi, CURL *curl, int still_running = 0; if(index == 1) { - curl_multi_setopt(multi, CURLMOPT_NETWORK_CHANGED, - CURLMNWC_CLEAR_CONNS); + curl_multi_setopt(multi, CURLMOPT_NETWORK_CHANGED, CURLMNWC_CLEAR_CONNS); curl_mprintf("[1] signal network change\n"); } else { diff --git a/tests/libtest/lib3102.c b/tests/libtest/lib3102.c index 72da47551e40..094b32c1fc56 100644 --- a/tests/libtest/lib3102.c +++ b/tests/libtest/lib3102.c @@ -47,11 +47,11 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info) static const char issuer_prefix[] = "Issuer:"; static const char subject_prefix[] = "Subject:"; - if(!strncmp(slist->data, issuer_prefix, sizeof(issuer_prefix)-1)) { - issuer = slist->data + sizeof(issuer_prefix)-1; + if(!strncmp(slist->data, issuer_prefix, sizeof(issuer_prefix) - 1)) { + issuer = slist->data + sizeof(issuer_prefix) - 1; } - if(!strncmp(slist->data, subject_prefix, sizeof(subject_prefix)-1)) { - subject = slist->data + sizeof(subject_prefix)-1; + if(!strncmp(slist->data, subject_prefix, sizeof(subject_prefix) - 1)) { + subject = slist->data + sizeof(subject_prefix) - 1; } } @@ -80,7 +80,7 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info) return true; } -static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) { (void)stream; (void)ptr; diff --git a/tests/libtest/lib3207.c b/tests/libtest/lib3207.c index 7757643a269b..8b20b311ebbf 100644 --- a/tests/libtest/lib3207.c +++ b/tests/libtest/lib3207.c @@ -116,7 +116,7 @@ static unsigned int test_thread(void *ptr) static void t3207_test_lock(CURL *curl, curl_lock_data data, curl_lock_access laccess, void *useptr) { - curl_mutex_t *mutexes = (curl_mutex_t*) useptr; + curl_mutex_t *mutexes = (curl_mutex_t *)useptr; (void)curl; (void)laccess; Curl_mutex_acquire(&mutexes[data]); @@ -124,7 +124,7 @@ static void t3207_test_lock(CURL *curl, curl_lock_data data, static void t3207_test_unlock(CURL *curl, curl_lock_data data, void *useptr) { - curl_mutex_t *mutexes = (curl_mutex_t*) useptr; + curl_mutex_t *mutexes = (curl_mutex_t *)useptr; (void)curl; Curl_mutex_release(&mutexes[data]); } @@ -175,7 +175,7 @@ static CURLcode test_lib3207(const char *URL) { CURLcode res = CURLE_OK; size_t i; - CURLSH* share; + CURLSH *share; struct Ctx ctx[THREAD_SIZE]; curl_global_init(CURL_GLOBAL_ALL); diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index b28a01a9ce05..e33614fc58a8 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -127,8 +127,7 @@ static CURLcode test_lib505(const char *URL) test_setopt(curl, CURLOPT_READDATA, hd_src); /* and give the size of the upload (optional) */ - test_setopt(curl, CURLOPT_INFILESIZE_LARGE, - (curl_off_t)file_info.st_size); + test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); /* Now run off and do what you have been told! */ res = curl_easy_perform(curl); diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index 3d2a3556fdb0..f5c44c3e4726 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -52,21 +52,21 @@ static void t506_test_lock(CURL *curl, curl_lock_data data, (void)laccess; switch(data) { - case CURL_LOCK_DATA_SHARE: - what = "share"; - locknum = 0; - break; - case CURL_LOCK_DATA_DNS: - what = "dns"; - locknum = 1; - break; - case CURL_LOCK_DATA_COOKIE: - what = "cookie"; - locknum = 2; - break; - default: - curl_mfprintf(stderr, "lock: no such data: %d\n", data); - return; + case CURL_LOCK_DATA_SHARE: + what = "share"; + locknum = 0; + break; + case CURL_LOCK_DATA_DNS: + what = "dns"; + locknum = 1; + break; + case CURL_LOCK_DATA_COOKIE: + what = "cookie"; + locknum = 2; + break; + default: + curl_mfprintf(stderr, "lock: no such data: %d\n", data); + return; } /* detect locking of locked locks */ @@ -88,21 +88,21 @@ static void t506_test_unlock(CURL *curl, curl_lock_data data, void *useptr) int locknum; (void)curl; switch(data) { - case CURL_LOCK_DATA_SHARE: - what = "share"; - locknum = 0; - break; - case CURL_LOCK_DATA_DNS: - what = "dns"; - locknum = 1; - break; - case CURL_LOCK_DATA_COOKIE: - what = "cookie"; - locknum = 2; - break; - default: - curl_mfprintf(stderr, "unlock: no such data: %d\n", data); - return; + case CURL_LOCK_DATA_SHARE: + what = "share"; + locknum = 0; + break; + case CURL_LOCK_DATA_DNS: + what = "dns"; + locknum = 1; + break; + case CURL_LOCK_DATA_COOKIE: + what = "cookie"; + locknum = 2; + break; + default: + curl_mfprintf(stderr, "unlock: no such data: %d\n", data); + return; } /* detect unlocking of unlocked locks */ @@ -128,7 +128,7 @@ static void *t506_test_fire(void *ptr) { CURLcode code; struct curl_slist *headers; - struct t506_Tdata *tdata = (struct t506_Tdata*)ptr; + struct t506_Tdata *tdata = (struct t506_Tdata *)ptr; CURL *curl; curl = curl_easy_init(); @@ -138,9 +138,9 @@ static void *t506_test_fire(void *ptr) } headers = sethost(NULL); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_URL, tdata->url); + curl_easy_setopt(curl, CURLOPT_URL, tdata->url); curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); curl_mprintf("CURLOPT_SHARE\n"); curl_easy_setopt(curl, CURLOPT_SHARE, tdata->share); @@ -233,40 +233,38 @@ static CURLcode test_lib506(const char *URL) return TEST_ERR_MAJOR_BAD; } curl_mprintf("CURLOPT_SHARE\n"); - test_setopt(curl, CURLOPT_SHARE, share); + test_setopt(curl, CURLOPT_SHARE, share); curl_mprintf("CURLOPT_COOKIELIST injected_and_clobbered\n"); test_setopt(curl, CURLOPT_COOKIELIST, - "Set-Cookie: injected_and_clobbered=yes; " - "domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030"); + "Set-Cookie: injected_and_clobbered=yes; " + "domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030"); curl_mprintf("CURLOPT_COOKIELIST ALL\n"); test_setopt(curl, CURLOPT_COOKIELIST, "ALL"); curl_mprintf("CURLOPT_COOKIELIST session\n"); test_setopt(curl, CURLOPT_COOKIELIST, "Set-Cookie: session=elephants"); curl_mprintf("CURLOPT_COOKIELIST injected\n"); test_setopt(curl, CURLOPT_COOKIELIST, - "Set-Cookie: injected=yes; domain=host.foo.com; " - "expires=Sat Feb 2 11:56:27 GMT 2030"); + "Set-Cookie: injected=yes; domain=host.foo.com; " + "expires=Sat Feb 2 11:56:27 GMT 2030"); curl_mprintf("CURLOPT_COOKIELIST SESS\n"); test_setopt(curl, CURLOPT_COOKIELIST, "SESS"); curl_mprintf("CLEANUP\n"); curl_easy_cleanup(curl); - /* start treads */ for(i = 1; i <= THREADS; i++) { /* set thread data */ - tdata.url = tutil_suburl(URL, i); /* must be curl_free()d */ + tdata.url = tutil_suburl(URL, i); /* must be curl_free()d */ tdata.share = share; /* simulate thread, direct call of "thread" function */ - curl_mprintf("*** run %d\n",i); + curl_mprintf("*** run %d\n", i); t506_test_fire(&tdata); curl_free(tdata.url); } - /* fetch another one and save cookies */ curl_mprintf("*** run %d\n", i); curl = curl_easy_init(); @@ -280,11 +278,11 @@ static CURLcode test_lib506(const char *URL) url = tutil_suburl(URL, i); headers = sethost(NULL); test_setopt(curl, CURLOPT_HTTPHEADER, headers); - test_setopt(curl, CURLOPT_URL, url); + test_setopt(curl, CURLOPT_URL, url); curl_mprintf("CURLOPT_SHARE\n"); - test_setopt(curl, CURLOPT_SHARE, share); + test_setopt(curl, CURLOPT_SHARE, share); curl_mprintf("CURLOPT_COOKIEJAR\n"); - test_setopt(curl, CURLOPT_COOKIEJAR, jar); + test_setopt(curl, CURLOPT_COOKIEJAR, jar); curl_mprintf("CURLOPT_COOKIELIST FLUSH\n"); test_setopt(curl, CURLOPT_COOKIELIST, "FLUSH"); @@ -307,9 +305,9 @@ static CURLcode test_lib506(const char *URL) url = tutil_suburl(URL, i); headers = sethost(NULL); test_setopt(curl, CURLOPT_HTTPHEADER, headers); - test_setopt(curl, CURLOPT_URL, url); + test_setopt(curl, CURLOPT_URL, url); curl_mprintf("CURLOPT_SHARE\n"); - test_setopt(curl, CURLOPT_SHARE, share); + test_setopt(curl, CURLOPT_SHARE, share); curl_mprintf("CURLOPT_COOKIELIST ALL\n"); test_setopt(curl, CURLOPT_COOKIELIST, "ALL"); curl_mprintf("CURLOPT_COOKIEJAR\n"); diff --git a/tests/libtest/lib508.c b/tests/libtest/lib508.c index 697505150056..144f967f4a84 100644 --- a/tests/libtest/lib508.c +++ b/tests/libtest/lib508.c @@ -32,7 +32,7 @@ static size_t t508_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct t508_WriteThis *pooh = (struct t508_WriteThis *)userp; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; if(pooh->sizeleft) { diff --git a/tests/libtest/lib509.c b/tests/libtest/lib509.c index b5a0c583e072..c065eb87c891 100644 --- a/tests/libtest/lib509.c +++ b/tests/libtest/lib509.c @@ -74,7 +74,6 @@ static void custom_free(void *ptr) free(ptr); } - static CURLcode test_lib509(const char *URL) { static const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c index d2df0eaf203b..8d4b6ce15512 100644 --- a/tests/libtest/lib510.c +++ b/tests/libtest/lib510.c @@ -40,14 +40,14 @@ static size_t t510_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t510_WriteThis *pooh = (struct t510_WriteThis *)userp; const char *data; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; data = testpost[pooh->counter]; if(data) { size_t len = strlen(data); - if(size*nmemb < len) { + if(size * nmemb < len) { curl_mfprintf(stderr, "read buffer is too small to run test\n"); return 0; } diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c index a4d5ab6b1a1e..04e8759c1a71 100644 --- a/tests/libtest/lib526.c +++ b/tests/libtest/lib526.c @@ -155,7 +155,6 @@ static CURLcode test_lib526(const char *URL) curl_multi_cleanup(multi); curl_global_cleanup(); - } else if(testnum == 532) { /* undocumented cleanup sequence - type UB */ diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index 429a4869f5c9..f32d64b3033f 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -229,7 +229,7 @@ static ssize_t t530_getMicroSecondTimeout(struct curltime *timeout) /** * Update a fd_set with all of the sockets in use. */ -static void t530_updateFdSet(struct t530_Sockets *sockets, fd_set* fdset, +static void t530_updateFdSet(struct t530_Sockets *sockets, fd_set *fdset, curl_socket_t *maxFd) { int i; diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c index 4810aba83fc3..82d839d772ea 100644 --- a/tests/libtest/lib536.c +++ b/tests/libtest/lib536.c @@ -27,8 +27,7 @@ static void proxystat(CURL *curl) { long wasproxy; if(!curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &wasproxy)) { - curl_mprintf("This %sthe proxy\n", wasproxy ? "used ": - "DID NOT use "); + curl_mprintf("This %sthe proxy\n", wasproxy ? "used " : "DID NOT use "); } } diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index 8027a09c0286..31c5e306125a 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -118,7 +118,7 @@ static int t537_test_rlimit(int keep_open) /* If the OS allows a HUGE number of open files, we do not run. * Modern debian sid reports a limit of 134217724 and this tests * takes minutes. */ -#define LIMIT_CAP (256*1024) +#define LIMIT_CAP (256 * 1024) if(rl.rlim_cur > LIMIT_CAP) { curl_mfprintf(stderr, "soft limit above %ld, not running\n", (long)LIMIT_CAP); diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index 5e8890d98421..21886cfc74c5 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -138,8 +138,8 @@ static CURLcode loop(int num, CURLM *multi, const char *url, #else itimeout = (int)L; #endif - T.tv_sec = itimeout/1000; - T.tv_usec = (itimeout%1000)*1000; + T.tv_sec = itimeout / 1000; + T.tv_usec = (itimeout % 1000) * 1000; } else { T.tv_sec = 5; diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index 8f51fef088d8..797e6f1fc6b6 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -29,7 +29,7 @@ #include "first.h" static const char t547_uploadthis[] = "this is the blurb we want to upload\n"; -#define T547_DATALEN (sizeof(t547_uploadthis)-1) +#define T547_DATALEN (sizeof(t547_uploadthis) - 1) static size_t t547_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp) { diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index 403ad6fec196..79cd877b1baa 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -35,10 +35,10 @@ static char databuf[70000]; /* MUST be more than 64k OR static size_t t552_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) { - size_t amount = nmemb * size; /* Total bytes curl wants */ - size_t available = sizeof(databuf) - current_offset; /* What we have to - give */ - size_t given = amount < available ? amount : available; /* What is given */ + size_t amount = nmemb * size; /* Total bytes curl wants */ + size_t available = sizeof(databuf) - current_offset; /* What we have to + give */ + size_t given = amount < available ? amount : available; /* What is given */ (void)stream; memcpy(ptr, databuf + current_offset, given); current_offset += given; diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c index dd8c690ddbc3..0c8349159e55 100644 --- a/tests/libtest/lib554.c +++ b/tests/libtest/lib554.c @@ -32,7 +32,7 @@ static size_t t554_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { struct t554_WriteThis *pooh = (struct t554_WriteThis *)userp; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; if(pooh->sizeleft) { diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index 005fefe72ff8..c9522f5eaeb5 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -33,7 +33,7 @@ #include "first.h" static const char t555_uploadthis[] = "this is the blurb we want to upload\n"; -#define T555_DATALEN (sizeof(t555_uploadthis)-1) +#define T555_DATALEN (sizeof(t555_uploadthis) - 1) static size_t t555_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp) { diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index fa1ee2fa2fbc..9c4f7f9b9f3b 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -48,56 +48,48 @@ #define BUFSZ 256 - struct unsshort_st { unsigned short num; /* unsigned short */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - struct sigshort_st { short num; /* signed short */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - struct unsint_st { unsigned int num; /* unsigned int */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - struct sigint_st { int num; /* signed int */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - struct unslong_st { unsigned long num; /* unsigned long */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - struct siglong_st { long num; /* signed long */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - struct curloff_st { curl_off_t num; /* curl_off_t */ const char *expected; /* expected string */ char result[BUFSZ]; /* result string */ }; - static struct unsshort_st us_test[1 + 100]; static struct sigshort_st ss_test[1 + 100]; static struct unsint_st ui_test[1 + 100]; @@ -106,7 +98,6 @@ static struct unslong_st ul_test[1 + 100]; static struct siglong_st sl_test[1 + 100]; static struct curloff_st co_test[1 + 100]; - static int test_unsigned_short_formatting(void) { int i, j; @@ -136,7 +127,7 @@ static int test_unsigned_short_formatting(void) for(j = 0; j < BUFSZ; j++) us_test[i].result[j] = 'X'; - us_test[i].result[BUFSZ-1] = '\0'; + us_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(us_test[i].result, "%hu", us_test[i].num); @@ -148,7 +139,6 @@ static int test_unsigned_short_formatting(void) i, us_test[i].expected, us_test[i].result); failed++; } - } if(!failed) @@ -159,7 +149,6 @@ static int test_unsigned_short_formatting(void) return failed; } - static int test_signed_short_formatting(void) { int i, j; @@ -211,7 +200,7 @@ static int test_signed_short_formatting(void) for(j = 0; j < BUFSZ; j++) ss_test[i].result[j] = 'X'; - ss_test[i].result[BUFSZ-1] = '\0'; + ss_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(ss_test[i].result, "%hd", ss_test[i].num); @@ -222,7 +211,6 @@ static int test_signed_short_formatting(void) i, ss_test[i].expected, ss_test[i].result); failed++; } - } if(!failed) @@ -233,7 +221,6 @@ static int test_signed_short_formatting(void) return failed; } - static int test_unsigned_int_formatting(void) { int i, j; @@ -361,7 +348,7 @@ static int test_unsigned_int_formatting(void) for(j = 0; j < BUFSZ; j++) ui_test[i].result[j] = 'X'; - ui_test[i].result[BUFSZ-1] = '\0'; + ui_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(ui_test[i].result, "%u", ui_test[i].num); @@ -372,7 +359,6 @@ static int test_unsigned_int_formatting(void) i, ui_test[i].expected, ui_test[i].result); failed++; } - } if(!failed) @@ -383,7 +369,6 @@ static int test_unsigned_int_formatting(void) return failed; } - static int test_signed_int_formatting(void) { int i, j; @@ -589,7 +574,7 @@ static int test_signed_int_formatting(void) for(j = 0; j < BUFSZ; j++) si_test[i].result[j] = 'X'; - si_test[i].result[BUFSZ-1] = '\0'; + si_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(si_test[i].result, "%d", si_test[i].num); @@ -600,7 +585,6 @@ static int test_signed_int_formatting(void) i, si_test[i].expected, si_test[i].result); failed++; } - } if(!failed) @@ -611,7 +595,6 @@ static int test_signed_int_formatting(void) return failed; } - static int test_unsigned_long_formatting(void) { int i, j; @@ -738,7 +721,7 @@ static int test_unsigned_long_formatting(void) for(j = 0; j < BUFSZ; j++) ul_test[i].result[j] = 'X'; - ul_test[i].result[BUFSZ-1] = '\0'; + ul_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(ul_test[i].result, "%lu", ul_test[i].num); @@ -749,7 +732,6 @@ static int test_unsigned_long_formatting(void) i, ul_test[i].expected, ul_test[i].result); failed++; } - } if(!failed) @@ -760,7 +742,6 @@ static int test_unsigned_long_formatting(void) return failed; } - static int test_signed_long_formatting(void) { int i, j; @@ -966,7 +947,7 @@ static int test_signed_long_formatting(void) for(j = 0; j < BUFSZ; j++) sl_test[i].result[j] = 'X'; - sl_test[i].result[BUFSZ-1] = '\0'; + sl_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(sl_test[i].result, "%ld", sl_test[i].num); @@ -977,7 +958,6 @@ static int test_signed_long_formatting(void) i, sl_test[i].expected, sl_test[i].result); failed++; } - } if(!failed) @@ -988,7 +968,6 @@ static int test_signed_long_formatting(void) return failed; } - static int test_curl_off_t_formatting(void) { int i, j; @@ -1080,7 +1059,7 @@ static int test_curl_off_t_formatting(void) for(j = 0; j < BUFSZ; j++) co_test[i].result[j] = 'X'; - co_test[i].result[BUFSZ-1] = '\0'; + co_test[i].result[BUFSZ - 1] = '\0'; (void)curl_msprintf(co_test[i].result, "%" CURL_FORMAT_CURL_OFF_T, co_test[i].num); @@ -1092,7 +1071,6 @@ static int test_curl_off_t_formatting(void) i, co_test[i].expected, co_test[i].result); failed++; } - } if(!failed) @@ -1113,7 +1091,7 @@ static int string_check_low(int linenumber, char *buf, const char *buf2) } return 0; } -#define string_check(x,y) string_check_low(__LINE__, x, y) +#define string_check(x, y) string_check_low(__LINE__, x, y) static int strlen_check_low(int linenumber, char *buf, size_t len) { @@ -1126,7 +1104,7 @@ static int strlen_check_low(int linenumber, char *buf, size_t len) } return 0; } -#define strlen_check(x,y) strlen_check_low(__LINE__, x, y) +#define strlen_check(x, y) strlen_check_low(__LINE__, x, y) /* * The output strings in this test need to have been verified with a system @@ -1222,7 +1200,6 @@ static int test_width_precision(void) return errors; } - static int test_weird_arguments(void) { int errors = 0; @@ -1275,7 +1252,7 @@ static int test_weird_arguments(void) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* 10 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* 10 10 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* 10 11 */ - 0, 1, 2, 3, 4, 5, 6, 7); /* 8 */ + 0, 1, 2, 3, 4, 5, 6, 7); /* 8 */ if(rc != 128) { curl_mprintf("curl_mprintf() returned %d and not 128!\n", rc); diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index 260061f5191f..46e94afb5390 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -84,7 +84,7 @@ static CURLcode test_lib568(const char *URL) test_setopt(curl, CURLOPT_READDATA, sdpf); test_setopt(curl, CURLOPT_UPLOAD, 1L); - test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t) file_info.st_size); + test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); test_setopt(curl, CURLOPT_VERBOSE, 1L); /* Do the ANNOUNCE */ diff --git a/tests/libtest/lib570.c b/tests/libtest/lib570.c index f5ada6770b2e..1a1656d798f5 100644 --- a/tests/libtest/lib570.c +++ b/tests/libtest/lib570.c @@ -70,7 +70,7 @@ static CURLcode test_lib570(const char *URL) test_setopt(curl, CURLOPT_RTSP_CLIENT_CSEQ, 999L); test_setopt(curl, CURLOPT_RTSP_TRANSPORT, - "RAW/RAW/UDP;unicast;client_port=3056-3057"); + "RAW/RAW/UDP;unicast;client_port=3056-3057"); test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP); stream_uri = tutil_suburl(URL, request++); diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c index 4e20cb3da5b8..5e54f3549b92 100644 --- a/tests/libtest/lib572.c +++ b/tests/libtest/lib572.c @@ -102,7 +102,7 @@ static CURLcode test_lib572(const char *URL) test_setopt(curl, CURLOPT_READDATA, paramsf); test_setopt(curl, CURLOPT_UPLOAD, 1L); - test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t) file_info.st_size); + test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); res = curl_easy_perform(curl); if(res) diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c index ed00bbb04243..b19782ce0d6f 100644 --- a/tests/libtest/lib573.c +++ b/tests/libtest/lib573.c @@ -41,7 +41,7 @@ static CURLcode test_lib573(const char *URL) dbl_epsilon = 1.0; do { dbl_epsilon /= 2.0; - } while((double)(1.0 + (dbl_epsilon/2.0)) > (double)1.0); + } while((double)(1.0 + (dbl_epsilon / 2.0)) > (double)1.0); start_test_timing(); diff --git a/tests/libtest/lib574.c b/tests/libtest/lib574.c index f74371e97383..52527c7f419c 100644 --- a/tests/libtest/lib574.c +++ b/tests/libtest/lib574.c @@ -23,8 +23,7 @@ ***************************************************************************/ #include "first.h" -static int new_fnmatch(void *ptr, - const char *pattern, const char *string) +static int new_fnmatch(void *ptr, const char *pattern, const char *string) { (void)ptr; curl_mfprintf(stderr, "lib574: match string '%s' against pattern '%s'\n", diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index aaa81baedeb1..05d4a8432e63 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -84,7 +84,7 @@ static size_t t579_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t579_WriteThis *pooh = (struct t579_WriteThis *)userp; const char *data; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; data = testpost[pooh->counter]; diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index e99d5febdfab..dabebed6ce8f 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -175,7 +175,7 @@ static ssize_t t582_getMicroSecondTimeout(struct curltime *timeout) /** * Update a fd_set with all of the sockets in use. */ -static void t582_updateFdSet(struct t582_Sockets *sockets, fd_set* fdset, +static void t582_updateFdSet(struct t582_Sockets *sockets, fd_set *fdset, curl_socket_t *maxFd) { int i; diff --git a/tests/libtest/lib586.c b/tests/libtest/lib586.c index d0671b18fec3..310ad77f39f4 100644 --- a/tests/libtest/lib586.c +++ b/tests/libtest/lib586.c @@ -47,21 +47,21 @@ static void t586_test_lock(CURL *curl, curl_lock_data data, (void)laccess; switch(data) { - case CURL_LOCK_DATA_SHARE: - what = "share"; - break; - case CURL_LOCK_DATA_DNS: - what = "dns"; - break; - case CURL_LOCK_DATA_COOKIE: - what = "cookie"; - break; - case CURL_LOCK_DATA_SSL_SESSION: - what = "ssl_session"; - break; - default: - curl_mfprintf(stderr, "lock: no such data: %d\n", data); - return; + case CURL_LOCK_DATA_SHARE: + what = "share"; + break; + case CURL_LOCK_DATA_DNS: + what = "dns"; + break; + case CURL_LOCK_DATA_COOKIE: + what = "cookie"; + break; + case CURL_LOCK_DATA_SSL_SESSION: + what = "ssl_session"; + break; + default: + curl_mfprintf(stderr, "lock: no such data: %d\n", data); + return; } curl_mprintf("lock: %-6s [%s]: %d\n", what, user->text, user->counter); user->counter++; @@ -74,21 +74,21 @@ static void t586_test_unlock(CURL *curl, curl_lock_data data, void *useptr) struct t586_userdata *user = (struct t586_userdata *)useptr; (void)curl; switch(data) { - case CURL_LOCK_DATA_SHARE: - what = "share"; - break; - case CURL_LOCK_DATA_DNS: - what = "dns"; - break; - case CURL_LOCK_DATA_COOKIE: - what = "cookie"; - break; - case CURL_LOCK_DATA_SSL_SESSION: - what = "ssl_session"; - break; - default: - curl_mfprintf(stderr, "unlock: no such data: %d\n", data); - return; + case CURL_LOCK_DATA_SHARE: + what = "share"; + break; + case CURL_LOCK_DATA_DNS: + what = "dns"; + break; + case CURL_LOCK_DATA_COOKIE: + what = "cookie"; + break; + case CURL_LOCK_DATA_SSL_SESSION: + what = "ssl_session"; + break; + default: + curl_mfprintf(stderr, "unlock: no such data: %d\n", data); + return; } curl_mprintf("unlock: %-6s [%s]: %d\n", what, user->text, user->counter); user->counter++; @@ -98,7 +98,7 @@ static void t586_test_unlock(CURL *curl, curl_lock_data data, void *useptr) static void *t586_test_fire(void *ptr) { CURLcode code; - struct t586_Tdata *tdata = (struct t586_Tdata*)ptr; + struct t586_Tdata *tdata = (struct t586_Tdata *)ptr; CURL *curl; curl = curl_easy_init(); @@ -108,8 +108,8 @@ static void *t586_test_fire(void *ptr) } curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(curl, CURLOPT_URL, tdata->url); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_URL, tdata->url); curl_mprintf("CURLOPT_SHARE\n"); curl_easy_setopt(curl, CURLOPT_SHARE, tdata->share); @@ -181,20 +181,18 @@ static CURLcode test_lib586(const char *URL) return TEST_ERR_MAJOR_BAD; } - /* start treads */ for(i = 1; i <= THREADS; i++) { /* set thread data */ - tdata.url = URL; + tdata.url = URL; tdata.share = share; /* simulate thread, direct call of "thread" function */ - curl_mprintf("*** run %d\n",i); + curl_mprintf("*** run %d\n", i); t586_test_fire(&tdata); } - /* fetch another one */ curl_mprintf("*** run %d\n", i); curl = curl_easy_init(); @@ -233,8 +231,7 @@ static CURLcode test_lib586(const char *URL) curl_mprintf("SHARE_CLEANUP\n"); scode = curl_share_cleanup(share); if(scode != CURLSHE_OK) - curl_mfprintf(stderr, "curl_share_cleanup failed, code errno %d\n", - scode); + curl_mfprintf(stderr, "curl_share_cleanup failed, code errno %d\n", scode); curl_mprintf("GLOBAL_CLEANUP\n"); curl_global_cleanup(); diff --git a/tests/libtest/lib591.c b/tests/libtest/lib591.c index 521cbb7503ab..b58a408a028d 100644 --- a/tests/libtest/lib591.c +++ b/tests/libtest/lib591.c @@ -114,8 +114,8 @@ static CURLcode test_lib591(const char *URL) #else itimeout = (int)timeout; #endif - interval.tv_sec = itimeout/1000; - interval.tv_usec = (itimeout%1000)*1000; + interval.tv_sec = itimeout / 1000; + interval.tv_usec = (itimeout % 1000) * 1000; } else { interval.tv_sec = 0; diff --git a/tests/libtest/lib597.c b/tests/libtest/lib597.c index 38e60c084486..e02acadab39f 100644 --- a/tests/libtest/lib597.c +++ b/tests/libtest/lib597.c @@ -94,11 +94,11 @@ static CURLcode test_lib597(const char *URL) #else itimeout = (int)timeout; #endif - interval.tv_sec = itimeout/1000; - interval.tv_usec = (itimeout%1000)*1000; + interval.tv_sec = itimeout / 1000; + interval.tv_usec = (itimeout % 1000) * 1000; } else { - interval.tv_sec = TEST_HANG_TIMEOUT/1000 - 1; + interval.tv_sec = TEST_HANG_TIMEOUT / 1000 - 1; interval.tv_usec = 0; } diff --git a/tests/libtest/lib643.c b/tests/libtest/lib643.c index 52ea1eb664cc..d096082143ac 100644 --- a/tests/libtest/lib643.c +++ b/tests/libtest/lib643.c @@ -33,7 +33,7 @@ static size_t t643_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t643_WriteThis *pooh = (struct t643_WriteThis *)userp; int eof; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; if(testnum == 643) { @@ -100,8 +100,7 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) if(oldstyle) { res = curl_mime_name(part, "sendfile"); if(!res) - res = curl_mime_data_cb(part, datasize, t643_read_cb, - NULL, NULL, &pooh); + res = curl_mime_data_cb(part, datasize, t643_read_cb, NULL, NULL, &pooh); if(!res) res = curl_mime_filename(part, "postit2.c"); } @@ -109,8 +108,7 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) /* new style */ res = curl_mime_name(part, "sendfile alternative"); if(!res) - res = curl_mime_data_cb(part, datasize, t643_read_cb, - NULL, NULL, &pooh); + res = curl_mime_data_cb(part, datasize, t643_read_cb, NULL, NULL, &pooh); if(!res) res = curl_mime_filename(part, "filename 2 "); } @@ -137,8 +135,7 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) /* Fill in the file upload part */ res = curl_mime_name(part, "callbackdata"); if(!res) - res = curl_mime_data_cb(part, datasize, t643_read_cb, - NULL, NULL, &pooh2); + res = curl_mime_data_cb(part, datasize, t643_read_cb, NULL, NULL, &pooh2); if(res) curl_mprintf("curl_mime_xxx(2) = %s\n", curl_easy_strerror(res)); @@ -155,8 +152,7 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) /* Fill in the filename field */ res = curl_mime_name(part, "filename"); if(!res) - res = curl_mime_data(part, "postit2.c", - CURL_ZERO_TERMINATED); + res = curl_mime_data(part, "postit2.c", CURL_ZERO_TERMINATED); if(res) curl_mprintf("curl_mime_xxx(3) = %s\n", curl_easy_strerror(res)); @@ -172,8 +168,7 @@ static CURLcode t643_test_once(const char *URL, bool oldstyle) } res = curl_mime_name(part, "submit"); if(!res) - res = curl_mime_data(part, "send", - CURL_ZERO_TERMINATED); + res = curl_mime_data(part, "send", CURL_ZERO_TERMINATED); if(res) curl_mprintf("curl_mime_xxx(4) = %s\n", curl_easy_strerror(res)); diff --git a/tests/libtest/lib650.c b/tests/libtest/lib650.c index 4aa6ea9d8bb4..d749e67d27c7 100644 --- a/tests/libtest/lib650.c +++ b/tests/libtest/lib650.c @@ -30,7 +30,7 @@ /* curl_formget callback to count characters. */ static size_t count_chars(void *userp, const char *buf, size_t len) { - size_t *pcounter = (size_t *) userp; + size_t *pcounter = (size_t *)userp; (void)buf; *pcounter += len; @@ -51,8 +51,7 @@ static CURLcode test_lib650(const char *URL) long contentlength = 0; static const char testname[] = "fieldname"; - static char testdata[] = - "this is what we post to the silly web server"; + static char testdata[] = "this is what we post to the silly web server"; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); @@ -141,7 +140,7 @@ static CURLcode test_lib650(const char *URL) * This is done before including stdin data because we want to reuse it * and stdin cannot be rewound. */ - curl_formget(formpost, (void *) &formlength, count_chars); + curl_formget(formpost, (void *)&formlength, count_chars); /* Include length in data for external check. */ curl_msnprintf(flbuf, sizeof(flbuf), "%zu", formlength); diff --git a/tests/libtest/lib651.c b/tests/libtest/lib651.c index 7d1d28563f15..1e38d18895cc 100644 --- a/tests/libtest/lib651.c +++ b/tests/libtest/lib651.c @@ -35,12 +35,12 @@ static CURLcode test_lib651(const char *URL) /* create a buffer with AAAA...BBBBB...CCCC...etc */ int i; - int size = (int)sizeof(testbuf)/1000; + int size = (int)sizeof(testbuf) / 1000; - for(i = 0; i < size ; i++) + for(i = 0; i < size; i++) memset(&testbuf[i * 1000], 65 + i, 1000); - testbuf[sizeof(testbuf)-1] = 0; /* null-terminate */ + testbuf[sizeof(testbuf) - 1] = 0; /* null-terminate */ if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib652.c b/tests/libtest/lib652.c index 4fae340042b0..eea153742f03 100644 --- a/tests/libtest/lib652.c +++ b/tests/libtest/lib652.c @@ -37,7 +37,7 @@ static CURLcode test_lib652(const char *URL) int i; int size = (int)sizeof(testbuf) / 10; - for(i = 0; i < size ; i++) + for(i = 0; i < size; i++) memset(&testbuf[i * 10], 65 + (i % 26), 10); if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { diff --git a/tests/libtest/lib654.c b/tests/libtest/lib654.c index 1d93798d7c10..7d519d645331 100644 --- a/tests/libtest/lib654.c +++ b/tests/libtest/lib654.c @@ -31,7 +31,7 @@ struct t654_WriteThis { static void free_callback(void *userp) { - struct t654_WriteThis *pooh = (struct t654_WriteThis *) userp; + struct t654_WriteThis *pooh = (struct t654_WriteThis *)userp; pooh->freecount++; } @@ -41,7 +41,7 @@ static size_t t654_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t654_WriteThis *pooh = (struct t654_WriteThis *)userp; int eof; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; eof = pooh->sizeleft <= 0; @@ -92,7 +92,7 @@ static CURLcode test_lib654(const char *URL) /* Prepare the callback structure. */ pooh.readptr = testdata; - pooh.sizeleft = (curl_off_t) strlen(testdata); + pooh.sizeleft = (curl_off_t)strlen(testdata); pooh.freecount = 0; /* Build the mime tree. */ diff --git a/tests/libtest/lib666.c b/tests/libtest/lib666.c index f47bacb9a807..e0a36412b012 100644 --- a/tests/libtest/lib666.c +++ b/tests/libtest/lib666.c @@ -40,7 +40,7 @@ static CURLcode test_lib666(const char *URL) if(i % 77 == 76) testbuf[i] = '\n'; else - testbuf[i] = (char) (0x41 + i % 26); /* A...Z */ + testbuf[i] = (char)(0x41 + i % 26); /* A...Z */ if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib667.c b/tests/libtest/lib667.c index 1bd612f37797..3d835d500f86 100644 --- a/tests/libtest/lib667.c +++ b/tests/libtest/lib667.c @@ -33,7 +33,7 @@ static size_t t667_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t667_WriteThis *pooh = (struct t667_WriteThis *)userp; int eof; - if(size*nmemb < 1) + if(size * nmemb < 1) return 0; eof = pooh->sizeleft <= 0; @@ -82,7 +82,7 @@ static CURLcode test_lib667(const char *URL) /* Prepare the callback structure. */ pooh.readptr = testdata; - pooh.sizeleft = (curl_off_t) strlen(testdata); + pooh.sizeleft = (curl_off_t)strlen(testdata); /* Build the mime tree. */ mime = curl_mime_init(curl); @@ -90,8 +90,7 @@ static CURLcode test_lib667(const char *URL) curl_mime_name(part, "field"); curl_mime_encoder(part, "base64"); /* Using an undefined length forces chunked transfer. */ - curl_mime_data_cb(part, (curl_off_t) -1, t667_read_cb, - NULL, NULL, &pooh); + curl_mime_data_cb(part, (curl_off_t)-1, t667_read_cb, NULL, NULL, &pooh); /* Bind mime data to its easy handle. */ test_setopt(curl, CURLOPT_MIMEPOST, mime); diff --git a/tests/libtest/lib668.c b/tests/libtest/lib668.c index 5011391736b1..e0f291d809e2 100644 --- a/tests/libtest/lib668.c +++ b/tests/libtest/lib668.c @@ -76,7 +76,7 @@ static CURLcode test_lib668(const char *URL) /* Prepare the callback structures. */ pooh1.readptr = testdata; - pooh1.sizeleft = (curl_off_t) strlen(testdata); + pooh1.sizeleft = (curl_off_t)strlen(testdata); pooh2 = pooh1; /* Build the mime tree. */ @@ -84,14 +84,14 @@ static CURLcode test_lib668(const char *URL) part = curl_mime_addpart(mime); curl_mime_name(part, "field1"); /* Early end of data detection can be done because the data size is known. */ - curl_mime_data_cb(part, (curl_off_t) strlen(testdata), + curl_mime_data_cb(part, (curl_off_t)strlen(testdata), t668_read_cb, NULL, NULL, &pooh1); part = curl_mime_addpart(mime); curl_mime_name(part, "field2"); /* Using an undefined length forces chunked transfer and disables early end of data detection for this part. */ - curl_mime_data_cb(part, (curl_off_t) -1, t668_read_cb, - NULL, NULL, &pooh2); + curl_mime_data_cb(part, (curl_off_t)-1, + t668_read_cb, NULL, NULL, &pooh2); part = curl_mime_addpart(mime); curl_mime_name(part, "field3"); /* Regular file part sources early end of data can be detected because diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index e97b04319e3c..886bf39a72bc 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -33,7 +33,7 @@ struct t670_ReadThis { static size_t t670_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) { - struct t670_ReadThis *pooh = (struct t670_ReadThis *) userp; + struct t670_ReadThis *pooh = (struct t670_ReadThis *)userp; time_t delta; if(size * nmemb < 1) @@ -61,7 +61,7 @@ static int t670_xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) { - struct t670_ReadThis *pooh = (struct t670_ReadThis *) clientp; + struct t670_ReadThis *pooh = (struct t670_ReadThis *)clientp; (void)dltotal; (void)dlnow; @@ -102,7 +102,7 @@ static CURLcode test_lib670(const char *URL) return TEST_ERR_MAJOR_BAD; } - pooh.origin = (time_t) 0; + pooh.origin = (time_t)0; pooh.count = 0; pooh.curl = curl_easy_init(); @@ -128,7 +128,7 @@ static CURLcode test_lib670(const char *URL) goto test_cleanup; } - res = curl_mime_data_cb(part, (curl_off_t) 2, t670_read_cb, + res = curl_mime_data_cb(part, (curl_off_t)2, t670_read_cb, NULL, NULL, &pooh); /* Bind mime data to its easy handle. */ diff --git a/tests/libtest/lib678.c b/tests/libtest/lib678.c index ed8731d20d5b..525407fddc37 100644 --- a/tests/libtest/lib678.c +++ b/tests/libtest/lib678.c @@ -43,8 +43,7 @@ static int loadfile(const char *filename, void **filedata, size_t *filesize) continue_reading = fseek(fInCert, 0, SEEK_SET) == 0; if(continue_reading) data = curlx_malloc(datasize + 1); - if((!data) || - ((int)fread(data, datasize, 1, fInCert) != 1)) + if((!data) || ((int)fread(data, datasize, 1, fInCert) != 1)) continue_reading = FALSE; curlx_fclose(fInCert); if(!continue_reading) { @@ -52,7 +51,7 @@ static int loadfile(const char *filename, void **filedata, size_t *filesize) datasize = 0; data = NULL; } - } + } } *filesize = datasize; *filedata = data; diff --git a/tests/libtest/lib758.c b/tests/libtest/lib758.c index bc6a490d3d39..fadb1db6fdd7 100644 --- a/tests/libtest/lib758.c +++ b/tests/libtest/lib758.c @@ -69,7 +69,6 @@ static void t758_msg(const char *msg) curl_mfprintf(stderr, "%s %s\n", t758_tag(), msg); } - struct t758_Sockets { curl_socket_t *sockets; int count; /* number of sockets actually stored in array */ @@ -203,7 +202,7 @@ static int t758_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg) { - SSL * ssl; + SSL *ssl; (void)arg; ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); @@ -226,7 +225,7 @@ static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg) static CURLcode t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *clientp) { - SSL_CTX *ctx = (SSL_CTX *) ssl_ctx; + SSL_CTX *ctx = (SSL_CTX *)ssl_ctx; (void)curl; SSL_CTX_set_cert_verify_callback(ctx, t758_cert_verify_callback, clientp); return CURLE_OK; @@ -277,7 +276,7 @@ static ssize_t t758_getMicroSecondTimeout(struct curltime *timeout) /** * Update a fd_set with all of the sockets in use. */ -static void t758_updateFdSet(struct t758_Sockets *sockets, fd_set* fdset, +static void t758_updateFdSet(struct t758_Sockets *sockets, fd_set *fdset, curl_socket_t *maxFd) { int i; @@ -359,7 +358,6 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, curl_global_trace("all"); - easy_init(curl); debug_config.nohex = TRUE; debug_config.tracetime = TRUE; diff --git a/tests/server/dnsd.c b/tests/server/dnsd.c index 9b3a42e1590c..58bbd2f3f88c 100644 --- a/tests/server/dnsd.c +++ b/tests/server/dnsd.c @@ -26,8 +26,7 @@ static int dnsd_wrotepidfile = 0; static int dnsd_wroteportfile = 0; -static unsigned short get16bit(const unsigned char **pkt, - size_t *size) +static unsigned short get16bit(const unsigned char **pkt, size_t *size) { const unsigned char *p = *pkt; (*pkt) += 2; @@ -140,7 +139,7 @@ static int store_incoming(const unsigned char *data, size_t size, fprintf(server, "Z: %x\n", (id & 0x70) >> 4); fprintf(server, "RCODE: %x\n", (id & 0x0f)); #endif - (void) get16bit(&data, &size); + (void)get16bit(&data, &size); data += 6; /* skip ANCOUNT, NSCOUNT and ARCOUNT */ size -= 6; @@ -153,10 +152,9 @@ static int store_incoming(const unsigned char *data, size_t size, qd = get16bit(&data, &size); fprintf(server, "QNAME %s QTYPE %s\n", name, type2string(qd)); *qtype = qd; - logmsg("Question for '%s' type %x / %s", name, qd, - type2string(qd)); + logmsg("Question for '%s' type %x / %s", name, qd, type2string(qd)); - (void) get16bit(&data, &size); + (void)get16bit(&data, &size); *qlen = qsize - size; /* total size of the query */ if(*qlen > qbuflen) { @@ -311,7 +309,7 @@ static int send_response(curl_socket_t sock, fprintf(stderr, "Not working\n"); return -1; #else - rc = sendto(sock, (const void *)bytes, (SENDTO3) i, 0, addr, addrlen); + rc = sendto(sock, (const void *)bytes, (SENDTO3)i, 0, addr, addrlen); if(rc != (ssize_t)i) { fprintf(stderr, "failed sending %d bytes\n", (int)i); } @@ -319,7 +317,6 @@ static int send_response(curl_socket_t sock, return 0; } - static void read_instructions(void) { char file[256]; @@ -412,7 +409,7 @@ static int test_dnsd(int argc, char **argv) #else "" #endif - ); + ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { @@ -475,7 +472,7 @@ static int test_dnsd(int argc, char **argv) } snprintf(loglockfile, sizeof(loglockfile), "%s/%s/dnsd-%s.lock", - logdir, SERVERLOGS_LOCKDIR, ipv_inuse); + logdir, SERVERLOGS_LOCKDIR, ipv_inuse); #ifdef _WIN32 if(win32_init()) diff --git a/tests/server/getpart.c b/tests/server/getpart.c index efec3de634b6..becde4a9bb06 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -182,8 +182,8 @@ static int appenddata(char **dst_buf, /* dest buffer */ return GPE_OK; } -static int decodedata(char **buf, /* dest buffer */ - size_t *len) /* dest buffer data length */ +static int decodedata(char **buf, /* dest buffer */ + size_t *len) /* dest buffer data length */ { CURLcode error = CURLE_OK; unsigned char *buf64 = NULL; @@ -254,7 +254,7 @@ int getpart(char **outbuf, size_t *outlen, char *end; union { ssize_t sig; - size_t uns; + size_t uns; } len; size_t bufsize = 0; size_t outalloc = 256; @@ -288,8 +288,7 @@ int getpart(char **outbuf, size_t *outlen, if('<' != *ptr) { if(in_wanted_part) { show(("=> %s", buffer)); - error = appenddata(outbuf, outlen, &outalloc, buffer, datalen, - base64); + error = appenddata(outbuf, outlen, &outalloc, buffer, datalen, base64); if(error) break; } @@ -353,7 +352,6 @@ int getpart(char **outbuf, size_t *outlen, if(in_wanted_part) break; } - } else if(!in_wanted_part) { /* @@ -411,9 +409,9 @@ int getpart(char **outbuf, size_t *outlen, /* start of wanted part */ in_wanted_part = 1; if(strstr(patt, "base64=")) - /* bit rough test, but "mostly" functional, */ - /* treat wanted part data as base64 encoded */ - base64 = 1; + /* bit rough test, but "mostly" functional, */ + /* treat wanted part data as base64 encoded */ + base64 = 1; if(strstr(patt, "nonewline=")) { show(("* setting nonewline\n")); nonewline = 1; @@ -421,7 +419,6 @@ int getpart(char **outbuf, size_t *outlen, } continue; } - } if(in_wanted_part) { diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index 59c7540dcfc3..081b038d075b 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -156,7 +156,7 @@ static void logprotocol(mqttdir dir, /* return 0 on success */ static int connack(FILE *dump, curl_socket_t fd) { - unsigned char packet[]={ + unsigned char packet[] = { MQTT_MSG_CONNACK, 0x02, 0x00, 0x00 }; @@ -283,7 +283,6 @@ static size_t encode_length(size_t packetlen, return bytes; } - static size_t decode_length(unsigned char *buffer, size_t buflen, size_t *lenbytes) { @@ -304,7 +303,6 @@ static size_t decode_length(unsigned char *buffer, return len; } - /* return 0 on success */ static int publish(FILE *dump, curl_socket_t fd, unsigned short packetid, @@ -408,7 +406,7 @@ static int fixedheader(curl_socket_t fd, static curl_socket_t mqttit(curl_socket_t fd) { - size_t buff_size = 10*1024; + size_t buff_size = 10 * 1024; unsigned char *buffer = NULL; ssize_t rc; unsigned char byte; @@ -482,8 +480,7 @@ static curl_socket_t mqttit(curl_socket_t fd) } if(byte == MQTT_MSG_CONNECT) { - logprotocol(FROM_CLIENT, "CONNECT", remaining_length, - dump, buffer, rc); + logprotocol(FROM_CLIENT, "CONNECT", remaining_length, dump, buffer, rc); if(memcmp(protocol, buffer, sizeof(protocol))) { logmsg("Protocol preamble mismatch"); @@ -607,8 +604,7 @@ static curl_socket_t mqttit(curl_socket_t fd) size_t topiclen; logmsg("Incoming PUBLISH"); - logprotocol(FROM_CLIENT, "PUBLISH", remaining_length, - dump, buffer, rc); + logprotocol(FROM_CLIENT, "PUBLISH", remaining_length, dump, buffer, rc); topiclen = (size_t)(buffer[1 + bytes] << 8) | buffer[2 + bytes]; logmsg("Got %zu bytes topic", topiclen); @@ -754,7 +750,7 @@ static int test_mqttd(int argc, char *argv[]) #else "" #endif - ); + ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { @@ -802,8 +798,7 @@ static int test_mqttd(int argc, char *argv[]) if(argc > arg) { opt = argv[arg]; if(curlx_str_number(&opt, &num, 0xffff)) { - fprintf(stderr, "mqttd: invalid --port argument (%s)\n", - argv[arg]); + fprintf(stderr, "mqttd: invalid --port argument (%s)\n", argv[arg]); return 0; } server_port = (unsigned short)num; diff --git a/tests/server/resolve.c b/tests/server/resolve.c index c41c2fc68ad2..ed54eef5f36b 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -47,7 +47,7 @@ static int test_resolve(int argc, char *argv[]) #else "" #endif - ); + ); return 0; } else if(!strcmp("--ipv6", argv[arg])) { @@ -79,7 +79,7 @@ static int test_resolve(int argc, char *argv[]) #ifdef CURLRES_IPV6 "\n --ipv6" #endif - ); + ); return 1; } diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 335bbaaa69de..842562394058 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -50,10 +50,10 @@ typedef enum { RPROT_HTTP = 2 } reqprot_t; -#define SET_RTP_PKT_CHN(p,c) ((p)[1] = (char)((c) & 0xFF)) +#define SET_RTP_PKT_CHN(p, c) ((p)[1] = (char)((c) & 0xFF)) -#define SET_RTP_PKT_LEN(p,l) (((p)[2] = (char)(((l) >> 8) & 0xFF)), \ - ((p)[3] = (char)((l) & 0xFF))) +#define SET_RTP_PKT_LEN(p, l) (((p)[2] = (char)(((l) >> 8) & 0xFF)), \ + ((p)[3] = (char)((l) & 0xFF))) struct rtspd_httprequest { char reqbuf[150000]; /* buffer area for the incoming request */ @@ -105,10 +105,8 @@ struct rtspd_httprequest { #define END_OF_HEADERS "\r\n\r\n" - /* sent as reply to a QUIT */ -static const char *docquit_rtsp = -"HTTP/1.1 200 Goodbye" END_OF_HEADERS; +static const char *docquit_rtsp = "HTTP/1.1 200 Goodbye" END_OF_HEADERS; /* sent as reply to a CONNECT */ static const char *docconnect = @@ -180,7 +178,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) return 1; } - req->prot_version = prot_major*10 + prot_minor; + req->prot_version = prot_major * 10 + prot_minor; /* find the last slash */ ptr = strrchr(doc, '/'); @@ -285,8 +283,8 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) if(num < 0) logmsg("negative pipe size ignored"); else if(num > 0) - req->pipe = num-1; /* decrease by one since we do not count the - first request in this number */ + req->pipe = num - 1; /* decrease by one since we do not count + the first request in this number */ } else if(sscanf(ptr, "skip: %d", &num) == 1) { logmsg("instructed to skip this number of bytes %d", num); @@ -569,7 +567,7 @@ static void rtspd_storerequest(char *reqbuf, size_t totalsize) writeleft = totalsize; do { - written = fwrite(&reqbuf[totalsize-writeleft], 1, writeleft, dump); + written = fwrite(&reqbuf[totalsize - writeleft], 1, writeleft, dump); if(got_exit_signal) goto storerequest_cleanup; if(written > 0) @@ -584,7 +582,7 @@ static void rtspd_storerequest(char *reqbuf, size_t totalsize) logmsg("Error writing file %s error (%d) %s", dumpfile, error, curlx_strerror(error, errbuf, sizeof(errbuf))); logmsg("Wrote only (%zu bytes) of (%zu bytes) request input to %s", - totalsize-writeleft, totalsize, dumpfile); + totalsize - writeleft, totalsize, dumpfile); } storerequest_cleanup: @@ -636,7 +634,7 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req) /*** end of httprequest init ***/ - while(!done_processing && (req->offset < sizeof(req->reqbuf)-1)) { + while(!done_processing && (req->offset < sizeof(req->reqbuf) - 1)) { if(pipereq_length && pipereq) { memmove(reqbuf, pipereq, pipereq_length); got = curlx_uztosz(pipereq_length); @@ -650,7 +648,7 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req) got = sread(sock, reqbuf + req->offset, req->cl); else got = sread(sock, reqbuf + req->offset, - sizeof(req->reqbuf)-1 - req->offset); + sizeof(req->reqbuf) - 1 - req->offset); } if(got_exit_signal) return 1; @@ -686,16 +684,16 @@ static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req) } } - if((req->offset == sizeof(req->reqbuf)-1) && (got > 0)) { + if((req->offset == sizeof(req->reqbuf) - 1) && (got > 0)) { logmsg("Request would overflow buffer, closing connection"); /* dump request received so far to external file anyway */ - reqbuf[sizeof(req->reqbuf)-1] = '\0'; + reqbuf[sizeof(req->reqbuf) - 1] = '\0'; fail = 1; } - else if(req->offset > sizeof(req->reqbuf)-1) { + else if(req->offset > sizeof(req->reqbuf) - 1) { logmsg("Request buffer overflow, closing connection"); /* dump request received so far to external file anyway */ - reqbuf[sizeof(req->reqbuf)-1] = '\0'; + reqbuf[sizeof(req->reqbuf) - 1] = '\0'; fail = 1; } else @@ -739,10 +737,10 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) case RCMD_STREAM: { static const char streamthis[] = "a string to stream 01234567890\n"; for(;;) { - written = swrite(sock, streamthis, sizeof(streamthis)-1); + written = swrite(sock, streamthis, sizeof(streamthis) - 1); if(got_exit_signal) return -1; - if(written != (ssize_t)(sizeof(streamthis)-1)) { + if(written != (ssize_t)(sizeof(streamthis) - 1)) { logmsg("Stopped streaming"); break; } @@ -803,7 +801,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) } else { FILE *stream = test2fopen(req->testno, logdir); - char partbuf[80]="data"; + char partbuf[80] = "data"; if(req->partno) snprintf(partbuf, sizeof(partbuf), "data%ld", req->partno); if(!stream) { @@ -942,7 +940,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) if(sendfailure) { logmsg("Sending response failed. Only (%zu bytes) of " "(%zu bytes) were sent", - responsesize-count, responsesize); + responsesize - count, responsesize); free(ptr); free(cmd); return -1; @@ -997,7 +995,6 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req) return 0; } - static int test_rtspd(int argc, char *argv[]) { srvr_sockaddr_union_t me; @@ -1031,7 +1028,7 @@ static int test_rtspd(int argc, char *argv[]) #else "" #endif - ); + ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { @@ -1126,8 +1123,7 @@ static int test_rtspd(int argc, char *argv[]) } flag = 1; - if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag))) { + if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 08ece51ea141..9560a3967646 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -420,7 +420,7 @@ static DWORD WINAPI select_ws_wait_thread(void *lpParameter) DWORD type, length, ret; /* retrieve handles from internal structure */ - data = (struct select_ws_wait_data *) lpParameter; + data = (struct select_ws_wait_data *)lpParameter; if(data) { handle = data->handle; handles[0] = data->abort; @@ -434,120 +434,120 @@ static DWORD WINAPI select_ws_wait_thread(void *lpParameter) /* retrieve the type of file to wait on */ type = GetFileType(handle); switch(type) { - case FILE_TYPE_DISK: - /* The handle represents a file on disk, this means: - * - WaitForMultipleObjectsEx will always be signalled for it. - * - comparison of current position in file and total size of - * the file can be used to check if we reached the end yet. - * - * Approach: Loop till either the internal event is signalled - * or if the end of the file has already been reached. - */ - while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE) - == WAIT_TIMEOUT) { - /* get total size of file */ - length = 0; - size.QuadPart = 0; - size.LowPart = GetFileSize(handle, &length); - if((size.LowPart != INVALID_FILE_SIZE) || + case FILE_TYPE_DISK: + /* The handle represents a file on disk, this means: + * - WaitForMultipleObjectsEx will always be signalled for it. + * - comparison of current position in file and total size of + * the file can be used to check if we reached the end yet. + * + * Approach: Loop till either the internal event is signalled + * or if the end of the file has already been reached. + */ + while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE) + == WAIT_TIMEOUT) { + /* get total size of file */ + length = 0; + size.QuadPart = 0; + size.LowPart = GetFileSize(handle, &length); + if((size.LowPart != INVALID_FILE_SIZE) || + (GetLastError() == NO_ERROR)) { + size.HighPart = (LONG)length; + /* get the current position within the file */ + pos.QuadPart = 0; + pos.LowPart = SetFilePointer(handle, 0, &pos.HighPart, FILE_CURRENT); + if((pos.LowPart != INVALID_SET_FILE_POINTER) || (GetLastError() == NO_ERROR)) { - size.HighPart = (LONG)length; - /* get the current position within the file */ - pos.QuadPart = 0; - pos.LowPart = SetFilePointer(handle, 0, &pos.HighPart, FILE_CURRENT); - if((pos.LowPart != INVALID_SET_FILE_POINTER) || - (GetLastError() == NO_ERROR)) { - /* compare position with size, abort if not equal */ - if(size.QuadPart == pos.QuadPart) { - /* sleep and continue waiting */ - SleepEx(0, FALSE); - continue; - } + /* compare position with size, abort if not equal */ + if(size.QuadPart == pos.QuadPart) { + /* sleep and continue waiting */ + SleepEx(0, FALSE); + continue; } } - /* there is some data available, stop waiting */ - logmsg("[select_ws_wait_thread] data available, DISK: %p", handle); - SetEvent(signal); } - break; + /* there is some data available, stop waiting */ + logmsg("[select_ws_wait_thread] data available, DISK: %p", handle); + SetEvent(signal); + } + break; - case FILE_TYPE_CHAR: - /* The handle represents a character input, this means: - * - WaitForMultipleObjectsEx will be signalled on any kind of input, - * including mouse and window size events we do not care about. - * - * Approach: Loop till either the internal event is signalled - * or we get signalled for an actual key-event. - */ - while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE) - == WAIT_OBJECT_0 + 1) { - /* check if this is an actual console handle */ - if(GetConsoleMode(handle, &ret)) { - /* retrieve an event from the console buffer */ - length = 0; - if(PeekConsoleInput(handle, &inputrecord, 1, &length)) { - /* check if the event is not an actual key-event */ - if(length == 1 && inputrecord.EventType != KEY_EVENT) { - /* purge the non-key-event and continue waiting */ - ReadConsoleInput(handle, &inputrecord, 1, &length); - continue; - } + case FILE_TYPE_CHAR: + /* The handle represents a character input, this means: + * - WaitForMultipleObjectsEx will be signalled on any kind of input, + * including mouse and window size events we do not care about. + * + * Approach: Loop till either the internal event is signalled + * or we get signalled for an actual key-event. + */ + while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE) + == WAIT_OBJECT_0 + 1) { + /* check if this is an actual console handle */ + if(GetConsoleMode(handle, &ret)) { + /* retrieve an event from the console buffer */ + length = 0; + if(PeekConsoleInput(handle, &inputrecord, 1, &length)) { + /* check if the event is not an actual key-event */ + if(length == 1 && inputrecord.EventType != KEY_EVENT) { + /* purge the non-key-event and continue waiting */ + ReadConsoleInput(handle, &inputrecord, 1, &length); + continue; } } - /* there is some data available, stop waiting */ - logmsg("[select_ws_wait_thread] data available, CHAR: %p", handle); - SetEvent(signal); } - break; + /* there is some data available, stop waiting */ + logmsg("[select_ws_wait_thread] data available, CHAR: %p", handle); + SetEvent(signal); + } + break; - case FILE_TYPE_PIPE: - /* The handle represents an anonymous or named pipe, this means: - * - WaitForMultipleObjectsEx will always be signalled for it. - * - peek into the pipe and retrieve the amount of data available. - * - * Approach: Loop till either the internal event is signalled - * or there is data in the pipe available for reading. - */ - while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE) - == WAIT_TIMEOUT) { - /* peek into the pipe and retrieve the amount of data available */ - length = 0; - if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) { - /* if there is no data available, sleep and continue waiting */ - if(length == 0) { - SleepEx(0, FALSE); - continue; - } - else { - logmsg("[select_ws_wait_thread] PeekNamedPipe len: %lu", length); - } + case FILE_TYPE_PIPE: + /* The handle represents an anonymous or named pipe, this means: + * - WaitForMultipleObjectsEx will always be signalled for it. + * - peek into the pipe and retrieve the amount of data available. + * + * Approach: Loop till either the internal event is signalled + * or there is data in the pipe available for reading. + */ + while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE) + == WAIT_TIMEOUT) { + /* peek into the pipe and retrieve the amount of data available */ + length = 0; + if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) { + /* if there is no data available, sleep and continue waiting */ + if(length == 0) { + SleepEx(0, FALSE); + continue; } else { - /* if the pipe has NOT been closed, sleep and continue waiting */ - ret = GetLastError(); - if(ret != ERROR_BROKEN_PIPE) { - logmsg("[select_ws_wait_thread] PeekNamedPipe error (%lu)", ret); - SleepEx(0, FALSE); - continue; - } - else { - logmsg("[select_ws_wait_thread] pipe closed, PIPE: %p", handle); - } + logmsg("[select_ws_wait_thread] PeekNamedPipe len: %lu", length); } - /* there is some data available, stop waiting */ - logmsg("[select_ws_wait_thread] data available, PIPE: %p", handle); - SetEvent(signal); } - break; - - default: - /* The handle has an unknown type, try to wait on it */ - if(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE) - == WAIT_OBJECT_0 + 1) { - logmsg("[select_ws_wait_thread] data available, HANDLE: %p", handle); - SetEvent(signal); + else { + /* if the pipe has NOT been closed, sleep and continue waiting */ + ret = GetLastError(); + if(ret != ERROR_BROKEN_PIPE) { + logmsg("[select_ws_wait_thread] PeekNamedPipe error (%lu)", ret); + SleepEx(0, FALSE); + continue; + } + else { + logmsg("[select_ws_wait_thread] pipe closed, PIPE: %p", handle); + } } - break; + /* there is some data available, stop waiting */ + logmsg("[select_ws_wait_thread] data available, PIPE: %p", handle); + SetEvent(signal); + } + break; + + default: + /* The handle has an unknown type, try to wait on it */ + if(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE) + == WAIT_OBJECT_0 + 1) { + logmsg("[select_ws_wait_thread] data available, HANDLE: %p", handle); + SetEvent(signal); + } + break; } return 0; @@ -658,12 +658,12 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, if(FD_ISSET(wsasock, readfds)) { FD_SET(wsasock, &readsock); - wsaevents.lNetworkEvents |= FD_READ|FD_ACCEPT|FD_CLOSE; + wsaevents.lNetworkEvents |= FD_READ | FD_ACCEPT | FD_CLOSE; } if(FD_ISSET(wsasock, writefds)) { FD_SET(wsasock, &writesock); - wsaevents.lNetworkEvents |= FD_WRITE|FD_CONNECT|FD_CLOSE; + wsaevents.lNetworkEvents |= FD_WRITE | FD_CONNECT | FD_CLOSE; } if(FD_ISSET(wsasock, exceptfds)) { @@ -800,11 +800,11 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, wsaevents.lNetworkEvents |= data[i].wsastate; /* remove from descriptor set if not ready for read/accept/close */ - if(!(wsaevents.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE))) + if(!(wsaevents.lNetworkEvents & (FD_READ | FD_ACCEPT | FD_CLOSE))) FD_CLR(wsasock, readfds); /* remove from descriptor set if not ready for write/connect */ - if(!(wsaevents.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE))) + if(!(wsaevents.lNetworkEvents & (FD_WRITE | FD_CONNECT | FD_CLOSE))) FD_CLR(wsasock, writefds); /* remove from descriptor set if not exceptional */ @@ -851,10 +851,10 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, return ret; } -#define SOCKFILT_select(a,b,c,d,e) select_ws(a,b,c,d,e) +#define SOCKFILT_select(a, b, c, d, e) select_ws(a, b, c, d, e) #else -#define SOCKFILT_select(a,b,c,d,e) select(a,b,c,d,e) -#endif /* USE_WINSOCK */ +#define SOCKFILT_select(a, b, c, d, e) select(a, b, c, d, e) +#endif /* USE_WINSOCK */ /* Perform the disconnect handshake with sockfilt * This involves waiting for the disconnect acknowledgment after the DISC @@ -867,46 +867,45 @@ static bool disc_handshake(void) return FALSE; do { - unsigned char buffer[BUFFER_SIZE]; - ssize_t buffer_len; - if(!read_stdin(buffer, 5)) - return FALSE; - logmsg("Received %c%c%c%c (on stdin)", - buffer[0], buffer[1], buffer[2], buffer[3]); - - if(!memcmp("ACKD", buffer, 4)) { - /* got the ack we were waiting for */ - break; - } - else if(!memcmp("DISC", buffer, 4)) { - logmsg("Crikey! Client also wants to disconnect"); - if(!write_stdout("ACKD\n", 5)) - return FALSE; - } - else if(!memcmp("DATA", buffer, 4)) { - /* We must read more data to stay in sync */ - logmsg("Throwing away data bytes"); - if(!read_data_block(buffer, sizeof(buffer), &buffer_len)) - return FALSE; + unsigned char buffer[BUFFER_SIZE]; + ssize_t buffer_len; + if(!read_stdin(buffer, 5)) + return FALSE; + logmsg("Received %c%c%c%c (on stdin)", + buffer[0], buffer[1], buffer[2], buffer[3]); - } - else if(!memcmp("QUIT", buffer, 4)) { - /* just die */ - logmsg("quits"); + if(!memcmp("ACKD", buffer, 4)) { + /* got the ack we were waiting for */ + break; + } + else if(!memcmp("DISC", buffer, 4)) { + logmsg("Crikey! Client also wants to disconnect"); + if(!write_stdout("ACKD\n", 5)) return FALSE; - } - else { - logmsg("Unexpected message error; aborting"); - /* - * The only other messages that could occur here are PING and PORT, - * and both of them occur at the start of a test when nothing should be - * trying to DISC. Therefore, we should not ever get here, but if we - * do, it is probably due to some kind of unclean shutdown situation so - * us shutting down is what we probably ought to be doing, anyway. - */ + } + else if(!memcmp("DATA", buffer, 4)) { + /* We must read more data to stay in sync */ + logmsg("Throwing away data bytes"); + if(!read_data_block(buffer, sizeof(buffer), &buffer_len)) return FALSE; - } + } + else if(!memcmp("QUIT", buffer, 4)) { + /* just die */ + logmsg("quits"); + return FALSE; + } + else { + logmsg("Unexpected message error; aborting"); + /* + * The only other messages that could occur here are PING and PORT, + * and both of them occur at the start of a test when nothing should be + * trying to DISC. Therefore, we should not ever get here, but if we + * do, it is probably due to some kind of unclean shutdown situation so + * us shutting down is what we probably ought to be doing, anyway. + */ + return FALSE; + } } while(TRUE); return TRUE; } @@ -1034,7 +1033,6 @@ static bool juggle(curl_socket_t *sockfdp, } /* switch(*mode) */ - do { /* select() blocking behavior call on blocking descriptors please */ @@ -1058,7 +1056,6 @@ static bool juggle(curl_socket_t *sockfdp, /* timeout */ return TRUE; - if(FD_ISSET(fileno(stdin), &fds_read)) { ssize_t buffer_len; /* read from stdin, commands/data to be dealt with and possibly passed on @@ -1146,8 +1143,7 @@ static bool juggle(curl_socket_t *sockfdp, } } - - if((sockfd != CURL_SOCKET_BAD) && (FD_ISSET(sockfd, &fds_read)) ) { + if((sockfd != CURL_SOCKET_BAD) && (FD_ISSET(sockfd, &fds_read))) { ssize_t nread_socket; if(*mode == PASSIVE_LISTEN) { /* there is no stream set up yet, this is an indication that there is a @@ -1228,7 +1224,7 @@ static int test_sockfilt(int argc, char *argv[]) #else "" #endif - ); + ); return 0; } else if(!strcmp("--verbose", argv[arg])) { diff --git a/tests/server/socksd.c b/tests/server/socksd.c index 4205d26880bd..f9fadd211328 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -289,8 +289,8 @@ static curl_socket_t socks4(curl_socket_t fd, static curl_socket_t sockit(curl_socket_t fd) { - unsigned char buffer[2*256 + 16]; - unsigned char response[2*256 + 16]; + unsigned char buffer[2 * 256 + 16]; + unsigned char response[2 * 256 + 16]; ssize_t rc; unsigned char len; unsigned char type; @@ -483,7 +483,7 @@ static curl_socket_t sockit(curl_socket_t fd) case 3: /* The first octet of the address field contains the number of octets of name that follow */ - fprintf(dump, " %.*s\n", len-1, &address[1]); + fprintf(dump, " %.*s\n", len - 1, &address[1]); break; case 4: /* 16 bytes IPv6 address */ @@ -579,8 +579,7 @@ static int tunnel(struct perclient *cp, fd_set *fds) /* read from client, send to remote */ nread = recv(cp->clientfd, buffer, sizeof(buffer), 0); if(nread > 0) { - nwrite = send(cp->remotefd, (char *)buffer, - (SEND_TYPE_ARG3)nread, 0); + nwrite = send(cp->remotefd, (char *)buffer, (SEND_TYPE_ARG3)nread, 0); if(nwrite != nread) return 1; cp->fromclient += nwrite; @@ -592,8 +591,7 @@ static int tunnel(struct perclient *cp, fd_set *fds) /* read from remote, send to client */ nread = recv(cp->remotefd, buffer, sizeof(buffer), 0); if(nread > 0) { - nwrite = send(cp->clientfd, (char *)buffer, - (SEND_TYPE_ARG3)nread, 0); + nwrite = send(cp->clientfd, (char *)buffer, (SEND_TYPE_ARG3)nread, 0); if(nwrite != nread) return 1; cp->fromremote += nwrite; @@ -725,7 +723,6 @@ static bool socksd_incoming(curl_socket_t listenfd) cp->used = TRUE; clients++; } - } } for(i = 0; i < 2; i++) { @@ -777,7 +774,7 @@ static int test_socksd(int argc, char *argv[]) #else "" #endif - ); + ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { diff --git a/tests/server/sws.c b/tests/server/sws.c index b070614f525e..13f745546983 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -51,7 +51,7 @@ static bool sws_prevbounce = FALSE; /* instructs the server to override the #define RCMD_STREAM 2 /* told to stream */ struct sws_httprequest { - char reqbuf[2*1024*1024]; /* buffer area for the incoming request */ + char reqbuf[2 * 1024 * 1024]; /* buffer area for the incoming request */ bool connect_request; /* if a CONNECT */ unsigned short connect_port; /* the port number CONNECT used */ size_t checkindex; /* where to start checking of the request */ @@ -138,8 +138,7 @@ static const char *cmdfile = "log/server.cmd"; static const char *end_of_headers = END_OF_HEADERS; /* sent as reply to a QUIT */ -static const char *docquit_sws = -"HTTP/1.1 200 Goodbye" END_OF_HEADERS; +static const char *docquit_sws = "HTTP/1.1 200 Goodbye" END_OF_HEADERS; /* send back this on 404 file not found */ static const char *doc404 = "HTTP/1.1 404 Not Found\r\n" @@ -169,7 +168,7 @@ static bool socket_domain_is_ip(void) #endif return true; default: - /* case AF_UNIX: */ + /* case AF_UNIX: */ return false; } } @@ -334,12 +333,10 @@ static int sws_ProcessRequest(struct sws_httprequest *req) size_t npath = 0; /* httppath length */ if(sscanf(line, - "%" REQUEST_KEYWORD_SIZE_TXT"s ", request) == 1) { + "%" REQUEST_KEYWORD_SIZE_TXT "s ", request) == 1) { http = strstr(line + strlen(request), "HTTP/"); - if(http && sscanf(http, "HTTP/%d.%d", - &prot_major, - &prot_minor) == 2) { + if(http && sscanf(http, "HTTP/%d.%d", &prot_major, &prot_minor) == 2) { /* between the request keyword and HTTP/ there is a path */ httppath = line + strlen(request); npath = http - httppath; @@ -361,7 +358,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) if(fine) { char *ptr; - req->prot_version = prot_major*10 + prot_minor; + req->prot_version = prot_major * 10 + prot_minor; /* find the last slash */ ptr = &httppath[npath]; @@ -746,7 +743,7 @@ static void sws_storerequest(const char *reqbuf, size_t totalsize) writeleft = totalsize; do { - written = fwrite(&reqbuf[totalsize-writeleft], 1, writeleft, dump); + written = fwrite(&reqbuf[totalsize - writeleft], 1, writeleft, dump); if(got_exit_signal) goto storerequest_cleanup; if(written > 0) @@ -761,7 +758,7 @@ static void sws_storerequest(const char *reqbuf, size_t totalsize) logmsg("Error writing file %s error (%d) %s", dumpfile, error, curlx_strerror(error, errbuf, sizeof(errbuf))); logmsg("Wrote only (%zu bytes) of (%zu bytes) request input to %s", - totalsize-writeleft, totalsize, dumpfile); + totalsize - writeleft, totalsize, dumpfile); } storerequest_cleanup: @@ -876,7 +873,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) return -1; } - if(req->offset >= sizeof(req->reqbuf)-1) { + if(req->offset >= sizeof(req->reqbuf) - 1) { /* buffer is already full; do nothing */ overflow = 1; } @@ -888,7 +885,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) got = sread(sock, reqbuf + req->offset, req->cl); else got = sread(sock, reqbuf + req->offset, - sizeof(req->reqbuf)-1 - req->offset); + sizeof(req->reqbuf) - 1 - req->offset); if(got_exit_signal) return -1; @@ -924,16 +921,16 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) return -1; } - if(overflow || (req->offset == sizeof(req->reqbuf)-1 && got > 0)) { + if(overflow || (req->offset == sizeof(req->reqbuf) - 1 && got > 0)) { logmsg("Request would overflow buffer, closing connection"); /* dump request received so far to external file anyway */ - reqbuf[sizeof(req->reqbuf)-1] = '\0'; + reqbuf[sizeof(req->reqbuf) - 1] = '\0'; fail = 1; } - else if(req->offset > sizeof(req->reqbuf)-1) { + else if(req->offset > sizeof(req->reqbuf) - 1) { logmsg("Request buffer overflow, closing connection"); /* dump request received so far to external file anyway */ - reqbuf[sizeof(req->reqbuf)-1] = '\0'; + reqbuf[sizeof(req->reqbuf) - 1] = '\0'; fail = 1; } else @@ -978,10 +975,10 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) case RCMD_STREAM: { static const char streamthis[] = "a string to stream 01234567890\n"; for(;;) { - written = swrite(sock, streamthis, sizeof(streamthis)-1); + written = swrite(sock, streamthis, sizeof(streamthis) - 1); if(got_exit_signal) return -1; - if(written != (ssize_t)(sizeof(streamthis)-1)) { + if(written != (ssize_t)(sizeof(streamthis) - 1)) { logmsg("Stopped streaming"); break; } @@ -1144,7 +1141,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) if(req->writedelay) { int msecs_left = req->writedelay; int intervals = msecs_left / MAX_SLEEP_TIME_MS; - if(msecs_left%MAX_SLEEP_TIME_MS) + if(msecs_left % MAX_SLEEP_TIME_MS) intervals++; logmsg("Pausing %d milliseconds after writing %zd bytes", msecs_left, written); @@ -1172,7 +1169,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) if(sendfailure) { logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) " "were sent", - responsesize-count, responsesize); + responsesize - count, responsesize); sws_prevtestno = req->testno; sws_prevpartno = req->partno; free(ptr); @@ -1247,9 +1244,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port) if(!ipaddr) return CURL_SOCKET_BAD; - logmsg("about to connect to %s%s%s:%hu", - op_br, ipaddr, cl_br, port); - + logmsg("about to connect to %s%s%s:%hu", op_br, ipaddr, cl_br, port); serverfd = socket(socket_domain, SOCK_STREAM, 0); if(CURL_SOCKET_BAD == serverfd) { @@ -1389,7 +1384,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port) * must accept a new connection and deal with it appropriately. */ -#define data_or_ctrl(x) ((x)?"DATA":"CTRL") +#define data_or_ctrl(x) ((x) ? "DATA" : "CTRL") #define SWS_CTRL 0 #define SWS_DATA 1 @@ -1644,7 +1639,7 @@ static void http_connect(curl_socket_t *infdp, } } if(serverfd[i] != CURL_SOCKET_BAD) { - len = sizeof(readserver[i])-toc[i]; + len = sizeof(readserver[i]) - toc[i]; if(len && FD_ISSET(serverfd[i], &input)) { /* read from server */ rc = sread(serverfd[i], &readserver[i][toc[i]], len); @@ -1676,7 +1671,7 @@ static void http_connect(curl_socket_t *infdp, logmsg("[%s] SENT \"%s\"", data_or_ctrl(i), data_to_hex(readserver[i], rc)); if(toc[i] - rc) - memmove(&readserver[i][0], &readserver[i][rc], toc[i]-rc); + memmove(&readserver[i][0], &readserver[i][rc], toc[i] - rc); toc[i] -= rc; } } @@ -1696,7 +1691,7 @@ static void http_connect(curl_socket_t *infdp, logmsg("[%s] SENT \"%s\"", data_or_ctrl(i), data_to_hex(readclient[i], rc)); if(tos[i] - rc) - memmove(&readclient[i][0], &readclient[i][rc], tos[i]-rc); + memmove(&readclient[i][0], &readclient[i][rc], tos[i] - rc); tos[i] -= rc; } } @@ -1826,7 +1821,6 @@ static void http_upgrade(struct sws_httprequest *req) /* left to implement */ } - /* returns a socket handle, or 0 if there are no more waiting sockets, or < 0 if there was an error */ static curl_socket_t accept_connection(curl_socket_t sock) @@ -2021,12 +2015,12 @@ static int test_sws(int argc, char *argv[]) if(!strcmp("--version", argv[arg])) { puts("sws IPv4" #ifdef USE_IPV6 - "/IPv6" + "/IPv6" #endif #ifdef USE_UNIX_SOCKETS - "/unix" + "/unix" #endif - ); + ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { @@ -2097,8 +2091,7 @@ static int test_sws(int argc, char *argv[]) if(argc > arg) { opt = argv[arg]; if(curlx_str_number(&opt, &num, 0xffff)) { - fprintf(stderr, "sws: invalid --port argument (%s)\n", - argv[arg]); + fprintf(stderr, "sws: invalid --port argument (%s)\n", argv[arg]); return 0; } port = (unsigned short)num; @@ -2327,9 +2320,9 @@ static int test_sws(int argc, char *argv[]) /* Clear out closed sockets */ for(socket_idx = num_sockets - 1; socket_idx >= 1; --socket_idx) { if(CURL_SOCKET_BAD == all_sockets[socket_idx]) { - char *dst = (char *) (all_sockets + socket_idx); - char *src = (char *) (all_sockets + socket_idx + 1); - char *end = (char *) (all_sockets + num_sockets); + char *dst = (char *)(all_sockets + socket_idx); + char *src = (char *)(all_sockets + socket_idx + 1); + char *end = (char *)(all_sockets + num_sockets); memmove(dst, src, end - src); num_sockets -= 1; } diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 2eb31ff5ece8..99c008031eab 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -380,7 +380,7 @@ static void read_ahead(struct testcase *test, } p = dp->th_data; - for(i = 0 ; i < SEGSIZE; i++) { + for(i = 0; i < SEGSIZE; i++) { if(newline) { if(prevchar == '\n') c = '\n'; /* lf to cr,lf */ @@ -536,8 +536,7 @@ static int synchnet(curl_socket_t f /* socket to flush */) else fromaddrlen = sizeof(fromaddr.sa6); #endif - (void)recvfrom(f, rbuf, sizeof(rbuf), 0, - &fromaddr.sa, &fromaddrlen); + (void)recvfrom(f, rbuf, sizeof(rbuf), 0, &fromaddr.sa, &fromaddrlen); } else break; @@ -578,7 +577,7 @@ static int test_tftpd(int argc, char **argv) #else "" #endif - ); + ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { @@ -674,8 +673,7 @@ static int test_tftpd(int argc, char **argv) } flag = 1; - if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag))) { + if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); @@ -825,7 +823,7 @@ static int test_tftpd(int argc, char **argv) } #endif - maxtimeout = 5*TIMEOUT; + maxtimeout = 5 * TIMEOUT; tp = &trsbuf.hdr; tp->th_opcode = ntohs(tp->th_opcode); @@ -1076,7 +1074,6 @@ static int tftpd_parse_servercmd(struct testcase *req) return 0; /* OK! */ } - /* * Validate file access. */ @@ -1104,7 +1101,7 @@ static int validate_access(struct testcase *test, ptr = strrchr(filename, '/'); if(ptr) { - char partbuf[80]="data"; + char partbuf[80] = "data"; long partno; long testno; const char *pval; @@ -1209,7 +1206,7 @@ static void sendtftp(struct testcase *test, const struct formats *pf) if(test->writedelay) { logmsg("Pausing %d seconds before %d bytes", test->writedelay, size); - curlx_wait_ms(1000*test->writedelay); + curlx_wait_ms(1000 * test->writedelay); } send_data: @@ -1249,11 +1246,10 @@ static void sendtftp(struct testcase *test, const struct formats *pf) } /* Re-synchronize with the other side */ (void)synchnet(peer); - if(sap->th_block == (sendblock-1)) { + if(sap->th_block == (sendblock - 1)) { goto send_data; } } - } sendblock++; } while(size == SEGSIZE); diff --git a/tests/server/util.c b/tests/server/util.c index ae21ff8b1af8..624826571a9f 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -37,7 +37,7 @@ */ char *data_to_hex(char *data, size_t len) { - static char buf[256*3]; + static char buf[256 * 3]; size_t i; char *optr = buf; char *iptr = data; @@ -177,18 +177,18 @@ int win32_init(void) } if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) || - HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) { + HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested)) { WSACleanup(); win32_perror("Winsock init failed"); logmsg("No suitable winsock.dll found -- aborting"); return 1; } } -#endif /* USE_WINSOCK */ +#endif /* USE_WINSOCK */ atexit(win32_cleanup); return 0; } -#endif /* _WIN32 */ +#endif /* _WIN32 */ /* fopens the test case file */ FILE *test2fopen(long testno, const char *logdir2) @@ -370,8 +370,7 @@ static void exit_signal_handler(int signum) fd != -1) { #else /* !checksrc! disable BANNEDFUNC 1 */ - fd = open(serverlogfile, - O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); + fd = open(serverlogfile, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); if(fd != -1) { #endif static const char msg[] = "exit_signal_handler: called\n"; @@ -546,7 +545,7 @@ static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler, #ifdef HAVE_SIGINTERRUPT if(oldhdlr != SIG_ERR) - siginterrupt(signum, (int) restartable); + siginterrupt(signum, (int)restartable); #else (void)restartable; #endif @@ -693,7 +692,7 @@ int bind_unix_socket(curl_socket_t sock, const char *unix_socket, return -1; } strcpy(sau->sun_path, unix_socket); - rc = bind(sock, (struct sockaddr*)sau, sizeof(struct sockaddr_un)); + rc = bind(sock, (struct sockaddr *)sau, sizeof(struct sockaddr_un)); if(rc && SOCKERRNO == SOCKEADDRINUSE) { struct_stat statbuf; /* socket already exists. Perhaps it is stale? */ @@ -738,7 +737,7 @@ int bind_unix_socket(curl_socket_t sock, const char *unix_socket, return rc; } /* stale socket is gone, retry bind */ - rc = bind(sock, (struct sockaddr*)sau, sizeof(struct sockaddr_un)); + rc = bind(sock, (struct sockaddr *)sau, sizeof(struct sockaddr_un)); } return rc; } @@ -805,29 +804,29 @@ curl_socket_t sockdaemon(curl_socket_t sock, request to let the system choose a non-zero available port. */ switch(socket_domain) { - case AF_INET: - memset(&listener.sa4, 0, sizeof(listener.sa4)); - listener.sa4.sin_family = AF_INET; - listener.sa4.sin_addr.s_addr = INADDR_ANY; - listener.sa4.sin_port = htons(*listenport); - rc = bind(sock, &listener.sa, sizeof(listener.sa4)); - break; + case AF_INET: + memset(&listener.sa4, 0, sizeof(listener.sa4)); + listener.sa4.sin_family = AF_INET; + listener.sa4.sin_addr.s_addr = INADDR_ANY; + listener.sa4.sin_port = htons(*listenport); + rc = bind(sock, &listener.sa, sizeof(listener.sa4)); + break; #ifdef USE_IPV6 - case AF_INET6: - memset(&listener.sa6, 0, sizeof(listener.sa6)); - listener.sa6.sin6_family = AF_INET6; - listener.sa6.sin6_addr = in6addr_any; - listener.sa6.sin6_port = htons(*listenport); - rc = bind(sock, &listener.sa, sizeof(listener.sa6)); - break; + case AF_INET6: + memset(&listener.sa6, 0, sizeof(listener.sa6)); + listener.sa6.sin6_family = AF_INET6; + listener.sa6.sin6_addr = in6addr_any; + listener.sa6.sin6_port = htons(*listenport); + rc = bind(sock, &listener.sa, sizeof(listener.sa6)); + break; #endif /* USE_IPV6 */ #ifdef USE_UNIX_SOCKETS - case AF_UNIX: - rc = bind_unix_socket(sock, unix_socket, &listener.sau); - break; + case AF_UNIX: + rc = bind_unix_socket(sock, unix_socket, &listener.sau); + break; #endif - default: - rc = 1; + default: + rc = 1; } if(rc) { diff --git a/tests/unit/unit1300.c b/tests/unit/unit1300.c index 77fb1fb38639..53da9dd4f661 100644 --- a/tests/unit/unit1300.c +++ b/tests/unit/unit1300.c @@ -65,7 +65,7 @@ static CURLcode test_unit1300(const char *arg) * 2: list head will be NULL * 3: list tail will be NULL * 4: list dtor will be NULL - */ + */ fail_unless(Curl_llist_count(&llist) == 0, "list initial size should be zero"); diff --git a/tests/unit/unit1302.c b/tests/unit/unit1302.c index d56f7b09f779..157f1f61ed9c 100644 --- a/tests/unit/unit1302.c +++ b/tests/unit/unit1302.c @@ -124,7 +124,7 @@ static CURLcode test_unit1302(const char *arg) {"", 0, "aWlpaWlpaQ=", 15} /* unaligned size, missing a padding char */ }; - for(i = 0 ; i < CURL_ARRAYSIZE(encode); i++) { + for(i = 0; i < CURL_ARRAYSIZE(encode); i++) { struct etest *e = &encode[i]; char *out; unsigned char *decoded; @@ -180,7 +180,7 @@ static CURLcode test_unit1302(const char *arg) Curl_safefree(out); } - for(i = 0 ; i < CURL_ARRAYSIZE(badecode); i++) { + for(i = 0; i < CURL_ARRAYSIZE(badecode); i++) { struct etest *e = &badecode[i]; unsigned char *decoded; size_t dlen; diff --git a/tests/unit/unit1304.c b/tests/unit/unit1304.c index 100f3f58287e..3e09a0c27761 100644 --- a/tests/unit/unit1304.c +++ b/tests/unit/unit1304.c @@ -46,8 +46,7 @@ static CURLcode test_unit1304(const char *arg) * Test a non existent host in our netrc file. */ Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "test.example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "test.example.com", &login, &password, arg); fail_unless(result == 1, "Host not found should return 1"); abort_unless(password == NULL, "password did not return NULL!"); abort_unless(login == NULL, "user did not return NULL!"); @@ -58,8 +57,7 @@ static CURLcode test_unit1304(const char *arg) */ login = (char *)CURL_UNCONST("me"); Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password == NULL, "password is not NULL!"); Curl_netrc_cleanup(&store); @@ -69,8 +67,7 @@ static CURLcode test_unit1304(const char *arg) */ login = (char *)CURL_UNCONST("me"); Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "test.example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "test.example.com", &login, &password, arg); fail_unless(result == 1, "Host not found should return 1"); abort_unless(password == NULL, "password is not NULL!"); Curl_netrc_cleanup(&store); @@ -81,8 +78,7 @@ static CURLcode test_unit1304(const char *arg) */ login = (char *)CURL_UNCONST("admi"); /* spellchecker:disable-line */ Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password == NULL, "password is not NULL!"); Curl_netrc_cleanup(&store); @@ -93,8 +89,7 @@ static CURLcode test_unit1304(const char *arg) */ login = (char *)CURL_UNCONST("adminn"); Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password == NULL, "password is not NULL!"); Curl_netrc_cleanup(&store); @@ -105,8 +100,7 @@ static CURLcode test_unit1304(const char *arg) */ login = NULL; Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(strncmp(password, "passwd", 6) == 0, @@ -124,8 +118,7 @@ static CURLcode test_unit1304(const char *arg) password = NULL; login = NULL; Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(strncmp(password, "passwd", 6) == 0, @@ -143,12 +136,10 @@ static CURLcode test_unit1304(const char *arg) curlx_free(login); login = NULL; Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "curl.example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "curl.example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); - fail_unless(strncmp(password, "none", 4) == 0, - "password should be 'none'"); + fail_unless(strncmp(password, "none", 4) == 0, "password should be 'none'"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "none", 4) == 0, "login should be 'none'"); Curl_netrc_cleanup(&store); @@ -162,12 +153,10 @@ static CURLcode test_unit1304(const char *arg) curlx_free(login); login = NULL; Curl_netrc_init(&store); - result = Curl_parsenetrc(&store, - "curl.example.com", &login, &password, arg); + result = Curl_parsenetrc(&store, "curl.example.com", &login, &password, arg); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); - fail_unless(strncmp(password, "none", 4) == 0, - "password should be 'none'"); + fail_unless(strncmp(password, "none", 4) == 0, "password should be 'none'"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "none", 4) == 0, "login should be 'none'"); Curl_netrc_cleanup(&store); diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c index d5fcf5c6b1ed..3651b341ed39 100644 --- a/tests/unit/unit1307.c +++ b/tests/unit/unit1307.c @@ -290,7 +290,7 @@ static CURLcode test_unit1307(const char *arg) for(i = 0; i < CURL_ARRAYSIZE(tests); i++) { int result = tests[i].result; int rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string); - if(result & (LINUX_DIFFER|MAC_DIFFER)) { + if(result & (LINUX_DIFFER | MAC_DIFFER)) { if((result & LINUX_DIFFER) && (machine == SYSTEM_LINUX)) result >>= LINUX_SHIFT; else if((result & MAC_DIFFER) && (machine == SYSTEM_MACOS)) diff --git a/tests/unit/unit1309.c b/tests/unit/unit1309.c index 2e2af21f2c75..af9a29e11085 100644 --- a/tests/unit/unit1309.c +++ b/tests/unit/unit1309.c @@ -63,8 +63,8 @@ static CURLcode test_unit1309(const char *arg) #define NUM_NODES 50 struct Curl_tree *root, *removed; - struct Curl_tree nodes[NUM_NODES*3]; - size_t storage[NUM_NODES*3]; + struct Curl_tree nodes[NUM_NODES * 3]; + size_t storage[NUM_NODES * 3]; int rc; int i, j; struct curltime tv_now = {0, 0}; @@ -75,7 +75,7 @@ static CURLcode test_unit1309(const char *arg) struct curltime key; key.tv_sec = 0; - key.tv_usec = (541*i)%1023; + key.tv_usec = (541 * i) % 1023; storage[i] = key.tv_usec; Curl_splayset(&nodes[i], &storage[i]); root = Curl_splayinsert(key, root, &nodes[i]); @@ -85,7 +85,7 @@ static CURLcode test_unit1309(const char *arg) splayprint(root, 0, 1); for(i = 0; i < NUM_NODES; i++) { - int rem = (i + 7)%NUM_NODES; + int rem = (i + 7) % NUM_NODES; curl_mprintf("Tree look:\n"); splayprint(root, 0, 1); curl_mprintf("remove pointer %d, payload %zu\n", rem, @@ -105,11 +105,11 @@ static CURLcode test_unit1309(const char *arg) struct curltime key; key.tv_sec = 0; - key.tv_usec = (541*i)%1023; + key.tv_usec = (541 * i) % 1023; /* add some nodes with the same key */ for(j = 0; j <= i % 3; j++) { - storage[i * 3 + j] = key.tv_usec*10 + j; + storage[i * 3 + j] = key.tv_usec * 10 + j; Curl_splayset(&nodes[i * 3 + j], &storage[i * 3 + j]); root = Curl_splayinsert(key, root, &nodes[i * 3 + j]); } diff --git a/tests/unit/unit1397.c b/tests/unit/unit1397.c index 7d3d4fd7f798..e56b894e36b3 100644 --- a/tests/unit/unit1397.c +++ b/tests/unit/unit1397.c @@ -103,7 +103,7 @@ static CURLcode test_unit1397(const char *arg) "did %sMATCH\n", tests[i].host, tests[i].pattern, - tests[i].match ? "NOT ": ""); + tests[i].match ? "NOT " : ""); unitfail++; } } diff --git a/tests/unit/unit1398.c b/tests/unit/unit1398.c index 1b72bf1163b1..abd4447ca464 100644 --- a/tests/unit/unit1398.c +++ b/tests/unit/unit1398.c @@ -118,7 +118,7 @@ static CURLcode test_unit1398(const char *arg) "%s%s%s%s%s%s%s%s%s%s" /* 100 */ "%s%s%s%s%s%s%s%s%s%s" /* 110 */ "%s%s%s%s%s%s%s%s%s%s" /* 120 */ - "%s%s%s%s%s%s%s%s%s", /* 129 */ + "%s%s%s%s%s%s%s%s%s", /* 129 */ "a", "", "", "", "", "", "", "", "", "", /* 10 */ "b", "", "", "", "", "", "", "", "", "", /* 20 */ @@ -132,8 +132,8 @@ static CURLcode test_unit1398(const char *arg) "j", "", "", "", "", "", "", "", "", "", /* 100 */ "k", "", "", "", "", "", "", "", "", "", /* 110 */ "l", "", "", "", "", "", "", "", "", "", /* 120 */ - "m", "", "", "", "", "", "", "", "" /* 129 */ - ); + "m", "", "", "", "", "", "", "", "" /* 129 */ + ); fail_unless(rc == 0, "return code should be 0"); /* 128 input % flags */ @@ -150,7 +150,7 @@ static CURLcode test_unit1398(const char *arg) "%s%s%s%s%s%s%s%s%s%s" /* 100 */ "%s%s%s%s%s%s%s%s%s%s" /* 110 */ "%s%s%s%s%s%s%s%s%s%s" /* 120 */ - "%s%s%s%s%s%s%s%s", /* 128 */ + "%s%s%s%s%s%s%s%s", /* 128 */ "a", "", "", "", "", "", "", "", "", "", /* 10 */ "b", "", "", "", "", "", "", "", "", "", /* 20 */ @@ -164,8 +164,8 @@ static CURLcode test_unit1398(const char *arg) "j", "", "", "", "", "", "", "", "", "", /* 100 */ "k", "", "", "", "", "", "", "", "", "", /* 110 */ "l", "", "", "", "", "", "", "", "", "", /* 120 */ - "m", "", "", "", "", "", "", "" /* 128 */ - ); + "m", "", "", "", "", "", "", "" /* 128 */ + ); fail_unless(rc == 13, "return code should be 13"); /* 129 output segments */ @@ -176,8 +176,8 @@ static CURLcode test_unit1398(const char *arg) "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" /* 80 */ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" /* 100 */ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" /* 120 */ - "%%%%%%%%%%%%%%%%%%" /* 129 */ - ); + "%%%%%%%%%%%%%%%%%%" /* 129 */ + ); fail_unless(rc == 0, "return code should be 0"); /* 128 output segments */ @@ -188,8 +188,8 @@ static CURLcode test_unit1398(const char *arg) "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" /* 80 */ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" /* 100 */ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" /* 120 */ - "%%%%%%%%%%%%%%%%" /* 128 */ - ); + "%%%%%%%%%%%%%%%%" /* 128 */ + ); fail_unless(rc == 128, "return code should be 128"); UNITTEST_END_SIMPLE diff --git a/tests/unit/unit1601.c b/tests/unit/unit1601.c index d31866bb741a..fa7743785dcf 100644 --- a/tests/unit/unit1601.c +++ b/tests/unit/unit1601.c @@ -37,7 +37,7 @@ static CURLcode test_unit1601(const char *arg) unsigned char output[MD5_DIGEST_LEN]; unsigned char *testp = output; - Curl_md5it(output, (const unsigned char *) string1, strlen(string1)); + Curl_md5it(output, (const unsigned char *)string1, strlen(string1)); verify_memory(testp, "\xc4\xca\x42\x38\xa0\xb9\x23\x82\x0d\xcc\x50\x9a\x6f" "\x75\x84\x9b", MD5_DIGEST_LEN); diff --git a/tests/unit/unit1606.c b/tests/unit/unit1606.c index 4e290db72a76..c7f3d718c7d4 100644 --- a/tests/unit/unit1606.c +++ b/tests/unit/unit1606.c @@ -82,18 +82,12 @@ static CURLcode test_unit1606(const char *arg) UNITTEST_BEGIN(t1606_setup(&easy)) - fail_unless(runawhile(easy, 41, 41, 40, 0) == 41, - "wrong low speed timeout"); - fail_unless(runawhile(easy, 21, 21, 20, 0) == 21, - "wrong low speed timeout"); - fail_unless(runawhile(easy, 60, 60, 40, 0) == 60, - "wrong log speed timeout"); - fail_unless(runawhile(easy, 50, 50, 40, 0) == 50, - "wrong log speed timeout"); - fail_unless(runawhile(easy, 40, 40, 40, 0) == 99, - "should not time out"); - fail_unless(runawhile(easy, 10, 50, 100, 2) == 36, - "bad timeout"); + fail_unless(runawhile(easy, 41, 41, 40, 0) == 41, "wrong low speed timeout"); + fail_unless(runawhile(easy, 21, 21, 20, 0) == 21, "wrong low speed timeout"); + fail_unless(runawhile(easy, 60, 60, 40, 0) == 60, "wrong log speed timeout"); + fail_unless(runawhile(easy, 50, 50, 40, 0) == 50, "wrong log speed timeout"); + fail_unless(runawhile(easy, 40, 40, 40, 0) == 99, "should not time out"); + fail_unless(runawhile(easy, 10, 50, 100, 2) == 36, "bad timeout"); UNITTEST_END(t1606_stop(easy)) } diff --git a/tests/unit/unit1610.c b/tests/unit/unit1610.c index 73a546a85eaf..5c47fe28e2c6 100644 --- a/tests/unit/unit1610.c +++ b/tests/unit/unit1610.c @@ -44,14 +44,14 @@ static CURLcode test_unit1610(const char *arg) unsigned char output[CURL_SHA256_DIGEST_LENGTH]; unsigned char *testp = output; - Curl_sha256it(output, (const unsigned char *) string1, strlen(string1)); + Curl_sha256it(output, (const unsigned char *)string1, strlen(string1)); verify_memory(testp, "\x6b\x86\xb2\x73\xff\x34\xfc\xe1\x9d\x6b\x80\x4e\xff\x5a\x3f" "\x57\x47\xad\xa4\xea\xa2\x2f\x1d\x49\xc0\x1e\x52\xdd\xb7\x87" "\x5b\x4b", CURL_SHA256_DIGEST_LENGTH); - Curl_sha256it(output, (const unsigned char *) string2, strlen(string2)); + Curl_sha256it(output, (const unsigned char *)string2, strlen(string2)); verify_memory(testp, "\xcb\xb1\x6a\x8a\xb9\xcb\xb9\x35\xa8\xcb\xa0\x2e\x28\xc0\x26" diff --git a/tests/unit/unit1611.c b/tests/unit/unit1611.c index 5337aa33a319..88c79eb3d9af 100644 --- a/tests/unit/unit1611.c +++ b/tests/unit/unit1611.c @@ -35,13 +35,13 @@ static CURLcode test_unit1611(const char *arg) unsigned char output[MD4_DIGEST_LENGTH]; unsigned char *testp = output; - Curl_md4it(output, (const unsigned char *) string1, strlen(string1)); + Curl_md4it(output, (const unsigned char *)string1, strlen(string1)); verify_memory(testp, "\x8b\xe1\xec\x69\x7b\x14\xad\x3a\x53\xb3\x71\x43\x61\x20\x64" "\x1d", MD4_DIGEST_LENGTH); - Curl_md4it(output, (const unsigned char *) string2, strlen(string2)); + Curl_md4it(output, (const unsigned char *)string2, strlen(string2)); verify_memory(testp, "\xa7\x16\x1c\xad\x7e\xbe\xdb\xbc\xf8\xc7\x23\x10\x2d\x2c\xe2" diff --git a/tests/unit/unit1612.c b/tests/unit/unit1612.c index 0cc0c0254667..7d8c9acf96b6 100644 --- a/tests/unit/unit1612.c +++ b/tests/unit/unit1612.c @@ -40,8 +40,8 @@ static CURLcode test_unit1612(const char *arg) unsigned char *testp = output; Curl_hmacit(&Curl_HMAC_MD5, - (const unsigned char *) password, strlen(password), - (const unsigned char *) string1, strlen(string1), + (const unsigned char *)password, strlen(password), + (const unsigned char *)string1, strlen(string1), output); verify_memory(testp, @@ -49,8 +49,8 @@ static CURLcode test_unit1612(const char *arg) "\x37", HMAC_MD5_LENGTH); Curl_hmacit(&Curl_HMAC_MD5, - (const unsigned char *) password, strlen(password), - (const unsigned char *) string2, strlen(string2), + (const unsigned char *)password, strlen(password), + (const unsigned char *)string2, strlen(string2), output); verify_memory(testp, diff --git a/tests/unit/unit1614.c b/tests/unit/unit1614.c index 10140ee60282..675133e5adf6 100644 --- a/tests/unit/unit1614.c +++ b/tests/unit/unit1614.c @@ -34,12 +34,12 @@ static CURLcode test_unit1614(const char *arg) int err = 0; struct check { - const char *a; + const char *a; const char *n; unsigned int bits; bool match; }; - struct check list4[]= { + struct check list4[] = { { "192.160.0.1", "192.160.0.1", 33, FALSE}, { "192.160.0.1", "192.160.0.1", 32, TRUE}, { "192.160.0.1", "192.160.0.1", 0, TRUE}, @@ -55,7 +55,7 @@ static CURLcode test_unit1614(const char *arg) { NULL, NULL, 0, FALSE} /* end marker */ }; #ifdef USE_IPV6 - struct check list6[]= { + struct check list6[] = { { "::1", "::1", 0, TRUE}, { "::1", "::1", 128, TRUE}, { "::1", "0:0::1", 128, TRUE}, @@ -69,7 +69,7 @@ static CURLcode test_unit1614(const char *arg) const char *n; bool match; }; - struct noproxy list[]= { + struct noproxy list[] = { { "www.example.com", "localhost .example.com .example.de", FALSE}, { "www.example.com", "localhost,.example.com,.example.de", TRUE}, { "www.example.com.", "localhost,.example.com,.example.de", TRUE}, @@ -161,7 +161,7 @@ static CURLcode test_unit1614(const char *arg) if(match != list4[i].match) { curl_mfprintf(stderr, "%s in %s/%u should %smatch\n", list4[i].a, list4[i].n, list4[i].bits, - list4[i].match ? "": "not "); + list4[i].match ? "" : "not "); err++; } } @@ -171,7 +171,7 @@ static CURLcode test_unit1614(const char *arg) if(match != list6[i].match) { curl_mfprintf(stderr, "%s in %s/%u should %smatch\n", list6[i].a, list6[i].n, list6[i].bits, - list6[i].match ? "": "not "); + list6[i].match ? "" : "not "); err++; } } @@ -181,7 +181,7 @@ static CURLcode test_unit1614(const char *arg) if(match != list[i].match) { curl_mfprintf(stderr, "%s in %s should %smatch\n", list[i].a, list[i].n, - list[i].match ? "": "not "); + list[i].match ? "" : "not "); err++; } } diff --git a/tests/unit/unit1615.c b/tests/unit/unit1615.c index 44dc1ae04545..fadb1aaa59b4 100644 --- a/tests/unit/unit1615.c +++ b/tests/unit/unit1615.c @@ -113,31 +113,31 @@ static CURLcode test_unit1615(const char *arg) /* Mute compiler warnings in 'verify_memory' macros below */ computed_hash = output_buf; - Curl_sha512_256it(output_buf, (const unsigned char *) test_str1, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str1, CURL_ARRAYSIZE(test_str1) - 1); verify_memory(computed_hash, precomp_hash1, CURL_SHA512_256_DIGEST_LENGTH); - Curl_sha512_256it(output_buf, (const unsigned char *) test_str2, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str2, CURL_ARRAYSIZE(test_str2) - 1); verify_memory(computed_hash, precomp_hash2, CURL_SHA512_256_DIGEST_LENGTH); - Curl_sha512_256it(output_buf, (const unsigned char *) test_str3, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str3, CURL_ARRAYSIZE(test_str3) - 1); verify_memory(computed_hash, precomp_hash3, CURL_SHA512_256_DIGEST_LENGTH); - Curl_sha512_256it(output_buf, (const unsigned char *) test_str4, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str4, CURL_ARRAYSIZE(test_str4) - 1); verify_memory(computed_hash, precomp_hash4, CURL_SHA512_256_DIGEST_LENGTH); - Curl_sha512_256it(output_buf, (const unsigned char *) test_str5, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str5, CURL_ARRAYSIZE(test_str5) - 1); verify_memory(computed_hash, precomp_hash5, CURL_SHA512_256_DIGEST_LENGTH); - Curl_sha512_256it(output_buf, (const unsigned char *) test_str6, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str6, CURL_ARRAYSIZE(test_str6) - 1); verify_memory(computed_hash, precomp_hash6, CURL_SHA512_256_DIGEST_LENGTH); - Curl_sha512_256it(output_buf, (const unsigned char *) test_str7, + Curl_sha512_256it(output_buf, (const unsigned char *)test_str7, CURL_ARRAYSIZE(test_str7) - 1); verify_memory(computed_hash, precomp_hash7, CURL_SHA512_256_DIGEST_LENGTH); diff --git a/tests/unit/unit1620.c b/tests/unit/unit1620.c index 4c1674f5bd54..b04424ae3bd3 100644 --- a/tests/unit/unit1620.c +++ b/tests/unit/unit1620.c @@ -116,8 +116,7 @@ static CURLcode test_unit1620(const char *arg) Curl_freeset(empty); for(i = (enum dupstring)0; i < STRING_LAST; i++) { - fail_unless(empty->set.str[i] == NULL, - "Curl_free() did not set to NULL"); + fail_unless(empty->set.str[i] == NULL, "Curl_free() did not set to NULL"); } rc = Curl_close(&empty); diff --git a/tests/unit/unit1650.c b/tests/unit/unit1650.c index 89e72262d384..309515d9b125 100644 --- a/tests/unit/unit1650.c +++ b/tests/unit/unit1650.c @@ -205,7 +205,7 @@ static CURLcode test_unit1650(const char *arg) int j; for(j = 0; j < 16; j += 2) { size_t l; - curl_msnprintf(ptr, len, "%s%02x%02x", j?":":"", a->ip.v6[j], + curl_msnprintf(ptr, len, "%s%02x%02x", j ? ":" : "", a->ip.v6[j], a->ip.v6[j + 1]); l = strlen(ptr); len -= l; @@ -232,12 +232,12 @@ static CURLcode test_unit1650(const char *arg) } /* pass all sizes into the decoder until full */ - for(i = 0; i < sizeof(full49)-1; i++) { + for(i = 0; i < sizeof(full49) - 1; i++) { struct dohentry d; DOHcode rc; memset(&d, 0, sizeof(d)); - rc = doh_resp_decode((const unsigned char *)full49, i, CURL_DNS_TYPE_A, - &d); + rc = doh_resp_decode((const unsigned char *)full49, + i, CURL_DNS_TYPE_A, &d); if(!rc) { /* none of them should work */ curl_mfprintf(stderr, "%zu: %d\n", i, rc); @@ -250,8 +250,8 @@ static CURLcode test_unit1650(const char *arg) struct dohentry d; DOHcode rc; memset(&d, 0, sizeof(d)); - rc = doh_resp_decode((const unsigned char *)&full49[i], sizeof(full49)-i-1, - CURL_DNS_TYPE_A, &d); + rc = doh_resp_decode((const unsigned char *)&full49[i], + sizeof(full49) - i - 1, CURL_DNS_TYPE_A, &d); if(!rc) { /* none of them should work */ curl_mfprintf(stderr, "2 %zu: %d\n", i, rc); @@ -264,8 +264,8 @@ static CURLcode test_unit1650(const char *arg) struct dohentry d; struct dohaddr *a; memset(&d, 0, sizeof(d)); - rc = doh_resp_decode((const unsigned char *)full49, sizeof(full49)-1, - CURL_DNS_TYPE_A, &d); + rc = doh_resp_decode((const unsigned char *)full49, + sizeof(full49) - 1, CURL_DNS_TYPE_A, &d); fail_if(d.numaddr != 1, "missing address"); a = &d.addr[0]; p = &a->ip.v4[0]; diff --git a/tests/unit/unit1651.c b/tests/unit/unit1651.c index d3620d99f299..ffaea47b20ea 100644 --- a/tests/unit/unit1651.c +++ b/tests/unit/unit1651.c @@ -360,10 +360,10 @@ static CURLcode test_unit1651(const char *arg) /* a poor man's fuzzing of some initial data to make sure nothing bad happens */ - for(byte = 1 ; byte < 255; byte += 17) { + for(byte = 1; byte < 255; byte += 17) { for(i = 0; i < 45; i++) { unsigned char backup = cert[i]; - cert[i] = (unsigned char) (byte & 0xff); + cert[i] = (unsigned char)(byte & 0xff); (void)Curl_extract_certinfo(data, 0, beg, end); cert[i] = backup; } diff --git a/tests/unit/unit1655.c b/tests/unit/unit1655.c index ab42b971ef51..91aca3f1a4a3 100644 --- a/tests/unit/unit1655.c +++ b/tests/unit/unit1655.c @@ -121,7 +121,7 @@ static CURLcode test_unit1655(const char *arg) else { if(d == DOH_OK) { fail_unless(olen <= sizeof(victim.dohbuffer), - "wrote outside bounds"); + "wrote outside bounds"); fail_unless(olen > strlen(name), "unrealistic low size"); } } diff --git a/tests/unit/unit1656.c b/tests/unit/unit1656.c index 322aa2dbe329..7cdca884b808 100644 --- a/tests/unit/unit1656.c +++ b/tests/unit/unit1656.c @@ -95,7 +95,7 @@ static CURLcode test_unit1656(const char *arg) struct dynbuf dbuf; bool all_ok = TRUE; - curlx_dyn_init(&dbuf, 32*1024); + curlx_dyn_init(&dbuf, 32 * 1024); if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/unit/unit1657.c b/tests/unit/unit1657.c index c03cd51f55a8..850b3ef73086 100644 --- a/tests/unit/unit1657.c +++ b/tests/unit/unit1657.c @@ -93,7 +93,7 @@ static CURLcode test_unit1657(const char *arg) bool all_ok = TRUE; struct dynbuf dbuf; - curlx_dyn_init(&dbuf, 32*1024); + curlx_dyn_init(&dbuf, 32 * 1024); if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/unit/unit1660.c b/tests/unit/unit1660.c index 376f6bdcfa45..6b1dcce9fc4d 100644 --- a/tests/unit/unit1660.c +++ b/tests/unit/unit1660.c @@ -130,7 +130,7 @@ static CURLcode test_unit1660(const char *arg) Curl_hsts_loadfile(easy, h, arg); - for(i = 0; headers[i].host ; i++) { + for(i = 0; headers[i].host; i++) { if(headers[i].hdr) { res = Curl_hsts_parse(h, headers[i].host, headers[i].hdr); diff --git a/tests/unit/unit1661.c b/tests/unit/unit1661.c index d9aa2a61f14e..569b06760b2b 100644 --- a/tests/unit/unit1661.c +++ b/tests/unit/unit1661.c @@ -78,7 +78,7 @@ static CURLcode test_unit1661(const char *arg) /** * testing Curl_bufref_ptr */ - fail_unless((const char *) Curl_bufref_ptr(&bufref) == buffer, + fail_unless((const char *)Curl_bufref_ptr(&bufref) == buffer, "Wrong pointer value returned"); /** diff --git a/tests/unit/unit1663.c b/tests/unit/unit1663.c index e4431930a410..e0c77c9d7849 100644 --- a/tests/unit/unit1663.c +++ b/tests/unit/unit1663.c @@ -39,12 +39,11 @@ static CURLcode t1663_setup(void) return res; } -static void t1663_parse( - const char *input_data, - const char *exp_dev, - const char *exp_iface, - const char *exp_host, - CURLcode exp_rc) +static void t1663_parse(const char *input_data, + const char *exp_dev, + const char *exp_iface, + const char *exp_host, + CURLcode exp_rc) { char *dev = NULL; char *iface = NULL; diff --git a/tests/unit/unit2600.c b/tests/unit/unit2600.c index b69b675b3b1a..9af844ca6387 100644 --- a/tests/unit/unit2600.c +++ b/tests/unit/unit2600.c @@ -238,8 +238,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, return res; } -static void check_result(const struct test_case *tc, - struct test_result *tr) +static void check_result(const struct test_case *tc, struct test_result *tr) { char msg[256]; timediff_t duration_ms; @@ -247,8 +246,7 @@ static void check_result(const struct test_case *tc, duration_ms = curlx_timediff_ms(tr->ended, tr->started); curl_mfprintf(stderr, "%d: test case took %dms\n", tc->id, (int)duration_ms); - if(tr->res != tc->exp_res - && CURLE_OPERATION_TIMEDOUT != tr->res) { + if(tr->res != tc->exp_res && CURLE_OPERATION_TIMEDOUT != tr->res) { /* on CI we encounter the TIMEOUT result, since images get less CPU * and events are not as sharply timed. */ curl_msprintf(msg, "%d: expected result %d but got %d", diff --git a/tests/unit/unit2601.c b/tests/unit/unit2601.c index 8411c19e9878..6a1ca2f1bd36 100644 --- a/tests/unit/unit2601.c +++ b/tests/unit/unit2601.c @@ -80,7 +80,7 @@ static void check_bufq(size_t pool_spares, size_t chunk_size, size_t max_chunks, size_t wsize, size_t rsize, int opts) { - static unsigned char test_data[32*1024]; + static unsigned char test_data[32 * 1024]; struct bufq q; struct bufc_pool pool; @@ -167,7 +167,7 @@ static void check_bufq(size_t pool_spares, /* Test SOFT_LIMIT option */ Curl_bufq_free(&q); - Curl_bufq_init2(&q, chunk_size, max_chunks, (opts|BUFQ_OPT_SOFT_LIMIT)); + Curl_bufq_init2(&q, chunk_size, max_chunks, (opts | BUFQ_OPT_SOFT_LIMIT)); nwritten = 0; while(!Curl_bufq_is_full(&q)) { res = Curl_bufq_write(&q, test_data, wsize, &n2); @@ -212,9 +212,9 @@ static CURLcode test_unit2601(const char *arg) struct bufq q; size_t n; CURLcode res; - unsigned char buf[16*1024]; + unsigned char buf[16 * 1024]; - Curl_bufq_init(&q, 8*1024, 12); + Curl_bufq_init(&q, 8 * 1024, 12); res = Curl_bufq_read(&q, buf, 128, &n); fail_unless(res && res == CURLE_AGAIN, "read empty fail"); Curl_bufq_free(&q); @@ -225,7 +225,7 @@ static CURLcode test_unit2601(const char *arg) check_bufq(0, 1024, 4, 16000, 3000, BUFQ_OPT_NONE); check_bufq(0, 8000, 10, 1234, 1234, BUFQ_OPT_NONE); - check_bufq(0, 8000, 10, 8*1024, 4*1024, BUFQ_OPT_NONE); + check_bufq(0, 8000, 10, 8 * 1024, 4 * 1024, BUFQ_OPT_NONE); check_bufq(0, 1024, 4, 128, 128, BUFQ_OPT_NO_SPARES); check_bufq(0, 1024, 4, 129, 127, BUFQ_OPT_NO_SPARES); diff --git a/tests/unit/unit2602.c b/tests/unit/unit2602.c index da2b7dba5496..684fa3db8332 100644 --- a/tests/unit/unit2602.c +++ b/tests/unit/unit2602.c @@ -85,7 +85,7 @@ static CURLcode test_unit2602(const char *arg) Curl_dynhds_reset(&hds); Curl_dynhds_free(&hds); - Curl_dynhds_init(&hds, 128, 4*1024); + Curl_dynhds_init(&hds, 128, 4 * 1024); fail_if(Curl_dynhds_add(&hds, "test1", 5, "123", 3), "add failed"); fail_if(Curl_dynhds_add(&hds, "test1", 5, "123", 3), "add failed"); fail_if(Curl_dynhds_cadd(&hds, "blablabla", "thingies"), "add failed"); @@ -100,18 +100,18 @@ static CURLcode test_unit2602(const char *arg) fail_unless(Curl_dynhds_ccount_name(&hds, "bLABlaBlA") == 0, "should"); fail_if(Curl_dynhds_cadd(&hds, "Bla-Bla", "thingies"), "add failed"); - curlx_dyn_init(&dbuf, 32*1024); + curlx_dyn_init(&dbuf, 32 * 1024); fail_if(Curl_dynhds_h1_dprint(&hds, &dbuf), "h1 print failed"); if(curlx_dyn_ptr(&dbuf)) { fail_if(strcmp(curlx_dyn_ptr(&dbuf), "test1: 123\r\ntest1: 123\r\nBla-Bla: thingies\r\n"), - "h1 format differs"); + "h1 format differs"); } curlx_dyn_free(&dbuf); } Curl_dynhds_free(&hds); - Curl_dynhds_init(&hds, 128, 4*1024); + Curl_dynhds_init(&hds, 128, 4 * 1024); /* continuation without previous header fails */ res = Curl_dynhds_h1_cadd_line(&hds, " indented value"); fail_unless(res, "add should have failed"); @@ -124,13 +124,13 @@ static CURLcode test_unit2602(const char *arg) fail_if(Curl_dynhds_h1_cadd_line(&hds, "ti3: val1"), "add"); fail_if(Curl_dynhds_h1_cadd_line(&hds, " val2"), "add indent"); - curlx_dyn_init(&dbuf, 32*1024); + curlx_dyn_init(&dbuf, 32 * 1024); fail_if(Curl_dynhds_h1_dprint(&hds, &dbuf), "h1 print failed"); if(curlx_dyn_ptr(&dbuf)) { curl_mfprintf(stderr, "indent concat: %s\n", curlx_dyn_ptr(&dbuf)); fail_if(strcmp(curlx_dyn_ptr(&dbuf), "ti1: val1 val2\r\nti2: val1 val2\r\nti3: val1 val2\r\n"), - "wrong format"); + "wrong format"); } curlx_dyn_free(&dbuf); diff --git a/tests/unit/unit3200.c b/tests/unit/unit3200.c index fe00da939d57..bfd4d1181b84 100644 --- a/tests/unit/unit3200.c +++ b/tests/unit/unit3200.c @@ -94,68 +94,68 @@ static CURLcode test_unit3200(const char *arg) curl_mfprintf(stderr, "Test %zd...", i); switch(i) { - case 0: - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE1\n", line), - "First line failed (1)"); - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE2 NEWLINE\n", line), - "Second line failed (1)"); - res = Curl_get_line(&buf, fp, &eof); - abort_unless(eof, "Missed EOF (1)"); - break; - case 1: - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE1\n", line), - "First line failed (2)"); - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE2 NONEWLINE\n", line), - "Second line failed (2)"); - res = Curl_get_line(&buf, fp, &eof); - abort_unless(eof, "Missed EOF (2)"); - break; - case 2: - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE1\n", line), - "First line failed (3)"); - res = Curl_get_line(&buf, fp, &eof); - fail_unless(!curlx_dyn_len(&buf), - "Did not detect max read on EOF (3)"); - break; - case 3: - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE1\n", line), - "First line failed (4)"); - res = Curl_get_line(&buf, fp, &eof); - fail_unless(!curlx_dyn_len(&buf), - "Did not ignore partial on EOF (4)"); - break; - case 4: - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE1\n", line), - "First line failed (5)"); - res = Curl_get_line(&buf, fp, &eof); - fail_unless(!curlx_dyn_len(&buf), - "Did not bail out on too long line"); - break; - case 5: - res = Curl_get_line(&buf, fp, &eof); - line = curlx_dyn_ptr(&buf); - fail_unless(!res && line && !strcmp("LINE1\x1aTEST\n", line), - "Missed/Misinterpreted ^Z (6)"); - res = Curl_get_line(&buf, fp, &eof); - abort_unless(eof, "Missed EOF (6)"); - break; - default: - abort_unless(1, "Unknown case"); - break; + case 0: + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE1\n", line), + "First line failed (1)"); + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE2 NEWLINE\n", line), + "Second line failed (1)"); + res = Curl_get_line(&buf, fp, &eof); + abort_unless(eof, "Missed EOF (1)"); + break; + case 1: + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE1\n", line), + "First line failed (2)"); + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE2 NONEWLINE\n", line), + "Second line failed (2)"); + res = Curl_get_line(&buf, fp, &eof); + abort_unless(eof, "Missed EOF (2)"); + break; + case 2: + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE1\n", line), + "First line failed (3)"); + res = Curl_get_line(&buf, fp, &eof); + fail_unless(!curlx_dyn_len(&buf), + "Did not detect max read on EOF (3)"); + break; + case 3: + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE1\n", line), + "First line failed (4)"); + res = Curl_get_line(&buf, fp, &eof); + fail_unless(!curlx_dyn_len(&buf), + "Did not ignore partial on EOF (4)"); + break; + case 4: + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE1\n", line), + "First line failed (5)"); + res = Curl_get_line(&buf, fp, &eof); + fail_unless(!curlx_dyn_len(&buf), + "Did not bail out on too long line"); + break; + case 5: + res = Curl_get_line(&buf, fp, &eof); + line = curlx_dyn_ptr(&buf); + fail_unless(!res && line && !strcmp("LINE1\x1aTEST\n", line), + "Missed/Misinterpreted ^Z (6)"); + res = Curl_get_line(&buf, fp, &eof); + abort_unless(eof, "Missed EOF (6)"); + break; + default: + abort_unless(1, "Unknown case"); + break; } curlx_dyn_free(&buf); curlx_fclose(fp); diff --git a/tests/unit/unit3205.c b/tests/unit/unit3205.c index bb42e9e0c629..bb35fb2f8eae 100644 --- a/tests/unit/unit3205.c +++ b/tests/unit/unit3205.c @@ -561,9 +561,9 @@ static CURLcode test_unit3205(const char *arg) /* suites matched by EDH alias will return the DHE name */ if(test->id >= 0x0011 && test->id < 0x0017) { if(expect && memcmp(expect, "EDH-", 4) == 0) - expect = (char *) memcpy(strcpy(alt, expect), "DHE-", 4); + expect = (char *)memcpy(strcpy(alt, expect), "DHE-", 4); if(expect && memcmp(expect + 4, "EDH-", 4) == 0) - expect = (char *) memcpy(strcpy(alt, expect) + 4, "DHE-", 4) - 4; + expect = (char *)memcpy(strcpy(alt, expect) + 4, "DHE-", 4) - 4; } if(expect && strcmp(buf, expect) != 0) { diff --git a/tests/unit/unit3211.c b/tests/unit/unit3211.c index 1ec30ac9a2af..7f6c616909c0 100644 --- a/tests/unit/unit3211.c +++ b/tests/unit/unit3211.c @@ -84,7 +84,7 @@ static void check_set(const char *name, unsigned int capacity, } /* The count is half */ c = Curl_uint32_bset_count(&bset); - fail_unless(c == slen/2, "set count is wrong"); + fail_unless(c == slen / 2, "set count is wrong"); Curl_uint32_bset_clear(&bset); c = Curl_uint32_bset_count(&bset); @@ -107,7 +107,7 @@ static void check_set(const char *name, unsigned int capacity, for(i = 0; i < slen; i++) /* all still present after resize back */ fail_unless(Curl_uint32_bset_contains(&bset, s[i]), "unexpectedly lost"); - fail_unless(!Curl_uint32_bset_resize(&bset, capacity/2), + fail_unless(!Curl_uint32_bset_resize(&bset, capacity / 2), "resize half failed"); /* halved the size, what numbers remain in set? */ c = Curl_uint32_bset_capacity(&bset); diff --git a/tests/unit/unit3213.c b/tests/unit/unit3213.c index b0d4d2ced557..dbd26f4aa49c 100644 --- a/tests/unit/unit3213.c +++ b/tests/unit/unit3213.c @@ -75,7 +75,7 @@ static void check_spbset(const char *name, const unsigned int *s, size_t slen) } /* The count is half */ c = Curl_uint32_spbset_count(&bset); - fail_unless(c == slen/2, "set count is wrong"); + fail_unless(c == slen / 2, "set count is wrong"); Curl_uint32_spbset_clear(&bset); c = Curl_uint32_spbset_count(&bset); diff --git a/tests/unit/unit3216.c b/tests/unit/unit3216.c index cbe9a5f0bf51..0f9d27492c03 100644 --- a/tests/unit/unit3216.c +++ b/tests/unit/unit3216.c @@ -45,7 +45,7 @@ static CURLcode test_unit3216(const char *arg) fail_unless(Curl_rlimit_avail(&r, ts) == 0, "blocked inf"); Curl_rlimit_block(&r, FALSE, ts); fail_unless(Curl_rlimit_avail(&r, ts) == CURL_OFF_T_MAX, - "unblocked unlimited"); + "unblocked unlimited"); /* A ratelimit that give 10 tokens per second */ ts = curlx_now(); From 06e16167d62984976b7a3ea2fcfa61813fd6d81c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 28 Nov 2025 17:16:31 +0100 Subject: [PATCH 585/885] memdebug: buffer output data Instead of writing each line to file immediately, this now stores them in an in-memory buffer until that gets full or curl exits. To make it run faster and write to file less often. Closes #19750 --- lib/memdebug.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/memdebug.c b/lib/memdebug.c index 9fd54d026b69..329b11ea793b 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -62,6 +62,10 @@ static long memsize = 0; /* set number of mallocs allowed */ static struct backtrace_state *btstate; #endif +#define KEEPSIZE 10000 +static char membuf[KEEPSIZE]; +static size_t memwidx = 0; /* write index */ + /* LeakSantizier (LSAN) calls _exit() instead of exit() when a leak is detected on exit so the logfile must be closed explicitly or data could be lost. Though _exit() does not call atexit handlers such as this, LSAN's call to @@ -71,6 +75,8 @@ static void curl_dbg_cleanup(void) if(curl_dbg_logfile && curl_dbg_logfile != stderr && curl_dbg_logfile != stdout) { + if(memwidx) + fwrite(membuf, 1, memwidx, curl_dbg_logfile); /* !checksrc! disable BANNEDFUNC 1 */ fclose(curl_dbg_logfile); } @@ -506,7 +512,7 @@ int curl_dbg_fclose(FILE *file, int line, const char *source) void curl_dbg_log(const char *format, ...) { char buf[1024]; - int nchars; + size_t nchars; va_list ap; if(!curl_dbg_logfile) @@ -519,8 +525,20 @@ void curl_dbg_log(const char *format, ...) if(nchars > (int)sizeof(buf) - 1) nchars = (int)sizeof(buf) - 1; - if(nchars > 0) - fwrite(buf, 1, (size_t)nchars, curl_dbg_logfile); + if(nchars > 0) { + if(KEEPSIZE - nchars < memwidx) { + /* flush */ + fwrite(membuf, 1, memwidx, curl_dbg_logfile); + fflush(curl_dbg_logfile); + memwidx = 0; + } + if(memwidx) { + /* the previous line ends with a newline */ + DEBUGASSERT(membuf[memwidx - 1] == '\n'); + } + memcpy(&membuf[memwidx], buf, nchars); + memwidx += nchars; + } } #endif /* CURLDEBUG */ From 16f073ef49f94412000218c9f6ad04e3fd7e4d01 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Mar 2025 01:15:16 +0100 Subject: [PATCH 586/885] cmake: define dependencies as `IMPORTED` interface targets Rework the way curl's custom Find modules advertise their properties. Before this patch, Find modules returned detected dependency properties (header dirs, libs, libdirs, C flags, etc.) via global variables. curl's main `CMakeLists.txt` copied their values into global lists, which it later applied to targets. This solution worked internally, but it was unsuited for the public, distributed `CURLConfig.cmake` and publishing curl's Find modules with it, due to polluting the namespace of consumer projects. It's also impractical to apply the many individual variables to every targets depending on libcurl. To allow using Find modules in consumer projects, this patch makes them define as imported interface targets, named `CURL::`. Then store dependency information as target properties. It avoids namespace pollution and makes the dependency information apply automatically to all targets using `CURL::libcurl_static`. Find modules continue to return `*_FOUND` and `*_VERSION` variables. For dependencies detected via `pkg-config`, CMake 3.16+ is recommended. Older CMake versions have a varying degree of support for propagating/handling library directories. This may cause issues in envs where dependencies reside in non-system locations and detected via `pkg-config` (e.g. macOS + Homebrew). Use `CURL_USE_PKGCONFIG=OFF` to fix these issues. Or upgrade to newer CMake, or link libcurl dynamically. Also: - re-enable `pkg-config` for old cmake `find_library()` integration tests. - make `curlinfo` build after these changes. - distribute local Find modules. - export the raw list of lib dependencies via `CURL_LIBRARIES_PRIVATE`. - `CURLconfig.cmake`: use curl's Find modules to detect dependencies in the consumer env. - add custom property to target property debug function. - the curl build process no longer modifies `CMAKE_C_FLAGS`. Follow-up to e86542038dda88dadf8959584e803895f979310c #17047 Ref: #14930 Ref: https://github.com/libssh2/libssh2/pull/1535 Ref: https://github.com/libssh2/libssh2/pull/1571 Ref: https://github.com/libssh2/libssh2/pull/1581 Ref: https://github.com/libssh2/libssh2/pull/1623 Closes #16973 --- CMake/FindBrotli.cmake | 40 ++-- CMake/FindCares.cmake | 51 +++-- CMake/FindGSS.cmake | 73 +++--- CMake/FindGnuTLS.cmake | 47 ++-- CMake/FindLDAP.cmake | 42 ++-- CMake/FindLibbacktrace.cmake | 29 ++- CMake/FindLibgsasl.cmake | 46 ++-- CMake/FindLibidn2.cmake | 47 ++-- CMake/FindLibpsl.cmake | 47 ++-- CMake/FindLibrtmp.cmake | 53 +++-- CMake/FindLibssh.cmake | 51 +++-- CMake/FindLibssh2.cmake | 47 ++-- CMake/FindLibuv.cmake | 47 ++-- CMake/FindMbedTLS.cmake | 54 +++-- CMake/FindNGHTTP2.cmake | 47 ++-- CMake/FindNGHTTP3.cmake | 47 ++-- CMake/FindNGTCP2.cmake | 42 ++-- CMake/FindNettle.cmake | 47 ++-- CMake/FindQuiche.cmake | 47 ++-- CMake/FindRustls.cmake | 59 +++-- CMake/FindWolfSSL.cmake | 55 +++-- CMake/FindZstd.cmake | 47 ++-- CMake/Utilities.cmake | 1 + CMake/curl-config.cmake.in | 118 ++++++++++ CMakeLists.txt | 433 +++++++++++++++-------------------- lib/CMakeLists.txt | 26 ++- src/CMakeLists.txt | 3 +- tests/cmake/test.sh | 2 +- 28 files changed, 999 insertions(+), 649 deletions(-) diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake index d2b50d962124..981b30cafd57 100644 --- a/CMake/FindBrotli.cmake +++ b/CMake/FindBrotli.cmake @@ -29,31 +29,27 @@ # - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library. # - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library. # -# Result variables: +# Defines: # # - `BROTLI_FOUND`: System has brotli. -# - `BROTLI_INCLUDE_DIRS`: The brotli include directories. -# - `BROTLI_LIBRARIES`: The brotli library names. -# - `BROTLI_LIBRARY_DIRS`: The brotli library directories. -# - `BROTLI_PC_REQUIRES`: The brotli pkg-config packages. -# - `BROTLI_CFLAGS`: Required compiler flags. # - `BROTLI_VERSION`: Version of brotli. +# - `CURL::brotli`: brotli library target. -set(BROTLI_PC_REQUIRES "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon +set(_brotli_pc_requires "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon if(CURL_USE_PKGCONFIG AND NOT DEFINED BROTLI_INCLUDE_DIR AND NOT DEFINED BROTLICOMMON_LIBRARY AND NOT DEFINED BROTLIDEC_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(BROTLI ${BROTLI_PC_REQUIRES}) + pkg_check_modules(_brotli ${_brotli_pc_requires}) endif() -if(BROTLI_FOUND) +if(_brotli_FOUND) set(Brotli_FOUND TRUE) - set(BROTLI_VERSION ${BROTLI_libbrotlicommon_VERSION}) - string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}") - message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") + set(BROTLI_FOUND TRUE) + set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION}) + message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") else() find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon") @@ -68,9 +64,25 @@ else() ) if(BROTLI_FOUND) - set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR}) - set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY}) + set(_brotli_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR}) + set(_brotli_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY}) endif() mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY) endif() + +if(BROTLI_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_brotli_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::brotli) + add_library(CURL::brotli INTERFACE IMPORTED) + set_target_properties(CURL::brotli PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_brotli_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_brotli_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_brotli_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_brotli_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindCares.cmake b/CMake/FindCares.cmake index ae2db52d85aa..4a20bc0af471 100644 --- a/CMake/FindCares.cmake +++ b/CMake/FindCares.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory. -# - `CARES_LIBRARY`: Absolute path to `cares` library. +# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory. +# - `CARES_LIBRARY`: Absolute path to `cares` library. # -# Result variables: +# Defines: # -# - `CARES_FOUND`: System has c-ares. -# - `CARES_INCLUDE_DIRS`: The c-ares include directories. -# - `CARES_LIBRARIES`: The c-ares library names. -# - `CARES_LIBRARY_DIRS`: The c-ares library directories. -# - `CARES_PC_REQUIRES`: The c-ares pkg-config packages. -# - `CARES_CFLAGS`: Required compiler flags. -# - `CARES_VERSION`: Version of c-ares. +# - `CARES_FOUND`: System has c-ares. +# - `CARES_VERSION`: Version of c-ares. +# - `CURL::cares`: c-ares library target. -set(CARES_PC_REQUIRES "libcares") +set(_cares_pc_requires "libcares") if(CURL_USE_PKGCONFIG AND NOT DEFINED CARES_INCLUDE_DIR AND NOT DEFINED CARES_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(CARES ${CARES_PC_REQUIRES}) + pkg_check_modules(_cares ${_cares_pc_requires}) endif() -if(CARES_FOUND) +if(_cares_FOUND) set(Cares_FOUND TRUE) - string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}") - message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") + set(CARES_FOUND TRUE) + set(CARES_VERSION ${_cares_VERSION}) + message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") else() find_path(CARES_INCLUDE_DIR NAMES "ares.h") find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares") @@ -85,13 +82,29 @@ else() ) if(CARES_FOUND) - set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR}) - set(CARES_LIBRARIES ${CARES_LIBRARY}) + set(_cares_INCLUDE_DIRS ${CARES_INCLUDE_DIR}) + set(_cares_LIBRARIES ${CARES_LIBRARY}) endif() mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY) endif() -if(CARES_FOUND AND WIN32) - list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others +if(CARES_FOUND) + if(WIN32) + list(APPEND _cares_LIBRARIES "iphlpapi") # for if_indextoname and others + endif() + + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_cares_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::cares) + add_library(CURL::cares INTERFACE IMPORTED) + set_target_properties(CURL::cares PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_cares_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_cares_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_cares_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_cares_LIBRARIES}") + endif() endif() diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake index 89545aa74134..106c4c4edd71 100644 --- a/CMake/FindGSS.cmake +++ b/CMake/FindGSS.cmake @@ -25,19 +25,15 @@ # # Input variables: # -# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment) +# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment) # -# Result variables: +# Defines: # -# - `GSS_FOUND`: System has a GSS library. -# - `GSS_FLAVOUR`: "GNU" or "MIT" if anything found. -# - `GSS_INCLUDE_DIRS`: The GSS include directories. -# - `GSS_LIBRARIES`: The GSS library names. -# - `GSS_LIBRARY_DIRS`: The GSS library directories. -# - `GSS_PC_REQUIRES`: The GSS pkg-config packages. -# - `GSS_CFLAGS`: Required compiler flags. -# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest. -# In case the library is found but no version info available it is set to "unknown" +# - `GSS_FOUND`: System has a GSS library. +# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest. +# In case the library is found but no version info available it is set to "unknown" +# - `CURL::gss`: GSS library target. +# - CURL_GSS_FLAVOUR`: Custom property. "GNU" or "MIT" if detected. set(_gnu_modname "gss") set(_mit_modname "mit-krb5-gssapi") @@ -140,7 +136,7 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr # Older versions may not have the "--vendor" parameter. In this case we just do not care. if(NOT _gss_configure_failed AND NOT _gss_vendor MATCHES "Heimdal|heimdal") - set(GSS_FLAVOUR "MIT") # assume a default, should not really matter + set(_gss_flavour "MIT") # assume a default, should not really matter endif() else() # Either there is no config script or we are on a platform that does not provide one (Windows?) @@ -156,7 +152,7 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr cmake_pop_check_state() if(_gss_have_mit_headers) - set(GSS_FLAVOUR "MIT") + set(_gss_flavour "MIT") if(WIN32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) list(APPEND _gss_libdir_suffixes "lib/AMD64") @@ -174,14 +170,14 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr find_path(_gss_INCLUDE_DIRS NAMES "gss.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include") if(_gss_INCLUDE_DIRS) - set(GSS_FLAVOUR "GNU") - set(GSS_PC_REQUIRES ${_gnu_modname}) + set(_gss_flavour "GNU") + set(_gss_pc_requires ${_gnu_modname}) set(_gss_libname "gss") endif() endif() # If we have headers, look up libraries - if(GSS_FLAVOUR) + if(_gss_flavour) set(_gss_libdir_hints ${_gss_root_hints}) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) cmake_path(GET _gss_INCLUDE_DIRS PARENT_PATH _gss_calculated_potential_root) @@ -193,34 +189,28 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr find_library(_gss_LIBRARIES NAMES ${_gss_libname} HINTS ${_gss_libdir_hints} PATH_SUFFIXES ${_gss_libdir_suffixes}) endif() endif() - if(NOT GSS_FLAVOUR) + if(NOT _gss_flavour) message(FATAL_ERROR "GNU or MIT GSS is required") endif() else() # _gss_MODULE_NAME set since CMake 3.16. # _pkg_check_modules_pkg_name is undocumented and used as a fallback for CMake <3.16 versions. if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _pkg_check_modules_pkg_name STREQUAL _gnu_modname) - set(GSS_FLAVOUR "GNU") - set(GSS_PC_REQUIRES ${_gnu_modname}) + set(_gss_flavour "GNU") + set(_gss_pc_requires ${_gnu_modname}) elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _pkg_check_modules_pkg_name STREQUAL _mit_modname) - set(GSS_FLAVOUR "MIT") - set(GSS_PC_REQUIRES ${_mit_modname}) + set(_gss_flavour "MIT") + set(_gss_pc_requires ${_mit_modname}) else() message(FATAL_ERROR "GNU or MIT GSS is required") endif() - message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")") + message(STATUS "Found GSS/${_gss_flavour} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")") endif() -string(REPLACE ";" " " _gss_CFLAGS "${_gss_CFLAGS}") - -set(GSS_INCLUDE_DIRS ${_gss_INCLUDE_DIRS}) -set(GSS_LIBRARIES ${_gss_LIBRARIES}) -set(GSS_LIBRARY_DIRS ${_gss_LIBRARY_DIRS}) -set(GSS_CFLAGS ${_gss_CFLAGS}) set(GSS_VERSION ${_gss_version}) if(NOT GSS_VERSION) - if(GSS_FLAVOUR STREQUAL "MIT") + if(_gss_flavour STREQUAL "MIT") if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) cmake_host_system_information(RESULT _mit_version QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/MIT/Kerberos/SDK/CurrentVersion" VALUE "VersionString") @@ -234,9 +224,9 @@ if(NOT GSS_VERSION) set(GSS_VERSION "MIT Unknown") endif() else() # GNU - if(GSS_INCLUDE_DIRS AND EXISTS "${GSS_INCLUDE_DIRS}/gss.h") + if(_gss_INCLUDE_DIRS AND EXISTS "${_gss_INCLUDE_DIRS}/gss.h") set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"") - file(STRINGS "${GSS_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}") + file(STRINGS "${_gss_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}") string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") set(GSS_VERSION "${_version_str}") unset(_version_regex) @@ -248,8 +238,8 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GSS REQUIRED_VARS - GSS_FLAVOUR - GSS_LIBRARIES + _gss_flavour + _gss_LIBRARIES VERSION_VAR GSS_VERSION FAIL_MESSAGE @@ -266,3 +256,20 @@ mark_as_advanced( _gss_PREFIX _gss_version ) + +if(GSS_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_gss_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::gss) + add_library(CURL::gss INTERFACE IMPORTED) + set_target_properties(CURL::gss PROPERTIES + INTERFACE_CURL_GSS_FLAVOUR "${_gss_flavour}" + INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake index 4de4f82eee38..fff57b2c293a 100644 --- a/CMake/FindGnuTLS.cmake +++ b/CMake/FindGnuTLS.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `GNUTLS_INCLUDE_DIR`: Absolute path to GnuTLS include directory. -# - `GNUTLS_LIBRARY`: Absolute path to `gnutls` library. +# - `GNUTLS_INCLUDE_DIR`: Absolute path to GnuTLS include directory. +# - `GNUTLS_LIBRARY`: Absolute path to `gnutls` library. # -# Result variables: +# Defines: # -# - `GNUTLS_FOUND`: System has GnuTLS. -# - `GNUTLS_INCLUDE_DIRS`: The GnuTLS include directories. -# - `GNUTLS_LIBRARIES`: The GnuTLS library names. -# - `GNUTLS_LIBRARY_DIRS`: The GnuTLS library directories. -# - `GNUTLS_PC_REQUIRES`: The GnuTLS pkg-config packages. -# - `GNUTLS_CFLAGS`: Required compiler flags. -# - `GNUTLS_VERSION`: Version of GnuTLS. +# - `GNUTLS_FOUND`: System has GnuTLS. +# - `GNUTLS_VERSION`: Version of GnuTLS. +# - `CURL::gnutls`: GnuTLS library target. -set(GNUTLS_PC_REQUIRES "gnutls") +set(_gnutls_pc_requires "gnutls") if(CURL_USE_PKGCONFIG AND NOT DEFINED GNUTLS_INCLUDE_DIR AND NOT DEFINED GNUTLS_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(GNUTLS ${GNUTLS_PC_REQUIRES}) + pkg_check_modules(_gnutls ${_gnutls_pc_requires}) endif() -if(GNUTLS_FOUND) +if(_gnutls_FOUND) set(GnuTLS_FOUND TRUE) - string(REPLACE ";" " " GNUTLS_CFLAGS "${GNUTLS_CFLAGS}") - message(STATUS "Found GnuTLS (via pkg-config): ${GNUTLS_INCLUDE_DIRS} (found version \"${GNUTLS_VERSION}\")") + set(GNUTLS_FOUND TRUE) + set(GNUTLS_VERSION ${_gnutls_VERSION}) + message(STATUS "Found GnuTLS (via pkg-config): ${_gnutls_INCLUDE_DIRS} (found version \"${GNUTLS_VERSION}\")") else() find_path(GNUTLS_INCLUDE_DIR NAMES "gnutls/gnutls.h") find_library(GNUTLS_LIBRARY NAMES "gnutls" "libgnutls") @@ -75,9 +72,25 @@ else() ) if(GNUTLS_FOUND) - set(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR}) - set(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY}) + set(_gnutls_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR}) + set(_gnutls_LIBRARIES ${GNUTLS_LIBRARY}) endif() mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY) endif() + +if(GNUTLS_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_gnutls_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::gnutls) + add_library(CURL::gnutls INTERFACE IMPORTED) + set_target_properties(CURL::gnutls PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_gnutls_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_gnutls_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake index 0a897aa13f88..2f5cc713c72d 100644 --- a/CMake/FindLDAP.cmake +++ b/CMake/FindLDAP.cmake @@ -29,32 +29,28 @@ # - `LDAP_LIBRARY`: Absolute path to `ldap` library. # - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library. # -# Result variables: +# Defines: # # - `LDAP_FOUND`: System has ldap. -# - `LDAP_INCLUDE_DIRS`: The ldap include directories. -# - `LDAP_LIBRARIES`: The ldap library names. -# - `LDAP_LIBRARY_DIRS`: The ldap library directories. -# - `LDAP_PC_REQUIRES`: The ldap pkg-config packages. -# - `LDAP_CFLAGS`: Required compiler flags. # - `LDAP_VERSION`: Version of ldap. +# - `CURL::ldap`: ldap library target. -set(LDAP_PC_REQUIRES "ldap" "lber") +set(_ldap_pc_requires "ldap" "lber") if(CURL_USE_PKGCONFIG AND NOT DEFINED LDAP_INCLUDE_DIR AND NOT DEFINED LDAP_LIBRARY AND NOT DEFINED LDAP_LBER_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LDAP ${LDAP_PC_REQUIRES}) + pkg_check_modules(_ldap ${_ldap_pc_requires}) endif() -if(LDAP_FOUND) - set(LDAP_VERSION ${LDAP_ldap_VERSION}) - string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}") - message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")") +if(_ldap_FOUND) + set(LDAP_FOUND TRUE) + set(LDAP_VERSION ${_ldap_ldap_VERSION}) + message(STATUS "Found LDAP (via pkg-config): ${_ldap_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")") else() - set(LDAP_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + set(_ldap_pc_requires "") # Depend on pkg-config only when found via pkg-config # On Apple the SDK LDAP gets picked up from # 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains @@ -99,9 +95,25 @@ else() ) if(LDAP_FOUND) - set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR}) - set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY}) + set(_ldap_INCLUDE_DIRS ${LDAP_INCLUDE_DIR}) + set(_ldap_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY}) endif() mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY) endif() + +if(LDAP_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_ldap_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::ldap) + add_library(CURL::ldap INTERFACE IMPORTED) + set_target_properties(CURL::ldap PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindLibbacktrace.cmake b/CMake/FindLibbacktrace.cmake index 444c5f90fdcf..c6f7b700c43c 100644 --- a/CMake/FindLibbacktrace.cmake +++ b/CMake/FindLibbacktrace.cmake @@ -25,14 +25,13 @@ # # Input variables: # -# - `LIBBACKTRACE_INCLUDE_DIR`: Absolute path to libbacktrace include directory. -# - `LIBBACKTRACE_LIBRARY`: Absolute path to `libbacktrace` library. +# - `LIBBACKTRACE_INCLUDE_DIR`: Absolute path to libbacktrace include directory. +# - `LIBBACKTRACE_LIBRARY`: Absolute path to `libbacktrace` library. # -# Result variables: +# Defines: # -# - `LIBBACKTRACE_FOUND`: System has libbacktrace. -# - `LIBBACKTRACE_INCLUDE_DIRS`: The libbacktrace include directories. -# - `LIBBACKTRACE_LIBRARIES`: The libbacktrace library names. +# - `LIBBACKTRACE_FOUND`: System has libbacktrace. +# - `CURL::libbacktrace`: libbacktrace library target. find_path(LIBBACKTRACE_INCLUDE_DIR NAMES "backtrace.h") find_library(LIBBACKTRACE_LIBRARY NAMES "backtrace" "libbacktrace") @@ -45,8 +44,22 @@ find_package_handle_standard_args(Libbacktrace ) if(LIBBACKTRACE_FOUND) - set(LIBBACKTRACE_INCLUDE_DIRS ${LIBBACKTRACE_INCLUDE_DIR}) - set(LIBBACKTRACE_LIBRARIES ${LIBBACKTRACE_LIBRARY}) + set(_libbacktrace_INCLUDE_DIRS ${LIBBACKTRACE_INCLUDE_DIR}) + set(_libbacktrace_LIBRARIES ${LIBBACKTRACE_LIBRARY}) + + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libbacktrace_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libbacktrace) + add_library(CURL::libbacktrace INTERFACE IMPORTED) + set_target_properties(CURL::libbacktrace PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libbacktrace_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libbacktrace_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libbacktrace_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libbacktrace_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libbacktrace_LIBRARIES}") + endif() endif() mark_as_advanced(LIBBACKTRACE_INCLUDE_DIR LIBBACKTRACE_LIBRARY) diff --git a/CMake/FindLibgsasl.cmake b/CMake/FindLibgsasl.cmake index e584f75371c0..5ddf957d72d8 100644 --- a/CMake/FindLibgsasl.cmake +++ b/CMake/FindLibgsasl.cmake @@ -25,32 +25,28 @@ # # Input variables: # -# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory. -# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library. +# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory. +# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library. # -# Result variables: +# Defines: # -# - `LIBGSASL_FOUND`: System has libgsasl. -# - `LIBGSASL_INCLUDE_DIRS`: The libgsasl include directories. -# - `LIBGSASL_LIBRARIES`: The libgsasl library names. -# - `LIBGSASL_LIBRARY_DIRS`: The libgsasl library directories. -# - `LIBGSASL_PC_REQUIRES`: The libgsasl pkg-config packages. -# - `LIBGSASL_CFLAGS`: Required compiler flags. -# - `LIBGSASL_VERSION`: Version of libgsasl. +# - `LIBGSASL_FOUND`: System has libgsasl. +# - `LIBGSASL_VERSION`: Version of libgsasl. +# - `CURL::libgsasl`: libgsasl library target. -set(LIBGSASL_PC_REQUIRES "libgsasl") +set(_libgsasl_pc_requires "libgsasl") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBGSASL_INCLUDE_DIR AND NOT DEFINED LIBGSASL_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBGSASL ${LIBGSASL_PC_REQUIRES}) + pkg_check_modules(_libgsasl ${_libgsasl_pc_requires}) endif() -if(LIBGSASL_FOUND) +if(_libgsasl_FOUND) set(Libgsasl_FOUND TRUE) - string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}") - message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")") + set(LIBGSASL_FOUND TRUE) + message(STATUS "Found Libgsasl (via pkg-config): ${_libgsasl_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")") else() find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h") find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl") @@ -75,9 +71,25 @@ else() ) if(LIBGSASL_FOUND) - set(LIBGSASL_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR}) - set(LIBGSASL_LIBRARIES ${LIBGSASL_LIBRARY}) + set(_libgsasl_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR}) + set(_libgsasl_LIBRARIES ${LIBGSASL_LIBRARY}) endif() mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY) endif() + +if(LIBGSASL_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libgsasl_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libgsasl) + add_library(CURL::libgsasl INTERFACE IMPORTED) + set_target_properties(CURL::libgsasl PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindLibidn2.cmake b/CMake/FindLibidn2.cmake index 9112428f37dc..336a7f7b404e 100644 --- a/CMake/FindLibidn2.cmake +++ b/CMake/FindLibidn2.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory. -# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library. +# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory. +# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library. # -# Result variables: +# Defines: # -# - `LIBIDN2_FOUND`: System has libidn2. -# - `LIBIDN2_INCLUDE_DIRS`: The libidn2 include directories. -# - `LIBIDN2_LIBRARIES`: The libidn2 library names. -# - `LIBIDN2_LIBRARY_DIRS`: The libidn2 library directories. -# - `LIBIDN2_PC_REQUIRES`: The libidn2 pkg-config packages. -# - `LIBIDN2_CFLAGS`: Required compiler flags. -# - `LIBIDN2_VERSION`: Version of libidn2. +# - `LIBIDN2_FOUND`: System has libidn2. +# - `LIBIDN2_VERSION`: Version of libidn2. +# - `CURL::libidn2`: libidn2 library target. -set(LIBIDN2_PC_REQUIRES "libidn2") +set(_libidn2_pc_requires "libidn2") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBIDN2_INCLUDE_DIR AND NOT DEFINED LIBIDN2_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBIDN2 ${LIBIDN2_PC_REQUIRES}) + pkg_check_modules(_libidn2 ${_libidn2_pc_requires}) endif() -if(LIBIDN2_FOUND) +if(_libidn2_FOUND) set(Libidn2_FOUND TRUE) - string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}") - message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")") + set(LIBIDN2_FOUND TRUE) + set(LIBIDN2_VERSION ${_libidn2_VERSION}) + message(STATUS "Found Libidn2 (via pkg-config): ${_libidn2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")") else() find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h") find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2") @@ -75,9 +72,25 @@ else() ) if(LIBIDN2_FOUND) - set(LIBIDN2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR}) - set(LIBIDN2_LIBRARIES ${LIBIDN2_LIBRARY}) + set(_libidn2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR}) + set(_libidn2_LIBRARIES ${LIBIDN2_LIBRARY}) endif() mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY) endif() + +if(LIBIDN2_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libidn2_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libidn2) + add_library(CURL::libidn2 INTERFACE IMPORTED) + set_target_properties(CURL::libidn2 PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindLibpsl.cmake b/CMake/FindLibpsl.cmake index 13740fa9b3fa..9b1a0cdd97b4 100644 --- a/CMake/FindLibpsl.cmake +++ b/CMake/FindLibpsl.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory. -# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library. +# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory. +# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library. # -# Result variables: +# Defines: # -# - `LIBPSL_FOUND`: System has libpsl. -# - `LIBPSL_INCLUDE_DIRS`: The libpsl include directories. -# - `LIBPSL_LIBRARIES`: The libpsl library names. -# - `LIBPSL_LIBRARY_DIRS`: The libpsl library directories. -# - `LIBPSL_PC_REQUIRES`: The libpsl pkg-config packages. -# - `LIBPSL_CFLAGS`: Required compiler flags. -# - `LIBPSL_VERSION`: Version of libpsl. +# - `LIBPSL_FOUND`: System has libpsl. +# - `LIBPSL_VERSION`: Version of libpsl. +# - `CURL::libpsl`: libpsl library target. -set(LIBPSL_PC_REQUIRES "libpsl") +set(_libpsl_pc_requires "libpsl") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBPSL_INCLUDE_DIR AND NOT DEFINED LIBPSL_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBPSL ${LIBPSL_PC_REQUIRES}) + pkg_check_modules(_libpsl ${_libpsl_pc_requires}) endif() -if(LIBPSL_FOUND AND LIBPSL_INCLUDE_DIRS) +if(_libpsl_FOUND AND _libpsl_INCLUDE_DIRS) set(Libpsl_FOUND TRUE) - string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}") - message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")") + set(LIBPSL_FOUND TRUE) + set(LIBPSL_VERSION ${_libpsl_VERSION}) + message(STATUS "Found Libpsl (via pkg-config): ${_libpsl_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")") else() find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h") find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl") @@ -75,9 +72,25 @@ else() ) if(LIBPSL_FOUND) - set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR}) - set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY}) + set(_libpsl_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR}) + set(_libpsl_LIBRARIES ${LIBPSL_LIBRARY}) endif() mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY) endif() + +if(LIBPSL_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libpsl_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libpsl) + add_library(CURL::libpsl INTERFACE IMPORTED) + set_target_properties(CURL::libpsl PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake index be975794b773..070538578e4a 100644 --- a/CMake/FindLibrtmp.cmake +++ b/CMake/FindLibrtmp.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `LIBRTMP_INCLUDE_DIR`: Absolute path to librtmp include directory. -# - `LIBRTMP_LIBRARY`: Absolute path to `librtmp` library. +# - `LIBRTMP_INCLUDE_DIR`: Absolute path to librtmp include directory. +# - `LIBRTMP_LIBRARY`: Absolute path to `librtmp` library. # -# Result variables: +# Defines: # -# - `LIBRTMP_FOUND`: System has librtmp. -# - `LIBRTMP_INCLUDE_DIRS`: The librtmp include directories. -# - `LIBRTMP_LIBRARIES`: The librtmp library names. -# - `LIBRTMP_LIBRARY_DIRS`: The librtmp library directories. -# - `LIBRTMP_PC_REQUIRES`: The librtmp pkg-config packages. -# - `LIBRTMP_CFLAGS`: Required compiler flags. -# - `LIBRTMP_VERSION`: Version of librtmp. +# - `LIBRTMP_FOUND`: System has librtmp. +# - `LIBRTMP_VERSION`: Version of librtmp. +# - `CURL::librtmp`: librtmp library target. -set(LIBRTMP_PC_REQUIRES "librtmp") +set(_librtmp_pc_requires "librtmp") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBRTMP_INCLUDE_DIR AND NOT DEFINED LIBRTMP_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBRTMP ${LIBRTMP_PC_REQUIRES}) + pkg_check_modules(_librtmp ${_librtmp_pc_requires}) endif() -if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS) +if(_librtmp_FOUND AND _librtmp_INCLUDE_DIRS) set(Librtmp_FOUND TRUE) - string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}") - message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")") + set(LIBRTMP_FOUND TRUE) + set(LIBRTMP_VERSION ${_librtmp_VERSION}) + message(STATUS "Found Librtmp (via pkg-config): ${_librtmp_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")") else() find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h") find_library(LIBRTMP_LIBRARY NAMES "rtmp") @@ -85,8 +82,8 @@ else() ) if(LIBRTMP_FOUND) - set(LIBRTMP_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR}) - set(LIBRTMP_LIBRARIES ${LIBRTMP_LIBRARY}) + set(_librtmp_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR}) + set(_librtmp_LIBRARIES ${LIBRTMP_LIBRARY}) endif() mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY) @@ -94,10 +91,26 @@ else() # Necessary when linking a static librtmp find_package(OpenSSL) if(OPENSSL_FOUND) - list(APPEND LIBRTMP_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) + list(APPEND _librtmp_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) endif() endif() -if(LIBRTMP_FOUND AND WIN32) - list(APPEND LIBRTMP_LIBRARIES "winmm") +if(LIBRTMP_FOUND) + if(WIN32) + list(APPEND _librtmp_LIBRARIES "winmm") + endif() + + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_librtmp_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::librtmp) + add_library(CURL::librtmp INTERFACE IMPORTED) + set_target_properties(CURL::librtmp PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_librtmp_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_librtmp_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_librtmp_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_librtmp_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_librtmp_LIBRARIES}") + endif() endif() diff --git a/CMake/FindLibssh.cmake b/CMake/FindLibssh.cmake index cb895aa8d74b..ad1248fe00af 100644 --- a/CMake/FindLibssh.cmake +++ b/CMake/FindLibssh.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory. -# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library. +# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory. +# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library. # -# Result variables: +# Defines: # -# - `LIBSSH_FOUND`: System has libssh. -# - `LIBSSH_INCLUDE_DIRS`: The libssh include directories. -# - `LIBSSH_LIBRARIES`: The libssh library names. -# - `LIBSSH_LIBRARY_DIRS`: The libssh library directories. -# - `LIBSSH_PC_REQUIRES`: The libssh pkg-config packages. -# - `LIBSSH_CFLAGS`: Required compiler flags. -# - `LIBSSH_VERSION`: Version of libssh. +# - `LIBSSH_FOUND`: System has libssh. +# - `LIBSSH_VERSION`: Version of libssh. +# - `CURL::libssh`: libssh library target. -set(LIBSSH_PC_REQUIRES "libssh") +set(_libssh_pc_requires "libssh") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBSSH_INCLUDE_DIR AND NOT DEFINED LIBSSH_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBSSH ${LIBSSH_PC_REQUIRES}) + pkg_check_modules(_libssh ${_libssh_pc_requires}) endif() -if(LIBSSH_FOUND) +if(_libssh_FOUND) set(Libssh_FOUND TRUE) - string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}") - message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")") + set(LIBSSH_FOUND TRUE) + set(LIBSSH_VERSION ${_libssh_VERSION}) + message(STATUS "Found Libssh (via pkg-config): ${_libssh_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")") else() find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h") find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh") @@ -85,13 +82,29 @@ else() ) if(LIBSSH_FOUND) - set(LIBSSH_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR}) - set(LIBSSH_LIBRARIES ${LIBSSH_LIBRARY}) + set(_libssh_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR}) + set(_libssh_LIBRARIES ${LIBSSH_LIBRARY}) endif() mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY) endif() -if(LIBSSH_FOUND AND WIN32) - list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex +if(LIBSSH_FOUND) + if(WIN32) + list(APPEND _libssh_LIBRARIES "iphlpapi") # for if_nametoindex + endif() + + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libssh_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libssh) + add_library(CURL::libssh INTERFACE IMPORTED) + set_target_properties(CURL::libssh PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libssh_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libssh_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libssh_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libssh_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libssh_LIBRARIES}") + endif() endif() diff --git a/CMake/FindLibssh2.cmake b/CMake/FindLibssh2.cmake index 08415533e0db..330611bfe55c 100644 --- a/CMake/FindLibssh2.cmake +++ b/CMake/FindLibssh2.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory. -# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library. +# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory. +# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library. # -# Result variables: +# Defines: # -# - `LIBSSH2_FOUND`: System has libssh2. -# - `LIBSSH2_INCLUDE_DIRS`: The libssh2 include directories. -# - `LIBSSH2_LIBRARIES`: The libssh2 library names. -# - `LIBSSH2_LIBRARY_DIRS`: The libssh2 library directories. -# - `LIBSSH2_PC_REQUIRES`: The libssh2 pkg-config packages. -# - `LIBSSH2_CFLAGS`: Required compiler flags. -# - `LIBSSH2_VERSION`: Version of libssh2. +# - `LIBSSH2_FOUND`: System has libssh2. +# - `LIBSSH2_VERSION`: Version of libssh2. +# - `CURL::libssh2`: libssh2 library target. -set(LIBSSH2_PC_REQUIRES "libssh2") +set(_libssh2_pc_requires "libssh2") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBSSH2_INCLUDE_DIR AND NOT DEFINED LIBSSH2_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBSSH2 ${LIBSSH2_PC_REQUIRES}) + pkg_check_modules(_libssh2 ${_libssh2_pc_requires}) endif() -if(LIBSSH2_FOUND AND LIBSSH2_INCLUDE_DIRS) +if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS) set(Libssh2_FOUND TRUE) - string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}") - message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") + set(LIBSSH2_FOUND TRUE) + set(LIBSSH2_VERSION ${_libssh2_VERSION}) + message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") else() find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h") find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2") @@ -75,9 +72,25 @@ else() ) if(LIBSSH2_FOUND) - set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) - set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) + set(_libssh2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) + set(_libssh2_LIBRARIES ${LIBSSH2_LIBRARY}) endif() mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) endif() + +if(LIBSSH2_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libssh2_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libssh2) + add_library(CURL::libssh2 INTERFACE IMPORTED) + set_target_properties(CURL::libssh2 PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libssh2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libssh2_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libssh2_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libssh2_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindLibuv.cmake b/CMake/FindLibuv.cmake index 2565ba3a386a..f9d614bc067c 100644 --- a/CMake/FindLibuv.cmake +++ b/CMake/FindLibuv.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory. -# - `LIBUV_LIBRARY`: Absolute path to `libuv` library. +# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory. +# - `LIBUV_LIBRARY`: Absolute path to `libuv` library. # -# Result variables: +# Defines: # -# - `LIBUV_FOUND`: System has libuv. -# - `LIBUV_INCLUDE_DIRS`: The libuv include directories. -# - `LIBUV_LIBRARIES`: The libuv library names. -# - `LIBUV_LIBRARY_DIRS`: The libuv library directories. -# - `LIBUV_PC_REQUIRES`: The libuv pkg-config packages. -# - `LIBUV_CFLAGS`: Required compiler flags. -# - `LIBUV_VERSION`: Version of libuv. +# - `LIBUV_FOUND`: System has libuv. +# - `LIBUV_VERSION`: Version of libuv. +# - `CURL::libuv`: libuv library target. -set(LIBUV_PC_REQUIRES "libuv") +set(_libuv_pc_requires "libuv") if(CURL_USE_PKGCONFIG AND NOT DEFINED LIBUV_INCLUDE_DIR AND NOT DEFINED LIBUV_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(LIBUV ${LIBUV_PC_REQUIRES}) + pkg_check_modules(_libuv ${_libuv_pc_requires}) endif() -if(LIBUV_FOUND) +if(_libuv_FOUND) set(Libuv_FOUND TRUE) - string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}") - message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")") + set(LIBUV_FOUND TRUE) + set(LIBUV_VERSION ${_libuv_VERSION}) + message(STATUS "Found Libuv (via pkg-config): ${_libuv_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")") else() find_path(LIBUV_INCLUDE_DIR NAMES "uv.h") find_library(LIBUV_LIBRARY NAMES "uv" "libuv") @@ -85,9 +82,25 @@ else() ) if(LIBUV_FOUND) - set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR}) - set(LIBUV_LIBRARIES ${LIBUV_LIBRARY}) + set(_libuv_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR}) + set(_libuv_LIBRARIES ${LIBUV_LIBRARY}) endif() mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY) endif() + +if(LIBUV_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_libuv_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::libuv) + add_library(CURL::libuv INTERFACE IMPORTED) + set_target_properties(CURL::libuv PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_libuv_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libuv_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libuv_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_libuv_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_libuv_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake index 11b4f076f4dc..97201ab2b343 100644 --- a/CMake/FindMbedTLS.cmake +++ b/CMake/FindMbedTLS.cmake @@ -25,20 +25,16 @@ # # Input variables: # -# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory. -# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library. -# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library. -# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library. +# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory. +# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library. +# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library. +# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library. # -# Result variables: +# Defines: # -# - `MBEDTLS_FOUND`: System has mbedTLS. -# - `MBEDTLS_INCLUDE_DIRS`: The mbedTLS include directories. -# - `MBEDTLS_LIBRARIES`: The mbedTLS library names. -# - `MBEDTLS_LIBRARY_DIRS`: The mbedTLS library directories. -# - `MBEDTLS_PC_REQUIRES`: The mbedTLS pkg-config packages. -# - `MBEDTLS_CFLAGS`: Required compiler flags. -# - `MBEDTLS_VERSION`: Version of mbedTLS. +# - `MBEDTLS_FOUND`: System has mbedTLS. +# - `MBEDTLS_VERSION`: Version of mbedTLS. +# - `CURL::mbedtls`: mbedTLS library target. if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR) message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.") @@ -46,7 +42,7 @@ if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR) unset(MBEDTLS_INCLUDE_DIRS) endif() -set(MBEDTLS_PC_REQUIRES "mbedtls" "mbedx509" "mbedcrypto") +set(_mbedtls_pc_requires "mbedtls" "mbedx509" "mbedcrypto") if(CURL_USE_PKGCONFIG AND NOT DEFINED MBEDTLS_INCLUDE_DIR AND @@ -54,16 +50,16 @@ if(CURL_USE_PKGCONFIG AND NOT DEFINED MBEDX509_LIBRARY AND NOT DEFINED MBEDCRYPTO_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES}) + pkg_check_modules(_mbedtls ${_mbedtls_pc_requires}) endif() -if(MBEDTLS_FOUND) +if(_mbedtls_FOUND) set(MbedTLS_FOUND TRUE) - set(MBEDTLS_VERSION ${MBEDTLS_mbedtls_VERSION}) - string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}") - message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") + set(MBEDTLS_FOUND TRUE) + set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION}) + message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") else() - set(MBEDTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h") find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls") @@ -92,9 +88,25 @@ else() ) if(MBEDTLS_FOUND) - set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR}) - set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}) + set(_mbedtls_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR}) + set(_mbedtls_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}) endif() mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) endif() + +if(MBEDTLS_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_mbedtls_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::mbedtls) + add_library(CURL::mbedtls INTERFACE IMPORTED) + set_target_properties(CURL::mbedtls PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_mbedtls_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_mbedtls_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_mbedtls_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_mbedtls_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake index 1ccf64158915..8304345a384b 100644 --- a/CMake/FindNGHTTP2.cmake +++ b/CMake/FindNGHTTP2.cmake @@ -25,31 +25,28 @@ # # Input variables: # -# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory. -# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library. +# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory. +# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library. # -# Result variables: +# Defines: # -# - `NGHTTP2_FOUND`: System has nghttp2. -# - `NGHTTP2_INCLUDE_DIRS`: The nghttp2 include directories. -# - `NGHTTP2_LIBRARIES`: The nghttp2 library names. -# - `NGHTTP2_LIBRARY_DIRS`: The nghttp2 library directories. -# - `NGHTTP2_PC_REQUIRES`: The nghttp2 pkg-config packages. -# - `NGHTTP2_CFLAGS`: Required compiler flags. -# - `NGHTTP2_VERSION`: Version of nghttp2. +# - `NGHTTP2_FOUND`: System has nghttp2. +# - `NGHTTP2_VERSION`: Version of nghttp2. +# - `CURL::nghttp2`: nghttp2 library target. -set(NGHTTP2_PC_REQUIRES "libnghttp2") +set(_nghttp2_pc_requires "libnghttp2") if(CURL_USE_PKGCONFIG AND NOT DEFINED NGHTTP2_INCLUDE_DIR AND NOT DEFINED NGHTTP2_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(NGHTTP2 ${NGHTTP2_PC_REQUIRES}) + pkg_check_modules(_nghttp2 ${_nghttp2_pc_requires}) endif() -if(NGHTTP2_FOUND) - string(REPLACE ";" " " NGHTTP2_CFLAGS "${NGHTTP2_CFLAGS}") - message(STATUS "Found NGHTTP2 (via pkg-config): ${NGHTTP2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")") +if(_nghttp2_FOUND) + set(NGHTTP2_FOUND TRUE) + set(NGHTTP2_VERSION ${_nghttp2_VERSION}) + message(STATUS "Found NGHTTP2 (via pkg-config): ${_nghttp2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")") else() find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h") find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static") @@ -74,9 +71,25 @@ else() ) if(NGHTTP2_FOUND) - set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR}) - set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY}) + set(_nghttp2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR}) + set(_nghttp2_LIBRARIES ${NGHTTP2_LIBRARY}) endif() mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY) endif() + +if(NGHTTP2_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_nghttp2_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::nghttp2) + add_library(CURL::nghttp2 INTERFACE IMPORTED) + set_target_properties(CURL::nghttp2 PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake index fba2c5779b36..37ebfe1114fa 100644 --- a/CMake/FindNGHTTP3.cmake +++ b/CMake/FindNGHTTP3.cmake @@ -25,31 +25,28 @@ # # Input variables: # -# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory. -# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library. +# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory. +# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library. # -# Result variables: +# Defines: # -# - `NGHTTP3_FOUND`: System has nghttp3. -# - `NGHTTP3_INCLUDE_DIRS`: The nghttp3 include directories. -# - `NGHTTP3_LIBRARIES`: The nghttp3 library names. -# - `NGHTTP3_LIBRARY_DIRS`: The nghttp3 library directories. -# - `NGHTTP3_PC_REQUIRES`: The nghttp3 pkg-config packages. -# - `NGHTTP3_CFLAGS`: Required compiler flags. -# - `NGHTTP3_VERSION`: Version of nghttp3. +# - `NGHTTP3_FOUND`: System has nghttp3. +# - `NGHTTP3_VERSION`: Version of nghttp3. +# - `CURL::nghttp3`: nghttp3 library target. -set(NGHTTP3_PC_REQUIRES "libnghttp3") +set(_nghttp3_pc_requires "libnghttp3") if(CURL_USE_PKGCONFIG AND NOT DEFINED NGHTTP3_INCLUDE_DIR AND NOT DEFINED NGHTTP3_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(NGHTTP3 ${NGHTTP3_PC_REQUIRES}) + pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires}) endif() -if(NGHTTP3_FOUND) - string(REPLACE ";" " " NGHTTP3_CFLAGS "${NGHTTP3_CFLAGS}") - message(STATUS "Found NGHTTP3 (via pkg-config): ${NGHTTP3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")") +if(_nghttp3_FOUND) + set(NGHTTP3_FOUND TRUE) + set(NGHTTP3_VERSION ${_nghttp3_VERSION}) + message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")") else() find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h") find_library(NGHTTP3_LIBRARY NAMES "nghttp3") @@ -74,9 +71,25 @@ else() ) if(NGHTTP3_FOUND) - set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR}) - set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY}) + set(_nghttp3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR}) + set(_nghttp3_LIBRARIES ${NGHTTP3_LIBRARY}) endif() mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY) endif() + +if(NGHTTP3_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_nghttp3_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::nghttp3) + add_library(CURL::nghttp3 INTERFACE IMPORTED) + set_target_properties(CURL::nghttp3 PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nghttp3_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nghttp3_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_nghttp3_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_nghttp3_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake index cda3b0e08cb2..416ea459f6b1 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake @@ -44,15 +44,11 @@ # - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library. # - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library. # -# Result variables: +# Defines: # # - `NGTCP2_FOUND`: System has ngtcp2. -# - `NGTCP2_INCLUDE_DIRS`: The ngtcp2 include directories. -# - `NGTCP2_LIBRARIES`: The ngtcp2 library names. -# - `NGTCP2_LIBRARY_DIRS`: The ngtcp2 library directories. -# - `NGTCP2_PC_REQUIRES`: The ngtcp2 pkg-config packages. -# - `NGTCP2_CFLAGS`: Required compiler flags. # - `NGTCP2_VERSION`: Version of ngtcp2. +# - `CURL::ngtcp2`: ngtcp2 library target. if(NGTCP2_FIND_COMPONENTS) set(_ngtcp2_crypto_backend "") @@ -71,9 +67,9 @@ if(NGTCP2_FIND_COMPONENTS) endif() endif() -set(NGTCP2_PC_REQUIRES "libngtcp2") +set(_ngtcp2_pc_requires "libngtcp2") if(_ngtcp2_crypto_backend) - list(APPEND NGTCP2_PC_REQUIRES "lib${_crypto_library_lower}") + list(APPEND _ngtcp2_pc_requires "lib${_crypto_library_lower}") endif() set(_tried_pkgconfig FALSE) @@ -81,14 +77,14 @@ if(CURL_USE_PKGCONFIG AND NOT DEFINED NGTCP2_INCLUDE_DIR AND NOT DEFINED NGTCP2_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(NGTCP2 ${NGTCP2_PC_REQUIRES}) + pkg_check_modules(_ngtcp2 ${_ngtcp2_pc_requires}) set(_tried_pkgconfig TRUE) endif() -if(NGTCP2_FOUND) - set(NGTCP2_VERSION ${NGTCP2_libngtcp2_VERSION}) - string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}") - message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") +if(_ngtcp2_FOUND) + set(NGTCP2_FOUND TRUE) + set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION}) + message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") else() find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h") find_library(NGTCP2_LIBRARY NAMES "ngtcp2") @@ -128,8 +124,8 @@ else() ) if(NGTCP2_FOUND) - set(NGTCP2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR}) - set(NGTCP2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY}) + set(_ngtcp2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR}) + set(_ngtcp2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY}) endif() mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY) @@ -139,3 +135,19 @@ else() unset(NGTCP2_LIBRARY CACHE) endif() endif() + +if(NGTCP2_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_ngtcp2_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::ngtcp2) + add_library(CURL::ngtcp2 INTERFACE IMPORTED) + set_target_properties(CURL::ngtcp2 PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_ngtcp2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_ngtcp2_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_ngtcp2_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_ngtcp2_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake index 7f2f69c1ca3e..d22865ffad69 100644 --- a/CMake/FindNettle.cmake +++ b/CMake/FindNettle.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory. -# - `NETTLE_LIBRARY`: Absolute path to `nettle` library. +# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory. +# - `NETTLE_LIBRARY`: Absolute path to `nettle` library. # -# Result variables: +# Defines: # -# - `NETTLE_FOUND`: System has nettle. -# - `NETTLE_INCLUDE_DIRS`: The nettle include directories. -# - `NETTLE_LIBRARIES`: The nettle library names. -# - `NETTLE_LIBRARY_DIRS`: The nettle library directories. -# - `NETTLE_PC_REQUIRES`: The nettle pkg-config packages. -# - `NETTLE_CFLAGS`: Required compiler flags. -# - `NETTLE_VERSION`: Version of nettle. +# - `NETTLE_FOUND`: System has nettle. +# - `NETTLE_VERSION`: Version of nettle. +# - `CURL::nettle`: nettle library target. -set(NETTLE_PC_REQUIRES "nettle") +set(_nettle_pc_requires "nettle") if(CURL_USE_PKGCONFIG AND NOT DEFINED NETTLE_INCLUDE_DIR AND NOT DEFINED NETTLE_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(NETTLE ${NETTLE_PC_REQUIRES}) + pkg_check_modules(_nettle ${_nettle_pc_requires}) endif() -if(NETTLE_FOUND) +if(_nettle_FOUND) set(Nettle_FOUND TRUE) - string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}") - message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")") + set(NETTLE_FOUND TRUE) + set(NETTLE_VERSION ${_nettle_VERSION}) + message(STATUS "Found Nettle (via pkg-config): ${_nettle_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")") else() find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h") find_library(NETTLE_LIBRARY NAMES "nettle") @@ -80,9 +77,25 @@ else() ) if(NETTLE_FOUND) - set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR}) - set(NETTLE_LIBRARIES ${NETTLE_LIBRARY}) + set(_nettle_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR}) + set(_nettle_LIBRARIES ${NETTLE_LIBRARY}) endif() mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY) endif() + +if(NETTLE_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_nettle_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::nettle) + add_library(CURL::nettle INTERFACE IMPORTED) + set_target_properties(CURL::nettle PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindQuiche.cmake b/CMake/FindQuiche.cmake index 934cf9f69f15..22482d79fb4f 100644 --- a/CMake/FindQuiche.cmake +++ b/CMake/FindQuiche.cmake @@ -25,32 +25,29 @@ # # Input variables: # -# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory. -# - `QUICHE_LIBRARY`: Absolute path to `quiche` library. +# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory. +# - `QUICHE_LIBRARY`: Absolute path to `quiche` library. # -# Result variables: +# Defines: # -# - `QUICHE_FOUND`: System has quiche. -# - `QUICHE_INCLUDE_DIRS`: The quiche include directories. -# - `QUICHE_LIBRARIES`: The quiche library names. -# - `QUICHE_LIBRARY_DIRS`: The quiche library directories. -# - `QUICHE_PC_REQUIRES`: The quiche pkg-config packages. -# - `QUICHE_CFLAGS`: Required compiler flags. -# - `QUICHE_VERSION`: Version of quiche. +# - `QUICHE_FOUND`: System has quiche. +# - `QUICHE_VERSION`: Version of quiche. +# - `CURL::quiche`: quiche library target. -set(QUICHE_PC_REQUIRES "quiche") +set(_quiche_pc_requires "quiche") if(CURL_USE_PKGCONFIG AND NOT DEFINED QUICHE_INCLUDE_DIR AND NOT DEFINED QUICHE_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(QUICHE ${QUICHE_PC_REQUIRES}) + pkg_check_modules(_quiche ${_quiche_pc_requires}) endif() -if(QUICHE_FOUND) +if(_quiche_FOUND) set(Quiche_FOUND TRUE) - string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}") - message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")") + set(QUICHE_FOUND TRUE) + set(QUICHE_VERSION ${_quiche_VERSION}) + message(STATUS "Found Quiche (via pkg-config): ${_quiche_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")") else() find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h") find_library(QUICHE_LIBRARY NAMES "quiche") @@ -63,9 +60,25 @@ else() ) if(QUICHE_FOUND) - set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR}) - set(QUICHE_LIBRARIES ${QUICHE_LIBRARY}) + set(_quiche_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR}) + set(_quiche_LIBRARIES ${QUICHE_LIBRARY}) endif() mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY) endif() + +if(QUICHE_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_quiche_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::quiche) + add_library(CURL::quiche INTERFACE IMPORTED) + set_target_properties(CURL::quiche PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_quiche_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_quiche_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_quiche_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_quiche_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_quiche_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindRustls.cmake b/CMake/FindRustls.cmake index a29ce5fa098b..37b99be73ea9 100644 --- a/CMake/FindRustls.cmake +++ b/CMake/FindRustls.cmake @@ -25,34 +25,31 @@ # # Input variables: # -# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory. -# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library. +# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory. +# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library. # -# Result variables: +# Defines: # -# - `RUSTLS_FOUND`: System has Rustls. -# - `RUSTLS_INCLUDE_DIRS`: The Rustls include directories. -# - `RUSTLS_LIBRARIES`: The Rustls library names. -# - `RUSTLS_LIBRARY_DIRS`: The Rustls library directories. -# - `RUSTLS_PC_REQUIRES`: The Rustls pkg-config packages. -# - `RUSTLS_CFLAGS`: Required compiler flags. -# - `RUSTLS_VERSION`: Version of Rustls. +# - `RUSTLS_FOUND`: System has Rustls. +# - `RUSTLS_VERSION`: Version of Rustls. +# - `CURL::rustls`: Rustls library target. -set(RUSTLS_PC_REQUIRES "rustls") +set(_rustls_pc_requires "rustls") if(CURL_USE_PKGCONFIG AND NOT DEFINED RUSTLS_INCLUDE_DIR AND NOT DEFINED RUSTLS_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(RUSTLS ${RUSTLS_PC_REQUIRES}) + pkg_check_modules(_rustls ${_rustls_pc_requires}) endif() -if(RUSTLS_FOUND) +if(_rustls_FOUND) set(Rustls_FOUND TRUE) - string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}") - message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")") + set(RUSTLS_FOUND TRUE) + set(RUSTLS_VERSION ${_rustls_VERSION}) + message(STATUS "Found Rustls (via pkg-config): ${_rustls_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")") else() - set(RUSTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + set(_rustls_pc_requires "") # Depend on pkg-config only when found via pkg-config find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h") find_library(RUSTLS_LIBRARY NAMES "rustls") @@ -65,8 +62,8 @@ else() ) if(RUSTLS_FOUND) - set(RUSTLS_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR}) - set(RUSTLS_LIBRARIES ${RUSTLS_LIBRARY}) + set(_rustls_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR}) + set(_rustls_LIBRARIES ${RUSTLS_LIBRARY}) endif() mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY) @@ -79,31 +76,47 @@ if(RUSTLS_FOUND) if(NOT SECURITY_FRAMEWORK) message(FATAL_ERROR "Security framework not found") endif() - list(APPEND RUSTLS_LIBRARIES "-framework Security") + list(APPEND _rustls_LIBRARIES "-framework Security") find_library(FOUNDATION_FRAMEWORK NAMES "Foundation") mark_as_advanced(FOUNDATION_FRAMEWORK) if(NOT FOUNDATION_FRAMEWORK) message(FATAL_ERROR "Foundation framework not found") endif() - list(APPEND RUSTLS_LIBRARIES "-framework Foundation") + list(APPEND _rustls_LIBRARIES "-framework Foundation") elseif(NOT WIN32) find_library(PTHREAD_LIBRARY NAMES "pthread") if(PTHREAD_LIBRARY) - list(APPEND RUSTLS_LIBRARIES ${PTHREAD_LIBRARY}) + list(APPEND _rustls_LIBRARIES ${PTHREAD_LIBRARY}) endif() mark_as_advanced(PTHREAD_LIBRARY) find_library(DL_LIBRARY NAMES "dl") if(DL_LIBRARY) - list(APPEND RUSTLS_LIBRARIES ${DL_LIBRARY}) + list(APPEND _rustls_LIBRARIES ${DL_LIBRARY}) endif() mark_as_advanced(DL_LIBRARY) find_library(MATH_LIBRARY NAMES "m") if(MATH_LIBRARY) - list(APPEND RUSTLS_LIBRARIES ${MATH_LIBRARY}) + list(APPEND _rustls_LIBRARIES ${MATH_LIBRARY}) endif() mark_as_advanced(MATH_LIBRARY) endif() endif() + +if(RUSTLS_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_rustls_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::rustls) + add_library(CURL::rustls INTERFACE IMPORTED) + set_target_properties(CURL::rustls PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_rustls_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_rustls_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_rustls_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_rustls_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_rustls_LIBRARIES}") + endif() +endif() diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake index 4d172c029a39..3a3c05f0fd03 100644 --- a/CMake/FindWolfSSL.cmake +++ b/CMake/FindWolfSSL.cmake @@ -25,18 +25,14 @@ # # Input variables: # -# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory. -# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library. +# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory. +# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library. # -# Result variables: +# Defines: # -# - `WOLFSSL_FOUND`: System has wolfSSL. -# - `WOLFSSL_INCLUDE_DIRS`: The wolfSSL include directories. -# - `WOLFSSL_LIBRARIES`: The wolfSSL library names. -# - `WOLFSSL_LIBRARY_DIRS`: The wolfSSL library directories. -# - `WOLFSSL_PC_REQUIRES`: The wolfSSL pkg-config packages. -# - `WOLFSSL_CFLAGS`: Required compiler flags. -# - `WOLFSSL_VERSION`: Version of wolfSSL. +# - `WOLFSSL_FOUND`: System has wolfSSL. +# - `WOLFSSL_VERSION`: Version of wolfSSL. +# - `CURL::wolfssl`: wolfSSL library target. if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR) message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.") @@ -47,19 +43,20 @@ if(DEFINED WolfSSL_LIBRARY AND NOT DEFINED WOLFSSL_LIBRARY) set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}") endif() -set(WOLFSSL_PC_REQUIRES "wolfssl") +set(_wolfssl_pc_requires "wolfssl") if(CURL_USE_PKGCONFIG AND NOT DEFINED WOLFSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(WOLFSSL ${WOLFSSL_PC_REQUIRES}) + pkg_check_modules(_wolfssl ${_wolfssl_pc_requires}) endif() -if(WOLFSSL_FOUND) +if(_wolfssl_FOUND) set(WolfSSL_FOUND TRUE) - string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}") - message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") + set(WOLFSSL_FOUND TRUE) + set(WOLFSSL_VERSION ${_wolfssl_VERSION}) + message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") else() find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h") find_library(WOLFSSL_LIBRARY NAMES "wolfssl") @@ -84,8 +81,8 @@ else() ) if(WOLFSSL_FOUND) - set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR}) - set(WOLFSSL_LIBRARIES ${WOLFSSL_LIBRARY}) + set(_wolfssl_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR}) + set(_wolfssl_LIBRARIES ${WOLFSSL_LIBRARY}) endif() mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY) @@ -98,19 +95,35 @@ if(WOLFSSL_FOUND) if(NOT SECURITY_FRAMEWORK) message(FATAL_ERROR "Security framework not found") endif() - list(APPEND WOLFSSL_LIBRARIES "-framework Security") + list(APPEND _wolfssl_LIBRARIES "-framework Security") find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation") mark_as_advanced(COREFOUNDATION_FRAMEWORK) if(NOT COREFOUNDATION_FRAMEWORK) message(FATAL_ERROR "CoreFoundation framework not found") endif() - list(APPEND WOLFSSL_LIBRARIES "-framework CoreFoundation") - elseif(NOT WIN32) + list(APPEND _wolfssl_LIBRARIES "-framework CoreFoundation") + elseif(WIN32) + list(APPEND _wolfssl_LIBRARIES "crypt32") + else() find_library(MATH_LIBRARY NAMES "m") if(MATH_LIBRARY) - list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow + list(APPEND _wolfssl_LIBRARIES ${MATH_LIBRARY}) # for log and pow endif() mark_as_advanced(MATH_LIBRARY) endif() + + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_wolfssl_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::wolfssl) + add_library(CURL::wolfssl INTERFACE IMPORTED) + set_target_properties(CURL::wolfssl PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_wolfssl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_wolfssl_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_wolfssl_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_wolfssl_LIBRARIES}") + endif() endif() diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake index 655f0cc700a8..954a827b6fe4 100644 --- a/CMake/FindZstd.cmake +++ b/CMake/FindZstd.cmake @@ -25,18 +25,14 @@ # # Input variables: # -# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory. -# - `ZSTD_LIBRARY`: Absolute path to `zstd` library. +# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory. +# - `ZSTD_LIBRARY`: Absolute path to `zstd` library. # -# Result variables: +# Defines: # -# - `ZSTD_FOUND`: System has zstd. -# - `ZSTD_INCLUDE_DIRS`: The zstd include directories. -# - `ZSTD_LIBRARIES`: The zstd library names. -# - `ZSTD_LIBRARY_DIRS`: The zstd library directories. -# - `ZSTD_PC_REQUIRES`: The zstd pkg-config packages. -# - `ZSTD_CFLAGS`: Required compiler flags. -# - `ZSTD_VERSION`: Version of zstd. +# - `ZSTD_FOUND`: System has zstd. +# - `ZSTD_VERSION`: Version of zstd. +# - `CURL::zstd`: zstd library target. if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR) message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.") @@ -47,19 +43,20 @@ if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY) set(ZSTD_LIBRARY "${Zstd_LIBRARY}") endif() -set(ZSTD_PC_REQUIRES "libzstd") +set(_zstd_pc_requires "libzstd") if(CURL_USE_PKGCONFIG AND NOT DEFINED ZSTD_INCLUDE_DIR AND NOT DEFINED ZSTD_LIBRARY) find_package(PkgConfig QUIET) - pkg_check_modules(ZSTD ${ZSTD_PC_REQUIRES}) + pkg_check_modules(_zstd ${_zstd_pc_requires}) endif() -if(ZSTD_FOUND) +if(_zstd_FOUND) set(Zstd_FOUND TRUE) - string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}") - message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") + set(ZSTD_FOUND TRUE) + set(ZSTD_VERSION ${_zstd_VERSION}) + message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") else() find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") find_library(ZSTD_LIBRARY NAMES "zstd") @@ -94,9 +91,25 @@ else() ) if(ZSTD_FOUND) - set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR}) - set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) + set(_zstd_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR}) + set(_zstd_LIBRARIES ${ZSTD_LIBRARY}) endif() mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY) endif() + +if(ZSTD_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.13) + link_directories(${_zstd_LIBRARY_DIRS}) + endif() + + if(NOT TARGET CURL::zstd) + add_library(CURL::zstd INTERFACE IMPORTED) + set_target_properties(CURL::zstd PROPERTIES + INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_zstd_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_zstd_INCLUDE_DIRS}" + INTERFACE_LINK_DIRECTORIES "${_zstd_LIBRARY_DIRS}" + INTERFACE_LINK_LIBRARIES "${_zstd_LIBRARIES}") + endif() +endif() diff --git a/CMake/Utilities.cmake b/CMake/Utilities.cmake index 335713c84cfe..efa28b75155b 100644 --- a/CMake/Utilities.cmake +++ b/CMake/Utilities.cmake @@ -59,6 +59,7 @@ function(curl_dumptargetprops _target) string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}") list(REMOVE_DUPLICATES _cmake_property_list) list(REMOVE_ITEM _cmake_property_list "") + list(APPEND _cmake_property_list "INTERFACE_LIBCURL_PC_MODULES") foreach(_prop IN LISTS _cmake_property_list) if(_prop MATCHES "") foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO") diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index d1582b8d41b9..99949198a305 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -23,7 +23,12 @@ ########################################################################### @PACKAGE_INIT@ +option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@" "@CURL_USE_PKGCONFIG@") + include(CMakeFindDependencyMacro) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) + +set(_libs "") if("@USE_OPENSSL@") if("@OPENSSL_VERSION_MAJOR@") find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@") @@ -34,6 +39,97 @@ endif() if("@HAVE_LIBZ@") find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@") endif() +if("@HAVE_BROTLI@") + find_dependency(Brotli) + list(APPEND _libs CURL::brotli) +endif() +if("@USE_ARES@") + find_dependency(Cares) + list(APPEND _libs CURL::cares) +endif() +if("@HAVE_GSSAPI@") + find_dependency(GSS) + list(APPEND _libs CURL::gss) +endif() +if("@USE_BACKTRACE@") + find_dependency(Libbacktrace) + list(APPEND _libs CURL::libbacktrace) +endif() +if("@USE_GSASL@") + find_dependency(Libgsasl) + list(APPEND _libs CURL::libgsasl) +endif() +if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@") + find_dependency(LDAP) + list(APPEND _libs CURL::ldap) +endif() +if("@HAVE_LIBIDN2@") + find_dependency(Libidn2) + list(APPEND _libs CURL::libidn2) +endif() +if("@USE_LIBPSL@") + find_dependency(Libpsl) + list(APPEND _libs CURL::libpsl) +endif() +if("@USE_LIBRTMP@") + find_dependency(Librtmp) + list(APPEND _libs CURL::librtmp) +endif() +if("@USE_LIBSSH@") + find_dependency(Libssh) + list(APPEND _libs CURL::libssh) +endif() +if("@USE_LIBSSH2@") + find_dependency(Libssh2) + list(APPEND _libs CURL::libssh2) +endif() +if("@USE_LIBUV@") + find_dependency(Libuv) + list(APPEND _libs CURL::libuv) +endif() +if("@USE_MBEDTLS@") + find_dependency(MbedTLS) + list(APPEND _libs CURL::mbedtls) +endif() +if("@USE_NGHTTP2@") + find_dependency(NGHTTP2) + list(APPEND _libs CURL::nghttp2) +endif() +if("@USE_NGHTTP3@") + find_dependency(NGHTTP3) + list(APPEND _libs CURL::nghttp3) +endif() +if("@USE_NGTCP2@") + find_dependency(NGTCP2) + list(APPEND _libs CURL::ngtcp2) +endif() +if("@USE_GNUTLS@") + find_dependency(GnuTLS) + list(APPEND _libs CURL::gnutls) + find_dependency(Nettle) + list(APPEND _libs CURL::nettle) +endif() +if("@USE_QUICHE@") + find_dependency(Quiche) + list(APPEND _libs CURL::quiche) +endif() +if("@USE_RUSTLS@") + find_dependency(Rustls) + list(APPEND _libs CURL::rustls) +endif() +if("@USE_WOLFSSL@") + find_dependency(WolfSSL) + list(APPEND _libs CURL::wolfssl) +endif() +if("@HAVE_ZSTD@") + find_dependency(Zstd) + list(APPEND _libs CURL::zstd) +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND WIN32 AND NOT TARGET CURL::win32_winsock) + add_library(CURL::win32_winsock INTERFACE IMPORTED) + set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "@_win32_winsock@") +endif() include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") @@ -45,9 +141,31 @@ if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@) add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@) endif() +if(TARGET @PROJECT_NAME@::@LIB_STATIC@) + # CMake before CMP0099 (CMake 3.17 2020-03-20) did not propagate libdirs to + # targets. It expected libs to have an absolute filename. As a workaround, + # manually apply dependency libdirs, for CMake consumers without this policy. + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) + cmake_policy(GET CMP0099 _has_CMP0099) # https://cmake.org/cmake/help/latest/policy/CMP0099.html + endif() + if(NOT _has_CMP0099 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.13 AND _libs) + set(_libdirs "") + foreach(_lib IN LISTS _libs) + get_target_property(_libdir "${_lib}" INTERFACE_LINK_DIRECTORIES) + if(_libdir) + list(APPEND _libdirs "${_libdir}") + endif() + endforeach() + if(_libdirs) + target_link_directories(@PROJECT_NAME@::@LIB_STATIC@ INTERFACE ${_libdirs}) + endif() + endif() +endif() + # For compatibility with CMake's FindCURL.cmake set(CURL_VERSION_STRING "@CURLVERSION@") set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@) +set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@") set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d6e7ca3e667..2af1679c993f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,23 +358,14 @@ else() endif() option(CURL_USE_PKGCONFIG "Enable pkg-config to detect dependencies" ${_curl_use_pkgconfig_default}) -# Initialize variables collecting dependency libs, paths, pkg-config names. +# Initialize variables collecting system and dependency libs. set(CURL_NETWORK_AND_TIME_LIBS "") set(CURL_LIBS "") -set(CURL_LIBDIRS "") -set(LIBCURL_PC_REQUIRES_PRIVATE "") if(ENABLE_ARES) set(USE_ARES 1) find_package(Cares REQUIRED) - list(APPEND CURL_LIBS ${CARES_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${CARES_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${CARES_PC_REQUIRES}) - include_directories(SYSTEM ${CARES_INCLUDE_DIRS}) - link_directories(${CARES_LIBRARY_DIRS}) - if(CARES_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${CARES_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::cares) endif() include(CurlSymbolHiding) @@ -762,7 +753,7 @@ if(CURL_USE_OPENSSL) # Depend on OpenSSL via imported targets. This allows our dependents to # get our dependencies transitively. list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "openssl") + set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_MODULES "openssl") if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") set(_valid_default_ssl_backend TRUE) @@ -809,14 +800,7 @@ if(CURL_USE_MBEDTLS) endif() set(_ssl_enabled ON) set(USE_MBEDTLS ON) - list(APPEND CURL_LIBS ${MBEDTLS_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${MBEDTLS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${MBEDTLS_PC_REQUIRES}) - include_directories(SYSTEM ${MBEDTLS_INCLUDE_DIRS}) - link_directories(${MBEDTLS_LIBRARY_DIRS}) - if(MBEDTLS_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${MBEDTLS_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::mbedtls) if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "mbedtls") set(_valid_default_ssl_backend TRUE) @@ -828,9 +812,7 @@ if(CURL_USE_MBEDTLS) endif() if(NOT DEFINED HAVE_MBEDTLS_DES_CRYPT_ECB) cmake_push_check_state() - list(APPEND CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIRS}") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${MBEDTLS_LIBRARIES}") - curl_required_libpaths("${MBEDTLS_LIBRARY_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::mbedtls) check_function_exists("mbedtls_des_crypt_ecb" HAVE_MBEDTLS_DES_CRYPT_ECB) # in mbedTLS <4 cmake_pop_check_state() endif() @@ -840,14 +822,7 @@ if(CURL_USE_WOLFSSL) find_package(WolfSSL REQUIRED) set(_ssl_enabled ON) set(USE_WOLFSSL ON) - list(APPEND CURL_LIBS ${WOLFSSL_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${WOLFSSL_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${WOLFSSL_PC_REQUIRES}) - include_directories(SYSTEM ${WOLFSSL_INCLUDE_DIRS}) - link_directories(${WOLFSSL_LIBRARY_DIRS}) - if(WOLFSSL_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${WOLFSSL_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::wolfssl) if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "wolfssl") set(_valid_default_ssl_backend TRUE) @@ -857,26 +832,11 @@ endif() if(CURL_USE_GNUTLS) find_package(GnuTLS REQUIRED) - list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${GNUTLS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${GNUTLS_PC_REQUIRES}) - include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS}) - link_directories(${GNUTLS_LIBRARY_DIRS}) - if(GNUTLS_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${GNUTLS_CFLAGS}") - endif() - + list(APPEND CURL_LIBS CURL::gnutls) find_package(Nettle REQUIRED) + list(APPEND CURL_LIBS CURL::nettle) set(_ssl_enabled ON) set(USE_GNUTLS ON) - list(APPEND CURL_LIBS ${NETTLE_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NETTLE_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NETTLE_PC_REQUIRES}) - include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS}) - link_directories(${NETTLE_LIBRARY_DIRS}) - if(NETTLE_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${NETTLE_CFLAGS}") - endif() if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "gnutls") set(_valid_default_ssl_backend TRUE) @@ -885,9 +845,7 @@ if(CURL_USE_GNUTLS) if(NOT DEFINED HAVE_GNUTLS_SRP AND NOT CURL_DISABLE_SRP) cmake_push_check_state() - list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}") - curl_required_libpaths("${GNUTLS_LIBRARY_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::gnutls) # In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds. # Detecting actual TLS-SRP support needs poking the API at runtime. check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP) @@ -899,23 +857,14 @@ if(CURL_USE_RUSTLS) find_package(Rustls REQUIRED) set(_ssl_enabled ON) set(USE_RUSTLS ON) - list(APPEND CURL_LIBS ${RUSTLS_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${RUSTLS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${RUSTLS_PC_REQUIRES}) - include_directories(SYSTEM ${RUSTLS_INCLUDE_DIRS}) - link_directories(${RUSTLS_LIBRARY_DIRS}) - if(RUSTLS_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${RUSTLS_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::rustls) if(NOT DEFINED HAVE_RUSTLS_SUPPORTED_HPKE) if(RUSTLS_VERSION AND RUSTLS_VERSION VERSION_GREATER_EQUAL 0.15) set(HAVE_RUSTLS_SUPPORTED_HPKE TRUE) elseif(NOT RUSTLS_VERSION) cmake_push_check_state() - list(APPEND CMAKE_REQUIRED_INCLUDES "${RUSTLS_INCLUDE_DIRS}") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${RUSTLS_LIBRARIES}") - curl_required_libpaths("${RUSTLS_LIBRARY_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::rustls) check_symbol_exists("rustls_supported_hpke" "rustls.h" HAVE_RUSTLS_SUPPORTED_HPKE) cmake_pop_check_state() endif() @@ -944,21 +893,14 @@ if(ZLIB_FOUND) # Depend on ZLIB via imported targets. This allows our dependents to # get our dependencies transitively. list(APPEND CURL_LIBS ZLIB::ZLIB) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "zlib") + set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_MODULES "zlib") endif() set(HAVE_BROTLI OFF) curl_dependency_option(CURL_BROTLI Brotli "brotli") if(BROTLI_FOUND) set(HAVE_BROTLI ON) - list(APPEND CURL_LIBS ${BROTLI_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${BROTLI_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${BROTLI_PC_REQUIRES}) - include_directories(SYSTEM ${BROTLI_INCLUDE_DIRS}) - link_directories(${BROTLI_LIBRARY_DIRS}) - if(BROTLI_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${BROTLI_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::brotli) endif() set(HAVE_ZSTD OFF) @@ -966,14 +908,7 @@ curl_dependency_option(CURL_ZSTD Zstd "zstd") if(ZSTD_FOUND) if(ZSTD_VERSION VERSION_GREATER_EQUAL 1.0.0) set(HAVE_ZSTD ON) - list(APPEND CURL_LIBS ${ZSTD_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${ZSTD_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${ZSTD_PC_REQUIRES}) - include_directories(SYSTEM ${ZSTD_INCLUDE_DIRS}) - link_directories(${ZSTD_LIBRARY_DIRS}) - if(ZSTD_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${ZSTD_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::zstd) else() message(WARNING "zstd v1.0.0 or newer is required, disabling zstd support.") endif() @@ -993,9 +928,7 @@ macro(curl_openssl_check_exists) endif() endif() if(USE_WOLFSSL) - list(APPEND CMAKE_REQUIRED_INCLUDES "${WOLFSSL_INCLUDE_DIRS}") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${WOLFSSL_LIBRARIES}") - curl_required_libpaths("${WOLFSSL_LIBRARY_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::wolfssl) if(HAVE_LIBZ) list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) # Public wolfSSL headers also require zlib headers endif() @@ -1097,14 +1030,7 @@ option(USE_NGHTTP2 "Use nghttp2 library" ON) if(USE_NGHTTP2) find_package(NGHTTP2) if(NGHTTP2_FOUND) - list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGHTTP2_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP2_PC_REQUIRES}) - include_directories(SYSTEM ${NGHTTP2_INCLUDE_DIRS}) - link_directories(${NGHTTP2_LIBRARY_DIRS}) - if(NGHTTP2_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${NGHTTP2_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::nghttp2) else() set(USE_NGHTTP2 OFF) endif() @@ -1140,25 +1066,11 @@ if(USE_NGTCP2) else() message(FATAL_ERROR "ngtcp2 requires a supported TLS-backend") endif() - list(APPEND CURL_LIBS ${NGTCP2_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGTCP2_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGTCP2_PC_REQUIRES}) - include_directories(SYSTEM ${NGTCP2_INCLUDE_DIRS}) - link_directories(${NGTCP2_LIBRARY_DIRS}) - if(NGTCP2_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${NGTCP2_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::ngtcp2) find_package(NGHTTP3 REQUIRED) set(USE_NGHTTP3 ON) - list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGHTTP3_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP3_PC_REQUIRES}) - include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS}) - link_directories(${NGHTTP3_LIBRARY_DIRS}) - if(NGHTTP3_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${NGHTTP3_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::nghttp3) endif() option(USE_QUICHE "Use quiche library for HTTP/3 support" OFF) @@ -1173,18 +1085,10 @@ if(USE_QUICHE) message(FATAL_ERROR "quiche requires BoringSSL") endif() curl_openssl_check_quic() - list(APPEND CURL_LIBS ${QUICHE_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${QUICHE_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${QUICHE_PC_REQUIRES}) - include_directories(SYSTEM ${QUICHE_INCLUDE_DIRS}) - link_directories(${QUICHE_LIBRARY_DIRS}) - if(QUICHE_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${QUICHE_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::quiche) if(NOT DEFINED HAVE_QUICHE_CONN_SET_QLOG_FD) cmake_push_check_state() - list(APPEND CMAKE_REQUIRED_INCLUDES "${QUICHE_INCLUDE_DIRS}") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${QUICHE_LIBRARIES}") + list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::quiche) check_symbol_exists("quiche_conn_set_qlog_fd" "quiche.h" HAVE_QUICHE_CONN_SET_QLOG_FD) cmake_pop_check_state() endif() @@ -1200,14 +1104,7 @@ if(USE_OPENSSL_QUIC) find_package(NGHTTP3 REQUIRED) set(USE_NGHTTP3 ON) - list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGHTTP3_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP3_PC_REQUIRES}) - include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS}) - link_directories(${NGHTTP3_LIBRARY_DIRS}) - if(NGHTTP3_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${NGHTTP3_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::nghttp3) endif() if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP)) @@ -1235,22 +1132,12 @@ if(NOT CURL_DISABLE_LDAP) find_package(LDAP) if(LDAP_FOUND) set(HAVE_LBER_H 1) - set(CURL_LIBS ${LDAP_LIBRARIES} ${CURL_LIBS}) - list(APPEND CURL_LIBDIRS ${LDAP_LIBRARY_DIRS}) - if(LDAP_PC_REQUIRES) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LDAP_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) - endif() - include_directories(SYSTEM ${LDAP_INCLUDE_DIRS}) - link_directories(${LDAP_LIBRARY_DIRS}) - if(LDAP_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LDAP_CFLAGS}") - endif() + set(CURL_LIBS CURL::ldap ${CURL_LIBS}) # LDAP feature checks list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DLDAP_DEPRECATED=1") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${LDAP_LIBRARIES}") - curl_required_libpaths("${LDAP_LIBRARY_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::ldap) check_function_exists("ldap_url_parse" HAVE_LDAP_URL_PARSE) check_function_exists("ldap_init_fd" HAVE_LDAP_INIT_FD) @@ -1312,14 +1199,7 @@ set(HAVE_LIBIDN2 OFF) if(USE_LIBIDN2 AND NOT USE_APPLE_IDN AND NOT USE_WIN32_IDN) find_package(Libidn2) if(LIBIDN2_FOUND) - set(CURL_LIBS ${LIBIDN2_LIBRARIES} ${CURL_LIBS}) - list(APPEND CURL_LIBDIRS ${LIBIDN2_LIBRARY_DIRS}) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBIDN2_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) - include_directories(SYSTEM ${LIBIDN2_INCLUDE_DIRS}) - link_directories(${LIBIDN2_LIBRARY_DIRS}) - if(LIBIDN2_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBIDN2_CFLAGS}") - endif() + set(CURL_LIBS CURL::libidn2 ${CURL_LIBS}) set(HAVE_IDN2_H 1) set(HAVE_LIBIDN2 1) endif() @@ -1329,17 +1209,9 @@ endif() option(CURL_USE_LIBPSL "Use libpsl" ON) mark_as_advanced(CURL_USE_LIBPSL) set(USE_LIBPSL OFF) - if(CURL_USE_LIBPSL) find_package(Libpsl REQUIRED) - list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBPSL_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBPSL_PC_REQUIRES}) - include_directories(SYSTEM ${LIBPSL_INCLUDE_DIRS}) - link_directories(${LIBPSL_LIBRARY_DIRS}) - if(LIBPSL_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBPSL_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::libpsl) set(USE_LIBPSL ON) endif() @@ -1347,18 +1219,10 @@ endif() option(CURL_USE_LIBSSH2 "Use libssh2" ON) mark_as_advanced(CURL_USE_LIBSSH2) set(USE_LIBSSH2 OFF) - if(CURL_USE_LIBSSH2) find_package(Libssh2) if(LIBSSH2_FOUND) - set(CURL_LIBS ${LIBSSH2_LIBRARIES} ${CURL_LIBS}) # keep it before TLS-crypto, compression - list(APPEND CURL_LIBDIRS ${LIBSSH2_LIBRARY_DIRS}) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBSSH2_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) - include_directories(SYSTEM ${LIBSSH2_INCLUDE_DIRS}) - link_directories(${LIBSSH2_LIBRARY_DIRS}) - if(LIBSSH2_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBSSH2_CFLAGS}") - endif() + set(CURL_LIBS CURL::libssh2 ${CURL_LIBS}) # keep it before TLS-crypto, compression set(USE_LIBSSH2 ON) endif() endif() @@ -1368,14 +1232,7 @@ option(CURL_USE_LIBSSH "Use libssh" OFF) mark_as_advanced(CURL_USE_LIBSSH) if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH) find_package(Libssh REQUIRED) - set(CURL_LIBS ${LIBSSH_LIBRARIES} ${CURL_LIBS}) # keep it before TLS-crypto, compression - list(APPEND CURL_LIBDIRS ${LIBSSH_LIBRARY_DIRS}) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBSSH_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) - include_directories(SYSTEM ${LIBSSH_INCLUDE_DIRS}) - link_directories(${LIBSSH_LIBRARY_DIRS}) - if(LIBSSH_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBSSH_CFLAGS}") - endif() + set(CURL_LIBS CURL::libssh ${CURL_LIBS}) # keep it before TLS-crypto, compression set(USE_LIBSSH ON) endif() @@ -1383,14 +1240,7 @@ option(CURL_USE_GSASL "Use libgsasl" OFF) mark_as_advanced(CURL_USE_GSASL) if(CURL_USE_GSASL) find_package(Libgsasl REQUIRED) - list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBGSASL_PC_REQUIRES}) - include_directories(SYSTEM ${LIBGSASL_INCLUDE_DIRS}) - link_directories(${LIBGSASL_LIBRARY_DIRS}) - if(LIBGSASL_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBGSASL_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::libgsasl) set(USE_GSASL ON) endif() @@ -1402,16 +1252,10 @@ if(CURL_USE_GSSAPI) set(HAVE_GSSAPI ${GSS_FOUND}) if(GSS_FOUND) - list(APPEND CURL_LIBS ${GSS_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${GSS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${GSS_PC_REQUIRES}) - include_directories(SYSTEM ${GSS_INCLUDE_DIRS}) - link_directories(${GSS_LIBRARY_DIRS}) - if(GSS_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${GSS_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::gss) - if(GSS_FLAVOUR STREQUAL "GNU") + get_target_property(_gss_flavour CURL::gss INTERFACE_CURL_GSS_FLAVOUR) + if(_gss_flavour STREQUAL "GNU") set(HAVE_GSSGNU 1) elseif(GSS_VERSION) # MIT set(CURL_KRB5_VERSION "\"${GSS_VERSION}\"") @@ -1431,8 +1275,7 @@ if(CURL_USE_LIBBACKTRACE) message(FATAL_ERROR "libbacktrace requires debug information") endif() find_package(Libbacktrace REQUIRED) - list(APPEND CURL_LIBS ${LIBBACKTRACE_LIBRARIES}) - include_directories(SYSTEM ${LIBBACKTRACE_INCLUDE_DIRS}) + list(APPEND CURL_LIBS CURL::libbacktrace) set(USE_BACKTRACE ON) endif() @@ -1443,14 +1286,7 @@ if(CURL_USE_LIBUV) message(FATAL_ERROR "Using libuv without debug support enabled is useless") endif() find_package(Libuv REQUIRED) - list(APPEND CURL_LIBS ${LIBUV_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBUV_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBUV_PC_REQUIRES}) - include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS}) - link_directories(${LIBUV_LIBRARY_DIRS}) - if(LIBUV_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBUV_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::libuv) set(USE_LIBUV ON) set(HAVE_UV_H ON) endif() @@ -1458,14 +1294,7 @@ endif() option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF) if(USE_LIBRTMP) find_package(Librtmp REQUIRED) - list(APPEND CURL_LIBS ${LIBRTMP_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBRTMP_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBRTMP_PC_REQUIRES}) - include_directories(SYSTEM ${LIBRTMP_INCLUDE_DIRS}) - link_directories(${LIBRTMP_LIBRARY_DIRS}) - if(LIBRTMP_CFLAGS) - string(APPEND CMAKE_C_FLAGS " ${LIBRTMP_CFLAGS}") - endif() + list(APPEND CURL_LIBS CURL::librtmp) endif() option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) @@ -1964,6 +1793,28 @@ if(CURL_CODE_COVERAGE) list(APPEND CURL_LIBS ${CURL_COVERAGE_LIBS}) endif() +# Hack to add some libraries to the end of the library list to make binutils ld +# for GCC find symbols when linking statically. Necessary for libs detected via +# CMake's built-in find modules, which CMake adds to the beginning of the lib +# list on the linker command-line for some reason. This makes them appear +# before dependencies detected via curl's custom Find modules, and breaks +# linkers sensitive to lib order. There must be a better solution to this. +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + foreach(_lib IN ITEMS OpenSSL::Crypto ZLIB::ZLIB) + if(TARGET "${_lib}") + add_library(CURL::${_lib} INTERFACE IMPORTED) + get_target_property(_libname "${_lib}" LOCATION) + set_target_properties(${_lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${_libname}") + list(APPEND CURL_LIBS ${_lib}) + endif() + endforeach() + if(WIN32) + add_library(CURL::win32_winsock INTERFACE IMPORTED) + set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32") + list(APPEND CURL_LIBS CURL::win32_winsock) + endif() +endif() + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation endif() @@ -2028,8 +1879,6 @@ endif() add_subdirectory(scripts) # for shell completions -list(REMOVE_DUPLICATES CURL_LIBDIRS) - add_subdirectory(lib) if(BUILD_CURL_EXE) @@ -2252,67 +2101,104 @@ if(NOT CURL_DISABLE_INSTALL) endif() endforeach() - foreach(_libdir IN LISTS _custom_libdirs CURL_LIBDIRS) - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) - cmake_path(SET _libdir NORMALIZE "${_libdir}") - endif() - list(FIND _sys_libdirs "${_libdir}" _libdir_index) - if(_libdir_index LESS 0) - list(APPEND _ldflags "-L${_libdir}") - endif() - endforeach() - set(_implicit_libs "") if(NOT MINGW AND NOT UNIX) set(_implicit_libs "${CMAKE_C_IMPLICIT_LINK_LIBRARIES}") endif() - foreach(_lib IN LISTS _implicit_libs _custom_libs CURL_LIBS) + set(_explicit_libdirs "") + set(LIBCURL_PC_REQUIRES_PRIVATE "") + set(LIBCURL_PC_LIBS_PRIVATE_LIST "") + foreach(_lib IN LISTS CURL_LIBS _custom_libs _implicit_libs) if(TARGET "${_lib}") - set(_libname "${_lib}") - get_target_property(_imported "${_libname}" IMPORTED) + set(_explicit_libs "") + get_target_property(_imported "${_lib}" IMPORTED) if(NOT _imported) # Reading the LOCATION property on non-imported target will error out. # Assume the user will not need this information in the .pc file. continue() endif() - get_target_property(_lib "${_libname}" LOCATION) - if(NOT _lib) - message(WARNING "Bad lib in library list: ${_libname}") - continue() - endif() - endif() - if(_lib MATCHES "^-") # '-framework ' - list(APPEND _ldflags "${_lib}") - elseif(_lib MATCHES "/") - # This gets a bit more complex, because we want to specify the - # directory separately, and only once per directory - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) - cmake_path(GET _lib PARENT_PATH _libdir) - cmake_path(GET _lib STEM _libname) + if(_lib MATCHES "CURL::") + # This is empty for 'CURL::*' targets and safe to ignore. + # Explicitly skip this query to avoid CMake v3.18 and older erroring out. + set(_libname "") else() - get_filename_component(_libdir "${_lib}" DIRECTORY) - get_filename_component(_libname "${_lib}" NAME_WE) + get_target_property(_libname "${_lib}" LOCATION) endif() - if(_libname MATCHES "^lib") - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) - cmake_path(SET _libdir NORMALIZE "${_libdir}") + if(_libname) + list(APPEND _explicit_libs "${_libname}") + else() + get_target_property(_libs "${_lib}" INTERFACE_LINK_LIBRARIES) + if(_libs) + list(APPEND _explicit_libs "${_libs}") endif() - list(FIND _sys_libdirs "${_libdir}" _libdir_index) - if(_libdir_index LESS 0) - list(APPEND _ldflags "-L${_libdir}") + get_target_property(_libdirs "${_lib}" INTERFACE_LINK_DIRECTORIES) + if(_libdirs) + list(APPEND _explicit_libdirs "${_libdirs}") endif() - string(REGEX REPLACE "^lib" "" _libname "${_libname}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") - else() - list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") endif() + if(NOT _libname AND NOT _libs AND NOT _libdirs) + message(WARNING "Bad lib in library list: ${_lib}") + endif() + get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) + if(_modules) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") + endif() + + foreach(_lib IN LISTS _explicit_libs) + if(_lib MATCHES "/") + # This gets a bit more complex, because we want to specify the + # directory separately, and only once per directory + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) + cmake_path(GET _lib PARENT_PATH _libdir) + cmake_path(GET _lib STEM _libname) + else() + get_filename_component(_libdir "${_lib}" DIRECTORY) + get_filename_component(_libname "${_lib}" NAME_WE) + endif() + if(_libname MATCHES "^lib") + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) + cmake_path(SET _libdir NORMALIZE "${_libdir}") + endif() + list(FIND _sys_libdirs "${_libdir}" _libdir_index) + if(_libdir_index LESS 0) + list(APPEND _ldflags "-L${_libdir}") + endif() + string(REGEX REPLACE "^lib" "" _libname "${_libname}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + else() + list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + else() + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + endforeach() + elseif(_lib MATCHES "^-") # '-framework ' + list(APPEND _ldflags "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") else() list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") endif() endforeach() + foreach(_libdir IN LISTS _custom_libdirs _explicit_libdirs) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) + cmake_path(SET _libdir NORMALIZE "${_libdir}") + endif() + list(FIND _sys_libdirs "${_libdir}" _libdir_index) + if(_libdir_index LESS 0) + list(APPEND _ldflags "-L${_libdir}") + endif() + endforeach() + + list(REMOVE_DUPLICATES _ldflags) + if(LIBCURL_PC_REQUIRES_PRIVATE) + list(REMOVE_DUPLICATES LIBCURL_PC_REQUIRES_PRIVATE) string(REPLACE ";" "," LIBCURL_PC_REQUIRES_PRIVATE "${LIBCURL_PC_REQUIRES_PRIVATE}") endif() if(LIBCURL_PC_LIBS_PRIVATE) @@ -2424,13 +2310,37 @@ if(NOT CURL_DISABLE_INSTALL) # Consumed custom variables: # CURLVERSION + # LIBCURL_PC_LIBS_PRIVATE_LIST # LIB_NAME # LIB_SELECTED + # LIB_STATIC # TARGETS_EXPORT_NAME - # USE_OPENSSL OPENSSL_VERSION_MAJOR - # HAVE_LIBZ ZLIB_VERSION_MAJOR # CURL_SUPPORTED_FEATURES_LIST # CURL_SUPPORTED_PROTOCOLS_LIST + # HAVE_BROTLI + # HAVE_GSSAPI + # HAVE_LIBIDN2 + # HAVE_LIBZ ZLIB_VERSION_MAJOR + # HAVE_ZSTD + # USE_ARES + # USE_BACKTRACE + # USE_GNUTLS + # USE_GSASL + # USE_LIBPSL + # USE_LIBRTMP + # USE_LIBSSH + # USE_LIBSSH2 + # USE_LIBUV + # USE_MBEDTLS + # USE_NGHTTP2 + # USE_NGHTTP3 + # USE_NGTCP2 + # USE_OPENSSL OPENSSL_VERSION_MAJOR + # USE_QUICHE + # USE_RUSTLS + # USE_WIN32_LDAP CURL_DISABLE_LDAP + # USE_WOLFSSL + # _win32_winsock configure_package_config_file("CMake/curl-config.cmake.in" "${_project_config}" INSTALL_DESTINATION ${_install_cmake_dir} @@ -2442,7 +2352,32 @@ if(NOT CURL_DISABLE_INSTALL) DESTINATION ${_install_cmake_dir}) endif() - install(FILES ${_version_config} ${_project_config} + install( + FILES + ${_version_config} + ${_project_config} + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindBrotli.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindCares.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindGSS.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindGnuTLS.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLDAP.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibbacktrace.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibgsasl.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibidn2.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibpsl.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibrtmp.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibssh.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibssh2.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibuv.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindMbedTLS.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindNGHTTP2.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindNGHTTP3.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindNGTCP2.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindNettle.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindQuiche.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindRustls.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindWolfSSL.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindZstd.cmake" DESTINATION ${_install_cmake_dir}) if(NOT TARGET curl_uninstall) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b468eec0a2e4..5ce288a0a897 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -44,7 +44,7 @@ if(CURL_BUILD_TESTING) # special libcurlu library just for unittests add_library(curlu STATIC EXCLUDE_FROM_ALL ${HHEADERS} ${CSOURCES}) target_compile_definitions(curlu PUBLIC "CURL_STATICLIB" "UNITTESTS") - target_link_libraries(curlu PRIVATE ${CURL_LIBS}) + target_link_libraries(curlu PUBLIC ${CURL_LIBS}) # There is plenty of parallelism when building the testdeps target. # Override the curlu batch size with the maximum to optimize performance. set_target_properties(curlu PROPERTIES UNITY_BUILD_BATCH_SIZE 0 C_CLANG_TIDY "") @@ -151,8 +151,7 @@ if(BUILD_STATIC_LIBS) set_target_properties(${LIB_STATIC} PROPERTIES PREFIX "" OUTPUT_NAME "${LIBCURL_OUTPUT_NAME}" SUFFIX "${STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" - INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB" - INTERFACE_LINK_DIRECTORIES "${CURL_LIBDIRS}") + INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB") if(CURL_HIDES_PRIVATE_SYMBOLS) set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_OPTIONS "${CURL_CFLAG_SYMBOLS_HIDE}") set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS") @@ -174,6 +173,27 @@ if(BUILD_STATIC_LIBS) target_include_directories(${LIB_STATIC} INTERFACE "$" "$") + + # CMake before CMP0099 (CMake 3.17 2020-03-20) did not propagate libdirs to + # targets. It expected libs to have an absolute filename. As a workaround, + # manually apply dependency libdirs, for CMake consumers without this policy. + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) + cmake_policy(GET CMP0099 _has_CMP0099) # https://cmake.org/cmake/help/latest/policy/CMP0099.html + endif() + if(NOT _has_CMP0099 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.13 AND CURL_LIBS) + set(_libdirs "") + foreach(_lib IN LISTS CURL_LIBS) + if(TARGET "${_lib}") + get_target_property(_libdir "${_lib}" INTERFACE_LINK_DIRECTORIES) + if(_libdir) + list(APPEND _libdirs "${_libdir}") + endif() + endif() + endforeach() + if(_libdirs) + target_link_directories(${LIB_STATIC} INTERFACE ${_libdirs}) + endif() + endif() endif() if(BUILD_SHARED_LIBS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33f288b91591..7d28434bd38e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -109,12 +109,13 @@ target_link_libraries(${EXE_NAME} ${LIB_SELECTED_FOR_EXE} ${CURL_LIBS}) add_executable(${PROJECT_NAME}::${EXE_NAME} ALIAS ${EXE_NAME}) add_executable(curlinfo EXCLUDE_FROM_ALL "curlinfo.c") +target_link_libraries(curlinfo PRIVATE ${CURL_LIBS}) set_target_properties(curlinfo PROPERTIES UNITY_BUILD OFF) # special libcurltool library just for unittests add_library(curltool STATIC EXCLUDE_FROM_ALL ${CURL_CFILES} ${CURL_HFILES} ${_curlx_cfiles_lib} ${_curlx_hfiles_lib}) target_compile_definitions(curltool PUBLIC "CURL_STATICLIB" "UNITTESTS") -target_link_libraries(curltool PRIVATE ${CURL_LIBS}) +target_link_libraries(curltool PUBLIC ${CURL_LIBS}) set_target_properties(curltool PROPERTIES C_CLANG_TIDY "") if(CURL_HAS_LTO) diff --git a/tests/cmake/test.sh b/tests/cmake/test.sh index 451235484ef6..a871372ab644 100755 --- a/tests/cmake/test.sh +++ b/tests/cmake/test.sh @@ -114,7 +114,7 @@ if [ "${mode}" = 'all' ] || [ "${mode}" = 'find_package' ]; then "${cmake_provider}" --install "${bldp}" else mkdir "${bldp}"; cd "${bldp}" - "${cmake_provider}" "${src}" -G "${gen}" ${cmake_opts} -DCURL_USE_PKGCONFIG=OFF ${TEST_CMAKE_FLAGS:-} "$@" \ + "${cmake_provider}" "${src}" -G "${gen}" ${cmake_opts} ${TEST_CMAKE_FLAGS:-} "$@" \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=ON \ -DCMAKE_INSTALL_PREFIX="${prefix}" From ed331cea80c607344a19b400ab9abf25af09dc36 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 14:17:04 +0100 Subject: [PATCH 587/885] cmake: save and restore `CMAKE_MODULE_PATH` in `curl-config.cmake` Reported-by: Kai Pastor Bug: https://github.com/curl/curl/pull/16973#discussion_r2572957270 Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973 Closes #19758 --- CMake/curl-config.cmake.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index 99949198a305..c4e9f59e863b 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -26,6 +26,8 @@ option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@" "@CURL_USE_PKGCONFIG@") include(CMakeFindDependencyMacro) + +set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) set(_libs "") @@ -126,6 +128,8 @@ if("@HAVE_ZSTD@") list(APPEND _libs CURL::zstd) endif() +set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND WIN32 AND NOT TARGET CURL::win32_winsock) add_library(CURL::win32_winsock INTERFACE IMPORTED) set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "@_win32_winsock@") From 545f2f387d41b4a356705a08c1154c807f4dbb7d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 16:07:59 +0100 Subject: [PATCH 588/885] lib/sendf.h: forward declare two structs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To fix non-unity builds using certain header orders (seen in ntlm.c with the include order changed): ``` lib/vauth/../sendf.h:117:27: error: ‘struct Curl_cwriter’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 117 | struct Curl_cwriter *writer); | ^~~~~~~~~~~~ lib/vauth/../sendf.h:215:54: error: ‘struct Curl_creader’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 215 | CURLcode (*do_init)(struct Curl_easy *data, struct Curl_creader *reader); | ^~~~~~~~~~~~ [...] ``` Ref: https://github.com/curl/curl/actions/runs/19785420705/job/56691185397?pr=19760 Ref: #19760 Closes #19761 --- lib/sendf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sendf.h b/lib/sendf.h index 686744390102..3a6dccba6a3d 100644 --- a/lib/sendf.h +++ b/lib/sendf.h @@ -52,6 +52,10 @@ #define CLIENTWRITE_EOS (1<<7) /* End Of transfer download Stream */ #define CLIENTWRITE_0LEN (1<<8) /* write even 0-length buffers */ +/* Forward declarations */ +struct Curl_creader; +struct Curl_cwriter; + /** * Write `len` bytes at `prt` to the client. `type` indicates what * kind of data is being written. From db32c0721f9cfbefe6a42b828ef7bfc4b40f71ac Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 28 Nov 2025 23:59:23 +0100 Subject: [PATCH 589/885] rustls: verify that verifier_builder is not NULL Since this function returns allocated resources there is probably at least a theoretical risk this can return NULL. Pointed out by ZeroPath Closes #19756 --- lib/vtls/rustls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index e4251a915198..0c13cc81eebb 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -750,6 +750,10 @@ init_config_builder_verifier(struct Curl_easy *data, } verifier_builder = rustls_web_pki_server_cert_verifier_builder_new(roots); + if(!verifier_builder) { + result = CURLE_OUT_OF_MEMORY; + goto cleanup; + } if(conn_config->CRLfile) { result = init_config_builder_verifier_crl(data, From 985f86f0be42a69bae91e9209016e5f7fe3346da Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sat, 29 Nov 2025 09:30:48 -0500 Subject: [PATCH 590/885] rustls: simplify init err path Closes #19759 --- lib/vtls/rustls.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 0c13cc81eebb..360a2454ac85 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -744,9 +744,7 @@ init_config_builder_verifier(struct Curl_easy *data, if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to build trusted root certificate store"); result = CURLE_SSL_CACERT_BADFILE; - if(result) { - goto cleanup; - } + goto cleanup; } verifier_builder = rustls_web_pki_server_cert_verifier_builder_new(roots); From c3add7130d7d81add205edbbb75fdfd1f38b3c68 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 19:51:45 +0100 Subject: [PATCH 591/885] mbedtls: replace macro constant with `CURL_ARRAYSIZE()` Also move from `int` to `size_t` for index variables. Closes #19762 --- lib/vtls/mbedtls_threadlock.c | 23 ++++++++++------------- lib/vtls/mbedtls_threadlock.h | 4 ++-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/vtls/mbedtls_threadlock.c b/lib/vtls/mbedtls_threadlock.c index 91de9eceb59b..89cc2b7d38df 100644 --- a/lib/vtls/mbedtls_threadlock.c +++ b/lib/vtls/mbedtls_threadlock.c @@ -37,17 +37,14 @@ #include "mbedtls_threadlock.h" -/* number of thread locks */ -#define NUMT 2 - -/* This array stores the mutexes available to Mbedtls */ -static MBEDTLS_MUTEX_T mutex_buf[NUMT]; +/* This array stores the mutexes available to mbedTLS */ +static MBEDTLS_MUTEX_T mutex_buf[2]; int Curl_mbedtlsthreadlock_thread_setup(void) { - int i; + size_t i; - for(i = 0; i < NUMT; i++) { + for(i = 0; i < CURL_ARRAYSIZE(mutex_buf); i++) { #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_init(&mutex_buf[i], NULL)) return 0; /* pthread_mutex_init failed */ @@ -63,9 +60,9 @@ int Curl_mbedtlsthreadlock_thread_setup(void) int Curl_mbedtlsthreadlock_thread_cleanup(void) { - int i; + size_t i; - for(i = 0; i < NUMT; i++) { + for(i = 0; i < CURL_ARRAYSIZE(mutex_buf); i++) { #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_destroy(&mutex_buf[i])) return 0; /* pthread_mutex_destroy failed */ @@ -78,9 +75,9 @@ int Curl_mbedtlsthreadlock_thread_cleanup(void) return 1; /* OK */ } -int Curl_mbedtlsthreadlock_lock_function(int n) +int Curl_mbedtlsthreadlock_lock_function(size_t n) { - if(n < NUMT) { + if(n < CURL_ARRAYSIZE(mutex_buf)) { #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_lock(&mutex_buf[n])) { DEBUGF(curl_mfprintf(stderr, "Error: " @@ -98,9 +95,9 @@ int Curl_mbedtlsthreadlock_lock_function(int n) return 1; /* OK */ } -int Curl_mbedtlsthreadlock_unlock_function(int n) +int Curl_mbedtlsthreadlock_unlock_function(size_t n) { - if(n < NUMT) { + if(n < CURL_ARRAYSIZE(mutex_buf)) { #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_unlock(&mutex_buf[n])) { DEBUGF(curl_mfprintf(stderr, "Error: " diff --git a/lib/vtls/mbedtls_threadlock.h b/lib/vtls/mbedtls_threadlock.h index 9402af6e415a..1855d4cc0187 100644 --- a/lib/vtls/mbedtls_threadlock.h +++ b/lib/vtls/mbedtls_threadlock.h @@ -33,8 +33,8 @@ int Curl_mbedtlsthreadlock_thread_setup(void); int Curl_mbedtlsthreadlock_thread_cleanup(void); -int Curl_mbedtlsthreadlock_lock_function(int n); -int Curl_mbedtlsthreadlock_unlock_function(int n); +int Curl_mbedtlsthreadlock_lock_function(size_t n); +int Curl_mbedtlsthreadlock_unlock_function(size_t n); #else From 0eed8b73309fbfb113002f4da8a6d92acff4871f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 29 Nov 2025 23:44:23 +0100 Subject: [PATCH 592/885] tool_operatate: return error for OOM in append2query Closes #19763 --- src/tool_operate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tool_operate.c b/src/tool_operate.c index 968dc864f9f6..71d29af8d8b0 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -848,6 +848,8 @@ static CURLcode append2query(struct OperationConfig *config, } curl_url_cleanup(uh); } + else + result = CURLE_OUT_OF_MEMORY; return result; } From 2253bc330f56315faaa287c29d7612f5a34d8058 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 02:16:52 +0100 Subject: [PATCH 593/885] lib/subdirs: fix formatting nits Closes #19757 --- lib/curlx/base64.c | 20 +- lib/curlx/dynbuf.c | 1 - lib/curlx/dynbuf.h | 22 +-- lib/curlx/fopen.h | 11 +- lib/curlx/inet_ntop.c | 11 +- lib/curlx/inet_ntop.h | 4 +- lib/curlx/inet_pton.c | 23 +-- lib/curlx/inet_pton.h | 6 +- lib/curlx/nonblock.c | 2 +- lib/curlx/strerr.c | 3 +- lib/curlx/strparse.c | 8 +- lib/curlx/timediff.c | 2 +- lib/curlx/timeval.c | 34 ++-- lib/curlx/wait.c | 2 +- lib/curlx/warnless.c | 121 ++++++------ lib/curlx/warnless.h | 2 +- lib/curlx/winapi.c | 5 +- lib/vauth/cleartext.c | 7 +- lib/vauth/cram.c | 2 +- lib/vauth/digest.c | 76 ++++---- lib/vauth/digest_sspi.c | 16 +- lib/vauth/gsasl.c | 2 +- lib/vauth/krb5_gssapi.c | 2 +- lib/vauth/krb5_sspi.c | 3 +- lib/vauth/ntlm.c | 5 +- lib/vauth/ntlm_sspi.c | 13 +- lib/vauth/oauth2.c | 2 +- lib/vauth/spnego_sspi.c | 14 +- lib/vauth/vauth.c | 16 +- lib/vquic/curl_ngtcp2.c | 128 +++++++------ lib/vquic/curl_osslq.c | 99 +++++----- lib/vquic/curl_quiche.c | 31 ++- lib/vquic/vquic-tls.c | 7 +- lib/vquic/vquic-tls.h | 16 +- lib/vquic/vquic.c | 9 +- lib/vquic/vquic_int.h | 25 ++- lib/vssh/libssh.c | 333 ++++++++++++++++---------------- lib/vssh/libssh2.c | 347 ++++++++++++++++------------------ lib/vssh/ssh.h | 6 +- lib/vssh/vssh.c | 3 +- lib/vtls/apple.c | 5 +- lib/vtls/cipher_suite.c | 42 ++-- lib/vtls/gtls.c | 84 ++++---- lib/vtls/gtls.h | 3 +- lib/vtls/hostcheck.c | 4 +- lib/vtls/keylog.c | 19 +- lib/vtls/mbedtls.c | 73 ++++--- lib/vtls/mbedtls_threadlock.c | 5 +- lib/vtls/mbedtls_threadlock.h | 3 +- lib/vtls/openssl.c | 148 ++++++--------- lib/vtls/openssl.h | 3 +- lib/vtls/rustls.c | 176 ++++++++--------- lib/vtls/schannel.c | 160 +++++++--------- lib/vtls/schannel.h | 9 +- lib/vtls/schannel_verify.c | 51 ++--- lib/vtls/vtls.c | 53 +++--- lib/vtls/vtls.h | 12 +- lib/vtls/vtls_int.h | 20 +- lib/vtls/vtls_scache.c | 54 +++--- lib/vtls/vtls_scache.h | 26 ++- lib/vtls/vtls_spack.c | 31 ++- lib/vtls/wolfssl.c | 113 +++++------ lib/vtls/wolfssl.h | 9 +- lib/vtls/x509asn1.c | 54 +++--- 64 files changed, 1199 insertions(+), 1397 deletions(-) diff --git a/lib/curlx/base64.c b/lib/curlx/base64.c index 6a24c20ebdfb..4fc525387e5f 100644 --- a/lib/curlx/base64.c +++ b/lib/curlx/base64.c @@ -31,12 +31,12 @@ #include "base64.h" /* ---- Base64 Encoding/Decoding Table --- */ -const char Curl_base64encdec[]= +const char Curl_base64encdec[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /* The Base 64 encoding with a URL and filename safe alphabet, RFC 4648 section 5 */ -static const char base64url[]= +static const char base64url[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; static const unsigned char decodetable[] = @@ -188,18 +188,18 @@ static CURLcode base64_encode(const char *table64, return CURLE_OUT_OF_MEMORY; while(insize >= 3) { - *output++ = table64[ in[0] >> 2 ]; - *output++ = table64[ ((in[0] & 0x03) << 4) | (in[1] >> 4) ]; - *output++ = table64[ ((in[1] & 0x0F) << 2) | ((in[2] & 0xC0) >> 6) ]; - *output++ = table64[ in[2] & 0x3F ]; + *output++ = table64[in[0] >> 2]; + *output++ = table64[((in[0] & 0x03) << 4) | (in[1] >> 4)]; + *output++ = table64[((in[1] & 0x0F) << 2) | ((in[2] & 0xC0) >> 6)]; + *output++ = table64[in[2] & 0x3F]; insize -= 3; in += 3; } if(insize) { /* this is only one or two bytes now */ - *output++ = table64[ in[0] >> 2 ]; + *output++ = table64[in[0] >> 2]; if(insize == 1) { - *output++ = table64[ ((in[0] & 0x03) << 4) ]; + *output++ = table64[((in[0] & 0x03) << 4)]; if(padbyte) { *output++ = padbyte; *output++ = padbyte; @@ -207,8 +207,8 @@ static CURLcode base64_encode(const char *table64, } else { /* insize == 2 */ - *output++ = table64[ ((in[0] & 0x03) << 4) | ((in[1] & 0xF0) >> 4) ]; - *output++ = table64[ ((in[1] & 0x0F) << 2) ]; + *output++ = table64[((in[0] & 0x03) << 4) | ((in[1] & 0xF0) >> 4)]; + *output++ = table64[((in[1] & 0x0F) << 2)]; if(padbyte) *output++ = padbyte; } diff --git a/lib/curlx/dynbuf.c b/lib/curlx/dynbuf.c index e54865f933c7..a9ff48367f62 100644 --- a/lib/curlx/dynbuf.c +++ b/lib/curlx/dynbuf.c @@ -156,7 +156,6 @@ CURLcode curlx_dyn_tail(struct dynbuf *s, size_t trail) s->bufr[s->leng] = 0; } return CURLE_OK; - } /* diff --git a/lib/curlx/dynbuf.h b/lib/curlx/dynbuf.h index 00ca04789360..683b484610bb 100644 --- a/lib/curlx/dynbuf.h +++ b/lib/curlx/dynbuf.h @@ -32,7 +32,7 @@ struct dynbuf { size_t allc; /* size of the current allocation */ size_t toobig; /* size limit for the buffer */ #ifdef DEBUGBUILD - int init; /* detect API usage mistakes */ + int init; /* detect API usage mistakes */ #endif }; @@ -62,24 +62,24 @@ int curlx_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save); char *curlx_dyn_take(struct dynbuf *s, size_t *plen); /* Dynamic buffer max sizes */ -#define MAX_DYNBUF_SIZE (SIZE_MAX/2) +#define MAX_DYNBUF_SIZE (SIZE_MAX / 2) #define DYN_DOH_RESPONSE 3000 #define DYN_DOH_CNAME 256 #define DYN_PAUSE_BUFFER (64 * 1024 * 1024) #define DYN_HAXPROXY 2048 -#define DYN_HTTP_REQUEST (1024*1024) +#define DYN_HTTP_REQUEST (1024 * 1024) #define DYN_APRINTF 8000000 -#define DYN_RTSP_REQ_HEADER (64*1024) -#define DYN_TRAILERS (64*1024) +#define DYN_RTSP_REQ_HEADER (64 * 1024) +#define DYN_TRAILERS (64 * 1024) #define DYN_PROXY_CONNECT_HEADERS 16384 #define DYN_QLOG_NAME 1024 #define DYN_H1_TRAILER 4096 -#define DYN_PINGPPONG_CMD (64*1024) -#define DYN_IMAP_CMD (64*1024) -#define DYN_MQTT_RECV (64*1024) +#define DYN_PINGPPONG_CMD (64 * 1024) +#define DYN_IMAP_CMD (64 * 1024) +#define DYN_MQTT_RECV (64 * 1024) #define DYN_MQTT_SEND 0xFFFFFFF -#define DYN_CRLFILE_SIZE (400*1024*1024) /* 400mb */ -#define DYN_CERTFILE_SIZE (100*1024) /* 100KiB */ -#define DYN_KEYFILE_SIZE (100*1024) /* 100KiB */ +#define DYN_CRLFILE_SIZE (400 * 1024 * 1024) /* 400MiB */ +#define DYN_CERTFILE_SIZE (100 * 1024) /* 100KiB */ +#define DYN_KEYFILE_SIZE (100 * 1024) /* 100KiB */ #endif diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index eeb3fda9469c..fb3277a17e7d 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -51,11 +51,12 @@ int curlx_win32_open(const char *filename, int oflag, ...); #endif #ifdef CURLDEBUG -#define curlx_fopen(file,mode) curl_dbg_fopen(file,mode,__LINE__,__FILE__) -#define curlx_freopen(file,mode,fh) \ - curl_dbg_freopen(file,mode,fh,__LINE__,__FILE__) -#define curlx_fdopen(file,mode) curl_dbg_fdopen(file,mode,__LINE__,__FILE__) -#define curlx_fclose(file) curl_dbg_fclose(file,__LINE__,__FILE__) +#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__) +#define curlx_freopen(file, mode, fh) \ + curl_dbg_freopen(file, mode, fh, __LINE__, __FILE__) +#define curlx_fdopen(file, mode) \ + curl_dbg_fdopen(file, mode, __LINE__, __FILE__) +#define curlx_fclose(file) curl_dbg_fclose(file, __LINE__, __FILE__) #else #define curlx_fopen CURLX_FOPEN_LOW #define curlx_freopen CURLX_FREOPEN_LOW diff --git a/lib/curlx/inet_ntop.c b/lib/curlx/inet_ntop.c index 771af81474e7..96c58273e2a1 100644 --- a/lib/curlx/inet_ntop.c +++ b/lib/curlx/inet_ntop.c @@ -109,17 +109,18 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size) */ memset(words, '\0', sizeof(words)); for(i = 0; i < IN6ADDRSZ; i++) - words[i/2] |= ((unsigned int)src[i] << ((1 - (i % 2)) << 3)); + words[i / 2] |= ((unsigned int)src[i] << ((1 - (i % 2)) << 3)); best.base = -1; - cur.base = -1; + cur.base = -1; best.len = 0; cur.len = 0; for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { if(words[i] == 0) { if(cur.base == -1) { - cur.base = i; cur.len = 1; + cur.base = i; + cur.len = 1; } else cur.len++; @@ -152,7 +153,7 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size) /* Is this address an encapsulated IPv4? */ if(i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { + (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { if(!inet_ntop4(src + 12, tp, sizeof(tmp) - (tp - tmp))) { return NULL; } @@ -219,4 +220,4 @@ char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size) return NULL; } } -#endif /* HAVE_INET_NTOP */ +#endif /* HAVE_INET_NTOP */ diff --git a/lib/curlx/inet_ntop.h b/lib/curlx/inet_ntop.h index 490f49e8a195..79cdc9e2afea 100644 --- a/lib/curlx/inet_ntop.h +++ b/lib/curlx/inet_ntop.h @@ -37,11 +37,11 @@ #include #endif #ifdef __AMIGA__ -#define curlx_inet_ntop(af,addr,buf,size) \ +#define curlx_inet_ntop(af, addr, buf, size) \ (char *)inet_ntop(af, CURL_UNCONST(addr), (unsigned char *)buf, \ (curl_socklen_t)(size)) #else -#define curlx_inet_ntop(af,addr,buf,size) \ +#define curlx_inet_ntop(af, addr, buf, size) \ inet_ntop(af, addr, buf, (curl_socklen_t)(size)) #endif #else diff --git a/lib/curlx/inet_pton.c b/lib/curlx/inet_pton.c index b78fa5d746fb..7b4a4043061d 100644 --- a/lib/curlx/inet_pton.c +++ b/lib/curlx/inet_pton.c @@ -54,8 +54,8 @@ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ -static int inet_pton4(const char *src, unsigned char *dst); -static int inet_pton6(const char *src, unsigned char *dst); +static int inet_pton4(const char *src, unsigned char *dst); +static int inet_pton6(const char *src, unsigned char *dst); /* int * inet_pton(af, src, dst) @@ -73,8 +73,7 @@ static int inet_pton6(const char *src, unsigned char *dst); * author: * Paul Vixie, 1996. */ -int -curlx_inet_pton(int af, const char *src, void *dst) +int curlx_inet_pton(int af, const char *src, void *dst) { switch(af) { case AF_INET: @@ -98,8 +97,7 @@ curlx_inet_pton(int af, const char *src, void *dst) * author: * Paul Vixie, 1996. */ -static int -inet_pton4(const char *src, unsigned char *dst) +static int inet_pton4(const char *src, unsigned char *dst) { int saw_digit, octets, ch; unsigned char tmp[INADDRSZ], *tp; @@ -151,8 +149,7 @@ inet_pton4(const char *src, unsigned char *dst) * author: * Paul Vixie, 1996. */ -static int -inet_pton6(const char *src, unsigned char *dst) +static int inet_pton6(const char *src, unsigned char *dst) { unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp; const char *curtok; @@ -187,14 +184,14 @@ inet_pton6(const char *src, unsigned char *dst) } if(tp + INT16SZ > endp) return 0; - *tp++ = (unsigned char) ((val >> 8) & 0xff); - *tp++ = (unsigned char) (val & 0xff); + *tp++ = (unsigned char)((val >> 8) & 0xff); + *tp++ = (unsigned char)(val & 0xff); saw_xdigit = 0; val = 0; continue; } if(ch == '.' && ((tp + INADDRSZ) <= endp) && - inet_pton4(curtok, tp) > 0) { + inet_pton4(curtok, tp) > 0) { tp += INADDRSZ; saw_xdigit = 0; break; /* '\0' was seen by inet_pton4(). */ @@ -204,8 +201,8 @@ inet_pton6(const char *src, unsigned char *dst) if(saw_xdigit) { if(tp + INT16SZ > endp) return 0; - *tp++ = (unsigned char) ((val >> 8) & 0xff); - *tp++ = (unsigned char) (val & 0xff); + *tp++ = (unsigned char)((val >> 8) & 0xff); + *tp++ = (unsigned char)(val & 0xff); } if(colonp) { /* diff --git a/lib/curlx/inet_pton.h b/lib/curlx/inet_pton.h index a9ad24c9447f..a52ef145dac5 100644 --- a/lib/curlx/inet_pton.h +++ b/lib/curlx/inet_pton.h @@ -37,9 +37,11 @@ #include #endif #ifdef __AMIGA__ -#define curlx_inet_pton(x,y,z) inet_pton(x,(unsigned char *)CURL_UNCONST(y),z) +#define curlx_inet_pton(x, y, z) \ + inet_pton(x, (unsigned char *)CURL_UNCONST(y), z) #else -#define curlx_inet_pton(x,y,z) inet_pton(x,y,z) +#define curlx_inet_pton(x, y, z) \ + inet_pton(x, y, z) #endif #else int curlx_inet_pton(int, const char *, void *); diff --git a/lib/curlx/nonblock.c b/lib/curlx/nonblock.c index b944f9546bb5..23eb8c0e3ab2 100644 --- a/lib/curlx/nonblock.c +++ b/lib/curlx/nonblock.c @@ -88,6 +88,6 @@ int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); #else -# error "no non-blocking method was found/used/set" +#error "no non-blocking method was found/used/set" #endif } diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index 3dbeab82ee57..70ad1fb813e4 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -43,8 +43,7 @@ * codes (WSAGetLastError) to error messages. * Returns NULL if no error message was found for error code. */ -static const char * -get_winsock_error(int err, char *buf, size_t len) +static const char *get_winsock_error(int err, char *buf, size_t len) { #ifndef CURL_DISABLE_VERBOSE_STRINGS const char *p; diff --git a/lib/curlx/strparse.c b/lib/curlx/strparse.c index a29d8be2fdb7..c5a3ed2102e6 100644 --- a/lib/curlx/strparse.c +++ b/lib/curlx/strparse.c @@ -66,8 +66,7 @@ int curlx_str_until(const char **linep, struct Curl_str *out, /* Get a word until the first space or end of string. At least one byte long. return non-zero on error */ -int curlx_str_word(const char **linep, struct Curl_str *out, - const size_t max) +int curlx_str_word(const char **linep, struct Curl_str *out, const size_t max) { return curlx_str_until(linep, out, max, ' '); } @@ -95,7 +94,6 @@ int curlx_str_untilnl(const char **linep, struct Curl_str *out, return STRE_OK; } - /* Get a "quoted" word. No escaping possible. return non-zero on error */ int curlx_str_quotedword(const char **linep, struct Curl_str *out, @@ -141,8 +139,8 @@ int curlx_str_singlespace(const char **linep) } /* given an ASCII character and max ascii, return TRUE if valid */ -#define valid_digit(x,m) \ - (((x) >= '0') && ((x) <= m) && Curl_hexasciitable[(x)-'0']) +#define valid_digit(x, m) \ + (((x) >= '0') && ((x) <= m) && Curl_hexasciitable[(x) - '0']) /* We use 16 for the zero index (and the necessary bitwise AND in the loop) to be able to have a non-zero value there to make valid_digit() able to diff --git a/lib/curlx/timediff.c b/lib/curlx/timediff.c index a90da961ab83..d8baabe63e60 100644 --- a/lib/curlx/timediff.c +++ b/lib/curlx/timediff.c @@ -84,5 +84,5 @@ struct timeval *curlx_mstotv(struct timeval *tv, timediff_t ms) */ timediff_t curlx_tvtoms(struct timeval *tv) { - return (tv->tv_sec*1000) + (timediff_t)(tv->tv_usec/1000); + return (tv->tv_sec * 1000) + (timediff_t)(tv->tv_usec / 1000); } diff --git a/lib/curlx/timeval.c b/lib/curlx/timeval.c index a27525855b0a..ff49d7d27464 100644 --- a/lib/curlx/timeval.c +++ b/lib/curlx/timeval.c @@ -79,7 +79,7 @@ struct curltime curlx_now(void) return now; } -#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) || \ +#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) || \ defined(HAVE_CLOCK_GETTIME_MONOTONIC_RAW) struct curltime curlx_now(void) @@ -103,7 +103,7 @@ struct curltime curlx_now(void) ** called on unsupported OS version. */ #if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \ - (HAVE_BUILTIN_AVAILABLE == 1) + (HAVE_BUILTIN_AVAILABLE == 1) bool have_clock_gettime = FALSE; if(__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) have_clock_gettime = TRUE; @@ -111,8 +111,8 @@ struct curltime curlx_now(void) #ifdef HAVE_CLOCK_GETTIME_MONOTONIC_RAW if( -#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \ - (HAVE_BUILTIN_AVAILABLE == 1) +#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \ + (HAVE_BUILTIN_AVAILABLE == 1) have_clock_gettime && #endif (clock_gettime(CLOCK_MONOTONIC_RAW, &tsnow) == 0)) { @@ -124,7 +124,7 @@ struct curltime curlx_now(void) if( #if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \ - (HAVE_BUILTIN_AVAILABLE == 1) + (HAVE_BUILTIN_AVAILABLE == 1) have_clock_gettime && #endif (clock_gettime(CLOCK_MONOTONIC, &tsnow) == 0)) { @@ -222,12 +222,12 @@ struct curltime curlx_now(void) */ timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older) { - timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; - if(diff >= (TIMEDIFF_T_MAX/1000)) + timediff_t diff = (timediff_t)newer.tv_sec - older.tv_sec; + if(diff >= (TIMEDIFF_T_MAX / 1000)) return TIMEDIFF_T_MAX; - else if(diff <= (TIMEDIFF_T_MIN/1000)) + else if(diff <= (TIMEDIFF_T_MIN / 1000)) return TIMEDIFF_T_MIN; - return diff * 1000 + (newer.tv_usec-older.tv_usec)/1000; + return diff * 1000 + (newer.tv_usec - older.tv_usec) / 1000; } /* @@ -237,12 +237,12 @@ timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older) timediff_t curlx_timediff_ceil_ms(struct curltime newer, struct curltime older) { - timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; - if(diff >= (TIMEDIFF_T_MAX/1000)) + timediff_t diff = (timediff_t)newer.tv_sec - older.tv_sec; + if(diff >= (TIMEDIFF_T_MAX / 1000)) return TIMEDIFF_T_MAX; - else if(diff <= (TIMEDIFF_T_MIN/1000)) + else if(diff <= (TIMEDIFF_T_MIN / 1000)) return TIMEDIFF_T_MIN; - return diff * 1000 + (newer.tv_usec - older.tv_usec + 999)/1000; + return diff * 1000 + (newer.tv_usec - older.tv_usec + 999) / 1000; } /* @@ -251,10 +251,10 @@ timediff_t curlx_timediff_ceil_ms(struct curltime newer, */ timediff_t curlx_timediff_us(struct curltime newer, struct curltime older) { - timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; - if(diff >= (TIMEDIFF_T_MAX/1000000)) + timediff_t diff = (timediff_t)newer.tv_sec - older.tv_sec; + if(diff >= (TIMEDIFF_T_MAX / 1000000)) return TIMEDIFF_T_MAX; - else if(diff <= (TIMEDIFF_T_MIN/1000000)) + else if(diff <= (TIMEDIFF_T_MIN / 1000000)) return TIMEDIFF_T_MIN; - return diff * 1000000 + newer.tv_usec-older.tv_usec; + return diff * 1000000 + newer.tv_usec - older.tv_usec; } diff --git a/lib/curlx/wait.c b/lib/curlx/wait.c index 4e10a8297a93..f1dd6e7a7e27 100644 --- a/lib/curlx/wait.c +++ b/lib/curlx/wait.c @@ -74,7 +74,7 @@ int curlx_wait_ms(timediff_t timeout_ms) /* prevent overflow, timeout_ms is typecast to ULONG/DWORD. */ #if TIMEDIFF_T_MAX >= ULONG_MAX if(timeout_ms >= ULONG_MAX) - timeout_ms = ULONG_MAX-1; + timeout_ms = ULONG_MAX - 1; /* do not use ULONG_MAX, because that is equal to INFINITE */ #endif Sleep((DWORD)timeout_ms); diff --git a/lib/curlx/warnless.c b/lib/curlx/warnless.c index fafa83c98c97..45442bd46270 100644 --- a/lib/curlx/warnless.c +++ b/lib/curlx/warnless.c @@ -27,10 +27,10 @@ #if defined(__INTEL_COMPILER) && defined(__unix__) #ifdef HAVE_NETINET_IN_H -# include +#include #endif #ifdef HAVE_ARPA_INET_H -# include +#include #endif #endif /* __INTEL_COMPILER && __unix__ */ @@ -56,15 +56,15 @@ unsigned char curlx_ultouc(unsigned long ulnum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif - DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_UCHAR); - return (unsigned char)(ulnum & (unsigned long) CURL_MASK_UCHAR); + DEBUGASSERT(ulnum <= (unsigned long)CURL_MASK_UCHAR); + return (unsigned char)(ulnum & (unsigned long)CURL_MASK_UCHAR); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -75,15 +75,15 @@ unsigned char curlx_ultouc(unsigned long ulnum) int curlx_uztosi(size_t uznum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif - DEBUGASSERT(uznum <= (size_t) CURL_MASK_SINT); - return (int)(uznum & (size_t) CURL_MASK_SINT); + DEBUGASSERT(uznum <= (size_t)CURL_MASK_SINT); + return (int)(uznum & (size_t)CURL_MASK_SINT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -94,17 +94,17 @@ int curlx_uztosi(size_t uznum) unsigned long curlx_uztoul(size_t uznum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif #if ULONG_MAX < SIZE_MAX - DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG); + DEBUGASSERT(uznum <= (size_t)CURL_MASK_ULONG); #endif - return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG); + return (unsigned long)(uznum & (size_t)CURL_MASK_ULONG); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -115,17 +115,17 @@ unsigned long curlx_uztoul(size_t uznum) unsigned int curlx_uztoui(size_t uznum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif #if UINT_MAX < SIZE_MAX - DEBUGASSERT(uznum <= (size_t) CURL_MASK_UINT); + DEBUGASSERT(uznum <= (size_t)CURL_MASK_UINT); #endif - return (unsigned int)(uznum & (size_t) CURL_MASK_UINT); + return (unsigned int)(uznum & (size_t)CURL_MASK_UINT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -136,18 +136,18 @@ unsigned int curlx_uztoui(size_t uznum) int curlx_sltosi(long slnum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); #if INT_MAX < LONG_MAX - DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_SINT); + DEBUGASSERT((unsigned long)slnum <= (unsigned long)CURL_MASK_SINT); #endif - return (int)(slnum & (long) CURL_MASK_SINT); + return (int)(slnum & (long)CURL_MASK_SINT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -158,18 +158,18 @@ int curlx_sltosi(long slnum) unsigned int curlx_sltoui(long slnum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); #if UINT_MAX < LONG_MAX - DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_UINT); + DEBUGASSERT((unsigned long)slnum <= (unsigned long)CURL_MASK_UINT); #endif - return (unsigned int)(slnum & (long) CURL_MASK_UINT); + return (unsigned int)(slnum & (long)CURL_MASK_UINT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -180,16 +180,16 @@ unsigned int curlx_sltoui(long slnum) unsigned short curlx_sltous(long slnum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); - DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_USHORT); - return (unsigned short)(slnum & (long) CURL_MASK_USHORT); + DEBUGASSERT((unsigned long)slnum <= (unsigned long)CURL_MASK_USHORT); + return (unsigned short)(slnum & (long)CURL_MASK_USHORT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -200,15 +200,15 @@ unsigned short curlx_sltous(long slnum) ssize_t curlx_uztosz(size_t uznum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif - DEBUGASSERT(uznum <= (size_t) CURL_MASK_SSIZE_T); - return (ssize_t)(uznum & (size_t) CURL_MASK_SSIZE_T); + DEBUGASSERT(uznum <= (size_t)CURL_MASK_SSIZE_T); + return (ssize_t)(uznum & (size_t)CURL_MASK_SSIZE_T); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -219,15 +219,15 @@ ssize_t curlx_uztosz(size_t uznum) size_t curlx_sotouz(curl_off_t sonum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sonum >= 0); - return (size_t)(sonum & (curl_off_t) CURL_MASK_USIZE_T); + return (size_t)(sonum & (curl_off_t)CURL_MASK_USIZE_T); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -238,18 +238,18 @@ size_t curlx_sotouz(curl_off_t sonum) int curlx_sztosi(ssize_t sznum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sznum >= 0); #if INT_MAX < SSIZE_MAX - DEBUGASSERT((size_t) sznum <= (size_t) CURL_MASK_SINT); + DEBUGASSERT((size_t)sznum <= (size_t)CURL_MASK_SINT); #endif - return (int)(sznum & (ssize_t) CURL_MASK_SINT); + return (int)(sznum & (ssize_t)CURL_MASK_SINT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -260,15 +260,15 @@ int curlx_sztosi(ssize_t sznum) unsigned short curlx_uitous(unsigned int uinum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif - DEBUGASSERT(uinum <= (unsigned int) CURL_MASK_USHORT); - return (unsigned short) (uinum & (unsigned int) CURL_MASK_USHORT); + DEBUGASSERT(uinum <= (unsigned int)CURL_MASK_USHORT); + return (unsigned short)(uinum & (unsigned int)CURL_MASK_USHORT); #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -279,15 +279,15 @@ unsigned short curlx_uitous(unsigned int uinum) size_t curlx_sitouz(int sinum) { #ifdef __INTEL_COMPILER -# pragma warning(push) -# pragma warning(disable:810) /* conversion may lose significant bits */ +#pragma warning(push) +#pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sinum >= 0); - return (size_t) sinum; + return (size_t)sinum; #ifdef __INTEL_COMPILER -# pragma warning(pop) +#pragma warning(pop) #endif } @@ -333,7 +333,6 @@ bool curlx_sotouz_fits(curl_off_t sonum, size_t *puznum) return TRUE; } - bool curlx_sltouz(long slnum, size_t *puznum) { if(slnum < 0) { diff --git a/lib/curlx/warnless.h b/lib/curlx/warnless.h index 52e7ec2a5c5d..5f324ac37592 100644 --- a/lib/curlx/warnless.h +++ b/lib/curlx/warnless.h @@ -31,7 +31,7 @@ #endif #define CURLX_FUNCTION_CAST(target_type, func) \ - (target_type)(void (*) (void))(func) + (target_type)(void (*)(void))(func) unsigned char curlx_ultouc(unsigned long ulnum); diff --git a/lib/curlx/winapi.c b/lib/curlx/winapi.c index 4cacbcb618ea..3243f7cb4ad3 100644 --- a/lib/curlx/winapi.c +++ b/lib/curlx/winapi.c @@ -57,8 +57,8 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen) /* Truncate multiple lines */ p = strchr(buf, '\n'); if(p) { - if(p > buf && *(p-1) == '\r') - *(p-1) = '\0'; + if(p > buf && *(p - 1) == '\r') + *(p - 1) = '\0'; else *p = '\0'; } @@ -89,7 +89,6 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen) #if defined(__GNUC__) && __GNUC__ >= 7 #pragma GCC diagnostic pop #endif - } #else { diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index d259bc42b5b2..862310111e66 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -27,8 +27,8 @@ #include "../curl_setup.h" -#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \ - !defined(CURL_DISABLE_POP3) || \ +#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \ + !defined(CURL_DISABLE_POP3) || \ (!defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP)) #include @@ -110,8 +110,7 @@ void Curl_auth_create_login_message(const char *valuep, struct bufref *out) * * Returns void. */ -void Curl_auth_create_external_message(const char *user, - struct bufref *out) +void Curl_auth_create_external_message(const char *user, struct bufref *out) { /* This is the same formatting as the login message */ Curl_auth_create_login_message(user, out); diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index 3b02e5751fcc..9bc5544a64fa 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -63,7 +63,7 @@ CURLcode Curl_auth_create_cram_md5_message(const struct bufref *chlg, /* Compute the digest using the password as the key */ ctxt = Curl_HMAC_init(&Curl_HMAC_MD5, - (const unsigned char *) passwdp, + (const unsigned char *)passwdp, curlx_uztoui(strlen(passwdp))); if(!ctxt) return CURLE_OUT_OF_MEMORY; diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 850891f17535..c5fea6739449 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -138,20 +138,20 @@ bool Curl_auth_digest_get_pair(const char *str, char *value, char *content, #ifndef USE_WINDOWS_SSPI /* Convert MD5 chunk to RFC2617 (section 3.1.3) -suitable ASCII string */ static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */ - unsigned char *dest) /* 33 bytes */ + unsigned char *dest) /* 33 bytes */ { int i; for(i = 0; i < 16; i++) - curl_msnprintf((char *) &dest[i * 2], 3, "%02x", source[i]); + curl_msnprintf((char *)&dest[i * 2], 3, "%02x", source[i]); } /* Convert sha256 or SHA-512/256 chunk to RFC7616 -suitable ASCII string */ static void auth_digest_sha256_to_ascii(unsigned char *source, /* 32 bytes */ - unsigned char *dest) /* 65 bytes */ + unsigned char *dest) /* 65 bytes */ { int i; for(i = 0; i < 32; i++) - curl_msnprintf((char *) &dest[i * 2], 3, "%02x", source[i]); + curl_msnprintf((char *)&dest[i * 2], 3, "%02x", source[i]); } /* Perform quoted-string escaping as described in RFC2616 and its errata */ @@ -272,7 +272,7 @@ static CURLcode auth_decode_digest_md5_message(const struct bufref *chlgref, char *alg, size_t alen, char *qop, size_t qlen) { - const char *chlg = (const char *) Curl_bufref_ptr(chlgref); + const char *chlg = (const char *)Curl_bufref_ptr(chlgref); /* Ensure we have a valid challenge message */ if(!Curl_bufref_len(chlgref)) @@ -387,13 +387,13 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, if(!ctxt) return CURLE_OUT_OF_MEMORY; - Curl_MD5_update(ctxt, (const unsigned char *) userp, + Curl_MD5_update(ctxt, (const unsigned char *)userp, curlx_uztoui(strlen(userp))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) realm, + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)realm, curlx_uztoui(strlen(realm))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) passwdp, + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)passwdp, curlx_uztoui(strlen(passwdp))); Curl_MD5_final(ctxt, digest); @@ -401,12 +401,12 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, if(!ctxt) return CURLE_OUT_OF_MEMORY; - Curl_MD5_update(ctxt, (const unsigned char *) digest, MD5_DIGEST_LEN); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) nonce, + Curl_MD5_update(ctxt, (const unsigned char *)digest, MD5_DIGEST_LEN); + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)nonce, curlx_uztoui(strlen(nonce))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) cnonce, + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)cnonce, curlx_uztoui(strlen(cnonce))); Curl_MD5_final(ctxt, digest); @@ -427,10 +427,10 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; } - Curl_MD5_update(ctxt, (const unsigned char *) method, + Curl_MD5_update(ctxt, (const unsigned char *)method, curlx_uztoui(strlen(method))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) spn, + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)spn, curlx_uztoui(strlen(spn))); Curl_MD5_final(ctxt, digest); @@ -445,23 +445,23 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; } - Curl_MD5_update(ctxt, (const unsigned char *) HA1_hex, 2 * MD5_DIGEST_LEN); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) nonce, + Curl_MD5_update(ctxt, (const unsigned char *)HA1_hex, 2 * MD5_DIGEST_LEN); + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)nonce, curlx_uztoui(strlen(nonce))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) nonceCount, + Curl_MD5_update(ctxt, (const unsigned char *)nonceCount, curlx_uztoui(strlen(nonceCount))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) cnonce, + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)cnonce, curlx_uztoui(strlen(cnonce))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) qop, + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)qop, curlx_uztoui(strlen(qop))); - Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); + Curl_MD5_update(ctxt, (const unsigned char *)":", 1); - Curl_MD5_update(ctxt, (const unsigned char *) HA2_hex, 2 * MD5_DIGEST_LEN); + Curl_MD5_update(ctxt, (const unsigned char *)HA2_hex, 2 * MD5_DIGEST_LEN); Curl_MD5_final(ctxt, digest); for(i = 0; i < MD5_DIGEST_LEN; i++) @@ -553,7 +553,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, if(curlx_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH)) foundAuth = TRUE; else if(curlx_str_casecompare(&out, - DIGEST_QOP_VALUE_STRING_AUTH_INT)) + DIGEST_QOP_VALUE_STRING_AUTH_INT)) foundAuthInt = TRUE; if(curlx_str_single(&token, ',')) break; @@ -720,7 +720,7 @@ static CURLcode auth_create_digest_http_message( if(!hashthis) return CURLE_OUT_OF_MEMORY; - result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); + result = hash(hashbuf, (unsigned char *)hashthis, strlen(hashthis)); curlx_free(hashthis); if(result) return result; @@ -743,7 +743,7 @@ static CURLcode auth_create_digest_http_message( if(!hashthis) return CURLE_OUT_OF_MEMORY; - result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); + result = hash(hashbuf, (unsigned char *)hashthis, strlen(hashthis)); curlx_free(hashthis); if(result) return result; @@ -755,7 +755,7 @@ static CURLcode auth_create_digest_http_message( if(!tmp) return CURLE_OUT_OF_MEMORY; - result = hash(hashbuf, (unsigned char *) tmp, strlen(tmp)); + result = hash(hashbuf, (unsigned char *)tmp, strlen(tmp)); curlx_free(tmp); if(result) return result; @@ -799,7 +799,7 @@ static CURLcode auth_create_digest_http_message( if(!hashthis) return CURLE_OUT_OF_MEMORY; - result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); + result = hash(hashbuf, (unsigned char *)hashthis, strlen(hashthis)); curlx_free(hashthis); if(result) return result; @@ -816,7 +816,7 @@ static CURLcode auth_create_digest_http_message( if(!hashthis) return CURLE_OUT_OF_MEMORY; - result = hash(hashbuf, (unsigned char *) hashthis, strlen(hashthis)); + result = hash(hashbuf, (unsigned char *)hashthis, strlen(hashthis)); curlx_free(hashthis); if(result) return result; @@ -1015,9 +1015,9 @@ void Curl_auth_digest_cleanup(struct digestdata *digest) digest->nc = 0; digest->algo = ALGO_MD5; /* default algorithm */ - digest->stale = FALSE; /* default means normal, not stale */ + digest->stale = FALSE; /* default means normal, not stale */ digest->userhash = FALSE; } -#endif /* !USE_WINDOWS_SSPI */ +#endif /* !USE_WINDOWS_SSPI */ -#endif /* !CURL_DISABLE_DIGEST_AUTH */ +#endif /* !CURL_DISABLE_DIGEST_AUTH */ diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index ea6a66af9fac..550810acda18 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -42,14 +42,14 @@ #include "../strerror.h" /* -* Curl_auth_is_digest_supported() -* -* This is used to evaluate if DIGEST is supported. -* -* Parameters: None -* -* Returns TRUE if DIGEST is supported by Windows SSPI. -*/ + * Curl_auth_is_digest_supported() + * + * This is used to evaluate if DIGEST is supported. + * + * Parameters: None + * + * Returns TRUE if DIGEST is supported by Windows SSPI. + */ bool Curl_auth_is_digest_supported(void) { PSecPkgInfo SecurityPackage; diff --git a/lib/vauth/gsasl.c b/lib/vauth/gsasl.c index debeda0604e2..8330a4bd7155 100644 --- a/lib/vauth/gsasl.c +++ b/lib/vauth/gsasl.c @@ -100,7 +100,7 @@ CURLcode Curl_auth_gsasl_token(struct Curl_easy *data, size_t outlen; res = gsasl_step(gsasl->client, - (const char *) Curl_bufref_ptr(chlg), Curl_bufref_len(chlg), + (const char *)Curl_bufref_ptr(chlg), Curl_bufref_len(chlg), &response, &outlen); if(res != GSASL_OK && res != GSASL_NEEDS_MORE) { failf(data, "GSASL step: %s", gsasl_strerror(res)); diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 9ea36171faec..1590949d681a 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -159,7 +159,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, gss_release_buffer(&unused_status, &output_token); } else - Curl_bufref_set(out, mutual_auth ? "": NULL, 0, NULL); + Curl_bufref_set(out, mutual_auth ? "" : NULL, 0, NULL); return result; } diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index 10fbac7644db..2f82345b98c7 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -278,8 +278,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, /* Get our response size information */ status = Curl_pSecFn->QueryContextAttributes(krb5->context, - SECPKG_ATTR_SIZES, - &sizes); + SECPKG_ATTR_SIZES, &sizes); if(status == SEC_E_INSUFFICIENT_MEMORY) return CURLE_OUT_OF_MEMORY; diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index a757d1c8f9fd..e5eb1de5ef8b 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -48,7 +48,6 @@ #include "vauth.h" #include "../curl_endian.h" - /* NTLM buffer fixed size, large enough for long user + host + domain */ #define NTLM_BUFSIZE 1024 @@ -158,7 +157,7 @@ #define NTLMSSP_SIGNATURE "\x4e\x54\x4c\x4d\x53\x53\x50" #if DEBUG_ME -# define DEBUG_OUT(x) x +#define DEBUG_OUT(x) x static void ntlm_print_flags(FILE *handle, unsigned long flags) { if(flags & NTLMFLAG_NEGOTIATE_UNICODE) @@ -236,7 +235,7 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len) curl_mfprintf(stderr, "%02.2x", (unsigned int)*p++); } #else -# define DEBUG_OUT(x) Curl_nop_stmt +#define DEBUG_OUT(x) Curl_nop_stmt #endif /* diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index d976bc5d2131..bab319671c48 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -221,7 +221,6 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data, } /* -* Curl_auth_create_ntlm_type3_message() * Curl_auth_create_ntlm_type3_message() * * This is used to generate an already encoded NTLM type-3 message ready for @@ -267,12 +266,12 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, #ifdef SECPKG_ATTR_ENDPOINT_BINDINGS /* ssl context comes from schannel. - * When extended protection is used in IIS server, - * we have to pass a second SecBuffer to the SecBufferDesc - * otherwise IIS will not pass the authentication (401 response). - * Minimum supported version is Windows 7. - * https://learn.microsoft.com/security-updates/SecurityAdvisories/2009/973811 - */ + * When extended protection is used in IIS server, + * we have to pass a second SecBuffer to the SecBufferDesc + * otherwise IIS will not pass the authentication (401 response). + * Minimum supported version is Windows 7. + * https://learn.microsoft.com/security-updates/SecurityAdvisories/2009/973811 + */ if(ntlm->sslContext) { SEC_CHANNEL_BINDINGS channelBindings; SecPkgContext_Bindings pkgBindings; diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c index 0bb7a9d6bdab..3b4d4164f094 100644 --- a/lib/vauth/oauth2.c +++ b/lib/vauth/oauth2.c @@ -27,7 +27,7 @@ #include "../curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \ - !defined(CURL_DISABLE_POP3) || \ + !defined(CURL_DISABLE_POP3) || \ (!defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP)) #include diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 90e622da3d4e..2b0504f630f8 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -139,7 +139,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, nego->output_token = curlx_malloc(nego->token_max); if(!nego->output_token) return CURLE_OUT_OF_MEMORY; - } + } if(!nego->credentials) { /* Do we have credentials to use or are we using single sign-on? */ @@ -200,12 +200,12 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, #ifdef SECPKG_ATTR_ENDPOINT_BINDINGS /* ssl context comes from Schannel. - * When extended protection is used in IIS server, - * we have to pass a second SecBuffer to the SecBufferDesc - * otherwise IIS will not pass the authentication (401 response). - * Minimum supported version is Windows 7. - * https://learn.microsoft.com/security-updates/SecurityAdvisories/2009/973811 - */ + * When extended protection is used in IIS server, + * we have to pass a second SecBuffer to the SecBufferDesc + * otherwise IIS will not pass the authentication (401 response). + * Minimum supported version is Windows 7. + * https://learn.microsoft.com/security-updates/SecurityAdvisories/2009/973811 + */ if(nego->sslContext) { SEC_CHANNEL_BINDINGS channelBindings; SecPkgContext_Bindings pkgBindings; diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index 6626ace8bc6a..4ca6cef7c8fe 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -171,13 +171,11 @@ static void ntlm_conn_dtor(void *key, size_t klen, void *entry) struct ntlmdata *Curl_auth_ntlm_get(struct connectdata *conn, bool proxy) { - const char *key = proxy ? CURL_META_NTLM_PROXY_CONN : - CURL_META_NTLM_CONN; + const char *key = proxy ? CURL_META_NTLM_PROXY_CONN : CURL_META_NTLM_CONN; struct ntlmdata *ntlm = Curl_conn_meta_get(conn, key); if(!ntlm) { ntlm = curlx_calloc(1, sizeof(*ntlm)); - if(!ntlm || - Curl_conn_meta_set(conn, key, ntlm, ntlm_conn_dtor)) + if(!ntlm || Curl_conn_meta_set(conn, key, ntlm, ntlm_conn_dtor)) return NULL; } return ntlm; @@ -185,8 +183,8 @@ struct ntlmdata *Curl_auth_ntlm_get(struct connectdata *conn, bool proxy) void Curl_auth_ntlm_remove(struct connectdata *conn, bool proxy) { - Curl_conn_meta_remove(conn, proxy ? - CURL_META_NTLM_PROXY_CONN : CURL_META_NTLM_CONN); + Curl_conn_meta_remove(conn, proxy ? CURL_META_NTLM_PROXY_CONN + : CURL_META_NTLM_CONN); } #endif /* USE_NTLM */ @@ -257,13 +255,11 @@ static void nego_conn_dtor(void *key, size_t klen, void *entry) struct negotiatedata *Curl_auth_nego_get(struct connectdata *conn, bool proxy) { - const char *key = proxy ? CURL_META_NEGO_PROXY_CONN : - CURL_META_NEGO_CONN; + const char *key = proxy ? CURL_META_NEGO_PROXY_CONN : CURL_META_NEGO_CONN; struct negotiatedata *nego = Curl_conn_meta_get(conn, key); if(!nego) { nego = curlx_calloc(1, sizeof(*nego)); - if(!nego || - Curl_conn_meta_set(conn, key, nego, nego_conn_dtor)) + if(!nego || Curl_conn_meta_set(conn, key, nego, nego_conn_dtor)) return NULL; } return nego; diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 62255285b6a0..09b30229f08d 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -72,14 +72,14 @@ #include "../curlx/warnless.h" -#define QUIC_MAX_STREAMS (256*1024) -#define QUIC_HANDSHAKE_TIMEOUT (10*NGTCP2_SECONDS) +#define QUIC_MAX_STREAMS (256 * 1024) +#define QUIC_HANDSHAKE_TIMEOUT (10 * NGTCP2_SECONDS) /* A stream window is the maximum amount we need to buffer for * each active transfer. * Chunk size is large enough to take a full DATA frame */ #define H3_STREAM_WINDOW_SIZE (64 * 1024) -#define H3_STREAM_CHUNK_SIZE (16 * 1024) +#define H3_STREAM_CHUNK_SIZE (16 * 1024) #if H3_STREAM_CHUNK_SIZE < NGTCP2_MAX_UDP_PAYLOAD_SIZE #error H3_STREAM_CHUNK_SIZE smaller than NGTCP2_MAX_UDP_PAYLOAD_SIZE #endif @@ -150,8 +150,7 @@ struct cf_ngtcp2_ctx { /* How to access `call_data` from a cf_ngtcp2 filter */ #undef CF_CTX_CALL_DATA -#define CF_CTX_CALL_DATA(cf) \ - ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data +#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data static void h3_stream_hash_free(unsigned int id, void *stream); @@ -187,14 +186,14 @@ static void cf_ngtcp2_setup_keep_alive(struct Curl_cfilter *cf, struct cf_ngtcp2_ctx *ctx = cf->ctx; const ngtcp2_transport_params *rp; /* Peer should have sent us its transport parameters. If it - * announces a positive `max_idle_timeout` it will close the - * connection when it does not hear from us for that time. - * - * Some servers use this as a keep-alive timer at a rather low - * value. We are doing HTTP/3 here and waiting for the response - * to a request may take a considerable amount of time. We need - * to prevent the peer's QUIC stack from closing in this case. - */ + * announces a positive `max_idle_timeout` it will close the + * connection when it does not hear from us for that time. + * + * Some servers use this as a keep-alive timer at a rather low + * value. We are doing HTTP/3 here and waiting for the response + * to a request may take a considerable amount of time. We need + * to prevent the peer's QUIC stack from closing in this case. + */ if(!ctx->qconn) return; @@ -218,7 +217,6 @@ static void cf_ngtcp2_setup_keep_alive(struct Curl_cfilter *cf, } } - struct pkt_io_ctx; static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -231,20 +229,20 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, * All about the H3 internals of a stream */ struct h3_stream_ctx { - int64_t id; /* HTTP/3 protocol identifier */ - struct bufq sendbuf; /* h3 request body */ - struct h1_req_parser h1; /* h1 request parsing */ + int64_t id; /* HTTP/3 protocol identifier */ + struct bufq sendbuf; /* h3 request body */ + struct h1_req_parser h1; /* h1 request parsing */ size_t sendbuf_len_in_flight; /* sendbuf amount "in flight" */ - uint64_t error3; /* HTTP/3 stream error code */ - curl_off_t upload_left; /* number of request bytes left to upload */ - uint64_t download_unacked; /* bytes not acknowledged yet */ - int status_code; /* HTTP status code */ - CURLcode xfer_result; /* result from xfer_resp_write(_hd) */ - BIT(resp_hds_complete); /* we have a complete, final response */ - BIT(closed); /* TRUE on stream close */ - BIT(reset); /* TRUE on stream reset */ - BIT(send_closed); /* stream is local closed */ - BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ + uint64_t error3; /* HTTP/3 stream error code */ + curl_off_t upload_left; /* number of request bytes left to upload */ + uint64_t download_unacked; /* bytes not acknowledged yet */ + int status_code; /* HTTP status code */ + CURLcode xfer_result; /* result from xfer_resp_write(_hd) */ + BIT(resp_hds_complete); /* we have a complete, final response */ + BIT(closed); /* TRUE on stream close */ + BIT(reset); /* TRUE on stream reset */ + BIT(send_closed); /* stream is local closed */ + BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ }; static void h3_stream_ctx_free(struct h3_stream_ctx *stream) @@ -315,8 +313,8 @@ static bool cf_ngtcp2_sfind(uint32_t mid, void *value, void *user_data) return TRUE; /* continue */ } -static struct h3_stream_ctx * -cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, int64_t stream_id) +static struct h3_stream_ctx *cf_ngtcp2_get_stream(struct cf_ngtcp2_ctx *ctx, + int64_t stream_id) { struct cf_ngtcp2_sfind_ctx fctx; fctx.stream_id = stream_id; @@ -367,8 +365,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)cf; if(stream) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] easy handle is done", - stream->id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] easy handle is done", stream->id); cf_ngtcp2_stream_close(cf, data, stream); Curl_uint32_hash_remove(&ctx->streams, data->mid); if(!Curl_uint32_hash_count(&ctx->streams)) @@ -640,10 +637,9 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags, return 0; } -static int -cb_acked_stream_data_offset(ngtcp2_conn *tconn, int64_t stream_id, - uint64_t offset, uint64_t datalen, void *user_data, - void *stream_user_data) +static int cb_acked_stream_data_offset(ngtcp2_conn *tconn, int64_t stream_id, + uint64_t offset, uint64_t datalen, + void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; @@ -830,8 +826,8 @@ static int cb_recv_rx_key(ngtcp2_conn *tconn, ngtcp2_encryption_level level, } #if defined(_MSC_VER) && defined(_DLL) -# pragma warning(push) -# pragma warning(disable:4232) /* MSVC extension, dllimport identity */ +#pragma warning(push) +#pragma warning(disable:4232) /* MSVC extension, dllimport identity */ #endif static ngtcp2_callbacks ng_callbacks = { @@ -881,7 +877,7 @@ static ngtcp2_callbacks ng_callbacks = { }; #if defined(_MSC_VER) && defined(_DLL) -# pragma warning(pop) +#pragma warning(pop) #endif /** @@ -1337,9 +1333,9 @@ static CURLcode init_ngh3_conn(struct Curl_cfilter *cf, } static CURLcode recv_closed_stream(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct h3_stream_ctx *stream, - size_t *pnread) + struct Curl_easy *data, + struct h3_stream_ctx *stream, + size_t *pnread) { (void)cf; *pnread = 0; @@ -1452,11 +1448,10 @@ static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id, return 0; } -static nghttp3_ssize -cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, - nghttp3_vec *vec, size_t veccnt, - uint32_t *pflags, void *user_data, - void *stream_user_data) +static nghttp3_ssize cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, + nghttp3_vec *vec, size_t veccnt, + uint32_t *pflags, void *user_data, + void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; @@ -1504,8 +1499,7 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, } else if(!nwritten) { /* Not EOF, and nothing to give, we signal WOULDBLOCK. */ - CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> AGAIN", - stream->id); + CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> AGAIN", stream->id); return NGHTTP3_ERR_WOULDBLOCK; } @@ -1961,7 +1955,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, */ max_payload_size = ngtcp2_conn_get_max_tx_udp_payload_size(ctx->qconn); path_max_payload_size = - ngtcp2_conn_get_path_max_tx_udp_payload_size(ctx->qconn); + ngtcp2_conn_get_path_max_tx_udp_payload_size(ctx->qconn); send_quantum = ngtcp2_conn_get_send_quantum(ctx->qconn); CURL_TRC_CF(data, cf, "egress, collect and send packets, quantum=%zu", send_quantum); @@ -1977,7 +1971,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, size_t buflen = Curl_bufq_len(&ctx->q.sendbuf); if((buflen >= send_quantum) || ((buflen + gsolen) >= ctx->q.sendbuf.chunk_size)) - break; + break; DEBUGASSERT(nread > 0); ++pktcnt; if(pktcnt == 1) { @@ -2283,16 +2277,26 @@ static int quic_ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) static const char *gtls_hs_msg_name(int mtype) { switch(mtype) { - case 1: return "ClientHello"; - case 2: return "ServerHello"; - case 4: return "SessionTicket"; - case 8: return "EncryptedExtensions"; - case 11: return "Certificate"; - case 13: return "CertificateRequest"; - case 15: return "CertificateVerify"; - case 20: return "Finished"; - case 24: return "KeyUpdate"; - case 254: return "MessageHash"; + case 1: + return "ClientHello"; + case 2: + return "ServerHello"; + case 4: + return "SessionTicket"; + case 8: + return "EncryptedExtensions"; + case 11: + return "Certificate"; + case 13: + return "CertificateRequest"; + case 15: + return "CertificateVerify"; + case 20: + return "Finished"; + case 24: + return "KeyUpdate"; + case 254: + return "MessageHash"; } return "Unknown"; } @@ -2458,7 +2462,7 @@ static CURLcode cf_ngtcp2_on_session_reuse(struct Curl_cfilter *cf, #endif /* WOLFSSL_EARLY_DATA */ #endif #if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || \ - (defined(USE_OPENSSL) && defined(HAVE_OPENSSL_EARLYDATA)) + (defined(USE_OPENSSL) && defined(HAVE_OPENSSL_EARLYDATA)) if((!ctx->earlydata_max)) { CURL_TRC_CF(data, cf, "SSL session does not allow earlydata"); } @@ -2668,7 +2672,7 @@ static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "connection refused by server"); /* When a QUIC server instance is shutting down, it may send us a * CONNECTION_CLOSE with this code right away. We want - * to keep on trying in this case. */ + * to keep on trying in this case. */ result = CURLE_WEIRD_SERVER_REPLY; } } diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 7bca97b4086d..ece4ce6ad570 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -453,29 +453,29 @@ static CURLcode cf_osslq_h3conn_add_stream(struct cf_osslq_h3conn *h3, * BUT OpenSSL does not offer this information to us. So, we silently * ignore all such streams we do not expect. */ switch(stype) { - case SSL_STREAM_TYPE_READ: { - struct cf_osslq_stream *nstream; - if(h3->remote_ctrl_n >= CURL_ARRAYSIZE(h3->remote_ctrl)) { - /* rejected, we are full */ - CURL_TRC_CF(data, cf, "[%" PRId64 "] reject remote uni stream", - stream_id); - SSL_free(stream_ssl); - return CURLE_OK; - } - nstream = &h3->remote_ctrl[h3->remote_ctrl_n++]; - nstream->id = stream_id; - nstream->ssl = stream_ssl; - Curl_bufq_initp(&nstream->recvbuf, &ctx->stream_bufcp, 1, BUFQ_OPT_NONE); - CURL_TRC_CF(data, cf, "[%" PRId64 "] accepted remote uni stream", + case SSL_STREAM_TYPE_READ: { + struct cf_osslq_stream *nstream; + if(h3->remote_ctrl_n >= CURL_ARRAYSIZE(h3->remote_ctrl)) { + /* rejected, we are full */ + CURL_TRC_CF(data, cf, "[%" PRId64 "] reject remote uni stream", stream_id); - return CURLE_OK; - } - default: - CURL_TRC_CF(data, cf, "[%" PRId64 "] reject remote %s" - " stream, type=%x", stream_id, - (stype == SSL_STREAM_TYPE_BIDI) ? "bidi" : "write", stype); SSL_free(stream_ssl); return CURLE_OK; + } + nstream = &h3->remote_ctrl[h3->remote_ctrl_n++]; + nstream->id = stream_id; + nstream->ssl = stream_ssl; + Curl_bufq_initp(&nstream->recvbuf, &ctx->stream_bufcp, 1, BUFQ_OPT_NONE); + CURL_TRC_CF(data, cf, "[%" PRId64 "] accepted remote uni stream", + stream_id); + return CURLE_OK; + } + default: + CURL_TRC_CF(data, cf, "[%" PRId64 "] reject remote %s" + " stream, type=%x", stream_id, + (stype == SSL_STREAM_TYPE_BIDI) ? "bidi" : "write", stype); + SSL_free(stream_ssl); + return CURLE_OK; } } @@ -505,8 +505,7 @@ static CURLcode cf_osslq_ssl_err(struct Curl_cfilter *cf, lerr = SSL_get_verify_result(ctx->tls.ossl.ssl); if(lerr != X509_V_OK) { ssl_config->certverifyresult = lerr; - curl_msnprintf(ebuf, sizeof(ebuf), - "SSL certificate problem: %s", + curl_msnprintf(ebuf, sizeof(ebuf), "SSL certificate problem: %s", X509_verify_cert_error_string(lerr)); } else @@ -540,7 +539,7 @@ static CURLcode cf_osslq_ssl_err(struct Curl_cfilter *cf, * the SO_ERROR is also lost. */ if(CURLE_SSL_CONNECT_ERROR == result && errdetail == 0) { - char extramsg[80]=""; + char extramsg[80] = ""; int sockerr = SOCKERRNO; struct ip_quadruple ip; @@ -570,20 +569,21 @@ static CURLcode cf_osslq_verify_peer(struct Curl_cfilter *cf, */ struct h3_stream_ctx { struct cf_osslq_stream s; - struct bufq sendbuf; /* h3 request body */ - struct bufq recvbuf; /* h3 response body */ - struct h1_req_parser h1; /* h1 request parsing */ + struct bufq sendbuf; /* h3 request body */ + struct bufq recvbuf; /* h3 response body */ + struct h1_req_parser h1; /* h1 request parsing */ size_t sendbuf_len_in_flight; /* sendbuf amount "in flight" */ - size_t recv_buf_nonflow; /* buffered bytes, not counting for flow control */ - uint64_t error3; /* HTTP/3 stream error code */ - curl_off_t upload_left; /* number of request bytes left to upload */ - curl_off_t download_recvd; /* number of response DATA bytes received */ - int status_code; /* HTTP status code */ - BIT(resp_hds_complete); /* we have a complete, final response */ - BIT(closed); /* TRUE on stream close */ - BIT(reset); /* TRUE on stream reset */ - BIT(send_closed); /* stream is local closed */ - BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ + size_t recv_buf_nonflow; /* buffered bytes, + not counting for flow control */ + uint64_t error3; /* HTTP/3 stream error code */ + curl_off_t upload_left; /* number of request bytes left to upload */ + curl_off_t download_recvd; /* number of response DATA bytes received */ + int status_code; /* HTTP status code */ + BIT(resp_hds_complete); /* we have a complete, final response */ + BIT(closed); /* TRUE on stream close */ + BIT(reset); /* TRUE on stream reset */ + BIT(send_closed); /* stream is local closed */ + BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ }; static void h3_stream_ctx_free(struct h3_stream_ctx *stream) @@ -645,8 +645,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) (void)cf; if(stream) { - CURL_TRC_CF(data, cf, "[%" PRIu64 "] easy handle is done", - stream->s.id); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] easy handle is done", stream->s.id); if(ctx->h3.conn && (stream->s.id >= 0) && !stream->closed) { nghttp3_conn_shutdown_stream_read(ctx->h3.conn, stream->s.id); nghttp3_conn_close_stream(ctx->h3.conn, stream->s.id, @@ -965,11 +964,10 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id, return 0; } -static nghttp3_ssize -cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, - nghttp3_vec *vec, size_t veccnt, - uint32_t *pflags, void *user_data, - void *stream_user_data) +static nghttp3_ssize cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, + nghttp3_vec *vec, size_t veccnt, + uint32_t *pflags, void *user_data, + void *stream_user_data) { struct Curl_cfilter *cf = user_data; struct cf_osslq_ctx *ctx = cf->ctx; @@ -1106,21 +1104,21 @@ static CURLcode cf_osslq_h3conn_init(struct cf_osslq_ctx *ctx, SSL *conn, } result = cf_osslq_stream_open(&h3->s_ctrl, conn, - SSL_STREAM_FLAG_ADVANCE|SSL_STREAM_FLAG_UNI, + SSL_STREAM_FLAG_ADVANCE | SSL_STREAM_FLAG_UNI, &ctx->stream_bufcp, NULL); if(result) { result = CURLE_QUIC_CONNECT_ERROR; goto out; } result = cf_osslq_stream_open(&h3->s_qpack_enc, conn, - SSL_STREAM_FLAG_ADVANCE|SSL_STREAM_FLAG_UNI, + SSL_STREAM_FLAG_ADVANCE | SSL_STREAM_FLAG_UNI, &ctx->stream_bufcp, NULL); if(result) { result = CURLE_QUIC_CONNECT_ERROR; goto out; } result = cf_osslq_stream_open(&h3->s_qpack_dec, conn, - SSL_STREAM_FLAG_ADVANCE|SSL_STREAM_FLAG_UNI, + SSL_STREAM_FLAG_ADVANCE | SSL_STREAM_FLAG_UNI, &ctx->stream_bufcp, NULL); if(result) { result = CURLE_QUIC_CONNECT_ERROR; @@ -1221,7 +1219,8 @@ static CURLcode cf_osslq_ctx_start(struct Curl_cfilter *cf, SSL_INCOMING_STREAM_POLICY_ACCEPT, 0); /* from our side, there is no idle timeout */ SSL_set_value_uint(ctx->tls.ossl.ssl, - SSL_VALUE_CLASS_FEATURE_REQUEST, SSL_VALUE_QUIC_IDLE_TIMEOUT, 0); + SSL_VALUE_CLASS_FEATURE_REQUEST, + SSL_VALUE_QUIC_IDLE_TIMEOUT, 0); /* setup the H3 things on top of the QUIC connection */ result = cf_osslq_h3conn_init(ctx, ctx->tls.ossl.ssl, cf); @@ -1532,7 +1531,7 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, fill_ctx.multi = data->multi; fill_ctx.n = 0; Curl_uint32_hash_visit(&ctx->streams, cf_osslq_collect_block_send, - &fill_ctx); + &fill_ctx); poll_count = fill_ctx.n; if(poll_count) { CURL_TRC_CF(data, cf, "polling %zu blocked streams", poll_count); @@ -1541,7 +1540,7 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, res = CURLE_UNRECOVERABLE_POLL; if(!SSL_poll(ctx->poll_items, poll_count, sizeof(SSL_POLL_ITEM), &timeout, 0, &result_count)) - goto out; + goto out; res = CURLE_OK; @@ -1617,7 +1616,7 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, uint64_t flags = (eos && ((i + 1) == n)) ? SSL_WRITE_FLAG_CONCLUDE : 0; written = vec[i].len; ok = !s->ssl || SSL_write_ex2(s->ssl, vec[i].base, vec[i].len, flags, - &written); + &written); if(ok && flags & SSL_WRITE_FLAG_CONCLUDE) eos_written = TRUE; if(ok) { diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 5aca750c2cb9..45f606ec6182 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -167,17 +167,17 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, * All about the H3 internals of a stream */ struct h3_stream_ctx { - uint64_t id; /* HTTP/3 protocol stream identifier */ - struct bufq recvbuf; /* h3 response */ + uint64_t id; /* HTTP/3 protocol stream identifier */ + struct bufq recvbuf; /* h3 response */ struct h1_req_parser h1; /* h1 request parsing */ - uint64_t error3; /* HTTP/3 stream error code */ - BIT(opened); /* TRUE after stream has been opened */ - BIT(closed); /* TRUE on stream close */ - BIT(reset); /* TRUE on stream reset */ - BIT(send_closed); /* stream is locally closed */ + uint64_t error3; /* HTTP/3 stream error code */ + BIT(opened); /* TRUE after stream has been opened */ + BIT(closed); /* TRUE on stream close */ + BIT(reset); /* TRUE on stream reset */ + BIT(send_closed); /* stream is locally closed */ BIT(resp_hds_complete); /* final response has been received */ - BIT(resp_got_header); /* TRUE when h3 stream has recvd some HEADER */ - BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ + BIT(resp_got_header); /* TRUE when h3 stream has recvd some HEADER */ + BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ }; static void h3_stream_ctx_free(struct h3_stream_ctx *stream) @@ -318,7 +318,7 @@ static void cf_quiche_expire_conn_closed(struct Curl_cfilter *cf, /* * write_resp_raw() copies response data in raw format to the `data`'s - * receive buffer. If not enough space is available, it appends to the + * receive buffer. If not enough space is available, it appends to the * `data`'s overflow buffer. */ static CURLcode write_resp_raw(struct Curl_cfilter *cf, @@ -813,7 +813,7 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, timeout_ns = quiche_conn_timeout_as_nanos(ctx->qconn); if(timeout_ns % 1000000) timeout_ns += 1000000; - /* expire resolution is milliseconds */ + /* expire resolution is milliseconds */ Curl_expire(data, (timeout_ns / 1000000), EXPIRE_QUIC); return result; } @@ -977,9 +977,9 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, DEBUGASSERT(stream); result = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL, - !data->state.http_ignorecustom ? - data->set.str[STRING_CUSTOMREQUEST] : NULL, - 0, pnwritten); + !data->state.http_ignorecustom ? + data->set.str[STRING_CUSTOMREQUEST] : NULL, + 0, pnwritten); if(result) goto out; if(!stream->h1.done) { @@ -1313,8 +1313,7 @@ static CURLcode cf_quiche_ctx_open(struct Curl_cfilter *cf, int qfd; (void)Curl_qlogdir(data, ctx->scid, sizeof(ctx->scid), &qfd); if(qfd != -1) - quiche_conn_set_qlog_fd(ctx->qconn, qfd, - "qlog title", "curl qlog"); + quiche_conn_set_qlog_fd(ctx->qconn, qfd, "qlog title", "curl qlog"); } #endif diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index 7a3c99b58441..99b19b369185 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -143,7 +143,9 @@ CURLcode Curl_vquic_tls_before_recv(struct curl_tls_ctx *ctx, return result; } #else - (void)ctx; (void)cf; (void)data; + (void)ctx; + (void)cf; + (void)data; #endif return CURLE_OK; } @@ -172,7 +174,7 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, #elif defined(USE_WOLFSSL) (void)data; if(conn_config->verifyhost) { - WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(ctx->wssl.ssl); + WOLFSSL_X509 *cert = wolfSSL_get_peer_certificate(ctx->wssl.ssl); if(!cert) result = CURLE_OUT_OF_MEMORY; else if(peer->sni && @@ -194,7 +196,6 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, return result; } - bool Curl_vquic_tls_get_ssl_info(struct curl_tls_ctx *ctx, bool give_ssl_ctx, struct curl_tlssessioninfo *info) diff --git a/lib/vquic/vquic-tls.h b/lib/vquic/vquic-tls.h index c694e23e4e6d..7bddb42c99f3 100644 --- a/lib/vquic/vquic-tls.h +++ b/lib/vquic/vquic-tls.h @@ -69,14 +69,14 @@ typedef CURLcode Curl_vquic_session_reuse_cb(struct Curl_cfilter *cf, /** * Initialize the QUIC TLS instances based of the SSL configurations * for the connection filter, transfer and peer. - * @param ctx the TLS context to initialize - * @param cf the connection filter involved - * @param data the transfer involved - * @param peer the peer that will be connected to - * @param alpns the ALPN specifications to negotiate, may be NULL - * @param cb_setup optional callback for early TLS config - * @param cb_user_data user_data param for callback - * @param ssl_user_data optional pointer to set in TLS application context + * @param ctx the TLS context to initialize + * @param cf the connection filter involved + * @param data the transfer involved + * @param peer the peer that will be connected to + * @param alpns the ALPN specifications to negotiate, may be NULL + * @param cb_setup optional callback for early TLS config + * @param cb_user_data user_data param for callback + * @param ssl_user_data optional pointer to set in TLS application context * @param session_reuse_cb callback to handle session reuse, signal early data */ CURLcode Curl_vquic_tls_init(struct curl_tls_ctx *ctx, diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index c1267cef9ed0..a4dea8a77c43 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -266,7 +266,7 @@ static CURLcode vquic_send_packets(struct Curl_cfilter *cf, unsigned char c; *psent = 0; Curl_rand(data, &c, 1); - if(c >= ((100-qctx->wblock_percent)*256/100)) { + if(c >= ((100 - qctx->wblock_percent) * 256 / 100)) { CURL_TRC_CF(data, cf, "vquic_flush() simulate EWOULDBLOCK"); return CURLE_AGAIN; } @@ -334,8 +334,7 @@ CURLcode vquic_send_tail_split(struct Curl_cfilter *cf, struct Curl_easy *data, qctx->split_gsolen = gsolen; qctx->gsolen = tail_gsolen; CURL_TRC_CF(data, cf, "vquic_send_tail_split: [%zu gso=%zu][%zu gso=%zu]", - qctx->split_len, qctx->split_gsolen, - tail_len, qctx->gsolen); + qctx->split_len, qctx->split_gsolen, tail_len, qctx->gsolen); return vquic_flush(cf, data, qctx); } @@ -476,7 +475,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, { struct iovec msg_iov; struct msghdr msg; - uint8_t buf[64*1024]; + uint8_t buf[64 * 1024]; struct sockaddr_storage remote_addr; size_t total_nread, pkts, calls; ssize_t rc; @@ -551,7 +550,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, size_t max_pkts, vquic_recv_pkts_cb *recv_cb, void *userp) { - uint8_t buf[64*1024]; + uint8_t buf[64 * 1024]; int bufsize = (int)sizeof(buf); struct sockaddr_storage remote_addr; socklen_t remote_addrlen = sizeof(remote_addr); diff --git a/lib/vquic/vquic_int.h b/lib/vquic/vquic_int.h index ef92ab21b730..b4f2fd811680 100644 --- a/lib/vquic/vquic_int.h +++ b/lib/vquic/vquic_int.h @@ -33,25 +33,25 @@ #define MAX_UDP_PAYLOAD_SIZE 1452 struct cf_quic_ctx { - curl_socket_t sockfd; /* connected UDP socket */ + curl_socket_t sockfd; /* connected UDP socket */ struct sockaddr_storage local_addr; /* address socket is bound to */ - socklen_t local_addrlen; /* length of local address */ - - struct bufq sendbuf; /* buffer for sending one or more packets */ - struct curltime first_byte_at; /* when first byte was recvd */ - struct curltime last_op; /* last (attempted) send/recv operation */ - struct curltime last_io; /* last successful socket IO */ - size_t gsolen; /* length of individual packets in send buf */ - size_t split_len; /* if != 0, buffer length after which GSO differs */ + socklen_t local_addrlen; /* length of local address */ + + struct bufq sendbuf; /* buffer for sending one or more packets */ + struct curltime first_byte_at; /* when first byte was recvd */ + struct curltime last_op; /* last (attempted) send/recv operation */ + struct curltime last_io; /* last successful socket IO */ + size_t gsolen; /* length of individual packets in send buf */ + size_t split_len; /* if != 0, buffer length after which GSO differs */ size_t split_gsolen; /* length of individual packets after split_len */ #ifdef DEBUGBUILD - int wblock_percent; /* percent of writes doing EAGAIN */ + int wblock_percent; /* percent of writes doing EAGAIN */ #endif BIT(got_first_byte); /* if first byte was received */ - BIT(no_gso); /* do not use gso on sending */ + BIT(no_gso); /* do not use gso on sending */ }; -#define H3_STREAM_CTX(ctx,data) \ +#define H3_STREAM_CTX(ctx, data) \ (data ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL) CURLcode vquic_ctx_init(struct cf_quic_ctx *qctx); @@ -77,7 +77,6 @@ CURLcode vquic_send_tail_split(struct Curl_cfilter *cf, struct Curl_easy *data, CURLcode vquic_flush(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx); - typedef CURLcode vquic_recv_pkts_cb(const unsigned char *buf, size_t buflen, size_t gso_size, struct sockaddr_storage *remote_addr, diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index db80bcbf8c96..cd3a7d6622e1 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -74,12 +74,12 @@ /* A recent macro provided by libssh. Or make our own. */ #ifndef SSH_STRING_FREE_CHAR -#define SSH_STRING_FREE_CHAR(x) \ - do { \ - if(x) { \ - ssh_string_free_char(x); \ - x = NULL; \ - } \ +#define SSH_STRING_FREE_CHAR(x) \ + do { \ + if(x) { \ + ssh_string_free_char(x); \ + x = NULL; \ + } \ } while(0) #endif @@ -111,10 +111,9 @@ static CURLcode sftp_doing(struct Curl_easy *data, static CURLcode sftp_disconnect(struct Curl_easy *data, struct connectdata *conn, bool dead); -static -CURLcode sftp_perform(struct Curl_easy *data, - bool *connected, - bool *dophase_done); +static CURLcode sftp_perform(struct Curl_easy *data, + bool *connected, + bool *dophase_done); static CURLcode myssh_pollset(struct Curl_easy *data, struct easy_pollset *ps); @@ -189,22 +188,22 @@ const struct Curl_handler Curl_handler_sftp = { static CURLcode sftp_error_to_CURLE(int err) { switch(err) { - case SSH_FX_OK: - return CURLE_OK; + case SSH_FX_OK: + return CURLE_OK; - case SSH_FX_NO_SUCH_FILE: - case SSH_FX_NO_SUCH_PATH: - return CURLE_REMOTE_FILE_NOT_FOUND; + case SSH_FX_NO_SUCH_FILE: + case SSH_FX_NO_SUCH_PATH: + return CURLE_REMOTE_FILE_NOT_FOUND; - case SSH_FX_PERMISSION_DENIED: - case SSH_FX_WRITE_PROTECT: - return CURLE_REMOTE_ACCESS_DENIED; + case SSH_FX_PERMISSION_DENIED: + case SSH_FX_WRITE_PROTECT: + return CURLE_REMOTE_ACCESS_DENIED; - case SSH_FX_FILE_ALREADY_EXISTS: - return CURLE_REMOTE_FILE_EXISTS; + case SSH_FX_FILE_ALREADY_EXISTS: + return CURLE_REMOTE_FILE_EXISTS; - default: - break; + default: + break; } return CURLE_SSH; @@ -213,7 +212,7 @@ static CURLcode sftp_error_to_CURLE(int err) #if !defined(CURL_DISABLE_VERBOSE_STRINGS) static const char *myssh_statename(sshstate state) { - static const char *const names[] = { + static const char * const names[] = { "SSH_STOP", "SSH_INIT", "SSH_S_STARTUP", @@ -284,7 +283,7 @@ static const char *myssh_statename(sshstate state) #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ -#define myssh_to(x,y,z) myssh_set_state(x,y,z) +#define myssh_to(x, y, z) myssh_set_state(x, y, z) /* * SSH State machine related code @@ -328,8 +327,7 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc) enum curl_khmatch keymatch; struct curl_khkey foundkey; struct curl_khkey *knownkeyp = NULL; - curl_sshkeycallback func = - data->set.ssh_keyfunc; + curl_sshkeycallback func = data->set.ssh_keyfunc; struct ssh_knownhosts_entry *knownhostsentry = NULL; struct curl_khkey knownkey; @@ -343,8 +341,7 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc) char md5buffer[33]; const char *pubkey_md5 = data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5]; - rc = ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_MD5, - &hash, &hlen); + 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"); @@ -352,7 +349,7 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc) } for(i = 0; i < 16; i++) - curl_msnprintf(&md5buffer[i*2], 3, "%02x", (unsigned char)hash[i]); + curl_msnprintf(&md5buffer[i * 2], 3, "%02x", (unsigned char)hash[i]); infof(data, "SSH MD5 fingerprint: %s", md5buffer); @@ -461,7 +458,7 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc) Curl_set_in_callback(data, TRUE); rc = func(data, knownkeyp, /* from the knownhosts file */ - &foundkey, /* from the remote host */ + &foundkey, /* from the remote host */ keymatch, data->set.ssh_keyfunc_userp); Curl_set_in_callback(data, FALSE); @@ -519,8 +516,7 @@ static int myssh_to_SFTP_CLOSE(struct Curl_easy *data, struct ssh_conn *sshc) { myssh_to(data, sshc, SSH_SFTP_CLOSE); - sshc->actualcode = - sftp_error_to_CURLE(sftp_get_error(sshc->sftp_session)); + sshc->actualcode = sftp_error_to_CURLE(sftp_get_error(sshc->sftp_session)); return SSH_ERROR; } @@ -613,7 +609,6 @@ static int myssh_in_SFTP_READDIR(struct Curl_easy *data, sshc->actualcode = result; return SSH_NO_ERROR; } - } else { if(curlx_dyn_add(&sshc->readdir_buf, sshc->readdir_longentry)) { @@ -684,8 +679,7 @@ static int myssh_in_SFTP_READDIR_LINK(struct Curl_easy *data, Curl_safefree(sshc->readdir_linkPath); - if(curlx_dyn_addf(&sshc->readdir_buf, " -> %s", - sshc->readdir_filename)) { + if(curlx_dyn_addf(&sshc->readdir_buf, " -> %s", sshc->readdir_filename)) { /* Not using: * return myssh_to_SFTP_CLOSE(data, sshc); * @@ -808,56 +802,56 @@ static int myssh_auth_interactive(struct connectdata *conn, restart: switch(sshc->kbd_state) { - case 0: - rc = ssh_userauth_kbdint(sshc->ssh_session, NULL, NULL); - if(rc == SSH_AUTH_AGAIN) - return SSH_AGAIN; + case 0: + rc = ssh_userauth_kbdint(sshc->ssh_session, NULL, NULL); + if(rc == SSH_AUTH_AGAIN) + return SSH_AGAIN; - if(rc != SSH_AUTH_INFO) - return SSH_ERROR; + if(rc != SSH_AUTH_INFO) + return SSH_ERROR; - nprompts = ssh_userauth_kbdint_getnprompts(sshc->ssh_session); - if(nprompts != 1) - return SSH_ERROR; + nprompts = ssh_userauth_kbdint_getnprompts(sshc->ssh_session); + if(nprompts != 1) + return SSH_ERROR; - rc = ssh_userauth_kbdint_setanswer(sshc->ssh_session, 0, conn->passwd); - if(rc < 0) - return SSH_ERROR; + rc = ssh_userauth_kbdint_setanswer(sshc->ssh_session, 0, conn->passwd); + if(rc < 0) + return SSH_ERROR; - FALLTHROUGH(); - case 1: - sshc->kbd_state = 1; + FALLTHROUGH(); + case 1: + sshc->kbd_state = 1; - rc = ssh_userauth_kbdint(sshc->ssh_session, NULL, NULL); - if(rc == SSH_AUTH_AGAIN) - return SSH_AGAIN; - else if(rc == SSH_AUTH_SUCCESS) - rc = SSH_OK; - else if(rc == SSH_AUTH_INFO) { - nprompts = ssh_userauth_kbdint_getnprompts(sshc->ssh_session); - if(nprompts) - return SSH_ERROR; + rc = ssh_userauth_kbdint(sshc->ssh_session, NULL, NULL); + if(rc == SSH_AUTH_AGAIN) + return SSH_AGAIN; + else if(rc == SSH_AUTH_SUCCESS) + rc = SSH_OK; + else if(rc == SSH_AUTH_INFO) { + nprompts = ssh_userauth_kbdint_getnprompts(sshc->ssh_session); + if(nprompts) + return SSH_ERROR; - sshc->kbd_state = 2; - goto restart; - } - else - rc = SSH_ERROR; - break; - case 2: sshc->kbd_state = 2; + goto restart; + } + else + rc = SSH_ERROR; + break; + case 2: + sshc->kbd_state = 2; - rc = ssh_userauth_kbdint(sshc->ssh_session, NULL, NULL); - if(rc == SSH_AUTH_AGAIN) - return SSH_AGAIN; - else if(rc == SSH_AUTH_SUCCESS) - rc = SSH_OK; - else - rc = SSH_ERROR; + rc = ssh_userauth_kbdint(sshc->ssh_session, NULL, NULL); + if(rc == SSH_AUTH_AGAIN) + return SSH_AGAIN; + else if(rc == SSH_AUTH_SUCCESS) + rc = SSH_OK; + else + rc = SSH_ERROR; - break; - default: - return SSH_ERROR; + break; + default: + return SSH_ERROR; } sshc->kbd_state = 0; @@ -967,8 +961,7 @@ static int myssh_in_AUTH_PKEY_INIT(struct Curl_easy *data, * (2) use the "default" keys. */ if(data->set.str[STRING_SSH_PRIVATE_KEY]) { if(sshc->pubkey && !data->set.ssl.key_passwd) { - rc = ssh_userauth_try_publickey(sshc->ssh_session, NULL, - sshc->pubkey); + rc = ssh_userauth_try_publickey(sshc->ssh_session, NULL, sshc->pubkey); if(rc == SSH_AUTH_AGAIN) return SSH_AGAIN; @@ -993,7 +986,7 @@ static int myssh_in_AUTH_PKEY_INIT(struct Curl_easy *data, } else { rc = ssh_userauth_publickey_auto(sshc->ssh_session, NULL, - data->set.ssl.key_passwd); + data->set.ssl.key_passwd); if(rc == SSH_AUTH_AGAIN) return SSH_AGAIN; @@ -1166,7 +1159,7 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data, } else /* Clear file before writing (normal behavior) */ - flags = O_WRONLY|O_CREAT|O_TRUNC; + flags = O_WRONLY | O_CREAT | O_TRUNC; if(sshc->sftp_file) sftp_close(sshc->sftp_file); @@ -1214,7 +1207,7 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data, } /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { - char scratch[4*1024]; + char scratch[4 * 1024]; size_t readthisamountnow = (data->state.resume_from - passed > (curl_off_t)sizeof(scratch)) ? @@ -1363,8 +1356,7 @@ static int myssh_in_SFTP_DOWNLOAD_STAT(struct Curl_easy *data, /* Now store the number of bytes we are expected to download */ data->req.size = size - data->state.resume_from; data->req.maxdownload = size - data->state.resume_from; - Curl_pgrsSetDownloadSize(data, - size - data->state.resume_from); + Curl_pgrsSetDownloadSize(data, size - data->state.resume_from); rc = sftp_seek64(sshc->sftp_file, data->state.resume_from); if(rc) @@ -1877,8 +1869,7 @@ static void conn_forget_socket(struct Curl_easy *data, int sockindex) if(conn && CONN_SOCK_IDX_VALID(sockindex)) { struct Curl_cfilter *cf = conn->cfilter[sockindex]; if(cf) - (void)Curl_conn_cf_cntrl(cf, data, TRUE, - CF_CTRL_FORGET_SOCKET, 0, NULL); + (void)Curl_conn_cf_cntrl(cf, data, TRUE, CF_CTRL_FORGET_SOCKET, 0, NULL); fake_sclose(conn->sock[sockindex]); conn->sock[sockindex] = CURL_SOCKET_BAD; } @@ -2067,8 +2058,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, break; if(rc && !sshc->acceptfail) { Curl_safefree(sshc->quote_path1); - failf(data, "rm command failed: %s", - ssh_get_error(sshc->ssh_session)); + failf(data, "rm command failed: %s", ssh_get_error(sshc->ssh_session)); myssh_to(data, sshc, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; @@ -2110,7 +2100,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, if(data->state.upload) myssh_to(data, sshc, SSH_SFTP_UPLOAD_INIT); else if(sshp) { - if(sshp->path[strlen(sshp->path)-1] == '/') + if(sshp->path[strlen(sshp->path) - 1] == '/') myssh_to(data, sshc, SSH_SFTP_READDIR_INIT); else myssh_to(data, sshc, SSH_SFTP_DOWNLOAD_INIT); @@ -2301,26 +2291,26 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, FALLTHROUGH(); case SSH_SCP_DOWNLOAD: { - curl_off_t bytecount; + curl_off_t bytecount; - rc = ssh_scp_pull_request(sshc->scp_session); - if(rc != SSH_SCP_REQUEST_NEWFILE) { - err_msg = ssh_get_error(sshc->ssh_session); - failf(data, "%s", err_msg); - rc = myssh_to_ERROR(data, sshc, CURLE_REMOTE_FILE_NOT_FOUND); - break; - } + rc = ssh_scp_pull_request(sshc->scp_session); + if(rc != SSH_SCP_REQUEST_NEWFILE) { + err_msg = ssh_get_error(sshc->ssh_session); + failf(data, "%s", err_msg); + rc = myssh_to_ERROR(data, sshc, CURLE_REMOTE_FILE_NOT_FOUND); + break; + } - /* download data */ - bytecount = ssh_scp_request_get_size(sshc->scp_session); - data->req.maxdownload = (curl_off_t) bytecount; - Curl_xfer_setup_recv(data, FIRSTSOCKET, bytecount); + /* download data */ + bytecount = ssh_scp_request_get_size(sshc->scp_session); + data->req.maxdownload = (curl_off_t)bytecount; + Curl_xfer_setup_recv(data, FIRSTSOCKET, bytecount); - /* not set by Curl_xfer_setup to preserve keepon bits */ - conn->send_idx = 0; + /* not set by Curl_xfer_setup to preserve keepon bits */ + conn->send_idx = 0; - myssh_to(data, sshc, SSH_STOP); - break; + myssh_to(data, sshc, SSH_STOP); + break; } case SSH_SCP_DONE: if(data->state.upload) @@ -2406,7 +2396,6 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, sshc->nextstate = SSH_NO_STATE; myssh_to(data, sshc, SSH_STOP); break; - } /* break the loop only on STOP or SSH_AGAIN. If `rc` is some * other error code, we will have progressed the state accordingly. */ @@ -2424,7 +2413,6 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, return result; } - /* called by the multi interface to figure out what socket(s) to wait for and for what actions in the DO_DONE, PERFORM and WAITPERFORM states */ static CURLcode myssh_pollset(struct Curl_easy *data, @@ -2525,7 +2513,6 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, CURL_SOCKET_BAD, left_ms > 1000 ? 1000 : left_ms); } - } return result; @@ -2717,9 +2704,8 @@ static CURLcode scp_doing(struct Curl_easy *data, bool *dophase_done) * the options previously setup. */ -static -CURLcode scp_perform(struct Curl_easy *data, - bool *connected, bool *dophase_done) +static CURLcode scp_perform(struct Curl_easy *data, + bool *connected, bool *dophase_done) { CURLcode result = CURLE_OK; struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); @@ -2871,7 +2857,6 @@ static CURLcode myssh_done(struct Curl_easy *data, return result; } - static CURLcode scp_done(struct Curl_easy *data, CURLcode status, bool premature) { @@ -2963,10 +2948,9 @@ static CURLcode scp_recv(struct Curl_easy *data, int sockindex, * the options previously setup. */ -static -CURLcode sftp_perform(struct Curl_easy *data, - bool *connected, - bool *dophase_done) +static CURLcode sftp_perform(struct Curl_easy *data, + bool *connected, + bool *dophase_done) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); CURLcode result = CURLE_OK; @@ -3064,34 +3048,34 @@ static CURLcode sftp_send(struct Curl_easy *data, int sockindex, #if LIBSSH_VERSION_INT > SSH_VERSION_INT(0, 11, 0) switch(sshc->sftp_send_state) { - case 0: - sftp_file_set_nonblocking(sshc->sftp_file); - if(sftp_aio_begin_write(sshc->sftp_file, mem, len, - &sshc->sftp_send_aio) == SSH_ERROR) { - return CURLE_SEND_ERROR; - } - sshc->sftp_send_state = 1; - FALLTHROUGH(); - case 1: - nwrite = sftp_aio_wait_write(&sshc->sftp_send_aio); - myssh_block2waitfor(conn, sshc, (nwrite == SSH_AGAIN) ? TRUE : FALSE); - if(nwrite == SSH_AGAIN) - return CURLE_AGAIN; - else if(nwrite < 0) - return CURLE_SEND_ERROR; - - /* - * sftp_aio_wait_write() would free sftp_send_aio and - * assign it NULL in all cases except when it returns - * SSH_AGAIN. - */ - - sshc->sftp_send_state = 0; - *pnwritten = (size_t)nwrite; - return CURLE_OK; - default: - /* we never reach here */ + case 0: + sftp_file_set_nonblocking(sshc->sftp_file); + if(sftp_aio_begin_write(sshc->sftp_file, mem, len, + &sshc->sftp_send_aio) == SSH_ERROR) { return CURLE_SEND_ERROR; + } + sshc->sftp_send_state = 1; + FALLTHROUGH(); + case 1: + nwrite = sftp_aio_wait_write(&sshc->sftp_send_aio); + myssh_block2waitfor(conn, sshc, (nwrite == SSH_AGAIN) ? TRUE : FALSE); + if(nwrite == SSH_AGAIN) + return CURLE_AGAIN; + else if(nwrite < 0) + return CURLE_SEND_ERROR; + + /* + * sftp_aio_wait_write() would free sftp_send_aio and + * assign it NULL in all cases except when it returns + * SSH_AGAIN. + */ + + sshc->sftp_send_state = 0; + *pnwritten = (size_t)nwrite; + return CURLE_OK; + default: + /* we never reach here */ + return CURLE_SEND_ERROR; } #else /* @@ -3143,54 +3127,53 @@ static CURLcode sftp_recv(struct Curl_easy *data, int sockindex, return CURLE_FAILED_INIT; switch(sshc->sftp_recv_state) { - case 0: + case 0: #if LIBSSH_VERSION_INT > SSH_VERSION_INT(0, 11, 0) - if(sftp_aio_begin_read(sshc->sftp_file, len, - &sshc->sftp_recv_aio) == SSH_ERROR) { - return CURLE_RECV_ERROR; - } + if(sftp_aio_begin_read(sshc->sftp_file, len, + &sshc->sftp_recv_aio) == SSH_ERROR) { + return CURLE_RECV_ERROR; + } #else - sshc->sftp_file_index = - sftp_async_read_begin(sshc->sftp_file, (uint32_t)len); - if(sshc->sftp_file_index < 0) - return CURLE_RECV_ERROR; + sshc->sftp_file_index = + sftp_async_read_begin(sshc->sftp_file, (uint32_t)len); + if(sshc->sftp_file_index < 0) + return CURLE_RECV_ERROR; #endif - FALLTHROUGH(); - case 1: - sshc->sftp_recv_state = 1; + FALLTHROUGH(); + case 1: + sshc->sftp_recv_state = 1; #if LIBSSH_VERSION_INT > SSH_VERSION_INT(0, 11, 0) - nread = sftp_aio_wait_read(&sshc->sftp_recv_aio, mem, len); + nread = sftp_aio_wait_read(&sshc->sftp_recv_aio, mem, len); #else - nread = sftp_async_read(sshc->sftp_file, mem, (uint32_t)len, - (uint32_t)sshc->sftp_file_index); + nread = sftp_async_read(sshc->sftp_file, mem, (uint32_t)len, + (uint32_t)sshc->sftp_file_index); #endif - myssh_block2waitfor(conn, sshc, (nread == SSH_AGAIN)); + myssh_block2waitfor(conn, sshc, (nread == SSH_AGAIN)); - if(nread == SSH_AGAIN) - return CURLE_AGAIN; - else if(nread < 0) - return CURLE_RECV_ERROR; + if(nread == SSH_AGAIN) + return CURLE_AGAIN; + else if(nread < 0) + return CURLE_RECV_ERROR; - /* - * sftp_aio_wait_read() would free sftp_recv_aio and - * assign it NULL in all cases except when it returns - * SSH_AGAIN. - */ + /* + * sftp_aio_wait_read() would free sftp_recv_aio and + * assign it NULL in all cases except when it returns + * SSH_AGAIN. + */ - sshc->sftp_recv_state = 0; - *pnread = (size_t)nread; - return CURLE_OK; + sshc->sftp_recv_state = 0; + *pnread = (size_t)nread; + return CURLE_OK; - default: - /* we never reach here */ - return CURLE_RECV_ERROR; + default: + /* we never reach here */ + return CURLE_RECV_ERROR; } } - CURLcode Curl_ssh_init(void) { if(ssh_init()) { @@ -3210,4 +3193,4 @@ void Curl_ssh_version(char *buffer, size_t buflen) (void)curl_msnprintf(buffer, buflen, "libssh/%s", ssh_version(0)); } -#endif /* USE_LIBSSH */ +#endif /* USE_LIBSSH */ diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index ce593d54874a..8701775d7d94 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -154,12 +154,12 @@ const struct Curl_handler Curl_handler_sftp = { PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE }; -static void -kbd_callback(const char *name, int name_len, const char *instruction, - int instruction_len, int num_prompts, - const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts, - LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, - void **abstract) +static void kbd_callback(const char *name, int name_len, + const char *instruction, int instruction_len, + int num_prompts, + const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts, + LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, + void **abstract) { struct Curl_easy *data = (struct Curl_easy *)*abstract; @@ -187,30 +187,30 @@ kbd_callback(const char *name, int name_len, const char *instruction, static CURLcode sftp_libssh2_error_to_CURLE(unsigned long err) { switch(err) { - case LIBSSH2_FX_OK: - return CURLE_OK; + case LIBSSH2_FX_OK: + return CURLE_OK; - case LIBSSH2_FX_NO_SUCH_FILE: - case LIBSSH2_FX_NO_SUCH_PATH: - return CURLE_REMOTE_FILE_NOT_FOUND; + case LIBSSH2_FX_NO_SUCH_FILE: + case LIBSSH2_FX_NO_SUCH_PATH: + return CURLE_REMOTE_FILE_NOT_FOUND; - case LIBSSH2_FX_PERMISSION_DENIED: - case LIBSSH2_FX_WRITE_PROTECT: - case LIBSSH2_FX_LOCK_CONFlICT: - return CURLE_REMOTE_ACCESS_DENIED; + case LIBSSH2_FX_PERMISSION_DENIED: + case LIBSSH2_FX_WRITE_PROTECT: + case LIBSSH2_FX_LOCK_CONFlICT: + return CURLE_REMOTE_ACCESS_DENIED; - case LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM: - case LIBSSH2_FX_QUOTA_EXCEEDED: - return CURLE_REMOTE_DISK_FULL; + case LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM: + case LIBSSH2_FX_QUOTA_EXCEEDED: + return CURLE_REMOTE_DISK_FULL; - case LIBSSH2_FX_FILE_ALREADY_EXISTS: - return CURLE_REMOTE_FILE_EXISTS; + case LIBSSH2_FX_FILE_ALREADY_EXISTS: + return CURLE_REMOTE_FILE_EXISTS; - case LIBSSH2_FX_DIR_NOT_EMPTY: - return CURLE_QUOTE_ERROR; + case LIBSSH2_FX_DIR_NOT_EMPTY: + return CURLE_QUOTE_ERROR; - default: - break; + default: + break; } return CURLE_SSH; @@ -219,39 +219,39 @@ static CURLcode sftp_libssh2_error_to_CURLE(unsigned long err) static CURLcode libssh2_session_error_to_CURLE(int err) { switch(err) { - /* Ordered by order of appearance in libssh2.h */ - case LIBSSH2_ERROR_NONE: - return CURLE_OK; + /* Ordered by order of appearance in libssh2.h */ + case LIBSSH2_ERROR_NONE: + return CURLE_OK; - /* This is the error returned by libssh2_scp_recv2 - * on unknown file */ - case LIBSSH2_ERROR_SCP_PROTOCOL: - return CURLE_REMOTE_FILE_NOT_FOUND; + /* This is the error returned by libssh2_scp_recv2 + * on unknown file */ + case LIBSSH2_ERROR_SCP_PROTOCOL: + return CURLE_REMOTE_FILE_NOT_FOUND; - case LIBSSH2_ERROR_SOCKET_NONE: - return CURLE_COULDNT_CONNECT; + case LIBSSH2_ERROR_SOCKET_NONE: + return CURLE_COULDNT_CONNECT; - case LIBSSH2_ERROR_ALLOC: - return CURLE_OUT_OF_MEMORY; + case LIBSSH2_ERROR_ALLOC: + return CURLE_OUT_OF_MEMORY; - case LIBSSH2_ERROR_SOCKET_SEND: - return CURLE_SEND_ERROR; + case LIBSSH2_ERROR_SOCKET_SEND: + return CURLE_SEND_ERROR; - case LIBSSH2_ERROR_HOSTKEY_INIT: - case LIBSSH2_ERROR_HOSTKEY_SIGN: - case LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: - case LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED: - return CURLE_PEER_FAILED_VERIFICATION; + case LIBSSH2_ERROR_HOSTKEY_INIT: + case LIBSSH2_ERROR_HOSTKEY_SIGN: + case LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: + case LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED: + return CURLE_PEER_FAILED_VERIFICATION; - case LIBSSH2_ERROR_PASSWORD_EXPIRED: - return CURLE_LOGIN_DENIED; + case LIBSSH2_ERROR_PASSWORD_EXPIRED: + return CURLE_LOGIN_DENIED; - case LIBSSH2_ERROR_SOCKET_TIMEOUT: - case LIBSSH2_ERROR_TIMEOUT: - return CURLE_OPERATION_TIMEDOUT; + case LIBSSH2_ERROR_SOCKET_TIMEOUT: + case LIBSSH2_ERROR_TIMEOUT: + return CURLE_OPERATION_TIMEDOUT; - case LIBSSH2_ERROR_EAGAIN: - return CURLE_AGAIN; + case LIBSSH2_ERROR_EAGAIN: + return CURLE_AGAIN; } return CURLE_SSH; @@ -283,7 +283,7 @@ static LIBSSH2_FREE_FUNC(my_libssh2_free) #if !defined(CURL_DISABLE_VERBOSE_STRINGS) static const char *myssh_statename(sshstate state) { - static const char *const names[] = { + static const char * const names[] = { "SSH_STOP", "SSH_INIT", "SSH_S_STARTUP", @@ -354,7 +354,7 @@ static const char *myssh_statename(sshstate state) #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ -#define myssh_state(x,y,z) myssh_set_state(x,y,z) +#define myssh_state(x, y, z) myssh_set_state(x, y, z) /* * SSH State machine related code @@ -663,7 +663,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data, /* The fingerprint points to static storage (!), do not free() it. */ int i; for(i = 0; i < 16; i++) { - curl_msnprintf(&md5buffer[i*2], 3, "%02x", + curl_msnprintf(&md5buffer[i * 2], 3, "%02x", (unsigned char)fingerprint[i]); } @@ -703,7 +703,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data, rc = data->set.ssh_hostkeyfunc(data->set.ssh_hostkeyfunc_userp, (int)keytype, remotekey, keylen); Curl_set_in_callback(data, FALSE); - if(rc!= CURLKHMATCH_OK) { + if(rc != CURLKHMATCH_OK) { myssh_state(data, sshc, SSH_SESSION_FREE); return CURLE_PEER_FAILED_VERIFICATION; } @@ -1009,11 +1009,10 @@ static CURLcode sftp_quote(struct Curl_easy *data, return CURLE_QUOTE_ERROR; } -static CURLcode -sftp_upload_init(struct Curl_easy *data, - struct ssh_conn *sshc, - struct SSHPROTO *sshp, - bool *blockp) +static CURLcode sftp_upload_init(struct Curl_easy *data, + struct ssh_conn *sshc, + struct SSHPROTO *sshp, + bool *blockp) { unsigned long flags; @@ -1140,7 +1139,7 @@ sftp_upload_init(struct Curl_easy *data, } /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { - char scratch[4*1024]; + char scratch[4 * 1024]; size_t readthisamountnow = (data->state.resume_from - passed > (curl_off_t)sizeof(scratch)) ? @@ -1283,11 +1282,10 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, return 0; } -static CURLcode -sftp_quote_stat(struct Curl_easy *data, - struct ssh_conn *sshc, - struct SSHPROTO *sshp, - bool *blockp) +static CURLcode sftp_quote_stat(struct Curl_easy *data, + struct ssh_conn *sshc, + struct SSHPROTO *sshp, + bool *blockp) { char *cmd = sshc->quote_item->data; sshc->acceptfail = FALSE; @@ -1395,11 +1393,10 @@ sftp_quote_stat(struct Curl_easy *data, return CURLE_QUOTE_ERROR; } -static CURLcode -sftp_download_stat(struct Curl_easy *data, - struct ssh_conn *sshc, - struct SSHPROTO *sshp, - bool *blockp) +static CURLcode sftp_download_stat(struct Curl_easy *data, + struct ssh_conn *sshc, + struct SSHPROTO *sshp, + bool *blockp) { LIBSSH2_SFTP_ATTRIBUTES attrs; int rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, @@ -1468,8 +1465,7 @@ sftp_download_stat(struct Curl_easy *data, /* Now store the number of bytes we are expected to download */ data->req.size = attrs.filesize - data->state.resume_from; data->req.maxdownload = attrs.filesize - data->state.resume_from; - Curl_pgrsSetDownloadSize(data, - attrs.filesize - data->state.resume_from); + Curl_pgrsSetDownloadSize(data, attrs.filesize - data->state.resume_from); libssh2_sftp_seek64(sshc->sftp_handle, (libssh2_uint64_t)data->state.resume_from); } @@ -1507,7 +1503,7 @@ static CURLcode sftp_readdir(struct Curl_easy *data, return result; } if(rc > 0) { - size_t readdir_len = (size_t) rc; + size_t readdir_len = (size_t)rc; sshp->readdir_filename[readdir_len] = '\0'; if(data->set.list_only) { @@ -1639,8 +1635,7 @@ static CURLcode ssh_state_authlist(struct Curl_easy *data, myssh_state(data, sshc, SSH_SESSION_FREE); return libssh2_session_error_to_CURLE(rc); } - infof(data, "SSH authentication methods available: %s", - sshc->authlist); + infof(data, "SSH authentication methods available: %s", sshc->authlist); myssh_state(data, sshc, SSH_AUTH_PKEY_INIT); return CURLE_OK; @@ -1679,8 +1674,7 @@ static CURLcode ssh_state_auth_pkey(struct Curl_easy *data, err_msg = unknown; } else { - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); } infof(data, "SSH public key authentication failed: %s", err_msg); myssh_state(data, sshc, SSH_AUTH_PASS_INIT); @@ -1742,8 +1736,8 @@ static CURLcode ssh_state_auth_agent_init(struct Curl_easy *data, struct ssh_conn *sshc) { int rc = 0; - if((data->set.ssh_auth_types & CURLSSH_AUTH_AGENT) - && (strstr(sshc->authlist, "publickey") != NULL)) { + if((data->set.ssh_auth_types & CURLSSH_AUTH_AGENT) && + (strstr(sshc->authlist, "publickey") != NULL)) { /* Connect to the ssh-agent */ /* The agent could be shared by a curl thread i believe @@ -1838,8 +1832,8 @@ static CURLcode ssh_state_auth_agent(struct Curl_easy *data, static CURLcode ssh_state_auth_key_init(struct Curl_easy *data, struct ssh_conn *sshc) { - if((data->set.ssh_auth_types & CURLSSH_AUTH_KEYBOARD) - && (strstr(sshc->authlist, "keyboard-interactive") != NULL)) { + if((data->set.ssh_auth_types & CURLSSH_AUTH_KEYBOARD) && + (strstr(sshc->authlist, "keyboard-interactive") != NULL)) { myssh_state(data, sshc, SSH_AUTH_KEY); } else { @@ -1913,8 +1907,7 @@ static CURLcode ssh_state_sftp_init(struct Curl_easy *data, LIBSSH2_ERROR_EAGAIN) return CURLE_AGAIN; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); failf(data, "Failure initializing sftp session: %s", err_msg); myssh_state(data, sshc, SSH_SESSION_FREE); return CURLE_FAILED_INIT; @@ -2384,8 +2377,7 @@ static CURLcode ssh_state_scp_download_init(struct Curl_easy *data, LIBSSH2_ERROR_EAGAIN) return CURLE_AGAIN; - ssh_err = (int)(libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0)); + ssh_err = libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); failf(data, "%s", err_msg); myssh_state(data, sshc, SSH_SCP_CHANNEL_FREE); return libssh2_session_error_to_CURLE(ssh_err); @@ -2415,8 +2407,7 @@ static CURLcode ssh_state_sftp_close(struct Curl_easy *data, if(rc < 0) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to close libssh2 file: %d %s", rc, err_msg); } sshc->sftp_handle = NULL; @@ -2454,8 +2445,7 @@ static CURLcode ssh_state_sftp_shutdown(struct Curl_easy *data, if(rc < 0) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, - NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to close libssh2 file: %d %s", rc, err_msg); } sshc->sftp_handle = NULL; @@ -2527,8 +2517,7 @@ static CURLcode ssh_state_scp_upload_init(struct Curl_easy *data, LIBSSH2_ERROR_EAGAIN) return CURLE_AGAIN; - ssh_err = (int)(libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0)); + ssh_err = libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); failf(data, "%s", err_msg); myssh_state(data, sshc, SSH_SCP_CHANNEL_FREE); result = libssh2_session_error_to_CURLE(ssh_err); @@ -2567,10 +2556,8 @@ static CURLcode ssh_state_session_disconnect(struct Curl_easy *data, if(rc < 0) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); - infof(data, "Failed to free libssh2 scp subsystem: %d %s", - rc, err_msg); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); + infof(data, "Failed to free libssh2 scp subsystem: %d %s", rc, err_msg); } sshc->ssh_channel = NULL; } @@ -2582,10 +2569,8 @@ static CURLcode ssh_state_session_disconnect(struct Curl_easy *data, if(rc < 0) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); - infof(data, "Failed to disconnect libssh2 session: %d %s", - rc, err_msg); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); + infof(data, "Failed to disconnect libssh2 session: %d %s", rc, err_msg); } } @@ -2750,8 +2735,7 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, } break; - case SSH_SFTP_FILETIME: - { + case SSH_SFTP_FILETIME: { LIBSSH2_SFTP_ATTRIBUTES attrs; int rc; @@ -2778,7 +2762,7 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, if(data->state.upload) myssh_state(data, sshc, SSH_SFTP_UPLOAD_INIT); else if(sshp) { - if(sshp->path[strlen(sshp->path)-1] == '/') + if(sshp->path[strlen(sshp->path) - 1] == '/') myssh_state(data, sshc, SSH_SFTP_READDIR_INIT); else myssh_state(data, sshc, SSH_SFTP_DOWNLOAD_INIT); @@ -3097,8 +3081,8 @@ static void ssh_block2waitfor(struct Curl_easy *data, dir = libssh2_session_block_directions(sshc->ssh_session); if(dir) { /* translate the libssh2 define bits into our own bit defines */ - sshc->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND) ? KEEP_RECV : 0) | - ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND) ? KEEP_SEND : 0); + sshc->waitfor = ((dir & LIBSSH2_SESSION_BLOCK_INBOUND) ? KEEP_RECV : 0) | + ((dir & LIBSSH2_SESSION_BLOCK_OUTBOUND) ? KEEP_SEND : 0); } } if(!dir) @@ -3308,24 +3292,24 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done) { const char *crypto_str; switch(libssh2_crypto_engine()) { - case libssh2_gcrypt: - crypto_str = "libgcrypt"; - break; - case libssh2_mbedtls: - crypto_str = "mbedTLS"; - break; - case libssh2_openssl: - crypto_str = "openssl compatible"; - break; - case libssh2_os400qc3: - crypto_str = "OS400QC3"; - break; - case libssh2_wincng: - crypto_str = "WinCNG"; - break; - default: - crypto_str = NULL; - break; + case libssh2_gcrypt: + crypto_str = "libgcrypt"; + break; + case libssh2_mbedtls: + crypto_str = "mbedTLS"; + break; + case libssh2_openssl: + crypto_str = "openssl compatible"; + break; + case libssh2_os400qc3: + crypto_str = "OS400QC3"; + break; + case libssh2_wincng: + crypto_str = "WinCNG"; + break; + default: + crypto_str = NULL; + break; } if(crypto_str) infof(data, "libssh2 cryptography backend: %s", crypto_str); @@ -3476,10 +3460,9 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done) * the options previously setup. */ -static -CURLcode scp_perform(struct Curl_easy *data, - bool *connected, - bool *dophase_done) +static CURLcode scp_perform(struct Curl_easy *data, + bool *connected, + bool *dophase_done) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); CURLcode result = CURLE_OK; @@ -3562,8 +3545,7 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, rc = libssh2_agent_disconnect(sshc->ssh_agent); if((rc < 0) && data) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to disconnect from libssh2 agent: %d %s", rc, err_msg); } @@ -3583,8 +3565,7 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, rc = libssh2_sftp_close(sshc->sftp_handle); if((rc < 0) && data) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, - NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to close libssh2 file: %d %s", rc, err_msg); } if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) @@ -3597,10 +3578,8 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, rc = libssh2_channel_free(sshc->ssh_channel); if((rc < 0) && data) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); - infof(data, "Failed to free libssh2 scp subsystem: %d %s", - rc, err_msg); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); + infof(data, "Failed to free libssh2 scp subsystem: %d %s", rc, err_msg); } if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) return CURLE_AGAIN; @@ -3612,8 +3591,7 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, rc = libssh2_sftp_shutdown(sshc->sftp_session); if((rc < 0) && data) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to stop libssh2 sftp subsystem: %d %s", rc, err_msg); } if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) @@ -3626,8 +3604,7 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, rc = libssh2_session_free(sshc->ssh_session); if((rc < 0) && data) { char *err_msg = NULL; - (void)libssh2_session_last_error(sshc->ssh_session, - &err_msg, NULL, 0); + (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "Failed to free libssh2 session: %d %s", rc, err_msg); } if(!block && (rc == LIBSSH2_ERROR_EAGAIN)) @@ -3653,7 +3630,6 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data, return CURLE_OK; } - /* BLOCKING, but the function is using the state machine so the only reason this is still blocking is that the multi interface code has no support for disconnecting operations that takes a while */ @@ -3701,7 +3677,6 @@ static CURLcode ssh_done(struct Curl_easy *data, CURLcode status) return result; } - static CURLcode scp_done(struct Curl_easy *data, CURLcode status, bool premature) { @@ -3731,8 +3706,8 @@ static CURLcode scp_send(struct Curl_easy *data, int sockindex, return CURLE_FAILED_INIT; /* libssh2_channel_write() returns int! */ - nwritten = (ssize_t) libssh2_channel_write(sshc->ssh_channel, - (const char *)mem, len); + nwritten = (ssize_t)libssh2_channel_write(sshc->ssh_channel, + (const char *)mem, len); ssh_block2waitfor(data, sshc, (nwritten == LIBSSH2_ERROR_EAGAIN)); @@ -3761,7 +3736,7 @@ static CURLcode scp_recv(struct Curl_easy *data, int sockindex, return CURLE_FAILED_INIT; /* libssh2_channel_read() returns int */ - nread = (ssize_t) libssh2_channel_read(sshc->ssh_channel, mem, len); + nread = (ssize_t)libssh2_channel_read(sshc->ssh_channel, mem, len); ssh_block2waitfor(data, sshc, (nread == LIBSSH2_ERROR_EAGAIN)); if(nread == LIBSSH2_ERROR_EAGAIN) @@ -3787,10 +3762,9 @@ static CURLcode scp_recv(struct Curl_easy *data, int sockindex, * the options previously setup. */ -static -CURLcode sftp_perform(struct Curl_easy *data, - bool *connected, - bool *dophase_done) +static CURLcode sftp_perform(struct Curl_easy *data, + bool *connected, + bool *dophase_done) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); CURLcode result = CURLE_OK; @@ -3850,7 +3824,6 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, sshc_cleanup(sshc, data, TRUE); } return result; - } static CURLcode sftp_done(struct Curl_easy *data, CURLcode status, @@ -3934,65 +3907,65 @@ static CURLcode sftp_recv(struct Curl_easy *data, int sockindex, static const char *sftp_libssh2_strerror(unsigned long err) { switch(err) { - case LIBSSH2_FX_NO_SUCH_FILE: - return "No such file or directory"; + case LIBSSH2_FX_NO_SUCH_FILE: + return "No such file or directory"; - case LIBSSH2_FX_PERMISSION_DENIED: - return "Permission denied"; + case LIBSSH2_FX_PERMISSION_DENIED: + return "Permission denied"; - case LIBSSH2_FX_FAILURE: - return "Operation failed"; + case LIBSSH2_FX_FAILURE: + return "Operation failed"; - case LIBSSH2_FX_BAD_MESSAGE: - return "Bad message from SFTP server"; + case LIBSSH2_FX_BAD_MESSAGE: + return "Bad message from SFTP server"; - case LIBSSH2_FX_NO_CONNECTION: - return "Not connected to SFTP server"; + case LIBSSH2_FX_NO_CONNECTION: + return "Not connected to SFTP server"; - case LIBSSH2_FX_CONNECTION_LOST: - return "Connection to SFTP server lost"; + case LIBSSH2_FX_CONNECTION_LOST: + return "Connection to SFTP server lost"; - case LIBSSH2_FX_OP_UNSUPPORTED: - return "Operation not supported by SFTP server"; + case LIBSSH2_FX_OP_UNSUPPORTED: + return "Operation not supported by SFTP server"; - case LIBSSH2_FX_INVALID_HANDLE: - return "Invalid handle"; + case LIBSSH2_FX_INVALID_HANDLE: + return "Invalid handle"; - case LIBSSH2_FX_NO_SUCH_PATH: - return "No such file or directory"; + case LIBSSH2_FX_NO_SUCH_PATH: + return "No such file or directory"; - case LIBSSH2_FX_FILE_ALREADY_EXISTS: - return "File already exists"; + case LIBSSH2_FX_FILE_ALREADY_EXISTS: + return "File already exists"; - case LIBSSH2_FX_WRITE_PROTECT: - return "File is write protected"; + case LIBSSH2_FX_WRITE_PROTECT: + return "File is write protected"; - case LIBSSH2_FX_NO_MEDIA: - return "No media"; + case LIBSSH2_FX_NO_MEDIA: + return "No media"; - case LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM: - return "Disk full"; + case LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM: + return "Disk full"; - case LIBSSH2_FX_QUOTA_EXCEEDED: - return "User quota exceeded"; + case LIBSSH2_FX_QUOTA_EXCEEDED: + return "User quota exceeded"; - case LIBSSH2_FX_UNKNOWN_PRINCIPLE: - return "Unknown principle"; + case LIBSSH2_FX_UNKNOWN_PRINCIPLE: + return "Unknown principle"; - case LIBSSH2_FX_LOCK_CONFlICT: - return "File lock conflict"; + case LIBSSH2_FX_LOCK_CONFlICT: + return "File lock conflict"; - case LIBSSH2_FX_DIR_NOT_EMPTY: - return "Directory not empty"; + case LIBSSH2_FX_DIR_NOT_EMPTY: + return "Directory not empty"; - case LIBSSH2_FX_NOT_A_DIRECTORY: - return "Not a directory"; + case LIBSSH2_FX_NOT_A_DIRECTORY: + return "Not a directory"; - case LIBSSH2_FX_INVALID_FILENAME: - return "Invalid filename"; + case LIBSSH2_FX_INVALID_FILENAME: + return "Invalid filename"; - case LIBSSH2_FX_LINK_LOOP: - return "Link points to itself"; + case LIBSSH2_FX_LINK_LOOP: + return "Link points to itself"; } return "Unknown error in libssh2"; } diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 92ae72a6a761..ad0875f19143 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -217,7 +217,7 @@ struct ssh_conn { #ifdef USE_LIBSSH #if LIBSSH_VERSION_INT < SSH_VERSION_INT(0, 9, 0) -# error "SCP/SFTP protocols require libssh 0.9.0 or later" +#error "SCP/SFTP protocols require libssh 0.9.0 or later" #endif #endif @@ -227,7 +227,7 @@ struct ssh_conn { non-configure platforms */ #if !defined(LIBSSH2_VERSION_NUM) || (LIBSSH2_VERSION_NUM < 0x010208) -# error "SCP/SFTP protocols require libssh2 1.2.8 or later" +#error "SCP/SFTP protocols require libssh2 1.2.8 or later" /* 1.2.8 was released on April 5 2011 */ #endif @@ -247,7 +247,7 @@ void Curl_ssh_attach(struct Curl_easy *data, #else /* for non-SSH builds */ #define Curl_ssh_cleanup() -#define Curl_ssh_attach(x,y) +#define Curl_ssh_attach(x, y) #define Curl_ssh_init() 0 #endif diff --git a/lib/vssh/vssh.c b/lib/vssh/vssh.c index a23f9e8e981f..bfc0a1eb3ab6 100644 --- a/lib/vssh/vssh.c +++ b/lib/vssh/vssh.c @@ -75,7 +75,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, /* Copy a separating '/' if homedir does not end with one */ len = curlx_dyn_len(&npath); p = curlx_dyn_ptr(&npath); - if(len && (p[len-1] != '/')) + if(len && (p[len - 1] != '/')) copyfrom = 2; if(curlx_dyn_addn(&npath, &working_path[copyfrom], @@ -147,7 +147,6 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) if(!curlx_dyn_len(&out)) goto fail; - } else { struct Curl_str word; diff --git a/lib/vtls/apple.c b/lib/vtls/apple.c index 62bb9e3bd194..31108763a02a 100644 --- a/lib/vtls/apple.c +++ b/lib/vtls/apple.c @@ -207,8 +207,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf, #if defined(HAVE_BUILTIN_AVAILABLE) && defined(SUPPORTS_SecOCSP) if(ocsp_len > 0) { if(__builtin_available(macOS 10.9, iOS 7, tvOS 9, watchOS 2, *)) { - CFDataRef ocspdata = - CFDataCreate(NULL, ocsp_buf, (CFIndex)ocsp_len); + CFDataRef ocspdata = CFDataCreate(NULL, ocsp_buf, (CFIndex)ocsp_len); status = SecTrustSetOCSPResponse(trust, ocspdata); CFRelease(ocspdata); @@ -243,7 +242,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf, err_desc = curlx_malloc(size + 1); if(err_desc) { if(!CFStringGetCString(error_ref, err_desc, size, - kCFStringEncodingUTF8)) { + kCFStringEncodingUTF8)) { curlx_free(err_desc); err_desc = NULL; } diff --git a/lib/vtls/cipher_suite.c b/lib/vtls/cipher_suite.c index 23fb3a3c5d16..3726187d7fcc 100644 --- a/lib/vtls/cipher_suite.c +++ b/lib/vtls/cipher_suite.c @@ -547,8 +547,7 @@ static const struct cs_entry cs_list [] = { }; #define CS_LIST_LEN CURL_ARRAYSIZE(cs_list) -static int cs_str_to_zip(const char *cs_str, size_t cs_len, - uint8_t zip[6]) +static int cs_str_to_zip(const char *cs_str, size_t cs_len, uint8_t zip[6]) { uint8_t indexes[8] = {0}; const char *entry, *cur; @@ -568,7 +567,8 @@ static int cs_str_to_zip(const char *cs_str, size_t cs_len, /* determine the length of the part */ cur = nxt; - for(; nxt < end && *nxt != '\0' && *nxt != separator; nxt++); + for(; nxt < end && *nxt != '\0' && *nxt != separator; nxt++) + ; len = nxt - cur; /* lookup index for the part (skip empty string at 0) */ @@ -581,22 +581,21 @@ static int cs_str_to_zip(const char *cs_str, size_t cs_len, if(idx == CS_TXT_LEN) return -1; - indexes[i++] = (uint8_t) idx; + indexes[i++] = (uint8_t)idx; } while(nxt < end && *(nxt++) != '\0'); /* zip the 8 indexes into 48 bits */ - zip[0] = (uint8_t) (indexes[0] << 2 | (indexes[1] & 0x3F) >> 4); - zip[1] = (uint8_t) (indexes[1] << 4 | (indexes[2] & 0x3F) >> 2); - zip[2] = (uint8_t) (indexes[2] << 6 | (indexes[3] & 0x3F)); - zip[3] = (uint8_t) (indexes[4] << 2 | (indexes[5] & 0x3F) >> 4); - zip[4] = (uint8_t) (indexes[5] << 4 | (indexes[6] & 0x3F) >> 2); - zip[5] = (uint8_t) (indexes[6] << 6 | (indexes[7] & 0x3F)); + zip[0] = (uint8_t)(indexes[0] << 2 | (indexes[1] & 0x3F) >> 4); + zip[1] = (uint8_t)(indexes[1] << 4 | (indexes[2] & 0x3F) >> 2); + zip[2] = (uint8_t)(indexes[2] << 6 | (indexes[3] & 0x3F)); + zip[3] = (uint8_t)(indexes[4] << 2 | (indexes[5] & 0x3F) >> 4); + zip[4] = (uint8_t)(indexes[5] << 4 | (indexes[6] & 0x3F) >> 2); + zip[5] = (uint8_t)(indexes[6] << 6 | (indexes[7] & 0x3F)); return 0; } -static int cs_zip_to_str(const uint8_t zip[6], - char *buf, size_t buf_size) +static int cs_zip_to_str(const uint8_t zip[6], char *buf, size_t buf_size) { uint8_t indexes[8] = {0}; const char *entry; @@ -659,13 +658,12 @@ uint16_t Curl_cipher_suite_lookup_id(const char *cs_str, size_t cs_len) static bool cs_is_separator(char c) { switch(c) { - case ' ': - case '\t': - case ':': - case ',': - case ';': - return TRUE; - default:; + case ' ': + case '\t': + case ':': + case ',': + case ';': + return TRUE; } return FALSE; } @@ -673,10 +671,12 @@ static bool cs_is_separator(char c) uint16_t Curl_cipher_suite_walk_str(const char **str, const char **end) { /* move string pointer to first non-separator or end of string */ - for(; cs_is_separator(*str[0]); (*str)++); + for(; cs_is_separator(*str[0]); (*str)++) + ; /* move end pointer to next separator or end of string */ - for(*end = *str; *end[0] != '\0' && !cs_is_separator(*end[0]); (*end)++); + for(*end = *str; *end[0] != '\0' && !cs_is_separator(*end[0]); (*end)++) + ; return Curl_cipher_suite_lookup_id(*str, *end - *str); } diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index c05ab8427b89..e0ba48422b22 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -66,7 +66,7 @@ #ifdef GTLSDEBUG static void tls_log_func(int level, const char *str) { - curl_mfprintf(stderr, "|<%d>| %s", level, str); + curl_mfprintf(stderr, "|<%d>| %s", level, str); } #endif @@ -131,8 +131,7 @@ static ssize_t gtls_pull(void *s, void *buf, size_t blen) } result = Curl_conn_cf_recv(cf->next, data, buf, blen, &nread); - CURL_TRC_CF(data, cf, "glts_pull(len=%zu) -> %d, %zd", - blen, result, nread); + CURL_TRC_CF(data, cf, "glts_pull(len=%zu) -> %d, %zd", blen, result, nread); backend->gtls.io_result = result; if(result) { /* !checksrc! disable ERRNOVAR 1 */ @@ -173,9 +172,7 @@ static void gtls_cleanup(void) } #ifndef CURL_DISABLE_VERBOSE_STRINGS -static void showtime(struct Curl_easy *data, - const char *text, - time_t stamp) +static void showtime(struct Curl_easy *data, const char *text, time_t stamp) { struct tm buffer; const struct tm *tm = &buffer; @@ -209,10 +206,10 @@ static gnutls_datum_t load_file(const char *file) f = curlx_fopen(file, "rb"); if(!f) return loaded_file; - if(fseek(f, 0, SEEK_END) != 0 - || (filelen = ftell(f)) < 0 - || fseek(f, 0, SEEK_SET) != 0 - || !(ptr = curlx_malloc((size_t)filelen))) + if(fseek(f, 0, SEEK_END) != 0 || + (filelen = ftell(f)) < 0 || + fseek(f, 0, SEEK_SET) != 0 || + !(ptr = curlx_malloc((size_t)filelen))) goto out; if(fread(ptr, 1, (size_t)filelen, f) < (size_t)filelen) { curlx_free(ptr); @@ -231,7 +228,6 @@ static void unload_file(gnutls_datum_t data) curlx_free(data.data); } - /* this function does an SSL/TLS (re-)handshake */ static CURLcode cf_gtls_handshake(struct Curl_cfilter *cf, struct Curl_easy *data) @@ -584,20 +580,20 @@ static bool gtls_shared_creds_different(struct Curl_cfilter *cf, return strcmp(sc->CAfile, conn_config->CAfile); } -static struct gtls_shared_creds* -gtls_get_cached_creds(struct Curl_cfilter *cf, struct Curl_easy *data) +static struct gtls_shared_creds *gtls_get_cached_creds(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct gtls_shared_creds *shared_creds; if(data->multi) { shared_creds = Curl_hash_pick(&data->multi->proto_hash, CURL_UNCONST(MPROTO_GTLS_X509_KEY), - sizeof(MPROTO_GTLS_X509_KEY)-1); - if(shared_creds && shared_creds->creds && - !gtls_shared_creds_expired(data, shared_creds) && - !gtls_shared_creds_different(cf, shared_creds)) { - return shared_creds; - } + sizeof(MPROTO_GTLS_X509_KEY) - 1); + if(shared_creds && shared_creds->creds && + !gtls_shared_creds_expired(data, shared_creds) && + !gtls_shared_creds_different(cf, shared_creds)) { + return shared_creds; + } } return NULL; } @@ -605,7 +601,7 @@ gtls_get_cached_creds(struct Curl_cfilter *cf, struct Curl_easy *data) static void gtls_shared_creds_hash_free(void *key, size_t key_len, void *p) { struct gtls_shared_creds *sc = p; - DEBUGASSERT(key_len == (sizeof(MPROTO_GTLS_X509_KEY)-1)); + DEBUGASSERT(key_len == (sizeof(MPROTO_GTLS_X509_KEY) - 1)); DEBUGASSERT(!memcmp(MPROTO_GTLS_X509_KEY, key, key_len)); (void)key; (void)key_len; @@ -635,9 +631,9 @@ static void gtls_set_cached_creds(struct Curl_cfilter *cf, return; if(!Curl_hash_add2(&data->multi->proto_hash, - CURL_UNCONST(MPROTO_GTLS_X509_KEY), - sizeof(MPROTO_GTLS_X509_KEY)-1, - sc, gtls_shared_creds_hash_free)) { + CURL_UNCONST(MPROTO_GTLS_X509_KEY), + sizeof(MPROTO_GTLS_X509_KEY) - 1, + sc, gtls_shared_creds_hash_free)) { Curl_gtls_shared_creds_free(&sc); /* down reference again */ return; } @@ -839,7 +835,7 @@ static CURLcode gtls_set_priority(struct Curl_cfilter *cf, if((conn_config->cipher_list[0] == '+') || (conn_config->cipher_list[0] == '-') || (conn_config->cipher_list[0] == '!')) { - /* add it to out own */ + /* add it to out own */ if(!curlx_dyn_len(&buf)) { /* not added yet */ result = curlx_dyn_add(&buf, priority); if(result) @@ -1106,8 +1102,8 @@ static CURLcode gtls_on_session_reuse(struct Curl_cfilter *cf, connssl->earlydata_state = ssl_earlydata_await; connssl->state = ssl_connection_deferred; result = Curl_alpn_set_negotiated(cf, data, connssl, - (const unsigned char *)scs->alpn, - scs->alpn ? strlen(scs->alpn) : 0); + (const unsigned char *)scs->alpn, + scs->alpn ? strlen(scs->alpn) : 0); *do_early_data = !result; } return result; @@ -1225,8 +1221,8 @@ CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx, return result; } -static CURLcode -gtls_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode gtls_connect_step1(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct gtls_ssl_backend_data *backend = @@ -1333,8 +1329,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, return result; } -void Curl_gtls_report_handshake(struct Curl_easy *data, - struct gtls_ctx *gctx) +void Curl_gtls_report_handshake(struct Curl_easy *data, struct gtls_ctx *gctx) { #ifndef CURL_DISABLE_VERBOSE_STRINGS if(Curl_trc_is_verbose(data)) { @@ -1580,8 +1575,7 @@ static CURLcode glts_apple_verify(struct Curl_cfilter *cf, CURLcode result; result = Curl_vtls_apple_verify(cf, data, peer, chain->num_certs, - gtls_chain_get_der, chain, - NULL, 0); + gtls_chain_get_der, chain, NULL, 0); *pverified = !result; if(*pverified) infof(data, " SSL certificate verified by Apple SecTrust."); @@ -1589,14 +1583,13 @@ static CURLcode glts_apple_verify(struct Curl_cfilter *cf, } #endif /* USE_APPLE_SECTRUST */ -CURLcode -Curl_gtls_verifyserver(struct Curl_cfilter *cf, - struct Curl_easy *data, - gnutls_session_t session, - struct ssl_primary_config *config, - struct ssl_config_data *ssl_config, - struct ssl_peer *peer, - const char *pinned_key) +CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf, + struct Curl_easy *data, + gnutls_session_t session, + struct ssl_primary_config *config, + struct ssl_config_data *ssl_config, + struct ssl_peer *peer, + const char *pinned_key) { struct gtls_cert_chain chain; gnutls_x509_crt_t x509_cert = NULL, x509_issuer = NULL; @@ -1651,7 +1644,7 @@ Curl_gtls_verifyserver(struct Curl_cfilter *cf, goto out; for(i = 0; i < chain.num_certs; i++) { - const char *beg = (const char *) chain.certs[i].data; + const char *beg = (const char *)chain.certs[i].data; const char *end = beg + chain.certs[i].size; result = Curl_extract_certinfo(data, (int)i, beg, end); @@ -1897,7 +1890,7 @@ static CURLcode gtls_send_earlydata(struct Curl_cfilter *cf, { struct ssl_connect_data *connssl = cf->ctx; struct gtls_ssl_backend_data *backend = - (struct gtls_ssl_backend_data *)connssl->backend; + (struct gtls_ssl_backend_data *)connssl->backend; CURLcode result = CURLE_OK; const unsigned char *buf; size_t blen; @@ -1907,8 +1900,7 @@ static CURLcode gtls_send_earlydata(struct Curl_cfilter *cf, backend->gtls.io_result = CURLE_OK; while(Curl_bufq_peek(&connssl->earlydata, &buf, &blen)) { n = gnutls_record_send_early_data(backend->gtls.session, buf, blen); - CURL_TRC_CF(data, cf, "gtls_send_earlydata(len=%zu) -> %zd", - blen, n); + CURL_TRC_CF(data, cf, "gtls_send_earlydata(len=%zu) -> %zd", blen, n); if(n < 0) { if(n == GNUTLS_E_AGAIN) result = CURLE_AGAIN; @@ -1947,7 +1939,7 @@ static CURLcode gtls_connect_common(struct Curl_cfilter *cf, { struct ssl_connect_data *connssl = cf->ctx; struct gtls_ssl_backend_data *backend = - (struct gtls_ssl_backend_data *)connssl->backend; + (struct gtls_ssl_backend_data *)connssl->backend; CURLcode result = CURLE_OK; DEBUGASSERT(backend); @@ -2131,7 +2123,7 @@ static CURLcode gtls_shutdown(struct Curl_cfilter *cf, size_t i; DEBUGASSERT(backend); - /* If we have no handshaked connection or already shut down */ + /* If we have no handshaked connection or already shut down */ if(!backend->gtls.session || cf->shutdown || connssl->state != ssl_connection_complete) { *done = TRUE; diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h index afbe51eb9cb8..4949eee2d211 100644 --- a/lib/vtls/gtls.h +++ b/lib/vtls/gtls.h @@ -119,8 +119,7 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf, size_t quic_tp_len); /* Report properties of a successful handshake */ -void Curl_gtls_report_handshake(struct Curl_easy *data, - struct gtls_ctx *gctx); +void Curl_gtls_report_handshake(struct Curl_easy *data, struct gtls_ctx *gctx); extern const struct Curl_ssl Curl_ssl_gnutls; diff --git a/lib/vtls/hostcheck.c b/lib/vtls/hostcheck.c index 672f473db42a..fbd460bc15b1 100644 --- a/lib/vtls/hostcheck.c +++ b/lib/vtls/hostcheck.c @@ -84,9 +84,9 @@ static bool hostmatch(const char *hostname, DEBUGASSERT(hostlen); /* normalize pattern and hostname by stripping off trailing dots */ - if(hostname[hostlen-1]=='.') + if(hostname[hostlen - 1] == '.') hostlen--; - if(pattern[patternlen-1]=='.') + if(pattern[patternlen - 1] == '.') patternlen--; if(strncmp(pattern, "*.", 2)) diff --git a/lib/vtls/keylog.c b/lib/vtls/keylog.c index 397bac1a366a..03dda01f8dec 100644 --- a/lib/vtls/keylog.c +++ b/lib/vtls/keylog.c @@ -38,8 +38,7 @@ /* The fp for the open SSLKEYLOGFILE, or NULL if not open */ static FILE *keylog_file_fp; -void -Curl_tls_keylog_open(void) +void Curl_tls_keylog_open(void) { char *keylog_file_name; @@ -63,8 +62,7 @@ Curl_tls_keylog_open(void) } } -void -Curl_tls_keylog_close(void) +void Curl_tls_keylog_close(void) { if(keylog_file_fp) { curlx_fclose(keylog_file_fp); @@ -72,14 +70,12 @@ Curl_tls_keylog_close(void) } } -bool -Curl_tls_keylog_enabled(void) +bool Curl_tls_keylog_enabled(void) { return keylog_file_fp != NULL; } -bool -Curl_tls_keylog_write_line(const char *line) +bool Curl_tls_keylog_write_line(const char *line) { /* The current maximum valid keylog line length LF and NUL is 195. */ size_t linelen; @@ -107,10 +103,9 @@ Curl_tls_keylog_write_line(const char *line) return TRUE; } -bool -Curl_tls_keylog_write(const char *label, - const unsigned char client_random[CLIENT_RANDOM_SIZE], - const unsigned char *secret, size_t secretlen) +bool Curl_tls_keylog_write(const char *label, + const unsigned char client_random[CLIENT_RANDOM_SIZE], + const unsigned char *secret, size_t secretlen) { size_t pos, i; unsigned char line[KEYLOG_LABEL_MAXLEN + 1 + 2 * CLIENT_RANDOM_SIZE + 1 + diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 9e13ed4641d9..d33167037162 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -38,7 +38,7 @@ #include #if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" +#error "mbedTLS 3.2.0 or later required" #endif #include #include @@ -77,7 +77,7 @@ /* ALPN for http2 */ #if defined(USE_HTTP2) && defined(MBEDTLS_SSL_ALPN) -# define HAS_ALPN_MBEDTLS +#define HAS_ALPN_MBEDTLS #endif struct mbed_ssl_backend_data { @@ -109,7 +109,7 @@ struct mbed_ssl_backend_data { #endif #ifndef MBEDTLS_ERROR_C -#define mbedtls_strerror(a,b,c) b[0] = 0 +#define mbedtls_strerror(a, b, c) b[0] = 0 #endif #if defined(CURL_MBEDTLS_DRBG) && defined(HAS_THREADING_SUPPORT) @@ -217,8 +217,7 @@ static int mbedtls_bio_cf_read(void *bio, unsigned char *buf, size_t blen) /* * profile */ -static const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr = -{ +static const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr = { /* Hashes from SHA-1 and above */ MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA1) | MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_RIPEMD160) | @@ -307,9 +306,8 @@ mbed_set_ssl_version_min_max(struct Curl_easy *data, cipher suite present in other SSL implementations. Provide provisional support for specifying the cipher suite here. */ #ifdef MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 -static int -mbed_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size, - bool prefer_rfc) +static int mbed_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size, + bool prefer_rfc) { if(id == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8) curl_msnprintf(buf, buf_size, "%s", "TLS_ECJPAKE_WITH_AES_128_CCM_8"); @@ -318,8 +316,7 @@ mbed_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size, return 0; } -static uint16_t -mbed_cipher_suite_walk_str(const char **str, const char **end) +static uint16_t mbed_cipher_suite_walk_str(const char **str, const char **end) { uint16_t id = Curl_cipher_suite_walk_str(str, end); size_t len = *end - *str; @@ -348,7 +345,8 @@ mbed_set_selected_ciphers(struct Curl_easy *data, const char *ptr, *end; supported = mbedtls_ssl_list_ciphersuites(); - for(i = 0; supported[i] != 0; i++); + for(i = 0; supported[i] != 0; i++) + ; supported_len = i; selected = curlx_malloc(sizeof(int) * (supported_len + 1)); @@ -361,7 +359,7 @@ mbed_set_selected_ciphers(struct Curl_easy *data, if(!ciphers13) { /* Add default TLSv1.3 ciphers to selection */ for(j = 0; j < supported_len; j++) { - uint16_t id = (uint16_t) supported[j]; + uint16_t id = (uint16_t)supported[j]; if(strncmp(mbedtls_ssl_get_ciphersuite_name(id), "TLS1-3", 6) != 0) continue; @@ -380,23 +378,25 @@ mbed_set_selected_ciphers(struct Curl_easy *data, /* Check if cipher is supported */ if(id) { - for(i = 0; i < supported_len && supported[i] != id; i++); + for(i = 0; i < supported_len && supported[i] != id; i++) + ; if(i == supported_len) id = 0; } if(!id) { if(ptr[0] != '\0') infof(data, "mbedTLS: unknown cipher in list: \"%.*s\"", - (int) (end - ptr), ptr); + (int)(end - ptr), ptr); continue; } /* No duplicates allowed (so selected cannot overflow) */ - for(i = 0; i < count && selected[i] != id; i++); + for(i = 0; i < count && selected[i] != id; i++) + ; if(i < count) { if(i >= default13_count) infof(data, "mbedTLS: duplicate cipher in list: \"%.*s\"", - (int) (end - ptr), ptr); + (int)(end - ptr), ptr); continue; } @@ -412,12 +412,13 @@ mbed_set_selected_ciphers(struct Curl_easy *data, if(!ciphers12) { /* Add default TLSv1.2 ciphers to selection */ for(j = 0; j < supported_len; j++) { - uint16_t id = (uint16_t) supported[j]; + uint16_t id = (uint16_t)supported[j]; if(strncmp(mbedtls_ssl_get_ciphersuite_name(id), "TLS1-3", 6) == 0) continue; /* No duplicates allowed (so selected cannot overflow) */ - for(i = 0; i < count && selected[i] != id; i++); + for(i = 0; i < count && selected[i] != id; i++) + ; if(i < count) continue; @@ -441,8 +442,8 @@ mbed_set_selected_ciphers(struct Curl_easy *data, return CURLE_OK; } -static void -mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) +static void mbed_dump_cert_info(struct Curl_easy *data, + const mbedtls_x509_crt *crt) { #if defined(CURL_DISABLE_VERBOSE_STRINGS) || defined(MBEDTLS_X509_REMOVE_INFO) (void)data, (void)crt; @@ -454,7 +455,7 @@ mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) infof(data, "Server certificate:"); for(p = buffer; *p; p += *p != '\0') { size_t s = strcspn(p, "\n"); - infof(data, "%.*s", (int) s, p); + infof(data, "%.*s", (int)s, p); p += s; } } @@ -465,8 +466,8 @@ mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) #endif } -static void -mbed_extract_certinfo(struct Curl_easy *data, const mbedtls_x509_crt *crt) +static void mbed_extract_certinfo(struct Curl_easy *data, + const mbedtls_x509_crt *crt) { CURLcode result; const mbedtls_x509_crt *cur; @@ -485,7 +486,7 @@ mbed_extract_certinfo(struct Curl_easy *data, const mbedtls_x509_crt *crt) result = Curl_ssl_init_certinfo(data, cert_count); for(i = 0, cur = crt; result == CURLE_OK && cur; ++i, cur = cur->next) { - const char *beg = (const char *) cur->raw.p; + const char *beg = (const char *)cur->raw.p; const char *end = beg + cur->raw.len; result = Curl_extract_certinfo(data, i, beg, end); } @@ -494,7 +495,7 @@ mbed_extract_certinfo(struct Curl_easy *data, const mbedtls_x509_crt *crt) static int mbed_verify_cb(void *ptr, mbedtls_x509_crt *crt, int depth, uint32_t *flags) { - struct Curl_cfilter *cf = (struct Curl_cfilter *) ptr; + struct Curl_cfilter *cf = (struct Curl_cfilter *)ptr; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); struct Curl_easy *data = CF_DATA_CURRENT(cf); @@ -523,8 +524,8 @@ static int mbed_verify_cb(void *ptr, mbedtls_x509_crt *crt, return 0; } -static CURLcode -mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct mbed_ssl_backend_data *backend = @@ -959,8 +960,8 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OK; } -static CURLcode -mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode mbed_connect_step2(struct Curl_cfilter *cf, + struct Curl_easy *data) { CURLcode result; int ret; @@ -1004,8 +1005,8 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) { char cipher_str[64]; uint16_t cipher_id; - cipher_id = (uint16_t) - mbedtls_ssl_get_ciphersuite_id_from_ssl(&backend->ssl); + cipher_id = + (uint16_t)mbedtls_ssl_get_ciphersuite_id_from_ssl(&backend->ssl); mbed_cipher_suite_get_str(cipher_id, cipher_str, sizeof(cipher_str), TRUE); infof(data, "mbedTLS: %s Handshake complete, cipher is %s", mbedtls_ssl_get_version(&backend->ssl), cipher_str); @@ -1084,8 +1085,8 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OK; } -static CURLcode -mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode mbed_new_session(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct mbed_ssl_backend_data *backend = @@ -1148,8 +1149,7 @@ mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) } static CURLcode mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *mem, size_t len, - size_t *pnwritten) + const void *mem, size_t len, size_t *pnwritten) { struct ssl_connect_data *connssl = cf->ctx; struct mbed_ssl_backend_data *backend = @@ -1327,8 +1327,7 @@ static void mbedtls_close(struct Curl_cfilter *cf, struct Curl_easy *data) } static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data, - char *buf, size_t buffersize, - size_t *pnread) + char *buf, size_t buffersize, size_t *pnread) { struct ssl_connect_data *connssl = cf->ctx; struct mbed_ssl_backend_data *backend = diff --git a/lib/vtls/mbedtls_threadlock.c b/lib/vtls/mbedtls_threadlock.c index 89cc2b7d38df..0a74d60d37ae 100644 --- a/lib/vtls/mbedtls_threadlock.c +++ b/lib/vtls/mbedtls_threadlock.c @@ -24,9 +24,8 @@ ***************************************************************************/ #include "../curl_setup.h" -#if defined(USE_MBEDTLS) && \ - ((defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || \ - defined(_WIN32)) +#if defined(USE_MBEDTLS) && \ + ((defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || defined(_WIN32)) #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) # include diff --git a/lib/vtls/mbedtls_threadlock.h b/lib/vtls/mbedtls_threadlock.h index 1855d4cc0187..55607e62504c 100644 --- a/lib/vtls/mbedtls_threadlock.h +++ b/lib/vtls/mbedtls_threadlock.h @@ -28,8 +28,7 @@ #ifdef USE_MBEDTLS -#if (defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || \ - defined(_WIN32) +#if (defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || defined(_WIN32) int Curl_mbedtlsthreadlock_thread_setup(void); int Curl_mbedtlsthreadlock_thread_cleanup(void); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index bdfe527acd83..a958698b5836 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -179,7 +179,7 @@ static void ossl_provider_cleanup(struct Curl_easy *data); #define OSSL_PACKAGE "BoringSSL" #elif defined(OPENSSL_IS_AWSLC) #define OSSL_PACKAGE "AWS-LC" -#elif defined(USE_NGTCP2) && defined(USE_NGHTTP3) && \ +#elif defined(USE_NGTCP2) && defined(USE_NGHTTP3) && \ !defined(OPENSSL_QUIC_API2) #define OSSL_PACKAGE "quictls" #else @@ -234,7 +234,7 @@ static CURLcode pubkey_show(struct Curl_easy *data, return push_certinfo(data, mem, namebuf, num); } -#define print_pubkey_BN(_type, _name, _num) \ +#define print_pubkey_BN(_type, _name, _num) \ pubkey_show(data, mem, _num, #_type, #_name, _name) static int asn1_object_dump(const ASN1_OBJECT *a, char *buf, size_t len) @@ -685,8 +685,7 @@ static void ossl_keylog_callback(const SSL *ssl, const char *line) * ossl_log_tls12_secret is called by libcurl to make the CLIENT_RANDOMs if the * OpenSSL being used does not have native support for doing that. */ -static void -ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done) +static void ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done) { const SSL_SESSION *session; unsigned char client_random[SSL3_RANDOM_SIZE]; @@ -791,8 +790,7 @@ static char *ossl_strerror(unsigned long error, char *buf, size_t size) return buf; } -static int passwd_callback(char *buf, int num, int encrypting, - void *password) +static int passwd_callback(char *buf, int num, int encrypting, void *password) { DEBUGASSERT(encrypting == 0); @@ -932,8 +930,7 @@ static int use_certificate_blob(SSL_CTX *ctx, const struct curl_blob *blob, } else if(type == SSL_FILETYPE_PEM) { /* ERR_R_PEM_LIB; */ - x = PEM_read_bio_X509(in, NULL, - passwd_callback, CURL_UNCONST(key_passwd)); + x = PEM_read_bio_X509(in, NULL, passwd_callback, CURL_UNCONST(key_passwd)); } else { ret = 0; @@ -979,9 +976,9 @@ static int use_privatekey_blob(SSL_CTX *ctx, const struct curl_blob *blob, return ret; } -static int -use_certificate_chain_blob(SSL_CTX *ctx, const struct curl_blob *blob, - const char *key_passwd) +static int use_certificate_chain_blob(SSL_CTX *ctx, + const struct curl_blob *blob, + const char *key_passwd) { int ret = 0; X509 *x = NULL; @@ -1011,8 +1008,7 @@ use_certificate_chain_blob(SSL_CTX *ctx, const struct curl_blob *blob, } while((ca = PEM_read_bio_X509(in, NULL, passwd_callback, - CURL_UNCONST(key_passwd))) - != NULL) { + CURL_UNCONST(key_passwd))) != NULL) { if(!SSL_CTX_add0_chain_cert(ctx, ca)) { X509_free(ca); @@ -1054,8 +1050,7 @@ static int enginecheck(struct Curl_easy *data, } if(data->state.engine) { - UI_METHOD *ui_method = - UI_create_method("curl user interface"); + UI_METHOD *ui_method = UI_create_method("curl user interface"); if(!ui_method) { failf(data, "unable to create " OSSL_PACKAGE " user-interface method"); return 0; @@ -1116,8 +1111,7 @@ static int providercheck(struct Curl_easy *data, EVP_PKEY *priv_key = NULL; OSSL_STORE_CTX *store = NULL; OSSL_STORE_INFO *info = NULL; - UI_METHOD *ui_method = - UI_create_method("curl user interface"); + UI_METHOD *ui_method = UI_create_method("curl user interface"); if(!ui_method) { failf(data, "unable to create " OSSL_PACKAGE " user-interface method"); return 0; @@ -1221,16 +1215,15 @@ static int engineload(struct Curl_easy *data, /* Load the certificate from the engine */ if(!ENGINE_ctrl_cmd(data->state.engine, cmd_name, 0, ¶ms, NULL, 1)) { - failf(data, "ssl engine cannot load client cert with id" - " '%s' [%s]", cert_file, + failf(data, "ssl engine cannot load client cert with id '%s' [%s]", + cert_file, ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); return 0; } if(!params.cert) { - failf(data, "ssl engine did not initialized the certificate " - "properly."); + failf(data, "ssl engine did not initialized the certificate properly."); return 0; } @@ -1352,8 +1345,7 @@ static int pkcs12load(struct Curl_easy *data, if(cert_blob) { cert_bio = BIO_new_mem_buf(cert_blob->data, (int)(cert_blob->len)); if(!cert_bio) { - failf(data, - "BIO_new_mem_buf NULL, " OSSL_PACKAGE " error %s", + failf(data, "BIO_new_mem_buf NULL, " OSSL_PACKAGE " error %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)) ); return 0; @@ -1362,8 +1354,7 @@ static int pkcs12load(struct Curl_easy *data, else { cert_bio = BIO_new(BIO_s_file()); if(!cert_bio) { - failf(data, - "BIO_new return NULL, " OSSL_PACKAGE " error %s", + failf(data, "BIO_new return NULL, " OSSL_PACKAGE " error %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)) ); return 0; @@ -1386,11 +1377,9 @@ static int pkcs12load(struct Curl_easy *data, } if(!PKCS12_parse(p12, key_passwd, &pri, &x509, &ca)) { - failf(data, - "could not parse PKCS12 file, check password, " OSSL_PACKAGE + failf(data, "could not parse PKCS12 file, check password, " OSSL_PACKAGE " error %s", - ossl_strerror(ERR_get_error(), error_buffer, - sizeof(error_buffer)) ); + ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); PKCS12_free(p12); return 0; } @@ -1398,17 +1387,14 @@ static int pkcs12load(struct Curl_easy *data, PKCS12_free(p12); if(SSL_CTX_use_certificate(ctx, x509) != 1) { - failf(data, - "could not load PKCS12 client certificate, " OSSL_PACKAGE + failf(data, "could not load PKCS12 client certificate, " OSSL_PACKAGE " error %s", - ossl_strerror(ERR_get_error(), error_buffer, - sizeof(error_buffer)) ); + ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); goto fail; } if(SSL_CTX_use_PrivateKey(ctx, pri) != 1) { - failf(data, "unable to use private key from PKCS12 file '%s'", - cert_file); + failf(data, "unable to use private key from PKCS12 file '%s'", cert_file); goto fail; } @@ -1500,7 +1486,7 @@ static CURLcode client_cert(struct Curl_easy *data, "(no key found, wrong passphrase, or wrong file format?)", (cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file), ossl_strerror(ERR_get_error(), error_buffer, - sizeof(error_buffer)) ); + sizeof(error_buffer))); return CURLE_SSL_CERTPROBLEM; } break; @@ -1520,7 +1506,7 @@ static CURLcode client_cert(struct Curl_easy *data, "(no key found, wrong passphrase, or wrong file format?)", (cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file), ossl_strerror(ERR_get_error(), error_buffer, - sizeof(error_buffer)) ); + sizeof(error_buffer))); return CURLE_SSL_CERTPROBLEM; } break; @@ -1850,20 +1836,17 @@ static CURLcode ossl_set_provider(struct Curl_easy *data, const char *iname) return CURLE_OK; } - data->state.provider = - OSSL_PROVIDER_try_load(data->state.libctx, name, 1); + data->state.provider = OSSL_PROVIDER_try_load(data->state.libctx, name, 1); if(!data->state.provider) { char error_buffer[256]; failf(data, "Failed to initialize provider: %s", - ossl_strerror(ERR_get_error(), error_buffer, - sizeof(error_buffer))); + ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); ossl_provider_cleanup(data); return CURLE_SSL_ENGINE_NOTFOUND; } /* load the base provider as well */ - data->state.baseprov = - OSSL_PROVIDER_try_load(data->state.libctx, "base", 1); + data->state.baseprov = OSSL_PROVIDER_try_load(data->state.libctx, "base", 1); if(!data->state.baseprov) { ossl_provider_cleanup(data); failf(data, "Failed to load base"); @@ -1875,7 +1858,6 @@ static CURLcode ossl_set_provider(struct Curl_easy *data, const char *iname) } #endif - static CURLcode ossl_shutdown(struct Curl_cfilter *cf, struct Curl_easy *data, bool send_shutdown, bool *done) @@ -2138,7 +2120,7 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data, if(check->type == target) { /* get data and length */ const char *altptr = (const char *)ASN1_STRING_get0_data(check->d.ia5); - size_t altlen = (size_t) ASN1_STRING_length(check->d.ia5); + size_t altlen = (size_t)ASN1_STRING_length(check->d.ia5); switch(target) { case GEN_DNS: /* name/pattern comparison */ @@ -2166,8 +2148,7 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data, our server IP address is */ if((altlen == addrlen) && !memcmp(altptr, &addr, altlen)) { matched = TRUE; - infof(data, - " subjectAltName: \"%s\" matches cert's IP address!", + infof(data, " subjectAltName: \"%s\" matches cert's IP address!", peer->dispname); } break; @@ -2242,8 +2223,7 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data, /* error already detected, pass through */ ; else if(!cn) { - failf(data, - "SSL: unable to obtain common name from peer certificate"); + failf(data, "SSL: unable to obtain common name from peer certificate"); result = CURLE_PEER_FAILED_VERIFICATION; } else if(!Curl_cert_hostcheck((const char *)cn, cnlen, @@ -2780,7 +2760,7 @@ CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, */ static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) { - struct Curl_cfilter *cf = (struct Curl_cfilter*) SSL_get_app_data(ssl); + struct Curl_cfilter *cf = (struct Curl_cfilter *)SSL_get_app_data(ssl); if(cf) { struct Curl_easy *data = CF_DATA_CURRENT(cf); struct ssl_connect_data *connssl = cf->ctx; @@ -3181,7 +3161,7 @@ static CURLcode ossl_populate_x509_store(struct Curl_cfilter *cf, failf(data, "error loading CRL file: %s", ssl_crlfile); return CURLE_SSL_CRL_BADFILE; } - x509flags = X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL; + x509flags = X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL; infof(data, " CRLfile: %s", ssl_crlfile); } @@ -3210,7 +3190,7 @@ static CURLcode ossl_populate_x509_store(struct Curl_cfilter *cf, } /* key to use at `multi->proto_hash` */ -#define MPROTO_OSSL_X509_KEY "tls:ossl:x509:share" +#define MPROTO_OSSL_X509_KEY "tls:ossl:x509:share" struct ossl_x509_share { char *CAfile; /* CAfile path used to generate X509 store */ @@ -3222,7 +3202,7 @@ struct ossl_x509_share { static void oss_x509_share_free(void *key, size_t key_len, void *p) { struct ossl_x509_share *share = p; - DEBUGASSERT(key_len == (sizeof(MPROTO_OSSL_X509_KEY)-1)); + DEBUGASSERT(key_len == (sizeof(MPROTO_OSSL_X509_KEY) - 1)); DEBUGASSERT(!memcmp(MPROTO_OSSL_X509_KEY, key, key_len)); (void)key; (void)key_len; @@ -3233,9 +3213,8 @@ static void oss_x509_share_free(void *key, size_t key_len, void *p) curlx_free(share); } -static bool -ossl_cached_x509_store_expired(const struct Curl_easy *data, - const struct ossl_x509_share *mb) +static bool ossl_cached_x509_store_expired(const struct Curl_easy *data, + const struct ossl_x509_share *mb) { const struct ssl_general_config *cfg = &data->set.general_ssl; if(cfg->ca_cache_timeout < 0) @@ -3249,9 +3228,8 @@ ossl_cached_x509_store_expired(const struct Curl_easy *data, } } -static bool -ossl_cached_x509_store_different(struct Curl_cfilter *cf, - const struct ossl_x509_share *mb) +static bool ossl_cached_x509_store_different(struct Curl_cfilter *cf, + const struct ossl_x509_share *mb) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); if(!mb->CAfile || !conn_config->CAfile) @@ -3272,7 +3250,7 @@ static X509_STORE *ossl_get_cached_x509_store(struct Curl_cfilter *cf, *pempty = TRUE; share = multi ? Curl_hash_pick(&multi->proto_hash, CURL_UNCONST(MPROTO_OSSL_X509_KEY), - sizeof(MPROTO_OSSL_X509_KEY)-1) : NULL; + sizeof(MPROTO_OSSL_X509_KEY) - 1) : NULL; if(share && share->store && !ossl_cached_x509_store_expired(data, share) && !ossl_cached_x509_store_different(cf, share)) { @@ -3297,7 +3275,7 @@ static void ossl_set_cached_x509_store(struct Curl_cfilter *cf, return; share = Curl_hash_pick(&multi->proto_hash, CURL_UNCONST(MPROTO_OSSL_X509_KEY), - sizeof(MPROTO_OSSL_X509_KEY)-1); + sizeof(MPROTO_OSSL_X509_KEY) - 1); if(!share) { share = curlx_calloc(1, sizeof(*share)); @@ -3305,7 +3283,7 @@ static void ossl_set_cached_x509_store(struct Curl_cfilter *cf, return; if(!Curl_hash_add2(&multi->proto_hash, CURL_UNCONST(MPROTO_OSSL_X509_KEY), - sizeof(MPROTO_OSSL_X509_KEY)-1, + sizeof(MPROTO_OSSL_X509_KEY) - 1, share, oss_x509_share_free)) { curlx_free(share); return; @@ -3508,8 +3486,7 @@ static CURLcode ossl_init_ech(struct ossl_ctx *octx, if(data->set.tls_ech & CURLECH_HARD) return result; } - if(SSL_set1_ech_config_list(octx->ssl, ech_config, - ech_config_len) != 1) { + if(SSL_set1_ech_config_list(octx->ssl, ech_config, ech_config_len) != 1) { infof(data, "ECH: SSL_ECH_set1_ech_config_list failed"); if(data->set.tls_ech & CURLECH_HARD) { curlx_free(ech_config); @@ -3519,14 +3496,13 @@ static CURLcode ossl_init_ech(struct ossl_ctx *octx, curlx_free(ech_config); trying_ech_now = 1; # else - ech_config = (unsigned char *) data->set.str[STRING_ECH_CONFIG]; + ech_config = (unsigned char *)data->set.str[STRING_ECH_CONFIG]; if(!ech_config) { infof(data, "ECH: ECHConfig from command line empty"); return CURLE_SSL_CONNECT_ERROR; } ech_config_len = strlen(data->set.str[STRING_ECH_CONFIG]); - if(SSL_set1_ech_config_list(octx->ssl, ech_config, - ech_config_len) != 1) { + if(SSL_set1_ech_config_list(octx->ssl, ech_config, ech_config_len) != 1) { infof(data, "ECH: SSL_ECH_set1_ech_config_list failed"); if(data->set.tls_ech & CURLECH_HARD) return CURLE_SSL_CONNECT_ERROR; @@ -3584,16 +3560,16 @@ static CURLcode ossl_init_ech(struct ossl_ctx *octx, infof(data, "ECH: inner: '%s', outer: '%s'", peer->hostname ? peer->hostname : "NULL", outername); result = SSL_ech_set1_server_names(octx->ssl, - peer->hostname, outername, - 0 /* do send outer */); + peer->hostname, outername, + 0 /* do send outer */); if(result != 1) { infof(data, "ECH: rv failed to set server name(s) %d [ERROR]", result); return CURLE_SSL_CONNECT_ERROR; } } # endif /* HAVE_BORINGSSL_LIKE */ - if(trying_ech_now - && SSL_set_min_proto_version(octx->ssl, TLS1_3_VERSION) != 1) { + if(trying_ech_now && + SSL_set_min_proto_version(octx->ssl, TLS1_3_VERSION) != 1) { infof(data, "ECH: cannot force TLSv1.3 [ERROR]"); return CURLE_SSL_CONNECT_ERROR; } @@ -3602,7 +3578,6 @@ static CURLcode ossl_init_ech(struct ossl_ctx *octx, } #endif /* USE_ECH_OPENSSL */ - static CURLcode ossl_init_ssl(struct ossl_ctx *octx, struct Curl_cfilter *cf, struct Curl_easy *data, @@ -3706,7 +3681,6 @@ static CURLcode ossl_init_method(struct Curl_cfilter *cf, return *pmethod ? CURLE_OK : CURLE_SSL_CONNECT_ERROR; } - CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, struct Curl_cfilter *cf, struct Curl_easy *data, @@ -3821,7 +3795,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, /* "--tlsv" options mean TLS >= version */ case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: /* TLS >= version 1.0 */ + case CURL_SSLVERSION_TLSv1: /* TLS >= version 1.0 */ case CURL_SSLVERSION_TLSv1_0: /* TLS >= version 1.0 */ case CURL_SSLVERSION_TLSv1_1: /* TLS >= version 1.1 */ case CURL_SSLVERSION_TLSv1_2: /* TLS >= version 1.2 */ @@ -4036,8 +4010,7 @@ static CURLcode ossl_on_session_reuse(struct Curl_cfilter *cf, return result; } -void Curl_ossl_report_handshake(struct Curl_easy *data, - struct ossl_ctx *octx) +void Curl_ossl_report_handshake(struct Curl_easy *data, struct ossl_ctx *octx) { #ifndef CURL_DISABLE_VERBOSE_STRINGS if(Curl_trc_is_verbose(data)) { @@ -4065,7 +4038,6 @@ void Curl_ossl_report_handshake(struct Curl_easy *data, (void)data; (void)octx; #endif /* CURL_DISABLE_VERBOSE_STRINGS */ - } static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, @@ -4121,7 +4093,7 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, #ifdef USE_ECH_OPENSSL /* If we have retry configs, then trace those out */ -static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL* ssl, +static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL *ssl, int reason) { CURLcode result = CURLE_OK; @@ -4247,7 +4219,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, else { /* untreated error */ sslerr_t errdetail; - char error_buffer[256]=""; + char error_buffer[256] = ""; CURLcode result; long lerr; int lib; @@ -4319,7 +4291,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, * the SO_ERROR is also lost. */ if(CURLE_SSL_CONNECT_ERROR == result && errdetail == 0) { - char extramsg[80]=""; + char extramsg[80] = ""; int sockerr = SOCKERRNO; if(sockerr && detail == SSL_ERROR_SYSCALL) @@ -4374,7 +4346,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, break; default: status = "unexpected status"; - infof(data, "ECH: unexpected status %d",rv); + infof(data, "ECH: unexpected status %d", rv); } infof(data, "ECH: result: status is %s, inner is %s, outer is %s", (status ? status : "NULL"), @@ -4418,7 +4390,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, * Heavily modified from: * https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning#OpenSSL */ -static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert, +static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509 *cert, const char *pinnedpubkey) { /* Scratch */ @@ -4534,8 +4506,7 @@ static void infof_certstack(struct Curl_easy *data, const SSL *ssl) type_name = NULL; #endif - infof(data, - " Certificate level %d: " + infof(data, " Certificate level %d: " "Public key type %s%s (%d/%d Bits/secBits), signed using %s", cert_level, type_name ? type_name : "?", get_group_name == 0 ? "" : group_name_final, @@ -4553,7 +4524,7 @@ static CURLcode ossl_check_issuer(struct Curl_cfilter *cf, struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); X509 *issuer = NULL; BIO *fp = NULL; - char err_buf[256]=""; + char err_buf[256] = ""; bool verify_enabled = (conn_config->verifypeer || conn_config->verifyhost); CURLcode result = CURLE_OK; @@ -4671,12 +4642,12 @@ static CURLcode ossl_infof_cert(struct Curl_cfilter *cf, infof(data, " subject: %s", result ? "[NONE]" : curlx_dyn_ptr(&dname)); ASN1_TIME_print(mem, X509_get0_notBefore(server_cert)); - len = BIO_get_mem_data(mem, (char **) &buf); + len = BIO_get_mem_data(mem, (char **)&buf); infof(data, " start date: %.*s", (int)len, buf); (void)BIO_reset(mem); ASN1_TIME_print(mem, X509_get0_notAfter(server_cert)); - len = BIO_get_mem_data(mem, (char **) &buf); + len = BIO_get_mem_data(mem, (char **)&buf); infof(data, " expire date: %.*s", (int)len, buf); (void)BIO_reset(mem); @@ -5118,8 +5089,7 @@ static CURLcode ossl_send(struct Curl_cfilter *cf, result = CURLE_AGAIN; octx->blocked_ssl_write_len = memlen; goto out; - case SSL_ERROR_SYSCALL: - { + case SSL_ERROR_SYSCALL: { int sockerr = SOCKERRNO; if(octx->io_result == CURLE_AGAIN) { diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h index 5b6f35396d91..ff8246b4fae3 100644 --- a/lib/vtls/openssl.h +++ b/lib/vtls/openssl.h @@ -150,8 +150,7 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf, struct ssl_peer *peer); /* Report properties of a successful handshake */ -void Curl_ossl_report_handshake(struct Curl_easy *data, - struct ossl_ctx *octx); +void Curl_ossl_report_handshake(struct Curl_easy *data, struct ossl_ctx *octx); #endif /* USE_OPENSSL */ #endif /* HEADER_CURL_SSLUSE_H */ diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 360a2454ac85..951b339b4346 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -42,8 +42,7 @@ #include "cipher_suite.h" #include "x509asn1.h" -struct rustls_ssl_backend_data -{ +struct rustls_ssl_backend_data { const struct rustls_client_config *config; struct rustls_connection *conn; size_t plain_out_buffered; @@ -58,17 +57,17 @@ static CURLcode map_error(const rustls_result r) return CURLE_PEER_FAILED_VERIFICATION; } switch(r) { - case RUSTLS_RESULT_OK: - return CURLE_OK; - case RUSTLS_RESULT_NULL_PARAMETER: - return CURLE_BAD_FUNCTION_ARGUMENT; - default: - return CURLE_RECV_ERROR; + case RUSTLS_RESULT_OK: + return CURLE_OK; + case RUSTLS_RESULT_NULL_PARAMETER: + return CURLE_BAD_FUNCTION_ARGUMENT; + default: + return CURLE_RECV_ERROR; } } -static void -rustls_failf(struct Curl_easy *data, const rustls_result rr, const char *msg) +static void rustls_failf(struct Curl_easy *data, const rustls_result rr, + const char *msg) { char errorbuf[STRERROR_LEN]; size_t errorlen; @@ -76,8 +75,8 @@ rustls_failf(struct Curl_easy *data, const rustls_result rr, const char *msg) failf(data, "%s: %.*s", msg, (int)errorlen, errorbuf); } -static bool -cr_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) +static bool cr_data_pending(struct Curl_cfilter *cf, + const struct Curl_easy *data) { const struct ssl_connect_data *ctx = cf->ctx; struct rustls_ssl_backend_data *backend; @@ -93,11 +92,11 @@ struct io_ctx { struct Curl_easy *data; }; -static int -read_cb(void *userdata, uint8_t *buf, uintptr_t len, uintptr_t *out_n) +static int read_cb(void *userdata, uint8_t *buf, uintptr_t len, + uintptr_t *out_n) { const struct io_ctx *io_ctx = userdata; - struct ssl_connect_data *const connssl = io_ctx->cf->ctx; + struct ssl_connect_data * const connssl = io_ctx->cf->ctx; CURLcode result; int ret = 0; size_t nread; @@ -120,8 +119,8 @@ read_cb(void *userdata, uint8_t *buf, uintptr_t len, uintptr_t *out_n) return ret; } -static int -write_cb(void *userdata, const uint8_t *buf, uintptr_t len, uintptr_t *out_n) +static int write_cb(void *userdata, const uint8_t *buf, uintptr_t len, + uintptr_t *out_n) { const struct io_ctx *io_ctx = userdata; CURLcode result; @@ -146,8 +145,8 @@ write_cb(void *userdata, const uint8_t *buf, uintptr_t len, uintptr_t *out_n) static ssize_t tls_recv_more(struct Curl_cfilter *cf, struct Curl_easy *data, CURLcode *err) { - const struct ssl_connect_data *const connssl = cf->ctx; - struct rustls_ssl_backend_data *const backend = + const struct ssl_connect_data * const connssl = cf->ctx; + struct rustls_ssl_backend_data * const backend = (struct rustls_ssl_backend_data *)connssl->backend; struct io_ctx io_ctx; size_t tls_bytes_read = 0; @@ -186,12 +185,11 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf, * Filter receive method implementation. `plainbuf` and `plainlen` * are always not NULL/0. */ -static CURLcode -cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, - char *plainbuf, size_t plainlen, size_t *pnread) +static CURLcode cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, + char *plainbuf, size_t plainlen, size_t *pnread) { - const struct ssl_connect_data *const connssl = cf->ctx; - struct rustls_ssl_backend_data *const backend = + const struct ssl_connect_data * const connssl = cf->ctx; + struct rustls_ssl_backend_data * const backend = (struct rustls_ssl_backend_data *)connssl->backend; struct rustls_connection *rconn = NULL; CURLcode result = CURLE_OK; @@ -300,12 +298,12 @@ static CURLcode cr_flush_out(struct Curl_cfilter *cf, struct Curl_easy *data, * In that case, it will not read anything into Rustls' plaintext input buffer. * It will only drain Rustls' plaintext output buffer into the socket. */ -static CURLcode -cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *plainbuf, size_t plainlen, size_t *pnwritten) +static CURLcode cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, + const void *plainbuf, size_t plainlen, + size_t *pnwritten) { - const struct ssl_connect_data *const connssl = cf->ctx; - struct rustls_ssl_backend_data *const backend = + const struct ssl_connect_data * const connssl = cf->ctx; + struct rustls_ssl_backend_data * const backend = (struct rustls_ssl_backend_data *)connssl->backend; struct rustls_connection *rconn = NULL; size_t plainwritten = 0; @@ -379,18 +377,15 @@ cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* A server certificate verify callback for Rustls that always returns RUSTLS_RESULT_OK, or in other words disable certificate verification. */ -static uint32_t -cr_verify_none(void *userdata, - const rustls_verify_server_cert_params *params) +static uint32_t cr_verify_none(void *userdata, + const rustls_verify_server_cert_params *params) { (void)userdata; (void)params; return RUSTLS_RESULT_OK; } -static int -read_file_into(const char *filename, - struct dynbuf *out) +static int read_file_into(const char *filename, struct dynbuf *out) { FILE *f = curlx_fopen(filename, FOPEN_READTEXT); if(!f) { @@ -464,16 +459,17 @@ cr_get_selected_ciphers(struct Curl_easy *data, if(!id) { if(ptr[0] != '\0') infof(data, "rustls: unknown cipher in list: \"%.*s\"", - (int) (end - ptr), ptr); + (int)(end - ptr), ptr); continue; } /* No duplicates allowed (so selected cannot overflow) */ - for(i = 0; i < count && selected[i] != entry; i++); + for(i = 0; i < count && selected[i] != entry; i++) + ; if(i < count) { if(i >= default13_count) infof(data, "rustls: duplicate cipher in list: \"%.*s\"", - (int) (end - ptr), ptr); + (int)(end - ptr), ptr); continue; } @@ -494,7 +490,8 @@ cr_get_selected_ciphers(struct Curl_easy *data, continue; /* No duplicates allowed (so selected cannot overflow) */ - for(i = 0; i < count && selected[i] != entry; i++); + for(i = 0; i < count && selected[i] != entry; i++) + ; if(i < count) continue; @@ -505,10 +502,10 @@ cr_get_selected_ciphers(struct Curl_easy *data, *selected_size = count; } -static void -cr_keylog_log_cb(struct rustls_str label, - const uint8_t *client_random, size_t client_random_len, - const uint8_t *secret, size_t secret_len) +static void cr_keylog_log_cb(struct rustls_str label, + const uint8_t *client_random, + size_t client_random_len, const uint8_t *secret, + size_t secret_len) { char clabel[KEYLOG_LABEL_MAXLEN]; (void)client_random_len; @@ -528,12 +525,11 @@ init_config_builder(struct Curl_easy *data, const struct rustls_crypto_provider *custom_provider = NULL; uint16_t tls_versions[2] = { - RUSTLS_TLS_VERSION_TLSV1_2, - RUSTLS_TLS_VERSION_TLSV1_3, + RUSTLS_TLS_VERSION_TLSV1_2, + RUSTLS_TLS_VERSION_TLSV1_3, }; size_t tls_versions_len = 2; - size_t cipher_suites_len = - rustls_default_crypto_provider_ciphersuites_len(); + size_t cipher_suites_len = rustls_default_crypto_provider_ciphersuites_len(); CURLcode result = CURLE_OK; rustls_result rr; @@ -602,7 +598,7 @@ init_config_builder(struct Curl_easy *data, &custom_provider_builder); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, - "failed to create crypto provider builder from default"); + "failed to create crypto provider builder from default"); result = CURLE_SSL_CIPHER; goto cleanup; } @@ -614,13 +610,13 @@ init_config_builder(struct Curl_easy *data, cipher_suites_len); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, - "failed to set ciphersuites for crypto provider builder"); + "failed to set ciphersuites for crypto provider builder"); result = CURLE_SSL_CIPHER; goto cleanup; } - rr = rustls_crypto_provider_builder_build( - custom_provider_builder, &custom_provider); + rr = rustls_crypto_provider_builder_build(custom_provider_builder, + &custom_provider); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to build custom crypto provider"); result = CURLE_SSL_CIPHER; @@ -628,9 +624,9 @@ init_config_builder(struct Curl_easy *data, } rr = rustls_client_config_builder_new_custom(custom_provider, - tls_versions, - tls_versions_len, - config_builder); + tls_versions, + tls_versions_len, + config_builder); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to create client config builder"); result = CURLE_SSL_CIPHER; @@ -669,8 +665,7 @@ init_config_builder_alpn(struct Curl_easy *data, infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data); } -static CURLcode -init_config_builder_verifier_crl( +static CURLcode init_config_builder_verifier_crl( struct Curl_easy *data, const struct ssl_primary_config *conn_config, struct rustls_web_pki_server_cert_verifier_builder *builder) @@ -723,7 +718,6 @@ init_config_builder_verifier(struct Curl_easy *data, 1); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to parse trusted certificates from blob"); - result = CURLE_SSL_CACERT_BADFILE; goto cleanup; } @@ -734,7 +728,6 @@ init_config_builder_verifier(struct Curl_easy *data, 1); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to load trusted certificates"); - result = CURLE_SSL_CACERT_BADFILE; goto cleanup; } @@ -755,8 +748,8 @@ init_config_builder_verifier(struct Curl_easy *data, if(conn_config->CRLfile) { result = init_config_builder_verifier_crl(data, - conn_config, - verifier_builder); + conn_config, + verifier_builder); if(result) { goto cleanup; } @@ -789,8 +782,7 @@ init_config_builder_verifier(struct Curl_easy *data, return result; } -static CURLcode -init_config_builder_platform_verifier( +static CURLcode init_config_builder_platform_verifier( struct Curl_easy *data, struct rustls_client_config_builder *builder) { @@ -890,10 +882,8 @@ init_config_builder_client_auth(struct Curl_easy *data, rr = rustls_certified_key_keys_match(certified_key); if(rr != RUSTLS_RESULT_OK) { - rustls_failf(data, - rr, + rustls_failf(data, rr, "rustls: client certificate and keypair files do not match:"); - result = CURLE_SSL_CERTPROBLEM; goto cleanup; } @@ -1011,9 +1001,9 @@ init_config_builder_ech(struct Curl_easy *data, } #endif /* USE_ECH */ -static CURLcode -cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, - struct rustls_ssl_backend_data *const backend) +static CURLcode cr_init_backend(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct rustls_ssl_backend_data * const backend) { const struct ssl_connect_data *connssl = cf->ctx; const struct ssl_primary_config *conn_config = @@ -1091,9 +1081,7 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } - rr = rustls_client_config_builder_build( - config_builder, - &backend->config); + rr = rustls_client_config_builder_build(config_builder, &backend->config); if(rr != RUSTLS_RESULT_OK) { rustls_failf(data, rr, "failed to build client config"); return CURLE_SSL_CONNECT_ERROR; @@ -1116,11 +1104,11 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } -static void -cr_set_negotiated_alpn(struct Curl_cfilter *cf, struct Curl_easy *data, - const struct rustls_connection *rconn) +static void cr_set_negotiated_alpn(struct Curl_cfilter *cf, + struct Curl_easy *data, + const struct rustls_connection *rconn) { - struct ssl_connect_data *const connssl = cf->ctx; + struct ssl_connect_data * const connssl = cf->ctx; const uint8_t *protocol = NULL; size_t len = 0; @@ -1133,12 +1121,11 @@ cr_set_negotiated_alpn(struct Curl_cfilter *cf, struct Curl_easy *data, * This function will set `*done` to true once the handshake is complete. * This function never reads the value of `*done*`. */ -static CURLcode -cr_connect(struct Curl_cfilter *cf, - struct Curl_easy *data, bool *done) +static CURLcode cr_connect(struct Curl_cfilter *cf, struct Curl_easy *data, + bool *done) { - struct ssl_connect_data *const connssl = cf->ctx; - const struct rustls_ssl_backend_data *const backend = + struct ssl_connect_data * const connssl = cf->ctx; + const struct rustls_ssl_backend_data * const backend = (struct rustls_ssl_backend_data *)connssl->backend; const struct rustls_connection *rconn = NULL; CURLcode tmperr = CURLE_OK; @@ -1165,9 +1152,9 @@ cr_connect(struct Curl_cfilter *cf, /* Read/write data until the handshake is done or the socket would block. */ for(;;) { /* - * Connection has been established according to Rustls. Set send/recv - * handlers, and update the state machine. - */ + * Connection has been established according to Rustls. Set send/recv + * handlers, and update the state machine. + */ connssl->io_need = CURL_SSL_IO_NEED_NONE; if(!rustls_connection_is_handshaking(rconn)) { /* Rustls claims it is no longer handshaking *before* it has @@ -1186,8 +1173,7 @@ cr_connect(struct Curl_cfilter *cf, } /* REALLY Done with the handshake. */ { - const uint16_t proto = - rustls_connection_get_protocol_version(rconn); + const uint16_t proto = rustls_connection_get_protocol_version(rconn); const rustls_str ciphersuite_name = rustls_connection_get_negotiated_ciphersuite_name(rconn); const rustls_str kex_group_name = @@ -1297,9 +1283,7 @@ cr_connect(struct Curl_cfilter *cf, DEBUGASSERT(FALSE); } -static void * -cr_get_internals(struct ssl_connect_data *connssl, - CURLINFO info) +static void *cr_get_internals(struct ssl_connect_data *connssl, CURLINFO info) { struct rustls_ssl_backend_data *backend = (struct rustls_ssl_backend_data *)connssl->backend; @@ -1308,10 +1292,8 @@ cr_get_internals(struct ssl_connect_data *connssl, return backend->conn; } -static CURLcode -cr_shutdown(struct Curl_cfilter *cf, - struct Curl_easy *data, - const bool send_shutdown, bool *done) +static CURLcode cr_shutdown(struct Curl_cfilter *cf, struct Curl_easy *data, + const bool send_shutdown, bool *done) { struct ssl_connect_data *connssl = cf->ctx; struct rustls_ssl_backend_data *backend = @@ -1373,8 +1355,7 @@ cr_shutdown(struct Curl_cfilter *cf, return result; } -static void -cr_close(struct Curl_cfilter *cf, struct Curl_easy *data) +static void cr_close(struct Curl_cfilter *cf, struct Curl_easy *data) { const struct ssl_connect_data *connssl = cf->ctx; struct rustls_ssl_backend_data *backend = @@ -1398,13 +1379,12 @@ static size_t cr_version(char *buffer, size_t size) return curl_msnprintf(buffer, size, "%.*s", (int)ver.len, ver.data); } -static CURLcode -cr_random(struct Curl_easy *data, unsigned char *entropy, size_t length) +static CURLcode cr_random(struct Curl_easy *data, unsigned char *entropy, + size_t length) { rustls_result rresult = 0; (void)data; - rresult = - rustls_default_crypto_provider_random(entropy, length); + rresult = rustls_default_crypto_provider_random(entropy, length); return map_error(rresult); } diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 49a4516cdfc8..21314d16ecb3 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -34,7 +34,7 @@ #ifdef USE_SCHANNEL #ifndef USE_WINDOWS_SSPI -# error "cannot compile SCHANNEL support without SSPI." +#error "cannot compile SCHANNEL support without SSPI." #endif #include "schannel.h" @@ -67,7 +67,7 @@ */ #ifdef CURL_SCHANNEL_DEV_DEBUG #define SCH_DEV(x) x -#define SCH_DEV_SHOWBOOL(x) \ +#define SCH_DEV_SHOWBOOL(x) \ infof(data, "schannel: " #x " %s", (x) ? "TRUE" : "FALSE"); #else #define SCH_DEV(x) do { } while(0) @@ -159,10 +159,9 @@ static void InitSecBufferDesc(SecBufferDesc *desc, SecBuffer *BufArr, desc->cBuffers = NumArrElem; } -static CURLcode -schannel_set_ssl_version_min_max(DWORD *enabled_protocols, - struct Curl_cfilter *cf, - struct Curl_easy *data) +static CURLcode schannel_set_ssl_version_min_max(DWORD *enabled_protocols, + struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); long ssl_version = conn_config->version; @@ -222,7 +221,7 @@ struct algo { int id; }; -static const struct algo algs[]= { +static const struct algo algs[] = { CIPHEROPTION(CALG_MD2), CIPHEROPTION(CALG_MD4), CIPHEROPTION(CALG_MD5), @@ -330,8 +329,7 @@ static const struct algo algs[]= { {NULL, 0}, }; -static int -get_alg_id_by_name(const char *name) +static int get_alg_id_by_name(const char *name) { const char *nameEnd = strchr(name, ':'); size_t n = nameEnd ? (size_t)(nameEnd - name) : strlen(name); @@ -346,9 +344,8 @@ get_alg_id_by_name(const char *name) #define NUM_CIPHERS 47 /* There are 47 options listed above */ -static CURLcode -set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, - ALG_ID *algIds) +static CURLcode set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, + ALG_ID *algIds) { const char *startCur = ciphers; int algCount = 0; @@ -376,9 +373,8 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, } /* Function allocates memory for store_path only if CURLE_OK is returned */ -static CURLcode -get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, - TCHAR **thumbprint) +static CURLcode get_cert_location(TCHAR *path, DWORD *store_name, + TCHAR **store_path, TCHAR **thumbprint) { TCHAR *sep; TCHAR *store_path_start; @@ -400,14 +396,11 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, *store_name = CERT_SYSTEM_STORE_SERVICES; else if(_tcsncmp(path, TEXT("Users"), store_name_len) == 0) *store_name = CERT_SYSTEM_STORE_USERS; - else if(_tcsncmp(path, TEXT("CurrentUserGroupPolicy"), - store_name_len) == 0) + else if(_tcsncmp(path, TEXT("CurrentUserGroupPolicy"), store_name_len) == 0) *store_name = CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY; - else if(_tcsncmp(path, TEXT("LocalMachineGroupPolicy"), - store_name_len) == 0) + else if(_tcsncmp(path, TEXT("LocalMachineGroupPolicy"), store_name_len) == 0) *store_name = CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY; - else if(_tcsncmp(path, TEXT("LocalMachineEnterprise"), - store_name_len) == 0) + else if(_tcsncmp(path, TEXT("LocalMachineEnterprise"), store_name_len) == 0) *store_name = CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE; else return CURLE_SSL_CERTPROBLEM; @@ -431,9 +424,8 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, return CURLE_OK; } -static CURLcode -schannel_acquire_credential_handle(struct Curl_cfilter *cf, - struct Curl_easy *data) +static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); @@ -461,37 +453,36 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, if(ssl_config->no_revoke) { flags |= SCH_CRED_IGNORE_NO_REVOCATION_CHECK | - SCH_CRED_IGNORE_REVOCATION_OFFLINE; + SCH_CRED_IGNORE_REVOCATION_OFFLINE; DEBUGF(infof(data, "schannel: disabled server certificate revocation " - "checks")); + "checks")); } else if(ssl_config->revoke_best_effort) { flags |= SCH_CRED_IGNORE_NO_REVOCATION_CHECK | - SCH_CRED_IGNORE_REVOCATION_OFFLINE | SCH_CRED_REVOCATION_CHECK_CHAIN; + SCH_CRED_IGNORE_REVOCATION_OFFLINE | + SCH_CRED_REVOCATION_CHECK_CHAIN; DEBUGF(infof(data, "schannel: ignore revocation offline errors")); } else { flags |= SCH_CRED_REVOCATION_CHECK_CHAIN; - DEBUGF(infof(data, - "schannel: checking server certificate revocation")); + DEBUGF(infof(data, "schannel: checking server certificate revocation")); } } else { flags = SCH_CRED_MANUAL_CRED_VALIDATION | - SCH_CRED_IGNORE_NO_REVOCATION_CHECK | - SCH_CRED_IGNORE_REVOCATION_OFFLINE; - DEBUGF(infof(data, - "schannel: disabled server cert revocation checks")); + SCH_CRED_IGNORE_NO_REVOCATION_CHECK | + SCH_CRED_IGNORE_REVOCATION_OFFLINE; + DEBUGF(infof(data, "schannel: disabled server cert revocation checks")); } if(!conn_config->verifyhost) { flags |= SCH_CRED_NO_SERVERNAME_CHECK; DEBUGF(infof(data, "schannel: verifyhost setting prevents Schannel from " - "comparing the supplied target name with the subject " - "names in server certificates.")); + "comparing the supplied target name with the subject " + "names in server certificates.")); } if(!ssl_config->auto_client_cert) { @@ -508,8 +499,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, case CURL_SSLVERSION_TLSv1_0: case CURL_SSLVERSION_TLSv1_1: case CURL_SSLVERSION_TLSv1_2: - case CURL_SSLVERSION_TLSv1_3: - { + case CURL_SSLVERSION_TLSv1_3: { result = schannel_set_ssl_version_min_max(&enabled_protocols, cf, data); if(result) return result; @@ -550,7 +540,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, result = get_cert_location(cert_path, &cert_store_name, &cert_store_path, &cert_thumbprint_str); - if(result && (data->set.ssl.primary.clientcert[0]!='\0')) + if(result && (data->set.ssl.primary.clientcert[0] != '\0')) fInCert = curlx_fopen(data->set.ssl.primary.clientcert, "rb"); if(result && !fInCert) { @@ -579,7 +569,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, https://learn.microsoft.com/archive/msdn-technet-forums/3e7bc95f-b21a-4bcd-bd2c-7f996718cae5 */ CRYPT_DATA_BLOB datablob; - WCHAR* pszPassword; + WCHAR *pszPassword; size_t pwd_len = 0; int str_w_len = 0; int cert_find_flags; @@ -613,12 +603,12 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, } /* Convert key-pair data to the in-memory certificate store */ - datablob.pbData = (BYTE*)certdata; + datablob.pbData = (BYTE *)certdata; datablob.cbData = (DWORD)certsize; if(data->set.ssl.key_passwd) pwd_len = strlen(data->set.ssl.key_passwd); - pszPassword = (WCHAR*)curlx_malloc(sizeof(WCHAR)*(pwd_len + 1)); + pszPassword = (WCHAR *)curlx_malloc(sizeof(WCHAR) * (pwd_len + 1)); if(pszPassword) { if(pwd_len > 0) str_w_len = MultiByteToWideChar(CP_UTF8, @@ -854,8 +844,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, return CURLE_OK; } -static CURLcode -schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode schannel_connect_step1(struct Curl_cfilter *cf, + struct Curl_easy *data) { size_t written = 0; struct ssl_connect_data *connssl = cf->ctx; @@ -874,8 +864,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) CURLcode result; DEBUGASSERT(backend); - DEBUGF(infof(data, - "schannel: SSL/TLS connection with %s port %d (step 1/3)", + DEBUGF(infof(data, "schannel: SSL/TLS connection with %s port %d (step 1/3)", connssl->peer.hostname, connssl->peer.port)); if(curlx_verify_windows_version(5, 1, 0, PLATFORM_WINNT, @@ -899,7 +888,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } else { failf(data, "schannel: this version of Windows is too old to support " - "certificate verification via CA bundle file."); + "certificate verification via CA bundle file."); return CURLE_SSL_CACERT_BADFILE; } } @@ -952,7 +941,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) int cur = 0; int list_start_index = 0; unsigned int *extension_len = NULL; - unsigned short* list_len = NULL; + unsigned short *list_len = NULL; struct alpn_proto_buf proto; /* The first four bytes will be an unsigned int indicating number @@ -968,7 +957,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* The next two bytes will be an unsigned short indicating the number of bytes used to list the preferred protocols. */ - list_len = (unsigned short*)(void *)(&alpn_buffer[cur]); + list_len = (unsigned short *)(void *)(&alpn_buffer[cur]); cur += (int)sizeof(unsigned short); list_start_index = cur; @@ -1006,8 +995,8 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* security request flags */ backend->req_flags = ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT | - ISC_REQ_CONFIDENTIALITY | ISC_REQ_ALLOCATE_MEMORY | - ISC_REQ_STREAM; + ISC_REQ_CONFIDENTIALITY | ISC_REQ_ALLOCATE_MEMORY | + ISC_REQ_STREAM; if(!ssl_config->auto_client_cert) { backend->req_flags |= ISC_REQ_USE_SUPPLIED_CREDS; @@ -1131,8 +1120,8 @@ static CURLcode schannel_error(struct Curl_easy *data, } } -static CURLcode -schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode schannel_connect_step2(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = @@ -1155,8 +1144,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) doread = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? FALSE : TRUE; connssl->io_need = CURL_SSL_IO_NEED_NONE; - DEBUGF(infof(data, - "schannel: SSL/TLS connection with %s port %d (step 2/3)", + DEBUGF(infof(data, "schannel: SSL/TLS connection with %s port %d (step 2/3)", connssl->peer.hostname, connssl->peer.port)); if(!backend->cred || !backend->ctxt) @@ -1361,7 +1349,8 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) if(backend->encdata_offset > inbuf[1].cbBuffer) { memmove(backend->encdata_buffer, (backend->encdata_buffer + backend->encdata_offset) - - inbuf[1].cbBuffer, inbuf[1].cbBuffer); + inbuf[1].cbBuffer, + inbuf[1].cbBuffer); backend->encdata_offset = inbuf[1].cbBuffer; if(sspi_status == SEC_I_CONTINUE_NEEDED) { doread = FALSE; @@ -1415,8 +1404,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OK; } -static bool -valid_cert_encoding(const CERT_CONTEXT *cert_context) +static bool valid_cert_encoding(const CERT_CONTEXT *cert_context) { return (cert_context != NULL) && ((cert_context->dwCertEncodingType & X509_ASN_ENCODING) != 0) && @@ -1424,12 +1412,11 @@ valid_cert_encoding(const CERT_CONTEXT *cert_context) (cert_context->cbCertEncoded > 0); } -typedef bool(*Read_crt_func)(const CERT_CONTEXT *ccert_context, - bool reverse_order, void *arg); +typedef bool (*Read_crt_func)(const CERT_CONTEXT *ccert_context, + bool reverse_order, void *arg); -static void -traverse_cert_store(const CERT_CONTEXT *context, Read_crt_func func, - void *arg) +static void traverse_cert_store(const CERT_CONTEXT *context, + Read_crt_func func, void *arg) { const CERT_CONTEXT *current_context = NULL; bool should_continue = TRUE; @@ -1454,9 +1441,8 @@ traverse_cert_store(const CERT_CONTEXT *context, Read_crt_func func, CertFreeCertificateContext(current_context); } -static bool -cert_counter_callback(const CERT_CONTEXT *ccert_context, bool reverse_order, - void *certs_count) +static bool cert_counter_callback(const CERT_CONTEXT *ccert_context, + bool reverse_order, void *certs_count) { (void)reverse_order; if(valid_cert_encoding(ccert_context)) @@ -1466,22 +1452,20 @@ cert_counter_callback(const CERT_CONTEXT *ccert_context, bool reverse_order, return TRUE; } -struct Adder_args -{ +struct Adder_args { struct Curl_easy *data; CURLcode result; int idx; int certs_count; }; -static bool -add_cert_to_certinfo(const CERT_CONTEXT *ccert_context, bool reverse_order, - void *raw_arg) +static bool add_cert_to_certinfo(const CERT_CONTEXT *ccert_context, + bool reverse_order, void *raw_arg) { - struct Adder_args *args = (struct Adder_args*)raw_arg; + struct Adder_args *args = (struct Adder_args *)raw_arg; args->result = CURLE_OK; if(valid_cert_encoding(ccert_context)) { - const char *beg = (const char *) ccert_context->pbCertEncoded; + const char *beg = (const char *)ccert_context->pbCertEncoded; const char *end = beg + ccert_context->cbCertEncoded; int insert_index = reverse_order ? (args->certs_count - 1) - args->idx : args->idx; @@ -1511,8 +1495,8 @@ static void schannel_session_free(void *sessionid) } } -static CURLcode -schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode schannel_connect_step3(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = @@ -1527,8 +1511,7 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); DEBUGASSERT(backend); - DEBUGF(infof(data, - "schannel: SSL/TLS connection with %s port %d (step 3/3)", + DEBUGF(infof(data, "schannel: SSL/TLS connection with %s port %d (step 3/3)", connssl->peer.hostname, connssl->peer.port)); if(!backend->cred) @@ -1886,9 +1869,8 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } -static CURLcode -schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, size_t *pnwritten) +static CURLcode schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, + const void *buf, size_t len, size_t *pnwritten) { size_t data_len = 0; unsigned char *ptr = NULL; @@ -2018,7 +2000,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, else if(sspi_status == SEC_E_INSUFFICIENT_MEMORY) { result = CURLE_OUT_OF_MEMORY; } - else{ + else { result = CURLE_SEND_ERROR; } @@ -2032,9 +2014,8 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } -static CURLcode -schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, - char *buf, size_t len, size_t *pnread) +static CURLcode schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, + char *buf, size_t len, size_t *pnread) { size_t size = 0; size_t nread = 0; @@ -2170,7 +2151,7 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, /* https://learn.microsoft.com/windows/win32/api/sspi/nf-sspi-decryptmessage */ sspi_status = Curl_pSecFn->DecryptMessage(&backend->ctxt->ctxt_handle, - &inbuf_desc, 0, NULL); + &inbuf_desc, 0, NULL); /* check if everything went fine (server may want to renegotiate or shutdown the connection context) */ @@ -2231,7 +2212,8 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, buffer */ memmove(backend->encdata_buffer, (backend->encdata_buffer + backend->encdata_offset) - - inbuf[3].cbBuffer, inbuf[3].cbBuffer); + inbuf[3].cbBuffer, + inbuf[3].cbBuffer); backend->encdata_offset = inbuf[3].cbBuffer; } @@ -2761,7 +2743,7 @@ HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf, share = Curl_hash_pick(&multi->proto_hash, CURL_UNCONST(MPROTO_SCHANNEL_CERT_SHARE_KEY), - sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1); + sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY) - 1); if(!share || !share->cert_store) { return NULL; } @@ -2809,7 +2791,7 @@ HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf, static void schannel_cert_share_free(void *key, size_t key_len, void *p) { struct schannel_cert_share *share = p; - DEBUGASSERT(key_len == (sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1)); + DEBUGASSERT(key_len == (sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY) - 1)); DEBUGASSERT(!memcmp(MPROTO_SCHANNEL_CERT_SHARE_KEY, key, key_len)); (void)key; (void)key_len; @@ -2839,7 +2821,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, share = Curl_hash_pick(&multi->proto_hash, CURL_UNCONST(MPROTO_SCHANNEL_CERT_SHARE_KEY), - sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1); + sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY) - 1); if(!share) { share = curlx_calloc(1, sizeof(*share)); if(!share) { @@ -2847,7 +2829,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, } if(!Curl_hash_add2(&multi->proto_hash, CURL_UNCONST(MPROTO_SCHANNEL_CERT_SHARE_KEY), - sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1, + sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY) - 1, share, schannel_cert_share_free)) { curlx_free(share); return FALSE; diff --git a/lib/vtls/schannel.h b/lib/vtls/schannel.h index 9d0bea221a9b..47017c5f5686 100644 --- a/lib/vtls/schannel.h +++ b/lib/vtls/schannel.h @@ -69,15 +69,14 @@ * (and only here). */ #if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC) -# undef X509_NAME -# undef X509_CERT_PAIR -# undef X509_EXTENSIONS +#undef X509_NAME +#undef X509_CERT_PAIR +#undef X509_EXTENSIONS #endif extern const struct Curl_ssl Curl_ssl_schannel; -CURLcode Curl_verify_host(struct Curl_cfilter *cf, - struct Curl_easy *data); +CURLcode Curl_verify_host(struct Curl_cfilter *cf, struct Curl_easy *data); CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, struct Curl_easy *data); diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index 4ff7b5d536a1..e1a3731457b8 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -33,7 +33,7 @@ #ifdef USE_SCHANNEL #ifndef USE_WINDOWS_SSPI -# error "cannot compile SCHANNEL support without SSPI." +#error "cannot compile SCHANNEL support without SSPI." #endif #include "schannel.h" @@ -157,8 +157,8 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, const CERT_CONTEXT *cert_context = NULL; BOOL add_cert_result = FALSE; DWORD actual_content_type = 0; - DWORD cert_size = (DWORD) - ((end_cert_ptr + end_cert_len) - begin_cert_ptr); + DWORD cert_size = + (DWORD)((end_cert_ptr + end_cert_len) - begin_cert_ptr); cert_blob.pbData = (BYTE *)CURL_UNCONST(begin_cert_ptr); cert_blob.cbData = cert_size; @@ -238,13 +238,11 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, if(result == CURLE_OK) { if(!num_certs) { - infof(data, - "schannel: did not add any certificates from CA file '%s'", + infof(data, "schannel: did not add any certificates from CA file '%s'", ca_file_text); } else { - infof(data, - "schannel: added %d certificate(s) from CA file '%s'", + infof(data, "schannel: added %d certificate(s) from CA file '%s'", num_certs, ca_file_text); } } @@ -266,9 +264,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, ca_file_tstr = curlx_convert_UTF8_to_tchar(ca_file); if(!ca_file_tstr) { char buffer[WINAPI_ERROR_LEN]; - failf(data, - "schannel: invalid path name for CA file '%s': %s", - ca_file, + failf(data, "schannel: invalid path name for CA file '%s': %s", ca_file, curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer))); result = CURLE_SSL_CACERT_BADFILE; goto cleanup; @@ -288,9 +284,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, NULL); if(ca_file_handle == INVALID_HANDLE_VALUE) { char buffer[WINAPI_ERROR_LEN]; - failf(data, - "schannel: failed to open CA file '%s': %s", - ca_file, + failf(data, "schannel: failed to open CA file '%s': %s", ca_file, curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer))); result = CURLE_SSL_CACERT_BADFILE; goto cleanup; @@ -298,8 +292,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, if(!GetFileSizeEx(ca_file_handle, &file_size)) { char buffer[WINAPI_ERROR_LEN]; - failf(data, - "schannel: failed to determine size of CA file '%s': %s", + failf(data, "schannel: failed to determine size of CA file '%s': %s", ca_file, curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer))); result = CURLE_SSL_CACERT_BADFILE; @@ -307,8 +300,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, } if(file_size.QuadPart > MAX_CAFILE_SIZE) { - failf(data, - "schannel: CA file exceeds max size of %u bytes", + failf(data, "schannel: CA file exceeds max size of %u bytes", MAX_CAFILE_SIZE); result = CURLE_SSL_CACERT_BADFILE; goto cleanup; @@ -328,9 +320,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, if(!ReadFile(ca_file_handle, ca_file_buffer + total_bytes_read, bytes_to_read, &bytes_read, NULL)) { char buffer[WINAPI_ERROR_LEN]; - failf(data, - "schannel: failed to read from CA file '%s': %s", - ca_file, + failf(data, "schannel: failed to read from CA file '%s': %s", ca_file, curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer))); result = CURLE_SSL_CACERT_BADFILE; goto cleanup; @@ -455,12 +445,11 @@ static DWORD cert_get_name_string(struct Curl_easy *data, } /* -* Returns TRUE if the hostname is a numeric IPv4/IPv6 Address, -* and populates the buffer with IPv4/IPv6 info. -*/ + * Returns TRUE if the hostname is a numeric IPv4/IPv6 Address, + * and populates the buffer with IPv4/IPv6 info. + */ -static bool get_num_host_info(struct num_ip_data *ip_blob, - LPCSTR hostname) +static bool get_num_host_info(struct num_ip_data *ip_blob, LPCSTR hostname) { struct in_addr ia; struct in6_addr ia6; @@ -520,9 +509,8 @@ static bool get_alt_name_info(struct Curl_easy *data, &decode_para, alt_name_info, alt_name_info_size)) { - failf(data, - "schannel: CryptDecodeObjectEx() returned no alternate name " - "information."); + failf(data, "schannel: CryptDecodeObjectEx() returned no alternate name " + "information."); return result; } result = TRUE; @@ -530,8 +518,7 @@ static bool get_alt_name_info(struct Curl_easy *data, } /* Verify the server's hostname */ -CURLcode Curl_verify_host(struct Curl_cfilter *cf, - struct Curl_easy *data) +CURLcode Curl_verify_host(struct Curl_cfilter *cf, struct Curl_easy *data) { CURLcode result = CURLE_PEER_FAILED_VERIFICATION; struct ssl_connect_data *connssl = cf->ctx; @@ -545,7 +532,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, DWORD actual_len = 0; PCERT_ALT_NAME_INFO alt_name_info = NULL; DWORD alt_name_info_size = 0; - struct num_ip_data ip_blob = { 0 }; + struct num_ip_data ip_blob = {0}; bool Win8_compat; struct num_ip_data *p = &ip_blob; DWORD i; @@ -840,7 +827,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, * list URL, or when the list could not be downloaded because the * server is currently unreachable. */ dwTrustErrorMask &= ~(DWORD)(CERT_TRUST_REVOCATION_STATUS_UNKNOWN | - CERT_TRUST_IS_OFFLINE_REVOCATION); + CERT_TRUST_IS_OFFLINE_REVOCATION); } if(dwTrustErrorMask) { diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 6eb60e41cf99..e342953778b0 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -93,14 +93,13 @@ dest->var = NULL; \ } while(0) -#define CLONE_BLOB(var) \ - do { \ - if(blobdup(&dest->var, source->var)) \ - return FALSE; \ +#define CLONE_BLOB(var) \ + do { \ + if(blobdup(&dest->var, source->var)) \ + return FALSE; \ } while(0) -static CURLcode blobdup(struct curl_blob **dest, - struct curl_blob *src) +static CURLcode blobdup(struct curl_blob **dest, struct curl_blob *src) { DEBUGASSERT(dest); DEBUGASSERT(!*dest); @@ -149,8 +148,8 @@ static const struct alpn_spec ALPN_SPEC_H2_H11 = { #endif #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_PROXY) -static const struct alpn_spec * -alpn_get_spec(http_majors allowed, bool use_alpn) +static const struct alpn_spec *alpn_get_spec(http_majors allowed, + bool use_alpn) { if(!use_alpn) return NULL; @@ -170,7 +169,6 @@ alpn_get_spec(http_majors allowed, bool use_alpn) #endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_PROXY */ #endif /* USE_SSL */ - void Curl_ssl_easy_config_init(struct Curl_easy *data) { /* @@ -185,10 +183,9 @@ void Curl_ssl_easy_config_init(struct Curl_easy *data) #endif } -static bool -match_ssl_primary_config(struct Curl_easy *data, - struct ssl_primary_config *c1, - struct ssl_primary_config *c2) +static bool match_ssl_primary_config(struct Curl_easy *data, + struct ssl_primary_config *c1, + struct ssl_primary_config *c2) { (void)data; if((c1->version == c2->version) && @@ -324,8 +321,7 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) sslc->primary.cipher_list13 = data->set.str[STRING_SSL_CIPHER13_LIST]; sslc->primary.signature_algorithms = data->set.str[STRING_SSL_SIGNATURE_ALGORITHMS]; - sslc->primary.pinned_key = - data->set.str[STRING_SSL_PINNEDPUBLICKEY]; + sslc->primary.pinned_key = data->set.str[STRING_SSL_PINNEDPUBLICKEY]; sslc->primary.cert_blob = data->set.blobs[BLOB_CERT]; sslc->primary.ca_info_blob = data->set.blobs[BLOB_CAINFO]; sslc->primary.curves = data->set.str[STRING_SSL_EC_CURVES]; @@ -538,9 +534,9 @@ void Curl_ssl_close_all(struct Curl_easy *data) Curl_ssl->close_all(data); } -CURLcode Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) +CURLcode Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct easy_pollset *ps) { struct ssl_connect_data *connssl = cf->ctx; @@ -628,7 +624,7 @@ CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num) Curl_ssl_free_certinfo(data); /* Allocate the required certificate information structures */ - table = curlx_calloc((size_t) num, sizeof(struct curl_slist *)); + table = curlx_calloc((size_t)num, sizeof(struct curl_slist *)); if(!table) return CURLE_OUT_OF_MEMORY; @@ -661,8 +657,7 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, curlx_dyn_addn(&build, value, valuelen)) return CURLE_OUT_OF_MEMORY; - nl = Curl_slist_append_nodup(ci->certinfo[certnum], - curlx_dyn_ptr(&build)); + nl = Curl_slist_append_nodup(ci->certinfo[certnum], curlx_dyn_ptr(&build)); if(!nl) { curlx_dyn_free(&build); curl_slist_free_all(ci->certinfo[certnum]); @@ -798,8 +793,8 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, pinned_hash = pinnedpubkey; while(pinned_hash && - !strncmp(pinned_hash, "sha256//", (sizeof("sha256//")-1))) { - pinned_hash = pinned_hash + (sizeof("sha256//")-1); + !strncmp(pinned_hash, "sha256//", (sizeof("sha256//") - 1))) { + pinned_hash = pinned_hash + (sizeof("sha256//") - 1); end_pos = strchr(pinned_hash, ';'); pinned_hash_len = end_pos ? (size_t)(end_pos - pinned_hash) : strlen(pinned_hash); @@ -845,7 +840,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, * if the size of our certificate is bigger than the file * size then it cannot match */ - size = curlx_sotouz((curl_off_t) filesize); + size = curlx_sotouz((curl_off_t)filesize); if(pubkeylen > size) goto end; @@ -1277,7 +1272,7 @@ CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, /* not an IP address, normalize according to RCC 6066 ch. 3, * max len of SNI is 2^16-1, no trailing dot */ size_t len = strlen(peer->hostname); - if(len && (peer->hostname[len-1] == '.')) + if(len && (peer->hostname[len - 1] == '.')) len--; if(len < USHRT_MAX) { peer->sni = curlx_calloc(1, len + 1); @@ -1563,7 +1558,7 @@ static CURLcode ssl_cf_shutdown(struct Curl_cfilter *cf, *done = TRUE; /* If we have done the SSL handshake, shut down the connection cleanly */ if(cf->connected && (connssl->state == ssl_connection_complete) && - !cf->shutdown && Curl_ssl->shut_down) { + !cf->shutdown && Curl_ssl->shut_down) { struct cf_call_data save; CF_DATA_SAVE(save, cf, data); @@ -1781,7 +1776,7 @@ static CURLcode cf_ssl_proxy_create(struct Curl_cfilter **pcf, #ifdef USE_HTTP2 if(conn->http_proxy.proxytype == CURLPROXY_HTTPS2) { use_alpn = TRUE; - allowed = (CURL_HTTP_V1x|CURL_HTTP_V2x); + allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x); } #endif @@ -1847,7 +1842,7 @@ static CURLcode vtls_shutdown_blocking(struct Curl_cfilter *cf, } result = connssl->ssl_impl->shut_down(cf, data, send_shutdown, done); - if(result ||*done) + if(result || *done) goto out; if(connssl->io_need) { @@ -2042,7 +2037,7 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, if(proto && proto_len) { if(memchr(proto, '\0', proto_len)) { failf(data, "ALPN: server selected protocol contains NUL. " - "Refusing to continue."); + "Refusing to continue."); result = CURLE_SSL_CONNECT_ERROR; goto out; } diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index dbe13c59030b..b5b517f0b6fa 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -253,16 +253,16 @@ extern struct Curl_cftype Curl_cft_ssl_proxy; #define Curl_ssl_init() 1 #define Curl_ssl_cleanup() Curl_nop_stmt #define Curl_ssl_close_all(x) Curl_nop_stmt -#define Curl_ssl_set_engine(x,y) CURLE_NOT_BUILT_IN +#define Curl_ssl_set_engine(x, y) CURLE_NOT_BUILT_IN #define Curl_ssl_set_engine_default(x) CURLE_NOT_BUILT_IN #define Curl_ssl_engines_list(x) NULL #define Curl_ssl_free_certinfo(x) Curl_nop_stmt -#define Curl_ssl_random(x,y,z) ((void)x, CURLE_NOT_BUILT_IN) +#define Curl_ssl_random(x, y, z) ((void)x, CURLE_NOT_BUILT_IN) #define Curl_ssl_cert_status_request() FALSE -#define Curl_ssl_supports(a,b) FALSE -#define Curl_ssl_cfilter_add(a,b,c) CURLE_NOT_BUILT_IN -#define Curl_ssl_cfilter_remove(a,b,c) CURLE_OK -#define Curl_ssl_cf_get_config(a,b) NULL +#define Curl_ssl_supports(a, b) FALSE +#define Curl_ssl_cfilter_add(a, b, c) CURLE_NOT_BUILT_IN +#define Curl_ssl_cfilter_remove(a, b, c) CURLE_OK +#define Curl_ssl_cf_get_config(a, b) NULL #define Curl_ssl_cf_get_primary_config(a) NULL #endif diff --git a/lib/vtls/vtls_int.h b/lib/vtls/vtls_int.h index 8bf6c6c64be9..0a184f88c127 100644 --- a/lib/vtls/vtls_int.h +++ b/lib/vtls/vtls_int.h @@ -71,8 +71,7 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, const unsigned char *proto, size_t proto_len); -bool Curl_alpn_contains_proto(const struct alpn_spec *spec, - const char *proto); +bool Curl_alpn_contains_proto(const struct alpn_spec *spec, const char *proto); /* enum for the nonblocking SSL connection state machine */ typedef enum { @@ -99,11 +98,11 @@ typedef enum { } ssl_earlydata_state; #define CURL_SSL_IO_NEED_NONE (0) -#define CURL_SSL_IO_NEED_RECV (1<<0) -#define CURL_SSL_IO_NEED_SEND (1<<1) +#define CURL_SSL_IO_NEED_RECV (1 << 0) +#define CURL_SSL_IO_NEED_SEND (1 << 1) /* Max earlydata payload we want to send */ -#define CURL_SSL_EARLY_MAX (64*1024) +#define CURL_SSL_EARLY_MAX (64 * 1024) /* Information in each SSL cfilter context: cf->ctx */ struct ssl_connect_data { @@ -130,11 +129,8 @@ struct ssl_connect_data { BIT(input_pending); /* data for SSL_read() may be available */ }; - #undef CF_CTX_CALL_DATA -#define CF_CTX_CALL_DATA(cf) \ - ((struct ssl_connect_data *)(cf)->ctx)->call_data - +#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data /* Definitions for SSL Implementations */ @@ -157,8 +153,7 @@ struct Curl_ssl { /* data_pending() shall return TRUE when it wants to get called again to drain internal buffers and deliver data instead of waiting for the socket to get readable */ - bool (*data_pending)(struct Curl_cfilter *cf, - const struct Curl_easy *data); + bool (*data_pending)(struct Curl_cfilter *cf, const struct Curl_easy *data); /* return 0 if a find random is filled in */ CURLcode (*random)(struct Curl_easy *data, unsigned char *entropy, @@ -181,7 +176,7 @@ struct Curl_ssl { struct curl_slist *(*engines_list)(struct Curl_easy *data); CURLcode (*sha256sum)(const unsigned char *input, size_t inputlen, - unsigned char *sha256sum, size_t sha256sumlen); + unsigned char *sha256sum, size_t sha256sumlen); CURLcode (*recv_plain)(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, size_t *pnread); CURLcode (*send_plain)(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -189,7 +184,6 @@ struct Curl_ssl { CURLcode (*get_channel_binding)(struct Curl_easy *data, int sockindex, struct dynbuf *binding); - }; extern const struct Curl_ssl *Curl_ssl; diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 21dfe2eaa032..b968d8b8f36a 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -106,23 +106,21 @@ static void cf_ssl_scache_session_ldestroy(void *udata, void *obj) curlx_free(s); } -CURLcode -Curl_ssl_session_create(void *sdata, size_t sdata_len, - int ietf_tls_id, const char *alpn, - curl_off_t valid_until, size_t earlydata_max, - struct Curl_ssl_session **psession) +CURLcode Curl_ssl_session_create(void *sdata, size_t sdata_len, + int ietf_tls_id, const char *alpn, + curl_off_t valid_until, size_t earlydata_max, + struct Curl_ssl_session **psession) { return Curl_ssl_session_create2(sdata, sdata_len, ietf_tls_id, alpn, valid_until, earlydata_max, NULL, 0, psession); } -CURLcode -Curl_ssl_session_create2(void *sdata, size_t sdata_len, - int ietf_tls_id, const char *alpn, - curl_off_t valid_until, size_t earlydata_max, - unsigned char *quic_tp, size_t quic_tp_len, - struct Curl_ssl_session **psession) +CURLcode Curl_ssl_session_create2(void *sdata, size_t sdata_len, + int ietf_tls_id, const char *alpn, + curl_off_t valid_until, size_t earlydata_max, + unsigned char *quic_tp, size_t quic_tp_len, + struct Curl_ssl_session **psession) { struct Curl_ssl_session *s; @@ -322,7 +320,7 @@ CURLcode Curl_ssl_scache_create(size_t max_peers, } scache->magic = CURL_SCACHE_MAGIC; - scache->default_lifetime_secs = (24*60*60); /* 1 day */ + scache->default_lifetime_secs = (24 * 60 * 60); /* 1 day */ scache->peer_count = max_peers; scache->peers = peers; scache->age = 1; @@ -507,7 +505,7 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, if(ssl->version || ssl->version_max) { r = curlx_dyn_addf(&buf, ":TLSVER-%d-%d", ssl->version, - (ssl->version_max >> 16)); + (ssl->version_max >> 16)); if(r) goto out; } @@ -616,19 +614,18 @@ static bool cf_ssl_scache_match_auth(struct Curl_ssl_scache_peer *peer, else if(!Curl_safecmp(peer->clientcert, conn_config->clientcert)) return FALSE; #ifdef USE_TLS_SRP - if(Curl_timestrcmp(peer->srp_username, conn_config->username) || - Curl_timestrcmp(peer->srp_password, conn_config->password)) - return FALSE; + if(Curl_timestrcmp(peer->srp_username, conn_config->username) || + Curl_timestrcmp(peer->srp_password, conn_config->password)) + return FALSE; #endif return TRUE; } -static CURLcode -cf_ssl_find_peer_by_key(struct Curl_easy *data, - struct Curl_ssl_scache *scache, - const char *ssl_peer_key, - struct ssl_primary_config *conn_config, - struct Curl_ssl_scache_peer **ppeer) +static CURLcode cf_ssl_find_peer_by_key(struct Curl_easy *data, + struct Curl_ssl_scache *scache, + const char *ssl_peer_key, + struct ssl_primary_config *conn_config, + struct Curl_ssl_scache_peer **ppeer) { size_t i, peer_key_len = 0; CURLcode result = CURLE_OK; @@ -718,12 +715,11 @@ cf_ssl_get_free_peer(struct Curl_ssl_scache *scache) return peer; } -static CURLcode -cf_ssl_add_peer(struct Curl_easy *data, - struct Curl_ssl_scache *scache, - const char *ssl_peer_key, - struct ssl_primary_config *conn_config, - struct Curl_ssl_scache_peer **ppeer) +static CURLcode cf_ssl_add_peer(struct Curl_easy *data, + struct Curl_ssl_scache *scache, + const char *ssl_peer_key, + struct ssl_primary_config *conn_config, + struct Curl_ssl_scache_peer **ppeer) { struct Curl_ssl_scache_peer *peer = NULL; CURLcode result = CURLE_OK; @@ -1000,7 +996,7 @@ void Curl_ssl_scache_remove_all(struct Curl_cfilter *cf, #ifdef USE_SSLS_EXPORT -#define CURL_SSL_TICKET_MAX (16*1024) +#define CURL_SSL_TICKET_MAX (16 * 1024) static CURLcode cf_ssl_scache_peer_set_hmac(struct Curl_ssl_scache_peer *peer) { diff --git a/lib/vtls/vtls_scache.h b/lib/vtls/vtls_scache.h index 445f21054937..67049462a859 100644 --- a/lib/vtls/vtls_scache.h +++ b/lib/vtls/vtls_scache.h @@ -37,8 +37,8 @@ struct ssl_peer; /* RFC 8446 (TLSv1.3) restrict lifetime to one week max, for * other, less secure versions, we restrict it to a day */ -#define CURL_SCACHE_MAX_13_LIFETIME_SEC (60*60*24*7) -#define CURL_SCACHE_MAX_12_LIFETIME_SEC (60*60*24) +#define CURL_SCACHE_MAX_13_LIFETIME_SEC (60 * 60 * 24 * 7) +#define CURL_SCACHE_MAX_12_LIFETIME_SEC (60 * 60 * 24) /* Create a session cache for up to max_peers endpoints with a total * of up to max_sessions SSL sessions per peer */ @@ -142,22 +142,18 @@ struct Curl_ssl_session { * in case this is not known. * @param psession on return the scached session instance created */ -CURLcode -Curl_ssl_session_create(void *sdata, size_t sdata_len, - int ietf_tls_id, const char *alpn, - curl_off_t valid_until, - size_t earlydata_max, - struct Curl_ssl_session **psession); +CURLcode Curl_ssl_session_create(void *sdata, size_t sdata_len, + int ietf_tls_id, const char *alpn, + curl_off_t valid_until, size_t earlydata_max, + struct Curl_ssl_session **psession); /* Variation of session creation with quic transport parameter bytes, * Takes ownership of `quic_tp` regardless of return code. */ -CURLcode -Curl_ssl_session_create2(void *sdata, size_t sdata_len, - int ietf_tls_id, const char *alpn, - curl_off_t valid_until, - size_t earlydata_max, - unsigned char *quic_tp, size_t quic_tp_len, - struct Curl_ssl_session **psession); +CURLcode Curl_ssl_session_create2(void *sdata, size_t sdata_len, + int ietf_tls_id, const char *alpn, + curl_off_t valid_until, size_t earlydata_max, + unsigned char *quic_tp, size_t quic_tp_len, + struct Curl_ssl_session **psession); /* Destroy a `session` instance. Can be called with NULL. * Does NOT need locking. */ diff --git a/lib/vtls/vtls_spack.c b/lib/vtls/vtls_spack.c index 070bb485a350..ac289f1b2f69 100644 --- a/lib/vtls/vtls_spack.c +++ b/lib/vtls/vtls_spack.c @@ -52,8 +52,8 @@ static CURLcode spack_enc8(struct dynbuf *buf, uint8_t b) return curlx_dyn_addn(buf, &b, 1); } -static CURLcode -spack_dec8(uint8_t *val, const uint8_t **src, const uint8_t *end) +static CURLcode spack_dec8(uint8_t *val, const uint8_t **src, + const uint8_t *end) { if(end - *src < 1) return CURLE_READ_ERROR; @@ -70,8 +70,8 @@ static CURLcode spack_enc16(struct dynbuf *buf, uint16_t val) return curlx_dyn_addn(buf, nval, sizeof(nval)); } -static CURLcode -spack_dec16(uint16_t *val, const uint8_t **src, const uint8_t *end) +static CURLcode spack_dec16(uint16_t *val, const uint8_t **src, + const uint8_t *end) { if(end - *src < 2) return CURLE_READ_ERROR; @@ -90,8 +90,8 @@ static CURLcode spack_enc32(struct dynbuf *buf, uint32_t val) return curlx_dyn_addn(buf, nval, sizeof(nval)); } -static CURLcode -spack_dec32(uint32_t *val, const uint8_t **src, const uint8_t *end) +static CURLcode spack_dec32(uint32_t *val, const uint8_t **src, + const uint8_t *end) { if(end - *src < 4) return CURLE_READ_ERROR; @@ -107,7 +107,7 @@ static CURLcode spack_enc64(struct dynbuf *buf, uint64_t val) nval[0] = (uint8_t)(val >> 56); nval[1] = (uint8_t)(val >> 48); nval[2] = (uint8_t)(val >> 40); - nval[3] = (uint8_t)(val >> 32); \ + nval[3] = (uint8_t)(val >> 32); nval[4] = (uint8_t)(val >> 24); nval[5] = (uint8_t)(val >> 16); nval[6] = (uint8_t)(val >> 8); @@ -115,8 +115,8 @@ static CURLcode spack_enc64(struct dynbuf *buf, uint64_t val) return curlx_dyn_addn(buf, nval, sizeof(nval)); } -static CURLcode -spack_dec64(uint64_t *val, const uint8_t **src, const uint8_t *end) +static CURLcode spack_dec64(uint64_t *val, const uint8_t **src, + const uint8_t *end) { if(end - *src < 8) return CURLE_READ_ERROR; @@ -141,8 +141,8 @@ static CURLcode spack_encstr16(struct dynbuf *buf, const char *s) return r; } -static CURLcode -spack_decstr16(char **val, const uint8_t **src, const uint8_t *end) +static CURLcode spack_decstr16(char **val, const uint8_t **src, + const uint8_t *end) { uint16_t slen; CURLcode r; @@ -158,8 +158,8 @@ spack_decstr16(char **val, const uint8_t **src, const uint8_t *end) return *val ? CURLE_OK : CURLE_OUT_OF_MEMORY; } -static CURLcode spack_encdata16(struct dynbuf *buf, - const uint8_t *data, size_t data_len) +static CURLcode spack_encdata16(struct dynbuf *buf, const uint8_t *data, + size_t data_len) { CURLcode r; if(data_len > UINT16_MAX) @@ -171,9 +171,8 @@ static CURLcode spack_encdata16(struct dynbuf *buf, return r; } -static CURLcode -spack_decdata16(uint8_t **val, size_t *val_len, - const uint8_t **src, const uint8_t *end) +static CURLcode spack_decdata16(uint8_t **val, size_t *val_len, + const uint8_t **src, const uint8_t *end) { uint16_t data_len; CURLcode r; diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index eae17078fd35..62bf723efd33 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -127,9 +127,9 @@ static CURLcode wssl_connect(struct Curl_cfilter *cf, * (--enable-opensslextra or --enable-all). */ #if defined(HAVE_SECRET_CALLBACK) && defined(WOLFSSL_TLS13) -static int -wssl_tls13_secret_callback(SSL *ssl, int id, const unsigned char *secret, - int secretSz, void *ctx) +static int wssl_tls13_secret_callback(SSL *ssl, int id, + const unsigned char *secret, + int secretSz, void *ctx) { const char *label; unsigned char client_random[SSL3_RANDOM_SIZE]; @@ -309,8 +309,7 @@ static long wssl_bio_cf_ctrl(WOLFSSL_BIO *bio, int cmd, long num, void *ptr) return ret; } -static int wssl_bio_cf_out_write(WOLFSSL_BIO *bio, - const char *buf, int blen) +static int wssl_bio_cf_out_write(WOLFSSL_BIO *bio, const char *buf, int blen) { struct Curl_cfilter *cf = wolfSSL_BIO_get_data(bio); struct ssl_connect_data *connssl = cf->ctx; @@ -487,7 +486,7 @@ static int wssl_vtls_new_session_cb(WOLFSSL *ssl, WOLFSSL_SESSION *session) { struct Curl_cfilter *cf; - cf = (struct Curl_cfilter*)wolfSSL_get_app_data(ssl); + cf = (struct Curl_cfilter *)wolfSSL_get_app_data(ssl); DEBUGASSERT(cf != NULL); if(cf && session) { struct ssl_connect_data *connssl = cf->ctx; @@ -535,8 +534,8 @@ static CURLcode wssl_on_session_reuse(struct Curl_cfilter *cf, connssl->earlydata_state = ssl_earlydata_await; connssl->state = ssl_connection_deferred; result = Curl_alpn_set_negotiated(cf, data, connssl, - (const unsigned char *)scs->alpn, - scs->alpn ? strlen(scs->alpn) : 0); + (const unsigned char *)scs->alpn, + scs->alpn ? strlen(scs->alpn) : 0); *do_early_data = !result; } return result; @@ -640,7 +639,7 @@ static CURLcode wssl_populate_x509_store(struct Curl_cfilter *cf, } #else infof(data, "ignoring native CA option because wolfSSL was built without " - "native CA support"); + "native CA support"); #endif } #endif /* !NO_FILESYSTEM */ @@ -688,7 +687,7 @@ static CURLcode wssl_populate_x509_store(struct Curl_cfilter *cf, /* Just continue with a warning if no strict certificate verification is required. */ infof(data, "error setting certificate verify locations," - " continuing anyway:"); + " continuing anyway:"); } } else { @@ -707,15 +706,15 @@ static CURLcode wssl_populate_x509_store(struct Curl_cfilter *cf, #define MPROTO_WSSL_X509_KEY "tls:wssl:x509:share" struct wssl_x509_share { - char *CAfile; /* CAfile path used to generate X509 store */ + char *CAfile; /* CAfile path used to generate X509 store */ WOLFSSL_X509_STORE *store; /* cached X509 store or NULL if none */ - struct curltime time; /* when the cached store was created */ + struct curltime time; /* when the cached store was created */ }; static void wssl_x509_share_free(void *key, size_t key_len, void *p) { struct wssl_x509_share *share = p; - DEBUGASSERT(key_len == (sizeof(MPROTO_WSSL_X509_KEY)-1)); + DEBUGASSERT(key_len == (sizeof(MPROTO_WSSL_X509_KEY) - 1)); DEBUGASSERT(!memcmp(MPROTO_WSSL_X509_KEY, key, key_len)); (void)key; (void)key_len; @@ -726,9 +725,8 @@ static void wssl_x509_share_free(void *key, size_t key_len, void *p) curlx_free(share); } -static bool -wssl_cached_x509_store_expired(const struct Curl_easy *data, - const struct wssl_x509_share *mb) +static bool wssl_cached_x509_store_expired(const struct Curl_easy *data, + const struct wssl_x509_share *mb) { const struct ssl_general_config *cfg = &data->set.general_ssl; struct curltime now = curlx_now(); @@ -741,9 +739,8 @@ wssl_cached_x509_store_expired(const struct Curl_easy *data, return elapsed_ms >= timeout_ms; } -static bool -wssl_cached_x509_store_different(struct Curl_cfilter *cf, - const struct wssl_x509_share *mb) +static bool wssl_cached_x509_store_different(struct Curl_cfilter *cf, + const struct wssl_x509_share *mb) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); if(!mb->CAfile || !conn_config->CAfile) @@ -762,7 +759,7 @@ static WOLFSSL_X509_STORE *wssl_get_cached_x509_store(struct Curl_cfilter *cf, DEBUGASSERT(multi); share = multi ? Curl_hash_pick(&multi->proto_hash, CURL_UNCONST(MPROTO_WSSL_X509_KEY), - sizeof(MPROTO_WSSL_X509_KEY)-1) : NULL; + sizeof(MPROTO_WSSL_X509_KEY) - 1) : NULL; if(share && share->store && !wssl_cached_x509_store_expired(data, share) && !wssl_cached_x509_store_different(cf, share)) { @@ -785,7 +782,7 @@ static void wssl_set_cached_x509_store(struct Curl_cfilter *cf, return; share = Curl_hash_pick(&multi->proto_hash, CURL_UNCONST(MPROTO_WSSL_X509_KEY), - sizeof(MPROTO_WSSL_X509_KEY)-1); + sizeof(MPROTO_WSSL_X509_KEY) - 1); if(!share) { share = curlx_calloc(1, sizeof(*share)); @@ -793,7 +790,7 @@ static void wssl_set_cached_x509_store(struct Curl_cfilter *cf, return; if(!Curl_hash_add2(&multi->proto_hash, CURL_UNCONST(MPROTO_WSSL_X509_KEY), - sizeof(MPROTO_WSSL_X509_KEY)-1, + sizeof(MPROTO_WSSL_X509_KEY) - 1, share, wssl_x509_share_free)) { curlx_free(share); return; @@ -876,8 +873,7 @@ CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf, } #ifdef WOLFSSL_TLS13 -static CURLcode -wssl_add_default_ciphers(bool tls13, struct dynbuf *buf) +static CURLcode wssl_add_default_ciphers(bool tls13, struct dynbuf *buf) { int i; char *str; @@ -905,8 +901,7 @@ wssl_add_default_ciphers(bool tls13, struct dynbuf *buf) /* 4.2.0 (2019) */ #if LIBWOLFSSL_VERSION_HEX < 0x04002000 || !defined(OPENSSL_EXTRA) -static int -wssl_legacy_CTX_set_min_proto_version(WOLFSSL_CTX* ctx, int version) +static int wssl_legacy_CTX_set_min_proto_version(WOLFSSL_CTX *ctx, int version) { int res; switch(version) { @@ -933,8 +928,8 @@ wssl_legacy_CTX_set_min_proto_version(WOLFSSL_CTX* ctx, int version) } return res; } -static int -wssl_legacy_CTX_set_max_proto_version(WOLFSSL_CTX* ctx, int version) + +static int wssl_legacy_CTX_set_max_proto_version(WOLFSSL_CTX *ctx, int version) { (void)ctx, (void)version; return WOLFSSL_NOT_IMPLEMENTED; @@ -1106,7 +1101,6 @@ static CURLcode ssl_version(struct Curl_easy *data, return CURLE_OK; } - #define QUIC_GROUPS "P-256:P-384:P-521" CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, @@ -1121,7 +1115,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, { struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); struct ssl_primary_config *conn_config; - WOLFSSL_METHOD* req_method = NULL; + WOLFSSL_METHOD *req_method = NULL; struct alpn_spec alpns; char *curves; #ifdef WOLFSSL_HAVE_KYBER @@ -1357,8 +1351,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, /* Ensure the Client Random is preserved. */ wolfSSL_KeepArrays(wctx->ssl); #if defined(HAVE_SECRET_CALLBACK) && defined(WOLFSSL_TLS13) - wolfSSL_set_tls13_secret_cb(wctx->ssl, - wssl_tls13_secret_callback, NULL); + wolfSSL_set_tls13_secret_cb(wctx->ssl, wssl_tls13_secret_callback, NULL); #endif } #endif /* OPENSSL_EXTRA */ @@ -1383,15 +1376,15 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, if(data->set.tls_ech == CURLECH_GREASE) { infof(data, "ECH: GREASE is done by default by wolfSSL: no need to ask"); } - if(data->set.tls_ech & CURLECH_CLA_CFG - && data->set.str[STRING_ECH_CONFIG]) { + if(data->set.tls_ech & CURLECH_CLA_CFG && + data->set.str[STRING_ECH_CONFIG]) { char *b64val = data->set.str[STRING_ECH_CONFIG]; word32 b64len = 0; - b64len = (word32) strlen(b64val); - if(b64len - && wolfSSL_SetEchConfigsBase64(wctx->ssl, b64val, b64len) - != WOLFSSL_SUCCESS) { + b64len = (word32)strlen(b64val); + if(b64len && + wolfSSL_SetEchConfigsBase64(wctx->ssl, + b64val, b64len) != WOLFSSL_SUCCESS) { if(data->set.tls_ech & CURLECH_HARD) { result = CURLE_SSL_CONNECT_ERROR; goto out; @@ -1424,8 +1417,8 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, size_t elen = rinfo->echconfiglist_len; infof(data, "ECH: ECHConfig from DoH HTTPS RR"); - if(wolfSSL_SetEchConfigs(wctx->ssl, ecl, (word32) elen) != - WOLFSSL_SUCCESS) { + if(wolfSSL_SetEchConfigs(wctx->ssl, ecl, (word32)elen) != + WOLFSSL_SUCCESS) { infof(data, "ECH: wolfSSL_SetEchConfigs failed"); if(data->set.tls_ech & CURLECH_HARD) { result = CURLE_SSL_CONNECT_ERROR; @@ -1476,8 +1469,8 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, * This function loads all the client/CA certificates and CRLs. Setup the TLS * layer and do all necessary magic. */ -static CURLcode -wssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode wssl_connect_step1(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; @@ -1542,9 +1535,7 @@ wssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OK; } - -static char *wssl_strerror(unsigned long error, char *buf, - unsigned long size) +static char *wssl_strerror(unsigned long error, char *buf, unsigned long size) { DEBUGASSERT(size > 40); *buf = '\0'; @@ -1665,8 +1656,7 @@ static CURLcode wssl_send_earlydata(struct Curl_cfilter *cf, } #endif /* WOLFSSL_EARLY_DATA */ -static CURLcode wssl_handshake(struct Curl_cfilter *cf, - struct Curl_easy *data) +static CURLcode wssl_handshake(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; @@ -1735,7 +1725,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, conn_config->verifyhost && !connssl->peer.sni) { /* we have an IP address as hostname. */ - WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(wssl->ssl); + WOLFSSL_X509 *cert = wolfSSL_get_peer_certificate(wssl->ssl); if(!cert) { failf(data, "unable to get peer certificate"); return CURLE_PEER_FAILED_VERIFICATION; @@ -1789,11 +1779,11 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, } else if(wssl->io_result) { switch(wssl->io_result) { - case CURLE_SEND_ERROR: - case CURLE_RECV_ERROR: - return CURLE_SSL_CONNECT_ERROR; - default: - return wssl->io_result; + case CURLE_SEND_ERROR: + case CURLE_RECV_ERROR: + return CURLE_SSL_CONNECT_ERROR; + default: + return wssl->io_result; } } #ifdef USE_ECH_WOLFSSL @@ -1804,8 +1794,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, int rv = 0; /* this currently does not produce the retry_configs */ - rv = wolfSSL_GetEchConfigs(wssl->ssl, echConfigs, - &echConfigsLen); + rv = wolfSSL_GetEchConfigs(wssl->ssl, echConfigs, &echConfigsLen); if(rv != WOLFSSL_SUCCESS) { infof(data, "Failed to get ECHConfigs"); } @@ -2087,7 +2076,6 @@ size_t Curl_wssl_version(char *buffer, size_t size) #endif } - static int wssl_init(void) { int ret; @@ -2101,7 +2089,6 @@ static int wssl_init(void) return ret; } - static void wssl_cleanup(void) { wssl_bio_cf_free_methods(); @@ -2111,7 +2098,6 @@ static void wssl_cleanup(void) #endif } - static bool wssl_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { @@ -2128,15 +2114,14 @@ static bool wssl_data_pending(struct Curl_cfilter *cf, return FALSE; } -void Curl_wssl_report_handshake(struct Curl_easy *data, - struct wssl_ctx *wssl) +void Curl_wssl_report_handshake(struct Curl_easy *data, struct wssl_ctx *wssl) { #if (LIBWOLFSSL_VERSION_HEX >= 0x03009010) - infof(data, "SSL connection using %s / %s", - wolfSSL_get_version(wssl->ssl), - wolfSSL_get_cipher_name(wssl->ssl)); + infof(data, "SSL connection using %s / %s", + wolfSSL_get_version(wssl->ssl), + wolfSSL_get_cipher_name(wssl->ssl)); #else - infof(data, "SSL connected"); + infof(data, "SSL connected"); #endif } diff --git a/lib/vtls/wolfssl.h b/lib/vtls/wolfssl.h index 7ff4cfb88178..5e3c9e2c5dd6 100644 --- a/lib/vtls/wolfssl.h +++ b/lib/vtls/wolfssl.h @@ -41,9 +41,9 @@ extern const struct Curl_ssl Curl_ssl_wolfssl; struct wssl_ctx { struct WOLFSSL_CTX *ssl_ctx; - struct WOLFSSL *ssl; - CURLcode io_result; /* result of last BIO cfilter operation */ - CURLcode hs_result; /* result of handshake */ + struct WOLFSSL *ssl; + CURLcode io_result; /* result of last BIO cfilter operation */ + CURLcode hs_result; /* result of handshake */ int io_send_blocked_len; /* length of last BIO write that EAGAIN-ed */ BIT(x509_store_setup); /* x509 store has been set up */ BIT(shutting_down); /* TLS is being shut down */ @@ -88,8 +88,7 @@ CURLcode Curl_wssl_verify_pinned(struct Curl_cfilter *cf, struct Curl_easy *data, struct wssl_ctx *wssl); -void Curl_wssl_report_handshake(struct Curl_easy *data, - struct wssl_ctx *wssl); +void Curl_wssl_report_handshake(struct Curl_easy *data, struct wssl_ctx *wssl); #endif /* USE_WOLFSSL */ #endif /* HEADER_CURL_WOLFSSL_H */ diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index fcc0d0e1daf2..f63a9fcb9928 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -192,7 +192,7 @@ static const char *getASN1Element_(struct Curl_asn1Element *elem, /* Process header byte. */ elem->header = beg; - b = (unsigned char) *beg++; + b = (unsigned char)*beg++; elem->constructed = (b & 0x20) != 0; elem->eclass = (b >> 6) & 3; b &= 0x1F; @@ -203,7 +203,7 @@ static const char *getASN1Element_(struct Curl_asn1Element *elem, /* Process length. */ if(beg >= end) return NULL; - b = (unsigned char) *beg++; + b = (unsigned char)*beg++; if(!(b & 0x80)) len = b; else if(!(b &= 0x7F)) { @@ -284,7 +284,7 @@ static CURLcode bool2str(struct dynbuf *store, { if(end - beg != 1) return CURLE_BAD_FUNCTION_ARGUMENT; - return curlx_dyn_add(store, *beg ? "TRUE": "FALSE"); + return curlx_dyn_add(store, *beg ? "TRUE" : "FALSE"); } /* @@ -298,13 +298,12 @@ static CURLcode octet2str(struct dynbuf *store, CURLcode result = CURLE_OK; while(!result && beg < end) - result = curlx_dyn_addf(store, "%02x:", (unsigned char) *beg++); + result = curlx_dyn_addf(store, "%02x:", (unsigned char)*beg++); return result; } -static CURLcode bit2str(struct dynbuf *store, - const char *beg, const char *end) +static CURLcode bit2str(struct dynbuf *store, const char *beg, const char *end) { /* Convert an ASN.1 bit string to a printable string. */ @@ -318,8 +317,7 @@ static CURLcode bit2str(struct dynbuf *store, * * Returns error. */ -static CURLcode int2str(struct dynbuf *store, - const char *beg, const char *end) +static CURLcode int2str(struct dynbuf *store, const char *beg, const char *end) { unsigned int val = 0; size_t n = end - beg; @@ -335,7 +333,7 @@ static CURLcode int2str(struct dynbuf *store, val = ~val; do - val = (val << 8) | *(const unsigned char *) beg++; + val = (val << 8) | *(const unsigned char *)beg++; while(beg < end); return curlx_dyn_addf(store, "%s%x", val >= 10 ? "0x" : "", val); } @@ -348,8 +346,8 @@ static CURLcode int2str(struct dynbuf *store, * * Returns error. */ -static CURLcode -utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) +static CURLcode utf8asn1str(struct dynbuf *to, int type, const char *from, + const char *end) { size_t inlength = end - from; int size = 1; @@ -390,14 +388,14 @@ utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) switch(size) { case 4: - wc = (wc << 8) | *(const unsigned char *) from++; - wc = (wc << 8) | *(const unsigned char *) from++; + wc = (wc << 8) | *(const unsigned char *)from++; + wc = (wc << 8) | *(const unsigned char *)from++; FALLTHROUGH(); case 2: - wc = (wc << 8) | *(const unsigned char *) from++; + wc = (wc << 8) | *(const unsigned char *)from++; FALLTHROUGH(); default: /* case 1: */ - wc = (wc << 8) | *(const unsigned char *) from++; + wc = (wc << 8) | *(const unsigned char *)from++; } if(wc >= 0x00000080) { if(wc >= 0x00000800) { @@ -406,19 +404,19 @@ utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) /* Invalid char. size for target encoding. */ return CURLE_WEIRD_SERVER_REPLY; } - buf[3] = (char) (0x80 | (wc & 0x3F)); + buf[3] = (char)(0x80 | (wc & 0x3F)); wc = (wc >> 6) | 0x00010000; charsize++; } - buf[2] = (char) (0x80 | (wc & 0x3F)); + buf[2] = (char)(0x80 | (wc & 0x3F)); wc = (wc >> 6) | 0x00000800; charsize++; } - buf[1] = (char) (0x80 | (wc & 0x3F)); + buf[1] = (char)(0x80 | (wc & 0x3F)); wc = (wc >> 6) | 0x000000C0; charsize++; } - buf[0] = (char) wc; + buf[0] = (char)wc; result = curlx_dyn_addn(to, buf, charsize); } } @@ -438,7 +436,7 @@ static CURLcode encodeOID(struct dynbuf *store, CURLcode result = CURLE_OK; /* Process the first two numbers. */ - y = *(const unsigned char *) beg++; + y = *(const unsigned char *)beg++; x = y / 40; y -= x * 40; @@ -452,7 +450,7 @@ static CURLcode encodeOID(struct dynbuf *store, do { if(x & 0xFF000000) return CURLE_OK; - y = *(const unsigned char *) beg++; + y = *(const unsigned char *)beg++; x = (x << 7) | (y & 0x7F); } while(y & 0x80); result = curlx_dyn_addf(store, ".%u", x); @@ -973,8 +971,8 @@ static CURLcode do_pubkey_field(struct Curl_easy *data, int certnum, } /* return 0 on success, 1 on error */ -static int do_pubkey(struct Curl_easy *data, int certnum, - const char *algo, struct Curl_asn1Element *param, +static int do_pubkey(struct Curl_easy *data, int certnum, const char *algo, + struct Curl_asn1Element *param, struct Curl_asn1Element *pubkey) { struct Curl_asn1Element elem; @@ -1019,7 +1017,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, len = ((elem.end - q) * 8); if(len) { unsigned int i; - for(i = *(const unsigned char *) q; !(i & 0x80); i <<= 1) + for(i = *(const unsigned char *)q; !(i & 0x80); i <<= 1) len--; } if(len > 32) @@ -1078,8 +1076,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, * Convert an ASN.1 distinguished name into a printable string. * Return error. */ -static CURLcode DNtostr(struct dynbuf *store, - struct Curl_asn1Element *dn) +static CURLcode DNtostr(struct dynbuf *store, struct Curl_asn1Element *dn) { return encodeDN(store, dn); } @@ -1135,7 +1132,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, /* Version (always fits in less than 32 bits). */ version = 0; for(ptr = cert.version.beg; ptr < cert.version.end; ptr++) - version = (version << 8) | *(const unsigned char *) ptr; + version = (version << 8) | *(const unsigned char *)ptr; if(data->set.ssl.certinfo) { result = curlx_dyn_addf(&out, "%x", version); if(result) @@ -1163,8 +1160,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, if(result) goto done; if(data->set.ssl.certinfo) { - result = ssl_push_certinfo_dyn(data, certnum, "Signature Algorithm", - &out); + result = ssl_push_certinfo_dyn(data, certnum, "Signature Algorithm", &out); if(result) goto done; } From 47a1ab2ebecb21485c0e955316d90511e80a3c43 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 22:37:26 +0100 Subject: [PATCH 594/885] lib: fix formatting nits (part 1) From `lib/a*` to `lib/cs*`. Closes #19764 --- lib/altsvc.c | 1 - lib/altsvc.h | 2 +- lib/amigaos.c | 12 ++-- lib/arpa_telnet.h | 12 ++-- lib/asyn-ares.c | 22 +++---- lib/asyn-base.c | 8 +-- lib/asyn-thrdd.c | 15 ++--- lib/asyn.h | 20 +++--- lib/bufq.c | 3 +- lib/bufq.h | 2 +- lib/bufref.c | 2 +- lib/bufref.h | 1 - lib/cf-h1-proxy.c | 40 ++++++------ lib/cf-h1-proxy.h | 1 - lib/cf-h2-proxy.c | 159 +++++++++++++++++++++++----------------------- lib/cf-haproxy.c | 8 +-- lib/cf-ip-happy.c | 90 +++++++++++++------------- lib/cf-socket.c | 117 +++++++++++++++++----------------- lib/cf-socket.h | 2 +- lib/cfilters.c | 19 +++--- lib/cfilters.h | 55 ++++++++-------- lib/conncache.c | 18 ++---- lib/conncache.h | 3 +- lib/connect.c | 64 +++++++++---------- lib/connect.h | 12 ++-- lib/cookie.c | 61 ++++++++---------- lib/cookie.h | 40 ++++++------ lib/cshutdn.c | 20 ++---- 28 files changed, 377 insertions(+), 432 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index 84f6c1b44547..cbaf4b4d85f9 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -64,7 +64,6 @@ const char *Curl_alpnid2str(enum alpnid id) } } - static void altsvc_free(struct altsvc *as) { curlx_free(as->src.host); diff --git a/lib/altsvc.h b/lib/altsvc.h index 831cd097436a..d370b4e4b195 100644 --- a/lib/altsvc.h +++ b/lib/altsvc.h @@ -68,7 +68,7 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, const int versions); /* CURLALTSVC_H* bits */ #else /* disabled */ -#define Curl_altsvc_save(a,b,c) +#define Curl_altsvc_save(a, b, c) #define Curl_altsvc_cleanup(x) #endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */ #endif /* HEADER_CURL_ALTSVC_H */ diff --git a/lib/amigaos.c b/lib/amigaos.c index e4b678d54185..d32ee5e7902f 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -120,8 +120,7 @@ void Curl_amiga_cleanup(void) * allocates memory also. */ -struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, - int port) +struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, int port) { struct Curl_addrinfo *ai = NULL; struct hostent *h; @@ -144,7 +143,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, } } else { - #ifdef CURLRES_THREADED +#ifdef CURLRES_THREADED /* gethostbyname() is not thread safe, so we need to reopen bsdsocket * on the thread's context */ @@ -160,13 +159,13 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, } CloseLibrary(base); } - #else +#else /* not using threaded resolver - safe to use this as-is */ h = gethostbyname(hostname); if(h) { ai = Curl_he2ai(h, port); } - #endif +#endif } return ai; @@ -219,8 +218,7 @@ CURLcode Curl_amiga_init(void) } if(SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG)&errno, - SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG)"curl", - TAG_DONE)) { + SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG)"curl", TAG_DONE)) { CURL_AMIGA_REQUEST("SocketBaseTags ERROR"); return CURLE_FAILED_INIT; } diff --git a/lib/arpa_telnet.h b/lib/arpa_telnet.h index 055aa98b1096..daf2487fc616 100644 --- a/lib/arpa_telnet.h +++ b/lib/arpa_telnet.h @@ -43,8 +43,7 @@ /* * The telnet options represented as strings */ -static const char * const telnetoptions[]= -{ +static const char * const telnetoptions[] = { "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP", "NAOCRD", "NAOHTS", @@ -86,8 +85,7 @@ static const char * const telnetoptions[]= /* * Then those numbers represented as strings: */ -static const char * const telnetcmds[]= -{ +static const char * const telnetcmds[] = { "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", @@ -103,11 +101,11 @@ static const char * const telnetcmds[]= #define CURL_TELQUAL_INFO 2 #define CURL_TELQUAL_NAME 3 -#define CURL_TELCMD_OK(x) ( ((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \ - ((unsigned int)(x) <= CURL_TELCMD_MAXIMUM) ) +#define CURL_TELCMD_OK(x) (((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \ + ((unsigned int)(x) <= CURL_TELCMD_MAXIMUM)) #ifndef CURL_DISABLE_VERBOSE_STRINGS -#define CURL_TELCMD(x) telnetcmds[(x)-CURL_TELCMD_MINIMUM] +#define CURL_TELCMD(x) telnetcmds[(x) - CURL_TELCMD_MINIMUM] #else #define CURL_TELCMD(x) "" #endif diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index e3ba512b77ff..ce4f866be6d2 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -140,7 +140,6 @@ void Curl_async_global_cleanup(void) #endif } - static void sock_state_cb(void *data, ares_socket_t socket_fd, int readable, int writable) { @@ -309,12 +308,12 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, /* Now that we have checked for any last minute results above, see if there are any responses still pending when the EXPIRE_HAPPY_EYEBALLS_DNS timer expires. */ - if(ares->num_pending + if(ares->num_pending && /* This is only set to non-zero if the timer was started. */ - && (ares->happy_eyeballs_dns_time.tv_sec - || ares->happy_eyeballs_dns_time.tv_usec) - && (curlx_timediff_ms(curlx_now(), ares->happy_eyeballs_dns_time) - >= HAPPY_EYEBALLS_DNS_TIMEOUT)) { + (ares->happy_eyeballs_dns_time.tv_sec || + ares->happy_eyeballs_dns_time.tv_usec) && + (curlx_timediff_ms(curlx_now(), ares->happy_eyeballs_dns_time) >= + HAPPY_EYEBALLS_DNS_TIMEOUT)) { /* Remember that the EXPIRE_HAPPY_EYEBALLS_DNS timer is no longer running. */ memset(&ares->happy_eyeballs_dns_time, 0, @@ -418,8 +417,8 @@ CURLcode Curl_async_await(struct Curl_easy *data, itimeout_ms = (int)timeout_ms; #endif - max_timeout.tv_sec = itimeout_ms/1000; - max_timeout.tv_usec = (itimeout_ms%1000)*1000; + max_timeout.tv_sec = itimeout_ms / 1000; + max_timeout.tv_usec = (itimeout_ms % 1000) * 1000; real_timeout = ares_timeout(ares->channel, &max_timeout, &time_buf); @@ -427,7 +426,7 @@ CURLcode Curl_async_await(struct Curl_easy *data, second is left, otherwise just use 1000ms to make sure the progress callback gets called frequent enough */ if(!real_timeout->tv_sec) - call_timeout_ms = (timediff_t)(real_timeout->tv_usec/1000); + call_timeout_ms = (timediff_t)(real_timeout->tv_usec / 1000); else call_timeout_ms = 1000; @@ -518,7 +517,7 @@ static void async_ares_hostbyname_cb(void *user_data, if(ARES_SUCCESS == status) { ares->ares_status = status; /* one success overrules any error */ async_addr_concat(&ares->temp_ai, - Curl_he2ai(hostent, data->state.async.port)); + Curl_he2ai(hostent, data->state.async.port)); } else if(ares->ares_status != ARES_SUCCESS) { /* no success so far, remember last error */ @@ -586,8 +585,7 @@ static void async_ares_hostbyname_cb(void *user_data, c-ares retry cycle each request is. */ ares->happy_eyeballs_dns_time = curlx_now(); - Curl_expire(data, HAPPY_EYEBALLS_DNS_TIMEOUT, - EXPIRE_HAPPY_EYEBALLS_DNS); + Curl_expire(data, HAPPY_EYEBALLS_DNS_TIMEOUT, EXPIRE_HAPPY_EYEBALLS_DNS); } } diff --git a/lib/asyn-base.c b/lib/asyn-base.c index 6338a3fc6e25..5358fcb8fa54 100644 --- a/lib/asyn-base.c +++ b/lib/asyn-base.c @@ -59,7 +59,6 @@ **********************************************************************/ #ifdef CURLRES_ASYNCH - #ifdef USE_ARES #if ARES_VERSION < 0x010600 @@ -122,8 +121,7 @@ CURLcode Curl_ares_pollset(struct Curl_easy *data, * * return number of sockets it worked on, or -1 on error */ -int Curl_ares_perform(ares_channel channel, - timediff_t timeout_ms) +int Curl_ares_perform(ares_channel channel, timediff_t timeout_ms) { int nfds; int bitmask; @@ -142,11 +140,11 @@ int Curl_ares_perform(ares_channel channel, pfd[i].revents = 0; if(ARES_GETSOCK_READABLE(bitmask, i)) { pfd[i].fd = socks[i]; - pfd[i].events |= POLLRDNORM|POLLIN; + pfd[i].events |= POLLRDNORM | POLLIN; } if(ARES_GETSOCK_WRITABLE(bitmask, i)) { pfd[i].fd = socks[i]; - pfd[i].events |= POLLWRNORM|POLLOUT; + pfd[i].events |= POLLWRNORM | POLLOUT; } if(pfd[i].events) num++; diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index 6c2e02fd1871..e5bf0629d38f 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -45,13 +45,13 @@ #endif #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) -# include +#include #endif #ifdef HAVE_GETADDRINFO -# define RESOLVER_ENOMEM EAI_MEMORY /* = WSA_NOT_ENOUGH_MEMORY on Windows */ +#define RESOLVER_ENOMEM EAI_MEMORY /* = WSA_NOT_ENOUGH_MEMORY on Windows */ #else -# define RESOLVER_ENOMEM SOCKENOMEM +#define RESOLVER_ENOMEM SOCKENOMEM #endif #include "urldata.h" @@ -245,7 +245,6 @@ static CURL_THREAD_RETURN_T CURL_STDCALL getaddrinfo_thread(void *arg) } } #endif - } addr_ctx_unlink(&addr_ctx, NULL); @@ -486,8 +485,8 @@ static void async_thrdd_shutdown(struct Curl_easy *data) Curl_mutex_acquire(&addr_ctx->mutx); #ifndef CURL_DISABLE_SOCKETPAIR - if(!addr_ctx->do_abort) - Curl_multi_will_close(data, addr_ctx->sock_pair[0]); + if(!addr_ctx->do_abort) + Curl_multi_will_close(data, addr_ctx->sock_pair[0]); #endif addr_ctx->do_abort = TRUE; done = addr_ctx->thrd_done; @@ -703,7 +702,7 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) if(!thrd_done) { #ifndef CURL_DISABLE_SOCKETPAIR - /* return read fd to client for polling the DNS resolution status */ + /* return read fd to client for polling the DNS resolution status */ result = Curl_pollset_add_in(data, ps, thrdd->addr->sock_pair[0]); #else timediff_t milli; @@ -711,7 +710,7 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) if(ms < 3) milli = 0; else if(ms <= 50) - milli = ms/3; + milli = ms / 3; else if(ms <= 250) milli = 50; else diff --git a/lib/asyn.h b/lib/asyn.h index 8da7dd9720cc..e5e472e247db 100644 --- a/lib/asyn.h +++ b/lib/asyn.h @@ -129,19 +129,18 @@ CURLcode Curl_ares_pollset(struct Curl_easy *data, ares_channel channel, struct easy_pollset *ps); -int Curl_ares_perform(ares_channel channel, - timediff_t timeout_ms); +int Curl_ares_perform(ares_channel channel, timediff_t timeout_ms); #endif #ifdef CURLRES_ARES /* async resolving implementation using c-ares alone */ struct async_ares_ctx { ares_channel channel; - int num_pending; /* number of outstanding c-ares requests */ + int num_pending; /* number of outstanding c-ares requests */ struct Curl_addrinfo *temp_ai; /* intermediary result while fetching c-ares parts */ - int ares_status; /* ARES_SUCCESS, ARES_ENOTFOUND, etc. */ - CURLcode result; /* CURLE_OK or error handling response */ + int ares_status; /* ARES_SUCCESS, ARES_ENOTFOUND, etc. */ + CURLcode result; /* CURLE_OK or error handling response */ #ifndef HAVE_CARES_GETADDRINFO struct curltime happy_eyeballs_dns_time; /* when this timer started, or 0 */ #endif @@ -223,11 +222,11 @@ struct doh_probes; #else /* CURLRES_ASYNCH */ /* convert these functions if an asynch resolver is not used */ -#define Curl_async_get_impl(x,y) (*(y) = NULL, CURLE_OK) -#define Curl_async_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST -#define Curl_async_await(x,y) CURLE_COULDNT_RESOLVE_HOST -#define Curl_async_global_init() CURLE_OK -#define Curl_async_global_cleanup() Curl_nop_stmt +#define Curl_async_get_impl(x, y) (*(y) = NULL, CURLE_OK) +#define Curl_async_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST +#define Curl_async_await(x, y) CURLE_COULDNT_RESOLVE_HOST +#define Curl_async_global_init() CURLE_OK +#define Curl_async_global_cleanup() Curl_nop_stmt #endif /* !CURLRES_ASYNCH */ @@ -270,6 +269,5 @@ void Curl_async_destroy(struct Curl_easy *data); #define Curl_async_destroy(x) Curl_nop_stmt #endif /* USE_CURL_ASYNC */ - /********** end of generic resolver interface functions *****************/ #endif /* HEADER_CURL_ASYN_H */ diff --git a/lib/bufq.c b/lib/bufq.c index 5a77fc52d4b3..6eeeeb35d432 100644 --- a/lib/bufq.c +++ b/lib/bufq.c @@ -143,7 +143,6 @@ static void chunk_list_free(struct buf_chunk **anchor) } } - void Curl_bufcp_init(struct bufc_pool *pool, size_t chunk_size, size_t spare_max) { @@ -330,7 +329,7 @@ static void prune_head(struct bufq *q) --q->chunk_count; } else if((q->chunk_count > q->max_chunks) || - (q->opts & BUFQ_OPT_NO_SPARES)) { + (q->opts & BUFQ_OPT_NO_SPARES)) { /* SOFT_LIMIT allowed us more than max. free spares until * we are at max again. Or free them if we are configured * to not use spares. */ diff --git a/lib/bufq.h b/lib/bufq.h index 9557e5d33bba..112388a6bf47 100644 --- a/lib/bufq.h +++ b/lib/bufq.h @@ -38,7 +38,7 @@ struct buf_chunk { size_t r_offset; /* first unread bytes */ size_t w_offset; /* one after last written byte */ union { - uint8_t data[1]; /* the buffer for `dlen` bytes */ + uint8_t data[1]; /* the buffer for `dlen` bytes */ void *dummy; /* alignment */ } x; }; diff --git a/lib/bufref.c b/lib/bufref.c index d5181a5da662..643fe5d2e08c 100644 --- a/lib/bufref.c +++ b/lib/bufref.c @@ -76,7 +76,7 @@ void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len, DEBUGASSERT(len <= CURL_MAX_INPUT_LENGTH); Curl_bufref_free(br); - br->ptr = (const unsigned char *) ptr; + br->ptr = (const unsigned char *)ptr; br->len = len; br->dtor = dtor; } diff --git a/lib/bufref.h b/lib/bufref.h index dd424f18f556..f80011fde5ec 100644 --- a/lib/bufref.h +++ b/lib/bufref.h @@ -36,7 +36,6 @@ struct bufref { #endif }; - void Curl_bufref_init(struct bufref *br); void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len, void (*dtor)(void *)); diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 84ba3d6193fa..19c63a12b049 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -48,12 +48,12 @@ typedef enum { - H1_TUNNEL_INIT, /* init/default/no tunnel state */ - H1_TUNNEL_CONNECT, /* CONNECT request is being send */ - H1_TUNNEL_RECEIVE, /* CONNECT answer is being received */ - H1_TUNNEL_RESPONSE, /* CONNECT response received completely */ - H1_TUNNEL_ESTABLISHED, - H1_TUNNEL_FAILED + H1_TUNNEL_INIT, /* init/default/no tunnel state */ + H1_TUNNEL_CONNECT, /* CONNECT request is being send */ + H1_TUNNEL_RECEIVE, /* CONNECT answer is being received */ + H1_TUNNEL_RESPONSE, /* CONNECT response received completely */ + H1_TUNNEL_ESTABLISHED, + H1_TUNNEL_FAILED } h1_tunnel_state; /* struct for HTTP CONNECT tunneling */ @@ -74,7 +74,6 @@ struct h1_tunnel_state { BIT(close_connection); }; - static bool tunnel_is_established(struct h1_tunnel_state *ts) { return ts && (ts->tunnel_state == H1_TUNNEL_ESTABLISHED); @@ -209,9 +208,9 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, int http_minor; CURLcode result; - /* This only happens if we have looped here due to authentication - reasons, and we do not really use the newly cloned URL here - then. Just free it. */ + /* This only happens if we have looped here due to authentication + reasons, and we do not really use the newly cloned URL here + then. Just free it. */ Curl_safefree(data->req.newurl); result = Curl_http_proxy_create_CONNECT(&req, cf, data, 1); @@ -281,10 +280,8 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, struct SingleRequest *k = &data->req; (void)cf; - if((checkprefix("WWW-Authenticate:", header) && - (401 == k->httpcode)) || - (checkprefix("Proxy-authenticate:", header) && - (407 == k->httpcode))) { + if((checkprefix("WWW-Authenticate:", header) && (401 == k->httpcode)) || + (checkprefix("Proxy-authenticate:", header) && (407 == k->httpcode))) { bool proxy = (k->httpcode == 407); char *auth = Curl_copy_header_value(header); @@ -300,7 +297,7 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, return result; } else if(checkprefix("Content-Length:", header)) { - if(k->httpcode/100 == 2) { + if(k->httpcode / 100 == 2) { /* A client MUST ignore any Content-Length or Transfer-Encoding header fields received in a successful response to CONNECT. "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 */ @@ -319,7 +316,7 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, STRCONST("Connection:"), STRCONST("close"))) ts->close_connection = TRUE; else if(checkprefix("Transfer-Encoding:", header)) { - if(k->httpcode/100 == 2) { + if(k->httpcode / 100 == 2) { /* A client MUST ignore any Content-Length or Transfer-Encoding header fields received in a successful response to CONNECT. "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 */ @@ -493,8 +490,8 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, ts->keepon = KEEPON_DONE; } - DEBUGASSERT(ts->keepon == KEEPON_IGNORE - || ts->keepon == KEEPON_DONE); + DEBUGASSERT(ts->keepon == KEEPON_IGNORE || + ts->keepon == KEEPON_DONE); continue; } @@ -508,7 +505,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, if(error) result = CURLE_RECV_ERROR; *done = (ts->keepon == KEEPON_DONE); - if(!result && *done && data->info.httpproxycode/100 != 2) { + if(!result && *done && data->info.httpproxycode / 100 != 2) { /* Deal with the possibly already received authenticate headers. 'newurl' is set to a new URL if we must loop. */ result = Curl_http_auth_act(data); @@ -603,7 +600,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, } while(data->req.newurl); DEBUGASSERT(ts->tunnel_state == H1_TUNNEL_RESPONSE); - if(data->info.httpproxycode/100 != 2) { + if(data->info.httpproxycode / 100 != 2) { /* a non-2xx response and we have no next URL to try. */ Curl_safefree(data->req.newurl); h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data); @@ -716,10 +713,9 @@ static void cf_h1_proxy_close(struct Curl_cfilter *cf, } } - struct Curl_cftype Curl_cft_h1_proxy = { "H1-PROXY", - CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, + CF_TYPE_IP_CONNECT | CF_TYPE_PROXY, 0, cf_h1_proxy_destroy, cf_h1_proxy_connect, diff --git a/lib/cf-h1-proxy.h b/lib/cf-h1-proxy.h index ac5bed0b2bc7..ded55db9df31 100644 --- a/lib/cf-h1-proxy.h +++ b/lib/cf-h1-proxy.h @@ -33,7 +33,6 @@ CURLcode Curl_cf_h1_proxy_insert_after(struct Curl_cfilter *cf, extern struct Curl_cftype Curl_cft_h1_proxy; - #endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */ #endif /* HEADER_CURL_H1_PROXY_H */ diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index 7066db3b4c4a..fb2586d1d0e5 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -45,12 +45,12 @@ #include "curlx/warnless.h" #include "cf-h2-proxy.h" -#define PROXY_H2_CHUNK_SIZE (16*1024) +#define PROXY_H2_CHUNK_SIZE (16 * 1024) #define PROXY_HTTP2_HUGE_WINDOW_SIZE (100 * 1024 * 1024) #define H2_TUNNEL_WINDOW_SIZE (10 * 1024 * 1024) -#define PROXY_H2_NW_RECV_CHUNKS (H2_TUNNEL_WINDOW_SIZE / PROXY_H2_CHUNK_SIZE) +#define PROXY_H2_NW_RECV_CHUNKS (H2_TUNNEL_WINDOW_SIZE / PROXY_H2_CHUNK_SIZE) #define PROXY_H2_NW_SEND_CHUNKS 1 #define H2_TUNNEL_RECV_CHUNKS (H2_TUNNEL_WINDOW_SIZE / PROXY_H2_CHUNK_SIZE) @@ -58,11 +58,11 @@ typedef enum { - H2_TUNNEL_INIT, /* init/default/no tunnel state */ - H2_TUNNEL_CONNECT, /* CONNECT request is being send */ - H2_TUNNEL_RESPONSE, /* CONNECT response received completely */ - H2_TUNNEL_ESTABLISHED, - H2_TUNNEL_FAILED + H2_TUNNEL_INIT, /* init/default/no tunnel state */ + H2_TUNNEL_CONNECT, /* CONNECT request is being send */ + H2_TUNNEL_RESPONSE, /* CONNECT response received completely */ + H2_TUNNEL_ESTABLISHED, + H2_TUNNEL_FAILED } h2_tunnel_state; struct tunnel_stream { @@ -94,7 +94,7 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf, Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip); /* host:port with IPv6 support */ - ts->authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname, + ts->authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname, ipv6_ip ? "]" : "", port); if(!ts->authority) return CURLE_OUT_OF_MEMORY; @@ -184,8 +184,7 @@ struct cf_h2_proxy_ctx { /* How to access `call_data` from a cf_h2 filter */ #undef CF_CTX_CALL_DATA -#define CF_CTX_CALL_DATA(cf) \ - ((struct cf_h2_proxy_ctx *)(cf)->ctx)->call_data +#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_proxy_ctx *)(cf)->ctx)->call_data static void cf_h2_proxy_ctx_clear(struct cf_h2_proxy_ctx *ctx) { @@ -542,70 +541,70 @@ static int proxy_h2_fr_print(const nghttp2_frame *frame, char *buffer, size_t blen) { switch(frame->hd.type) { - case NGHTTP2_DATA: { - return curl_msnprintf(buffer, blen, - "FRAME[DATA, len=%d, eos=%d, padlen=%d]", - (int)frame->hd.length, - !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM), - (int)frame->data.padlen); + case NGHTTP2_DATA: { + return curl_msnprintf(buffer, blen, + "FRAME[DATA, len=%d, eos=%d, padlen=%d]", + (int)frame->hd.length, + !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM), + (int)frame->data.padlen); + } + case NGHTTP2_HEADERS: { + return curl_msnprintf(buffer, blen, + "FRAME[HEADERS, len=%d, hend=%d, eos=%d]", + (int)frame->hd.length, + !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS), + !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)); + } + case NGHTTP2_PRIORITY: { + return curl_msnprintf(buffer, blen, + "FRAME[PRIORITY, len=%d, flags=%d]", + (int)frame->hd.length, frame->hd.flags); + } + case NGHTTP2_RST_STREAM: { + return curl_msnprintf(buffer, blen, + "FRAME[RST_STREAM, len=%d, flags=%d, error=%u]", + (int)frame->hd.length, frame->hd.flags, + frame->rst_stream.error_code); + } + case NGHTTP2_SETTINGS: { + if(frame->hd.flags & NGHTTP2_FLAG_ACK) { + return curl_msnprintf(buffer, blen, "FRAME[SETTINGS, ack=1]"); } - case NGHTTP2_HEADERS: { - return curl_msnprintf(buffer, blen, - "FRAME[HEADERS, len=%d, hend=%d, eos=%d]", - (int)frame->hd.length, - !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS), - !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)); - } - case NGHTTP2_PRIORITY: { - return curl_msnprintf(buffer, blen, - "FRAME[PRIORITY, len=%d, flags=%d]", - (int)frame->hd.length, frame->hd.flags); - } - case NGHTTP2_RST_STREAM: { - return curl_msnprintf(buffer, blen, - "FRAME[RST_STREAM, len=%d, flags=%d, error=%u]", - (int)frame->hd.length, frame->hd.flags, - frame->rst_stream.error_code); - } - case NGHTTP2_SETTINGS: { - if(frame->hd.flags & NGHTTP2_FLAG_ACK) { - return curl_msnprintf(buffer, blen, "FRAME[SETTINGS, ack=1]"); - } - return curl_msnprintf(buffer, blen, - "FRAME[SETTINGS, len=%d]", (int)frame->hd.length); - } - case NGHTTP2_PUSH_PROMISE: - return curl_msnprintf(buffer, blen, - "FRAME[PUSH_PROMISE, len=%d, hend=%d]", - (int)frame->hd.length, - !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS)); - case NGHTTP2_PING: - return curl_msnprintf(buffer, blen, - "FRAME[PING, len=%d, ack=%d]", - (int)frame->hd.length, - frame->hd.flags & NGHTTP2_FLAG_ACK); - case NGHTTP2_GOAWAY: { - char scratch[128]; - size_t s_len = CURL_ARRAYSIZE(scratch); - size_t len = (frame->goaway.opaque_data_len < s_len) ? - frame->goaway.opaque_data_len : s_len-1; - if(len) - memcpy(scratch, frame->goaway.opaque_data, len); - scratch[len] = '\0'; - return curl_msnprintf(buffer, blen, - "FRAME[GOAWAY, error=%d, reason='%s', " - "last_stream=%d]", frame->goaway.error_code, - scratch, frame->goaway.last_stream_id); - } - case NGHTTP2_WINDOW_UPDATE: { - return curl_msnprintf(buffer, blen, - "FRAME[WINDOW_UPDATE, incr=%d]", - frame->window_update.window_size_increment); - } - default: - return curl_msnprintf(buffer, blen, "FRAME[%d, len=%d, flags=%d]", - frame->hd.type, (int)frame->hd.length, - frame->hd.flags); + return curl_msnprintf(buffer, blen, + "FRAME[SETTINGS, len=%d]", (int)frame->hd.length); + } + case NGHTTP2_PUSH_PROMISE: + return curl_msnprintf(buffer, blen, + "FRAME[PUSH_PROMISE, len=%d, hend=%d]", + (int)frame->hd.length, + !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS)); + case NGHTTP2_PING: + return curl_msnprintf(buffer, blen, + "FRAME[PING, len=%d, ack=%d]", + (int)frame->hd.length, + frame->hd.flags & NGHTTP2_FLAG_ACK); + case NGHTTP2_GOAWAY: { + char scratch[128]; + size_t s_len = CURL_ARRAYSIZE(scratch); + size_t len = (frame->goaway.opaque_data_len < s_len) ? + frame->goaway.opaque_data_len : s_len-1; + if(len) + memcpy(scratch, frame->goaway.opaque_data, len); + scratch[len] = '\0'; + return curl_msnprintf(buffer, blen, + "FRAME[GOAWAY, error=%d, reason='%s', " + "last_stream=%d]", frame->goaway.error_code, + scratch, frame->goaway.last_stream_id); + } + case NGHTTP2_WINDOW_UPDATE: { + return curl_msnprintf(buffer, blen, + "FRAME[WINDOW_UPDATE, incr=%d]", + frame->window_update.window_size_increment); + } + default: + return curl_msnprintf(buffer, blen, "FRAME[%d, len=%d, flags=%d]", + frame->hd.type, (int)frame->hd.length, + frame->hd.flags); } } @@ -621,7 +620,7 @@ static int proxy_h2_on_frame_send(nghttp2_session *session, if(data && Curl_trc_cf_is_verbose(cf, data)) { char buffer[256]; int len; - len = proxy_h2_fr_print(frame, buffer, sizeof(buffer)-1); + len = proxy_h2_fr_print(frame, buffer, sizeof(buffer) - 1); buffer[len] = 0; CURL_TRC_CF(data, cf, "[%d] -> %s", frame->hd.stream_id, buffer); } @@ -644,9 +643,9 @@ static int proxy_h2_on_frame_recv(nghttp2_session *session, if(Curl_trc_cf_is_verbose(cf, data)) { char buffer[256]; int len; - len = proxy_h2_fr_print(frame, buffer, sizeof(buffer)-1); + len = proxy_h2_fr_print(frame, buffer, sizeof(buffer) - 1); buffer[len] = 0; - CURL_TRC_CF(data, cf, "[%d] <- %s",frame->hd.stream_id, buffer); + CURL_TRC_CF(data, cf, "[%d] <- %s", frame->hd.stream_id, buffer); } #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ @@ -962,7 +961,7 @@ static CURLcode inspect_response(struct Curl_cfilter *cf, (void)cf; DEBUGASSERT(ts->resp); - if(ts->resp->status/100 == 2) { + if(ts->resp->status / 100 == 2) { infof(data, "CONNECT tunnel established, response %d", ts->resp->status); h2_tunnel_go_state(cf, ts, H2_TUNNEL_ESTABLISHED, data); return CURLE_OK; @@ -1220,7 +1219,7 @@ static CURLcode cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, c_exhaust = !nghttp2_session_get_remote_window_size(ctx->h2); s_exhaust = ctx->tunnel.stream_id >= 0 && !nghttp2_session_get_stream_remote_window_size( - ctx->h2, ctx->tunnel.stream_id); + ctx->h2, ctx->tunnel.stream_id); want_recv = (want_recv || c_exhaust || s_exhaust); want_send = (!s_exhaust && want_send) || (!c_exhaust && nghttp2_session_want_write(ctx->h2)) || @@ -1414,7 +1413,7 @@ static CURLcode cf_h2_proxy_send(struct Curl_cfilter *cf, "h2 windows %d-%d (stream-conn), buffers %zu-%zu (stream-conn)", ctx->tunnel.stream_id, len, result, *pnwritten, nghttp2_session_get_stream_remote_window_size( - ctx->h2, ctx->tunnel.stream_id), + ctx->h2, ctx->tunnel.stream_id), nghttp2_session_get_remote_window_size(ctx->h2), Curl_bufq_len(&ctx->tunnel.sendbuf), Curl_bufq_len(&ctx->outbufq)); @@ -1566,7 +1565,7 @@ static CURLcode cf_h2_proxy_cntrl(struct Curl_cfilter *cf, struct Curl_cftype Curl_cft_h2_proxy = { "H2-PROXY", - CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, + CF_TYPE_IP_CONNECT | CF_TYPE_PROXY, CURL_LOG_LVL_NONE, cf_h2_proxy_destroy, cf_h2_proxy_connect, diff --git a/lib/cf-haproxy.c b/lib/cf-haproxy.c index a1793c0071ec..5ceef5190a37 100644 --- a/lib/cf-haproxy.c +++ b/lib/cf-haproxy.c @@ -36,9 +36,9 @@ typedef enum { - HAPROXY_INIT, /* init/default/no tunnel state */ - HAPROXY_SEND, /* data_out being sent */ - HAPROXY_DONE /* all work done */ + HAPROXY_INIT, /* init/default/no tunnel state */ + HAPROXY_SEND, /* data_out being sent */ + HAPROXY_DONE /* all work done */ } haproxy_state; struct cf_haproxy_ctx { @@ -61,7 +61,7 @@ static void cf_haproxy_ctx_free(struct cf_haproxy_ctx *ctx) } } -static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter*cf, +static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_haproxy_ctx *ctx = cf->ctx; diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 8901db02c283..72ac59b7d90b 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -108,7 +108,6 @@ void Curl_debug_set_transport_provider(uint8_t transport, } #endif /* UNITTESTS */ - struct cf_ai_iter { const struct Curl_addrinfo *head; const struct Curl_addrinfo *last; @@ -423,9 +422,9 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, int ai_family = 0; #ifdef USE_IPV6 if((bs->last_attempt_ai_family == AF_INET) || - !cf_ai_iter_has_more(&bs->addr_iter)) { - addr = cf_ai_iter_next(&bs->ipv6_iter); - ai_family = bs->ipv6_iter.ai_family; + !cf_ai_iter_has_more(&bs->addr_iter)) { + addr = cf_ai_iter_next(&bs->ipv6_iter); + ai_family = bs->ipv6_iter.ai_family; } #endif if(!addr) { @@ -629,7 +628,6 @@ struct cf_ip_happy_ctx { struct curltime started; }; - static CURLcode is_connected(struct Curl_cfilter *cf, struct Curl_easy *data, bool *connected) @@ -774,50 +772,50 @@ static CURLcode cf_ip_happy_connect(struct Curl_cfilter *cf, *done = FALSE; switch(ctx->state) { - case SCFST_INIT: - DEBUGASSERT(CURL_SOCKET_BAD == Curl_conn_cf_get_socket(cf, data)); - DEBUGASSERT(!cf->connected); - result = start_connect(cf, data); - if(result) - return result; - ctx->state = SCFST_WAITING; - FALLTHROUGH(); - case SCFST_WAITING: - result = is_connected(cf, data, done); - if(!result && *done) { - DEBUGASSERT(ctx->ballers.winner); - DEBUGASSERT(ctx->ballers.winner->cf); - DEBUGASSERT(ctx->ballers.winner->cf->connected); - /* we have a winner. Install and activate it. - * close/free all others. */ - ctx->state = SCFST_DONE; - cf->connected = TRUE; - cf->next = ctx->ballers.winner->cf; - ctx->ballers.winner->cf = NULL; - cf_ip_happy_ctx_clear(cf, data); - Curl_expire_done(data, EXPIRE_HAPPY_EYEBALLS); - - if(cf->conn->handler->protocol & PROTO_FAMILY_SSH) - Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */ + case SCFST_INIT: + DEBUGASSERT(CURL_SOCKET_BAD == Curl_conn_cf_get_socket(cf, data)); + DEBUGASSERT(!cf->connected); + result = start_connect(cf, data); + if(result) + return result; + ctx->state = SCFST_WAITING; + FALLTHROUGH(); + case SCFST_WAITING: + result = is_connected(cf, data, done); + if(!result && *done) { + DEBUGASSERT(ctx->ballers.winner); + DEBUGASSERT(ctx->ballers.winner->cf); + DEBUGASSERT(ctx->ballers.winner->cf->connected); + /* we have a winner. Install and activate it. + * close/free all others. */ + ctx->state = SCFST_DONE; + cf->connected = TRUE; + cf->next = ctx->ballers.winner->cf; + ctx->ballers.winner->cf = NULL; + cf_ip_happy_ctx_clear(cf, data); + Curl_expire_done(data, EXPIRE_HAPPY_EYEBALLS); + + if(cf->conn->handler->protocol & PROTO_FAMILY_SSH) + Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */ #ifndef CURL_DISABLE_VERBOSE_STRINGS - if(Curl_trc_cf_is_verbose(cf, data)) { - struct ip_quadruple ipquad; - bool is_ipv6; - if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) { - const char *host; - int port; - Curl_conn_get_current_host(data, cf->sockindex, &host, &port); - CURL_TRC_CF(data, cf, "Connected to %s (%s) port %u", - host, ipquad.remote_ip, ipquad.remote_port); - } + if(Curl_trc_cf_is_verbose(cf, data)) { + struct ip_quadruple ipquad; + bool is_ipv6; + if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) { + const char *host; + int port; + Curl_conn_get_current_host(data, cf->sockindex, &host, &port); + CURL_TRC_CF(data, cf, "Connected to %s (%s) port %u", + host, ipquad.remote_ip, ipquad.remote_port); } -#endif - data->info.numconnects++; /* to track the # of connections made */ } - break; - case SCFST_DONE: - *done = TRUE; - break; +#endif + data->info.numconnects++; /* to track the # of connections made */ + } + break; + case SCFST_DONE: + *done = TRUE; + break; } return result; } diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 3172aee5b9c9..a12995941610 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -96,7 +96,7 @@ static void set_ipv6_v6only(curl_socket_t sockfd, int on) (void)setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on)); } #else -#define set_ipv6_v6only(x,y) +#define set_ipv6_v6only(x, y) #endif static void tcpnodelay(struct Curl_cfilter *cf, @@ -104,7 +104,7 @@ static void tcpnodelay(struct Curl_cfilter *cf, curl_socket_t sockfd) { #if defined(TCP_NODELAY) && defined(CURL_TCP_NODELAY_SUPPORTED) - curl_socklen_t onoff = (curl_socklen_t) 1; + curl_socklen_t onoff = (curl_socklen_t)1; int level = IPPROTO_TCP; char buffer[STRERROR_LEN]; @@ -142,7 +142,7 @@ static void nosigpipe(struct Curl_cfilter *cf, } } #else -#define nosigpipe(x,y,z) Curl_nop_stmt +#define nosigpipe(x, y, z) Curl_nop_stmt #endif #if defined(USE_WINSOCK) || \ @@ -156,10 +156,9 @@ static void nosigpipe(struct Curl_cfilter *cf, #define KEEPALIVE_FACTOR(x) #endif -static void -tcpkeepalive(struct Curl_cfilter *cf, - struct Curl_easy *data, - curl_socket_t sockfd) +static void tcpkeepalive(struct Curl_cfilter *cf, + struct Curl_easy *data, + curl_socket_t sockfd) { int optval = data->set.tcp_keepalive ? 1 : 0; @@ -202,7 +201,7 @@ tcpkeepalive(struct Curl_cfilter *cf, { /* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */ #ifndef SIO_KEEPALIVE_VALS -#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4) +#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR, 4) struct tcp_keepalive { u_long onoff; u_long keepalivetime; @@ -342,15 +341,15 @@ static CURLcode socket_open(struct Curl_easy *data, DEBUGASSERT(data); DEBUGASSERT(data->conn); if(data->set.fopensocket) { - /* - * If the opensocket callback is set, all the destination address - * information is passed to the callback. Depending on this information the - * callback may opt to abort the connection, this is indicated returning - * CURL_SOCKET_BAD; otherwise it will return a not-connected socket. When - * the callback returns a valid socket the destination address information - * might have been changed and this 'new' address will actually be used - * here to connect. - */ + /* + * If the opensocket callback is set, all the destination address + * information is passed to the callback. Depending on this information the + * callback may opt to abort the connection, this is indicated returning + * CURL_SOCKET_BAD; otherwise it will return a not-connected socket. When + * the callback returns a valid socket the destination address information + * might have been changed and this 'new' address will actually be used + * here to connect. + */ Curl_set_in_callback(data, TRUE); *sockfd = data->set.fopensocket(data->set.opensocket_client, CURLSOCKTYPE_IPCXN, @@ -600,7 +599,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, if(!iface && !host && !port) /* no local kind of binding was requested */ return CURLE_OK; - else if(iface && (strlen(iface) >= 255) ) + else if(iface && (strlen(iface) >= 255)) return CURLE_BAD_FUNCTION_ARGUMENT; memset(&sa, 0, sizeof(struct Curl_sockaddr_storage)); @@ -640,33 +639,33 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, /* Discover IP from input device, then bind to it */ if2ip_result = Curl_if2ip(af, #ifdef USE_IPV6 - scope, conn->scope_id, + scope, conn->scope_id, #endif - iface, myhost, sizeof(myhost)); + iface, myhost, sizeof(myhost)); } switch(if2ip_result) { - case IF2IP_NOT_FOUND: - if(iface_input && !host_input) { - /* Do not fall back to treating it as a hostname */ - char buffer[STRERROR_LEN]; - data->state.os_errno = error = SOCKERRNO; - failf(data, "Could not bind to interface '%s' with errno %d: %s", - iface, error, curlx_strerror(error, buffer, sizeof(buffer))); - return CURLE_INTERFACE_FAILED; - } - break; - case IF2IP_AF_NOT_SUPPORTED: - /* Signal the caller to try another address family if available */ - return CURLE_UNSUPPORTED_PROTOCOL; - case IF2IP_FOUND: - /* - * We now have the numerical IP address in the 'myhost' buffer - */ - host = myhost; - infof(data, "Local Interface %s is ip %s using address family %i", - iface, host, af); - done = 1; - break; + case IF2IP_NOT_FOUND: + if(iface_input && !host_input) { + /* Do not fall back to treating it as a hostname */ + char buffer[STRERROR_LEN]; + data->state.os_errno = error = SOCKERRNO; + failf(data, "Could not bind to interface '%s' with errno %d: %s", + iface, error, curlx_strerror(error, buffer, sizeof(buffer))); + return CURLE_INTERFACE_FAILED; + } + break; + case IF2IP_AF_NOT_SUPPORTED: + /* Signal the caller to try another address family if available */ + return CURLE_UNSUPPORTED_PROTOCOL; + case IF2IP_FOUND: + /* + * We now have the numerical IP address in the 'myhost' buffer + */ + host = myhost; + infof(data, "Local Interface %s is ip %s using address family %i", + iface, host, af); + done = 1; + break; } if(!iface_input || host_input) { /* @@ -728,7 +727,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, present, is known to be numeric */ curl_off_t scope_id; if(curlx_str_number((const char **)CURL_UNCONST(&scope_ptr), - &scope_id, UINT_MAX)) + &scope_id, UINT_MAX)) return CURLE_UNSUPPORTED_PROTOCOL; si6->sin6_scope_id = (unsigned int)scope_id; } @@ -921,7 +920,7 @@ struct cf_socket_ctx { int wblock_percent; /* percent of writes doing EAGAIN */ int wpartial_percent; /* percent of bytes written in send */ int rblock_percent; /* percent of reads doing EAGAIN */ - size_t recv_max; /* max enforced read size */ + size_t recv_max; /* max enforced read size */ #endif BIT(got_first_byte); /* if first byte was received */ BIT(listening); /* socket is listening */ @@ -1043,12 +1042,12 @@ static void set_local_ip(struct Curl_cfilter *cf, curl_socklen_t slen = sizeof(struct Curl_sockaddr_storage); memset(&ssloc, 0, sizeof(ssloc)); - if(getsockname(ctx->sock, (struct sockaddr*) &ssloc, &slen)) { + if(getsockname(ctx->sock, (struct sockaddr *)&ssloc, &slen)) { int error = SOCKERRNO; infof(data, "getsockname() failed with errno %d: %s", error, curlx_strerror(error, buffer, sizeof(buffer))); } - else if(!Curl_addr2string((struct sockaddr*)&ssloc, slen, + else if(!Curl_addr2string((struct sockaddr *)&ssloc, slen, ctx->ip.local_ip, &ctx->ip.local_port)) { infof(data, "ssloc inet_ntop() failed with errno %d: %s", errno, curlx_strerror(errno, buffer, sizeof(buffer))); @@ -1123,8 +1122,8 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, infof(data, " Trying %s:%d...", ctx->ip.remote_ip, ctx->ip.remote_port); #ifdef USE_IPV6 - is_tcp = (ctx->addr.family == AF_INET - || ctx->addr.family == AF_INET6) && + is_tcp = (ctx->addr.family == AF_INET || + ctx->addr.family == AF_INET6) && ctx->addr.socktype == SOCK_STREAM; #else is_tcp = (ctx->addr.family == AF_INET) && @@ -1320,8 +1319,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf, rc = SOCKET_WRITABLE(ctx->sock, 0); if(rc == 0) { /* no connection yet */ - CURL_TRC_CF(data, cf, "not connected yet on fd=%" FMT_SOCKET_T, - ctx->sock); + CURL_TRC_CF(data, cf, "not connected yet on fd=%" FMT_SOCKET_T, ctx->sock); return CURLE_OK; } else if(rc == CURL_CSELECT_OUT || cf->conn->bits.tcp_fastopen) { @@ -1411,7 +1409,7 @@ static void win_update_sndbuf_size(struct cf_socket_ctx *ctx) if(curlx_timediff_ms(n, ctx->last_sndbuf_query_at) > 1000) { if(!WSAIoctl(ctx->sock, SIO_IDEAL_SEND_BACKLOG_QUERY, 0, 0, - &ideal, sizeof(ideal), &ideallen, 0, 0) && + &ideal, sizeof(ideal), &ideallen, 0, 0) && ideal != ctx->sndbuf_size && !setsockopt(ctx->sock, SOL_SOCKET, SO_SNDBUF, (const char *)&ideal, sizeof(ideal))) { @@ -1443,7 +1441,7 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, if(ctx->wblock_percent > 0) { unsigned char c = 0; Curl_rand_bytes(data, FALSE, &c, 1); - if(c >= ((100-ctx->wblock_percent)*256/100)) { + if(c >= ((100 - ctx->wblock_percent) * 256 / 100)) { CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE EWOULDBLOCK", orig_len); cf->conn->sock[cf->sockindex] = fdsave; return CURLE_AGAIN; @@ -1520,7 +1518,7 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(cf->cft != &Curl_cft_udp && ctx->rblock_percent > 0) { unsigned char c = 0; Curl_rand(data, &c, 1); - if(c >= ((100-ctx->rblock_percent)*256/100)) { + if(c >= ((100 - ctx->rblock_percent) * 256 / 100)) { CURL_TRC_CF(data, cf, "recv(len=%zu) SIMULATE EWOULDBLOCK", len); return CURLE_AGAIN; } @@ -1634,7 +1632,7 @@ static bool cf_socket_conn_is_alive(struct Curl_cfilter *cf, /* Check with 0 timeout if there are any events pending on the socket */ pfd[0].fd = ctx->sock; - pfd[0].events = POLLRDNORM|POLLIN|POLLRDBAND|POLLPRI; + pfd[0].events = POLLRDNORM | POLLIN | POLLRDBAND | POLLPRI; pfd[0].revents = 0; r = Curl_poll(pfd, 1, 0); @@ -1646,7 +1644,7 @@ static bool cf_socket_conn_is_alive(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "is_alive: poll timeout, assume alive"); return TRUE; } - else if(pfd[0].revents & (POLLERR|POLLHUP|POLLPRI|POLLNVAL)) { + else if(pfd[0].revents & (POLLERR | POLLHUP | POLLPRI | POLLNVAL)) { CURL_TRC_CF(data, cf, "is_alive: err/hup/etc events, assume dead"); return FALSE; } @@ -1814,7 +1812,6 @@ static void linux_quic_gro(struct cf_socket_ctx *ctx) #define linux_quic_gro(x) #endif - static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf, struct Curl_easy *data) { @@ -2035,13 +2032,13 @@ static void cf_tcp_set_accepted_remote_ip(struct Curl_cfilter *cf, ctx->ip.remote_port = 0; plen = sizeof(ssrem); memset(&ssrem, 0, plen); - if(getpeername(ctx->sock, (struct sockaddr*) &ssrem, &plen)) { + if(getpeername(ctx->sock, (struct sockaddr *)&ssrem, &plen)) { int error = SOCKERRNO; failf(data, "getpeername() failed with errno %d: %s", error, curlx_strerror(error, buffer, sizeof(buffer))); return; } - if(!Curl_addr2string((struct sockaddr*)&ssrem, plen, + if(!Curl_addr2string((struct sockaddr *)&ssrem, plen, ctx->ip.remote_ip, &ctx->ip.remote_port)) { failf(data, "ssrem inet_ntop() failed with errno %d: %s", errno, curlx_strerror(errno, buffer, sizeof(buffer))); @@ -2111,10 +2108,10 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, size = sizeof(add); #ifdef HAVE_ACCEPT4 - s_accepted = CURL_ACCEPT4(ctx->sock, (struct sockaddr *) &add, &size, + s_accepted = CURL_ACCEPT4(ctx->sock, (struct sockaddr *)&add, &size, SOCK_NONBLOCK | SOCK_CLOEXEC); #else - s_accepted = CURL_ACCEPT(ctx->sock, (struct sockaddr *) &add, &size); + s_accepted = CURL_ACCEPT(ctx->sock, (struct sockaddr *)&add, &size); #endif if(CURL_SOCKET_BAD == s_accepted) { diff --git a/lib/cf-socket.h b/lib/cf-socket.h index 432b0870451d..e5f69c60f46f 100644 --- a/lib/cf-socket.h +++ b/lib/cf-socket.h @@ -57,7 +57,7 @@ struct Curl_sockaddr_ex { /* * Parse interface option, and return the interface name and the host part. -*/ + */ CURLcode Curl_parse_interface(const char *input, char **dev, char **iface, char **host); diff --git a/lib/cfilters.c b/lib/cfilters.c index dd4cb5210acc..f51da8521aff 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -511,8 +511,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, goto out; } else if(result) { - CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %d", - result); + CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %d", result); conn_report_connect_stats(cf, data); goto out; } @@ -653,7 +652,7 @@ bool Curl_conn_is_multiplex(struct connectdata *conn, int sockindex) for(; cf; cf = cf->next) { if(cf->cft->flags & CF_TYPE_MULTIPLEX) return TRUE; - if(cf->cft->flags & (CF_TYPE_IP_CONNECT|CF_TYPE_SSL)) + if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL)) return FALSE; } return FALSE; @@ -691,7 +690,7 @@ unsigned char Curl_conn_http_version(struct Curl_easy *data, v = (unsigned char)value; break; } - if(cf->cft->flags & (CF_TYPE_IP_CONNECT|CF_TYPE_SSL)) + if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL)) break; } return (unsigned char)(result ? 0 : v); @@ -803,9 +802,9 @@ void Curl_conn_get_current_host(struct Curl_easy *data, int sockindex, cf = CONN_SOCK_IDX_VALID(sockindex) ? data->conn->cfilter[sockindex] : NULL; /* Find the "lowest" tunneling proxy filter that has not connected yet. */ while(cf && !cf->connected) { - if((cf->cft->flags & (CF_TYPE_IP_CONNECT|CF_TYPE_PROXY)) == - (CF_TYPE_IP_CONNECT|CF_TYPE_PROXY)) - cf_proxy = cf; + if((cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_PROXY)) == + (CF_TYPE_IP_CONNECT | CF_TYPE_PROXY)) + cf_proxy = cf; cf = cf->next; } /* cf_proxy (!= NULL) is not connected yet. It is talking @@ -945,8 +944,7 @@ static CURLcode cf_cntrl_all(struct connectdata *conn, CURLcode Curl_conn_ev_data_setup(struct Curl_easy *data) { - return cf_cntrl_all(data->conn, data, FALSE, - CF_CTRL_DATA_SETUP, 0, NULL); + return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL); } CURLcode Curl_conn_flush(struct Curl_easy *data, int sockindex) @@ -1100,8 +1098,7 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, return CURLE_BAD_FUNCTION_ARGUMENT; #ifdef DEBUGBUILD if(write_len) { - /* Allow debug builds to override this logic to force short sends - */ + /* Allow debug builds to override this logic to force short sends */ const char *p = getenv("CURL_SMALLSENDS"); if(p) { curl_off_t altsize; diff --git a/lib/cfilters.h b/lib/cfilters.h index a3bd97a9f166..73b9cb03e034 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -116,16 +116,16 @@ typedef CURLcode Curl_cft_conn_keep_alive(struct Curl_cfilter *cf, * "ignored" meaning return values are ignored and the event is distributed * to all filters in the chain. Overall result is always CURLE_OK. */ -/* data event arg1 arg2 return */ -#define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */ -/* unused now 5 */ -#define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */ -#define CF_CTRL_DATA_DONE 7 /* premature NULL ignored */ -#define CF_CTRL_DATA_DONE_SEND 8 /* 0 NULL ignored */ +/* data event arg1 arg2 return */ +#define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */ +/* unused now 5 */ +#define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */ +#define CF_CTRL_DATA_DONE 7 /* premature NULL ignored */ +#define CF_CTRL_DATA_DONE_SEND 8 /* 0 NULL ignored */ /* update conn info at connection and data */ -#define CF_CTRL_CONN_INFO_UPDATE (256+0) /* 0 NULL ignored */ -#define CF_CTRL_FORGET_SOCKET (256+1) /* 0 NULL ignored */ -#define CF_CTRL_FLUSH (256+2) /* 0 NULL first fail */ +#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0 NULL ignored */ +#define CF_CTRL_FORGET_SOCKET (256 + 1) /* 0 NULL ignored */ +#define CF_CTRL_FLUSH (256 + 2) /* 0 NULL first fail */ /** * Handle event/control for the filter. @@ -135,7 +135,6 @@ typedef CURLcode Curl_cft_cntrl(struct Curl_cfilter *cf, struct Curl_easy *data, int event, int arg1, void *arg2); - /** * Queries to ask via a `Curl_cft_query *query` method on a cfilter chain. * - MAX_CONCURRENT: the maximum number of parallel transfers the filter @@ -210,21 +209,21 @@ typedef CURLcode Curl_cft_query(struct Curl_cfilter *cf, /* A connection filter type, e.g. specific implementation. */ struct Curl_cftype { - const char *name; /* name of the filter type */ - int flags; /* flags of filter type */ - int log_level; /* log level for such filters */ - Curl_cft_destroy_this *destroy; /* destroy resources of this cf */ - Curl_cft_connect *do_connect; /* establish connection */ - Curl_cft_close *do_close; /* close conn */ - Curl_cft_shutdown *do_shutdown; /* shutdown conn */ + const char *name; /* name of the filter type */ + int flags; /* flags of filter type */ + int log_level; /* log level for such filters */ + Curl_cft_destroy_this *destroy; /* destroy resources of this cf */ + Curl_cft_connect *do_connect; /* establish connection */ + Curl_cft_close *do_close; /* close conn */ + Curl_cft_shutdown *do_shutdown; /* shutdown conn */ Curl_cft_adjust_pollset *adjust_pollset; /* adjust transfer poll set */ - Curl_cft_data_pending *has_data_pending;/* conn has data pending */ - Curl_cft_send *do_send; /* send data */ - Curl_cft_recv *do_recv; /* receive data */ - Curl_cft_cntrl *cntrl; /* events/control */ - Curl_cft_conn_is_alive *is_alive; /* FALSE if conn is dead, Jim! */ - Curl_cft_conn_keep_alive *keep_alive; /* try to keep it alive */ - Curl_cft_query *query; /* query filter chain */ + Curl_cft_data_pending *has_data_pending; /* conn has data pending */ + Curl_cft_send *do_send; /* send data */ + Curl_cft_recv *do_recv; /* receive data */ + Curl_cft_cntrl *cntrl; /* events/control */ + Curl_cft_conn_is_alive *is_alive; /* FALSE if conn is dead, Jim! */ + Curl_cft_conn_keep_alive *keep_alive; /* try to keep it alive */ + Curl_cft_query *query; /* query filter chain */ }; /* A connection filter instance, e.g. registered at a connection */ @@ -426,7 +425,7 @@ const char *Curl_conn_get_alpn_negotiated(struct Curl_easy *data, /** * Close the filter chain at `sockindex` for connection `data->conn`. - * Filters remain in place and may be connected again afterwards. + * Filters remain in place and may be connected again afterwards. */ void Curl_conn_close(struct Curl_easy *data, int sockindex); @@ -622,7 +621,6 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, const void *buf, size_t blen, bool eos, size_t *pnwritten); - /** * Types and macros used to keep the current easy handle in filter calls, * allowing for nested invocations. See #10336. @@ -654,7 +652,7 @@ struct cf_call_data { * a member in the cfilter's `ctx`. * * #define CF_CTX_CALL_DATA(cf) -> struct cf_call_data instance -*/ + */ #ifdef DEBUGBUILD @@ -688,7 +686,6 @@ struct cf_call_data { #endif /* !DEBUGBUILD */ -#define CF_DATA_CURRENT(cf) \ - ((cf)? (CF_CTX_CALL_DATA(cf).data) : NULL) +#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL) #endif /* HEADER_CURL_CFILTERS_H */ diff --git a/lib/conncache.c b/lib/conncache.c index 7f38a1875790..c7a52b69f69a 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -59,7 +59,7 @@ } \ } while(0) -#define CPOOL_UNLOCK(c,d) \ +#define CPOOL_UNLOCK(c,d) \ do { \ if((c)) { \ DEBUGASSERT((c)->locked); \ @@ -161,7 +161,6 @@ static struct connectdata *cpool_get_first(struct cpool *cpool) return NULL; } - static struct cpool_bundle *cpool_find_bundle(struct cpool *cpool, struct connectdata *conn) { @@ -178,7 +177,6 @@ static void cpool_remove_bundle(struct cpool *cpool, Curl_hash_delete(&cpool->dest2bundle, bundle->dest, bundle->dest_len); } - static void cpool_remove_conn(struct cpool *cpool, struct connectdata *conn) { @@ -260,8 +258,8 @@ void Curl_cpool_xfer_init(struct Curl_easy *data) } } -static struct cpool_bundle * -cpool_add_bundle(struct cpool *cpool, struct connectdata *conn) +static struct cpool_bundle *cpool_add_bundle(struct cpool *cpool, + struct connectdata *conn) { struct cpool_bundle *bundle; @@ -341,7 +339,6 @@ static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool) return oldest_idle; } - int Curl_cpool_check_limits(struct Curl_easy *data, struct connectdata *conn) { @@ -386,10 +383,10 @@ int Curl_cpool_check_limits(struct Curl_easy *data, if(!oldest_idle) break; /* disconnect the old conn and continue */ - CURL_TRC_M(data, "Discarding connection #%" - FMT_OFF_T " from %zu to reach destination " - "limit of %zu", oldest_idle->connection_id, - Curl_llist_count(&bundle->conns), dest_limit); + CURL_TRC_M(data, "Discarding connection #%" FMT_OFF_T + " from %zu to reach destination limit of %zu", + oldest_idle->connection_id, + Curl_llist_count(&bundle->conns), dest_limit); Curl_conn_terminate(cpool->idata, oldest_idle, FALSE); /* in case the bundle was destroyed in disconnect, look it up again */ @@ -704,7 +701,6 @@ void Curl_conn_terminate(struct Curl_easy *data, CPOOL_UNLOCK(cpool, data); } - struct cpool_reaper_ctx { struct curltime now; }; diff --git a/lib/conncache.h b/lib/conncache.h index a5f133344fd4..5761ee9b4464 100644 --- a/lib/conncache.h +++ b/lib/conncache.h @@ -49,7 +49,7 @@ void Curl_conn_terminate(struct Curl_easy *data, bool aborted); struct cpool { - /* the pooled connections, bundled per destination */ + /* the pooled connections, bundled per destination */ struct Curl_hash dest2bundle; size_t num_conn; curl_off_t next_connection_id; @@ -166,5 +166,4 @@ void Curl_cpool_do_locked(struct Curl_easy *data, /* Close all unused connections, prevent reuse of existing ones. */ void Curl_cpool_nw_changed(struct Curl_easy *data); - #endif /* HEADER_CURL_CONNCACHE_H */ diff --git a/lib/connect.c b/lib/connect.c index 72a27fae1cd9..748cf53a29ae 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -247,36 +247,35 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, #endif switch(sa->sa_family) { - case AF_INET: - si = (struct sockaddr_in *)(void *) sa; - if(curlx_inet_ntop(sa->sa_family, &si->sin_addr, addr, MAX_IPADR_LEN)) { - *port = ntohs(si->sin_port); - return TRUE; - } - break; + case AF_INET: + si = (struct sockaddr_in *)(void *)sa; + if(curlx_inet_ntop(sa->sa_family, &si->sin_addr, addr, MAX_IPADR_LEN)) { + *port = ntohs(si->sin_port); + return TRUE; + } + break; #ifdef USE_IPV6 - case AF_INET6: - si6 = (struct sockaddr_in6 *)(void *) sa; - if(curlx_inet_ntop(sa->sa_family, &si6->sin6_addr, addr, - MAX_IPADR_LEN)) { - *port = ntohs(si6->sin6_port); - return TRUE; - } - break; + case AF_INET6: + si6 = (struct sockaddr_in6 *)(void *)sa; + if(curlx_inet_ntop(sa->sa_family, &si6->sin6_addr, addr, MAX_IPADR_LEN)) { + *port = ntohs(si6->sin6_port); + return TRUE; + } + break; #endif #if (defined(HAVE_SYS_UN_H) || defined(WIN32_SOCKADDR_UN)) && defined(AF_UNIX) - case AF_UNIX: - if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) { - su = (struct sockaddr_un*)sa; - curl_msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path); - } - else - addr[0] = 0; /* socket with no name */ - *port = 0; - return TRUE; + case AF_UNIX: + if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) { + su = (struct sockaddr_un *)sa; + curl_msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path); + } + else + addr[0] = 0; /* socket with no name */ + *port = 0; + return TRUE; #endif - default: - break; + default: + break; } addr[0] = '\0'; @@ -338,7 +337,7 @@ void Curl_conncontrol(struct connectdata *conn, #endif is_multiplex = Curl_conn_is_multiplex(conn, FIRSTSOCKET); closeit = (ctrl == CONNCTRL_CONNECTION) || - ((ctrl == CONNCTRL_STREAM) && !is_multiplex); + ((ctrl == CONNCTRL_STREAM) && !is_multiplex); if((ctrl == CONNCTRL_STREAM) && is_multiplex) ; /* stream signal on multiplex conn never affects close state */ else if((bit)closeit != conn->bits.close) { @@ -409,8 +408,8 @@ static CURLcode cf_setup_connect(struct Curl_cfilter *cf, if(ctx->state < CF_SETUP_CNNCT_HTTP_PROXY && cf->conn->bits.httpproxy) { #ifdef USE_SSL - if(IS_HTTPS_PROXY(cf->conn->http_proxy.proxytype) - && !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { + if(IS_HTTPS_PROXY(cf->conn->http_proxy.proxytype) && + !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { result = Curl_cf_ssl_proxy_insert_after(cf, data); if(result) return result; @@ -450,9 +449,9 @@ static CURLcode cf_setup_connect(struct Curl_cfilter *cf, if(ctx->state < CF_SETUP_CNNCT_SSL) { #ifdef USE_SSL - if((ctx->ssl_mode == CURL_CF_SSL_ENABLE - || (ctx->ssl_mode != CURL_CF_SSL_DISABLE - && cf->conn->handler->flags & PROTOPT_SSL)) /* we want SSL */ + if((ctx->ssl_mode == CURL_CF_SSL_ENABLE || + (ctx->ssl_mode != CURL_CF_SSL_DISABLE && + cf->conn->handler->flags & PROTOPT_SSL)) /* we want SSL */ && !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { /* it is missing */ result = Curl_cf_ssl_insert_after(cf, data); if(result) @@ -494,7 +493,6 @@ static void cf_setup_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) Curl_safefree(ctx); } - struct Curl_cftype Curl_cft_setup = { "SETUP", 0, diff --git a/lib/connect.h b/lib/connect.h index 9060591dcec6..7d1c9c908991 100644 --- a/lib/connect.h +++ b/lib/connect.h @@ -100,13 +100,13 @@ void Curl_conncontrol(struct connectdata *conn, ); #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) -#define streamclose(x,y) Curl_conncontrol(x, CONNCTRL_STREAM, y) -#define connclose(x,y) Curl_conncontrol(x, CONNCTRL_CONNECTION, y) -#define connkeep(x,y) Curl_conncontrol(x, CONNCTRL_KEEP, y) +#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y) +#define connclose(x, y) Curl_conncontrol(x, CONNCTRL_CONNECTION, y) +#define connkeep(x, y) Curl_conncontrol(x, CONNCTRL_KEEP, y) #else /* if !DEBUGBUILD || CURL_DISABLE_VERBOSE_STRINGS */ -#define streamclose(x,y) Curl_conncontrol(x, CONNCTRL_STREAM) -#define connclose(x,y) Curl_conncontrol(x, CONNCTRL_CONNECTION) -#define connkeep(x,y) Curl_conncontrol(x, CONNCTRL_KEEP) +#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM) +#define connclose(x, y) Curl_conncontrol(x, CONNCTRL_CONNECTION) +#define connkeep(x, y) Curl_conncontrol(x, CONNCTRL_KEEP) #endif CURLcode Curl_cf_setup_insert_after(struct Curl_cfilter *cf_at, diff --git a/lib/cookie.c b/lib/cookie.c index 250c7390ce12..81a57942b245 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -45,7 +45,7 @@ static void strstore(char **str, const char *newstr, size_t len); /* number of seconds in 400 days */ -#define COOKIES_MAXAGE (400*24*3600) +#define COOKIES_MAXAGE (400 * 24 * 3600) /* Make sure cookies never expire further away in time than 400 days into the future. (from RFC6265bis draft-19) @@ -59,7 +59,7 @@ static void cap_expires(time_t now, struct Cookie *co) timediff_t cap = now + COOKIES_MAXAGE; if(co->expires > cap) { cap += 30; - co->expires = (cap/60)*60; + co->expires = (cap / 60) * 60; } } } @@ -84,7 +84,7 @@ static bool cookie_tailmatch(const char *cookie_domain, return FALSE; if(!curl_strnequal(cookie_domain, - hostname + hostname_len-cookie_domain_len, + hostname + hostname_len - cookie_domain_len, cookie_domain_len)) return FALSE; @@ -428,8 +428,8 @@ parse_cookie_header(struct Curl_easy *data, * combination of name + contents. Chrome and Firefox support 4095 or * 4096 bytes combo */ - if(curlx_strlen(&name) >= (MAX_NAME-1) || - curlx_strlen(&val) >= (MAX_NAME-1) || + if(curlx_strlen(&name) >= (MAX_NAME - 1) || + curlx_strlen(&val) >= (MAX_NAME - 1) || ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) { infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", curlx_strlen(&name), curlx_strlen(&val)); @@ -530,11 +530,11 @@ parse_cookie_header(struct Curl_easy *data, is_ip = Curl_host_is_ipnum(domain ? domain : curlx_str(&val)); - if(!domain - || (is_ip && !strncmp(curlx_str(&val), domain, - curlx_strlen(&val)) && - (curlx_strlen(&val) == strlen(domain))) - || (!is_ip && cookie_tailmatch(curlx_str(&val), + if(!domain || + (is_ip && + !strncmp(curlx_str(&val), domain, curlx_strlen(&val)) && + (curlx_strlen(&val) == strlen(domain))) || + (!is_ip && cookie_tailmatch(curlx_str(&val), curlx_strlen(&val), domain))) { strstore(&co->domain, curlx_str(&val), curlx_strlen(&val)); if(!co->domain) @@ -689,7 +689,7 @@ parse_netscape(struct Cookie *co, co->httponly = TRUE; } - if(lineptr[0]=='#') + if(lineptr[0] == '#') /* do not even try the comments */ return CURLE_OK; @@ -704,7 +704,7 @@ parse_netscape(struct Cookie *co, next = (ptr[len] == '\t' ? &ptr[len + 1] : NULL); switch(fields) { case 0: - if(ptr[0]=='.') { /* skip preceding dots */ + if(ptr[0] == '.') { /* skip preceding dots */ ptr++; len--; } @@ -792,10 +792,9 @@ parse_netscape(struct Cookie *co, return CURLE_OK; } -static bool -is_public_suffix(struct Curl_easy *data, - struct Cookie *co, - const char *domain) +static bool is_public_suffix(struct Curl_easy *data, + struct Cookie *co, + const char *domain) { #ifdef USE_LIBPSL /* @@ -899,7 +898,7 @@ static bool replace_existing(struct Curl_easy *data, if(clist->domain && co->domain) { if(curl_strequal(clist->domain, co->domain) && - (clist->tailmatch == co->tailmatch)) + (clist->tailmatch == co->tailmatch)) /* The domains are identical */ replace_old = TRUE; } @@ -1059,7 +1058,6 @@ Curl_cookie_add(struct Curl_easy *data, return result; } - /* * Curl_cookie_init() * @@ -1195,7 +1193,6 @@ CURLcode Curl_cookie_loadfiles(struct Curl_easy *data) return result; } - /* * cookie_sort * @@ -1291,8 +1288,7 @@ CURLcode Curl_cookie_getlist(struct Curl_easy *data, /* at first, remove expired cookies */ remove_expired(ci); - for(n = Curl_llist_head(&ci->cookielist[myhash]); - n; n = Curl_node_next(n)) { + for(n = Curl_llist_head(&ci->cookielist[myhash]); n; n = Curl_node_next(n)) { struct Cookie *co = Curl_node_elem(n); /* if the cookie requires we are secure we must only continue if we are! */ @@ -1302,7 +1298,7 @@ CURLcode Curl_cookie_getlist(struct Curl_easy *data, if(!co->domain || (co->tailmatch && !is_ip && cookie_tailmatch(co->domain, strlen(co->domain), host)) || - ((!co->tailmatch || is_ip) && curl_strequal(host, co->domain)) ) { + ((!co->tailmatch || is_ip) && curl_strequal(host, co->domain))) { /* * the right part of the host matches the domain stuff in the * cookie data @@ -1312,7 +1308,7 @@ CURLcode Curl_cookie_getlist(struct Curl_easy *data, * now check the left part of the path with the cookies path * requirement */ - if(!co->spath || pathmatch(co->spath, path) ) { + if(!co->spath || pathmatch(co->spath, path)) { /* * This is a match and we add it to the return-linked-list @@ -1445,14 +1441,14 @@ void Curl_cookie_cleanup(struct CookieInfo *ci) static char *get_netscape_format(const struct Cookie *co) { return curl_maprintf( - "%s" /* httponly preamble */ - "%s%s\t" /* domain */ - "%s\t" /* tailmatch */ - "%s\t" /* path */ - "%s\t" /* secure */ - "%" FMT_OFF_T "\t" /* expires */ - "%s\t" /* name */ - "%s", /* value */ + "%s" /* httponly preamble */ + "%s%s\t" /* domain */ + "%s\t" /* tailmatch */ + "%s\t" /* path */ + "%s\t" /* secure */ + "%" FMT_OFF_T "\t" /* expires */ + "%s\t" /* name */ + "%s", /* value */ co->httponly ? "#HttpOnly_" : "", /* * Make sure all domains are prefixed with a dot if they allow @@ -1522,8 +1518,7 @@ static CURLcode cookie_output(struct Curl_easy *data, /* only sort the cookies with a domain property */ for(i = 0; i < COOKIE_HASH_SIZE; i++) { - for(n = Curl_llist_head(&ci->cookielist[i]); n; - n = Curl_node_next(n)) { + for(n = Curl_llist_head(&ci->cookielist[i]); n; n = Curl_node_next(n)) { struct Cookie *co = Curl_node_elem(n); if(!co->domain) continue; diff --git a/lib/cookie.h b/lib/cookie.h index e1be698cf49a..5e9f5f7823ce 100644 --- a/lib/cookie.h +++ b/lib/cookie.h @@ -30,29 +30,29 @@ #include "llist.h" struct Cookie { - struct Curl_llist_node node; /* for the main cookie list */ + struct Curl_llist_node node; /* for the main cookie list */ struct Curl_llist_node getnode; /* for getlist */ - char *name; /* = value */ - char *value; /* name = */ - char *path; /* path = which is in Set-Cookie: */ - char *spath; /* sanitized cookie path */ - char *domain; /* domain = */ - curl_off_t expires; /* expires = */ - unsigned int creationtime; /* time when the cookie was written */ - BIT(tailmatch); /* tail-match the domain name */ - BIT(secure); /* the 'secure' keyword was used */ - BIT(livecookie); /* updated from a server, not a stored file */ - BIT(httponly); /* the httponly directive is present */ - BIT(prefix_secure); /* secure prefix is set */ - BIT(prefix_host); /* host prefix is set */ + char *name; /* = value */ + char *value; /* name = */ + char *path; /* path = which is in Set-Cookie: */ + char *spath; /* sanitized cookie path */ + char *domain; /* domain = */ + curl_off_t expires; /* expires = */ + unsigned int creationtime; /* time when the cookie was written */ + BIT(tailmatch); /* tail-match the domain name */ + BIT(secure); /* the 'secure' keyword was used */ + BIT(livecookie); /* updated from server, not a stored file */ + BIT(httponly); /* the httponly directive is present */ + BIT(prefix_secure); /* secure prefix is set */ + BIT(prefix_host); /* host prefix is set */ }; /* * Available cookie prefixes, as defined in * draft-ietf-httpbis-rfc6265bis-02 */ -#define COOKIE_PREFIX__SECURE (1<<0) -#define COOKIE_PREFIX__HOST (1<<1) +#define COOKIE_PREFIX__SECURE (1 << 0) +#define COOKIE_PREFIX__HOST (1 << 1) #define COOKIE_HASH_SIZE 63 @@ -60,9 +60,9 @@ struct CookieInfo { /* linked lists of cookies we know of */ struct Curl_llist cookielist[COOKIE_HASH_SIZE]; curl_off_t next_expiration; /* the next time at which expiration happens */ - unsigned int numcookies; /* number of cookies in the "jar" */ - unsigned int lastct; /* last creation-time used in the jar */ - BIT(running); /* state info, for cookie adding information */ + unsigned int numcookies; /* number of cookies in the "jar" */ + unsigned int lastct; /* last creation-time used in the jar */ + BIT(running); /* state info, for cookie adding information */ BIT(newsession); /* new session, discard session cookies on load */ }; @@ -130,7 +130,7 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies); #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 +#define Curl_flush_cookies(x, y) Curl_nop_stmt #else void Curl_flush_cookies(struct Curl_easy *data, bool cleanup); void Curl_cookie_cleanup(struct CookieInfo *c); diff --git a/lib/cshutdn.c b/lib/cshutdn.c index 0a4ab416473f..26c8f9c0dd41 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -119,7 +119,6 @@ void Curl_cshutdn_run_once(struct Curl_easy *data, Curl_detach_connection(data); } - void Curl_cshutdn_terminate(struct Curl_easy *data, struct connectdata *conn, bool do_shutdown) @@ -227,7 +226,6 @@ static CURLcode cshutdn_wait(struct cshutdn *cshutdn, return result; } - static void cshutdn_perform(struct cshutdn *cshutdn, struct Curl_easy *data) { @@ -270,7 +268,6 @@ static void cshutdn_perform(struct cshutdn *cshutdn, Curl_expire_ex(data, nowp, next_expire_ms, EXPIRE_SHUTDOWN); } - static void cshutdn_terminate_all(struct cshutdn *cshutdn, struct Curl_easy *data, int timeout_ms) @@ -301,7 +298,7 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn, spent_ms = curlx_timediff_ms(curlx_now(), started); if(spent_ms >= (timediff_t)timeout_ms) { CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, %s", - (timeout_ms > 0) ? "timeout" : "best effort done"); + (timeout_ms > 0) ? "timeout" : "best effort done"); break; } @@ -325,7 +322,6 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn, sigpipe_restore(&pipe_st); } - int Curl_cshutdn_init(struct cshutdn *cshutdn, struct Curl_multi *multi) { @@ -336,7 +332,6 @@ int Curl_cshutdn_init(struct cshutdn *cshutdn, return 0; /* good */ } - void Curl_cshutdn_destroy(struct cshutdn *cshutdn, struct Curl_easy *data) { @@ -388,7 +383,6 @@ size_t Curl_cshutdn_dest_count(struct Curl_easy *data, return 0; } - static CURLMcode cshutdn_update_ev(struct cshutdn *cshutdn, struct Curl_easy *data, struct connectdata *conn) @@ -404,7 +398,6 @@ static CURLMcode cshutdn_update_ev(struct cshutdn *cshutdn, return mresult; } - void Curl_cshutdn_add(struct cshutdn *cshutdn, struct connectdata *conn, size_t conns_in_pool) @@ -436,7 +429,6 @@ void Curl_cshutdn_add(struct cshutdn *cshutdn, conn->connection_id, Curl_llist_count(&cshutdn->list)); } - static void cshutdn_multi_socket(struct cshutdn *cshutdn, struct Curl_easy *data, curl_socket_t s) @@ -461,7 +453,6 @@ static void cshutdn_multi_socket(struct cshutdn *cshutdn, } } - void Curl_cshutdn_perform(struct cshutdn *cshutdn, struct Curl_easy *data, curl_socket_t s) @@ -483,8 +474,7 @@ void Curl_cshutdn_setfds(struct cshutdn *cshutdn, struct easy_pollset ps; Curl_pollset_init(&ps); - for(e = Curl_llist_head(&cshutdn->list); e; - e = Curl_node_next(e)) { + for(e = Curl_llist_head(&cshutdn->list); e; e = Curl_node_next(e)) { unsigned int i; struct connectdata *conn = Curl_node_elem(e); CURLcode result; @@ -535,8 +525,7 @@ unsigned int Curl_cshutdn_add_waitfds(struct cshutdn *cshutdn, CURLcode result; Curl_pollset_init(&ps); - for(e = Curl_llist_head(&cshutdn->list); e; - e = Curl_node_next(e)) { + for(e = Curl_llist_head(&cshutdn->list); e; e = Curl_node_next(e)) { conn = Curl_node_elem(e); Curl_pollset_reset(&ps); Curl_attach_connection(data, conn); @@ -563,8 +552,7 @@ CURLcode Curl_cshutdn_add_pollfds(struct cshutdn *cshutdn, struct connectdata *conn; Curl_pollset_init(&ps); - for(e = Curl_llist_head(&cshutdn->list); e; - e = Curl_node_next(e)) { + for(e = Curl_llist_head(&cshutdn->list); e; e = Curl_node_next(e)) { conn = Curl_node_elem(e); Curl_pollset_reset(&ps); Curl_attach_connection(data, conn); From 6d156bc05f6d96a84a5c6a464dee638870e92094 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 01:26:56 +0100 Subject: [PATCH 595/885] tests/data: replace Perl `&&` with `and` for XML-compliance Bringing down non-XML-compliant files to 50 (from 58). Follow-up to 7f3731ce142c1d74023abad183cc8ce0fd527fab #19595 Closes #19765 --- tests/data/test1506 | 3 +-- tests/data/test1510 | 3 +-- tests/data/test1512 | 3 +-- tests/data/test1542 | 3 +-- tests/data/test2402 | 3 +-- tests/data/test2404 | 3 +-- tests/data/test2502 | 3 +-- tests/data/test96 | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/data/test1506 b/tests/data/test1506 index cd7654a0d8bc..677d16773c22 100644 --- a/tests/data/test1506 +++ b/tests/data/test1506 @@ -4,7 +4,6 @@ HTTP multi verbose logs -notxml @@ -93,7 +92,7 @@ Accept: */* * Connection #3 to host server4.example.com:%HTTPPORT left intact -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /Closing connection/)) diff --git a/tests/data/test1510 b/tests/data/test1510 index febe7d76ea30..7a688c81a23a 100644 --- a/tests/data/test1510 +++ b/tests/data/test1510 @@ -4,7 +4,6 @@ HTTP verbose logs flaky -notxml @@ -90,7 +89,7 @@ Accept: */* * Connection #3 to host server4.example.com:%HTTPPORT left intact -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /Closing connection/)) diff --git a/tests/data/test1512 b/tests/data/test1512 index 3798d7325b4c..74547cdd2867 100644 --- a/tests/data/test1512 +++ b/tests/data/test1512 @@ -3,7 +3,6 @@ HTTP GLOBAL DNS CACHE -notxml @@ -75,7 +74,7 @@ Accept: */* ^Host:.* -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /Closing connection/)) diff --git a/tests/data/test1542 b/tests/data/test1542 index 044fe518a467..41cf01432475 100644 --- a/tests/data/test1542 +++ b/tests/data/test1542 @@ -6,7 +6,6 @@ connection reuse persistent connection CURLOPT_MAXLIFETIME_CONN verbose logs -notxml @@ -66,7 +65,7 @@ Accept: */* == Info: Connection #1 to host %HOSTIP:%HTTPPORT left intact -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /(closing|shutting down) connection #\d+/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /(closing|shutting down) connection #\d+/)) diff --git a/tests/data/test2402 b/tests/data/test2402 index ba3fcc85b451..5dc357f58fcd 100644 --- a/tests/data/test2402 +++ b/tests/data/test2402 @@ -5,7 +5,6 @@ HTTP HTTP/2 multi verbose logs -notxml @@ -104,7 +103,7 @@ Via: 2 nghttpx * Connection #0 to host localhost:%HTTP2TLSPORT left intact -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /Closing connection/)) diff --git a/tests/data/test2404 b/tests/data/test2404 index 5034a15c3ca6..3dbb726be9a3 100644 --- a/tests/data/test2404 +++ b/tests/data/test2404 @@ -5,7 +5,6 @@ HTTP HTTP/2 multi verbose logs -notxml @@ -104,7 +103,7 @@ Via: 2 nghttpx * Connection #0 to host localhost:%HTTP2TLSPORT left intact -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /Closing connection/)) diff --git a/tests/data/test2502 b/tests/data/test2502 index ac6cd3cf588c..c76b0418744d 100644 --- a/tests/data/test2502 +++ b/tests/data/test2502 @@ -5,7 +5,6 @@ HTTP HTTP/3 multi verbose logs -notxml @@ -99,7 +98,7 @@ Via: 3 nghttpx == Info: Connection #0 to host localhost:%HTTP3PORT left intact -$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if(($_ !~ /left intact/) and ($_ !~ /Closing connection/)) Maximum allocated: 1800000 diff --git a/tests/data/test96 b/tests/data/test96 index de4b7c18ad3f..a99114a3b3fb 100644 --- a/tests/data/test96 +++ b/tests/data/test96 @@ -2,7 +2,6 @@ TrackMemory -notxml @@ -37,7 +36,7 @@ MEM tool_cfgable.c MEM tool_cfgable.c -$_ = '' if((($_ !~ /tool_paramhlp/) && ($_ !~ /tool_cfgable/)) || ($_ =~ /free\(\(nil\)\)/)) +$_ = '' if((($_ !~ /tool_paramhlp/) and ($_ !~ /tool_cfgable/)) || ($_ =~ /free\(\(nil\)\)/)) s/:\d+.*// s:^(MEM )(.*/)(.*):$1$3: From 2d2d70b6e568f229d140264361a219851de1fd56 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 01:45:57 +0100 Subject: [PATCH 596/885] test613.pl: integrate mtime check for test 1445, 1446 Move check logic from postchecks to `test613.pl`. To make these test data files XML-compliant. Also to avoid POSIX/bash-shellisms in postcheck. Closes #19766 --- tests/data/test1445 | 4 +--- tests/data/test1446 | 7 +------ tests/libtest/test613.pl | 9 ++++++++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/data/test1445 b/tests/data/test1445 index 705162be2d37..08c12c9647a8 100644 --- a/tests/data/test1445 +++ b/tests/data/test1445 @@ -3,7 +3,6 @@ FILE --remote-time -notxml @@ -29,8 +28,7 @@ file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.dir/plainfile.txt --remote-tim # Verify data after the test has been "shot" -%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \ -%PERL -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 946728000)' +%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %LOGDIR/curl%TESTNUMBER.out 946728000 diff --git a/tests/data/test1446 b/tests/data/test1446 index 448eefbc1f5a..aa87ce11e193 100644 --- a/tests/data/test1446 +++ b/tests/data/test1446 @@ -3,16 +3,13 @@ SFTP --remote-time -notxml -# # Server-side -# # Client-side @@ -29,12 +26,10 @@ SFTP with --remote-time -# # Verify data after the test has been "shot" -%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \ -%PERL -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 978264000)' +%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %LOGDIR/curl%TESTNUMBER.out 978264000 diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index 88c0e4968256..3cccb6ed7f71 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -83,7 +83,6 @@ sub errout { } elsif($ARGV[0] eq "postprocess") { my $dirname = $ARGV[1]; - my $logfile = $ARGV[2]; # Clean up the test directory if($^O eq 'cygwin') { @@ -97,6 +96,14 @@ sub errout { rmdir $dirname || die "$!"; + if($#ARGV >= 3) { # Verify mtime if requested + my $checkfile = $ARGV[2]; + my $expected_mtime = int($ARGV[3]); + my $mtime = (stat($checkfile))[9]; + exit ($mtime != $expected_mtime); + } + + my $logfile = $ARGV[2]; if($logfile && -s $logfile) { # Process the directory file to remove all information that # could be inconsistent from one test run to the next (e.g. From 0180af248119d373b74b6906c5adac71d4b6cdfe Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 02:57:39 +0100 Subject: [PATCH 597/885] tests/data: add `%PERL` to postcheck commands where missing To avoid potentially executing a different Perl than used by the rest of the build and tests. Also to be more portable by not relying on shebang support, though these particular tests require POSIX shell anyway. Closes #19767 --- tests/data/test1013 | 2 +- tests/data/test1014 | 2 +- tests/data/test1022 | 2 +- tests/data/test1023 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/data/test1013 b/tests/data/test1013 index aee2bfbefb3a..ef7cd958aa7e 100644 --- a/tests/data/test1013 +++ b/tests/data/test1013 @@ -25,7 +25,7 @@ Compare curl --version with curl-config --protocols # Verify data after the test has been "shot" -%SRCDIR/libtest/test%TESTNUMBER.pl ../curl-config %LOGDIR/stdout%TESTNUMBER protocols +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl ../curl-config %LOGDIR/stdout%TESTNUMBER protocols 0 diff --git a/tests/data/test1014 b/tests/data/test1014 index 7dce0d8e1542..72289bc4ad32 100644 --- a/tests/data/test1014 +++ b/tests/data/test1014 @@ -25,7 +25,7 @@ Compare curl --version with curl-config --features # Verify data after the test has been "shot" -%SRCDIR/libtest/test1013.pl ../curl-config %LOGDIR/stdout%TESTNUMBER features > %LOGDIR/result%TESTNUMBER +%PERL %SRCDIR/libtest/test1013.pl ../curl-config %LOGDIR/stdout%TESTNUMBER features > %LOGDIR/result%TESTNUMBER 0 diff --git a/tests/data/test1022 b/tests/data/test1022 index 888c9ea1024c..b3b6bc04a2d6 100644 --- a/tests/data/test1022 +++ b/tests/data/test1022 @@ -25,7 +25,7 @@ Compare curl --version with curl-config --version # Verify data after the test has been "shot" -%SRCDIR/libtest/test%TESTNUMBER.pl ../curl-config %LOGDIR/stdout%TESTNUMBER version +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl ../curl-config %LOGDIR/stdout%TESTNUMBER version 0 diff --git a/tests/data/test1023 b/tests/data/test1023 index 40fb11f81ed2..6e55d235e82d 100644 --- a/tests/data/test1023 +++ b/tests/data/test1023 @@ -25,7 +25,7 @@ Compare curl --version with curl-config --vernum # Verify data after the test has been "shot" -%SRCDIR/libtest/test1022.pl ../curl-config %LOGDIR/stdout%TESTNUMBER vernum +%PERL %SRCDIR/libtest/test1022.pl ../curl-config %LOGDIR/stdout%TESTNUMBER vernum 0 From fdf9937cef62755f67e7d622d6fdd296eb542009 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 12:34:02 +0100 Subject: [PATCH 598/885] rtmp: stop redefining `setsockopt` system symbol on Windows Before this patch it added Windows-specific casts. In unity builds this also affected other source files. `setsockopt()` is called without special casts in other places in the code, and passing a non-const char ptr to a const char ptr arg also should work. Basic compile test with mingw-w64 confirms. In case of issues, a cast to `curl_socklen_t` can be used, or do the special case in an `#if` branch. Also: merge Windows-specific guards for `SET_RCVTIMEO()`. Follow-up to 639d052e4499c663a578d940713e40cd466268fa #3155 Follow-up to 04cb15ae9dc0e863487ee55de2226cf5033311c0 Closes #19768 --- lib/curl_rtmp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index b2dd937008a5..6f9e7c37b4b8 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -37,10 +37,7 @@ #include #include -#if defined(_WIN32) && !defined(USE_LWIPSOCK) -#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e) -#define SET_RCVTIMEO(tv,s) int tv = s*1000 -#elif defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD) +#if defined(USE_WINSOCK) || defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD) #define SET_RCVTIMEO(tv,s) int tv = s*1000 #else #define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0} From 003689c3d37510f7073d203ed94c882c19653fac Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 12:52:46 +0100 Subject: [PATCH 599/885] cf-socket: drop feature check for `IPV6_V6ONLY` on Windows The macro is present in all supported Windows toolchains. It's present in mingw-w64 v3+, and in MS SDK 6.0A+ (maybe earlier). Also: - restrict this logic to `USE_WINSOCK` (was: `_WIN32`), to exclude alternate socket libraries (i.e. lwIP). lwIP supports `IPV6_V6ONLY` since its 2.0.0 (2016-11-10) release and it's disabled by default, unlike in Winsock. Ref: https://github.com/lwip-tcpip/lwip/commit/e65202f8257e55b09e6309b1aa405b5e6a017f0d - delete interim setter function/dummy macro `set_ipv6_v6only()`. Follow-up to a28f5f68b965119d9dd1ab6c2a2ccc66c6ed5d1f #18010 Follow-up to ca3f6decb927a4c3eb4c10fba09848b626a526d6 #10975 Closes #19769 --- lib/cf-socket.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index a12995941610..0e431976c915 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -83,22 +83,6 @@ #include "curlx/strparse.h" -#if defined(USE_IPV6) && defined(IPV6_V6ONLY) && defined(_WIN32) -/* It makes support for IPv4-mapped IPv6 addresses. - * Linux kernel, NetBSD, FreeBSD and Darwin: default is off; - * Windows Vista and later: default is on; - * DragonFly BSD: acts like off, and dummy setting; - * OpenBSD and earlier Windows: unsupported. - * Linux: controlled by /proc/sys/net/ipv6/bindv6only. - */ -static void set_ipv6_v6only(curl_socket_t sockfd, int on) -{ - (void)setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on)); -} -#else -#define set_ipv6_v6only(x, y) -#endif - static void tcpnodelay(struct Curl_cfilter *cf, struct Curl_easy *data, curl_socket_t sockfd) @@ -1114,7 +1098,18 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, #ifdef USE_IPV6 if(ctx->addr.family == AF_INET6) { - set_ipv6_v6only(ctx->sock, 0); +#ifdef USE_WINSOCK + /* Turn on support for IPv4-mapped IPv6 addresses. + * Linux kernel, NetBSD, FreeBSD, Darwin, lwIP: default is off; + * Windows Vista and later: default is on; + * DragonFly BSD: acts like off, and dummy setting; + * OpenBSD and earlier Windows: unsupported. + * Linux: controlled by /proc/sys/net/ipv6/bindv6only. + */ + int on = 0; + (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_V6ONLY, + (void *)&on, sizeof(on)); +#endif infof(data, " Trying [%s]:%d...", ctx->ip.remote_ip, ctx->ip.remote_port); } else From 815bf7664999cb733438c9dd54bbbd8f1737679e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 17:16:03 +0100 Subject: [PATCH 600/885] autotools: delete idle `AM_CFLAGS`, `AM_LDFLAGS` variables Closes #19771 --- lib/Makefile.am | 9 +++------ src/Makefile.am | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index 784b7f35d61e..2645872ebf77 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -63,8 +63,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) -AM_LDFLAGS = -AM_CFLAGS = if DEBUGBUILD AM_CPPFLAGS += -DDEBUGBUILD endif @@ -136,12 +134,11 @@ libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) endif libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) -libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(CURL_LDFLAGS_LIB) $(LIBCURL_PC_LIBS_PRIVATE) -libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) +libcurl_la_LDFLAGS = $(libcurl_la_LDFLAGS_EXTRA) $(CURL_LDFLAGS_LIB) $(LIBCURL_PC_LIBS_PRIVATE) +libcurl_la_CFLAGS = $(libcurl_la_CFLAGS_EXTRA) libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS -libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_PC_LIBS_PRIVATE) -libcurlu_la_CFLAGS = $(AM_CFLAGS) +libcurlu_la_LDFLAGS = -static $(LIBCURL_PC_LIBS_PRIVATE) CHECKSRC = $(CS_$(V)) CS_0 = @echo " RUN " $@; diff --git a/src/Makefile.am b/src/Makefile.am index c1bcf273597e..169a64f71391 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,7 +61,6 @@ if CURLDEBUG AM_CPPFLAGS += -DCURLDEBUG endif -AM_LDFLAGS = if USE_UNICODE UNICODEFLAG = -municode endif @@ -94,7 +93,7 @@ curl_SOURCES += $(CURL_RCFILES) $(CURL_RCFILES): tool_version.h endif -curl_LDFLAGS = $(AM_LDFLAGS) $(CURL_LDFLAGS_BIN) $(UNICODEFLAG) +curl_LDFLAGS = $(CURL_LDFLAGS_BIN) $(UNICODEFLAG) # This might hold -Werror CFLAGS += @CURL_CFLAG_EXTRAS@ From 4e8d5da7eeaa83c9d2e5cc62fb92231cf75d3c94 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 17:31:24 +0100 Subject: [PATCH 601/885] vtls: drop interim ECH feature macros (OpenSSL, wolfSSL) Use the macros set by autotools and cmake, to simplify. Closes #19772 --- lib/vtls/openssl.c | 24 ++++++++++-------------- lib/vtls/wolfssl.c | 12 ++++-------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index a958698b5836..67466e6e41d5 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -86,11 +86,7 @@ #include #include -#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST -#define USE_ECH_OPENSSL -#endif - -#if defined(USE_ECH_OPENSSL) && !defined(HAVE_BORINGSSL_LIKE) +#if defined(HAVE_SSL_SET1_ECH_CONFIG_LIST) && !defined(HAVE_BORINGSSL_LIKE) #include #endif @@ -3447,7 +3443,7 @@ ossl_init_session_and_alpns(struct ossl_ctx *octx, return CURLE_OK; } -#ifdef USE_ECH_OPENSSL +#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST static CURLcode ossl_init_ech(struct ossl_ctx *octx, struct Curl_cfilter *cf, struct Curl_easy *data, @@ -3576,7 +3572,7 @@ static CURLcode ossl_init_ech(struct ossl_ctx *octx, return CURLE_OK; } -#endif /* USE_ECH_OPENSSL */ +#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST */ static CURLcode ossl_init_ssl(struct ossl_ctx *octx, struct Curl_cfilter *cf, @@ -3611,13 +3607,13 @@ static CURLcode ossl_init_ssl(struct ossl_ctx *octx, } } -#ifdef USE_ECH_OPENSSL +#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST { CURLcode result = ossl_init_ech(octx, cf, data, peer); if(result) return result; } -#endif /* USE_ECH_OPENSSL */ +#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST */ return ossl_init_session_and_alpns(octx, cf, data, peer, alpns_requested, sess_reuse_cb); @@ -4091,7 +4087,7 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, return CURLE_OK; } -#ifdef USE_ECH_OPENSSL +#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST /* If we have retry configs, then trace those out */ static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL *ssl, int reason) @@ -4262,7 +4258,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, ossl_strerror(errdetail, error_buffer, sizeof(error_buffer))); } #endif -#ifdef USE_ECH_OPENSSL +#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST else if((lib == ERR_LIB_SSL) && # ifndef HAVE_BORINGSSL_LIKE (reason == SSL_R_ECH_REQUIRED)) { @@ -4309,7 +4305,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, connssl->connecting_state = ssl_connect_3; Curl_ossl_report_handshake(data, octx); -#if defined(USE_ECH_OPENSSL) && !defined(HAVE_BORINGSSL_LIKE) +#if defined(HAVE_SSL_SET1_ECH_CONFIG_LIST) && !defined(HAVE_BORINGSSL_LIKE) if(ECH_ENABLED(data)) { char *inner = NULL, *outer = NULL; const char *status = NULL; @@ -4367,7 +4363,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, else { infof(data, "ECH: result: status is not attempted"); } -#endif /* USE_ECH_OPENSSL && !HAVE_BORINGSSL_LIKE */ +#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST && !HAVE_BORINGSSL_LIKE */ #ifdef HAS_ALPN_OPENSSL /* Sets data and len to negotiated protocol, len is 0 if no protocol was @@ -5435,7 +5431,7 @@ const struct Curl_ssl Curl_ssl_openssl = { #ifdef HAVE_SSL_CTX_SET1_SIGALGS SSLSUPP_SIGNATURE_ALGORITHMS | #endif -#ifdef USE_ECH_OPENSSL +#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST SSLSUPP_ECH | #endif SSLSUPP_CA_CACHE | diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 62bf723efd33..cfefeb9320c7 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -75,10 +75,6 @@ #include #include "wolfssl.h" -#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG -#define USE_ECH_WOLFSSL -#endif - /* KEEP_PEER_CERT is a product of the presence of build time symbol OPENSSL_EXTRA without NO_CERTS, depending on the version. KEEP_PEER_CERT is in wolfSSL's settings.h, and the latter two are build time symbols in @@ -1364,7 +1360,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, } #endif /* HAVE_SECURE_RENEGOTIATION */ -#ifdef USE_ECH_WOLFSSL +#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG if(ECH_ENABLED(data)) { int trying_ech_now = 0; @@ -1449,7 +1445,7 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, } } -#endif /* USE_ECH_WOLFSSL */ +#endif /* HAVE_WOLFSSL_CTX_GENERATEECHCONFIG */ result = CURLE_OK; @@ -1786,7 +1782,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, struct Curl_easy *data) return wssl->io_result; } } -#ifdef USE_ECH_WOLFSSL +#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG else if(detail == -1) { /* try access a retry_config ECHConfigList for tracing */ byte echConfigs[1000]; @@ -2282,7 +2278,7 @@ const struct Curl_ssl Curl_ssl_wolfssl = { #endif SSLSUPP_CA_PATH | SSLSUPP_CAINFO_BLOB | -#ifdef USE_ECH_WOLFSSL +#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG SSLSUPP_ECH | #endif SSLSUPP_SSL_CTX | From f553bff6ee719cf04402b28305e911458b5b6d36 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 23:27:06 +0100 Subject: [PATCH 602/885] cmakelint: also lint CMake `.in` files, fix a long line ``` CMakeConfigurableFile.in cmake_uninstall.cmake.in curl-config.cmake.in ``` Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973 Closes #19773 --- CMake/curl-config.cmake.in | 3 ++- scripts/cmakelint.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index c4e9f59e863b..33d540da27c8 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -23,7 +23,8 @@ ########################################################################### @PACKAGE_INIT@ -option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@" "@CURL_USE_PKGCONFIG@") +option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@" + "@CURL_USE_PKGCONFIG@") include(CMakeFindDependencyMacro) diff --git a/scripts/cmakelint.sh b/scripts/cmakelint.sh index 325a07b5e6cb..1e1cc592ed3f 100755 --- a/scripts/cmakelint.sh +++ b/scripts/cmakelint.sh @@ -52,7 +52,7 @@ cd "$(dirname "$0")"/.. # strip off the leading ./ to make the grep regexes work properly find . -type f | sed 's@^\./@@' fi -} | grep -E '(^CMake|/CMake|\.cmake$)' | grep -v -E '(\.h\.cmake|\.in|\.c)$' \ +} | grep -E '(^CMake|/CMake|\.cmake$)' | grep -v -E '(\.h\.cmake|\.c)$' \ | xargs \ cmake-lint \ --suppress-decorations \ From 7799d15eef302cdc3fdbbe1dec5c43df2048ec9e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 00:34:33 +0100 Subject: [PATCH 603/885] cmake: fix `ws2_32` reference in `curl-config.cmake` Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973 Follow-up to 554dfa556886c3d7425f6690f3fc408128bf4744 #17927 Closes #19775 --- CMake/curl-config.cmake.in | 2 +- CMakeLists.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index 33d540da27c8..525f2d3dbeb3 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -133,7 +133,7 @@ set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND WIN32 AND NOT TARGET CURL::win32_winsock) add_library(CURL::win32_winsock INTERFACE IMPORTED) - set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "@_win32_winsock@") + set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32") endif() include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") diff --git a/CMakeLists.txt b/CMakeLists.txt index 2af1679c993f..5bcf0b6a631a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2340,7 +2340,6 @@ if(NOT CURL_DISABLE_INSTALL) # USE_RUSTLS # USE_WIN32_LDAP CURL_DISABLE_LDAP # USE_WOLFSSL - # _win32_winsock configure_package_config_file("CMake/curl-config.cmake.in" "${_project_config}" INSTALL_DESTINATION ${_install_cmake_dir} From bf58ca6e8f5f518c1f4b4acab03acb1b60e25c00 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 01:17:41 +0100 Subject: [PATCH 604/885] cmake: narrow scope of custom `CMAKE_MODULE_PATH` in `curl-config.cmake` Set it only while using local Find modules, leave it as-is while using system ones. Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973 Cherry-picked from #19776 --- CMake/curl-config.cmake.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index 525f2d3dbeb3..97c60d3a8d4d 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -28,10 +28,6 @@ option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependenci include(CMakeFindDependencyMacro) -set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH}) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) - -set(_libs "") if("@USE_OPENSSL@") if("@OPENSSL_VERSION_MAJOR@") find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@") @@ -42,6 +38,12 @@ endif() if("@HAVE_LIBZ@") find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@") endif() + +set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) + +set(_libs "") + if("@HAVE_BROTLI@") find_dependency(Brotli) list(APPEND _libs CURL::brotli) From 41931f1659f485ba60cfb4da0b4479bfb0fd8a8e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 30 Nov 2025 23:35:25 +0100 Subject: [PATCH 605/885] imap: make sure Curl_pgrsSetDownloadSize() does not overflow Follow-up to c1e3a760b. The previous update missed an addition that also can wrap and cause confusion. Fixing this by calling Curl_pgrsSetDownloadSize() after the overflow check. Reported-by: Deniz Parlak Closes #19774 --- lib/imap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index d093e46d33ab..9d58bec4ec81 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1214,8 +1214,6 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data, /* This is a literal response, setup to receive the body data */ infof(data, "Found %" FMT_OFF_T " bytes to download", size); - /* Progress size includes both header line and literal body */ - Curl_pgrsSetDownloadSize(data, size + len); /* First write the header line */ result = Curl_client_write(data, CLIENTWRITE_BODY, line, len); @@ -1268,6 +1266,9 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data, else size += len; + /* Progress size includes both header line and literal body */ + Curl_pgrsSetDownloadSize(data, size); + if(data->req.bytecount == size) /* All data already transferred (header + literal body) */ Curl_xfer_setup_nop(data); From cffc91284475e78a7d9b0538b9db329fe3249f63 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 09:26:28 +0100 Subject: [PATCH 606/885] url: fix return code for OOM in parse_proxy() Closes #19779 --- lib/url.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/url.c b/lib/url.c index b4c33236cd67..84909f037238 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2250,11 +2250,15 @@ static CURLcode parse_proxy(struct Curl_easy *data, /* Is there a username and password given in this proxy url? */ uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE); - if(uc && (uc != CURLUE_NO_USER)) + if(uc && (uc != CURLUE_NO_USER)) { + result = Curl_uc_to_curlcode(uc); goto error; + } uc = curl_url_get(uhp, CURLUPART_PASSWORD, &proxypasswd, CURLU_URLDECODE); - if(uc && (uc != CURLUE_NO_PASSWORD)) + if(uc && (uc != CURLUE_NO_PASSWORD)) { + result = Curl_uc_to_curlcode(uc); goto error; + } if(proxyuser || proxypasswd) { curlx_free(proxyinfo->user); From 729316a9e4aed66c3ca90435e2c7f4052dac32f9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 10:24:32 +0100 Subject: [PATCH 607/885] http: handle oom error from Curl_input_digest() Closes #19780 --- lib/http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/http.c b/lib/http.c index f09d96ee0607..5e2b8f9ac013 100644 --- a/lib/http.c +++ b/lib/http.c @@ -976,6 +976,8 @@ static CURLcode auth_digest(struct Curl_easy *data, * Digest */ result = Curl_input_digest(data, proxy, auth); if(result) { + if(result == CURLE_OUT_OF_MEMORY) + return result; infof(data, "Digest authentication problem, ignoring."); data->state.authproblem = TRUE; } From dabfae84f0f2626974c109c979a21bcaad357450 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 01:53:25 +0100 Subject: [PATCH 608/885] cmake: namespace all local variables in `curl-config.cmake` Also: - apply it to the local copy of this code in `lib/CMakeLists.txt`. - replace 'CURL' with `@PROJECT_NAME@` in a message. Closes #19777 --- CMake/curl-config.cmake.in | 86 +++++++++++++++++++------------------- lib/CMakeLists.txt | 16 +++---- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index 97c60d3a8d4d..7ae026d8f8c6 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -42,93 +42,93 @@ endif() set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) -set(_libs "") +set(_curl_libs "") if("@HAVE_BROTLI@") find_dependency(Brotli) - list(APPEND _libs CURL::brotli) + list(APPEND _curl_libs CURL::brotli) endif() if("@USE_ARES@") find_dependency(Cares) - list(APPEND _libs CURL::cares) + list(APPEND _curl_libs CURL::cares) endif() if("@HAVE_GSSAPI@") find_dependency(GSS) - list(APPEND _libs CURL::gss) + list(APPEND _curl_libs CURL::gss) endif() if("@USE_BACKTRACE@") find_dependency(Libbacktrace) - list(APPEND _libs CURL::libbacktrace) + list(APPEND _curl_libs CURL::libbacktrace) endif() if("@USE_GSASL@") find_dependency(Libgsasl) - list(APPEND _libs CURL::libgsasl) + list(APPEND _curl_libs CURL::libgsasl) endif() if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@") find_dependency(LDAP) - list(APPEND _libs CURL::ldap) + list(APPEND _curl_libs CURL::ldap) endif() if("@HAVE_LIBIDN2@") find_dependency(Libidn2) - list(APPEND _libs CURL::libidn2) + list(APPEND _curl_libs CURL::libidn2) endif() if("@USE_LIBPSL@") find_dependency(Libpsl) - list(APPEND _libs CURL::libpsl) + list(APPEND _curl_libs CURL::libpsl) endif() if("@USE_LIBRTMP@") find_dependency(Librtmp) - list(APPEND _libs CURL::librtmp) + list(APPEND _curl_libs CURL::librtmp) endif() if("@USE_LIBSSH@") find_dependency(Libssh) - list(APPEND _libs CURL::libssh) + list(APPEND _curl_libs CURL::libssh) endif() if("@USE_LIBSSH2@") find_dependency(Libssh2) - list(APPEND _libs CURL::libssh2) + list(APPEND _curl_libs CURL::libssh2) endif() if("@USE_LIBUV@") find_dependency(Libuv) - list(APPEND _libs CURL::libuv) + list(APPEND _curl_libs CURL::libuv) endif() if("@USE_MBEDTLS@") find_dependency(MbedTLS) - list(APPEND _libs CURL::mbedtls) + list(APPEND _curl_libs CURL::mbedtls) endif() if("@USE_NGHTTP2@") find_dependency(NGHTTP2) - list(APPEND _libs CURL::nghttp2) + list(APPEND _curl_libs CURL::nghttp2) endif() if("@USE_NGHTTP3@") find_dependency(NGHTTP3) - list(APPEND _libs CURL::nghttp3) + list(APPEND _curl_libs CURL::nghttp3) endif() if("@USE_NGTCP2@") find_dependency(NGTCP2) - list(APPEND _libs CURL::ngtcp2) + list(APPEND _curl_libs CURL::ngtcp2) endif() if("@USE_GNUTLS@") find_dependency(GnuTLS) - list(APPEND _libs CURL::gnutls) + list(APPEND _curl_libs CURL::gnutls) find_dependency(Nettle) - list(APPEND _libs CURL::nettle) + list(APPEND _curl_libs CURL::nettle) endif() if("@USE_QUICHE@") find_dependency(Quiche) - list(APPEND _libs CURL::quiche) + list(APPEND _curl_libs CURL::quiche) endif() if("@USE_RUSTLS@") find_dependency(Rustls) - list(APPEND _libs CURL::rustls) + list(APPEND _curl_libs CURL::rustls) endif() if("@USE_WOLFSSL@") find_dependency(WolfSSL) - list(APPEND _libs CURL::wolfssl) + list(APPEND _curl_libs CURL::wolfssl) endif() if("@HAVE_ZSTD@") find_dependency(Zstd) - list(APPEND _libs CURL::zstd) + list(APPEND _curl_libs CURL::zstd) endif() set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) @@ -155,16 +155,16 @@ if(TARGET @PROJECT_NAME@::@LIB_STATIC@) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) cmake_policy(GET CMP0099 _has_CMP0099) # https://cmake.org/cmake/help/latest/policy/CMP0099.html endif() - if(NOT _has_CMP0099 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.13 AND _libs) - set(_libdirs "") - foreach(_lib IN LISTS _libs) - get_target_property(_libdir "${_lib}" INTERFACE_LINK_DIRECTORIES) - if(_libdir) - list(APPEND _libdirs "${_libdir}") + if(NOT _has_CMP0099 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.13 AND _curl_libs) + set(_curl_libdirs "") + foreach(_curl_lib IN LISTS _curl_libs) + get_target_property(_curl_libdir "${_curl_lib}" INTERFACE_LINK_DIRECTORIES) + if(_curl_libdir) + list(APPEND _curl_libdirs "${_curl_libdir}") endif() endforeach() - if(_libdirs) - target_link_directories(@PROJECT_NAME@::@LIB_STATIC@ INTERFACE ${_libdirs}) + if(_curl_libdirs) + target_link_directories(@PROJECT_NAME@::@LIB_STATIC@ INTERFACE ${_curl_libdirs}) endif() endif() endif() @@ -178,25 +178,25 @@ set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@") -foreach(_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES) - set(CURL_SUPPORTS_${_item} TRUE) +foreach(_curl_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES) + set(CURL_SUPPORTS_${_curl_item} TRUE) endforeach() -set(_missing_req "") -foreach(_item IN LISTS CURL_FIND_COMPONENTS) - if(CURL_SUPPORTS_${_item}) - set(CURL_${_item}_FOUND TRUE) - elseif(CURL_FIND_REQUIRED_${_item}) - list(APPEND _missing_req ${_item}) +set(_curl_missing_req "") +foreach(_curl_item IN LISTS CURL_FIND_COMPONENTS) + if(CURL_SUPPORTS_${_curl_item}) + set(CURL_${_curl_item}_FOUND TRUE) + elseif(CURL_FIND_REQUIRED_${_curl_item}) + list(APPEND _curl_missing_req ${_curl_item}) endif() endforeach() -if(_missing_req) - string(REPLACE ";" " " _missing_req "${_missing_req}") +if(_curl_missing_req) + string(REPLACE ";" " " _curl_missing_req "${_curl_missing_req}") if(CURL_FIND_REQUIRED) - message(FATAL_ERROR "CURL: missing required components: ${_missing_req}") + message(FATAL_ERROR "@PROJECT_NAME@: missing required components: ${_curl_missing_req}") endif() - unset(_missing_req) + unset(_curl_missing_req) endif() check_required_components("@PROJECT_NAME@") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5ce288a0a897..b9b175a24d06 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -181,17 +181,17 @@ if(BUILD_STATIC_LIBS) cmake_policy(GET CMP0099 _has_CMP0099) # https://cmake.org/cmake/help/latest/policy/CMP0099.html endif() if(NOT _has_CMP0099 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.13 AND CURL_LIBS) - set(_libdirs "") - foreach(_lib IN LISTS CURL_LIBS) - if(TARGET "${_lib}") - get_target_property(_libdir "${_lib}" INTERFACE_LINK_DIRECTORIES) - if(_libdir) - list(APPEND _libdirs "${_libdir}") + set(_curl_libdirs "") + foreach(_curl_lib IN LISTS CURL_LIBS) + if(TARGET "${_curl_lib}") + get_target_property(_curl_libdir "${_curl_lib}" INTERFACE_LINK_DIRECTORIES) + if(_curl_libdir) + list(APPEND _curl_libdirs "${_curl_libdir}") endif() endif() endforeach() - if(_libdirs) - target_link_directories(${LIB_STATIC} INTERFACE ${_libdirs}) + if(_curl_libdirs) + target_link_directories(${LIB_STATIC} INTERFACE ${_curl_libdirs}) endif() endif() endif() From 4aed2dcc897b383b8bb9ae3bf2d7a2246ebccfcd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 15:23:58 +0100 Subject: [PATCH 609/885] krb5: fix detecting channel binding feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the already detected `gssapi/gssapi_krb5.h` MIT Kerberos header to pull in `gssapi_ext.h`, which in turn sets `GSS_C_CHANNEL_BOUND_FLAG` if supported. Channel binding is present in MIT Kerberos 1.19+. Also: - lib: de-duplicate GSS-API header includes. - vauth: de-duplicate `urldata.h` includes. - drop interim feature macro in favor of the native GSS one. Assisted-by: Max Faxälv Reported-by: Max Faxälv Bug: https://github.com/curl/curl/pull/19164#issuecomment-3551687025 Follow-up to 8616e5aada9c78fb611c60d913c999c8e78c14ba #19164 Closes #19603 Closes #19760 --- lib/curl_gssapi.h | 5 ----- lib/http_negotiate.c | 6 +++--- lib/urldata.h | 11 +++++------ lib/vauth/cleartext.c | 1 - lib/vauth/cram.c | 1 - lib/vauth/digest.c | 1 - lib/vauth/digest_sspi.c | 1 - lib/vauth/gsasl.c | 1 - lib/vauth/krb5_gssapi.c | 1 - lib/vauth/krb5_sspi.c | 1 - lib/vauth/ntlm.c | 4 +--- lib/vauth/ntlm_sspi.c | 1 - lib/vauth/oauth2.c | 1 - lib/vauth/spnego_gssapi.c | 5 ++--- lib/vauth/spnego_sspi.c | 1 - lib/vauth/vauth.c | 1 - lib/vauth/vauth.h | 15 ++------------- lib/version.c | 12 ------------ 18 files changed, 13 insertions(+), 56 deletions(-) diff --git a/lib/curl_gssapi.h b/lib/curl_gssapi.h index 1a2bbabdf516..6df7e059d325 100644 --- a/lib/curl_gssapi.h +++ b/lib/curl_gssapi.h @@ -28,11 +28,6 @@ #include "urldata.h" #ifdef HAVE_GSSAPI - -#ifdef GSS_C_CHANNEL_BOUND_FLAG /* MIT Kerberos 1.19+, missing from GNU GSS */ -#define CURL_GSSAPI_HAS_CHANNEL_BINDING -#endif - extern gss_OID_desc Curl_spnego_mech_oid; extern gss_OID_desc Curl_krb5_mech_oid; diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index fc80f80fa350..f31e59c2ca6d 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -120,7 +120,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, neg_ctx->sslContext = conn->sslContext; #endif /* Check if the connection is using SSL and get the channel binding data */ -#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING +#ifdef GSS_C_CHANNEL_BOUND_FLAG #ifdef USE_SSL curlx_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1); if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) { @@ -134,13 +134,13 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, #else curlx_dyn_init(&neg_ctx->channel_binding_data, 1); #endif /* USE_SSL */ -#endif /* CURL_GSSAPI_HAS_CHANNEL_BINDING */ +#endif /* GSS_C_CHANNEL_BOUND_FLAG */ /* Initialize the security context and decode our challenge */ result = Curl_auth_decode_spnego_message(data, userp, passwdp, service, host, header, neg_ctx); -#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING +#ifdef GSS_C_CHANNEL_BOUND_FLAG curlx_dyn_free(&neg_ctx->channel_binding_data); #endif diff --git a/lib/urldata.h b/lib/urldata.h index 561db56ecd8a..1c91099d153d 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -191,12 +191,11 @@ typedef CURLcode (Curl_recv)(struct Curl_easy *data, /* transfer */ #ifdef HAVE_GSSAPI # ifdef HAVE_GSSGNU # include -# else -# ifdef HAVE_GSSAPI_H -# include -# else -# include -# endif +# elif defined(HAVE_GSSAPI_H) +# include +# else /* MIT Kerberos */ +# include +# include /* for GSS_C_CHANNEL_BOUND_FLAG, in 1.19+ */ # endif #endif diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index 862310111e66..c0e59fd273b9 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -32,7 +32,6 @@ (!defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP)) #include -#include "../urldata.h" #include "vauth.h" #include "../curlx/warnless.h" diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index 9bc5544a64fa..6a39a400ee3c 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -29,7 +29,6 @@ #ifndef CURL_DISABLE_DIGEST_AUTH #include -#include "../urldata.h" #include "vauth.h" #include "../curl_hmac.h" diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index c5fea6739449..8bcfc7ed6c9c 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -33,7 +33,6 @@ #include "vauth.h" #include "digest.h" -#include "../urldata.h" #include "../curlx/base64.h" #include "../curl_hmac.h" #include "../curl_md5.h" diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index 550810acda18..fc2c1393750f 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -33,7 +33,6 @@ #include "vauth.h" #include "digest.h" -#include "../urldata.h" #include "../curlx/warnless.h" #include "../curlx/multibyte.h" #include "../sendf.h" diff --git a/lib/vauth/gsasl.c b/lib/vauth/gsasl.c index 8330a4bd7155..3888622dbffa 100644 --- a/lib/vauth/gsasl.c +++ b/lib/vauth/gsasl.c @@ -31,7 +31,6 @@ #include #include "vauth.h" -#include "../urldata.h" #include "../sendf.h" #include diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 1590949d681a..7ba21a394184 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -33,7 +33,6 @@ #include "vauth.h" #include "../curl_sasl.h" -#include "../urldata.h" #include "../curl_gssapi.h" #include "../sendf.h" diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index 2f82345b98c7..7317af809ad5 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -31,7 +31,6 @@ #include #include "vauth.h" -#include "../urldata.h" #include "../curlx/warnless.h" #include "../curlx/multibyte.h" #include "../sendf.h" diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index e5eb1de5ef8b..e47135337acd 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -35,7 +35,7 @@ #define DEBUG_ME 0 -#include "../urldata.h" +#include "vauth.h" #include "../sendf.h" #include "../curl_ntlm_core.h" #include "../curl_gethostname.h" @@ -44,8 +44,6 @@ #include "../rand.h" #include "../vtls/vtls.h" #include "../strdup.h" - -#include "vauth.h" #include "../curl_endian.h" /* NTLM buffer fixed size, large enough for long user + host + domain */ diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index bab319671c48..561de27dc36c 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -29,7 +29,6 @@ #include #include "vauth.h" -#include "../urldata.h" #include "../curl_ntlm_core.h" #include "../curlx/warnless.h" #include "../curlx/multibyte.h" diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c index 3b4d4164f094..c9122debffa9 100644 --- a/lib/vauth/oauth2.c +++ b/lib/vauth/oauth2.c @@ -31,7 +31,6 @@ (!defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP)) #include -#include "../urldata.h" #include "vauth.h" #include "../curlx/warnless.h" diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index f956f2c03e81..3a24e8860a80 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -31,7 +31,6 @@ #include #include "vauth.h" -#include "../urldata.h" #include "../curlx/base64.h" #include "../curl_gssapi.h" #include "../curlx/warnless.h" @@ -92,7 +91,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; gss_channel_bindings_t chan_bindings = GSS_C_NO_CHANNEL_BINDINGS; -#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING +#ifdef GSS_C_CHANNEL_BOUND_FLAG struct gss_channel_bindings_struct chan; #endif @@ -155,7 +154,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, } /* Set channel binding data if available */ -#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING +#ifdef GSS_C_CHANNEL_BOUND_FLAG if(curlx_dyn_len(&nego->channel_binding_data)) { memset(&chan, 0, sizeof(struct gss_channel_bindings_struct)); chan.application_data.length = curlx_dyn_len(&nego->channel_binding_data); diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 2b0504f630f8..2a6548b6d4d9 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -31,7 +31,6 @@ #include #include "vauth.h" -#include "../urldata.h" #include "../curlx/base64.h" #include "../curlx/warnless.h" #include "../curlx/multibyte.h" diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index 4ca6cef7c8fe..9b87bd2c6757 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -28,7 +28,6 @@ #include "vauth.h" #include "../strdup.h" -#include "../urldata.h" #include "../curlx/multibyte.h" #include "../url.h" diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h index 51b9f41c1b04..4c98d9b1c11c 100644 --- a/lib/vauth/vauth.h +++ b/lib/vauth/vauth.h @@ -28,6 +28,7 @@ #include "../bufref.h" #include "../curlx/dynbuf.h" +#include "../urldata.h" struct Curl_easy; struct connectdata; @@ -233,18 +234,6 @@ CURLcode Curl_auth_create_xoauth_bearer_message(const char *user, #ifdef USE_KERBEROS5 -#ifdef HAVE_GSSAPI -# ifdef HAVE_GSSGNU -# include -# else -# ifdef HAVE_GSSAPI_H -# include -# else -# include -# endif -# endif -#endif - /* meta key for storing KRB5 meta at connection */ #define CURL_META_KRB5_CONN "meta:auth:krb5:conn" @@ -310,7 +299,7 @@ struct negotiatedata { gss_ctx_id_t context; gss_name_t spn; gss_buffer_desc output_token; -#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING +#ifdef GSS_C_CHANNEL_BOUND_FLAG struct dynbuf channel_binding_data; #endif #else diff --git a/lib/version.c b/lib/version.c index f02b92fedfc7..49c15ffcdec9 100644 --- a/lib/version.c +++ b/lib/version.c @@ -77,18 +77,6 @@ #include #endif -#ifdef HAVE_GSSAPI -# ifdef HAVE_GSSGNU -# include -# else -# ifdef HAVE_GSSAPI_H -# include -# else -# include -# endif -# endif -#endif - #ifdef USE_OPENLDAP #include #endif From 012fa2b91b6c1129695600bfdafc5f01f7fce76f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 11:04:36 +0100 Subject: [PATCH 610/885] auth: always treat Curl_auth_ntlm_get() returning NULL as OOM Closes #19782 --- lib/curl_sasl.c | 2 +- lib/http_ntlm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index aef47dc0162e..f0b6e9471e5f 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -705,7 +705,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, case SASL_NTLM_TYPE2MSG: { /* Decode the type-2 message */ struct ntlmdata *ntlm = Curl_auth_ntlm_get(conn, FALSE); - result = !ntlm ? CURLE_FAILED_INIT : + result = !ntlm ? CURLE_OUT_OF_MEMORY : get_server_message(sasl, data, &serverdata); if(!result) result = Curl_auth_decode_ntlm_type2_message(data, &serverdata, ntlm); diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index 2856745c34c4..6c79bcac1b97 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -64,7 +64,7 @@ CURLcode Curl_input_ntlm(struct Curl_easy *data, if(checkprefix("NTLM", header)) { struct ntlmdata *ntlm = Curl_auth_ntlm_get(conn, proxy); if(!ntlm) - return CURLE_FAILED_INIT; + return CURLE_OUT_OF_MEMORY; header += strlen("NTLM"); curlx_str_passblanks(&header); From c6c4a99300bebdd3fd5a6af9ebca0053e3cbc8f7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 11:00:47 +0100 Subject: [PATCH 611/885] http: acknowledge OOM errors from Curl_input_ntlm Closes #19781 --- lib/http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/http.c b/lib/http.c index 5e2b8f9ac013..fcae0a57c25c 100644 --- a/lib/http.c +++ b/lib/http.c @@ -946,6 +946,8 @@ static CURLcode auth_ntlm(struct Curl_easy *data, if(!result) data->state.authproblem = FALSE; else { + if(result == CURLE_OUT_OF_MEMORY) + return result; infof(data, "NTLM authentication problem, ignoring."); data->state.authproblem = TRUE; } From a7bebd8502914f1652f423eddfd7005f8413a781 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 1 Dec 2025 13:22:25 +0100 Subject: [PATCH 612/885] memdebug: add mutex for thread safety Protect modification to the `membuf` by different threads via a mutex. This ensure that index updates are correct and that data gets written in order. Closes #19785 --- lib/memdebug.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/memdebug.c b/lib/memdebug.c index 329b11ea793b..1dda6d785cca 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -29,6 +29,7 @@ #include #include "urldata.h" +#include "curl_threads.h" #include "curlx/fopen.h" /* for CURLX_FOPEN_LOW(), CURLX_FREOPEN_LOW() */ #ifdef USE_BACKTRACE @@ -66,6 +67,11 @@ static struct backtrace_state *btstate; static char membuf[KEEPSIZE]; static size_t memwidx = 0; /* write index */ +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) +static bool dbg_mutex_init = 0; +static curl_mutex_t dbg_mutex; +#endif + /* LeakSantizier (LSAN) calls _exit() instead of exit() when a leak is detected on exit so the logfile must be closed explicitly or data could be lost. Though _exit() does not call atexit handlers such as this, LSAN's call to @@ -81,6 +87,12 @@ static void curl_dbg_cleanup(void) fclose(curl_dbg_logfile); } curl_dbg_logfile = NULL; +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + if(dbg_mutex_init) { + Curl_mutex_destroy(&dbg_mutex); + dbg_mutex_init = FALSE; + } +#endif } #ifdef USE_BACKTRACE static void error_bt_callback(void *data, const char *message, @@ -123,6 +135,12 @@ void curl_dbg_memdebug(const char *logname) setbuf(curl_dbg_logfile, (char *)NULL); #endif } +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + if(!dbg_mutex_init) { + dbg_mutex_init = TRUE; + Curl_mutex_init(&dbg_mutex); + } +#endif #ifdef USE_BACKTRACE btstate = backtrace_create_state(NULL, 0, error_bt_callback, NULL); #endif @@ -526,6 +544,11 @@ void curl_dbg_log(const char *format, ...) nchars = (int)sizeof(buf) - 1; if(nchars > 0) { +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + bool lock_mutex = dbg_mutex_init; + if(lock_mutex) + Curl_mutex_acquire(&dbg_mutex); +#endif if(KEEPSIZE - nchars < memwidx) { /* flush */ fwrite(membuf, 1, memwidx, curl_dbg_logfile); @@ -538,6 +561,10 @@ void curl_dbg_log(const char *format, ...) } memcpy(&membuf[memwidx], buf, nchars); memwidx += nchars; +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + if(lock_mutex) + Curl_mutex_release(&dbg_mutex); +#endif } } From d1b85bc49c5dd0e2c2eaf06027b5520152317f62 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 1 Dec 2025 14:05:39 +0100 Subject: [PATCH 613/885] memdebug: log before free add the debug log before freeing the memory, otherwise another thread might allocate and log it before the free is logged. Follow-up to a7bebd8502914f1652f423 Closes #19787 --- lib/memdebug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/memdebug.c b/lib/memdebug.c index 1dda6d785cca..b6c2d854c33e 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -337,6 +337,9 @@ void curl_dbg_free(void *ptr, int line, const char *source) if(ptr) { struct memdebug *mem; + if(source) + curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr); + #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:1684) @@ -352,9 +355,6 @@ void curl_dbg_free(void *ptr, int line, const char *source) /* free for real */ (Curl_cfree)(mem); } - - if(source && ptr) - curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr); } curl_socket_t curl_dbg_socket(int domain, int type, int protocol, From fb7033d7600dfb59de06e7af8a0d6ab2a4163578 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 13:48:12 +0100 Subject: [PATCH 614/885] runtests: enable torture testing with threaded resolver Since a7bebd850291 made it possible. Closes #19786 --- tests/runtests.pl | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index 648666fd301e..1bde3f3afc64 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -846,15 +846,9 @@ sub checksystemfeatures { } # 'socks' was once here but is now removed - if($torture) { - if(!$feature{"TrackMemory"}) { - die "cannot run torture tests since curl was built without ". - "TrackMemory feature (--enable-curldebug)"; - } - if($feature{"threaded-resolver"} && !$valgrind) { - die "cannot run torture tests since curl was built with the ". - "threaded resolver, and we are not running with valgrind"; - } + if($torture && !$feature{"TrackMemory"}) { + die "cannot run torture tests since curl was built without ". + "TrackMemory feature (--enable-curldebug)"; } my $hostname=join(' ', runclientoutput("hostname")); @@ -879,13 +873,6 @@ sub checksystemfeatures { # Only show if not the default for now logmsg "* Jobs: $jobs\n"; } - # Disable memory tracking when using threaded resolver - if($feature{"TrackMemory"} && $feature{"threaded-resolver"}) { - logmsg("*\n", - "*** DISABLES TrackMemory (memory tracking) when using threaded resolver\n", - "*\n"); - $feature{"TrackMemory"} = 0; - } my $env = sprintf("%s%s%s%s%s", $valgrind?"Valgrind ":"", From a2ebae61ca365a358c6d11b2ab1f0b062efa49c6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 13:14:17 +0100 Subject: [PATCH 615/885] tool_urlglob: acknowledge OOM in peek_ipv6 Previously, an OOM error would just imply not an IPv6 address. Closes #19784 --- src/tool_urlglob.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index 9ea8a274fa0d..bfa54ab8275b 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -343,7 +343,7 @@ static CURLcode glob_range(struct URLGlob *glob, const char **patternp, #define MAX_IP6LEN 128 -static bool peek_ipv6(const char *str, size_t *skip) +static CURLcode peek_ipv6(const char *str, size_t *skip, bool *ipv6p) { /* * Scan for a potential IPv6 literal. @@ -355,27 +355,33 @@ static bool peek_ipv6(const char *str, size_t *skip) char *endbr = strchr(str, ']'); size_t hlen; CURLUcode rc; + CURLcode result = CURLE_OK; + *ipv6p = FALSE; /* default to nope */ + *skip = 0; if(!endbr) - return FALSE; + return CURLE_OK; hlen = endbr - str + 1; if(hlen >= MAX_IP6LEN) - return FALSE; + return CURLE_OK; u = curl_url(); if(!u) - return FALSE; + return CURLE_OUT_OF_MEMORY; memcpy(hostname, str, hlen); hostname[hlen] = 0; /* ask to "guess scheme" as then it works without an https:// prefix */ rc = curl_url_set(u, CURLUPART_URL, hostname, CURLU_GUESS_SCHEME); - curl_url_cleanup(u); - if(!rc) + if(rc == CURLUE_OUT_OF_MEMORY) + return CURLE_OUT_OF_MEMORY; + if(!rc) { *skip = hlen; - return rc ? FALSE : TRUE; + *ipv6p = TRUE; + } + return result; } static CURLcode add_glob(struct URLGlob *glob, size_t pos) @@ -414,7 +420,11 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, if(*pattern == '[') { /* skip over IPv6 literals and [] */ size_t skip = 0; - if(!peek_ipv6(pattern, &skip) && (pattern[1] == ']')) + bool ipv6; + res = peek_ipv6(pattern, &skip, &ipv6); + if(res) + return res; + if(!ipv6 && (pattern[1] == ']')) skip = 2; if(skip) { if(curlx_dyn_addn(&glob->buf, pattern, skip)) From c421c3e3251b33e78b1c98030d92e6ad23a82d03 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Nov 2025 23:22:59 +0100 Subject: [PATCH 616/885] cmake: verify minimum CMake version in `curl-config.cmake` Show a message if the CMake version is lower than that when consuming libcurl via the CMake config. The minimum CMake version on consumption is for now the same as the minimum required (v3.7) to build curl itself. Ref: https://cmake.org/cmake/help/v3.7/variable/CMAKE_MINIMUM_REQUIRED_VERSION.html Ref: #18704 (discussion) Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973 Closes #19776 --- CMake/curl-config.cmake.in | 5 +++++ CMakeLists.txt | 1 + 2 files changed, 6 insertions(+) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index 7ae026d8f8c6..7f346c832ca5 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -26,6 +26,11 @@ option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@" "@CURL_USE_PKGCONFIG@") +if(CMAKE_VERSION VERSION_LESS @CMAKE_MINIMUM_REQUIRED_VERSION@) + message(STATUS "@PROJECT_NAME@: @PROJECT_NAME@-specific Find modules require " + "CMake @CMAKE_MINIMUM_REQUIRED_VERSION@ or upper, found: ${CMAKE_VERSION}.") +endif() + include(CMakeFindDependencyMacro) if("@USE_OPENSSL@") diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bcf0b6a631a..b45e7859e090 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2309,6 +2309,7 @@ if(NOT CURL_DISABLE_INSTALL) ${_generated_version_config}") # Consumed custom variables: + # CMAKE_MINIMUM_REQUIRED_VERSION # CURLVERSION # LIBCURL_PC_LIBS_PRIVATE_LIST # LIB_NAME From ca1919caee6a82e400acdc491179b748f38c5ede Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 15:52:10 +0100 Subject: [PATCH 617/885] idn: fix memory leak in `win32_ascii_to_idn()` Closes #19789 --- lib/idn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/idn.c b/lib/idn.c index 1c404f6543f3..38f2845f260e 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -201,6 +201,7 @@ static CURLcode win32_ascii_to_idn(const char *in, char **output) WCHAR idn[IDN_MAX_LENGTH]; /* stores a UTF-16 string */ int chars = IdnToUnicode(0, in_w, (int)(wcslen(in_w) + 1), idn, IDN_MAX_LENGTH); + curlx_unicodefree(in_w); if(chars) { /* 'chars' is "the number of characters retrieved" */ char *mstr = curlx_convert_wchar_to_UTF8(idn); From 338713345046e164ddd3b2dca75d862124d34a3a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 16:36:25 +0100 Subject: [PATCH 618/885] lib: delete unused `curlx/multibyte.h` includes Closes #19792 --- lib/vauth/krb5_sspi.c | 1 - lib/vauth/ntlm.c | 1 - lib/vauth/ntlm_sspi.c | 1 - lib/vauth/spnego_gssapi.c | 1 - lib/vauth/spnego_sspi.c | 1 - 5 files changed, 5 deletions(-) diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index 7317af809ad5..21636d59ee3d 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -32,7 +32,6 @@ #include "vauth.h" #include "../curlx/warnless.h" -#include "../curlx/multibyte.h" #include "../sendf.h" /* diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index e47135337acd..22d028e8c2fa 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -39,7 +39,6 @@ #include "../sendf.h" #include "../curl_ntlm_core.h" #include "../curl_gethostname.h" -#include "../curlx/multibyte.h" #include "../curlx/warnless.h" #include "../rand.h" #include "../vtls/vtls.h" diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index 561de27dc36c..d724907db649 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -31,7 +31,6 @@ #include "vauth.h" #include "../curl_ntlm_core.h" #include "../curlx/warnless.h" -#include "../curlx/multibyte.h" #include "../sendf.h" #include "../strdup.h" diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index 3a24e8860a80..2feafdda4b24 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -34,7 +34,6 @@ #include "../curlx/base64.h" #include "../curl_gssapi.h" #include "../curlx/warnless.h" -#include "../curlx/multibyte.h" #include "../sendf.h" #if defined(__GNUC__) && defined(__APPLE__) diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 2a6548b6d4d9..31747c0a0e72 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -33,7 +33,6 @@ #include "vauth.h" #include "../curlx/base64.h" #include "../curlx/warnless.h" -#include "../curlx/multibyte.h" #include "../sendf.h" #include "../strerror.h" From ccb68d2e3b602b24a8cb52f473b96938ac998db6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 15:49:01 +0100 Subject: [PATCH 619/885] idn: use curlx allocators on Windows Replace `curlx_convert*()` functions with local copies that always use the curlx allocator. Closes #19790 --- lib/idn.c | 81 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/lib/idn.c b/lib/idn.c index 38f2845f260e..0b1a4a36ccc0 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -30,7 +30,6 @@ #include "urldata.h" #include "idn.h" #include "sendf.h" -#include "curlx/multibyte.h" #include "curlx/warnless.h" #ifdef USE_LIBIDN2 @@ -163,24 +162,60 @@ WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags, #define IDN_MAX_LENGTH 255 +static wchar_t *idn_curlx_convert_UTF8_to_wchar(const char *str_utf8) +{ + wchar_t *str_w = NULL; + + if(str_utf8) { + int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, + str_utf8, -1, NULL, 0); + if(str_w_len > 0) { + str_w = curlx_malloc(str_w_len * sizeof(wchar_t)); + if(str_w) { + if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, + str_w_len) == 0) { + curlx_free(str_w); + return NULL; + } + } + } + } + return str_w; +} + +static char *idn_curlx_convert_wchar_to_UTF8(const wchar_t *str_w) +{ + char *str_utf8 = NULL; + + if(str_w) { + int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, + NULL, 0, NULL, NULL); + if(bytes > 0) { + str_utf8 = curlx_malloc(bytes); + if(str_utf8) { + if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, bytes, + NULL, NULL) == 0) { + curlx_free(str_utf8); + return NULL; + } + } + } + } + return str_utf8; +} + static CURLcode win32_idn_to_ascii(const char *in, char **out) { - wchar_t *in_w = curlx_convert_UTF8_to_wchar(in); + wchar_t *in_w = idn_curlx_convert_UTF8_to_wchar(in); *out = NULL; if(in_w) { wchar_t punycode[IDN_MAX_LENGTH]; int chars = IdnToAscii(0, in_w, (int)(wcslen(in_w) + 1), punycode, IDN_MAX_LENGTH); - curlx_unicodefree(in_w); + curlx_free(in_w); if(chars) { - char *mstr = curlx_convert_wchar_to_UTF8(punycode); - if(mstr) { - *out = curlx_strdup(mstr); - curlx_unicodefree(mstr); - if(!*out) - return CURLE_OUT_OF_MEMORY; - } - else + *out = idn_curlx_convert_wchar_to_UTF8(punycode); + if(!*out) return CURLE_OUT_OF_MEMORY; } else @@ -192,32 +227,26 @@ static CURLcode win32_idn_to_ascii(const char *in, char **out) return CURLE_OK; } -static CURLcode win32_ascii_to_idn(const char *in, char **output) +static CURLcode win32_ascii_to_idn(const char *in, char **out) { - char *out = NULL; - - wchar_t *in_w = curlx_convert_UTF8_to_wchar(in); + wchar_t *in_w = idn_curlx_convert_UTF8_to_wchar(in); + *out = NULL; if(in_w) { WCHAR idn[IDN_MAX_LENGTH]; /* stores a UTF-16 string */ int chars = IdnToUnicode(0, in_w, (int)(wcslen(in_w) + 1), idn, IDN_MAX_LENGTH); - curlx_unicodefree(in_w); - if(chars) { - /* 'chars' is "the number of characters retrieved" */ - char *mstr = curlx_convert_wchar_to_UTF8(idn); - if(mstr) { - out = curlx_strdup(mstr); - curlx_unicodefree(mstr); - if(!out) - return CURLE_OUT_OF_MEMORY; - } + curlx_free(in_w); + if(chars) { /* 'chars' is "the number of characters retrieved" */ + *out = idn_curlx_convert_wchar_to_UTF8(idn); + if(!*out) + return CURLE_OUT_OF_MEMORY; } else return CURLE_URL_MALFORMAT; } else return CURLE_URL_MALFORMAT; - *output = out; + return CURLE_OK; } From a3fcd80de4b1fe00c8832713afadfc6ad8f391b3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 15:25:26 +0100 Subject: [PATCH 620/885] curlx: use curlx allocators in non-memdebug builds (Windows) To limit raw allocators to `CURLDEBUG` (memdebug/TrackMemory) Windows UNICODE builds. Closes #19788 --- lib/curlx/fopen.c | 50 +++++++++++++++---------------------------- lib/curlx/multibyte.c | 12 ++++------- lib/curlx/multibyte.h | 15 ++++++++++++- 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index caf4978af163..1838b7de8b8c 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -100,8 +100,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) goto cleanup; if(!needed || needed >= max_path_len) goto cleanup; - /* !checksrc! disable BANNEDFUNC 1 */ - ibuf = malloc(needed * sizeof(wchar_t)); + ibuf = CURLX_MALLOC(needed * sizeof(wchar_t)); if(!ibuf) goto cleanup; if(mbstowcs_s(&count, ibuf, needed, in, needed - 1)) @@ -122,8 +121,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) /* skip paths that are not excessive and do not need modification */ if(needed <= MAX_PATH) goto cleanup; - /* !checksrc! disable BANNEDFUNC 1 */ - fbuf = malloc(needed * sizeof(wchar_t)); + fbuf = CURLX_MALLOC(needed * sizeof(wchar_t)); if(!fbuf) goto cleanup; count = (size_t)GetFullPathNameW(in_w, (DWORD)needed, fbuf, NULL); @@ -156,19 +154,16 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) if(needed > max_path_len) goto cleanup; - /* !checksrc! disable BANNEDFUNC 1 */ - temp = malloc(needed * sizeof(wchar_t)); + temp = CURLX_MALLOC(needed * sizeof(wchar_t)); if(!temp) goto cleanup; if(wcsncpy_s(temp, needed, L"\\\\?\\UNC\\", 8)) { - /* !checksrc! disable BANNEDFUNC 1 */ - free(temp); + CURLX_FREE(temp); goto cleanup; } if(wcscpy_s(temp + 8, needed, fbuf + 2)) { - /* !checksrc! disable BANNEDFUNC 1 */ - free(temp); + CURLX_FREE(temp); goto cleanup; } } @@ -178,25 +173,21 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) if(needed > max_path_len) goto cleanup; - /* !checksrc! disable BANNEDFUNC 1 */ - temp = malloc(needed * sizeof(wchar_t)); + temp = CURLX_MALLOC(needed * sizeof(wchar_t)); if(!temp) goto cleanup; if(wcsncpy_s(temp, needed, L"\\\\?\\", 4)) { - /* !checksrc! disable BANNEDFUNC 1 */ - free(temp); + CURLX_FREE(temp); goto cleanup; } if(wcscpy_s(temp + 4, needed, fbuf)) { - /* !checksrc! disable BANNEDFUNC 1 */ - free(temp); + CURLX_FREE(temp); goto cleanup; } } - /* !checksrc! disable BANNEDFUNC 1 */ - free(fbuf); + CURLX_FREE(fbuf); fbuf = temp; } @@ -206,8 +197,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) goto cleanup; if(!needed || needed >= max_path_len) goto cleanup; - /* !checksrc! disable BANNEDFUNC 1 */ - obuf = malloc(needed); + obuf = CURLX_MALLOC(needed); if(!obuf) goto cleanup; if(wcstombs_s(&count, obuf, needed, fbuf, needed - 1)) @@ -222,12 +212,10 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out) #endif cleanup: - /* !checksrc! disable BANNEDFUNC 1 */ - free(fbuf); + CURLX_FREE(fbuf); #ifndef _UNICODE - /* !checksrc! disable BANNEDFUNC 2 */ - free(ibuf); - free(obuf); + CURLX_FREE(ibuf); + CURLX_FREE(obuf); #endif return *out ? true : false; } @@ -269,8 +257,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) errno = _sopen_s(&result, target, oflag, _SH_DENYNO, pmode); #endif - /* !checksrc! disable BANNEDFUNC 1 */ - free(fixed); + CURLX_FREE(fixed); return result; } @@ -303,8 +290,7 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) errno = fopen_s(&result, target, mode); #endif - /* !checksrc! disable BANNEDFUNC 1 */ - free(fixed); + CURLX_FREE(fixed); return result; } @@ -342,8 +328,7 @@ FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) errno = freopen_s(&result, target, mode, fp); #endif - /* !checksrc! disable BANNEDFUNC 1 */ - free(fixed); + CURLX_FREE(fixed); return result; } @@ -382,8 +367,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) #endif #endif - /* !checksrc! disable BANNEDFUNC 1 */ - free(fixed); + CURLX_FREE(fixed); return result; } diff --git a/lib/curlx/multibyte.c b/lib/curlx/multibyte.c index 2583f3087031..fb3b7be3e120 100644 --- a/lib/curlx/multibyte.c +++ b/lib/curlx/multibyte.c @@ -45,13 +45,11 @@ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8) int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str_utf8, -1, NULL, 0); if(str_w_len > 0) { - /* !checksrc! disable BANNEDFUNC 1 */ - str_w = malloc(str_w_len * sizeof(wchar_t)); + str_w = CURLX_MALLOC(str_w_len * sizeof(wchar_t)); if(str_w) { if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, str_w_len) == 0) { - /* !checksrc! disable BANNEDFUNC 1 */ - free(str_w); + CURLX_FREE(str_w); return NULL; } } @@ -69,13 +67,11 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w) int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL, 0, NULL, NULL); if(bytes > 0) { - /* !checksrc! disable BANNEDFUNC 1 */ - str_utf8 = malloc(bytes); + str_utf8 = CURLX_MALLOC(bytes); if(str_utf8) { if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, bytes, NULL, NULL) == 0) { - /* !checksrc! disable BANNEDFUNC 1 */ - free(str_utf8); + CURLX_FREE(str_utf8); return NULL; } } diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index fac07c2eeb24..3eae4e75bd1f 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -44,12 +44,20 @@ * memory tracker memdebug functions. */ +#ifdef CURLDEBUG +#define CURLX_MALLOC(x) malloc(x) +#define CURLX_FREE(x) free(x) +#else +#define CURLX_MALLOC(x) curlx_malloc(x) +#define CURLX_FREE(x) curlx_free(x) +#endif + /* MultiByte conversions using Windows kernel32 library. */ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); /* the purpose of this macro is to free() without being traced by memdebug */ -#define curlx_unicodefree(ptr) free(ptr) +#define curlx_unicodefree(ptr) CURLX_FREE(ptr) #ifdef UNICODE @@ -65,8 +73,13 @@ typedef union { #else /* !UNICODE */ +#ifdef CURLDEBUG #define curlx_convert_UTF8_to_tchar(ptr) _strdup(ptr) #define curlx_convert_tchar_to_UTF8(ptr) _strdup(ptr) +#else +#define curlx_convert_UTF8_to_tchar(ptr) curlx_strdup(ptr) +#define curlx_convert_tchar_to_UTF8(ptr) curlx_strdup(ptr) +#endif typedef union { char *tchar_ptr; From 5356bce6abab7e8e28a3d412b2fa2c55bfa62416 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 19:49:50 +0100 Subject: [PATCH 621/885] windows: use `_strdup()` instead of `strdup()` where missing To replace deprecated `strdup()` CRT calls with the recommended `_strdup()`. Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup-mbsdup Closes #19794 --- docs/examples/block_ip.c | 7 +------ lib/curl_setup.h | 3 +-- lib/easy.c | 4 ++++ tests/libtest/memptr.c | 4 ++++ tests/server/first.h | 4 ++++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index bf2193a26359..5cd77cad0e80 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -38,12 +38,6 @@ int main(void) } #else -#ifdef _MSC_VER -#ifndef _CRT_NONSTDC_NO_DEPRECATE -#define _CRT_NONSTDC_NO_DEPRECATE /* for strdup() */ -#endif -#endif - #ifdef _WIN32 #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600 #undef _WIN32_WINNT @@ -52,6 +46,7 @@ int main(void) #include #include #include +#define strdup _strdup #else #include #include diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 6acac0d17ad0..2cc18cf41488 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -91,8 +91,7 @@ #pragma warning(disable:4127) /* Avoid VS2005 and upper complaining about portable C functions. */ #ifndef _CRT_NONSTDC_NO_DEPRECATE /* mingw-w64 v2+. MS SDK ~10+/~VS2017+. */ -#define _CRT_NONSTDC_NO_DEPRECATE /* for close(), fileno(), strdup(), - unlink(), etc. */ +#define _CRT_NONSTDC_NO_DEPRECATE /* for close(), fileno(), unlink(), etc. */ #endif #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS /* for getenv(), gmtime(), strcpy(), diff --git a/lib/easy.c b/lib/easy.c index 476f63c74dff..c60819fcdc6e 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -103,7 +103,11 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT; * so the callback pointer is initialized correctly. */ #ifdef HAVE_STRDUP +#ifdef _WIN32 +#define system_strdup _strdup +#else #define system_strdup strdup +#endif #else #define system_strdup Curl_strdup #endif diff --git a/tests/libtest/memptr.c b/tests/libtest/memptr.c index 400e72c41ab9..fe90b01a6cb1 100644 --- a/tests/libtest/memptr.c +++ b/tests/libtest/memptr.c @@ -36,7 +36,11 @@ curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc; curl_free_callback Curl_cfree = (curl_free_callback)free; curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc; +#ifdef _WIN32 +curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)_strdup; +#else curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)strdup; +#endif curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; #if defined(_MSC_VER) && defined(_DLL) diff --git a/tests/server/first.h b/tests/server/first.h index 2979239ad366..316a7a622e8d 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -69,6 +69,10 @@ extern const struct entry_s s_entries[]; # define snprintf _snprintf #endif +#ifdef _WIN32 +# define strdup _strdup +#endif + #ifdef _WIN32 # define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n) #elif defined(HAVE_STRCASECMP) From 189fda00260b75bb2776a8ae36e3d7d36f01173e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 23:12:47 +0100 Subject: [PATCH 622/885] memdebug: replace macro constant with `sizeof()` Closes #19795 --- lib/memdebug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/memdebug.c b/lib/memdebug.c index b6c2d854c33e..bbd7407c3c90 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -63,8 +63,7 @@ static long memsize = 0; /* set number of mallocs allowed */ static struct backtrace_state *btstate; #endif -#define KEEPSIZE 10000 -static char membuf[KEEPSIZE]; +static char membuf[10000]; static size_t memwidx = 0; /* write index */ #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) @@ -549,7 +548,7 @@ void curl_dbg_log(const char *format, ...) if(lock_mutex) Curl_mutex_acquire(&dbg_mutex); #endif - if(KEEPSIZE - nchars < memwidx) { + if(sizeof(membuf) - nchars < memwidx) { /* flush */ fwrite(membuf, 1, memwidx, curl_dbg_logfile); fflush(curl_dbg_logfile); From 9517b41b509f1098ed0b3b7ff20b53a566fa3f5e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 20:08:09 +0100 Subject: [PATCH 623/885] multibyte: limit `curlx_convert_*wchar*()` functions to Unicode builds Follow-up to ccb68d2e3b602b24a8cb52f473b96938ac998db6 #19790 Closes #19796 --- lib/curlx/multibyte.c | 4 ++-- lib/curlx/multibyte.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/curlx/multibyte.c b/lib/curlx/multibyte.c index fb3b7be3e120..3a33fcedfc65 100644 --- a/lib/curlx/multibyte.c +++ b/lib/curlx/multibyte.c @@ -29,7 +29,7 @@ #include "../curl_setup.h" -#ifdef _WIN32 +#if defined(_WIN32) && defined(UNICODE) #include "multibyte.h" @@ -81,4 +81,4 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w) return str_utf8; } -#endif /* _WIN32 */ +#endif /* _WIN32 && UNICODE */ diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index 3eae4e75bd1f..fd264e180efa 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -52,15 +52,15 @@ #define CURLX_FREE(x) curlx_free(x) #endif -/* MultiByte conversions using Windows kernel32 library. */ -wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); -char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); - /* the purpose of this macro is to free() without being traced by memdebug */ #define curlx_unicodefree(ptr) CURLX_FREE(ptr) #ifdef UNICODE +/* MultiByte conversions using Windows kernel32 library. */ +wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); +char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); + #define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) #define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) From 58673ac8373c0d3baa0e5a3530e36a1095321a2b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 21:07:56 +0100 Subject: [PATCH 624/885] runtests: fix Perl warning ``` Use of uninitialized value $cmdhash{"option"} in pattern match (m//) at tests/runtests.pl line 1753. ``` Ref: https://github.com/curl/curl/actions/runs/19833947198/job/56831923295?pr=19794#step:13:3694 Follow-up to 02aa75a8c240af1a8912145497806e8925859a87 #19752 Closes #19797 --- tests/runtests.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index 1bde3f3afc64..d0455d224380 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1750,7 +1750,7 @@ sub singletest_check { if(! -f "$logdir/$MEMDUMP") { my %cmdhash = getpartattr("client", "command"); my $cmdtype = $cmdhash{'type'} || "default"; - if($cmdhash{'option'} !~ /no-memdebug/) { + if($cmdhash{'option'} && $cmdhash{'option'} !~ /no-memdebug/) { logmsg "\n** ALERT! memory tracking with no output file?\n" if($cmdtype ne "perl"); } From 85a6936d7669748983ec340519df325eea9c9333 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Dec 2025 16:32:39 +0100 Subject: [PATCH 625/885] libssh2: consider strdup() failures OOM and return correctly In the ssh_state_pkey_init function. Closes #19791 --- lib/vssh/libssh2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 8701775d7d94..4437724fcf42 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -1205,8 +1205,11 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, sshc->rsa_pub = sshc->rsa = NULL; - if(data->set.str[STRING_SSH_PRIVATE_KEY]) + if(data->set.str[STRING_SSH_PRIVATE_KEY]) { sshc->rsa = curlx_strdup(data->set.str[STRING_SSH_PRIVATE_KEY]); + if(!sshc->rsa) + out_of_memory = TRUE; + } else { /* To ponder about: should really the lib be messing about with the HOME environment variable etc? */ @@ -1251,7 +1254,7 @@ static CURLcode ssh_state_pkey_init(struct Curl_easy *data, * libssh2 extract the public key from the private key file. * This is done by simply passing sshc->rsa_pub = NULL. */ - if(data->set.str[STRING_SSH_PUBLIC_KEY] + if(!out_of_memory && data->set.str[STRING_SSH_PUBLIC_KEY] /* treat empty string the same way as NULL */ && data->set.str[STRING_SSH_PUBLIC_KEY][0]) { sshc->rsa_pub = curlx_strdup(data->set.str[STRING_SSH_PUBLIC_KEY]); From dc29590d6061931d054132cb701512a8b7305e7c Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 1 Dec 2025 18:08:25 +0100 Subject: [PATCH 626/885] memdebug: log socket close before closing To not get a mixup in the memdebug log order. Closes #19793 --- lib/memdebug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/memdebug.c b/lib/memdebug.c index bbd7407c3c90..7eae1708b7de 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -468,9 +468,8 @@ void curl_dbg_mark_sclose(curl_socket_t sockfd, int line, const char *source) /* this is our own defined way to close sockets on *ALL* platforms */ int curl_dbg_sclose(curl_socket_t sockfd, int line, const char *source) { - int res = CURL_SCLOSE(sockfd); curl_dbg_mark_sclose(sockfd, line, source); - return res; + return CURL_SCLOSE(sockfd); } ALLOC_FUNC From 055f1a3d02f656feb31a1246392473f6ac0e186f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2025 09:16:20 +0100 Subject: [PATCH 627/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 84 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2dbac34d0f65..136176ce799d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3553 + Contributors: 3554 This release includes the following changes: @@ -22,6 +22,7 @@ This release includes the following bugfixes: o asyn-ares: handle Curl_dnscache_mk_entry() OOM error [199] o asyn-ares: remove hostname free on OOM [122] o asyn-thrdd: release rrname if ares_init_options fails [41] + o auth: always treat Curl_auth_ntlm_get() returning NULL as OOM [186] o autotools: add nettle library detection via pkg-config (for GnuTLS) [178] o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] o badwords: fix issues found in scripts and other files [142] @@ -31,14 +32,19 @@ This release includes the following bugfixes: o build: tidy-up MSVC CRT warning suppression macros [140] o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74] o cf-https-connect: allocate ctx at first in cf_hc_create() [79] + o cf-socket: drop feature check for `IPV6_V6ONLY` on Windows [210] o cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime [157] o cf-socket: trace ignored errors [97] o cfilters: make conn_forget_socket a private libssh function [109] o checksrc.pl: detect assign followed by more than one space [26] o cmake: adjust defaults for target platforms not supporting shared libs [35] + o cmake: define dependencies as `IMPORTED` interface targets [223] o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16] + o cmake: fix `ws2_32` reference in `curl-config.cmake` [201] o cmake: honor `CURL_DISABLE_INSTALL` and `CURL_ENABLE_EXPORT_TARGET` [106] + o cmake: save and restore `CMAKE_MODULE_PATH` in `curl-config.cmake` [222] o code: minor indent fixes before closing braces [107] + o CODE_STYLE.md: sync banned function list with checksrc.pl [243] o config2setopts: bail out if curl_url_get() returns OOM [102] o config2setopts: exit if curl_url_set() fails on OOM [105] o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] @@ -52,15 +58,18 @@ This release includes the following bugfixes: o curl_sasl: make Curl_sasl_decode_mech compare case insensitively [160] o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124] o curl_setup.h: drop stray `#undef stat` (Windows) [103] + o curl_setup.h: drop superfluous parenthesis from `Curl_safefree` macro [242] o CURLINFO: remove 'get' and 'get the' from each short desc [50] o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48] o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example o curlx/fopen: replace open CRT functions their with `_s` counterparts (Windows) [204] + o curlx/multibyte: stop setting macros for non-Windows [226] o curlx/strerr: use `strerror_s()` on Windows [75] o curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows) [143] o curlx: replace `sprintf` with `snprintf` [194] + o curlx: use curlx allocators in non-memdebug builds (Windows) [155] o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] o DISTROS.md: add OpenBSD [126] @@ -68,6 +77,7 @@ This release includes the following bugfixes: o docs: fix checksrc `EQUALSPACE` warnings [21] o docs: mention umask need when curl creates files [56] o docs: spell it Rustls with a capital R [181] + o example: fix formatting nits [232] o examples/crawler: fix variable [92] o examples/multi-uv: fix invalid req->data access [177] o examples/multithread: fix race condition [101] @@ -86,34 +96,47 @@ This release includes the following bugfixes: o hostip: make more functions return CURLcode [202] o hostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST [183] o hsts: propagate and error out correctly on OOM [130] + o http: acknowledge OOM errors from Curl_input_ntlm [185] o http: avoid two strdup()s and do minor simplifications [144] o http: error on OOM when creating range header [59] o http: fix OOM exit in Curl_http_follow [179] + o http: handle oom error from Curl_input_digest() [192] o http: replace atoi use in Curl_http_follow with curlx_str_number [65] o http: the :authority header should never contain user+password [147] + o idn: fix memory leak in `win32_ascii_to_idn()` [173] + o idn: use curlx allocators on Windows [165] + o imap: make sure Curl_pgrsSetDownloadSize() does not overflow [200] o INSTALL-CMAKE.md: document static option defaults more [37] + o krb5: fix detecting channel binding feature [187] o krb5_sspi: unify a part of error handling [80] + o lib/sendf.h: forward declare two structs [221] o lib: cleanup for some typos about spaces and code style [3] o lib: eliminate size_t casts [112] o lib: error for OOM when extracting URL query [127] + o lib: fix formatting nits [215] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] o lib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows) [164] o lib: timer stats improvements [190] o libssh2: add paths to error messages for quote commands [114] o libssh2: cleanup ssh_force_knownhost_key_type [64] + o libssh2: consider strdup() failures OOM and return correctly [72] o libssh2: replace atoi() in ssh_force_knownhost_key_type [63] + o libssh: fix state machine loop to progress as it should o libssh: properly free sftp_attributes [153] o libtests: replace `atoi()` with `curlx_str_number()` [120] o limit-rate: add example using --limit-rate and --max-time together [89] o m4/sectrust: fix test(1) operator [4] o manage: expand the 'libcurl support required' message [208] o mbedtls: fix potential use of uninitialized `nread` [8] + o mbedtls_threadlock: avoid calloc, use array [244] + o memdebug: add mutex for thread safety [184] o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] o multi: make max_total_* members size_t [158] o multi: simplify admin handle processing [189] + o multibyte: limit `curlx_convert_*wchar*()` functions to Unicode builds [135] o ngtcp2+openssl: fix leak of session [172] o ngtcp2: remove the unused Curl_conn_is_ngtcp2 function [85] o noproxy: replace atoi with curlx_str_number [67] @@ -134,10 +157,14 @@ This release includes the following bugfixes: o ratelimit: redesign [209] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] + o rtmp: stop redefining `setsockopt` system symbol on Windows [211] o runtests: detect bad libssh differently for test 1459 [11] o runtests: drop Python 2 support remains [45] + o runtests: enable torture testing with threaded resolver [176] o rustls: fix a potential memory issue [81] o rustls: minor adjustment of sizeof() [38] + o rustls: simplify init err path [219] + o rustls: verify that verifier_builder is not NULL [220] o schannel: fix memory leak of cert_store_path on four error paths [23] o schannel: replace atoi() with curlx_str_number() [119] o schannel_verify: fix a memory leak of cert_context [152] @@ -151,6 +178,7 @@ This release includes the following bugfixes: o socks_sspi: use free() not FreeContextBuffer() [93] o speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE [113] o speedlimit: also reset on send unpausing [197] + o ssh: tracing and better pollset handling [230] o telnet: replace atoi for BINARY handling with curlx_str_number [66] o TEST-SUITE.md: correct the man page's path [136] o test07_22: fix flakiness [95] @@ -161,6 +189,7 @@ This release includes the following bugfixes: o tests/server: do not fall back to original data file in `test2fopen()` [32] o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110] o tests: allow 2500-2503 to use ~2MB malloc [31] + o tests: fix formatting nits [225] o tftp: release filename if conn_get_remote_addr fails [42] o tftpd: fix/tidy up `open()` mode flags [57] o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] @@ -172,14 +201,17 @@ This release includes the following bugfixes: o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] o tool_msgs: make voutf() use stack instead of heap [125] + o tool_operatate: return error for OOM in append2query [217] o tool_operate: exit on curl_share_setopt errors [108] o tool_operate: fix a case of ignoring return code in operate() [128] o tool_operate: fix case of ignoring return code in single_transfer [129] o tool_operate: remove redundant condition [19] o tool_operate: use curlx_str_number instead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] + o tool_urlglob: acknowledge OOM in peek_ipv6 [175] o tool_urlglob: clean up used memory on errors better [44] o tool_writeout: bail out proper on OOM [104] + o url: fix return code for OOM in parse_proxy() [193] o url: if OOM in parse_proxy() return error [132] o urlapi: fix mem-leaks in curl_url_get error paths [22] o urlapi: handle OOM properly when setting URL [180] @@ -191,6 +223,7 @@ This release includes the following bugfixes: o vtls: handle possible malicious certs_num from peer [53] o vtls: pinned key check [98] o wcurl: import v2025.11.09 [29] + o windows: use `_strdup()` instead of `strdup()` where missing [145] o wolfSSL: able to differentiate between IP and DNS in alt names [13] o wolfssl: avoid NULL dereference in OOM situation [77] o wolfssl: fix a potential memory leak of session [6] @@ -219,14 +252,15 @@ advice from friends like these: Aleksandr Sergeev, Aleksei Bavshin, Andrew Kirillov, BANADDA, boingball, Brad King, bttrfl on github, Christian Schmitz, Dan Fandrich, - Daniel McCarney, Daniel Stenberg, Fd929c2CE5fA on github, ffath-vo on github, - Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Leonardo Taccari, - letshack9707 on hackerone, Marc Aldorasi, Marcel Raad, nait-furry, - ncaklovic on github, Nick Korepanov, Omdahake on github, Patrick Monnerat, - pelioro on hackerone, Ray Satiro, renovate[bot], Samuel Henrique, - st751228051 on github, Stanislav Fort, Stefan Eissing, Sunny, - Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang, Yedaya Katsman - (38 contributors) + Daniel McCarney, Daniel Stenberg, Deniz Parlak, Fd929c2CE5fA on github, + ffath-vo on github, Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Kai Pastor, + Leonardo Taccari, letshack9707 on hackerone, Marc Aldorasi, Marcel Raad, + Max Faxälv, nait-furry, ncaklovic on github, Nick Korepanov, + Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro, + renovate[bot], Samuel Henrique, st751228051 on github, Stanislav Fort, + Stefan Eissing, Sunny, Thomas Klausner, Viktor Szakats, Wesley Moore, + Xiaoke Wang, Yedaya Katsman + (41 contributors) References to bug reports and discussions on issues: @@ -300,6 +334,7 @@ References to bug reports and discussions on issues: [69] = https://curl.se/bug/?i=17927 [70] = https://curl.se/bug/?i=19464 [71] = https://curl.se/bug/?i=19461 + [72] = https://curl.se/bug/?i=19791 [73] = https://curl.se/bug/?i=19359 [74] = https://curl.se/bug/?i=19465 [75] = https://curl.se/bug/?i=19646 @@ -361,6 +396,7 @@ References to bug reports and discussions on issues: [132] = https://curl.se/bug/?i=19590 [133] = https://curl.se/bug/?i=19471 [134] = https://curl.se/bug/?i=19583 + [135] = https://curl.se/bug/?i=19796 [136] = https://curl.se/bug/?i=19586 [137] = https://curl.se/bug/?i=19578 [138] = https://curl.se/bug/?i=19580 @@ -369,6 +405,7 @@ References to bug reports and discussions on issues: [142] = https://curl.se/bug/?i=19572 [143] = https://curl.se/bug/?i=19581 [144] = https://curl.se/bug/?i=19571 + [145] = https://curl.se/bug/?i=19794 [146] = https://curl.se/bug/?i=19543 [147] = https://curl.se/bug/?i=19568 [148] = https://curl.se/bug/?i=19569 @@ -378,6 +415,7 @@ References to bug reports and discussions on issues: [152] = https://curl.se/bug/?i=19556 [153] = https://curl.se/bug/?i=19564 [154] = https://curl.se/bug/?i=19566 + [155] = https://curl.se/bug/?i=19788 [156] = https://curl.se/bug/?i=19541 [157] = https://curl.se/bug/?i=19520 [158] = https://curl.se/bug/?i=19618 @@ -387,29 +425,57 @@ References to bug reports and discussions on issues: [162] = https://curl.se/bug/?i=19636 [163] = https://curl.se/bug/?i=19637 [164] = https://curl.se/bug/?i=19589 + [165] = https://curl.se/bug/?i=19790 [166] = https://curl.se/bug/?i=19615 [167] = https://curl.se/bug/?i=19609 [168] = https://curl.se/bug/?i=19612 [170] = https://curl.se/bug/?i=19333 [171] = https://curl.se/bug/?i=19714 [172] = https://curl.se/bug/?i=19717 + [173] = https://curl.se/bug/?i=19789 + [175] = https://curl.se/bug/?i=19784 + [176] = https://curl.se/bug/?i=19786 [177] = https://curl.se/bug/?i=19462 [178] = https://curl.se/bug/?i=19703 [179] = https://curl.se/bug/?i=19705 [180] = https://curl.se/bug/?i=19704 [181] = https://curl.se/bug/?i=19702 [183] = https://curl.se/bug/?i=19701 + [184] = https://curl.se/bug/?i=19785 + [185] = https://curl.se/bug/?i=19781 + [186] = https://curl.se/bug/?i=19782 + [187] = https://curl.se/bug/?i=19164 [189] = https://curl.se/bug/?i=19604 [190] = https://curl.se/bug/?i=19269 [191] = https://curl.se/bug/?i=19663 + [192] = https://curl.se/bug/?i=19780 + [193] = https://curl.se/bug/?i=19779 [194] = https://curl.se/bug/?i=19681 [195] = https://curl.se/bug/?i=19692 [196] = https://curl.se/bug/?i=19692 [197] = https://curl.se/bug/?i=19687 [198] = https://curl.se/bug/?i=19689 [199] = https://curl.se/bug/?i=19688 + [200] = https://curl.se/bug/?i=19774 + [201] = https://curl.se/bug/?i=19775 [202] = https://curl.se/bug/?i=19669 [203] = https://curl.se/bug/?i=19683 [204] = https://curl.se/bug/?i=19643 [208] = https://curl.se/bug/?i=19665 [209] = https://curl.se/bug/?i=19384 + [210] = https://curl.se/bug/?i=19769 + [211] = https://curl.se/bug/?i=19768 + [215] = https://curl.se/bug/?i=19764 + [217] = https://curl.se/bug/?i=19763 + [219] = https://curl.se/bug/?i=19759 + [220] = https://curl.se/bug/?i=19756 + [221] = https://curl.se/bug/?i=19761 + [222] = https://curl.se/bug/?i=16973 + [223] = https://curl.se/bug/?i=16973 + [225] = https://curl.se/bug/?i=19754 + [226] = https://curl.se/bug/?i=19751 + [230] = https://curl.se/bug/?i=19745 + [232] = https://curl.se/bug/?i=19746 + [242] = https://curl.se/bug/?i=19734 + [243] = https://curl.se/bug/?i=19733 + [244] = https://curl.se/bug/?i=19732 From 8dedcce7a3b8f32633ba7b546ae55bb7f5017fd1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2025 10:13:32 +0100 Subject: [PATCH 628/885] RELEASE-NOTES: fix typo --- RELEASE-NOTES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 136176ce799d..512bc5425d57 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -201,11 +201,11 @@ This release includes the following bugfixes: o tool_help: add checks to avoid unsigned wrap around [14] o tool_ipfs: check return codes better [20] o tool_msgs: make voutf() use stack instead of heap [125] - o tool_operatate: return error for OOM in append2query [217] o tool_operate: exit on curl_share_setopt errors [108] o tool_operate: fix a case of ignoring return code in operate() [128] o tool_operate: fix case of ignoring return code in single_transfer [129] o tool_operate: remove redundant condition [19] + o tool_operate: return error for OOM in append2query [217] o tool_operate: use curlx_str_number instead of atoi [68] o tool_paramhlp: refuse --proto remove all protocols [10] o tool_urlglob: acknowledge OOM in peek_ipv6 [175] From c1c3487d7902799412823cb71df7af6af0df36a1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2025 09:53:00 +0100 Subject: [PATCH 629/885] curl_gssapi: make sure Curl_gss_log_error() has an initialized buffer Reported-by: Stanislav Fort (Aisle Research) Closes #19802 --- lib/curl_gssapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index edd555db7923..7f5bd72954aa 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -428,7 +428,7 @@ static size_t display_gss_error(OM_uint32 status, int type, void Curl_gss_log_error(struct Curl_easy *data, const char *prefix, OM_uint32 major, OM_uint32 minor) { - char buf[GSS_LOG_BUFFER_LEN]; + char buf[GSS_LOG_BUFFER_LEN] = ""; size_t len = 0; if(major != GSS_S_FAILURE) From 4f2374810ab50802c94400dad26c60771b3fa0ff Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2025 11:13:49 +0100 Subject: [PATCH 630/885] DEPRECATE.md: remove OpenSSL-QUIC in January 2026 instead Move it up two months. It was only ever experimental so this cannot interfere with any production code so shorten the "quarantine". Closes #19805 --- docs/DEPRECATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 1629af1fffd0..2a3cbfc78d88 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -36,7 +36,7 @@ stack. - curl users building with vanilla OpenSSL can still use QUIC through the means of ngtcp2 -We remove the OpenSSL-QUIC backend in March 2026. +We remove the OpenSSL-QUIC backend in January 2026. ## RTMP From b30c1b97b97cdbe7cc6f638c90f8b60e2036ad27 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 2 Dec 2025 13:42:29 +0100 Subject: [PATCH 631/885] quiche: use client writer Instead of buffering response body data until it is received by the transfer loop, write the response data directly to the client. Use a connection wide scratch buffer to get the response body from quiche. Eliminates need for maintaining individual buffers for each stream. Fixes #19803 Reported-by: Stanislav Fort Closes #19806 --- lib/vquic/curl_quiche.c | 385 +++++++++++++++++++--------------------- 1 file changed, 185 insertions(+), 200 deletions(-) diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 45f606ec6182..913311085270 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -89,8 +89,9 @@ struct cf_quiche_ctx { uint8_t scid[QUICHE_MAX_CONN_ID_LEN]; struct curltime started_at; /* time the current attempt started */ struct curltime handshake_at; /* time connect handshake finished */ - struct bufc_pool stream_bufcp; /* chunk pool for streams */ struct uint_hash streams; /* hash `data->mid` to `stream_ctx` */ + struct dynbuf scratch; /* temp buffer for header construction */ + struct bufq writebuf; /* temp buffer for writing bodies */ curl_off_t data_recvd; BIT(initialized); BIT(goaway); /* got GOAWAY from server */ @@ -119,9 +120,10 @@ static void cf_quiche_ctx_init(struct cf_quiche_ctx *ctx) debug_log_init = 1; } #endif - Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, - H3_STREAM_POOL_SPARES); + curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); Curl_uint32_hash_init(&ctx->streams, 63, h3_stream_hash_free); + Curl_bufq_init2(&ctx->writebuf, H3_STREAM_CHUNK_SIZE, H3_STREAM_RECV_CHUNKS, + BUFQ_OPT_SOFT_LIMIT); ctx->data_recvd = 0; ctx->initialized = TRUE; } @@ -134,8 +136,9 @@ static void cf_quiche_ctx_free(struct cf_quiche_ctx *ctx) Curl_vquic_tls_cleanup(&ctx->tls); Curl_ssl_peer_cleanup(&ctx->peer); vquic_ctx_free(&ctx->q); - Curl_bufcp_free(&ctx->stream_bufcp); Curl_uint32_hash_destroy(&ctx->streams); + curlx_dyn_free(&ctx->scratch); + Curl_bufq_free(&ctx->writebuf); } curlx_free(ctx); } @@ -168,9 +171,10 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, */ struct h3_stream_ctx { uint64_t id; /* HTTP/3 protocol stream identifier */ - struct bufq recvbuf; /* h3 response */ struct h1_req_parser h1; /* h1 request parsing */ uint64_t error3; /* HTTP/3 stream error code */ + int status_code; /* HTTP status code */ + CURLcode xfer_result; /* result from cf_quiche_write_(hd/body) */ BIT(opened); /* TRUE after stream has been opened */ BIT(closed); /* TRUE on stream close */ BIT(reset); /* TRUE on stream reset */ @@ -182,7 +186,6 @@ struct h3_stream_ctx { static void h3_stream_ctx_free(struct h3_stream_ctx *stream) { - Curl_bufq_free(&stream->recvbuf); Curl_h1_req_parse_free(&stream->h1); curlx_free(stream); } @@ -252,6 +255,7 @@ static bool cf_quiche_do_expire(struct Curl_cfilter *cf, (void)stream; (void)user_data; CURL_TRC_CF(sdata, cf, "conn closed, mark as dirty"); + stream->xfer_result = CURLE_SEND_ERROR; Curl_multi_mark_dirty(sdata); return TRUE; } @@ -270,8 +274,6 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, return CURLE_OUT_OF_MEMORY; stream->id = -1; - Curl_bufq_initp(&stream->recvbuf, &ctx->stream_bufcp, - H3_STREAM_RECV_CHUNKS, BUFQ_OPT_SOFT_LIMIT); Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); if(!Curl_uint32_hash_set(&ctx->streams, data->mid, stream)) { @@ -282,28 +284,38 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, return CURLE_OK; } +static void cf_quiche_stream_close(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream) +{ + struct cf_quiche_ctx *ctx = cf->ctx; + CURLcode result; + + if(ctx->qconn && !stream->closed) { + quiche_conn_stream_shutdown(ctx->qconn, stream->id, + QUICHE_SHUTDOWN_READ, CURL_H3_NO_ERROR); + if(!stream->send_closed) { + quiche_conn_stream_shutdown(ctx->qconn, stream->id, + QUICHE_SHUTDOWN_WRITE, CURL_H3_NO_ERROR); + stream->send_closed = TRUE; + } + stream->closed = TRUE; + result = cf_flush_egress(cf, data); + if(result) + CURL_TRC_CF(data, cf, "[%" PRIu64 "] stream close, flush egress -> %d", + stream->id, result); + } +} + static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_quiche_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - CURLcode result; (void)cf; if(stream) { CURL_TRC_CF(data, cf, "[%" PRIu64 "] easy handle is done", stream->id); - if(ctx->qconn && !stream->closed) { - quiche_conn_stream_shutdown(ctx->qconn, stream->id, - QUICHE_SHUTDOWN_READ, CURL_H3_NO_ERROR); - if(!stream->send_closed) { - quiche_conn_stream_shutdown(ctx->qconn, stream->id, - QUICHE_SHUTDOWN_WRITE, CURL_H3_NO_ERROR); - stream->send_closed = TRUE; - } - stream->closed = TRUE; - result = cf_flush_egress(cf, data); - if(result) - CURL_TRC_CF(data, cf, "data_done, flush egress -> %d", result); - } + cf_quiche_stream_close(cf, data, stream); Curl_uint32_hash_remove(&ctx->streams, data->mid); } } @@ -316,39 +328,29 @@ static void cf_quiche_expire_conn_closed(struct Curl_cfilter *cf, cf_quiche_for_all_streams(cf, data->multi, cf_quiche_do_expire, NULL); } -/* - * write_resp_raw() copies response data in raw format to the `data`'s - * receive buffer. If not enough space is available, it appends to the - * `data`'s overflow buffer. - */ -static CURLcode write_resp_raw(struct Curl_cfilter *cf, +static void cf_quiche_write_hd(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *mem, size_t memlen) + struct h3_stream_ctx *stream, + const char *buf, size_t blen, bool eos) { - struct cf_quiche_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - CURLcode result = CURLE_OK; - size_t nwritten; - - (void)cf; - if(!stream) - return CURLE_RECV_ERROR; - result = Curl_bufq_write(&stream->recvbuf, mem, memlen, &nwritten); - if(result) - return result; - - if(nwritten < memlen) { - /* This MUST not happen. Our recbuf is dimensioned to hold the - * full max_stream_window and then some for this reason. */ - DEBUGASSERT(0); - return CURLE_RECV_ERROR; + /* This function returns no error intentionally, but records + * the result at the stream, skipping further writes once the + * `result` of the transfer is known. + * The stream is subsequently cancelled "higher up" in the filter's + * send/recv callbacks. Closing the stream here leads to SEND/RECV + * errors in other places that then overwrite the transfer's result. */ + if(!stream->xfer_result) { + stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos); + if(stream->xfer_result) + CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu " + "bytes of headers", stream->id, stream->xfer_result, blen); } - return result; } struct cb_ctx { struct Curl_cfilter *cf; struct Curl_easy *data; + struct h3_stream_ctx *stream; }; static int cb_each_header(uint8_t *name, size_t name_len, @@ -356,39 +358,59 @@ static int cb_each_header(uint8_t *name, size_t name_len, void *argp) { struct cb_ctx *x = argp; - struct cf_quiche_ctx *ctx = x->cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, x->data); + struct Curl_cfilter *cf = x->cf; + struct Curl_easy *data = x->data; + struct h3_stream_ctx *stream = x->stream; + struct cf_quiche_ctx *ctx = cf->ctx; CURLcode result; - if(!stream) - return CURLE_OK; + if(!stream || stream->xfer_result) + return 1; /* abort iteration */ if((name_len == 7) && !strncmp(HTTP_PSEUDO_STATUS, (char *)name, 7)) { - CURL_TRC_CF(x->data, x->cf, "[%" PRIu64 "] status: %.*s", - stream->id, (int)value_len, value); - result = write_resp_raw(x->cf, x->data, "HTTP/3 ", sizeof("HTTP/3 ") - 1); + curlx_dyn_reset(&ctx->scratch); + result = Curl_http_decode_status(&stream->status_code, + (const char *)value, value_len); + if(!result) + result = curlx_dyn_addn(&ctx->scratch, STRCONST("HTTP/3 ")); + if(!result) + result = curlx_dyn_addn(&ctx->scratch, + (const char *)value, value_len); if(!result) - result = write_resp_raw(x->cf, x->data, value, value_len); + result = curlx_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); if(!result) - result = write_resp_raw(x->cf, x->data, " \r\n", 3); + cf_quiche_write_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch), + curlx_dyn_len(&ctx->scratch), FALSE); + CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s", + stream->id, curlx_dyn_ptr(&ctx->scratch)); } else { - CURL_TRC_CF(x->data, x->cf, "[%" PRIu64 "] header: %.*s: %.*s", + /* store as an HTTP1-style header */ + CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s", stream->id, (int)name_len, name, (int)value_len, value); - result = write_resp_raw(x->cf, x->data, name, name_len); + curlx_dyn_reset(&ctx->scratch); + result = curlx_dyn_addn(&ctx->scratch, + (const char *)name, name_len); if(!result) - result = write_resp_raw(x->cf, x->data, ": ", 2); + result = curlx_dyn_addn(&ctx->scratch, STRCONST(": ")); if(!result) - result = write_resp_raw(x->cf, x->data, value, value_len); + result = curlx_dyn_addn(&ctx->scratch, + (const char *)value, value_len); if(!result) - result = write_resp_raw(x->cf, x->data, "\r\n", 2); + result = curlx_dyn_addn(&ctx->scratch, STRCONST("\r\n")); + if(!result) + cf_quiche_write_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch), + curlx_dyn_len(&ctx->scratch), FALSE); } + if(result) { CURL_TRC_CF(x->data, x->cf, "[%" PRIu64 "] on header error %d", stream->id, result); + if(!stream->xfer_result) + stream->xfer_result = result; } - return result; + return stream->xfer_result ? 1 : 0; } static CURLcode stream_resp_read(void *reader_ctx, @@ -410,94 +432,99 @@ static CURLcode stream_resp_read(void *reader_ctx, return CURLE_OK; } -static CURLcode cf_recv_body(struct Curl_cfilter *cf, - struct Curl_easy *data) +static void cf_quiche_flush_body(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream) +{ + struct cf_quiche_ctx *ctx = cf->ctx; + const uint8_t *buf; + size_t blen; + + while(stream && !stream->xfer_result) { + if(Curl_bufq_peek(&ctx->writebuf, &buf, &blen)) { + stream->xfer_result = Curl_xfer_write_resp( + data, (const char *)buf, blen, FALSE); + Curl_bufq_skip(&ctx->writebuf, blen); + if(stream->xfer_result) { + CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu bytes" + " of data", stream->id, stream->xfer_result, blen); + } + } + else + break; + } + Curl_bufq_reset(&ctx->writebuf); +} + +static void cf_quiche_recv_body(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream) { struct cf_quiche_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); size_t nread; struct cb_ctx cb_ctx; CURLcode result = CURLE_OK; if(!stream) - return CURLE_RECV_ERROR; - - if(!stream->resp_hds_complete) { - result = write_resp_raw(cf, data, "\r\n", 2); - if(result) - return result; - stream->resp_hds_complete = TRUE; - } + return; + /* Even when the transfer has already errored, we need to receive + * the data from quiche, as quiche will otherwise get stuck and + * raise events to receive over and over again. */ cb_ctx.cf = cf; cb_ctx.data = data; - result = Curl_bufq_slurp(&stream->recvbuf, - stream_resp_read, &cb_ctx, &nread); - - if(result && result != CURLE_AGAIN) { - CURL_TRC_CF(data, cf, "[%" PRIu64 "] recv_body error %zu", - stream->id, nread); - failf(data, "Error %d in HTTP/3 response body for stream[%" PRIu64 "]", - result, stream->id); - stream->closed = TRUE; - stream->reset = TRUE; - stream->send_closed = TRUE; - return result; - } - return CURLE_OK; -} - -#ifdef DEBUGBUILD -static const char *cf_ev_name(quiche_h3_event *ev) -{ - switch(quiche_h3_event_type(ev)) { - case QUICHE_H3_EVENT_HEADERS: - return "HEADERS"; - case QUICHE_H3_EVENT_DATA: - return "DATA"; - case QUICHE_H3_EVENT_RESET: - return "RESET"; - case QUICHE_H3_EVENT_FINISHED: - return "FINISHED"; - case QUICHE_H3_EVENT_GOAWAY: - return "GOAWAY"; - default: - return "Unknown"; + cb_ctx.stream = stream; + Curl_bufq_reset(&ctx->writebuf); + while(!result) { + result = Curl_bufq_slurp(&ctx->writebuf, + stream_resp_read, &cb_ctx, &nread); + if(!result) + cf_quiche_flush_body(cf, data, stream); + else if(result == CURLE_AGAIN) + break; + else if(result) { + CURL_TRC_CF(data, cf, "[%" PRIu64 "] recv_body error %d", + stream->id, result); + failf(data, "[%" PRIu64 "] Error %d in HTTP/3 response body for stream", + stream->id, result); + stream->closed = TRUE; + stream->reset = TRUE; + stream->send_closed = TRUE; + if(!stream->xfer_result) + stream->xfer_result = result; + } } + cf_quiche_flush_body(cf, data, stream); } -#else -#define cf_ev_name(x) "" -#endif -static CURLcode h3_process_event(struct Curl_cfilter *cf, +static void cf_quiche_process_ev(struct Curl_cfilter *cf, struct Curl_easy *data, struct h3_stream_ctx *stream, quiche_h3_event *ev) { - struct cb_ctx cb_ctx; - CURLcode result = CURLE_OK; - int rc; - if(!stream) - return CURLE_OK; + return; + switch(quiche_h3_event_type(ev)) { - case QUICHE_H3_EVENT_HEADERS: + case QUICHE_H3_EVENT_HEADERS: { + struct cb_ctx cb_ctx; stream->resp_got_header = TRUE; cb_ctx.cf = cf; cb_ctx.data = data; - rc = quiche_h3_event_for_each_header(ev, cb_each_header, &cb_ctx); - if(rc) { - failf(data, "Error %d in HTTP/3 response header for stream[%" PRIu64 "]", - rc, stream->id); - return CURLE_RECV_ERROR; - } + cb_ctx.stream = stream; + quiche_h3_event_for_each_header(ev, cb_each_header, &cb_ctx); CURL_TRC_CF(data, cf, "[%" PRIu64 "] <- [HEADERS]", stream->id); + Curl_multi_mark_dirty(data); break; - + } case QUICHE_H3_EVENT_DATA: - if(!stream->closed) { - result = cf_recv_body(cf, data); + if(!stream->resp_hds_complete) { + stream->resp_hds_complete = TRUE; + cf_quiche_write_hd(cf, data, stream, "\r\n", 2, FALSE); } + cf_quiche_recv_body(cf, data, stream); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] <- [DATA]", stream->id); + Curl_multi_mark_dirty(data); break; case QUICHE_H3_EVENT_RESET: @@ -505,17 +532,17 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, stream->closed = TRUE; stream->reset = TRUE; stream->send_closed = TRUE; + Curl_multi_mark_dirty(data); break; case QUICHE_H3_EVENT_FINISHED: CURL_TRC_CF(data, cf, "[%" PRIu64 "] CLOSED", stream->id); if(!stream->resp_hds_complete) { - result = write_resp_raw(cf, data, "\r\n", 2); - if(result) - return result; stream->resp_hds_complete = TRUE; + cf_quiche_write_hd(cf, data, stream, "\r\n", 2, TRUE); } stream->closed = TRUE; + Curl_multi_mark_dirty(data); break; case QUICHE_H3_EVENT_GOAWAY: @@ -527,20 +554,6 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, stream->id, quiche_h3_event_type(ev)); break; } - return result; -} - -static CURLcode cf_quiche_ev_process(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct h3_stream_ctx *stream, - quiche_h3_event *ev) -{ - CURLcode result = h3_process_event(cf, data, stream, ev); - Curl_multi_mark_dirty(data); - if(result) - CURL_TRC_CF(data, cf, "error processing event %s for [%" PRIu64 "] -> %d", - cf_ev_name(ev), stream->id, result); - return result; } struct cf_quich_disp_ctx { @@ -548,7 +561,6 @@ struct cf_quich_disp_ctx { struct Curl_cfilter *cf; struct Curl_multi *multi; quiche_h3_event *ev; - CURLcode result; }; static bool cf_quiche_disp_event(uint32_t mid, void *val, void *user_data) @@ -559,7 +571,7 @@ static bool cf_quiche_disp_event(uint32_t mid, void *val, void *user_data) if(stream->id == dctx->stream_id) { struct Curl_easy *sdata = Curl_multi_get_easy(dctx->multi, mid); if(sdata) - dctx->result = cf_quiche_ev_process(dctx->cf, sdata, stream, dctx->ev); + cf_quiche_process_ev(dctx->cf, sdata, stream, dctx->ev); return FALSE; /* stop iterating */ } return TRUE; @@ -583,23 +595,22 @@ static CURLcode cf_poll_events(struct Curl_cfilter *cf, return CURLE_HTTP3; } else { - struct cf_quich_disp_ctx dctx; - dctx.stream_id = (uint64_t)rv; - dctx.cf = cf; - dctx.multi = data->multi; - dctx.ev = ev; - dctx.result = CURLE_OK; stream = H3_STREAM_CTX(ctx, data); - if(stream && stream->id == dctx.stream_id) { + if(stream && stream->id == (uint64_t)rv) { /* event for calling transfer */ - CURLcode result = cf_quiche_ev_process(cf, data, stream, ev); + cf_quiche_process_ev(cf, data, stream, ev); quiche_h3_event_free(ev); - if(result) - return result; + if(stream->xfer_result) + return stream->xfer_result; } else { /* another transfer, do not return errors, as they are not for * the calling transfer */ + struct cf_quich_disp_ctx dctx; + dctx.stream_id = (uint64_t)rv; + dctx.cf = cf; + dctx.multi = data->multi; + dctx.ev = ev; Curl_uint32_hash_visit(&ctx->streams, cf_quiche_disp_event, &dctx); quiche_h3_event_free(ev); } @@ -844,63 +855,46 @@ static CURLcode recv_closed_stream(struct Curl_cfilter *cf, } static CURLcode cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, - char *buf, size_t len, size_t *pnread) + char *buf, size_t blen, size_t *pnread) { struct cf_quiche_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; *pnread = 0; + (void)buf; + (void)blen; vquic_ctx_update_time(&ctx->q); if(!stream) return CURLE_RECV_ERROR; - if(!Curl_bufq_is_empty(&stream->recvbuf)) { - result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); - CURL_TRC_CF(data, cf, "[%" PRIu64 "] read recvbuf(len=%zu) " - "-> %d, %zu", stream->id, len, result, *pnread); - if(result) - goto out; - } - result = cf_process_ingress(cf, data); if(result) { CURL_TRC_CF(data, cf, "cf_recv, error on ingress"); goto out; } - /* recvbuf had nothing before, maybe after progressing ingress? */ - if(!*pnread && !Curl_bufq_is_empty(&stream->recvbuf)) { - result = Curl_bufq_cread(&stream->recvbuf, buf, len, pnread); - CURL_TRC_CF(data, cf, "[%" PRIu64 "] read recvbuf(len=%zu) " - "-> %d, %zu", stream->id, len, result, *pnread); - if(result) - goto out; - } - - if(*pnread) { - if(stream->closed) - Curl_multi_mark_dirty(data); + if(stream->xfer_result) { + cf_quiche_stream_close(cf, data, stream); + result = stream->xfer_result; + goto out; } - else { - if(stream->closed) - result = recv_closed_stream(cf, data, pnread); - else if(quiche_conn_is_draining(ctx->qconn)) { - failf(data, "QUIC connection is draining"); - result = CURLE_HTTP3; - } - else - result = CURLE_AGAIN; + else if(stream->closed) + result = recv_closed_stream(cf, data, pnread); + else if(quiche_conn_is_draining(ctx->qconn)) { + failf(data, "QUIC connection is draining"); + result = CURLE_HTTP3; } + else + result = CURLE_AGAIN; out: result = Curl_1st_err(result, cf_flush_egress(cf, data)); if(*pnread > 0) ctx->data_recvd += *pnread; - CURL_TRC_CF(data, cf, "[%" PRIu64 "] cf_recv(total=%" - FMT_OFF_T ") -> %d, %zu", - stream->id, ctx->data_recvd, result, *pnread); + CURL_TRC_CF(data, cf, "[%" PRIu64 "] cf_recv(len=%zu) -> %d, %zu, total=%" + FMT_OFF_T, stream->id, blen, result, *pnread, ctx->data_recvd); return result; } @@ -1092,6 +1086,10 @@ static CURLcode cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data, goto out; stream = H3_STREAM_CTX(ctx, data); } + else if(stream->xfer_result) { + cf_quiche_stream_close(cf, data, stream); + result = stream->xfer_result; + } else if(stream->closed) { if(stream->resp_hds_complete) { /* sending request body on a stream that has been closed by the @@ -1165,19 +1163,6 @@ static CURLcode cf_quiche_adjust_pollset(struct Curl_cfilter *cf, return result; } -/* - * Called from transfer.c:data_pending to know if we should keep looping - * to receive more data from the connection. - */ -static bool cf_quiche_data_pending(struct Curl_cfilter *cf, - const struct Curl_easy *data) -{ - struct cf_quiche_ctx *ctx = cf->ctx; - const struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - (void)cf; - return stream && !Curl_bufq_is_empty(&stream->recvbuf); -} - static CURLcode h3_data_pause(struct Curl_cfilter *cf, struct Curl_easy *data, bool pause) @@ -1608,7 +1593,7 @@ struct Curl_cftype Curl_cft_http3 = { cf_quiche_close, cf_quiche_shutdown, cf_quiche_adjust_pollset, - cf_quiche_data_pending, + Curl_cf_def_data_pending, cf_quiche_send, cf_quiche_recv, cf_quiche_cntrl, From 3e2a946926853608d67805bd9f4a58345fff364a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2025 14:13:55 +0100 Subject: [PATCH 632/885] ldap: provide version for "legacy" ldap as well It displays in version output as WinLDAP and LDAP/1, compared to OpenLDAP/[version] for the OpenLDAP backend code. Closes #19808 --- lib/curl_ldap.h | 1 + lib/ldap.c | 9 +++++++++ lib/openldap.c | 20 ++++++++++++++++++++ lib/version.c | 32 +++++--------------------------- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/lib/curl_ldap.h b/lib/curl_ldap.h index 8a1d807ed92b..9da9b717d529 100644 --- a/lib/curl_ldap.h +++ b/lib/curl_ldap.h @@ -32,5 +32,6 @@ extern const struct Curl_handler Curl_handler_ldap; extern const struct Curl_handler Curl_handler_ldaps; #endif +void Curl_ldap_version(char *buf, size_t bufsz); #endif #endif /* HEADER_CURL_LDAP_H */ diff --git a/lib/ldap.c b/lib/ldap.c index 6c6207038571..522bf3ad5860 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -1037,6 +1037,15 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp) } #endif /* !HAVE_LDAP_URL_PARSE */ +void Curl_ldap_version(char *buf, size_t bufsz) +{ +#ifdef USE_WIN32_LDAP + curl_msnprintf(buf, bufsz, "WinLDAP"); +#else + curl_msnprintf(buf, bufsz, "LDAP/1"); +#endif +} + #if defined(__GNUC__) && defined(__APPLE__) #pragma GCC diagnostic pop #endif diff --git a/lib/openldap.c b/lib/openldap.c index 107f6da832a5..bb48edd32f2c 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -1331,4 +1331,24 @@ ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) } #endif /* USE_SSL */ +void Curl_ldap_version(char *buf, size_t bufsz) +{ + LDAPAPIInfo api; + api.ldapai_info_version = LDAP_API_INFO_VERSION; + + if(ldap_get_option(NULL, LDAP_OPT_API_INFO, &api) == LDAP_OPT_SUCCESS) { + unsigned int patch = (unsigned int)(api.ldapai_vendor_version % 100); + unsigned int major = (unsigned int)(api.ldapai_vendor_version / 10000); + unsigned int minor = + (((unsigned int)api.ldapai_vendor_version - major * 10000) + - patch) / 100; + curl_msnprintf(buf, bufsz, "%s/%u.%u.%u", + api.ldapai_vendor_name, major, minor, patch); + ldap_memfree(api.ldapai_vendor_name); + ber_memvfree((void **)api.ldapai_extensions); + } + else + curl_msnprintf(buf, bufsz, "OpenLDAP"); +} + #endif /* !CURL_DISABLE_LDAP && USE_OPENLDAP */ diff --git a/lib/version.c b/lib/version.c index 49c15ffcdec9..487dc74ffa15 100644 --- a/lib/version.c +++ b/lib/version.c @@ -77,8 +77,8 @@ #include #endif -#ifdef USE_OPENLDAP -#include +#ifndef CURL_DISABLE_LDAP +#include "curl_ldap.h" #endif #ifdef HAVE_BROTLI @@ -103,28 +103,6 @@ static void zstd_version(char *buf, size_t bufsz) } #endif -#ifdef USE_OPENLDAP -static void oldap_version(char *buf, size_t bufsz) -{ - LDAPAPIInfo api; - api.ldapai_info_version = LDAP_API_INFO_VERSION; - - if(ldap_get_option(NULL, LDAP_OPT_API_INFO, &api) == LDAP_OPT_SUCCESS) { - unsigned int patch = (unsigned int)(api.ldapai_vendor_version % 100); - unsigned int major = (unsigned int)(api.ldapai_vendor_version / 10000); - unsigned int minor = - (((unsigned int)api.ldapai_vendor_version - major * 10000) - - patch) / 100; - curl_msnprintf(buf, bufsz, "%s/%u.%u.%u", - api.ldapai_vendor_name, major, minor, patch); - ldap_memfree(api.ldapai_vendor_name); - ber_memvfree((void **)api.ldapai_extensions); - } - else - curl_msnprintf(buf, bufsz, "OpenLDAP"); -} -#endif - #ifdef USE_LIBPSL static void psl_version(char *buf, size_t bufsz) { @@ -211,7 +189,7 @@ char *curl_version(void) #ifdef HAVE_GSSAPI char gss_buf[40]; #endif -#ifdef USE_OPENLDAP +#ifndef CURL_DISABLE_LDAP char ldap_buf[30]; #endif int i = 0; @@ -289,8 +267,8 @@ char *curl_version(void) #endif src[i++] = gss_buf; #endif /* HAVE_GSSAPI */ -#ifdef USE_OPENLDAP - oldap_version(ldap_buf, sizeof(ldap_buf)); +#ifndef CURL_DISABLE_LDAP + Curl_ldap_version(ldap_buf, sizeof(ldap_buf)); src[i++] = ldap_buf; #endif From 86b346443b68cde7ef33e1ab770e6c8ab641d2b1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Nov 2025 04:27:26 +0100 Subject: [PATCH 633/885] lib: fix formatting nits (part 2) From `lib/curl*` to `lib/g*`. With fixes to part 1. part 1: 47a1ab2ebecb21485c0e955316d90511e80a3c43 #19764 Closes #19800 --- lib/altsvc.c | 2 +- lib/amigaos.h | 2 +- lib/asyn-ares.c | 3 +- lib/asyn-base.c | 4 +- lib/asyn.h | 4 +- lib/cf-h2-proxy.c | 4 +- lib/cf-https-connect.c | 1 - lib/cf-ip-happy.c | 1 - lib/cf-socket.c | 6 +- lib/cf-socket.h | 2 +- lib/conncache.c | 1 - lib/content_encoding.c | 61 ++-- lib/cookie.c | 15 +- lib/cookie.h | 2 +- lib/curl_addrinfo.c | 54 ++-- lib/curl_addrinfo.h | 31 +- lib/curl_ctype.h | 8 +- lib/curl_fopen.c | 4 +- lib/curl_get_line.c | 5 +- lib/curl_gethostname.c | 1 - lib/curl_gssapi.c | 4 +- lib/curl_hmac.h | 1 - lib/curl_ldap.h | 6 +- lib/curl_memrchr.c | 4 +- lib/curl_memrchr.h | 2 +- lib/curl_ntlm_core.c | 99 +++--- lib/curl_ntlm_core.h | 20 +- lib/curl_range.c | 8 +- lib/curl_rtmp.c | 6 +- lib/curl_sasl.c | 16 +- lib/curl_setup.h | 46 +-- lib/curl_setup_once.h | 48 +-- lib/curl_sha512_256.c | 160 +++++----- lib/curl_sha512_256.h | 5 +- lib/curl_share.c | 20 +- lib/curl_share.h | 6 +- lib/curl_trc.c | 44 ++- lib/curl_trc.h | 12 +- lib/cw-out.c | 2 +- lib/cw-pause.c | 2 +- lib/dict.c | 20 +- lib/doh.c | 62 ++-- lib/doh.h | 6 +- lib/dynhds.c | 11 +- lib/easy.c | 22 +- lib/easy_lock.h | 14 +- lib/easyoptions.c | 688 +++++++++++++++++++++-------------------- lib/escape.c | 10 +- lib/fake_addrinfo.c | 3 +- lib/file.c | 17 +- lib/formdata.c | 99 +++--- lib/formdata.h | 1 - lib/ftp.c | 336 ++++++++++---------- lib/ftplistparser.c | 20 +- lib/getinfo.c | 29 +- lib/optiontable.pl | 8 +- 56 files changed, 978 insertions(+), 1090 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index cbaf4b4d85f9..f2906ad4e379 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -42,7 +42,7 @@ #include "curlx/strparse.h" #include "connect.h" -#define MAX_ALTSVC_LINE 4095 +#define MAX_ALTSVC_LINE 4095 #define MAX_ALTSVC_DATELEN 256 #define MAX_ALTSVC_HOSTLEN 2048 #define MAX_ALTSVC_ALPNLEN 10 diff --git a/lib/amigaos.h b/lib/amigaos.h index c99d963ececc..58278f093561 100644 --- a/lib/amigaos.h +++ b/lib/amigaos.h @@ -33,7 +33,7 @@ void Curl_amiga_cleanup(void); #else -#define Curl_amiga_init() CURLE_OK +#define Curl_amiga_init() CURLE_OK #define Curl_amiga_cleanup() Curl_nop_stmt #endif diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index ce4f866be6d2..40ce00db2229 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -180,8 +180,7 @@ static CURLcode async_ares_init(struct Curl_easy *data) status = ares_init_options(&ares->channel, &options, optmask); if(status != ARES_SUCCESS) { ares->channel = NULL; - rc = (status == ARES_ENOMEM) ? - CURLE_OUT_OF_MEMORY : CURLE_FAILED_INIT; + rc = (status == ARES_ENOMEM) ? CURLE_OUT_OF_MEMORY : CURLE_FAILED_INIT; goto out; } diff --git a/lib/asyn-base.c b/lib/asyn-base.c index 5358fcb8fa54..1db132c1e41d 100644 --- a/lib/asyn-base.c +++ b/lib/asyn-base.c @@ -168,9 +168,9 @@ int Curl_ares_perform(ares_channel channel, timediff_t timeout_ms) /* move through the descriptors and ask for processing on them */ for(i = 0; i < num; i++) ares_process_fd(channel, - (pfd[i].revents & (POLLRDNORM|POLLIN)) ? + (pfd[i].revents & (POLLRDNORM | POLLIN)) ? pfd[i].fd : ARES_SOCKET_BAD, - (pfd[i].revents & (POLLWRNORM|POLLOUT)) ? + (pfd[i].revents & (POLLWRNORM | POLLOUT)) ? pfd[i].fd : ARES_SOCKET_BAD); } return nfds; diff --git a/lib/asyn.h b/lib/asyn.h index e5e472e247db..87c6532a3d9d 100644 --- a/lib/asyn.h +++ b/lib/asyn.h @@ -223,7 +223,7 @@ struct doh_probes; /* convert these functions if an asynch resolver is not used */ #define Curl_async_get_impl(x, y) (*(y) = NULL, CURLE_OK) -#define Curl_async_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST +#define Curl_async_is_resolved(x, y) CURLE_COULDNT_RESOLVE_HOST #define Curl_async_await(x, y) CURLE_COULDNT_RESOLVE_HOST #define Curl_async_global_init() CURLE_OK #define Curl_async_global_cleanup() Curl_nop_stmt @@ -266,7 +266,7 @@ void Curl_async_shutdown(struct Curl_easy *data); void Curl_async_destroy(struct Curl_easy *data); #else /* !USE_CURL_ASYNC */ #define Curl_async_shutdown(x) Curl_nop_stmt -#define Curl_async_destroy(x) Curl_nop_stmt +#define Curl_async_destroy(x) Curl_nop_stmt #endif /* USE_CURL_ASYNC */ /********** end of generic resolver interface functions *****************/ diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index fb2586d1d0e5..5a58c280e9f4 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -242,8 +242,8 @@ static int proxy_h2_client_new(struct Curl_cfilter *cf, { struct cf_h2_proxy_ctx *ctx = cf->ctx; nghttp2_option *o; - nghttp2_mem mem = {NULL, Curl_nghttp2_malloc, Curl_nghttp2_free, - Curl_nghttp2_calloc, Curl_nghttp2_realloc}; + nghttp2_mem mem = { NULL, Curl_nghttp2_malloc, Curl_nghttp2_free, + Curl_nghttp2_calloc, Curl_nghttp2_realloc }; int rc = nghttp2_option_new(&o); if(rc) diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index ad815a0fe734..acb3bcdd3a7a 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -244,7 +244,6 @@ static CURLcode baller_connected(struct Curl_cfilter *cf, return result; } - static bool time_to_start_next(struct Curl_cfilter *cf, struct Curl_easy *data, size_t idx, struct curltime now) diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 72ac59b7d90b..d31c6b6caaa6 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -613,7 +613,6 @@ static int cf_ip_ballers_min_reply_ms(struct cf_ip_ballers *bs, return reply_ms; } - typedef enum { SCFST_INIT, SCFST_WAITING, diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 0e431976c915..1881683cc8ed 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -643,8 +643,8 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, return CURLE_UNSUPPORTED_PROTOCOL; case IF2IP_FOUND: /* - * We now have the numerical IP address in the 'myhost' buffer - */ + * We now have the numerical IP address in the 'myhost' buffer + */ host = myhost; infof(data, "Local Interface %s is ip %s using address family %i", iface, host, af); @@ -2057,7 +2057,7 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, #else struct sockaddr_in add; #endif - curl_socklen_t size = (curl_socklen_t) sizeof(add); + curl_socklen_t size = (curl_socklen_t)sizeof(add); curl_socket_t s_accepted = CURL_SOCKET_BAD; timediff_t timeout_ms; int socketstate = 0; diff --git a/lib/cf-socket.h b/lib/cf-socket.h index e5f69c60f46f..fe5ff2fa47de 100644 --- a/lib/cf-socket.h +++ b/lib/cf-socket.h @@ -52,7 +52,7 @@ struct Curl_sockaddr_ex { struct Curl_sockaddr_storage buf; } addr; }; -#define curl_sa_addr addr.sa +#define curl_sa_addr addr.sa #define curl_sa_addrbuf addr.buf /* diff --git a/lib/conncache.c b/lib/conncache.c index c7a52b69f69a..c50697f177b6 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -77,7 +77,6 @@ struct cpool_bundle { char dest[1]; /* destination of bundle, allocated to keep dest_len bytes */ }; - static void cpool_discard_conn(struct cpool *cpool, struct Curl_easy *data, struct connectdata *conn, diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 84ed86c1df3d..47adac0f4302 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -86,24 +86,20 @@ struct zlib_writer { z_stream z; /* State structure for zlib. */ }; - -static voidpf -zalloc_cb(voidpf opaque, unsigned int items, unsigned int size) +static voidpf zalloc_cb(voidpf opaque, unsigned int items, unsigned int size) { (void)opaque; /* not a typo, keep it curlx_calloc() */ return (voidpf)curlx_calloc(items, size); } -static void -zfree_cb(voidpf opaque, voidpf ptr) +static void zfree_cb(voidpf opaque, voidpf ptr) { (void)opaque; curlx_free(ptr); } -static CURLcode -process_zlib_error(struct Curl_easy *data, z_stream *z) +static CURLcode process_zlib_error(struct Curl_easy *data, z_stream *z) { if(z->msg) failf(data, "Error while processing content unencoding: %s", @@ -115,9 +111,8 @@ process_zlib_error(struct Curl_easy *data, z_stream *z) return CURLE_BAD_CONTENT_ENCODING; } -static CURLcode -exit_zlib(struct Curl_easy *data, - z_stream *z, zlibInitState *zlib_init, CURLcode result) +static CURLcode exit_zlib(struct Curl_easy *data, z_stream *z, + zlibInitState *zlib_init, CURLcode result) { if(*zlib_init != ZLIB_UNINIT) { if(inflateEnd(z) != Z_OK && result == CURLE_OK) @@ -128,8 +123,7 @@ exit_zlib(struct Curl_easy *data, return result; } -static CURLcode process_trailer(struct Curl_easy *data, - struct zlib_writer *zp) +static CURLcode process_trailer(struct Curl_easy *data, struct zlib_writer *zp) { z_stream *z = &zp->z; CURLcode result = CURLE_OK; @@ -156,7 +150,7 @@ static CURLcode inflate_stream(struct Curl_easy *data, struct Curl_cwriter *writer, int type, zlibInitState started) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ uInt nread = z->avail_in; z_const Bytef *orig_in = z->next_in; @@ -176,7 +170,7 @@ static CURLcode inflate_stream(struct Curl_easy *data, done = TRUE; /* (re)set buffer for decompressed output for every iteration */ - z->next_out = (Bytef *) zp->buffer; + z->next_out = (Bytef *)zp->buffer; z->avail_out = DECOMPRESS_BUFFER_SIZE; status = inflate(z, Z_BLOCK); @@ -237,17 +231,16 @@ static CURLcode inflate_stream(struct Curl_easy *data, return result; } - /* Deflate handler. */ static CURLcode deflate_do_init(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ /* Initialize zlib */ - z->zalloc = (alloc_func) zalloc_cb; - z->zfree = (free_func) zfree_cb; + z->zalloc = (alloc_func)zalloc_cb; + z->zfree = (free_func)zfree_cb; if(inflateInit(z) != Z_OK) return process_zlib_error(data, z); @@ -259,7 +252,7 @@ static CURLcode deflate_do_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ if(!(type & CLIENTWRITE_BODY) || !nbytes) @@ -279,7 +272,7 @@ static CURLcode deflate_do_write(struct Curl_easy *data, static void deflate_do_close(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ exit_zlib(data, z, &zp->zlib_init, CURLE_OK); @@ -299,12 +292,12 @@ static const struct Curl_cwtype deflate_encoding = { static CURLcode gzip_do_init(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ /* Initialize zlib */ - z->zalloc = (alloc_func) zalloc_cb; - z->zfree = (free_func) zfree_cb; + z->zalloc = (alloc_func)zalloc_cb; + z->zfree = (free_func)zfree_cb; if(inflateInit2(z, MAX_WBITS + 32) != Z_OK) return process_zlib_error(data, z); @@ -317,7 +310,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ if(!(type & CLIENTWRITE_BODY) || !nbytes) @@ -338,7 +331,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data, static void gzip_do_close(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct zlib_writer *zp = (struct zlib_writer *) writer; + struct zlib_writer *zp = (struct zlib_writer *)writer; z_stream *z = &zp->z; /* zlib state structure */ exit_zlib(data, z, &zp->zlib_init, CURLE_OK); @@ -402,7 +395,7 @@ static CURLcode brotli_map_error(BrotliDecoderErrorCode be) static CURLcode brotli_do_init(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct brotli_writer *bp = (struct brotli_writer *) writer; + struct brotli_writer *bp = (struct brotli_writer *)writer; (void)data; bp->br = BrotliDecoderCreateInstance(NULL, NULL, NULL); @@ -413,8 +406,8 @@ static CURLcode brotli_do_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes) { - struct brotli_writer *bp = (struct brotli_writer *) writer; - const uint8_t *src = (const uint8_t *) buf; + struct brotli_writer *bp = (struct brotli_writer *)writer; + const uint8_t *src = (const uint8_t *)buf; uint8_t *dst; size_t dstleft; CURLcode result = CURLE_OK; @@ -428,7 +421,7 @@ static CURLcode brotli_do_write(struct Curl_easy *data, while((nbytes || r == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) && result == CURLE_OK) { - dst = (uint8_t *) bp->buffer; + dst = (uint8_t *)bp->buffer; dstleft = DECOMPRESS_BUFFER_SIZE; r = BrotliDecoderDecompressStream(bp->br, &nbytes, &src, &dstleft, &dst, NULL); @@ -457,7 +450,7 @@ static CURLcode brotli_do_write(struct Curl_easy *data, static void brotli_do_close(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct brotli_writer *bp = (struct brotli_writer *) writer; + struct brotli_writer *bp = (struct brotli_writer *)writer; (void)data; if(bp->br) { @@ -501,7 +494,7 @@ static void Curl_zstd_free(void *opaque, void *address) static CURLcode zstd_do_init(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct zstd_writer *zp = (struct zstd_writer *) writer; + struct zstd_writer *zp = (struct zstd_writer *)writer; (void)data; @@ -523,7 +516,7 @@ static CURLcode zstd_do_write(struct Curl_easy *data, const char *buf, size_t nbytes) { CURLcode result = CURLE_OK; - struct zstd_writer *zp = (struct zstd_writer *) writer; + struct zstd_writer *zp = (struct zstd_writer *)writer; ZSTD_inBuffer in; ZSTD_outBuffer out; size_t errorCode; @@ -560,7 +553,7 @@ static CURLcode zstd_do_write(struct Curl_easy *data, static void zstd_do_close(struct Curl_easy *data, struct Curl_cwriter *writer) { - struct zstd_writer *zp = (struct zstd_writer *) writer; + struct zstd_writer *zp = (struct zstd_writer *)writer; (void)data; if(zp->zds) { @@ -614,7 +607,7 @@ static const struct Curl_cwtype * const transfer_unencoders[] = { }; /* Provide a list of comma-separated names of supported encodings. -*/ + */ void Curl_all_content_encodings(char *buf, size_t blen) { size_t len = 0; diff --git a/lib/cookie.c b/lib/cookie.c index 81a57942b245..e3cf8e4e0cf1 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -661,13 +661,12 @@ parse_cookie_header(struct Curl_easy *data, return CURLE_OK; } -static CURLcode -parse_netscape(struct Cookie *co, - struct CookieInfo *ci, - bool *okay, - const char *lineptr, - bool secure) /* TRUE if connection is over secure - origin */ +static CURLcode parse_netscape(struct Cookie *co, + struct CookieInfo *ci, + bool *okay, + const char *lineptr, + bool secure) /* TRUE if connection is over + secure origin */ { /* * This line is NOT an HTTP header style line, we do offer support for @@ -1247,7 +1246,7 @@ static int cookie_sort_ct(const void *p1, const void *p2) bool Curl_secure_context(struct connectdata *conn, const char *host) { - return conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) || + return conn->handler->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS) || curl_strequal("localhost", host) || !strcmp(host, "127.0.0.1") || !strcmp(host, "::1"); diff --git a/lib/cookie.h b/lib/cookie.h index 5e9f5f7823ce..c1fb23ee4c23 100644 --- a/lib/cookie.h +++ b/lib/cookie.h @@ -52,7 +52,7 @@ struct Cookie { * draft-ietf-httpbis-rfc6265bis-02 */ #define COOKIE_PREFIX__SECURE (1 << 0) -#define COOKIE_PREFIX__HOST (1 << 1) +#define COOKIE_PREFIX__HOST (1 << 1) #define COOKIE_HASH_SIZE 63 diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 67c2f4177d5f..7993631bf1f8 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -71,8 +71,7 @@ # define vqualifier #endif -void -Curl_freeaddrinfo(struct Curl_addrinfo *cahead) +void Curl_freeaddrinfo(struct Curl_addrinfo *cahead) { struct Curl_addrinfo *vqualifier canext; struct Curl_addrinfo *ca; @@ -83,7 +82,6 @@ Curl_freeaddrinfo(struct Curl_addrinfo *cahead) } } - #ifdef HAVE_GETADDRINFO /* * Curl_getaddrinfo_ex() @@ -98,12 +96,10 @@ Curl_freeaddrinfo(struct Curl_addrinfo *cahead) * There should be no single call to system's getaddrinfo() in the * whole library, any such call should be 'routed' through this one. */ - -int -Curl_getaddrinfo_ex(const char *nodename, - const char *servname, - const struct addrinfo *hints, - struct Curl_addrinfo **result) +int Curl_getaddrinfo_ex(const char *nodename, + const char *servname, + const struct addrinfo *hints, + struct Curl_addrinfo **result) { const struct addrinfo *ai; struct addrinfo *aihead; @@ -176,7 +172,6 @@ Curl_getaddrinfo_ex(const char *nodename, if(calast) calast->ai_next = ca; calast = ca; - } /* destroy the addrinfo list */ @@ -208,7 +203,6 @@ Curl_getaddrinfo_ex(const char *nodename, } #endif /* HAVE_GETADDRINFO */ - /* * Curl_he2ai() * @@ -248,10 +242,8 @@ Curl_getaddrinfo_ex(const char *nodename, * * #define h_addr h_addr_list[0] */ - #if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE)) -struct Curl_addrinfo * -Curl_he2ai(const struct hostent *he, int port) +struct Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port) { struct Curl_addrinfo *ai; struct Curl_addrinfo *prevai = NULL; @@ -350,10 +342,8 @@ Curl_he2ai(const struct hostent *he, int port) * returns a Curl_addrinfo chain filled in correctly with information for the * given address/host */ - -static CURLcode -ip2addr(struct Curl_addrinfo **addrp, - int af, const void *inaddr, const char *hostname, int port) +static CURLcode ip2addr(struct Curl_addrinfo **addrp, int af, + const void *inaddr, const char *hostname, int port) { struct Curl_addrinfo *ai; size_t addrsize; @@ -473,7 +463,7 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, return NULL; ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo)); - sa_un = (void *) ai->ai_addr; + sa_un = (void *)ai->ai_addr; sa_un->sun_family = AF_UNIX; /* sun_path must be able to store the null-terminated path */ @@ -508,10 +498,8 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, * family otherwise present in memdebug.c. I put these ones here since they * require a bunch of structs I did not want to include in memdebug.c */ - -void -curl_dbg_freeaddrinfo(struct addrinfo *freethis, - int line, const char *source) +void curl_dbg_freeaddrinfo(struct addrinfo *freethis, + int line, const char *source) { curl_dbg_log("ADDR %s:%d freeaddrinfo(%p)\n", source, line, (void *)freethis); @@ -533,7 +521,6 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis, } #endif /* CURLDEBUG && HAVE_FREEADDRINFO */ - #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) /* * curl_dbg_getaddrinfo() @@ -542,13 +529,11 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis, * family otherwise present in memdebug.c. I put these ones here since they * require a bunch of structs I did not want to include in memdebug.c */ - -int -curl_dbg_getaddrinfo(const char *hostname, - const char *service, - const struct addrinfo *hints, - struct addrinfo **result, - int line, const char *source) +int curl_dbg_getaddrinfo(const char *hostname, + const char *service, + const struct addrinfo *hints, + struct addrinfo **result, + int line, const char *source) { #ifdef USE_LWIPSOCK int res = lwip_getaddrinfo(hostname, service, hints, result); @@ -566,11 +551,10 @@ curl_dbg_getaddrinfo(const char *hostname, #endif if(res == 0) /* success */ - curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n", - source, line, (void *)*result); + curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n", source, line, + (void *)*result); else - curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n", - source, line); + curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n", source, line); return res; } #endif /* CURLDEBUG && HAVE_GETADDRINFO */ diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h index 9a26c6784912..378b31ed05da 100644 --- a/lib/curl_addrinfo.h +++ b/lib/curl_addrinfo.h @@ -60,20 +60,17 @@ struct Curl_addrinfo { struct Curl_addrinfo *ai_next; }; -void -Curl_freeaddrinfo(struct Curl_addrinfo *cahead); +void Curl_freeaddrinfo(struct Curl_addrinfo *cahead); #ifdef HAVE_GETADDRINFO -int -Curl_getaddrinfo_ex(const char *nodename, - const char *servname, - const struct addrinfo *hints, - struct Curl_addrinfo **result); +int Curl_getaddrinfo_ex(const char *nodename, + const char *servname, + const struct addrinfo *hints, + struct Curl_addrinfo **result); #endif #if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE)) -struct Curl_addrinfo * -Curl_he2ai(const struct hostent *he, int port); +struct Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port); #endif bool Curl_is_ipaddr(const char *address); @@ -85,23 +82,23 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, #endif #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) && \ - defined(HAVE_FREEADDRINFO) -void -curl_dbg_freeaddrinfo(struct addrinfo *freethis, int line, const char *source); + defined(HAVE_FREEADDRINFO) +void curl_dbg_freeaddrinfo(struct addrinfo *freethis, int line, + const char *source); #endif #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) -int -curl_dbg_getaddrinfo(const char *hostname, const char *service, - const struct addrinfo *hints, struct addrinfo **result, - int line, const char *source); +int curl_dbg_getaddrinfo(const char *hostname, const char *service, + const struct addrinfo *hints, + struct addrinfo **result, int line, + const char *source); #endif #ifdef HAVE_GETADDRINFO #ifdef USE_RESOLVE_ON_IPS void Curl_addrinfo_set_port(struct Curl_addrinfo *addrinfo, int port); #else -#define Curl_addrinfo_set_port(x,y) +#define Curl_addrinfo_set_port(x, y) #endif #endif diff --git a/lib/curl_ctype.h b/lib/curl_ctype.h index 48c3c37c359c..153a8f9c6cdc 100644 --- a/lib/curl_ctype.h +++ b/lib/curl_ctype.h @@ -25,17 +25,17 @@ ***************************************************************************/ #define ISLOWHEXALHA(x) (((x) >= 'a') && ((x) <= 'f')) -#define ISUPHEXALHA(x) (((x) >= 'A') && ((x) <= 'F')) +#define ISUPHEXALHA(x) (((x) >= 'A') && ((x) <= 'F')) #define ISLOWCNTRL(x) ((unsigned char)(x) <= 0x1f) -#define IS7F(x) ((x) == 0x7f) +#define IS7F(x) ((x) == 0x7f) #define ISLOWPRINT(x) (((x) >= 9) && ((x) <= 0x0d)) #define ISPRINT(x) (ISLOWPRINT(x) || (((x) >= ' ') && ((x) <= 0x7e))) #define ISGRAPH(x) (ISLOWPRINT(x) || (((x) > ' ') && ((x) <= 0x7e))) -#define ISCNTRL(x) (ISLOWCNTRL(x) || IS7F(x)) -#define ISALPHA(x) (ISLOWER(x) || ISUPPER(x)) +#define ISCNTRL(x) (ISLOWCNTRL(x) || IS7F(x)) +#define ISALPHA(x) (ISLOWER(x) || ISUPPER(x)) #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALHA(x) || ISUPHEXALHA(x)) #define ISODIGIT(x) (((x) >= '0') && ((x) <= '7')) #define ISALNUM(x) (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x)) diff --git a/lib/curl_fopen.c b/lib/curl_fopen.c index cccf849acb7d..383b307e2120 100644 --- a/lib/curl_fopen.c +++ b/lib/curl_fopen.c @@ -62,10 +62,10 @@ static char *dirslash(const char *path) n = strlen(path); if(n) { /* find the rightmost path separator, if any */ - while(n && !IS_SEP(path[n-1])) + while(n && !IS_SEP(path[n - 1])) --n; /* skip over all the path separators, if any */ - while(n && IS_SEP(path[n-1])) + while(n && IS_SEP(path[n - 1])) --n; } if(curlx_dyn_addn(&out, path, n)) diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c index ea31eb182fa3..5e553f4d31de 100644 --- a/lib/curl_get_line.c +++ b/lib/curl_get_line.c @@ -29,8 +29,7 @@ #include "curl_get_line.h" -#define appendnl(b) \ - curlx_dyn_addn(buf, "\n", 1) +#define appendnl(b) curlx_dyn_addn(buf, "\n", 1) /* * Curl_get_line() returns only complete whole lines that end with newline. @@ -57,7 +56,7 @@ CURLcode Curl_get_line(struct dynbuf *buf, FILE *input, bool *eof) /* now check the full line */ rlen = curlx_dyn_len(buf); b = curlx_dyn_ptr(buf); - if(rlen && (b[rlen-1] == '\n')) + if(rlen && (b[rlen - 1] == '\n')) /* LF at end of the line */ return CURLE_OK; /* all good */ if(*eof) diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index 9f2624ff051d..e339e6079882 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -93,5 +93,4 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) return 0; #endif - } diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index 7f5bd72954aa..31addb8fbc7f 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -154,7 +154,7 @@ stub_gss_init_sec_context(OM_uint32 *min, } /* Server response, either D (RA==) or C (Qw==) */ - if(((char *) input_token->value)[0] == 'D') { + if(((char *)input_token->value)[0] == 'D') { /* Done */ switch(ctx->sent) { case STUB_GSS_KRB5: @@ -170,7 +170,7 @@ stub_gss_init_sec_context(OM_uint32 *min, } } - if(((char *) input_token->value)[0] != 'C') { + if(((char *)input_token->value)[0] != 'C') { /* We only support Done or Continue */ *min = STUB_GSS_SERVER_ERR; return GSS_S_FAILURE; diff --git a/lib/curl_hmac.h b/lib/curl_hmac.h index 9675c6c54259..285846afe705 100644 --- a/lib/curl_hmac.h +++ b/lib/curl_hmac.h @@ -56,7 +56,6 @@ struct HMAC_context { void *hashctxt2; /* Hash function context 2. */ }; - /* Prototypes. */ struct HMAC_context *Curl_HMAC_init(const struct HMAC_params *hashparams, const unsigned char *key, diff --git a/lib/curl_ldap.h b/lib/curl_ldap.h index 9da9b717d529..5ef32a5a30ae 100644 --- a/lib/curl_ldap.h +++ b/lib/curl_ldap.h @@ -26,9 +26,9 @@ #ifndef CURL_DISABLE_LDAP extern const struct Curl_handler Curl_handler_ldap; -#if !defined(CURL_DISABLE_LDAPS) && \ - ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ - (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) +#if !defined(CURL_DISABLE_LDAPS) && \ + ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ + (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) extern const struct Curl_handler Curl_handler_ldaps; #endif diff --git a/lib/curl_memrchr.c b/lib/curl_memrchr.c index 81464584070c..d8b4eef9f40b 100644 --- a/lib/curl_memrchr.c +++ b/lib/curl_memrchr.c @@ -37,9 +37,7 @@ * backwards from the end of the n bytes pointed to by s instead of forward * from the beginning. */ - -void * -Curl_memrchr(const void *s, int c, size_t n) +void *Curl_memrchr(const void *s, int c, size_t n) { if(n > 0) { const unsigned char *p = s; diff --git a/lib/curl_memrchr.h b/lib/curl_memrchr.h index 3c7dda96ac98..73bd346cdee6 100644 --- a/lib/curl_memrchr.h +++ b/lib/curl_memrchr.h @@ -35,7 +35,7 @@ #else /* HAVE_MEMRCHR */ void *Curl_memrchr(const void *s, int c, size_t n); -#define memrchr(x,y,z) Curl_memrchr((x),(y),(z)) +#define memrchr(x, y, z) Curl_memrchr((x), (y), (z)) #endif /* HAVE_MEMRCHR */ diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index f2c8c2d2a659..8bb273693d30 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -53,7 +53,7 @@ #ifdef USE_MBEDTLS #include #if MBEDTLS_VERSION_NUMBER < 0x03020000 - #error "mbedTLS 3.2.0 or later required" +#error "mbedTLS 3.2.0 or later required" #endif #endif @@ -81,13 +81,13 @@ # include # include # ifdef OPENSSL_COEXIST -# define DES_key_schedule WOLFSSL_DES_key_schedule -# define DES_cblock WOLFSSL_DES_cblock -# define DES_set_odd_parity wolfSSL_DES_set_odd_parity -# define DES_set_key wolfSSL_DES_set_key +# define DES_key_schedule WOLFSSL_DES_key_schedule +# define DES_cblock WOLFSSL_DES_cblock +# define DES_set_odd_parity wolfSSL_DES_set_odd_parity +# define DES_set_key wolfSSL_DES_set_key # define DES_set_key_unchecked wolfSSL_DES_set_key_unchecked -# define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt -# define DESKEY(x) ((WOLFSSL_DES_key_schedule *)(x)) +# define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt +# define DESKEY(x) ((WOLFSSL_DES_key_schedule *)(x)) # else # define DESKEY(x) &x # endif @@ -161,8 +161,8 @@ static void curl_des_set_odd_parity(unsigned char *bytes, size_t len) #endif /* USE_CURL_DES_SET_ODD_PARITY */ /* -* Turns a 56-bit key into being 64-bit wide. -*/ + * Turns a 56-bit key into being 64-bit wide. + */ static void extend_key_56_to_64(const unsigned char *key_56, char *key) { key[0] = (char)key_56[0]; @@ -186,7 +186,7 @@ static void setup_des_key(const unsigned char *key_56, DES_cblock key; /* Expand the 56-bit key to 64 bits */ - extend_key_56_to_64(key_56, (char *) &key); + extend_key_56_to_64(key_56, (char *)&key); /* Set the key parity to odd */ DES_set_odd_parity(&key); @@ -197,8 +197,7 @@ static void setup_des_key(const unsigned char *key_56, #elif defined(USE_GNUTLS) -static void setup_des_key(const unsigned char *key_56, - struct des_ctx *des) +static void setup_des_key(const unsigned char *key_56, struct des_ctx *des) { char key[8]; @@ -206,10 +205,10 @@ static void setup_des_key(const unsigned char *key_56, extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ - curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); + curl_des_set_odd_parity((unsigned char *)key, sizeof(key)); /* Set the key */ - des_set_key(des, (const uint8_t *) key); + des_set_key(des, (const uint8_t *)key); } #elif defined(USE_MBEDTLS_DES) @@ -224,11 +223,11 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ - mbedtls_des_key_set_parity((unsigned char *) key); + mbedtls_des_key_set_parity((unsigned char *)key); /* Perform the encryption */ mbedtls_des_init(&ctx); - mbedtls_des_setkey_enc(&ctx, (unsigned char *) key); + mbedtls_des_setkey_enc(&ctx, (unsigned char *)key); return mbedtls_des_crypt_ecb(&ctx, in, out) == 0; } @@ -248,10 +247,10 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, extend_key_56_to_64(key_56, ctl.Crypto_Key); /* Set the key parity to odd */ - curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len); + curl_des_set_odd_parity((unsigned char *)ctl.Crypto_Key, ctl.Data_Len); /* Perform the encryption */ - _CIPHER((_SPCPTR *) &out, &ctl, (_SPCPTR *) &in); + _CIPHER((_SPCPTR *)&out, &ctl, (_SPCPTR *)&in); return TRUE; } @@ -286,10 +285,10 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, extend_key_56_to_64(key_56, blob.key); /* Set the key parity to odd */ - curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key)); + curl_des_set_odd_parity((unsigned char *)blob.key, sizeof(blob.key)); /* Import the key */ - if(!CryptImportKey(hprov, (BYTE *) &blob, sizeof(blob), 0, 0, &hkey)) { + if(!CryptImportKey(hprov, (BYTE *)&blob, sizeof(blob), 0, 0, &hkey)) { CryptReleaseContext(hprov, 0); return FALSE; @@ -308,11 +307,11 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, #endif /* USE_WIN32_CRYPTO */ - /* - * takes a 21 byte array and treats it as 3 56-bit DES keys. The - * 8 byte plaintext is encrypted with each key and the resulting 24 - * bytes are stored in the results array. - */ +/* + * takes a 21 byte array and treats it as 3 56-bit DES keys. The + * 8 byte plaintext is encrypted with each key and the resulting 24 + * bytes are stored in the results array. + */ void Curl_ntlm_core_lm_resp(const unsigned char *keys, const unsigned char *plaintext, unsigned char *results) @@ -321,16 +320,16 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys, DES_key_schedule ks; setup_des_key(keys, DESKEY(ks)); - DES_ecb_encrypt((DES_cblock*)CURL_UNCONST(plaintext), - (DES_cblock*)results, DESKEY(ks), DES_ENCRYPT); + DES_ecb_encrypt((DES_cblock *)CURL_UNCONST(plaintext), + (DES_cblock *)results, DESKEY(ks), DES_ENCRYPT); setup_des_key(keys + 7, DESKEY(ks)); - DES_ecb_encrypt((DES_cblock*)CURL_UNCONST(plaintext), - (DES_cblock*)(results + 8), DESKEY(ks), DES_ENCRYPT); + DES_ecb_encrypt((DES_cblock *)CURL_UNCONST(plaintext), + (DES_cblock *)(results + 8), DESKEY(ks), DES_ENCRYPT); setup_des_key(keys + 14, DESKEY(ks)); - DES_ecb_encrypt((DES_cblock*)CURL_UNCONST(plaintext), - (DES_cblock*)(results + 16), DESKEY(ks), DES_ENCRYPT); + DES_ecb_encrypt((DES_cblock *)CURL_UNCONST(plaintext), + (DES_cblock *)(results + 16), DESKEY(ks), DES_ENCRYPT); #elif defined(USE_GNUTLS) struct des_ctx des; setup_des_key(keys, &des); @@ -431,7 +430,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(const char *password, size_t len = strlen(password); unsigned char *pw; CURLcode result; - if(len > SIZE_MAX/2) /* avoid integer overflow */ + if(len > SIZE_MAX / 2) /* avoid integer overflow */ return CURLE_OUT_OF_MEMORY; pw = len ? curlx_malloc(len * 2) : (unsigned char *)curlx_strdup(""); if(!pw) @@ -452,7 +451,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(const char *password, #ifndef USE_WINDOWS_SSPI #define NTLMv2_BLOB_SIGNATURE "\x01\x01\x00\x00" -#define NTLMv2_BLOB_LEN (44 -16 + ntlm->target_info_len + 4) +#define NTLMv2_BLOB_LEN (44 - 16 + ntlm->target_info_len + 4) /* Timestamp in tenths of a microsecond since January 1, 1601 00:00:00 UTC. */ struct ms_filetime { @@ -474,11 +473,11 @@ static void time2filetime(struct ms_filetime *ft, time_t t) ft->dwLowDateTime = (unsigned int)(t & 0xFFFFFFFF); ft->dwHighDateTime = 0; -# ifndef HAVE_TIME_T_UNSIGNED +#ifndef HAVE_TIME_T_UNSIGNED /* Extend sign if needed. */ if(ft->dwLowDateTime & 0x80000000) ft->dwHighDateTime = ~(unsigned int)0; -# endif +#endif /* Bias seconds to Jan 1, 1601. 134774 days = 11644473600 seconds = 0x2B6109100 */ @@ -559,20 +558,20 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, unsigned char **ntresp, unsigned int *ntresp_len) { -/* NTLMv2 response structure : ------------------------------------------------------------------------------- -0 HMAC MD5 16 bytes -------BLOB-------------------------------------------------------------------- -16 Signature 0x01010000 -20 Reserved long (0x00000000) -24 Timestamp LE, 64-bit signed value representing the number of - tenths of a microsecond since January 1, 1601. -32 Client Nonce 8 bytes -40 Unknown 4 bytes -44 Target Info N bytes (from the type-2 message) -44+N Unknown 4 bytes ------------------------------------------------------------------------------- -*/ + /* NTLMv2 response structure : + ----------------------------------------------------------------------------- + 0 HMAC MD5 16 bytes + ------BLOB------------------------------------------------------------------- + 16 Signature 0x01010000 + 20 Reserved long (0x00000000) + 24 Timestamp LE, 64-bit signed value representing the number of + tenths of a microsecond since January 1, 1601. + 32 Client Nonce 8 bytes + 40 Unknown 4 bytes + 44 Target Info N bytes (from the type-2 message) + 44+N Unknown 4 bytes + ----------------------------------------------------------------------------- + */ unsigned int len = 0; unsigned char *ptr = NULL; @@ -585,7 +584,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, #ifdef DEBUGBUILD char *force_timestamp = getenv("CURL_FORCETIME"); if(force_timestamp) - time2filetime(&tw, (time_t) 0); + time2filetime(&tw, (time_t)0); else #endif time2filetime(&tw, time(NULL)); diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h index 584f4a17d508..2e23d44bf580 100644 --- a/lib/curl_ntlm_core.h +++ b/lib/curl_ntlm_core.h @@ -58,16 +58,16 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, unsigned char *ntlmhash, unsigned char *ntlmv2hash); -CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, - unsigned char *challenge_client, - struct ntlmdata *ntlm, - unsigned char **ntresp, - unsigned int *ntresp_len); - -CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash, - unsigned char *challenge_client, - unsigned char *challenge_server, - unsigned char *lmresp); +CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, + unsigned char *challenge_client, + struct ntlmdata *ntlm, + unsigned char **ntresp, + unsigned int *ntresp_len); + +CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash, + unsigned char *challenge_client, + unsigned char *challenge_server, + unsigned char *lmresp); #endif /* !USE_WINDOWS_SSPI */ diff --git a/lib/curl_range.c b/lib/curl_range.c index e9620a29b535..4f788688133b 100644 --- a/lib/curl_range.c +++ b/lib/curl_range.c @@ -31,10 +31,10 @@ /* Only include this function if one or more of FTP, FILE are enabled. */ #if !defined(CURL_DISABLE_FTP) || !defined(CURL_DISABLE_FILE) - /* - Check if this is a range download, and if so, set the internal variables - properly. - */ +/* + Check if this is a range download, and if so, set the internal variables + properly. +*/ CURLcode Curl_range(struct Curl_easy *data) { if(data->state.use_range && data->state.range) { diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 6f9e7c37b4b8..1eebbb5b3f24 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -38,12 +38,12 @@ #include #if defined(USE_WINSOCK) || defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD) -#define SET_RCVTIMEO(tv,s) int tv = s*1000 +#define SET_RCVTIMEO(tv, s) int tv = s * 1000 #else -#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0} +#define SET_RCVTIMEO(tv, s) struct timeval tv = { s, 0 } #endif -#define DEF_BUFTIME (2*60*60*1000) /* 2 hours */ +#define DEF_BUFTIME (2 * 60 * 60 * 1000) /* 2 hours */ /* meta key for storing RTMP* at connection */ #define CURL_META_RTMP_CONN "meta:proto:rtmp:conn" diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index f0b6e9471e5f..a4cd5a207b68 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -235,7 +235,7 @@ static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data, if(!result && (sasl->params->flags & SASL_FLAG_BASE64)) { unsigned char *msg; size_t msglen; - const char *serverdata = (const char *) Curl_bufref_ptr(out); + const char *serverdata = (const char *)Curl_bufref_ptr(out); if(!*serverdata || *serverdata == '=') Curl_bufref_set(out, NULL, 0, NULL); @@ -355,8 +355,8 @@ static bool sasl_choose_gsasl(struct Curl_easy *data, struct sasl_ctx *sctx) struct gsasldata *gsasl; struct bufref nullmsg; - if(sctx->user && - (sctx->enabledmechs & (SASL_MECH_SCRAM_SHA_256|SASL_MECH_SCRAM_SHA_1))) { + if(sctx->user && (sctx->enabledmechs & + (SASL_MECH_SCRAM_SHA_256 | SASL_MECH_SCRAM_SHA_1))) { gsasl = Curl_auth_gsasl_get(sctx->conn); if(!gsasl) { sctx->result = CURLE_OUT_OF_MEMORY; @@ -364,14 +364,14 @@ static bool sasl_choose_gsasl(struct Curl_easy *data, struct sasl_ctx *sctx) } if((sctx->enabledmechs & SASL_MECH_SCRAM_SHA_256) && - Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_256, - gsasl)) { + Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_256, + gsasl)) { sctx->mech = SASL_MECH_STRING_SCRAM_SHA_256; sctx->sasl->authused = SASL_MECH_SCRAM_SHA_256; } else if((sctx->enabledmechs & SASL_MECH_SCRAM_SHA_1) && - Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_1, - gsasl)) { + Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_1, + gsasl)) { sctx->mech = SASL_MECH_STRING_SCRAM_SHA_1; sctx->sasl->authused = SASL_MECH_SCRAM_SHA_1; } @@ -399,7 +399,7 @@ static bool sasl_choose_digest(struct Curl_easy *data, struct sasl_ctx *sctx) if(!sctx->user) return FALSE; else if((sctx->enabledmechs & SASL_MECH_DIGEST_MD5) && - Curl_auth_is_digest_supported()) { + Curl_auth_is_digest_supported()) { sctx->mech = SASL_MECH_STRING_DIGEST_MD5; sctx->state1 = SASL_DIGESTMD5; sctx->sasl->authused = SASL_MECH_DIGEST_MD5; diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 2cc18cf41488..ca275df0ada0 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -325,8 +325,8 @@ * Direct macros concatenation does not work because macros * are not expanded before direct concatenation. */ -#define CURL_CONC_MACROS_(A,B) A ## B -#define CURL_CONC_MACROS(A,B) CURL_CONC_MACROS_(A,B) +#define CURL_CONC_MACROS_(A, B) A ## B +#define CURL_CONC_MACROS(A, B) CURL_CONC_MACROS_(A, B) /* curl uses its own printf() function internally. It understands the GNU * format. Use this format, so that it matches the GNU format attribute we @@ -431,9 +431,9 @@ # ifdef __amigaos4__ int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); -# define select(a,b,c,d,e) Curl_amiga_select(a,b,c,d,e) +# define select(a, b, c, d, e) Curl_amiga_select(a, b, c, d, e) # else -# 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 /* must not use libc's fcntl() on bsdsocket.library sockfds! */ # undef HAVE_FCNTL @@ -485,7 +485,7 @@ # undef lseek # define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence) # undef fstat -# define fstat(fdes,stp) _fstati64(fdes, stp) +# define fstat(fdes, stp) _fstati64(fdes, stp) # define struct_stat struct _stati64 # define LSEEK_ERROR (__int64)-1 # else @@ -500,8 +500,8 @@ /* Requires DJGPP 2.04 */ # include # undef lseek -# define lseek(fdes,offset,whence) llseek(fdes, offset, whence) -# define LSEEK_ERROR (offset_t)-1 +# define lseek(fdes, offset, whence) llseek(fdes, offset, whence) +# define LSEEK_ERROR (offset_t)-1 #endif #ifndef struct_stat @@ -570,7 +570,7 @@ #endif #define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1) -#define FMT_OFF_T CURL_FORMAT_CURL_OFF_T +#define FMT_OFF_T CURL_FORMAT_CURL_OFF_T #define FMT_OFF_TU CURL_FORMAT_CURL_OFF_TU #if (SIZEOF_TIME_T == 4) @@ -639,8 +639,8 @@ # ifdef MSDOS /* Watt-32 */ # include -# define select(n,r,w,x,t) select_s(n,r,w,x,t) -# define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z)) +# define select(n, r, w, x, t) select_s(n, r, w, x, t) +# define ioctl(x, y, z) ioctlsocket(x, y, (char *)(z)) # include # undef word # undef byte @@ -899,15 +899,15 @@ endings either CRLF or LF so 't' is appropriate. /* Some convenience macros to get the larger/smaller value out of two given. We prefix with CURL to prevent name collisions. */ -#define CURLMAX(x,y) ((x)>(y)?(x):(y)) -#define CURLMIN(x,y) ((x)<(y)?(x):(y)) +#define CURLMAX(x, y) ((x) > (y) ? (x) : (y)) +#define CURLMIN(x, y) ((x) < (y) ? (x) : (y)) /* A convenience macro to provide both the string literal and the length of the string literal in one go, useful for functions that take "string,len" as their argument */ -#define STRCONST(x) x,sizeof(x)-1 +#define STRCONST(x) x, sizeof(x) - 1 -#define CURL_ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) +#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) /* Buffer size for error messages retrieved via curlx_strerror() and Curl_sspi_strerror() */ @@ -1033,28 +1033,28 @@ CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode, int line, const char *source); -#define sclose(sockfd) curl_dbg_sclose(sockfd,__LINE__,__FILE__) -#define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd,__LINE__,__FILE__) +#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__) +#define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd, __LINE__, __FILE__) -#define CURL_GETADDRINFO(host,serv,hint,res) \ +#define CURL_GETADDRINFO(host, serv, hint, res) \ curl_dbg_getaddrinfo(host, serv, hint, res, __LINE__, __FILE__) #define CURL_FREEADDRINFO(data) \ curl_dbg_freeaddrinfo(data, __LINE__, __FILE__) -#define CURL_SOCKET(domain,type,protocol) \ +#define CURL_SOCKET(domain, type, protocol) \ curl_dbg_socket((int)domain, type, protocol, __LINE__, __FILE__) #ifdef HAVE_SOCKETPAIR -#define CURL_SOCKETPAIR(domain,type,protocol,socket_vector) \ +#define CURL_SOCKETPAIR(domain, type, protocol, socket_vector) \ curl_dbg_socketpair((int)domain, type, protocol, socket_vector, \ __LINE__, __FILE__) #endif -#define CURL_ACCEPT(sock,addr,len) \ +#define CURL_ACCEPT(sock, addr, len) \ curl_dbg_accept(sock, addr, len, __LINE__, __FILE__) #ifdef HAVE_ACCEPT4 -#define CURL_ACCEPT4(sock,addr,len,flags) \ +#define CURL_ACCEPT4(sock, addr, len, flags) \ curl_dbg_accept4(sock, addr, len, flags, __LINE__, __FILE__) #endif -#define CURL_SEND(a,b,c,d) curl_dbg_send(a,b,c,d, __LINE__, __FILE__) -#define CURL_RECV(a,b,c,d) curl_dbg_recv(a,b,c,d, __LINE__, __FILE__) +#define CURL_SEND(a, b, c, d) curl_dbg_send(a, b, c, d, __LINE__, __FILE__) +#define CURL_RECV(a, b, c, d) curl_dbg_recv(a, b, c, d, __LINE__, __FILE__) #else /* !CURLDEBUG */ diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index 7caf6c9bc5eb..cf494b2ba8b0 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -104,7 +104,6 @@ /* * Definition of timeval struct for platforms that do not have it. */ - #ifndef HAVE_STRUCT_TIMEVAL struct timeval { long tv_sec; @@ -112,24 +111,21 @@ struct timeval { }; #endif - /* * If we have the MSG_NOSIGNAL define, make sure we use * it as the fourth argument of function send() */ - #ifdef HAVE_MSG_NOSIGNAL #define SEND_4TH_ARG MSG_NOSIGNAL #else #define SEND_4TH_ARG 0 #endif - #ifdef __minix /* Minix does not support recv on TCP sockets */ -#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \ - (RECV_TYPE_ARG2)(y), \ - (RECV_TYPE_ARG3)(z)) +#define sread(x, y, z) (ssize_t)read((RECV_TYPE_ARG1)(x), \ + (RECV_TYPE_ARG2)(y), \ + (RECV_TYPE_ARG3)(z)) #elif defined(HAVE_RECV) /* @@ -154,10 +150,10 @@ struct timeval { * SEND_TYPE_RETV must also be defined. */ -#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \ - (RECV_TYPE_ARG2)(y), \ - (RECV_TYPE_ARG3)(z), \ - (RECV_TYPE_ARG4)(0)) +#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \ + (RECV_TYPE_ARG2)(y), \ + (RECV_TYPE_ARG3)(z), \ + (RECV_TYPE_ARG4)(0)) #else /* HAVE_RECV */ #ifndef sread #error "Missing definition of macro sread!" @@ -167,25 +163,23 @@ struct timeval { #ifdef __minix /* Minix does not support send on TCP sockets */ -#define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ - (SEND_TYPE_ARG2)CURL_UNCONST(y), \ - (SEND_TYPE_ARG3)(z)) +#define swrite(x, y, z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ + (SEND_TYPE_ARG2)CURL_UNCONST(y), \ + (SEND_TYPE_ARG3)(z)) #elif defined(HAVE_SEND) -#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ +#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ (SEND_QUAL_ARG2 SEND_TYPE_ARG2)CURL_UNCONST(y), \ - (SEND_TYPE_ARG3)(z), \ - (SEND_TYPE_ARG4)(SEND_4TH_ARG)) + (SEND_TYPE_ARG3)(z), \ + (SEND_TYPE_ARG4)(SEND_4TH_ARG)) #else /* HAVE_SEND */ #ifndef swrite #error "Missing definition of macro swrite!" #endif #endif /* HAVE_SEND */ - /* * Function-like macro definition used to close a socket. */ - #ifdef HAVE_CLOSESOCKET # define CURL_SCLOSE(x) closesocket((x)) #elif defined(HAVE_CLOSESOCKET_CAMEL) @@ -210,7 +204,6 @@ struct timeval { /* * 'bool' stuff compatible with HP-UX headers. */ - #if defined(__hpux) && !defined(HAVE_BOOL_T) typedef int bool; # define false 0 @@ -218,14 +211,12 @@ struct timeval { # define HAVE_BOOL_T #endif - /* * 'bool' exists on platforms with , i.e. C99 platforms. * On non-C99 platforms there is no bool, so define an enum for that. * On C99 platforms 'false' and 'true' also exist. Enum uses a * global namespace though, so use bool_false and bool_true. */ - #ifndef HAVE_BOOL_T typedef enum { bool_false = 0, @@ -258,7 +249,6 @@ typedef unsigned int bit; * 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro, * AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too. */ - #ifndef TRUE #define TRUE true #endif @@ -268,22 +258,18 @@ typedef unsigned int bit; #include "curl_ctype.h" - /* * Macro used to include code only in debug builds. */ - #ifdef DEBUGBUILD #define DEBUGF(x) x #else #define DEBUGF(x) do { } while(0) #endif - /* * Macro used to include assertion code only in debug builds. */ - #undef DEBUGASSERT #ifdef DEBUGBUILD #define DEBUGASSERT(x) assert(x) @@ -291,12 +277,10 @@ typedef unsigned int bit; #define DEBUGASSERT(x) do { } while(0) #endif - /* * Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno * (or equivalent) on this platform to hide platform details to code using it. */ - #ifdef USE_WINSOCK #define SOCKERRNO ((int)WSAGetLastError()) #define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) @@ -305,11 +289,9 @@ typedef unsigned int bit; #define SET_SOCKERRNO(x) (errno = (x)) #endif - /* * Portable error number symbolic names defined to Winsock error codes. */ - #ifdef USE_WINSOCK #define SOCKEACCES WSAEACCES #define SOCKEADDRINUSE WSAEADDRINUSE @@ -349,7 +331,6 @@ typedef unsigned int bit; /* * Macro argv_item_t hides platform details to code using it. */ - #ifdef __VMS #define argv_item_t __char_ptr32 #elif defined(_UNICODE) @@ -358,13 +339,10 @@ typedef unsigned int bit; #define argv_item_t char * #endif - /* * We use this ZERO_NULL to avoid picky compiler warnings, * when assigning a NULL pointer to a function pointer var. */ - #define ZERO_NULL 0 - #endif /* HEADER_CURL_SETUP_ONCE_H */ diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index af768fd2aa5f..cc49aa4c7750 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -30,12 +30,12 @@ #include "curlx/warnless.h" /* The recommended order of the TLS backends: - * * OpenSSL - * * GnuTLS - * * wolfSSL - * * Schannel SSPI - * * mbedTLS - * * Rustls + * 1. OpenSSL + * 2. GnuTLS + * 3. wolfSSL + * 4. Schannel SSPI + * 5. mbedTLS + * 6. Rustls * Skip the backend if it does not support the required algorithm */ #ifdef USE_OPENSSL @@ -72,7 +72,6 @@ # endif #endif /* USE_OPENSSL */ - #if !defined(HAS_SHA512_256_IMPLEMENTATION) && defined(USE_GNUTLS) # include # ifdef SHA512_256_DIGEST_SIZE @@ -109,7 +108,7 @@ typedef EVP_MD_CTX *Curl_sha512_256_ctx; */ static CURLcode Curl_sha512_256_init(void *context) { - Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; + Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; *ctx = EVP_MD_CTX_create(); if(!*ctx) @@ -129,7 +128,6 @@ static CURLcode Curl_sha512_256_init(void *context) return CURLE_FAILED_INIT; } - /** * Process portion of bytes. * @@ -142,7 +140,7 @@ static CURLcode Curl_sha512_256_update(void *context, const unsigned char *data, size_t length) { - Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; + Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; if(!EVP_DigestUpdate(*ctx, data, length)) return CURLE_SSL_CIPHER; @@ -150,7 +148,6 @@ static CURLcode Curl_sha512_256_update(void *context, return CURLE_OK; } - /** * Finalise SHA-512/256 calculation, return digest. * @@ -163,7 +160,7 @@ static CURLcode Curl_sha512_256_update(void *context, static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { CURLcode ret; - Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; + Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; #ifdef NEED_NETBSD_SHA512_256_WORKAROUND /* Use a larger buffer to work around a bug in NetBSD: @@ -202,7 +199,7 @@ typedef struct sha512_256_ctx Curl_sha512_256_ctx; */ static CURLcode Curl_sha512_256_init(void *context) { - Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; + Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; /* Check whether the header and this file use the same numbers */ DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE); @@ -212,7 +209,6 @@ static CURLcode Curl_sha512_256_init(void *context) return CURLE_OK; } - /** * Process portion of bytes. * @@ -225,7 +221,7 @@ static CURLcode Curl_sha512_256_update(void *context, const unsigned char *data, size_t length) { - Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; + Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; DEBUGASSERT((data != NULL) || (length == 0)); @@ -234,7 +230,6 @@ static CURLcode Curl_sha512_256_update(void *context, return CURLE_OK; } - /** * Finalise SHA-512/256 calculation, return digest. * @@ -246,7 +241,7 @@ static CURLcode Curl_sha512_256_update(void *context, static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { - Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; + Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; sha512_256_digest(ctx, (size_t)CURL_SHA512_256_DIGEST_SIZE, (uint8_t *)digest); @@ -286,32 +281,31 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, /* Bits manipulation macros and functions. Can be moved to other headers to reuse. */ -#define CURL_GET_64BIT_BE(ptr) \ - ( ((uint64_t)(((const uint8_t*)(ptr))[0]) << 56) | \ - ((uint64_t)(((const uint8_t*)(ptr))[1]) << 48) | \ - ((uint64_t)(((const uint8_t*)(ptr))[2]) << 40) | \ - ((uint64_t)(((const uint8_t*)(ptr))[3]) << 32) | \ - ((uint64_t)(((const uint8_t*)(ptr))[4]) << 24) | \ - ((uint64_t)(((const uint8_t*)(ptr))[5]) << 16) | \ - ((uint64_t)(((const uint8_t*)(ptr))[6]) << 8) | \ - (uint64_t)(((const uint8_t*)(ptr))[7]) ) - -#define CURL_PUT_64BIT_BE(ptr,val) do { \ - ((uint8_t*)(ptr))[7]=(uint8_t)((uint64_t)(val)); \ - ((uint8_t*)(ptr))[6]=(uint8_t)(((uint64_t)(val)) >> 8); \ - ((uint8_t*)(ptr))[5]=(uint8_t)(((uint64_t)(val)) >> 16); \ - ((uint8_t*)(ptr))[4]=(uint8_t)(((uint64_t)(val)) >> 24); \ - ((uint8_t*)(ptr))[3]=(uint8_t)(((uint64_t)(val)) >> 32); \ - ((uint8_t*)(ptr))[2]=(uint8_t)(((uint64_t)(val)) >> 40); \ - ((uint8_t*)(ptr))[1]=(uint8_t)(((uint64_t)(val)) >> 48); \ - ((uint8_t*)(ptr))[0]=(uint8_t)(((uint64_t)(val)) >> 56); \ +#define CURL_GET_64BIT_BE(ptr) \ + (((uint64_t)(((const uint8_t *)(ptr))[0]) << 56) | \ + ((uint64_t)(((const uint8_t *)(ptr))[1]) << 48) | \ + ((uint64_t)(((const uint8_t *)(ptr))[2]) << 40) | \ + ((uint64_t)(((const uint8_t *)(ptr))[3]) << 32) | \ + ((uint64_t)(((const uint8_t *)(ptr))[4]) << 24) | \ + ((uint64_t)(((const uint8_t *)(ptr))[5]) << 16) | \ + ((uint64_t)(((const uint8_t *)(ptr))[6]) << 8) | \ + (uint64_t)(((const uint8_t *)(ptr))[7])) + +#define CURL_PUT_64BIT_BE(ptr,val) do { \ + ((uint8_t*)(ptr))[7] = (uint8_t) ((uint64_t)(val)); \ + ((uint8_t*)(ptr))[6] = (uint8_t)(((uint64_t)(val)) >> 8); \ + ((uint8_t*)(ptr))[5] = (uint8_t)(((uint64_t)(val)) >> 16); \ + ((uint8_t*)(ptr))[4] = (uint8_t)(((uint64_t)(val)) >> 24); \ + ((uint8_t*)(ptr))[3] = (uint8_t)(((uint64_t)(val)) >> 32); \ + ((uint8_t*)(ptr))[2] = (uint8_t)(((uint64_t)(val)) >> 40); \ + ((uint8_t*)(ptr))[1] = (uint8_t)(((uint64_t)(val)) >> 48); \ + ((uint8_t*)(ptr))[0] = (uint8_t)(((uint64_t)(val)) >> 56); \ } while(0) /* Defined as a function. The macro version may duplicate the binary code * size as each argument is used twice, so if any calculation is used * as an argument, the calculation could be done twice. */ -static CURL_FORCEINLINE uint64_t Curl_rotr64(uint64_t value, - unsigned int bits) +static CURL_FORCEINLINE uint64_t Curl_rotr64(uint64_t value, unsigned int bits) { bits %= 64; if(bits == 0) @@ -399,7 +393,6 @@ struct Curl_sha512_256ctx { */ typedef struct Curl_sha512_256ctx Curl_sha512_256_ctx; - /** * Initialise structure for SHA-512/256 calculation. * @@ -408,7 +401,7 @@ typedef struct Curl_sha512_256ctx Curl_sha512_256_ctx; */ static CURLcode Curl_sha512_256_init(void *context) { - struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; + struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context; /* Check whether the header and this file use the same numbers */ DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE); @@ -434,16 +427,14 @@ static CURLcode Curl_sha512_256_init(void *context) return CURLE_OK; } - /** * Base of the SHA-512/256 transformation. * Gets a full 128 bytes block of data and updates hash values; * @param H hash values * @param data the data buffer with #CURL_SHA512_256_BLOCK_SIZE bytes block */ -static -void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], - const void *data) +static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], + const void *data) { /* Working variables, see FIPS PUB 180-4 section 6.7, 6.4. */ @@ -462,8 +453,8 @@ void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], /* 'Ch' and 'Maj' macro functions are defined with widely-used optimization. See FIPS PUB 180-4 formulae 4.8, 4.9. */ -#define Sha512_Ch(x,y,z) ( (z) ^ ((x) & ((y) ^ (z))) ) -#define Sha512_Maj(x,y,z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) ) +#define Sha512_Ch(x, y, z) ( (z) ^ ((x) & ((y) ^ (z))) ) +#define Sha512_Maj(x, y, z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) ) /* Four 'Sigma' macro functions. See FIPS PUB 180-4 formulae 4.10, 4.11, 4.12, 4.13. */ @@ -533,38 +524,41 @@ void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], * Note: 'wt' must be used exactly one time in this macro as macro for 'wt' calculation may change other data as well every time when used. */ -#define SHA2STEP64(vA,vB,vC,vD,vE,vF,vG,vH,kt,wt) do { \ - (vD) += ((vH) += SIG1((vE)) + Sha512_Ch((vE),(vF),(vG)) + (kt) + (wt)); \ - (vH) += SIG0((vA)) + Sha512_Maj((vA),(vB),(vC)); } while (0) +#define SHA2STEP64(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) \ + do { \ + (vD) += ((vH) += SIG1((vE)) + Sha512_Ch((vE), (vF), (vG)) + (kt) + (wt)); \ + (vH) += SIG0((vA)) + Sha512_Maj((vA), (vB), (vC)); \ + } while(0) /* One step of SHA-512/256 computation with working variables rotation, see FIPS PUB 180-4 section 6.4.2 step 3. This macro version reassigns all working variables on each step. */ -#define SHA2STEP64RV(vA,vB,vC,vD,vE,vF,vG,vH,kt,wt) do { \ - uint64_t tmp_h_ = (vH); \ - SHA2STEP64((vA),(vB),(vC),(vD),(vE),(vF),(vG),tmp_h_,(kt),(wt)); \ - (vH) = (vG); \ - (vG) = (vF); \ - (vF) = (vE); \ - (vE) = (vD); \ - (vD) = (vC); \ - (vC) = (vB); \ - (vB) = (vA); \ - (vA) = tmp_h_; } while(0) +#define SHA2STEP64RV(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) \ + do { \ + uint64_t tmp_h_ = (vH); \ + SHA2STEP64((vA), (vB), (vC), (vD), (vE), (vF), (vG), tmp_h_, (kt), (wt)); \ + (vH) = (vG); \ + (vG) = (vF); \ + (vF) = (vE); \ + (vE) = (vD); \ + (vD) = (vC); \ + (vC) = (vB); \ + (vB) = (vA); \ + (vA) = tmp_h_; \ + } while(0) /* Get value of W(t) from input data buffer for 0 <= t <= 15, See FIPS PUB 180-4 section 6.2. Input data must be read in big-endian bytes order, see FIPS PUB 180-4 section 3.1.2. */ -#define SHA512_GET_W_FROM_DATA(buf,t) \ - CURL_GET_64BIT_BE( \ - ((const uint8_t*) (buf)) + (t) * SHA512_256_BYTES_IN_WORD) +#define SHA512_GET_W_FROM_DATA(buf, t) \ + CURL_GET_64BIT_BE(((const uint8_t *)(buf)) + (t) * SHA512_256_BYTES_IN_WORD) /* During first 16 steps, before making any calculation on each step, the W element is read from the input data buffer as a big-endian value and stored in the array of W elements. */ for(t = 0; t < 16; ++t) { - SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t], \ + SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t], W[t] = SHA512_GET_W_FROM_DATA(data, t)); } @@ -573,15 +567,15 @@ void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], As only the last 16 'W' are used in calculations, it is possible to use 16 elements array of W as a cyclic buffer. Note: ((t-16) & 15) have same value as (t & 15) */ -#define Wgen(w,t) \ - (uint64_t)( (w)[(t - 16) & 15] + sig1((w)[((t) - 2) & 15]) \ - + (w)[((t) - 7) & 15] + sig0((w)[((t) - 15) & 15]) ) +#define Wgen(w, t) \ + (uint64_t)((w)[((t) - 16) & 15] + sig1((w)[((t) - 2) & 15]) + \ + (w)[((t) - 7) & 15] + sig0((w)[((t) - 15) & 15])) /* During the last 64 steps, before making any calculation on each step, current W element is generated from other W elements of the cyclic buffer and the generated value is stored back in the cyclic buffer. */ for(t = 16; t < 80; ++t) { - SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t], \ + SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t], W[t & 15] = Wgen(W, t)); } } @@ -598,7 +592,6 @@ void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], H[7] += h; } - /** * Process portion of bytes. * @@ -612,9 +605,9 @@ static CURLcode Curl_sha512_256_update(void *context, size_t length) { unsigned int bytes_have; /**< Number of bytes in the context buffer */ - struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; + struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context; /* the void pointer here is required to mute Intel compiler warning */ - void *const ctx_buf = ctx->buffer; + void * const ctx_buf = ctx->buffer; DEBUGASSERT((data != NULL) || (length == 0)); @@ -623,7 +616,7 @@ static CURLcode Curl_sha512_256_update(void *context, /* Note: (count & (CURL_SHA512_256_BLOCK_SIZE-1)) equals (count % CURL_SHA512_256_BLOCK_SIZE) for this block size. */ - bytes_have = (unsigned int) (ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1)); + bytes_have = (unsigned int)(ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1)); ctx->count += length; if(length > ctx->count) ctx->count_bits_hi += 1U << 3; /* Value wrap */ @@ -635,7 +628,7 @@ static CURLcode Curl_sha512_256_update(void *context, if(length >= bytes_left) { /* Combine new data with data in the buffer and process the full block. */ - memcpy(((unsigned char *) ctx_buf) + bytes_have, + memcpy(((unsigned char *)ctx_buf) + bytes_have, data, bytes_left); data += bytes_left; @@ -656,13 +649,12 @@ static CURLcode Curl_sha512_256_update(void *context, if(length) { /* Copy incomplete block of new data (if any) to the buffer. */ - memcpy(((unsigned char *) ctx_buf) + bytes_have, data, length); + memcpy(((unsigned char *)ctx_buf) + bytes_have, data, length); } return CURLE_OK; } - /** * Size of "length" insertion in bits. * See FIPS PUB 180-4 section 5.1.2. @@ -684,11 +676,11 @@ static CURLcode Curl_sha512_256_update(void *context, */ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { - struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; + struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context; uint64_t num_bits; /**< Number of processed bits */ unsigned int bytes_have; /**< Number of bytes in the context buffer */ /* the void pointer here is required to mute Intel compiler warning */ - void *const ctx_buf = ctx->buffer; + void * const ctx_buf = ctx->buffer; /* Memorise the number of processed bits. The padding and other data added here during the postprocessing must @@ -697,7 +689,7 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) /* Note: (count & (CURL_SHA512_256_BLOCK_SIZE-1)) equals (count % CURL_SHA512_256_BLOCK_SIZE) for this block size. */ - bytes_have = (unsigned int) (ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1)); + bytes_have = (unsigned int)(ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1)); /* Input data must be padded with a single bit "1", then with zeros and the finally the length of data in bits must be added as the final bytes @@ -709,13 +701,13 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) predefined (0x80). */ /* Buffer always have space at least for one byte (as full buffers are processed when formed). */ - ((unsigned char *) ctx_buf)[bytes_have++] = 0x80U; + ((unsigned char *)ctx_buf)[bytes_have++] = 0x80U; if(CURL_SHA512_256_BLOCK_SIZE - bytes_have < SHA512_256_SIZE_OF_LEN_ADD) { /* No space in the current block to put the total length of message. Pad the current block with zeros and process it. */ if(bytes_have < CURL_SHA512_256_BLOCK_SIZE) - memset(((unsigned char *) ctx_buf) + bytes_have, 0, + memset(((unsigned char *)ctx_buf) + bytes_have, 0, CURL_SHA512_256_BLOCK_SIZE - bytes_have); /* Process the full block. */ Curl_sha512_256_transform(ctx->H, ctx->buffer); @@ -724,17 +716,17 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) } /* Pad the rest of the buffer with zeros. */ - memset(((unsigned char *) ctx_buf) + bytes_have, 0, + memset(((unsigned char *)ctx_buf) + bytes_have, 0, CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD - bytes_have); /* Put high part of number of bits in processed message and then lower part of number of bits as big-endian values. See FIPS PUB 180-4 section 5.1.2. */ /* Note: the target location is predefined and buffer is always aligned */ - CURL_PUT_64BIT_BE(((unsigned char *) ctx_buf) \ + CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \ + CURL_SHA512_256_BLOCK_SIZE \ - SHA512_256_SIZE_OF_LEN_ADD, \ ctx->count_bits_hi); - CURL_PUT_64BIT_BE(((unsigned char *) ctx_buf) \ + CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \ + CURL_SHA512_256_BLOCK_SIZE \ - SHA512_256_SIZE_OF_LEN_ADD \ + SHA512_256_BYTES_IN_WORD, \ @@ -775,7 +767,7 @@ CURLcode Curl_sha512_256it(unsigned char *output, const unsigned char *input, if(res != CURLE_OK) return res; - res = Curl_sha512_256_update(&ctx, (const void *) input, input_size); + res = Curl_sha512_256_update(&ctx, (const void *)input, input_size); if(res != CURLE_OK) { (void)Curl_sha512_256_finish(output, &ctx); diff --git a/lib/curl_sha512_256.h b/lib/curl_sha512_256.h index a84e77bc3038..c22491ddc0f5 100644 --- a/lib/curl_sha512_256.h +++ b/lib/curl_sha512_256.h @@ -35,9 +35,8 @@ extern const struct HMAC_params Curl_HMAC_SHA512_256[1]; #define CURL_SHA512_256_DIGEST_LENGTH 32 -CURLcode -Curl_sha512_256it(unsigned char *output, const unsigned char *input, - size_t input_size); +CURLcode Curl_sha512_256it(unsigned char *output, const unsigned char *input, + size_t input_size); #endif /* !CURL_DISABLE_DIGEST_AUTH && !CURL_DISABLE_SHA512_256 */ diff --git a/lib/curl_share.c b/lib/curl_share.c index c6b51267046f..109fe76b6676 100644 --- a/lib/curl_share.c +++ b/lib/curl_share.c @@ -34,8 +34,7 @@ #include "hsts.h" #include "url.h" -CURLSH * -curl_share_init(void) +CURLSH *curl_share_init(void) { struct Curl_share *share = curlx_calloc(1, sizeof(struct Curl_share)); if(share) { @@ -60,8 +59,7 @@ curl_share_init(void) } #undef curl_share_setopt -CURLSHcode -curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) +CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) { va_list param; int type; @@ -224,8 +222,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) return res; } -CURLSHcode -curl_share_cleanup(CURLSH *sh) +CURLSHcode curl_share_cleanup(CURLSH *sh) { struct Curl_share *share = sh; if(!GOOD_SHARE_HANDLE(share)) @@ -273,10 +270,8 @@ curl_share_cleanup(CURLSH *sh) return CURLSHE_OK; } - -CURLSHcode -Curl_share_lock(struct Curl_easy *data, curl_lock_data type, - curl_lock_access accesstype) +CURLSHcode Curl_share_lock(struct Curl_easy *data, curl_lock_data type, + curl_lock_access accesstype) { struct Curl_share *share = data->share; @@ -292,8 +287,7 @@ Curl_share_lock(struct Curl_easy *data, curl_lock_data type, return CURLSHE_OK; } -CURLSHcode -Curl_share_unlock(struct Curl_easy *data, curl_lock_data type) +CURLSHcode Curl_share_unlock(struct Curl_easy *data, curl_lock_data type) { struct Curl_share *share = data->share; @@ -302,7 +296,7 @@ Curl_share_unlock(struct Curl_easy *data, curl_lock_data type) if(share->specifier & (unsigned int)(1 << type)) { if(share->unlockfunc) /* only call this if set! */ - share->unlockfunc (data, type, share->clientdata); + share->unlockfunc(data, type, share->clientdata); } return CURLSHE_OK; diff --git a/lib/curl_share.h b/lib/curl_share.h index 974c99dc204b..0699356dd443 100644 --- a/lib/curl_share.h +++ b/lib/curl_share.h @@ -38,7 +38,7 @@ struct Curl_ssl_scache; #define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE) #define CURL_SHARE_KEEP_CONNECT(s) \ - ((s) && ((s)->specifier & (1<< CURL_LOCK_DATA_CONNECT))) + ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT))) /* this struct is libcurl-private, do not export details */ struct Curl_share { @@ -71,8 +71,8 @@ CURLSHcode Curl_share_lock(struct Curl_easy *, curl_lock_data, CURLSHcode Curl_share_unlock(struct Curl_easy *, curl_lock_data); /* convenience macro to check if this handle is using a shared SSL spool */ -#define CURL_SHARE_ssl_scache(data) (data->share && \ +#define CURL_SHARE_ssl_scache(data) (data->share && \ (data->share->specifier & \ - (1<type = type; if(type & CLIENTWRITE_BODY) Curl_bufq_init2(&cwbuf->b, CW_PAUSE_BUF_CHUNK, 1, - (BUFQ_OPT_SOFT_LIMIT|BUFQ_OPT_NO_SPARES)); + (BUFQ_OPT_SOFT_LIMIT | BUFQ_OPT_NO_SPARES)); else Curl_bufq_init(&cwbuf->b, buflen, 1); } diff --git a/lib/dict.c b/lib/dict.c index f208892f7302..a5facf4310db 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -60,10 +60,10 @@ #include "progress.h" #include "dict.h" -#define DICT_MATCH "/MATCH:" -#define DICT_MATCH2 "/M:" -#define DICT_MATCH3 "/FIND:" -#define DICT_DEFINE "/DEFINE:" +#define DICT_MATCH "/MATCH:" +#define DICT_MATCH2 "/M:" +#define DICT_MATCH3 "/FIND:" +#define DICT_DEFINE "/DEFINE:" #define DICT_DEFINE2 "/D:" #define DICT_DEFINE3 "/LOOKUP:" @@ -192,9 +192,9 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done) if(result) return result; - if(curl_strnequal(path, DICT_MATCH, sizeof(DICT_MATCH)-1) || - curl_strnequal(path, DICT_MATCH2, sizeof(DICT_MATCH2)-1) || - curl_strnequal(path, DICT_MATCH3, sizeof(DICT_MATCH3)-1)) { + if(curl_strnequal(path, DICT_MATCH, sizeof(DICT_MATCH) - 1) || + curl_strnequal(path, DICT_MATCH2, sizeof(DICT_MATCH2) - 1) || + curl_strnequal(path, DICT_MATCH3, sizeof(DICT_MATCH3) - 1)) { word = strchr(path, ':'); if(word) { @@ -239,9 +239,9 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done) } Curl_xfer_setup_recv(data, FIRSTSOCKET, -1); } - else if(curl_strnequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) || - curl_strnequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) || - curl_strnequal(path, DICT_DEFINE3, sizeof(DICT_DEFINE3)-1)) { + else if(curl_strnequal(path, DICT_DEFINE, sizeof(DICT_DEFINE) - 1) || + curl_strnequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2) - 1) || + curl_strnequal(path, DICT_DEFINE3, sizeof(DICT_DEFINE3) - 1)) { word = strchr(path, ':'); if(word) { diff --git a/lib/doh.c b/lib/doh.c index d7b1d54c25e8..b0f19be73a7e 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -44,7 +44,7 @@ #define DNS_CLASS_IN 0x01 #ifndef CURL_DISABLE_VERBOSE_STRINGS -static const char * const errors[]={ +static const char * const errors[] = { "", "Bad label", "Out of range", @@ -107,7 +107,7 @@ UNITTEST DOHcode doh_req_encode(const char *host, size_t expected_len; DEBUGASSERT(hostlen); expected_len = 12 + 1 + hostlen + 4; - if(host[hostlen-1]!='.') + if(host[hostlen - 1] != '.') expected_len++; if(expected_len > DOH_MAX_DNSREQ_SIZE) @@ -169,8 +169,8 @@ UNITTEST DOHcode doh_req_encode(const char *host, return DOH_OK; } -static size_t -doh_probe_write_cb(char *contents, size_t size, size_t nmemb, void *userp) +static size_t doh_probe_write_cb(char *contents, size_t size, size_t nmemb, + void *userp) { size_t realsize = size * nmemb; struct Curl_easy *data = userp; @@ -269,7 +269,7 @@ static void doh_probe_dtor(void *key, size_t klen, void *e) } } -#define ERROR_CHECK_SETOPT(x,y) \ +#define ERROR_CHECK_SETOPT(x, y) \ do { \ result = curl_easy_setopt((CURL *)doh, x, y); \ if(result && \ @@ -346,7 +346,7 @@ static CURLcode doh_probe_run(struct Curl_easy *data, ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); #else /* in debug mode, also allow http */ - ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS); + ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); #endif ERROR_CHECK_SETOPT(CURLOPT_TIMEOUT_MS, (long)timeout_ms); ERROR_CHECK_SETOPT(CURLOPT_SHARE, (CURLSH *)data->share); @@ -358,11 +358,11 @@ static CURLcode doh_probe_run(struct Curl_easy *data, ERROR_CHECK_SETOPT(CURLOPT_NOSIGNAL, 1L); ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYHOST, - data->set.doh_verifyhost ? 2L : 0L); + data->set.doh_verifyhost ? 2L : 0L); ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYPEER, - data->set.doh_verifypeer ? 1L : 0L); + data->set.doh_verifypeer ? 1L : 0L); ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYSTATUS, - data->set.doh_verifystatus ? 1L : 0L); + data->set.doh_verifystatus ? 1L : 0L); /* Inherit *some* SSL options from the user's transfer. This is a best-guess as to which options are needed for compatibility. #3661 @@ -376,20 +376,16 @@ static CURLcode doh_probe_run(struct Curl_easy *data, doh->set.ssl.custom_capath = data->set.ssl.custom_capath; doh->set.ssl.custom_cablob = data->set.ssl.custom_cablob; if(data->set.str[STRING_SSL_CAFILE]) { - ERROR_CHECK_SETOPT(CURLOPT_CAINFO, - data->set.str[STRING_SSL_CAFILE]); + ERROR_CHECK_SETOPT(CURLOPT_CAINFO, data->set.str[STRING_SSL_CAFILE]); } if(data->set.blobs[BLOB_CAINFO]) { - ERROR_CHECK_SETOPT(CURLOPT_CAINFO_BLOB, - data->set.blobs[BLOB_CAINFO]); + ERROR_CHECK_SETOPT(CURLOPT_CAINFO_BLOB, data->set.blobs[BLOB_CAINFO]); } if(data->set.str[STRING_SSL_CAPATH]) { - ERROR_CHECK_SETOPT(CURLOPT_CAPATH, - data->set.str[STRING_SSL_CAPATH]); + ERROR_CHECK_SETOPT(CURLOPT_CAPATH, data->set.str[STRING_SSL_CAPATH]); } if(data->set.str[STRING_SSL_CRLFILE]) { - ERROR_CHECK_SETOPT(CURLOPT_CRLFILE, - data->set.str[STRING_SSL_CRLFILE]); + ERROR_CHECK_SETOPT(CURLOPT_CRLFILE, data->set.str[STRING_SSL_CRLFILE]); } if(data->set.ssl.certinfo) ERROR_CHECK_SETOPT(CURLOPT_CERTINFO, 1L); @@ -717,7 +713,6 @@ UNITTEST void de_init(struct dohentry *de) curlx_dyn_init(&de->cname[i], DYN_DOH_CNAME); } - UNITTEST DOHcode doh_resp_decode(const unsigned char *doh, size_t dohlen, DNStype dnstype, @@ -851,7 +846,7 @@ UNITTEST DOHcode doh_resp_decode(const unsigned char *doh, #ifdef USE_HTTTPS if((type != CURL_DNS_TYPE_NS) && !d->numcname && !d->numaddr && - !d->numhttps_rrs) + !d->numhttps_rrs) #else if((type != CURL_DNS_TYPE_NS) && !d->numcname && !d->numaddr) #endif @@ -895,8 +890,7 @@ static void doh_show(struct Curl_easy *data, #ifdef USE_HTTPSRR for(i = 0; i < d->numhttps_rrs; i++) { # ifdef DEBUGBUILD - doh_print_buf(data, "DoH HTTPS", - d->https_rrs[i].val, d->https_rrs[i].len); + doh_print_buf(data, "DoH HTTPS", d->https_rrs[i].val, d->https_rrs[i].len); # else infof(data, "DoH HTTPS RR: length %d", d->https_rrs[i].len); # endif @@ -907,7 +901,7 @@ static void doh_show(struct Curl_easy *data, } } #else -#define doh_show(x,y) +#define doh_show(x, y) #endif /* @@ -1022,16 +1016,16 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname, static const char *doh_type2name(DNStype dnstype) { switch(dnstype) { - case CURL_DNS_TYPE_A: - return "A"; - case CURL_DNS_TYPE_AAAA: - return "AAAA"; + case CURL_DNS_TYPE_A: + return "A"; + case CURL_DNS_TYPE_AAAA: + return "AAAA"; #ifdef USE_HTTPSRR - case CURL_DNS_TYPE_HTTPS: - return "HTTPS"; + case CURL_DNS_TYPE_HTTPS: + return "HTTPS"; #endif - default: - return "unknown"; + default: + return "unknown"; } } #endif @@ -1174,8 +1168,7 @@ UNITTEST void doh_print_httpsrr(struct Curl_easy *data, struct Curl_https_rrinfo *hrr) { DEBUGASSERT(hrr); - infof(data, "HTTPS RR: priority %d, target: %s", - hrr->priority, hrr->target); + infof(data, "HTTPS RR: priority %d, target: %s", hrr->priority, hrr->target); if(hrr->alpns[0] != ALPN_none) infof(data, "HTTPS RR: alpns %u %u %u %u", hrr->alpns[0], hrr->alpns[1], hrr->alpns[2], hrr->alpns[3]); @@ -1285,7 +1278,7 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, doh_print_httpsrr(data, hrr); # endif dns->hinfo = hrr; - } + } #endif /* and add the entry to the cache */ data->state.async.dns = dns; @@ -1323,8 +1316,7 @@ void Curl_doh_close(struct Curl_easy *data) doh->probe_resp[slot].probe_mid = UINT32_MAX; /* should have been called before data is removed from multi handle */ DEBUGASSERT(data->multi); - probe_data = data->multi ? Curl_multi_get_easy(data->multi, mid) : - NULL; + probe_data = data->multi ? Curl_multi_get_easy(data->multi, mid) : NULL; if(!probe_data) { DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%u not found!", doh->probe_resp[slot].probe_mid)); diff --git a/lib/doh.h b/lib/doh.h index ffd0cb087913..16732173ab67 100644 --- a/lib/doh.h +++ b/lib/doh.h @@ -122,7 +122,7 @@ CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, CURLcode Curl_doh_is_resolved(struct Curl_easy *data, struct Curl_dns_entry **dns); -#define DOH_MAX_ADDR 24 +#define DOH_MAX_ADDR 24 #define DOH_MAX_CNAME 4 #define DOH_MAX_HTTPS 4 @@ -180,8 +180,8 @@ UNITTEST void de_cleanup(struct dohentry *d); #endif #else /* if DoH is disabled */ -#define Curl_doh(a,b,c,d,e) NULL -#define Curl_doh_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST +#define Curl_doh(a, b, c, d, e) NULL +#define Curl_doh_is_resolved(x, y) CURLE_COULDNT_RESOLVE_HOST #endif #endif /* HEADER_CURL_DOH_H */ diff --git a/lib/dynhds.c b/lib/dynhds.c index ebe1beae5856..b6654114d692 100644 --- a/lib/dynhds.c +++ b/lib/dynhds.c @@ -55,9 +55,8 @@ entry_new(const char *name, size_t namelen, return e; } -static struct dynhds_entry * -entry_append(struct dynhds_entry *e, - const char *value, size_t valuelen) +static struct dynhds_entry *entry_append(struct dynhds_entry *e, + const char *value, size_t valuelen) { struct dynhds_entry *e2; size_t valuelen2 = e->valuelen + 1 + valuelen; @@ -171,7 +170,7 @@ CURLcode Curl_dynhds_add(struct dynhds *dynhds, if(dynhds->strs_len + namelen + valuelen > dynhds->max_strs_size) return CURLE_OUT_OF_MEMORY; -entry = entry_new(name, namelen, value, valuelen, dynhds->opts); + entry = entry_new(name, namelen, value, valuelen, dynhds->opts); if(!entry) goto out; @@ -234,11 +233,11 @@ CURLcode Curl_dynhds_h1_add_line(struct dynhds *dynhds, } if(!line_len) return CURLE_BAD_FUNCTION_ARGUMENT; - e = dynhds->hds[dynhds->hds_len-1]; + e = dynhds->hds[dynhds->hds_len - 1]; e2 = entry_append(e, line, line_len); if(!e2) return CURLE_OUT_OF_MEMORY; - dynhds->hds[dynhds->hds_len-1] = e2; + dynhds->hds[dynhds->hds_len - 1] = e2; entry_free(e); return CURLE_OK; } diff --git a/lib/easy.c b/lib/easy.c index c60819fcdc6e..d2f6c36c0d87 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -87,7 +87,7 @@ static long easy_init_flags; #ifdef GLOBAL_INIT_IS_THREADSAFE static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT; -#define global_init_lock() curl_simple_lock_lock(&s_lock) +#define global_init_lock() curl_simple_lock_lock(&s_lock) #define global_init_unlock() curl_simple_lock_unlock(&s_lock) #else @@ -208,7 +208,6 @@ static CURLcode global_init(long flags, bool memoryfuncs) return CURLE_FAILED_INIT; } - /** * curl_global_init() globally initializes curl given a bitwise set of the * different features of what to initialize. @@ -411,7 +410,6 @@ static int events_timer(CURLM *multi, /* multi handle */ return 0; } - /* poll2cselect * * convert from poll() bit definitions to libcurl's CURL_CSELECT_* ones @@ -428,7 +426,6 @@ static int poll2cselect(int pollmask) return omask; } - /* socketcb2poll * * convert from libcurl' CURL_POLL_* bit definitions to poll()'s @@ -485,10 +482,9 @@ static int events_socket(CURL *easy, /* easy handle */ /* The socket 's' is already being monitored, update the activity mask. Convert from libcurl bitmask to the poll one. */ m->socket.events = socketcb2poll(what); - infof(data, "socket cb: socket %" FMT_SOCKET_T - " UPDATED as %s%s", s, - (what&CURL_POLL_IN) ? "IN" : "", - (what&CURL_POLL_OUT) ? "OUT" : ""); + infof(data, "socket cb: socket %" FMT_SOCKET_T " UPDATED as %s%s", s, + (what & CURL_POLL_IN) ? "IN" : "", + (what & CURL_POLL_OUT) ? "OUT" : ""); } break; } @@ -512,8 +508,8 @@ static int events_socket(CURL *easy, /* easy handle */ m->socket.revents = 0; ev->list = m; infof(data, "socket cb: socket %" FMT_SOCKET_T " ADDED as %s%s", s, - (what&CURL_POLL_IN) ? "IN" : "", - (what&CURL_POLL_OUT) ? "OUT" : ""); + (what & CURL_POLL_IN) ? "IN" : "", + (what & CURL_POLL_OUT) ? "OUT" : ""); } else return CURLE_OUT_OF_MEMORY; @@ -523,7 +519,6 @@ static int events_socket(CURL *easy, /* easy handle */ return 0; } - /* * events_setup() * @@ -681,7 +676,6 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) return result; } - /* easy_events() * * Runs a transfer in a blocking manner using the events-based API @@ -690,7 +684,7 @@ static CURLcode easy_events(struct Curl_multi *multi) { /* this struct is made static to allow it to be used after this function returns and curl_multi_remove_handle() is called */ - static struct events evs = {-1, FALSE, 0, NULL, 0}; + static struct events evs = { -1, FALSE, 0, NULL, 0 }; /* if running event-based, do some further multi inits */ events_setup(multi, &evs); @@ -738,7 +732,6 @@ static CURLcode easy_transfer(struct Curl_multi *multi) return result; } - /* * easy_perform() is the internal interface that performs a blocking * transfer as previously setup. @@ -1201,7 +1194,6 @@ CURLcode curl_easy_pause(CURL *d, int action) return result; } - static CURLcode easy_connection(struct Curl_easy *data, struct connectdata **connp) { diff --git a/lib/easy_lock.h b/lib/easy_lock.h index f8998cc5472c..a10fe3103a8d 100644 --- a/lib/easy_lock.h +++ b/lib/easy_lock.h @@ -30,10 +30,10 @@ #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 -#define curl_simple_lock SRWLOCK +#define curl_simple_lock SRWLOCK #define CURL_SIMPLE_LOCK_INIT SRWLOCK_INIT -#define curl_simple_lock_lock(m) AcquireSRWLockExclusive(m) +#define curl_simple_lock_lock(m) AcquireSRWLockExclusive(m) #define curl_simple_lock_unlock(m) ReleaseSRWLockExclusive(m) #elif defined(HAVE_ATOMIC) && defined(HAVE_STDATOMIC_H) @@ -42,7 +42,7 @@ #include #endif -#define curl_simple_lock atomic_int +#define curl_simple_lock atomic_int #define CURL_SIMPLE_LOCK_INIT 0 #ifndef __INTEL_COMPILER @@ -91,14 +91,14 @@ static CURL_INLINE void curl_simple_lock_unlock(curl_simple_lock *lock) #include -#define curl_simple_lock pthread_mutex_t -#define CURL_SIMPLE_LOCK_INIT PTHREAD_MUTEX_INITIALIZER -#define curl_simple_lock_lock(m) pthread_mutex_lock(m) +#define curl_simple_lock pthread_mutex_t +#define CURL_SIMPLE_LOCK_INIT PTHREAD_MUTEX_INITIALIZER +#define curl_simple_lock_lock(m) pthread_mutex_lock(m) #define curl_simple_lock_unlock(m) pthread_mutex_unlock(m) #else -#undef GLOBAL_INIT_IS_THREADSAFE +#undef GLOBAL_INIT_IS_THREADSAFE #endif diff --git a/lib/easyoptions.c b/lib/easyoptions.c index 03d676df0e73..4bd8457f75dd 100644 --- a/lib/easyoptions.c +++ b/lib/easyoptions.c @@ -29,348 +29,352 @@ /* all easy setopt options listed in alphabetical order */ const struct curl_easyoption Curl_easyopts[] = { - {"ABSTRACT_UNIX_SOCKET", CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOT_STRING, 0}, - {"ACCEPTTIMEOUT_MS", CURLOPT_ACCEPTTIMEOUT_MS, CURLOT_LONG, 0}, - {"ACCEPT_ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, 0}, - {"ADDRESS_SCOPE", CURLOPT_ADDRESS_SCOPE, CURLOT_LONG, 0}, - {"ALTSVC", CURLOPT_ALTSVC, CURLOT_STRING, 0}, - {"ALTSVC_CTRL", CURLOPT_ALTSVC_CTRL, CURLOT_LONG, 0}, - {"APPEND", CURLOPT_APPEND, CURLOT_LONG, 0}, - {"AUTOREFERER", CURLOPT_AUTOREFERER, CURLOT_LONG, 0}, - {"AWS_SIGV4", CURLOPT_AWS_SIGV4, CURLOT_STRING, 0}, - {"BUFFERSIZE", CURLOPT_BUFFERSIZE, CURLOT_LONG, 0}, - {"CAINFO", CURLOPT_CAINFO, CURLOT_STRING, 0}, - {"CAINFO_BLOB", CURLOPT_CAINFO_BLOB, CURLOT_BLOB, 0}, - {"CAPATH", CURLOPT_CAPATH, CURLOT_STRING, 0}, - {"CA_CACHE_TIMEOUT", CURLOPT_CA_CACHE_TIMEOUT, CURLOT_LONG, 0}, - {"CERTINFO", CURLOPT_CERTINFO, CURLOT_LONG, 0}, - {"CHUNK_BGN_FUNCTION", CURLOPT_CHUNK_BGN_FUNCTION, CURLOT_FUNCTION, 0}, - {"CHUNK_DATA", CURLOPT_CHUNK_DATA, CURLOT_CBPTR, 0}, - {"CHUNK_END_FUNCTION", CURLOPT_CHUNK_END_FUNCTION, CURLOT_FUNCTION, 0}, - {"CLOSESOCKETDATA", CURLOPT_CLOSESOCKETDATA, CURLOT_CBPTR, 0}, - {"CLOSESOCKETFUNCTION", CURLOPT_CLOSESOCKETFUNCTION, CURLOT_FUNCTION, 0}, - {"CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT, CURLOT_LONG, 0}, - {"CONNECTTIMEOUT_MS", CURLOPT_CONNECTTIMEOUT_MS, CURLOT_LONG, 0}, - {"CONNECT_ONLY", CURLOPT_CONNECT_ONLY, CURLOT_LONG, 0}, - {"CONNECT_TO", CURLOPT_CONNECT_TO, CURLOT_SLIST, 0}, - {"CONV_FROM_NETWORK_FUNCTION", CURLOPT_CONV_FROM_NETWORK_FUNCTION, - CURLOT_FUNCTION, 0}, - {"CONV_FROM_UTF8_FUNCTION", CURLOPT_CONV_FROM_UTF8_FUNCTION, - CURLOT_FUNCTION, 0}, - {"CONV_TO_NETWORK_FUNCTION", CURLOPT_CONV_TO_NETWORK_FUNCTION, - CURLOT_FUNCTION, 0}, - {"COOKIE", CURLOPT_COOKIE, CURLOT_STRING, 0}, - {"COOKIEFILE", CURLOPT_COOKIEFILE, CURLOT_STRING, 0}, - {"COOKIEJAR", CURLOPT_COOKIEJAR, CURLOT_STRING, 0}, - {"COOKIELIST", CURLOPT_COOKIELIST, CURLOT_STRING, 0}, - {"COOKIESESSION", CURLOPT_COOKIESESSION, CURLOT_LONG, 0}, - {"COPYPOSTFIELDS", CURLOPT_COPYPOSTFIELDS, CURLOT_OBJECT, 0}, - {"CRLF", CURLOPT_CRLF, CURLOT_LONG, 0}, - {"CRLFILE", CURLOPT_CRLFILE, CURLOT_STRING, 0}, - {"CURLU", CURLOPT_CURLU, CURLOT_OBJECT, 0}, - {"CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CURLOT_STRING, 0}, - {"DEBUGDATA", CURLOPT_DEBUGDATA, CURLOT_CBPTR, 0}, - {"DEBUGFUNCTION", CURLOPT_DEBUGFUNCTION, CURLOT_FUNCTION, 0}, - {"DEFAULT_PROTOCOL", CURLOPT_DEFAULT_PROTOCOL, CURLOT_STRING, 0}, - {"DIRLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, 0}, - {"DISALLOW_USERNAME_IN_URL", CURLOPT_DISALLOW_USERNAME_IN_URL, - CURLOT_LONG, 0}, - {"DNS_CACHE_TIMEOUT", CURLOPT_DNS_CACHE_TIMEOUT, CURLOT_LONG, 0}, - {"DNS_INTERFACE", CURLOPT_DNS_INTERFACE, CURLOT_STRING, 0}, - {"DNS_LOCAL_IP4", CURLOPT_DNS_LOCAL_IP4, CURLOT_STRING, 0}, - {"DNS_LOCAL_IP6", CURLOPT_DNS_LOCAL_IP6, CURLOT_STRING, 0}, - {"DNS_SERVERS", CURLOPT_DNS_SERVERS, CURLOT_STRING, 0}, - {"DNS_SHUFFLE_ADDRESSES", CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOT_LONG, 0}, - {"DNS_USE_GLOBAL_CACHE", CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOT_LONG, 0}, - {"DOH_SSL_VERIFYHOST", CURLOPT_DOH_SSL_VERIFYHOST, CURLOT_LONG, 0}, - {"DOH_SSL_VERIFYPEER", CURLOPT_DOH_SSL_VERIFYPEER, CURLOT_LONG, 0}, - {"DOH_SSL_VERIFYSTATUS", CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOT_LONG, 0}, - {"DOH_URL", CURLOPT_DOH_URL, CURLOT_STRING, 0}, - {"ECH", CURLOPT_ECH, CURLOT_STRING, 0}, - {"EGDSOCKET", CURLOPT_EGDSOCKET, CURLOT_STRING, 0}, - {"ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, CURLOT_FLAG_ALIAS}, - {"ERRORBUFFER", CURLOPT_ERRORBUFFER, CURLOT_OBJECT, 0}, - {"EXPECT_100_TIMEOUT_MS", CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOT_LONG, 0}, - {"FAILONERROR", CURLOPT_FAILONERROR, CURLOT_LONG, 0}, - {"FILE", CURLOPT_WRITEDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS}, - {"FILETIME", CURLOPT_FILETIME, CURLOT_LONG, 0}, - {"FNMATCH_DATA", CURLOPT_FNMATCH_DATA, CURLOT_CBPTR, 0}, - {"FNMATCH_FUNCTION", CURLOPT_FNMATCH_FUNCTION, CURLOT_FUNCTION, 0}, - {"FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CURLOT_LONG, 0}, - {"FORBID_REUSE", CURLOPT_FORBID_REUSE, CURLOT_LONG, 0}, - {"FRESH_CONNECT", CURLOPT_FRESH_CONNECT, CURLOT_LONG, 0}, - {"FTPAPPEND", CURLOPT_APPEND, CURLOT_LONG, CURLOT_FLAG_ALIAS}, - {"FTPLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, CURLOT_FLAG_ALIAS}, - {"FTPPORT", CURLOPT_FTPPORT, CURLOT_STRING, 0}, - {"FTPSSLAUTH", CURLOPT_FTPSSLAUTH, CURLOT_VALUES, 0}, - {"FTP_ACCOUNT", CURLOPT_FTP_ACCOUNT, CURLOT_STRING, 0}, - {"FTP_ALTERNATIVE_TO_USER", CURLOPT_FTP_ALTERNATIVE_TO_USER, - CURLOT_STRING, 0}, - {"FTP_CREATE_MISSING_DIRS", CURLOPT_FTP_CREATE_MISSING_DIRS, - CURLOT_LONG, 0}, - {"FTP_FILEMETHOD", CURLOPT_FTP_FILEMETHOD, CURLOT_VALUES, 0}, - {"FTP_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT, - CURLOT_LONG, CURLOT_FLAG_ALIAS}, - {"FTP_SKIP_PASV_IP", CURLOPT_FTP_SKIP_PASV_IP, CURLOT_LONG, 0}, - {"FTP_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, CURLOT_FLAG_ALIAS}, - {"FTP_SSL_CCC", CURLOPT_FTP_SSL_CCC, CURLOT_LONG, 0}, - {"FTP_USE_EPRT", CURLOPT_FTP_USE_EPRT, CURLOT_LONG, 0}, - {"FTP_USE_EPSV", CURLOPT_FTP_USE_EPSV, CURLOT_LONG, 0}, - {"FTP_USE_PRET", CURLOPT_FTP_USE_PRET, CURLOT_LONG, 0}, - {"GSSAPI_DELEGATION", CURLOPT_GSSAPI_DELEGATION, CURLOT_VALUES, 0}, - {"HAPPY_EYEBALLS_TIMEOUT_MS", CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, - CURLOT_LONG, 0}, - {"HAPROXYPROTOCOL", CURLOPT_HAPROXYPROTOCOL, CURLOT_LONG, 0}, - {"HAPROXY_CLIENT_IP", CURLOPT_HAPROXY_CLIENT_IP, CURLOT_STRING, 0}, - {"HEADER", CURLOPT_HEADER, CURLOT_LONG, 0}, - {"HEADERDATA", CURLOPT_HEADERDATA, CURLOT_CBPTR, 0}, - {"HEADERFUNCTION", CURLOPT_HEADERFUNCTION, CURLOT_FUNCTION, 0}, - {"HEADEROPT", CURLOPT_HEADEROPT, CURLOT_VALUES, 0}, - {"HSTS", CURLOPT_HSTS, CURLOT_STRING, 0}, - {"HSTSREADDATA", CURLOPT_HSTSREADDATA, CURLOT_CBPTR, 0}, - {"HSTSREADFUNCTION", CURLOPT_HSTSREADFUNCTION, CURLOT_FUNCTION, 0}, - {"HSTSWRITEDATA", CURLOPT_HSTSWRITEDATA, CURLOT_CBPTR, 0}, - {"HSTSWRITEFUNCTION", CURLOPT_HSTSWRITEFUNCTION, CURLOT_FUNCTION, 0}, - {"HSTS_CTRL", CURLOPT_HSTS_CTRL, CURLOT_LONG, 0}, - {"HTTP09_ALLOWED", CURLOPT_HTTP09_ALLOWED, CURLOT_LONG, 0}, - {"HTTP200ALIASES", CURLOPT_HTTP200ALIASES, CURLOT_SLIST, 0}, - {"HTTPAUTH", CURLOPT_HTTPAUTH, CURLOT_VALUES, 0}, - {"HTTPGET", CURLOPT_HTTPGET, CURLOT_LONG, 0}, - {"HTTPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, 0}, - {"HTTPPOST", CURLOPT_HTTPPOST, CURLOT_OBJECT, 0}, - {"HTTPPROXYTUNNEL", CURLOPT_HTTPPROXYTUNNEL, CURLOT_LONG, 0}, - {"HTTP_CONTENT_DECODING", CURLOPT_HTTP_CONTENT_DECODING, CURLOT_LONG, 0}, - {"HTTP_TRANSFER_DECODING", CURLOPT_HTTP_TRANSFER_DECODING, CURLOT_LONG, 0}, - {"HTTP_VERSION", CURLOPT_HTTP_VERSION, CURLOT_VALUES, 0}, - {"IGNORE_CONTENT_LENGTH", CURLOPT_IGNORE_CONTENT_LENGTH, CURLOT_LONG, 0}, - {"INFILE", CURLOPT_READDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS}, - {"INFILESIZE", CURLOPT_INFILESIZE, CURLOT_LONG, 0}, - {"INFILESIZE_LARGE", CURLOPT_INFILESIZE_LARGE, CURLOT_OFF_T, 0}, - {"INTERFACE", CURLOPT_INTERFACE, CURLOT_STRING, 0}, - {"INTERLEAVEDATA", CURLOPT_INTERLEAVEDATA, CURLOT_CBPTR, 0}, - {"INTERLEAVEFUNCTION", CURLOPT_INTERLEAVEFUNCTION, CURLOT_FUNCTION, 0}, - {"IOCTLDATA", CURLOPT_IOCTLDATA, CURLOT_CBPTR, 0}, - {"IOCTLFUNCTION", CURLOPT_IOCTLFUNCTION, CURLOT_FUNCTION, 0}, - {"IPRESOLVE", CURLOPT_IPRESOLVE, CURLOT_VALUES, 0}, - {"ISSUERCERT", CURLOPT_ISSUERCERT, CURLOT_STRING, 0}, - {"ISSUERCERT_BLOB", CURLOPT_ISSUERCERT_BLOB, CURLOT_BLOB, 0}, - {"KEEP_SENDING_ON_ERROR", CURLOPT_KEEP_SENDING_ON_ERROR, CURLOT_LONG, 0}, - {"KEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, 0}, - {"KRB4LEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, CURLOT_FLAG_ALIAS}, - {"KRBLEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, 0}, - {"LOCALPORT", CURLOPT_LOCALPORT, CURLOT_LONG, 0}, - {"LOCALPORTRANGE", CURLOPT_LOCALPORTRANGE, CURLOT_LONG, 0}, - {"LOGIN_OPTIONS", CURLOPT_LOGIN_OPTIONS, CURLOT_STRING, 0}, - {"LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CURLOT_LONG, 0}, - {"LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CURLOT_LONG, 0}, - {"MAIL_AUTH", CURLOPT_MAIL_AUTH, CURLOT_STRING, 0}, - {"MAIL_FROM", CURLOPT_MAIL_FROM, CURLOT_STRING, 0}, - {"MAIL_RCPT", CURLOPT_MAIL_RCPT, CURLOT_SLIST, 0}, - {"MAIL_RCPT_ALLLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS, - CURLOT_LONG, CURLOT_FLAG_ALIAS}, - {"MAIL_RCPT_ALLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOT_LONG, 0}, - {"MAXAGE_CONN", CURLOPT_MAXAGE_CONN, CURLOT_LONG, 0}, - {"MAXCONNECTS", CURLOPT_MAXCONNECTS, CURLOT_LONG, 0}, - {"MAXFILESIZE", CURLOPT_MAXFILESIZE, CURLOT_LONG, 0}, - {"MAXFILESIZE_LARGE", CURLOPT_MAXFILESIZE_LARGE, CURLOT_OFF_T, 0}, - {"MAXLIFETIME_CONN", CURLOPT_MAXLIFETIME_CONN, CURLOT_LONG, 0}, - {"MAXREDIRS", CURLOPT_MAXREDIRS, CURLOT_LONG, 0}, - {"MAX_RECV_SPEED_LARGE", CURLOPT_MAX_RECV_SPEED_LARGE, CURLOT_OFF_T, 0}, - {"MAX_SEND_SPEED_LARGE", CURLOPT_MAX_SEND_SPEED_LARGE, CURLOT_OFF_T, 0}, - {"MIMEPOST", CURLOPT_MIMEPOST, CURLOT_OBJECT, 0}, - {"MIME_OPTIONS", CURLOPT_MIME_OPTIONS, CURLOT_LONG, 0}, - {"NETRC", CURLOPT_NETRC, CURLOT_VALUES, 0}, - {"NETRC_FILE", CURLOPT_NETRC_FILE, CURLOT_STRING, 0}, - {"NEW_DIRECTORY_PERMS", CURLOPT_NEW_DIRECTORY_PERMS, CURLOT_LONG, 0}, - {"NEW_FILE_PERMS", CURLOPT_NEW_FILE_PERMS, CURLOT_LONG, 0}, - {"NOBODY", CURLOPT_NOBODY, CURLOT_LONG, 0}, - {"NOPROGRESS", CURLOPT_NOPROGRESS, CURLOT_LONG, 0}, - {"NOPROXY", CURLOPT_NOPROXY, CURLOT_STRING, 0}, - {"NOSIGNAL", CURLOPT_NOSIGNAL, CURLOT_LONG, 0}, - {"OPENSOCKETDATA", CURLOPT_OPENSOCKETDATA, CURLOT_CBPTR, 0}, - {"OPENSOCKETFUNCTION", CURLOPT_OPENSOCKETFUNCTION, CURLOT_FUNCTION, 0}, - {"PASSWORD", CURLOPT_PASSWORD, CURLOT_STRING, 0}, - {"PATH_AS_IS", CURLOPT_PATH_AS_IS, CURLOT_LONG, 0}, - {"PINNEDPUBLICKEY", CURLOPT_PINNEDPUBLICKEY, CURLOT_STRING, 0}, - {"PIPEWAIT", CURLOPT_PIPEWAIT, CURLOT_LONG, 0}, - {"PORT", CURLOPT_PORT, CURLOT_LONG, 0}, - {"POST", CURLOPT_POST, CURLOT_LONG, 0}, - {"POST301", CURLOPT_POSTREDIR, CURLOT_VALUES, CURLOT_FLAG_ALIAS}, - {"POSTFIELDS", CURLOPT_POSTFIELDS, CURLOT_OBJECT, 0}, - {"POSTFIELDSIZE", CURLOPT_POSTFIELDSIZE, CURLOT_LONG, 0}, - {"POSTFIELDSIZE_LARGE", CURLOPT_POSTFIELDSIZE_LARGE, CURLOT_OFF_T, 0}, - {"POSTQUOTE", CURLOPT_POSTQUOTE, CURLOT_SLIST, 0}, - {"POSTREDIR", CURLOPT_POSTREDIR, CURLOT_VALUES, 0}, - {"PREQUOTE", CURLOPT_PREQUOTE, CURLOT_SLIST, 0}, - {"PREREQDATA", CURLOPT_PREREQDATA, CURLOT_CBPTR, 0}, - {"PREREQFUNCTION", CURLOPT_PREREQFUNCTION, CURLOT_FUNCTION, 0}, - {"PRE_PROXY", CURLOPT_PRE_PROXY, CURLOT_STRING, 0}, - {"PRIVATE", CURLOPT_PRIVATE, CURLOT_OBJECT, 0}, - {"PROGRESSDATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS}, - {"PROGRESSFUNCTION", CURLOPT_PROGRESSFUNCTION, CURLOT_FUNCTION, 0}, - {"PROTOCOLS", CURLOPT_PROTOCOLS, CURLOT_LONG, 0}, - {"PROTOCOLS_STR", CURLOPT_PROTOCOLS_STR, CURLOT_STRING, 0}, - {"PROXY", CURLOPT_PROXY, CURLOT_STRING, 0}, - {"PROXYAUTH", CURLOPT_PROXYAUTH, CURLOT_VALUES, 0}, - {"PROXYHEADER", CURLOPT_PROXYHEADER, CURLOT_SLIST, 0}, - {"PROXYPASSWORD", CURLOPT_PROXYPASSWORD, CURLOT_STRING, 0}, - {"PROXYPORT", CURLOPT_PROXYPORT, CURLOT_LONG, 0}, - {"PROXYTYPE", CURLOPT_PROXYTYPE, CURLOT_VALUES, 0}, - {"PROXYUSERNAME", CURLOPT_PROXYUSERNAME, CURLOT_STRING, 0}, - {"PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CURLOT_STRING, 0}, - {"PROXY_CAINFO", CURLOPT_PROXY_CAINFO, CURLOT_STRING, 0}, - {"PROXY_CAINFO_BLOB", CURLOPT_PROXY_CAINFO_BLOB, CURLOT_BLOB, 0}, - {"PROXY_CAPATH", CURLOPT_PROXY_CAPATH, CURLOT_STRING, 0}, - {"PROXY_CRLFILE", CURLOPT_PROXY_CRLFILE, CURLOT_STRING, 0}, - {"PROXY_ISSUERCERT", CURLOPT_PROXY_ISSUERCERT, CURLOT_STRING, 0}, - {"PROXY_ISSUERCERT_BLOB", CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOT_BLOB, 0}, - {"PROXY_KEYPASSWD", CURLOPT_PROXY_KEYPASSWD, CURLOT_STRING, 0}, - {"PROXY_PINNEDPUBLICKEY", CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOT_STRING, 0}, - {"PROXY_SERVICE_NAME", CURLOPT_PROXY_SERVICE_NAME, CURLOT_STRING, 0}, - {"PROXY_SSLCERT", CURLOPT_PROXY_SSLCERT, CURLOT_STRING, 0}, - {"PROXY_SSLCERTTYPE", CURLOPT_PROXY_SSLCERTTYPE, CURLOT_STRING, 0}, - {"PROXY_SSLCERT_BLOB", CURLOPT_PROXY_SSLCERT_BLOB, CURLOT_BLOB, 0}, - {"PROXY_SSLKEY", CURLOPT_PROXY_SSLKEY, CURLOT_STRING, 0}, - {"PROXY_SSLKEYTYPE", CURLOPT_PROXY_SSLKEYTYPE, CURLOT_STRING, 0}, - {"PROXY_SSLKEY_BLOB", CURLOPT_PROXY_SSLKEY_BLOB, CURLOT_BLOB, 0}, - {"PROXY_SSLVERSION", CURLOPT_PROXY_SSLVERSION, CURLOT_VALUES, 0}, - {"PROXY_SSL_CIPHER_LIST", CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOT_STRING, 0}, - {"PROXY_SSL_OPTIONS", CURLOPT_PROXY_SSL_OPTIONS, CURLOT_LONG, 0}, - {"PROXY_SSL_VERIFYHOST", CURLOPT_PROXY_SSL_VERIFYHOST, CURLOT_LONG, 0}, - {"PROXY_SSL_VERIFYPEER", CURLOPT_PROXY_SSL_VERIFYPEER, CURLOT_LONG, 0}, - {"PROXY_TLS13_CIPHERS", CURLOPT_PROXY_TLS13_CIPHERS, CURLOT_STRING, 0}, - {"PROXY_TLSAUTH_PASSWORD", CURLOPT_PROXY_TLSAUTH_PASSWORD, - CURLOT_STRING, 0}, - {"PROXY_TLSAUTH_TYPE", CURLOPT_PROXY_TLSAUTH_TYPE, CURLOT_STRING, 0}, - {"PROXY_TLSAUTH_USERNAME", CURLOPT_PROXY_TLSAUTH_USERNAME, - CURLOT_STRING, 0}, - {"PROXY_TRANSFER_MODE", CURLOPT_PROXY_TRANSFER_MODE, CURLOT_LONG, 0}, - {"PUT", CURLOPT_PUT, CURLOT_LONG, 0}, - {"QUICK_EXIT", CURLOPT_QUICK_EXIT, CURLOT_LONG, 0}, - {"QUOTE", CURLOPT_QUOTE, CURLOT_SLIST, 0}, - {"RANDOM_FILE", CURLOPT_RANDOM_FILE, CURLOT_STRING, 0}, - {"RANGE", CURLOPT_RANGE, CURLOT_STRING, 0}, - {"READDATA", CURLOPT_READDATA, CURLOT_CBPTR, 0}, - {"READFUNCTION", CURLOPT_READFUNCTION, CURLOT_FUNCTION, 0}, - {"REDIR_PROTOCOLS", CURLOPT_REDIR_PROTOCOLS, CURLOT_LONG, 0}, - {"REDIR_PROTOCOLS_STR", CURLOPT_REDIR_PROTOCOLS_STR, CURLOT_STRING, 0}, - {"REFERER", CURLOPT_REFERER, CURLOT_STRING, 0}, - {"REQUEST_TARGET", CURLOPT_REQUEST_TARGET, CURLOT_STRING, 0}, - {"RESOLVE", CURLOPT_RESOLVE, CURLOT_SLIST, 0}, - {"RESOLVER_START_DATA", CURLOPT_RESOLVER_START_DATA, CURLOT_CBPTR, 0}, - {"RESOLVER_START_FUNCTION", CURLOPT_RESOLVER_START_FUNCTION, - CURLOT_FUNCTION, 0}, - {"RESUME_FROM", CURLOPT_RESUME_FROM, CURLOT_LONG, 0}, - {"RESUME_FROM_LARGE", CURLOPT_RESUME_FROM_LARGE, CURLOT_OFF_T, 0}, - {"RTSPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, CURLOT_FLAG_ALIAS}, - {"RTSP_CLIENT_CSEQ", CURLOPT_RTSP_CLIENT_CSEQ, CURLOT_LONG, 0}, - {"RTSP_REQUEST", CURLOPT_RTSP_REQUEST, CURLOT_VALUES, 0}, - {"RTSP_SERVER_CSEQ", CURLOPT_RTSP_SERVER_CSEQ, CURLOT_LONG, 0}, - {"RTSP_SESSION_ID", CURLOPT_RTSP_SESSION_ID, CURLOT_STRING, 0}, - {"RTSP_STREAM_URI", CURLOPT_RTSP_STREAM_URI, CURLOT_STRING, 0}, - {"RTSP_TRANSPORT", CURLOPT_RTSP_TRANSPORT, CURLOT_STRING, 0}, - {"SASL_AUTHZID", CURLOPT_SASL_AUTHZID, CURLOT_STRING, 0}, - {"SASL_IR", CURLOPT_SASL_IR, CURLOT_LONG, 0}, - {"SEEKDATA", CURLOPT_SEEKDATA, CURLOT_CBPTR, 0}, - {"SEEKFUNCTION", CURLOPT_SEEKFUNCTION, CURLOT_FUNCTION, 0}, - {"SERVER_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT, - CURLOT_LONG, 0}, - {"SERVER_RESPONSE_TIMEOUT_MS", CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, - CURLOT_LONG, 0}, - {"SERVICE_NAME", CURLOPT_SERVICE_NAME, CURLOT_STRING, 0}, - {"SHARE", CURLOPT_SHARE, CURLOT_OBJECT, 0}, - {"SOCKOPTDATA", CURLOPT_SOCKOPTDATA, CURLOT_CBPTR, 0}, - {"SOCKOPTFUNCTION", CURLOPT_SOCKOPTFUNCTION, CURLOT_FUNCTION, 0}, - {"SOCKS5_AUTH", CURLOPT_SOCKS5_AUTH, CURLOT_LONG, 0}, - {"SOCKS5_GSSAPI_NEC", CURLOPT_SOCKS5_GSSAPI_NEC, CURLOT_LONG, 0}, - {"SOCKS5_GSSAPI_SERVICE", CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOT_STRING, 0}, - {"SSH_AUTH_TYPES", CURLOPT_SSH_AUTH_TYPES, CURLOT_VALUES, 0}, - {"SSH_COMPRESSION", CURLOPT_SSH_COMPRESSION, CURLOT_LONG, 0}, - {"SSH_HOSTKEYDATA", CURLOPT_SSH_HOSTKEYDATA, CURLOT_CBPTR, 0}, - {"SSH_HOSTKEYFUNCTION", CURLOPT_SSH_HOSTKEYFUNCTION, CURLOT_FUNCTION, 0}, - {"SSH_HOST_PUBLIC_KEY_MD5", CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, - CURLOT_STRING, 0}, - {"SSH_HOST_PUBLIC_KEY_SHA256", CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, - CURLOT_STRING, 0}, - {"SSH_KEYDATA", CURLOPT_SSH_KEYDATA, CURLOT_CBPTR, 0}, - {"SSH_KEYFUNCTION", CURLOPT_SSH_KEYFUNCTION, CURLOT_FUNCTION, 0}, - {"SSH_KNOWNHOSTS", CURLOPT_SSH_KNOWNHOSTS, CURLOT_STRING, 0}, - {"SSH_PRIVATE_KEYFILE", CURLOPT_SSH_PRIVATE_KEYFILE, CURLOT_STRING, 0}, - {"SSH_PUBLIC_KEYFILE", CURLOPT_SSH_PUBLIC_KEYFILE, CURLOT_STRING, 0}, - {"SSLCERT", CURLOPT_SSLCERT, CURLOT_STRING, 0}, - {"SSLCERTPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS}, - {"SSLCERTTYPE", CURLOPT_SSLCERTTYPE, CURLOT_STRING, 0}, - {"SSLCERT_BLOB", CURLOPT_SSLCERT_BLOB, CURLOT_BLOB, 0}, - {"SSLENGINE", CURLOPT_SSLENGINE, CURLOT_STRING, 0}, - {"SSLENGINE_DEFAULT", CURLOPT_SSLENGINE_DEFAULT, CURLOT_LONG, 0}, - {"SSLKEY", CURLOPT_SSLKEY, CURLOT_STRING, 0}, - {"SSLKEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS}, - {"SSLKEYTYPE", CURLOPT_SSLKEYTYPE, CURLOT_STRING, 0}, - {"SSLKEY_BLOB", CURLOPT_SSLKEY_BLOB, CURLOT_BLOB, 0}, - {"SSLVERSION", CURLOPT_SSLVERSION, CURLOT_VALUES, 0}, - {"SSL_CIPHER_LIST", CURLOPT_SSL_CIPHER_LIST, CURLOT_STRING, 0}, - {"SSL_CTX_DATA", CURLOPT_SSL_CTX_DATA, CURLOT_CBPTR, 0}, - {"SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, CURLOT_FUNCTION, 0}, - {"SSL_EC_CURVES", CURLOPT_SSL_EC_CURVES, CURLOT_STRING, 0}, - {"SSL_ENABLE_ALPN", CURLOPT_SSL_ENABLE_ALPN, CURLOT_LONG, 0}, - {"SSL_ENABLE_NPN", CURLOPT_SSL_ENABLE_NPN, CURLOT_LONG, 0}, - {"SSL_FALSESTART", CURLOPT_SSL_FALSESTART, CURLOT_LONG, 0}, - {"SSL_OPTIONS", CURLOPT_SSL_OPTIONS, CURLOT_VALUES, 0}, - {"SSL_SESSIONID_CACHE", CURLOPT_SSL_SESSIONID_CACHE, CURLOT_LONG, 0}, - {"SSL_SIGNATURE_ALGORITHMS", CURLOPT_SSL_SIGNATURE_ALGORITHMS, - CURLOT_STRING, 0}, - {"SSL_VERIFYHOST", CURLOPT_SSL_VERIFYHOST, CURLOT_LONG, 0}, - {"SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER, CURLOT_LONG, 0}, - {"SSL_VERIFYSTATUS", CURLOPT_SSL_VERIFYSTATUS, CURLOT_LONG, 0}, - {"STDERR", CURLOPT_STDERR, CURLOT_OBJECT, 0}, - {"STREAM_DEPENDS", CURLOPT_STREAM_DEPENDS, CURLOT_OBJECT, 0}, - {"STREAM_DEPENDS_E", CURLOPT_STREAM_DEPENDS_E, CURLOT_OBJECT, 0}, - {"STREAM_WEIGHT", CURLOPT_STREAM_WEIGHT, CURLOT_LONG, 0}, - {"SUPPRESS_CONNECT_HEADERS", CURLOPT_SUPPRESS_CONNECT_HEADERS, - CURLOT_LONG, 0}, - {"TCP_FASTOPEN", CURLOPT_TCP_FASTOPEN, CURLOT_LONG, 0}, - {"TCP_KEEPALIVE", CURLOPT_TCP_KEEPALIVE, CURLOT_LONG, 0}, - {"TCP_KEEPCNT", CURLOPT_TCP_KEEPCNT, CURLOT_LONG, 0}, - {"TCP_KEEPIDLE", CURLOPT_TCP_KEEPIDLE, CURLOT_LONG, 0}, - {"TCP_KEEPINTVL", CURLOPT_TCP_KEEPINTVL, CURLOT_LONG, 0}, - {"TCP_NODELAY", CURLOPT_TCP_NODELAY, CURLOT_LONG, 0}, - {"TELNETOPTIONS", CURLOPT_TELNETOPTIONS, CURLOT_SLIST, 0}, - {"TFTP_BLKSIZE", CURLOPT_TFTP_BLKSIZE, CURLOT_LONG, 0}, - {"TFTP_NO_OPTIONS", CURLOPT_TFTP_NO_OPTIONS, CURLOT_LONG, 0}, - {"TIMECONDITION", CURLOPT_TIMECONDITION, CURLOT_VALUES, 0}, - {"TIMEOUT", CURLOPT_TIMEOUT, CURLOT_LONG, 0}, - {"TIMEOUT_MS", CURLOPT_TIMEOUT_MS, CURLOT_LONG, 0}, - {"TIMEVALUE", CURLOPT_TIMEVALUE, CURLOT_LONG, 0}, - {"TIMEVALUE_LARGE", CURLOPT_TIMEVALUE_LARGE, CURLOT_OFF_T, 0}, - {"TLS13_CIPHERS", CURLOPT_TLS13_CIPHERS, CURLOT_STRING, 0}, - {"TLSAUTH_PASSWORD", CURLOPT_TLSAUTH_PASSWORD, CURLOT_STRING, 0}, - {"TLSAUTH_TYPE", CURLOPT_TLSAUTH_TYPE, CURLOT_STRING, 0}, - {"TLSAUTH_USERNAME", CURLOPT_TLSAUTH_USERNAME, CURLOT_STRING, 0}, - {"TRAILERDATA", CURLOPT_TRAILERDATA, CURLOT_CBPTR, 0}, - {"TRAILERFUNCTION", CURLOPT_TRAILERFUNCTION, CURLOT_FUNCTION, 0}, - {"TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CURLOT_LONG, 0}, - {"TRANSFER_ENCODING", CURLOPT_TRANSFER_ENCODING, CURLOT_LONG, 0}, - {"UNIX_SOCKET_PATH", CURLOPT_UNIX_SOCKET_PATH, CURLOT_STRING, 0}, - {"UNRESTRICTED_AUTH", CURLOPT_UNRESTRICTED_AUTH, CURLOT_LONG, 0}, - {"UPKEEP_INTERVAL_MS", CURLOPT_UPKEEP_INTERVAL_MS, CURLOT_LONG, 0}, - {"UPLOAD", CURLOPT_UPLOAD, CURLOT_LONG, 0}, - {"UPLOAD_BUFFERSIZE", CURLOPT_UPLOAD_BUFFERSIZE, CURLOT_LONG, 0}, - {"UPLOAD_FLAGS", CURLOPT_UPLOAD_FLAGS, CURLOT_LONG, 0}, - {"URL", CURLOPT_URL, CURLOT_STRING, 0}, - {"USERAGENT", CURLOPT_USERAGENT, CURLOT_STRING, 0}, - {"USERNAME", CURLOPT_USERNAME, CURLOT_STRING, 0}, - {"USERPWD", CURLOPT_USERPWD, CURLOT_STRING, 0}, - {"USE_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, 0}, - {"VERBOSE", CURLOPT_VERBOSE, CURLOT_LONG, 0}, - {"WILDCARDMATCH", CURLOPT_WILDCARDMATCH, CURLOT_LONG, 0}, - {"WRITEDATA", CURLOPT_WRITEDATA, CURLOT_CBPTR, 0}, - {"WRITEFUNCTION", CURLOPT_WRITEFUNCTION, CURLOT_FUNCTION, 0}, - {"WRITEHEADER", CURLOPT_HEADERDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS}, - {"WS_OPTIONS", CURLOPT_WS_OPTIONS, CURLOT_LONG, 0}, - {"XFERINFODATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, 0}, - {"XFERINFOFUNCTION", CURLOPT_XFERINFOFUNCTION, CURLOT_FUNCTION, 0}, - {"XOAUTH2_BEARER", CURLOPT_XOAUTH2_BEARER, CURLOT_STRING, 0}, - {NULL, CURLOPT_LASTENTRY, CURLOT_LONG, 0} /* end of table */ + { "ABSTRACT_UNIX_SOCKET", CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOT_STRING, 0 }, + { "ACCEPTTIMEOUT_MS", CURLOPT_ACCEPTTIMEOUT_MS, CURLOT_LONG, 0 }, + { "ACCEPT_ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, 0 }, + { "ADDRESS_SCOPE", CURLOPT_ADDRESS_SCOPE, CURLOT_LONG, 0 }, + { "ALTSVC", CURLOPT_ALTSVC, CURLOT_STRING, 0 }, + { "ALTSVC_CTRL", CURLOPT_ALTSVC_CTRL, CURLOT_LONG, 0 }, + { "APPEND", CURLOPT_APPEND, CURLOT_LONG, 0 }, + { "AUTOREFERER", CURLOPT_AUTOREFERER, CURLOT_LONG, 0 }, + { "AWS_SIGV4", CURLOPT_AWS_SIGV4, CURLOT_STRING, 0 }, + { "BUFFERSIZE", CURLOPT_BUFFERSIZE, CURLOT_LONG, 0 }, + { "CAINFO", CURLOPT_CAINFO, CURLOT_STRING, 0 }, + { "CAINFO_BLOB", CURLOPT_CAINFO_BLOB, CURLOT_BLOB, 0 }, + { "CAPATH", CURLOPT_CAPATH, CURLOT_STRING, 0 }, + { "CA_CACHE_TIMEOUT", CURLOPT_CA_CACHE_TIMEOUT, CURLOT_LONG, 0 }, + { "CERTINFO", CURLOPT_CERTINFO, CURLOT_LONG, 0 }, + { "CHUNK_BGN_FUNCTION", CURLOPT_CHUNK_BGN_FUNCTION, CURLOT_FUNCTION, 0 }, + { "CHUNK_DATA", CURLOPT_CHUNK_DATA, CURLOT_CBPTR, 0 }, + { "CHUNK_END_FUNCTION", CURLOPT_CHUNK_END_FUNCTION, CURLOT_FUNCTION, 0 }, + { "CLOSESOCKETDATA", CURLOPT_CLOSESOCKETDATA, CURLOT_CBPTR, 0 }, + { "CLOSESOCKETFUNCTION", CURLOPT_CLOSESOCKETFUNCTION, CURLOT_FUNCTION, 0 }, + { "CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT, CURLOT_LONG, 0 }, + { "CONNECTTIMEOUT_MS", CURLOPT_CONNECTTIMEOUT_MS, CURLOT_LONG, 0 }, + { "CONNECT_ONLY", CURLOPT_CONNECT_ONLY, CURLOT_LONG, 0 }, + { "CONNECT_TO", CURLOPT_CONNECT_TO, CURLOT_SLIST, 0 }, + { "CONV_FROM_NETWORK_FUNCTION", CURLOPT_CONV_FROM_NETWORK_FUNCTION, + CURLOT_FUNCTION, 0 }, + { "CONV_FROM_UTF8_FUNCTION", CURLOPT_CONV_FROM_UTF8_FUNCTION, + CURLOT_FUNCTION, 0 }, + { "CONV_TO_NETWORK_FUNCTION", CURLOPT_CONV_TO_NETWORK_FUNCTION, + CURLOT_FUNCTION, 0 }, + { "COOKIE", CURLOPT_COOKIE, CURLOT_STRING, 0 }, + { "COOKIEFILE", CURLOPT_COOKIEFILE, CURLOT_STRING, 0 }, + { "COOKIEJAR", CURLOPT_COOKIEJAR, CURLOT_STRING, 0 }, + { "COOKIELIST", CURLOPT_COOKIELIST, CURLOT_STRING, 0 }, + { "COOKIESESSION", CURLOPT_COOKIESESSION, CURLOT_LONG, 0 }, + { "COPYPOSTFIELDS", CURLOPT_COPYPOSTFIELDS, CURLOT_OBJECT, 0 }, + { "CRLF", CURLOPT_CRLF, CURLOT_LONG, 0 }, + { "CRLFILE", CURLOPT_CRLFILE, CURLOT_STRING, 0 }, + { "CURLU", CURLOPT_CURLU, CURLOT_OBJECT, 0 }, + { "CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CURLOT_STRING, 0 }, + { "DEBUGDATA", CURLOPT_DEBUGDATA, CURLOT_CBPTR, 0 }, + { "DEBUGFUNCTION", CURLOPT_DEBUGFUNCTION, CURLOT_FUNCTION, 0 }, + { "DEFAULT_PROTOCOL", CURLOPT_DEFAULT_PROTOCOL, CURLOT_STRING, 0 }, + { "DIRLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, 0 }, + { "DISALLOW_USERNAME_IN_URL", CURLOPT_DISALLOW_USERNAME_IN_URL, + CURLOT_LONG, 0 }, + { "DNS_CACHE_TIMEOUT", CURLOPT_DNS_CACHE_TIMEOUT, CURLOT_LONG, 0 }, + { "DNS_INTERFACE", CURLOPT_DNS_INTERFACE, CURLOT_STRING, 0 }, + { "DNS_LOCAL_IP4", CURLOPT_DNS_LOCAL_IP4, CURLOT_STRING, 0 }, + { "DNS_LOCAL_IP6", CURLOPT_DNS_LOCAL_IP6, CURLOT_STRING, 0 }, + { "DNS_SERVERS", CURLOPT_DNS_SERVERS, CURLOT_STRING, 0 }, + { "DNS_SHUFFLE_ADDRESSES", CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOT_LONG, 0 }, + { "DNS_USE_GLOBAL_CACHE", CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOT_LONG, 0 }, + { "DOH_SSL_VERIFYHOST", CURLOPT_DOH_SSL_VERIFYHOST, CURLOT_LONG, 0 }, + { "DOH_SSL_VERIFYPEER", CURLOPT_DOH_SSL_VERIFYPEER, CURLOT_LONG, 0 }, + { "DOH_SSL_VERIFYSTATUS", CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOT_LONG, 0 }, + { "DOH_URL", CURLOPT_DOH_URL, CURLOT_STRING, 0 }, + { "ECH", CURLOPT_ECH, CURLOT_STRING, 0 }, + { "EGDSOCKET", CURLOPT_EGDSOCKET, CURLOT_STRING, 0 }, + { "ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, CURLOT_FLAG_ALIAS }, + { "ERRORBUFFER", CURLOPT_ERRORBUFFER, CURLOT_OBJECT, 0 }, + { "EXPECT_100_TIMEOUT_MS", CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOT_LONG, 0 }, + { "FAILONERROR", CURLOPT_FAILONERROR, CURLOT_LONG, 0 }, + { "FILE", CURLOPT_WRITEDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS }, + { "FILETIME", CURLOPT_FILETIME, CURLOT_LONG, 0 }, + { "FNMATCH_DATA", CURLOPT_FNMATCH_DATA, CURLOT_CBPTR, 0 }, + { "FNMATCH_FUNCTION", CURLOPT_FNMATCH_FUNCTION, CURLOT_FUNCTION, 0 }, + { "FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CURLOT_LONG, 0 }, + { "FORBID_REUSE", CURLOPT_FORBID_REUSE, CURLOT_LONG, 0 }, + { "FRESH_CONNECT", CURLOPT_FRESH_CONNECT, CURLOT_LONG, 0 }, + { "FTPAPPEND", CURLOPT_APPEND, CURLOT_LONG, CURLOT_FLAG_ALIAS }, + { "FTPLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, CURLOT_FLAG_ALIAS }, + { "FTPPORT", CURLOPT_FTPPORT, CURLOT_STRING, 0 }, + { "FTPSSLAUTH", CURLOPT_FTPSSLAUTH, CURLOT_VALUES, 0 }, + { "FTP_ACCOUNT", CURLOPT_FTP_ACCOUNT, CURLOT_STRING, 0 }, + { "FTP_ALTERNATIVE_TO_USER", CURLOPT_FTP_ALTERNATIVE_TO_USER, + CURLOT_STRING, 0 }, + { "FTP_CREATE_MISSING_DIRS", CURLOPT_FTP_CREATE_MISSING_DIRS, + CURLOT_LONG, 0 }, + { "FTP_FILEMETHOD", CURLOPT_FTP_FILEMETHOD, CURLOT_VALUES, 0 }, + { "FTP_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT, + CURLOT_LONG, CURLOT_FLAG_ALIAS }, + { "FTP_SKIP_PASV_IP", CURLOPT_FTP_SKIP_PASV_IP, CURLOT_LONG, 0 }, + { "FTP_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, CURLOT_FLAG_ALIAS }, + { "FTP_SSL_CCC", CURLOPT_FTP_SSL_CCC, CURLOT_LONG, 0 }, + { "FTP_USE_EPRT", CURLOPT_FTP_USE_EPRT, CURLOT_LONG, 0 }, + { "FTP_USE_EPSV", CURLOPT_FTP_USE_EPSV, CURLOT_LONG, 0 }, + { "FTP_USE_PRET", CURLOPT_FTP_USE_PRET, CURLOT_LONG, 0 }, + { "GSSAPI_DELEGATION", CURLOPT_GSSAPI_DELEGATION, CURLOT_VALUES, 0 }, + { "HAPPY_EYEBALLS_TIMEOUT_MS", CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, + CURLOT_LONG, 0 }, + { "HAPROXYPROTOCOL", CURLOPT_HAPROXYPROTOCOL, CURLOT_LONG, 0 }, + { "HAPROXY_CLIENT_IP", CURLOPT_HAPROXY_CLIENT_IP, CURLOT_STRING, 0 }, + { "HEADER", CURLOPT_HEADER, CURLOT_LONG, 0 }, + { "HEADERDATA", CURLOPT_HEADERDATA, CURLOT_CBPTR, 0 }, + { "HEADERFUNCTION", CURLOPT_HEADERFUNCTION, CURLOT_FUNCTION, 0 }, + { "HEADEROPT", CURLOPT_HEADEROPT, CURLOT_VALUES, 0 }, + { "HSTS", CURLOPT_HSTS, CURLOT_STRING, 0 }, + { "HSTSREADDATA", CURLOPT_HSTSREADDATA, CURLOT_CBPTR, 0 }, + { "HSTSREADFUNCTION", CURLOPT_HSTSREADFUNCTION, CURLOT_FUNCTION, 0 }, + { "HSTSWRITEDATA", CURLOPT_HSTSWRITEDATA, CURLOT_CBPTR, 0 }, + { "HSTSWRITEFUNCTION", CURLOPT_HSTSWRITEFUNCTION, CURLOT_FUNCTION, 0 }, + { "HSTS_CTRL", CURLOPT_HSTS_CTRL, CURLOT_LONG, 0 }, + { "HTTP09_ALLOWED", CURLOPT_HTTP09_ALLOWED, CURLOT_LONG, 0 }, + { "HTTP200ALIASES", CURLOPT_HTTP200ALIASES, CURLOT_SLIST, 0 }, + { "HTTPAUTH", CURLOPT_HTTPAUTH, CURLOT_VALUES, 0 }, + { "HTTPGET", CURLOPT_HTTPGET, CURLOT_LONG, 0 }, + { "HTTPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, 0 }, + { "HTTPPOST", CURLOPT_HTTPPOST, CURLOT_OBJECT, 0 }, + { "HTTPPROXYTUNNEL", CURLOPT_HTTPPROXYTUNNEL, CURLOT_LONG, 0 }, + { "HTTP_CONTENT_DECODING", CURLOPT_HTTP_CONTENT_DECODING, CURLOT_LONG, 0 }, + { "HTTP_TRANSFER_DECODING", CURLOPT_HTTP_TRANSFER_DECODING, + CURLOT_LONG, 0 }, + { "HTTP_VERSION", CURLOPT_HTTP_VERSION, CURLOT_VALUES, 0 }, + { "IGNORE_CONTENT_LENGTH", CURLOPT_IGNORE_CONTENT_LENGTH, CURLOT_LONG, 0 }, + { "INFILE", CURLOPT_READDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS }, + { "INFILESIZE", CURLOPT_INFILESIZE, CURLOT_LONG, 0 }, + { "INFILESIZE_LARGE", CURLOPT_INFILESIZE_LARGE, CURLOT_OFF_T, 0 }, + { "INTERFACE", CURLOPT_INTERFACE, CURLOT_STRING, 0 }, + { "INTERLEAVEDATA", CURLOPT_INTERLEAVEDATA, CURLOT_CBPTR, 0 }, + { "INTERLEAVEFUNCTION", CURLOPT_INTERLEAVEFUNCTION, CURLOT_FUNCTION, 0 }, + { "IOCTLDATA", CURLOPT_IOCTLDATA, CURLOT_CBPTR, 0 }, + { "IOCTLFUNCTION", CURLOPT_IOCTLFUNCTION, CURLOT_FUNCTION, 0 }, + { "IPRESOLVE", CURLOPT_IPRESOLVE, CURLOT_VALUES, 0 }, + { "ISSUERCERT", CURLOPT_ISSUERCERT, CURLOT_STRING, 0 }, + { "ISSUERCERT_BLOB", CURLOPT_ISSUERCERT_BLOB, CURLOT_BLOB, 0 }, + { "KEEP_SENDING_ON_ERROR", CURLOPT_KEEP_SENDING_ON_ERROR, CURLOT_LONG, 0 }, + { "KEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, 0 }, + { "KRB4LEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, CURLOT_FLAG_ALIAS }, + { "KRBLEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, 0 }, + { "LOCALPORT", CURLOPT_LOCALPORT, CURLOT_LONG, 0 }, + { "LOCALPORTRANGE", CURLOPT_LOCALPORTRANGE, CURLOT_LONG, 0 }, + { "LOGIN_OPTIONS", CURLOPT_LOGIN_OPTIONS, CURLOT_STRING, 0 }, + { "LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CURLOT_LONG, 0 }, + { "LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CURLOT_LONG, 0 }, + { "MAIL_AUTH", CURLOPT_MAIL_AUTH, CURLOT_STRING, 0 }, + { "MAIL_FROM", CURLOPT_MAIL_FROM, CURLOT_STRING, 0 }, + { "MAIL_RCPT", CURLOPT_MAIL_RCPT, CURLOT_SLIST, 0 }, + { "MAIL_RCPT_ALLLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS, + CURLOT_LONG, CURLOT_FLAG_ALIAS }, + { "MAIL_RCPT_ALLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOT_LONG, 0 }, + { "MAXAGE_CONN", CURLOPT_MAXAGE_CONN, CURLOT_LONG, 0 }, + { "MAXCONNECTS", CURLOPT_MAXCONNECTS, CURLOT_LONG, 0 }, + { "MAXFILESIZE", CURLOPT_MAXFILESIZE, CURLOT_LONG, 0 }, + { "MAXFILESIZE_LARGE", CURLOPT_MAXFILESIZE_LARGE, CURLOT_OFF_T, 0 }, + { "MAXLIFETIME_CONN", CURLOPT_MAXLIFETIME_CONN, CURLOT_LONG, 0 }, + { "MAXREDIRS", CURLOPT_MAXREDIRS, CURLOT_LONG, 0 }, + { "MAX_RECV_SPEED_LARGE", CURLOPT_MAX_RECV_SPEED_LARGE, CURLOT_OFF_T, 0 }, + { "MAX_SEND_SPEED_LARGE", CURLOPT_MAX_SEND_SPEED_LARGE, CURLOT_OFF_T, 0 }, + { "MIMEPOST", CURLOPT_MIMEPOST, CURLOT_OBJECT, 0 }, + { "MIME_OPTIONS", CURLOPT_MIME_OPTIONS, CURLOT_LONG, 0 }, + { "NETRC", CURLOPT_NETRC, CURLOT_VALUES, 0 }, + { "NETRC_FILE", CURLOPT_NETRC_FILE, CURLOT_STRING, 0 }, + { "NEW_DIRECTORY_PERMS", CURLOPT_NEW_DIRECTORY_PERMS, CURLOT_LONG, 0 }, + { "NEW_FILE_PERMS", CURLOPT_NEW_FILE_PERMS, CURLOT_LONG, 0 }, + { "NOBODY", CURLOPT_NOBODY, CURLOT_LONG, 0 }, + { "NOPROGRESS", CURLOPT_NOPROGRESS, CURLOT_LONG, 0 }, + { "NOPROXY", CURLOPT_NOPROXY, CURLOT_STRING, 0 }, + { "NOSIGNAL", CURLOPT_NOSIGNAL, CURLOT_LONG, 0 }, + { "OPENSOCKETDATA", CURLOPT_OPENSOCKETDATA, CURLOT_CBPTR, 0 }, + { "OPENSOCKETFUNCTION", CURLOPT_OPENSOCKETFUNCTION, CURLOT_FUNCTION, 0 }, + { "PASSWORD", CURLOPT_PASSWORD, CURLOT_STRING, 0 }, + { "PATH_AS_IS", CURLOPT_PATH_AS_IS, CURLOT_LONG, 0 }, + { "PINNEDPUBLICKEY", CURLOPT_PINNEDPUBLICKEY, CURLOT_STRING, 0 }, + { "PIPEWAIT", CURLOPT_PIPEWAIT, CURLOT_LONG, 0 }, + { "PORT", CURLOPT_PORT, CURLOT_LONG, 0 }, + { "POST", CURLOPT_POST, CURLOT_LONG, 0 }, + { "POST301", CURLOPT_POSTREDIR, CURLOT_VALUES, CURLOT_FLAG_ALIAS }, + { "POSTFIELDS", CURLOPT_POSTFIELDS, CURLOT_OBJECT, 0 }, + { "POSTFIELDSIZE", CURLOPT_POSTFIELDSIZE, CURLOT_LONG, 0 }, + { "POSTFIELDSIZE_LARGE", CURLOPT_POSTFIELDSIZE_LARGE, CURLOT_OFF_T, 0 }, + { "POSTQUOTE", CURLOPT_POSTQUOTE, CURLOT_SLIST, 0 }, + { "POSTREDIR", CURLOPT_POSTREDIR, CURLOT_VALUES, 0 }, + { "PREQUOTE", CURLOPT_PREQUOTE, CURLOT_SLIST, 0 }, + { "PREREQDATA", CURLOPT_PREREQDATA, CURLOT_CBPTR, 0 }, + { "PREREQFUNCTION", CURLOPT_PREREQFUNCTION, CURLOT_FUNCTION, 0 }, + { "PRE_PROXY", CURLOPT_PRE_PROXY, CURLOT_STRING, 0 }, + { "PRIVATE", CURLOPT_PRIVATE, CURLOT_OBJECT, 0 }, + { "PROGRESSDATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS }, + { "PROGRESSFUNCTION", CURLOPT_PROGRESSFUNCTION, CURLOT_FUNCTION, 0 }, + { "PROTOCOLS", CURLOPT_PROTOCOLS, CURLOT_LONG, 0 }, + { "PROTOCOLS_STR", CURLOPT_PROTOCOLS_STR, CURLOT_STRING, 0 }, + { "PROXY", CURLOPT_PROXY, CURLOT_STRING, 0 }, + { "PROXYAUTH", CURLOPT_PROXYAUTH, CURLOT_VALUES, 0 }, + { "PROXYHEADER", CURLOPT_PROXYHEADER, CURLOT_SLIST, 0 }, + { "PROXYPASSWORD", CURLOPT_PROXYPASSWORD, CURLOT_STRING, 0 }, + { "PROXYPORT", CURLOPT_PROXYPORT, CURLOT_LONG, 0 }, + { "PROXYTYPE", CURLOPT_PROXYTYPE, CURLOT_VALUES, 0 }, + { "PROXYUSERNAME", CURLOPT_PROXYUSERNAME, CURLOT_STRING, 0 }, + { "PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CURLOT_STRING, 0 }, + { "PROXY_CAINFO", CURLOPT_PROXY_CAINFO, CURLOT_STRING, 0 }, + { "PROXY_CAINFO_BLOB", CURLOPT_PROXY_CAINFO_BLOB, CURLOT_BLOB, 0 }, + { "PROXY_CAPATH", CURLOPT_PROXY_CAPATH, CURLOT_STRING, 0 }, + { "PROXY_CRLFILE", CURLOPT_PROXY_CRLFILE, CURLOT_STRING, 0 }, + { "PROXY_ISSUERCERT", CURLOPT_PROXY_ISSUERCERT, CURLOT_STRING, 0 }, + { "PROXY_ISSUERCERT_BLOB", CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOT_BLOB, 0 }, + { "PROXY_KEYPASSWD", CURLOPT_PROXY_KEYPASSWD, CURLOT_STRING, 0 }, + { "PROXY_PINNEDPUBLICKEY", CURLOPT_PROXY_PINNEDPUBLICKEY, + CURLOT_STRING, 0 }, + { "PROXY_SERVICE_NAME", CURLOPT_PROXY_SERVICE_NAME, CURLOT_STRING, 0 }, + { "PROXY_SSLCERT", CURLOPT_PROXY_SSLCERT, CURLOT_STRING, 0 }, + { "PROXY_SSLCERTTYPE", CURLOPT_PROXY_SSLCERTTYPE, CURLOT_STRING, 0 }, + { "PROXY_SSLCERT_BLOB", CURLOPT_PROXY_SSLCERT_BLOB, CURLOT_BLOB, 0 }, + { "PROXY_SSLKEY", CURLOPT_PROXY_SSLKEY, CURLOT_STRING, 0 }, + { "PROXY_SSLKEYTYPE", CURLOPT_PROXY_SSLKEYTYPE, CURLOT_STRING, 0 }, + { "PROXY_SSLKEY_BLOB", CURLOPT_PROXY_SSLKEY_BLOB, CURLOT_BLOB, 0 }, + { "PROXY_SSLVERSION", CURLOPT_PROXY_SSLVERSION, CURLOT_VALUES, 0 }, + { "PROXY_SSL_CIPHER_LIST", CURLOPT_PROXY_SSL_CIPHER_LIST, + CURLOT_STRING, 0 }, + { "PROXY_SSL_OPTIONS", CURLOPT_PROXY_SSL_OPTIONS, CURLOT_LONG, 0 }, + { "PROXY_SSL_VERIFYHOST", CURLOPT_PROXY_SSL_VERIFYHOST, CURLOT_LONG, 0 }, + { "PROXY_SSL_VERIFYPEER", CURLOPT_PROXY_SSL_VERIFYPEER, CURLOT_LONG, 0 }, + { "PROXY_TLS13_CIPHERS", CURLOPT_PROXY_TLS13_CIPHERS, CURLOT_STRING, 0 }, + { "PROXY_TLSAUTH_PASSWORD", CURLOPT_PROXY_TLSAUTH_PASSWORD, + CURLOT_STRING, 0 }, + { "PROXY_TLSAUTH_TYPE", CURLOPT_PROXY_TLSAUTH_TYPE, CURLOT_STRING, 0 }, + { "PROXY_TLSAUTH_USERNAME", CURLOPT_PROXY_TLSAUTH_USERNAME, + CURLOT_STRING, 0 }, + { "PROXY_TRANSFER_MODE", CURLOPT_PROXY_TRANSFER_MODE, CURLOT_LONG, 0 }, + { "PUT", CURLOPT_PUT, CURLOT_LONG, 0 }, + { "QUICK_EXIT", CURLOPT_QUICK_EXIT, CURLOT_LONG, 0 }, + { "QUOTE", CURLOPT_QUOTE, CURLOT_SLIST, 0 }, + { "RANDOM_FILE", CURLOPT_RANDOM_FILE, CURLOT_STRING, 0 }, + { "RANGE", CURLOPT_RANGE, CURLOT_STRING, 0 }, + { "READDATA", CURLOPT_READDATA, CURLOT_CBPTR, 0 }, + { "READFUNCTION", CURLOPT_READFUNCTION, CURLOT_FUNCTION, 0 }, + { "REDIR_PROTOCOLS", CURLOPT_REDIR_PROTOCOLS, CURLOT_LONG, 0 }, + { "REDIR_PROTOCOLS_STR", CURLOPT_REDIR_PROTOCOLS_STR, CURLOT_STRING, 0 }, + { "REFERER", CURLOPT_REFERER, CURLOT_STRING, 0 }, + { "REQUEST_TARGET", CURLOPT_REQUEST_TARGET, CURLOT_STRING, 0 }, + { "RESOLVE", CURLOPT_RESOLVE, CURLOT_SLIST, 0 }, + { "RESOLVER_START_DATA", CURLOPT_RESOLVER_START_DATA, CURLOT_CBPTR, 0 }, + { "RESOLVER_START_FUNCTION", CURLOPT_RESOLVER_START_FUNCTION, + CURLOT_FUNCTION, 0 }, + { "RESUME_FROM", CURLOPT_RESUME_FROM, CURLOT_LONG, 0 }, + { "RESUME_FROM_LARGE", CURLOPT_RESUME_FROM_LARGE, CURLOT_OFF_T, 0 }, + { "RTSPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, CURLOT_FLAG_ALIAS }, + { "RTSP_CLIENT_CSEQ", CURLOPT_RTSP_CLIENT_CSEQ, CURLOT_LONG, 0 }, + { "RTSP_REQUEST", CURLOPT_RTSP_REQUEST, CURLOT_VALUES, 0 }, + { "RTSP_SERVER_CSEQ", CURLOPT_RTSP_SERVER_CSEQ, CURLOT_LONG, 0 }, + { "RTSP_SESSION_ID", CURLOPT_RTSP_SESSION_ID, CURLOT_STRING, 0 }, + { "RTSP_STREAM_URI", CURLOPT_RTSP_STREAM_URI, CURLOT_STRING, 0 }, + { "RTSP_TRANSPORT", CURLOPT_RTSP_TRANSPORT, CURLOT_STRING, 0 }, + { "SASL_AUTHZID", CURLOPT_SASL_AUTHZID, CURLOT_STRING, 0 }, + { "SASL_IR", CURLOPT_SASL_IR, CURLOT_LONG, 0 }, + { "SEEKDATA", CURLOPT_SEEKDATA, CURLOT_CBPTR, 0 }, + { "SEEKFUNCTION", CURLOPT_SEEKFUNCTION, CURLOT_FUNCTION, 0 }, + { "SERVER_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT, + CURLOT_LONG, 0 }, + { "SERVER_RESPONSE_TIMEOUT_MS", CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, + CURLOT_LONG, 0 }, + { "SERVICE_NAME", CURLOPT_SERVICE_NAME, CURLOT_STRING, 0 }, + { "SHARE", CURLOPT_SHARE, CURLOT_OBJECT, 0 }, + { "SOCKOPTDATA", CURLOPT_SOCKOPTDATA, CURLOT_CBPTR, 0 }, + { "SOCKOPTFUNCTION", CURLOPT_SOCKOPTFUNCTION, CURLOT_FUNCTION, 0 }, + { "SOCKS5_AUTH", CURLOPT_SOCKS5_AUTH, CURLOT_LONG, 0 }, + { "SOCKS5_GSSAPI_NEC", CURLOPT_SOCKS5_GSSAPI_NEC, CURLOT_LONG, 0 }, + { "SOCKS5_GSSAPI_SERVICE", CURLOPT_SOCKS5_GSSAPI_SERVICE, + CURLOT_STRING, 0 }, + { "SSH_AUTH_TYPES", CURLOPT_SSH_AUTH_TYPES, CURLOT_VALUES, 0 }, + { "SSH_COMPRESSION", CURLOPT_SSH_COMPRESSION, CURLOT_LONG, 0 }, + { "SSH_HOSTKEYDATA", CURLOPT_SSH_HOSTKEYDATA, CURLOT_CBPTR, 0 }, + { "SSH_HOSTKEYFUNCTION", CURLOPT_SSH_HOSTKEYFUNCTION, CURLOT_FUNCTION, 0 }, + { "SSH_HOST_PUBLIC_KEY_MD5", CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, + CURLOT_STRING, 0 }, + { "SSH_HOST_PUBLIC_KEY_SHA256", CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, + CURLOT_STRING, 0 }, + { "SSH_KEYDATA", CURLOPT_SSH_KEYDATA, CURLOT_CBPTR, 0 }, + { "SSH_KEYFUNCTION", CURLOPT_SSH_KEYFUNCTION, CURLOT_FUNCTION, 0 }, + { "SSH_KNOWNHOSTS", CURLOPT_SSH_KNOWNHOSTS, CURLOT_STRING, 0 }, + { "SSH_PRIVATE_KEYFILE", CURLOPT_SSH_PRIVATE_KEYFILE, CURLOT_STRING, 0 }, + { "SSH_PUBLIC_KEYFILE", CURLOPT_SSH_PUBLIC_KEYFILE, CURLOT_STRING, 0 }, + { "SSLCERT", CURLOPT_SSLCERT, CURLOT_STRING, 0 }, + { "SSLCERTPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS }, + { "SSLCERTTYPE", CURLOPT_SSLCERTTYPE, CURLOT_STRING, 0 }, + { "SSLCERT_BLOB", CURLOPT_SSLCERT_BLOB, CURLOT_BLOB, 0 }, + { "SSLENGINE", CURLOPT_SSLENGINE, CURLOT_STRING, 0 }, + { "SSLENGINE_DEFAULT", CURLOPT_SSLENGINE_DEFAULT, CURLOT_LONG, 0 }, + { "SSLKEY", CURLOPT_SSLKEY, CURLOT_STRING, 0 }, + { "SSLKEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS }, + { "SSLKEYTYPE", CURLOPT_SSLKEYTYPE, CURLOT_STRING, 0 }, + { "SSLKEY_BLOB", CURLOPT_SSLKEY_BLOB, CURLOT_BLOB, 0 }, + { "SSLVERSION", CURLOPT_SSLVERSION, CURLOT_VALUES, 0 }, + { "SSL_CIPHER_LIST", CURLOPT_SSL_CIPHER_LIST, CURLOT_STRING, 0 }, + { "SSL_CTX_DATA", CURLOPT_SSL_CTX_DATA, CURLOT_CBPTR, 0 }, + { "SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, CURLOT_FUNCTION, 0 }, + { "SSL_EC_CURVES", CURLOPT_SSL_EC_CURVES, CURLOT_STRING, 0 }, + { "SSL_ENABLE_ALPN", CURLOPT_SSL_ENABLE_ALPN, CURLOT_LONG, 0 }, + { "SSL_ENABLE_NPN", CURLOPT_SSL_ENABLE_NPN, CURLOT_LONG, 0 }, + { "SSL_FALSESTART", CURLOPT_SSL_FALSESTART, CURLOT_LONG, 0 }, + { "SSL_OPTIONS", CURLOPT_SSL_OPTIONS, CURLOT_VALUES, 0 }, + { "SSL_SESSIONID_CACHE", CURLOPT_SSL_SESSIONID_CACHE, CURLOT_LONG, 0 }, + { "SSL_SIGNATURE_ALGORITHMS", CURLOPT_SSL_SIGNATURE_ALGORITHMS, + CURLOT_STRING, 0 }, + { "SSL_VERIFYHOST", CURLOPT_SSL_VERIFYHOST, CURLOT_LONG, 0 }, + { "SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER, CURLOT_LONG, 0 }, + { "SSL_VERIFYSTATUS", CURLOPT_SSL_VERIFYSTATUS, CURLOT_LONG, 0 }, + { "STDERR", CURLOPT_STDERR, CURLOT_OBJECT, 0 }, + { "STREAM_DEPENDS", CURLOPT_STREAM_DEPENDS, CURLOT_OBJECT, 0 }, + { "STREAM_DEPENDS_E", CURLOPT_STREAM_DEPENDS_E, CURLOT_OBJECT, 0 }, + { "STREAM_WEIGHT", CURLOPT_STREAM_WEIGHT, CURLOT_LONG, 0 }, + { "SUPPRESS_CONNECT_HEADERS", CURLOPT_SUPPRESS_CONNECT_HEADERS, + CURLOT_LONG, 0 }, + { "TCP_FASTOPEN", CURLOPT_TCP_FASTOPEN, CURLOT_LONG, 0 }, + { "TCP_KEEPALIVE", CURLOPT_TCP_KEEPALIVE, CURLOT_LONG, 0 }, + { "TCP_KEEPCNT", CURLOPT_TCP_KEEPCNT, CURLOT_LONG, 0 }, + { "TCP_KEEPIDLE", CURLOPT_TCP_KEEPIDLE, CURLOT_LONG, 0 }, + { "TCP_KEEPINTVL", CURLOPT_TCP_KEEPINTVL, CURLOT_LONG, 0 }, + { "TCP_NODELAY", CURLOPT_TCP_NODELAY, CURLOT_LONG, 0 }, + { "TELNETOPTIONS", CURLOPT_TELNETOPTIONS, CURLOT_SLIST, 0 }, + { "TFTP_BLKSIZE", CURLOPT_TFTP_BLKSIZE, CURLOT_LONG, 0 }, + { "TFTP_NO_OPTIONS", CURLOPT_TFTP_NO_OPTIONS, CURLOT_LONG, 0 }, + { "TIMECONDITION", CURLOPT_TIMECONDITION, CURLOT_VALUES, 0 }, + { "TIMEOUT", CURLOPT_TIMEOUT, CURLOT_LONG, 0 }, + { "TIMEOUT_MS", CURLOPT_TIMEOUT_MS, CURLOT_LONG, 0 }, + { "TIMEVALUE", CURLOPT_TIMEVALUE, CURLOT_LONG, 0 }, + { "TIMEVALUE_LARGE", CURLOPT_TIMEVALUE_LARGE, CURLOT_OFF_T, 0 }, + { "TLS13_CIPHERS", CURLOPT_TLS13_CIPHERS, CURLOT_STRING, 0 }, + { "TLSAUTH_PASSWORD", CURLOPT_TLSAUTH_PASSWORD, CURLOT_STRING, 0 }, + { "TLSAUTH_TYPE", CURLOPT_TLSAUTH_TYPE, CURLOT_STRING, 0 }, + { "TLSAUTH_USERNAME", CURLOPT_TLSAUTH_USERNAME, CURLOT_STRING, 0 }, + { "TRAILERDATA", CURLOPT_TRAILERDATA, CURLOT_CBPTR, 0 }, + { "TRAILERFUNCTION", CURLOPT_TRAILERFUNCTION, CURLOT_FUNCTION, 0 }, + { "TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CURLOT_LONG, 0 }, + { "TRANSFER_ENCODING", CURLOPT_TRANSFER_ENCODING, CURLOT_LONG, 0 }, + { "UNIX_SOCKET_PATH", CURLOPT_UNIX_SOCKET_PATH, CURLOT_STRING, 0 }, + { "UNRESTRICTED_AUTH", CURLOPT_UNRESTRICTED_AUTH, CURLOT_LONG, 0 }, + { "UPKEEP_INTERVAL_MS", CURLOPT_UPKEEP_INTERVAL_MS, CURLOT_LONG, 0 }, + { "UPLOAD", CURLOPT_UPLOAD, CURLOT_LONG, 0 }, + { "UPLOAD_BUFFERSIZE", CURLOPT_UPLOAD_BUFFERSIZE, CURLOT_LONG, 0 }, + { "UPLOAD_FLAGS", CURLOPT_UPLOAD_FLAGS, CURLOT_LONG, 0 }, + { "URL", CURLOPT_URL, CURLOT_STRING, 0 }, + { "USERAGENT", CURLOPT_USERAGENT, CURLOT_STRING, 0 }, + { "USERNAME", CURLOPT_USERNAME, CURLOT_STRING, 0 }, + { "USERPWD", CURLOPT_USERPWD, CURLOT_STRING, 0 }, + { "USE_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, 0 }, + { "VERBOSE", CURLOPT_VERBOSE, CURLOT_LONG, 0 }, + { "WILDCARDMATCH", CURLOPT_WILDCARDMATCH, CURLOT_LONG, 0 }, + { "WRITEDATA", CURLOPT_WRITEDATA, CURLOT_CBPTR, 0 }, + { "WRITEFUNCTION", CURLOPT_WRITEFUNCTION, CURLOT_FUNCTION, 0 }, + { "WRITEHEADER", CURLOPT_HEADERDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS }, + { "WS_OPTIONS", CURLOPT_WS_OPTIONS, CURLOT_LONG, 0 }, + { "XFERINFODATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, 0 }, + { "XFERINFOFUNCTION", CURLOPT_XFERINFOFUNCTION, CURLOT_FUNCTION, 0 }, + { "XOAUTH2_BEARER", CURLOPT_XOAUTH2_BEARER, CURLOT_STRING, 0 }, + { NULL, CURLOPT_LASTENTRY, CURLOT_LONG, 0 } /* end of table */ }; #ifdef DEBUGBUILD diff --git a/lib/escape.c b/lib/escape.c index 04b46f7a9e26..3e49701bcb62 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -52,8 +52,7 @@ char *curl_unescape(const char *string, int length) /* Escapes for URL the given unescaped string of given length. * 'data' is ignored since 7.82.0. */ -char *curl_easy_escape(CURL *data, const char *string, - int inlength) +char *curl_easy_escape(CURL *data, const char *string, int inlength) { size_t length; struct dynbuf d; @@ -79,7 +78,7 @@ char *curl_easy_escape(CURL *data, const char *string, } else { /* encode it */ - unsigned char out[3]={'%'}; + unsigned char out[3] = { '%' }; Curl_hexbyte(&out[1], in); if(curlx_dyn_addn(&d, out, 3)) return NULL; @@ -163,8 +162,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, * If olen == NULL, no output length is stored. * 'data' is ignored since 7.82.0. */ -char *curl_easy_unescape(CURL *data, const char *string, - int length, int *olen) +char *curl_easy_unescape(CURL *data, const char *string, int length, int *olen) { char *str = NULL; (void)data; @@ -177,7 +175,7 @@ char *curl_easy_unescape(CURL *data, const char *string, return NULL; if(olen) { - if(outputlen <= (size_t) INT_MAX) + if(outputlen <= (size_t)INT_MAX) *olen = curlx_uztosi(outputlen); else /* too large to return in an int, fail! */ diff --git a/lib/fake_addrinfo.c b/lib/fake_addrinfo.c index 7d5da09ead53..f771c29009a4 100644 --- a/lib/fake_addrinfo.c +++ b/lib/fake_addrinfo.c @@ -181,8 +181,7 @@ int r_getaddrinfo(const char *node, } } - ares_getaddrinfo(channel, node, service, &ahints, - async_addrinfo_cb, &ctx); + ares_getaddrinfo(channel, node, service, &ahints, async_addrinfo_cb, &ctx); /* Wait until no more requests are left to be processed */ ares_queue_wait_empty(channel, -1); diff --git a/lib/file.c b/lib/file.c index 2f30a0297ca6..0f969571265a 100644 --- a/lib/file.c +++ b/lib/file.c @@ -127,7 +127,6 @@ const struct Curl_handler Curl_handler_file = { PROTOPT_NONETWORK | PROTOPT_NOURLQUERY /* flags */ }; - static void file_cleanup(struct FILEPROTO *file) { Curl_safefree(file->freepath); @@ -332,7 +331,7 @@ static CURLcode file_upload(struct Curl_easy *data, if(!dir[1]) return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */ - mode = O_WRONLY|O_CREAT|CURL_O_BINARY; + mode = O_WRONLY | O_CREAT | CURL_O_BINARY; if(data->state.resume_from) mode |= O_APPEND; else @@ -478,7 +477,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) const struct tm *tm = &buffer; char header[80]; int headerlen; - static const char accept_ranges[]= { "Accept-ranges: bytes\r\n" }; + static const char accept_ranges[] = { "Accept-ranges: bytes\r\n" }; if(expected_size >= 0) { headerlen = curl_msnprintf(header, sizeof(header), @@ -502,7 +501,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) headerlen = curl_msnprintf(header, sizeof(header), "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n", - Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6], + Curl_wkday[tm->tm_wday ? tm->tm_wday - 1 : 6], tm->tm_mday, Curl_month[tm->tm_mon], tm->tm_year + 1900, @@ -568,10 +567,10 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) if(!S_ISDIR(statbuf.st_mode)) { #ifdef __AMIGA__ if(data->state.resume_from != - lseek(fd, (off_t)data->state.resume_from, SEEK_SET)) + lseek(fd, (off_t)data->state.resume_from, SEEK_SET)) #else if(data->state.resume_from != - lseek(fd, data->state.resume_from, SEEK_SET)) + lseek(fd, data->state.resume_from, SEEK_SET)) #endif return CURLE_BAD_DOWNLOAD_RESUME; } @@ -591,11 +590,11 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) size_t bytestoread; if(size_known) { - bytestoread = (expected_size < (curl_off_t)(xfer_blen-1)) ? - curlx_sotouz(expected_size) : (xfer_blen-1); + bytestoread = (expected_size < (curl_off_t)(xfer_blen - 1)) ? + curlx_sotouz(expected_size) : (xfer_blen - 1); } else - bytestoread = xfer_blen-1; + bytestoread = xfer_blen - 1; nread = read(fd, xfer_buf, bytestoread); diff --git a/lib/formdata.c b/lib/formdata.c index d4bfed89beaa..e51bf14b6323 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -41,13 +41,13 @@ struct Curl_easy; #include "curlx/warnless.h" -#define HTTPPOST_PTRNAME CURL_HTTPPOST_PTRNAME -#define HTTPPOST_FILENAME CURL_HTTPPOST_FILENAME +#define HTTPPOST_PTRNAME CURL_HTTPPOST_PTRNAME +#define HTTPPOST_FILENAME CURL_HTTPPOST_FILENAME #define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS -#define HTTPPOST_READFILE CURL_HTTPPOST_READFILE -#define HTTPPOST_PTRBUFFER CURL_HTTPPOST_PTRBUFFER -#define HTTPPOST_CALLBACK CURL_HTTPPOST_CALLBACK -#define HTTPPOST_BUFFER CURL_HTTPPOST_BUFFER +#define HTTPPOST_READFILE CURL_HTTPPOST_READFILE +#define HTTPPOST_PTRBUFFER CURL_HTTPPOST_PTRBUFFER +#define HTTPPOST_CALLBACK CURL_HTTPPOST_CALLBACK +#define HTTPPOST_BUFFER CURL_HTTPPOST_BUFFER /*************************************************************************** * @@ -59,11 +59,10 @@ struct Curl_easy; * Returns newly allocated HttpPost on success and NULL if malloc failed. * ***************************************************************************/ -static struct curl_httppost * -AddHttpPost(struct FormInfo *src, - struct curl_httppost *parent_post, - struct curl_httppost **httppost, - struct curl_httppost **last_post) +static struct curl_httppost *AddHttpPost(struct FormInfo *src, + struct curl_httppost *parent_post, + struct curl_httppost **httppost, + struct curl_httppost **last_post) { struct curl_httppost *post; size_t namelength = src->namelength; @@ -227,21 +226,19 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, /* go through the list, check for completeness and if everything is * alright add the HttpPost item otherwise set retval accordingly */ - for(form = first_form; - form != NULL; - form = form->more) { + for(form = first_form; form != NULL; form = form->more) { if(((!form->name || !form->value) && !post) || - ( (form->contentslength) && - (form->flags & HTTPPOST_FILENAME) ) || - ( (form->flags & HTTPPOST_FILENAME) && - (form->flags & HTTPPOST_PTRCONTENTS) ) || + (form->contentslength && + (form->flags & HTTPPOST_FILENAME)) || + ((form->flags & HTTPPOST_FILENAME) && + (form->flags & HTTPPOST_PTRCONTENTS)) || - ( (!form->buffer) && - (form->flags & HTTPPOST_BUFFER) && - (form->flags & HTTPPOST_PTRBUFFER) ) || + (!form->buffer && + (form->flags & HTTPPOST_BUFFER) && + (form->flags & HTTPPOST_PTRBUFFER)) || - ( (form->flags & HTTPPOST_READFILE) && - (form->flags & HTTPPOST_PTRCONTENTS) ) + ((form->flags & HTTPPOST_READFILE) && + (form->flags & HTTPPOST_PTRCONTENTS)) ) { return CURL_FORMADD_INCOMPLETE; } @@ -285,7 +282,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | HTTPPOST_CALLBACK)) && form->value) { /* copy value (without strdup; possibly contains null characters) */ - size_t clen = (size_t) form->contentslength; + size_t clen = (size_t)form->contentslength; if(!clen) clen = strlen(form->value) + 1; @@ -321,10 +318,8 @@ static void free_chain(struct curl_httppost *c) } } -static -CURLFORMcode FormAdd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - va_list params) +static CURLFORMcode FormAdd(struct curl_httppost **httppost, + struct curl_httppost **last_post, va_list params) { struct FormInfo *first_form, *curr, *form = NULL; CURLFORMcode retval = CURL_FORMADD_OK; @@ -442,13 +437,12 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, case CURLFORM_CONTENTLEN: curr->flags |= CURL_HTTPPOST_LARGE; curr->contentslength = - array_state ? (curl_off_t)(size_t)avalue : - va_arg(params, curl_off_t); + array_state ? (curl_off_t)(size_t)avalue : va_arg(params, curl_off_t); break; /* Get contents from a given filename */ case CURLFORM_FILECONTENT: - if(curr->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE)) + if(curr->flags & (HTTPPOST_PTRCONTENTS | HTTPPOST_READFILE)) retval = CURL_FORMADD_OPTION_TWICE; else { if(!array_state) @@ -513,7 +507,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, break; case CURLFORM_BUFFERPTR: - curr->flags |= HTTPPOST_PTRBUFFER|HTTPPOST_BUFFER; + curr->flags |= HTTPPOST_PTRBUFFER | HTTPPOST_BUFFER; if(curr->buffer) retval = CURL_FORMADD_OPTION_TWICE; else { @@ -597,21 +591,20 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, } break; - case CURLFORM_CONTENTHEADER: - { - /* this "cast increases required alignment of target type" but - we consider it OK anyway */ - struct curl_slist *list = array_state ? - (struct curl_slist *)(void *)avalue : - va_arg(params, struct curl_slist *); + case CURLFORM_CONTENTHEADER: { + /* this "cast increases required alignment of target type" but + we consider it OK anyway */ + struct curl_slist *list = array_state ? + (struct curl_slist *)(void *)avalue : + va_arg(params, struct curl_slist *); - if(curr->contentheader) - retval = CURL_FORMADD_OPTION_TWICE; - else - curr->contentheader = list; + if(curr->contentheader) + retval = CURL_FORMADD_OPTION_TWICE; + else + curr->contentheader = list; - break; - } + break; + } case CURLFORM_FILENAME: case CURLFORM_BUFFER: if(!array_state) @@ -672,8 +665,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, */ CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...) + struct curl_httppost **last_post, ...) { va_list arg; CURLFORMcode result; @@ -717,7 +709,7 @@ int curl_formget(struct curl_httppost *form, void *arg, } Curl_mime_cleanpart(&toppart); - return (int) result; + return (int)result; } /* @@ -741,8 +733,7 @@ void curl_formfree(struct curl_httppost *form) if(!(form->flags & HTTPPOST_PTRNAME)) curlx_free(form->name); /* free the name */ if(!(form->flags & - (HTTPPOST_PTRCONTENTS|HTTPPOST_BUFFER|HTTPPOST_CALLBACK)) - ) + (HTTPPOST_PTRCONTENTS | HTTPPOST_BUFFER | HTTPPOST_CALLBACK))) curlx_free(form->contents); /* free the contents */ curlx_free(form->contenttype); /* free the content type */ curlx_free(form->showfilename); /* free the faked filename */ @@ -751,7 +742,6 @@ void curl_formfree(struct curl_httppost *form) } while(form); /* continue */ } - /* Set mime part name, taking care of non null-terminated name string. */ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) { @@ -893,7 +883,7 @@ CURLcode Curl_getformdata(CURL *data, /* Set fake filename. */ if(!result && post->showfilename) if(post->more || (post->flags & (HTTPPOST_FILENAME | HTTPPOST_BUFFER | - HTTPPOST_CALLBACK))) + HTTPPOST_CALLBACK))) result = curl_mime_filename(part, post->showfilename); } } @@ -907,8 +897,7 @@ CURLcode Curl_getformdata(CURL *data, #else /* if disabled */ CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...) + struct curl_httppost **last_post, ...) { (void)httppost; (void)last_post; @@ -930,4 +919,4 @@ void curl_formfree(struct curl_httppost *form) /* Nothing to do. */ } -#endif /* if disabled */ +#endif /* if disabled */ diff --git a/lib/formdata.h b/lib/formdata.h index 74f00bf4fcbc..e80b83bbf491 100644 --- a/lib/formdata.h +++ b/lib/formdata.h @@ -55,5 +55,4 @@ CURLcode Curl_getformdata(CURL *data, curl_read_callback fread_func); #endif /* CURL_DISABLE_FORM_API */ - #endif /* HEADER_CURL_FORMDATA_H */ diff --git a/lib/ftp.c b/lib/ftp.c index b2b15a89dcd3..49f042c7c4c7 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -88,11 +88,11 @@ #define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3])) #ifdef CURL_DISABLE_VERBOSE_STRINGS -#define ftp_pasv_verbose(a,b,c,d) Curl_nop_stmt -#define FTP_CSTATE(c) ((void)(c), "") +#define ftp_pasv_verbose(a, b, c, d) Curl_nop_stmt +#define FTP_CSTATE(c) ((void)(c), "") #else /* CURL_DISABLE_VERBOSE_STRINGS */ /* for tracing purposes */ -static const char * const ftp_state_names[]={ +static const char * const ftp_state_names[] = { "STOP", "WAIT220", "AUTH", @@ -131,7 +131,7 @@ static const char * const ftp_state_names[]={ "STOR", "QUIT" }; -#define FTP_CSTATE(ftpc) ((ftpc)? ftp_state_names[(ftpc)->state] : "???") +#define FTP_CSTATE(ftpc) ((ftpc) ? ftp_state_names[(ftpc)->state] : "???") #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ @@ -163,12 +163,11 @@ static void ftp_state_low(struct Curl_easy *data, ftpc->state = newstate; } - /* Local API functions */ #ifndef DEBUGBUILD -#define ftp_state(x,y,z) ftp_state_low(x,y,z) +#define ftp_state(x, y, z) ftp_state_low(x, y, z) #else /* !DEBUGBUILD */ -#define ftp_state(x,y,z) ftp_state_low(x,y,z,__LINE__) +#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__) #endif /* DEBUGBUILD */ static CURLcode ftp_sendquote(struct Curl_easy *data, @@ -270,7 +269,6 @@ const struct Curl_handler Curl_handler_ftp = { PROTOPT_CONN_REUSE /* flags */ }; - #ifdef USE_SSL /* * FTPS protocol handler. @@ -490,7 +488,7 @@ static CURLcode ftp_check_ctrl_on_data_wait(struct Curl_easy *data, infof(data, "FTP code: %03d", ftpcode); - if(ftpcode/100 > 3) + if(ftpcode / 100 > 3) return CURLE_FTP_ACCEPT_FAILED; return CURLE_WEIRD_SERVER_REPLY; @@ -762,8 +760,8 @@ static CURLcode ftp_domore_pollset(struct Curl_easy *data, /* if stopped and still in this state, then we are also waiting for a connect on the secondary connection */ DEBUGASSERT(data->conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD || - (data->conn->cfilter[SECONDARYSOCKET] && - !Curl_conn_is_connected(data->conn, SECONDARYSOCKET))); + (data->conn->cfilter[SECONDARYSOCKET] && + !Curl_conn_is_connected(data->conn, SECONDARYSOCKET))); /* An unconnected SECONDARY will add its socket by itself * via its adjust_pollset() */ return Curl_pollset_add_in(data, ps, data->conn->sock[FIRSTSOCKET]); @@ -782,7 +780,7 @@ static const char *pathpiece(struct ftp_conn *ftpc, int num) { DEBUGASSERT(ftpc->dirs); DEBUGASSERT(ftpc->dirdepth > num); - return &ftpc->rawpath[ ftpc->dirs[num].start ]; + return &ftpc->rawpath[ftpc->dirs[num].start]; } /* This is called after the FTP_QUOTE state is passed. @@ -953,7 +951,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, if(addrlen) { const struct Curl_sockaddr_ex *remote_addr = - Curl_conn_get_remote_addr(data, FIRSTSOCKET); + Curl_conn_get_remote_addr(data, FIRSTSOCKET); DEBUGASSERT(remote_addr); if(!remote_addr) @@ -971,15 +969,15 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, conn->scope_id, #endif ipstr, hbuf, sizeof(hbuf))) { - case IF2IP_NOT_FOUND: - /* not an interface, use the given string as hostname instead */ - host = ipstr; - break; - case IF2IP_AF_NOT_SUPPORTED: - goto out; - case IF2IP_FOUND: - host = hbuf; /* use the hbuf for hostname */ - break; + case IF2IP_NOT_FOUND: + /* not an interface, use the given string as hostname instead */ + host = ipstr; + break; + case IF2IP_AF_NOT_SUPPORTED: + goto out; + case IF2IP_FOUND: + host = hbuf; /* use the hbuf for hostname */ + break; } } else @@ -1060,7 +1058,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, sa6->sin6_port = htons(port); #endif /* Try binding the given address. */ - if(bind(portsock, sa, sslen) ) { + if(bind(portsock, sa, sslen)) { /* It failed. */ error = SOCKERRNO; if(possibly_non_local && (error == SOCKEADDRNOTAVAIL)) { @@ -1501,7 +1499,6 @@ static CURLcode ftp_state_mdtm(struct Curl_easy *data, return result; } - /* This is called after the TYPE and possible quote commands have been sent */ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, struct ftp_conn *ftpc, @@ -1554,7 +1551,7 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, } /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { - char scratch[4*1024]; + char scratch[4 * 1024]; size_t readthisamountnow = (data->state.resume_from - passed > (curl_off_t)sizeof(scratch)) ? sizeof(scratch) : @@ -1752,7 +1749,6 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data, return result; } - static CURLcode ftp_control_addr_dup(struct Curl_easy *data, char **newhostp) { @@ -1810,8 +1806,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, struct pingpong *pp = &ftpc->pp; char *newhost = NULL; unsigned short newport = 0; - char *str = - curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */ + char *str = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */ if((ftpc->count1 == 0) && (ftpcode == 229)) { @@ -1872,8 +1867,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, /* told to ignore the remotely given IP but instead use the host we used for the control connection */ infof(data, "Skip %u.%u.%u.%u for data connection, reuse %s instead", - ip[0], ip[1], ip[2], ip[3], - conn->host.name); + ip[0], ip[1], ip[2], ip[3], conn->host.name); result = ftp_control_addr_dup(data, &newhost); if(result) return result; @@ -2024,7 +2018,7 @@ static CURLcode ftp_state_port_resp(struct Curl_easy *data, static int twodigit(const char *p) { - return (p[0]-'0') * 10 + (p[1]-'0'); + return (p[0] - '0') * 10 + (p[1] - '0'); } static bool ftp_213_date(const char *p, int *year, int *month, int *day, @@ -2079,27 +2073,26 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data, CURLcode result = CURLE_OK; switch(ftpcode) { - case 213: - { - /* we got a time. Format should be: "YYYYMMDDHHMMSS[.sss]" where the - last .sss part is optional and means fractions of a second */ - int year, month, day, hour, minute, second; - struct pingpong *pp = &ftpc->pp; - char *resp = curlx_dyn_ptr(&pp->recvbuf) + 4; - bool showtime = FALSE; - if(ftp_213_date(resp, &year, &month, &day, &hour, &minute, &second)) { - /* we have a time, reformat it */ - char timebuf[24]; - curl_msnprintf(timebuf, sizeof(timebuf), - "%04d%02d%02d %02d:%02d:%02d GMT", - year, month, day, hour, minute, second); - /* now, convert this into a time() value: */ - if(!Curl_getdate_capped(timebuf, &data->info.filetime)) - showtime = TRUE; - } + case 213: { + /* we got a time. Format should be: "YYYYMMDDHHMMSS[.sss]" where the + last .sss part is optional and means fractions of a second */ + int year, month, day, hour, minute, second; + struct pingpong *pp = &ftpc->pp; + char *resp = curlx_dyn_ptr(&pp->recvbuf) + 4; + bool showtime = FALSE; + if(ftp_213_date(resp, &year, &month, &day, &hour, &minute, &second)) { + /* we have a time, reformat it */ + char timebuf[24]; + curl_msnprintf(timebuf, sizeof(timebuf), + "%04d%02d%02d %02d:%02d:%02d GMT", + year, month, day, hour, minute, second); + /* now, convert this into a time() value: */ + if(!Curl_getdate_capped(timebuf, &data->info.filetime)) + showtime = TRUE; + } - /* If we asked for a time of the file and we actually got one as well, - we "emulate" an HTTP-style header in our output. */ + /* If we asked for a time of the file and we actually got one as well, + we "emulate" an HTTP-style header in our output. */ #if defined(__GNUC__) && (defined(__DJGPP__) || defined(__AMIGA__)) #pragma GCC diagnostic push @@ -2107,38 +2100,38 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data, warning: comparison of unsigned expression in '>= 0' is always true */ #pragma GCC diagnostic ignored "-Wtype-limits" #endif - if(data->req.no_body && ftpc->file && - data->set.get_filetime && showtime) { + if(data->req.no_body && ftpc->file && + data->set.get_filetime && showtime) { #if defined(__GNUC__) && (defined(__DJGPP__) || defined(__AMIGA__)) #pragma GCC diagnostic pop #endif - char headerbuf[128]; - int headerbuflen; - time_t filetime = data->info.filetime; - struct tm buffer; - const struct tm *tm = &buffer; + char headerbuf[128]; + int headerbuflen; + time_t filetime = data->info.filetime; + struct tm buffer; + const struct tm *tm = &buffer; - result = Curl_gmtime(filetime, &buffer); - if(result) - return result; + result = Curl_gmtime(filetime, &buffer); + if(result) + return result; - /* format: "Tue, 15 Nov 1994 12:45:26" */ - headerbuflen = - curl_msnprintf(headerbuf, sizeof(headerbuf), - "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d " - "GMT\r\n", - Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6], - tm->tm_mday, - Curl_month[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - result = client_write_header(data, headerbuf, headerbuflen); - if(result) - return result; - } /* end of a ridiculous amount of conditionals */ - } + /* format: "Tue, 15 Nov 1994 12:45:26" */ + headerbuflen = + curl_msnprintf(headerbuf, sizeof(headerbuf), + "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d " + "GMT\r\n", + Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6], + tm->tm_mday, + Curl_month[tm->tm_mon], + tm->tm_year + 1900, + tm->tm_hour, + tm->tm_min, + tm->tm_sec); + result = client_write_header(data, headerbuf, headerbuflen); + if(result) + return result; + } /* end of a ridiculous amount of conditionals */ + } break; default: infof(data, "unsupported MDTM reply format"); @@ -2194,7 +2187,7 @@ static CURLcode ftp_state_type_resp(struct Curl_easy *data, { CURLcode result = CURLE_OK; - if(ftpcode/100 != 2) { + if(ftpcode / 100 != 2) { /* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a successful 'TYPE I'. While that is not as RFC959 says, it is still a positive response code and we allow that. */ @@ -2267,7 +2260,7 @@ static CURLcode ftp_state_retr(struct Curl_easy *data, return CURLE_BAD_DOWNLOAD_RESUME; } /* Now store the number of bytes we are expected to download */ - ftp->downloadsize = filesize-data->state.resume_from; + ftp->downloadsize = filesize - data->state.resume_from; } } @@ -2378,7 +2371,7 @@ static CURLcode ftp_state_rest_resp(struct Curl_easy *data, case FTP_REST: default: if(ftpcode == 350) { - char buffer[24]= { "Accept-ranges: bytes\r\n" }; + char buffer[24] = { "Accept-ranges: bytes\r\n" }; result = client_write_header(data, buffer, strlen(buffer)); if(result) return result; @@ -2590,12 +2583,11 @@ static CURLcode ftp_state_user_resp(struct Curl_easy *data, if((ftpcode == 331) && (ftpc->state == FTP_USER)) { /* 331 Password required for ... (the server requires to send the user's password too) */ - result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s", - data->conn->passwd); + result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s", data->conn->passwd); if(!result) ftp_state(data, ftpc, FTP_PASS); } - else if(ftpcode/100 == 2) { + else if(ftpcode / 100 == 2) { /* 230 User ... logged in. (the user logged in with or without password) */ result = ftp_state_loggedin(data, ftpc); @@ -2621,9 +2613,8 @@ static CURLcode ftp_state_user_resp(struct Curl_easy *data, if(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER] && !ftpc->ftp_trying_alternative) { /* Ok, USER failed. Let's try the supplied command. */ - result = - Curl_pp_sendf(data, &ftpc->pp, "%s", - data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]); + result = Curl_pp_sendf(data, &ftpc->pp, "%s", + data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]); if(!result) { ftpc->ftp_trying_alternative = TRUE; ftp_state(data, ftpc, FTP_USER); @@ -2789,8 +2780,7 @@ static CURLcode ftp_wait_resp(struct Curl_easy *data, (int)data->set.ftpsslauth); return CURLE_UNKNOWN_OPTION; /* we do not know what to do */ } - result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", - ftpauth[ftpc->count1]); + result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); if(!result) ftp_state(data, ftpc, FTP_AUTH); } @@ -2890,10 +2880,9 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, break; case FTP_PROT: - if(ftpcode/100 == 2) + if(ftpcode / 100 == 2) /* We have enabled SSL for the data connection! */ - conn->bits.ftp_use_data_ssl = - (data->set.use_ssl != CURLUSESSL_CONTROL); + conn->bits.ftp_use_data_ssl = (data->set.use_ssl != CURLUSESSL_CONTROL); /* FTP servers typically responds with 500 if they decide to reject our 'P' request */ else if(data->set.use_ssl > CURLUSESSL_CONTROL) @@ -3005,7 +2994,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, break; case FTP_CWD: - if(ftpcode/100 != 2) { + if(ftpcode / 100 != 2) { /* failure to CWD there */ if(data->set.ftp_create_missing_dirs && ftpc->cwdcount && !ftpc->count2) { @@ -3047,7 +3036,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, break; case FTP_MKD: - if((ftpcode/100 != 2) && !ftpc->count3--) { + if((ftpcode / 100 != 2) && !ftpc->count3--) { /* failure to MKD the directory */ failf(data, "Failed to MKD dir: %03d", ftpcode); result = CURLE_REMOTE_ACCESS_DENIED; @@ -3120,7 +3109,6 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, return result; } - /* called repeatedly until done from multi.c */ static CURLcode ftp_statemach(struct Curl_easy *data, struct ftp_conn *ftpc, @@ -3419,10 +3407,9 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, * * BLOCKING */ -static -CURLcode ftp_sendquote(struct Curl_easy *data, - struct ftp_conn *ftpc, - struct curl_slist *quote) +static CURLcode ftp_sendquote(struct Curl_easy *data, + struct ftp_conn *ftpc, + struct curl_slist *quote) { struct curl_slist *item; struct pingpong *pp = &ftpc->pp; @@ -3913,8 +3900,7 @@ static CURLcode wc_statemach(struct Curl_easy *data, Curl_set_in_callback(data, FALSE); switch(userresponse) { case CURL_CHUNK_BGN_FUNC_SKIP: - infof(data, "Wildcard - \"%s\" skipped by user", - finfo->filename); + infof(data, "Wildcard - \"%s\" skipped by user", finfo->filename); wildcard->state = CURLWC_SKIP; continue; case CURL_CHUNK_BGN_FUNC_FAIL: @@ -4130,10 +4116,9 @@ static size_t numof_slashes(const char *str) * Parse the URL path into separate path components. * */ -static -CURLcode ftp_parse_url_path(struct Curl_easy *data, - struct ftp_conn *ftpc, - struct FTP *ftp) +static CURLcode ftp_parse_url_path(struct Curl_easy *data, + struct ftp_conn *ftpc, + struct FTP *ftp) { const char *slashPos = NULL; const char *fileName = NULL; @@ -4155,78 +4140,78 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data, rawPath = ftpc->rawpath; switch(data->set.ftp_filemethod) { - case FTPFILE_NOCWD: /* fastest, but less standard-compliant */ + case FTPFILE_NOCWD: /* fastest, but less standard-compliant */ - if((pathLen > 0) && (rawPath[pathLen - 1] != '/')) - fileName = rawPath; /* this is a full file path */ - /* - else: ftpc->file is not used anywhere other than for operations on - a file. In other words, never for directory operations. - So we can safely leave filename as NULL here and use it as a - argument in dir/file decisions. - */ - break; + if((pathLen > 0) && (rawPath[pathLen - 1] != '/')) + fileName = rawPath; /* this is a full file path */ + /* + else: ftpc->file is not used anywhere other than for operations on + a file. In other words, never for directory operations. + So we can safely leave filename as NULL here and use it as a + argument in dir/file decisions. + */ + break; - case FTPFILE_SINGLECWD: - slashPos = strrchr(rawPath, '/'); - if(slashPos) { - /* get path before last slash, except for / */ - size_t dirlen = slashPos - rawPath; - if(dirlen == 0) - dirlen = 1; - - ftpc->dirs = curlx_calloc(1, sizeof(ftpc->dirs[0])); - if(!ftpc->dirs) - return CURLE_OUT_OF_MEMORY; - - ftpc->dirs[0].start = 0; - ftpc->dirs[0].len = (int)dirlen; - ftpc->dirdepth = 1; /* we consider it to be a single directory */ - fileName = slashPos + 1; /* rest is filename */ - } - else - fileName = rawPath; /* filename only (or empty) */ - break; + case FTPFILE_SINGLECWD: + slashPos = strrchr(rawPath, '/'); + if(slashPos) { + /* get path before last slash, except for / */ + size_t dirlen = slashPos - rawPath; + if(dirlen == 0) + dirlen = 1; - default: /* allow pretty much anything */ - case FTPFILE_MULTICWD: { - /* current position: begin of next path component */ - const char *curPos = rawPath; - - /* number of entries to allocate for the 'dirs' array */ - size_t dirAlloc = numof_slashes(rawPath); - - if(dirAlloc >= FTP_MAX_DIR_DEPTH) - /* suspiciously deep directory hierarchy */ - return CURLE_URL_MALFORMAT; - - if(dirAlloc) { - ftpc->dirs = curlx_calloc(dirAlloc, sizeof(ftpc->dirs[0])); - if(!ftpc->dirs) - return CURLE_OUT_OF_MEMORY; - - /* parse the URL path into separate path components */ - while(dirAlloc--) { - const char *spos = strchr(curPos, '/'); - size_t clen = spos - curPos; - - /* path starts with a slash: add that as a directory */ - if(!clen && (ftpc->dirdepth == 0)) - ++clen; - - /* we skip empty path components, like "x//y" since the FTP command - CWD requires a parameter and a non-existent parameter a) does not - work on many servers and b) has no effect on the others. */ - if(clen) { - ftpc->dirs[ftpc->dirdepth].start = (int)(curPos - rawPath); - ftpc->dirs[ftpc->dirdepth].len = (int)clen; - ftpc->dirdepth++; - } - curPos = spos + 1; + ftpc->dirs = curlx_calloc(1, sizeof(ftpc->dirs[0])); + if(!ftpc->dirs) + return CURLE_OUT_OF_MEMORY; + + ftpc->dirs[0].start = 0; + ftpc->dirs[0].len = (int)dirlen; + ftpc->dirdepth = 1; /* we consider it to be a single directory */ + fileName = slashPos + 1; /* rest is filename */ + } + else + fileName = rawPath; /* filename only (or empty) */ + break; + + default: /* allow pretty much anything */ + case FTPFILE_MULTICWD: { + /* current position: begin of next path component */ + const char *curPos = rawPath; + + /* number of entries to allocate for the 'dirs' array */ + size_t dirAlloc = numof_slashes(rawPath); + + if(dirAlloc >= FTP_MAX_DIR_DEPTH) + /* suspiciously deep directory hierarchy */ + return CURLE_URL_MALFORMAT; + + if(dirAlloc) { + ftpc->dirs = curlx_calloc(dirAlloc, sizeof(ftpc->dirs[0])); + if(!ftpc->dirs) + return CURLE_OUT_OF_MEMORY; + + /* parse the URL path into separate path components */ + while(dirAlloc--) { + const char *spos = strchr(curPos, '/'); + size_t clen = spos - curPos; + + /* path starts with a slash: add that as a directory */ + if(!clen && (ftpc->dirdepth == 0)) + ++clen; + + /* we skip empty path components, like "x//y" since the FTP command + CWD requires a parameter and a non-existent parameter a) does not + work on many servers and b) has no effect on the others. */ + if(clen) { + ftpc->dirs[ftpc->dirdepth].start = (int)(curPos - rawPath); + ftpc->dirs[ftpc->dirdepth].len = (int)clen; + ftpc->dirdepth++; } + curPos = spos + 1; } - fileName = curPos; /* the rest is the filename (or empty) */ } + fileName = curPos; /* the rest is the filename (or empty) */ + } break; } /* switch */ @@ -4327,11 +4312,10 @@ static CURLcode ftp_doing(struct Curl_easy *data, * ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the * ftp_done() function without finding any major problem. */ -static -CURLcode ftp_regular_transfer(struct Curl_easy *data, - struct ftp_conn *ftpc, - struct FTP *ftp, - bool *dophase_done) +static CURLcode ftp_regular_transfer(struct Curl_easy *data, + struct ftp_conn *ftpc, + struct FTP *ftp, + bool *dophase_done) { CURLcode result = CURLE_OK; bool connected = FALSE; diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index b62fa47f6542..5a1194613753 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -215,7 +215,6 @@ struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void) return curlx_calloc(1, sizeof(struct ftp_parselist_data)); } - void Curl_ftp_parselist_data_free(struct ftp_parselist_data **parserp) { struct ftp_parselist_data *parser = *parserp; @@ -225,13 +224,11 @@ void Curl_ftp_parselist_data_free(struct ftp_parselist_data **parserp) *parserp = NULL; } - CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data) { return pl_data->error; } - #define FTP_LP_MALFORMATED_PERM 0x01000000 static unsigned int ftp_pl_get_permission(const char *str) @@ -284,7 +281,7 @@ static unsigned int ftp_pl_get_permission(const char *str) if(str[7] == 'w') permissions |= 1 << 1; else if(str[7] != '-') - permissions |= FTP_LP_MALFORMATED_PERM; + permissions |= FTP_LP_MALFORMATED_PERM; if(str[8] == 'x') permissions |= 1; else if(str[8] == 't') { @@ -430,7 +427,6 @@ static CURLcode parse_unix_totalsize(struct ftp_parselist_data *parser, } else return CURLE_FTP_BAD_FILE_LIST; - } break; } @@ -487,7 +483,7 @@ static CURLcode parse_unix_hlinks(struct ftp_parselist_data *parser, } break; case PL_UNIX_HLINKS_NUMBER: - parser->item_length ++; + parser->item_length++; if(c == ' ') { const char *p = &mem[parser->item_offset]; curl_off_t hlinks; @@ -623,7 +619,7 @@ static CURLcode parse_unix_time(struct ftp_parselist_data *parser, case PL_UNIX_TIME_PREPART1: if(c != ' ') { if(ISALNUM(c) && len) { - parser->item_offset = len -1; + parser->item_offset = len - 1; parser->item_length = 1; parser->state.UNIX.sub.time = PL_UNIX_TIME_PART1; } @@ -668,7 +664,7 @@ static CURLcode parse_unix_time(struct ftp_parselist_data *parser, case PL_UNIX_TIME_PART3: parser->item_length++; if(c == ' ') { - mem[parser->item_offset + parser->item_length -1] = 0; + mem[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.time = parser->item_offset; if(finfo->filetype == CURLFILETYPE_SYMLINK) { parser->state.UNIX.main = PL_UNIX_SYMLINK; @@ -924,7 +920,7 @@ static CURLcode parse_winnt(struct Curl_easy *data, case PL_WINNT_TIME_TIME: if(c == ' ') { parser->offsets.time = parser->item_offset; - mem[parser->item_offset + parser->item_length -1] = 0; + mem[parser->item_offset + parser->item_length - 1] = 0; parser->state.NT.main = PL_WINNT_DIRORSIZE; parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_PRESPACE; parser->item_length = 0; @@ -944,7 +940,7 @@ static CURLcode parse_winnt(struct Curl_easy *data, } break; case PL_WINNT_DIRORSIZE_CONTENT: - parser->item_length ++; + parser->item_length++; if(c == ' ') { mem[parser->item_offset + parser->item_length - 1] = 0; if(strcmp("", mem + parser->item_offset) == 0) { @@ -972,7 +968,7 @@ static CURLcode parse_winnt(struct Curl_easy *data, switch(parser->state.NT.sub.filename) { case PL_WINNT_FILENAME_PRESPACE: if(c != ' ' && len) { - parser->item_offset = len -1; + parser->item_offset = len - 1; parser->item_length = 1; parser->state.NT.sub.filename = PL_WINNT_FILENAME_CONTENT; } @@ -1020,7 +1016,7 @@ static CURLcode parse_winnt(struct Curl_easy *data, size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) { - size_t bufflen = size*nmemb; + size_t bufflen = size * nmemb; struct Curl_easy *data = (struct Curl_easy *)connptr; struct ftp_wc *ftpwc = data->wildcard->ftpwc; struct ftp_parselist_data *parser = ftpwc->parser; diff --git a/lib/getinfo.c b/lib/getinfo.c index 14244d087b06..13e9622d3302 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -128,7 +128,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, *param_charp = data->info.contenttype; break; case CURLINFO_PRIVATE: - *param_charp = (char *) data->set.private_data; + *param_charp = (char *)data->set.private_data; break; case CURLINFO_FTP_ENTRY_PATH: /* Return the entrypath string from the most recent connection. @@ -375,7 +375,7 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, return CURLE_OK; } -#define DOUBLE_SECS(x) (double)(x)/1000000 +#define DOUBLE_SECS(x) (double)(x) / 1000000 static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, curl_off_t *param_offt) @@ -577,20 +577,19 @@ static CURLcode getinfo_slist(struct Curl_easy *data, CURLINFO info, *param_slistp = ptr.to_slist; break; case CURLINFO_TLS_SESSION: - case CURLINFO_TLS_SSL_PTR: - { - struct curl_tlssessioninfo **tsip = (struct curl_tlssessioninfo **) - param_slistp; - struct curl_tlssessioninfo *tsi = &data->tsi; - - /* we are exposing a pointer to internal memory with unknown - * lifetime here. */ - *tsip = tsi; - if(!Curl_conn_get_ssl_info(data, data->conn, FIRSTSOCKET, tsi)) { - tsi->backend = Curl_ssl_backend(); - tsi->internals = NULL; - } + case CURLINFO_TLS_SSL_PTR: { + struct curl_tlssessioninfo **tsip = (struct curl_tlssessioninfo **) + param_slistp; + struct curl_tlssessioninfo *tsi = &data->tsi; + + /* we are exposing a pointer to internal memory with unknown + * lifetime here. */ + *tsip = tsi; + if(!Curl_conn_get_ssl_info(data, data->conn, FIRSTSOCKET, tsi)) { + tsi->backend = Curl_ssl_backend(); + tsi->internals = NULL; } + } break; default: return CURLE_UNKNOWN_OPTION; diff --git a/lib/optiontable.pl b/lib/optiontable.pl index 43fbd39d3bfc..54b86d72e1ed 100755 --- a/lib/optiontable.pl +++ b/lib/optiontable.pl @@ -131,19 +131,19 @@ sub add { $name = $alias{$name}; $flag = "CURLOT_FLAG_ALIAS"; } - my $o = sprintf(" {\"%s\", %s, %s, %s},\n", + my $o = sprintf(" { \"%s\", %s, %s, %s },\n", $oname, $opt{$name}, $type{$name}, $flag); if(length($o) < 80) { print $o; } else { - printf(" {\"%s\", %s,\n %s, %s},\n", - $oname, $opt{$name}, $type{$name}, $flag); + printf(" { \"%s\", %s,\n %s, %s },\n", + $oname, $opt{$name}, $type{$name}, $flag); } } print < Date: Tue, 2 Dec 2025 14:26:31 +0100 Subject: [PATCH 634/885] pytest: improve stragglers A fix for the tests that took the longest: - test_05: make the server close the HTTP/1.1 connection when simulating an error during a download. This eliminates waiting for a keepalive timeout - test_02: pause tests with slightly smaller documents, eliminate special setup for HTTP/2. We test stream window handling now elsewhere already - cli_hx_download: run look in 500ms steps instead of 1sec, resuming paused tranfers earlier. Closes #19809 --- docs/libcurl/libcurl-env-dbg.md | 5 ---- lib/http2.c | 23 -------------- tests/http/test_02_download.py | 30 ++----------------- .../http/testenv/mod_curltest/mod_curltest.c | 4 +++ tests/libtest/cli_hx_download.c | 2 +- 5 files changed, 7 insertions(+), 57 deletions(-) diff --git a/docs/libcurl/libcurl-env-dbg.md b/docs/libcurl/libcurl-env-dbg.md index 3fcc1935d5ee..ce6b480ae305 100644 --- a/docs/libcurl/libcurl-env-dbg.md +++ b/docs/libcurl/libcurl-env-dbg.md @@ -164,8 +164,3 @@ Make a blocking, graceful shutdown of all remaining connections when a multi handle is destroyed. This implicitly triggers for easy handles that are run via easy_perform. The value of the environment variable gives the shutdown timeout in milliseconds. - -## `CURL_H2_STREAM_WIN_MAX` - -Set to a positive 32-bit number to override the HTTP/2 stream window's -default of 10MB. Used in testing to verify correct window update handling. diff --git a/lib/http2.c b/lib/http2.c index e75d7431e72c..38c7d82785fe 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -111,9 +111,6 @@ struct cf_h2_ctx { uint32_t goaway_error; /* goaway error code from server */ int32_t remote_max_sid; /* max id processed by server */ int32_t local_max_sid; /* max id processed by us */ -#ifdef DEBUGBUILD - int32_t stream_win_max; /* max h2 stream window size */ -#endif BIT(initialized); BIT(via_h1_upgrade); BIT(conn_closed); @@ -139,18 +136,6 @@ static void cf_h2_ctx_init(struct cf_h2_ctx *ctx, bool via_h1_upgrade) Curl_uint32_hash_init(&ctx->streams, 63, h2_stream_hash_free); ctx->remote_max_sid = 2147483647; ctx->via_h1_upgrade = via_h1_upgrade; -#ifdef DEBUGBUILD - { - const char *p = getenv("CURL_H2_STREAM_WIN_MAX"); - - ctx->stream_win_max = H2_STREAM_WINDOW_SIZE_MAX; - if(p) { - curl_off_t l; - if(!curlx_str_number(&p, &l, INT_MAX)) - ctx->stream_win_max = (int32_t)l; - } - } -#endif ctx->initialized = TRUE; } @@ -330,15 +315,7 @@ static int32_t cf_h2_get_desired_local_win(struct Curl_cfilter *cf, else if(avail < INT32_MAX) return (int32_t)avail; } -#ifdef DEBUGBUILD - { - struct cf_h2_ctx *ctx = cf->ctx; - CURL_TRC_CF(data, cf, "stream_win_max=%d", ctx->stream_win_max); - return ctx->stream_win_max; - } -#else return H2_STREAM_WINDOW_SIZE_MAX; -#endif } static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf, diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 9fbc116caf0a..269ff6cf2695 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -277,12 +277,10 @@ def test_02_20_h2_small_frames(self, env: Env, httpd, configures_httpd): # download serial via lib client, pause/resume at different offsets @pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000]) - @pytest.mark.parametrize("proto", ['http/1.1', 'h3']) + @pytest.mark.parametrize("proto", Env.http_protos()) def test_02_21_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset): - if proto == 'h3' and not env.have_h3(): - pytest.skip("h3 not supported") count = 2 - docname = 'data-10m' + docname = 'data-1m' url = f'https://localhost:{env.https_port}/{docname}' client = LocalClient(name='cli_hx_download', env=env) if not client.exists(): @@ -294,30 +292,6 @@ def test_02_21_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset): srcfile = os.path.join(httpd.docs_dir, docname) self.check_downloads(client, srcfile, count) - # h2 download parallel via lib client, pause/resume at different offsets - # debug-override stream window size to reproduce #16955 - @pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000]) - @pytest.mark.parametrize("swin_max", [0, 10*1024]) - @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") - def test_02_21_h2_lib_serial(self, env: Env, httpd, pause_offset, swin_max): - proto = 'h2' - count = 2 - docname = 'data-10m' - url = f'https://localhost:{env.https_port}/{docname}' - run_env = os.environ.copy() - run_env['CURL_DEBUG'] = 'multi,http/2' - if swin_max > 0: - run_env['CURL_H2_STREAM_WIN_MAX'] = f'{swin_max}' - client = LocalClient(name='cli_hx_download', env=env, run_env=run_env) - if not client.exists(): - pytest.skip(f'example client not built: {client.name}') - r = client.run(args=[ - '-n', f'{count}', '-P', f'{pause_offset}', '-V', proto, url - ]) - r.check_exit_code(0) - srcfile = os.path.join(httpd.docs_dir, docname) - self.check_downloads(client, srcfile, count) - # download via lib client, several at a time, pause/resume @pytest.mark.parametrize("pause_offset", [100*1023]) @pytest.mark.parametrize("proto", Env.http_protos()) diff --git a/tests/http/testenv/mod_curltest/mod_curltest.c b/tests/http/testenv/mod_curltest/mod_curltest.c index b45fd95286b2..76ce5f459721 100644 --- a/tests/http/testenv/mod_curltest/mod_curltest.c +++ b/tests/http/testenv/mod_curltest/mod_curltest.c @@ -570,6 +570,10 @@ static int curltest_tweak_handler(request_rec *r) APR_BRIGADE_INSERT_TAIL(bb, b); ap_pass_brigade(r->output_filters, bb); } + if(rv == APR_ECONNRESET) { + r->connection->aborted = 1; + return rv; + } return AP_FILTER_ERROR; } diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index 2a3614412369..d139ea28f772 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -449,7 +449,7 @@ static CURLcode test_cli_hx_download(const char *URL) if(still_running) { /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi, NULL, 0, 1000, NULL); + mc = curl_multi_poll(multi, NULL, 0, 500, NULL); } if(mc) From aba3c63ae8323e68149417d1a56ea7b43b842814 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 1 Dec 2025 12:48:55 +0100 Subject: [PATCH 635/885] pytest: fix and improve reliability Address issues listed in #19770: - allow for ngttpx to successfully shut down on last attempt that might extend beyond the finish timestamp - timeline checks: allos `time_starttransfer` to appear anywhere in the timeline as a slow client might seen response data before setting the other counters - dump logs on test_05_02 as it was not reproduced locally Fixes #19970 Closes #19783 --- tests/http/test_01_basic.py | 5 +++-- tests/http/test_05_errors.py | 4 ++-- tests/http/testenv/curl.py | 11 +++++++++-- tests/http/testenv/nghttpx.py | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/http/test_01_basic.py b/tests/http/test_01_basic.py index 14a8dec957fc..eb328ea73390 100644 --- a/tests/http/test_01_basic.py +++ b/tests/http/test_01_basic.py @@ -308,13 +308,14 @@ def test_01_20_method_space(self, env: Env, proto, httpd): url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo' r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True, extra_args=['-X', method]) - assert len(r.stats) == 1 if proto == 'h2' or proto == 'h3': - r.check_response(http_status=0) + # h2+3 may close the connection for such invalid requests re_m = re.compile(r'.*\[:method: ([^\]]+)\].*') lines = [line for line in r.trace_lines if re_m.match(line)] assert len(lines) == 1, f'{r.dump_logs()}' m = re_m.match(lines[0]) assert m.group(1) == method, f'{r.dump_logs()}' else: + # h1 should give us a real response + assert len(r.stats) == 1 r.check_response(http_status=400) diff --git a/tests/http/test_05_errors.py b/tests/http/test_05_errors.py index 258b7f11d5e5..102b92e20256 100644 --- a/tests/http/test_05_errors.py +++ b/tests/http/test_05_errors.py @@ -73,8 +73,8 @@ def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): invalid_stats = [] for idx, s in enumerate(r.stats): if 'exitcode' not in s or s['exitcode'] not in [18, 55, 56, 92, 95]: - invalid_stats.append(f'request {idx} exit with {s["exitcode"]}\n{s}') - assert len(invalid_stats) == 0, f'failed: {invalid_stats}' + invalid_stats.append(f'request {idx} exit with {s["exitcode"]}\n{r.dump_logs()}') + assert len(invalid_stats) == 0, f'failed: {invalid_stats}\n{r.dump_logs()}' # access a resource that, on h2, RST the stream with HTTP_1_1_REQUIRED @pytest.mark.skipif(condition=not Env.have_h2_curl(), reason="curl without h2") diff --git a/tests/http/testenv/curl.py b/tests/http/testenv/curl.py index e486715fa79b..f54170baba58 100644 --- a/tests/http/testenv/curl.py +++ b/tests/http/testenv/curl.py @@ -525,6 +525,7 @@ def check_stats_timeline(self, idx): } # stat keys where we expect a positive value ref_tl = [] + somewhere_keys = [] exact_match = True # redirects mess up the queue time, only count without if s['time_redirect'] == 0: @@ -542,10 +543,13 @@ def check_stats_timeline(self, idx): # what kind of transfer was it? if s['size_upload'] == 0 and s['size_download'] > 0: # this is a download - dl_tl = ['time_pretransfer', 'time_starttransfer'] + dl_tl = ['time_pretransfer'] if s['size_request'] > 0: dl_tl = ['time_posttransfer'] + dl_tl ref_tl += dl_tl + # the first byte of the response may arrive before we + # track the other times when the client is slow (CI). + somewhere_keys = ['time_starttransfer'] elif s['size_upload'] > 0 and s['size_download'] == 0: # this is an upload ul_tl = ['time_pretransfer', 'time_posttransfer'] @@ -561,11 +565,14 @@ def check_stats_timeline(self, idx): self.check_stat_positive(s, idx, key) if exact_match: # assert all events not in reference timeline are 0 - for key in [key for key in all_keys if key not in ref_tl]: + for key in [key for key in all_keys if key not in ref_tl and key not in somewhere_keys]: self.check_stat_zero(s, key) # calculate the timeline that did happen seen_tl = sorted(ref_tl, key=lambda ts: s[ts]) assert seen_tl == ref_tl, f'{[f"{ts}: {s[ts]}" for ts in seen_tl]}' + for key in somewhere_keys: + self.check_stat_positive(s, idx, key) + assert s[key] <= s['time_total'] def dump_logs(self): lines = ['>>--stdout ----------------------------------------------\n'] diff --git a/tests/http/testenv/nghttpx.py b/tests/http/testenv/nghttpx.py index 6db888b901be..106766fc0fe7 100644 --- a/tests/http/testenv/nghttpx.py +++ b/tests/http/testenv/nghttpx.py @@ -138,7 +138,7 @@ def reload(self, timeout: timedelta = timedelta(seconds=Env.SERVER_TIMEOUT)): except subprocess.TimeoutExpired: log.warning(f'nghttpx({running.pid}), not shut down yet.') os.kill(running.pid, signal.SIGQUIT) - if datetime.now() >= end_wait: + if running and datetime.now() >= end_wait: log.error(f'nghttpx({running.pid}), terminate forcefully.') os.kill(running.pid, signal.SIGKILL) running.terminate() From d993d46eb14234e36a15288d25dccc6107a6733f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Dec 2025 03:06:39 +0100 Subject: [PATCH 636/885] GHA/windows: install MSYS2 c-ares only when used Closes #19820 --- .github/workflows/windows.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d4019ed176cb..d2e97851fc69 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -204,8 +204,8 @@ jobs: - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '' , config: '--with-openssl', install: 'openssl-devel libssh2-devel', name: 'default R' } # MinGW - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: 'skiprun', config: '--enable-debug --with-openssl --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib CPPFLAGS=-D_WIN32_WINNT=0x0501', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-libssh2', name: 'default XP' } - - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --enable-windows-unicode --enable-ares --with-openssl-quic --enable-shared=no', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-nghttp3 mingw-w64-x86_64-libssh2', name: 'c-ares U' } - - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', install: 'mingw-w64-x86_64-libssh2', type: 'Debug', name: 'schannel c-ares U' } + - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --enable-windows-unicode --enable-ares --with-openssl-quic --enable-shared=no', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-openssl mingw-w64-x86_64-nghttp3 mingw-w64-x86_64-libssh2', name: 'c-ares U' } + - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-libssh2', type: 'Debug', name: 'schannel c-ares U' } # WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to # read its configuration from, making it vulnerable to attacks on # Windows. Do not use this component till there is a fix for these. @@ -244,7 +244,6 @@ jobs: mingw-w64-${{ matrix.env }}-${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || '' }} mingw-w64-${{ matrix.env }}-diffutils mingw-w64-${{ matrix.env }}-libpsl - mingw-w64-${{ matrix.env }}-c-ares ${{ matrix.install }} - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 From dc8c0d54a51961bbdea25fafa4c381d10f27cf9c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2025 17:46:52 +0100 Subject: [PATCH 637/885] test3207: enable memdebug for this test again Closes #19813 --- tests/data/test3207 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test3207 b/tests/data/test3207 index 9aa3ee5a365f..4806ef5474d6 100644 --- a/tests/data/test3207 +++ b/tests/data/test3207 @@ -37,7 +37,7 @@ concurrent HTTPS GET using shared ssl session cache lib%TESTNUMBER # provide URL and ca-cert - + https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt From c3b030b860a2c1b2a74e032bb82b981d2f806249 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 2 Dec 2025 07:25:18 +0100 Subject: [PATCH 638/885] lib: fix formatting nits (part 3) From `lib/h` to `lib/w`. part 1: 47a1ab2ebecb21485c0e955316d90511e80a3c43 #19764 part 2: 86b346443b68cde7ef33e1ab770e6c8ab641d2b1 #19800 Closes #19811 --- lib/hash.c | 41 ++--- lib/hash.h | 23 ++- lib/headers.c | 3 +- lib/headers.h | 6 +- lib/hmac.c | 16 +- lib/hostip.c | 61 +++---- lib/hostip.h | 9 +- lib/hostip4.c | 10 +- lib/hsts.c | 16 +- lib/hsts.h | 4 +- lib/http.c | 148 +++++++--------- lib/http.h | 18 +- lib/http1.c | 6 +- lib/http2.c | 174 +++++++++---------- lib/http2.h | 8 +- lib/http_aws_sigv4.c | 59 +++---- lib/http_aws_sigv4.h | 3 +- lib/http_chunks.c | 4 +- lib/http_digest.c | 2 +- lib/http_negotiate.c | 5 +- lib/http_ntlm.c | 12 +- lib/http_proxy.c | 27 +-- lib/http_proxy.h | 2 +- lib/httpsrr.c | 1 - lib/httpsrr.h | 2 +- lib/idn.c | 20 +-- lib/if2ip.c | 25 ++- lib/if2ip.h | 16 +- lib/imap.c | 145 +++++++++------- lib/imap.h | 3 +- lib/ldap.c | 22 ++- lib/llist.c | 25 ++- lib/llist.h | 4 +- lib/md4.c | 71 ++++---- lib/md5.c | 62 ++++--- lib/memdebug.c | 14 +- lib/mime.c | 138 +++++++-------- lib/mime.h | 11 +- lib/mprintf.c | 62 ++++--- lib/mqtt.c | 22 +-- lib/multi.c | 178 ++++++++----------- lib/multi_ev.c | 40 ++--- lib/multi_ntfy.c | 4 +- lib/multi_ntfy.h | 9 +- lib/multiif.h | 1 - lib/netrc.c | 10 +- lib/netrc.h | 12 +- lib/noproxy.c | 10 +- lib/openldap.c | 39 ++--- lib/parsedate.c | 182 +++++++++---------- lib/pingpong.c | 1 - lib/pingpong.h | 10 +- lib/pop3.c | 20 +-- lib/progress.c | 25 ++- lib/psl.c | 2 +- lib/rand.c | 9 +- lib/rand.h | 7 +- lib/ratelimit.c | 2 +- lib/request.c | 4 +- lib/request.h | 1 - lib/rtsp.c | 33 ++-- lib/rtsp.h | 2 +- lib/select.c | 36 ++-- lib/select.h | 61 ++++--- lib/sendf.c | 15 +- lib/sendf.h | 20 +-- lib/setopt.c | 76 ++++---- lib/setopt.h | 2 +- lib/setup-os400.h | 9 +- lib/setup-vms.h | 385 +++++++++++++++++++++-------------------- lib/sha256.c | 103 +++++------ lib/sigpipe.h | 12 +- lib/slist.c | 13 +- lib/smb.c | 42 ++--- lib/smtp.c | 61 ++++--- lib/socketpair.h | 18 +- lib/socks.c | 51 +++--- lib/socks.h | 6 +- lib/socks_gssapi.c | 12 +- lib/socks_sspi.c | 12 +- lib/splay.c | 6 +- lib/strcase.c | 76 ++++---- lib/strcase.h | 2 +- lib/strdup.h | 2 +- lib/strerror.c | 192 ++++++++++----------- lib/system_win32.c | 2 +- lib/telnet.c | 403 +++++++++++++++++++++---------------------- lib/tftp.c | 22 +-- lib/transfer.c | 18 +- lib/transfer.h | 3 +- lib/uint-bset.c | 10 +- lib/uint-bset.h | 3 +- lib/uint-hash.c | 7 +- lib/uint-hash.h | 2 - lib/uint-spbset.c | 6 - lib/uint-table.c | 11 -- lib/url.c | 112 ++++++------ lib/urlapi.c | 68 +++++--- lib/urldata.h | 130 +++++++------- lib/version.c | 6 +- lib/ws.c | 300 ++++++++++++++++---------------- lib/ws.h | 5 +- 102 files changed, 1998 insertions(+), 2223 deletions(-) diff --git a/lib/hash.c b/lib/hash.c index 2d91c855e614..b9e9d702e3cc 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -37,8 +37,7 @@ #if 0 /* useful function for debugging hashes and their contents */ -void Curl_hash_print(struct Curl_hash *h, - void (*func)(void *)) +void Curl_hash_print(struct Curl_hash *h, void (*func)(void *)) { struct Curl_hash_iterator iter; struct Curl_hash_element *he; @@ -80,12 +79,11 @@ void Curl_hash_print(struct Curl_hash *h, * @unittest: 1602 * @unittest: 1603 */ -void -Curl_hash_init(struct Curl_hash *h, - size_t slots, - hash_function hfunc, - comp_function comparator, - Curl_hash_dtor dtor) +void Curl_hash_init(struct Curl_hash *h, + size_t slots, + hash_function hfunc, + comp_function comparator, + Curl_hash_dtor dtor) { DEBUGASSERT(h); DEBUGASSERT(slots); @@ -104,9 +102,10 @@ Curl_hash_init(struct Curl_hash *h, #endif } -static struct Curl_hash_element * -hash_elem_create(const void *key, size_t key_len, const void *p, - Curl_hash_elem_dtor dtor) +static struct Curl_hash_element *hash_elem_create(const void *key, + size_t key_len, + const void *p, + Curl_hash_elem_dtor dtor) { struct Curl_hash_element *he; @@ -161,8 +160,8 @@ static void hash_elem_link(struct Curl_hash *h, ++h->size; } -#define CURL_HASH_SLOT(x,y,z) x->table[x->hash_func(y, z, x->slots)] -#define CURL_HASH_SLOT_ADDR(x,y,z) &CURL_HASH_SLOT(x,y,z) +#define CURL_HASH_SLOT(x, y, z) x->table[x->hash_func(y, z, x->slots)] +#define CURL_HASH_SLOT_ADDR(x, y, z) &CURL_HASH_SLOT(x, y, z) void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, Curl_hash_elem_dtor dtor) @@ -205,8 +204,7 @@ void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, * @unittest: 1602 * @unittest: 1603 */ -void * -Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) +void *Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) { return Curl_hash_add2(h, key, key_len, p, NULL); } @@ -242,8 +240,7 @@ int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len) * * @unittest: 1603 */ -void * -Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len) +void *Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len) { DEBUGASSERT(h); DEBUGASSERT(h->init == HASHINIT); @@ -268,8 +265,7 @@ Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len) * @unittest: 1602 * @unittest: 1603 */ -void -Curl_hash_destroy(struct Curl_hash *h) +void Curl_hash_destroy(struct Curl_hash *h) { DEBUGASSERT(h->init == HASHINIT); if(h->table) { @@ -308,9 +304,8 @@ size_t Curl_hash_count(struct Curl_hash *h) } /* Cleans all entries that pass the comp function criteria. */ -void -Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, - int (*comp)(void *, void *)) +void Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, + int (*comp)(void *, void *)) { size_t i; @@ -335,7 +330,7 @@ Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num) { - const char *key_str = (const char *) key; + const char *key_str = (const char *)key; const char *end = key_str + key_length; size_t h = 5381; diff --git a/lib/hash.h b/lib/hash.h index fcd92db6645d..b9974826b03c 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -31,17 +31,17 @@ #include "llist.h" /* Hash function prototype */ -typedef size_t (*hash_function) (void *key, - size_t key_length, - size_t slots_num); +typedef size_t (*hash_function)(void *key, + size_t key_length, + size_t slots_num); /* Comparator function prototype. Compares two keys. */ -typedef size_t (*comp_function) (void *key1, - size_t key1_len, - void *key2, - size_t key2_len); +typedef size_t (*comp_function)(void *key1, + size_t key1_len, + void *key2, + size_t key2_len); typedef void (*Curl_hash_dtor)(void *); @@ -49,10 +49,10 @@ typedef void (*Curl_hash_elem_dtor)(void *key, size_t key_len, void *p); struct Curl_hash_element { struct Curl_hash_element *next; - void *ptr; + void *ptr; Curl_hash_elem_dtor dtor; size_t key_len; - char key[1]; /* allocated memory following the struct */ + char key[1]; /* allocated memory following the struct */ }; struct Curl_hash { @@ -63,7 +63,7 @@ struct Curl_hash { /* Comparator function to compare keys */ comp_function comp_func; /* General element construct, unless element itself carries one */ - Curl_hash_dtor dtor; + Curl_hash_dtor dtor; size_t slots; size_t size; #ifdef DEBUGBUILD @@ -105,7 +105,6 @@ void Curl_hash_start_iterate(struct Curl_hash *hash, struct Curl_hash_element * Curl_hash_next_element(struct Curl_hash_iterator *iter); -void Curl_hash_print(struct Curl_hash *h, - void (*func)(void *)); +void Curl_hash_print(struct Curl_hash *h, void (*func)(void *)); #endif /* HEADER_CURL_HASH_H */ diff --git a/lib/headers.c b/lib/headers.c index 91715fd51d3a..7cf215c0800e 100644 --- a/lib/headers.c +++ b/lib/headers.c @@ -69,7 +69,7 @@ CURLHcode curl_easy_header(CURL *easy, struct Curl_header_store *hs = NULL; struct Curl_header_store *pick = NULL; if(!name || !hout || !data || - (type > (CURLH_HEADER|CURLH_TRAILER|CURLH_CONNECT|CURLH_1XX| + (type > (CURLH_HEADER | CURLH_TRAILER | CURLH_CONNECT | CURLH_1XX | CURLH_PSEUDO)) || !type || (request < -1)) return CURLHE_BAD_ARGUMENT; if(!Curl_llist_count(&data->state.httphdrs)) @@ -264,7 +264,6 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value, return CURLE_OK; } - /* * Curl_headers_push() gets passed a full HTTP header to store. It gets called * immediately before the header callback. The header is CRLF terminated. diff --git a/lib/headers.h b/lib/headers.h index e11fe9804e51..7249355f0ccd 100644 --- a/lib/headers.h +++ b/lib/headers.h @@ -54,9 +54,9 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, CURLcode Curl_headers_cleanup(struct Curl_easy *data); #else -#define Curl_headers_init(x) CURLE_OK -#define Curl_headers_push(x,y,z) CURLE_OK -#define Curl_headers_cleanup(x) Curl_nop_stmt +#define Curl_headers_init(x) CURLE_OK +#define Curl_headers_push(x, y, z) CURLE_OK +#define Curl_headers_cleanup(x) Curl_nop_stmt #endif #endif /* HEADER_CURL_HEADER_H */ diff --git a/lib/hmac.c b/lib/hmac.c index 4f226e6434f8..fdde19717539 100644 --- a/lib/hmac.c +++ b/lib/hmac.c @@ -46,10 +46,9 @@ static const unsigned char hmac_ipad = 0x36; static const unsigned char hmac_opad = 0x5C; -struct HMAC_context * -Curl_HMAC_init(const struct HMAC_params *hashparams, - const unsigned char *key, - unsigned int keylen) +struct HMAC_context *Curl_HMAC_init(const struct HMAC_params *hashparams, + const unsigned char *key, + unsigned int keylen) { size_t i; struct HMAC_context *ctxt; @@ -64,15 +63,15 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, return ctxt; ctxt->hash = hashparams; - ctxt->hashctxt1 = (void *) (ctxt + 1); - ctxt->hashctxt2 = (void *) ((char *) ctxt->hashctxt1 + hashparams->ctxtsize); + ctxt->hashctxt1 = (void *)(ctxt + 1); + ctxt->hashctxt2 = (void *)((char *)ctxt->hashctxt1 + hashparams->ctxtsize); /* If the key is too long, replace it by its hash digest. */ if(keylen > hashparams->maxkeylen) { if(hashparams->hinit(ctxt->hashctxt1)) goto fail; hashparams->hupdate(ctxt->hashctxt1, key, keylen); - hkey = (unsigned char *) ctxt->hashctxt2 + hashparams->ctxtsize; + hkey = (unsigned char *)ctxt->hashctxt2 + hashparams->ctxtsize; hashparams->hfinal(hkey, ctxt->hashctxt1); key = hkey; keylen = hashparams->resultlen; @@ -112,7 +111,6 @@ int Curl_HMAC_update(struct HMAC_context *ctxt, return 0; } - int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output) { const struct HMAC_params *hashparams = ctxt->hash; @@ -121,7 +119,7 @@ int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output) storage. */ if(!output) - output = (unsigned char *) ctxt->hashctxt2 + ctxt->hash->ctxtsize; + output = (unsigned char *)ctxt->hashctxt2 + ctxt->hash->ctxtsize; hashparams->hfinal(output, ctxt->hashctxt1); hashparams->hupdate(ctxt->hashctxt2, output, hashparams->resultlen); diff --git a/lib/hostip.c b/lib/hostip.c index e81886995eda..ba9e3ddd7ac9 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -118,7 +118,7 @@ static void dnscache_entry_free(struct Curl_dns_entry *dns); static void show_resolve_info(struct Curl_easy *data, struct Curl_dns_entry *dns); #else -#define show_resolve_info(x,y) Curl_nop_stmt +#define show_resolve_info(x, y) Curl_nop_stmt #endif /* @@ -158,10 +158,9 @@ void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf, * Create a hostcache id string for the provided host + port, to be used by * the DNS caching. Without alloc. Return length of the id string. */ -static size_t -create_dnscache_id(const char *name, - size_t nlen, /* 0 or actual name length */ - int port, char *ptr, size_t buflen) +static size_t create_dnscache_id(const char *name, + size_t nlen, /* 0 or actual name length */ + int port, char *ptr, size_t buflen) { size_t len = nlen ? nlen : strlen(name); DEBUGASSERT(buflen >= MAX_HOSTCACHE_LEN); @@ -185,12 +184,10 @@ struct dnscache_prune_data { * Returning non-zero means remove the entry, return 0 to keep it in the * cache. */ -static int -dnscache_entry_is_stale(void *datap, void *hc) +static int dnscache_entry_is_stale(void *datap, void *hc) { - struct dnscache_prune_data *prune = - (struct dnscache_prune_data *) datap; - struct Curl_dns_entry *dns = (struct Curl_dns_entry *) hc; + struct dnscache_prune_data *prune = (struct dnscache_prune_data *)datap; + struct Curl_dns_entry *dns = (struct Curl_dns_entry *)hc; if(dns->timestamp.tv_sec || dns->timestamp.tv_usec) { /* get age in milliseconds */ @@ -209,9 +206,9 @@ dnscache_entry_is_stale(void *datap, void *hc) * Prune the DNS cache. This assumes that a lock has already been taken. * Returns the 'age' of the oldest still kept entry - in milliseconds. */ -static timediff_t -dnscache_prune(struct Curl_hash *hostcache, timediff_t cache_timeout_ms, - struct curltime now) +static timediff_t dnscache_prune(struct Curl_hash *hostcache, + timediff_t cache_timeout_ms, + struct curltime now) { struct dnscache_prune_data user; @@ -389,11 +386,10 @@ static struct Curl_dns_entry *fetch_addr(struct Curl_easy *data, * The returned data *MUST* be "released" with Curl_resolv_unlink() after * use, or we will leak memory! */ -struct Curl_dns_entry * -Curl_dnscache_get(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version) +struct Curl_dns_entry *Curl_dnscache_get(struct Curl_easy *data, + const char *hostname, + int port, + int ip_version) { struct Curl_dnscache *dnscache = dnscache_get(data); struct Curl_dns_entry *dns = NULL; @@ -447,7 +443,7 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, struct Curl_addrinfo **nodes; infof(data, "Shuffling %i addresses", num_addrs); - nodes = curlx_malloc(num_addrs*sizeof(*nodes)); + nodes = curlx_malloc(num_addrs * sizeof(*nodes)); if(nodes) { int i; unsigned int *rnd; @@ -456,7 +452,7 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, /* build a plain array of Curl_addrinfo pointers */ nodes[0] = *addr; for(i = 1; i < num_addrs; i++) { - nodes[i] = nodes[i-1]->ai_next; + nodes[i] = nodes[i - 1]->ai_next; } rnd = curlx_malloc(rnd_size); @@ -472,10 +468,10 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, /* relink list in the new order */ for(i = 1; i < num_addrs; i++) { - nodes[i-1]->ai_next = nodes[i]; + nodes[i - 1]->ai_next = nodes[i]; } - nodes[num_addrs-1]->ai_next = NULL; + nodes[num_addrs - 1]->ai_next = NULL; *addr = nodes[0]; } curlx_free(rnd); @@ -632,7 +628,7 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name) return ca; } #else -#define get_localhost6(x,y) NULL +#define get_localhost6(x, y) NULL #endif /* return a static IPv4 127.0.0.1 for the given name */ @@ -727,7 +723,6 @@ bool Curl_host_is_ipnum(const char *hostname) return FALSE; } - /* return TRUE if 'part' is a case insensitive tail of 'full' */ static bool tailmatch(const char *full, size_t flen, const char *part, size_t plen) @@ -980,8 +975,7 @@ CURLcode Curl_resolv_blocking(struct Curl_easy *data, * execution. This effectively causes the remainder of the application to run * within a signal handler which is nonportable and could lead to problems. */ -CURL_NORETURN static -void alarmfunc(int sig) +CURL_NORETURN static void alarmfunc(int sig) { (void)sig; siglongjmp(curl_jmpenv, 1); @@ -1018,7 +1012,7 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, { #ifdef USE_ALARM_TIMEOUT #ifdef HAVE_SIGACTION - struct sigaction keep_sigact; /* store the old struct here */ + struct sigaction keep_sigact; /* store the old struct here */ volatile bool keep_copysig = FALSE; /* whether old sigact has been saved */ struct sigaction sigact; #else @@ -1058,8 +1052,8 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, /* The alarm() function only provides integer second resolution, so if we want to wait less than one second we must bail out already now. */ failf(data, - "remaining timeout of %ld too small to resolve via SIGALRM method", - timeout); + "remaining timeout of %ld too small to resolve via SIGALRM method", + timeout); return CURLE_OPERATION_TIMEDOUT; } /* This allows us to time-out from the name resolver, as the timeout @@ -1101,7 +1095,7 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, /* alarm() makes a signal get sent when the timeout fires off, and that will abort system calls */ - prev_alarm = alarm(curlx_sltoui(timeout/1000L)); + prev_alarm = alarm(curlx_sltoui(timeout / 1000L)); } #else /* !USE_ALARM_TIMEOUT */ @@ -1151,7 +1145,7 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, unsigned long alarm_set = (unsigned long)(prev_alarm - elapsed_secs); if(!alarm_set || - ((alarm_set >= 0x80000000) && (prev_alarm < 0x80000000)) ) { + ((alarm_set >= 0x80000000) && (prev_alarm < 0x80000000))) { /* if the alarm time-left reached zero or turned "negative" (counted with unsigned values), we should fire off a SIGALRM here, but we will not, and zero would be to switch it off so we never set it to @@ -1203,7 +1197,7 @@ void Curl_resolv_unlink(struct Curl_easy *data, struct Curl_dns_entry **pdns) static void dnscache_entry_dtor(void *entry) { - struct Curl_dns_entry *dns = (struct Curl_dns_entry *) entry; + struct Curl_dns_entry *dns = (struct Curl_dns_entry *)entry; DEBUGASSERT(dns && (dns->refcount > 0)); dns->refcount--; if(dns->refcount == 0) @@ -1361,8 +1355,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) error = FALSE; err: if(error) { - failf(data, "Could not parse CURLOPT_RESOLVE entry '%s'", - hostp->data); + failf(data, "Could not parse CURLOPT_RESOLVE entry '%s'", hostp->data); Curl_freeaddrinfo(head); return CURLE_SETOPT_OPTION_SYNTAX; } diff --git a/lib/hostip.h b/lib/hostip.h index 3eb82cd1498a..780d93038f93 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -175,10 +175,9 @@ Curl_dnscache_mk_entry(struct Curl_easy *data, * The returned data *MUST* be "released" with Curl_resolv_unlink() after * use, or we will leak memory! */ -struct Curl_dns_entry * -Curl_dnscache_get(struct Curl_easy *data, - const char *hostname, - int port, int ip_version); +struct Curl_dns_entry *Curl_dnscache_get(struct Curl_easy *data, + const char *hostname, int port, + int ip_version); /* * Curl_dnscache_addr() adds `entry` to the cache, increasing its @@ -196,7 +195,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data); CURLcode Curl_resolv_check(struct Curl_easy *data, struct Curl_dns_entry **dns); #else -#define Curl_resolv_check(x,y) CURLE_NOT_BUILT_IN +#define Curl_resolv_check(x, y) CURLE_NOT_BUILT_IN #endif CURLcode Curl_resolv_pollset(struct Curl_easy *data, struct easy_pollset *ps); diff --git a/lib/hostip4.c b/lib/hostip4.c index f01e902fd684..ada021176983 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -166,11 +166,11 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, /* Linux */ (void)gethostbyname_r(hostname, - (struct hostent *)buf, - (char *)buf + sizeof(struct hostent), - CURL_HOSTENT_SIZE - sizeof(struct hostent), - &h, /* DIFFERENCE */ - &h_errnop); + (struct hostent *)buf, + (char *)buf + sizeof(struct hostent), + CURL_HOSTENT_SIZE - sizeof(struct hostent), + &h, /* DIFFERENCE */ + &h_errnop); /* Redhat 8, using glibc 2.2.93 changed the behavior. Now all of a * sudden this function returns EAGAIN if the given buffer size is too * small. Previous versions are known to return ERANGE for the same diff --git a/lib/hsts.c b/lib/hsts.c index 22add0395732..66f983e493fb 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -41,10 +41,10 @@ #include "strdup.h" #include "curlx/strparse.h" -#define MAX_HSTS_LINE 4095 +#define MAX_HSTS_LINE 4095 #define MAX_HSTS_HOSTLEN 2048 #define MAX_HSTS_DATELEN 256 -#define UNLIMITED "unlimited" +#define UNLIMITED "unlimited" #if defined(DEBUGBUILD) || defined(UNITTESTS) /* to play well with debug builds, we can *set* a fixed time this will @@ -248,7 +248,7 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, if((hlen > MAX_HSTS_HOSTLEN) || !hlen) return NULL; - if(hostname[hlen-1] == '.') + if(hostname[hlen - 1] == '.') /* remove the trailing dot */ --hlen; @@ -265,7 +265,7 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, ntail = strlen(sts->host); if((subdomain && sts->includeSubDomains) && (ntail < hlen)) { size_t offs = hlen - ntail; - if((hostname[offs-1] == '.') && + if((hostname[offs - 1] == '.') && curl_strnequal(&hostname[offs], sts->host, ntail) && (ntail > blen)) { /* save the tail match with the longest tail */ @@ -310,8 +310,7 @@ static CURLcode hsts_push(struct Curl_easy *data, else strcpy(e.expire, UNLIMITED); - sc = data->set.hsts_write(data, &e, i, - data->set.hsts_write_userp); + sc = data->set.hsts_write(data, &e, i, data->set.hsts_write_userp); *stop = (sc != CURLSTS_OK); return sc == CURLSTS_FAIL ? CURLE_BAD_FUNCTION_ARGUMENT : CURLE_OK; } @@ -327,7 +326,7 @@ static CURLcode hsts_out(struct stsentry *sts, FILE *fp) if(result) return result; curl_mfprintf(fp, "%s%s \"%d%02d%02d %02d:%02d:%02d\"\n", - sts->includeSubDomains ? ".": "", sts->host, + sts->includeSubDomains ? "." : "", sts->host, stamp.tm_year + 1900, stamp.tm_mon + 1, stamp.tm_mday, stamp.tm_hour, stamp.tm_min, stamp.tm_sec); } @@ -337,7 +336,6 @@ static CURLcode hsts_out(struct stsentry *sts, FILE *fp) return CURLE_OK; } - /* * Curl_https_save() writes the HSTS cache to file and callback. */ @@ -469,7 +467,7 @@ static CURLcode hsts_pull(struct Curl_easy *data, struct hsts *h) char buffer[MAX_HSTS_HOSTLEN + 1]; struct curl_hstsentry e; e.name = buffer; - e.namelen = sizeof(buffer)-1; + e.namelen = sizeof(buffer) - 1; e.includeSubDomains = FALSE; /* default */ e.expire[0] = 0; e.name[0] = 0; /* just to make it clean */ diff --git a/lib/hsts.h b/lib/hsts.h index cb83ada79043..91fe778788c7 100644 --- a/lib/hsts.h +++ b/lib/hsts.h @@ -62,8 +62,8 @@ CURLcode Curl_hsts_loadcb(struct Curl_easy *data, CURLcode Curl_hsts_loadfiles(struct Curl_easy *data); #else #define Curl_hsts_cleanup(x) -#define Curl_hsts_loadcb(x,y) CURLE_OK -#define Curl_hsts_save(x,y,z) +#define Curl_hsts_loadcb(x, y) CURLE_OK +#define Curl_hsts_save(x, y, z) #define Curl_hsts_loadfiles(x) CURLE_OK #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */ #endif /* HEADER_CURL_HSTS_H */ diff --git a/lib/http.c b/lib/http.c index fcae0a57c25c..3178ca59e993 100644 --- a/lib/http.c +++ b/lib/http.c @@ -111,7 +111,6 @@ static CURLcode http_statusline(struct Curl_easy *data, static CURLcode http_target(struct Curl_easy *data, struct dynbuf *req); static CURLcode http_useragent(struct Curl_easy *data); - /* * HTTP handler interface. */ @@ -138,7 +137,7 @@ const struct Curl_handler Curl_handler_http = { CURLPROTO_HTTP, /* protocol */ CURLPROTO_HTTP, /* family */ PROTOPT_CREDSPERREQUEST | /* flags */ - PROTOPT_USERPWDCTRL | PROTOPT_CONN_REUSE + PROTOPT_USERPWDCTRL | PROTOPT_CONN_REUSE }; @@ -169,7 +168,7 @@ const struct Curl_handler Curl_handler_https = { CURLPROTO_HTTPS, /* protocol */ CURLPROTO_HTTP, /* family */ PROTOPT_SSL | PROTOPT_CREDSPERREQUEST | PROTOPT_ALPN | /* flags */ - PROTOPT_USERPWDCTRL | PROTOPT_CONN_REUSE + PROTOPT_USERPWDCTRL | PROTOPT_CONN_REUSE }; #endif @@ -255,7 +254,7 @@ char *Curl_checkProxyheaders(struct Curl_easy *data, } #else /* disabled */ -#define Curl_checkProxyheaders(x,y,z,a) NULL +#define Curl_checkProxyheaders(x, y, z, a) NULL #endif static bool http_header_is_empty(const char *header) @@ -599,7 +598,6 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) data->state.authproblem = TRUE; else data->info.proxyauthpicked = data->state.authproxy.picked; - } #endif @@ -617,7 +615,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) return CURLE_OUT_OF_MEMORY; } else if((data->req.httpcode < 300) && - (!data->state.authhost.done) && + !data->state.authhost.done && data->req.authneg) { /* no (known) authentication available, authentication is not "done" yet and @@ -645,13 +643,12 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) * Output the correct authentication header depending on the auth type * and whether or not it is to a proxy. */ -static CURLcode -output_auth_headers(struct Curl_easy *data, - struct connectdata *conn, - struct auth *authstatus, - const char *request, - const char *path, - bool proxy) +static CURLcode output_auth_headers(struct Curl_easy *data, + struct connectdata *conn, + struct auth *authstatus, + const char *request, + const char *path, + bool proxy) { const char *auth = NULL; CURLcode result = CURLE_OK; @@ -865,13 +862,12 @@ Curl_http_output_auth(struct Curl_easy *data, #else /* when disabled */ -CURLcode -Curl_http_output_auth(struct Curl_easy *data, - struct connectdata *conn, - const char *request, - Curl_HttpReq httpreq, - const char *path, - bool proxytunnel) +CURLcode Curl_http_output_auth(struct Curl_easy *data, + struct connectdata *conn, + const char *request, + Curl_HttpReq httpreq, + const char *path, + bool proxytunnel) { (void)data; (void)conn; @@ -1398,7 +1394,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, /* 300 - Multiple Choices */ /* 306 - Not used */ /* 307 - Temporary Redirect */ - default: /* for all above (and the unknown ones) */ + default: /* for all above (and the unknown ones) */ /* Some codes are explicitly mentioned since I have checked RFC2616 and * they seem to be OK to POST to. */ @@ -1420,10 +1416,10 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, * This behavior is forbidden by RFC1945 and the obsolete RFC2616, and * can be overridden with CURLOPT_POSTREDIR. */ - if((data->state.httpreq == HTTPREQ_POST - || data->state.httpreq == HTTPREQ_POST_FORM - || data->state.httpreq == HTTPREQ_POST_MIME) - && !(data->set.keep_post & CURL_REDIR_POST_301)) { + if((data->state.httpreq == HTTPREQ_POST || + data->state.httpreq == HTTPREQ_POST_FORM || + data->state.httpreq == HTTPREQ_POST_MIME) && + !(data->set.keep_post & CURL_REDIR_POST_301)) { http_switch_to_get(data, 301); switch_to_get = TRUE; } @@ -1445,10 +1441,10 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, * This behavior is forbidden by RFC1945 and the obsolete RFC2616, and * can be overridden with CURLOPT_POSTREDIR. */ - if((data->state.httpreq == HTTPREQ_POST - || data->state.httpreq == HTTPREQ_POST_FORM - || data->state.httpreq == HTTPREQ_POST_MIME) - && !(data->set.keep_post & CURL_REDIR_POST_302)) { + if((data->state.httpreq == HTTPREQ_POST || + data->state.httpreq == HTTPREQ_POST_FORM || + data->state.httpreq == HTTPREQ_POST_MIME) && + !(data->set.keep_post & CURL_REDIR_POST_302)) { http_switch_to_get(data, 302); switch_to_get = TRUE; } @@ -1502,12 +1498,11 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, * Returns TRUE if 'headerline' contains the 'header' with given 'content'. * Pass headers WITH the colon. */ -bool -Curl_compareheader(const char *headerline, /* line to check */ - const char *header, /* header keyword _with_ colon */ - const size_t hlen, /* len of the keyword in bytes */ - const char *content, /* content string to find */ - const size_t clen) /* len of the content in bytes */ +bool Curl_compareheader(const char *headerline, /* line to check */ + const char *header, /* header keyword _with_ colon */ + const size_t hlen, /* len of the keyword in bytes */ + const char *content, /* content string to find */ + const size_t clen) /* len of the content in bytes */ { /* RFC2616, section 4.2 says: "Each header field consists of a name followed * by a colon (":") and the field value. Field names are case-insensitive. @@ -1651,14 +1646,14 @@ static unsigned char http_request_version(struct Curl_easy *data) static const char *get_http_string(int httpversion) { switch(httpversion) { - case 30: - return "3"; - case 20: - return "2"; - case 11: - return "1.1"; - default: - return "1.0"; + case 30: + return "3"; + case 20: + return "2"; + case 11: + return "1.1"; + default: + return "1.0"; } } @@ -1841,7 +1836,7 @@ CURLcode Curl_add_timecondition(struct Curl_easy *data, curl_msnprintf(datestr, sizeof(datestr), "%s: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n", condp, - Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6], + Curl_wkday[tm->tm_wday ? tm->tm_wday - 1 : 6], tm->tm_mday, Curl_month[tm->tm_mon], tm->tm_year + 1900, @@ -1869,11 +1864,11 @@ void Curl_http_method(struct Curl_easy *data, Curl_HttpReq httpreq = (Curl_HttpReq)data->state.httpreq; const char *request; #ifndef CURL_DISABLE_WEBSOCKETS - if(data->conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS)) + if(data->conn->handler->protocol & (CURLPROTO_WS | CURLPROTO_WSS)) httpreq = HTTPREQ_GET; else #endif - if((data->conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_FTP)) && + if((data->conn->handler->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_FTP)) && data->state.upload) httpreq = HTTPREQ_PUT; @@ -1923,7 +1918,6 @@ static CURLcode http_useragent(struct Curl_easy *data) return CURLE_OK; } - static CURLcode http_set_aptr_host(struct Curl_easy *data) { struct connectdata *conn = data->conn; @@ -1993,10 +1987,10 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data) [brackets] if the hostname is a plain IPv6-address. RFC2732-style. */ const char *host = conn->host.name; - if(((conn->given->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS)) && + if(((conn->given->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS)) && (conn->remote_port == PORT_HTTPS)) || - ((conn->given->protocol&(CURLPROTO_HTTP|CURLPROTO_WS)) && - (conn->remote_port == PORT_HTTP)) ) + ((conn->given->protocol & (CURLPROTO_HTTP | CURLPROTO_WS)) && + (conn->remote_port == PORT_HTTP))) /* if(HTTPS on port 443) OR (HTTP on port 80) then do not include the port number in the host string */ aptr->host = curl_maprintf("Host: %s%s%s\r\n", @@ -2532,7 +2526,7 @@ static CURLcode http_cookies(struct Curl_easy *data, return result; } #else -#define http_cookies(a,b) CURLE_OK +#define http_cookies(a, b) CURLE_OK #endif static CURLcode http_range(struct Curl_easy *data, @@ -2579,7 +2573,7 @@ static CURLcode http_range(struct Curl_easy *data, data->state.aptr.rangeline = curl_maprintf("Content-Range: bytes %s%" FMT_OFF_T "/" "%" FMT_OFF_T "\r\n", - data->state.range, total_len-1, total_len); + data->state.range, total_len - 1, total_len); } else { /* Range was selected and then we just pass the incoming range and @@ -2909,7 +2903,7 @@ static CURLcode http_add_hd(struct Curl_easy *data, result = Curl_http2_request_upgrade(req, data); } #ifndef CURL_DISABLE_WEBSOCKETS - if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS)) + if(!result && conn->handler->protocol & (CURLPROTO_WS | CURLPROTO_WSS)) result = Curl_ws_request(data, req); #endif break; @@ -3057,7 +3051,6 @@ typedef enum { STATUS_BAD /* not a status line */ } statusline; - /* Check a string for a prefix. Check no more than 'len' bytes */ static bool checkprefixmax(const char *prefix, const char *buffer, size_t len) { @@ -3070,9 +3063,8 @@ static bool checkprefixmax(const char *prefix, const char *buffer, size_t len) * * Returns TRUE if member of the list matches prefix of string */ -static statusline -checkhttpprefix(struct Curl_easy *data, - const char *s, size_t len) +static statusline checkhttpprefix(struct Curl_easy *data, + const char *s, size_t len) { struct curl_slist *head = data->set.http200aliases; statusline rc = STATUS_BAD; @@ -3093,9 +3085,8 @@ checkhttpprefix(struct Curl_easy *data, } #ifndef CURL_DISABLE_RTSP -static statusline -checkrtspprefix(struct Curl_easy *data, - const char *s, size_t len) +static statusline checkrtspprefix(struct Curl_easy *data, + const char *s, size_t len) { statusline result = STATUS_BAD; statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN; @@ -3107,9 +3098,9 @@ checkrtspprefix(struct Curl_easy *data, } #endif /* CURL_DISABLE_RTSP */ -static statusline -checkprotoprefix(struct Curl_easy *data, struct connectdata *conn, - const char *s, size_t len) +static statusline checkprotoprefix(struct Curl_easy *data, + struct connectdata *conn, + const char *s, size_t len) { #ifndef CURL_DISABLE_RTSP if(conn->handler->protocol & CURLPROTO_RTSP) @@ -3123,17 +3114,17 @@ checkprotoprefix(struct Curl_easy *data, struct connectdata *conn, /* HTTP header has field name `n` (a string constant) */ #define HD_IS(hd, hdlen, n) \ - (((hdlen) >= (sizeof(n)-1)) && curl_strnequal((n), (hd), (sizeof(n)-1))) + (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal((n), (hd), (sizeof(n) - 1))) #define HD_VAL(hd, hdlen, n) \ - ((((hdlen) >= (sizeof(n)-1)) && \ - curl_strnequal((n), (hd), (sizeof(n)-1)))? (hd + (sizeof(n)-1)) : NULL) + ((((hdlen) >= (sizeof(n) - 1)) && \ + curl_strnequal((n), (hd), (sizeof(n) - 1)))? (hd + (sizeof(n) - 1)) : NULL) /* HTTP header has field name `n` (a string constant) and contains `v` * (a string constant) in its value(s) */ #define HD_IS_AND_SAYS(hd, hdlen, n, v) \ (HD_IS(hd, hdlen, n) && \ - ((hdlen) > ((sizeof(n)-1) + (sizeof(v)-1))) && \ + ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \ Curl_compareheader(hd, STRCONST(n), STRCONST(v))) /* @@ -3664,15 +3655,15 @@ static CURLcode http_statusline(struct Curl_easy *data, #endif /* no major version switch mid-connection */ if(k->httpversion_sent && - (k->httpversion/10 != k->httpversion_sent/10)) { + (k->httpversion / 10 != k->httpversion_sent / 10)) { failf(data, "Version mismatch (from HTTP/%u to HTTP/%u)", - k->httpversion_sent/10, k->httpversion/10); + k->httpversion_sent / 10, k->httpversion / 10); return CURLE_WEIRD_SERVER_REPLY; } break; default: failf(data, "Unsupported HTTP version (%u.%d) in response", - k->httpversion/10, k->httpversion%10); + k->httpversion / 10, k->httpversion % 10); return CURLE_UNSUPPORTED_PROTOCOL; } @@ -3825,7 +3816,7 @@ static CURLcode http_write_header(struct Curl_easy *data, Curl_debug(data, CURLINFO_HEADER_IN, hd, hdlen); writetype = CLIENTWRITE_HEADER | - ((data->req.httpcode/100 == 1) ? CLIENTWRITE_1XX : 0); + ((data->req.httpcode / 100 == 1) ? CLIENTWRITE_1XX : 0); result = Curl_client_write(data, writetype, hd, hdlen); if(result) @@ -4011,8 +4002,7 @@ static CURLcode http_on_response(struct Curl_easy *data, /* Check if this response means the transfer errored. */ if(http_should_fail(data, data->req.httpcode)) { - failf(data, "The requested URL returned error: %d", - k->httpcode); + failf(data, "The requested URL returned error: %d", k->httpcode); result = CURLE_HTTP_RETURNED_ERROR; goto out; } @@ -4056,8 +4046,7 @@ static CURLcode http_on_response(struct Curl_easy *data, } else { infof(data, "Got HTTP failure 417 while sending data"); - streamclose(conn, - "Stop sending data before everything sent"); + streamclose(conn, "Stop sending data before everything sent"); result = http_perhapsrewind(data, conn); if(result) goto out; @@ -4095,7 +4084,6 @@ static CURLcode http_on_response(struct Curl_easy *data, infof(data, "Keep sending data to get tossed away"); k->keepon |= KEEP_SEND; } - } /* If we requested a "no body", this is a good time to get @@ -4291,7 +4279,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data, */ Curl_debug(data, CURLINFO_HEADER_IN, hd, hdlen); - if(k->httpcode/100 == 1) + if(k->httpcode / 100 == 1) writetype |= CLIENTWRITE_1XX; result = Curl_client_write(data, writetype, hd, hdlen); if(result) @@ -4785,8 +4773,7 @@ CURLcode Curl_http_req_to_h2(struct dynhds *h2_headers, infof(data, "set pseudo header %s to %s", HTTP_PSEUDO_SCHEME, scheme); } else { - scheme = Curl_conn_is_ssl(data->conn, FIRSTSOCKET) ? - "https" : "http"; + scheme = Curl_conn_is_ssl(data->conn, FIRSTSOCKET) ? "https" : "http"; } } @@ -4969,8 +4956,7 @@ static CURLcode http_exp100_add_reader(struct Curl_easy *data) struct Curl_creader *reader = NULL; CURLcode result; - result = Curl_creader_create(&reader, data, &cr_exp100, - CURL_CR_PROTOCOL); + result = Curl_creader_create(&reader, data, &cr_exp100, CURL_CR_PROTOCOL); if(!result) result = Curl_creader_add(data, reader); if(!result) { diff --git a/lib/http.h b/lib/http.h index ef41d7bb2249..1c7ebdf8d7f1 100644 --- a/lib/http.h +++ b/lib/http.h @@ -38,7 +38,6 @@ typedef enum { HTTPREQ_HEAD } Curl_HttpReq; - /* When redirecting transfers. */ typedef enum { FOLLOW_NONE, /* not used within the function, just a placeholder to @@ -55,7 +54,6 @@ typedef enum { /* bitmask of CURL_HTTP_V* values */ typedef unsigned char http_majors; - #ifndef CURL_DISABLE_HTTP #ifdef USE_HTTP3 @@ -140,7 +138,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, selected to use no auth at all. Ie, we actively select no auth, as opposed to not having one selected. The other CURLAUTH_* defines are present in the public curl/curl.h header. */ -#define CURLAUTH_PICKNONE (1<<30) /* do not use auth */ +#define CURLAUTH_PICKNONE (1 << 30) /* do not use auth */ /* MAX_INITIAL_POST_SIZE indicates the number of bytes that will make the POST data get included in the initial data chunk sent to the server. If the @@ -155,7 +153,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, It must not be greater than 64K to work on VMS. */ #ifndef MAX_INITIAL_POST_SIZE -#define MAX_INITIAL_POST_SIZE (64*1024) +#define MAX_INITIAL_POST_SIZE (64 * 1024) #endif /* EXPECT_100_THRESHOLD is the request body size limit for when libcurl will @@ -164,13 +162,13 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, * */ #ifndef EXPECT_100_THRESHOLD -#define EXPECT_100_THRESHOLD (1024*1024) +#define EXPECT_100_THRESHOLD (1024 * 1024) #endif /* MAX_HTTP_RESP_HEADER_SIZE is the maximum size of all response headers combined that libcurl allows for a single HTTP response, any HTTP version. This count includes CONNECT response headers. */ -#define MAX_HTTP_RESP_HEADER_SIZE (300*1024) +#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024) /* MAX_HTTP_RESP_HEADER_COUNT is the maximum number of response headers that libcurl allows for a single HTTP response, including CONNECT and @@ -243,11 +241,11 @@ CURLcode Curl_http_req_make2(struct httpreq **preq, void Curl_http_req_free(struct httpreq *req); -#define HTTP_PSEUDO_METHOD ":method" -#define HTTP_PSEUDO_SCHEME ":scheme" +#define HTTP_PSEUDO_METHOD ":method" +#define HTTP_PSEUDO_SCHEME ":scheme" #define HTTP_PSEUDO_AUTHORITY ":authority" -#define HTTP_PSEUDO_PATH ":path" -#define HTTP_PSEUDO_STATUS ":status" +#define HTTP_PSEUDO_PATH ":path" +#define HTTP_PSEUDO_STATUS ":status" /** * Create the list of HTTP/2 headers which represent the request, diff --git a/lib/http1.c b/lib/http1.c index 657a674105fa..693a0dd7ef6d 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -33,7 +33,7 @@ #include "urlapi-int.h" -#define H1_MAX_URL_LEN (8*1024) +#define H1_MAX_URL_LEN (8 * 1024) void Curl_h1_req_parse_init(struct h1_req_parser *parser, size_t max_line_len) { @@ -227,8 +227,8 @@ static CURLcode start_req(struct h1_req_parser *parser, result = CURLE_OUT_OF_MEMORY; goto out; } - url_options = (CURLU_NON_SUPPORT_SCHEME| - CURLU_PATH_AS_IS| + url_options = (CURLU_NON_SUPPORT_SCHEME | + CURLU_PATH_AS_IS | CURLU_NO_DEFAULT_PORT); if(!(options & H1_PARSE_OPT_STRICT)) url_options |= CURLU_ALLOW_SPACE; diff --git a/lib/http2.c b/lib/http2.c index 38c7d82785fe..a3ff8c85294e 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -53,7 +53,7 @@ #endif #ifdef CURL_DISABLE_VERBOSE_STRINGS -#define nghttp2_session_callbacks_set_error_callback(x,y) +#define nghttp2_session_callbacks_set_error_callback(x, y) #endif #if (NGHTTP2_VERSION_NUM >= 0x010c00) @@ -91,7 +91,7 @@ * is blocked from sending us any data. See #10988 for an issue with this. */ #define HTTP2_HUGE_WINDOW_SIZE (100 * H2_STREAM_WINDOW_SIZE_MAX) -#define H2_SETTINGS_IV_LEN 3 +#define H2_SETTINGS_IV_LEN 3 #define H2_BINSETTINGS_LEN 80 struct cf_h2_ctx { @@ -122,8 +122,7 @@ struct cf_h2_ctx { /* How to access `call_data` from a cf_h2 filter */ #undef CF_CTX_CALL_DATA -#define CF_CTX_CALL_DATA(cf) \ - ((struct cf_h2_ctx *)(cf)->ctx)->call_data +#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data static void h2_stream_hash_free(unsigned int id, void *stream); @@ -248,7 +247,7 @@ struct h2_stream_ctx { BIT(write_paused); /* stream write is paused */ }; -#define H2_STREAM_CTX(ctx,data) \ +#define H2_STREAM_CTX(ctx, data) \ ((struct h2_stream_ctx *)( \ data? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL)) @@ -305,8 +304,7 @@ static void h2_stream_hash_free(unsigned int id, void *stream) static int32_t cf_h2_get_desired_local_win(struct Curl_cfilter *cf, struct Curl_easy *data) { - curl_off_t avail = Curl_rlimit_avail(&data->progress.dl.rlimit, - curlx_now()); + curl_off_t avail = Curl_rlimit_avail(&data->progress.dl.rlimit, curlx_now()); (void)cf; if(avail < CURL_OFF_T_MAX) { /* limit in place */ @@ -379,7 +377,6 @@ static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf, } #endif /* !NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE */ - static CURLcode http2_data_setup(struct Curl_cfilter *cf, struct Curl_easy *data, struct h2_stream_ctx **pstream) @@ -447,8 +444,8 @@ static int h2_client_new(struct Curl_cfilter *cf, { struct cf_h2_ctx *ctx = cf->ctx; nghttp2_option *o; - nghttp2_mem mem = {NULL, Curl_nghttp2_malloc, Curl_nghttp2_free, - Curl_nghttp2_calloc, Curl_nghttp2_realloc}; + nghttp2_mem mem = { NULL, Curl_nghttp2_malloc, Curl_nghttp2_free, + Curl_nghttp2_calloc, Curl_nghttp2_realloc }; int rc = nghttp2_option_new(&o); if(rc) @@ -806,7 +803,6 @@ static ssize_t send_callback(nghttp2_session *h2, NGHTTP2_ERR_CALLBACK_FAILURE : (ssize_t)nwritten; } - /* We pass a pointer to this struct in the push callback, but the contents of the struct are hidden from the user. */ struct curl_pushheaders { @@ -1217,72 +1213,72 @@ static CURLcode on_stream_frame(struct Curl_cfilter *cf, static int fr_print(const nghttp2_frame *frame, char *buffer, size_t blen) { switch(frame->hd.type) { - case NGHTTP2_DATA: { - return curl_msnprintf(buffer, blen, - "FRAME[DATA, len=%d, eos=%d, padlen=%d]", - (int)frame->hd.length, - !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM), - (int)frame->data.padlen); - } - case NGHTTP2_HEADERS: { - return curl_msnprintf(buffer, blen, - "FRAME[HEADERS, len=%d, hend=%d, eos=%d]", - (int)frame->hd.length, - !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS), - !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)); - } - case NGHTTP2_PRIORITY: { - return curl_msnprintf(buffer, blen, - "FRAME[PRIORITY, len=%d, flags=%d]", - (int)frame->hd.length, frame->hd.flags); - } - case NGHTTP2_RST_STREAM: { - return curl_msnprintf(buffer, blen, - "FRAME[RST_STREAM, len=%d, flags=%d, error=%u]", - (int)frame->hd.length, frame->hd.flags, - frame->rst_stream.error_code); - } - case NGHTTP2_SETTINGS: { - if(frame->hd.flags & NGHTTP2_FLAG_ACK) { - return curl_msnprintf(buffer, blen, "FRAME[SETTINGS, ack=1]"); - } - return curl_msnprintf(buffer, blen, - "FRAME[SETTINGS, len=%d]", (int)frame->hd.length); - } - case NGHTTP2_PUSH_PROMISE: { - return curl_msnprintf(buffer, blen, - "FRAME[PUSH_PROMISE, len=%d, hend=%d]", - (int)frame->hd.length, - !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS)); - } - case NGHTTP2_PING: { - return curl_msnprintf(buffer, blen, - "FRAME[PING, len=%d, ack=%d]", - (int)frame->hd.length, - frame->hd.flags&NGHTTP2_FLAG_ACK); - } - case NGHTTP2_GOAWAY: { - char scratch[128]; - size_t s_len = CURL_ARRAYSIZE(scratch); - size_t len = (frame->goaway.opaque_data_len < s_len) ? - frame->goaway.opaque_data_len : s_len-1; - if(len) - memcpy(scratch, frame->goaway.opaque_data, len); - scratch[len] = '\0'; - return curl_msnprintf(buffer, blen, - "FRAME[GOAWAY, error=%d, reason='%s', " - "last_stream=%d]", frame->goaway.error_code, - scratch, frame->goaway.last_stream_id); - } - case NGHTTP2_WINDOW_UPDATE: { - return curl_msnprintf(buffer, blen, - "FRAME[WINDOW_UPDATE, incr=%d]", - frame->window_update.window_size_increment); - } - default: - return curl_msnprintf(buffer, blen, "FRAME[%d, len=%d, flags=%d]", - frame->hd.type, (int)frame->hd.length, - frame->hd.flags); + case NGHTTP2_DATA: { + return curl_msnprintf(buffer, blen, + "FRAME[DATA, len=%d, eos=%d, padlen=%d]", + (int)frame->hd.length, + !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM), + (int)frame->data.padlen); + } + case NGHTTP2_HEADERS: { + return curl_msnprintf(buffer, blen, + "FRAME[HEADERS, len=%d, hend=%d, eos=%d]", + (int)frame->hd.length, + !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS), + !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM)); + } + case NGHTTP2_PRIORITY: { + return curl_msnprintf(buffer, blen, + "FRAME[PRIORITY, len=%d, flags=%d]", + (int)frame->hd.length, frame->hd.flags); + } + case NGHTTP2_RST_STREAM: { + return curl_msnprintf(buffer, blen, + "FRAME[RST_STREAM, len=%d, flags=%d, error=%u]", + (int)frame->hd.length, frame->hd.flags, + frame->rst_stream.error_code); + } + case NGHTTP2_SETTINGS: { + if(frame->hd.flags & NGHTTP2_FLAG_ACK) { + return curl_msnprintf(buffer, blen, "FRAME[SETTINGS, ack=1]"); + } + return curl_msnprintf(buffer, blen, + "FRAME[SETTINGS, len=%d]", (int)frame->hd.length); + } + case NGHTTP2_PUSH_PROMISE: { + return curl_msnprintf(buffer, blen, + "FRAME[PUSH_PROMISE, len=%d, hend=%d]", + (int)frame->hd.length, + !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS)); + } + case NGHTTP2_PING: { + return curl_msnprintf(buffer, blen, + "FRAME[PING, len=%d, ack=%d]", + (int)frame->hd.length, + frame->hd.flags & NGHTTP2_FLAG_ACK); + } + case NGHTTP2_GOAWAY: { + char scratch[128]; + size_t s_len = CURL_ARRAYSIZE(scratch); + size_t len = (frame->goaway.opaque_data_len < s_len) ? + frame->goaway.opaque_data_len : s_len - 1; + if(len) + memcpy(scratch, frame->goaway.opaque_data, len); + scratch[len] = '\0'; + return curl_msnprintf(buffer, blen, + "FRAME[GOAWAY, error=%d, reason='%s', " + "last_stream=%d]", frame->goaway.error_code, + scratch, frame->goaway.last_stream_id); + } + case NGHTTP2_WINDOW_UPDATE: { + return curl_msnprintf(buffer, blen, + "FRAME[WINDOW_UPDATE, incr=%d]", + frame->window_update.window_size_increment); + } + default: + return curl_msnprintf(buffer, blen, "FRAME[%d, len=%d, flags=%d]", + frame->hd.type, (int)frame->hd.length, + frame->hd.flags); } } @@ -1298,7 +1294,7 @@ static int on_frame_send(nghttp2_session *session, const nghttp2_frame *frame, if(data && Curl_trc_cf_is_verbose(cf, data)) { char buffer[256]; int len; - len = fr_print(frame, buffer, sizeof(buffer)-1); + len = fr_print(frame, buffer, sizeof(buffer) - 1); buffer[len] = 0; CURL_TRC_CF(data, cf, "[%d] -> %s", frame->hd.stream_id, buffer); } @@ -1326,9 +1322,9 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, if(Curl_trc_cf_is_verbose(cf, data)) { char buffer[256]; int len; - len = fr_print(frame, buffer, sizeof(buffer)-1); + len = fr_print(frame, buffer, sizeof(buffer) - 1); buffer[len] = 0; - CURL_TRC_CF(data, cf, "[%d] <- %s",frame->hd.stream_id, buffer); + CURL_TRC_CF(data, cf, "[%d] <- %s", frame->hd.stream_id, buffer); } #endif /* !CURL_DISABLE_VERBOSE_STRINGS */ @@ -1340,9 +1336,9 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, if(!(frame->hd.flags & NGHTTP2_FLAG_ACK)) { uint32_t max_conn = ctx->max_concurrent_streams; ctx->max_concurrent_streams = nghttp2_session_get_remote_settings( - session, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); + session, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); ctx->enable_push = nghttp2_session_get_remote_settings( - session, NGHTTP2_SETTINGS_ENABLE_PUSH) != 0; + session, NGHTTP2_SETTINGS_ENABLE_PUSH) != 0; CURL_TRC_CF(data, cf, "[0] MAX_CONCURRENT_STREAMS: %d", ctx->max_concurrent_streams); CURL_TRC_CF(data, cf, "[0] ENABLE_PUSH: %s", @@ -1369,7 +1365,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, ctx->remote_max_sid = frame->goaway.last_stream_id; if(data) { infof(data, "received GOAWAY, error=%u, last_stream=%u", - ctx->goaway_error, ctx->remote_max_sid); + ctx->goaway_error, ctx->remote_max_sid); Curl_multi_connchanged(data->multi); } break; @@ -1403,7 +1399,7 @@ static int cf_h2_on_invalid_frame_recv(nghttp2_session *session, #ifndef CURL_DISABLE_VERBOSE_STRINGS char buffer[256]; int len; - len = fr_print(frame, buffer, sizeof(buffer)-1); + len = fr_print(frame, buffer, sizeof(buffer) - 1); buffer[len] = 0; failf(data, "[HTTP2] [%d] received invalid frame: %s, error %d: %s", stream_id, buffer, ngerr, nghttp2_strerror(ngerr)); @@ -1440,8 +1436,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags, /* Receiving a Stream ID not in the hash should not happen - unless we have aborted a transfer artificially and there were more data in the pipeline. Silently ignore. */ - CURL_TRC_CF(CF_DATA_CURRENT(cf), cf, "[%d] Data for unknown", - stream_id); + CURL_TRC_CF(CF_DATA_CURRENT(cf), cf, "[%d] Data for unknown", stream_id); /* consumed explicitly as no one will read it */ nghttp2_session_consume(session, stream_id, len); return 0; @@ -1594,7 +1589,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, if(frame->hd.type == NGHTTP2_PUSH_PROMISE) { char *h; - if((namelen == (sizeof(HTTP_PSEUDO_AUTHORITY)-1)) && + if((namelen == (sizeof(HTTP_PSEUDO_AUTHORITY) - 1)) && !strncmp(HTTP_PSEUDO_AUTHORITY, (const char *)name, namelen)) { /* pseudo headers are lower case */ int rc = 0; @@ -1900,7 +1895,8 @@ static CURLcode http2_handle_stream_close(struct Curl_cfilter *cf, break; Curl_debug(data, CURLINFO_HEADER_IN, curlx_dyn_ptr(&dbuf), curlx_dyn_len(&dbuf)); - result = Curl_client_write(data, CLIENTWRITE_HEADER|CLIENTWRITE_TRAILER, + result = Curl_client_write(data, + CLIENTWRITE_HEADER | CLIENTWRITE_TRAILER, curlx_dyn_ptr(&dbuf), curlx_dyn_len(&dbuf)); if(result) break; @@ -1967,7 +1963,7 @@ static CURLcode h2_progress_egress(struct Curl_cfilter *cf, if(stream && stream->id > 0 && ((sweight_wanted(data) != sweight_in_effect(data)) || (data->set.priority.exclusive != data->state.priority.exclusive) || - (data->set.priority.parent != data->state.priority.parent)) ) { + (data->set.priority.parent != data->state.priority.parent))) { /* send new weight and/or dependency */ nghttp2_priority_spec pri_spec; diff --git a/lib/http2.h b/lib/http2.h index 93cc2d44f259..147d7f76d538 100644 --- a/lib/http2.h +++ b/lib/http2.h @@ -65,10 +65,10 @@ extern struct Curl_cftype Curl_cft_nghttp2; #define Curl_http2_may_switch(a) FALSE -#define Curl_http2_request_upgrade(x,y) CURLE_UNSUPPORTED_PROTOCOL -#define Curl_http2_switch(a) CURLE_UNSUPPORTED_PROTOCOL -#define Curl_http2_upgrade(a,b,c,d,e) CURLE_UNSUPPORTED_PROTOCOL -#define Curl_h2_http_1_1_error(x) 0 +#define Curl_http2_request_upgrade(x, y) CURLE_UNSUPPORTED_PROTOCOL +#define Curl_http2_switch(a) CURLE_UNSUPPORTED_PROTOCOL +#define Curl_http2_upgrade(a, b, c, d, e) CURLE_UNSUPPORTED_PROTOCOL +#define Curl_h2_http_1_1_error(x) 0 #endif #endif /* HEADER_CURL_HTTP2_H */ diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index 0ef18b6feabe..da80f1965809 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -133,7 +133,7 @@ static void trim_headers(struct curl_slist *head) } /* maximum length for the aws sivg4 parts */ -#define MAX_SIGV4_LEN 64 +#define MAX_SIGV4_LEN 64 #define DATE_HDR_KEY_LEN (MAX_SIGV4_LEN + sizeof("X--Date")) /* string been x-PROVIDER-date:TIMESTAMP, I need +1 for ':' */ @@ -400,8 +400,7 @@ static CURLcode make_headers(struct Curl_easy *data, #define CONTENT_SHA256_KEY_LEN (MAX_SIGV4_LEN + sizeof("X--Content-Sha256")) /* add 2 for ": " between header name and value */ -#define CONTENT_SHA256_HDR_LEN (CONTENT_SHA256_KEY_LEN + 2 + \ - SHA256_HEX_LENGTH) +#define CONTENT_SHA256_HDR_LEN (CONTENT_SHA256_KEY_LEN + 2 + SHA256_HEX_LENGTH) /* try to parse a payload hash from the content-sha256 header */ static const char *parse_content_sha_hdr(struct Curl_easy *data, @@ -429,7 +428,7 @@ static const char *parse_content_sha_hdr(struct Curl_easy *data, curlx_str_passblanks(&value); len = strlen(value); - while(len > 0 && ISBLANK(value[len-1])) + while(len > 0 && ISBLANK(value[len - 1])) --len; *value_len = len; @@ -530,7 +529,6 @@ static int compare_func(const void *a, const void *b) compare = strcmp(curlx_dyn_ptr(&aa->value), curlx_dyn_ptr(&bb->value)); return compare; - } UNITTEST CURLcode canon_path(const char *q, size_t len, @@ -572,14 +570,13 @@ UNITTEST CURLcode canon_query(const char *query, struct dynbuf *dq) if(!query) return result; - result = split_to_dyn_array(query, &query_array[0], - &num_query_components); + result = split_to_dyn_array(query, &query_array[0], &num_query_components); if(result) { goto fail; } /* Create list of pairs, each pair containing an encoded query - * component */ + * component */ for(index = 0; index < num_query_components; index++) { const char *in_key; @@ -599,8 +596,8 @@ UNITTEST CURLcode canon_query(const char *query, struct dynbuf *dq) in_key_len = offset - in_key; } - curlx_dyn_init(&encoded_query_array[index].key, query_part_len*3 + 1); - curlx_dyn_init(&encoded_query_array[index].value, query_part_len*3 + 1); + curlx_dyn_init(&encoded_query_array[index].key, query_part_len * 3 + 1); + curlx_dyn_init(&encoded_query_array[index].value, query_part_len * 3 + 1); counted_query_components++; /* Decode/encode the key */ @@ -672,8 +669,8 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) const char *line; struct Curl_str provider0; struct Curl_str provider1; - struct Curl_str region = { NULL, 0}; - struct Curl_str service = { NULL, 0}; + struct Curl_str region = { NULL, 0 }; + struct Curl_str service = { NULL, 0 }; const char *hostname = conn->host.name; time_t clock; struct tm tm; @@ -697,8 +694,8 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) char *str_to_sign = NULL; const char *user = data->state.aptr.user ? data->state.aptr.user : ""; char *secret = NULL; - unsigned char sign0[CURL_SHA256_DIGEST_LENGTH] = {0}; - unsigned char sign1[CURL_SHA256_DIGEST_LENGTH] = {0}; + unsigned char sign0[CURL_SHA256_DIGEST_LENGTH] = { 0 }; + unsigned char sign1[CURL_SHA256_DIGEST_LENGTH] = { 0 }; char *auth_headers = NULL; if(data->set.path_as_is) { @@ -782,7 +779,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) /* AWS S3 requires a x-amz-content-sha256 header, and supports special * values like UNSIGNED-PAYLOAD */ bool sign_as_s3 = curlx_str_casecompare(&provider0, "aws") && - curlx_str_casecompare(&service, "s3"); + curlx_str_casecompare(&service, "s3"); if(sign_as_s3) result = calc_s3_payload_hash(data, httpreq, curlx_str(&provider1), @@ -864,7 +861,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) goto fail; infof(data, "aws_sigv4: Canonical request (enclosed in []) - [%s]", - canonical_request); + canonical_request); request_type = curl_maprintf("%.*s4_request", (int)curlx_strlen(&provider0), @@ -885,7 +882,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) if(!credential_scope) goto fail; - if(Curl_sha256it(sha_hash, (unsigned char *) canonical_request, + if(Curl_sha256it(sha_hash, (unsigned char *)canonical_request, strlen(canonical_request))) goto fail; @@ -912,7 +909,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) curlx_strlen(&provider0)); infof(data, "aws_sigv4: String to sign (enclosed in []) - [%s]", - str_to_sign); + str_to_sign); secret = curl_maprintf("%.*s4%s", (int)curlx_strlen(&provider0), curlx_str(&provider0), data->state.aptr.passwd ? @@ -980,8 +977,8 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) } /* -* Frees all allocated strings in a dynbuf pair array, and the dynbuf itself -*/ + * Frees all allocated strings in a dynbuf pair array, and the dynbuf itself + */ static void pair_array_free(struct pair *pair_array, size_t num_elements) { @@ -991,12 +988,11 @@ static void pair_array_free(struct pair *pair_array, size_t num_elements) curlx_dyn_free(&pair_array[index].key); curlx_dyn_free(&pair_array[index].value); } - } /* -* Frees all allocated strings in a split dynbuf, and the dynbuf itself -*/ + * Frees all allocated strings in a split dynbuf, and the dynbuf itself + */ static void dyn_array_free(struct dynbuf *db, size_t num_elements) { @@ -1007,10 +1003,10 @@ static void dyn_array_free(struct dynbuf *db, size_t num_elements) } /* -* Splits source string by SPLIT_BY, and creates an array of dynbuf in db. -* db is initialized by this function. -* Caller is responsible for freeing the array elements with dyn_array_free -*/ + * Splits source string by SPLIT_BY, and creates an array of dynbuf in db. + * db is initialized by this function. + * Caller is responsible for freeing the array elements with dyn_array_free + */ #define SPLIT_BY '&' @@ -1032,8 +1028,7 @@ static CURLcode split_to_dyn_array(const char *source, if(source[pos] == SPLIT_BY) { if(segment_length) { curlx_dyn_init(&db[index], segment_length + 1); - result = curlx_dyn_addn(&db[index], &source[start], - segment_length); + result = curlx_dyn_addn(&db[index], &source[start], segment_length); if(result) goto fail; @@ -1064,7 +1059,6 @@ static CURLcode split_to_dyn_array(const char *source, return result; } - static bool is_reserved_char(const char c) { return (ISALNUM(c) || ISURLPUNTCS(c)); @@ -1091,7 +1085,6 @@ static CURLcode uri_encode_path(struct Curl_str *original_path, return CURLE_OK; } - static CURLcode encode_query_component(char *component, size_t len, struct dynbuf *db) { @@ -1116,8 +1109,8 @@ static CURLcode encode_query_component(char *component, size_t len, } /* -* Populates a dynbuf containing url_encode(url_decode(in)) -*/ + * Populates a dynbuf containing url_encode(url_decode(in)) + */ static CURLcode http_aws_decode_encode(const char *in, size_t in_len, struct dynbuf *out) diff --git a/lib/http_aws_sigv4.h b/lib/http_aws_sigv4.h index 9747c948a69d..ea7651896e50 100644 --- a/lib/http_aws_sigv4.h +++ b/lib/http_aws_sigv4.h @@ -33,8 +33,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data); #ifdef UNITTESTS UNITTEST CURLcode canon_path(const char *q, size_t len, - struct dynbuf *new_path, - bool normalize); + struct dynbuf *new_path, bool normalize); UNITTEST CURLcode canon_query(const char *query, struct dynbuf *dq); #endif diff --git a/lib/http_chunks.c b/lib/http_chunks.c index 9d0a0b324cdd..76aab85ce233 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -357,7 +357,6 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, case CHUNK_FAILED: return CURLE_RECV_ERROR; } - } return CURLE_OK; } @@ -528,8 +527,7 @@ static CURLcode add_last_chunk(struct Curl_easy *data, continue; } - result = Curl_bufq_cwrite(&ctx->chunkbuf, tr->data, - strlen(tr->data), &n); + result = Curl_bufq_cwrite(&ctx->chunkbuf, tr->data, strlen(tr->data), &n); if(!result) result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("\r\n"), &n); if(result) diff --git a/lib/http_digest.c b/lib/http_digest.c index 2ca1a12d5daf..34aba0e3ba2f 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -148,7 +148,7 @@ CURLcode Curl_output_digest(struct Curl_easy *data, } } if(!tmp) - path = (unsigned char *)curlx_strdup((const char *) uripath); + path = (unsigned char *)curlx_strdup((const char *)uripath); if(!path) return CURLE_OUT_OF_MEMORY; diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index f31e59c2ca6d..2929f7980aff 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -47,7 +47,6 @@ static void http_auth_nego_reset(struct connectdata *conn, Curl_auth_cleanup_spnego(neg_ctx); } - CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, bool proxy, const char *header) { @@ -124,8 +123,8 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, #ifdef USE_SSL curlx_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1); if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) { - result = Curl_ssl_get_channel_binding( - data, FIRSTSOCKET, &neg_ctx->channel_binding_data); + result = Curl_ssl_get_channel_binding(data, FIRSTSOCKET, + &neg_ctx->channel_binding_data); if(result) { http_auth_nego_reset(conn, neg_ctx, proxy); return result; diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index 6c79bcac1b97..e1b48d76759d 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -144,7 +144,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) userp = data->state.aptr.proxyuser; passwdp = data->state.aptr.proxypasswd; service = data->set.str[STRING_PROXY_SERVICE_NAME] ? - data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP"; + data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP"; hostname = conn->http_proxy.host.name; state = &conn->proxy_ntlm_state; authp = &data->state.authproxy; @@ -157,7 +157,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) userp = data->state.aptr.user; passwdp = data->state.aptr.passwd; service = data->set.str[STRING_SERVICE_NAME] ? - data->set.str[STRING_SERVICE_NAME] : "HTTP"; + data->set.str[STRING_SERVICE_NAME] : "HTTP"; hostname = conn->host.name; state = &conn->http_ntlm_state; authp = &data->state.authhost; @@ -202,12 +202,11 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) if(!result) { DEBUGASSERT(Curl_bufref_len(&ntlmmsg) != 0); result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), - Curl_bufref_len(&ntlmmsg), &base64, &len); + Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { curlx_free(*allocuserpwd); *allocuserpwd = curl_maprintf("%sAuthorization: NTLM %s\r\n", - proxy ? "Proxy-" : "", - base64); + proxy ? "Proxy-" : "", base64); curlx_free(base64); if(!*allocuserpwd) result = CURLE_OUT_OF_MEMORY; @@ -225,8 +224,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) if(!result) { curlx_free(*allocuserpwd); *allocuserpwd = curl_maprintf("%sAuthorization: NTLM %s\r\n", - proxy ? "Proxy-" : "", - base64); + proxy ? "Proxy-" : "", base64); curlx_free(base64); if(!*allocuserpwd) result = CURLE_OUT_OF_MEMORY; diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 21f0cc6211c1..d1d043bfb245 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -131,25 +131,31 @@ static CURLcode dynhds_add_custom(struct Curl_easy *data, if(data->state.aptr.host && /* a Host: header was sent already, do not pass on any custom Host: header as that will produce *two* in the same request! */ - curlx_str_casecompare(&name, "Host")); + curlx_str_casecompare(&name, "Host")) + ; else if(data->state.httpreq == HTTPREQ_POST_FORM && /* this header (extended by formdata.c) is sent later */ - curlx_str_casecompare(&name, "Content-Type")); + curlx_str_casecompare(&name, "Content-Type")) + ; else if(data->state.httpreq == HTTPREQ_POST_MIME && /* this header is sent later */ - curlx_str_casecompare(&name, "Content-Type")); + curlx_str_casecompare(&name, "Content-Type")) + ; else if(data->req.authneg && /* while doing auth neg, do not allow the custom length since we will force length zero then */ - curlx_str_casecompare(&name, "Content-Length")); + curlx_str_casecompare(&name, "Content-Length")) + ; else if((httpversion >= 20) && - curlx_str_casecompare(&name, "Transfer-Encoding")); + curlx_str_casecompare(&name, "Transfer-Encoding")) + ; /* HTTP/2 and HTTP/3 do not support chunked requests */ else if((curlx_str_casecompare(&name, "Authorization") || curlx_str_casecompare(&name, "Cookie")) && /* be careful of sending this potentially sensitive header to other hosts */ - !Curl_auth_allowed_to_host(data)); + !Curl_auth_allowed_to_host(data)) + ; else { CURLcode result = Curl_dynhds_add(hds, curlx_str(&name), curlx_strlen(&name), @@ -211,13 +217,13 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip); authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname, - ipv6_ip ?"]" : "", port); + ipv6_ip ? "]" : "", port); if(!authority) { result = CURLE_OUT_OF_MEMORY; goto out; } - result = Curl_http_req_make(&req, "CONNECT", sizeof("CONNECT")-1, + result = Curl_http_req_make(&req, "CONNECT", sizeof("CONNECT") - 1, NULL, 0, authority, strlen(authority), NULL, 0); if(result) @@ -253,7 +259,7 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, } if(http_version_major == 1 && - !Curl_checkProxyheaders(data, cf->conn, STRCONST("Proxy-Connection"))) { + !Curl_checkProxyheaders(data, cf->conn, STRCONST("Proxy-Connection"))) { result = Curl_dynhds_cadd(&req->headers, "Proxy-Connection", "Keep-Alive"); if(result) goto out; @@ -394,10 +400,9 @@ static void http_proxy_cf_close(struct Curl_cfilter *cf, cf->next->cft->do_close(cf->next, data); } - struct Curl_cftype Curl_cft_http_proxy = { "HTTP-PROXY", - CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, + CF_TYPE_IP_CONNECT | CF_TYPE_PROXY, 0, http_proxy_cf_destroy, http_proxy_cf_connect, diff --git a/lib/http_proxy.h b/lib/http_proxy.h index 17f7e10488e1..7af2ebb284c9 100644 --- a/lib/http_proxy.h +++ b/lib/http_proxy.h @@ -46,7 +46,7 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, int http_version_major); /* Default proxy timeout in milliseconds */ -#define PROXY_TIMEOUT (3600*1000) +#define PROXY_TIMEOUT (3600 * 1000) CURLcode Curl_cf_http_proxy_query(struct Curl_cfilter *cf, struct Curl_easy *data, diff --git a/lib/httpsrr.c b/lib/httpsrr.c index 34d081b50264..3acb16ac3a71 100644 --- a/lib/httpsrr.c +++ b/lib/httpsrr.c @@ -151,7 +151,6 @@ void Curl_httpsrr_cleanup(struct Curl_https_rrinfo *rrinfo) Curl_safefree(rrinfo->rrname); } - #ifdef USE_ARES static CURLcode httpsrr_opt(struct Curl_easy *data, diff --git a/lib/httpsrr.h b/lib/httpsrr.h index 9b7831f75cbc..4259a03262f3 100644 --- a/lib/httpsrr.h +++ b/lib/httpsrr.h @@ -33,7 +33,7 @@ #ifdef USE_HTTPSRR #define CURL_MAXLEN_host_name 253 -#define MAX_HTTPSRR_ALPNS 4 +#define MAX_HTTPSRR_ALPNS 4 struct Curl_easy; diff --git a/lib/idn.c b/lib/idn.c index 0b1a4a36ccc0..8f4c3e03f712 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -22,9 +22,9 @@ * ***************************************************************************/ - /* - * IDN conversions - */ +/* + * IDN conversions + */ #include "curl_setup.h" #include "urldata.h" @@ -87,18 +87,18 @@ static CURLcode mac_idn_to_ascii(const char *in, char **out) { size_t inlen = strlen(in); if(inlen < MAX_HOST_LENGTH) { - char iconv_buffer[MAX_HOST_LENGTH] = {0}; + char iconv_buffer[MAX_HOST_LENGTH] = { 0 }; char *iconv_outptr = iconv_buffer; size_t iconv_outlen = sizeof(iconv_buffer); CURLcode iconv_result = iconv_to_utf8(in, inlen, &iconv_outptr, &iconv_outlen); if(!iconv_result) { UErrorCode err = U_ZERO_ERROR; - UIDNA* idna = uidna_openUTS46( - UIDNA_CHECK_BIDI|UIDNA_NONTRANSITIONAL_TO_ASCII, &err); + UIDNA *idna = uidna_openUTS46( + UIDNA_CHECK_BIDI | UIDNA_NONTRANSITIONAL_TO_ASCII, &err); if(!U_FAILURE(err)) { UIDNAInfo info = UIDNA_INFO_INITIALIZER; - char buffer[MAX_HOST_LENGTH] = {0}; + char buffer[MAX_HOST_LENGTH] = { 0 }; (void)uidna_nameToASCII_UTF8(idna, iconv_buffer, (int)iconv_outlen, buffer, sizeof(buffer) - 1, &info, &err); uidna_close(idna); @@ -122,11 +122,11 @@ static CURLcode mac_ascii_to_idn(const char *in, char **out) size_t inlen = strlen(in); if(inlen < MAX_HOST_LENGTH) { UErrorCode err = U_ZERO_ERROR; - UIDNA* idna = uidna_openUTS46( - UIDNA_CHECK_BIDI|UIDNA_NONTRANSITIONAL_TO_UNICODE, &err); + UIDNA *idna = uidna_openUTS46( + UIDNA_CHECK_BIDI | UIDNA_NONTRANSITIONAL_TO_UNICODE, &err); if(!U_FAILURE(err)) { UIDNAInfo info = UIDNA_INFO_INITIALIZER; - char buffer[MAX_HOST_LENGTH] = {0}; + char buffer[MAX_HOST_LENGTH] = { 0 }; (void)uidna_nameToUnicodeUTF8(idna, in, -1, buffer, sizeof(buffer) - 1, &info, &err); uidna_close(idna); diff --git a/lib/if2ip.c b/lib/if2ip.c index c2b8aafc4d7e..ef2bfe2b0a48 100644 --- a/lib/if2ip.c +++ b/lib/if2ip.c @@ -62,10 +62,10 @@ unsigned int Curl_ipv6_scope(const struct sockaddr *sa) { if(sa->sa_family == AF_INET6) { - const struct sockaddr_in6 * sa6 = - (const struct sockaddr_in6 *)(const void *) sa; + const struct sockaddr_in6 *sa6 = + (const struct sockaddr_in6 *)(const void *)sa; const unsigned char *b = sa6->sin6_addr.s6_addr; - unsigned short w = (unsigned short) ((b[0] << 8) | b[1]); + unsigned short w = (unsigned short)((b[0] << 8) | b[1]); if((b[0] & 0xFE) == 0xFC) /* Handle ULAs */ return IPV6_SCOPE_UNIQUELOCAL; @@ -103,8 +103,7 @@ if2ip_result_t Curl_if2ip(int af, struct ifaddrs *iface, *head; if2ip_result_t res = IF2IP_NOT_FOUND; -#if defined(USE_IPV6) && \ - !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) +#if defined(USE_IPV6) && !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) (void)local_scope_id; #endif @@ -138,7 +137,7 @@ if2ip_result_t Curl_if2ip(int af, #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID /* Include the scope of this interface as part of the address */ scopeid = ((struct sockaddr_in6 *)(void *)iface->ifa_addr) - ->sin6_scope_id; + ->sin6_scope_id; /* If given, scope id should match. */ if(local_scope_id && scopeid != local_scope_id) { @@ -248,15 +247,15 @@ if2ip_result_t Curl_if2ip(int af, const char *interf, char *buf, size_t buf_size) { - (void)af; + (void)af; #ifdef USE_IPV6 - (void)remote_scope; - (void)local_scope_id; + (void)remote_scope; + (void)local_scope_id; #endif - (void)interf; - (void)buf; - (void)buf_size; - return IF2IP_NOT_FOUND; + (void)interf; + (void)buf; + (void)buf_size; + return IF2IP_NOT_FOUND; } #endif diff --git a/lib/if2ip.h b/lib/if2ip.h index 42ec7b033a8c..12fdaabd736a 100644 --- a/lib/if2ip.h +++ b/lib/if2ip.h @@ -56,7 +56,7 @@ if2ip_result_t Curl_if2ip(int af, /* Nedelcho Stanev's work-around for SFU 3.0 */ struct ifreq { -#define IFNAMSIZ 16 +#define IFNAMSIZ 16 #define IFHWADDRLEN 6 union { char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ @@ -75,14 +75,14 @@ struct ifreq { /* This define exists to avoid an extra #ifdef INTERIX in the C code. */ -#define ifr_name ifr_ifrn.ifrn_name /* interface name */ -#define ifr_addr ifr_ifru.ifru_addr /* address */ +#define ifr_name ifr_ifrn.ifrn_name /* interface name */ +#define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ -#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ -#define ifr_flags ifr_ifru.ifru_flags /* flags */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -#define ifr_metric ifr_ifru.ifru_metric /* metric */ -#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ +#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ +#define ifr_flags ifr_ifru.ifru_flags /* flags */ +#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_metric ifr_ifru.ifru_metric /* metric */ +#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */ diff --git a/lib/imap.c b/lib/imap.c index 9d58bec4ec81..ec5e654cfae9 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -347,46 +347,46 @@ static bool imap_endofresp(struct Curl_easy *data, struct connectdata *conn, /* Do we have an untagged command response? */ if(len >= 2 && !memcmp("* ", line, 2)) { switch(imapc->state) { - /* States which are interested in untagged responses */ - case IMAP_CAPABILITY: - if(!imap_matchresp(line, len, "CAPABILITY")) - return FALSE; - break; - - case IMAP_LIST: - if((!imap->custom && !imap_matchresp(line, len, "LIST")) || - (imap->custom && !imap_matchresp(line, len, imap->custom) && - (!curl_strequal(imap->custom, "STORE") || - !imap_matchresp(line, len, "FETCH")) && - !curl_strequal(imap->custom, "SELECT") && - !curl_strequal(imap->custom, "EXAMINE") && - !curl_strequal(imap->custom, "SEARCH") && - !curl_strequal(imap->custom, "EXPUNGE") && - !curl_strequal(imap->custom, "LSUB") && - !curl_strequal(imap->custom, "UID") && - !curl_strequal(imap->custom, "GETQUOTAROOT") && - !curl_strequal(imap->custom, "NOOP"))) - return FALSE; - break; + /* States which are interested in untagged responses */ + case IMAP_CAPABILITY: + if(!imap_matchresp(line, len, "CAPABILITY")) + return FALSE; + break; - case IMAP_SELECT: - /* SELECT is special in that its untagged responses do not have a - common prefix so accept anything! */ - break; + case IMAP_LIST: + if((!imap->custom && !imap_matchresp(line, len, "LIST")) || + (imap->custom && !imap_matchresp(line, len, imap->custom) && + (!curl_strequal(imap->custom, "STORE") || + !imap_matchresp(line, len, "FETCH")) && + !curl_strequal(imap->custom, "SELECT") && + !curl_strequal(imap->custom, "EXAMINE") && + !curl_strequal(imap->custom, "SEARCH") && + !curl_strequal(imap->custom, "EXPUNGE") && + !curl_strequal(imap->custom, "LSUB") && + !curl_strequal(imap->custom, "UID") && + !curl_strequal(imap->custom, "GETQUOTAROOT") && + !curl_strequal(imap->custom, "NOOP"))) + return FALSE; + break; - case IMAP_FETCH: - if(!imap_matchresp(line, len, "FETCH")) - return FALSE; - break; + case IMAP_SELECT: + /* SELECT is special in that its untagged responses do not have a + common prefix so accept anything! */ + break; - case IMAP_SEARCH: - if(!imap_matchresp(line, len, "SEARCH")) - return FALSE; - break; + case IMAP_FETCH: + if(!imap_matchresp(line, len, "FETCH")) + return FALSE; + break; - /* Ignore other untagged responses */ - default: + case IMAP_SEARCH: + if(!imap_matchresp(line, len, "SEARCH")) return FALSE; + break; + + /* Ignore other untagged responses */ + default: + return FALSE; } *resp = '*'; @@ -400,16 +400,16 @@ static bool imap_endofresp(struct Curl_easy *data, struct connectdata *conn, if(!imap->custom && ((len == 3 && line[0] == '+') || (len >= 2 && !memcmp("+ ", line, 2)))) { switch(imapc->state) { - /* States which are interested in continuation responses */ - case IMAP_AUTHENTICATE: - case IMAP_APPEND: - *resp = '+'; - break; + /* States which are interested in continuation responses */ + case IMAP_AUTHENTICATE: + case IMAP_APPEND: + *resp = '+'; + break; - default: - failf(data, "Unexpected continuation response"); - *resp = -1; - break; + default: + failf(data, "Unexpected continuation response"); + *resp = -1; + break; } return TRUE; @@ -471,7 +471,7 @@ static void imap_state(struct Curl_easy *data, { #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ - static const char * const names[]={ + static const char * const names[] = { "STOP", "SERVERGREET", "CAPABILITY", @@ -570,8 +570,8 @@ static CURLcode imap_perform_upgrade_tls(struct Curl_easy *data, result, ssldone)); if(!result && ssldone) { imapc->ssldone = ssldone; - /* perform CAPA now, changes imapc->state out of IMAP_UPGRADETLS */ - result = imap_perform_capability(data, imapc); + /* perform CAPA now, changes imapc->state out of IMAP_UPGRADETLS */ + result = imap_perform_capability(data, imapc); } out: return result; @@ -636,7 +636,7 @@ static CURLcode imap_perform_authenticate(struct Curl_easy *data, struct imap_conn *imapc = Curl_conn_meta_get(data->conn, CURL_META_IMAP_CONN); CURLcode result = CURLE_OK; - const char *ir = (const char *) Curl_bufref_ptr(initresp); + const char *ir = (const char *)Curl_bufref_ptr(initresp); if(!imapc) return CURLE_FAILED_INIT; @@ -669,7 +669,7 @@ static CURLcode imap_continue_authenticate(struct Curl_easy *data, if(!imapc) return CURLE_FAILED_INIT; return Curl_pp_sendf(data, &imapc->pp, - "%s", (const char *) Curl_bufref_ptr(resp)); + "%s", (const char *)Curl_bufref_ptr(resp)); } /*********************************************************************** @@ -1048,8 +1048,8 @@ static CURLcode imap_state_capability_resp(struct Curl_easy *data, /* Extract the word */ for(wordlen = 0; line[wordlen] && line[wordlen] != ' ' && - line[wordlen] != '\t' && line[wordlen] != '\r' && - line[wordlen] != '\n';) + line[wordlen] != '\t' && line[wordlen] != '\r' && + line[wordlen] != '\n';) wordlen++; /* Does the server support the STARTTLS capability? */ @@ -1322,7 +1322,6 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, imapc->mb_uidvalidity = (unsigned int)value; imapc->mb_uidvalidity_set = TRUE; } - } } else if(imapcode == IMAP_RESP_OK) { @@ -1797,7 +1796,7 @@ static CURLcode imap_perform(struct Curl_easy *data, bool *connected, /* SEARCH the current mailbox */ result = imap_perform_search(data, imapc, imap); else if(imap->mailbox && !selected && - (imap->custom || imap->uid || imap->mindex || imap->query)) + (imap->custom || imap->uid || imap->mindex || imap->query)) /* SELECT the mailbox */ result = imap_perform_select(data, imapc, imap); else @@ -2112,21 +2111,33 @@ static bool imap_is_bchar(char ch) return TRUE; switch(ch) { - /* bchar */ - case ':': case '@': case '/': - /* bchar -> achar */ - case '&': case '=': - /* bchar -> achar -> uchar -> unreserved (without alphanumeric) */ - case '-': case '.': case '_': case '~': - /* bchar -> achar -> uchar -> sub-delims-sh */ - case '!': case '$': case '\'': case '(': case ')': case '*': - case '+': case ',': - /* bchar -> achar -> uchar -> pct-encoded */ - case '%': /* HEXDIG chars are already included above */ - return TRUE; + /* bchar */ + case ':': + case '@': + case '/': + /* bchar -> achar */ + case '&': + case '=': + /* bchar -> achar -> uchar -> unreserved (without alphanumeric) */ + case '-': + case '.': + case '_': + case '~': + /* bchar -> achar -> uchar -> sub-delims-sh */ + case '!': + case '$': + case '\'': + case '(': + case ')': + case '*': + case '+': + case ',': + /* bchar -> achar -> uchar -> pct-encoded */ + case '%': /* HEXDIG chars are already included above */ + return TRUE; - default: - return FALSE; + default: + return FALSE; } } diff --git a/lib/imap.h b/lib/imap.h index f802ed5c0c72..2bab0b4ddea7 100644 --- a/lib/imap.h +++ b/lib/imap.h @@ -27,7 +27,6 @@ #include "pingpong.h" #include "curl_sasl.h" - extern const struct Curl_handler Curl_handler_imap; extern const struct Curl_handler Curl_handler_imaps; @@ -37,6 +36,6 @@ extern const struct Curl_handler Curl_handler_imaps; /* Authentication type values */ #define IMAP_TYPE_NONE 0 -#define IMAP_TYPE_ANY (IMAP_TYPE_CLEARTEXT|IMAP_TYPE_SASL) +#define IMAP_TYPE_ANY (IMAP_TYPE_CLEARTEXT | IMAP_TYPE_SASL) #endif /* HEADER_CURL_IMAP_H */ diff --git a/lib/ldap.c b/lib/ldap.c index 522bf3ad5860..63b2cbc414f6 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -96,7 +96,7 @@ #ifdef USE_WIN32_LDAP #define FREE_ON_WINLDAP(x) curlx_unicodefree(x) -#define curl_ldap_num_t ULONG +#define curl_ldap_num_t ULONG #else #define FREE_ON_WINLDAP(x) #define curl_ldap_num_t int @@ -142,14 +142,15 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp); #endif /* !HAVE_LDAP_URL_PARSE */ #ifdef DEBUG_LDAP - #define LDAP_TRACE(x) do { \ - ldap_trace_low("%u: ", __LINE__); \ - ldap_trace_low x; \ - } while(0) +#define LDAP_TRACE(x) \ +do { \ + ldap_trace_low("%u: ", __LINE__); \ + ldap_trace_low x; \ +} while(0) - static void ldap_trace_low(const char *fmt, ...) CURL_PRINTF(1, 2); +static void ldap_trace_low(const char *fmt, ...) CURL_PRINTF(1, 2); #else - #define LDAP_TRACE(x) Curl_nop_stmt +#define LDAP_TRACE(x) Curl_nop_stmt #endif #if defined(USE_WIN32_LDAP) && defined(ldap_err2string) @@ -172,7 +173,6 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done); /* * LDAP protocol handler. */ - const struct Curl_handler Curl_handler_ldap = { "ldap", /* scheme */ ZERO_NULL, /* setup_connection */ @@ -202,7 +202,6 @@ const struct Curl_handler Curl_handler_ldap = { /* * LDAPS protocol handler. */ - const struct Curl_handler Curl_handler_ldaps = { "ldaps", /* scheme */ ZERO_NULL, /* setup_connection */ @@ -619,7 +618,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) } if((attr_len > 7) && - curl_strequal(";binary", attr + (attr_len - 7)) ) { + curl_strequal(";binary", attr + (attr_len - 7))) { /* Binary attribute, encode to base64. */ if(vals[i]->bv_len) { result = curlx_base64_encode((uint8_t *)vals[i]->bv_val, @@ -886,8 +885,7 @@ static curl_ldap_num_t ldap_url_parse2_low(struct Curl_easy *data, LDAP_TRACE(("attr[%zu] '%.*s'\n", i, (int)out.len, out.str)); /* Unescape the attribute */ - result = Curl_urldecode(out.str, out.len, &unescaped, NULL, - REJECT_ZERO); + result = Curl_urldecode(out.str, out.len, &unescaped, NULL, REJECT_ZERO); if(result) { rc = LDAP_NO_MEMORY; goto quit; diff --git a/lib/llist.c b/lib/llist.c index ebcda82a04ed..3c70905df250 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -45,8 +45,7 @@ static struct Curl_llist_node *verifynode(struct Curl_llist_node *n) /* * @unittest: 1300 */ -void -Curl_llist_init(struct Curl_llist *l, Curl_llist_dtor dtor) +void Curl_llist_init(struct Curl_llist *l, Curl_llist_dtor dtor) { l->_size = 0; l->_dtor = dtor; @@ -68,11 +67,10 @@ Curl_llist_init(struct Curl_llist *l, Curl_llist_dtor dtor) * * @unittest: 1300 */ -void -Curl_llist_insert_next(struct Curl_llist *list, - struct Curl_llist_node *e, /* may be NULL */ - const void *p, - struct Curl_llist_node *ne) +void Curl_llist_insert_next(struct Curl_llist *list, + struct Curl_llist_node *e, /* may be NULL */ + const void *p, + struct Curl_llist_node *ne) { DEBUGASSERT(list); DEBUGASSERT(list->_init == LLISTINIT); @@ -119,9 +117,8 @@ Curl_llist_insert_next(struct Curl_llist *list, * * @unittest: 1300 */ -void -Curl_llist_append(struct Curl_llist *list, const void *p, - struct Curl_llist_node *ne) +void Curl_llist_append(struct Curl_llist *list, const void *p, + struct Curl_llist_node *ne) { DEBUGASSERT(list); DEBUGASSERT(list->_init == LLISTINIT); @@ -177,9 +174,8 @@ void *Curl_node_take_elem(struct Curl_llist_node *e) /* * @unittest: 1300 */ -UNITTEST void Curl_node_uremove(struct Curl_llist_node *, void *); -UNITTEST void -Curl_node_uremove(struct Curl_llist_node *e, void *user) +UNITTEST void Curl_node_uremove(struct Curl_llist_node *e, void *user); +UNITTEST void Curl_node_uremove(struct Curl_llist_node *e, void *user) { struct Curl_llist *list; void *ptr; @@ -200,8 +196,7 @@ void Curl_node_remove(struct Curl_llist_node *e) Curl_node_uremove(e, NULL); } -void -Curl_llist_destroy(struct Curl_llist *list, void *user) +void Curl_llist_destroy(struct Curl_llist *list, void *user) { if(list) { DEBUGASSERT(list->_init == LLISTINIT); diff --git a/lib/llist.h b/lib/llist.h index 0a2bc9a62f47..0a4a68516362 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -55,8 +55,8 @@ struct Curl_llist_node { void Curl_llist_init(struct Curl_llist *, Curl_llist_dtor); void Curl_llist_insert_next(struct Curl_llist *, struct Curl_llist_node *, const void *, struct Curl_llist_node *node); -void Curl_llist_append(struct Curl_llist *, - const void *, struct Curl_llist_node *node); +void Curl_llist_append(struct Curl_llist *, const void *, + struct Curl_llist_node *node); void Curl_node_remove(struct Curl_llist_node *); void Curl_llist_destroy(struct Curl_llist *, void *); diff --git a/lib/md4.c b/lib/md4.c index 7929e57f65c0..befaeab68bcd 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -71,14 +71,13 @@ #include #endif - #if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4) #ifdef OPENSSL_COEXIST - #define MD4_CTX WOLFSSL_MD4_CTX - #define MD4_Init wolfSSL_MD4_Init + #define MD4_CTX WOLFSSL_MD4_CTX + #define MD4_Init wolfSSL_MD4_Init #define MD4_Update wolfSSL_MD4_Update - #define MD4_Final wolfSSL_MD4_Final + #define MD4_Final wolfSSL_MD4_Final #endif #elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4) @@ -129,7 +128,7 @@ static int MD4_Init(MD4_CTX *ctx) static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size) { - CryptHashData(ctx->hHash, (const BYTE *)data, (unsigned int) size, 0); + CryptHashData(ctx->hHash, (const BYTE *)data, (unsigned int)size, 0); } static void MD4_Final(unsigned char *result, MD4_CTX *ctx) @@ -224,8 +223,8 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx); * The MD4 transformation for all three rounds. */ #define MD4_STEP(f, a, b, c, d, x, s) \ - (a) += f((b), (c), (d)) + (x); \ - (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); + (a) += f((b), (c), (d)) + (x); \ + (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); /* * SET reads 4 input bytes in little-endian byte order and stores them @@ -236,19 +235,15 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx); * does not work. */ #if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define MD4_SET(n) \ - (*(const MD4_u32plus *)(const void *)&ptr[(n) * 4]) -#define MD4_GET(n) \ - MD4_SET(n) +#define MD4_SET(n) (*(const MD4_u32plus *)(const void *)&ptr[(n) * 4]) +#define MD4_GET(n) MD4_SET(n) #else -#define MD4_SET(n) \ - (ctx->block[(n)] = \ - (MD4_u32plus)ptr[(n) * 4] | \ - ((MD4_u32plus)ptr[(n) * 4 + 1] << 8) | \ - ((MD4_u32plus)ptr[(n) * 4 + 2] << 16) | \ - ((MD4_u32plus)ptr[(n) * 4 + 3] << 24)) -#define MD4_GET(n) \ - (ctx->block[(n)]) +#define MD4_SET(n) (ctx->block[(n)] = \ + (MD4_u32plus)ptr[(n) * 4] | \ + ((MD4_u32plus)ptr[(n) * 4 + 1] << 8) | \ + ((MD4_u32plus)ptr[(n) * 4 + 2] << 16) | \ + ((MD4_u32plus)ptr[(n) * 4 + 3] << 24)) +#define MD4_GET(n) (ctx->block[(n)]) #endif /* @@ -413,32 +408,32 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) memset(&ctx->buffer[used], 0, available - 8); ctx->lo <<= 3; - ctx->buffer[56] = curlx_ultouc((ctx->lo)&0xff); - ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8)&0xff); - ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16)&0xff); - ctx->buffer[59] = curlx_ultouc((ctx->lo >> 24)&0xff); - ctx->buffer[60] = curlx_ultouc((ctx->hi)&0xff); - ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8)&0xff); - ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff); + ctx->buffer[56] = curlx_ultouc((ctx->lo) & 0xff); + ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8) & 0xff); + ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16) & 0xff); + ctx->buffer[59] = curlx_ultouc((ctx->lo >> 24) & 0xff); + ctx->buffer[60] = curlx_ultouc((ctx->hi) & 0xff); + ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8) & 0xff); + ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16) & 0xff); ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24); my_md4_body(ctx, ctx->buffer, 64); - result[0] = curlx_ultouc((ctx->a)&0xff); - result[1] = curlx_ultouc((ctx->a >> 8)&0xff); - result[2] = curlx_ultouc((ctx->a >> 16)&0xff); + result[0] = curlx_ultouc((ctx->a) & 0xff); + result[1] = curlx_ultouc((ctx->a >> 8) & 0xff); + result[2] = curlx_ultouc((ctx->a >> 16) & 0xff); result[3] = curlx_ultouc(ctx->a >> 24); - result[4] = curlx_ultouc((ctx->b)&0xff); - result[5] = curlx_ultouc((ctx->b >> 8)&0xff); - result[6] = curlx_ultouc((ctx->b >> 16)&0xff); + result[4] = curlx_ultouc((ctx->b) & 0xff); + result[5] = curlx_ultouc((ctx->b >> 8) & 0xff); + result[6] = curlx_ultouc((ctx->b >> 16) & 0xff); result[7] = curlx_ultouc(ctx->b >> 24); - result[8] = curlx_ultouc((ctx->c)&0xff); - result[9] = curlx_ultouc((ctx->c >> 8)&0xff); - result[10] = curlx_ultouc((ctx->c >> 16)&0xff); + result[8] = curlx_ultouc((ctx->c) & 0xff); + result[9] = curlx_ultouc((ctx->c >> 8) & 0xff); + result[10] = curlx_ultouc((ctx->c >> 16) & 0xff); result[11] = curlx_ultouc(ctx->c >> 24); - result[12] = curlx_ultouc((ctx->d)&0xff); - result[13] = curlx_ultouc((ctx->d >> 8)&0xff); - result[14] = curlx_ultouc((ctx->d >> 16)&0xff); + result[12] = curlx_ultouc((ctx->d) & 0xff); + result[13] = curlx_ultouc((ctx->d >> 8) & 0xff); + result[14] = curlx_ultouc((ctx->d >> 16) & 0xff); result[15] = curlx_ultouc(ctx->d >> 24); memset(ctx, 0, sizeof(*ctx)); diff --git a/lib/md5.c b/lib/md5.c index a579b02c63ae..e1a443c9236a 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -314,9 +314,9 @@ static void my_md5_final(unsigned char *result, void *ctx); * The MD5 transformation for all four rounds. */ #define MD5_STEP(f, a, b, c, d, x, t, s) \ - (a) += f((b), (c), (d)) + (x) + (t); \ - (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ - (a) += (b); + (a) += f((b), (c), (d)) + (x) + (t); \ + (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ + (a) += (b); /* * SET reads 4 input bytes in little-endian byte order and stores them @@ -327,19 +327,15 @@ static void my_md5_final(unsigned char *result, void *ctx); * does not work. */ #if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define MD5_SET(n) \ - (*(const MD5_u32plus *)(const void *)&ptr[(n) * 4]) -#define MD5_GET(n) \ - MD5_SET(n) +#define MD5_SET(n) (*(const MD5_u32plus *)(const void *)&ptr[(n) * 4]) +#define MD5_GET(n) MD5_SET(n) #else -#define MD5_SET(n) \ - (ctx->block[(n)] = \ - (MD5_u32plus)ptr[(n) * 4] | \ - ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \ - ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \ - ((MD5_u32plus)ptr[(n) * 4 + 3] << 24)) -#define MD5_GET(n) \ - (ctx->block[(n)]) +#define MD5_SET(n) (ctx->block[(n)] = \ + (MD5_u32plus)ptr[(n) * 4] | \ + ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \ + ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \ + ((MD5_u32plus)ptr[(n) * 4 + 3] << 24)) +#define MD5_GET(n) (ctx->block[(n)]) #endif /* @@ -527,32 +523,32 @@ static void my_md5_final(unsigned char *result, void *in) memset(&ctx->buffer[used], 0, available - 8); ctx->lo <<= 3; - ctx->buffer[56] = curlx_ultouc((ctx->lo)&0xff); - ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8)&0xff); - ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16)&0xff); + ctx->buffer[56] = curlx_ultouc((ctx->lo) & 0xff); + ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8) & 0xff); + ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16) & 0xff); ctx->buffer[59] = curlx_ultouc(ctx->lo >> 24); - ctx->buffer[60] = curlx_ultouc((ctx->hi)&0xff); - ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8)&0xff); - ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff); + ctx->buffer[60] = curlx_ultouc((ctx->hi) & 0xff); + ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8) & 0xff); + ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16) & 0xff); ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24); my_md5_body(ctx, ctx->buffer, 64); - result[0] = curlx_ultouc((ctx->a)&0xff); - result[1] = curlx_ultouc((ctx->a >> 8)&0xff); - result[2] = curlx_ultouc((ctx->a >> 16)&0xff); + result[0] = curlx_ultouc((ctx->a) & 0xff); + result[1] = curlx_ultouc((ctx->a >> 8) & 0xff); + result[2] = curlx_ultouc((ctx->a >> 16) & 0xff); result[3] = curlx_ultouc(ctx->a >> 24); - result[4] = curlx_ultouc((ctx->b)&0xff); - result[5] = curlx_ultouc((ctx->b >> 8)&0xff); - result[6] = curlx_ultouc((ctx->b >> 16)&0xff); + result[4] = curlx_ultouc((ctx->b) & 0xff); + result[5] = curlx_ultouc((ctx->b >> 8) & 0xff); + result[6] = curlx_ultouc((ctx->b >> 16) & 0xff); result[7] = curlx_ultouc(ctx->b >> 24); - result[8] = curlx_ultouc((ctx->c)&0xff); - result[9] = curlx_ultouc((ctx->c >> 8)&0xff); - result[10] = curlx_ultouc((ctx->c >> 16)&0xff); + result[8] = curlx_ultouc((ctx->c) & 0xff); + result[9] = curlx_ultouc((ctx->c >> 8) & 0xff); + result[10] = curlx_ultouc((ctx->c >> 16) & 0xff); result[11] = curlx_ultouc(ctx->c >> 24); - result[12] = curlx_ultouc((ctx->d)&0xff); - result[13] = curlx_ultouc((ctx->d >> 8)&0xff); - result[14] = curlx_ultouc((ctx->d >> 16)&0xff); + result[12] = curlx_ultouc((ctx->d) & 0xff); + result[13] = curlx_ultouc((ctx->d >> 8) & 0xff); + result[14] = curlx_ultouc((ctx->d >> 16) & 0xff); result[15] = curlx_ultouc(ctx->d >> 24); memset(ctx, 0, sizeof(*ctx)); diff --git a/lib/memdebug.c b/lib/memdebug.c index 7eae1708b7de..991c9eb921c3 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -165,8 +165,7 @@ static bool countcheck(const char *func, int line, const char *source) if(memlimit && source) { if(!memsize) { /* log to file */ - curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", - source, line, func); + curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", source, line, func); /* log to stderr also */ curl_mfprintf(stderr, "LIMIT %s:%d %s reached memlimit\n", source, line, func); @@ -336,8 +335,8 @@ void curl_dbg_free(void *ptr, int line, const char *source) if(ptr) { struct memdebug *mem; - if(source) - curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr); + if(source) + curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr); #ifdef __INTEL_COMPILER # pragma warning(push) @@ -386,7 +385,7 @@ SEND_TYPE_RETV curl_dbg_send(SEND_TYPE_ARG1 sockfd, rc = send(sockfd, buf, len, flags); if(source) curl_dbg_log("SEND %s:%d send(%lu) = %ld\n", - source, line, (unsigned long)len, (long)rc); + source, line, (unsigned long)len, (long)rc); return rc; } @@ -401,7 +400,7 @@ RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd, RECV_TYPE_ARG2 buf, rc = recv(sockfd, buf, len, flags); if(source) curl_dbg_log("RECV %s:%d recv(%lu) = %ld\n", - source, line, (unsigned long)len, (long)rc); + source, line, (unsigned long)len, (long)rc); return rc; } @@ -515,8 +514,7 @@ int curl_dbg_fclose(FILE *file, int line, const char *source) DEBUGASSERT(file != NULL); if(source) - curl_dbg_log("FILE %s:%d fclose(%p)\n", - source, line, (void *)file); + curl_dbg_log("FILE %s:%d fclose(%p)\n", source, line, (void *)file); /* !checksrc! disable BANNEDFUNC 1 */ res = fclose(file); diff --git a/lib/mime.c b/lib/mime.c index 7ebe47315de9..92edd78878c8 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -56,8 +56,8 @@ struct Curl_easy; # endif #endif -#define READ_ERROR ((size_t) -1) -#define STOP_FILLING ((size_t) -2) +#define READ_ERROR ((size_t)-1) +#define STOP_FILLING ((size_t)-2) static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, void *instream, bool *hasread); @@ -77,12 +77,12 @@ static curl_off_t encoder_qp_size(curl_mimepart *part); static curl_off_t mime_size(curl_mimepart *part); static const struct mime_encoder encoders[] = { - {"binary", encoder_nop_read, encoder_nop_size}, - {"8bit", encoder_nop_read, encoder_nop_size}, - {"7bit", encoder_7bit_read, encoder_nop_size}, - {"base64", encoder_base64_read, encoder_base64_size}, - {"quoted-printable", encoder_qp_read, encoder_qp_size}, - {ZERO_NULL, ZERO_NULL, ZERO_NULL} + { "binary", encoder_nop_read, encoder_nop_size }, + { "8bit", encoder_nop_read, encoder_nop_size }, + { "7bit", encoder_7bit_read, encoder_nop_size }, + { "base64", encoder_base64_read, encoder_base64_size }, + { "quoted-printable", encoder_qp_read, encoder_qp_size }, + { ZERO_NULL, ZERO_NULL, ZERO_NULL } }; /* Quoted-printable character class table. @@ -120,15 +120,13 @@ static const unsigned char qp_class[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */ }; - /* Binary --> hexadecimal ASCII table. */ static const char aschex[] = "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x41\x42\x43\x44\x45\x46"; - #ifndef __VMS #define filesize(name, stat_data) (stat_data.st_size) -#define fopen_read curlx_fopen +#define fopen_read curlx_fopen #else @@ -143,13 +141,12 @@ static const char aschex[] = * and CD/DVD images should be either a STREAM_LF format or a fixed format. * */ -curl_off_t VmsRealFileSize(const char *name, - const struct_stat *stat_buf) +curl_off_t VmsRealFileSize(const char *name, const struct_stat *stat_buf) { char buffer[8192]; curl_off_t count; int ret_stat; - FILE * file; + FILE *file; file = curlx_fopen(name, FOPEN_READTEXT); /* VMS */ if(!file) @@ -173,8 +170,7 @@ curl_off_t VmsRealFileSize(const char *name, * if not to call a routine to get the correct size. * */ -static curl_off_t VmsSpecialSize(const char *name, - const struct_stat *stat_buf) +static curl_off_t VmsSpecialSize(const char *name, const struct_stat *stat_buf) { switch(stat_buf->st_fab_rfm) { case FAB$C_VAR: @@ -196,7 +192,7 @@ static curl_off_t VmsSpecialSize(const char *name, * record format of the file. * */ -static FILE * vmsfopenread(const char *file, const char *mode) +static FILE *vmsfopenread(const char *file, const char *mode) { struct_stat statbuf; int result; @@ -217,7 +213,6 @@ static FILE * vmsfopenread(const char *file, const char *mode) #define fopen_read vmsfopenread #endif - #ifndef HAVE_BASENAME /* (Quote from The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 @@ -264,7 +259,7 @@ static char *Curl_basename(char *path) return path; } -#define basename(x) Curl_basename((x)) +#define basename(x) Curl_basename(x) #endif @@ -372,7 +367,6 @@ static void cleanup_encoder_state(struct mime_encoder_state *p) p->bufend = 0; } - /* Dummy encoder. This is used for 8bit and binary content encodings. */ static size_t encoder_nop_read(char *buffer, size_t size, bool ateof, struct curl_mimepart *part) @@ -400,7 +394,6 @@ static curl_off_t encoder_nop_size(curl_mimepart *part) return part->datasize; } - /* 7bit encoder: the encoder is just a data validity check. */ static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof, curl_mimepart *part) @@ -426,7 +419,6 @@ static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof, return cursize; } - /* Base64 content encoder. */ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof, curl_mimepart *part) @@ -521,7 +513,6 @@ static curl_off_t encoder_base64_size(curl_mimepart *part) return size + 2 * ((size - 1) / MAX_ENCODED_LINE_LENGTH); } - /* Quoted-printable lookahead. * * Check if a CRLF or end of data is in input buffer at current position + n. @@ -558,7 +549,7 @@ static size_t encoder_qp_read(char *buffer, size_t size, bool ateof, size_t len = 1; size_t consumed = 1; int i = st->buf[st->bufbeg]; - buf[0] = (char) i; + buf[0] = (char)i; buf[1] = aschex[(i >> 4) & 0xF]; buf[2] = aschex[i & 0xF]; @@ -649,13 +640,12 @@ static curl_off_t encoder_qp_size(curl_mimepart *part) return part->datasize ? -1 : 0; } - /* In-memory data callbacks. */ /* Argument is a pointer to the mime part. */ static size_t mime_mem_read(char *buffer, size_t size, size_t nitems, void *instream) { - curl_mimepart *part = (curl_mimepart *) instream; + curl_mimepart *part = (curl_mimepart *)instream; size_t sz = curlx_sotouz(part->datasize - part->state.offset); (void)size; /* Always 1 */ @@ -673,7 +663,7 @@ static size_t mime_mem_read(char *buffer, size_t size, size_t nitems, static int mime_mem_seek(void *instream, curl_off_t offset, int whence) { - curl_mimepart *part = (curl_mimepart *) instream; + curl_mimepart *part = (curl_mimepart *)instream; switch(whence) { case SEEK_CUR: @@ -693,10 +683,9 @@ static int mime_mem_seek(void *instream, curl_off_t offset, int whence) static void mime_mem_free(void *ptr) { - Curl_safefree(((curl_mimepart *) ptr)->data); + Curl_safefree(((curl_mimepart *)ptr)->data); } - /* Named file callbacks. */ /* Argument is a pointer to the mime part. */ static bool mime_open_file(curl_mimepart *part) @@ -712,7 +701,7 @@ static bool mime_open_file(curl_mimepart *part) static size_t mime_file_read(char *buffer, size_t size, size_t nitems, void *instream) { - curl_mimepart *part = (curl_mimepart *) instream; + curl_mimepart *part = (curl_mimepart *)instream; if(!nitems) return STOP_FILLING; @@ -725,7 +714,7 @@ static size_t mime_file_read(char *buffer, size_t size, size_t nitems, static int mime_file_seek(void *instream, curl_off_t offset, int whence) { - curl_mimepart *part = (curl_mimepart *) instream; + curl_mimepart *part = (curl_mimepart *)instream; if(whence == SEEK_SET && !offset && !part->fp) return CURL_SEEKFUNC_OK; /* Not open: implicitly already at BOF. */ @@ -739,7 +728,7 @@ static int mime_file_seek(void *instream, curl_off_t offset, int whence) static void mime_file_free(void *ptr) { - curl_mimepart *part = (curl_mimepart *) ptr; + curl_mimepart *part = (curl_mimepart *)ptr; if(part->fp) { curlx_fclose(part->fp); @@ -748,7 +737,6 @@ static void mime_file_free(void *ptr) Curl_safefree(part->data); } - /* Subparts callbacks. */ /* Argument is a pointer to the mime structure. */ @@ -798,7 +786,7 @@ static size_t read_part_content(curl_mimepart *part, } /* If we can determine we are at end of part data, spare a read. */ - if(part->datasize != (curl_off_t) -1 && + if(part->datasize != (curl_off_t)-1 && part->state.offset >= part->datasize) { /* sz is already zero. */ } @@ -809,8 +797,8 @@ static size_t read_part_content(curl_mimepart *part, * Cannot be processed as other kinds since read function requires * an additional parameter and is highly recursive. */ - sz = mime_subparts_read(buffer, 1, bufsize, part->arg, hasread); - break; + sz = mime_subparts_read(buffer, 1, bufsize, part->arg, hasread); + break; case MIMEKIND_FILE: if(part->fp && feof(part->fp)) break; /* At EOF. */ @@ -916,7 +904,7 @@ static size_t readback_part(curl_mimepart *part, while(bufsize) { size_t sz = 0; - struct curl_slist *hdr = (struct curl_slist *) part->state.ptr; + struct curl_slist *hdr = (struct curl_slist *)part->state.ptr; switch(part->state.state) { case MIMESTATE_BEGIN: mimesetstate(&part->state, @@ -994,7 +982,7 @@ static size_t readback_part(curl_mimepart *part, static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, void *instream, bool *hasread) { - curl_mime *mime = (curl_mime *) instream; + curl_mime *mime = (curl_mime *)instream; size_t cursize = 0; (void)size; /* Always 1 */ @@ -1070,7 +1058,7 @@ static int mime_part_rewind(curl_mimepart *part) if(part->state.state > targetstate) { res = CURL_SEEKFUNC_CANTSEEK; if(part->seekfunc) { - res = part->seekfunc(part->arg, (curl_off_t) 0, SEEK_SET); + res = part->seekfunc(part->arg, (curl_off_t)0, SEEK_SET); switch(res) { case CURL_SEEKFUNC_OK: case CURL_SEEKFUNC_FAIL: @@ -1095,7 +1083,7 @@ static int mime_part_rewind(curl_mimepart *part) static int mime_subparts_seek(void *instream, curl_off_t offset, int whence) { - curl_mime *mime = (curl_mime *) instream; + curl_mime *mime = (curl_mime *)instream; curl_mimepart *part; int result = CURL_SEEKFUNC_OK; @@ -1126,10 +1114,10 @@ static void cleanup_part_content(curl_mimepart *part) part->readfunc = NULL; part->seekfunc = NULL; part->freefunc = NULL; - part->arg = (void *) part; /* Defaults to part itself. */ + part->arg = (void *)part; /* Defaults to part itself. */ part->data = NULL; part->fp = NULL; - part->datasize = (curl_off_t) 0; /* No size yet. */ + part->datasize = (curl_off_t)0; /* No size yet. */ cleanup_encoder_state(&part->encstate); part->kind = MIMEKIND_NONE; part->flags &= ~(unsigned int)MIME_FAST_READ; @@ -1139,7 +1127,7 @@ static void cleanup_part_content(curl_mimepart *part) static void mime_subparts_free(void *ptr) { - curl_mime *mime = (curl_mime *) ptr; + curl_mime *mime = (curl_mime *)ptr; if(mime && mime->parent) { mime->parent->freefunc = NULL; /* Be sure we will not be called again. */ @@ -1151,7 +1139,7 @@ static void mime_subparts_free(void *ptr) /* Do not free subparts: unbind them. This is used for the top level only. */ static void mime_subparts_unbind(void *ptr) { - curl_mime *mime = (curl_mime *) ptr; + curl_mime *mime = (curl_mime *)ptr; if(mime && mime->parent) { mime->parent->freefunc = NULL; /* Be sure we will not be called again. */ @@ -1160,7 +1148,6 @@ static void mime_subparts_unbind(void *ptr) } } - void Curl_mime_cleanpart(curl_mimepart *part) { if(part) { @@ -1207,7 +1194,7 @@ CURLcode Curl_mime_duppart(struct Curl_easy *data, case MIMEKIND_NONE: break; case MIMEKIND_DATA: - res = curl_mime_data(dst, src->data, (size_t) src->datasize); + res = curl_mime_data(dst, src->data, (size_t)src->datasize); break; case MIMEKIND_FILE: res = curl_mime_filedata(dst, src->data); @@ -1226,7 +1213,7 @@ CURLcode Curl_mime_duppart(struct Curl_easy *data, res = mime ? curl_mime_subparts(dst, mime) : CURLE_OUT_OF_MEMORY; /* Duplicate subparts. */ - for(s = ((curl_mime *) src->arg)->firstpart; !res && s; s = s->nextpart) { + for(s = ((curl_mime *)src->arg)->firstpart; !res && s; s = s->nextpart) { d = curl_mime_addpart(mime); res = d ? Curl_mime_duppart(data, d, s) : CURLE_OUT_OF_MEMORY; } @@ -1287,7 +1274,7 @@ curl_mime *curl_mime_init(void *easy) memset(mime->boundary, '-', MIME_BOUNDARY_DASHES); if(Curl_rand_alnum(easy, - (unsigned char *) &mime->boundary[MIME_BOUNDARY_DASHES], + (unsigned char *)&mime->boundary[MIME_BOUNDARY_DASHES], MIME_RAND_BOUNDARY_CHARS + 1)) { /* failed to get random separator, bail out */ curlx_free(mime); @@ -1302,7 +1289,7 @@ curl_mime *curl_mime_init(void *easy) /* Initialize a mime part. */ void Curl_mime_initpart(curl_mimepart *part) { - memset((char *) part, 0, sizeof(*part)); + memset((char *)part, 0, sizeof(*part)); part->lastreadstatus = 1; /* Successful read status. */ mimesetstate(&part->state, MIMESTATE_BEGIN, NULL); } @@ -1367,8 +1354,7 @@ CURLcode curl_mime_filename(curl_mimepart *part, const char *filename) } /* Set mime part content from memory data. */ -CURLcode curl_mime_data(curl_mimepart *part, - const char *ptr, size_t datasize) +CURLcode curl_mime_data(curl_mimepart *part, const char *ptr, size_t datasize) { if(!part) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -1558,7 +1544,7 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part, they might not be positioned at start. Rewind them now, as a future check while rewinding the parent may cause this content to be skipped. */ - if(mime_subparts_seek(subparts, (curl_off_t) 0, SEEK_SET) != + if(mime_subparts_seek(subparts, (curl_off_t)0, SEEK_SET) != CURL_SEEKFUNC_OK) return CURLE_SEND_FAIL_REWIND; @@ -1580,12 +1566,11 @@ CURLcode curl_mime_subparts(curl_mimepart *part, curl_mime *subparts) return Curl_mime_set_subparts(part, subparts, TRUE); } - /* Readback from top mime. */ /* Argument is the dummy top part. */ size_t Curl_mime_read(char *buffer, size_t size, size_t nitems, void *instream) { - curl_mimepart *part = (curl_mimepart *) instream; + curl_mimepart *part = (curl_mimepart *)instream; size_t ret; bool hasread; @@ -1668,8 +1653,7 @@ static curl_off_t mime_size(curl_mimepart *part) if(size >= 0 && !(part->flags & MIME_BODY_ONLY)) { /* Compute total part size. */ size += slist_size(part->curlheaders, 2, NULL, 0); - size += slist_size(part->userheaders, 2, - STRCONST("Content-Type")); + size += slist_size(part->userheaders, 2, STRCONST("Content-Type")); size += 2; /* CRLF after headers. */ } return size; @@ -1718,16 +1702,16 @@ const char *Curl_mime_contenttype(const char *filename) const char *type; }; static const struct ContentType ctts[] = { - {".gif", "image/gif"}, - {".jpg", "image/jpeg"}, - {".jpeg", "image/jpeg"}, - {".png", "image/png"}, - {".svg", "image/svg+xml"}, - {".txt", "text/plain"}, - {".htm", "text/html"}, - {".html", "text/html"}, - {".pdf", "application/pdf"}, - {".xml", "application/xml"} + { ".gif", "image/gif" }, + { ".jpg", "image/jpeg" }, + { ".jpeg", "image/jpeg" }, + { ".png", "image/png" }, + { ".svg", "image/svg+xml" }, + { ".txt", "text/plain" }, + { ".htm", "text/html" }, + { ".html", "text/html" }, + { ".pdf", "application/pdf" }, + { ".xml", "application/xml" } }; if(filename) { @@ -1808,7 +1792,7 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data, } if(part->kind == MIMEKIND_MULTIPART) { - mime = (curl_mime *) part->arg; + mime = (curl_mime *)part->arg; if(mime) boundary = mime->boundary; } @@ -1821,10 +1805,10 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data, if(!search_header(part->userheaders, STRCONST("Content-Disposition"))) { if(!disposition) if(part->filename || part->name || - (contenttype && !curl_strnequal(contenttype, "multipart/", 10))) - disposition = DISPOSITION_DEFAULT; + (contenttype && !curl_strnequal(contenttype, "multipart/", 10))) + disposition = DISPOSITION_DEFAULT; if(disposition && curl_strequal(disposition, "attachment") && - !part->name && !part->filename) + !part->name && !part->filename) disposition = NULL; if(disposition) { char *name = NULL; @@ -1854,8 +1838,8 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data, Curl_safefree(filename); if(ret) return ret; - } } + } /* Issue Content-Type header. */ if(contenttype) { @@ -1870,7 +1854,7 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data, if(part->encoder) cte = part->encoder->name; else if(contenttype && strategy == MIMESTRATEGY_MAIL && - part->kind != MIMEKIND_MULTIPART) + part->kind != MIMEKIND_MULTIPART) cte = "8bit"; if(cte) { ret = Curl_mime_add_header(&part->curlheaders, @@ -1909,7 +1893,7 @@ static void mime_unpause(curl_mimepart *part) if(part->lastreadstatus == CURL_READFUNC_PAUSE) part->lastreadstatus = 1; /* Successful read status. */ if(part->kind == MIMEKIND_MULTIPART) { - curl_mime *mime = (curl_mime *) part->arg; + curl_mime *mime = (curl_mime *)part->arg; if(mime) { curl_mimepart *subpart; @@ -2113,7 +2097,7 @@ static CURLcode cr_mime_resume_from(struct Curl_easy *data, curl_off_t passed = 0; do { - char scratch[4*1024]; + char scratch[4 * 1024]; size_t readthisamountnow = (offset - passed > (curl_off_t)sizeof(scratch)) ? sizeof(scratch) : @@ -2262,8 +2246,7 @@ CURLcode curl_mime_encoder(curl_mimepart *part, const char *encoding) return CURLE_NOT_BUILT_IN; } -CURLcode curl_mime_data(curl_mimepart *part, - const char *data, size_t datasize) +CURLcode curl_mime_data(curl_mimepart *part, const char *data, size_t datasize) { (void)part; (void)data; @@ -2278,8 +2261,7 @@ CURLcode curl_mime_filedata(curl_mimepart *part, const char *filename) return CURLE_NOT_BUILT_IN; } -CURLcode curl_mime_data_cb(curl_mimepart *part, - curl_off_t datasize, +CURLcode curl_mime_data_cb(curl_mimepart *part, curl_off_t datasize, curl_read_callback readfunc, curl_seek_callback seekfunc, curl_free_callback freefunc, diff --git a/lib/mime.h b/lib/mime.h index 5073a38f709a..3ac196180bff 100644 --- a/lib/mime.h +++ b/lib/mime.h @@ -165,12 +165,11 @@ CURLcode Curl_creader_set_mime(struct Curl_easy *data, curl_mimepart *part); /* if disabled */ #define Curl_mime_initpart(x) #define Curl_mime_cleanpart(x) -#define Curl_mime_duppart(x,y,z) CURLE_OK /* Nothing to duplicate. Succeed */ -#define Curl_mime_set_subparts(a,b,c) CURLE_NOT_BUILT_IN -#define Curl_mime_prepare_headers(a,b,c,d,e) CURLE_NOT_BUILT_IN -#define Curl_mime_read NULL -#define Curl_creader_set_mime(x,y) ((void)x, CURLE_NOT_BUILT_IN) +#define Curl_mime_duppart(x, y, z) CURLE_OK /* Nothing to duplicate. Succeed */ +#define Curl_mime_set_subparts(a, b, c) CURLE_NOT_BUILT_IN +#define Curl_mime_prepare_headers(a, b, c, d, e) CURLE_NOT_BUILT_IN +#define Curl_mime_read NULL +#define Curl_creader_set_mime(x, y) ((void)x, CURLE_NOT_BUILT_IN) #endif - #endif /* HEADER_CURL_MIME_H */ diff --git a/lib/mprintf.c b/lib/mprintf.c index 046917aeb5f0..5c58e907b4b5 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -171,8 +171,8 @@ static int dollarstring(const char *p, const char **end) return (int)num - 1; } -#define is_arg_used(x,y) ((x)[(y)/8] & (1 << ((y)&7))) -#define mark_arg_used(x,y) ((x)[y/8] |= (unsigned char)(1 << ((y)&7))) +#define is_arg_used(x, y) ((x)[(y) / 8] & (1 << ((y) & 7))) +#define mark_arg_used(x, y) ((x)[y / 8] |= (unsigned char)(1 << ((y) & 7))) /* * Parse the format string. @@ -206,7 +206,7 @@ static int parsefmt(const char *format, int max_param = -1; int i; int ocount = 0; - unsigned char usedinput[MAX_PARAMETERS/8]; + unsigned char usedinput[MAX_PARAMETERS / 8]; size_t outlen = 0; struct outsegment *optr; int use_dollar = DOLLAR_UNKNOWN; @@ -364,8 +364,15 @@ static int parsefmt(const char *format, if(!(flags & FLAGS_LEFT)) flags |= FLAGS_PAD_NIL; FALLTHROUGH(); - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': { + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': { curl_off_t num; flags |= FLAGS_WIDTH; fmt--; @@ -431,7 +438,7 @@ static int parsefmt(const char *format, type = FORMAT_LONGU; else type = FORMAT_INTU; - flags |= FLAGS_OCTAL|FLAGS_UNSIGNED; + flags |= FLAGS_OCTAL | FLAGS_UNSIGNED; break; case 'x': if(flags & FLAGS_LONGLONG) @@ -440,7 +447,7 @@ static int parsefmt(const char *format, type = FORMAT_LONGU; else type = FORMAT_INTU; - flags |= FLAGS_HEX|FLAGS_UNSIGNED; + flags |= FLAGS_HEX | FLAGS_UNSIGNED; break; case 'X': if(flags & FLAGS_LONGLONG) @@ -449,7 +456,7 @@ static int parsefmt(const char *format, type = FORMAT_LONGU; else type = FORMAT_INTU; - flags |= FLAGS_HEX|FLAGS_UPPER|FLAGS_UNSIGNED; + flags |= FLAGS_HEX | FLAGS_UPPER | FLAGS_UNSIGNED; break; case 'c': type = FORMAT_INT; @@ -464,7 +471,7 @@ static int parsefmt(const char *format, break; case 'E': type = FORMAT_DOUBLE; - flags |= FLAGS_FLOATE|FLAGS_UPPER; + flags |= FLAGS_FLOATE | FLAGS_UPPER; break; case 'g': type = FORMAT_DOUBLE; @@ -472,7 +479,7 @@ static int parsefmt(const char *format, break; case 'G': type = FORMAT_DOUBLE; - flags |= FLAGS_FLOATG|FLAGS_UPPER; + flags |= FLAGS_FLOATG | FLAGS_UPPER; break; default: /* invalid instruction, disregard and continue */ @@ -627,9 +634,9 @@ static bool out_double(void *userp, double dnum, char *work, int *donep) { - char formatbuf[32]="%"; + char formatbuf[32] = "%"; char *fptr = &formatbuf[1]; - size_t left = sizeof(formatbuf)-strlen(formatbuf); + size_t left = sizeof(formatbuf) - strlen(formatbuf); int flags = p->flags; int width = p->width; int prec = p->prec; @@ -745,7 +752,7 @@ static bool out_number(void *userp, if(!(flags & FLAGS_LEFT)) while(--width > 0) OUTCHAR(' '); - OUTCHAR((char) num); + OUTCHAR((char)num); if(flags & FLAGS_LEFT) while(--width > 0) OUTCHAR(' '); @@ -868,7 +875,7 @@ static bool out_string(void *userp, if(!str) { /* Write null string if there is space. */ - if(prec == -1 || prec >= (int) sizeof(nilstr) - 1) { + if(prec == -1 || prec >= (int)sizeof(nilstr) - 1) { str = nilstr; len = sizeof(nilstr) - 1; /* Disable quotes around (nil) */ @@ -916,10 +923,10 @@ static bool out_pointer(void *userp, { /* Generic pointer. */ if(ptr) { - size_t num = (size_t) ptr; + size_t num = (size_t)ptr; /* If the pointer is not NULL, write it as a %#x spec. */ - p->flags |= FLAGS_HEX|FLAGS_ALT; + p->flags |= FLAGS_HEX | FLAGS_ALT; if(out_number(userp, stream, p, num, 0, work, donep)) return TRUE; } @@ -958,13 +965,12 @@ static bool out_pointer(void *userp, * All output is sent to the 'stream()' callback, one byte at a time. */ -static int formatf( - void *userp, /* untouched by format(), just sent to the stream() function in - the second argument */ - /* function pointer called for each output character */ - int (*stream)(unsigned char, void *), - const char *format, /* %-formatted string */ - va_list ap_save) /* list of parameters */ +static int formatf(void *userp, /* untouched by format(), just sent to the + stream() function in the second argument */ + /* function pointer called for each output character */ + int (*stream)(unsigned char, void *), + const char *format, /* %-formatted string */ + va_list ap_save) /* list of parameters */ { int done = 0; /* number of characters written */ int i; @@ -1065,15 +1071,15 @@ static int formatf( /* Answer the count of characters written. */ #ifdef HAVE_LONG_LONG_TYPE if(p.flags & FLAGS_LONGLONG) - *(LONG_LONG_TYPE *) iptr->val.ptr = (LONG_LONG_TYPE)done; + *(LONG_LONG_TYPE *)iptr->val.ptr = (LONG_LONG_TYPE)done; else #endif if(p.flags & FLAGS_LONG) - *(long *) iptr->val.ptr = (long)done; + *(long *)iptr->val.ptr = (long)done; else if(!(p.flags & FLAGS_SHORT)) - *(int *) iptr->val.ptr = (int)done; + *(int *)iptr->val.ptr = (int)done; else - *(short *) iptr->val.ptr = (short)done; + *(short *)iptr->val.ptr = (short)done; break; default: @@ -1138,7 +1144,7 @@ static int alloc_addbyter(unsigned char outc, void *f) CURLcode result = curlx_dyn_addn(infop->b, &outc, 1); if(result) { infop->merr = result == CURLE_TOO_LARGE ? MERR_TOO_LARGE : MERR_MEM; - return 1 ; /* fail */ + return 1; /* fail */ } return 0; } diff --git a/lib/mqtt.c b/lib/mqtt.c index a8975d53919b..df5f37775f4f 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -51,8 +51,8 @@ /* #define MQTT_MSG_PINGREQ 0xC0 */ #define MQTT_MSG_PINGRESP 0xD0 -#define MQTT_CONNACK_LEN 2 -#define MQTT_SUBACK_LEN 3 +#define MQTT_CONNACK_LEN 2 +#define MQTT_SUBACK_LEN 3 #define MQTT_CLIENTID_LEN 12 /* "curl0123abcd" */ /* meta key for storing protocol meta at easy handle */ @@ -92,7 +92,6 @@ struct MQTT { BIT(pingsent); /* 1 while we wait for ping response */ }; - /* * Forward declarations. */ @@ -315,7 +314,7 @@ static CURLcode mqtt_connect(struct Curl_easy *data) int rc = 0; /* remain length */ int remain_pos = 0; - char remain[4] = {0}; + char remain[4] = { 0 }; size_t packetlen = 0; size_t start_user = 0; size_t start_pwd = 0; @@ -324,12 +323,10 @@ static CURLcode mqtt_connect(struct Curl_easy *data) char *packet = NULL; /* extracting username from request */ - const char *username = data->state.aptr.user ? - data->state.aptr.user : ""; + const char *username = data->state.aptr.user ? data->state.aptr.user : ""; const size_t ulen = strlen(username); /* extracting password from request */ - const char *passwd = data->state.aptr.passwd ? - data->state.aptr.passwd : ""; + const char *passwd = data->state.aptr.passwd ? data->state.aptr.passwd : ""; const size_t plen = strlen(passwd); const size_t payloadlen = ulen + plen + MQTT_CLIENTID_LEN + 2 + /* The plus 2s below are for the MSB and LSB describing the length of the @@ -531,7 +528,7 @@ static CURLcode mqtt_subscribe(struct Curl_easy *data) packet[1 + n] = (mqtt->packetid >> 8) & 0xff; packet[2 + n] = mqtt->packetid & 0xff; packet[3 + n] = (topiclen >> 8) & 0xff; - packet[4 + n ] = topiclen & 0xff; + packet[4 + n] = topiclen & 0xff; memcpy(&packet[5 + n], topic, topiclen); packet[5 + n + topiclen] = 0; /* QoS zero */ @@ -661,7 +658,7 @@ static size_t mqtt_decode_len(unsigned char *buf, } #ifdef DEBUGBUILD -static const char *statenames[]={ +static const char *statenames[] = { "MQTT_FIRST", "MQTT_REMAINING_LENGTH", "MQTT_CONNACK", @@ -695,7 +692,6 @@ static void mqstate(struct Curl_easy *data, mqtt->nextstate = nextstate; } - static CURLcode mqtt_read_publish(struct Curl_easy *data, bool *done) { CURLcode result = CURLE_OK; @@ -756,7 +752,7 @@ static CURLcode mqtt_read_publish(struct Curl_easy *data, bool *done) FALLTHROUGH(); case MQTT_PUB_REMAIN: { /* read rest of packet, but no more. Cap to buffer size */ - char buffer[4*1024]; + char buffer[4 * 1024]; size_t rest = mq->npacket; if(rest > sizeof(buffer)) rest = sizeof(buffer); @@ -886,7 +882,7 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done) if(result) return result; - infof(data, "mqtt_doing: state [%d]", (int) mqtt->state); + infof(data, "mqtt_doing: state [%d]", (int)mqtt->state); switch(mqtt->state) { case MQTT_FIRST: /* Read the initial byte only */ diff --git a/lib/multi.c b/lib/multi.c index c5b78f53e446..b912f7a212f2 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -55,7 +55,7 @@ #include "urlapi-int.h" /* initial multi->xfers table size for a full multi */ -#define CURL_XFER_TABLE_SIZE 512 +#define CURL_XFER_TABLE_SIZE 512 /* CURL_SOCKET_HASH_TABLE_SIZE should be a prime number. Increasing it from 97 @@ -195,12 +195,11 @@ static void mstate(struct Curl_easy *data, CURLMstate state } #ifndef DEBUGBUILD -#define multistate(x,y) mstate(x,y) +#define multistate(x, y) mstate(x, y) #else -#define multistate(x,y) mstate(x,y, __LINE__) +#define multistate(x, y) mstate(x, y, __LINE__) #endif - /* multi->proto_hash destructor. Should never be called as elements * MUST be added with their own destructor */ static void ph_freeentry(void *p) @@ -343,15 +342,14 @@ static void multi_warn_debug(struct Curl_multi *multi, struct Curl_easy *data) if(!multi->warned) { infof(data, "!!! WARNING !!!"); infof(data, "This is a debug build of libcurl, " - "do not use in production."); + "do not use in production."); multi->warned = TRUE; } } #else -#define multi_warn_debug(x,y) Curl_nop_stmt +#define multi_warn_debug(x, y) Curl_nop_stmt #endif - static CURLMcode multi_xfers_add(struct Curl_multi *multi, struct Curl_easy *data) { @@ -380,8 +378,8 @@ static CURLMcode multi_xfers_add(struct Curl_multi *multi, new_size = max_capacity; /* can not be larger than this */ } else { - /* make it a 64 multiple, since our bitsets frow by that and - * small (easy_multi) grows to at least 64 on first resize. */ + /* make it a 64 multiple, since our bitsets frow by that and + * small (easy_multi) grows to at least 64 on first resize. */ new_size = (((used + min_unused) + 63) / 64) * 64; } } @@ -564,7 +562,7 @@ static bool multi_conn_should_close(struct connectdata *conn, && !(conn->http_negotiate_state == GSS_AUTHRECV || conn->proxy_negotiate_state == GSS_AUTHRECV) #endif - ) + ) return TRUE; /* Unless this connection is for a "connect-only" transfer, it @@ -842,7 +840,7 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) if(data->state.lastconnect_id != -1) { /* Mark any connect-only connection for closure */ Curl_cpool_do_by_id(data, data->state.lastconnect_id, - close_connect_only, NULL); + close_connect_only, NULL); } #ifdef USE_LIBPSL @@ -1076,14 +1074,12 @@ static CURLcode mstate_perform_pollset(struct Curl_easy *data, else { /* Default is to obey the data->req.keepon flags for send/recv */ if(CURL_WANT_RECV(data) && CONN_SOCK_IDX_VALID(conn->recv_idx)) { - result = Curl_pollset_add_in( - data, ps, conn->sock[conn->recv_idx]); + result = Curl_pollset_add_in(data, ps, conn->sock[conn->recv_idx]); } if(!result && Curl_req_want_send(data) && CONN_SOCK_IDX_VALID(conn->send_idx)) { - result = Curl_pollset_add_out( - data, ps, conn->sock[conn->send_idx]); + result = Curl_pollset_add_out(data, ps, conn->sock[conn->send_idx]); } } if(!result) @@ -1174,34 +1170,33 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data, if(CURL_TRC_M_is_verbose(data)) { size_t timeout_count = Curl_llist_count(&data->state.timeoutlist); switch(ps->n) { - case 0: - CURL_TRC_M(data, "pollset[], timeouts=%zu, paused %d/%d (r/w)", - timeout_count, - Curl_xfer_send_is_paused(data), - Curl_xfer_recv_is_paused(data)); - break; - case 1: - CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", - ps->sockets[0], - (ps->actions[0] & CURL_POLL_IN) ? "IN" : "", - (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "", - timeout_count); - break; - case 2: - CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s, " - "fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", - ps->sockets[0], - (ps->actions[0] & CURL_POLL_IN) ? "IN" : "", - (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "", - ps->sockets[1], - (ps->actions[1] & CURL_POLL_IN) ? "IN" : "", - (ps->actions[1] & CURL_POLL_OUT) ? "OUT" : "", - timeout_count); - break; - default: - CURL_TRC_M(data, "pollset[fds=%u], timeouts=%zu", - ps->n, timeout_count); - break; + case 0: + CURL_TRC_M(data, "pollset[], timeouts=%zu, paused %d/%d (r/w)", + timeout_count, + Curl_xfer_send_is_paused(data), + Curl_xfer_recv_is_paused(data)); + break; + case 1: + CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", + ps->sockets[0], + (ps->actions[0] & CURL_POLL_IN) ? "IN" : "", + (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "", + timeout_count); + break; + case 2: + CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s, " + "fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu", + ps->sockets[0], + (ps->actions[0] & CURL_POLL_IN) ? "IN" : "", + (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "", + ps->sockets[1], + (ps->actions[1] & CURL_POLL_IN) ? "IN" : "", + (ps->actions[1] & CURL_POLL_OUT) ? "OUT" : "", + timeout_count); + break; + default: + CURL_TRC_M(data, "pollset[fds=%u], timeouts=%zu", ps->n, timeout_count); + break; } CURL_TRC_EASY_TIMERS(data); } @@ -1259,8 +1254,7 @@ CURLMcode curl_multi_fdset(CURLM *m, if((int)ps.sockets[i] > this_max_fd) this_max_fd = (int)ps.sockets[i]; } - } - while(Curl_uint32_bset_next(&multi->process, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } Curl_cshutdn_setfds(&multi->cshutdn, multi->admin, @@ -1305,8 +1299,7 @@ CURLMcode curl_multi_waitfds(CURLM *m, } Curl_multi_pollset(data, &ps); need += Curl_waitfds_add_ps(&cwfds, &ps); - } - while(Curl_uint32_bset_next(&multi->process, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } need += Curl_cshutdn_add_waitfds(&multi->cshutdn, multi->admin, &cwfds); @@ -1394,8 +1387,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, result = CURLM_OUT_OF_MEMORY; goto out; } - } - while(Curl_uint32_bset_next(&multi->process, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } if(Curl_cshutdn_add_pollfds(&multi->cshutdn, multi->admin, &cpfds)) { @@ -1424,11 +1416,11 @@ static CURLMcode multi_wait(struct Curl_multi *multi, for(i = 0; i < cpfds.n; i++) { long mask = 0; if(cpfds.pfds[i].events & POLLIN) - mask |= FD_READ|FD_ACCEPT|FD_CLOSE; + mask |= FD_READ | FD_ACCEPT | FD_CLOSE; if(cpfds.pfds[i].events & POLLPRI) mask |= FD_OOB; if(cpfds.pfds[i].events & POLLOUT) { - mask |= FD_WRITE|FD_CONNECT|FD_CLOSE; + mask |= FD_WRITE | FD_CONNECT | FD_CLOSE; reset_socket_fdwrite(cpfds.pfds[i].fd); } if(mask) { @@ -1503,9 +1495,9 @@ static CURLMcode multi_wait(struct Curl_multi *multi, curl_socket_t s = extra_fds[i].fd; wsa_events.lNetworkEvents = 0; if(WSAEnumNetworkEvents(s, NULL, &wsa_events) == 0) { - if(wsa_events.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE)) + if(wsa_events.lNetworkEvents & (FD_READ | FD_ACCEPT | FD_CLOSE)) mask |= CURL_WAIT_POLLIN; - if(wsa_events.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE)) + if(wsa_events.lNetworkEvents & (FD_WRITE | FD_CONNECT | FD_CLOSE)) mask |= CURL_WAIT_POLLOUT; if(wsa_events.lNetworkEvents & FD_OOB) mask |= CURL_WAIT_POLLPRI; @@ -1610,8 +1602,7 @@ CURLMcode curl_multi_poll(CURLM *multi, int timeout_ms, int *ret) { - return multi_wait(multi, extra_fds, extra_nfds, timeout_ms, ret, TRUE, - TRUE); + return multi_wait(multi, extra_fds, extra_nfds, timeout_ms, ret, TRUE, TRUE); } CURLMcode curl_multi_wakeup(CURLM *m) @@ -1864,8 +1855,7 @@ static CURLcode protocol_doing(struct Curl_easy *data, bool *done) * proceed with some action. * */ -static CURLcode protocol_connect(struct Curl_easy *data, - bool *protocol_done) +static CURLcode protocol_connect(struct Curl_easy *data, bool *protocol_done) { CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; @@ -1874,8 +1864,7 @@ static CURLcode protocol_connect(struct Curl_easy *data, *protocol_done = FALSE; - if(Curl_conn_is_connected(conn, FIRSTSOCKET) - && conn->bits.protoconnstart) { + if(Curl_conn_is_connected(conn, FIRSTSOCKET) && conn->bits.protoconnstart) { /* We already are connected, get back. This may happen when the connect worked fine in the first call, like when we connect to a local server or proxy. Note that we do not know if the protocol is actually done. @@ -1942,8 +1931,7 @@ static CURLcode multi_follow(struct Curl_easy *data, return CURLE_TOO_MANY_REDIRECTS; } -static CURLcode mspeed_check(struct Curl_easy *data, - struct curltime now) +static CURLcode mspeed_check(struct Curl_easy *data, struct curltime now) { timediff_t recv_wait_ms = 0; timediff_t send_wait_ms = 0; @@ -2160,8 +2148,7 @@ static CURLMcode state_do(struct Curl_easy *data, multi_done(data, CURLE_OK, FALSE); /* if there is no connection left, skip the DONE state */ - multistate(data, data->conn ? - MSTATE_DONE : MSTATE_COMPLETED); + multistate(data, data->conn ? MSTATE_DONE : MSTATE_COMPLETED); rc = CURLM_CALL_MULTI_PERFORM; goto end; } @@ -2597,8 +2584,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, if(control) { /* if positive, advance to DO_DONE if negative, go back to DOING */ - multistate(data, control == 1 ? - MSTATE_DID : MSTATE_DOING); + multistate(data, control == 1 ? MSTATE_DID : MSTATE_DOING); rc = CURLM_CALL_MULTI_PERFORM; } /* else @@ -2796,7 +2782,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, return rc; } - CURLMcode curl_multi_perform(CURLM *m, int *running_handles) { CURLMcode returncode = CURLM_OK; @@ -2832,8 +2817,7 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) result = multi_runsingle(multi, &now, data); if(result) returncode = result; - } - while(Curl_uint32_bset_next(&multi->process, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->process, mid, &mid)); } sigpipe_restore(&pipe_st); @@ -2925,8 +2909,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) #endif if(data->state.internal) Curl_close(&data); - } - while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)); + } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)); } Curl_cpool_destroy(&multi->cpool); @@ -3017,7 +3000,6 @@ CURLMsg *curl_multi_info_read(CURLM *m, int *msgs_in_queue) return NULL; } - void Curl_multi_will_close(struct Curl_easy *data, curl_socket_t s) { if(data) { @@ -3160,8 +3142,7 @@ static CURLMcode multi_run_dirty(struct multi_run_ctx *mrc) CURL_TRC_M(multi->admin, "multi_run_dirty, %u no longer found", mid); Curl_uint32_bset_remove(&multi->dirty, mid); } - } - while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); } out: @@ -3243,8 +3224,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi, } #undef curl_multi_setopt -CURLMcode curl_multi_setopt(CURLM *m, - CURLMoption option, ...) +CURLMcode curl_multi_setopt(CURLM *m, CURLMoption option, ...) { CURLMcode res = CURLM_OK; va_list param; @@ -3305,14 +3285,13 @@ CURLMcode curl_multi_setopt(CURLM *m, break; case CURLMOPT_PIPELINING_SERVER_BL: break; - case CURLMOPT_MAX_CONCURRENT_STREAMS: - { - long streams = va_arg(param, long); - if((streams < 1) || (streams > INT_MAX)) - streams = 100; - multi->max_concurrent_streams = (unsigned int)streams; - } + case CURLMOPT_MAX_CONCURRENT_STREAMS: { + long streams = va_arg(param, long); + if((streams < 1) || (streams > INT_MAX)) + streams = 100; + multi->max_concurrent_streams = (unsigned int)streams; break; + } case CURLMOPT_NETWORK_CHANGED: { long val = va_arg(param, long); if(val & CURLMNWC_CLEAR_DNS) { @@ -3371,7 +3350,6 @@ CURLMcode curl_multi_socket_all(CURLM *m, int *running_handles) return multi_socket(multi, TRUE, CURL_SOCKET_BAD, 0, running_handles); } - static bool multi_has_dirties(struct Curl_multi *multi) { uint32_t mid; @@ -3388,8 +3366,7 @@ static bool multi_has_dirties(struct Curl_multi *multi) CURL_TRC_M(multi->admin, "dirty transfer %u no longer found", mid); Curl_uint32_bset_remove(&multi->dirty, mid); } - } - while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); } return FALSE; } @@ -3398,7 +3375,7 @@ static void multi_timeout(struct Curl_multi *multi, struct curltime *expire_time, long *timeout_ms) { - static const struct curltime tv_zero = {0, 0}; + static const struct curltime tv_zero = { 0, 0 }; #ifndef CURL_DISABLE_VERBOSE_STRINGS struct Curl_easy *data = NULL; #endif @@ -3453,8 +3430,7 @@ static void multi_timeout(struct Curl_multi *multi, #ifndef CURL_DISABLE_VERBOSE_STRINGS if(data && CURL_TRC_TIMER_is_verbose(data)) { - struct Curl_llist_node *e = - Curl_llist_head(&data->state.timeoutlist); + struct Curl_llist_node *e = Curl_llist_head(&data->state.timeoutlist); if(e) { struct time_node *n = Curl_node_elem(e); CURL_TRC_TIMER(data, n->eid, "gives multi timeout in %ldms", @@ -3506,8 +3482,7 @@ CURLMcode Curl_update_timer(struct Curl_multi *multi) set_value = TRUE; } else if(multi->last_timeout_ms < 0) { - CURL_TRC_M(multi->admin, "[TIMER] set %ldms, none before", - timeout_ms); + CURL_TRC_M(multi->admin, "[TIMER] set %ldms, none before", timeout_ms); set_value = TRUE; } else if(curlx_timediff_us(multi->last_expire_ts, expire_ts)) { @@ -3543,8 +3518,7 @@ CURLMcode Curl_update_timer(struct Curl_multi *multi) * * Remove a given timestamp from the list of timeouts. */ -static void -multi_deltimeout(struct Curl_easy *data, expire_id eid) +static void multi_deltimeout(struct Curl_easy *data, expire_id eid) { struct Curl_llist_node *e; struct Curl_llist *timeoutlist = &data->state.timeoutlist; @@ -3565,11 +3539,10 @@ multi_deltimeout(struct Curl_easy *data, expire_id eid) * of list is always the timeout nearest in time. * */ -static CURLMcode -multi_addtimeout(struct Curl_easy *data, - struct curltime *stamp, - expire_id eid, - const struct curltime *nowp) +static CURLMcode multi_addtimeout(struct Curl_easy *data, + struct curltime *stamp, + expire_id eid, + const struct curltime *nowp) { struct Curl_llist_node *e; struct time_node *node; @@ -3594,7 +3567,6 @@ multi_addtimeout(struct Curl_easy *data, break; prev = e; } - } /* else this is the first timeout on the list */ @@ -3621,8 +3593,8 @@ void Curl_expire_ex(struct Curl_easy *data, DEBUGASSERT(id < EXPIRE_LAST); set = *nowp; - set.tv_sec += (time_t)(milli/1000); /* might be a 64 to 32 bits conversion */ - set.tv_usec += (int)(milli%1000)*1000; + set.tv_sec += (time_t)(milli / 1000); /* may be a 64 to 32-bit conversion */ + set.tv_usec += (int)(milli % 1000) * 1000; if(set.tv_usec >= 1000000) { set.tv_sec++; @@ -3783,8 +3755,7 @@ static void process_pending_handles(struct Curl_multi *multi) /* transfer no longer known, should not happen */ Curl_uint32_bset_remove(&multi->pending, mid); DEBUGASSERT(0); - } - while(Curl_uint32_bset_next(&multi->pending, mid, &mid)); + } while(Curl_uint32_bset_next(&multi->pending, mid, &mid)); } } @@ -3820,8 +3791,7 @@ CURL **curl_multi_get_handles(CURLM *m) DEBUGASSERT(i < count); if(!data->state.internal) a[i++] = data; - } - while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)); + } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry)); } a[i] = NULL; /* last entry is a NULL */ } diff --git a/lib/multi_ev.c b/lib/multi_ev.c index 026cbd29968e..40b49da85d95 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -64,7 +64,7 @@ struct mev_sh_entry { static size_t mev_sh_entry_hash(void *key, size_t key_length, size_t slots_num) { - curl_socket_t fd = *((curl_socket_t *) key); + curl_socket_t fd = *((curl_socket_t *)key); (void)key_length; return (fd % (curl_socket_t)slots_num); } @@ -72,8 +72,9 @@ static size_t mev_sh_entry_hash(void *key, size_t key_length, size_t slots_num) static size_t mev_sh_entry_compare(void *k1, size_t k1_len, void *k2, size_t k2_len) { - (void)k1_len; (void)k2_len; - return (*((curl_socket_t *) k1)) == (*((curl_socket_t *) k2)); + (void)k1_len; + (void)k2_len; + return (*((curl_socket_t *)k1)) == (*((curl_socket_t *)k2)); } /* sockhash entry destructor callback */ @@ -85,8 +86,8 @@ static void mev_sh_entry_dtor(void *freethis) } /* look up a given socket in the socket hash, skip invalid sockets */ -static struct mev_sh_entry * -mev_sh_entry_get(struct Curl_hash *sh, curl_socket_t s) +static struct mev_sh_entry *mev_sh_entry_get(struct Curl_hash *sh, + curl_socket_t s) { if(s != CURL_SOCKET_BAD) { /* only look for proper sockets */ @@ -96,8 +97,8 @@ mev_sh_entry_get(struct Curl_hash *sh, curl_socket_t s) } /* make sure this socket is present in the hash for this handle */ -static struct mev_sh_entry * -mev_sh_entry_add(struct Curl_hash *sh, curl_socket_t s) +static struct mev_sh_entry *mev_sh_entry_add(struct Curl_hash *sh, + curl_socket_t s) { struct mev_sh_entry *there = mev_sh_entry_get(sh, s); struct mev_sh_entry *check; @@ -166,7 +167,6 @@ static bool mev_sh_entry_conn_add(struct mev_sh_entry *e, return TRUE; } - static bool mev_sh_entry_xfer_remove(struct mev_sh_entry *e, struct Curl_easy *data) { @@ -202,8 +202,7 @@ static CURLMcode mev_forget_socket(struct Curl_multi *multi, /* We managed this socket before, tell the socket callback to forget it. */ if(entry->announced && multi->socket_cb) { - CURL_TRC_M(data, "ev %s, call(fd=%" FMT_SOCKET_T ", ev=REMOVE)", - cause, s); + CURL_TRC_M(data, "ev %s, call(fd=%" FMT_SOCKET_T ", ev=REMOVE)", cause, s); mev_in_callback(multi, TRUE); rc = multi->socket_cb(data, s, CURL_POLL_REMOVE, multi->socket_userp, entry->user_data); @@ -446,8 +445,7 @@ static void mev_pollset_dtor(void *key, size_t klen, void *entry) } } -static struct easy_pollset* -mev_add_new_conn_pollset(struct connectdata *conn) +static struct easy_pollset *mev_add_new_conn_pollset(struct connectdata *conn) { struct easy_pollset *ps; @@ -459,8 +457,7 @@ mev_add_new_conn_pollset(struct connectdata *conn) return ps; } -static struct easy_pollset* -mev_add_new_xfer_pollset(struct Curl_easy *data) +static struct easy_pollset *mev_add_new_xfer_pollset(struct Curl_easy *data) { struct easy_pollset *ps; @@ -472,9 +469,8 @@ mev_add_new_xfer_pollset(struct Curl_easy *data) return ps; } -static struct easy_pollset * -mev_get_last_pollset(struct Curl_easy *data, - struct connectdata *conn) +static struct easy_pollset *mev_get_last_pollset(struct Curl_easy *data, + struct connectdata *conn) { if(data) { if(conn) @@ -484,8 +480,7 @@ mev_get_last_pollset(struct Curl_easy *data, return NULL; } -static CURLMcode mev_assess(struct Curl_multi *multi, - struct Curl_easy *data, +static CURLMcode mev_assess(struct Curl_multi *multi, struct Curl_easy *data, struct connectdata *conn) { struct easy_pollset ps, *last_ps; @@ -551,13 +546,11 @@ CURLMcode Curl_multi_ev_assess_xfer_bset(struct Curl_multi *multi, struct Curl_easy *data = Curl_multi_get_easy(multi, mid); if(data) result = Curl_multi_ev_assess_xfer(multi, data); - } - while(!result && Curl_uint32_bset_next(set, mid, &mid)); + } while(!result && Curl_uint32_bset_next(set, mid, &mid)); } return result; } - CURLMcode Curl_multi_ev_assign(struct Curl_multi *multi, curl_socket_t s, void *user_data) @@ -596,8 +589,7 @@ void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, CURL_TRC_M(multi->admin, "socket transfer %u no longer found", mid); Curl_uint32_spbset_remove(&entry->xfers, mid); } - } - while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid)); + } while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid)); } if(entry->conn) diff --git a/lib/multi_ntfy.c b/lib/multi_ntfy.c index 43e4db9e8270..4fdbe7400a4a 100644 --- a/lib/multi_ntfy.c +++ b/lib/multi_ntfy.c @@ -38,7 +38,7 @@ struct mntfy_entry { uint32_t type; }; -#define CURL_MNTFY_CHUNK_SIZE 128 +#define CURL_MNTFY_CHUNK_SIZE 128 struct mntfy_chunk { struct mntfy_chunk *next; @@ -171,7 +171,7 @@ void Curl_mntfy_add(struct Curl_easy *data, unsigned int type) Curl_uint32_bset_contains(&multi->ntfy.enabled, (uint32_t)type)) { /* append to list of outstanding notifications */ struct mntfy_chunk *tail = mntfy_non_full_tail(&multi->ntfy); - CURL_TRC_M(data, "[NTFY] add %d for xfer %u", type, data->mid); + CURL_TRC_M(data, "[NTFY] add %d for xfer %u", type, data->mid); if(tail) mntfy_chunk_append(tail, data, (uint32_t)type); else diff --git a/lib/multi_ntfy.h b/lib/multi_ntfy.h index c3094a9ebe71..144d0319d0e6 100644 --- a/lib/multi_ntfy.h +++ b/lib/multi_ntfy.h @@ -47,11 +47,12 @@ CURLMcode Curl_mntfy_disable(struct Curl_multi *multi, unsigned int type); void Curl_mntfy_add(struct Curl_easy *data, unsigned int type); -#define CURLM_NTFY(d,t) \ - do { if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \ - Curl_mntfy_add((d), (t)); } while(0) +#define CURLM_NTFY(d, t) \ + do { \ + if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \ + Curl_mntfy_add((d), (t)); \ + } while(0) CURLMcode Curl_mntfy_dispatch_all(struct Curl_multi *multi); - #endif /* HEADER_CURL_MULTI_NTFY_H */ diff --git a/lib/multiif.h b/lib/multiif.h index 62c68c9cedf3..9db5b0100029 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -68,7 +68,6 @@ CURLMcode Curl_multi_add_perform(struct Curl_multi *multi, struct Curl_easy *data, struct connectdata *conn); - /* Return the value of the CURLMOPT_MAX_CONCURRENT_STREAMS option */ unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi); diff --git a/lib/netrc.c b/lib/netrc.c index f8de4082972c..d26d194fe2d9 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -60,8 +60,8 @@ enum found_state { #define FOUND_LOGIN 1 #define FOUND_PASSWORD 2 -#define MAX_NETRC_LINE 16384 -#define MAX_NETRC_FILE (128*1024) +#define MAX_NETRC_LINE 16384 +#define MAX_NETRC_FILE (128 * 1024) #define MAX_NETRC_TOKEN 4096 /* convert a dynbuf call CURLcode error to a NETRCcode error */ @@ -318,7 +318,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, if(!specific_login) Curl_safefree(login); } - if((found == (FOUND_PASSWORD|FOUND_LOGIN)) && our_login) { + if((found == (FOUND_PASSWORD | FOUND_LOGIN)) && our_login) { done = TRUE; break; } @@ -412,8 +412,8 @@ NETRCcode Curl_parsenetrc(struct store_netrc *store, const char *host, } else { struct passwd pw, *pw_res; - if(!getpwuid_r(geteuid(), &pw, pwbuf, sizeof(pwbuf), &pw_res) - && pw_res) { + if(!getpwuid_r(geteuid(), &pw, pwbuf, sizeof(pwbuf), &pw_res) && + pw_res) { home = pw.pw_dir; } #elif defined(HAVE_GETPWUID) && defined(HAVE_GETEUID) diff --git a/lib/netrc.h b/lib/netrc.h index 0d6d081bfbb9..81012d0d97e6 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -50,14 +50,14 @@ void Curl_netrc_cleanup(struct store_netrc *s); NETRCcode Curl_parsenetrc(struct store_netrc *s, const char *host, char **loginp, char **passwordp, const char *filename); - /* Assume: (*passwordp)[0]=0, host[0] != 0. - * If (*loginp)[0] = 0, search for login and password within a machine - * section in the netrc. - * If (*loginp)[0] != 0, search for password within machine and login. - */ +/* Assume: (*passwordp)[0]=0, host[0] != 0. + * If (*loginp)[0] = 0, search for login and password within a machine + * section in the netrc. + * If (*loginp)[0] != 0, search for password within machine and login. + */ #else /* disabled */ -#define Curl_parsenetrc(a,b,c,d,e,f) 1 +#define Curl_parsenetrc(a, b, c, d, e, f) 1 #define Curl_netrc_init(x) #define Curl_netrc_cleanup(x) #endif diff --git a/lib/noproxy.c b/lib/noproxy.c index 1e19c369c0d9..569466fb62ec 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -141,8 +141,7 @@ static bool match_host(const char *token, size_t tokenlen, else if(tokenlen < namelen) { /* case B, tailmatch domain */ match = (name[namelen - tokenlen - 1] == '.') && - curl_strnequal(token, name + (namelen - tokenlen), - tokenlen); + curl_strnequal(token, name + (namelen - tokenlen), tokenlen); } /* case C passes through, not a match */ return match; @@ -180,11 +179,10 @@ static bool match_ip(int type, const char *token, size_t tokenlen, return Curl_cidr4_match(name, check, bits); } - /**************************************************************** -* Checks if the host is in the noproxy list. returns TRUE if it matches and -* therefore the proxy should NOT be used. -****************************************************************/ + * Checks if the host is in the noproxy list. returns TRUE if it matches and + * therefore the proxy should NOT be used. + ****************************************************************/ bool Curl_check_noproxy(const char *name, const char *no_proxy) { char hostip[128]; diff --git a/lib/openldap.c b/lib/openldap.c index bb48edd32f2c..ba1a39181f38 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -112,7 +112,6 @@ static Curl_recv oldap_recv; /* * LDAP protocol handler. */ - const struct Curl_handler Curl_handler_ldap = { "ldap", /* scheme */ oldap_setup_connection, /* setup_connection */ @@ -136,14 +135,13 @@ const struct Curl_handler Curl_handler_ldap = { CURLPROTO_LDAP, /* protocol */ CURLPROTO_LDAP, /* family */ PROTOPT_SSL_REUSE | /* flags */ - PROTOPT_CONN_REUSE + PROTOPT_CONN_REUSE }; #ifdef USE_SSL /* * LDAPS protocol handler. */ - const struct Curl_handler Curl_handler_ldaps = { "ldaps", /* scheme */ oldap_setup_connection, /* setup_connection */ @@ -167,7 +165,7 @@ const struct Curl_handler Curl_handler_ldaps = { CURLPROTO_LDAPS, /* protocol */ CURLPROTO_LDAP, /* family */ PROTOPT_SSL | /* flags */ - PROTOPT_CONN_REUSE + PROTOPT_CONN_REUSE }; #endif @@ -281,7 +279,7 @@ static CURLcode oldap_url_parse(struct Curl_easy *data, LDAPURLDesc **ludp) result = rc == LDAP_URL_ERR_MEM ? CURLE_OUT_OF_MEMORY : CURLE_URL_MALFORMAT; rc -= LDAP_URL_SUCCESS; - if((size_t) rc < CURL_ARRAYSIZE(url_errs)) + if((size_t)rc < CURL_ARRAYSIZE(url_errs)) msg = url_errs[rc]; failf(data, "LDAP local: %s", msg); } @@ -507,8 +505,7 @@ static ber_slen_t ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len); static int ldapsb_tls_close(Sockbuf_IO_Desc *sbiod); -static Sockbuf_IO ldapsb_tls = -{ +static Sockbuf_IO ldapsb_tls = { ldapsb_tls_setup, ldapsb_tls_remove, ldapsb_tls_ctrl, @@ -658,7 +655,7 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done) ldap_set_option(li->ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF); { - ber_len_t max = 256*1024; + ber_len_t max = 256 * 1024; Sockbuf *sb; if((ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb) != LDAP_OPT_SUCCESS) || /* Set the maximum allowed size of an incoming message, which to @@ -730,7 +727,7 @@ static CURLcode oldap_state_mechs_resp(struct Curl_easy *data, if(bvals) { for(i = 0; bvals[i].bv_val; i++) { size_t llen; - unsigned short mech = Curl_sasl_decode_mech((char *) bvals[i].bv_val, + unsigned short mech = Curl_sasl_decode_mech((char *)bvals[i].bv_val, bvals[i].bv_len, &llen); if(bvals[i].bv_len == llen) li->sasl.authmechs |= mech; @@ -829,7 +826,7 @@ static CURLcode oldap_connecting(struct Curl_easy *data, bool *done) struct connectdata *conn = data->conn; struct ldapconninfo *li = Curl_conn_meta_get(conn, CURL_META_LDAP_CONN); LDAPMessage *msg = NULL; - struct timeval tv = {0, 0}; + struct timeval tv = { 0, 0 }; int code = LDAP_SUCCESS; int rc; @@ -1091,7 +1088,7 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, int rc; LDAPMessage *msg = NULL; BerElement *ber = NULL; - struct timeval tv = {0, 0}; + struct timeval tv = { 0, 0 }; struct berval bv, *bvals; CURLcode result = CURLE_AGAIN; int code; @@ -1246,30 +1243,26 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, } #ifdef USE_SSL -static int -ldapsb_tls_setup(Sockbuf_IO_Desc *sbiod, void *arg) +static int ldapsb_tls_setup(Sockbuf_IO_Desc *sbiod, void *arg) { sbiod->sbiod_pvt = arg; return 0; } -static int -ldapsb_tls_remove(Sockbuf_IO_Desc *sbiod) +static int ldapsb_tls_remove(Sockbuf_IO_Desc *sbiod) { sbiod->sbiod_pvt = NULL; return 0; } /* We do not need to do anything because libcurl does it already */ -static int -ldapsb_tls_close(Sockbuf_IO_Desc *sbiod) +static int ldapsb_tls_close(Sockbuf_IO_Desc *sbiod) { (void)sbiod; return 0; } -static int -ldapsb_tls_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg) +static int ldapsb_tls_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg) { (void)arg; if(opt == LBER_SB_OPT_DATA_READY) { @@ -1279,8 +1272,8 @@ ldapsb_tls_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg) return 0; } -static ber_slen_t -ldapsb_tls_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) +static ber_slen_t ldapsb_tls_read(Sockbuf_IO_Desc *sbiod, void *buf, + ber_len_t len) { struct Curl_easy *data = sbiod->sbiod_pvt; ber_slen_t ret = 0; @@ -1304,8 +1297,8 @@ ldapsb_tls_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) } return ret; } -static ber_slen_t -ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) +static ber_slen_t ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, + ber_len_t len) { struct Curl_easy *data = sbiod->sbiod_pvt; ber_slen_t ret = 0; diff --git a/lib/parsedate.c b/lib/parsedate.c index 2c3eb67fd2e6..0649de454b4c 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -107,17 +107,19 @@ static int parsedate(const char *date, time_t *output); #if !defined(CURL_DISABLE_PARSEDATE) || !defined(CURL_DISABLE_FTP) || \ !defined(CURL_DISABLE_FILE) || defined(USE_GNUTLS) /* These names are also used by FTP and FILE code */ -const char * const Curl_wkday[] = -{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; -const char * const Curl_month[]= -{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; +const char * const Curl_wkday[] = { + "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" +}; +const char * const Curl_month[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" +}; #endif #ifndef CURL_DISABLE_PARSEDATE -static const char * const weekday[] = -{ "Monday", "Tuesday", "Wednesday", "Thursday", - "Friday", "Saturday", "Sunday" }; +static const char * const weekday[] = { + "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +}; struct tzinfo { char name[5]; @@ -127,83 +129,83 @@ struct tzinfo { /* Here's a bunch of frequently used time zone names. These were supported by the old getdate parser. */ #define tDAYZONE -60 /* offset for daylight savings time */ -static const struct tzinfo tz[]= { - {"GMT", 0}, /* Greenwich Mean */ - {"UT", 0}, /* Universal Time */ - {"UTC", 0}, /* Universal (Coordinated) */ - {"WET", 0}, /* Western European */ - {"BST", 0 tDAYZONE}, /* British Summer */ - {"WAT", 60}, /* West Africa */ - {"AST", 240}, /* Atlantic Standard */ - {"ADT", 240 tDAYZONE}, /* Atlantic Daylight */ - {"EST", 300}, /* Eastern Standard */ - {"EDT", 300 tDAYZONE}, /* Eastern Daylight */ - {"CST", 360}, /* Central Standard */ - {"CDT", 360 tDAYZONE}, /* Central Daylight */ - {"MST", 420}, /* Mountain Standard */ - {"MDT", 420 tDAYZONE}, /* Mountain Daylight */ - {"PST", 480}, /* Pacific Standard */ - {"PDT", 480 tDAYZONE}, /* Pacific Daylight */ - {"YST", 540}, /* Yukon Standard */ - {"YDT", 540 tDAYZONE}, /* Yukon Daylight */ - {"HST", 600}, /* Hawaii Standard */ - {"HDT", 600 tDAYZONE}, /* Hawaii Daylight */ - {"CAT", 600}, /* Central Alaska */ - {"AHST", 600}, /* Alaska-Hawaii Standard */ - {"NT", 660}, /* Nome */ /* spellchecker:disable-line */ - {"IDLW", 720}, /* International Date Line West */ - {"CET", -60}, /* Central European */ - {"MET", -60}, /* Middle European */ - {"MEWT", -60}, /* Middle European Winter */ - {"MEST", -60 tDAYZONE}, /* Middle European Summer */ - {"CEST", -60 tDAYZONE}, /* Central European Summer */ - {"MESZ", -60 tDAYZONE}, /* Middle European Summer */ - {"FWT", -60}, /* French Winter */ - {"FST", -60 tDAYZONE}, /* French Summer */ - {"EET", -120}, /* Eastern Europe, USSR Zone 1 */ - {"WAST", -420}, /* spellchecker:disable-line */ - /* West Australian Standard */ - {"WADT", -420 tDAYZONE}, /* West Australian Daylight */ - {"CCT", -480}, /* China Coast, USSR Zone 7 */ - {"JST", -540}, /* Japan Standard, USSR Zone 8 */ - {"EAST", -600}, /* Eastern Australian Standard */ - {"EADT", -600 tDAYZONE}, /* Eastern Australian Daylight */ - {"GST", -600}, /* Guam Standard, USSR Zone 9 */ - {"NZT", -720}, /* New Zealand */ - {"NZST", -720}, /* New Zealand Standard */ - {"NZDT", -720 tDAYZONE}, /* New Zealand Daylight */ - {"IDLE", -720}, /* International Date Line East */ +static const struct tzinfo tz[] = { + { "GMT", 0 }, /* Greenwich Mean */ + { "UT", 0 }, /* Universal Time */ + { "UTC", 0 }, /* Universal (Coordinated) */ + { "WET", 0 }, /* Western European */ + { "BST", 0 tDAYZONE }, /* British Summer */ + { "WAT", 60 }, /* West Africa */ + { "AST", 240 }, /* Atlantic Standard */ + { "ADT", 240 tDAYZONE }, /* Atlantic Daylight */ + { "EST", 300 }, /* Eastern Standard */ + { "EDT", 300 tDAYZONE }, /* Eastern Daylight */ + { "CST", 360 }, /* Central Standard */ + { "CDT", 360 tDAYZONE }, /* Central Daylight */ + { "MST", 420 }, /* Mountain Standard */ + { "MDT", 420 tDAYZONE }, /* Mountain Daylight */ + { "PST", 480 }, /* Pacific Standard */ + { "PDT", 480 tDAYZONE }, /* Pacific Daylight */ + { "YST", 540 }, /* Yukon Standard */ + { "YDT", 540 tDAYZONE }, /* Yukon Daylight */ + { "HST", 600 }, /* Hawaii Standard */ + { "HDT", 600 tDAYZONE }, /* Hawaii Daylight */ + { "CAT", 600 }, /* Central Alaska */ + { "AHST", 600 }, /* Alaska-Hawaii Standard */ + { "NT", 660 }, /* Nome */ /* spellchecker:disable-line */ + { "IDLW", 720 }, /* International Date Line West */ + { "CET", -60 }, /* Central European */ + { "MET", -60 }, /* Middle European */ + { "MEWT", -60 }, /* Middle European Winter */ + { "MEST", -60 tDAYZONE }, /* Middle European Summer */ + { "CEST", -60 tDAYZONE }, /* Central European Summer */ + { "MESZ", -60 tDAYZONE }, /* Middle European Summer */ + { "FWT", -60 }, /* French Winter */ + { "FST", -60 tDAYZONE }, /* French Summer */ + { "EET", -120 }, /* Eastern Europe, USSR Zone 1 */ + { "WAST", -420 }, /* spellchecker:disable-line */ + /* West Australian Standard */ + { "WADT", -420 tDAYZONE }, /* West Australian Daylight */ + { "CCT", -480 }, /* China Coast, USSR Zone 7 */ + { "JST", -540 }, /* Japan Standard, USSR Zone 8 */ + { "EAST", -600 }, /* Eastern Australian Standard */ + { "EADT", -600 tDAYZONE }, /* Eastern Australian Daylight */ + { "GST", -600 }, /* Guam Standard, USSR Zone 9 */ + { "NZT", -720 }, /* New Zealand */ + { "NZST", -720 }, /* New Zealand Standard */ + { "NZDT", -720 tDAYZONE }, /* New Zealand Daylight */ + { "IDLE", -720 }, /* International Date Line East */ /* Next up: Military timezone names. RFC822 allowed these, but (as noted in RFC 1123) had their signs wrong. Here we use the correct signs to match actual military usage. */ - {"A", 1 * 60}, /* Alpha */ - {"B", 2 * 60}, /* Bravo */ - {"C", 3 * 60}, /* Charlie */ - {"D", 4 * 60}, /* Delta */ - {"E", 5 * 60}, /* Echo */ - {"F", 6 * 60}, /* Foxtrot */ - {"G", 7 * 60}, /* Golf */ - {"H", 8 * 60}, /* Hotel */ - {"I", 9 * 60}, /* India */ + { "A", 1 * 60 }, /* Alpha */ + { "B", 2 * 60 }, /* Bravo */ + { "C", 3 * 60 }, /* Charlie */ + { "D", 4 * 60 }, /* Delta */ + { "E", 5 * 60 }, /* Echo */ + { "F", 6 * 60 }, /* Foxtrot */ + { "G", 7 * 60 }, /* Golf */ + { "H", 8 * 60 }, /* Hotel */ + { "I", 9 * 60 }, /* India */ /* "J", Juliet is not used as a timezone, to indicate the observer's local time */ - {"K", 10 * 60}, /* Kilo */ - {"L", 11 * 60}, /* Lima */ - {"M", 12 * 60}, /* Mike */ - {"N", -1 * 60}, /* November */ - {"O", -2 * 60}, /* Oscar */ - {"P", -3 * 60}, /* Papa */ - {"Q", -4 * 60}, /* Quebec */ - {"R", -5 * 60}, /* Romeo */ - {"S", -6 * 60}, /* Sierra */ - {"T", -7 * 60}, /* Tango */ - {"U", -8 * 60}, /* Uniform */ - {"V", -9 * 60}, /* Victor */ - {"W", -10 * 60}, /* Whiskey */ - {"X", -11 * 60}, /* X-ray */ - {"Y", -12 * 60}, /* Yankee */ - {"Z", 0}, /* Zulu, zero meridian, a.k.a. UTC */ + { "K", 10 * 60 }, /* Kilo */ + { "L", 11 * 60 }, /* Lima */ + { "M", 12 * 60 }, /* Mike */ + { "N", -1 * 60 }, /* November */ + { "O", -2 * 60 }, /* Oscar */ + { "P", -3 * 60 }, /* Papa */ + { "Q", -4 * 60 }, /* Quebec */ + { "R", -5 * 60 }, /* Romeo */ + { "S", -6 * 60 }, /* Sierra */ + { "T", -7 * 60 }, /* Tango */ + { "U", -8 * 60 }, /* Uniform */ + { "V", -9 * 60 }, /* Victor */ + { "W", -10 * 60 }, /* Whiskey */ + { "X", -11 * 60 }, /* X-ray */ + { "Y", -12 * 60 }, /* Yankee */ + { "Z", 0 }, /* Zulu, zero meridian, a.k.a. UTC */ }; /* returns: @@ -260,7 +262,7 @@ static int checktz(const char *check, size_t len) size_t ilen = strlen(what->name); if((ilen == len) && curl_strnequal(check, what->name, len)) - return what->offset*60; + return what->offset * 60; what++; } return -1; @@ -286,12 +288,13 @@ enum assume { static time_t time2epoch(int sec, int min, int hour, int mday, int mon, int year) { - static const int month_days_cumulative[12] = - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; + static const int month_days_cumulative[12] = { + 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 + }; int leap_days = year - (mon <= 1); leap_days = ((leap_days / 4) - (leap_days / 100) + (leap_days / 400) - (1969 / 4) + (1969 / 100) - (1969 / 400)); - return ((((time_t) (year - 1970) * 365 + return ((((time_t)(year - 1970) * 365 + leap_days + month_days_cumulative[mon] + mday - 1) * 24 + hour) * 60 + min) * 60 + sec; } @@ -304,13 +307,12 @@ static int oneortwodigit(const char *date, const char **endp) int num = date[0] - '0'; if(ISDIGIT(date[1])) { *endp = &date[2]; - return num*10 + (date[1] - '0'); + return num * 10 + (date[1] - '0'); } *endp = &date[1]; return num; } - /* HH:MM:SS or HH:MM and accept single-digits too */ static bool match_time(const char *date, int *h, int *m, int *s, char **endp) @@ -444,11 +446,11 @@ static int parsedate(const char *date, time_t *output) anyone has a more authoritative source for the exact maximum time zone offsets, please speak up! */ found = TRUE; - tzoff = (val/100 * 60 + val%100)*60; + tzoff = (val / 100 * 60 + val % 100) * 60; /* the + and - prefix indicates the local time compared to GMT, this we need their reversed math to get what we want */ - tzoff = date[-1]=='+' ? -tzoff : tzoff; + tzoff = date[-1] == '+' ? -tzoff : tzoff; } else if((num_digits == 8) && @@ -457,9 +459,9 @@ static int parsedate(const char *date, time_t *output) (mdaynum == -1)) { /* 8 digits, no year, month or day yet. This is YYYYMMDD */ found = TRUE; - yearnum = val/10000; - monnum = (val%10000)/100-1; /* month is 0 - 11 */ - mdaynum = val%100; + yearnum = val / 10000; + monnum = (val % 10000) / 100 - 1; /* month is 0 - 11 */ + mdaynum = val % 100; } if(!found && (dignext == DATE_MDAY) && (mdaynum == -1)) { diff --git a/lib/pingpong.c b/lib/pingpong.c index 7ac321af7244..36acc34a3668 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -214,7 +214,6 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data, return CURLE_OK; } - /*********************************************************************** * * Curl_pp_sendf() diff --git a/lib/pingpong.h b/lib/pingpong.h index bd723b1c9bf4..5492453d8459 100644 --- a/lib/pingpong.h +++ b/lib/pingpong.h @@ -71,10 +71,10 @@ struct pingpong { read */ }; -#define PINGPONG_SETUP(pp,s,e) \ - do { \ - (pp)->statemachine = s; \ - (pp)->endofresp = e; \ +#define PINGPONG_SETUP(pp, s, e) \ + do { \ + (pp)->statemachine = s; \ + (pp)->endofresp = e; \ } while(0) /* @@ -94,7 +94,6 @@ void Curl_pp_init(struct pingpong *pp); timediff_t Curl_pp_state_timeout(struct Curl_easy *data, struct pingpong *pp, bool disconnecting); - /*********************************************************************** * * Curl_pp_sendf() @@ -148,7 +147,6 @@ CURLcode Curl_pp_pollset(struct Curl_easy *data, struct pingpong *pp, struct easy_pollset *ps); - /*********************************************************************** * * Curl_pp_moredata() diff --git a/lib/pop3.c b/lib/pop3.c index f10108229b6a..771069b3d434 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -84,11 +84,11 @@ #define POP3_TYPE_SASL (1 << 2) /* Authentication type values */ -#define POP3_TYPE_NONE 0 -#define POP3_TYPE_ANY (POP3_TYPE_CLEARTEXT|POP3_TYPE_APOP|POP3_TYPE_SASL) +#define POP3_TYPE_NONE 0 +#define POP3_TYPE_ANY (POP3_TYPE_CLEARTEXT | POP3_TYPE_APOP | POP3_TYPE_SASL) /* This is the 5-bytes End-Of-Body marker for POP3 */ -#define POP3_EOB "\x0d\x0a\x2e\x0d\x0a" +#define POP3_EOB "\x0d\x0a\x2e\x0d\x0a" #define POP3_EOB_LEN 5 /* meta key for storing protocol meta at easy handle */ @@ -196,8 +196,7 @@ const struct Curl_handler Curl_handler_pop3 = { CURLPROTO_POP3, /* protocol */ CURLPROTO_POP3, /* family */ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY | /* flags */ - PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | - PROTOPT_CONN_REUSE + PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | PROTOPT_CONN_REUSE }; #ifdef USE_SSL @@ -228,8 +227,7 @@ const struct Curl_handler Curl_handler_pop3s = { CURLPROTO_POP3S, /* protocol */ CURLPROTO_POP3, /* family */ PROTOPT_CLOSEACTION | PROTOPT_SSL | /* flags */ - PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS | - PROTOPT_CONN_REUSE + PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS | PROTOPT_CONN_REUSE }; #endif @@ -512,7 +510,7 @@ static CURLcode pop3_perform_upgrade_tls(struct Curl_easy *data, result, ssldone)); if(!result && ssldone) { pop3c->ssldone = ssldone; - /* perform CAPA now, changes pop3c->state out of POP3_UPGRADETLS */ + /* perform CAPA now, changes pop3c->state out of POP3_UPGRADETLS */ result = pop3_perform_capa(data, conn); } out: @@ -589,10 +587,10 @@ static CURLcode pop3_perform_apop(struct Curl_easy *data, if(!ctxt) return CURLE_OUT_OF_MEMORY; - Curl_MD5_update(ctxt, (const unsigned char *) pop3c->apoptimestamp, + Curl_MD5_update(ctxt, (const unsigned char *)pop3c->apoptimestamp, curlx_uztoui(strlen(pop3c->apoptimestamp))); - Curl_MD5_update(ctxt, (const unsigned char *) conn->passwd, + Curl_MD5_update(ctxt, (const unsigned char *)conn->passwd, curlx_uztoui(strlen(conn->passwd))); /* Finalise the digest */ @@ -625,7 +623,7 @@ static CURLcode pop3_perform_auth(struct Curl_easy *data, struct pop3_conn *pop3c = Curl_conn_meta_get(data->conn, CURL_META_POP3_CONN); CURLcode result = CURLE_OK; - const char *ir = (const char *) Curl_bufref_ptr(initresp); + const char *ir = (const char *)Curl_bufref_ptr(initresp); if(!pop3c) return CURLE_FAILED_INIT; diff --git a/lib/progress.c b/lib/progress.c index 7124a307d1f5..1ae8b5801d01 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -87,7 +87,7 @@ static char *max6data(curl_off_t bytes, char *max6) /* xxx.yU */ curl_msnprintf(max6, 7, "%3" CURL_FORMAT_CURL_OFF_T ".%" CURL_FORMAT_CURL_OFF_T "%c", nbytes, - (bytes%1024) / (1024/10), unit[k]); + (bytes % 1024) / (1024 / 10), unit[k]); } return max6; } @@ -351,7 +351,7 @@ void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size) void Curl_pgrsEarlyData(struct Curl_easy *data, curl_off_t sent) { - data->progress.earlydata_sent = sent; + data->progress.earlydata_sent = sent; } /* returns the average speed in bytes / second */ @@ -360,7 +360,7 @@ static curl_off_t trspeed(curl_off_t size, /* number of bytes */ { if(us < 1) return size * 1000000; - else if(size < CURL_OFF_T_MAX/1000000) + else if(size < CURL_OFF_T_MAX / 1000000) return (size * 1000000) / us; else if(us >= 1000000) return size / (us / 1000000); @@ -422,18 +422,18 @@ static bool progress_calc(struct Curl_easy *data, struct curltime *pnow) ((i_latest + 1) % CURL_SPEED_RECORDS); /* How much we transferred between oldest and current records */ - amount = p->speed_amount[i_latest]- p->speed_amount[i_oldest]; + amount = p->speed_amount[i_latest] - p->speed_amount[i_oldest]; /* How long this took */ duration_ms = curlx_timediff_ms(p->speed_time[i_latest], p->speed_time[i_oldest]); if(duration_ms <= 0) duration_ms = 1; - if(amount > (CURL_OFF_T_MAX/1000)) { + if(amount > (CURL_OFF_T_MAX / 1000)) { /* the 'amount' value is bigger than would fit in 64 bits if multiplied with 1000, so we use the double math for this */ - p->current_speed = (curl_off_t) - (((double)amount * 1000.0)/(double)duration_ms); + p->current_speed = + (curl_off_t)(((double)amount * 1000.0) / (double)duration_ms); } else { /* the 'amount' value is small enough to fit within 32 bits even @@ -459,7 +459,7 @@ static curl_off_t pgrs_est_percent(curl_off_t total, curl_off_t cur) if(total > 10000) return cur / (total / 100); else if(total > 0) - return (cur*100) / total; + return (cur * 100) / total; return 0; } @@ -488,7 +488,7 @@ static void progress_meter(struct Curl_easy *data) char time_left[10]; char time_total[10]; char time_spent[10]; - curl_off_t cur_secs = (curl_off_t)p->timespent/1000000; /* seconds */ + curl_off_t cur_secs = (curl_off_t)p->timespent / 1000000; /* seconds */ if(!p->headers_out) { if(data->state.resume_from) { @@ -516,11 +516,9 @@ static void progress_meter(struct Curl_easy *data) time2str(time_spent, cur_secs); /* Get the total amount of data expected to get transferred */ - total_expected_size = - p->ul_size_known ? p->ul.total_size : p->ul.cur_size; + total_expected_size = p->ul_size_known ? p->ul.total_size : p->ul.cur_size; - dl_size = - p->dl_size_known ? p->dl.total_size : p->dl.cur_size; + dl_size = p->dl_size_known ? p->dl.total_size : p->dl.cur_size; /* integer overflow check */ if((CURL_OFF_T_MAX - total_expected_size) < dl_size) @@ -561,7 +559,6 @@ static void progress_meter(struct Curl_easy *data) #define progress_meter(x) Curl_nop_stmt #endif - /* * Curl_pgrsUpdate() returns 0 for success or the value returned by the * progress callback! diff --git a/lib/psl.c b/lib/psl.c index 5bf96d09bd88..0be51e44020a 100644 --- a/lib/psl.c +++ b/lib/psl.c @@ -91,7 +91,7 @@ const psl_ctx_t *Curl_psl_use(struct Curl_easy *easy) pslcache->expires = expires; } } - Curl_share_unlock(easy, CURL_LOCK_DATA_PSL); /* Release exclusive lock. */ + Curl_share_unlock(easy, CURL_LOCK_DATA_PSL); /* Release exclusive lock. */ Curl_share_lock(easy, CURL_LOCK_DATA_PSL, CURL_LOCK_ACCESS_SHARED); } psl = pslcache->psl; diff --git a/lib/rand.c b/lib/rand.c index 8c5a2cf71e44..88324e918ae9 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -227,8 +227,7 @@ CURLcode Curl_rand_bytes(struct Curl_easy *data, * size. */ -CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, - size_t num) +CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, size_t num) { CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT; unsigned char buffer[128]; @@ -240,7 +239,7 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, memset(buffer, 0, sizeof(buffer)); #endif - if((num/2 >= sizeof(buffer)) || !(num&1)) { + if((num / 2 >= sizeof(buffer)) || !(num & 1)) { /* make sure it fits in the local buffer and that it is an odd number! */ DEBUGF(infof(data, "invalid buffer size with Curl_rand_hex")); return CURLE_BAD_FUNCTION_ARGUMENT; @@ -248,11 +247,11 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, num--; /* save one for null-termination */ - result = Curl_rand(data, buffer, num/2); + result = Curl_rand(data, buffer, num / 2); if(result) return result; - Curl_hexencode(buffer, num/2, rnd, num + 1); + Curl_hexencode(buffer, num / 2, rnd, num + 1); return result; } diff --git a/lib/rand.h b/lib/rand.h index 2ba60e72976e..674cb6ee2025 100644 --- a/lib/rand.h +++ b/lib/rand.h @@ -31,9 +31,9 @@ CURLcode Curl_rand_bytes(struct Curl_easy *data, unsigned char *rnd, size_t num); #ifdef DEBUGBUILD -#define Curl_rand(a,b,c) Curl_rand_bytes((a), TRUE, (b), (c)) +#define Curl_rand(a, b, c) Curl_rand_bytes((a), TRUE, (b), (c)) #else -#define Curl_rand(a,b,c) Curl_rand_bytes((a), (b), (c)) +#define Curl_rand(a, b, c) Curl_rand_bytes((a), (b), (c)) #endif /* @@ -41,8 +41,7 @@ CURLcode Curl_rand_bytes(struct Curl_easy *data, * hexadecimal digits PLUS a null-terminating byte. It must be an odd number * size. */ -CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, - size_t num); +CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, size_t num); /* * Curl_rand_alnum() fills the 'rnd' buffer with a given 'num' size with random diff --git a/lib/ratelimit.c b/lib/ratelimit.c index c3593d593756..7e3592506aa8 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -28,7 +28,7 @@ #include "ratelimit.h" -#define CURL_US_PER_SEC 1000000 +#define CURL_US_PER_SEC 1000000 #define CURL_RLIMIT_MIN_CHUNK (16 * 1024) #define CURL_RLIMIT_MAX_STEPS 2 /* 500ms interval */ diff --git a/lib/request.c b/lib/request.c index 581d7d14537a..fa83380878ad 100644 --- a/lib/request.c +++ b/lib/request.c @@ -111,7 +111,7 @@ CURLcode Curl_req_done(struct SingleRequest *req, void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data) { - struct curltime t0 = {0, 0}; + struct curltime t0 = { 0, 0 }; Curl_safefree(req->newurl); Curl_client_reset(data); @@ -473,6 +473,6 @@ CURLcode Curl_req_stop_send_recv(struct Curl_easy *data) CURLcode result = CURLE_OK; if(data->req.keepon & KEEP_SEND) result = Curl_req_abort_sending(data); - data->req.keepon &= ~(KEEP_RECV|KEEP_SEND); + data->req.keepon &= ~(KEEP_RECV | KEEP_SEND); return result; } diff --git a/lib/request.h b/lib/request.h index 0f9e0a6ff4fc..5b0d1460283b 100644 --- a/lib/request.h +++ b/lib/request.h @@ -48,7 +48,6 @@ enum upgrade101 { UPGR101_RECEIVED /* 101 response received */ }; - /* * Request specific data in the easy handle (Curl_easy). Previously, * these members were on the connectdata struct but since a conn struct may diff --git a/lib/rtsp.c b/lib/rtsp.c index 5a46dc62c407..ee5d822a5404 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -117,11 +117,10 @@ static CURLcode rtsp_do_pollset(struct Curl_easy *data, return Curl_pollset_add_out(data, ps, data->conn->sock[FIRSTSOCKET]); } -static -CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, size_t len); -static -CURLcode rtsp_parse_transport(struct Curl_easy *data, const char *transport); - +static CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, + size_t len); +static CURLcode rtsp_parse_transport(struct Curl_easy *data, + const char *transport); /* * RTSP handler interface. @@ -191,7 +190,6 @@ static CURLcode rtsp_setup_connection(struct Curl_easy *data, return CURLE_OK; } - /* * Function to check on various aspects of a connection. */ @@ -211,7 +209,6 @@ static unsigned int rtsp_conncheck(struct Curl_easy *data, return ret_val; } - static CURLcode rtsp_connect(struct Curl_easy *data, bool *done) { struct rtsp_conn *rtspc = @@ -274,7 +271,6 @@ static CURLcode rtsp_done(struct Curl_easy *data, return httpStatus; } - static CURLcode rtsp_setup_body(struct Curl_easy *data, Curl_RtspReq rtspreq, struct dynbuf *reqp) @@ -324,9 +320,8 @@ static CURLcode rtsp_setup_body(struct Curl_easy *data, if(rtspreq == RTSPREQ_SET_PARAMETER || rtspreq == RTSPREQ_GET_PARAMETER) { if(!Curl_checkheaders(data, STRCONST("Content-Type"))) { - result = curlx_dyn_addn(reqp, - STRCONST("Content-Type: " - "text/parameters\r\n")); + result = curlx_dyn_addn(reqp, STRCONST("Content-Type: " + "text/parameters\r\n")); if(result) return result; } @@ -334,9 +329,8 @@ static CURLcode rtsp_setup_body(struct Curl_easy *data, if(rtspreq == RTSPREQ_ANNOUNCE) { if(!Curl_checkheaders(data, STRCONST("Content-Type"))) { - result = curlx_dyn_addn(reqp, - STRCONST("Content-Type: " - "application/sdp\r\n")); + result = curlx_dyn_addn(reqp, STRCONST("Content-Type: " + "application/sdp\r\n")); if(result) return result; } @@ -931,7 +925,7 @@ static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, blen, rtspc->in_header, data->req.done, rtspc->state, data->req.size)); if(!result && (is_eos || blen)) { - result = Curl_client_write(data, CLIENTWRITE_BODY| + result = Curl_client_write(data, CLIENTWRITE_BODY | (is_eos ? CLIENTWRITE_EOS : 0), buf, blen); } @@ -954,8 +948,8 @@ static CURLcode rtsp_rtp_write_resp_hd(struct Curl_easy *data, return rtsp_rtp_write_resp(data, buf, blen, is_eos); } -static -CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, size_t len) +static CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, + size_t len) { size_t wrote; curl_write_callback writeit; @@ -1066,8 +1060,8 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header) return CURLE_OK; } -static -CURLcode rtsp_parse_transport(struct Curl_easy *data, const char *transport) +static CURLcode rtsp_parse_transport(struct Curl_easy *data, + const char *transport) { /* If we receive multiple Transport response-headers, the linterleaved channels of each response header is recorded and used together for @@ -1109,5 +1103,4 @@ CURLcode rtsp_parse_transport(struct Curl_easy *data, const char *transport) return CURLE_OK; } - #endif /* CURL_DISABLE_RTSP */ diff --git a/lib/rtsp.h b/lib/rtsp.h index 59f20a9f1672..7b42efde2860 100644 --- a/lib/rtsp.h +++ b/lib/rtsp.h @@ -32,7 +32,7 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header); #else /* disabled */ -#define Curl_rtsp_parseheader(x,y) CURLE_NOT_BUILT_IN +#define Curl_rtsp_parseheader(x, y) CURLE_NOT_BUILT_IN #endif /* CURL_DISABLE_RTSP */ diff --git a/lib/select.c b/lib/select.c index 5692fc020d1f..52dfa7376d0a 100644 --- a/lib/select.c +++ b/lib/select.c @@ -146,19 +146,19 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ num = 0; if(readfd0 != CURL_SOCKET_BAD) { pfd[num].fd = readfd0; - pfd[num].events = POLLRDNORM|POLLIN|POLLRDBAND|POLLPRI; + pfd[num].events = POLLRDNORM | POLLIN | POLLRDBAND | POLLPRI; pfd[num].revents = 0; num++; } if(readfd1 != CURL_SOCKET_BAD) { pfd[num].fd = readfd1; - pfd[num].events = POLLRDNORM|POLLIN|POLLRDBAND|POLLPRI; + pfd[num].events = POLLRDNORM | POLLIN | POLLRDBAND | POLLPRI; pfd[num].revents = 0; num++; } if(writefd != CURL_SOCKET_BAD) { pfd[num].fd = writefd; - pfd[num].events = POLLWRNORM|POLLOUT|POLLPRI; + pfd[num].events = POLLWRNORM | POLLOUT | POLLPRI; pfd[num].revents = 0; num++; } @@ -170,23 +170,23 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ r = 0; num = 0; if(readfd0 != CURL_SOCKET_BAD) { - if(pfd[num].revents & (POLLRDNORM|POLLIN|POLLERR|POLLHUP)) + if(pfd[num].revents & (POLLRDNORM | POLLIN | POLLERR | POLLHUP)) r |= CURL_CSELECT_IN; - if(pfd[num].revents & (POLLPRI|POLLNVAL)) + if(pfd[num].revents & (POLLPRI | POLLNVAL)) r |= CURL_CSELECT_ERR; num++; } if(readfd1 != CURL_SOCKET_BAD) { - if(pfd[num].revents & (POLLRDNORM|POLLIN|POLLERR|POLLHUP)) + if(pfd[num].revents & (POLLRDNORM | POLLIN | POLLERR | POLLHUP)) r |= CURL_CSELECT_IN2; - if(pfd[num].revents & (POLLPRI|POLLNVAL)) + if(pfd[num].revents & (POLLPRI | POLLNVAL)) r |= CURL_CSELECT_ERR; num++; } if(writefd != CURL_SOCKET_BAD) { - if(pfd[num].revents & (POLLWRNORM|POLLOUT)) + if(pfd[num].revents & (POLLWRNORM | POLLOUT)) r |= CURL_CSELECT_OUT; - if(pfd[num].revents & (POLLERR|POLLHUP|POLLPRI|POLLNVAL)) + if(pfd[num].revents & (POLLERR | POLLHUP | POLLPRI | POLLNVAL)) r |= CURL_CSELECT_ERR; } @@ -265,7 +265,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) if(ufds[i].revents & POLLHUP) ufds[i].revents |= POLLIN; if(ufds[i].revents & POLLERR) - ufds[i].revents |= POLLIN|POLLOUT; + ufds[i].revents |= POLLIN | POLLOUT; } #else /* HAVE_POLL */ @@ -280,15 +280,15 @@ 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| - POLLRDNORM|POLLWRNORM|POLLRDBAND)) { + if(ufds[i].events & (POLLIN |POLLOUT |POLLPRI | + POLLRDNORM | POLLWRNORM | POLLRDBAND)) { if(ufds[i].fd > maxfd) maxfd = ufds[i].fd; - if(ufds[i].events & (POLLRDNORM|POLLIN)) + if(ufds[i].events & (POLLRDNORM | POLLIN)) FD_SET(ufds[i].fd, &fds_read); - if(ufds[i].events & (POLLWRNORM|POLLOUT)) + if(ufds[i].events & (POLLWRNORM | POLLOUT)) FD_SET(ufds[i].fd, &fds_write); - if(ufds[i].events & (POLLRDBAND|POLLPRI)) + if(ufds[i].events & (POLLRDBAND | POLLPRI)) FD_SET(ufds[i].fd, &fds_err); } } @@ -579,9 +579,9 @@ CURLcode Curl_pollset_change(struct Curl_easy *data, if(!VALID_SOCK(sock)) return CURLE_BAD_FUNCTION_ARGUMENT; - DEBUGASSERT(add_flags <= (CURL_POLL_IN|CURL_POLL_OUT)); - DEBUGASSERT(remove_flags <= (CURL_POLL_IN|CURL_POLL_OUT)); - DEBUGASSERT((add_flags&remove_flags) == 0); /* no overlap */ + DEBUGASSERT(add_flags <= (CURL_POLL_IN | CURL_POLL_OUT)); + DEBUGASSERT(remove_flags <= (CURL_POLL_IN | CURL_POLL_OUT)); + DEBUGASSERT((add_flags & remove_flags) == 0); /* no overlap */ for(i = 0; i < ps->n; ++i) { if(ps->sockets[i] == sock) { ps->actions[i] &= (unsigned char)(~remove_flags); diff --git a/lib/select.h b/lib/select.h index fb54686af3e2..c5f1c59be02f 100644 --- a/lib/select.h +++ b/lib/select.h @@ -47,11 +47,10 @@ #define POLLHUP 0x10 #define POLLNVAL 0x20 -struct pollfd -{ - curl_socket_t fd; - short events; - short revents; +struct pollfd { + curl_socket_t fd; + short events; + short revents; }; #endif @@ -76,9 +75,9 @@ struct pollfd int Curl_socket_check(curl_socket_t readfd, curl_socket_t readfd2, curl_socket_t writefd, timediff_t timeout_ms); -#define SOCKET_READABLE(x,z) \ +#define SOCKET_READABLE(x, z) \ Curl_socket_check(x, CURL_SOCKET_BAD, CURL_SOCKET_BAD, z) -#define SOCKET_WRITABLE(x,z) \ +#define SOCKET_WRITABLE(x, z) \ Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, x, z) int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms); @@ -90,32 +89,33 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms); #ifdef USE_WINSOCK #define VALID_SOCK(s) ((s) < INVALID_SOCKET) #define FDSET_SOCK(x) 1 -#define VERIFY_SOCK(x) do { \ - if(!VALID_SOCK(x)) { \ - SET_SOCKERRNO(SOCKEINVAL); \ - return -1; \ - } \ -} while(0) +#define VERIFY_SOCK(x) \ + do { \ + if(!VALID_SOCK(x)) { \ + SET_SOCKERRNO(SOCKEINVAL); \ + return -1; \ + } \ + } while(0) #else #define VALID_SOCK(s) ((s) >= 0) /* If the socket is small enough to get set or read from an fdset */ #define FDSET_SOCK(s) ((s) < FD_SETSIZE) -#define VERIFY_SOCK(x) do { \ - if(!VALID_SOCK(x) || !FDSET_SOCK(x)) { \ - SET_SOCKERRNO(SOCKEINVAL); \ - return -1; \ - } \ +#define VERIFY_SOCK(x) \ + do { \ + if(!VALID_SOCK(x) || !FDSET_SOCK(x)) { \ + SET_SOCKERRNO(SOCKEINVAL); \ + return -1; \ + } \ } while(0) #endif - /* Keep the sockets to poll for an easy handle. * `actions` are bitmaps of CURL_POLL_IN and CURL_POLL_OUT. * Starts with small capacity, grows on demand. */ -#define EZ_POLLSET_DEF_COUNT 2 +#define EZ_POLLSET_DEF_COUNT 2 struct easy_pollset { curl_socket_t *sockets; @@ -133,7 +133,6 @@ struct easy_pollset { #define CURL_EASY_POLLSET_MAGIC 0x7a657370 #endif - /* allocate and initialise */ struct easy_pollset *Curl_pollset_create(void); @@ -162,22 +161,22 @@ CURLcode Curl_pollset_set(struct Curl_easy *data, bool do_in, bool do_out) WARN_UNUSED_RESULT; #define Curl_pollset_add_in(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0) + Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0) #define Curl_pollset_remove_in(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), 0, CURL_POLL_IN) + Curl_pollset_change((data), (ps), (sock), 0, CURL_POLL_IN) #define Curl_pollset_add_out(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), CURL_POLL_OUT, 0) + Curl_pollset_change((data), (ps), (sock), CURL_POLL_OUT, 0) #define Curl_pollset_remove_out(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), 0, CURL_POLL_OUT) + Curl_pollset_change((data), (ps), (sock), 0, CURL_POLL_OUT) #define Curl_pollset_add_inout(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), \ - CURL_POLL_IN|CURL_POLL_OUT, 0) + Curl_pollset_change((data), (ps), (sock), \ + CURL_POLL_IN | CURL_POLL_OUT, 0) #define Curl_pollset_set_in_only(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), \ - CURL_POLL_IN, CURL_POLL_OUT) + Curl_pollset_change((data), (ps), (sock), \ + CURL_POLL_IN, CURL_POLL_OUT) #define Curl_pollset_set_out_only(data, ps, sock) \ - Curl_pollset_change((data), (ps), (sock), \ - CURL_POLL_OUT, CURL_POLL_IN) + Curl_pollset_change((data), (ps), (sock), \ + CURL_POLL_OUT, CURL_POLL_IN) /* return < = on error, 0 on timeout or how many sockets are ready */ int Curl_pollset_poll(struct Curl_easy *data, diff --git a/lib/sendf.c b/lib/sendf.c index 1d73291c92d2..f4a816e23173 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -69,13 +69,14 @@ CURLcode Curl_client_write(struct Curl_easy *data, CURLcode result; /* it is one of those, at least */ - DEBUGASSERT(type & (CLIENTWRITE_BODY|CLIENTWRITE_HEADER|CLIENTWRITE_INFO)); + DEBUGASSERT(type & + (CLIENTWRITE_BODY | CLIENTWRITE_HEADER | CLIENTWRITE_INFO)); /* BODY is only BODY (with optional EOS) */ DEBUGASSERT(!(type & CLIENTWRITE_BODY) || - ((type & ~(CLIENTWRITE_BODY|CLIENTWRITE_EOS)) == 0)); + ((type & ~(CLIENTWRITE_BODY | CLIENTWRITE_EOS)) == 0)); /* INFO is only INFO (with optional EOS) */ DEBUGASSERT(!(type & CLIENTWRITE_INFO) || - ((type & ~(CLIENTWRITE_INFO|CLIENTWRITE_EOS)) == 0)); + ((type & ~(CLIENTWRITE_INFO | CLIENTWRITE_EOS)) == 0)); if(!data->req.writer_stack) { result = do_init_writer_stack(data); @@ -227,7 +228,7 @@ static CURLcode cw_download_write(struct Curl_easy *data, bool is_connect = !!(type & CLIENTWRITE_CONNECT); if(!ctx->started_response && - !(type & (CLIENTWRITE_INFO|CLIENTWRITE_CONNECT))) { + !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) { Curl_pgrsTime(data, TIMER_STARTTRANSFER); Curl_rlimit_start(&data->progress.dl.rlimit, curlx_now()); ctx->started_response = TRUE; @@ -784,7 +785,7 @@ static CURLcode cr_in_resume_from(struct Curl_easy *data, } /* when seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { - char scratch[4*1024]; + char scratch[4 * 1024]; size_t readthisamountnow = (offset - passed > (curl_off_t)sizeof(scratch)) ? sizeof(scratch) : @@ -1089,8 +1090,7 @@ static CURLcode cr_lc_add(struct Curl_easy *data) struct Curl_creader *reader = NULL; CURLcode result; - result = Curl_creader_create(&reader, data, &cr_lc, - CURL_CR_CONTENT_ENCODE); + result = Curl_creader_create(&reader, data, &cr_lc, CURL_CR_CONTENT_ENCODE); if(!result) result = Curl_creader_add(data, reader); @@ -1481,5 +1481,4 @@ struct Curl_creader *Curl_creader_get_by_type(struct Curl_easy *data, return r; } return NULL; - } diff --git a/lib/sendf.h b/lib/sendf.h index 3a6dccba6a3d..7b983c5271b2 100644 --- a/lib/sendf.h +++ b/lib/sendf.h @@ -42,15 +42,15 @@ * BODY, INFO and HEADER should not be mixed, as this would lead to * confusion on how to interpret/format/convert the data. */ -#define CLIENTWRITE_BODY (1<<0) /* non-meta information, BODY */ -#define CLIENTWRITE_INFO (1<<1) /* meta information, not a HEADER */ -#define CLIENTWRITE_HEADER (1<<2) /* meta information, HEADER */ -#define CLIENTWRITE_STATUS (1<<3) /* a special status HEADER */ -#define CLIENTWRITE_CONNECT (1<<4) /* a CONNECT related HEADER */ -#define CLIENTWRITE_1XX (1<<5) /* a 1xx response related HEADER */ -#define CLIENTWRITE_TRAILER (1<<6) /* a trailer HEADER */ -#define CLIENTWRITE_EOS (1<<7) /* End Of transfer download Stream */ -#define CLIENTWRITE_0LEN (1<<8) /* write even 0-length buffers */ +#define CLIENTWRITE_BODY (1 << 0) /* non-meta information, BODY */ +#define CLIENTWRITE_INFO (1 << 1) /* meta information, not a HEADER */ +#define CLIENTWRITE_HEADER (1 << 2) /* meta information, HEADER */ +#define CLIENTWRITE_STATUS (1 << 3) /* a special status HEADER */ +#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */ +#define CLIENTWRITE_1XX (1 << 5) /* a 1xx response related HEADER */ +#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */ +#define CLIENTWRITE_EOS (1 << 7) /* End Of transfer download Stream */ +#define CLIENTWRITE_0LEN (1 << 8) /* write even 0-length buffers */ /* Forward declarations */ struct Curl_creader; @@ -206,7 +206,6 @@ CURLcode Curl_cwriter_def_write(struct Curl_easy *data, void Curl_cwriter_def_close(struct Curl_easy *data, struct Curl_cwriter *writer); - typedef enum { CURL_CRCNTRL_REWIND, CURL_CRCNTRL_UNPAUSE, @@ -407,7 +406,6 @@ void Curl_creader_done(struct Curl_easy *data, int premature); struct Curl_creader *Curl_creader_get_by_type(struct Curl_easy *data, const struct Curl_crtype *crt); - /** * Set the client reader to provide 0 bytes, immediate EOS. */ diff --git a/lib/setopt.c b/lib/setopt.c index b4ca361ce35f..0a377be1f165 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -59,8 +59,8 @@ static CURLcode setopt_set_timeout_sec(timediff_t *ptimeout_ms, long secs) { if(secs < 0) return CURLE_BAD_FUNCTION_ARGUMENT; -#if LONG_MAX > (TIMEDIFF_T_MAX/1000) - if(secs > (TIMEDIFF_T_MAX/1000)) { +#if LONG_MAX > (TIMEDIFF_T_MAX / 1000) + if(secs > (TIMEDIFF_T_MAX / 1000)) { *ptimeout_ms = TIMEDIFF_T_MAX; return CURLE_OK; } @@ -193,7 +193,7 @@ static CURLcode setstropt_interface(char *option, char **devp, return CURLE_OK; } -#define C_SSLVERSION_VALUE(x) (x & 0xffff) +#define C_SSLVERSION_VALUE(x) (x & 0xffff) #define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)x & 0xffff0000) static CURLcode protocol2num(const char *str, curl_prot_t *val) @@ -208,7 +208,7 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val) return CURLE_BAD_FUNCTION_ARGUMENT; if(curl_strequal(str, "all")) { - *val = ~(curl_prot_t) 0; + *val = ~(curl_prot_t)0; return CURLE_OK; } @@ -217,7 +217,7 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val) size_t tlen; str = strchr(str, ','); - tlen = str ? (size_t) (str - token) : strlen(token); + tlen = str ? (size_t)(str - token) : strlen(token); if(tlen) { const struct Curl_handler *h = Curl_getn_scheme_handler(token, tlen); @@ -256,7 +256,7 @@ static CURLcode httpauth(struct Curl_easy *data, bool proxy, /* switch off bits we cannot support */ #ifndef USE_NTLM - auth &= ~CURLAUTH_NTLM; /* no NTLM support */ + auth &= ~CURLAUTH_NTLM; /* no NTLM support */ #endif #ifndef USE_SPNEGO auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without GSS-API @@ -787,8 +787,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, case CURLOPT_SSL_SESSIONID_CACHE: s->ssl.primary.cache_session = enabled; #ifndef CURL_DISABLE_PROXY - s->proxy_ssl.primary.cache_session = - s->ssl.primary.cache_session; + s->proxy_ssl.primary.cache_session = s->ssl.primary.cache_session; #endif break; #ifdef USE_SSH @@ -810,7 +809,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, s->tcp_keepalive = enabled; break; case CURLOPT_TCP_FASTOPEN: -#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \ +#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \ defined(TCP_FASTOPEN_CONNECT) s->tcp_fastopen = enabled; break; @@ -1099,7 +1098,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, #ifdef HAVE_GSSAPI case CURLOPT_GSSAPI_DELEGATION: s->gssapi_delegation = (unsigned char)uarg & - (CURLGSSAPI_DELEGATION_POLICY_FLAG|CURLGSSAPI_DELEGATION_FLAG); + (CURLGSSAPI_DELEGATION_POLICY_FLAG | CURLGSSAPI_DELEGATION_FLAG); break; #endif @@ -1145,7 +1144,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, case CURLOPT_IPRESOLVE: if((arg < CURL_IPRESOLVE_WHATEVER) || (arg > CURL_IPRESOLVE_V6)) return CURLE_BAD_FUNCTION_ARGUMENT; - s->ipver = (unsigned char) arg; + s->ipver = (unsigned char)arg; break; case CURLOPT_CONNECT_ONLY: @@ -1413,8 +1412,8 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, break; #endif /* ! CURL_DISABLE_FORM_API */ #endif /* ! CURL_DISABLE_HTTP */ -#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ - !defined(CURL_DISABLE_IMAP) +#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ + !defined(CURL_DISABLE_IMAP) # ifndef CURL_DISABLE_MIME case CURLOPT_MIMEPOST: /* @@ -1444,8 +1443,7 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, if(!s->err) s->err = stderr; break; - case CURLOPT_SHARE: - { + case CURLOPT_SHARE: { struct Curl_share *set = va_arg(param, struct Curl_share *); /* disconnect from old share, if any */ @@ -1492,7 +1490,7 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, /* enable cookies since we now use a share that uses cookies! */ data->cookies = data->share->cookies; } -#endif /* CURL_DISABLE_HTTP */ +#endif /* CURL_DISABLE_HTTP */ #ifndef CURL_DISABLE_HSTS if(data->share->hsts) { /* first free the private one if any */ @@ -1509,8 +1507,8 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, } /* check for host cache not needed, * it will be done by curl_easy_perform */ + break; } - break; #ifdef USE_HTTP2 case CURLOPT_STREAM_DEPENDS: @@ -1530,8 +1528,7 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, } #ifndef CURL_DISABLE_COOKIES -static CURLcode cookielist(struct Curl_easy *data, - const char *ptr) +static CURLcode cookielist(struct Curl_easy *data, const char *ptr) { CURLcode result = CURLE_OK; if(!ptr) @@ -1584,8 +1581,7 @@ static CURLcode cookielist(struct Curl_easy *data, return result; } -static CURLcode cookiefile(struct Curl_easy *data, - const char *ptr) +static CURLcode cookiefile(struct Curl_easy *data, const char *ptr) { /* * Set cookie file to read and parse. Can be used multiple times. @@ -1639,8 +1635,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, case CURLOPT_PROXY_SSL_CIPHER_LIST: if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) { /* set a list of cipher we want to use in the SSL connection for proxy */ - return Curl_setstropt(&s->str[STRING_SSL_CIPHER_LIST_PROXY], - ptr); + return Curl_setstropt(&s->str[STRING_SSL_CIPHER_LIST_PROXY], ptr); } else return CURLE_NOT_BUILT_IN; @@ -1656,8 +1651,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, case CURLOPT_PROXY_TLS13_CIPHERS: if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) /* set preferred list of TLS 1.3 cipher suites for proxy */ - return Curl_setstropt(&s->str[STRING_SSL_CIPHER13_LIST_PROXY], - ptr); + return Curl_setstropt(&s->str[STRING_SSL_CIPHER13_LIST_PROXY], ptr); else return CURLE_NOT_BUILT_IN; #endif @@ -1841,7 +1835,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * to use the socks proxy. */ return Curl_setstropt(&s->str[STRING_PRE_PROXY], ptr); -#endif /* CURL_DISABLE_PROXY */ +#endif /* CURL_DISABLE_PROXY */ #ifndef CURL_DISABLE_PROXY case CURLOPT_SOCKS5_GSSAPI_SERVICE: @@ -2038,8 +2032,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } curlx_free(u); curlx_free(p); - } break; + } case CURLOPT_PROXYUSERNAME: /* * authentication username to use in the operation @@ -2201,8 +2195,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, */ #ifdef USE_SSL if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY)) - return Curl_setstropt(&s->str[STRING_SSL_PINNEDPUBLICKEY_PROXY], - ptr); + return Curl_setstropt(&s->str[STRING_SSL_PINNEDPUBLICKEY_PROXY], ptr); #endif return CURLE_NOT_BUILT_IN; #endif @@ -2304,8 +2297,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Specify colon-delimited list of signature scheme names. */ if(Curl_ssl_supports(data, SSLSUPP_SIGNATURE_ALGORITHMS)) - return Curl_setstropt(&s->str[STRING_SSL_SIGNATURE_ALGORITHMS], - ptr); + return Curl_setstropt(&s->str[STRING_SSL_SIGNATURE_ALGORITHMS], ptr); return CURLE_NOT_BUILT_IN; #endif #ifdef USE_SSH @@ -2347,8 +2339,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Option to allow for the SHA256 of the host public key to be checked * for validation purposes. */ - return Curl_setstropt(&s->str[STRING_SSH_HOST_PUBLIC_KEY_SHA256], - ptr); + return Curl_setstropt(&s->str[STRING_SSH_HOST_PUBLIC_KEY_SHA256], ptr); case CURLOPT_SSH_HOSTKEYDATA: /* @@ -2367,7 +2358,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } else /* make a NULL argument reset to default */ - s->allowed_protocols = (curl_prot_t) CURLPROTO_ALL; + s->allowed_protocols = (curl_prot_t)CURLPROTO_ALL; break; case CURLOPT_REDIR_PROTOCOLS_STR: @@ -2379,7 +2370,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } else /* make a NULL argument reset to default */ - s->redir_protocols = (curl_prot_t) CURLPROTO_REDIR; + s->redir_protocols = (curl_prot_t)CURLPROTO_REDIR; break; case CURLOPT_DEFAULT_PROTOCOL: @@ -2571,17 +2562,13 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } /* set tls_ech flag value, preserving CLA_CFG bit */ if(!strcmp(ptr, "false")) - s->tls_ech = CURLECH_DISABLE | - (s->tls_ech & CURLECH_CLA_CFG); + s->tls_ech = (s->tls_ech & CURLECH_CLA_CFG) | CURLECH_DISABLE; else if(!strcmp(ptr, "grease")) - s->tls_ech = CURLECH_GREASE | - (s->tls_ech & CURLECH_CLA_CFG); + s->tls_ech = (s->tls_ech & CURLECH_CLA_CFG) | CURLECH_GREASE; else if(!strcmp(ptr, "true")) - s->tls_ech = CURLECH_ENABLE | - (s->tls_ech & CURLECH_CLA_CFG); + s->tls_ech = (s->tls_ech & CURLECH_CLA_CFG) | CURLECH_ENABLE; else if(!strcmp(ptr, "hard")) - s->tls_ech = CURLECH_HARD | - (s->tls_ech & CURLECH_CLA_CFG); + s->tls_ech = (s->tls_ech & CURLECH_CLA_CFG) | CURLECH_HARD; else if(plen > 5 && !strncmp(ptr, "ecl:", 4)) { result = Curl_setstropt(&s->str[STRING_ECH_CONFIG], ptr + 4); if(result) @@ -2908,8 +2895,7 @@ static CURLcode setopt_blob(struct Curl_easy *data, CURLoption option, /* * Blob that holds Issuer certificate to check certificates issuer */ - return Curl_setblobopt(&s->blobs[BLOB_SSL_ISSUERCERT_PROXY], - blob); + return Curl_setblobopt(&s->blobs[BLOB_SSL_ISSUERCERT_PROXY], blob); #endif case CURLOPT_SSLKEY_BLOB: /* diff --git a/lib/setopt.h b/lib/setopt.h index c323dd74a379..0dd60c785f93 100644 --- a/lib/setopt.h +++ b/lib/setopt.h @@ -28,7 +28,7 @@ CURLcode Curl_setopt_SSLVERSION(struct Curl_easy *data, CURLoption option, long arg); #else -#define Curl_setopt_SSLVERSION(a,b,c) CURLE_NOT_BUILT_IN +#define Curl_setopt_SSLVERSION(a, b, c) CURLE_NOT_BUILT_IN #endif CURLcode Curl_setstropt(char **charp, const char *s) WARN_UNUSED_RESULT; diff --git a/lib/setup-os400.h b/lib/setup-os400.h index ef7baca67eff..01f939951008 100644 --- a/lib/setup-os400.h +++ b/lib/setup-os400.h @@ -24,7 +24,6 @@ * ***************************************************************************/ - /* OS/400 netdb.h does not define NI_MAXHOST. */ #define NI_MAXHOST 1025 @@ -37,15 +36,13 @@ typedef unsigned long u_int32_t; /* OS/400 has no idea of a tty! */ #define isatty(fd) 0 - /* Workaround bug in IBM QADRT runtime library: * function puts() does not output the implicit trailing newline. */ #include /* Be sure it is loaded. */ #undef puts -#define puts(s) (fputs((s), stdout) == EOF? EOF: putchar('\n')) - +#define puts(s) (fputs((s), stdout) == EOF ? EOF : putchar('\n')) /* System API wrapper prototypes & definitions to support ASCII parameters. */ @@ -105,8 +102,8 @@ extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status, #define gss_init_sec_context Curl_gss_init_sec_context_a -extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 * minor_status, - gss_ctx_id_t * context_handle, +extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 *minor_status, + gss_ctx_id_t *context_handle, gss_buffer_t output_token); #define gss_delete_sec_context Curl_gss_delete_sec_context_a diff --git a/lib/setup-vms.h b/lib/setup-vms.h index e3777ded6e10..17bf5a07a26d 100644 --- a/lib/setup-vms.h +++ b/lib/setup-vms.h @@ -38,9 +38,9 @@ /* Hide the stuff we are overriding */ #define getenv decc_getenv #ifdef __DECC -# if __INITIAL_POINTER_SIZE != 64 -# define getpwuid decc_getpwuid -# endif +# if __INITIAL_POINTER_SIZE != 64 +# define getpwuid decc_getpwuid +# endif #endif #include char *decc$getenv(const char *__name); @@ -51,34 +51,34 @@ char *decc$getenv(const char *__name); #undef getenv #undef getpwuid -#define getenv vms_getenv +#define getenv vms_getenv #define getpwuid vms_getpwuid /* VAX needs these in upper case when compiling exact case */ #define sys$assign SYS$ASSIGN #define sys$dassgn SYS$DASSGN -#define sys$qiow SYS$QIOW +#define sys$qiow SYS$QIOW #ifdef __DECC -# if __INITIAL_POINTER_SIZE -# pragma __pointer_size __save -# endif +# if __INITIAL_POINTER_SIZE +# pragma __pointer_size __save +# endif #endif #if __USE_LONG_GID_T -# define decc_getpwuid DECC$__LONG_GID_GETPWUID +# define decc_getpwuid DECC$__LONG_GID_GETPWUID #else -# if __INITIAL_POINTER_SIZE -# define decc_getpwuid decc$__32_getpwuid -# else -# define decc_getpwuid decc$getpwuid -# endif +# if __INITIAL_POINTER_SIZE +# define decc_getpwuid decc$__32_getpwuid +# else +# define decc_getpwuid decc$getpwuid +# endif #endif - struct passwd *decc_getpwuid(uid_t uid); +struct passwd *decc_getpwuid(uid_t uid); #ifdef __DECC -# if __INITIAL_POINTER_SIZE == 32 +# if __INITIAL_POINTER_SIZE == 32 /* Translate the path, but only if the path is a VMS file specification */ /* The translation is usually only needed for older versions of VMS */ static char *vms_translate_path(const char *path) @@ -100,18 +100,18 @@ static char *vms_translate_path(const char *path) return (char *)path; } } -# else - /* VMS translate path is actually not needed on the current 64-bit */ - /* VMS platforms, so instead of figuring out the pointer settings */ - /* Change it to a noop */ -# define vms_translate_path(__path) __path -# endif +# else + /* VMS translate path is actually not needed on the current 64-bit */ + /* VMS platforms, so instead of figuring out the pointer settings */ + /* Change it to a noop */ +# define vms_translate_path(__path) __path +# endif #endif #ifdef __DECC -# if __INITIAL_POINTER_SIZE -# pragma __pointer_size __restore -# endif +# if __INITIAL_POINTER_SIZE +# pragma __pointer_size __restore +# endif #endif static char *vms_getenv(const char *envvar) @@ -137,7 +137,6 @@ static char *vms_getenv(const char *envvar) return result; } - static struct passwd vms_passwd_cache; static struct passwd *vms_getpwuid(uid_t uid) @@ -146,11 +145,11 @@ static struct passwd *vms_getpwuid(uid_t uid) /* Hack needed to support 64-bit builds, decc_getpwnam is 32-bit only */ #ifdef __DECC -# if __INITIAL_POINTER_SIZE +# if __INITIAL_POINTER_SIZE __char_ptr32 unix_path; -# else +# else char *unix_path; -# endif +# endif #else char *unix_path; #endif @@ -191,181 +190,181 @@ static struct passwd *vms_getpwuid(uid_t uid) /* Bug - VMS OpenSSL and Kerberos universal symbols are in uppercase only */ /* VMS libraries should have universal symbols in exact and uppercase */ -#define ASN1_INTEGER_get ASN1_INTEGER_GET -#define ASN1_STRING_data ASN1_STRING_DATA -#define ASN1_STRING_length ASN1_STRING_LENGTH -#define ASN1_STRING_print ASN1_STRING_PRINT -#define ASN1_STRING_to_UTF8 ASN1_STRING_TO_UTF8 -#define ASN1_STRING_type ASN1_STRING_TYPE -#define BIO_ctrl BIO_CTRL -#define BIO_free BIO_FREE -#define BIO_new BIO_NEW -#define BIO_s_mem BIO_S_MEM -#define BN_bn2bin BN_BN2BIN -#define BN_num_bits BN_NUM_BITS +#define ASN1_INTEGER_get ASN1_INTEGER_GET +#define ASN1_STRING_data ASN1_STRING_DATA +#define ASN1_STRING_length ASN1_STRING_LENGTH +#define ASN1_STRING_print ASN1_STRING_PRINT +#define ASN1_STRING_to_UTF8 ASN1_STRING_TO_UTF8 +#define ASN1_STRING_type ASN1_STRING_TYPE +#define BIO_ctrl BIO_CTRL +#define BIO_free BIO_FREE +#define BIO_new BIO_NEW +#define BIO_s_mem BIO_S_MEM +#define BN_bn2bin BN_BN2BIN +#define BN_num_bits BN_NUM_BITS #define CRYPTO_cleanup_all_ex_data CRYPTO_CLEANUP_ALL_EX_DATA -#define CRYPTO_free CRYPTO_FREE -#define CRYPTO_malloc CRYPTO_MALLOC -#define CONF_modules_load_file CONF_MODULES_LOAD_FILE +#define CRYPTO_free CRYPTO_FREE +#define CRYPTO_malloc CRYPTO_MALLOC +#define CONF_modules_load_file CONF_MODULES_LOAD_FILE #ifdef __VAX # ifdef VMS_OLD_SSL /* Ancient OpenSSL on VAX/VMS missing this constant */ # define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 # undef CONF_modules_load_file - static int CONF_modules_load_file(const char *filename, - const char *appname, - unsigned long flags) { - return 1; - } +static int CONF_modules_load_file(const char *filename, + const char *appname, + unsigned long flags) { + return 1; +} # endif #endif -#define DES_ecb_encrypt DES_ECB_ENCRYPT -#define DES_set_key DES_SET_KEY -#define DES_set_odd_parity DES_SET_ODD_PARITY -#define ENGINE_ctrl ENGINE_CTRL -#define ENGINE_ctrl_cmd ENGINE_CTRL_CMD -#define ENGINE_finish ENGINE_FINISH -#define ENGINE_free ENGINE_FREE -#define ENGINE_get_first ENGINE_GET_FIRST -#define ENGINE_get_id ENGINE_GET_ID -#define ENGINE_get_next ENGINE_GET_NEXT -#define ENGINE_init ENGINE_INIT +#define DES_ecb_encrypt DES_ECB_ENCRYPT +#define DES_set_key DES_SET_KEY +#define DES_set_odd_parity DES_SET_ODD_PARITY +#define ENGINE_ctrl ENGINE_CTRL +#define ENGINE_ctrl_cmd ENGINE_CTRL_CMD +#define ENGINE_finish ENGINE_FINISH +#define ENGINE_free ENGINE_FREE +#define ENGINE_get_first ENGINE_GET_FIRST +#define ENGINE_get_id ENGINE_GET_ID +#define ENGINE_get_next ENGINE_GET_NEXT +#define ENGINE_init ENGINE_INIT #define ENGINE_load_builtin_engines ENGINE_LOAD_BUILTIN_ENGINES -#define ENGINE_load_private_key ENGINE_LOAD_PRIVATE_KEY -#define ENGINE_set_default ENGINE_SET_DEFAULT -#define ERR_clear_error ERR_CLEAR_ERROR -#define ERR_error_string ERR_ERROR_STRING -#define ERR_error_string_n ERR_ERROR_STRING_N -#define ERR_free_strings ERR_FREE_STRINGS -#define ERR_get_error ERR_GET_ERROR -#define ERR_peek_error ERR_PEEK_ERROR -#define ERR_remove_state ERR_REMOVE_STATE -#define EVP_PKEY_copy_parameters EVP_PKEY_COPY_PARAMETERS -#define EVP_PKEY_free EVP_PKEY_FREE -#define EVP_cleanup EVP_CLEANUP -#define GENERAL_NAMES_free GENERAL_NAMES_FREE -#define i2d_X509_PUBKEY I2D_X509_PUBKEY -#define MD4_Final MD4_FINAL -#define MD4_Init MD4_INIT -#define MD4_Update MD4_UPDATE -#define MD5_Final MD5_FINAL -#define MD5_Init MD5_INIT -#define MD5_Update MD5_UPDATE +#define ENGINE_load_private_key ENGINE_LOAD_PRIVATE_KEY +#define ENGINE_set_default ENGINE_SET_DEFAULT +#define ERR_clear_error ERR_CLEAR_ERROR +#define ERR_error_string ERR_ERROR_STRING +#define ERR_error_string_n ERR_ERROR_STRING_N +#define ERR_free_strings ERR_FREE_STRINGS +#define ERR_get_error ERR_GET_ERROR +#define ERR_peek_error ERR_PEEK_ERROR +#define ERR_remove_state ERR_REMOVE_STATE +#define EVP_PKEY_copy_parameters EVP_PKEY_COPY_PARAMETERS +#define EVP_PKEY_free EVP_PKEY_FREE +#define EVP_cleanup EVP_CLEANUP +#define GENERAL_NAMES_free GENERAL_NAMES_FREE +#define i2d_X509_PUBKEY I2D_X509_PUBKEY +#define MD4_Final MD4_FINAL +#define MD4_Init MD4_INIT +#define MD4_Update MD4_UPDATE +#define MD5_Final MD5_FINAL +#define MD5_Init MD5_INIT +#define MD5_Update MD5_UPDATE #define OPENSSL_add_all_algo_noconf OPENSSL_ADD_ALL_ALGO_NOCONF #ifndef __VAX #define OPENSSL_load_builtin_modules OPENSSL_LOAD_BUILTIN_MODULES #endif -#define PEM_read_X509 PEM_READ_X509 -#define PEM_write_bio_X509 PEM_WRITE_BIO_X509 -#define PKCS12_free PKCS12_FREE -#define PKCS12_parse PKCS12_PARSE -#define RAND_add RAND_ADD -#define RAND_bytes RAND_BYTES -#define RAND_file_name RAND_FILE_NAME -#define RAND_load_file RAND_LOAD_FILE -#define RAND_status RAND_STATUS -#define SSL_CIPHER_get_name SSL_CIPHER_GET_NAME -#define SSL_CTX_add_client_CA SSL_CTX_ADD_CLIENT_CA -#define SSL_CTX_callback_ctrl SSL_CTX_CALLBACK_CTRL -#define SSL_CTX_check_private_key SSL_CTX_CHECK_PRIVATE_KEY -#define SSL_CTX_ctrl SSL_CTX_CTRL -#define SSL_CTX_free SSL_CTX_FREE -#define SSL_CTX_get_cert_store SSL_CTX_GET_CERT_STORE -#define SSL_CTX_load_verify_locations SSL_CTX_LOAD_VERIFY_LOCATIONS -#define SSL_CTX_new SSL_CTX_NEW -#define SSL_CTX_set_cipher_list SSL_CTX_SET_CIPHER_LIST -#define SSL_CTX_set_def_passwd_cb_ud SSL_CTX_SET_DEF_PASSWD_CB_UD -#define SSL_CTX_set_default_passwd_cb SSL_CTX_SET_DEFAULT_PASSWD_CB -#define SSL_CTX_set_msg_callback SSL_CTX_SET_MSG_CALLBACK -#define SSL_CTX_set_verify SSL_CTX_SET_VERIFY -#define SSL_CTX_use_PrivateKey SSL_CTX_USE_PRIVATEKEY -#define SSL_CTX_use_PrivateKey_file SSL_CTX_USE_PRIVATEKEY_FILE -#define SSL_CTX_use_cert_chain_file SSL_CTX_USE_CERT_CHAIN_FILE -#define SSL_CTX_use_certificate SSL_CTX_USE_CERTIFICATE -#define SSL_CTX_use_certificate_file SSL_CTX_USE_CERTIFICATE_FILE -#define SSL_SESSION_free SSL_SESSION_FREE -#define SSL_connect SSL_CONNECT -#define SSL_free SSL_FREE -#define SSL_get1_session SSL_GET1_SESSION -#define SSL_get_certificate SSL_GET_CERTIFICATE -#define SSL_get_current_cipher SSL_GET_CURRENT_CIPHER -#define SSL_get_error SSL_GET_ERROR -#define SSL_get_peer_cert_chain SSL_GET_PEER_CERT_CHAIN -#define SSL_get_peer_certificate SSL_GET_PEER_CERTIFICATE -#define SSL_get_privatekey SSL_GET_PRIVATEKEY -#define SSL_get_session SSL_GET_SESSION -#define SSL_get_shutdown SSL_GET_SHUTDOWN -#define SSL_get_verify_result SSL_GET_VERIFY_RESULT -#define SSL_library_init SSL_LIBRARY_INIT -#define SSL_load_error_strings SSL_LOAD_ERROR_STRINGS -#define SSL_new SSL_NEW -#define SSL_peek SSL_PEEK -#define SSL_pending SSL_PENDING -#define SSL_read SSL_READ -#define SSL_set_connect_state SSL_SET_CONNECT_STATE -#define SSL_set_fd SSL_SET_FD -#define SSL_set_session SSL_SET_SESSION -#define SSL_shutdown SSL_SHUTDOWN -#define SSL_version SSL_VERSION -#define SSL_write SSL_WRITE -#define SSLeay SSLEAY -#define SSLv23_client_method SSLV23_CLIENT_METHOD -#define SSLv3_client_method SSLV3_CLIENT_METHOD -#define TLSv1_client_method TLSV1_CLIENT_METHOD -#define UI_create_method UI_CREATE_METHOD -#define UI_destroy_method UI_DESTROY_METHOD -#define UI_get0_user_data UI_GET0_USER_DATA -#define UI_get_input_flags UI_GET_INPUT_FLAGS -#define UI_get_string_type UI_GET_STRING_TYPE -#define UI_create_method UI_CREATE_METHOD -#define UI_destroy_method UI_DESTROY_METHOD -#define UI_method_get_closer UI_METHOD_GET_CLOSER -#define UI_method_get_opener UI_METHOD_GET_OPENER -#define UI_method_get_reader UI_METHOD_GET_READER -#define UI_method_get_writer UI_METHOD_GET_WRITER -#define UI_method_set_closer UI_METHOD_SET_CLOSER -#define UI_method_set_opener UI_METHOD_SET_OPENER -#define UI_method_set_reader UI_METHOD_SET_READER -#define UI_method_set_writer UI_METHOD_SET_WRITER -#define UI_OpenSSL UI_OPENSSL -#define UI_set_result UI_SET_RESULT -#define X509V3_EXT_print X509V3_EXT_PRINT -#define X509_EXTENSION_get_critical X509_EXTENSION_GET_CRITICAL -#define X509_EXTENSION_get_data X509_EXTENSION_GET_DATA -#define X509_EXTENSION_get_object X509_EXTENSION_GET_OBJECT -#define X509_LOOKUP_file X509_LOOKUP_FILE -#define X509_NAME_ENTRY_get_data X509_NAME_ENTRY_GET_DATA -#define X509_NAME_get_entry X509_NAME_GET_ENTRY -#define X509_NAME_get_index_by_NID X509_NAME_GET_INDEX_BY_NID -#define X509_NAME_print_ex X509_NAME_PRINT_EX +#define PEM_read_X509 PEM_READ_X509 +#define PEM_write_bio_X509 PEM_WRITE_BIO_X509 +#define PKCS12_free PKCS12_FREE +#define PKCS12_parse PKCS12_PARSE +#define RAND_add RAND_ADD +#define RAND_bytes RAND_BYTES +#define RAND_file_name RAND_FILE_NAME +#define RAND_load_file RAND_LOAD_FILE +#define RAND_status RAND_STATUS +#define SSL_CIPHER_get_name SSL_CIPHER_GET_NAME +#define SSL_CTX_add_client_CA SSL_CTX_ADD_CLIENT_CA +#define SSL_CTX_callback_ctrl SSL_CTX_CALLBACK_CTRL +#define SSL_CTX_check_private_key SSL_CTX_CHECK_PRIVATE_KEY +#define SSL_CTX_ctrl SSL_CTX_CTRL +#define SSL_CTX_free SSL_CTX_FREE +#define SSL_CTX_get_cert_store SSL_CTX_GET_CERT_STORE +#define SSL_CTX_load_verify_locations SSL_CTX_LOAD_VERIFY_LOCATIONS +#define SSL_CTX_new SSL_CTX_NEW +#define SSL_CTX_set_cipher_list SSL_CTX_SET_CIPHER_LIST +#define SSL_CTX_set_def_passwd_cb_ud SSL_CTX_SET_DEF_PASSWD_CB_UD +#define SSL_CTX_set_default_passwd_cb SSL_CTX_SET_DEFAULT_PASSWD_CB +#define SSL_CTX_set_msg_callback SSL_CTX_SET_MSG_CALLBACK +#define SSL_CTX_set_verify SSL_CTX_SET_VERIFY +#define SSL_CTX_use_PrivateKey SSL_CTX_USE_PRIVATEKEY +#define SSL_CTX_use_PrivateKey_file SSL_CTX_USE_PRIVATEKEY_FILE +#define SSL_CTX_use_cert_chain_file SSL_CTX_USE_CERT_CHAIN_FILE +#define SSL_CTX_use_certificate SSL_CTX_USE_CERTIFICATE +#define SSL_CTX_use_certificate_file SSL_CTX_USE_CERTIFICATE_FILE +#define SSL_SESSION_free SSL_SESSION_FREE +#define SSL_connect SSL_CONNECT +#define SSL_free SSL_FREE +#define SSL_get1_session SSL_GET1_SESSION +#define SSL_get_certificate SSL_GET_CERTIFICATE +#define SSL_get_current_cipher SSL_GET_CURRENT_CIPHER +#define SSL_get_error SSL_GET_ERROR +#define SSL_get_peer_cert_chain SSL_GET_PEER_CERT_CHAIN +#define SSL_get_peer_certificate SSL_GET_PEER_CERTIFICATE +#define SSL_get_privatekey SSL_GET_PRIVATEKEY +#define SSL_get_session SSL_GET_SESSION +#define SSL_get_shutdown SSL_GET_SHUTDOWN +#define SSL_get_verify_result SSL_GET_VERIFY_RESULT +#define SSL_library_init SSL_LIBRARY_INIT +#define SSL_load_error_strings SSL_LOAD_ERROR_STRINGS +#define SSL_new SSL_NEW +#define SSL_peek SSL_PEEK +#define SSL_pending SSL_PENDING +#define SSL_read SSL_READ +#define SSL_set_connect_state SSL_SET_CONNECT_STATE +#define SSL_set_fd SSL_SET_FD +#define SSL_set_session SSL_SET_SESSION +#define SSL_shutdown SSL_SHUTDOWN +#define SSL_version SSL_VERSION +#define SSL_write SSL_WRITE +#define SSLeay SSLEAY +#define SSLv23_client_method SSLV23_CLIENT_METHOD +#define SSLv3_client_method SSLV3_CLIENT_METHOD +#define TLSv1_client_method TLSV1_CLIENT_METHOD +#define UI_create_method UI_CREATE_METHOD +#define UI_destroy_method UI_DESTROY_METHOD +#define UI_get0_user_data UI_GET0_USER_DATA +#define UI_get_input_flags UI_GET_INPUT_FLAGS +#define UI_get_string_type UI_GET_STRING_TYPE +#define UI_create_method UI_CREATE_METHOD +#define UI_destroy_method UI_DESTROY_METHOD +#define UI_method_get_closer UI_METHOD_GET_CLOSER +#define UI_method_get_opener UI_METHOD_GET_OPENER +#define UI_method_get_reader UI_METHOD_GET_READER +#define UI_method_get_writer UI_METHOD_GET_WRITER +#define UI_method_set_closer UI_METHOD_SET_CLOSER +#define UI_method_set_opener UI_METHOD_SET_OPENER +#define UI_method_set_reader UI_METHOD_SET_READER +#define UI_method_set_writer UI_METHOD_SET_WRITER +#define UI_OpenSSL UI_OPENSSL +#define UI_set_result UI_SET_RESULT +#define X509V3_EXT_print X509V3_EXT_PRINT +#define X509_EXTENSION_get_critical X509_EXTENSION_GET_CRITICAL +#define X509_EXTENSION_get_data X509_EXTENSION_GET_DATA +#define X509_EXTENSION_get_object X509_EXTENSION_GET_OBJECT +#define X509_LOOKUP_file X509_LOOKUP_FILE +#define X509_NAME_ENTRY_get_data X509_NAME_ENTRY_GET_DATA +#define X509_NAME_get_entry X509_NAME_GET_ENTRY +#define X509_NAME_get_index_by_NID X509_NAME_GET_INDEX_BY_NID +#define X509_NAME_print_ex X509_NAME_PRINT_EX #define X509_STORE_CTX_get_current_cert X509_STORE_CTX_GET_CURRENT_CERT -#define X509_STORE_add_lookup X509_STORE_ADD_LOOKUP -#define X509_STORE_set_flags X509_STORE_SET_FLAGS -#define X509_check_issued X509_CHECK_ISSUED -#define X509_free X509_FREE -#define X509_get_ext_d2i X509_GET_EXT_D2I -#define X509_get_issuer_name X509_GET_ISSUER_NAME -#define X509_get_pubkey X509_GET_PUBKEY -#define X509_get_serialNumber X509_GET_SERIALNUMBER -#define X509_get_subject_name X509_GET_SUBJECT_NAME -#define X509_load_crl_file X509_LOAD_CRL_FILE -#define X509_verify_cert_error_string X509_VERIFY_CERT_ERROR_STRING -#define d2i_PKCS12_fp D2I_PKCS12_FP -#define i2t_ASN1_OBJECT I2T_ASN1_OBJECT -#define sk_num SK_NUM -#define sk_pop SK_POP -#define sk_pop_free SK_POP_FREE -#define sk_value SK_VALUE +#define X509_STORE_add_lookup X509_STORE_ADD_LOOKUP +#define X509_STORE_set_flags X509_STORE_SET_FLAGS +#define X509_check_issued X509_CHECK_ISSUED +#define X509_free X509_FREE +#define X509_get_ext_d2i X509_GET_EXT_D2I +#define X509_get_issuer_name X509_GET_ISSUER_NAME +#define X509_get_pubkey X509_GET_PUBKEY +#define X509_get_serialNumber X509_GET_SERIALNUMBER +#define X509_get_subject_name X509_GET_SUBJECT_NAME +#define X509_load_crl_file X509_LOAD_CRL_FILE +#define X509_verify_cert_error_string X509_VERIFY_CERT_ERROR_STRING +#define d2i_PKCS12_fp D2I_PKCS12_FP +#define i2t_ASN1_OBJECT I2T_ASN1_OBJECT +#define sk_num SK_NUM +#define sk_pop SK_POP +#define sk_pop_free SK_POP_FREE +#define sk_value SK_VALUE #ifdef __VAX #define OPENSSL_NO_SHA256 #endif -#define SHA256_Final SHA256_FINAL -#define SHA256_Init SHA256_INIT +#define SHA256_Final SHA256_FINAL +#define SHA256_Init SHA256_INIT #define SHA256_Update SHA256_UPDATE #define USE_UPPERCASE_GSSAPI 1 -#define gss_seal GSS_SEAL -#define gss_unseal GSS_UNSEAL +#define gss_seal GSS_SEAL +#define gss_unseal GSS_UNSEAL #define USE_UPPERCASE_KRBAPI 1 @@ -379,11 +378,11 @@ static struct passwd *vms_getpwuid(uid_t uid) /* VAX symbols are always in uppercase */ #ifdef __VAX -#define inflate INFLATE -#define inflateEnd INFLATEEND +#define inflate INFLATE +#define inflateEnd INFLATEEND #define inflateInit2_ INFLATEINIT2_ -#define inflateInit_ INFLATEINIT_ -#define zlibVersion ZLIBVERSION +#define inflateInit_ INFLATEINIT_ +#define zlibVersion ZLIBVERSION #endif /* Older VAX OpenSSL port defines these as Macros */ @@ -391,11 +390,11 @@ static struct passwd *vms_getpwuid(uid_t uid) /* that way a newer port will also work if some one has one */ #ifdef __VAX -# include -# ifndef OpenSSL_add_all_algorithms -# define OpenSSL_add_all_algorithms OPENSSL_ADD_ALL_ALGORITHMS - void OPENSSL_ADD_ALL_ALGORITHMS(void); -# endif +# include +# ifndef OpenSSL_add_all_algorithms +# define OpenSSL_add_all_algorithms OPENSSL_ADD_ALL_ALGORITHMS + void OPENSSL_ADD_ALL_ALGORITHMS(void); +# endif #endif #endif /* HEADER_CURL_SETUP_VMS_H */ diff --git a/lib/sha256.c b/lib/sha256.c index 977ad3edc402..9c3b60ec1885 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -193,7 +193,7 @@ static CURLcode my_sha256_init(void *in) { my_sha256_ctx *ctx = (my_sha256_ctx *)in; if(!CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_AES, - CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) return CURLE_OUT_OF_MEMORY; if(!CryptCreateHash(ctx->hCryptProv, CALG_SHA_256, 0, 0, &ctx->hHash)) { @@ -236,42 +236,43 @@ static void my_sha256_final(unsigned char *digest, void *in) /* This is based on the SHA256 implementation in LibTomCrypt that was released * into public domain. */ -#define WPA_GET_BE32(a) ((((unsigned long)(a)[0]) << 24) | \ - (((unsigned long)(a)[1]) << 16) | \ - (((unsigned long)(a)[2]) << 8) | \ - ((unsigned long)(a)[3])) -#define WPA_PUT_BE32(a, val) \ -do { \ - (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); \ -} while(0) +#define WPA_GET_BE32(a) \ + ((((unsigned long)(a)[0]) << 24) | \ + (((unsigned long)(a)[1]) << 16) | \ + (((unsigned long)(a)[2]) << 8) | \ + ((unsigned long)(a)[3])) +#define WPA_PUT_BE32(a, val) \ + do { \ + (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); \ + } while(0) #ifdef HAVE_LONGLONG -#define WPA_PUT_BE64(a, val) \ -do { \ - (a)[0] = (unsigned char)(((unsigned long long)(val)) >> 56); \ - (a)[1] = (unsigned char)(((unsigned long long)(val)) >> 48); \ - (a)[2] = (unsigned char)(((unsigned long long)(val)) >> 40); \ - (a)[3] = (unsigned char)(((unsigned long long)(val)) >> 32); \ - (a)[4] = (unsigned char)(((unsigned long long)(val)) >> 24); \ - (a)[5] = (unsigned char)(((unsigned long long)(val)) >> 16); \ - (a)[6] = (unsigned char)(((unsigned long long)(val)) >> 8); \ - (a)[7] = (unsigned char)(((unsigned long long)(val)) & 0xff); \ -} while(0) +#define WPA_PUT_BE64(a, val) \ + do { \ + (a)[0] = (unsigned char)(((unsigned long long)(val)) >> 56); \ + (a)[1] = (unsigned char)(((unsigned long long)(val)) >> 48); \ + (a)[2] = (unsigned char)(((unsigned long long)(val)) >> 40); \ + (a)[3] = (unsigned char)(((unsigned long long)(val)) >> 32); \ + (a)[4] = (unsigned char)(((unsigned long long)(val)) >> 24); \ + (a)[5] = (unsigned char)(((unsigned long long)(val)) >> 16); \ + (a)[6] = (unsigned char)(((unsigned long long)(val)) >> 8); \ + (a)[7] = (unsigned char)(((unsigned long long)(val)) & 0xff); \ + } while(0) #else -#define WPA_PUT_BE64(a, val) \ -do { \ - (a)[0] = (unsigned char)(((unsigned __int64)(val)) >> 56); \ - (a)[1] = (unsigned char)(((unsigned __int64)(val)) >> 48); \ - (a)[2] = (unsigned char)(((unsigned __int64)(val)) >> 40); \ - (a)[3] = (unsigned char)(((unsigned __int64)(val)) >> 32); \ - (a)[4] = (unsigned char)(((unsigned __int64)(val)) >> 24); \ - (a)[5] = (unsigned char)(((unsigned __int64)(val)) >> 16); \ - (a)[6] = (unsigned char)(((unsigned __int64)(val)) >> 8); \ - (a)[7] = (unsigned char)(((unsigned __int64)(val)) & 0xff); \ -} while(0) +#define WPA_PUT_BE64(a, val) \ + do { \ + (a)[0] = (unsigned char)(((unsigned __int64)(val)) >> 56); \ + (a)[1] = (unsigned char)(((unsigned __int64)(val)) >> 48); \ + (a)[2] = (unsigned char)(((unsigned __int64)(val)) >> 40); \ + (a)[3] = (unsigned char)(((unsigned __int64)(val)) >> 32); \ + (a)[4] = (unsigned char)(((unsigned __int64)(val)) >> 24); \ + (a)[5] = (unsigned char)(((unsigned __int64)(val)) >> 16); \ + (a)[6] = (unsigned char)(((unsigned __int64)(val)) >> 8); \ + (a)[7] = (unsigned char)(((unsigned __int64)(val)) & 0xff); \ + } while(0) #endif struct sha256_state { @@ -304,20 +305,21 @@ static const unsigned long K[64] = { /* Various logical functions */ #define RORc(x, y) \ -(((((unsigned long)(x) & 0xFFFFFFFFUL) >> (unsigned long)((y) & 31)) | \ - ((unsigned long)(x) << (unsigned long)(32 - ((y) & 31)))) & 0xFFFFFFFFUL) -#define Sha256_Ch(x,y,z) (z ^ (x & (y ^ z))) -#define Sha256_Maj(x,y,z) (((x | y) & z) | (x & y)) -#define Sha256_S(x, n) RORc((x), (n)) -#define Sha256_R(x, n) (((x)&0xFFFFFFFFUL)>>(n)) + (((((unsigned long)(x) & 0xFFFFFFFFUL) >> (unsigned long)((y) & 31)) | \ + ((unsigned long)(x) << (unsigned long)(32 - ((y) & 31)))) & 0xFFFFFFFFUL) + +#define Sha256_Ch(x, y, z) (z ^ (x & (y ^ z))) +#define Sha256_Maj(x, y, z) (((x | y) & z) | (x & y)) +#define Sha256_S(x, n) RORc((x), (n)) +#define Sha256_R(x, n) (((x) & 0xFFFFFFFFUL) >> (n)) + #define Sigma0(x) (Sha256_S(x, 2) ^ Sha256_S(x, 13) ^ Sha256_S(x, 22)) #define Sigma1(x) (Sha256_S(x, 6) ^ Sha256_S(x, 11) ^ Sha256_S(x, 25)) #define Gamma0(x) (Sha256_S(x, 7) ^ Sha256_S(x, 18) ^ Sha256_R(x, 3)) #define Gamma1(x) (Sha256_S(x, 17) ^ Sha256_S(x, 19) ^ Sha256_R(x, 10)) /* Compress 512-bits */ -static int sha256_compress(struct sha256_state *md, - const unsigned char *buf) +static int sha256_compress(struct sha256_state *md, const unsigned char *buf) { unsigned long S[8], W[64]; int i; @@ -331,12 +333,11 @@ static int sha256_compress(struct sha256_state *md, W[i] = WPA_GET_BE32(buf + (4 * i)); /* fill W[16..63] */ for(i = 16; i < 64; i++) { - W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + - W[i - 16]; + W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; } /* Compress */ -#define RND(a,b,c,d,e,f,g,h,i) \ +#define RND(a, b, c, d, e, f, g, h, i) \ do { \ unsigned long t0 = h + Sigma1(e) + Sha256_Ch(e, f, g) + K[i] + W[i]; \ unsigned long t1 = Sigma0(a) + Sha256_Maj(a, b, c); \ @@ -347,8 +348,15 @@ static int sha256_compress(struct sha256_state *md, for(i = 0; i < 64; ++i) { unsigned long t; RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], i); - t = S[7]; S[7] = S[6]; S[6] = S[5]; S[5] = S[4]; - S[4] = S[3]; S[3] = S[2]; S[2] = S[1]; S[1] = S[0]; S[0] = t; + t = S[7]; + S[7] = S[6]; + S[6] = S[5]; + S[5] = S[4]; + S[4] = S[3]; + S[3] = S[2]; + S[2] = S[1]; + S[1] = S[0]; + S[0] = t; } /* Feedback */ @@ -492,7 +500,6 @@ CURLcode Curl_sha256it(unsigned char *output, const unsigned char *input, return result; } - const struct HMAC_params Curl_HMAC_SHA256 = { my_sha256_init, /* Hash initialization function. */ my_sha256_update, /* Hash update function. */ diff --git a/lib/sigpipe.h b/lib/sigpipe.h index 1be3a111e958..5d2c78a2713c 100644 --- a/lib/sigpipe.h +++ b/lib/sigpipe.h @@ -25,7 +25,7 @@ ***************************************************************************/ #include "curl_setup.h" -#if defined(HAVE_SIGACTION) && \ +#if defined(HAVE_SIGACTION) && \ (defined(USE_OPENSSL) || defined(USE_MBEDTLS) || defined(USE_WOLFSSL)) #include @@ -88,12 +88,12 @@ static void sigpipe_apply(struct Curl_easy *data, #else /* for systems without sigaction */ -#define sigpipe_ignore(x,y) Curl_nop_stmt -#define sigpipe_apply(x,y) Curl_nop_stmt -#define sigpipe_init(x) Curl_nop_stmt -#define sigpipe_restore(x) Curl_nop_stmt +#define sigpipe_ignore(x, y) Curl_nop_stmt +#define sigpipe_apply(x, y) Curl_nop_stmt +#define sigpipe_init(x) Curl_nop_stmt +#define sigpipe_restore(x) Curl_nop_stmt #define SIGPIPE_VARIABLE(x) -#define SIGPIPE_MEMBER(x) bool x +#define SIGPIPE_MEMBER(x) bool x #endif #endif /* HEADER_CURL_SIGPIPE_H */ diff --git a/lib/slist.c b/lib/slist.c index 469ee0ef3b5b..9b7f11d42619 100644 --- a/lib/slist.c +++ b/lib/slist.c @@ -31,7 +31,7 @@ /* returns last node in linked list */ static struct curl_slist *slist_get_last(struct curl_slist *list) { - struct curl_slist *item; + struct curl_slist *item; /* if caller passed us a NULL, return now */ if(!list) @@ -57,8 +57,8 @@ static struct curl_slist *slist_get_last(struct curl_slist *list) struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, const char *data) { - struct curl_slist *last; - struct curl_slist *new_item; + struct curl_slist *last; + struct curl_slist *new_item; DEBUGASSERT(data); @@ -85,8 +85,7 @@ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, * bothersome, then simply create a separate _init function and call it * appropriately from within the program. */ -struct curl_slist *curl_slist_append(struct curl_slist *list, - const char *data) +struct curl_slist *curl_slist_append(struct curl_slist *list, const char *data) { char *dupdata = curlx_strdup(data); @@ -127,8 +126,8 @@ struct curl_slist *Curl_slist_duplicate(struct curl_slist *inlist) /* be nice and clean up resources */ void curl_slist_free_all(struct curl_slist *list) { - struct curl_slist *next; - struct curl_slist *item; + struct curl_slist *next; + struct curl_slist *item; if(!list) return; diff --git a/lib/smb.c b/lib/smb.c index 338464961b21..c52d4eca57af 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -368,7 +368,7 @@ const struct Curl_handler Curl_handler_smbs = { defined(__OS400__) static unsigned short smb_swap16(unsigned short x) { - return (unsigned short) ((x << 8) | ((x >> 8) & 0xff)); + return (unsigned short)((x << 8) | ((x >> 8) & 0xff)); } static unsigned int smb_swap32(unsigned int x) @@ -379,8 +379,8 @@ static unsigned int smb_swap32(unsigned int x) static curl_off_t smb_swap64(curl_off_t x) { - return ((curl_off_t) smb_swap32((unsigned int) x) << 32) | - smb_swap32((unsigned int) (x >> 32)); + return ((curl_off_t)smb_swap32((unsigned int)x) << 32) | + smb_swap32((unsigned int)(x >> 32)); } #else @@ -573,7 +573,7 @@ static CURLcode smb_recv_message(struct Curl_easy *data, if(nbt_size >= msg_size + 1) { /* Add the word count */ - msg_size += 1 + ((unsigned char) buf[msg_size]) * sizeof(unsigned short); + msg_size += 1 + ((unsigned char)buf[msg_size]) * sizeof(unsigned short); if(nbt_size >= msg_size + sizeof(unsigned short)) { /* Add the byte count */ msg_size += sizeof(unsigned short) + @@ -601,8 +601,8 @@ static void smb_format_message(struct smb_conn *smbc, const unsigned int pid = 0xbad71d; /* made up */ memset(h, 0, sizeof(*h)); - h->nbt_length = htons((unsigned short) (sizeof(*h) - sizeof(unsigned int) + - len)); + h->nbt_length = htons((unsigned short)(sizeof(*h) - sizeof(unsigned int) + + len)); memcpy((char *)h->magic, "\xffSMB", 4); h->command = cmd; h->flags = SMB_FLAGS_CANONICAL_PATHNAMES | SMB_FLAGS_CASELESS_PATHNAMES; @@ -610,7 +610,7 @@ static void smb_format_message(struct smb_conn *smbc, h->uid = smb_swap16(smbc->uid); h->tid = smb_swap16(req->tid); h->pid_high = smb_swap16((unsigned short)(pid >> 16)); - h->pid = smb_swap16((unsigned short) pid); + h->pid = smb_swap16((unsigned short)pid); } static CURLcode smb_send(struct Curl_easy *data, struct smb_conn *smbc, @@ -790,7 +790,7 @@ static CURLcode smb_send_open(struct Curl_easy *data, msg.access = smb_swap32(SMB_GENERIC_READ); msg.create_disposition = smb_swap32(SMB_FILE_OPEN); } - msg.byte_count = smb_swap16((unsigned short) byte_count); + msg.byte_count = smb_swap16((unsigned short)byte_count); strcpy(msg.bytes, req->path); return smb_send_message(data, smbc, req, SMB_COM_NT_CREATE_ANDX, &msg, @@ -831,8 +831,8 @@ static CURLcode smb_send_read(struct Curl_easy *data, msg.word_count = SMB_WC_READ_ANDX; msg.andx.command = SMB_COM_NO_ANDX_COMMAND; msg.fid = smb_swap16(req->fid); - msg.offset = smb_swap32((unsigned int) offset); - msg.offset_high = smb_swap32((unsigned int) (offset >> 32)); + msg.offset = smb_swap32((unsigned int)offset); + msg.offset_high = smb_swap32((unsigned int)(offset >> 32)); msg.min_bytes = smb_swap16(MAX_PAYLOAD_SIZE); msg.max_bytes = smb_swap16(MAX_PAYLOAD_SIZE); @@ -856,16 +856,16 @@ static CURLcode smb_send_write(struct Curl_easy *data, msg->word_count = SMB_WC_WRITE_ANDX; msg->andx.command = SMB_COM_NO_ANDX_COMMAND; msg->fid = smb_swap16(req->fid); - msg->offset = smb_swap32((unsigned int) offset); - msg->offset_high = smb_swap32((unsigned int) (offset >> 32)); - msg->data_length = smb_swap16((unsigned short) upload_size); + msg->offset = smb_swap32((unsigned int)offset); + msg->offset_high = smb_swap32((unsigned int)(offset >> 32)); + msg->data_length = smb_swap16((unsigned short)upload_size); msg->data_offset = smb_swap16(sizeof(*msg) - sizeof(unsigned int)); - msg->byte_count = smb_swap16((unsigned short) (upload_size + 1)); + msg->byte_count = smb_swap16((unsigned short)(upload_size + 1)); smb_format_message(smbc, req, &msg->h, SMB_COM_WRITE_ANDX, - sizeof(*msg) - sizeof(msg->h) + (size_t) upload_size); + sizeof(*msg) - sizeof(msg->h) + (size_t)upload_size); - return smb_send(data, smbc, sizeof(*msg), (size_t) upload_size); + return smb_send(data, smbc, sizeof(*msg), (size_t)upload_size); } static CURLcode smb_send_and_recv(struct Curl_easy *data, @@ -1014,7 +1014,7 @@ static void get_posix_time(time_t *out, curl_off_t timestamp) *out = TIME_T_MIN; else #endif - *out = (time_t) timestamp; + *out = (time_t)timestamp; } else *out = 0; @@ -1084,7 +1084,7 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) next_state = SMB_TREE_DISCONNECT; break; } - smb_m = (const struct smb_nt_create_response*) msg; + smb_m = (const struct smb_nt_create_response *)msg; req->fid = smb_swap16(smb_m->fid); data->req.offset = 0; if(data->state.upload) { @@ -1113,9 +1113,9 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) next_state = SMB_CLOSE; break; } - len = Curl_read16_le(((const unsigned char *) msg) + + len = Curl_read16_le(((const unsigned char *)msg) + sizeof(struct smb_header) + 11); - off = Curl_read16_le(((const unsigned char *) msg) + + off = Curl_read16_le(((const unsigned char *)msg) + sizeof(struct smb_header) + 13); if(len > 0) { if(off + sizeof(unsigned int) + len > smbc->got) { @@ -1142,7 +1142,7 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) next_state = SMB_CLOSE; break; } - len = Curl_read16_le(((const unsigned char *) msg) + + len = Curl_read16_le(((const unsigned char *)msg) + sizeof(struct smb_header) + 5); data->req.bytecount += len; data->req.offset += len; diff --git a/lib/smtp.c b/lib/smtp.c index 55a15b36c08d..5aab391e379a 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -201,8 +201,7 @@ const struct Curl_handler Curl_handler_smtp = { CURLPROTO_SMTP, /* protocol */ CURLPROTO_SMTP, /* family */ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY | /* flags */ - PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | - PROTOPT_CONN_REUSE + PROTOPT_URLOPTIONS | PROTOPT_SSL_REUSE | PROTOPT_CONN_REUSE }; #ifdef USE_SSL @@ -233,8 +232,7 @@ const struct Curl_handler Curl_handler_smtps = { CURLPROTO_SMTPS, /* protocol */ CURLPROTO_SMTP, /* family */ PROTOPT_CLOSEACTION | PROTOPT_SSL | /* flags */ - PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS | - PROTOPT_CONN_REUSE + PROTOPT_NOURLQUERY | PROTOPT_URLOPTIONS | PROTOPT_CONN_REUSE }; #endif @@ -285,10 +283,10 @@ static bool smtp_endofresp(struct Curl_easy *data, struct connectdata *conn, const char *p = tmpline; result = TRUE; memcpy(tmpline, line, (len == 5 ? 5 : 3)); - tmpline[len == 5 ? 5 : 3 ] = 0; + tmpline[len == 5 ? 5 : 3] = 0; if(curlx_str_number(&p, &code, len == 5 ? 99999 : 999)) return FALSE; - *resp = (int) code; + *resp = (int)code; /* Make sure real server never sends internal value */ if(*resp == 1) @@ -508,7 +506,7 @@ static CURLcode smtp_perform_auth(struct Curl_easy *data, CURLcode result = CURLE_OK; struct smtp_conn *smtpc = Curl_conn_meta_get(data->conn, CURL_META_SMTP_CONN); - const char *ir = (const char *) Curl_bufref_ptr(initresp); + const char *ir = (const char *)Curl_bufref_ptr(initresp); if(!smtpc) return CURLE_FAILED_INIT; @@ -542,7 +540,7 @@ static CURLcode smtp_continue_auth(struct Curl_easy *data, if(!smtpc) return CURLE_FAILED_INIT; return Curl_pp_sendf(data, &smtpc->pp, - "%s", (const char *) Curl_bufref_ptr(resp)); + "%s", (const char *)Curl_bufref_ptr(resp)); } /*********************************************************************** @@ -923,7 +921,7 @@ static CURLcode smtp_state_servergreet_resp(struct Curl_easy *data, CURLcode result = CURLE_OK; (void)instate; - if(smtpcode/100 != 2) { + if(smtpcode / 100 != 2) { failf(data, "Got unexpected smtp-server response: %d", smtpcode); result = CURLE_WEIRD_SERVER_REPLY; } @@ -972,9 +970,9 @@ static CURLcode smtp_state_ehlo_resp(struct Curl_easy *data, (void)instate; - if(smtpcode/100 != 2 && smtpcode != 1) { - if(data->set.use_ssl <= CURLUSESSL_TRY - || Curl_conn_is_ssl(data->conn, FIRSTSOCKET)) + if(smtpcode / 100 != 2 && smtpcode != 1) { + if(data->set.use_ssl <= CURLUSESSL_TRY || + Curl_conn_is_ssl(data->conn, FIRSTSOCKET)) result = smtp_perform_helo(data, smtpc); else { failf(data, "Remote access denied: %d", smtpcode); @@ -1073,7 +1071,7 @@ static CURLcode smtp_state_helo_resp(struct Curl_easy *data, CURLcode result = CURLE_OK; (void)instate; - if(smtpcode/100 != 2) { + if(smtpcode / 100 != 2) { failf(data, "Remote access denied: %d", smtpcode); result = CURLE_REMOTE_ACCESS_DENIED; } @@ -1125,8 +1123,8 @@ static CURLcode smtp_state_command_resp(struct Curl_easy *data, (void)instate; - if((smtp->rcpt && smtpcode/100 != 2 && smtpcode != 553 && smtpcode != 1) || - (!smtp->rcpt && smtpcode/100 != 2 && smtpcode != 1)) { + if((smtp->rcpt && smtpcode / 100 != 2 && smtpcode != 553 && smtpcode != 1) || + (!smtp->rcpt && smtpcode / 100 != 2 && smtpcode != 1)) { failf(data, "Command failed: %d", smtpcode); result = CURLE_WEIRD_SERVER_REPLY; } @@ -1165,7 +1163,7 @@ static CURLcode smtp_state_mail_resp(struct Curl_easy *data, CURLcode result = CURLE_OK; (void)instate; - if(smtpcode/100 != 2) { + if(smtpcode / 100 != 2) { failf(data, "MAIL failed: %d", smtpcode); result = CURLE_SEND_ERROR; } @@ -1189,7 +1187,7 @@ static CURLcode smtp_state_rcpt_resp(struct Curl_easy *data, (void)instate; - is_smtp_err = (smtpcode/100 != 2); + is_smtp_err = (smtpcode / 100 != 2); /* If there is multiple RCPT TO to be issued, it is possible to ignore errors and proceed with only the valid addresses. */ @@ -1735,8 +1733,8 @@ static CURLcode smtp_setup_connection(struct Curl_easy *data, smtpc = curlx_calloc(1, sizeof(*smtpc)); if(!smtpc || Curl_conn_meta_set(conn, CURL_META_SMTP_CONN, smtpc, smtp_conn_dtor)) { - result = CURLE_OUT_OF_MEMORY; - goto out; + result = CURLE_OUT_OF_MEMORY; + goto out; } smtp = curlx_calloc(1, sizeof(*smtp)); @@ -1943,7 +1941,7 @@ static void cr_eob_close(struct Curl_easy *data, struct Curl_creader *reader) } /* this is the 5-bytes End-Of-Body marker for SMTP */ -#define SMTP_EOB "\r\n.\r\n" +#define SMTP_EOB "\r\n.\r\n" #define SMTP_EOB_FIND_LEN 3 /* client reader doing SMTP End-Of-Body escaping. */ @@ -2016,16 +2014,16 @@ static CURLcode cr_eob_read(struct Curl_easy *data, const char *eob = SMTP_EOB; CURL_TRC_SMTP(data, "auto-ending mail body with '\\r\\n.\\r\\n'"); switch(ctx->n_eob) { - case 2: - /* seen a CRLF at the end, just add the remainder */ - eob = &SMTP_EOB[2]; - break; - case 3: - /* ended with '\r\n.', we should escape the last '.' */ - eob = "." SMTP_EOB; - break; - default: - break; + case 2: + /* seen a CRLF at the end, just add the remainder */ + eob = &SMTP_EOB[2]; + break; + case 3: + /* ended with '\r\n.', we should escape the last '.' */ + eob = "." SMTP_EOB; + break; + default: + break; } result = Curl_bufq_cwrite(&ctx->buf, eob, strlen(eob), &n); if(result) @@ -2078,8 +2076,7 @@ static CURLcode cr_eob_add(struct Curl_easy *data) struct Curl_creader *reader = NULL; CURLcode result; - result = Curl_creader_create(&reader, data, &cr_eob, - CURL_CR_CONTENT_ENCODE); + result = Curl_creader_create(&reader, data, &cr_eob, CURL_CR_CONTENT_ENCODE); if(!result) result = Curl_creader_add(data, reader); diff --git a/lib/socketpair.h b/lib/socketpair.h index e601f5f71bee..5387c09340fb 100644 --- a/lib/socketpair.h +++ b/lib/socketpair.h @@ -28,20 +28,20 @@ #ifdef USE_EVENTFD -#define wakeup_write write -#define wakeup_read read -#define wakeup_close close -#define wakeup_create(p,nb) Curl_eventfd(p,nb) +#define wakeup_write write +#define wakeup_read read +#define wakeup_close close +#define wakeup_create(p, nb) Curl_eventfd(p, nb) #include int Curl_eventfd(curl_socket_t socks[2], bool nonblocking); #elif defined(HAVE_PIPE) -#define wakeup_write write -#define wakeup_read read -#define wakeup_close close -#define wakeup_create(p,nb) Curl_pipe(p,nb) +#define wakeup_write write +#define wakeup_read read +#define wakeup_close close +#define wakeup_create(p, nb) Curl_pipe(p, nb) #include int Curl_pipe(curl_socket_t socks[2], bool nonblocking); @@ -67,7 +67,7 @@ int Curl_pipe(curl_socket_t socks[2], bool nonblocking); #endif #define USE_SOCKETPAIR -#define wakeup_create(p,nb) \ +#define wakeup_create(p, nb) \ Curl_socketpair(SOCKETPAIR_FAMILY, SOCKETPAIR_TYPE, 0, p, nb) #endif /* USE_EVENTFD */ diff --git a/lib/socks.c b/lib/socks.c index 7160dd150698..46208506527c 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -164,9 +164,9 @@ CURLcode Curl_blockread_all(struct Curl_cfilter *cf, #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) #define DEBUG_AND_VERBOSE -#define sxstate(x,c,d,y) socksstate(x,c,d,y, __LINE__) +#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__) #else -#define sxstate(x,c,d,y) socksstate(x,c,d,y) +#define sxstate(x, c, d, y) socksstate(x, c, d, y) #endif /* always use this function to change state, to make debugging easier */ @@ -206,9 +206,9 @@ static CURLproxycode socks_failed(struct socks_state *sx, } static CURLproxycode socks_flush(struct socks_state *sx, - struct Curl_cfilter *cf, - struct Curl_easy *data, - bool *done) + struct Curl_cfilter *cf, + struct Curl_easy *data, + bool *done) { CURLcode result; size_t nwritten; @@ -332,8 +332,7 @@ static CURLproxycode socks4_resolving(struct socks_state *sx, result = Curl_resolv(data, sx->hostname, sx->remote_port, cf->conn->ip_version, TRUE, &dns); if(result == CURLE_AGAIN) { - CURL_TRC_CF(data, cf, "SOCKS4 non-blocking resolve of %s", - sx->hostname); + CURL_TRC_CF(data, cf, "SOCKS4 non-blocking resolve of %s", sx->hostname); return CURLPX_OK; } else if(result) @@ -347,8 +346,7 @@ static CURLproxycode socks4_resolving(struct socks_state *sx, } if(result || !dns) { - failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.", - sx->hostname); + failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.", sx->hostname); return CURLPX_RESOLVE_HOST; } @@ -465,16 +463,16 @@ static CURLproxycode socks4_check_resp(struct socks_state *sx, } /* -* This function logs in to a SOCKS4 proxy and sends the specifics to the final -* destination server. -* -* Reference : -* https://www.openssh.com/txt/socks4.protocol -* -* Note : -* Set protocol4a=true for "SOCKS 4A (Simple Extension to SOCKS 4 Protocol)" -* Nonsupport "Identification Protocol (RFC1413)" -*/ + * This function logs in to a SOCKS4 proxy and sends the specifics to the final + * destination server. + * + * Reference : + * https://www.openssh.com/txt/socks4.protocol + * + * Note : + * Set protocol4a=true for "SOCKS 4A (Simple Extension to SOCKS 4 Protocol)" + * Nonsupport "Identification Protocol (RFC1413)" + */ static CURLproxycode socks4_connect(struct Curl_cfilter *cf, struct socks_state *sx, struct Curl_easy *data) @@ -733,7 +731,7 @@ static CURLproxycode socks5_auth_init(struct Curl_cfilter *cf, if(result || (nwritten != ulen)) return CURLPX_SEND_REQUEST; } - buf[0] = (unsigned char) plen; + buf[0] = (unsigned char)plen; result = Curl_bufq_write(&sx->iobuf, buf, 1, &nwritten); if(result || (nwritten != 1)) return CURLPX_SEND_REQUEST; @@ -813,7 +811,7 @@ static CURLproxycode socks5_req1_init(struct socks_state *sx, const size_t hostname_len = strlen(sx->hostname); desttype = 3; destination = (const unsigned char *)sx->hostname; - destlen = (unsigned char) hostname_len; /* one byte length */ + destlen = (unsigned char)hostname_len; /* one byte length */ } req[3] = desttype; @@ -860,8 +858,7 @@ static CURLproxycode socks5_resolving(struct socks_state *sx, result = Curl_resolv(data, sx->hostname, sx->remote_port, cf->conn->ip_version, TRUE, &dns); if(result == CURLE_AGAIN) { - CURL_TRC_CF(data, cf, "SOCKS5 non-blocking resolve of %s", - sx->hostname); + CURL_TRC_CF(data, cf, "SOCKS5 non-blocking resolve of %s", sx->hostname); return CURLPX_OK; } else if(result) @@ -875,8 +872,7 @@ static CURLproxycode socks5_resolving(struct socks_state *sx, } if(result || !dns) { - failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.", - sx->hostname); + failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.", sx->hostname); presult = CURLPX_RESOLVE_HOST; goto out; } @@ -893,8 +889,7 @@ static CURLproxycode socks5_resolving(struct socks_state *sx, } #endif if(!hp) { - failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.", - sx->hostname); + failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.", sx->hostname); presult = CURLPX_RESOLVE_HOST; goto out; } @@ -1394,7 +1389,7 @@ static CURLcode socks_cf_query(struct Curl_cfilter *cf, struct Curl_cftype Curl_cft_socks_proxy = { "SOCKS", - CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, + CF_TYPE_IP_CONNECT | CF_TYPE_PROXY, 0, socks_proxy_cf_destroy, socks_proxy_cf_connect, diff --git a/lib/socks.h b/lib/socks.h index f76bddc5f4e1..eb9088f530c7 100644 --- a/lib/socks.h +++ b/lib/socks.h @@ -27,9 +27,9 @@ #include "curl_setup.h" #ifdef CURL_DISABLE_PROXY -#define Curl_SOCKS4(a,b,c,d,e) CURLE_NOT_BUILT_IN -#define Curl_SOCKS5(a,b,c,d,e,f) CURLE_NOT_BUILT_IN -#define Curl_SOCKS_getsock(x,y,z) 0 +#define Curl_SOCKS4(a, b, c, d, e) CURLE_NOT_BUILT_IN +#define Curl_SOCKS5(a, b, c, d, e, f) CURLE_NOT_BUILT_IN +#define Curl_SOCKS_getsock(x, y, z) 0 #else /* * Helper read-from-socket functions. Does the same as Curl_read() but it diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 6f8a90139ded..3bee643e4108 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -67,8 +67,7 @@ static int check_gss_err(struct Curl_easy *data, GSS_C_NULL_OID, &msg_ctx, &status_string); if(maj_stat == GSS_S_COMPLETE) { - if(curlx_dyn_addn(&dbuf, status_string.value, - status_string.length)) + if(curlx_dyn_addn(&dbuf, status_string.value, status_string.length)) return 1; /* error */ gss_release_buffer(&min_stat, &status_string); break; @@ -85,8 +84,7 @@ static int check_gss_err(struct Curl_easy *data, GSS_C_NULL_OID, &msg_ctx, &status_string); if(maj_stat == GSS_S_COMPLETE) { - if(curlx_dyn_addn(&dbuf, status_string.value, - status_string.length)) + if(curlx_dyn_addn(&dbuf, status_string.value, status_string.length)) return 1; /* error */ gss_release_buffer(&min_stat, &status_string); break; @@ -144,7 +142,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, return CURLE_OUT_OF_MEMORY; gss_major_status = gss_import_name(&gss_minor_status, &service, - (gss_OID) GSS_C_NULL_OID, &server); + (gss_OID)GSS_C_NULL_OID, &server); } else { service.value = curlx_malloc(serviceptr_length + @@ -207,8 +205,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, us_length = htons((unsigned short)gss_send_token.length); memcpy(socksreq + 2, &us_length, sizeof(short)); - code = Curl_conn_cf_send(cf->next, data, socksreq, 4, - FALSE, &nwritten); + code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &nwritten); if(code || (nwritten != 4)) { failf(data, "Failed to send GSS-API authentication request."); gss_release_name(&gss_status, &server); @@ -227,7 +224,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } - } gss_release_buffer(&gss_status, &gss_send_token); diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 92592c5ce007..17e875557eea 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -187,8 +187,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } if(sspi_send_token.cbBuffer) { - socksreq[0] = 1; /* GSS-API subnegotiation version */ - socksreq[1] = 1; /* authentication message type */ + socksreq[0] = 1; /* GSS-API subnegotiation version */ + socksreq[1] = 1; /* authentication message type */ if(sspi_send_token.cbBuffer > 0xffff) { /* needs to fit in an unsigned 16 bit field */ result = CURLE_COULDNT_CONNECT; @@ -305,8 +305,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } /* Do encryption */ - socksreq[0] = 1; /* GSS-API subnegotiation version */ - socksreq[1] = 2; /* encryption message type */ + socksreq[0] = 1; /* GSS-API subnegotiation version */ + socksreq[1] = 2; /* encryption message type */ gss_enc = 0; /* no data protection */ /* do confidentiality protection if supported */ @@ -318,7 +318,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, infof(data, "SOCKS5 server supports GSS-API %s data protection.", (gss_enc == 0) ? "no" : - ((gss_enc == 1) ? "integrity":"confidentiality") ); + ((gss_enc == 1) ? "integrity" : "confidentiality") ); /* * Sending the encryption type in clear seems wrong. It should be @@ -399,7 +399,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } etbuf_size = sspi_w_token[0].cbBuffer + sspi_w_token[1].cbBuffer + - sspi_w_token[2].cbBuffer; + sspi_w_token[2].cbBuffer; if(etbuf_size > 0xffff) { /* needs to fit in an unsigned 16 bit field */ result = CURLE_COULDNT_CONNECT; diff --git a/lib/splay.c b/lib/splay.c index 3ca8678b2b2f..d036d27f548e 100644 --- a/lib/splay.c +++ b/lib/splay.c @@ -34,7 +34,7 @@ * zero : when i is equal to j * positive when : when i is larger than j */ -#define compare(i,j) curlx_timediff_us(i,j) +#define compare(i, j) curlx_timediff_us(i, j) /* * Splay using the key i (which may or may not be in the tree.) The starting @@ -134,7 +134,6 @@ struct Curl_tree *Curl_splayinsert(struct curltime i, node->smaller = t->smaller; node->larger = t; t->smaller = NULL; - } else { node->larger = t->larger; @@ -156,7 +155,7 @@ struct Curl_tree *Curl_splaygetbest(struct curltime i, struct Curl_tree *t, struct Curl_tree **removed) { - static const struct curltime tv_zero = {0, 0}; + static const struct curltime tv_zero = { 0, 0 }; struct Curl_tree *x; if(!t) { @@ -197,7 +196,6 @@ struct Curl_tree *Curl_splaygetbest(struct curltime i, return x; } - /* Deletes the node we point out from the tree if it is there. Stores a * pointer to the new resulting tree in 'newroot'. * diff --git a/lib/strcase.c b/lib/strcase.c index 78d4dc5b3d93..e8424fa61732 100644 --- a/lib/strcase.c +++ b/lib/strcase.c @@ -30,58 +30,60 @@ /* Mapping table to go from lowercase to uppercase for plain ASCII.*/ static const unsigned char touppermap[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255 }; /* Mapping table to go from uppercase to lowercase for plain ASCII.*/ static const unsigned char tolowermap[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255 }; - /* Portable, consistent toupper. Do not use toupper() because its behavior is altered by the current locale. */ char Curl_raw_toupper(char in) { - return (char)touppermap[(unsigned char) in]; + return (char)touppermap[(unsigned char)in]; } - /* Portable, consistent tolower. Do not use tolower() because its behavior is altered by the current locale. */ char Curl_raw_tolower(char in) { - return (char)tolowermap[(unsigned char) in]; + return (char)tolowermap[(unsigned char)in]; } /* Copy an upper case version of the string from src to dest. The @@ -135,7 +137,7 @@ int Curl_timestrcmp(const char *a, const char *b) if(a && b) { while(1) { - match |= a[i]^b[i]; + match |= a[i] ^ b[i]; if(!a[i] || !b[i]) break; i++; diff --git a/lib/strcase.h b/lib/strcase.h index 915c996926d0..56839c2f3eaa 100644 --- a/lib/strcase.h +++ b/lib/strcase.h @@ -31,7 +31,7 @@ char Curl_raw_tolower(char in); /* checkprefix() is a shorter version of the above, used when the first argument is the string literal */ -#define checkprefix(a,b) curl_strnequal(b, STRCONST(a)) +#define checkprefix(a, b) curl_strnequal(b, STRCONST(a)) void Curl_strntoupper(char *dest, const char *src, size_t n); void Curl_strntolower(char *dest, const char *src, size_t n); diff --git a/lib/strdup.h b/lib/strdup.h index 238a2611f645..22ade4d7ffad 100644 --- a/lib/strdup.h +++ b/lib/strdup.h @@ -29,7 +29,7 @@ char *Curl_strdup(const char *str); #endif #ifdef _WIN32 -wchar_t* Curl_wcsdup(const wchar_t* src); +wchar_t *Curl_wcsdup(const wchar_t *src); #endif void *Curl_memdup(const void *src, size_t buffer_length); void *Curl_saferealloc(void *ptr, size_t size); diff --git a/lib/strerror.c b/lib/strerror.c index 4b957bef2312..899db8c61d77 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -34,8 +34,7 @@ #include "curlx/winapi.h" #include "strerror.h" -const char * -curl_easy_strerror(CURLcode error) +const char *curl_easy_strerror(CURLcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch(error) { @@ -53,7 +52,7 @@ curl_easy_strerror(CURLcode error) case CURLE_NOT_BUILT_IN: return "A requested feature, protocol or option was not found built-in in" - " this libcurl due to a build-time decision."; + " this libcurl due to a build-time decision."; case CURLE_COULDNT_RESOLVE_PROXY: return "Could not resolve proxy name"; @@ -327,8 +326,7 @@ curl_easy_strerror(CURLcode error) #endif } -const char * -curl_multi_strerror(CURLMcode error) +const char *curl_multi_strerror(CURLMcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch(error) { @@ -387,8 +385,7 @@ curl_multi_strerror(CURLMcode error) #endif } -const char * -curl_share_strerror(CURLSHcode error) +const char *curl_share_strerror(CURLSHcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch(error) { @@ -423,8 +420,7 @@ curl_share_strerror(CURLSHcode error) #endif } -const char * -curl_url_strerror(CURLUcode error) +const char *curl_url_strerror(CURLUcode error) { #ifndef CURL_DISABLE_VERBOSE_STRINGS switch(error) { @@ -558,96 +554,96 @@ const char *Curl_sspi_strerror(SECURITY_STATUS err, char *buf, size_t buflen) #ifndef CURL_DISABLE_VERBOSE_STRINGS switch(err) { - case SEC_E_OK: - txt = "No error"; - break; + case SEC_E_OK: + txt = "No error"; + break; #define SEC2TXT(sec) case sec: txt = #sec; break - SEC2TXT(CRYPT_E_REVOKED); - SEC2TXT(CRYPT_E_NO_REVOCATION_DLL); - SEC2TXT(CRYPT_E_NO_REVOCATION_CHECK); - SEC2TXT(CRYPT_E_REVOCATION_OFFLINE); - SEC2TXT(CRYPT_E_NOT_IN_REVOCATION_DATABASE); - SEC2TXT(SEC_E_ALGORITHM_MISMATCH); - SEC2TXT(SEC_E_BAD_BINDINGS); - SEC2TXT(SEC_E_BAD_PKGID); - SEC2TXT(SEC_E_BUFFER_TOO_SMALL); - SEC2TXT(SEC_E_CANNOT_INSTALL); - SEC2TXT(SEC_E_CANNOT_PACK); - SEC2TXT(SEC_E_CERT_EXPIRED); - SEC2TXT(SEC_E_CERT_UNKNOWN); - SEC2TXT(SEC_E_CERT_WRONG_USAGE); - SEC2TXT(SEC_E_CONTEXT_EXPIRED); - SEC2TXT(SEC_E_CROSSREALM_DELEGATION_FAILURE); - SEC2TXT(SEC_E_CRYPTO_SYSTEM_INVALID); - SEC2TXT(SEC_E_DECRYPT_FAILURE); - SEC2TXT(SEC_E_DELEGATION_POLICY); - SEC2TXT(SEC_E_DELEGATION_REQUIRED); - SEC2TXT(SEC_E_DOWNGRADE_DETECTED); - SEC2TXT(SEC_E_ENCRYPT_FAILURE); - SEC2TXT(SEC_E_ILLEGAL_MESSAGE); - SEC2TXT(SEC_E_INCOMPLETE_CREDENTIALS); - SEC2TXT(SEC_E_INCOMPLETE_MESSAGE); - SEC2TXT(SEC_E_INSUFFICIENT_MEMORY); - SEC2TXT(SEC_E_INTERNAL_ERROR); - SEC2TXT(SEC_E_INVALID_HANDLE); - SEC2TXT(SEC_E_INVALID_PARAMETER); - SEC2TXT(SEC_E_INVALID_TOKEN); - SEC2TXT(SEC_E_ISSUING_CA_UNTRUSTED); - SEC2TXT(SEC_E_ISSUING_CA_UNTRUSTED_KDC); - SEC2TXT(SEC_E_KDC_CERT_EXPIRED); - SEC2TXT(SEC_E_KDC_CERT_REVOKED); - SEC2TXT(SEC_E_KDC_INVALID_REQUEST); - SEC2TXT(SEC_E_KDC_UNABLE_TO_REFER); - SEC2TXT(SEC_E_KDC_UNKNOWN_ETYPE); - SEC2TXT(SEC_E_LOGON_DENIED); - SEC2TXT(SEC_E_MAX_REFERRALS_EXCEEDED); - SEC2TXT(SEC_E_MESSAGE_ALTERED); - SEC2TXT(SEC_E_MULTIPLE_ACCOUNTS); - SEC2TXT(SEC_E_MUST_BE_KDC); - SEC2TXT(SEC_E_NOT_OWNER); - SEC2TXT(SEC_E_NO_AUTHENTICATING_AUTHORITY); - SEC2TXT(SEC_E_NO_CREDENTIALS); - SEC2TXT(SEC_E_NO_IMPERSONATION); - SEC2TXT(SEC_E_NO_IP_ADDRESSES); - SEC2TXT(SEC_E_NO_KERB_KEY); - SEC2TXT(SEC_E_NO_PA_DATA); - SEC2TXT(SEC_E_NO_S4U_PROT_SUPPORT); - SEC2TXT(SEC_E_NO_TGT_REPLY); - SEC2TXT(SEC_E_OUT_OF_SEQUENCE); - SEC2TXT(SEC_E_PKINIT_CLIENT_FAILURE); - SEC2TXT(SEC_E_PKINIT_NAME_MISMATCH); - SEC2TXT(SEC_E_POLICY_NLTM_ONLY); - SEC2TXT(SEC_E_QOP_NOT_SUPPORTED); - SEC2TXT(SEC_E_REVOCATION_OFFLINE_C); - SEC2TXT(SEC_E_REVOCATION_OFFLINE_KDC); - SEC2TXT(SEC_E_SECPKG_NOT_FOUND); - SEC2TXT(SEC_E_SECURITY_QOS_FAILED); - SEC2TXT(SEC_E_SHUTDOWN_IN_PROGRESS); - SEC2TXT(SEC_E_SMARTCARD_CERT_EXPIRED); - SEC2TXT(SEC_E_SMARTCARD_CERT_REVOKED); - SEC2TXT(SEC_E_SMARTCARD_LOGON_REQUIRED); - SEC2TXT(SEC_E_STRONG_CRYPTO_NOT_SUPPORTED); - SEC2TXT(SEC_E_TARGET_UNKNOWN); - SEC2TXT(SEC_E_TIME_SKEW); - SEC2TXT(SEC_E_TOO_MANY_PRINCIPALS); - SEC2TXT(SEC_E_UNFINISHED_CONTEXT_DELETED); - SEC2TXT(SEC_E_UNKNOWN_CREDENTIALS); - SEC2TXT(SEC_E_UNSUPPORTED_FUNCTION); - SEC2TXT(SEC_E_UNSUPPORTED_PREAUTH); - SEC2TXT(SEC_E_UNTRUSTED_ROOT); - SEC2TXT(SEC_E_WRONG_CREDENTIAL_HANDLE); - SEC2TXT(SEC_E_WRONG_PRINCIPAL); - SEC2TXT(SEC_I_COMPLETE_AND_CONTINUE); - SEC2TXT(SEC_I_COMPLETE_NEEDED); - SEC2TXT(SEC_I_CONTEXT_EXPIRED); - SEC2TXT(SEC_I_CONTINUE_NEEDED); - SEC2TXT(SEC_I_INCOMPLETE_CREDENTIALS); - SEC2TXT(SEC_I_LOCAL_LOGON); - SEC2TXT(SEC_I_NO_LSA_CONTEXT); - SEC2TXT(SEC_I_RENEGOTIATE); - SEC2TXT(SEC_I_SIGNATURE_NEEDED); - default: - txt = "Unknown error"; + SEC2TXT(CRYPT_E_REVOKED); + SEC2TXT(CRYPT_E_NO_REVOCATION_DLL); + SEC2TXT(CRYPT_E_NO_REVOCATION_CHECK); + SEC2TXT(CRYPT_E_REVOCATION_OFFLINE); + SEC2TXT(CRYPT_E_NOT_IN_REVOCATION_DATABASE); + SEC2TXT(SEC_E_ALGORITHM_MISMATCH); + SEC2TXT(SEC_E_BAD_BINDINGS); + SEC2TXT(SEC_E_BAD_PKGID); + SEC2TXT(SEC_E_BUFFER_TOO_SMALL); + SEC2TXT(SEC_E_CANNOT_INSTALL); + SEC2TXT(SEC_E_CANNOT_PACK); + SEC2TXT(SEC_E_CERT_EXPIRED); + SEC2TXT(SEC_E_CERT_UNKNOWN); + SEC2TXT(SEC_E_CERT_WRONG_USAGE); + SEC2TXT(SEC_E_CONTEXT_EXPIRED); + SEC2TXT(SEC_E_CROSSREALM_DELEGATION_FAILURE); + SEC2TXT(SEC_E_CRYPTO_SYSTEM_INVALID); + SEC2TXT(SEC_E_DECRYPT_FAILURE); + SEC2TXT(SEC_E_DELEGATION_POLICY); + SEC2TXT(SEC_E_DELEGATION_REQUIRED); + SEC2TXT(SEC_E_DOWNGRADE_DETECTED); + SEC2TXT(SEC_E_ENCRYPT_FAILURE); + SEC2TXT(SEC_E_ILLEGAL_MESSAGE); + SEC2TXT(SEC_E_INCOMPLETE_CREDENTIALS); + SEC2TXT(SEC_E_INCOMPLETE_MESSAGE); + SEC2TXT(SEC_E_INSUFFICIENT_MEMORY); + SEC2TXT(SEC_E_INTERNAL_ERROR); + SEC2TXT(SEC_E_INVALID_HANDLE); + SEC2TXT(SEC_E_INVALID_PARAMETER); + SEC2TXT(SEC_E_INVALID_TOKEN); + SEC2TXT(SEC_E_ISSUING_CA_UNTRUSTED); + SEC2TXT(SEC_E_ISSUING_CA_UNTRUSTED_KDC); + SEC2TXT(SEC_E_KDC_CERT_EXPIRED); + SEC2TXT(SEC_E_KDC_CERT_REVOKED); + SEC2TXT(SEC_E_KDC_INVALID_REQUEST); + SEC2TXT(SEC_E_KDC_UNABLE_TO_REFER); + SEC2TXT(SEC_E_KDC_UNKNOWN_ETYPE); + SEC2TXT(SEC_E_LOGON_DENIED); + SEC2TXT(SEC_E_MAX_REFERRALS_EXCEEDED); + SEC2TXT(SEC_E_MESSAGE_ALTERED); + SEC2TXT(SEC_E_MULTIPLE_ACCOUNTS); + SEC2TXT(SEC_E_MUST_BE_KDC); + SEC2TXT(SEC_E_NOT_OWNER); + SEC2TXT(SEC_E_NO_AUTHENTICATING_AUTHORITY); + SEC2TXT(SEC_E_NO_CREDENTIALS); + SEC2TXT(SEC_E_NO_IMPERSONATION); + SEC2TXT(SEC_E_NO_IP_ADDRESSES); + SEC2TXT(SEC_E_NO_KERB_KEY); + SEC2TXT(SEC_E_NO_PA_DATA); + SEC2TXT(SEC_E_NO_S4U_PROT_SUPPORT); + SEC2TXT(SEC_E_NO_TGT_REPLY); + SEC2TXT(SEC_E_OUT_OF_SEQUENCE); + SEC2TXT(SEC_E_PKINIT_CLIENT_FAILURE); + SEC2TXT(SEC_E_PKINIT_NAME_MISMATCH); + SEC2TXT(SEC_E_POLICY_NLTM_ONLY); + SEC2TXT(SEC_E_QOP_NOT_SUPPORTED); + SEC2TXT(SEC_E_REVOCATION_OFFLINE_C); + SEC2TXT(SEC_E_REVOCATION_OFFLINE_KDC); + SEC2TXT(SEC_E_SECPKG_NOT_FOUND); + SEC2TXT(SEC_E_SECURITY_QOS_FAILED); + SEC2TXT(SEC_E_SHUTDOWN_IN_PROGRESS); + SEC2TXT(SEC_E_SMARTCARD_CERT_EXPIRED); + SEC2TXT(SEC_E_SMARTCARD_CERT_REVOKED); + SEC2TXT(SEC_E_SMARTCARD_LOGON_REQUIRED); + SEC2TXT(SEC_E_STRONG_CRYPTO_NOT_SUPPORTED); + SEC2TXT(SEC_E_TARGET_UNKNOWN); + SEC2TXT(SEC_E_TIME_SKEW); + SEC2TXT(SEC_E_TOO_MANY_PRINCIPALS); + SEC2TXT(SEC_E_UNFINISHED_CONTEXT_DELETED); + SEC2TXT(SEC_E_UNKNOWN_CREDENTIALS); + SEC2TXT(SEC_E_UNSUPPORTED_FUNCTION); + SEC2TXT(SEC_E_UNSUPPORTED_PREAUTH); + SEC2TXT(SEC_E_UNTRUSTED_ROOT); + SEC2TXT(SEC_E_WRONG_CREDENTIAL_HANDLE); + SEC2TXT(SEC_E_WRONG_PRINCIPAL); + SEC2TXT(SEC_I_COMPLETE_AND_CONTINUE); + SEC2TXT(SEC_I_COMPLETE_NEEDED); + SEC2TXT(SEC_I_CONTEXT_EXPIRED); + SEC2TXT(SEC_I_CONTINUE_NEEDED); + SEC2TXT(SEC_I_INCOMPLETE_CREDENTIALS); + SEC2TXT(SEC_I_LOCAL_LOGON); + SEC2TXT(SEC_I_NO_LSA_CONTEXT); + SEC2TXT(SEC_I_RENEGOTIATE); + SEC2TXT(SEC_I_SIGNATURE_NEEDED); + default: + txt = "Unknown error"; } if(err == SEC_E_ILLEGAL_MESSAGE) { diff --git a/lib/system_win32.c b/lib/system_win32.c index f8a6cbfcccd6..42db33a3edfa 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -70,7 +70,7 @@ CURLcode Curl_win32_init(long flags) /* highest supported version. */ if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) || - HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) { + HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested)) { /* Tell the user that we could not find a usable */ /* winsock.dll. */ diff --git a/lib/telnet.c b/lib/telnet.c index 5319130b90f3..3153a392f679 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -62,27 +62,27 @@ #define SUBBUFSIZE 512 -#define CURL_SB_CLEAR(x) x->subpointer = x->subbuffer -#define CURL_SB_TERM(x) \ - do { \ - x->subend = x->subpointer; \ - CURL_SB_CLEAR(x); \ +#define CURL_SB_CLEAR(x) x->subpointer = x->subbuffer +#define CURL_SB_TERM(x) \ + do { \ + x->subend = x->subpointer; \ + CURL_SB_CLEAR(x); \ } while(0) -#define CURL_SB_ACCUM(x,c) \ - do { \ - if(x->subpointer < (x->subbuffer + sizeof(x->subbuffer))) \ - *x->subpointer++ = (c); \ +#define CURL_SB_ACCUM(x, c) \ + do { \ + if(x->subpointer < (x->subbuffer + sizeof(x->subbuffer))) \ + *x->subpointer++ = (c); \ } while(0) -#define CURL_SB_GET(x) ((*x->subpointer++)&0xff) -#define CURL_SB_LEN(x) (x->subend - x->subpointer) +#define CURL_SB_GET(x) ((*x->subpointer++) & 0xff) +#define CURL_SB_LEN(x) (x->subend - x->subpointer) /* For posterity: #define CURL_SB_PEEK(x) ((*x->subpointer)&0xff) #define CURL_SB_EOF(x) (x->subpointer >= x->subend) */ #ifdef CURL_DISABLE_VERBOSE_STRINGS -#define printoption(a,b,c,d) Curl_nop_stmt +#define printoption(a, b, c, d) Curl_nop_stmt #endif /* For negotiation compliant to RFC 1143 */ @@ -101,8 +101,7 @@ /* * Telnet receiver states for fsm */ -typedef enum -{ +typedef enum { CURL_TS_DATA = 0, CURL_TS_IAC, CURL_TS_WILL, @@ -137,12 +136,12 @@ struct TELNET { unsigned char *subpointer, *subend; /* buffer for sub-options */ }; - -static -CURLcode telrcv(struct Curl_easy *data, - struct TELNET *tn, - const unsigned char *inbuf, /* Data received from socket */ - ssize_t count); /* Number of bytes received */ +static CURLcode telrcv(struct Curl_easy *data, + struct TELNET *tn, + const unsigned char *inbuf, /* Data received from + socket */ + ssize_t count); /* Number of bytes + received */ #ifndef CURL_DISABLE_VERBOSE_STRINGS static void printoption(struct Curl_easy *data, @@ -199,7 +198,6 @@ const struct Curl_handler Curl_handler_telnet = { PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */ }; - static void telnet_easy_dtor(void *key, size_t klen, void *entry) { struct TELNET *tn = entry; @@ -210,8 +208,7 @@ static void telnet_easy_dtor(void *key, size_t klen, void *entry) curlx_free(tn); } -static -CURLcode init_telnet(struct Curl_easy *data) +static CURLcode init_telnet(struct Curl_easy *data) { struct TELNET *tn; @@ -328,15 +325,14 @@ static void send_negotiation(struct Curl_easy *data, int cmd, int option) bytes_written = swrite(conn->sock[FIRSTSOCKET], buf, 3); if(bytes_written < 0) { int err = SOCKERRNO; - failf(data,"Sending data failed (%d)",err); + failf(data, "Sending data failed (%d)", err); } printoption(data, "SENT", cmd, option); } -static -void set_remote_option(struct Curl_easy *data, struct TELNET *tn, - int option, int newstate) +static void set_remote_option(struct Curl_easy *data, struct TELNET *tn, + int option, int newstate) { if(newstate == CURL_YES) { switch(tn->him[option]) { @@ -408,8 +404,7 @@ void set_remote_option(struct Curl_easy *data, struct TELNET *tn, } } -static -void rec_will(struct Curl_easy *data, struct TELNET *tn, int option) +static void rec_will(struct Curl_easy *data, struct TELNET *tn, int option) { switch(tn->him[option]) { case CURL_NO: @@ -455,8 +450,7 @@ void rec_will(struct Curl_easy *data, struct TELNET *tn, int option) } } -static -void rec_wont(struct Curl_easy *data, struct TELNET *tn, int option) +static void rec_wont(struct Curl_easy *data, struct TELNET *tn, int option) { switch(tn->him[option]) { case CURL_NO: @@ -496,9 +490,8 @@ void rec_wont(struct Curl_easy *data, struct TELNET *tn, int option) } } -static void -set_local_option(struct Curl_easy *data, struct TELNET *tn, - int option, int newstate) +static void set_local_option(struct Curl_easy *data, struct TELNET *tn, + int option, int newstate) { if(newstate == CURL_YES) { switch(tn->us[option]) { @@ -570,8 +563,7 @@ set_local_option(struct Curl_easy *data, struct TELNET *tn, } } -static -void rec_do(struct Curl_easy *data, struct TELNET *tn, int option) +static void rec_do(struct Curl_easy *data, struct TELNET *tn, int option) { switch(tn->us[option]) { case CURL_NO: @@ -629,8 +621,7 @@ void rec_do(struct Curl_easy *data, struct TELNET *tn, int option) } } -static -void rec_dont(struct Curl_easy *data, struct TELNET *tn, int option) +static void rec_dont(struct Curl_easy *data, struct TELNET *tn, int option) { switch(tn->us[option]) { case CURL_NO: @@ -670,7 +661,6 @@ void rec_dont(struct Curl_easy *data, struct TELNET *tn, int option) } } - static void printsub(struct Curl_easy *data, int direction, /* '<' or '>' */ unsigned char *pointer, /* where suboption data is */ @@ -683,8 +673,8 @@ static void printsub(struct Curl_easy *data, if(length >= 3) { int j; - i = pointer[length-2]; - j = pointer[length-1]; + i = pointer[length - 2]; + j = pointer[length - 1]; if(i != CURL_IAC || j != CURL_SE) { infof(data, "(terminated by "); @@ -950,77 +940,77 @@ static CURLcode suboption(struct Curl_easy *data, struct TELNET *tn) printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn) + 2); switch(CURL_SB_GET(tn)) { - case CURL_TELOPT_TTYPE: - if(bad_option(tn->subopt_ttype)) - return CURLE_BAD_FUNCTION_ARGUMENT; - if(strlen(tn->subopt_ttype) > 1000) { - failf(data, "Tool long telnet TTYPE"); - return CURLE_SEND_ERROR; - } - len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", - CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE, - CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC, - CURL_SE); - bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); + case CURL_TELOPT_TTYPE: + if(bad_option(tn->subopt_ttype)) + return CURLE_BAD_FUNCTION_ARGUMENT; + if(strlen(tn->subopt_ttype) > 1000) { + failf(data, "Tool long telnet TTYPE"); + return CURLE_SEND_ERROR; + } + len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", + CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE, + CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC, + CURL_SE); + bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); - if(bytes_written < 0) { - err = SOCKERRNO; - failf(data, "Sending data failed (%d)", err); - return CURLE_SEND_ERROR; - } - printsub(data, '>', &temp[2], len-2); - break; - case CURL_TELOPT_XDISPLOC: - if(bad_option(tn->subopt_xdisploc)) + if(bytes_written < 0) { + err = SOCKERRNO; + failf(data, "Sending data failed (%d)", err); + return CURLE_SEND_ERROR; + } + printsub(data, '>', &temp[2], len-2); + break; + case CURL_TELOPT_XDISPLOC: + if(bad_option(tn->subopt_xdisploc)) + return CURLE_BAD_FUNCTION_ARGUMENT; + if(strlen(tn->subopt_xdisploc) > 1000) { + failf(data, "Tool long telnet XDISPLOC"); + return CURLE_SEND_ERROR; + } + len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", + CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC, + CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC, + CURL_SE); + bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); + if(bytes_written < 0) { + err = SOCKERRNO; + failf(data, "Sending data failed (%d)", err); + return CURLE_SEND_ERROR; + } + printsub(data, '>', &temp[2], len - 2); + break; + case CURL_TELOPT_NEW_ENVIRON: + len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c", + CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON, + CURL_TELQUAL_IS); + for(v = tn->telnet_vars; v; v = v->next) { + size_t tmplen = (strlen(v->data) + 1); + if(bad_option(v->data)) return CURLE_BAD_FUNCTION_ARGUMENT; - if(strlen(tn->subopt_xdisploc) > 1000) { - failf(data, "Tool long telnet XDISPLOC"); - return CURLE_SEND_ERROR; - } - len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", - CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC, - CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC, - CURL_SE); - bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); - if(bytes_written < 0) { - err = SOCKERRNO; - failf(data,"Sending data failed (%d)",err); - return CURLE_SEND_ERROR; - } - printsub(data, '>', &temp[2], len-2); - break; - case CURL_TELOPT_NEW_ENVIRON: - len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c", - CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON, - CURL_TELQUAL_IS); - for(v = tn->telnet_vars; v; v = v->next) { - size_t tmplen = (strlen(v->data) + 1); - if(bad_option(v->data)) - return CURLE_BAD_FUNCTION_ARGUMENT; - /* Add the variable if it fits */ - if(len + tmplen < (int)sizeof(temp)-6) { - char *s = strchr(v->data, ','); - if(!s) - len += curl_msnprintf((char *)&temp[len], sizeof(temp) - len, - "%c%s", CURL_NEW_ENV_VAR, v->data); - else { - size_t vlen = s - v->data; - len += curl_msnprintf((char *)&temp[len], sizeof(temp) - len, - "%c%.*s%c%s", CURL_NEW_ENV_VAR, - (int)vlen, v->data, CURL_NEW_ENV_VALUE, ++s); - } + /* Add the variable if it fits */ + if(len + tmplen < (int)sizeof(temp) - 6) { + char *s = strchr(v->data, ','); + if(!s) + len += curl_msnprintf((char *)&temp[len], sizeof(temp) - len, + "%c%s", CURL_NEW_ENV_VAR, v->data); + else { + size_t vlen = s - v->data; + len += curl_msnprintf((char *)&temp[len], sizeof(temp) - len, + "%c%.*s%c%s", CURL_NEW_ENV_VAR, + (int)vlen, v->data, CURL_NEW_ENV_VALUE, ++s); } } - curl_msnprintf((char *)&temp[len], sizeof(temp) - len, - "%c%c", CURL_IAC, CURL_SE); - len += 2; - bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); - if(bytes_written < 0) { - err = SOCKERRNO; - failf(data,"Sending data failed (%d)",err); - } - printsub(data, '>', &temp[2], len-2); - break; + } + curl_msnprintf((char *)&temp[len], sizeof(temp) - len, + "%c%c", CURL_IAC, CURL_SE); + len += 2; + bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); + if(bytes_written < 0) { + err = SOCKERRNO; + failf(data, "Sending data failed (%d)", err); + } + printsub(data, '>', &temp[2], len - 2); + break; } return CURLE_OK; } @@ -1063,7 +1053,7 @@ static void sendsuboption(struct Curl_easy *data, /* data suboption is now ready */ printsub(data, '>', (unsigned char *)tn->subbuffer + 2, - CURL_SB_LEN(tn)-2); + CURL_SB_LEN(tn) - 2); /* we send the header of the suboption... */ bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer, 3); @@ -1084,11 +1074,12 @@ static void sendsuboption(struct Curl_easy *data, } } -static -CURLcode telrcv(struct Curl_easy *data, - struct TELNET *tn, - const unsigned char *inbuf, /* Data received from socket */ - ssize_t count) /* Number of bytes received */ +static CURLcode telrcv(struct Curl_easy *data, + struct TELNET *tn, + const unsigned char *inbuf, /* Data received from + socket */ + ssize_t count) /* Number of bytes + received */ { unsigned char c; CURLcode result; @@ -1106,9 +1097,9 @@ CURLcode telrcv(struct Curl_easy *data, } \ startwrite = -1 -#define writebyte() \ - if(startwrite < 0) \ - startwrite = in +#define writebyte() \ + if(startwrite < 0) \ + startwrite = in #define bufferflush() startskipping() @@ -1170,79 +1161,79 @@ CURLcode telrcv(struct Curl_easy *data, } break; - case CURL_TS_WILL: - printoption(data, "RCVD", CURL_WILL, c); - tn->please_negotiate = 1; - rec_will(data, tn, c); - tn->telrcv_state = CURL_TS_DATA; - break; + case CURL_TS_WILL: + printoption(data, "RCVD", CURL_WILL, c); + tn->please_negotiate = 1; + rec_will(data, tn, c); + tn->telrcv_state = CURL_TS_DATA; + break; - case CURL_TS_WONT: - printoption(data, "RCVD", CURL_WONT, c); - tn->please_negotiate = 1; - rec_wont(data, tn, c); - tn->telrcv_state = CURL_TS_DATA; - break; + case CURL_TS_WONT: + printoption(data, "RCVD", CURL_WONT, c); + tn->please_negotiate = 1; + rec_wont(data, tn, c); + tn->telrcv_state = CURL_TS_DATA; + break; - case CURL_TS_DO: - printoption(data, "RCVD", CURL_DO, c); - tn->please_negotiate = 1; - rec_do(data, tn, c); - tn->telrcv_state = CURL_TS_DATA; - break; + case CURL_TS_DO: + printoption(data, "RCVD", CURL_DO, c); + tn->please_negotiate = 1; + rec_do(data, tn, c); + tn->telrcv_state = CURL_TS_DATA; + break; - case CURL_TS_DONT: - printoption(data, "RCVD", CURL_DONT, c); - tn->please_negotiate = 1; - rec_dont(data, tn, c); - tn->telrcv_state = CURL_TS_DATA; - break; + case CURL_TS_DONT: + printoption(data, "RCVD", CURL_DONT, c); + tn->please_negotiate = 1; + rec_dont(data, tn, c); + tn->telrcv_state = CURL_TS_DATA; + break; - case CURL_TS_SB: - if(c == CURL_IAC) - tn->telrcv_state = CURL_TS_SE; - else - CURL_SB_ACCUM(tn, c); - break; + case CURL_TS_SB: + if(c == CURL_IAC) + tn->telrcv_state = CURL_TS_SE; + else + CURL_SB_ACCUM(tn, c); + break; - case CURL_TS_SE: - if(c != CURL_SE) { - if(c != CURL_IAC) { - /* - * This is an error. We only expect to get "IAC IAC" or "IAC SE". - * Several things may have happened. An IAC was not doubled, the - * IAC SE was left off, or another option got inserted into the - * suboption are all possibilities. If we assume that the IAC was - * not doubled, and really the IAC SE was left off, we could get - * into an infinite loop here. So, instead, we terminate the - * suboption, and process the partial suboption if we can. - */ - CURL_SB_ACCUM(tn, CURL_IAC); - CURL_SB_ACCUM(tn, c); - tn->subpointer -= 2; - CURL_SB_TERM(tn); - - printoption(data, "In SUBOPTION processing, RCVD", CURL_IAC, c); - result = suboption(data, tn); /* handle sub-option */ - if(result) - return result; - tn->telrcv_state = CURL_TS_IAC; - goto process_iac; - } - CURL_SB_ACCUM(tn, c); - tn->telrcv_state = CURL_TS_SB; - } - else { + case CURL_TS_SE: + if(c != CURL_SE) { + if(c != CURL_IAC) { + /* + * This is an error. We only expect to get "IAC IAC" or "IAC SE". + * Several things may have happened. An IAC was not doubled, the + * IAC SE was left off, or another option got inserted into the + * suboption are all possibilities. If we assume that the IAC was + * not doubled, and really the IAC SE was left off, we could get + * into an infinite loop here. So, instead, we terminate the + * suboption, and process the partial suboption if we can. + */ CURL_SB_ACCUM(tn, CURL_IAC); - CURL_SB_ACCUM(tn, CURL_SE); + CURL_SB_ACCUM(tn, c); tn->subpointer -= 2; CURL_SB_TERM(tn); + + printoption(data, "In SUBOPTION processing, RCVD", CURL_IAC, c); result = suboption(data, tn); /* handle sub-option */ if(result) return result; - tn->telrcv_state = CURL_TS_DATA; + tn->telrcv_state = CURL_TS_IAC; + goto process_iac; } - break; + CURL_SB_ACCUM(tn, c); + tn->telrcv_state = CURL_TS_SB; + } + else { + CURL_SB_ACCUM(tn, CURL_IAC); + CURL_SB_ACCUM(tn, CURL_SE); + tn->subpointer -= 2; + CURL_SB_TERM(tn); + result = suboption(data, tn); /* handle sub-option */ + if(result) + return result; + tn->telrcv_state = CURL_TS_DATA; + } + break; } ++in; } @@ -1291,16 +1282,16 @@ static CURLcode send_telnet_data(struct Curl_easy *data, pfd[0].fd = conn->sock[FIRSTSOCKET]; pfd[0].events = POLLOUT; switch(Curl_poll(pfd, 1, -1)) { - case -1: /* error, abort writing */ - case 0: /* timeout (will never happen) */ - result = CURLE_SEND_ERROR; - break; - default: /* write! */ - bytes_written = 0; - result = Curl_xfer_send(data, outbuf + total_written, - outlen - total_written, FALSE, &bytes_written); - total_written += bytes_written; - break; + case -1: /* error, abort writing */ + case 0: /* timeout (will never happen) */ + result = CURLE_SEND_ERROR; + break; + default: /* write! */ + bytes_written = 0; + result = Curl_xfer_send(data, outbuf + total_written, + outlen - total_written, FALSE, &bytes_written); + total_written += bytes_written; + break; } } @@ -1326,8 +1317,8 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) WSANETWORKEVENTS events; HANDLE stdin_handle; HANDLE objs[2]; - DWORD obj_count; - DWORD wait_timeout; + DWORD obj_count; + DWORD wait_timeout; DWORD readfile_read; int err; #else @@ -1340,7 +1331,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) #endif struct curltime now; bool keepon = TRUE; - char buffer[4*1024]; + char buffer[4 * 1024]; struct TELNET *tn; *done = TRUE; /* unconditionally */ @@ -1371,7 +1362,8 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } /* Tell Winsock what events we want to listen to */ - if(WSAEventSelect(sockfd, event_handle, FD_READ|FD_CLOSE) == SOCKET_ERROR) { + if(WSAEventSelect(sockfd, event_handle, FD_READ | FD_CLOSE) == + SOCKET_ERROR) { WSACloseEvent(event_handle); return CURLE_RECV_ERROR; } @@ -1385,8 +1377,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) /* If stdin_handle is a pipe, use PeekNamedPipe() method to check it, else use the old WaitForMultipleObjects() way */ - if(GetFileType(stdin_handle) == FILE_TYPE_PIPE || - data->set.is_fread_set) { + if(GetFileType(stdin_handle) == FILE_TYPE_PIPE || data->set.is_fread_set) { /* Do not wait for stdin_handle, just wait for event_handle */ obj_count = 1; /* Check stdin_handle per 100 milliseconds */ @@ -1404,8 +1395,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) FALSE, wait_timeout); switch(waitret) { - case WAIT_TIMEOUT: - { + case WAIT_TIMEOUT: { for(;;) { if(data->set.is_fread_set) { size_t n; @@ -1438,8 +1428,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) if(!readfile_read) break; - if(!ReadFile(stdin_handle, buffer, buf_size, - &readfile_read, NULL)) { + if(!ReadFile(stdin_handle, buffer, buf_size, &readfile_read, NULL)) { keepon = FALSE; result = CURLE_READ_ERROR; break; @@ -1455,10 +1444,8 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } break; - case WAIT_OBJECT_0 + 1: - { - if(!ReadFile(stdin_handle, buffer, buf_size, - &readfile_read, NULL)) { + case WAIT_OBJECT_0 + 1: { + if(!ReadFile(stdin_handle, buffer, buf_size, &readfile_read, NULL)) { keepon = FALSE; result = CURLE_READ_ERROR; break; @@ -1472,8 +1459,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } break; - case WAIT_OBJECT_0: - { + case WAIT_OBJECT_0: { events.lNetworkEvents = 0; if(WSAEnumNetworkEvents(sockfd, event_handle, &events) == SOCKET_ERROR) { err = SOCKERRNO; @@ -1503,7 +1489,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) break; } - result = telrcv(data, tn, (unsigned char *) buffer, nread); + result = telrcv(data, tn, (unsigned char *)buffer, nread); if(result) { keepon = FALSE; break; @@ -1520,10 +1506,9 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) if(events.lNetworkEvents & FD_CLOSE) { keepon = FALSE; } + break; } - break; - - } + } /* switch */ if(data->set.timeout) { now = curlx_now(); @@ -1622,7 +1607,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) else { /* read from user-supplied method */ snread = (int)data->state.fread_func(buffer, 1, sizeof(buffer), - data->state.in); + data->state.in); if(snread == CURL_READFUNC_ABORT) { keepon = FALSE; break; diff --git a/lib/tftp.c b/lib/tftp.c index 5311a4c683a2..58e9696fb2c2 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -66,7 +66,7 @@ /* RFC2348 allows the block size to be negotiated */ #define TFTP_BLKSIZE_DEFAULT 512 -#define TFTP_OPTION_BLKSIZE "blksize" +#define TFTP_OPTION_BLKSIZE "blksize" /* from RFC2349: */ #define TFTP_OPTION_TSIZE "tsize" @@ -159,7 +159,6 @@ static CURLcode tftp_pollset(struct Curl_easy *data, struct easy_pollset *ps); static CURLcode tftp_translate_code(tftp_error_t error); - /* * TFTP protocol handler. */ @@ -221,7 +220,7 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state) timeout = 15; /* Average reposting an ACK after 5 seconds */ - state->retry_max = (int)timeout/5; + state->retry_max = (int)timeout / 5; /* But bound the total number */ if(state->retry_max < 3) @@ -231,7 +230,7 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state) state->retry_max = 50; /* Compute the re-ACK interval to suit the timeout */ - state->retry_time = (int)(timeout/state->retry_max); + state->retry_time = (int)(timeout / state->retry_max); if(state->retry_time < 1) state->retry_time = 1; @@ -259,7 +258,6 @@ static void setpacketevent(struct tftp_packet *packet, unsigned short num) packet->data[1] = (unsigned char)(num & 0xff); } - static void setpacketblock(struct tftp_packet *packet, unsigned short num) { packet->data[2] = (unsigned char)(num >> 8); @@ -279,7 +277,7 @@ static unsigned short getrpacketblock(const struct tftp_packet *packet) static size_t tftp_strnlen(const char *string, size_t maxlen) { const char *end = memchr(string, '\0', maxlen); - return end ? (size_t) (end - string) : maxlen; + return end ? (size_t)(end - string) : maxlen; } static const char *tftp_option_get(const char *buf, size_t len, @@ -294,7 +292,7 @@ static const char *tftp_option_get(const char *buf, size_t len, return NULL; *option = buf; - loc += tftp_strnlen(buf + loc, len-loc); + loc += tftp_strnlen(buf + loc, len - loc); loc++; /* NULL term */ if(loc > len) @@ -570,7 +568,7 @@ static CURLcode tftp_send_first(struct tftp_conn *state, /* the next blocknum is x + 1 but it needs to wrap at an unsigned 16bit boundary */ -#define NEXT_BLOCKNUM(x) (((x) + 1)&0xffff) +#define NEXT_BLOCKNUM(x) (((x) + 1) & 0xffff) /********************************************************** * @@ -784,7 +782,7 @@ static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event) bufptr += cb; } while(state->sbytes < state->blksize && cb); - sbytes = sendto(state->sockfd, (void *) state->spacket.data, + sbytes = sendto(state->sockfd, (void *)state->spacket.data, 4 + (SEND_TYPE_ARG3)state->sbytes, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); @@ -1136,15 +1134,14 @@ static CURLcode tftp_receive_packet(struct Curl_easy *data, (NEXT_BLOCKNUM(state->block) == getrpacketblock(&state->rpacket))) { result = Curl_client_write(data, CLIENTWRITE_BODY, (char *)state->rpacket.data + 4, - state->rbytes-4); + state->rbytes - 4); if(result) { tftp_state_machine(state, TFTP_EVENT_ERROR); return result; } } break; - case TFTP_EVENT_ERROR: - { + case TFTP_EVENT_ERROR: { unsigned short error = getrpacketblock(&state->rpacket); char *str = (char *)state->rpacket.data + 4; size_t strn = state->rbytes - 4; @@ -1328,7 +1325,6 @@ static CURLcode tftp_perform(struct Curl_easy *data, bool *dophase_done) return result; } - /********************************************************** * * tftp_do diff --git a/lib/transfer.c b/lib/transfer.c index d8a0d6c0ba2e..a8a66f86c7b9 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -82,7 +82,7 @@ #include "curlx/warnless.h" #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ - !defined(CURL_DISABLE_IMAP) + !defined(CURL_DISABLE_IMAP) /* * checkheaders() checks the linked list of custom headers for a * particular header (prefix). Provide the prefix without colon! @@ -95,11 +95,11 @@ char *Curl_checkheaders(const struct Curl_easy *data, { struct curl_slist *head; DEBUGASSERT(thislen); - DEBUGASSERT(thisheader[thislen-1] != ':'); + DEBUGASSERT(thisheader[thislen - 1] != ':'); for(head = data->set.headers; head; head = head->next) { if(curl_strnequal(head->data, thisheader, thislen) && - Curl_headersep(head->data[thislen]) ) + Curl_headersep(head->data[thislen])) return head->data; } @@ -111,13 +111,13 @@ static int data_pending(struct Curl_easy *data, bool rcvd_eagain) { struct connectdata *conn = data->conn; - if(conn->handler->protocol&PROTO_FAMILY_FTP) + if(conn->handler->protocol & PROTO_FAMILY_FTP) return Curl_conn_data_pending(data, SECONDARYSOCKET); /* in the case of libssh2, we can never be really sure that we have emptied its internal buffers so we MUST always try until we get EAGAIN back */ return (!rcvd_eagain && - conn->handler->protocol&(CURLPROTO_SCP|CURLPROTO_SFTP)) || + conn->handler->protocol & (CURLPROTO_SCP | CURLPROTO_SFTP)) || Curl_conn_data_pending(data, FIRSTSOCKET); } @@ -329,7 +329,7 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, CURL_TRC_M(data, "sendrecv_dl() no EAGAIN/pending data, mark as dirty"); } - if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) && + if(((k->keepon & (KEEP_RECV | KEEP_SEND)) == KEEP_SEND) && (conn->bits.close || is_multiplex)) { /* When we have read the entire thing and the close bit is set, the server may now close the connection. If there is now any kind of sending going @@ -428,7 +428,7 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp) } /* If there is nothing more to send/recv, the request is done */ - if((k->keepon & (KEEP_RECV|KEEP_SEND)) == 0) + if((k->keepon & (KEEP_RECV | KEEP_SEND)) == 0) data->req.done = TRUE; result = Curl_pgrsUpdate(data); @@ -636,7 +636,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) protocol is HTTP as when uploading over HTTP we will still get a response */ if(data->state.upload && - !(conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_RTSP))) + !(conn->handler->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_RTSP))) return CURLE_OK; if(conn->bits.reuse && @@ -656,7 +656,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) it again. Bad luck. Retry the same request on a fresh connect! */ retry = TRUE; else if(data->state.refused_stream && - (data->req.bytecount + data->req.headerbytecount == 0) ) { + (data->req.bytecount + data->req.headerbytecount == 0)) { /* This was sent on a refused stream, safe to rerun. A refused stream error can typically only happen on HTTP/2 level if the stream is safe to issue again, but the nghttp2 API can deliver the message to other diff --git a/lib/transfer.h b/lib/transfer.h index b96629d97968..3da5e2445139 100644 --- a/lib/transfer.h +++ b/lib/transfer.h @@ -24,7 +24,8 @@ * ***************************************************************************/ -#define Curl_headersep(x) ((((x)==':') || ((x)==';'))) +#define Curl_headersep(x) ((((x) == ':') || ((x) == ';'))) + char *Curl_checkheaders(const struct Curl_easy *data, const char *thisheader, const size_t thislen); diff --git a/lib/uint-bset.c b/lib/uint-bset.c index dcad94e42a6e..d41d982b3a23 100644 --- a/lib/uint-bset.c +++ b/lib/uint-bset.c @@ -37,10 +37,9 @@ void Curl_uint32_bset_init(struct uint32_bset *bset) #endif } - CURLcode Curl_uint32_bset_resize(struct uint32_bset *bset, uint32_t nmax) { - uint32_t nslots = (nmax < (UINT32_MAX-63)) ? + uint32_t nslots = (nmax < (UINT32_MAX - 63)) ? ((nmax + 63) / 64) : (UINT32_MAX / 64); DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC); @@ -61,7 +60,6 @@ CURLcode Curl_uint32_bset_resize(struct uint32_bset *bset, uint32_t nmax) return CURLE_OK; } - void Curl_uint32_bset_destroy(struct uint32_bset *bset) { DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC); @@ -97,7 +95,6 @@ bool Curl_uint32_bset_empty(struct uint32_bset *bset) return TRUE; } - void Curl_uint32_bset_clear(struct uint32_bset *bset) { if(bset->nslots) { @@ -106,7 +103,6 @@ void Curl_uint32_bset_clear(struct uint32_bset *bset) } } - bool Curl_uint32_bset_add(struct uint32_bset *bset, uint32_t i) { uint32_t islot = i / 64; @@ -118,7 +114,6 @@ bool Curl_uint32_bset_add(struct uint32_bset *bset, uint32_t i) return TRUE; } - void Curl_uint32_bset_remove(struct uint32_bset *bset, uint32_t i) { size_t islot = i / 64; @@ -126,7 +121,6 @@ void Curl_uint32_bset_remove(struct uint32_bset *bset, uint32_t i) bset->slots[islot] &= ~((uint64_t)1 << (i % 64)); } - bool Curl_uint32_bset_contains(struct uint32_bset *bset, uint32_t i) { uint32_t islot = i / 64; @@ -135,7 +129,6 @@ bool Curl_uint32_bset_contains(struct uint32_bset *bset, uint32_t i) return (bset->slots[islot] & ((uint64_t)1 << (i % 64))) != 0; } - bool Curl_uint32_bset_first(struct uint32_bset *bset, uint32_t *pfirst) { uint32_t i; @@ -198,7 +191,6 @@ uint32_t Curl_popcount64(uint64_t x) } #endif /* CURL_POPCOUNT64_IMPLEMENT */ - #ifdef CURL_CTZ64_IMPLEMENT uint32_t Curl_ctz64(uint64_t x) { diff --git a/lib/uint-bset.h b/lib/uint-bset.h index 5e5bbdb8fc0b..ff814bb5e6ad 100644 --- a/lib/uint-bset.h +++ b/lib/uint-bset.h @@ -99,9 +99,8 @@ bool Curl_uint32_bset_first(struct uint32_bset *bset, uint32_t *pfirst); bool Curl_uint32_bset_next(struct uint32_bset *bset, uint32_t last, uint32_t *pnext); - #ifndef CURL_POPCOUNT64 -#define CURL_POPCOUNT64(x) Curl_popcount64(x) +#define CURL_POPCOUNT64(x) Curl_popcount64(x) #define CURL_POPCOUNT64_IMPLEMENT uint32_t Curl_popcount64(uint64_t x); #endif /* !CURL_POPCOUNT64 */ diff --git a/lib/uint-hash.c b/lib/uint-hash.c index 166a9ab99ba5..43de42a19c8b 100644 --- a/lib/uint-hash.c +++ b/lib/uint-hash.c @@ -38,10 +38,9 @@ static uint32_t uint32_hash_hash(uint32_t id, uint32_t slots) return (id % slots); } - struct uint_hash_entry { struct uint_hash_entry *next; - void *value; + void *value; uint32_t id; }; @@ -111,8 +110,8 @@ static void uint32_hash_elem_link(struct uint_hash *h, ++h->size; } -#define CURL_UINT32_HASH_SLOT(h,id) h->table[uint32_hash_hash(id, h->slots)] -#define CURL_UINT32_HASH_SLOT_ADDR(h,id) &CURL_UINT32_HASH_SLOT(h,id) +#define CURL_UINT32_HASH_SLOT(h, id) h->table[uint32_hash_hash(id, h->slots)] +#define CURL_UINT32_HASH_SLOT_ADDR(h, id) &CURL_UINT32_HASH_SLOT(h, id) bool Curl_uint32_hash_set(struct uint_hash *h, uint32_t id, void *value) { diff --git a/lib/uint-hash.h b/lib/uint-hash.h index 330f61208bfa..3e09a6234821 100644 --- a/lib/uint-hash.h +++ b/lib/uint-hash.h @@ -45,7 +45,6 @@ struct uint_hash { #endif }; - void Curl_uint32_hash_init(struct uint_hash *h, uint32_t slots, Curl_uint32_hash_dtor *dtor); @@ -57,7 +56,6 @@ bool Curl_uint32_hash_remove(struct uint_hash *h, uint32_t id); void *Curl_uint32_hash_get(struct uint_hash *h, uint32_t id); uint32_t Curl_uint32_hash_count(struct uint_hash *h); - typedef bool Curl_uint32_hash_visit_cb(uint32_t id, void *value, void *user_data); diff --git a/lib/uint-spbset.c b/lib/uint-spbset.c index c726bfb900c1..84a893e85f5a 100644 --- a/lib/uint-spbset.c +++ b/lib/uint-spbset.c @@ -86,7 +86,6 @@ UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset) 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) { @@ -129,7 +128,6 @@ uint32_spbset_get_chunk(struct uint32_spbset *bset, uint32_t i, bool grow) return chunk; } - bool Curl_uint32_spbset_add(struct uint32_spbset *bset, uint32_t i) { struct uint32_spbset_chunk *chunk; @@ -146,7 +144,6 @@ bool Curl_uint32_spbset_add(struct uint32_spbset *bset, uint32_t i) return TRUE; } - void Curl_uint32_spbset_remove(struct uint32_spbset *bset, uint32_t i) { struct uint32_spbset_chunk *chunk; @@ -161,7 +158,6 @@ void Curl_uint32_spbset_remove(struct uint32_spbset *bset, uint32_t i) } } - bool Curl_uint32_spbset_contains(struct uint32_spbset *bset, uint32_t i) { struct uint32_spbset_chunk *chunk; @@ -195,7 +191,6 @@ bool Curl_uint32_spbset_first(struct uint32_spbset *bset, uint32_t *pfirst) return FALSE; } - static bool uint32_spbset_chunk_first(struct uint32_spbset_chunk *chunk, uint32_t *pfirst) { @@ -210,7 +205,6 @@ static bool uint32_spbset_chunk_first(struct uint32_spbset_chunk *chunk, return FALSE; } - static bool uint32_spbset_chunk_next(struct uint32_spbset_chunk *chunk, uint32_t last, uint32_t *pnext) diff --git a/lib/uint-table.c b/lib/uint-table.c index 05b53766f30a..b4d5d94a3a36 100644 --- a/lib/uint-table.c +++ b/lib/uint-table.c @@ -43,7 +43,6 @@ void Curl_uint32_tbl_init(struct uint32_tbl *tbl, #endif } - static void uint32_tbl_clear_rows(struct uint32_tbl *tbl, uint32_t from, uint32_t upto_excluding) @@ -61,7 +60,6 @@ static void uint32_tbl_clear_rows(struct uint32_tbl *tbl, } } - CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nrows) { /* we use `tbl->nrows + 1` during iteration, want that to work */ @@ -84,7 +82,6 @@ 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); @@ -101,25 +98,21 @@ UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl) tbl->last_key_added = UINT32_MAX; } - uint32_t Curl_uint32_tbl_capacity(struct uint32_tbl *tbl) { return tbl->nrows; } - uint32_t Curl_uint32_tbl_count(struct uint32_tbl *tbl) { return tbl->nentries; } - void *Curl_uint32_tbl_get(struct uint32_tbl *tbl, uint32_t key) { return (key < tbl->nrows) ? tbl->rows[key] : NULL; } - bool Curl_uint32_tbl_add(struct uint32_tbl *tbl, void *entry, uint32_t *pkey) { uint32_t key, start_pos; @@ -156,19 +149,16 @@ bool Curl_uint32_tbl_add(struct uint32_tbl *tbl, void *entry, uint32_t *pkey) return FALSE; } - void Curl_uint32_tbl_remove(struct uint32_tbl *tbl, uint32_t key) { uint32_tbl_clear_rows(tbl, key, key + 1); } - bool Curl_uint32_tbl_contains(struct uint32_tbl *tbl, uint32_t key) { return (key < tbl->nrows) ? !!tbl->rows[key] : FALSE; } - static bool uint32_tbl_next_at(struct uint32_tbl *tbl, uint32_t key, uint32_t *pkey, void **pentry) { @@ -197,7 +187,6 @@ bool Curl_uint32_tbl_first(struct uint32_tbl *tbl, return FALSE; } - bool Curl_uint32_tbl_next(struct uint32_tbl *tbl, uint32_t last_key, uint32_t *pkey, void **pentry) { diff --git a/lib/url.c b/lib/url.c index 84909f037238..f646b74ed4a7 100644 --- a/lib/url.c +++ b/lib/url.c @@ -148,16 +148,16 @@ static void data_priority_cleanup(struct Curl_easy *data); #define MAX_URL_LEN 0xffff /* -* get_protocol_family() -* -* This is used to return the protocol family for a given protocol. -* -* Parameters: -* -* 'h' [in] - struct Curl_handler pointer. -* -* Returns the family as a single bit protocol identifier. -*/ + * get_protocol_family() + * + * This is used to return the protocol family for a given protocol. + * + * Parameters: + * + * 'h' [in] - struct Curl_handler pointer. + * + * Returns the family as a single bit protocol identifier. + */ static curl_prot_t get_protocol_family(const struct Curl_handler *h) { DEBUGASSERT(h); @@ -460,8 +460,7 @@ void Curl_init_userdefined(struct Curl_easy *data) set->conn_max_idle_ms = 118 * 1000; set->conn_max_age_ms = 24 * 3600 * 1000; set->http09_allowed = FALSE; - set->httpwant = CURL_HTTP_VERSION_NONE - ; + set->httpwant = CURL_HTTP_VERSION_NONE; #if defined(USE_HTTP2) || defined(USE_HTTP3) memset(&set->priority, 0, sizeof(set->priority)); #endif @@ -592,7 +591,7 @@ static bool xfer_may_multiplex(const struct Curl_easy *data, (!conn->bits.protoconnstart || !conn->bits.close)) { if(Curl_multiplex_wanted(data->multi) && - (data->state.http_neg.allowed & (CURL_HTTP_V2x|CURL_HTTP_V3x))) + (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x))) /* allows HTTP/2 or newer */ return TRUE; } @@ -604,9 +603,8 @@ static bool xfer_may_multiplex(const struct Curl_easy *data, } #ifndef CURL_DISABLE_PROXY -static bool -proxy_info_matches(const struct proxy_info *data, - const struct proxy_info *needle) +static bool proxy_info_matches(const struct proxy_info *data, + const struct proxy_info *needle) { if((data->proxytype == needle->proxytype) && (data->port == needle->port) && @@ -616,9 +614,8 @@ proxy_info_matches(const struct proxy_info *data, return FALSE; } -static bool -socks_proxy_info_matches(const struct proxy_info *data, - const struct proxy_info *needle) +static bool socks_proxy_info_matches(const struct proxy_info *data, + const struct proxy_info *needle) { if(!proxy_info_matches(data, needle)) return FALSE; @@ -636,8 +633,8 @@ socks_proxy_info_matches(const struct proxy_info *data, } #else /* disabled, will not get called */ -#define proxy_info_matches(x,y) FALSE -#define socks_proxy_info_matches(x,y) FALSE +#define proxy_info_matches(x, y) FALSE +#define socks_proxy_info_matches(x, y) FALSE #endif /* A connection has to have been idle for less than 'conn_max_idle_ms' @@ -708,7 +705,6 @@ bool Curl_conn_seems_dead(struct connectdata *conn, dead = (state & CONNRESULT_DEAD); /* detach the connection again */ Curl_detach_connection(data); - } else { bool input_pending = FALSE; @@ -803,8 +799,8 @@ static bool url_match_connect_config(struct connectdata *conn, return FALSE; /* ip_version must match */ - if(m->data->set.ipver != CURL_IPRESOLVE_WHATEVER - && m->data->set.ipver != conn->ip_version) + if(m->data->set.ipver != CURL_IPRESOLVE_WHATEVER && + m->data->set.ipver != conn->ip_version) return FALSE; if(m->needle->localdev || m->needle->localport) { @@ -913,7 +909,7 @@ static bool url_match_multiplex_limits(struct connectdata *conn, return FALSE; } if(CONN_ATTACHED(conn) >= - Curl_conn_get_max_concurrent(m->data, conn, FIRSTSOCKET)) { + Curl_conn_get_max_concurrent(m->data, conn, FIRSTSOCKET)) { infof(m->data, "MAX_CONCURRENT_STREAMS reached, skip (%u)", CONN_ATTACHED(conn)); return FALSE; @@ -951,8 +947,7 @@ static bool url_match_proxy_use(struct connectdata *conn, return FALSE; if(m->needle->bits.socksproxy && - !socks_proxy_info_matches(&m->needle->socks_proxy, - &conn->socks_proxy)) + !socks_proxy_info_matches(&m->needle->socks_proxy, &conn->socks_proxy)) return FALSE; if(m->needle->bits.httpproxy) { @@ -969,9 +964,9 @@ static bool url_match_proxy_use(struct connectdata *conn, /* match SSL config to proxy */ if(!Curl_ssl_conn_config_match(m->data, conn, TRUE)) { DEBUGF(infof(m->data, - "Connection #%" FMT_OFF_T - " has different SSL proxy parameters, cannot reuse", - conn->connection_id)); + "Connection #%" FMT_OFF_T + " has different SSL proxy parameters, cannot reuse", + conn->connection_id)); return FALSE; } /* the SSL config to the server, which may apply here is checked @@ -981,7 +976,7 @@ static bool url_match_proxy_use(struct connectdata *conn, return TRUE; } #else -#define url_match_proxy_use(c,m) ((void)c, (void)m, TRUE) +#define url_match_proxy_use(c, m) ((void)c, (void)m, TRUE) #endif #ifndef CURL_DISABLE_HTTP @@ -989,7 +984,7 @@ static bool url_match_http_multiplex(struct connectdata *conn, struct url_conn_match *m) { if(m->may_multiplex && - (m->data->state.http_neg.allowed & (CURL_HTTP_V2x|CURL_HTTP_V3x)) && + (m->data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)) && (m->needle->handler->protocol & CURLPROTO_HTTP) && !conn->httpversion_seen) { if(m->data->set.pipewait) { @@ -1037,8 +1032,8 @@ static bool url_match_http_version(struct connectdata *conn, return TRUE; } #else -#define url_match_http_multiplex(c,m) ((void)c, (void)m, TRUE) -#define url_match_http_version(c,m) ((void)c, (void)m, TRUE) +#define url_match_http_multiplex(c, m) ((void)c, (void)m, TRUE) +#define url_match_http_version(c, m) ((void)c, (void)m, TRUE) #endif static bool url_match_proto_config(struct connectdata *conn, @@ -1091,7 +1086,7 @@ static bool url_match_destination(struct connectdata *conn, { /* Additional match requirements if talking TLS OR * not talking to an HTTP proxy OR using a tunnel through a proxy */ - if((m->needle->handler->flags&PROTOPT_SSL) + if((m->needle->handler->flags & PROTOPT_SSL) #ifndef CURL_DISABLE_PROXY || !m->needle->bits.httpproxy || m->needle->bits.tunnel_proxy #endif @@ -1116,7 +1111,7 @@ static bool url_match_destination(struct connectdata *conn, if((m->needle->bits.conn_to_host && !curl_strequal( m->needle->conn_to_host.name, conn->conn_to_host.name)) || (m->needle->bits.conn_to_port && - m->needle->conn_to_port != conn->conn_to_port)) + m->needle->conn_to_port != conn->conn_to_port)) return FALSE; /* hostname and port must match */ @@ -1207,7 +1202,7 @@ static bool url_match_auth_ntlm(struct connectdata *conn, return TRUE; } #else -#define url_match_auth_ntlm(c,m) ((void)c, (void)m, TRUE) +#define url_match_auth_ntlm(c, m) ((void)c, (void)m, TRUE) #endif static bool url_match_conn(struct connectdata *conn, void *userdata) @@ -1303,12 +1298,11 @@ static bool url_match_result(bool result, void *userdata) * * The force_reuse flag is set if the connection must be used. */ -static bool -ConnectionExists(struct Curl_easy *data, - struct connectdata *needle, - struct connectdata **usethis, - bool *force_reuse, - bool *waitpipe) +static bool ConnectionExists(struct Curl_easy *data, + struct connectdata *needle, + struct connectdata **usethis, + bool *force_reuse, + bool *waitpipe) { struct url_conn_match match; bool result; @@ -1676,12 +1670,11 @@ static CURLcode findprotocol(struct Curl_easy *data, create_conn() function when the connectdata struct is allocated. */ failf(data, "Protocol \"%s\" %s%s", protostr, p ? "disabled" : "not supported", - data->state.this_is_a_follow ? " (in redirect)":""); + data->state.this_is_a_follow ? " (in redirect)" : ""); return CURLE_UNSUPPORTED_PROTOCOL; } - CURLcode Curl_uc_to_curlcode(CURLUcode uc) { switch(uc) { @@ -1747,7 +1740,7 @@ static void zonefrom_url(CURLU *uh, struct Curl_easy *data, } } #else -#define zonefrom_url(a,b,c) Curl_nop_stmt +#define zonefrom_url(a, b, c) Curl_nop_stmt #endif /* @@ -1940,8 +1933,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, else if(uc != CURLUE_NO_OPTIONS) return Curl_uc_to_curlcode(uc); - uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, - CURLU_URLENCODE); + uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, CURLU_URLENCODE); if(uc) return Curl_uc_to_curlcode(uc); @@ -1978,7 +1970,6 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, return CURLE_OK; } - /* * If we are doing a resumed transfer, we need to setup our stuff * properly. @@ -2010,7 +2001,6 @@ static CURLcode setup_range(struct Curl_easy *data) return CURLE_OK; } - /* * setup_connection_internals() - * @@ -2066,15 +2056,14 @@ static CURLcode setup_connection_internals(struct Curl_easy *data, return CURLE_OK; } - #ifndef CURL_DISABLE_PROXY #ifndef CURL_DISABLE_HTTP /**************************************************************** -* Detect what (if any) proxy to use. Remember that this selects a host -* name and is not limited to HTTP proxies only. -* The returned pointer must be freed by the caller (unless NULL) -****************************************************************/ + * Detect what (if any) proxy to use. Remember that this selects a host + * name and is not limited to HTTP proxies only. + * The returned pointer must be freed by the caller (unless NULL) + ****************************************************************/ static char *detect_proxy(struct Curl_easy *data, struct connectdata *conn) { @@ -2189,7 +2178,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, /* When parsing the proxy, allowing non-supported schemes since we have these made up ones for proxies. Guess scheme for URLs without it. */ uc = curl_url_set(uhp, CURLUPART_URL, proxy, - CURLU_NON_SUPPORT_SCHEME|CURLU_GUESS_SCHEME); + CURLU_NON_SUPPORT_SCHEME | CURLU_GUESS_SCHEME); if(!uc) { /* parsed okay as a URL */ uc = curl_url_get(uhp, CURLUPART_SCHEME, &scheme, 0); @@ -2327,7 +2316,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, if(strcmp("/", path)) { is_unix_proxy = TRUE; curlx_free(host); - host = curl_maprintf(UNIX_SOCKET_PREFIX"%s", path); + host = curl_maprintf(UNIX_SOCKET_PREFIX "%s", path); if(!host) { result = CURLE_OUT_OF_MEMORY; goto error; @@ -2346,7 +2335,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, if(host[0] == '[') { /* this is a numerical IPv6, strip off the brackets */ size_t len = strlen(host); - host[len-1] = 0; /* clear the trailing bracket */ + host[len - 1] = 0; /* clear the trailing bracket */ host++; zonefrom_url(uhp, data, conn); } @@ -2753,7 +2742,7 @@ static CURLcode override_login(struct Curl_easy *data, return CURLE_READ_ERROR; } else { - if(!(conn->handler->flags&PROTOPT_USERPWDCTRL)) { + if(!(conn->handler->flags & PROTOPT_USERPWDCTRL)) { /* if the protocol cannot handle control codes in credentials, make sure there are none */ if(str_has_ctrl(*userp) || str_has_ctrl(*passwdp)) { @@ -3475,7 +3464,7 @@ static CURLcode create_conn(struct Curl_easy *data, * If the protocol is using SSL and HTTP proxy is used, we set * the tunnel_proxy bit. *************************************************************/ - if((conn->given->flags&PROTOPT_SSL) && conn->bits.httpproxy) + if((conn->given->flags & PROTOPT_SSL) && conn->bits.httpproxy) conn->bits.tunnel_proxy = TRUE; #endif @@ -3548,7 +3537,7 @@ static CURLcode create_conn(struct Curl_easy *data, * we set the tunnel_proxy bit. *************************************************************/ if((conn->bits.conn_to_host || conn->bits.conn_to_port) && - conn->bits.httpproxy) + conn->bits.httpproxy) conn->bits.tunnel_proxy = TRUE; #endif @@ -4006,7 +3995,6 @@ void Curl_data_priority_clear_state(struct Curl_easy *data) #endif /* USE_HTTP2 || USE_HTTP3 */ - CURLcode Curl_conn_meta_set(struct connectdata *conn, const char *key, void *meta_data, Curl_meta_dtor *meta_dtor) { diff --git a/lib/urlapi.c b/lib/urlapi.c index ad4d367dc34c..b8814cf85284 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -38,19 +38,19 @@ #include "curl_memrchr.h" #ifdef _WIN32 - /* MS-DOS/Windows style drive prefix, eg c: in c:foo */ -#define STARTS_WITH_DRIVE_PREFIX(str) \ - ((('a' <= str[0] && str[0] <= 'z') || \ +/* MS-DOS/Windows style drive prefix, eg c: in c:foo */ +#define STARTS_WITH_DRIVE_PREFIX(str) \ + ((('a' <= str[0] && str[0] <= 'z') || \ ('A' <= str[0] && str[0] <= 'Z')) && \ (str[1] == ':')) #endif - /* MS-DOS/Windows style drive prefix, optionally with - * a '|' instead of ':', followed by a slash or NUL */ -#define STARTS_WITH_URL_DRIVE_PREFIX(str) \ - ((('a' <= (str)[0] && (str)[0] <= 'z') || \ - ('A' <= (str)[0] && (str)[0] <= 'Z')) && \ - ((str)[1] == ':' || (str)[1] == '|') && \ +/* MS-DOS/Windows style drive prefix, optionally with + * a '|' instead of ':', followed by a slash or NUL */ +#define STARTS_WITH_URL_DRIVE_PREFIX(str) \ + ((('a' <= (str)[0] && (str)[0] <= 'z') || \ + ('A' <= (str)[0] && (str)[0] <= 'Z')) && \ + ((str)[1] == ':' || (str)[1] == '|') && \ ((str)[2] == '/' || (str)[2] == '\\' || (str)[2] == 0)) /* scheme is not URL encoded, the longest libcurl supported ones are... */ @@ -139,12 +139,12 @@ static CURLUcode urlencode_str(struct dynbuf *o, const char *url, /* we must add this with whitespace-replacing */ bool left = !query; const unsigned char *iptr; - const unsigned char *host_sep = (const unsigned char *) url; + const unsigned char *host_sep = (const unsigned char *)url; CURLcode result = CURLE_OK; if(!relative) { size_t n; - host_sep = (const unsigned char *) find_host_sep(url); + host_sep = (const unsigned char *)find_host_sep(url); /* output the first piece as-is */ n = (const char *)host_sep - url; @@ -160,7 +160,7 @@ static CURLUcode urlencode_str(struct dynbuf *o, const char *url, result = curlx_dyn_addn(o, "+", 1); } else if((*iptr < ' ') || (*iptr >= 0x7f)) { - unsigned char out[3]={'%'}; + unsigned char out[3] = { '%' }; Curl_hexbyte(&out[1], *iptr); result = curlx_dyn_addn(o, out, 3); } @@ -199,7 +199,7 @@ size_t Curl_is_absolute_url(const char *url, char *buf, size_t buflen, if(ISALPHA(url[0])) for(i = 1; i < MAX_SCHEME_LEN; ++i) { char s = url[i]; - if(s && (ISALNUM(s) || (s == '+') || (s == '-') || (s == '.') )) { + if(s && (ISALNUM(s) || (s == '+') || (s == '-') || (s == '.'))) { /* RFC 3986 3.1 explains: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */ @@ -453,7 +453,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, if(curlx_str_number(&portptr, &port, 0xffff) || *portptr) return CURLUE_BAD_PORT_NUMBER; - u->portnum = (unsigned short) port; + u->portnum = (unsigned short)port; /* generate a new port number string to get rid of leading zeroes etc */ curlx_free(u->port); u->port = curl_maprintf("%" CURL_FORMAT_CURL_OFF_T, port); @@ -563,7 +563,7 @@ static int ipv4_normalize(struct dynbuf *host) bool done = FALSE; int n = 0; const char *c = curlx_dyn_ptr(host); - unsigned int parts[4] = {0, 0, 0, 0}; + unsigned int parts[4] = { 0, 0, 0, 0 }; CURLcode result = CURLE_OK; if(*c == '[') @@ -920,7 +920,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) goto fail; schemelen = Curl_is_absolute_url(url, schemebuf, sizeof(schemebuf), - flags & (CURLU_GUESS_SCHEME| + flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)); /* handle the file: scheme */ @@ -1036,7 +1036,6 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) pathlen--; } #endif - } else { /* clear path */ @@ -1069,7 +1068,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) else { /* no scheme! */ - if(!(flags & (CURLU_DEFAULT_SCHEME|CURLU_GUESS_SCHEME))) { + if(!(flags & (CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME))) { result = CURLUE_BAD_SCHEME; goto fail; } @@ -1318,8 +1317,8 @@ CURLU *curl_url_dup(const CURLU *in) } #ifndef USE_IDN -#define host_decode(x,y) CURLUE_LACKS_IDN -#define host_encode(x,y) CURLUE_LACKS_IDN +#define host_decode(x, y) CURLUE_LACKS_IDN +#define host_encode(x, y) CURLUE_LACKS_IDN #else static CURLUcode host_decode(const char *host, char **allochost) { @@ -1697,7 +1696,7 @@ static CURLUcode set_url(CURLU *u, const char *url, size_t part_size, /* if the new URL is absolute replace the existing with the new. */ if(Curl_is_absolute_url(url, NULL, 0, - flags & (CURLU_GUESS_SCHEME|CURLU_DEFAULT_SCHEME))) + flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME))) return parseurl_and_replace(url, u, flags); /* if the old URL is incomplete (we cannot get an absolute URL in @@ -1765,11 +1764,24 @@ static CURLUcode urlset_clear(CURLU *u, CURLUPart what) static bool allowed_in_path(unsigned char x) { switch(x) { - case '!': case '$': case '&': case '\'': - case '(': case ')': case '{': case '}': - case '[': case ']': case '*': case '+': - case ',': case ';': case '=': case ':': - case '@': case '/': + case '!': + case '$': + case '&': + case '\'': + case '(': + case ')': + case '{': + case '}': + case '[': + case ']': + case '*': + case '+': + case ',': + case ';': + case '=': + case ':': + case '@': + case '/': return TRUE; } return FALSE; @@ -1878,7 +1890,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, return cc2cu(result); } else { - unsigned char out[3]={'%'}; + unsigned char out[3] = { '%' }; Curl_hexbyte(&out[1], *i); result = curlx_dyn_addn(&enc, out, 3); if(result) @@ -1911,7 +1923,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, none is present at the end of the existing query already */ size_t querylen = u->query ? strlen(u->query) : 0; - bool addamperand = querylen && (u->query[querylen -1] != '&'); + bool addamperand = querylen && (u->query[querylen - 1] != '&'); if(querylen) { struct dynbuf qbuf; curlx_dyn_init(&qbuf, CURL_MAX_INPUT_LENGTH); diff --git a/lib/urldata.h b/lib/urldata.h index 1c91099d153d..aa1326d2a645 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -28,40 +28,40 @@ #include "curl_setup.h" -#define PORT_FTP 21 -#define PORT_FTPS 990 +#define PORT_FTP 21 +#define PORT_FTPS 990 #define PORT_TELNET 23 -#define PORT_HTTP 80 -#define PORT_HTTPS 443 -#define PORT_DICT 2628 -#define PORT_LDAP 389 -#define PORT_LDAPS 636 -#define PORT_TFTP 69 -#define PORT_SSH 22 -#define PORT_IMAP 143 -#define PORT_IMAPS 993 -#define PORT_POP3 110 -#define PORT_POP3S 995 -#define PORT_SMB 445 -#define PORT_SMBS 445 -#define PORT_SMTP 25 -#define PORT_SMTPS 465 /* sometimes called SSMTP */ -#define PORT_RTSP 554 -#define PORT_RTMP 1935 -#define PORT_RTMPT PORT_HTTP -#define PORT_RTMPS PORT_HTTPS +#define PORT_HTTP 80 +#define PORT_HTTPS 443 +#define PORT_DICT 2628 +#define PORT_LDAP 389 +#define PORT_LDAPS 636 +#define PORT_TFTP 69 +#define PORT_SSH 22 +#define PORT_IMAP 143 +#define PORT_IMAPS 993 +#define PORT_POP3 110 +#define PORT_POP3S 995 +#define PORT_SMB 445 +#define PORT_SMBS 445 +#define PORT_SMTP 25 +#define PORT_SMTPS 465 /* sometimes called SSMTP */ +#define PORT_RTSP 554 +#define PORT_RTMP 1935 +#define PORT_RTMPT PORT_HTTP +#define PORT_RTMPS PORT_HTTPS #define PORT_GOPHER 70 -#define PORT_MQTT 1883 +#define PORT_MQTT 1883 struct curl_trc_featt; #ifdef USE_ECH /* CURLECH_ bits for the tls_ech option */ -# define CURLECH_DISABLE (1<<0) -# define CURLECH_GREASE (1<<1) -# define CURLECH_ENABLE (1<<2) -# define CURLECH_HARD (1<<3) -# define CURLECH_CLA_CFG (1<<4) +# define CURLECH_DISABLE (1 << 0) +# define CURLECH_GREASE (1 << 1) +# define CURLECH_ENABLE (1 << 2) +# define CURLECH_HARD (1 << 3) +# define CURLECH_CLA_CFG (1 << 4) #endif #ifndef CURL_DISABLE_WEBSOCKETS @@ -70,8 +70,8 @@ struct curl_trc_featt; * platforms that have a >= 64-bit type and then we use such a type for the * protocol fields in the protocol handler. */ -#define CURLPROTO_WS (1L<<30) -#define CURLPROTO_WSS ((curl_prot_t)1<<31) +#define CURLPROTO_WS (1L << 30) +#define CURLPROTO_WSS ((curl_prot_t)1 << 31) #else #define CURLPROTO_WS 0L #define CURLPROTO_WSS 0L @@ -107,15 +107,15 @@ typedef unsigned int curl_prot_t; /* Convenience defines for checking protocols or their SSL based version. Each protocol handler should only ever have a single CURLPROTO_ in its protocol field. */ -#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_WS| \ +#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \ CURLPROTO_WSS) -#define PROTO_FAMILY_FTP (CURLPROTO_FTP|CURLPROTO_FTPS) -#define PROTO_FAMILY_POP3 (CURLPROTO_POP3|CURLPROTO_POP3S) -#define PROTO_FAMILY_SMB (CURLPROTO_SMB|CURLPROTO_SMBS) -#define PROTO_FAMILY_SMTP (CURLPROTO_SMTP|CURLPROTO_SMTPS) -#define PROTO_FAMILY_SSH (CURLPROTO_SCP|CURLPROTO_SFTP) +#define PROTO_FAMILY_FTP (CURLPROTO_FTP | CURLPROTO_FTPS) +#define PROTO_FAMILY_POP3 (CURLPROTO_POP3 | CURLPROTO_POP3S) +#define PROTO_FAMILY_SMB (CURLPROTO_SMB | CURLPROTO_SMBS) +#define PROTO_FAMILY_SMTP (CURLPROTO_SMTP | CURLPROTO_SMTPS) +#define PROTO_FAMILY_SSH (CURLPROTO_SCP | CURLPROTO_SFTP) -#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) || \ +#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) || \ !defined(CURL_DISABLE_POP3) /* these protocols support CURLOPT_DIRLISTONLY */ #define CURL_LIST_ONLY_PROTOCOL 1 @@ -127,7 +127,7 @@ typedef unsigned int curl_prot_t; #define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") /* Default FTP/IMAP etc response timeout in milliseconds */ -#define RESP_TIMEOUT (60*1000) +#define RESP_TIMEOUT (60 * 1000) /* Max string input length is a precaution against abuse and to detect junk input easier and better. */ @@ -217,8 +217,8 @@ typedef CURLcode (Curl_recv)(struct Curl_easy *data, /* transfer */ larger buffers can help further, but this is deemed a fair memory/speed compromise. */ #define UPLOADBUFFER_DEFAULT 65536 -#define UPLOADBUFFER_MAX (2*1024*1024) -#define UPLOADBUFFER_MIN CURL_MAX_WRITE_SIZE +#define UPLOADBUFFER_MAX (2 * 1024 * 1024) +#define UPLOADBUFFER_MIN CURL_MAX_WRITE_SIZE #define CURLEASY_MAGIC_NUMBER 0xc0dedbadU #ifdef DEBUGBUILD @@ -226,7 +226,7 @@ typedef CURLcode (Curl_recv)(struct Curl_easy *data, /* transfer */ * are not NULL, but no longer have the MAGIC touch. This gives * us early warning on things only discovered by valgrind otherwise. */ #define GOOD_EASY_HANDLE(x) \ - (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER))? TRUE: \ + (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \ (DEBUGASSERT(!(x)), FALSE)) #else #define GOOD_EASY_HANDLE(x) \ @@ -269,7 +269,7 @@ struct ssl_config_data { long certverifyresult; /* result from the certificate verification */ curl_ssl_ctx_callback fsslctx; /* function to initialize ssl ctx */ void *fsslctxp; /* parameter for call back */ - char *cert_type; /* format for certificate (default: PEM)*/ + char *cert_type; /* format for certificate (default: PEM) */ char *key; /* private key filename */ struct curl_blob *key_blob; char *key_type; /* format for private key (default: PEM) */ @@ -424,8 +424,8 @@ struct hostname { */ #define KEEP_NONE 0 -#define KEEP_RECV (1<<0) /* there is or may be data to read */ -#define KEEP_SEND (1<<1) /* there is or may be data to write */ +#define KEEP_RECV (1 << 0) /* there is or may be data to read */ +#define KEEP_SEND (1 << 1) /* there is or may be data to write */ /* transfer wants to send */ #define CURL_WANT_SEND(data) ((data)->req.keepon & KEEP_SEND) @@ -576,8 +576,8 @@ struct Curl_handler { #define CONNRESULT_DEAD (1<<0) /* The connection is dead. */ #define TRNSPRT_NONE 0 -#define TRNSPRT_TCP 3 -#define TRNSPRT_UDP 4 +#define TRNSPRT_TCP 3 +#define TRNSPRT_UDP 4 #define TRNSPRT_QUIC 5 #define TRNSPRT_UNIX 6 @@ -589,9 +589,10 @@ struct ip_quadruple { uint8_t transport; }; -#define CUR_IP_QUAD_HAS_PORTS(x) (((x)->transport == TRNSPRT_TCP) || \ - ((x)->transport == TRNSPRT_UDP) || \ - ((x)->transport == TRNSPRT_QUIC)) +#define CUR_IP_QUAD_HAS_PORTS(x) \ + (((x)->transport == TRNSPRT_TCP) || \ + ((x)->transport == TRNSPRT_UDP) || \ + ((x)->transport == TRNSPRT_QUIC)) struct proxy_info { struct hostname host; @@ -827,8 +828,8 @@ struct Progress { #define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */ - curl_off_t speed_amount[ CURL_SPEED_RECORDS ]; - struct curltime speed_time[ CURL_SPEED_RECORDS ]; + curl_off_t speed_amount[CURL_SPEED_RECORDS]; + struct curltime speed_time[CURL_SPEED_RECORDS]; unsigned char speeder_c; BIT(hide); BIT(ul_size_known); @@ -839,19 +840,19 @@ struct Progress { }; typedef enum { - RTSPREQ_NONE, /* first in list */ - RTSPREQ_OPTIONS, - RTSPREQ_DESCRIBE, - RTSPREQ_ANNOUNCE, - RTSPREQ_SETUP, - RTSPREQ_PLAY, - RTSPREQ_PAUSE, - RTSPREQ_TEARDOWN, - RTSPREQ_GET_PARAMETER, - RTSPREQ_SET_PARAMETER, - RTSPREQ_RECORD, - RTSPREQ_RECEIVE, - RTSPREQ_LAST /* last in list */ + RTSPREQ_NONE, /* first in list */ + RTSPREQ_OPTIONS, + RTSPREQ_DESCRIBE, + RTSPREQ_ANNOUNCE, + RTSPREQ_SETUP, + RTSPREQ_PLAY, + RTSPREQ_PAUSE, + RTSPREQ_TEARDOWN, + RTSPREQ_GET_PARAMETER, + RTSPREQ_SET_PARAMETER, + RTSPREQ_RECORD, + RTSPREQ_RECEIVE, + RTSPREQ_LAST /* last in list */ } Curl_RtspReq; struct auth { @@ -911,7 +912,6 @@ typedef enum { EXPIRE_LAST /* not an actual timer, used as a marker only */ } expire_id; - typedef enum { TRAILERS_NONE, TRAILERS_INITIALIZED, @@ -919,7 +919,6 @@ typedef enum { TRAILERS_DONE } trailers_state; - /* * One instance for each timeout an easy handle can set. */ @@ -1296,7 +1295,6 @@ enum dupblob { BLOB_LAST }; - struct UserDefined { FILE *err; /* the stderr user data goes here */ void *debugdata; /* the data that will be passed to fdebug */ diff --git a/lib/version.c b/lib/version.c index 487dc74ffa15..79654fa9755c 100644 --- a/lib/version.c +++ b/lib/version.c @@ -335,8 +335,8 @@ static const char * const supported_protocols[] = { #ifndef CURL_DISABLE_LDAP "ldap", #if !defined(CURL_DISABLE_LDAPS) && \ - ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ - (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) + ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ + (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) "ldaps", #endif #endif @@ -438,7 +438,7 @@ static int ech_present(curl_version_info_data *info) * Use FEATURE() macro to define an entry: this allows documentation check. */ -#define FEATURE(name, present, bitmask) {(name), (present), (bitmask)} +#define FEATURE(name, present, bitmask) { (name), (present), (bitmask) } struct feat { const char *name; diff --git a/lib/ws.c b/lib/ws.c index 93e13e1ac184..eab06f4f118c 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -54,11 +54,11 @@ |N|V|V|V| | | |1|2|3| | */ -#define WSBIT_FIN (0x80) -#define WSBIT_RSV1 (0x40) -#define WSBIT_RSV2 (0x20) -#define WSBIT_RSV3 (0x10) -#define WSBIT_RSV_MASK (WSBIT_RSV1 | WSBIT_RSV2 | WSBIT_RSV3) +#define WSBIT_FIN (0x80) +#define WSBIT_RSV1 (0x40) +#define WSBIT_RSV2 (0x20) +#define WSBIT_RSV3 (0x10) +#define WSBIT_RSV_MASK (WSBIT_RSV1 | WSBIT_RSV2 | WSBIT_RSV3) #define WSBIT_OPCODE_CONT (0x0) #define WSBIT_OPCODE_TEXT (0x1) #define WSBIT_OPCODE_BIN (0x2) @@ -70,10 +70,9 @@ #define WSBIT_MASK 0x80 /* buffer dimensioning */ -#define WS_CHUNK_SIZE 65535 +#define WS_CHUNK_SIZE 65535 #define WS_CHUNK_COUNT 2 - /* a client-side WS frame decoder, parsing frame headers and * payload, keeping track of current position and stats */ enum ws_dec_state { @@ -126,24 +125,23 @@ struct websocket { size_t sendbuf_payload; /* number of payload bytes in sendbuf */ }; - static const char *ws_frame_name_of_op(uint8_t firstbyte) { switch(firstbyte & WSBIT_OPCODE_MASK) { - case WSBIT_OPCODE_CONT: - return "CONT"; - case WSBIT_OPCODE_TEXT: - return "TEXT"; - case WSBIT_OPCODE_BIN: - return "BIN"; - case WSBIT_OPCODE_CLOSE: - return "CLOSE"; - case WSBIT_OPCODE_PING: - return "PING"; - case WSBIT_OPCODE_PONG: - return "PONG"; - default: - return "???"; + case WSBIT_OPCODE_CONT: + return "CONT"; + case WSBIT_OPCODE_TEXT: + return "TEXT"; + case WSBIT_OPCODE_BIN: + return "BIN"; + case WSBIT_OPCODE_CLOSE: + return "CLOSE"; + case WSBIT_OPCODE_PING: + return "PING"; + case WSBIT_OPCODE_PONG: + return "PONG"; + default: + return "???"; } } @@ -151,78 +149,78 @@ static int ws_frame_firstbyte2flags(struct Curl_easy *data, uint8_t firstbyte, int cont_flags) { switch(firstbyte) { - /* 0x00 - intermediate TEXT/BINARY fragment */ - case WSBIT_OPCODE_CONT: - if(!(cont_flags & CURLWS_CONT)) { - failf(data, "[WS] no ongoing fragmented message to resume"); - return 0; - } - return cont_flags | CURLWS_CONT; - /* 0x80 - final TEXT/BIN fragment */ - case (WSBIT_OPCODE_CONT | WSBIT_FIN): - if(!(cont_flags & CURLWS_CONT)) { - failf(data, "[WS] no ongoing fragmented message to resume"); - return 0; - } - return cont_flags & ~CURLWS_CONT; - /* 0x01 - first TEXT fragment */ - case WSBIT_OPCODE_TEXT: - if(cont_flags & CURLWS_CONT) { - failf(data, "[WS] fragmented message interrupted by new TEXT msg"); - return 0; - } - return CURLWS_TEXT | CURLWS_CONT; - /* 0x81 - unfragmented TEXT msg */ - case (WSBIT_OPCODE_TEXT | WSBIT_FIN): - if(cont_flags & CURLWS_CONT) { - failf(data, "[WS] fragmented message interrupted by new TEXT msg"); - return 0; - } - return CURLWS_TEXT; - /* 0x02 - first BINARY fragment */ - case WSBIT_OPCODE_BIN: - if(cont_flags & CURLWS_CONT) { - failf(data, "[WS] fragmented message interrupted by new BINARY msg"); - return 0; - } - return CURLWS_BINARY | CURLWS_CONT; - /* 0x82 - unfragmented BINARY msg */ - case (WSBIT_OPCODE_BIN | WSBIT_FIN): - if(cont_flags & CURLWS_CONT) { - failf(data, "[WS] fragmented message interrupted by new BINARY msg"); - return 0; - } - return CURLWS_BINARY; - /* 0x08 - first CLOSE fragment */ - case WSBIT_OPCODE_CLOSE: - failf(data, "[WS] invalid fragmented CLOSE frame"); + /* 0x00 - intermediate TEXT/BINARY fragment */ + case WSBIT_OPCODE_CONT: + if(!(cont_flags & CURLWS_CONT)) { + failf(data, "[WS] no ongoing fragmented message to resume"); return 0; - /* 0x88 - unfragmented CLOSE */ - case (WSBIT_OPCODE_CLOSE | WSBIT_FIN): - return CURLWS_CLOSE; - /* 0x09 - first PING fragment */ - case WSBIT_OPCODE_PING: - failf(data, "[WS] invalid fragmented PING frame"); + } + return cont_flags | CURLWS_CONT; + /* 0x80 - final TEXT/BIN fragment */ + case (WSBIT_OPCODE_CONT | WSBIT_FIN): + if(!(cont_flags & CURLWS_CONT)) { + failf(data, "[WS] no ongoing fragmented message to resume"); return 0; - /* 0x89 - unfragmented PING */ - case (WSBIT_OPCODE_PING | WSBIT_FIN): - return CURLWS_PING; - /* 0x0a - first PONG fragment */ - case WSBIT_OPCODE_PONG: - failf(data, "[WS] invalid fragmented PONG frame"); + } + return cont_flags & ~CURLWS_CONT; + /* 0x01 - first TEXT fragment */ + case WSBIT_OPCODE_TEXT: + if(cont_flags & CURLWS_CONT) { + failf(data, "[WS] fragmented message interrupted by new TEXT msg"); return 0; - /* 0x8a - unfragmented PONG */ - case (WSBIT_OPCODE_PONG | WSBIT_FIN): - return CURLWS_PONG; - /* invalid first byte */ - default: - if(firstbyte & WSBIT_RSV_MASK) - /* any of the reserved bits 0x40/0x20/0x10 are set */ - failf(data, "[WS] invalid reserved bits: %02x", firstbyte); - else - /* any of the reserved opcodes 0x3-0x7 or 0xb-0xf is used */ - failf(data, "[WS] invalid opcode: %02x", firstbyte); + } + return CURLWS_TEXT | CURLWS_CONT; + /* 0x81 - unfragmented TEXT msg */ + case (WSBIT_OPCODE_TEXT | WSBIT_FIN): + if(cont_flags & CURLWS_CONT) { + failf(data, "[WS] fragmented message interrupted by new TEXT msg"); + return 0; + } + return CURLWS_TEXT; + /* 0x02 - first BINARY fragment */ + case WSBIT_OPCODE_BIN: + if(cont_flags & CURLWS_CONT) { + failf(data, "[WS] fragmented message interrupted by new BINARY msg"); + return 0; + } + return CURLWS_BINARY | CURLWS_CONT; + /* 0x82 - unfragmented BINARY msg */ + case (WSBIT_OPCODE_BIN | WSBIT_FIN): + if(cont_flags & CURLWS_CONT) { + failf(data, "[WS] fragmented message interrupted by new BINARY msg"); return 0; + } + return CURLWS_BINARY; + /* 0x08 - first CLOSE fragment */ + case WSBIT_OPCODE_CLOSE: + failf(data, "[WS] invalid fragmented CLOSE frame"); + return 0; + /* 0x88 - unfragmented CLOSE */ + case (WSBIT_OPCODE_CLOSE | WSBIT_FIN): + return CURLWS_CLOSE; + /* 0x09 - first PING fragment */ + case WSBIT_OPCODE_PING: + failf(data, "[WS] invalid fragmented PING frame"); + return 0; + /* 0x89 - unfragmented PING */ + case (WSBIT_OPCODE_PING | WSBIT_FIN): + return CURLWS_PING; + /* 0x0a - first PONG fragment */ + case WSBIT_OPCODE_PONG: + failf(data, "[WS] invalid fragmented PONG frame"); + return 0; + /* 0x8a - unfragmented PONG */ + case (WSBIT_OPCODE_PONG | WSBIT_FIN): + return CURLWS_PONG; + /* invalid first byte */ + default: + if(firstbyte & WSBIT_RSV_MASK) + /* any of the reserved bits 0x40/0x20/0x10 are set */ + failf(data, "[WS] invalid reserved bits: %02x", firstbyte); + else + /* any of the reserved opcodes 0x3-0x7 or 0xb-0xf is used */ + failf(data, "[WS] invalid opcode: %02x", firstbyte); + return 0; } } @@ -233,59 +231,59 @@ static CURLcode ws_frame_flags2firstbyte(struct Curl_easy *data, { *pfirstbyte = 0; switch(flags & ~CURLWS_OFFSET) { - case 0: - if(contfragment) { - CURL_TRC_WS(data, "no flags given; interpreting as continuation " - "fragment for compatibility"); - *pfirstbyte = (WSBIT_OPCODE_CONT | WSBIT_FIN); - return CURLE_OK; - } - failf(data, "[WS] no flags given"); - return CURLE_BAD_FUNCTION_ARGUMENT; - case CURLWS_CONT: - if(contfragment) { - infof(data, "[WS] setting CURLWS_CONT flag without message type is " - "supported for compatibility but highly discouraged"); - *pfirstbyte = WSBIT_OPCODE_CONT; - return CURLE_OK; - } - failf(data, "[WS] No ongoing fragmented message to continue"); - return CURLE_BAD_FUNCTION_ARGUMENT; - case CURLWS_TEXT: - *pfirstbyte = contfragment ? (WSBIT_OPCODE_CONT | WSBIT_FIN) - : (WSBIT_OPCODE_TEXT | WSBIT_FIN); - return CURLE_OK; - case (CURLWS_TEXT | CURLWS_CONT): - *pfirstbyte = contfragment ? WSBIT_OPCODE_CONT : WSBIT_OPCODE_TEXT; - return CURLE_OK; - case CURLWS_BINARY: - *pfirstbyte = contfragment ? (WSBIT_OPCODE_CONT | WSBIT_FIN) - : (WSBIT_OPCODE_BIN | WSBIT_FIN); - return CURLE_OK; - case (CURLWS_BINARY | CURLWS_CONT): - *pfirstbyte = contfragment ? WSBIT_OPCODE_CONT : WSBIT_OPCODE_BIN; - return CURLE_OK; - case CURLWS_CLOSE: - *pfirstbyte = WSBIT_OPCODE_CLOSE | WSBIT_FIN; - return CURLE_OK; - case (CURLWS_CLOSE | CURLWS_CONT): - failf(data, "[WS] CLOSE frame must not be fragmented"); - return CURLE_BAD_FUNCTION_ARGUMENT; - case CURLWS_PING: - *pfirstbyte = WSBIT_OPCODE_PING | WSBIT_FIN; + case 0: + if(contfragment) { + CURL_TRC_WS(data, "no flags given; interpreting as continuation " + "fragment for compatibility"); + *pfirstbyte = (WSBIT_OPCODE_CONT | WSBIT_FIN); return CURLE_OK; - case (CURLWS_PING | CURLWS_CONT): - failf(data, "[WS] PING frame must not be fragmented"); - return CURLE_BAD_FUNCTION_ARGUMENT; - case CURLWS_PONG: - *pfirstbyte = WSBIT_OPCODE_PONG | WSBIT_FIN; + } + failf(data, "[WS] no flags given"); + return CURLE_BAD_FUNCTION_ARGUMENT; + case CURLWS_CONT: + if(contfragment) { + infof(data, "[WS] setting CURLWS_CONT flag without message type is " + "supported for compatibility but highly discouraged"); + *pfirstbyte = WSBIT_OPCODE_CONT; return CURLE_OK; - case (CURLWS_PONG | CURLWS_CONT): - failf(data, "[WS] PONG frame must not be fragmented"); - return CURLE_BAD_FUNCTION_ARGUMENT; - default: - failf(data, "[WS] unknown flags: %x", flags); - return CURLE_BAD_FUNCTION_ARGUMENT; + } + failf(data, "[WS] No ongoing fragmented message to continue"); + return CURLE_BAD_FUNCTION_ARGUMENT; + case CURLWS_TEXT: + *pfirstbyte = contfragment ? (WSBIT_OPCODE_CONT | WSBIT_FIN) + : (WSBIT_OPCODE_TEXT | WSBIT_FIN); + return CURLE_OK; + case (CURLWS_TEXT | CURLWS_CONT): + *pfirstbyte = contfragment ? WSBIT_OPCODE_CONT : WSBIT_OPCODE_TEXT; + return CURLE_OK; + case CURLWS_BINARY: + *pfirstbyte = contfragment ? (WSBIT_OPCODE_CONT | WSBIT_FIN) + : (WSBIT_OPCODE_BIN | WSBIT_FIN); + return CURLE_OK; + case (CURLWS_BINARY | CURLWS_CONT): + *pfirstbyte = contfragment ? WSBIT_OPCODE_CONT : WSBIT_OPCODE_BIN; + return CURLE_OK; + case CURLWS_CLOSE: + *pfirstbyte = WSBIT_OPCODE_CLOSE | WSBIT_FIN; + return CURLE_OK; + case (CURLWS_CLOSE | CURLWS_CONT): + failf(data, "[WS] CLOSE frame must not be fragmented"); + return CURLE_BAD_FUNCTION_ARGUMENT; + case CURLWS_PING: + *pfirstbyte = WSBIT_OPCODE_PING | WSBIT_FIN; + return CURLE_OK; + case (CURLWS_PING | CURLWS_CONT): + failf(data, "[WS] PING frame must not be fragmented"); + return CURLE_BAD_FUNCTION_ARGUMENT; + case CURLWS_PONG: + *pfirstbyte = WSBIT_OPCODE_PONG | WSBIT_FIN; + return CURLE_OK; + case (CURLWS_PONG | CURLWS_CONT): + failf(data, "[WS] PONG frame must not be fragmented"); + return CURLE_BAD_FUNCTION_ARGUMENT; + default: + failf(data, "[WS] unknown flags: %x", flags); + return CURLE_BAD_FUNCTION_ARGUMENT; } } @@ -452,13 +450,14 @@ static CURLcode ws_dec_read_head(struct ws_decoder *dec, failf(data, "[WS] frame length longer than 63 bit not supported"); return CURLE_RECV_ERROR; } - dec->payload_len = ((curl_off_t)dec->head[2] << 56) | + dec->payload_len = + (curl_off_t)dec->head[2] << 56 | (curl_off_t)dec->head[3] << 48 | (curl_off_t)dec->head[4] << 40 | (curl_off_t)dec->head[5] << 32 | (curl_off_t)dec->head[6] << 24 | (curl_off_t)dec->head[7] << 16 | - (curl_off_t)dec->head[8] << 8 | + (curl_off_t)dec->head[8] << 8 | dec->head[9]; break; default: @@ -1230,7 +1229,6 @@ static const struct Curl_crtype ws_cr_encode = { sizeof(struct cr_ws_ctx) }; - struct wsfield { const char *name; const char *val; @@ -1245,7 +1243,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) size_t randlen; char keyval[40]; struct SingleRequest *k = &data->req; - struct wsfield heads[]= { + struct wsfield heads[] = { { /* The request MUST contain an |Upgrade| header field whose value MUST include the "websocket" keyword. */ @@ -1284,8 +1282,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) curlx_free(randstr); for(i = 0; !result && (i < CURL_ARRAYSIZE(heads)); i++) { if(!Curl_checkheaders(data, heads[i].name, strlen(heads[i].name))) { - result = curlx_dyn_addf(req, "%s: %s\r\n", heads[i].name, - heads[i].val); + result = curlx_dyn_addf(req, "%s: %s\r\n", heads[i].name, heads[i].val); } } data->state.http_hd_upgrade = TRUE; @@ -1329,7 +1326,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data, const char *p = getenv("CURL_WS_CHUNK_SIZE"); if(p) { curl_off_t l; - if(!curlx_str_number(&p, &l, 1*1024*1024)) + if(!curlx_str_number(&p, &l, 1 * 1024 * 1024)) chunk_size = (size_t)l; } } @@ -1633,7 +1630,7 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, const char *p = getenv("CURL_WS_CHUNK_EAGAIN"); if(p) { curl_off_t l; - if(!curlx_str_number(&p, &l, 1*1024*1024)) + if(!curlx_str_number(&p, &l, 1 * 1024 * 1024)) chunk_egain = (size_t)l; } #endif @@ -1844,7 +1841,6 @@ static CURLcode ws_setup_conn(struct Curl_easy *data, return Curl_http_setup_conn(data, conn); } - const struct curl_ws_frame *curl_ws_meta(CURL *d) { /* we only return something for websocket, called from within the callback @@ -1856,7 +1852,6 @@ const struct curl_ws_frame *curl_ws_meta(CURL *d) ws = Curl_conn_meta_get(data->conn, CURL_META_PROTO_WS_CONN); if(ws) return &ws->recvframe; - } return NULL; } @@ -1963,11 +1958,10 @@ const struct Curl_handler Curl_handler_wss = { CURLPROTO_WSS, /* protocol */ CURLPROTO_HTTP, /* family */ PROTOPT_SSL | PROTOPT_CREDSPERREQUEST | /* flags */ - PROTOPT_USERPWDCTRL + PROTOPT_USERPWDCTRL }; #endif - #else CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen, diff --git a/lib/ws.h b/lib/ws.h index b7655abbce74..a6e770694dee 100644 --- a/lib/ws.h +++ b/lib/ws.h @@ -38,10 +38,9 @@ extern const struct Curl_handler Curl_handler_ws; extern const struct Curl_handler Curl_handler_wss; #endif - #else -#define Curl_ws_request(x,y) CURLE_OK -#define Curl_ws_free(x) Curl_nop_stmt +#define Curl_ws_request(x, y) CURLE_OK +#define Curl_ws_free(x) Curl_nop_stmt #endif #endif /* HEADER_CURL_WS_H */ From 6694a42aa0e820a6fe1e59d85ff8597b6d768d8d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 22:18:41 +0100 Subject: [PATCH 639/885] idn: avoid allocations and wcslen on Windows Eliminate a heap buffer in both `win32_idn_to_ascii()` and `win32_ascii_to_idn()`, by replacing it with stack buffer. The maximum size is fixed in these cases, and small enough to fit there. Also reuse length returned by the UTF-8 to wchar conversion, allowing to drop `wcslen()` call in both functions, and allowing to call the wchar to UTF-8 conversion API `WideCharToMultiByte()` with the known length, saving length calculations within that API too. Ref: https://github.com/curl/curl/pull/19748#issuecomment-3592015200 Closes #19798 --- lib/idn.c | 72 +++++++++++++++++++------------------------------------ 1 file changed, 24 insertions(+), 48 deletions(-) diff --git a/lib/idn.c b/lib/idn.c index 8f4c3e03f712..083be1d53f88 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -162,42 +162,18 @@ WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags, #define IDN_MAX_LENGTH 255 -static wchar_t *idn_curlx_convert_UTF8_to_wchar(const char *str_utf8) -{ - wchar_t *str_w = NULL; - - if(str_utf8) { - int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, - str_utf8, -1, NULL, 0); - if(str_w_len > 0) { - str_w = curlx_malloc(str_w_len * sizeof(wchar_t)); - if(str_w) { - if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, - str_w_len) == 0) { - curlx_free(str_w); - return NULL; - } - } - } - } - return str_w; -} - -static char *idn_curlx_convert_wchar_to_UTF8(const wchar_t *str_w) +static char *idn_curlx_convert_wchar_to_UTF8(const wchar_t *str_w, int chars) { char *str_utf8 = NULL; - - if(str_w) { - int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, - NULL, 0, NULL, NULL); - if(bytes > 0) { - str_utf8 = curlx_malloc(bytes); - if(str_utf8) { - if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, bytes, - NULL, NULL) == 0) { - curlx_free(str_utf8); - return NULL; - } + int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, chars, NULL, 0, + NULL, NULL); + if(bytes > 0) { + str_utf8 = curlx_malloc(bytes); + if(str_utf8) { + if(WideCharToMultiByte(CP_UTF8, 0, str_w, chars, str_utf8, bytes, + NULL, NULL) == 0) { + curlx_free(str_utf8); + return NULL; } } } @@ -206,15 +182,15 @@ static char *idn_curlx_convert_wchar_to_UTF8(const wchar_t *str_w) static CURLcode win32_idn_to_ascii(const char *in, char **out) { - wchar_t *in_w = idn_curlx_convert_UTF8_to_wchar(in); + wchar_t in_w[IDN_MAX_LENGTH]; + int in_w_len; *out = NULL; - if(in_w) { + in_w_len = MultiByteToWideChar(CP_UTF8, 0, in, -1, in_w, IDN_MAX_LENGTH); + if(in_w_len) { wchar_t punycode[IDN_MAX_LENGTH]; - int chars = IdnToAscii(0, in_w, (int)(wcslen(in_w) + 1), punycode, - IDN_MAX_LENGTH); - curlx_free(in_w); - if(chars) { - *out = idn_curlx_convert_wchar_to_UTF8(punycode); + int chars = IdnToAscii(0, in_w, in_w_len, punycode, IDN_MAX_LENGTH); + if(chars > 0) { + *out = idn_curlx_convert_wchar_to_UTF8(punycode, chars); if(!*out) return CURLE_OUT_OF_MEMORY; } @@ -229,15 +205,15 @@ static CURLcode win32_idn_to_ascii(const char *in, char **out) static CURLcode win32_ascii_to_idn(const char *in, char **out) { - wchar_t *in_w = idn_curlx_convert_UTF8_to_wchar(in); + wchar_t in_w[IDN_MAX_LENGTH]; + int in_w_len; *out = NULL; - if(in_w) { + in_w_len = MultiByteToWideChar(CP_UTF8, 0, in, -1, in_w, IDN_MAX_LENGTH); + if(in_w_len) { WCHAR idn[IDN_MAX_LENGTH]; /* stores a UTF-16 string */ - int chars = IdnToUnicode(0, in_w, (int)(wcslen(in_w) + 1), idn, - IDN_MAX_LENGTH); - curlx_free(in_w); - if(chars) { /* 'chars' is "the number of characters retrieved" */ - *out = idn_curlx_convert_wchar_to_UTF8(idn); + int chars = IdnToUnicode(0, in_w, in_w_len, idn, IDN_MAX_LENGTH); + if(chars > 0) { /* 'chars' is "the number of characters retrieved" */ + *out = idn_curlx_convert_wchar_to_UTF8(idn, chars); if(!*out) return CURLE_OUT_OF_MEMORY; } From 1753de9d7a7a4e8d98869f1e01023db2861adf4f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Dec 2025 16:32:07 +0100 Subject: [PATCH 640/885] GHA/checksrc: give more time for slow Azure servers [ci skip] Sometimes 1 minutes is too short to install 39.4 kB of archives. Ref: https://github.com/curl/curl/actions/runs/19898949860/job/57036965452 --- .github/workflows/checksrc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index d3ef758b4872..1b471e50cfe7 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -122,7 +122,7 @@ jobs: xmllint: name: 'xmllint' runs-on: ubuntu-latest - timeout-minutes: 1 + timeout-minutes: 3 steps: - name: 'install prereqs' run: | From 0417d323c96db547e5ed9da733c51aed02be723e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Dec 2025 15:53:46 +0100 Subject: [PATCH 641/885] src: fix formatting nits Closes #19823 --- src/config2setopts.c | 21 ++--- src/curlinfo.c | 2 +- src/slist_wc.c | 3 +- src/terminal.c | 3 +- src/tool_cb_dbg.c | 4 +- src/tool_cb_hdr.c | 17 ++-- src/tool_cb_prg.c | 27 +++--- src/tool_cb_prg.h | 10 +-- src/tool_cb_rea.c | 2 +- src/tool_cb_wrt.c | 6 +- src/tool_cfgable.h | 9 +- src/tool_dirhie.c | 4 +- src/tool_doswin.c | 50 ++++++----- src/tool_doswin.h | 6 +- src/tool_easysrc.c | 4 +- src/tool_filetime.c | 4 +- src/tool_filetime.h | 2 +- src/tool_findfile.c | 2 +- src/tool_formparse.c | 43 ++++----- src/tool_getparam.c | 178 ++++++++++++++++++------------------- src/tool_getparam.h | 10 +-- src/tool_getpass.c | 9 +- src/tool_help.c | 57 ++++++------ src/tool_helpers.c | 4 +- src/tool_ipfs.c | 4 +- src/tool_libinfo.c | 2 +- src/tool_main.c | 2 +- src/tool_main.h | 4 +- src/tool_msgs.c | 12 +-- src/tool_msgs.h | 12 +-- src/tool_operate.c | 59 +++++-------- src/tool_operhlp.c | 2 +- src/tool_paramhlp.c | 27 +++--- src/tool_paramhlp.h | 2 +- src/tool_parsecfg.c | 2 +- src/tool_progress.c | 28 +++--- src/tool_sdecls.h | 2 - src/tool_setopt.c | 19 ++-- src/tool_setopt.h | 104 +++++++++------------- src/tool_setup.h | 4 +- src/tool_ssls.c | 4 +- src/tool_urlglob.c | 12 +-- src/tool_util.c | 2 +- src/tool_version.h | 8 +- src/tool_vms.c | 7 +- src/tool_vms.h | 5 +- src/tool_writeout.c | 186 ++++++++++++++++++++------------------- src/tool_writeout_json.c | 3 +- src/tool_xattr.h | 4 +- src/var.c | 37 ++++---- src/var.h | 3 +- tests/test1486.pl | 2 +- 52 files changed, 491 insertions(+), 544 deletions(-) diff --git a/src/config2setopts.c b/src/config2setopts.c index d3bd39c8647c..89a003cc96ac 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -142,8 +142,7 @@ static CURLcode url_proto_and_rewrite(char **url, curl_url_set(uh, CURLUPART_URL, *url, CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME); if(!uc) { - uc = curl_url_get(uh, CURLUPART_SCHEME, &schemep, - CURLU_DEFAULT_SCHEME); + uc = curl_url_get(uh, CURLUPART_SCHEME, &schemep, CURLU_DEFAULT_SCHEME); if(!uc) { #ifdef CURL_DISABLE_IPFS (void)config; @@ -339,8 +338,7 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) MY_SETOPT_STR(curl, CURLOPT_PROXY_CRLFILE, config->crlfile); if(config->pinnedpubkey) { - MY_SETOPT_STR(curl, CURLOPT_PINNEDPUBLICKEY, - config->pinnedpubkey); + MY_SETOPT_STR(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey); if(result) warnf("ignoring %s, not supported by libcurl with %s", "--pinnedpubkey", ssl_backend()); @@ -417,8 +415,7 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) { long mask = (config->proxy_ssl_allow_beast ? CURLSSLOPT_ALLOW_BEAST : 0) | - (config->proxy_ssl_auto_client_cert ? - CURLSSLOPT_AUTO_CLIENT_CERT : 0) | + (config->proxy_ssl_auto_client_cert ? CURLSSLOPT_AUTO_CLIENT_CERT : 0) | (config->proxy_native_ca_store ? CURLSSLOPT_NATIVE_CA : 0); if(mask) @@ -486,15 +483,13 @@ static CURLcode ssl_setopts(struct OperationConfig *config, CURL *curl) } /* only called for HTTP transfers */ -static CURLcode http_setopts(struct OperationConfig *config, - CURL *curl) +static CURLcode http_setopts(struct OperationConfig *config, CURL *curl) { CURLcode result; long postRedir = 0; my_setopt_long(curl, CURLOPT_FOLLOWLOCATION, config->followlocation); - my_setopt_long(curl, CURLOPT_UNRESTRICTED_AUTH, - config->unrestricted_auth); + my_setopt_long(curl, CURLOPT_UNRESTRICTED_AUTH, config->unrestricted_auth); MY_SETOPT_STR(curl, CURLOPT_AWS_SIGV4, config->aws_sigv4); my_setopt_long(curl, CURLOPT_AUTOREFERER, config->autoreferer); @@ -590,8 +585,7 @@ static void tcp_setopts(struct OperationConfig *config, CURL *curl) my_setopt_long(curl, CURLOPT_TCP_FASTOPEN, 1); if(config->mptcp) - my_setopt_ptr(curl, CURLOPT_OPENSOCKETFUNCTION, - tool_socket_open_mptcp_cb); + my_setopt_ptr(curl, CURLOPT_OPENSOCKETFUNCTION, tool_socket_open_mptcp_cb); /* curl 7.17.1 */ if(!config->nokeepalive) { @@ -946,8 +940,7 @@ CURLcode config2setopts(struct OperationConfig *config, my_setopt_long(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, (config->ftp_create_dirs ? CURLFTP_CREATE_DIR_RETRY : CURLFTP_CREATE_DIR_NONE)); - my_setopt_offt(curl, CURLOPT_MAXFILESIZE_LARGE, - config->max_filesize); + my_setopt_offt(curl, CURLOPT_MAXFILESIZE_LARGE, config->max_filesize); my_setopt_long(curl, CURLOPT_IPRESOLVE, config->ip_version); if(config->socks5_gssapi_nec) my_setopt_long(curl, CURLOPT_SOCKS5_GSSAPI_NEC, 1); diff --git a/src/curlinfo.c b/src/curlinfo.c index 852aee820161..35b8ff56a6e4 100644 --- a/src/curlinfo.c +++ b/src/curlinfo.c @@ -39,7 +39,7 @@ #include "fake_addrinfo.h" /* for USE_FAKE_GETADDRINFO */ #include -static const char *disabled[]={ +static const char *disabled[] = { "bindlocal: " #ifdef CURL_DISABLE_BINDLOCAL "OFF" diff --git a/src/slist_wc.c b/src/slist_wc.c index 26a91362b8e3..8a3ff254ccbc 100644 --- a/src/slist_wc.c +++ b/src/slist_wc.c @@ -32,8 +32,7 @@ * slist_wc_append() appends a string to the linked list. This function can be * used as an initialization function as well as an append function. */ -struct slist_wc *slist_wc_append(struct slist_wc *list, - const char *data) +struct slist_wc *slist_wc_append(struct slist_wc *list, const char *data) { struct curl_slist *new_item = curl_slist_append(NULL, data); diff --git a/src/terminal.c b/src/terminal.c index bb3e2ac61184..fe945cfa9c7b 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -74,8 +74,7 @@ unsigned int get_terminal_columns(void) * Do not use +1 to get the true screen-width since writing a * character at the right edge will cause a line wrap. */ - cols = (int) - (console_info.srWindow.Right - console_info.srWindow.Left); + cols = (int)(console_info.srWindow.Right - console_info.srWindow.Left); } } #endif /* TIOCGSIZE */ diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c index b858b6688e6e..2301bd67f57c 100644 --- a/src/tool_cb_dbg.c +++ b/src/tool_cb_dbg.c @@ -103,7 +103,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, if(handle && global->traceids && !curl_easy_getinfo(handle, CURLINFO_XFER_ID, &xfer_id) && xfer_id >= 0) { if(!curl_easy_getinfo(handle, CURLINFO_CONN_ID, &conn_id) && - conn_id >= 0) { + conn_id >= 0) { curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, conn_id); } @@ -224,7 +224,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, break; } - dump(timebuf, idsbuf, text, output, (unsigned char *) data, size, + dump(timebuf, idsbuf, text, output, (unsigned char *)data, size, global->tracetype, type); return 0; } diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index 7a5a475981d5..8027ea542171 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -39,17 +39,17 @@ static char *parse_filename(const char *ptr, size_t len); #ifdef _WIN32 -#define BOLD "\x1b[1m" +#define BOLD "\x1b[1m" #define BOLDOFF "\x1b[22m" #else -#define BOLD "\x1b[1m" +#define BOLD "\x1b[1m" /* Switch off bold by setting "all attributes off" since the explicit bold-off code (21) is not supported everywhere - like in the mac Terminal. */ #define BOLDOFF "\x1b[0m" /* OSC 8 hyperlink escape sequence */ -#define LINK "\x1b]8;;" -#define LINKST "\x1b\\" +#define LINK "\x1b]8;;" +#define LINKST "\x1b\\" #define LINKOFF LINK LINKST #endif @@ -76,7 +76,6 @@ int tool_write_headers(struct HdrCbData *hdrcbdata, FILE *stream) return rc; } - /* ** callback for CURLOPT_HEADERFUNCTION * @@ -131,7 +130,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) long response = 0; curl_easy_getinfo(per->curl, CURLINFO_RESPONSE_CODE, &response); - if((response/100 != 2) && (response/100 != 3)) + if((response / 100 != 2) && (response / 100 != 3)) /* only care about etag and content-disposition headers in 2xx and 3xx responses */ ; @@ -299,7 +298,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) #else if(curl_strnequal("Location", ptr, namelen)) { write_linked_location(per->curl, &value[1], cb - namelen - 1, - outs->stream); + outs->stream); } else fwrite(&value[1], cb - namelen - 1, 1, outs->stream); @@ -320,7 +319,7 @@ static char *parse_filename(const char *ptr, size_t len) char *copy; char *p; char *q; - char stop = '\0'; + char stop = '\0'; copy = memdup0(ptr, len); if(!copy) @@ -426,7 +425,7 @@ static void write_linked_location(CURL *curl, const char *location, } /* Strip the trailing end-of-line characters, normally "\r\n" */ - while(llen && (loc[llen-1] == '\n' || loc[llen-1] == '\r')) + while(llen && (loc[llen - 1] == '\n' || loc[llen - 1] == '\r')) --llen; /* CURLU makes it easy to handle the relative URL case */ diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index 6ae53b3ba227..ca437de50107 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -54,14 +54,15 @@ static const int sinus[] = { 500046, 484341, 468651, 452993, 437381, 421830, 406357, 390976, 375703, 360552, 345539, 330679, 315985, 301474, 287158, 273052, 259170, 245525, 232132, 219003, 206152, 193590, 181331, 169386, 157768, 146487, 135555, - 124983, 114781, 104959, 95526, 86493, 77868, 69660, 61876, 54525, 47613, - 41147, 35135, 29581, 24491, 19871, 15724, 12056, 8868, 6166, 3951, 2225, - 990, 248, 0, 244, 982, 2212, 3933, 6144, 8842, 12025, 15690, 19832, 24448, - 29534, 35084, 41092, 47554, 54462, 61809, 69589, 77794, 86415, 95445, - 104873, 114692, 124891, 135460, 146389, 157667, 169282, 181224, 193480, - 206039, 218888, 232015, 245406, 259048, 272928, 287032, 301346, 315856, - 330548, 345407, 360419, 375568, 390841, 406221, 421693, 437243, 452854, - 468513, 484202, 499907 + 124983, 114781, 104959, 95526, 86493, 77868, 69660, 61876, 54525, + 47613, 41147, 35135, 29581, 24491, 19871, 15724, 12056, 8868, + 6166, 3951, 2225, 990, 248, 0, 244, 982, 2212, + 3933, 6144, 8842, 12025, 15690, 19832, 24448, 29534, 35084, + 41092, 47554, 54462, 61809, 69589, 77794, 86415, 95445, 104873, + 114692, 124891, 135460, 146389, 157667, 169282, 181224, 193480, 206039, + 218888, 232015, 245406, 259048, 272928, 287032, 301346, 315856, 330548, + 345407, 360419, 375568, 390841, 406221, 421693, 437243, 452854, 468513, + 484202, 499907 }; static void fly(struct ProgressData *bar, bool moved) @@ -78,13 +79,13 @@ static void fly(struct ProgressData *bar, bool moved) memcpy(&buf[bar->bar + 1], "-=O=-", 5); - pos = sinus[bar->tick%200] / (1000000 / check) + 1; + pos = sinus[bar->tick % 200] / (1000000 / check) + 1; buf[pos] = '#'; - pos = sinus[(bar->tick + 5)%200] / (1000000 / check) + 1; + pos = sinus[(bar->tick + 5) % 200] / (1000000 / check) + 1; buf[pos] = '#'; - pos = sinus[(bar->tick + 10)%200] / (1000000 / check) + 1; + pos = sinus[(bar->tick + 10) % 200] / (1000000 / check) + 1; buf[pos] = '#'; - pos = sinus[(bar->tick + 15)%200] / (1000000 / check) + 1; + pos = sinus[(bar->tick + 15) % 200] / (1000000 / check) + 1; buf[pos] = '#'; fputs(buf, bar->out); @@ -201,7 +202,7 @@ int tool_progress_cb(void *clientp, frac = (double)point / (double)total; percent = frac * 100.0; barwidth = bar->width - 7; - num = (size_t) (((double)barwidth) * frac); + num = (size_t)(((double)barwidth) * frac); if(num > MAX_BARLENGTH) num = MAX_BARLENGTH; memset(line, '#', num); diff --git a/src/tool_cb_prg.h b/src/tool_cb_prg.h index 1f005dbfc4e9..a8b8930616f3 100644 --- a/src/tool_cb_prg.h +++ b/src/tool_cb_prg.h @@ -29,12 +29,12 @@ #define CURL_PROGRESS_BAR 1 struct ProgressData { - int calls; - curl_off_t prev; + int calls; + curl_off_t prev; struct curltime prevtime; - int width; - FILE *out; /* where to write everything to */ - curl_off_t initial_size; + int width; + FILE *out; /* where to write everything to */ + curl_off_t initial_size; unsigned int tick; int bar; int barmove; diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 0f2bf8177198..1de2277cd084 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -137,7 +137,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) #endif } else { - rc = read(per->infd, buffer, sz*nmemb); + rc = read(per->infd, buffer, sz * nmemb); if(rc < 0) { if(errno == EAGAIN) { errno = 0; diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 5696df2a5935..1b76565399cd 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -66,7 +66,7 @@ bool tool_create_output_file(struct OutStruct *outs, while(fd == -1 && /* have not successfully opened a file */ (errno == EEXIST || errno == EISDIR) && /* because we keep having files that already exist */ - next_num < 100 /* and we have not reached the retry limit */ ) { + next_num < 100 /* and we have not reached the retry limit */) { curlx_dyn_reset(&fbuffer); if(curlx_dyn_addf(&fbuffer, "%s.%d", fname, next_num)) return FALSE; @@ -158,12 +158,12 @@ static size_t win_console(intptr_t fhnd, struct OutStruct *outs, } if(complete) { - WCHAR prefix[3] = {0}; /* UTF-16 (1-2 WCHARs) + NUL */ + WCHAR prefix[3] = { 0 }; /* UTF-16 (1-2 WCHARs) + NUL */ if(MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)outs->utf8seq, -1, prefix, CURL_ARRAYSIZE(prefix))) { DEBUGASSERT(prefix[2] == L'\0'); - if(!WriteConsoleW((HANDLE) fhnd, prefix, prefix[1] ? 2 : 1, + if(!WriteConsoleW((HANDLE)fhnd, prefix, prefix[1] ? 2 : 1, &chars_written, NULL)) { return CURL_WRITEFUNC_ERROR; } diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 0eac0185f280..5652229d4b79 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -39,10 +39,13 @@ #endif #endif -#define checkprefix(a,b) curl_strnequal(b, STRCONST(a)) +#define checkprefix(a, b) curl_strnequal(b, STRCONST(a)) -#define tool_safefree(ptr) \ - do { curlx_free((ptr)); (ptr) = NULL;} while(0) +#define tool_safefree(ptr) \ + do { \ + curlx_free(ptr); \ + (ptr) = NULL; \ + } while(0) extern struct GlobalConfig *global; diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index 31962bd1c546..058403d66688 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -31,7 +31,7 @@ #include "tool_msgs.h" #if defined(_WIN32) || (defined(MSDOS) && !defined(__DJGPP__)) -# define mkdir(x,y) (mkdir)((x)) +# define mkdir(x, y) (mkdir)((x)) # ifndef F_OK # define F_OK 0 # endif @@ -112,7 +112,7 @@ CURLcode create_dir_hierarchy(const char *outfile) exist, since we would be creating it erroneously. eg if outfile is X:\foo\bar\filename then do not mkdir X: This logic takes into account unsupported drives !:, 1:, etc. */ - if(len > 1 && (outfile[1]==':')) + if(len > 1 && (outfile[1] == ':')) skip = TRUE; } #endif diff --git a/src/tool_doswin.c b/src/tool_doswin.c index ee236178c276..040792f465a7 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -63,14 +63,13 @@ /* only used by msdosify() */ static SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos); -static SANITIZEcode msdosify(char **const sanitized, const char *file_name, +static SANITIZEcode msdosify(char ** const sanitized, const char *file_name, int flags); #endif -static SANITIZEcode rename_if_reserved_dos(char **const sanitized, +static SANITIZEcode rename_if_reserved_dos(char ** const sanitized, const char *file_name, int flags); - /* Sanitize a file or path name. @@ -96,7 +95,7 @@ is in a UNC prefixed path. Success: (SANITIZE_ERR_OK) *sanitized points to a sanitized copy of file_name. Failure: (!= SANITIZE_ERR_OK) *sanitized is NULL. */ -SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, +SANITIZEcode sanitize_file_name(char ** const sanitized, const char *file_name, int flags) { char *p, *target; @@ -116,16 +115,16 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, #ifndef MSDOS if(file_name[0] == '\\' && file_name[1] == '\\') /* UNC prefixed path \\ (eg \\?\C:\foo) */ - max_sanitized_len = 32767-1; + max_sanitized_len = 32767 - 1; else #endif - max_sanitized_len = PATH_MAX-1; + max_sanitized_len = PATH_MAX - 1; } else /* The maximum length of a filename. FILENAME_MAX is often the same as PATH_MAX, in other words it is 260 and does not discount the path information therefore we should not use it. */ - max_sanitized_len = (PATH_MAX-1 > 255) ? 255 : PATH_MAX-1; + max_sanitized_len = (PATH_MAX - 1 > 255) ? 255 : PATH_MAX - 1; len = strlen(file_name); if(len > max_sanitized_len) @@ -287,17 +286,18 @@ sanitize_file_name. Success: (SANITIZE_ERR_OK) *sanitized points to a sanitized copy of file_name. Failure: (!= SANITIZE_ERR_OK) *sanitized is NULL. */ -static SANITIZEcode msdosify(char **const sanitized, const char *file_name, +static SANITIZEcode msdosify(char ** const sanitized, const char *file_name, int flags) { char dos_name[PATH_MAX]; - static const char illegal_chars_dos[] = ".+, ;=[]" /* illegal in DOS */ + static const char illegal_chars_dos[] = + ".+, ;=[]" /* illegal in DOS */ "|<>/\\\":?*"; /* illegal in DOS & W95 */ static const char *illegal_chars_w95 = &illegal_chars_dos[8]; int idx, dot_idx; const char *s = file_name; char *d = dos_name; - const char *const dlimit = dos_name + sizeof(dos_name) - 1; + const char * const dlimit = dos_name + sizeof(dos_name) - 1; const char *illegal_aliens = illegal_chars_dos; size_t len = sizeof(illegal_chars_dos) - 1; @@ -309,7 +309,7 @@ static SANITIZEcode msdosify(char **const sanitized, const char *file_name, if(!file_name) return SANITIZE_ERR_BAD_ARGUMENT; - if(strlen(file_name) > PATH_MAX-1) + if(strlen(file_name) > PATH_MAX - 1) return SANITIZE_ERR_INVALID_PATH; /* Support for Windows 9X VFAT systems, when available. */ @@ -322,7 +322,8 @@ static SANITIZEcode msdosify(char **const sanitized, const char *file_name, if(s[0] >= 'A' && s[0] <= 'z' && s[1] == ':') { *d++ = *s++; *d = ((flags & SANITIZE_ALLOW_PATH)) ? ':' : '_'; - ++d; ++s; + ++d; + ++s; } for(idx = 0, dot_idx = -1; *s && d < dlimit; s++, d++) { @@ -373,7 +374,7 @@ static SANITIZEcode msdosify(char **const sanitized, const char *file_name, *d++ = 'x'; if(d == dlimit) break; - *d = 'x'; + *d = 'x'; } else { /* libg++ etc. */ @@ -381,7 +382,7 @@ static SANITIZEcode msdosify(char **const sanitized, const char *file_name, *d++ = 'x'; if(d == dlimit) break; - *d = 'x'; + *d = 'x'; } else { memcpy(d, "plus", 4); @@ -431,7 +432,7 @@ sanitize_file_name. Success: (SANITIZE_ERR_OK) *sanitized points to a sanitized copy of file_name. Failure: (!= SANITIZE_ERR_OK) *sanitized is NULL. */ -static SANITIZEcode rename_if_reserved_dos(char **const sanitized, +static SANITIZEcode rename_if_reserved_dos(char ** const sanitized, const char *file_name, int flags) { @@ -462,7 +463,7 @@ static SANITIZEcode rename_if_reserved_dos(char **const sanitized, } #endif - if(len > PATH_MAX-1) + if(len > PATH_MAX - 1) return SANITIZE_ERR_INVALID_PATH; memcpy(fname, file_name, len); @@ -511,7 +512,7 @@ static SANITIZEcode rename_if_reserved_dos(char **const sanitized, p_len = strlen(p); /* Prepend a '_' */ - if(strlen(fname) == PATH_MAX-1) + if(strlen(fname) == PATH_MAX - 1) return SANITIZE_ERR_INVALID_PATH; memmove(p + 1, p, p_len + 1); p[0] = '_'; @@ -534,7 +535,7 @@ static SANITIZEcode rename_if_reserved_dos(char **const sanitized, /* Prepend a '_' */ size_t blen = strlen(base); if(blen) { - if(strlen(fname) >= PATH_MAX-1) + if(strlen(fname) >= PATH_MAX - 1) return SANITIZE_ERR_INVALID_PATH; memmove(base + 1, base, blen + 1); base[0] = '_'; @@ -613,7 +614,7 @@ struct curl_slist *GetLoadedModulePaths(void) struct curl_slist *slist = NULL; #ifndef CURL_WINDOWS_UWP HANDLE hnd = INVALID_HANDLE_VALUE; - MODULEENTRY32 mod = {0}; + MODULEENTRY32 mod = { 0 }; mod.dwSize = sizeof(MODULEENTRY32); @@ -763,7 +764,8 @@ static DWORD WINAPI win_stdin_thread_func(void *thread_data) SOCKADDR_IN clientAddr; int clientAddrLen = sizeof(clientAddr); - curl_socket_t socket_w = CURL_ACCEPT(tdata->socket_l, (SOCKADDR*)&clientAddr, + curl_socket_t socket_w = CURL_ACCEPT(tdata->socket_l, + (SOCKADDR *)&clientAddr, &clientAddrLen); if(socket_w == CURL_SOCKET_BAD) { @@ -822,7 +824,7 @@ curl_socket_t win32_stdin_read_thread(void) do { /* Prepare handles for thread */ - tdata = (struct win_thread_data*) + tdata = (struct win_thread_data *) curlx_calloc(1, sizeof(struct win_thread_data)); if(!tdata) { errorf("curlx_calloc() error"); @@ -841,14 +843,14 @@ curl_socket_t win32_stdin_read_thread(void) selfaddr.sin_family = AF_INET; selfaddr.sin_addr.S_un.S_addr = htonl(INADDR_LOOPBACK); /* Bind to any available loopback port */ - result = bind(tdata->socket_l, (SOCKADDR*)&selfaddr, socksize); + result = bind(tdata->socket_l, (SOCKADDR *)&selfaddr, socksize); if(result == SOCKET_ERROR) { errorf("bind error: %d", SOCKERRNO); break; } /* Bind to any available loopback port */ - result = getsockname(tdata->socket_l, (SOCKADDR*)&selfaddr, &socksize); + result = getsockname(tdata->socket_l, (SOCKADDR *)&selfaddr, &socksize); if(result == SOCKET_ERROR) { errorf("getsockname error: %d", SOCKERRNO); break; @@ -892,7 +894,7 @@ curl_socket_t win32_stdin_read_thread(void) /* Hard close the socket on closesocket() */ setsockopt(socket_r, SOL_SOCKET, SO_DONTLINGER, 0, 0); - if(connect(socket_r, (SOCKADDR*)&selfaddr, socksize) == SOCKET_ERROR) { + if(connect(socket_r, (SOCKADDR *)&selfaddr, socksize) == SOCKET_ERROR) { errorf("connect error: %d", SOCKERRNO); break; } diff --git a/src/tool_doswin.h b/src/tool_doswin.h index 01500bdbf732..75f4bacdb8c2 100644 --- a/src/tool_doswin.h +++ b/src/tool_doswin.h @@ -27,8 +27,8 @@ #if defined(_WIN32) || defined(MSDOS) -#define SANITIZE_ALLOW_PATH (1<<1) /* Allow path separators and colons */ -#define SANITIZE_ALLOW_RESERVED (1<<2) /* Allow reserved device names */ +#define SANITIZE_ALLOW_PATH (1 << 1) /* Allow path separators and colons */ +#define SANITIZE_ALLOW_RESERVED (1 << 2) /* Allow reserved device names */ typedef enum { SANITIZE_ERR_OK = 0, /* 0 - OK */ @@ -38,7 +38,7 @@ typedef enum { SANITIZE_ERR_LAST /* never use! */ } SANITIZEcode; -SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, +SANITIZEcode sanitize_file_name(char ** const sanitized, const char *file_name, int flags); #ifdef __DJGPP__ diff --git a/src/tool_easysrc.c b/src/tool_easysrc.c index 4747f6dfe6bb..ba9d345645c0 100644 --- a/src/tool_easysrc.c +++ b/src/tool_easysrc.c @@ -41,7 +41,7 @@ struct slist_wc *easysrc_clean; /* Clean up allocated data */ int easysrc_mime_count; int easysrc_slist_count; -static const char *const srchead[]={ +static const char * const srchead[] = { "/********* Sample code generated by the curl command line tool **********", " * All curl_easy_setopt() options are documented at:", " * https://curl.se/libcurl/c/curl_easy_setopt.html", @@ -57,7 +57,7 @@ static const char *const srchead[]={ /* easysrc_decl declarations come here */ /* easysrc_data initialization come here */ /* easysrc_code statements come here */ -static const char *const srchard[]={ +static const char * const srchard[] = { "/* Here is a list of options the curl code used that cannot get generated", " as source easily. You may choose to either not use them or implement", " them yourself.", diff --git a/src/tool_filetime.c b/src/tool_filetime.c index 041cc4dbd6cb..2d362b4bb7cb 100644 --- a/src/tool_filetime.c +++ b/src/tool_filetime.c @@ -51,8 +51,8 @@ int getfiletime(const char *filename, curl_off_t *stamp) if(hfile != INVALID_HANDLE_VALUE) { FILETIME ft; if(GetFileTime(hfile, NULL, NULL, &ft)) { - curl_off_t converted = (curl_off_t)ft.dwLowDateTime - | ((curl_off_t)ft.dwHighDateTime) << 32; + curl_off_t converted = (curl_off_t)ft.dwLowDateTime | + ((curl_off_t)ft.dwHighDateTime) << 32; if(converted < 116444736000000000) warnf("Failed to get filetime: underflow"); diff --git a/src/tool_filetime.h b/src/tool_filetime.h index c3663617b533..fedb7a195792 100644 --- a/src/tool_filetime.h +++ b/src/tool_filetime.h @@ -31,7 +31,7 @@ int getfiletime(const char *filename, curl_off_t *stamp); (defined(_WIN32) && (SIZEOF_CURL_OFF_T >= 8)) void setfiletime(curl_off_t filetime, const char *filename); #else -#define setfiletime(a,b,c) tool_nop_stmt +#define setfiletime(a, b, c) tool_nop_stmt #endif #endif /* HEADER_CURL_TOOL_FILETIME_H */ diff --git a/src/tool_findfile.c b/src/tool_findfile.c index 4dbd7bccb470..c962eb86b8cb 100644 --- a/src/tool_findfile.c +++ b/src/tool_findfile.c @@ -51,7 +51,7 @@ static const struct finder conf_list[] = { #ifdef _WIN32 { "USERPROFILE", NULL, FALSE }, { "APPDATA", NULL, FALSE }, - { "USERPROFILE", "\\Application Data", FALSE}, + { "USERPROFILE", "\\Application Data", FALSE }, #endif /* these are for .curlrc if XDG_CONFIG_HOME is not defined */ { "CURL_HOME", "/.config", TRUE }, diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 181abf7b8627..543f817cc3e4 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -86,8 +86,8 @@ static curl_off_t uztoso(size_t uznum) # pragma warning(disable:4310) /* cast truncates constant value */ #endif - DEBUGASSERT(uznum <= (size_t) CURL_MASK_SCOFFT); - return (curl_off_t)(uznum & (size_t) CURL_MASK_SCOFFT); + DEBUGASSERT(uznum <= (size_t)CURL_MASK_SCOFFT); + return (curl_off_t)(uznum & (size_t)CURL_MASK_SCOFFT); #if defined(__INTEL_COMPILER) || defined(_MSC_VER) # pragma warning(pop) @@ -192,12 +192,11 @@ void tool_mime_free(struct tool_mime *mime) } } - /* Mime part callbacks for stdin. */ size_t tool_mime_stdin_read(char *buffer, size_t size, size_t nitems, void *arg) { - struct tool_mime *sip = (struct tool_mime *) arg; + struct tool_mime *sip = (struct tool_mime *)arg; curl_off_t bytesleft; (void)size; /* Always 1: ignored. */ @@ -230,7 +229,7 @@ size_t tool_mime_stdin_read(char *buffer, int tool_mime_stdin_seek(void *instream, curl_off_t offset, int whence) { - struct tool_mime *sip = (struct tool_mime *) instream; + struct tool_mime *sip = (struct tool_mime *)instream; switch(whence) { case SEEK_CUR: @@ -296,8 +295,8 @@ static CURLcode tool2curlparts(CURL *curl, struct tool_mime *m, FALLTHROUGH(); case TOOLMIME_STDINDATA: ret = curl_mime_data_cb(part, m->size, - (curl_read_callback) tool_mime_stdin_read, - (curl_seek_callback) tool_mime_stdin_seek, + (curl_read_callback)tool_mime_stdin_read, + (curl_seek_callback)tool_mime_stdin_seek, NULL, m); break; @@ -372,8 +371,7 @@ static char *get_param_word(char **str, char **end_pos, char endchar) if(*ptr == '\\' && (ptr[1] == '\\' || ptr[1] == '"')) ++ptr; *ptr2++ = *ptr++; - } - while(ptr < *end_pos); + } while(ptr < *end_pos); *end_pos = ptr2; } ++ptr; @@ -428,7 +426,7 @@ static int read_field_headers(FILE *fp, struct curl_slist **pheaders) else if(ptr[0] == ' ') /* a continuation from the line before */ folded = TRUE; /* trim off trailing CRLFs and whitespaces */ - while(len && (ISNEWLINE(ptr[len -1]) || ISBLANK(ptr[len - 1]))) + while(len && (ISNEWLINE(ptr[len - 1]) || ISBLANK(ptr[len - 1]))) len--; if(!len) @@ -658,7 +656,6 @@ static int get_param_part(char endchar, return sep & 0xFF; } - /*************************************************************************** * * formparse() @@ -706,13 +703,13 @@ static int get_param_part(char endchar, * ***************************************************************************/ -#define SET_TOOL_MIME_PTR(m, field) \ - do { \ - if(field) { \ - (m)->field = curlx_strdup(field); \ - if(!(m)->field) \ - goto fail; \ - } \ +#define SET_TOOL_MIME_PTR(m, field) \ + do { \ + if(field) { \ + (m)->field = curlx_strdup(field); \ + if(!(m)->field) \ + goto fail; \ + } \ } while(0) int formparse(const char *input, @@ -811,9 +808,8 @@ int formparse(const char *input, part->headers = headers; headers = NULL; if(res == CURLE_READ_ERROR) { - /* An error occurred while reading stdin: if read has started, - issue the error now. Else, delay it until processed by - libcurl. */ + /* An error occurred while reading stdin: if read has started, + issue the error now. Else, delay it until processed by libcurl. */ if(part->size > 0) { warnf("error while reading standard input"); goto fail; @@ -838,8 +834,7 @@ int formparse(const char *input, if(sep < 0) goto fail; - part = tool_mime_new_filedata(*mimecurrent, data, FALSE, - &res); + part = tool_mime_new_filedata(*mimecurrent, data, FALSE, &res); if(!part) goto fail; part->headers = headers; @@ -879,7 +874,7 @@ int formparse(const char *input, SET_TOOL_MIME_PTR(part, encoder); if(sep) { - *contp = (char) sep; + *contp = (char)sep; warnf("garbage at end of field specification: %s", contp); } } diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 7afb0c5fc051..89385af84436 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -39,7 +39,7 @@ #include "var.h" #define ALLOW_BLANK TRUE -#define DENY_BLANK FALSE +#define DENY_BLANK FALSE static ParameterError getstr(char **str, const char *val, bool allowblank) { @@ -432,22 +432,22 @@ ParameterError parse_cert_parameter(const char *cert_parameter, case '\\': param_place++; switch(*param_place) { - case '\0': - *certname_place++ = '\\'; - break; - case '\\': - *certname_place++ = '\\'; - param_place++; - break; - case ':': - *certname_place++ = ':'; - param_place++; - break; - default: - *certname_place++ = '\\'; - *certname_place++ = *param_place; - param_place++; - break; + case '\0': + *certname_place++ = '\\'; + break; + case '\\': + *certname_place++ = '\\'; + param_place++; + break; + case ':': + *certname_place++ = ':'; + param_place++; + break; + default: + *certname_place++ = '\\'; + *certname_place++ = *param_place; + param_place++; + break; } break; case ':': @@ -459,7 +459,7 @@ ParameterError parse_cert_parameter(const char *cert_parameter, #ifdef _WIN32 if((param_place == &cert_parameter[1]) && (cert_parameter[2] == '\\' || cert_parameter[2] == '/') && - (ISALPHA(cert_parameter[0])) ) { + (ISALPHA(cert_parameter[0]))) { /* colon in the second column, followed by a backslash, and the first character is an alphabetic letter: @@ -503,7 +503,7 @@ static size_t replace_url_encoded_space_by_plus(char *url) url[new_index] = '+'; orig_index += 3; } - else{ + else { if(new_index != orig_index) { url[new_index] = url[orig_index]; } @@ -517,8 +517,8 @@ static size_t replace_url_encoded_space_by_plus(char *url) return new_index; /* new size */ } -static ParameterError -GetFileAndPassword(const char *nextarg, char **file, char **password) +static ParameterError GetFileAndPassword(const char *nextarg, char **file, + char **password) { char *certname, *passphrase; ParameterError err; @@ -558,15 +558,15 @@ static ParameterError GetSizeParameter(const char *arg, switch(*unit) { case 'G': case 'g': - if(value > (CURL_OFF_T_MAX / (1024*1024*1024))) + if(value > (CURL_OFF_T_MAX / (1024 * 1024 * 1024))) return PARAM_NUMBER_TOO_LARGE; - value *= 1024*1024*1024; + value *= 1024 * 1024 * 1024; break; case 'M': case 'm': - if(value > (CURL_OFF_T_MAX / (1024*1024))) + if(value > (CURL_OFF_T_MAX / (1024 * 1024))) return PARAM_NUMBER_TOO_LARGE; - value *= 1024*1024; + value *= 1024 * 1024; break; case 'K': case 'k': @@ -602,7 +602,7 @@ static void cleanarg(char *str) #endif /* the maximum size we allow the dynbuf generated string */ -#define MAX_DATAURLENCODE (500*1024*1024) +#define MAX_DATAURLENCODE (500 * 1024 * 1024) /* --data-urlencode */ static ParameterError data_urlencode(const char *nextarg, @@ -706,8 +706,7 @@ static ParameterError data_urlencode(const char *nextarg, return err; } -static void sethttpver(struct OperationConfig *config, - long httpversion) +static void sethttpver(struct OperationConfig *config, long httpversion) { if(config->httpversion && (config->httpversion != httpversion)) @@ -732,20 +731,20 @@ static CURLcode set_trace_config(const char *token) len = strlen(token); switch(*token) { - case '-': - toggle = FALSE; - name = token + 1; - len--; - break; - case '+': - toggle = TRUE; - name = token + 1; - len--; - break; - default: - toggle = TRUE; - name = token; - break; + case '-': + toggle = FALSE; + name = token + 1; + len--; + break; + case '+': + toggle = TRUE; + name = token + 1; + len--; + break; + default: + toggle = TRUE; + name = token; + break; } if((len == 3) && curl_strnequal(name, "all", 3)) { @@ -816,37 +815,37 @@ struct TOSEntry { }; static const struct TOSEntry tos_entries[] = { - {"AF11", 0x28}, - {"AF12", 0x30}, - {"AF13", 0x38}, - {"AF21", 0x48}, - {"AF22", 0x50}, - {"AF23", 0x58}, - {"AF31", 0x68}, - {"AF32", 0x70}, - {"AF33", 0x78}, - {"AF41", 0x88}, - {"AF42", 0x90}, - {"AF43", 0x98}, - {"CE", 0x03}, - {"CS0", 0x00}, - {"CS1", 0x20}, - {"CS2", 0x40}, - {"CS3", 0x60}, - {"CS4", 0x80}, - {"CS5", 0xa0}, - {"CS6", 0xc0}, - {"CS7", 0xe0}, - {"ECT0", 0x02}, - {"ECT1", 0x01}, - {"EF", 0xb8}, - {"LE", 0x04}, - {"LOWCOST", 0x02}, - {"LOWDELAY", 0x10}, - {"MINCOST", 0x02}, - {"RELIABILITY", 0x04}, - {"THROUGHPUT", 0x08}, - {"VOICE-ADMIT", 0xb0} + { "AF11", 0x28 }, + { "AF12", 0x30 }, + { "AF13", 0x38 }, + { "AF21", 0x48 }, + { "AF22", 0x50 }, + { "AF23", 0x58 }, + { "AF31", 0x68 }, + { "AF32", 0x70 }, + { "AF33", 0x78 }, + { "AF41", 0x88 }, + { "AF42", 0x90 }, + { "AF43", 0x98 }, + { "CE", 0x03 }, + { "CS0", 0x00 }, + { "CS1", 0x20 }, + { "CS2", 0x40 }, + { "CS3", 0x60 }, + { "CS4", 0x80 }, + { "CS5", 0xa0 }, + { "CS6", 0xc0 }, + { "CS7", 0xe0 }, + { "ECT0", 0x02 }, + { "ECT1", 0x01 }, + { "EF", 0xb8 }, + { "LE", 0x04 }, + { "LOWCOST", 0x02 }, + { "LOWDELAY", 0x10 }, + { "MINCOST", 0x02 }, + { "RELIABILITY", 0x04 }, + { "THROUGHPUT", 0x08 }, + { "VOICE-ADMIT", 0xb0 } }; static int find_tos(const void *a, const void *b) @@ -986,9 +985,9 @@ static ParameterError set_rate(const char *nextarg) const char *div = strchr(nextarg, '/'); char number[26]; long denominator; - long numerator = 60*60*1000; /* default per hour */ + long numerator = 60 * 60 * 1000; /* default per hour */ size_t numlen = div ? (size_t)(div - nextarg) : strlen(nextarg); - if(numlen > sizeof(number) -1) + if(numlen > sizeof(number) - 1) return PARAM_NUMBER_TOO_LARGE; memcpy(number, nextarg, numlen); @@ -1012,12 +1011,12 @@ static ParameterError set_rate(const char *nextarg) numerator = 1000; break; case 'm': /* per minute */ - numerator = 60*1000; + numerator = 60 * 1000; break; case 'h': /* per hour */ break; case 'd': /* per day */ - numerator = 24*60*60*1000; + numerator = 24 * 60 * 60 * 1000; break; default: errorf("unsupported --rate unit"); @@ -1040,7 +1039,7 @@ static ParameterError set_rate(const char *nextarg) else if(denominator > numerator) err = PARAM_NUMBER_TOO_LARGE; else - global->ms_per_transfer = numerator/denominator; + global->ms_per_transfer = numerator / denominator; return err; } @@ -1133,7 +1132,6 @@ static ParameterError parse_url(struct OperationConfig *config, return add_url(config, nextarg, FALSE); } - static ParameterError parse_localport(struct OperationConfig *config, const char *nextarg) { @@ -1163,7 +1161,7 @@ static ParameterError parse_localport(struct OperationConfig *config, else { if(str2unummax(&config->localportrange, pp, 65535)) return PARAM_BAD_USE; - config->localportrange -= (config->localport-1); + config->localportrange -= (config->localport - 1); if(config->localportrange < 1) return PARAM_BAD_USE; } @@ -1237,7 +1235,7 @@ static ParameterError parse_ech(struct OperationConfig *config, curlx_fclose(file); if(err) return err; - config->ech_config = curl_maprintf("ecl:%s",tmpcfg); + config->ech_config = curl_maprintf("ecl:%s", tmpcfg); curlx_free(tmpcfg); if(!config->ech_config) return PARAM_NO_MEM; @@ -1268,7 +1266,7 @@ static ParameterError parse_header(struct OperationConfig *config, else { struct dynbuf line; bool error = FALSE; - curlx_dyn_init(&line, 1024*100); + curlx_dyn_init(&line, 1024 * 100); while(my_get_line(file, &line, &error)) { const char *ptr = curlx_dyn_ptr(&line); err = add2list(cmd == C_PROXY_HEADER ? /* --proxy-header? */ @@ -1287,7 +1285,7 @@ static ParameterError parse_header(struct OperationConfig *config, else { if(!strchr(nextarg, ':') && !strchr(nextarg, ';')) { warnf("The provided %s header '%s' does not look like a header?", - (cmd == C_PROXY_HEADER) ? "proxy": "HTTP", nextarg); + (cmd == C_PROXY_HEADER) ? "proxy" : "HTTP", nextarg); } if(cmd == C_PROXY_HEADER) /* --proxy-header */ err = add2list(&config->proxyheaders, nextarg); @@ -1629,12 +1627,12 @@ struct flagmap { }; static const struct flagmap flag_table[] = { - {"answered", 8, CURLULFLAG_ANSWERED}, - {"deleted", 7, CURLULFLAG_DELETED}, - {"draft", 5, CURLULFLAG_DRAFT}, - {"flagged", 7, CURLULFLAG_FLAGGED}, - {"seen", 4, CURLULFLAG_SEEN}, - {NULL, 0, 0} + { "answered", 8, CURLULFLAG_ANSWERED }, + { "deleted", 7, CURLULFLAG_DELETED }, + { "draft", 5, CURLULFLAG_DRAFT }, + { "flagged", 7, CURLULFLAG_FLAGGED }, + { "seen", 4, CURLULFLAG_SEEN }, + { NULL, 0, 0 } }; static ParameterError parse_upload_flags(struct OperationConfig *config, @@ -2902,7 +2900,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ p = word; /* is there an '=' ? */ if(!curlx_str_until(&p, &out, MAX_OPTION_LEN, '=') && - !curlx_str_single(&p, '=') ) { + !curlx_str_single(&p, '=')) { /* there is an equal sign */ char tempword[MAX_OPTION_LEN + 1]; memcpy(tempword, curlx_str(&out), curlx_strlen(&out)); diff --git a/src/tool_getparam.h b/src/tool_getparam.h index d4812f6cebca..10b235187436 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -319,12 +319,12 @@ typedef enum { #define ARG_FILE 3 /* requires an argument, usually a filename */ #define ARG_TYPEMASK 0x03 -#define ARGTYPE(x) ((x) & ARG_TYPEMASK) +#define ARGTYPE(x) ((x) & ARG_TYPEMASK) -#define ARG_DEPR 0x10 /* deprecated option */ +#define ARG_DEPR 0x10 /* deprecated option */ #define ARG_CLEAR 0x20 /* clear cmdline argument */ -#define ARG_TLS 0x40 /* requires TLS support */ -#define ARG_NO 0x80 /* set if the option is documented as --no-* */ +#define ARG_TLS 0x40 /* requires TLS support */ +#define ARG_NO 0x80 /* set if the option is documented as --no-* */ struct LongShort { const char *lname; /* long name option */ @@ -383,7 +383,7 @@ ParameterError parse_args(int argc, argv_item_t argv[]); #define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) #define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) -#define unicodefree(ptr) curlx_unicodefree(ptr) +#define unicodefree(ptr) curlx_unicodefree(ptr) #else diff --git a/src/tool_getpass.c b/src/tool_getpass.c index b0316510bc23..f2423790fe2a 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -98,17 +98,16 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) buffer[i] = '\0'; break; } - else - if(buffer[i] == '\b') - /* remove this letter and if this is not the first key, remove the + else if(buffer[i] == '\b') + /* remove this letter and if this is not the first key, remove the previous one as well */ - i = i - (i >= 1 ? 2 : 1); + i = i - (i >= 1 ? 2 : 1); } /* since echo is disabled, print a newline */ fputs("\n", tool_stderr); /* if user did not hit ENTER, terminate buffer */ if(i == buflen) - buffer[buflen-1] = '\0'; + buffer[buflen - 1] = '\0'; return buffer; /* we always return success */ } diff --git a/src/tool_help.c b/src/tool_help.c index bbe8dc68a4c3..7355d2a7822f 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -41,31 +41,31 @@ struct category_descriptors { static const struct category_descriptors categories[] = { /* important is left out because it is the default help page */ - {"auth", "Authentication methods", CURLHELP_AUTH}, - {"connection", "Manage connections", CURLHELP_CONNECTION}, - {"curl", "The command line tool itself", CURLHELP_CURL}, - {"deprecated", "Legacy", CURLHELP_DEPRECATED}, - {"dns", "Names and resolving", CURLHELP_DNS}, - {"file", "FILE protocol", CURLHELP_FILE}, - {"ftp", "FTP protocol", CURLHELP_FTP}, - {"global", "Global options", CURLHELP_GLOBAL}, - {"http", "HTTP and HTTPS protocol", CURLHELP_HTTP}, - {"imap", "IMAP protocol", CURLHELP_IMAP}, - {"ldap", "LDAP protocol", CURLHELP_LDAP}, - {"output", "File system output", CURLHELP_OUTPUT}, - {"pop3", "POP3 protocol", CURLHELP_POP3}, - {"post", "HTTP POST specific", CURLHELP_POST}, - {"proxy", "Options for proxies", CURLHELP_PROXY}, - {"scp", "SCP protocol", CURLHELP_SCP}, - {"sftp", "SFTP protocol", CURLHELP_SFTP}, - {"smtp", "SMTP protocol", CURLHELP_SMTP}, - {"ssh", "SSH protocol", CURLHELP_SSH}, - {"telnet", "TELNET protocol", CURLHELP_TELNET}, - {"tftp", "TFTP protocol", CURLHELP_TFTP}, - {"timeout", "Timeouts and delays", CURLHELP_TIMEOUT}, - {"tls", "TLS/SSL related", CURLHELP_TLS}, - {"upload", "Upload, sending data", CURLHELP_UPLOAD}, - {"verbose", "Tracing, logging etc", CURLHELP_VERBOSE} + { "auth", "Authentication methods", CURLHELP_AUTH }, + { "connection", "Manage connections", CURLHELP_CONNECTION }, + { "curl", "The command line tool itself", CURLHELP_CURL }, + { "deprecated", "Legacy", CURLHELP_DEPRECATED }, + { "dns", "Names and resolving", CURLHELP_DNS }, + { "file", "FILE protocol", CURLHELP_FILE }, + { "ftp", "FTP protocol", CURLHELP_FTP }, + { "global", "Global options", CURLHELP_GLOBAL }, + { "http", "HTTP and HTTPS protocol", CURLHELP_HTTP }, + { "imap", "IMAP protocol", CURLHELP_IMAP }, + { "ldap", "LDAP protocol", CURLHELP_LDAP }, + { "output", "File system output", CURLHELP_OUTPUT }, + { "pop3", "POP3 protocol", CURLHELP_POP3 }, + { "post", "HTTP POST specific", CURLHELP_POST }, + { "proxy", "Options for proxies", CURLHELP_PROXY }, + { "scp", "SCP protocol", CURLHELP_SCP }, + { "sftp", "SFTP protocol", CURLHELP_SFTP }, + { "smtp", "SMTP protocol", CURLHELP_SMTP }, + { "ssh", "SSH protocol", CURLHELP_SSH }, + { "telnet", "TELNET protocol", CURLHELP_TELNET }, + { "tftp", "TFTP protocol", CURLHELP_TFTP }, + { "timeout", "Timeouts and delays", CURLHELP_TIMEOUT }, + { "tls", "TLS/SSL related", CURLHELP_TLS }, + { "upload", "Upload, sending data", CURLHELP_UPLOAD }, + { "verbose", "Tracing, logging etc", CURLHELP_VERBOSE } }; static void print_category(unsigned int category, unsigned int cols) @@ -228,7 +228,8 @@ void tool_help(const char *category) unsigned int cols = get_terminal_columns(); /* If no category was provided */ if(!category) { - const char *category_note = "\nThis is not the full help; this " + const char *category_note = + "\nThis is not the full help; this " "menu is split into categories.\nUse \"--help category\" to get " "an overview of all categories, which are:"; const char *category_note2 = @@ -303,7 +304,7 @@ void tool_help(const char *category) static bool is_debug(void) { - const char *const *builtin; + const char * const *builtin; for(builtin = feature_names; *builtin; ++builtin) if(curl_strequal("debug", *builtin)) return TRUE; @@ -312,7 +313,7 @@ static bool is_debug(void) void tool_version_info(void) { - const char *const *builtin; + const char * const *builtin; if(is_debug()) curl_mfprintf(tool_stderr, "WARNING: this libcurl is Debug-enabled, " "do not use in production\n\n"); diff --git a/src/tool_helpers.c b/src/tool_helpers.c index 2e308a248f13..c32e1bbaabe1 100644 --- a/src/tool_helpers.c +++ b/src/tool_helpers.c @@ -75,7 +75,7 @@ const char *param2text(ParameterError error) int SetHTTPrequest(HttpReq req, HttpReq *store) { /* this mirrors the HttpReq enum in tool_sdecls.h */ - const char *reqname[]= { + const char *reqname[] = { "", /* unspec */ "GET (-G, --get)", "HEAD (-I, --head)", @@ -99,7 +99,7 @@ int SetHTTPrequest(HttpReq req, HttpReq *store) void customrequest_helper(HttpReq req, char *method) { /* this mirrors the HttpReq enum in tool_sdecls.h */ - const char *dflt[]= { + const char *dflt[] = { "GET", "GET", "HEAD", diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index c1d27fc99b09..25bff3152f7c 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -157,8 +157,8 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, } /* check for unsupported gateway parts */ - if(curl_url_get(gatewayurl, CURLUPART_QUERY, &gwquery, 0) - != CURLUE_NO_QUERY) { + if(curl_url_get(gatewayurl, CURLUPART_QUERY, &gwquery, 0) != + CURLUE_NO_QUERY) { result = CURLE_URL_MALFORMAT; goto clean; } diff --git a/src/tool_libinfo.c b/src/tool_libinfo.c index 1687005481a9..18e0d6964ee5 100644 --- a/src/tool_libinfo.c +++ b/src/tool_libinfo.c @@ -137,7 +137,7 @@ size_t feature_count; CURLcode get_libcurl_info(void) { CURLcode result = CURLE_OK; - const char *const *builtin; + const char * const *builtin; /* Pointer to libcurl's runtime version information */ curlinfo = curl_version_info(CURLVERSION_NOW); diff --git a/src/tool_main.c b/src/tool_main.c index eb15ae740dd1..3784f280f645 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -109,7 +109,7 @@ static void memory_tracking_init(void) /* use the value as filename */ char fname[512]; if(strlen(env) >= sizeof(fname)) - env[sizeof(fname)-1] = '\0'; + env[sizeof(fname) - 1] = '\0'; strcpy(fname, env); curl_free(env); curl_dbg_memdebug(fname); diff --git a/src/tool_main.h b/src/tool_main.h index 53ee9a3702a7..757861632038 100644 --- a/src/tool_main.h +++ b/src/tool_main.h @@ -30,10 +30,10 @@ #define RETRY_SLEEP_DEFAULT 1000L /* ms */ #define RETRY_SLEEP_MAX 600000L /* ms == 10 minutes */ -#define MAX_PARALLEL 65535 +#define MAX_PARALLEL 65535 #define PARALLEL_DEFAULT 50 -#define MAX_PARALLEL_HOST 65535 +#define MAX_PARALLEL_HOST 65535 #define PARALLEL_HOST_DEFAULT 0 /* means not used */ #endif /* HEADER_CURL_TOOL_MAIN_H */ diff --git a/src/tool_msgs.c b/src/tool_msgs.c index b385f75cf8b8..b4fc1fb6fd5a 100644 --- a/src/tool_msgs.c +++ b/src/tool_msgs.c @@ -28,8 +28,8 @@ #include "tool_cb_prg.h" #include "terminal.h" -#define WARN_PREFIX "Warning: " -#define NOTE_PREFIX "Note: " +#define WARN_PREFIX "Warning: " +#define NOTE_PREFIX "Note: " #define ERROR_PREFIX "curl: " static void voutf(const char *prefix, @@ -53,7 +53,7 @@ static void voutf(const char *prefix, fputs(prefix, tool_stderr); if(len > width) { - size_t cut = width-1; + size_t cut = width - 1; while(!ISBLANK(ptr[cut]) && cut) { cut--; @@ -61,7 +61,7 @@ static void voutf(const char *prefix, if(cut == 0) /* not a single cutting position was found, just cut it at the max text width then! */ - cut = width-1; + cut = width - 1; (void)fwrite(ptr, cut + 1, 1, tool_stderr); fputs("\n", tool_stderr); @@ -121,9 +121,9 @@ void helpf(const char *fmt, ...) } curl_mfprintf(tool_stderr, "curl: try 'curl --help' " #ifdef USE_MANUAL - "or 'curl --manual' " + "or 'curl --manual' " #endif - "for more information\n"); + "for more information\n"); } /* diff --git a/src/tool_msgs.h b/src/tool_msgs.h index 99a980234a23..be75d95593ef 100644 --- a/src/tool_msgs.h +++ b/src/tool_msgs.h @@ -26,13 +26,9 @@ #include "tool_setup.h" #include "tool_cfgable.h" -void warnf(const char *fmt, ...) - CURL_PRINTF(1, 2); -void notef(const char *fmt, ...) - CURL_PRINTF(1, 2); -void helpf(const char *fmt, ...) - CURL_PRINTF(1, 2); -void errorf(const char *fmt, ...) - CURL_PRINTF(1, 2); +void warnf(const char *fmt, ...) CURL_PRINTF(1, 2); +void notef(const char *fmt, ...) CURL_PRINTF(1, 2); +void helpf(const char *fmt, ...) CURL_PRINTF(1, 2); +void errorf(const char *fmt, ...) CURL_PRINTF(1, 2); #endif /* HEADER_CURL_TOOL_MSGS_H */ diff --git a/src/tool_operate.c b/src/tool_operate.c index 71d29af8d8b0..25c1473b9685 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -155,7 +155,7 @@ static curl_off_t vms_realfilesize(const char *name, char buffer[8192]; curl_off_t count; int ret_stat; - FILE * file; + FILE *file; /* !checksrc! disable FOPENMODE 1 */ file = curlx_fopen(name, "r"); /* VMS */ @@ -180,8 +180,7 @@ static curl_off_t vms_realfilesize(const char *name, * if not to call a routine to get the correct size. * */ -static curl_off_t VmsSpecialSize(const char *name, - const struct_stat *stat_buf) +static curl_off_t VmsSpecialSize(const char *name, const struct_stat *stat_buf) { switch(stat_buf->st_fab_rfm) { case FAB$C_VAR: @@ -451,7 +450,7 @@ static CURLcode retrycheck(struct OperationConfig *config, if(retry) { long sleeptime = 0; curl_off_t retry_after = 0; - static const char * const m[]={ + static const char * const m[] = { NULL, "(retrying all errors)", ": timeout", @@ -465,7 +464,7 @@ static CURLcode retrycheck(struct OperationConfig *config, curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after); if(retry_after) { /* store in a 'long', make sure it does not overflow */ - if(retry_after > LONG_MAX/1000) + if(retry_after > LONG_MAX / 1000) sleeptime = LONG_MAX; else if((retry_after * 1000) > sleeptime) sleeptime = (long)retry_after * 1000; /* milliseconds */ @@ -500,10 +499,10 @@ static CURLcode retrycheck(struct OperationConfig *config, warnf("Problem %s. " "Will retry in %ld%s%.*ld second%s. " "%ld retr%s left.", - m[retry], sleeptime/1000L, - (sleeptime%1000L ? "." : ""), - (sleeptime%1000L ? 3 : 0), - sleeptime%1000L, + m[retry], sleeptime / 1000L, + (sleeptime % 1000L ? "." : ""), + (sleeptime % 1000L ? 3 : 0), + sleeptime % 1000L, (sleeptime == 1000L ? "" : "s"), per->retry_remaining, (per->retry_remaining > 1 ? "ies" : "y")); @@ -547,8 +546,7 @@ static CURLcode retrycheck(struct OperationConfig *config, outs->init += outs->bytes; outs->bytes = 0; config->resume_from = outs->init; - curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, - config->resume_from); + curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, config->resume_from); } } @@ -562,8 +560,7 @@ static CURLcode retrycheck(struct OperationConfig *config, int rc; /* 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); + notef("Throwing away %" CURL_FORMAT_CURL_OFF_T " bytes", outs->bytes); /* truncate file at the position where we started appending */ #if defined(HAVE_FTRUNCATE) && !defined(__DJGPP__) && !defined(__AMIGA__) if(ftruncate(fileno(outs->stream), outs->init)) { @@ -595,7 +592,6 @@ static CURLcode retrycheck(struct OperationConfig *config, return result; } - /* * Call this after a transfer has completed. */ @@ -706,7 +702,7 @@ static CURLcode post_per_transfer(struct per_transfer *per, if(per->retry_remaining && (!config->retry_maxtime_ms || (curlx_timediff_ms(curlx_now(), per->retrystart) < - config->retry_maxtime_ms)) ) { + config->retry_maxtime_ms))) { result = retrycheck(config, per, result, retryp, delay); if(!result && *retryp) return CURLE_OK; /* retry! */ @@ -735,8 +731,7 @@ static CURLcode post_per_transfer(struct per_transfer *per, warnf("Failed removing: %s", outs->filename); } else - warnf("Skipping removal; not a regular file: %s", - outs->filename); + warnf("Skipping removal; not a regular file: %s", outs->filename); } } @@ -825,8 +820,7 @@ static CURLcode append2query(struct OperationConfig *config, CURLU *uh = curl_url(); if(uh) { CURLUcode uerr; - uerr = curl_url_set(uh, CURLUPART_URL, per->url, - CURLU_GUESS_SCHEME); + uerr = curl_url_set(uh, CURLUPART_URL, per->url, CURLU_GUESS_SCHEME); if(uerr) { result = urlerr_cvt(uerr); errorf("(%d) Could not parse the URL, " @@ -837,8 +831,7 @@ static CURLcode append2query(struct OperationConfig *config, char *updated = NULL; uerr = curl_url_set(uh, CURLUPART_QUERY, q, CURLU_APPENDQUERY); if(!uerr) - uerr = curl_url_get(uh, CURLUPART_URL, &updated, - CURLU_GUESS_SCHEME); + uerr = curl_url_get(uh, CURLUPART_URL, &updated, CURLU_GUESS_SCHEME); if(uerr) result = urlerr_cvt(uerr); else { @@ -1333,8 +1326,7 @@ static CURLcode single_transfer(struct OperationConfig *config, /* * We have specified a file to upload and it is not "-". */ - result = add_file_name_to_url(per->curl, &per->url, - per->uploadfile); + result = add_file_name_to_url(per->curl, &per->url, per->uploadfile); if(result) return result; } @@ -1370,8 +1362,7 @@ static CURLcode single_transfer(struct OperationConfig *config, } /* explicitly passed to stdout means okaying binary gunk */ - config->terminal_binary_ok = - (per->outfile && !strcmp(per->outfile, "-")); + config->terminal_binary_ok = (per->outfile && !strcmp(per->outfile, "-")); hdrcbdata->honor_cd_filename = (config->content_disposition && u->useremote); @@ -1428,7 +1419,7 @@ static CURLcode add_parallel_transfers(CURLM *multi, CURLSH *share, return CURLE_UNKNOWN_OPTION; } - if(nxfers < (curl_off_t)(global->parallel_max*2)) { + if(nxfers < (curl_off_t)(global->parallel_max * 2)) { bool skipped = FALSE; do { result = create_transfer(share, addedp, &skipped); @@ -1513,7 +1504,7 @@ struct parastate { #if defined(DEBUGBUILD) && defined(USE_LIBUV) -#define DEBUG_UV 0 +#define DEBUG_UV 0 /* object to pass to the callbacks */ struct datauv { @@ -1535,7 +1526,7 @@ static void mnotify(CURLM *multi, unsigned int notification, static void on_uv_socket(uv_poll_t *req, int status, int events) { int flags = 0; - struct contextuv *c = (struct contextuv *) req->data; + struct contextuv *c = (struct contextuv *)req->data; (void)status; if(events & UV_READABLE) flags |= CURL_CSELECT_IN; @@ -1550,7 +1541,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events) /* callback from libuv when timeout expires */ static void on_uv_timeout(uv_timer_t *req) { - struct datauv *uv = (struct datauv *) req->data; + struct datauv *uv = (struct datauv *)req->data; #if DEBUG_UV curl_mfprintf(tool_stderr, "parallel_event: on_uv_timeout\n"); #endif @@ -1599,13 +1590,13 @@ static struct contextuv *create_context(curl_socket_t sockfd, static void close_cb(uv_handle_t *handle) { - struct contextuv *c = (struct contextuv *) handle->data; + struct contextuv *c = (struct contextuv *)handle->data; curlx_free(c); } static void destroy_context(struct contextuv *c) { - uv_close((uv_handle_t *) &c->poll_handle, close_cb); + uv_close((uv_handle_t *)&c->poll_handle, close_cb); } /* callback from libcurl to update socket activity to wait for */ @@ -1625,8 +1616,7 @@ static int cb_socket(CURL *easy, curl_socket_t s, int action, case CURL_POLL_IN: case CURL_POLL_OUT: case CURL_POLL_INOUT: - c = socketp ? - (struct contextuv *) socketp : create_context(s, uv); + c = socketp ? (struct contextuv *)socketp : create_context(s, uv); curl_multi_assign(uv->s->multi, s, c); @@ -1753,7 +1743,7 @@ static CURLcode check_finished(struct parastate *s) if(retry) { ended->added = FALSE; /* add it again */ /* we delay retries in full integer seconds only */ - ended->startat = delay ? time(NULL) + delay/1000 : 0; + ended->startat = delay ? time(NULL) + delay / 1000 : 0; } else { /* result receives this transfer's error unless the transfer was @@ -2222,7 +2212,6 @@ static CURLcode share_setup(CURLSH *share) return result; } - CURLcode operate(int argc, argv_item_t argv[]) { CURLcode result = CURLE_OK; diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index a8b5e9497570..c46f3e3eefd9 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -91,7 +91,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename) if(uh) { char *ptr; uerr = curl_url_set(uh, CURLUPART_URL, *inurlp, - CURLU_GUESS_SCHEME|CURLU_NON_SUPPORT_SCHEME); + CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME); if(uerr) { result = urlerr_cvt(uerr); goto fail; diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index b16fc42906d8..9faf2e4dde2d 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -224,7 +224,7 @@ static ParameterError getnum(long *val, const char *str, int base) *val = (long)num; if(is_neg) *val = -*val; - return PARAM_OK; /* Ok */ + return PARAM_OK; /* Ok */ } } return PARAM_BAD_NUMERIC; /* badness */ @@ -309,7 +309,7 @@ ParameterError secs2ms(long *valp, const char *str) const unsigned int digs[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }; if(!str || - curlx_str_number(&str, &secs, LONG_MAX/1000 - 1)) + curlx_str_number(&str, &secs, LONG_MAX / 1000 - 1)) return PARAM_BAD_NUMERIC; if(!curlx_str_single(&str, '.')) { curl_off_t fracs; @@ -319,7 +319,7 @@ ParameterError secs2ms(long *valp, const char *str) return PARAM_NUMBER_TOO_LARGE; /* how many milliseconds are in fracs ? */ len = (str - s); - while((len > CURL_ARRAYSIZE(digs) || (fracs > LONG_MAX/100))) { + while((len > CURL_ARRAYSIZE(digs) || (fracs > LONG_MAX / 100))) { fracs /= 10; len--; } @@ -340,7 +340,7 @@ static size_t protoset_index(const char * const *protoset, const char *proto) { const char * const *p = protoset; - DEBUGASSERT(proto == proto_token(proto)); /* Ensure it is tokenized. */ + DEBUGASSERT(proto == proto_token(proto)); /* Ensure it is tokenized. */ for(; *p; p++) if(proto == *p) @@ -388,7 +388,7 @@ static void protoset_clear(const char **protoset, const char *proto) * data. */ -#define MAX_PROTOSTRING (64*11) /* Enough room for 64 10-chars proto names. */ +#define MAX_PROTOSTRING (64 * 11) /* Room for 64 10-chars proto names. */ ParameterError proto2num(const char * const *val, char **ostr, const char *str) { @@ -452,8 +452,8 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str) break; case allow: case set: - memcpy((char *) protoset, - built_in_protos, (proto_count + 1) * sizeof(*protoset)); + memcpy((char *)protoset, built_in_protos, + (proto_count + 1) * sizeof(*protoset)); break; } } @@ -491,7 +491,7 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str) } /* We need the protocols in alphabetic order for CI tests requirements. */ - qsort((char *) protoset, protoset_index(protoset, NULL), sizeof(*protoset), + qsort((char *)protoset, protoset_index(protoset, NULL), sizeof(*protoset), struplocompare4sort); for(proto = 0; protoset[proto] && !result; proto++) @@ -543,7 +543,7 @@ ParameterError str2offset(curl_off_t *val, const char *str) return PARAM_OK; } -#define MAX_USERPWDLENGTH (100*1024) +#define MAX_USERPWDLENGTH (100 * 1024) static CURLcode checkpasswd(const char *kind, /* for what purpose */ const size_t i, /* operation index */ const bool last, /* TRUE if last operation */ @@ -648,22 +648,21 @@ long delegation(const char *str) return CURLGSSAPI_DELEGATION_NONE; } -#define isheadersep(x) ((((x)==':') || ((x)==';'))) +#define isheadersep(x) ((((x) == ':') || ((x) == ';'))) /* * inlist() returns true if the given 'checkfor' header is present in the * header list. */ -static bool inlist(const struct curl_slist *head, - const char *checkfor) +static bool inlist(const struct curl_slist *head, const char *checkfor) { size_t thislen = strlen(checkfor); DEBUGASSERT(thislen); - DEBUGASSERT(checkfor[thislen-1] != ':'); + DEBUGASSERT(checkfor[thislen - 1] != ':'); for(; head; head = head->next) { if(curl_strnequal(head->data, checkfor, thislen) && - isheadersep(head->data[thislen]) ) + isheadersep(head->data[thislen])) return TRUE; } diff --git a/src/tool_paramhlp.h b/src/tool_paramhlp.h index a9e8539cf57b..f7c743b7e262 100644 --- a/src/tool_paramhlp.h +++ b/src/tool_paramhlp.h @@ -31,7 +31,7 @@ struct getout *new_getout(struct OperationConfig *config); ParameterError file2string(char **bufp, FILE *file); #if SIZEOF_SIZE_T > 4 -#define MAX_FILE2MEMORY (16LL*1024*1024*1024) +#define MAX_FILE2MEMORY (16LL * 1024 * 1024 * 1024) #else #define MAX_FILE2MEMORY (INT_MAX) #endif diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index f901e69e7849..0466c547c3e3 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -33,7 +33,7 @@ /* only acknowledge colon or equals as separators if the option was not specified with an initial dash! */ -#define ISSEP(x,dash) (!dash && (((x) == '=') || ((x) == ':'))) +#define ISSEP(x, dash) (!dash && (((x) == '=') || ((x) == ':'))) /* * Copies the string from line to the param dynbuf, unquoting backslash-quoted diff --git a/src/tool_progress.c b/src/tool_progress.c index f9fbd83574ed..53ed9bcb3cec 100644 --- a/src/tool_progress.c +++ b/src/tool_progress.c @@ -44,8 +44,8 @@ static char *max5data(curl_off_t bytes, char *max5) if(nbytes < 100) { /* display with a decimal */ curl_msnprintf(max5, 6, "%2" CURL_FORMAT_CURL_OFF_T ".%0" - CURL_FORMAT_CURL_OFF_T "%c", bytes/1024, - (bytes%1024) / (1024/10), unit[k]); + CURL_FORMAT_CURL_OFF_T "%c", bytes / 1024, + (bytes % 1024) / (1024 / 10), unit[k]); break; } else if(nbytes < 10000) { @@ -143,9 +143,7 @@ static void add_offt(curl_off_t *val, curl_off_t add) |DL% UL% Dled Uled Xfers Live Total Current Left Speed | 6 -- 9.9G 0 2 2 0:00:40 0:00:02 0:00:37 4087M */ -bool progress_meter(CURLM *multi, - struct curltime *start, - bool final) +bool progress_meter(CURLM *multi, struct curltime *start, bool final) { static struct curltime stamp; static bool header = FALSE; @@ -169,9 +167,9 @@ bool progress_meter(CURLM *multi, char time_total[10]; char time_spent[10]; char buffer[3][6]; - curl_off_t spent = curlx_timediff_ms(now, *start)/1000; - char dlpercen[4]="--"; - char ulpercen[4]="--"; + curl_off_t spent = curlx_timediff_ms(now, *start) / 1000; + char dlpercen[4] = "--"; + char ulpercen[4] = "--"; struct per_transfer *per; curl_off_t all_dlnow = 0; curl_off_t all_ulnow = 0; @@ -207,15 +205,15 @@ bool progress_meter(CURLM *multi, } if(dlknown && all_dltotal) curl_msnprintf(dlpercen, sizeof(dlpercen), "%3" CURL_FORMAT_CURL_OFF_T, - all_dlnow < (CURL_OFF_T_MAX/100) ? + all_dlnow < (CURL_OFF_T_MAX / 100) ? (all_dlnow * 100 / all_dltotal) : - (all_dlnow / (all_dltotal/100))); + (all_dlnow / (all_dltotal / 100))); if(ulknown && all_ultotal) curl_msnprintf(ulpercen, sizeof(ulpercen), "%3" CURL_FORMAT_CURL_OFF_T, - all_ulnow < (CURL_OFF_T_MAX/100) ? + all_ulnow < (CURL_OFF_T_MAX / 100) ? (all_ulnow * 100 / all_ultotal) : - (all_ulnow / (all_ultotal/100))); + (all_ulnow / (all_ultotal / 100))); /* get the transfer speed, the higher of the two */ @@ -248,8 +246,8 @@ bool progress_meter(CURLM *multi, } if(!deltams) /* no division by zero please */ deltams++; - dls = (curl_off_t)((double)dl / ((double)deltams/1000.0)); - uls = (curl_off_t)((double)ul / ((double)deltams/1000.0)); + dls = (curl_off_t)((double)dl / ((double)deltams / 1000.0)); + uls = (curl_off_t)((double)ul / ((double)deltams / 1000.0)); speed = dls > uls ? dls : uls; } @@ -291,7 +289,7 @@ bool progress_meter(CURLM *multi, time_spent, time_left, max5data(speed, buffer[2]), /* speed */ - final ? "\n" :""); + final ? "\n" : ""); return TRUE; } return FALSE; diff --git a/src/tool_sdecls.h b/src/tool_sdecls.h index 45b7bd0c2056..9a6f3cc8820f 100644 --- a/src/tool_sdecls.h +++ b/src/tool_sdecls.h @@ -109,7 +109,6 @@ typedef enum { TRACE_PLAIN /* -v/--verbose type */ } trace; - /* * 'HttpReq' enumeration represents HTTP request types. */ @@ -123,7 +122,6 @@ typedef enum { TOOL_HTTPREQ_PUT } HttpReq; - /* * Complete struct declarations which have OperationConfig struct members, * just in case this header is directly included in some source file. diff --git a/src/tool_setopt.c b/src/tool_setopt.c index 97d469d76daa..837f66c9c319 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -36,9 +36,9 @@ /* For bit masks, put combinations first, then single bits, */ /* and finally any "NONE" value. */ -#define NV(e) {#e, e} -#define NV1(e, v) {#e, (v)} -#define NVEND {NULL, 0} /* sentinel to mark end of list */ +#define NV(e) { #e, e } +#define NV1(e, v) { #e, (v) } +#define NVEND { NULL, 0 } /* sentinel to mark end of list */ const struct NameValue setopt_nv_CURLPROXY[] = { NV(CURLPROXY_HTTP), @@ -101,7 +101,7 @@ const struct NameValue setopt_nv_CURL_SSLVERSION[] = { }; const struct NameValue setopt_nv_CURL_SSLVERSION_MAX[] = { - {"", CURL_SSLVERSION_MAX_NONE}, + { "", CURL_SSLVERSION_MAX_NONE }, NV(CURL_SSLVERSION_MAX_DEFAULT), NV(CURL_SSLVERSION_MAX_TLSv1_0), NV(CURL_SSLVERSION_MAX_TLSv1_1), @@ -174,7 +174,7 @@ static const struct NameValue setopt_nv_CURLNONZERODEFAULTS[] = { /* Escape string to C string syntax. Return NULL if out of memory. */ #define MAX_STRING_LENGTH_OUTPUT 2000 -#define ZERO_TERMINATED -1 +#define ZERO_TERMINATED -1 static char *c_escape(const char *str, curl_off_t len) { @@ -216,7 +216,7 @@ static char *c_escape(const char *str, curl_off_t len) /* Octal escape to avoid >2 digit hex. */ (len > 1 && ISXDIGIT(s[1])) ? "\\%03o" : "\\x%02x", - (unsigned int) *(const unsigned char *) s); + (unsigned int)*(const unsigned char *)s); } } } @@ -337,9 +337,9 @@ CURLcode tool_setopt_bitmask(CURL *curl, const char *name, CURLoption tag, curl_msnprintf(preamble, sizeof(preamble), "curl_easy_setopt(hnd, %s, ", name); for(nv = nvlist; nv->name; nv++) { - if((nv->value & ~ rest) == 0) { + if((nv->value & ~rest) == 0) { /* all value flags contained in rest */ - rest &= ~ nv->value; /* remove bits handled here */ + rest &= ~nv->value; /* remove bits handled here */ ret = easysrc_addf(&easysrc_code, "%s(long)%s%s", preamble, nv->name, rest ? " |" : ");"); if(!rest || ret) @@ -425,8 +425,7 @@ static CURLcode libcurl_generate_mime_part(CURL *curl, mimeno, submimeno); if(!ret) /* Avoid freeing in CLEAN. */ - ret = easysrc_addf(&easysrc_code, - "mime%d = NULL;", submimeno); + ret = easysrc_addf(&easysrc_code, "mime%d = NULL;", submimeno); } break; diff --git a/src/tool_setopt.h b/src/tool_setopt.h index 5ca7188841c4..fcd56382a75f 100644 --- a/src/tool_setopt.h +++ b/src/tool_setopt.h @@ -62,20 +62,20 @@ extern const struct NameValueUnsigned setopt_nv_CURLAUTH[]; extern const struct NameValueUnsigned setopt_nv_CURLHSTS[]; /* Map options to NameValue sets */ -#define setopt_nv_CURLOPT_HSTS_CTRL setopt_nv_CURLHSTS -#define setopt_nv_CURLOPT_HTTP_VERSION setopt_nv_CURL_HTTP_VERSION -#define setopt_nv_CURLOPT_HTTPAUTH setopt_nv_CURLAUTH -#define setopt_nv_CURLOPT_SSLVERSION setopt_nv_CURL_SSLVERSION -#define setopt_nv_CURLOPT_PROXY_SSLVERSION setopt_nv_CURL_SSLVERSION -#define setopt_nv_CURLOPT_TIMECONDITION setopt_nv_CURL_TIMECOND -#define setopt_nv_CURLOPT_FTP_SSL_CCC setopt_nv_CURLFTPSSL_CCC -#define setopt_nv_CURLOPT_USE_SSL setopt_nv_CURLUSESSL -#define setopt_nv_CURLOPT_SSL_OPTIONS setopt_nv_CURLSSLOPT +#define setopt_nv_CURLOPT_HSTS_CTRL setopt_nv_CURLHSTS +#define setopt_nv_CURLOPT_HTTP_VERSION setopt_nv_CURL_HTTP_VERSION +#define setopt_nv_CURLOPT_HTTPAUTH setopt_nv_CURLAUTH +#define setopt_nv_CURLOPT_SSLVERSION setopt_nv_CURL_SSLVERSION +#define setopt_nv_CURLOPT_PROXY_SSLVERSION setopt_nv_CURL_SSLVERSION +#define setopt_nv_CURLOPT_TIMECONDITION setopt_nv_CURL_TIMECOND +#define setopt_nv_CURLOPT_FTP_SSL_CCC setopt_nv_CURLFTPSSL_CCC +#define setopt_nv_CURLOPT_USE_SSL setopt_nv_CURLUSESSL +#define setopt_nv_CURLOPT_SSL_OPTIONS setopt_nv_CURLSSLOPT #define setopt_nv_CURLOPT_PROXY_SSL_OPTIONS setopt_nv_CURLSSLOPT -#define setopt_nv_CURLOPT_NETRC setopt_nv_CURL_NETRC -#define setopt_nv_CURLOPT_PROXYTYPE setopt_nv_CURLPROXY -#define setopt_nv_CURLOPT_PROXYAUTH setopt_nv_CURLAUTH -#define setopt_nv_CURLOPT_SOCKS5_AUTH setopt_nv_CURLAUTH +#define setopt_nv_CURLOPT_NETRC setopt_nv_CURL_NETRC +#define setopt_nv_CURLOPT_PROXYTYPE setopt_nv_CURLPROXY +#define setopt_nv_CURLOPT_PROXYAUTH setopt_nv_CURLAUTH +#define setopt_nv_CURLOPT_SOCKS5_AUTH setopt_nv_CURLAUTH /* Intercept setopt calls for --libcurl */ @@ -103,64 +103,48 @@ CURLcode tool_setopt_str(CURL *curl, struct OperationConfig *config, ...) WARN_UNUSED_RESULT; CURLcode tool_setopt_ptr(CURL *curl, const char *name, CURLoption tag, ...); -#define my_setopt_ptr(x,y,z) \ - tool_setopt_ptr(x, #y, y, z) - -#define my_setopt_long(x,y,z) \ - tool_setopt_long(x, #y, y, z) - -#define my_setopt_offt(x,y,z) \ - tool_setopt_offt(x, #y, y, z) - -#define my_setopt_str(x,y,z) \ - tool_setopt_str(x, config, #y, y, z) +#define my_setopt_long(x, y, z) tool_setopt_long(x, #y, y, z) +#define my_setopt_offt(x, y, z) tool_setopt_offt(x, #y, y, z) +#define my_setopt_ptr(x, y, z) tool_setopt_ptr(x, #y, y, z) +#define my_setopt_str(x, y, z) tool_setopt_str(x, config, #y, y, z) +#define my_setopt_mimepost(x, y, z) tool_setopt_mimepost(x, config, #y, y, z) +#define my_setopt_slist(x, y, z) tool_setopt_slist(x, #y, y, z) +#define my_setopt_SSLVERSION(x, y, z) tool_setopt_SSLVERSION(x, #y, y, z) +#define my_setopt_enum(x, y, z) \ + tool_setopt_enum(x, #y, y, setopt_nv_ ## y, z) +#define my_setopt_bitmask(x, y, z) \ + tool_setopt_bitmask(x, #y, y, setopt_nv_ ## y, z) /* assumes a 'result' variable to use. If the return code is benign it is left in 'result' after this call, otherwise the function returns the error */ -#define MY_SETOPT_STR(x,y,z) \ - do { \ - result = tool_setopt_str(x, config, #y, y, z); \ - if(setopt_bad(result)) \ - return result; \ +#define MY_SETOPT_STR(x, y, z) \ + do { \ + result = tool_setopt_str(x, config, #y, y, z); \ + if(setopt_bad(result)) \ + return result; \ } while(0) -#define my_setopt_enum(x,y,z) \ - tool_setopt_enum(x, #y, y, setopt_nv_ ## y, z) - -#define my_setopt_SSLVERSION(x,y,z) \ - tool_setopt_SSLVERSION(x, #y, y, z) - -#define my_setopt_bitmask(x,y,z) \ - tool_setopt_bitmask(x, #y, y, setopt_nv_ ## y, z) - -#define my_setopt_mimepost(x,y,z) \ - tool_setopt_mimepost(x, config, #y, y, z) - -#define my_setopt_slist(x,y,z) \ - tool_setopt_slist(x, #y, y, z) - #else /* CURL_DISABLE_LIBCURL_OPTION */ /* No --libcurl, so pass options directly to library */ -#define my_setopt_long(x,y,z) curl_easy_setopt(x, y, (long)(z)) -#define my_setopt_offt(x,y,z) curl_easy_setopt(x, y, (curl_off_t)(z)) -#define my_setopt_ptr(x,y,z) curl_easy_setopt(x, y, z) -#define my_setopt_str(x,y,z) curl_easy_setopt(x, y, z) -#define my_setopt_enum(x,y,z) curl_easy_setopt(x, y, z) -#define my_setopt_SSLVERSION(x,y,z) curl_easy_setopt(x, y, z) -#define my_setopt_bitmask(x,y,z) curl_easy_setopt(x, y, (long)z) -#define my_setopt_mimepost(x,y,z) curl_easy_setopt(x, y, z) -#define my_setopt_slist(x,y,z) curl_easy_setopt(x, y, z) - -#define MY_SETOPT_STR(x,y,z) \ - do { \ - result = curl_easy_setopt(x, y, z); \ - if(setopt_bad(result)) \ - return result; \ +#define my_setopt_long(x, y, z) curl_easy_setopt(x, y, (long)(z)) +#define my_setopt_offt(x, y, z) curl_easy_setopt(x, y, (curl_off_t)(z)) +#define my_setopt_ptr(x, y, z) curl_easy_setopt(x, y, z) +#define my_setopt_str(x, y, z) curl_easy_setopt(x, y, z) +#define my_setopt_mimepost(x, y, z) curl_easy_setopt(x, y, z) +#define my_setopt_slist(x, y, z) curl_easy_setopt(x, y, z) +#define my_setopt_SSLVERSION(x, y, z) curl_easy_setopt(x, y, z) +#define my_setopt_enum(x, y, z) curl_easy_setopt(x, y, z) +#define my_setopt_bitmask(x, y, z) curl_easy_setopt(x, y, (long)z) + +#define MY_SETOPT_STR(x, y, z) \ + do { \ + result = curl_easy_setopt(x, y, z); \ + if(setopt_bad(result)) \ + return result; \ } while(0) - #endif /* CURL_DISABLE_LIBCURL_OPTION */ #endif /* HEADER_CURL_TOOL_SETOPT_H */ diff --git a/src/tool_setup.h b/src/tool_setup.h index f693fc1dae70..1524e36103fb 100644 --- a/src/tool_setup.h +++ b/src/tool_setup.h @@ -54,7 +54,7 @@ extern FILE *tool_stderr; */ #ifdef macintosh -# define main(x,y) curl_main(x,y) +# define main(x, y) curl_main(x, y) #endif #ifndef CURL_OS @@ -100,7 +100,7 @@ extern bool tool_term_has_bold; int tool_ftruncate64(int fd, curl_off_t where); #undef ftruncate -#define ftruncate(fd,where) tool_ftruncate64(fd,where) +#define ftruncate(fd, where) tool_ftruncate64(fd, where) #define HAVE_FTRUNCATE 1 #define USE_TOOL_FTRUNCATE 1 diff --git a/src/tool_ssls.c b/src/tool_ssls.c index 7ffd6f707420..6ad5c2475dad 100644 --- a/src/tool_ssls.c +++ b/src/tool_ssls.c @@ -33,7 +33,6 @@ /* The maximum line length for an ecoded session ticket */ #define MAX_SSLS_LINE (64 * 1024) - static CURLcode tool_ssls_easy(struct OperationConfig *config, CURLSH *share, CURL **peasy) { @@ -193,8 +192,7 @@ CURLcode tool_ssls_save(struct OperationConfig *config, ctx.exported = 0; ctx.fp = curlx_fopen(filename, FOPEN_WRITETEXT); if(!ctx.fp) { - warnf("Warning: Failed to create SSL session file %s", - filename); + warnf("Warning: Failed to create SSL session file %s", filename); goto out; } diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index bfa54ab8275b..ad2e2de9d66b 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -80,7 +80,7 @@ static int multiply(curl_off_t *amount, curl_off_t with) return 1; #else sum = *amount * with; - if(sum/with != *amount) + if(sum / with != *amount) return 1; /* did not fit, bail out */ #endif } @@ -99,7 +99,7 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, bool done = FALSE; const char *pattern = *patternp; const char *opattern = pattern; - size_t opos = *posp-1; + size_t opos = *posp - 1; CURLcode result = CURLE_OK; size_t size = 0; char **elem = NULL; @@ -441,7 +441,7 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, /* only allow \ to escape known "special letters" */ if(*pattern == '\\' && (pattern[1] == '{' || pattern[1] == '[' || - pattern[1] == '}' || pattern[1] == ']') ) { + pattern[1] == '}' || pattern[1] == ']')) { /* escape character, skip '\' */ ++pattern; @@ -463,7 +463,7 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, else { if(!*pattern) /* done */ break; - else if(*pattern =='{') { + else if(*pattern == '{') { /* process set pattern */ pattern++; pos++; @@ -500,7 +500,7 @@ CURLcode glob_url(struct URLGlob *glob, char *url, curl_off_t *urlnum, CURLcode res; memset(glob, 0, sizeof(struct URLGlob)); - curlx_dyn_init(&glob->buf, 1024*1024); + curlx_dyn_init(&glob->buf, 1024 * 1024); glob->pattern = curlx_malloc(2 * sizeof(struct URLPattern)); if(!glob->pattern) return CURLE_OUT_OF_MEMORY; @@ -634,7 +634,7 @@ CURLcode glob_next_url(char **globbed, struct URLGlob *glob) return CURLE_OK; } -#define MAX_OUTPUT_GLOB_LENGTH (1024*1024) +#define MAX_OUTPUT_GLOB_LENGTH (1024 * 1024) CURLcode glob_match_url(char **output, const char *filename, struct URLGlob *glob) diff --git a/src/tool_util.c b/src/tool_util.c index 43dd096783cc..96b0715b0af3 100644 --- a/src/tool_util.c +++ b/src/tool_util.c @@ -75,7 +75,7 @@ int struplocompare(const char *p1, const char *p2) /* Indirect version to use as qsort callback. */ int struplocompare4sort(const void *p1, const void *p2) { - return struplocompare(* (char * const *) p1, * (char * const *) p2); + return struplocompare(*(char * const *)p1, *(char * const *)p2); } #ifdef USE_TOOL_FTRUNCATE diff --git a/src/tool_version.h b/src/tool_version.h index 00be7799ea74..5db625c3170f 100644 --- a/src/tool_version.h +++ b/src/tool_version.h @@ -25,12 +25,12 @@ ***************************************************************************/ #include -#define CURL_NAME "curl" -#define CURL_COPYRIGHT LIBCURL_COPYRIGHT -#define CURL_VERSION LIBCURL_VERSION +#define CURL_NAME "curl" +#define CURL_COPYRIGHT LIBCURL_COPYRIGHT +#define CURL_VERSION LIBCURL_VERSION #define CURL_VERSION_MAJOR LIBCURL_VERSION_MAJOR #define CURL_VERSION_MINOR LIBCURL_VERSION_MINOR #define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH -#define CURL_ID CURL_NAME " " CURL_VERSION " (" CURL_OS ") " +#define CURL_ID CURL_NAME " " CURL_VERSION " (" CURL_OS ") " #endif /* HEADER_CURL_TOOL_VERSION_H */ diff --git a/src/tool_vms.c b/src/tool_vms.c index 75aa7d5370ee..71606f3d66c5 100644 --- a/src/tool_vms.c +++ b/src/tool_vms.c @@ -184,7 +184,6 @@ static void decc_init(void) /* Invalid DECC feature name. */ curl_mprintf(" UNKNOWN DECC FEATURE: %s.\n", decc_feat_array[i].name); } - } } @@ -196,16 +195,16 @@ static void decc_init(void) other attributes. Note that "nopic" is significant only on VAX. */ #pragma extern_model save #pragma extern_model strict_refdef "LIB$INITIALIZ" 2, nopic, nowrt -const int spare[8] = {0}; +const int spare[8] = { 0 }; #pragma extern_model strict_refdef "LIB$INITIALIZE" 2, nopic, nowrt -void (*const x_decc_init)() = decc_init; +void (* const x_decc_init)() = decc_init; #pragma extern_model restore /* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */ #pragma extern_model save int LIB$INITIALIZE(void); #pragma extern_model strict_refdef -int dmy_lib$initialize = (int) LIB$INITIALIZE; +int dmy_lib$initialize = (int)LIB$INITIALIZE; #pragma extern_model restore #pragma standard diff --git a/src/tool_vms.h b/src/tool_vms.h index 3da816cf6735..3519628fc121 100644 --- a/src/tool_vms.h +++ b/src/tool_vms.h @@ -40,8 +40,9 @@ void vms_special_exit(int code, int vms_show); #undef exit #define exit(__code) vms_special_exit((__code), (0)) -#define VMS_STS(c,f,e,s) (((c&0xF)<<28)|((f&0xFFF)<<16)|((e&0x1FFF)<3)|(s&7)) -#define VMSSTS_HIDE VMS_STS(1,0,0,0) +#define VMS_STS(c, f, e, s) \ + (((c & 0xF) << 28) | ((f & 0xFFF) << 16) | ((e & 0x1FFF) < 3) | (s & 7)) +#define VMSSTS_HIDE VMS_STS(1, 0, 0, 0) #endif /* __VMS */ diff --git a/src/tool_writeout.c b/src/tool_writeout.c index f846add4e311..358c7b39b3f9 100644 --- a/src/tool_writeout.c +++ b/src/tool_writeout.c @@ -49,12 +49,12 @@ struct httpmap { }; static const struct httpmap http_version[] = { - { "0", CURL_HTTP_VERSION_NONE}, - { "1", CURL_HTTP_VERSION_1_0}, - { "1.1", CURL_HTTP_VERSION_1_1}, - { "2", CURL_HTTP_VERSION_2}, - { "3", CURL_HTTP_VERSION_3}, - { NULL, 0} /* end of list */ + { "0", CURL_HTTP_VERSION_NONE }, + { "1", CURL_HTTP_VERSION_1_0 }, + { "1.1", CURL_HTTP_VERSION_1_1 }, + { "2", CURL_HTTP_VERSION_2 }, + { "3", CURL_HTTP_VERSION_3 }, + { NULL, 0 } /* end of list */ }; /* The designated write function should be the same as the CURLINFO return type @@ -68,87 +68,90 @@ static const struct httpmap http_version[] = { Variable names MUST be in alphabetical order. */ static const struct writeoutvar variables[] = { - {"certs", VAR_CERT, CURLINFO_NONE, writeString}, - {"conn_id", VAR_CONN_ID, CURLINFO_CONN_ID, writeOffset}, - {"content_type", VAR_CONTENT_TYPE, CURLINFO_CONTENT_TYPE, writeString}, - {"errormsg", VAR_ERRORMSG, CURLINFO_NONE, writeString}, - {"exitcode", VAR_EXITCODE, CURLINFO_NONE, writeLong}, - {"filename_effective", VAR_EFFECTIVE_FILENAME, CURLINFO_NONE, writeString}, - {"ftp_entry_path", VAR_FTP_ENTRY_PATH, CURLINFO_FTP_ENTRY_PATH, writeString}, - {"header_json", VAR_HEADER_JSON, CURLINFO_NONE, NULL}, - {"http_code", VAR_HTTP_CODE, CURLINFO_RESPONSE_CODE, writeLong}, - {"http_connect", VAR_HTTP_CODE_PROXY, CURLINFO_HTTP_CONNECTCODE, writeLong}, - {"http_version", VAR_HTTP_VERSION, CURLINFO_HTTP_VERSION, writeString}, - {"json", VAR_JSON, CURLINFO_NONE, NULL}, - {"local_ip", VAR_LOCAL_IP, CURLINFO_LOCAL_IP, writeString}, - {"local_port", VAR_LOCAL_PORT, CURLINFO_LOCAL_PORT, writeLong}, - {"method", VAR_EFFECTIVE_METHOD, CURLINFO_EFFECTIVE_METHOD, writeString}, - {"num_certs", VAR_NUM_CERTS, CURLINFO_NONE, writeLong}, - {"num_connects", VAR_NUM_CONNECTS, CURLINFO_NUM_CONNECTS, writeLong}, - {"num_headers", VAR_NUM_HEADERS, CURLINFO_NONE, writeLong}, - {"num_redirects", VAR_REDIRECT_COUNT, CURLINFO_REDIRECT_COUNT, writeLong}, - {"num_retries", VAR_NUM_RETRY, CURLINFO_NONE, writeLong}, - {"onerror", VAR_ONERROR, CURLINFO_NONE, NULL}, - {"proxy_ssl_verify_result", VAR_PROXY_SSL_VERIFY_RESULT, - CURLINFO_PROXY_SSL_VERIFYRESULT, writeLong}, - {"proxy_used", VAR_PROXY_USED, CURLINFO_USED_PROXY, writeLong}, - {"redirect_url", VAR_REDIRECT_URL, CURLINFO_REDIRECT_URL, writeString}, - {"referer", VAR_REFERER, CURLINFO_REFERER, writeString}, - {"remote_ip", VAR_PRIMARY_IP, CURLINFO_PRIMARY_IP, writeString}, - {"remote_port", VAR_PRIMARY_PORT, CURLINFO_PRIMARY_PORT, writeLong}, - {"response_code", VAR_HTTP_CODE, CURLINFO_RESPONSE_CODE, writeLong}, - {"scheme", VAR_SCHEME, CURLINFO_SCHEME, writeString}, - {"size_download", VAR_SIZE_DOWNLOAD, CURLINFO_SIZE_DOWNLOAD_T, writeOffset}, - {"size_header", VAR_HEADER_SIZE, CURLINFO_HEADER_SIZE, writeLong}, - {"size_request", VAR_REQUEST_SIZE, CURLINFO_REQUEST_SIZE, writeLong}, - {"size_upload", VAR_SIZE_UPLOAD, CURLINFO_SIZE_UPLOAD_T, writeOffset}, - {"speed_download", VAR_SPEED_DOWNLOAD, CURLINFO_SPEED_DOWNLOAD_T, - writeOffset}, - {"speed_upload", VAR_SPEED_UPLOAD, CURLINFO_SPEED_UPLOAD_T, writeOffset}, - {"ssl_verify_result", VAR_SSL_VERIFY_RESULT, CURLINFO_SSL_VERIFYRESULT, - writeLong}, - {"stderr", VAR_STDERR, CURLINFO_NONE, NULL}, - {"stdout", VAR_STDOUT, CURLINFO_NONE, NULL}, - {"time_appconnect", VAR_APPCONNECT_TIME, CURLINFO_APPCONNECT_TIME_T, - writeTime}, - {"time_connect", VAR_CONNECT_TIME, CURLINFO_CONNECT_TIME_T, writeTime}, - {"time_namelookup", VAR_NAMELOOKUP_TIME, CURLINFO_NAMELOOKUP_TIME_T, - writeTime}, - {"time_posttransfer", VAR_POSTTRANSFER_TIME, CURLINFO_POSTTRANSFER_TIME_T, - writeTime}, - {"time_pretransfer", VAR_PRETRANSFER_TIME, CURLINFO_PRETRANSFER_TIME_T, - writeTime}, - {"time_queue", VAR_QUEUE_TIME, CURLINFO_QUEUE_TIME_T, writeTime}, - {"time_redirect", VAR_REDIRECT_TIME, CURLINFO_REDIRECT_TIME_T, writeTime}, - {"time_starttransfer", VAR_STARTTRANSFER_TIME, CURLINFO_STARTTRANSFER_TIME_T, - writeTime}, - {"time_total", VAR_TOTAL_TIME, CURLINFO_TOTAL_TIME_T, writeTime}, - {"tls_earlydata", VAR_TLS_EARLYDATA_SENT, CURLINFO_EARLYDATA_SENT_T, - writeOffset}, - {"url", VAR_INPUT_URL, CURLINFO_NONE, writeString}, - {"url.fragment", VAR_INPUT_URLFRAGMENT, CURLINFO_NONE, writeString}, - {"url.host", VAR_INPUT_URLHOST, CURLINFO_NONE, writeString}, - {"url.options", VAR_INPUT_URLOPTIONS, CURLINFO_NONE, writeString}, - {"url.password", VAR_INPUT_URLPASSWORD, CURLINFO_NONE, writeString}, - {"url.path", VAR_INPUT_URLPATH, CURLINFO_NONE, writeString}, - {"url.port", VAR_INPUT_URLPORT, CURLINFO_NONE, writeString}, - {"url.query", VAR_INPUT_URLQUERY, CURLINFO_NONE, writeString}, - {"url.scheme", VAR_INPUT_URLSCHEME, CURLINFO_NONE, writeString}, - {"url.user", VAR_INPUT_URLUSER, CURLINFO_NONE, writeString}, - {"url.zoneid", VAR_INPUT_URLZONEID, CURLINFO_NONE, writeString}, - {"url_effective", VAR_EFFECTIVE_URL, CURLINFO_EFFECTIVE_URL, writeString}, - {"urle.fragment", VAR_INPUT_URLEFRAGMENT, CURLINFO_NONE, writeString}, - {"urle.host", VAR_INPUT_URLEHOST, CURLINFO_NONE, writeString}, - {"urle.options", VAR_INPUT_URLEOPTIONS, CURLINFO_NONE, writeString}, - {"urle.password", VAR_INPUT_URLEPASSWORD, CURLINFO_NONE, writeString}, - {"urle.path", VAR_INPUT_URLEPATH, CURLINFO_NONE, writeString}, - {"urle.port", VAR_INPUT_URLEPORT, CURLINFO_NONE, writeString}, - {"urle.query", VAR_INPUT_URLEQUERY, CURLINFO_NONE, writeString}, - {"urle.scheme", VAR_INPUT_URLESCHEME, CURLINFO_NONE, writeString}, - {"urle.user", VAR_INPUT_URLEUSER, CURLINFO_NONE, writeString}, - {"urle.zoneid", VAR_INPUT_URLEZONEID, CURLINFO_NONE, writeString}, - {"urlnum", VAR_URLNUM, CURLINFO_NONE, writeOffset}, - {"xfer_id", VAR_EASY_ID, CURLINFO_XFER_ID, writeOffset} + { "certs", VAR_CERT, CURLINFO_NONE, writeString }, + { "conn_id", VAR_CONN_ID, CURLINFO_CONN_ID, writeOffset }, + { "content_type", VAR_CONTENT_TYPE, CURLINFO_CONTENT_TYPE, writeString }, + { "errormsg", VAR_ERRORMSG, CURLINFO_NONE, writeString }, + { "exitcode", VAR_EXITCODE, CURLINFO_NONE, writeLong }, + { "filename_effective", VAR_EFFECTIVE_FILENAME, CURLINFO_NONE, writeString }, + { "ftp_entry_path", VAR_FTP_ENTRY_PATH, CURLINFO_FTP_ENTRY_PATH, + writeString }, + { "header_json", VAR_HEADER_JSON, CURLINFO_NONE, NULL }, + { "http_code", VAR_HTTP_CODE, CURLINFO_RESPONSE_CODE, writeLong }, + { "http_connect", VAR_HTTP_CODE_PROXY, CURLINFO_HTTP_CONNECTCODE, + writeLong }, + { "http_version", VAR_HTTP_VERSION, CURLINFO_HTTP_VERSION, writeString }, + { "json", VAR_JSON, CURLINFO_NONE, NULL }, + { "local_ip", VAR_LOCAL_IP, CURLINFO_LOCAL_IP, writeString }, + { "local_port", VAR_LOCAL_PORT, CURLINFO_LOCAL_PORT, writeLong }, + { "method", VAR_EFFECTIVE_METHOD, CURLINFO_EFFECTIVE_METHOD, writeString }, + { "num_certs", VAR_NUM_CERTS, CURLINFO_NONE, writeLong }, + { "num_connects", VAR_NUM_CONNECTS, CURLINFO_NUM_CONNECTS, writeLong }, + { "num_headers", VAR_NUM_HEADERS, CURLINFO_NONE, writeLong }, + { "num_redirects", VAR_REDIRECT_COUNT, CURLINFO_REDIRECT_COUNT, writeLong }, + { "num_retries", VAR_NUM_RETRY, CURLINFO_NONE, writeLong }, + { "onerror", VAR_ONERROR, CURLINFO_NONE, NULL }, + { "proxy_ssl_verify_result", VAR_PROXY_SSL_VERIFY_RESULT, + CURLINFO_PROXY_SSL_VERIFYRESULT, writeLong }, + { "proxy_used", VAR_PROXY_USED, CURLINFO_USED_PROXY, writeLong }, + { "redirect_url", VAR_REDIRECT_URL, CURLINFO_REDIRECT_URL, writeString }, + { "referer", VAR_REFERER, CURLINFO_REFERER, writeString }, + { "remote_ip", VAR_PRIMARY_IP, CURLINFO_PRIMARY_IP, writeString }, + { "remote_port", VAR_PRIMARY_PORT, CURLINFO_PRIMARY_PORT, writeLong }, + { "response_code", VAR_HTTP_CODE, CURLINFO_RESPONSE_CODE, writeLong }, + { "scheme", VAR_SCHEME, CURLINFO_SCHEME, writeString }, + { "size_download", VAR_SIZE_DOWNLOAD, CURLINFO_SIZE_DOWNLOAD_T, + writeOffset }, + { "size_header", VAR_HEADER_SIZE, CURLINFO_HEADER_SIZE, writeLong }, + { "size_request", VAR_REQUEST_SIZE, CURLINFO_REQUEST_SIZE, writeLong }, + { "size_upload", VAR_SIZE_UPLOAD, CURLINFO_SIZE_UPLOAD_T, writeOffset }, + { "speed_download", VAR_SPEED_DOWNLOAD, CURLINFO_SPEED_DOWNLOAD_T, + writeOffset }, + { "speed_upload", VAR_SPEED_UPLOAD, CURLINFO_SPEED_UPLOAD_T, writeOffset }, + { "ssl_verify_result", VAR_SSL_VERIFY_RESULT, CURLINFO_SSL_VERIFYRESULT, + writeLong }, + { "stderr", VAR_STDERR, CURLINFO_NONE, NULL }, + { "stdout", VAR_STDOUT, CURLINFO_NONE, NULL }, + { "time_appconnect", VAR_APPCONNECT_TIME, CURLINFO_APPCONNECT_TIME_T, + writeTime }, + { "time_connect", VAR_CONNECT_TIME, CURLINFO_CONNECT_TIME_T, writeTime }, + { "time_namelookup", VAR_NAMELOOKUP_TIME, CURLINFO_NAMELOOKUP_TIME_T, + writeTime }, + { "time_posttransfer", VAR_POSTTRANSFER_TIME, CURLINFO_POSTTRANSFER_TIME_T, + writeTime }, + { "time_pretransfer", VAR_PRETRANSFER_TIME, CURLINFO_PRETRANSFER_TIME_T, + writeTime }, + { "time_queue", VAR_QUEUE_TIME, CURLINFO_QUEUE_TIME_T, writeTime }, + { "time_redirect", VAR_REDIRECT_TIME, CURLINFO_REDIRECT_TIME_T, writeTime }, + { "time_starttransfer", VAR_STARTTRANSFER_TIME, + CURLINFO_STARTTRANSFER_TIME_T, writeTime }, + { "time_total", VAR_TOTAL_TIME, CURLINFO_TOTAL_TIME_T, writeTime }, + { "tls_earlydata", VAR_TLS_EARLYDATA_SENT, CURLINFO_EARLYDATA_SENT_T, + writeOffset }, + { "url", VAR_INPUT_URL, CURLINFO_NONE, writeString }, + { "url.fragment", VAR_INPUT_URLFRAGMENT, CURLINFO_NONE, writeString }, + { "url.host", VAR_INPUT_URLHOST, CURLINFO_NONE, writeString }, + { "url.options", VAR_INPUT_URLOPTIONS, CURLINFO_NONE, writeString }, + { "url.password", VAR_INPUT_URLPASSWORD, CURLINFO_NONE, writeString }, + { "url.path", VAR_INPUT_URLPATH, CURLINFO_NONE, writeString }, + { "url.port", VAR_INPUT_URLPORT, CURLINFO_NONE, writeString }, + { "url.query", VAR_INPUT_URLQUERY, CURLINFO_NONE, writeString }, + { "url.scheme", VAR_INPUT_URLSCHEME, CURLINFO_NONE, writeString }, + { "url.user", VAR_INPUT_URLUSER, CURLINFO_NONE, writeString }, + { "url.zoneid", VAR_INPUT_URLZONEID, CURLINFO_NONE, writeString }, + { "url_effective", VAR_EFFECTIVE_URL, CURLINFO_EFFECTIVE_URL, writeString }, + { "urle.fragment", VAR_INPUT_URLEFRAGMENT, CURLINFO_NONE, writeString }, + { "urle.host", VAR_INPUT_URLEHOST, CURLINFO_NONE, writeString }, + { "urle.options", VAR_INPUT_URLEOPTIONS, CURLINFO_NONE, writeString }, + { "urle.password", VAR_INPUT_URLEPASSWORD, CURLINFO_NONE, writeString }, + { "urle.path", VAR_INPUT_URLEPATH, CURLINFO_NONE, writeString }, + { "urle.port", VAR_INPUT_URLEPORT, CURLINFO_NONE, writeString }, + { "urle.query", VAR_INPUT_URLEQUERY, CURLINFO_NONE, writeString }, + { "urle.scheme", VAR_INPUT_URLESCHEME, CURLINFO_NONE, writeString }, + { "urle.user", VAR_INPUT_URLEUSER, CURLINFO_NONE, writeString }, + { "urle.zoneid", VAR_INPUT_URLEZONEID, CURLINFO_NONE, writeString }, + { "urlnum", VAR_URLNUM, CURLINFO_NONE, writeOffset }, + { "xfer_id", VAR_EASY_ID, CURLINFO_XFER_ID, writeOffset } }; static int writeTime(FILE *stream, const struct writeoutvar *wovar, @@ -254,7 +257,7 @@ static int urlpart(struct per_transfer *per, writeoutid vid, } } if(!rc && curl_url_set(uh, CURLUPART_URL, url, - CURLU_GUESS_SCHEME|CURLU_NON_SUPPORT_SCHEME)) + CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME)) rc = 2; if(!rc && curl_url_get(uh, cpart, &part, CURLU_DEFAULT_PORT)) @@ -286,7 +289,7 @@ static int writeString(FILE *stream, const struct writeoutvar *wovar, const char *strinfo = NULL; const char *freestr = NULL; struct dynbuf buf; - curlx_dyn_init(&buf, 256*1024); + curlx_dyn_init(&buf, 256 * 1024); DEBUGASSERT(wovar->writefunc == writeString); @@ -337,7 +340,7 @@ static int writeString(FILE *stream, const struct writeoutvar *wovar, len = curlx_dyn_len(&buf); if(len) { char *ptr = curlx_dyn_ptr(&buf); - if(ptr[len -1] != '\n') { + if(ptr[len - 1] != '\n') { /* add a newline to make things look better */ if(curlx_dyn_addn(&buf, "\n", 1)) { error = TRUE; @@ -527,8 +530,7 @@ static int writeOffset(FILE *stream, const struct writeoutvar *wovar, return 1; /* return 1 if anything was written */ } -static int -matchvar(const void *m1, const void *m2) +static int matchvar(const void *m1, const void *m2) { const struct writeoutvar *v1 = m1; const struct writeoutvar *v2 = m2; diff --git a/src/tool_writeout_json.c b/src/tool_writeout_json.c index f3175edf9502..ee7dda2e9cc9 100644 --- a/src/tool_writeout_json.c +++ b/src/tool_writeout_json.c @@ -143,8 +143,7 @@ void headerJSON(FILE *stream, struct per_transfer *per) if(++i >= a) break; fputc(',', stream); - if(curl_easy_header(per->curl, name, i, CURLH_HEADER, - -1, &header)) + if(curl_easy_header(per->curl, name, i, CURLH_HEADER, -1, &header)) break; } while(1); fputc(']', stream); diff --git a/src/tool_xattr.h b/src/tool_xattr.h index 31301b3b0616..6720ccb2bd9a 100644 --- a/src/tool_xattr.h +++ b/src/tool_xattr.h @@ -29,7 +29,7 @@ # include /* header from libc, not from libattr */ # define USE_XATTR #elif (defined(__FreeBSD_version) && (__FreeBSD_version > 500000)) || \ - defined(__MidnightBSD_version) + defined(__MidnightBSD_version) # include # include # define USE_XATTR @@ -43,7 +43,7 @@ UNITTEST char *stripcredentials(const char *url); #endif #else -#define fwrite_xattr(a,b,c) 0 +#define fwrite_xattr(a, b, c) 0 #endif #endif /* HEADER_CURL_TOOL_XATTR_H */ diff --git a/src/var.c b/src/var.c index 08269e1db704..e224bf01d549 100644 --- a/src/var.c +++ b/src/var.c @@ -35,7 +35,7 @@ #include "var.h" #define MAX_EXPAND_CONTENT 10000000 -#define MAX_VAR_LEN 128 /* max length of a name */ +#define MAX_VAR_LEN 128 /* max length of a name */ /* free everything */ void varcleanup(void) @@ -53,8 +53,7 @@ static const struct tool_var *varcontent(const char *name, size_t nlen) { struct tool_var *list = global->variables; while(list) { - if((strlen(list->name) == nlen) && - !strncmp(name, list->name, nlen)) { + if((strlen(list->name) == nlen) && !strncmp(name, list->name, nlen)) { return list; } list = list->next; @@ -63,18 +62,18 @@ static const struct tool_var *varcontent(const char *name, size_t nlen) } #define ENDOFFUNC(x) (((x) == '}') || ((x) == ':')) -#define FUNCMATCH(ptr,name,len) \ +#define FUNCMATCH(ptr, name, len) \ (!strncmp(ptr, name, len) && ENDOFFUNC(ptr[len])) -#define FUNC_TRIM "trim" -#define FUNC_TRIM_LEN (sizeof(FUNC_TRIM) - 1) -#define FUNC_JSON "json" -#define FUNC_JSON_LEN (sizeof(FUNC_JSON) - 1) -#define FUNC_URL "url" -#define FUNC_URL_LEN (sizeof(FUNC_URL) - 1) -#define FUNC_B64 "b64" -#define FUNC_B64_LEN (sizeof(FUNC_B64) - 1) -#define FUNC_64DEC "64dec" /* base64 decode */ +#define FUNC_TRIM "trim" +#define FUNC_TRIM_LEN (sizeof(FUNC_TRIM) - 1) +#define FUNC_JSON "json" +#define FUNC_JSON_LEN (sizeof(FUNC_JSON) - 1) +#define FUNC_URL "url" +#define FUNC_URL_LEN (sizeof(FUNC_URL) - 1) +#define FUNC_B64 "b64" +#define FUNC_B64_LEN (sizeof(FUNC_B64) - 1) +#define FUNC_64DEC "64dec" /* base64 decode */ #define FUNC_64DEC_LEN (sizeof(FUNC_64DEC) - 1) static ParameterError varfunc(char *c, /* content */ @@ -105,7 +104,7 @@ static ParameterError varfunc(char *c, /* content */ c++; len--; } - while(len && ISSPACE(c[len-1])) + while(len && ISSPACE(c[len - 1])) len--; } /* put it in the output */ @@ -208,8 +207,7 @@ static ParameterError varfunc(char *c, /* content */ return err; } -ParameterError varexpand(const char *line, struct dynbuf *out, - bool *replaced) +ParameterError varexpand(const char *line, struct dynbuf *out, bool *replaced) { CURLcode result; char *envp; @@ -274,13 +272,12 @@ ParameterError varexpand(const char *line, struct dynbuf *out, name[nlen] = 0; /* verify that the name looks sensible */ - for(i = 0; (i < nlen) && - (ISALNUM(name[i]) || (name[i] == '_')); i++); + for(i = 0; (i < nlen) && (ISALNUM(name[i]) || (name[i] == '_')); i++) + ; if(i != nlen) { warnf("bad variable name: %s", name); /* insert the text as-is since this is not an env variable */ - result = curlx_dyn_addn(out, envp - prefix, - clp - envp + prefix + 2); + result = curlx_dyn_addn(out, envp - prefix, clp - envp + prefix + 2); if(result) return PARAM_NO_MEM; } diff --git a/src/var.h b/src/var.h index 4f1361cf1eab..40defea8ace1 100644 --- a/src/var.h +++ b/src/var.h @@ -34,8 +34,7 @@ struct tool_var { }; ParameterError setvariable(const char *input); -ParameterError varexpand(const char *line, struct dynbuf *out, - bool *replaced); +ParameterError varexpand(const char *line, struct dynbuf *out, bool *replaced); /* free everything */ void varcleanup(void); diff --git a/tests/test1486.pl b/tests/test1486.pl index 05006ebc63f5..79f6a856be48 100755 --- a/tests/test1486.pl +++ b/tests/test1486.pl @@ -45,7 +45,7 @@ sub getsrcvars { if($_ =~ /^}/) { last; } - if($_ =~ /^ \{\"([^\"]*)/) { + if($_ =~ /^ \{ \"([^\"]*)/) { my $var = $1; $insrc{$var} = $srccount++; } From 004f41c186becfd0bae1e5e456ba1842f0db7d9e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 2 Dec 2025 05:05:36 +0100 Subject: [PATCH 642/885] tests: add `%AMP` macro, use it in two tests To allow replacing `&` characters in `tests/data/test*` files for XML-compliance. Also: - document `%GT`, `%LT` Follow-up to de49cc89abc917cb4f273ebea8c6fb584d097de2 #19470 Closes #19824 --- docs/tests/FILEFORMAT.md | 8 ++++++++ tests/data/test1524 | 7 +++---- tests/data/test45 | 7 +++---- tests/testutil.pm | 1 + 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 1f3aa78991b8..90a249fac2d2 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -88,6 +88,14 @@ lines: %SP - space %TAB - horizontal tab +## Special characters + +Macros to help keep data files XML-compliant: + + %AMP - Ampersand: `&` + %GT - Greater-than sign: `>` + %LT - Less-than sign: `<` + ## Insert capped epoch days Mostly to test capped cookie expire dates: `%days[NUM]` inserts the number of diff --git a/tests/data/test1524 b/tests/data/test1524 index fcfd9f4c0001..8674e7660b07 100644 --- a/tests/data/test1524 +++ b/tests/data/test1524 @@ -4,7 +4,6 @@ HTTP HTTP PUT followlocation -notxml # @@ -12,7 +11,7 @@ notxml HTTP/1.1 303 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Connection: close @@ -25,7 +24,7 @@ body HTTP/1.1 303 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Connection: close HTTP/1.1 200 OK swsclose @@ -64,7 +63,7 @@ Accept: */* Content-Length: 4 moo -GET /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +GET /blah/moo.html%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test45 b/tests/data/test45 index 3d4df02f1332..f9b6dcc6db92 100644 --- a/tests/data/test45 +++ b/tests/data/test45 @@ -4,7 +4,6 @@ HTTP HTTP GET followlocation -notxml # Server-side @@ -13,7 +12,7 @@ notxml HTTP/1.1 301 This is a weirdo text message swsclose Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake -Location: data.cgi?moo=http://&/%TESTNUMBER0002 +Location: data.cgi?moo=http://%AMP/%TESTNUMBER0002 Connection: close This server reply is for testing a simple Location: following @@ -32,7 +31,7 @@ If this is received, the location following worked HTTP/1.1 301 This is a weirdo text message swsclose Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake -Location: data.cgi?moo=http://&/%TESTNUMBER0002 +Location: data.cgi?moo=http://%AMP/%TESTNUMBER0002 Connection: close HTTP/1.1 200 Followed here fine swsclose @@ -66,7 +65,7 @@ Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -GET /want/data.cgi?moo=http://&/%TESTNUMBER0002 HTTP/1.1 +GET /want/data.cgi?moo=http://%AMP/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/testutil.pm b/tests/testutil.pm index 7e2b279f07a0..4666770f072d 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -158,6 +158,7 @@ sub subbase64 { $$thing =~ s/%CR/\r/g; # carriage return aka \r aka 0x0d $$thing =~ s/%LT//g; + $$thing =~ s/%AMP/&/g; # include a file $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1, 0)/ge; From 276a4af4741c7ac5f4e24b22458146ebab049dcd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Dec 2025 17:22:37 +0100 Subject: [PATCH 643/885] test787: fix possible typo `&` -> `%` in curl option They are close on the keyboard and don't affect test results. To make this test XML-compliant. Ref: #14479 Follow-up to 40c264db617d025ca5053bc0964a185d11101301 #15739 Closes #19826 --- tests/data/test787 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/data/test787 b/tests/data/test787 index e95a18d17bd8..47b2effbde10 100644 --- a/tests/data/test787 +++ b/tests/data/test787 @@ -3,7 +3,6 @@ HTTP --variable -notxml @@ -22,7 +21,7 @@ http --variable with a file byte range, bad range -http://%HOSTIP:%HTTPPORT/%TESTNUMBER --variable "name[15-14]@&LOGDIR/fooo" --expand-data '{{name}}' +http://%HOSTIP:%HTTPPORT/%TESTNUMBER --variable "name[15-14]@%LOGDIR/fooo" --expand-data '{{name}}' From e8a4068e6868424d83a3394da4810c93a43c070a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 08:45:55 +0100 Subject: [PATCH 644/885] docs: clarify how to do unix domain sockets with SOCKS proxy Ref: #19825 Closes #19829 --- docs/cmdline-opts/socks4.md | 6 ++++-- docs/cmdline-opts/socks4a.md | 6 ++++-- docs/cmdline-opts/socks5-hostname.md | 6 ++++-- docs/cmdline-opts/socks5.md | 7 +++++-- docs/libcurl/opts/CURLOPT_PROXY.md | 5 +++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/cmdline-opts/socks4.md b/docs/cmdline-opts/socks4.md index 8e92d5930cb3..59ec172b8d86 100644 --- a/docs/cmdline-opts/socks4.md +++ b/docs/cmdline-opts/socks4.md @@ -7,6 +7,7 @@ Help: SOCKS4 proxy on given host + port Added: 7.15.2 Category: proxy Multi: single +Mutexed: proxy socks4a socks5 socks5-hostname See-also: - socks4a - socks5 @@ -21,8 +22,9 @@ Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. Using this socket type makes curl resolve the hostname and pass the address on to the proxy. -To specify proxy on a Unix domain socket, use localhost for host, e.g. -`socks4://localhost/path/to/socket.sock` +To specify the proxy on a Unix domain socket, use localhost for host and +append the absolute path to the domain socket. For example: +`socks4://localhost/path/to/socket.sock` (the scheme may be omitted). This option overrides any previous use of --proxy, as they are mutually exclusive. diff --git a/docs/cmdline-opts/socks4a.md b/docs/cmdline-opts/socks4a.md index 04d60b81b66d..9e451cf7b063 100644 --- a/docs/cmdline-opts/socks4a.md +++ b/docs/cmdline-opts/socks4a.md @@ -7,6 +7,7 @@ Help: SOCKS4a proxy on given host + port Added: 7.18.0 Category: proxy Multi: single +Mutexed: proxy socks4 socks5 socks5-hostname See-also: - socks4 - socks5 @@ -20,8 +21,9 @@ Example: Use the specified SOCKS4a proxy. If the port number is not specified, it is assumed at port 1080. This asks the proxy to resolve the hostname. -To specify proxy on a Unix domain socket, use localhost for host, e.g. -`socks4a://localhost/path/to/socket.sock` +To specify the proxy on a Unix domain socket, use localhost for host and +append the absolute path to the domain socket. For example: +`socks4a://localhost/path/to/socket.sock` (the scheme may be omitted). This option overrides any previous use of --proxy, as they are mutually exclusive. diff --git a/docs/cmdline-opts/socks5-hostname.md b/docs/cmdline-opts/socks5-hostname.md index 0ea2ed739fb9..b558248a78b9 100644 --- a/docs/cmdline-opts/socks5-hostname.md +++ b/docs/cmdline-opts/socks5-hostname.md @@ -7,6 +7,7 @@ Help: SOCKS5 proxy, pass hostname to proxy Added: 7.18.0 Category: proxy Multi: single +Mutexed: proxy socks4 socks4a socks5 See-also: - socks5 - socks4a @@ -19,8 +20,9 @@ Example: Use the specified SOCKS5 proxy (and let the proxy resolve the hostname). If the port number is not specified, it is assumed at port 1080. -To specify proxy on a Unix domain socket, use localhost for host, e.g. -`socks5h://localhost/path/to/socket.sock` +To specify the proxy on a Unix domain socket, use localhost for host and +append the absolute path to the domain socket. For example: +`socks5h://localhost/path/to/socket.sock` (the scheme may be omitted). This option overrides any previous use of --proxy, as they are mutually exclusive. diff --git a/docs/cmdline-opts/socks5.md b/docs/cmdline-opts/socks5.md index 4ea660d62d47..3aa65b33adda 100644 --- a/docs/cmdline-opts/socks5.md +++ b/docs/cmdline-opts/socks5.md @@ -10,8 +10,10 @@ Multi: single See-also: - socks5-hostname - socks4a +Mutexed: proxy socks4 socks4a socks5-hostname Example: - --socks5 proxy.example:7000 $URL + - --socks5 localhost/path/unix-domain $URL --- # `--socks5` @@ -19,8 +21,9 @@ Example: Use the specified SOCKS5 proxy - but resolve the hostname locally. If the port number is not specified, it is assumed at port 1080. -To specify proxy on a Unix domain socket, use localhost for host, e.g. -`socks5://localhost/path/to/socket.sock` +To specify the proxy on a Unix domain socket, use localhost for host and +append the absolute path to the domain socket. For example: +`socks5://localhost/path/to/socket.sock` (the scheme may be omitted). This option overrides any previous use of --proxy, as they are mutually exclusive. diff --git a/docs/libcurl/opts/CURLOPT_PROXY.md b/docs/libcurl/opts/CURLOPT_PROXY.md index 310e123e3db2..fca07f23f6f9 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY.md +++ b/docs/libcurl/opts/CURLOPT_PROXY.md @@ -89,8 +89,9 @@ proxy. Such tunneling is activated with CURLOPT_HTTPPROXYTUNNEL(3). Setting the proxy string to "" (an empty string) explicitly disables the use of a proxy, even if there is an environment variable set for it. -Unix domain sockets are supported for socks proxies since 7.84.0. Set -localhost for the host part. e.g. socks5h://localhost/path/to/socket.sock +Unix domain sockets are supported for SOCKS proxies. Set `localhost` for the +host part and append the absolute path to the domain socket. For example: +`socks5h://localhost/path/to/socket.sock` When you set a hostname to use, do not assume that there is any particular single port number used widely for proxies. Specify it. From ff2aaed9ba6f186feb57f89fc68546759fdb6dad Mon Sep 17 00:00:00 2001 From: Georg Schulz-Allgaier Date: Wed, 3 Dec 2025 22:49:05 +0100 Subject: [PATCH 645/885] noproxy: fix ipv6 handling Closes #19828 --- lib/noproxy.c | 34 ++++++---------------- tests/unit/unit1614.c | 66 +++++++++++++++++++++---------------------- 2 files changed, 42 insertions(+), 58 deletions(-) diff --git a/lib/noproxy.c b/lib/noproxy.c index 569466fb62ec..e0d0877fdc4f 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -185,8 +185,6 @@ static bool match_ip(int type, const char *token, size_t tokenlen, ****************************************************************/ bool Curl_check_noproxy(const char *name, const char *no_proxy) { - char hostip[128]; - /* * If we do not have a hostname at all, like for example with a FILE * transfer, we have nothing to interrogate the noproxy list with. @@ -202,37 +200,23 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) if(no_proxy && no_proxy[0]) { const char *p = no_proxy; size_t namelen; + char address[16]; enum nametype type = TYPE_HOST; if(!strcmp("*", no_proxy)) return TRUE; /* NO_PROXY was specified and it was not just an asterisk */ - if(name[0] == '[') { - char *endptr; - /* IPv6 numerical address */ - endptr = strchr(name, ']'); - if(!endptr) - return FALSE; - name++; - namelen = endptr - name; - if(namelen >= sizeof(hostip)) - return FALSE; - memcpy(hostip, name, namelen); - hostip[namelen] = 0; - name = hostip; + /* Check if name is an IP address; if not, assume it being a hostname. */ + namelen = strlen(name); + if(curlx_inet_pton(AF_INET, name, &address) == 1) + type = TYPE_IPV4; + else if(curlx_inet_pton(AF_INET6, name, &address) == 1) type = TYPE_IPV6; - } else { - unsigned int address; - namelen = strlen(name); - if(curlx_inet_pton(AF_INET, name, &address) == 1) - type = TYPE_IPV4; - else { - /* ignore trailing dots in the hostname */ - if(name[namelen - 1] == '.') - namelen--; - } + /* ignore trailing dots in the hostname */ + if(name[namelen - 1] == '.') + namelen--; } while(*p) { diff --git a/tests/unit/unit1614.c b/tests/unit/unit1614.c index 675133e5adf6..7b66af843119 100644 --- a/tests/unit/unit1614.c +++ b/tests/unit/unit1614.c @@ -113,39 +113,39 @@ static CURLcode test_unit1614(const char *arg) { "192.168.1.1", "foo, bar, 192.168.0.0/24", FALSE}, { "192.168.1.1", "foo, bar, 192.168.0.0/16", TRUE}, #ifdef USE_IPV6 - { "[::1]", "foo, bar, 192.168.0.0/16", FALSE}, - { "[::1]", "foo, bar, ::1/64", TRUE}, - { "[::1]", "::1/64", TRUE}, - { "[::1]", "::1/96", TRUE}, - { "[::1]", "::1/129", FALSE}, - { "[::1]", "::1/128", TRUE}, - { "[::1]", "::1/127", TRUE}, - { "[::1]", "::1/a127", FALSE}, - { "[::1]", "::1/127a", FALSE}, - { "[::1]", "::1/ 127", FALSE}, - { "[::1]", "::1/127 ", TRUE}, - { "[::1]", "::1/126", TRUE}, - { "[::1]", "::1/125", TRUE}, - { "[::1]", "::1/124", TRUE}, - { "[::1]", "::1/123", TRUE}, - { "[::1]", "::1/122", TRUE}, - { "[2001:db8:8000::1]", "2001:db8::/65", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/66", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/67", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/68", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/69", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/70", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/71", FALSE}, - { "[2001:db8:8000::1]", "2001:db8::/72", FALSE}, - { "[2001:db8::1]", "2001:db8::/65", TRUE}, - { "[2001:db8::1]", "2001:db8::/66", TRUE}, - { "[2001:db8::1]", "2001:db8::/67", TRUE}, - { "[2001:db8::1]", "2001:db8::/68", TRUE}, - { "[2001:db8::1]", "2001:db8::/69", TRUE}, - { "[2001:db8::1]", "2001:db8::/70", TRUE}, - { "[2001:db8::1]", "2001:db8::/71", TRUE}, - { "[2001:db8::1]", "2001:db8::/72", TRUE}, - { "[::1]", "::1/129", FALSE}, + { "::1", "foo, bar, 192.168.0.0/16", FALSE}, + { "::1", "foo, bar, ::1/64", TRUE}, + { "::1", "::1/64", TRUE}, + { "::1", "::1/96", TRUE}, + { "::1", "::1/129", FALSE}, + { "::1", "::1/128", TRUE}, + { "::1", "::1/127", TRUE}, + { "::1", "::1/a127", FALSE}, + { "::1", "::1/127a", FALSE}, + { "::1", "::1/ 127", FALSE}, + { "::1", "::1/127 ", TRUE}, + { "::1", "::1/126", TRUE}, + { "::1", "::1/125", TRUE}, + { "::1", "::1/124", TRUE}, + { "::1", "::1/123", TRUE}, + { "::1", "::1/122", TRUE}, + { "2001:db8:8000::1", "2001:db8::/65", FALSE}, + { "2001:db8:8000::1", "2001:db8::/66", FALSE}, + { "2001:db8:8000::1", "2001:db8::/67", FALSE}, + { "2001:db8:8000::1", "2001:db8::/68", FALSE}, + { "2001:db8:8000::1", "2001:db8::/69", FALSE}, + { "2001:db8:8000::1", "2001:db8::/70", FALSE}, + { "2001:db8:8000::1", "2001:db8::/71", FALSE}, + { "2001:db8:8000::1", "2001:db8::/72", FALSE}, + { "2001:db8::1", "2001:db8::/65", TRUE}, + { "2001:db8::1", "2001:db8::/66", TRUE}, + { "2001:db8::1", "2001:db8::/67", TRUE}, + { "2001:db8::1", "2001:db8::/68", TRUE}, + { "2001:db8::1", "2001:db8::/69", TRUE}, + { "2001:db8::1", "2001:db8::/70", TRUE}, + { "2001:db8::1", "2001:db8::/71", TRUE}, + { "2001:db8::1", "2001:db8::/72", TRUE}, + { "::1", "::1/129", FALSE}, { "bar", "foo, bar, ::1/64", TRUE}, { "BAr", "foo, bar, ::1/64", TRUE}, { "BAr", "foo,,,,, bar, ::1/64", TRUE}, From 472bc9032374f98f48f7a2df6c644cff91fe142c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Dec 2025 04:42:02 +0100 Subject: [PATCH 646/885] runtests: make memanalyzer a Perl module (for 1.1-2x speed-up per test run) Patch #19786 removed an exception, which caused many more CI jobs to run `memanalyze.pl`. It resulted in a 10-30% (Linux), 15% (macOS), 100% (2x, on Windows) slowdown of runtest steps. It also made some jobs exceed their time limits and fail (seen with the Windows ARM64 job.) Turns out the overhead was caused by calling `memanalyze.pl` as an external process (twice per test), which in turn had to load a full Perl stack from scratch each time. Fix by converting memanalyze to a Perl modul, loaded as part of `runtests.pl`, which eliminated the overhead completely. It also sped up existing jobs where memanalyze was run for a long time, e.g. two c-ares Windows jobs, saving 4.5m per CI run. Supersedes #19819 Bug: https://github.com/curl/curl/pull/19786#issuecomment-3598679397 Follow-up to fb7033d7600dfb59de06e7af8a0d6ab2a4163578 #19786 Closes #19821 --- tests/Makefile.am | 1 + tests/memanalyze.pl | 429 +--------------------------------------- tests/memanalyzer.pm | 459 +++++++++++++++++++++++++++++++++++++++++++ tests/runtests.pl | 5 +- 4 files changed, 471 insertions(+), 423 deletions(-) create mode 100644 tests/memanalyzer.pm diff --git a/tests/Makefile.am b/tests/Makefile.am index 0371159d68d8..6c48328ae109 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -61,6 +61,7 @@ EXTRA_DIST = \ http2-server.pl \ http3-server.pl \ memanalyze.pl \ + memanalyzer.pm \ negtelnetserver.py \ nghttpx.conf \ pathhelp.pm \ diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index 2b38e5e8a424..e30b263c4128 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -22,27 +22,15 @@ # SPDX-License-Identifier: curl # ########################################################################### -# -# Example input: -# -# MEM mprintf.c:1094 malloc(32) = e5718 -# MEM mprintf.c:1103 realloc(e5718, 64) = e6118 -# MEM sendf.c:232 free(f6520) use strict; use warnings; -my $mallocs=0; -my $callocs=0; -my $reallocs=0; -my $strdups=0; -my $wcsdups=0; -my $showlimit=0; -my $sends=0; -my $recvs=0; -my $sockets=0; -my $verbose=0; -my $trace=0; +use memanalyzer; + +my $showlimit = 0; +my $verbose = 0; +my $trace = 0; while(@ARGV) { if($ARGV[0] eq "-v") { @@ -63,411 +51,10 @@ } } -my $memsum = 0; # the total number of memory allocated over the lifetime -my $maxmem = 0; # the high water mark - -sub newtotal { - my ($newtot)=@_; - # count a max here - - if($newtot > $maxmem) { - $maxmem = $newtot; - } -} - my $file = $ARGV[0] || ''; -if(! -f $file) { - print "Usage: memanalyze.pl [options] \n", - "Options:\n", - " -l memlimit failure displayed\n", - " -v Verbose\n", - " -t Trace\n"; - exit; -} - -open(my $fileh, "<", "$file"); - -if($showlimit) { - while(<$fileh>) { - if(/^LIMIT.*memlimit$/) { - print $_; - last; - } - } - close($fileh); - exit; -} - -my %sizeataddr; -my %getmem; - -my $totalmem = 0; -my $frees = 0; - -my $dup; -my $size; -my $addr; - -my %filedes; -my %getfile; - -my %fopen; -my %fopenfile; -my $openfile = 0; -my $fopens = 0; - -my %addrinfo; -my %addrinfofile; -my $addrinfos = 0; - -my $source; -my $linenum; -my $function; - -my $lnum = 0; -while(<$fileh>) { - chomp $_; - my $line = $_; - $lnum++; - if($line =~ /^BT/) { - # back-trace, ignore - } - elsif($line =~ /^LIMIT ([^ ]*):(\d*) (.*)/) { - # new memory limit test prefix - my $i = $3; - my ($source, $linenum) = ($1, $2); - if($trace && ($i =~ /([^ ]*) reached memlimit/)) { - print "LIMIT: $1 returned error at $source:$linenum\n"; - } - } - elsif($line =~ /^MEM ([^ ]*):(\d*) (.*)/) { - # generic match for the filename+linenumber - $source = $1; - $linenum = $2; - $function = $3; - - if($function =~ /free\((\(nil\)|0x([0-9a-f]*))/) { - $addr = $2; - if($1 eq "(nil)") { - ; # do nothing when free(NULL) - } - elsif(!exists $sizeataddr{$addr}) { - print "FREE ERROR: No memory allocated: $line\n"; - } - elsif(-1 == $sizeataddr{$addr}) { - print "FREE ERROR: Memory freed twice: $line\n"; - print "FREE ERROR: Previously freed at: ".$getmem{$addr}."\n"; - } - else { - $totalmem -= $sizeataddr{$addr}; - if($trace) { - print "FREE: malloc at ".$getmem{$addr}." is freed again at $source:$linenum\n"; - printf("FREE: %d bytes freed, left allocated: $totalmem bytes\n", $sizeataddr{$addr}); - } - - newtotal($totalmem); - $frees++; - - $sizeataddr{$addr}=-1; # set -1 to mark as freed - $getmem{$addr}="$source:$linenum"; - - } - } - elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) { - $size = $1; - $addr = $2; - - if($sizeataddr{$addr} && $sizeataddr{$addr}>0) { - # this means weeeeeirdo - print "Mixed debug compile ($source:$linenum at line $lnum), rebuild curl now\n"; - print "We think $sizeataddr{$addr} bytes are already allocated at that memory address: $addr!\n"; - } - - $sizeataddr{$addr} = $size; - $totalmem += $size; - $memsum += $size; - - if($trace) { - print "MALLOC: malloc($size) at $source:$linenum", - " makes totally $totalmem bytes\n"; - } - - newtotal($totalmem); - $mallocs++; - - $getmem{$addr}="$source:$linenum"; - } - elsif($function =~ /calloc\((\d*),(\d*)\) = 0x([0-9a-f]*)/) { - $size = $1*$2; - $addr = $3; - - my $arg1 = $1; - my $arg2 = $2; - - if($sizeataddr{$addr} && $sizeataddr{$addr}>0) { - # this means weeeeeirdo - print "Mixed debug compile, rebuild curl now\n"; - } - - $sizeataddr{$addr}=$size; - $totalmem += $size; - $memsum += $size; - - if($trace) { - print "CALLOC: calloc($arg1,$arg2) at $source:$linenum", - " makes totally $totalmem bytes\n"; - } - - newtotal($totalmem); - $callocs++; - - $getmem{$addr}="$source:$linenum"; - } - elsif($function =~ /realloc\((\(nil\)|0x([0-9a-f]*)), (\d*)\) = 0x([0-9a-f]*)/) { - my ($oldaddr, $newsize, $newaddr) = ($2, $3, $4); - - if($oldaddr) { - my $oldsize = $sizeataddr{$oldaddr} ? $sizeataddr{$oldaddr} : 0; - - $totalmem -= $oldsize; - if($trace) { - printf("REALLOC: %d less bytes and ", $oldsize); - } - $sizeataddr{$oldaddr}=0; - - $getmem{$oldaddr}=""; - } - - $totalmem += $newsize; - $memsum += $newsize; - $sizeataddr{$newaddr}=$newsize; - - if($trace) { - printf("%d more bytes ($source:$linenum)\n", $newsize); - } - - newtotal($totalmem); - $reallocs++; - - $getmem{$newaddr}="$source:$linenum"; - } - elsif($function =~ /strdup\(0x([0-9a-f]*)\) \((\d*)\) = 0x([0-9a-f]*)/) { - # strdup(a5b50) (8) = df7c0 - - $dup = $1; - $size = $2; - $addr = $3; - $getmem{$addr}="$source:$linenum"; - $sizeataddr{$addr}=$size; - - $totalmem += $size; - $memsum += $size; - - if($trace) { - printf("STRDUP: $size bytes at %s, makes totally: %d bytes\n", - $getmem{$addr}, $totalmem); - } - - newtotal($totalmem); - $strdups++; - } - elsif($function =~ /wcsdup\(0x([0-9a-f]*)\) \((\d*)\) = 0x([0-9a-f]*)/) { - # wcsdup(a5b50) (8) = df7c0 - - $dup = $1; - $size = $2; - $addr = $3; - $getmem{$addr}="$source:$linenum"; - $sizeataddr{$addr}=$size; - - $totalmem += $size; - $memsum += $size; - - if($trace) { - printf("WCSDUP: $size bytes at %s, makes totally: %d bytes\n", - $getmem{$addr}, $totalmem); - } - - newtotal($totalmem); - $wcsdups++; - } - else { - print "Not recognized input line: $function\n"; - } - } - # FD url.c:1282 socket() = 5 - elsif($_ =~ /^FD ([^ ]*):(\d*) (.*)/) { - # generic match for the filename+linenumber - $source = $1; - $linenum = $2; - $function = $3; - - if($function =~ /socket\(\) = (\d*)/) { - $filedes{$1}=1; - $getfile{$1}="$source:$linenum"; - $openfile++; - $sockets++; # number of socket() calls - } - elsif($function =~ /socketpair\(\) = (\d*) (\d*)/) { - $filedes{$1}=1; - $getfile{$1}="$source:$linenum"; - $openfile++; - $filedes{$2}=1; - $getfile{$2}="$source:$linenum"; - $openfile++; - } - elsif($function =~ /accept\(\) = (\d*)/) { - $filedes{$1}=1; - $getfile{$1}="$source:$linenum"; - $openfile++; - } - elsif($function =~ /sclose\((\d*)\)/) { - if($filedes{$1} != 1) { - print "Close without open: $line\n"; - } - else { - $filedes{$1}=0; # closed now - $openfile--; - } - } - } - # FILE url.c:1282 fopen("blabla") = 0x5ddd - elsif($_ =~ /^FILE ([^ ]*):(\d*) (.*)/) { - # generic match for the filename+linenumber - $source = $1; - $linenum = $2; - $function = $3; - - if($function =~ /f[d]*open\(\"(.*)\",\"([^\"]*)\"\) = (\(nil\)|0x([0-9a-f]*))/) { - if($3 eq "(nil)") { - ; - } - else { - $fopen{$4}=1; - $fopenfile{$4}="$source:$linenum"; - $fopens++; - } - } - # fclose(0x1026c8) - elsif($function =~ /fclose\(0x([0-9a-f]*)\)/) { - if(!$fopen{$1}) { - print "fclose() without fopen(): $line\n"; - } - else { - $fopen{$1}=0; - $fopens--; - } - } - } - # GETNAME url.c:1901 getnameinfo() - elsif($_ =~ /^GETNAME ([^ ]*):(\d*) (.*)/) { - # not much to do - } - # SEND url.c:1901 send(83) = 83 - elsif($_ =~ /^SEND ([^ ]*):(\d*) (.*)/) { - $sends++; - } - # RECV url.c:1901 recv(102400) = 256 - elsif($_ =~ /^RECV ([^ ]*):(\d*) (.*)/) { - $recvs++; - } - - # ADDR url.c:1282 getaddrinfo() = 0x5ddd - elsif($_ =~ /^ADDR ([^ ]*):(\d*) (.*)/) { - # generic match for the filename+linenumber - $source = $1; - $linenum = $2; - $function = $3; - - if($function =~ /getaddrinfo\(\) = (\(nil\)|0x([0-9a-f]*))/) { - my $add = $1; - if($add eq "(nil)") { - ; - } - else { - $addrinfo{$add}=1; - $addrinfofile{$add}="$source:$linenum"; - $addrinfos++; - } - if($trace) { - printf("GETADDRINFO ($source:$linenum)\n"); - } - } - # fclose(0x1026c8) - elsif($function =~ /freeaddrinfo\((0x[0-9a-f]*)\)/) { - my $addr = $1; - if(!$addrinfo{$addr}) { - print "freeaddrinfo() without getaddrinfo(): $line\n"; - } - else { - $addrinfo{$addr}=0; - $addrinfos--; - } - if($trace) { - printf("FREEADDRINFO ($source:$linenum)\n"); - } - } - - } - else { - print "Not recognized prefix line: $line\n"; - } -} -close($fileh); - -if($totalmem) { - print "Leak detected: memory still allocated: $totalmem bytes\n"; - - for(keys %sizeataddr) { - $addr = $_; - $size = $sizeataddr{$addr}; - if($size > 0) { - print "At $addr, there is $size bytes.\n"; - print " allocated by ".$getmem{$addr}."\n"; - } - } -} - -if($openfile) { - for(keys %filedes) { - if($filedes{$_} == 1) { - print "Open file descriptor created at ".$getfile{$_}."\n"; - } - } -} - -if($fopens) { - print "Open FILE handles left at:\n"; - for(keys %fopen) { - if($fopen{$_} == 1) { - print "fopen() called at ".$fopenfile{$_}."\n"; - } - } -} - -if($addrinfos) { - print "IPv6-style name resolve data left at:\n"; - for(keys %addrinfofile) { - if($addrinfo{$_} == 1) { - print "getaddrinfo() called at ".$addrinfofile{$_}."\n"; - } - } -} - -if($verbose) { - print "Mallocs: $mallocs\n", - "Reallocs: $reallocs\n", - "Callocs: $callocs\n", - "Strdups: $strdups\n", - "Wcsdups: $wcsdups\n", - "Frees: $frees\n", - "Sends: $sends\n", - "Recvs: $recvs\n", - "Sockets: $sockets\n", - "Allocations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups)."\n", - "Operations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups + $sends + $recvs + $sockets)."\n"; +my @res = memanalyze($file, $verbose, $trace, $showlimit); - print "Maximum allocated: $maxmem\n"; - print "Total allocated: $memsum\n"; +for (@res) { + print $_; } diff --git a/tests/memanalyzer.pm b/tests/memanalyzer.pm new file mode 100644 index 000000000000..7dbdf7b94a91 --- /dev/null +++ b/tests/memanalyzer.pm @@ -0,0 +1,459 @@ +#!/usr/bin/env perl +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### +# +# Example input: +# +# MEM mprintf.c:1094 malloc(32) = e5718 +# MEM mprintf.c:1103 realloc(e5718, 64) = e6118 +# MEM sendf.c:232 free(f6520) + +package memanalyzer; + +use strict; +use warnings; + +BEGIN { + use base qw(Exporter); + + our @EXPORT = qw( + memanalyze + ); +} + +my $memsum; +my $maxmem; + +sub newtotal { + my ($newtot)=@_; + # count a max here + + if($newtot > $maxmem) { + $maxmem = $newtot; + } +} + +sub memanalyze { + my ($file, $verbose, $trace, $showlimit) = @_; + my @res; + + my $mallocs = 0; + my $callocs = 0; + my $reallocs = 0; + my $strdups = 0; + my $wcsdups = 0; + my $sends = 0; + my $recvs = 0; + my $sockets = 0; + + $memsum = 0; # the total number of memory allocated over the lifetime + $maxmem = 0; # the high water mark + + open(my $fileh, "<", "$file") or return (); + + if($showlimit) { + while(<$fileh>) { + if(/^LIMIT.*memlimit$/) { + push @res, $_; + last; + } + } + close($fileh); + return @res; + } + + my %sizeataddr; + my %getmem; + + my $totalmem = 0; + my $frees = 0; + + my $dup; + my $size; + my $addr; + + my %filedes; + my %getfile; + + my %fopen; + my %fopenfile; + my $openfile = 0; + my $fopens = 0; + + my %addrinfo; + my %addrinfofile; + my $addrinfos = 0; + + my $source; + my $linenum; + my $function; + + my $lnum = 0; + + while(<$fileh>) { + chomp $_; + my $line = $_; + $lnum++; + if($line =~ /^BT/) { + # back-trace, ignore + } + elsif($line =~ /^LIMIT ([^ ]*):(\d*) (.*)/) { + # new memory limit test prefix + my $i = $3; + my ($source, $linenum) = ($1, $2); + if($trace && ($i =~ /([^ ]*) reached memlimit/)) { + push @res, "LIMIT: $1 returned error at $source:$linenum\n"; + } + } + elsif($line =~ /^MEM ([^ ]*):(\d*) (.*)/) { + # generic match for the filename+linenumber + $source = $1; + $linenum = $2; + $function = $3; + + if($function =~ /free\((\(nil\)|0x([0-9a-f]*))/) { + $addr = $2; + if($1 eq "(nil)") { + ; # do nothing when free(NULL) + } + elsif(!exists $sizeataddr{$addr}) { + push @res, "FREE ERROR: No memory allocated: $line\n"; + } + elsif(-1 == $sizeataddr{$addr}) { + push @res, "FREE ERROR: Memory freed twice: $line\n"; + push @res, "FREE ERROR: Previously freed at: $getmem{$addr}\n"; + } + else { + $totalmem -= $sizeataddr{$addr}; + if($trace) { + push @res, "FREE: malloc at $getmem{$addr} is freed again at $source:$linenum\n"; + push @res, "FREE: $sizeataddr{$addr} bytes freed, left allocated: $totalmem bytes\n"; + } + + newtotal($totalmem); + $frees++; + + $sizeataddr{$addr}=-1; # set -1 to mark as freed + $getmem{$addr}="$source:$linenum"; + + } + } + elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) { + $size = $1; + $addr = $2; + + if($sizeataddr{$addr} && $sizeataddr{$addr}>0) { + # this means weeeeeirdo + push @res, "Mixed debug compile ($source:$linenum at line $lnum), rebuild curl now\n"; + push @res, "We think $sizeataddr{$addr} bytes are already allocated at that memory address: $addr!\n"; + } + + $sizeataddr{$addr} = $size; + $totalmem += $size; + $memsum += $size; + + if($trace) { + push @res, "MALLOC: malloc($size) at $source:$linenum makes totally $totalmem bytes\n"; + } + + newtotal($totalmem); + $mallocs++; + + $getmem{$addr}="$source:$linenum"; + } + elsif($function =~ /calloc\((\d*),(\d*)\) = 0x([0-9a-f]*)/) { + $size = $1 * $2; + $addr = $3; + + my $arg1 = $1; + my $arg2 = $2; + + if($sizeataddr{$addr} && $sizeataddr{$addr}>0) { + # this means weeeeeirdo + push @res, "Mixed debug compile, rebuild curl now\n"; + } + + $sizeataddr{$addr} = $size; + $totalmem += $size; + $memsum += $size; + + if($trace) { + push @res, "CALLOC: calloc($arg1,$arg2) at $source:$linenum makes totally $totalmem bytes\n"; + } + + newtotal($totalmem); + $callocs++; + + $getmem{$addr}="$source:$linenum"; + } + elsif($function =~ /realloc\((\(nil\)|0x([0-9a-f]*)), (\d*)\) = 0x([0-9a-f]*)/) { + my ($oldaddr, $newsize, $newaddr) = ($2, $3, $4); + my $oldsize = '-'; + + if($oldaddr) { + $oldsize = $sizeataddr{$oldaddr} ? $sizeataddr{$oldaddr} : 0; + + $totalmem -= $oldsize; + if($trace) { + } + $sizeataddr{$oldaddr} = 0; + + $getmem{$oldaddr} = ""; + } + + $totalmem += $newsize; + $memsum += $newsize; + $sizeataddr{$newaddr} = $newsize; + + if($trace) { + push @res, "REALLOC: $oldsize less bytes and $newsize more bytes ($source:$linenum)\n"; + } + + newtotal($totalmem); + $reallocs++; + + $getmem{$newaddr}="$source:$linenum"; + } + elsif($function =~ /strdup\(0x([0-9a-f]*)\) \((\d*)\) = 0x([0-9a-f]*)/) { + # strdup(a5b50) (8) = df7c0 + + $dup = $1; + $size = $2; + $addr = $3; + $getmem{$addr} = "$source:$linenum"; + $sizeataddr{$addr} = $size; + + $totalmem += $size; + $memsum += $size; + + if($trace) { + push @res, "STRDUP: $size bytes at $getmem{$addr}, makes totally: $totalmem bytes\n"; + } + + newtotal($totalmem); + $strdups++; + } + elsif($function =~ /wcsdup\(0x([0-9a-f]*)\) \((\d*)\) = 0x([0-9a-f]*)/) { + # wcsdup(a5b50) (8) = df7c0 + + $dup = $1; + $size = $2; + $addr = $3; + $getmem{$addr}="$source:$linenum"; + $sizeataddr{$addr}=$size; + + $totalmem += $size; + $memsum += $size; + + if($trace) { + push @res, "WCSDUP: $size bytes at $getmem{$addr}, makes totally: $totalmem bytes\n"; + } + + newtotal($totalmem); + $wcsdups++; + } + else { + push @res, "Not recognized input line: $function\n"; + } + } + # FD url.c:1282 socket() = 5 + elsif($_ =~ /^FD ([^ ]*):(\d*) (.*)/) { + # generic match for the filename+linenumber + $source = $1; + $linenum = $2; + $function = $3; + + if($function =~ /socket\(\) = (\d*)/) { + $filedes{$1} = 1; + $getfile{$1} = "$source:$linenum"; + $openfile++; + $sockets++; # number of socket() calls + } + elsif($function =~ /socketpair\(\) = (\d*) (\d*)/) { + $filedes{$1} = 1; + $getfile{$1} = "$source:$linenum"; + $openfile++; + $filedes{$2} = 1; + $getfile{$2} = "$source:$linenum"; + $openfile++; + } + elsif($function =~ /accept\(\) = (\d*)/) { + $filedes{$1} = 1; + $getfile{$1} = "$source:$linenum"; + $openfile++; + } + elsif($function =~ /sclose\((\d*)\)/) { + if($filedes{$1} != 1) { + push @res, "Close without open: $line\n"; + } + else { + $filedes{$1}=0; # closed now + $openfile--; + } + } + } + # FILE url.c:1282 fopen("blabla") = 0x5ddd + elsif($_ =~ /^FILE ([^ ]*):(\d*) (.*)/) { + # generic match for the filename+linenumber + $source = $1; + $linenum = $2; + $function = $3; + + if($function =~ /f[d]*open\(\"(.*)\",\"([^\"]*)\"\) = (\(nil\)|0x([0-9a-f]*))/) { + if($3 eq "(nil)") { + ; + } + else { + $fopen{$4} = 1; + $fopenfile{$4} = "$source:$linenum"; + $fopens++; + } + } + # fclose(0x1026c8) + elsif($function =~ /fclose\(0x([0-9a-f]*)\)/) { + if(!$fopen{$1}) { + push @res, "fclose() without fopen(): $line\n"; + } + else { + $fopen{$1} = 0; + $fopens--; + } + } + } + # GETNAME url.c:1901 getnameinfo() + elsif($_ =~ /^GETNAME ([^ ]*):(\d*) (.*)/) { + # not much to do + } + # SEND url.c:1901 send(83) = 83 + elsif($_ =~ /^SEND ([^ ]*):(\d*) (.*)/) { + $sends++; + } + # RECV url.c:1901 recv(102400) = 256 + elsif($_ =~ /^RECV ([^ ]*):(\d*) (.*)/) { + $recvs++; + } + + # ADDR url.c:1282 getaddrinfo() = 0x5ddd + elsif($_ =~ /^ADDR ([^ ]*):(\d*) (.*)/) { + # generic match for the filename+linenumber + $source = $1; + $linenum = $2; + $function = $3; + + if($function =~ /getaddrinfo\(\) = (\(nil\)|0x([0-9a-f]*))/) { + my $add = $1; + if($add eq "(nil)") { + ; + } + else { + $addrinfo{$add} = 1; + $addrinfofile{$add} = "$source:$linenum"; + $addrinfos++; + } + if($trace) { + push @res, "GETADDRINFO ($source:$linenum)\n"; + } + } + # fclose(0x1026c8) + elsif($function =~ /freeaddrinfo\((0x[0-9a-f]*)\)/) { + my $addr = $1; + if(!$addrinfo{$addr}) { + push @res, "freeaddrinfo() without getaddrinfo(): $line\n"; + } + else { + $addrinfo{$addr} = 0; + $addrinfos--; + } + if($trace) { + push @res, "FREEADDRINFO ($source:$linenum)\n"; + } + } + + } + else { + push @res, "Not recognized prefix line: $line\n"; + } + } + close($fileh); + + if($totalmem) { + push @res, "Leak detected: memory still allocated: $totalmem bytes\n"; + + for(keys %sizeataddr) { + $addr = $_; + $size = $sizeataddr{$addr}; + if($size > 0) { + push @res, "At $addr, there is $size bytes.\n"; + push @res, " allocated by $getmem{$addr}\n"; + } + } + } + + if($openfile) { + for(keys %filedes) { + if($filedes{$_} == 1) { + push @res, "Open file descriptor created at $getfile{$_}.\n"; + } + } + } + + if($fopens) { + push @res, "Open FILE handles left at:\n"; + for(keys %fopen) { + if($fopen{$_} == 1) { + push @res, "fopen() called at $fopenfile{$_}.\n"; + } + } + } + + if($addrinfos) { + push @res, "IPv6-style name resolve data left at:\n"; + for(keys %addrinfofile) { + if($addrinfo{$_} == 1) { + push @res, "getaddrinfo() called at $addrinfofile{$_}.\n"; + } + } + } + + if($verbose) { + push @res, + "Mallocs: $mallocs\n", + "Reallocs: $reallocs\n", + "Callocs: $callocs\n", + "Strdups: $strdups\n", + "Wcsdups: $wcsdups\n", + "Frees: $frees\n", + "Sends: $sends\n", + "Recvs: $recvs\n", + "Sockets: $sockets\n", + "Allocations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups)."\n", + "Operations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups + $sends + $recvs + $sockets)."\n", + "Maximum allocated: $maxmem\n", + "Total allocated: $memsum\n"; + } + + return @res; +} + +1; diff --git a/tests/runtests.pl b/tests/runtests.pl index d0455d224380..32a03446d132 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -102,6 +102,7 @@ BEGIN use globalconfig; use runner; use testutil; +use memanalyzer; my %custom_skip_reasons; @@ -1757,7 +1758,7 @@ sub singletest_check { $ok .= "-"; # problem with memory checking } else { - my @memdata=`$memanalyze "$logdir/$MEMDUMP"`; + my @memdata = memanalyze("$logdir/$MEMDUMP", 0, 0, 0); my $leak=0; for(@memdata) { if($_ ne "") { @@ -1776,7 +1777,7 @@ sub singletest_check { else { $ok .= "m"; } - my @more=`$memanalyze -v "$logdir/$MEMDUMP"`; + my @more = memanalyze("$logdir/$MEMDUMP", 1, 0, 0); my $allocs = 0; my $max = 0; for(@more) { From 608f5dd4557b449d9ece5aa193a4b89ac3760422 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Thu, 4 Dec 2025 14:43:18 +0100 Subject: [PATCH 647/885] vtls: do not reach into ASN1_STRING OpenSSL 4 has plans to make ASN1_STRING opaque, which will break the build, so convert the code to use accessors. ASN1_STRING_length() and ASN1_STRING_type() go way back to SSLeay and ASN1_STRING_get0_data() is OpenSSL 1.1 API present in BoringSSL since foreer and also available since LibreSSL 2.7, so this should not cause compat issues with any libcrypto in a supported version of the fork family. https://github.com/openssl/openssl/issues/29117 Closes #19831 --- lib/vtls/openssl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 67466e6e41d5..444fbc4e0453 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -412,6 +412,7 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) for(i = 0; !result && (i < (int)numcerts); i++) { ASN1_INTEGER *num; + const unsigned char *numdata; X509 *x = sk_X509_value(sk, (ossl_valsize_t)i); EVP_PKEY *pubkey = NULL; int j; @@ -433,10 +434,11 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) break; num = X509_get_serialNumber(x); - if(num->type == V_ASN1_NEG_INTEGER) + if(ASN1_STRING_type(num) == V_ASN1_NEG_INTEGER) BIO_puts(mem, "-"); - for(j = 0; j < num->length; j++) - BIO_printf(mem, "%02x", num->data[j]); + numdata = ASN1_STRING_get0_data(num); + for(j = 0; j < ASN1_STRING_length(num); j++) + BIO_printf(mem, "%02x", numdata[j]); result = push_certinfo(data, mem, "Serial Number", i); if(result) break; @@ -503,8 +505,9 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) } if(!result && psig) { - for(j = 0; j < psig->length; j++) - BIO_printf(mem, "%02x:", psig->data[j]); + const unsigned char *psigdata = ASN1_STRING_get0_data(psig); + for(j = 0; j < ASN1_STRING_length(psig); j++) + BIO_printf(mem, "%02x:", psigdata[j]); result = push_certinfo(data, mem, "Signature", i); } From 39d1976b7f709a516e3243338ebc0443bdd8d56d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 00:14:20 +0100 Subject: [PATCH 648/885] ldap: call ldap_init() before setting the options Closes #19830 --- lib/ldap.c | 50 +++++++++++++++++++------------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/lib/ldap.c b/lib/ldap.c index 63b2cbc414f6..0911a9239a2d 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -377,16 +377,29 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) passwd = conn->passwd; } +#ifdef USE_WIN32_LDAP + if(ldap_ssl) + server = ldap_sslinit(host, (curl_ldap_num_t)ipquad.remote_port, 1); + else +#else + server = ldap_init(host, (curl_ldap_num_t)ipquad.remote_port); +#endif + if(!server) { + failf(data, "LDAP: cannot setup connect to %s:%u", + conn->host.dispname, ipquad.remote_port); + result = CURLE_COULDNT_CONNECT; + goto quit; + } + #ifdef LDAP_OPT_NETWORK_TIMEOUT - ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, &ldap_timeout); + ldap_set_option(server, LDAP_OPT_NETWORK_TIMEOUT, &ldap_timeout); #endif - ldap_set_option(NULL, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); + ldap_set_option(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); if(ldap_ssl) { #ifdef HAVE_LDAP_SSL #ifdef USE_WIN32_LDAP /* Win32 LDAP SDK does not support insecure mode without CA! */ - server = ldap_sslinit(host, (curl_ldap_num_t)ipquad.remote_port, 1); ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON); #else /* !USE_WIN32_LDAP */ int ldap_option; @@ -406,7 +419,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) goto quit; } infof(data, "LDAP local: using PEM CA cert: %s", ldap_ca); - rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE, ldap_ca); + rc = ldap_set_option(server, LDAP_OPT_X_TLS_CACERTFILE, ldap_ca); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting PEM CA cert: %s", ldap_err2string(rc)); @@ -418,20 +431,13 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) else ldap_option = LDAP_OPT_X_TLS_NEVER; - rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &ldap_option); + rc = ldap_set_option(server, LDAP_OPT_X_TLS_REQUIRE_CERT, &ldap_option); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting cert verify mode: %s", ldap_err2string(rc)); result = CURLE_SSL_CERTPROBLEM; goto quit; } - server = ldap_init(host, ipquad.remote_port); - if(!server) { - failf(data, "LDAP local: Cannot connect to %s:%u", - conn->host.dispname, ipquad.remote_port); - result = CURLE_COULDNT_CONNECT; - goto quit; - } ldap_option = LDAP_OPT_X_TLS_HARD; rc = ldap_set_option(server, LDAP_OPT_X_TLS, &ldap_option); if(rc != LDAP_SUCCESS) { @@ -440,16 +446,6 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) result = CURLE_SSL_CERTPROBLEM; goto quit; } -#if 0 - rc = ldap_start_tls_s(server, NULL, NULL); - if(rc != LDAP_SUCCESS) { - failf(data, "LDAP local: ERROR starting SSL/TLS mode: %s", - ldap_err2string(rc)); - result = CURLE_SSL_CERTPROBLEM; - goto quit; - } -#endif - #else /* !LDAP_OPT_X_TLS */ (void)ldap_option; (void)ldap_ca; @@ -468,15 +464,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) result = CURLE_NOT_BUILT_IN; goto quit; } - else { - server = ldap_init(host, (curl_ldap_num_t)ipquad.remote_port); - if(!server) { - failf(data, "LDAP local: Cannot connect to %s:%u", - conn->host.dispname, ipquad.remote_port); - result = CURLE_COULDNT_CONNECT; - goto quit; - } - } + #ifdef USE_WIN32_LDAP ldap_set_option(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); rc = ldap_win_bind(data, server, user, passwd); From f39b8a11749dba677848ea1e7d2ed20f23f87f03 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 3 Dec 2025 18:36:03 +0100 Subject: [PATCH 649/885] lib: add a Curl_bufref_uptr() function and use it Function Curl_bufref_ptr() now returns a const char *. New function Curl_bufref_uptr() returns a const unsigned char *. Usage and doc updated. Closes #19827 --- docs/internals/BUFREF.md | 10 +++++++++- lib/bufref.c | 14 +++++++++++++- lib/bufref.h | 3 ++- lib/curl_sasl.c | 4 ++-- lib/http_ntlm.c | 4 ++-- lib/imap.c | 5 ++--- lib/pop3.c | 5 ++--- lib/smtp.c | 5 ++--- lib/vauth/cram.c | 2 +- lib/vauth/digest.c | 2 +- lib/vauth/gsasl.c | 3 +-- lib/vauth/ntlm.c | 4 ++-- lib/vauth/ntlm_sspi.c | 2 +- 13 files changed, 40 insertions(+), 23 deletions(-) diff --git a/docs/internals/BUFREF.md b/docs/internals/BUFREF.md index 9a8b506b561a..686a092aecc3 100644 --- a/docs/internals/BUFREF.md +++ b/docs/internals/BUFREF.md @@ -72,7 +72,15 @@ Returns `CURLE_OK` if successful, else `CURLE_OUT_OF_MEMORY`. ## `ptr` ```c -const unsigned char *Curl_bufref_ptr(const struct bufref *br); +const char *Curl_bufref_ptr(const struct bufref *br); +``` + +Returns a `const char *` to the referenced buffer. + +## `uptr` + +```c +const unsigned char *Curl_bufref_uptr(const struct bufref *br); ``` Returns a `const unsigned char *` to the referenced buffer. diff --git a/lib/bufref.c b/lib/bufref.c index 643fe5d2e08c..8dcd3592dbe4 100644 --- a/lib/bufref.c +++ b/lib/bufref.c @@ -84,7 +84,7 @@ void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len, /* * Get a pointer to the referenced buffer. */ -const unsigned char *Curl_bufref_ptr(const struct bufref *br) +const unsigned char *Curl_bufref_uptr(const struct bufref *br) { DEBUGASSERT(br); DEBUGASSERT(br->signature == SIGNATURE); @@ -93,6 +93,18 @@ const unsigned char *Curl_bufref_ptr(const struct bufref *br) return br->ptr; } +/* + * Get a pointer to the referenced string. + */ +const char *Curl_bufref_ptr(const struct bufref *br) +{ + DEBUGASSERT(br); + DEBUGASSERT(br->signature == SIGNATURE); + DEBUGASSERT(br->ptr || !br->len); + + return (const char *) br->ptr; +} + /* * Get the length of the referenced buffer data. */ diff --git a/lib/bufref.h b/lib/bufref.h index f80011fde5ec..b8ffe383478b 100644 --- a/lib/bufref.h +++ b/lib/bufref.h @@ -39,7 +39,8 @@ struct bufref { void Curl_bufref_init(struct bufref *br); void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len, void (*dtor)(void *)); -const unsigned char *Curl_bufref_ptr(const struct bufref *br); +const char *Curl_bufref_ptr(const struct bufref *br); +const unsigned char *Curl_bufref_uptr(const struct bufref *br); size_t Curl_bufref_len(const struct bufref *br); CURLcode Curl_bufref_memdup(struct bufref *br, const void *ptr, size_t len); void Curl_bufref_free(struct bufref *br); diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index a4cd5a207b68..3e4bafc19ae4 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -235,7 +235,7 @@ static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data, if(!result && (sasl->params->flags & SASL_FLAG_BASE64)) { unsigned char *msg; size_t msglen; - const char *serverdata = (const char *)Curl_bufref_ptr(out); + const char *serverdata = Curl_bufref_ptr(out); if(!*serverdata || *serverdata == '=') Curl_bufref_set(out, NULL, 0, NULL); @@ -263,7 +263,7 @@ static CURLcode build_message(struct SASL *sasl, struct bufref *msg) char *base64; size_t base64len; - result = curlx_base64_encode(Curl_bufref_ptr(msg), + result = curlx_base64_encode(Curl_bufref_uptr(msg), Curl_bufref_len(msg), &base64, &base64len); if(!result) Curl_bufref_set(msg, base64, base64len, curl_free); diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index e1b48d76759d..8d15a8a16227 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -201,7 +201,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) hostname, ntlm, &ntlmmsg); if(!result) { DEBUGASSERT(Curl_bufref_len(&ntlmmsg) != 0); - result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), + result = curlx_base64_encode(Curl_bufref_uptr(&ntlmmsg), Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { curlx_free(*allocuserpwd); @@ -219,7 +219,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) result = Curl_auth_create_ntlm_type3_message(data, userp, passwdp, ntlm, &ntlmmsg); if(!result && Curl_bufref_len(&ntlmmsg)) { - result = curlx_base64_encode(Curl_bufref_ptr(&ntlmmsg), + result = curlx_base64_encode(Curl_bufref_uptr(&ntlmmsg), Curl_bufref_len(&ntlmmsg), &base64, &len); if(!result) { curlx_free(*allocuserpwd); diff --git a/lib/imap.c b/lib/imap.c index ec5e654cfae9..cbc4506a9d85 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -636,7 +636,7 @@ static CURLcode imap_perform_authenticate(struct Curl_easy *data, struct imap_conn *imapc = Curl_conn_meta_get(data->conn, CURL_META_IMAP_CONN); CURLcode result = CURLE_OK; - const char *ir = (const char *)Curl_bufref_ptr(initresp); + const char *ir = Curl_bufref_ptr(initresp); if(!imapc) return CURLE_FAILED_INIT; @@ -668,8 +668,7 @@ static CURLcode imap_continue_authenticate(struct Curl_easy *data, (void)mech; if(!imapc) return CURLE_FAILED_INIT; - return Curl_pp_sendf(data, &imapc->pp, - "%s", (const char *)Curl_bufref_ptr(resp)); + return Curl_pp_sendf(data, &imapc->pp, "%s", Curl_bufref_ptr(resp)); } /*********************************************************************** diff --git a/lib/pop3.c b/lib/pop3.c index 771069b3d434..0ddff3e45ef9 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -623,7 +623,7 @@ static CURLcode pop3_perform_auth(struct Curl_easy *data, struct pop3_conn *pop3c = Curl_conn_meta_get(data->conn, CURL_META_POP3_CONN); CURLcode result = CURLE_OK; - const char *ir = (const char *)Curl_bufref_ptr(initresp); + const char *ir = Curl_bufref_ptr(initresp); if(!pop3c) return CURLE_FAILED_INIT; @@ -657,8 +657,7 @@ static CURLcode pop3_continue_auth(struct Curl_easy *data, if(!pop3c) return CURLE_FAILED_INIT; - return Curl_pp_sendf(data, &pop3c->pp, - "%s", (const char *) Curl_bufref_ptr(resp)); + return Curl_pp_sendf(data, &pop3c->pp, "%s", Curl_bufref_ptr(resp)); } /*********************************************************************** diff --git a/lib/smtp.c b/lib/smtp.c index 5aab391e379a..fa821fe45de3 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -506,7 +506,7 @@ static CURLcode smtp_perform_auth(struct Curl_easy *data, CURLcode result = CURLE_OK; struct smtp_conn *smtpc = Curl_conn_meta_get(data->conn, CURL_META_SMTP_CONN); - const char *ir = (const char *)Curl_bufref_ptr(initresp); + const char *ir = Curl_bufref_ptr(initresp); if(!smtpc) return CURLE_FAILED_INIT; @@ -539,8 +539,7 @@ static CURLcode smtp_continue_auth(struct Curl_easy *data, (void)mech; if(!smtpc) return CURLE_FAILED_INIT; - return Curl_pp_sendf(data, &smtpc->pp, - "%s", (const char *)Curl_bufref_ptr(resp)); + return Curl_pp_sendf(data, &smtpc->pp, "%s", Curl_bufref_ptr(resp)); } /*********************************************************************** diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index 6a39a400ee3c..7cce86fd62b5 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -69,7 +69,7 @@ CURLcode Curl_auth_create_cram_md5_message(const struct bufref *chlg, /* Update the digest with the given challenge */ if(Curl_bufref_len(chlg)) - Curl_HMAC_update(ctxt, Curl_bufref_ptr(chlg), + Curl_HMAC_update(ctxt, Curl_bufref_uptr(chlg), curlx_uztoui(Curl_bufref_len(chlg))); /* Finalise the digest */ diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 8bcfc7ed6c9c..ce3a7b368779 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -271,7 +271,7 @@ static CURLcode auth_decode_digest_md5_message(const struct bufref *chlgref, char *alg, size_t alen, char *qop, size_t qlen) { - const char *chlg = (const char *)Curl_bufref_ptr(chlgref); + const char *chlg = Curl_bufref_ptr(chlgref); /* Ensure we have a valid challenge message */ if(!Curl_bufref_len(chlgref)) diff --git a/lib/vauth/gsasl.c b/lib/vauth/gsasl.c index 3888622dbffa..4c83793d788d 100644 --- a/lib/vauth/gsasl.c +++ b/lib/vauth/gsasl.c @@ -98,8 +98,7 @@ CURLcode Curl_auth_gsasl_token(struct Curl_easy *data, char *response; size_t outlen; - res = gsasl_step(gsasl->client, - (const char *)Curl_bufref_ptr(chlg), Curl_bufref_len(chlg), + res = gsasl_step(gsasl->client, Curl_bufref_ptr(chlg), Curl_bufref_len(chlg), &response, &outlen); if(res != GSASL_OK && res != GSASL_NEEDS_MORE) { failf(data, "GSASL step: %s", gsasl_strerror(res)); diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 22d028e8c2fa..7fd13d8745c1 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -255,7 +255,7 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data, { unsigned short target_info_len = 0; unsigned int target_info_offset = 0; - const unsigned char *type2 = Curl_bufref_ptr(type2ref); + const unsigned char *type2 = Curl_bufref_uptr(type2ref); size_t type2len = Curl_bufref_len(type2ref); #ifdef CURL_DISABLE_VERBOSE_STRINGS @@ -355,7 +355,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data, */ CURLcode result = CURLE_OK; - const unsigned char *type2 = Curl_bufref_ptr(type2ref); + const unsigned char *type2 = Curl_bufref_uptr(type2ref); size_t type2len = Curl_bufref_len(type2ref); #ifdef CURL_DISABLE_VERBOSE_STRINGS diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index d724907db649..e4aad6e24f8d 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -209,7 +209,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data, } /* Store the challenge for later use */ - ntlm->input_token = Curl_memdup0((const char *)Curl_bufref_ptr(type2), + ntlm->input_token = Curl_memdup0(Curl_bufref_ptr(type2), Curl_bufref_len(type2)); if(!ntlm->input_token) return CURLE_OUT_OF_MEMORY; From 36542b734966fce2ce5689d689a0e4922a103e50 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 3 Dec 2025 23:15:18 +0100 Subject: [PATCH 650/885] lib: turn state.url into a struct bufref Closes #19827 --- lib/cookie.c | 3 ++- lib/curl_rtmp.c | 3 ++- lib/easy.c | 12 ++++++------ lib/getinfo.c | 7 +++++-- lib/http.c | 22 +++++++++++----------- lib/http2.c | 8 +++----- lib/ldap.c | 5 +++-- lib/multi.c | 5 +++-- lib/openldap.c | 5 +++-- lib/setopt.c | 14 +++----------- lib/transfer.c | 11 +++-------- lib/url.c | 37 +++++++++++++------------------------ lib/urldata.h | 4 ++-- lib/vquic/curl_ngtcp2.c | 3 ++- lib/vquic/curl_osslq.c | 3 ++- lib/vquic/curl_quiche.c | 7 ++++--- 16 files changed, 67 insertions(+), 82 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index e3cf8e4e0cf1..dff5198c1162 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -40,6 +40,7 @@ #include "rename.h" #include "strdup.h" #include "llist.h" +#include "bufref.h" #include "curlx/strparse.h" static void strstore(char **str, const char *newstr, size_t len); @@ -1622,7 +1623,7 @@ void Curl_flush_cookies(struct Curl_easy *data, bool cleanup) set), as otherwise the cookies were not completely initialized and there might be cookie files that were not loaded so saving the file is the wrong thing. */ - if(data->set.str[STRING_COOKIEJAR] && data->state.url) { + if(data->set.str[STRING_COOKIEJAR] && Curl_bufref_ptr(&data->state.url)) { /* if we have a destination file for all the cookies to get dumped to */ CURLcode result = cookie_output(data, data->cookies, data->set.str[STRING_COOKIEJAR]); diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 1eebbb5b3f24..e0597cdcca92 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -33,6 +33,7 @@ #include "curlx/nonblock.h" /* for curlx_nonblock */ #include "progress.h" /* for Curl_pgrsSetUploadSize */ #include "transfer.h" +#include "bufref.h" #include "curlx/warnless.h" #include #include @@ -233,7 +234,7 @@ static CURLcode rtmp_setup_connection(struct Curl_easy *data, RTMP_Init(r); RTMP_SetBufferMS(r, DEF_BUFTIME); - if(!RTMP_SetupURL(r, data->state.url)) + if(!RTMP_SetupURL(r, CURL_UNCONST(Curl_bufref_ptr(&data->state.url)))) /* rtmp_conn_dtor() performs the cleanup */ return CURLE_URL_MALFORMAT; return CURLE_OK; diff --git a/lib/easy.c b/lib/easy.c index d2f6c36c0d87..c18fdd09bf86 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -75,6 +75,7 @@ #include "system_win32.h" #include "http2.h" #include "curlx/dynbuf.h" +#include "bufref.h" #include "altsvc.h" #include "hsts.h" @@ -975,6 +976,7 @@ CURL *curl_easy_duphandle(CURL *d) Curl_hash_init(&outcurl->meta_hash, 23, Curl_hash_str, curlx_str_key_compare, dupeasy_meta_freeentry); curlx_dyn_init(&outcurl->state.headerb, CURL_MAX_HTTP_HEADER); + Curl_bufref_init(&outcurl->state.url); Curl_netrc_init(&outcurl->state.netrc); /* the connection pool is setup on demand */ @@ -1014,12 +1016,10 @@ CURL *curl_easy_duphandle(CURL *d) } #endif - if(data->state.url) { - outcurl->state.url = curlx_strdup(data->state.url); - if(!outcurl->state.url) - goto fail; - outcurl->state.url_alloc = TRUE; - } + if(Curl_bufref_ptr(&data->state.url)) + Curl_bufref_set(&outcurl->state.url, + curlx_strdup(Curl_bufref_ptr(&data->state.url)), 0, + curl_free); if(data->state.referer) { outcurl->state.referer = curlx_strdup(data->state.referer); diff --git a/lib/getinfo.c b/lib/getinfo.c index 13e9622d3302..59dc19877742 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -32,6 +32,7 @@ #include "vtls/vtls.h" #include "connect.h" /* Curl_getconnectinfo() */ #include "progress.h" +#include "bufref.h" #include "curlx/strparse.h" /* @@ -91,8 +92,10 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, const char **param_charp) { switch(info) { - case CURLINFO_EFFECTIVE_URL: - *param_charp = data->state.url ? data->state.url : ""; + case CURLINFO_EFFECTIVE_URL: { + const char *s = Curl_bufref_ptr(&data->state.url); + *param_charp = s ? s : ""; + } break; case CURLINFO_EFFECTIVE_METHOD: { const char *m = data->set.str[STRING_CUSTOMREQUEST]; diff --git a/lib/http.c b/lib/http.c index 3178ca59e993..ae7458572b6a 100644 --- a/lib/http.c +++ b/lib/http.c @@ -84,6 +84,7 @@ #include "altsvc.h" #include "hsts.h" #include "ws.h" +#include "bufref.h" #include "curl_ctype.h" #include "curlx/strparse.h" @@ -610,7 +611,8 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) we must make sure to free it before allocating a new one. As figured out in bug #2284386 */ curlx_free(data->req.newurl); - data->req.newurl = curlx_strdup(data->state.url); /* clone URL */ + /* clone URL */ + data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; } @@ -623,7 +625,8 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) we did not try HEAD or GET */ if((data->state.httpreq != HTTPREQ_GET) && (data->state.httpreq != HTTPREQ_HEAD)) { - data->req.newurl = curlx_strdup(data->state.url); /* clone URL */ + /* clone URL */ + data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authhost.done = TRUE; @@ -909,7 +912,7 @@ static CURLcode auth_spnego(struct Curl_easy *data, &conn->http_negotiate_state; if(!result) { curlx_free(data->req.newurl); - data->req.newurl = curlx_strdup(data->state.url); + data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authproblem = FALSE; @@ -1243,7 +1246,8 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, if(!u) return CURLE_OUT_OF_MEMORY; - uc = curl_url_set(u, CURLUPART_URL, data->state.url, 0); + uc = curl_url_set(u, CURLUPART_URL, + Curl_bufref_ptr(&data->state.url), 0); if(!uc) uc = curl_url_set(u, CURLUPART_FRAGMENT, NULL, 0); if(!uc) @@ -1365,13 +1369,9 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, if(disallowport) data->state.allow_port = FALSE; - if(data->state.url_alloc) - Curl_safefree(data->state.url); - - data->state.url = follow_url; - data->state.url_alloc = TRUE; + Curl_bufref_set(&data->state.url, follow_url, 0, curl_free); rewind_result = Curl_req_soft_reset(&data->req, data); - infof(data, "Issue another request to this URL: '%s'", data->state.url); + infof(data, "Issue another request to this URL: '%s'", follow_url); if((data->set.http_follow_mode == CURLFOLLOW_FIRSTONLY) && data->set.str[STRING_CUSTOMREQUEST] && !data->state.http_ignorecustom) { @@ -4054,7 +4054,7 @@ static CURLcode http_on_response(struct Curl_easy *data, data->state.disableexpect = TRUE; Curl_req_abort_sending(data); DEBUGASSERT(!data->req.newurl); - data->req.newurl = curlx_strdup(data->state.url); + data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); if(!data->req.newurl) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/http2.c b/lib/http2.c index a3ff8c85294e..df38f82cafa0 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -44,6 +44,7 @@ #include "rand.h" #include "curlx/strparse.h" #include "transfer.h" +#include "bufref.h" #include "curlx/dynbuf.h" #include "curlx/warnless.h" #include "headers.h" @@ -920,10 +921,7 @@ static int set_transfer_url(struct Curl_easy *data, if(rc) return rc; - if(data->state.url_alloc) - curlx_free(data->state.url); - data->state.url_alloc = TRUE; - data->state.url = url; + Curl_bufref_set(&data->state.url, url, 0, curl_free); return 0; } @@ -2316,7 +2314,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream, size_t acc = 0, i; infof(data, "[HTTP/2] [%d] OPENED stream for %s", - stream_id, data->state.url); + stream_id, Curl_bufref_ptr(&data->state.url)); for(i = 0; i < nheader; ++i) { acc += nva[i].namelen + nva[i].valuelen; diff --git a/lib/ldap.c b/lib/ldap.c index 0911a9239a2d..b6ed43d90415 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -89,6 +89,7 @@ #include "progress.h" #include "transfer.h" #include "curlx/strparse.h" +#include "bufref.h" #include "curl_ldap.h" #include "curlx/multibyte.h" #include "curlx/base64.h" @@ -338,10 +339,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) *done = TRUE; /* unconditionally */ infof(data, "LDAP local: LDAP Vendor = %s ; LDAP Version = %d", LDAP_VENDOR_NAME, LDAP_VENDOR_VERSION); - infof(data, "LDAP local: %s", data->state.url); + infof(data, "LDAP local: %s", Curl_bufref_ptr(&data->state.url)); #ifdef HAVE_LDAP_URL_PARSE - rc = ldap_url_parse(data->state.url, &ludp); + rc = ldap_url_parse(Curl_bufref_ptr(&data->state.url), &ludp); #else rc = ldap_url_parse_low(data, conn, &ludp); #endif diff --git a/lib/multi.c b/lib/multi.c index b912f7a212f2..3086d61c7489 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -53,6 +53,7 @@ #include "socketpair.h" #include "socks.h" #include "urlapi-int.h" +#include "bufref.h" /* initial multi->xfers table size for a full multi */ #define CURL_XFER_TABLE_SIZE 512 @@ -2006,7 +2007,7 @@ static CURLMcode state_performing(struct Curl_easy *data, data->state.errorbuf = FALSE; if(!newurl) /* typically for HTTP_1_1_REQUIRED error on first flight */ - newurl = curlx_strdup(data->state.url); + newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); if(!newurl) { result = CURLE_OUT_OF_MEMORY; } @@ -4066,7 +4067,7 @@ static void multi_xfer_dump(struct Curl_multi *multi, uint32_t mid, ", url=%s\n", mid, (data->magic == CURLEASY_MAGIC_NUMBER) ? "GOOD" : "BAD!", - (void *)data, data->id, data->state.url); + (void *)data, data->id, Curl_bufref_ptr(&data->state.url)); } } diff --git a/lib/openldap.c b/lib/openldap.c index ba1a39181f38..a1756e427907 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -52,6 +52,7 @@ #include "connect.h" #include "curl_sasl.h" #include "strcase.h" +#include "bufref.h" /* * Uncommenting this will enable the built-in debug logging of the openldap @@ -272,7 +273,7 @@ static CURLcode oldap_url_parse(struct Curl_easy *data, LDAPURLDesc **ludp) *ludp = NULL; if(!data->state.up.user && !data->state.up.password && !data->state.up.options) - rc = ldap_url_parse(data->state.url, ludp); + rc = ldap_url_parse(Curl_bufref_ptr(&data->state.url), ludp); if(rc != LDAP_URL_SUCCESS) { const char *msg = "url parsing problem"; @@ -988,7 +989,7 @@ static CURLcode oldap_do(struct Curl_easy *data, bool *done) if(!li) return CURLE_FAILED_INIT; - infof(data, "LDAP local: %s", data->state.url); + infof(data, "LDAP local: %s", Curl_bufref_ptr(&data->state.url)); result = oldap_url_parse(data, &lud); if(result) diff --git a/lib/setopt.c b/lib/setopt.c index 0a377be1f165..bcaf3fc2ae28 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -54,6 +54,7 @@ #include "tftp.h" #include "strdup.h" #include "escape.h" +#include "bufref.h" static CURLcode setopt_set_timeout_sec(timediff_t *ptimeout_ms, long secs) { @@ -1971,12 +1972,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* * The URL to fetch. */ - if(data->state.url_alloc) { - Curl_safefree(data->state.url); - data->state.url_alloc = FALSE; - } result = Curl_setstropt(&s->str[STRING_SET_URL], ptr); - data->state.url = s->str[STRING_SET_URL]; + Curl_bufref_set(&data->state.url, s->str[STRING_SET_URL], 0, NULL); break; case CURLOPT_USERPWD: @@ -2063,12 +2060,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* * pass CURLU to set URL */ - if(data->state.url_alloc) { - Curl_safefree(data->state.url); - data->state.url_alloc = FALSE; - } - else - data->state.url = NULL; + Curl_bufref_free(&data->state.url); Curl_safefree(s->str[STRING_SET_URL]); s->uh = (CURLU *)ptr; break; diff --git a/lib/transfer.c b/lib/transfer.c index a8a66f86c7b9..34f0698ebd75 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -79,6 +79,7 @@ #include "hsts.h" #include "setopt.h" #include "headers.h" +#include "bufref.h" #include "curlx/warnless.h" #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ @@ -484,13 +485,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) } } - /* since the URL may have been redirected in a previous use of this handle */ - if(data->state.url_alloc) { - Curl_safefree(data->state.url); - data->state.url_alloc = FALSE; - } - - data->state.url = data->set.str[STRING_SET_URL]; + Curl_bufref_set(&data->state.url, data->set.str[STRING_SET_URL], 0, NULL); if(data->set.postfields && data->set.set_resume_from) { /* we cannot */ @@ -676,7 +671,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) } infof(data, "Connection died, retrying a fresh connect (retry count: %d)", data->state.retrycount); - *url = curlx_strdup(data->state.url); + *url = curlx_strdup(Curl_bufref_ptr(&data->state.url)); if(!*url) return CURLE_OUT_OF_MEMORY; diff --git a/lib/url.c b/lib/url.c index f646b74ed4a7..65161d7e2488 100644 --- a/lib/url.c +++ b/lib/url.c @@ -73,6 +73,7 @@ #include "netrc.h" #include "formdata.h" #include "mime.h" +#include "bufref.h" #include "vtls/vtls.h" #include "hostip.h" #include "transfer.h" @@ -184,11 +185,7 @@ void Curl_freeset(struct Curl_easy *data) data->state.referer_alloc = FALSE; } data->state.referer = NULL; - if(data->state.url_alloc) { - Curl_safefree(data->state.url); - data->state.url_alloc = FALSE; - } - data->state.url = NULL; + Curl_bufref_free(&data->state.url); Curl_mime_cleanpart(&data->set.mimepost); @@ -516,6 +513,7 @@ CURLcode Curl_open(struct Curl_easy **curl) Curl_hash_init(&data->meta_hash, 23, Curl_hash_str, curlx_str_key_compare, easy_meta_freeentry); curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER); + Curl_bufref_init(&data->state.url); Curl_req_init(&data->req); Curl_initinfo(data); #ifndef CURL_DISABLE_HTTP @@ -1769,22 +1767,19 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; if(data->set.str[STRING_DEFAULT_PROTOCOL] && - !Curl_is_absolute_url(data->state.url, NULL, 0, TRUE)) { + !Curl_is_absolute_url(Curl_bufref_ptr(&data->state.url), NULL, 0, TRUE)) { char *url = curl_maprintf("%s://%s", data->set.str[STRING_DEFAULT_PROTOCOL], - data->state.url); + Curl_bufref_ptr(&data->state.url)); if(!url) return CURLE_OUT_OF_MEMORY; - if(data->state.url_alloc) - curlx_free(data->state.url); - data->state.url = url; - data->state.url_alloc = TRUE; + Curl_bufref_set(&data->state.url, url, 0, curl_free); } if(!use_set_uh) { char *newurl; - uc = curl_url_set(uh, CURLUPART_URL, data->state.url, (unsigned int) - (CURLU_GUESS_SCHEME | + uc = curl_url_set(uh, CURLUPART_URL, Curl_bufref_ptr(&data->state.url), + (unsigned int) (CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME | (data->set.disallow_username_in_url ? CURLU_DISALLOW_USER : 0) | @@ -1798,10 +1793,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, uc = curl_url_get(uh, CURLUPART_URL, &newurl, 0); if(uc) return Curl_uc_to_curlcode(uc); - if(data->state.url_alloc) - curlx_free(data->state.url); - data->state.url = newurl; - data->state.url_alloc = TRUE; + Curl_bufref_set(&data->state.url, newurl, 0, curl_free); } uc = curl_url_get(uh, CURLUPART_SCHEME, &data->state.up.scheme, 0); @@ -1855,8 +1847,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, uc = curl_url_set(uh, CURLUPART_SCHEME, "https", 0); if(uc) return Curl_uc_to_curlcode(uc); - if(data->state.url_alloc) - Curl_safefree(data->state.url); + Curl_bufref_free(&data->state.url); /* after update, get the updated version */ uc = curl_url_get(uh, CURLUPART_URL, &url, 0); if(uc) @@ -1866,10 +1857,8 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, curlx_free(url); return Curl_uc_to_curlcode(uc); } - data->state.url = url; - data->state.url_alloc = TRUE; - infof(data, "Switched from HTTP to HTTPS due to HSTS => %s", - data->state.url); + Curl_bufref_set(&data->state.url, url, 0, curl_free); + infof(data, "Switched from HTTP to HTTPS due to HSTS => %s", url); } } #endif @@ -3396,7 +3385,7 @@ static CURLcode create_conn(struct Curl_easy *data, /************************************************************* * Check input data *************************************************************/ - if(!data->state.url) { + if(!Curl_bufref_ptr(&data->state.url)) { result = CURLE_URL_MALFORMAT; goto out; } diff --git a/lib/urldata.h b/lib/urldata.h index aa1326d2a645..554e002020ad 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -154,6 +154,7 @@ typedef unsigned int curl_prot_t; #include "hash.h" #include "splay.h" #include "curlx/dynbuf.h" +#include "bufref.h" #include "dynhds.h" #include "request.h" #include "ratelimit.h" @@ -1025,7 +1026,7 @@ struct UrlState { void *in; /* CURLOPT_READDATA */ CURLU *uh; /* URL handle for the current parsed URL */ struct urlpieces up; - char *url; /* work URL, copied from UserDefined */ + struct bufref url; /* work URL, initially copied from UserDefined */ char *referer; /* referer string */ struct curl_slist *resolve; /* set to point to the set.resolve list when this should be dealt with in pretransfer */ @@ -1122,7 +1123,6 @@ struct UrlState { #ifdef CURL_LIST_ONLY_PROTOCOL BIT(list_only); /* list directory contents */ #endif - BIT(url_alloc); /* URL string is malloc()'ed */ BIT(referer_alloc); /* referer string is malloc()ed */ BIT(wildcard_resolve); /* Set to true if any resolve change is a wildcard */ BIT(upload); /* upload request */ diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 09b30229f08d..cf7b95bf6f94 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -61,6 +61,7 @@ #include "../select.h" #include "../curlx/inet_pton.h" #include "../transfer.h" +#include "../bufref.h" #include "vquic.h" #include "vquic_int.h" #include "vquic-tls.h" @@ -1631,7 +1632,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, if(Curl_trc_is_verbose(data)) { infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", - stream->id, data->state.url); + stream->id, Curl_bufref_ptr(&data->state.url)); for(i = 0; i < nheader; ++i) { infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->id, (int)nva[i].namelen, nva[i].name, diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index ece4ce6ad570..79bd1180dcf6 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -54,6 +54,7 @@ #include "../vtls/openssl.h" #include "curl_osslq.h" #include "../url.h" +#include "../bufref.h" #include "../curlx/warnless.h" #include "../curlx/strerr.h" @@ -1985,7 +1986,7 @@ static CURLcode h3_stream_open(struct Curl_cfilter *cf, if(Curl_trc_is_verbose(data)) { infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", - stream->s.id, data->state.url); + stream->s.id, Curl_bufref_ptr(&data->state.url)); for(i = 0; i < nheader; ++i) { infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->s.id, diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 913311085270..a35ffbec65e8 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -46,6 +46,7 @@ #include "curl_quiche.h" #include "../transfer.h" #include "../url.h" +#include "../bufref.h" #include "../curlx/inet_pton.h" #include "../curlx/warnless.h" #include "../vtls/openssl.h" @@ -1023,8 +1024,8 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, goto out; } else { - CURL_TRC_CF(data, cf, "send_request(%s) -> %" PRId64, - data->state.url, rv); + CURL_TRC_CF(data, cf, "send_request(%s) -> %" PRIu64, + Curl_bufref_ptr(&data->state.url), rv); } result = CURLE_SEND_ERROR; goto out; @@ -1038,7 +1039,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf, if(Curl_trc_is_verbose(data)) { infof(data, "[HTTP/3] [%" PRIu64 "] OPENED stream for %s", - stream->id, data->state.url); + stream->id, Curl_bufref_ptr(&data->state.url)); for(i = 0; i < nheader; ++i) { infof(data, "[HTTP/3] [%" PRIu64 "] [%.*s: %.*s]", stream->id, (int)nva[i].name_len, nva[i].name, From 2cb868242dc2ac9cd52ee64987ef51d5964a56f9 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 3 Dec 2025 21:13:52 +0100 Subject: [PATCH 651/885] lib: turn state.referer into a struct bufref Closes #19827 --- lib/easy.c | 16 ++++++++++------ lib/getinfo.c | 2 +- lib/http.c | 15 ++++++--------- lib/rtsp.c | 8 +++++--- lib/setopt.c | 6 +----- lib/url.c | 13 +++---------- lib/urldata.h | 3 +-- 7 files changed, 27 insertions(+), 36 deletions(-) diff --git a/lib/easy.c b/lib/easy.c index c18fdd09bf86..68ec3000f856 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -977,6 +977,7 @@ CURL *curl_easy_duphandle(CURL *d) Curl_hash_str, curlx_str_key_compare, dupeasy_meta_freeentry); curlx_dyn_init(&outcurl->state.headerb, CURL_MAX_HTTP_HEADER); Curl_bufref_init(&outcurl->state.url); + Curl_bufref_init(&outcurl->state.referer); Curl_netrc_init(&outcurl->state.netrc); /* the connection pool is setup on demand */ @@ -1016,16 +1017,19 @@ CURL *curl_easy_duphandle(CURL *d) } #endif - if(Curl_bufref_ptr(&data->state.url)) + if(Curl_bufref_ptr(&data->state.url)) { Curl_bufref_set(&outcurl->state.url, curlx_strdup(Curl_bufref_ptr(&data->state.url)), 0, curl_free); - - if(data->state.referer) { - outcurl->state.referer = curlx_strdup(data->state.referer); - if(!outcurl->state.referer) + if(!Curl_bufref_ptr(&outcurl->state.url)) + goto fail; + } + if(Curl_bufref_ptr(&data->state.referer)) { + Curl_bufref_set(&outcurl->state.referer, + curlx_strdup(Curl_bufref_ptr(&data->state.referer)), 0, + curl_free); + if(!Curl_bufref_ptr(&outcurl->state.referer)) goto fail; - outcurl->state.referer_alloc = TRUE; } /* Reinitialize an SSL engine for the new handle diff --git a/lib/getinfo.c b/lib/getinfo.c index 59dc19877742..82c701e07c67 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -148,7 +148,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, break; case CURLINFO_REFERER: /* Return the referrer header for this request, or NULL if unset */ - *param_charp = data->state.referer; + *param_charp = Curl_bufref_ptr(&data->state.referer); break; case CURLINFO_PRIMARY_IP: /* Return the ip address of the most recent (primary) connection */ diff --git a/lib/http.c b/lib/http.c index ae7458572b6a..afe37da5b660 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1235,11 +1235,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, /* We are asked to automatically set the previous URL as the referer when we get the next URL. We pick the ->url field, which may or may not be 100% correct */ - - if(data->state.referer_alloc) { - Curl_safefree(data->state.referer); - data->state.referer_alloc = FALSE; - } + Curl_bufref_free(&data->state.referer); /* Make a copy of the URL without credentials and fragment */ u = curl_url(); @@ -1262,8 +1258,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl, if(uc || !referer) return CURLE_OUT_OF_MEMORY; - data->state.referer = referer; - data->state.referer_alloc = TRUE; /* yes, free this later */ + Curl_bufref_set(&data->state.referer, referer, 0, curl_free); } } } @@ -2867,8 +2862,10 @@ static CURLcode http_add_hd(struct Curl_easy *data, case H1_HD_REFERER: Curl_safefree(data->state.aptr.ref); - if(data->state.referer && !Curl_checkheaders(data, STRCONST("Referer"))) - result = curlx_dyn_addf(req, "Referer: %s\r\n", data->state.referer); + if(Curl_bufref_ptr(&data->state.referer) && + !Curl_checkheaders(data, STRCONST("Referer"))) + result = curlx_dyn_addf(req, "Referer: %s\r\n", + Curl_bufref_ptr(&data->state.referer)); break; #ifndef CURL_DISABLE_PROXY diff --git a/lib/rtsp.c b/lib/rtsp.c index ee5d822a5404..0a807899f9a9 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -40,6 +40,7 @@ #include "connect.h" #include "cfilters.h" #include "strdup.h" +#include "bufref.h" #include "curlx/strparse.h" @@ -536,9 +537,10 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) /* Referrer */ Curl_safefree(data->state.aptr.ref); - if(data->state.referer && !Curl_checkheaders(data, STRCONST("Referer"))) - data->state.aptr.ref = curl_maprintf("Referer: %s\r\n", - data->state.referer); + if(Curl_bufref_ptr(&data->state.referer) && + !Curl_checkheaders(data, STRCONST("Referer"))) + data->state.aptr.ref = + curl_maprintf("Referer: %s\r\n", Curl_bufref_ptr(&data->state.referer)); p_referrer = data->state.aptr.ref; diff --git a/lib/setopt.c b/lib/setopt.c index bcaf3fc2ae28..476506dad4dc 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1754,12 +1754,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* * String to set in the HTTP Referer: field. */ - if(data->state.referer_alloc) { - Curl_safefree(data->state.referer); - data->state.referer_alloc = FALSE; - } result = Curl_setstropt(&s->str[STRING_SET_REFERER], ptr); - data->state.referer = s->str[STRING_SET_REFERER]; + Curl_bufref_set(&data->state.referer, s->str[STRING_SET_REFERER], 0, NULL); break; case CURLOPT_USERAGENT: diff --git a/lib/url.c b/lib/url.c index 65161d7e2488..64ad16a1ae81 100644 --- a/lib/url.c +++ b/lib/url.c @@ -180,11 +180,7 @@ void Curl_freeset(struct Curl_easy *data) Curl_safefree(data->set.blobs[j]); } - if(data->state.referer_alloc) { - Curl_safefree(data->state.referer); - data->state.referer_alloc = FALSE; - } - data->state.referer = NULL; + Curl_bufref_free(&data->state.referer); Curl_bufref_free(&data->state.url); Curl_mime_cleanpart(&data->set.mimepost); @@ -271,11 +267,7 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_safefree(data->state.first_host); Curl_ssl_free_certinfo(data); - if(data->state.referer_alloc) { - Curl_safefree(data->state.referer); - data->state.referer_alloc = FALSE; - } - data->state.referer = NULL; + Curl_bufref_free(&data->state.referer); up_free(data); curlx_dyn_free(&data->state.headerb); @@ -514,6 +506,7 @@ CURLcode Curl_open(struct Curl_easy **curl) Curl_hash_str, curlx_str_key_compare, easy_meta_freeentry); curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER); Curl_bufref_init(&data->state.url); + Curl_bufref_init(&data->state.referer); Curl_req_init(&data->req); Curl_initinfo(data); #ifndef CURL_DISABLE_HTTP diff --git a/lib/urldata.h b/lib/urldata.h index 554e002020ad..76aefec01ec7 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1027,7 +1027,7 @@ struct UrlState { CURLU *uh; /* URL handle for the current parsed URL */ struct urlpieces up; struct bufref url; /* work URL, initially copied from UserDefined */ - char *referer; /* referer string */ + struct bufref referer; /* referer string */ struct curl_slist *resolve; /* set to point to the set.resolve list when this should be dealt with in pretransfer */ #ifndef CURL_DISABLE_HTTP @@ -1123,7 +1123,6 @@ struct UrlState { #ifdef CURL_LIST_ONLY_PROTOCOL BIT(list_only); /* list directory contents */ #endif - BIT(referer_alloc); /* referer string is malloc()ed */ BIT(wildcard_resolve); /* Set to true if any resolve change is a wildcard */ BIT(upload); /* upload request */ BIT(internal); /* internal: true if this easy handle was created for From fe7703a0b398458eea2023ae802320eb1c5e401e Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 3 Dec 2025 21:52:33 +0100 Subject: [PATCH 652/885] formdata: use struct bufref for maybe-dynamic fields. Lengths are not stored in the structures, as they may be given before the data locations. Closes #19827 --- lib/formdata.c | 312 +++++++++++++++++++++---------------------------- lib/formdata.h | 24 ++-- 2 files changed, 141 insertions(+), 195 deletions(-) diff --git a/lib/formdata.c b/lib/formdata.c index e51bf14b6323..880f804dc6c9 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -37,6 +37,7 @@ struct Curl_easy; #include "sendf.h" #include "strdup.h" #include "rand.h" +#include "bufref.h" #include "curlx/fopen.h" #include "curlx/warnless.h" @@ -66,23 +67,23 @@ static struct curl_httppost *AddHttpPost(struct FormInfo *src, { struct curl_httppost *post; size_t namelength = src->namelength; - if(!namelength && src->name) - namelength = strlen(src->name); + if(!namelength && Curl_bufref_ptr(&src->name)) + namelength = strlen(Curl_bufref_ptr(&src->name)); if((src->bufferlength > LONG_MAX) || (namelength > LONG_MAX)) /* avoid overflow in typecasts below */ return NULL; post = curlx_calloc(1, sizeof(struct curl_httppost)); if(post) { - post->name = src->name; + post->name = CURL_UNCONST(Curl_bufref_ptr(&src->name)); post->namelength = (long)namelength; - post->contents = src->value; + post->contents = CURL_UNCONST(Curl_bufref_ptr(&src->value)); post->contentlen = src->contentslength; post->buffer = src->buffer; post->bufferlength = (long)src->bufferlength; - post->contenttype = src->contenttype; + post->contenttype = CURL_UNCONST(Curl_bufref_ptr(&src->contenttype)); post->flags = src->flags | CURL_HTTPPOST_LARGE; post->contentheader = src->contentheader; - post->showfilename = src->showfilename; + post->showfilename = CURL_UNCONST(Curl_bufref_ptr(&src->showfilename)); post->userp = src->userp; } else @@ -107,60 +108,63 @@ static struct curl_httppost *AddHttpPost(struct FormInfo *src, return post; } +/* Allocate and initialize a new FormInfo structure. */ +static struct FormInfo *NewFormInfo(void) +{ + struct FormInfo *form_info = curlx_calloc(1, sizeof(struct FormInfo)); + + if(form_info) { + Curl_bufref_init(&form_info->name); + Curl_bufref_init(&form_info->value); + Curl_bufref_init(&form_info->contenttype); + Curl_bufref_init(&form_info->showfilename); + } + + return form_info; +} + +/* Replace the target field data by a dynamic copy of it. */ +static CURLcode FormInfoCopyField(struct bufref *field, size_t len) +{ + const char *value = Curl_bufref_ptr(field); + CURLcode result = CURLE_OK; + + if(value) { + if(!len) + len = strlen(value); + result = Curl_bufref_memdup(field, value, len); + } + + return result; +} + /*************************************************************************** * * AddFormInfo() * - * Adds a FormInfo structure to the list presented by parent_form_info. - * - * Returns newly allocated FormInfo on success and NULL if malloc failed/ - * parent_form_info is NULL. + * Adds a FormInfo structure to the list presented by parent. * ***************************************************************************/ -static struct FormInfo *AddFormInfo(char *value, - char *contenttype, - struct FormInfo *parent_form_info) +static void AddFormInfo(struct FormInfo *form_info, struct FormInfo *parent) { - struct FormInfo *form_info; - form_info = curlx_calloc(1, sizeof(struct FormInfo)); - if(!form_info) - return NULL; - if(value) - form_info->value = value; - if(contenttype) - form_info->contenttype = contenttype; - form_info->flags = HTTPPOST_FILENAME; + form_info->flags |= HTTPPOST_FILENAME; - if(parent_form_info) { + if(parent) { /* now, point our 'more' to the original 'more' */ - form_info->more = parent_form_info->more; + form_info->more = parent->more; /* then move the original 'more' to point to ourselves */ - parent_form_info->more = form_info; + parent->more = form_info; } - - return form_info; } static void free_formlist(struct FormInfo *ptr) { for(; ptr != NULL; ptr = ptr->more) { - if(ptr->name_alloc) { - Curl_safefree(ptr->name); - ptr->name_alloc = FALSE; - } - if(ptr->value_alloc) { - Curl_safefree(ptr->value); - ptr->value_alloc = FALSE; - } - if(ptr->contenttype_alloc) { - Curl_safefree(ptr->contenttype); - ptr->contenttype_alloc = FALSE; - } - if(ptr->showfilename_alloc) { - Curl_safefree(ptr->showfilename); - ptr->showfilename_alloc = FALSE; - } + Curl_bufref_free(&ptr->name); + Curl_bufref_free(&ptr->value); + Curl_bufref_free(&ptr->contenttype); + Curl_bufref_free(&ptr->showfilename); } } @@ -227,7 +231,9 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, * alright add the HttpPost item otherwise set retval accordingly */ for(form = first_form; form != NULL; form = form->more) { - if(((!form->name || !form->value) && !post) || + const char *name = Curl_bufref_ptr(&form->name); + + if(((!name || !Curl_bufref_ptr(&form->value)) && !post) || (form->contentslength && (form->flags & HTTPPOST_FILENAME)) || ((form->flags & HTTPPOST_FILENAME) && @@ -244,62 +250,42 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, } if(((form->flags & HTTPPOST_FILENAME) || (form->flags & HTTPPOST_BUFFER)) && - !form->contenttype) { - char *f = (form->flags & HTTPPOST_BUFFER) ? - form->showfilename : form->value; - char const *type; - type = Curl_mime_contenttype(f); + !Curl_bufref_ptr(&form->contenttype)) { + const char *f = Curl_bufref_ptr((form->flags & HTTPPOST_BUFFER) ? + &form->showfilename : &form->value); + const char *type = Curl_mime_contenttype(f); if(!type) type = prevtype; if(!type) type = FILE_CONTENTTYPE_DEFAULT; /* our contenttype is missing */ - form->contenttype = curlx_strdup(type); - if(!form->contenttype) + if(Curl_bufref_memdup(&form->contenttype, type, strlen(type))) return CURL_FORMADD_MEMORY; - - form->contenttype_alloc = TRUE; } - if(form->name && form->namelength) { - if(memchr(form->name, 0, form->namelength)) + if(name && form->namelength) { + if(memchr(name, 0, form->namelength)) return CURL_FORMADD_NULL; } - if(!(form->flags & HTTPPOST_PTRNAME) && form->name) { + if(!(form->flags & HTTPPOST_PTRNAME)) { /* Note that there is small risk that form->name is NULL here if the app passed in a bad combo, so we check for that. */ - - /* copy name (without strdup; possibly not null-terminated) */ - char *dupname = Curl_memdup0(form->name, form->namelength ? - form->namelength : strlen(form->name)); - if(!dupname) + if(FormInfoCopyField(&form->name, form->namelength)) return CURL_FORMADD_MEMORY; - - form->name = dupname; - form->name_alloc = TRUE; } if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE | HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | - HTTPPOST_CALLBACK)) && form->value) { - /* copy value (without strdup; possibly contains null characters) */ - size_t clen = (size_t)form->contentslength; - if(!clen) - clen = strlen(form->value) + 1; - - form->value = Curl_memdup(form->value, clen); - - if(!form->value) + HTTPPOST_CALLBACK))) { + if(FormInfoCopyField(&form->value, (size_t) form->contentslength)) return CURL_FORMADD_MEMORY; - - form->value_alloc = TRUE; } post = AddHttpPost(form, post, httppost, last_post); if(!post) return CURL_FORMADD_MEMORY; - if(form->contenttype) - prevtype = form->contenttype; + if(Curl_bufref_ptr(&form->contenttype)) + prevtype = Curl_bufref_ptr(&form->contenttype); } return CURL_FORMADD_OK; @@ -329,15 +315,17 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, struct curl_httppost *newchain = NULL; struct curl_httppost *lastnode = NULL; - /* This is a state variable, that if TRUE means that we are parsing an - array that we got passed to us. If FALSE we are parsing the input - va_list arguments. */ - bool array_state = FALSE; +#define form_ptr_arg(t) (forms ? (t) (void *) avalue : va_arg(params, t)) +#ifdef HAVE_STDINT_H +#define form_int_arg(t) (forms ? (t) (uintptr_t) avalue : va_arg(params, t)) +#else +#define form_int_arg(t) (forms ? (t) (void *) avalue : va_arg(params, t)) +#endif /* * We need to allocate the first struct to fill in. */ - first_form = curlx_calloc(1, sizeof(struct FormInfo)); + first_form = NewFormInfo(); if(!first_form) return CURL_FORMADD_MEMORY; @@ -349,7 +337,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, while(retval == CURL_FORMADD_OK) { /* first see if we have more parts of the array param */ - if(array_state && forms) { + if(forms) { /* get the upcoming option from the given array */ option = forms->option; avalue = (char *)CURL_UNCONST(forms->value); @@ -357,7 +345,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, forms++; /* advance this to next entry */ if(CURLFORM_END == option) { /* end of array state */ - array_state = FALSE; + forms = NULL; continue; } } @@ -372,14 +360,12 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, switch(option) { case CURLFORM_ARRAY: - if(array_state) + if(forms) /* we do not support an array from within an array */ retval = CURL_FORMADD_ILLEGAL_ARRAY; else { forms = va_arg(params, struct curl_forms *); - if(forms) - array_state = TRUE; - else + if(!forms) retval = CURL_FORMADD_NULL; } break; @@ -388,17 +374,15 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, * Set the Name property. */ case CURLFORM_PTRNAME: - curr->flags |= HTTPPOST_PTRNAME; /* fall through */ - + curr->flags |= HTTPPOST_PTRNAME; FALLTHROUGH(); case CURLFORM_COPYNAME: - if(curr->name) + if(Curl_bufref_ptr(&curr->name)) retval = CURL_FORMADD_OPTION_TWICE; else { - if(!array_state) - avalue = va_arg(params, char *); + avalue = form_ptr_arg(char *); if(avalue) - curr->name = avalue; /* store for the moment */ + Curl_bufref_set(&curr->name, avalue, 0, NULL); /* No copy yet. */ else retval = CURL_FORMADD_NULL; } @@ -407,8 +391,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->namelength) retval = CURL_FORMADD_OPTION_TWICE; else - curr->namelength = - array_state ? (size_t)avalue : (size_t)va_arg(params, long); + curr->namelength = (size_t) form_int_arg(long); break; /* @@ -418,26 +401,23 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, curr->flags |= HTTPPOST_PTRCONTENTS; FALLTHROUGH(); case CURLFORM_COPYCONTENTS: - if(curr->value) + if(Curl_bufref_ptr(&curr->value)) retval = CURL_FORMADD_OPTION_TWICE; else { - if(!array_state) - avalue = va_arg(params, char *); + avalue = form_ptr_arg(char *); if(avalue) - curr->value = avalue; /* store for the moment */ + Curl_bufref_set(&curr->value, avalue, 0, NULL); /* No copy yet. */ else retval = CURL_FORMADD_NULL; } break; case CURLFORM_CONTENTSLENGTH: - curr->contentslength = - array_state ? (size_t)avalue : (size_t)va_arg(params, long); + curr->contentslength = (curl_off_t)(size_t) form_int_arg(long); break; case CURLFORM_CONTENTLEN: curr->flags |= CURL_HTTPPOST_LARGE; - curr->contentslength = - array_state ? (curl_off_t)(size_t)avalue : va_arg(params, curl_off_t); + curr->contentslength = form_int_arg(curl_off_t); break; /* Get contents from a given filename */ @@ -445,16 +425,12 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->flags & (HTTPPOST_PTRCONTENTS | HTTPPOST_READFILE)) retval = CURL_FORMADD_OPTION_TWICE; else { - if(!array_state) - avalue = va_arg(params, char *); + avalue = form_ptr_arg(char *); if(avalue) { - curr->value = curlx_strdup(avalue); - if(!curr->value) + if(Curl_bufref_memdup(&curr->value, avalue, strlen(avalue))) retval = CURL_FORMADD_MEMORY; - else { + else curr->flags |= HTTPPOST_READFILE; - curr->value_alloc = TRUE; - } } else retval = CURL_FORMADD_NULL; @@ -463,26 +439,20 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, /* We upload a file */ case CURLFORM_FILE: - if(!array_state) - avalue = va_arg(params, char *); - - if(curr->value) { + avalue = form_ptr_arg(char *); + if(Curl_bufref_ptr(&curr->value)) { if(curr->flags & HTTPPOST_FILENAME) { if(avalue) { - char *fname = curlx_strdup(avalue); - if(!fname) + form = NewFormInfo(); + if(!form || + Curl_bufref_memdup(&form->value, avalue, strlen(avalue))) { + curlx_free(form); retval = CURL_FORMADD_MEMORY; + } else { - form = AddFormInfo(fname, NULL, curr); - if(!form) { - curlx_free(fname); - retval = CURL_FORMADD_MEMORY; - } - else { - form->value_alloc = TRUE; - curr = form; - form = NULL; - } + AddFormInfo(form, curr); + curr = form; + form = NULL; } } else @@ -493,13 +463,10 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, } else { if(avalue) { - curr->value = curlx_strdup(avalue); - if(!curr->value) + if(Curl_bufref_memdup(&curr->value, avalue, strlen(avalue))) retval = CURL_FORMADD_MEMORY; - else { + else curr->flags |= HTTPPOST_FILENAME; - curr->value_alloc = TRUE; - } } else retval = CURL_FORMADD_NULL; @@ -511,12 +478,11 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->buffer) retval = CURL_FORMADD_OPTION_TWICE; else { - if(!array_state) - avalue = va_arg(params, char *); + avalue = form_ptr_arg(char *); if(avalue) { curr->buffer = avalue; /* store for the moment */ - curr->value = avalue; /* make it non-NULL to be accepted - as fine */ + /* Make value non-NULL to be accepted as fine */ + Curl_bufref_set(&curr->value, avalue, 0, NULL); } else retval = CURL_FORMADD_NULL; @@ -527,8 +493,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->bufferlength) retval = CURL_FORMADD_OPTION_TWICE; else - curr->bufferlength = - array_state ? (size_t)avalue : (size_t)va_arg(params, long); + curr->bufferlength = (size_t) form_int_arg(long); break; case CURLFORM_STREAM: @@ -536,14 +501,13 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->userp) retval = CURL_FORMADD_OPTION_TWICE; else { - if(!array_state) - avalue = va_arg(params, char *); + avalue = form_ptr_arg(char *); if(avalue) { curr->userp = avalue; - curr->value = avalue; /* this is not strictly true but we derive a - value from this later on and we need this - non-NULL to be accepted as a fine form - part */ + /* The following line is not strictly true but we derive a value + from this later on and we need this non-NULL to be accepted as + a fine form part */ + Curl_bufref_set(&curr->value, avalue, 0, NULL); } else retval = CURL_FORMADD_NULL; @@ -551,25 +515,20 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, break; case CURLFORM_CONTENTTYPE: - if(!array_state) - avalue = va_arg(params, char *); - if(curr->contenttype) { + avalue = form_ptr_arg(char *); + if(Curl_bufref_ptr(&curr->contenttype)) { if(curr->flags & HTTPPOST_FILENAME) { if(avalue) { - char *type = curlx_strdup(avalue); - if(!type) + form = NewFormInfo(); + if(!form || Curl_bufref_memdup(&form->contenttype, avalue, + strlen(avalue))) { + curlx_free(form); retval = CURL_FORMADD_MEMORY; + } else { - form = AddFormInfo(NULL, type, curr); - if(!form) { - curlx_free(type); - retval = CURL_FORMADD_MEMORY; - } - else { - form->contenttype_alloc = TRUE; - curr = form; - form = NULL; - } + AddFormInfo(form, curr); + curr = form; + form = NULL; } } else @@ -578,25 +537,18 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, else retval = CURL_FORMADD_OPTION_TWICE; } - else { - if(avalue) { - curr->contenttype = curlx_strdup(avalue); - if(!curr->contenttype) - retval = CURL_FORMADD_MEMORY; - else - curr->contenttype_alloc = TRUE; - } - else - retval = CURL_FORMADD_NULL; + else if(avalue) { + if(Curl_bufref_memdup(&curr->contenttype, avalue, strlen(avalue))) + retval = CURL_FORMADD_MEMORY; } + else + retval = CURL_FORMADD_NULL; break; case CURLFORM_CONTENTHEADER: { /* this "cast increases required alignment of target type" but we consider it OK anyway */ - struct curl_slist *list = array_state ? - (struct curl_slist *)(void *)avalue : - va_arg(params, struct curl_slist *); + struct curl_slist *list = form_ptr_arg(struct curl_slist *); if(curr->contentheader) retval = CURL_FORMADD_OPTION_TWICE; @@ -607,17 +559,11 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, } case CURLFORM_FILENAME: case CURLFORM_BUFFER: - if(!array_state) - avalue = va_arg(params, char *); - if(curr->showfilename) + avalue = form_ptr_arg(char *); + if(Curl_bufref_ptr(&curr->showfilename)) retval = CURL_FORMADD_OPTION_TWICE; - else { - curr->showfilename = curlx_strdup(avalue); - if(!curr->showfilename) - retval = CURL_FORMADD_MEMORY; - else - curr->showfilename_alloc = TRUE; - } + else if(Curl_bufref_memdup(&curr->showfilename, avalue, strlen(avalue))) + retval = CURL_FORMADD_MEMORY; break; default: @@ -656,6 +602,8 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, free_chain(newchain); return retval; +#undef form_ptr_arg +#undef form_int_arg } /* diff --git a/lib/formdata.h b/lib/formdata.h index e80b83bbf491..4ece7d06e71e 100644 --- a/lib/formdata.h +++ b/lib/formdata.h @@ -28,25 +28,23 @@ #ifndef CURL_DISABLE_FORM_API +#include "bufref.h" + /* used by FormAdd for temporary storage */ struct FormInfo { - char *name; - size_t namelength; - char *value; - curl_off_t contentslength; - char *contenttype; + struct bufref name; + struct bufref value; + struct bufref contenttype; + struct bufref showfilename; /* The filename to show. If not set, the actual + filename will be used */ char *buffer; /* pointer to existing buffer used for file upload */ - size_t bufferlength; - char *showfilename; /* The filename to show. If not set, the actual - filename will be used */ char *userp; /* pointer for the read callback */ - struct curl_slist *contentheader; struct FormInfo *more; + struct curl_slist *contentheader; + curl_off_t contentslength; + size_t namelength; + size_t bufferlength; unsigned char flags; - BIT(name_alloc); - BIT(value_alloc); - BIT(contenttype_alloc); - BIT(showfilename_alloc); }; CURLcode Curl_getformdata(CURL *data, From 1def38003299bf0fbbaf8b5ed34422205166d085 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 16:20:25 +0100 Subject: [PATCH 653/885] bufref: rename *memdup() to *memdup0() To make it clearer to readers of the code that the resulting dup also has a null terminator. Something a "normal" memdup() does not provide. Closes #19833 --- docs/internals/BUFREF.md | 5 +++-- lib/bufref.c | 2 +- lib/bufref.h | 2 +- lib/formdata.c | 16 ++++++++-------- lib/vauth/krb5_gssapi.c | 4 ++-- lib/vauth/krb5_sspi.c | 2 +- lib/vauth/ntlm.c | 2 +- lib/vauth/ntlm_sspi.c | 2 +- tests/unit/unit1661.c | 4 ++-- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/internals/BUFREF.md b/docs/internals/BUFREF.md index 686a092aecc3..cd101f08a9a3 100644 --- a/docs/internals/BUFREF.md +++ b/docs/internals/BUFREF.md @@ -54,10 +54,11 @@ specified as `NULL`: this is the case when the referenced buffer is static. if `buffer` is NULL, `length` must be zero. -## `memdup` +## `memdup0` ```c -CURLcode Curl_bufref_memdup(struct bufref *br, const void *data, size_t length); +CURLcode Curl_bufref_memdup0(struct bufref *br, const void *data, + size_t length); ``` Releases the previously referenced buffer, then duplicates the `length`-byte diff --git a/lib/bufref.c b/lib/bufref.c index 8dcd3592dbe4..8f52d48d20a5 100644 --- a/lib/bufref.c +++ b/lib/bufref.c @@ -117,7 +117,7 @@ size_t Curl_bufref_len(const struct bufref *br) return br->len; } -CURLcode Curl_bufref_memdup(struct bufref *br, const void *ptr, size_t len) +CURLcode Curl_bufref_memdup0(struct bufref *br, const void *ptr, size_t len) { unsigned char *cpy = NULL; diff --git a/lib/bufref.h b/lib/bufref.h index b8ffe383478b..abf1d617df5a 100644 --- a/lib/bufref.h +++ b/lib/bufref.h @@ -42,7 +42,7 @@ void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len, const char *Curl_bufref_ptr(const struct bufref *br); const unsigned char *Curl_bufref_uptr(const struct bufref *br); size_t Curl_bufref_len(const struct bufref *br); -CURLcode Curl_bufref_memdup(struct bufref *br, const void *ptr, size_t len); +CURLcode Curl_bufref_memdup0(struct bufref *br, const void *ptr, size_t len); void Curl_bufref_free(struct bufref *br); #endif diff --git a/lib/formdata.c b/lib/formdata.c index 880f804dc6c9..d5f6776a3d5f 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -132,7 +132,7 @@ static CURLcode FormInfoCopyField(struct bufref *field, size_t len) if(value) { if(!len) len = strlen(value); - result = Curl_bufref_memdup(field, value, len); + result = Curl_bufref_memdup0(field, value, len); } return result; @@ -260,7 +260,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, type = FILE_CONTENTTYPE_DEFAULT; /* our contenttype is missing */ - if(Curl_bufref_memdup(&form->contenttype, type, strlen(type))) + if(Curl_bufref_memdup0(&form->contenttype, type, strlen(type))) return CURL_FORMADD_MEMORY; } if(name && form->namelength) { @@ -427,7 +427,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, else { avalue = form_ptr_arg(char *); if(avalue) { - if(Curl_bufref_memdup(&curr->value, avalue, strlen(avalue))) + if(Curl_bufref_memdup0(&curr->value, avalue, strlen(avalue))) retval = CURL_FORMADD_MEMORY; else curr->flags |= HTTPPOST_READFILE; @@ -445,7 +445,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(avalue) { form = NewFormInfo(); if(!form || - Curl_bufref_memdup(&form->value, avalue, strlen(avalue))) { + Curl_bufref_memdup0(&form->value, avalue, strlen(avalue))) { curlx_free(form); retval = CURL_FORMADD_MEMORY; } @@ -463,7 +463,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, } else { if(avalue) { - if(Curl_bufref_memdup(&curr->value, avalue, strlen(avalue))) + if(Curl_bufref_memdup0(&curr->value, avalue, strlen(avalue))) retval = CURL_FORMADD_MEMORY; else curr->flags |= HTTPPOST_FILENAME; @@ -520,7 +520,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->flags & HTTPPOST_FILENAME) { if(avalue) { form = NewFormInfo(); - if(!form || Curl_bufref_memdup(&form->contenttype, avalue, + if(!form || Curl_bufref_memdup0(&form->contenttype, avalue, strlen(avalue))) { curlx_free(form); retval = CURL_FORMADD_MEMORY; @@ -538,7 +538,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, retval = CURL_FORMADD_OPTION_TWICE; } else if(avalue) { - if(Curl_bufref_memdup(&curr->contenttype, avalue, strlen(avalue))) + if(Curl_bufref_memdup0(&curr->contenttype, avalue, strlen(avalue))) retval = CURL_FORMADD_MEMORY; } else @@ -562,7 +562,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, avalue = form_ptr_arg(char *); if(Curl_bufref_ptr(&curr->showfilename)) retval = CURL_FORMADD_OPTION_TWICE; - else if(Curl_bufref_memdup(&curr->showfilename, avalue, strlen(avalue))) + else if(Curl_bufref_memdup0(&curr->showfilename, avalue, strlen(avalue))) retval = CURL_FORMADD_MEMORY; break; diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 7ba21a394184..0c069c70d690 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -154,7 +154,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, } if(output_token.value && output_token.length) { - result = Curl_bufref_memdup(out, output_token.value, output_token.length); + result = Curl_bufref_memdup0(out, output_token.value, output_token.length); gss_release_buffer(&unused_status, &output_token); } else @@ -285,7 +285,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, } /* Return the response. */ - result = Curl_bufref_memdup(out, output_token.value, output_token.length); + result = Curl_bufref_memdup0(out, output_token.value, output_token.length); /* Free the output buffer */ gss_release_buffer(&unused_status, &output_token); diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index 21636d59ee3d..32fa44cfcbb9 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -212,7 +212,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, } if(resp_buf.cbBuffer) { - result = Curl_bufref_memdup(out, resp_buf.pvBuffer, resp_buf.cbBuffer); + result = Curl_bufref_memdup0(out, resp_buf.pvBuffer, resp_buf.cbBuffer); } else if(mutual_auth) Curl_bufref_set(out, "", 0, NULL); diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 7fd13d8745c1..70d080f5a4ac 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -831,7 +831,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, size += hostlen; /* Return the binary blob. */ - result = Curl_bufref_memdup(out, ntlmbuf, size); + result = Curl_bufref_memdup0(out, ntlmbuf, size); error: curlx_free(ntlmv2resp); /* Free the dynamic buffer allocated for NTLMv2 */ diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index e4aad6e24f8d..dae7248f73fb 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -316,7 +316,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, } /* Return the response. */ - result = Curl_bufref_memdup(out, ntlm->output_token, type_3_buf.cbBuffer); + result = Curl_bufref_memdup0(out, ntlm->output_token, type_3_buf.cbBuffer); Curl_auth_cleanup_ntlm(ntlm); return result; } diff --git a/tests/unit/unit1661.c b/tests/unit/unit1661.c index 569b06760b2b..7f8d1aa76a37 100644 --- a/tests/unit/unit1661.c +++ b/tests/unit/unit1661.c @@ -87,9 +87,9 @@ static CURLcode test_unit1661(const char *arg) fail_unless(Curl_bufref_len(&bufref) == 13, "Wrong data size returned"); /** - * testing Curl_bufref_memdup + * testing Curl_bufref_memdup0 */ - res = Curl_bufref_memdup(&bufref, "1661", 3); + res = Curl_bufref_memdup0(&bufref, "1661", 3); abort_unless(res == CURLE_OK, curl_easy_strerror(res)); fail_unless(freecount == 1, "Destructor not called"); fail_unless((const char *)bufref.ptr != buffer, "Returned pointer not set"); From d7928029fc0a31df03473d5ca9e13b732357febc Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 4 Dec 2025 17:15:33 +0100 Subject: [PATCH 654/885] connection: attached transfer count Since we no longer traverse the transfers attached to a connection, change the sparse bitset to just a `uint32_t` counter. This makes multi_ev the single user of sparse bitsets for transfers using a socket and allocation failures are handled there correctly. Refs #19818 Closes #19836 --- lib/conncache.c | 4 ++-- lib/http2.c | 2 +- lib/multi.c | 18 +++++++++++------- lib/uint-spbset.c | 14 -------------- lib/uint-spbset.h | 3 --- lib/url.c | 15 ++++++--------- lib/urldata.h | 7 ++++--- lib/vquic/curl_ngtcp2.c | 4 ++-- lib/vquic/curl_osslq.c | 2 +- lib/vquic/curl_quiche.c | 4 ++-- 10 files changed, 29 insertions(+), 44 deletions(-) diff --git a/lib/conncache.c b/lib/conncache.c index c50697f177b6..18b760afe052 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -620,7 +620,7 @@ static void cpool_discard_conn(struct cpool *cpool, if(CONN_INUSE(conn) && !aborted) { CURL_TRC_M(data, "[CPOOL] not discarding #%" FMT_OFF_T " still in use by %u transfers", conn->connection_id, - CONN_ATTACHED(conn)); + conn->attached_xfers); return; } @@ -664,7 +664,7 @@ void Curl_conn_terminate(struct Curl_easy *data, * are other users of it */ if(CONN_INUSE(conn) && !aborted) { DEBUGASSERT(0); /* does this ever happen? */ - DEBUGF(infof(data, "Curl_disconnect when inuse: %u", CONN_ATTACHED(conn))); + DEBUGF(infof(data, "conn terminate when inuse: %u", conn->attached_xfers)); return; } diff --git a/lib/http2.c b/lib/http2.c index df38f82cafa0..deed6ece7ee1 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2786,7 +2786,7 @@ static CURLcode cf_h2_query(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); if(!ctx->h2 || !nghttp2_session_check_request_allowed(ctx->h2)) { /* the limit is what we have in use right now */ - effective_max = CONN_ATTACHED(cf->conn); + effective_max = cf->conn->attached_xfers; } else { effective_max = ctx->max_concurrent_streams; diff --git a/lib/multi.c b/lib/multi.c index 3086d61c7489..f87ee012d86b 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -607,12 +607,11 @@ static void multi_done_locked(struct connectdata *conn, Curl_detach_connection(data); - CURL_TRC_M(data, "multi_done_locked, in use=%u", - Curl_uint32_spbset_count(&conn->xfers_attached)); + CURL_TRC_M(data, "multi_done_locked, in use=%u", conn->attached_xfers); if(CONN_INUSE(conn)) { /* Stop if still used. */ CURL_TRC_M(data, "Connection still in use %u, no more multi_done now!", - Curl_uint32_spbset_count(&conn->xfers_attached)); + conn->attached_xfers); return; } @@ -906,9 +905,13 @@ void Curl_detach_connection(struct Curl_easy *data) { struct connectdata *conn = data->conn; if(conn) { - Curl_uint32_spbset_remove(&conn->xfers_attached, data->mid); - if(Curl_uint32_spbset_empty(&conn->xfers_attached)) - conn->attached_multi = NULL; + /* this should never happen, prevent underflow */ + DEBUGASSERT(conn->attached_xfers); + if(conn->attached_xfers) { + conn->attached_xfers--; + if(!conn->attached_xfers) + conn->attached_multi = NULL; + } } data->conn = NULL; } @@ -924,8 +927,9 @@ void Curl_attach_connection(struct Curl_easy *data, DEBUGASSERT(data); DEBUGASSERT(!data->conn); DEBUGASSERT(conn); + DEBUGASSERT(conn->attached_xfers < UINT32_MAX); data->conn = conn; - Curl_uint32_spbset_add(&conn->xfers_attached, data->mid); + conn->attached_xfers++; /* all attached transfers must be from the same multi */ if(!conn->attached_multi) conn->attached_multi = data->multi; diff --git a/lib/uint-spbset.c b/lib/uint-spbset.c index 84a893e85f5a..e27f66fc7b15 100644 --- a/lib/uint-spbset.c +++ b/lib/uint-spbset.c @@ -61,20 +61,6 @@ uint32_t Curl_uint32_spbset_count(struct uint32_spbset *bset) return n; } -bool Curl_uint32_spbset_empty(struct uint32_spbset *bset) -{ - struct uint32_spbset_chunk *chunk; - uint32_t i; - - for(chunk = &bset->head; chunk; chunk = chunk->next) { - for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) { - if(chunk->slots[i]) - return FALSE; - } - } - return TRUE; -} - UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset) { struct uint32_spbset_chunk *next, *chunk; diff --git a/lib/uint-spbset.h b/lib/uint-spbset.h index 8c46ce4aa8ea..0220d0544378 100644 --- a/lib/uint-spbset.h +++ b/lib/uint-spbset.h @@ -61,9 +61,6 @@ void Curl_uint32_spbset_destroy(struct uint32_spbset *bset); /* Get the cardinality of the bitset, e.g. numbers present in the set. */ uint32_t Curl_uint32_spbset_count(struct uint32_spbset *bset); -/* TRUE of bitset is empty */ -bool Curl_uint32_spbset_empty(struct uint32_spbset *bset); - /* Add the number `i` to the bitset. * Numbers can be added more than once, without making a difference. * Returns FALSE if allocations failed. */ diff --git a/lib/url.c b/lib/url.c index 64ad16a1ae81..194810553e18 100644 --- a/lib/url.c +++ b/lib/url.c @@ -561,7 +561,6 @@ void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn) Curl_safefree(conn->unix_domain_socket); #endif Curl_safefree(conn->destination); - Curl_uint32_spbset_destroy(&conn->xfers_attached); Curl_hash_destroy(&conn->meta_hash); curlx_free(conn); /* free all the connection oriented data */ @@ -893,16 +892,16 @@ static bool url_match_multiplex_limits(struct connectdata *conn, if(CONN_INUSE(conn) && m->may_multiplex) { DEBUGASSERT(conn->bits.multiplex); /* If multiplexed, make sure we do not go over concurrency limit */ - if(CONN_ATTACHED(conn) >= + if(conn->attached_xfers >= Curl_multi_max_concurrent_streams(m->data->multi)) { infof(m->data, "client side MAX_CONCURRENT_STREAMS reached" - ", skip (%u)", CONN_ATTACHED(conn)); + ", skip (%u)", conn->attached_xfers); return FALSE; } - if(CONN_ATTACHED(conn) >= + if(conn->attached_xfers >= Curl_conn_get_max_concurrent(m->data, conn, FIRSTSOCKET)) { infof(m->data, "MAX_CONCURRENT_STREAMS reached, skip (%u)", - CONN_ATTACHED(conn)); + conn->attached_xfers); return FALSE; } /* When not multiplexed, we have a match here! */ @@ -1343,6 +1342,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->recv_idx = 0; /* default for receiving transfer data */ conn->send_idx = 0; /* default for sending transfer data */ conn->connection_id = -1; /* no ID */ + conn->attached_xfers = 0; conn->remote_port = -1; /* unknown at this point */ /* Store creation time to help future close decision making */ @@ -1382,9 +1382,6 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->connect_only = data->set.connect_only; conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */ - /* Initialize the attached xfers bitset */ - Curl_uint32_spbset_init(&conn->xfers_attached); - /* Store the local bind parameters that will be used for this connection */ if(data->set.str[STRING_DEVICE]) { conn->localdev = curlx_strdup(data->set.str[STRING_DEVICE]); @@ -3806,7 +3803,7 @@ CURLcode Curl_connect(struct Curl_easy *data, DEBUGASSERT(conn); Curl_pgrsTime(data, TIMER_POSTQUEUE); if(reused) { - if(CONN_ATTACHED(conn) > 1) + if(conn->attached_xfers > 1) /* multiplexed */ *protocol_done = TRUE; } diff --git a/lib/urldata.h b/lib/urldata.h index 76aefec01ec7..899dfff0f10b 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -618,8 +618,7 @@ struct connectdata { handle is still used by one or more easy handles and can only used by any other easy handle without careful consideration (== only for multiplexing) and it cannot be used by another multi handle! */ -#define CONN_INUSE(c) (!Curl_uint32_spbset_empty(&(c)->xfers_attached)) -#define CONN_ATTACHED(c) Curl_uint32_spbset_count(&(c)->xfers_attached) +#define CONN_INUSE(c) (!!(c)->attached_xfers) /**** Fields set when inited and not modified again */ curl_off_t connection_id; /* Contains a unique number to make it easier to @@ -679,7 +678,6 @@ struct connectdata { was used on this connection. */ struct curltime keepalive; - struct uint32_spbset xfers_attached; /* mids of attached transfers */ /* A connection cache from a SHARE might be used in several multi handles. * We MUST not reuse connections that are running in another multi, * for concurrency reasons. That multi might run in another thread. @@ -721,6 +719,9 @@ struct connectdata { int remote_port; /* the remote port, not the proxy port! */ int conn_to_port; /* the remote port to connect to. valid only if bits.conn_to_port is set */ + + uint32_t attached_xfers; /* # of attached easy handles */ + #ifdef USE_IPV6 unsigned int scope_id; /* Scope id for IPv6 */ #endif diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index cf7b95bf6f94..690ef252a037 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -2718,7 +2718,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf, } else if(ctx->max_bidi_streams) { uint64_t avail_bidi_streams = 0; - uint64_t max_streams = CONN_ATTACHED(cf->conn); + uint64_t max_streams = cf->conn->attached_xfers; if(ctx->max_bidi_streams > ctx->used_bidi_streams) avail_bidi_streams = ctx->max_bidi_streams - ctx->used_bidi_streams; max_streams += avail_bidi_streams; @@ -2728,7 +2728,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf, *pres1 = (int)Curl_multi_max_concurrent_streams(data->multi); CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: " "MAX_CONCURRENT -> %d (%u in use)", - cf->conn->connection_id, *pres1, CONN_ATTACHED(cf->conn)); + cf->conn->connection_id, *pres1, cf->conn->attached_xfers); CF_DATA_RESTORE(cf, save); return CURLE_OK; } diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 79bd1180dcf6..73cea21a15dc 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -2323,7 +2323,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf, return CURLE_HTTP3; } /* we report avail + in_use */ - v += CONN_ATTACHED(cf->conn); + v += cf->conn->attached_xfers; *pres1 = (v > INT_MAX) ? INT_MAX : (int)v; #else *pres1 = 100; diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index a35ffbec65e8..7082d55916b8 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -1493,14 +1493,14 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf, switch(query) { case CF_QUERY_MAX_CONCURRENT: { - uint64_t max_streams = CONN_ATTACHED(cf->conn); + uint64_t max_streams = cf->conn->attached_xfers; if(!ctx->goaway && ctx->qconn) { max_streams += quiche_conn_peer_streams_left_bidi(ctx->qconn); } *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams; CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: " "MAX_CONCURRENT -> %d (%u in use)", - cf->conn->connection_id, *pres1, CONN_ATTACHED(cf->conn)); + cf->conn->connection_id, *pres1, cf->conn->attached_xfers); return CURLE_OK; } case CF_QUERY_CONNECT_REPLY_MS: From d517efe5bd1dbcc6faafe6b0c123521f96d955b0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 16:39:22 +0100 Subject: [PATCH 655/885] bufref: add Curl_bufref_dup that returns a strdup()ed version Cleans up a common pattern somewhat. Implemented as a macro. Closes #19834 --- docs/internals/BUFREF.md | 9 +++++++++ lib/bufref.h | 3 +++ lib/easy.c | 4 ++-- lib/http.c | 8 ++++---- lib/multi.c | 2 +- lib/transfer.c | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/internals/BUFREF.md b/docs/internals/BUFREF.md index cd101f08a9a3..46f7ee6b3e50 100644 --- a/docs/internals/BUFREF.md +++ b/docs/internals/BUFREF.md @@ -93,3 +93,12 @@ size_t Curl_bufref_len(const struct bufref *br); ``` Returns the stored length of the referenced buffer. + +## `dup` + +```c +char *Curl_bufref_dup(const struct bufref *br); +``` + +Returns a strdup() version of the buffer. Note that this assumes that the +bufref is null terminated. diff --git a/lib/bufref.h b/lib/bufref.h index abf1d617df5a..5d331adbdf0f 100644 --- a/lib/bufref.h +++ b/lib/bufref.h @@ -45,4 +45,7 @@ size_t Curl_bufref_len(const struct bufref *br); CURLcode Curl_bufref_memdup0(struct bufref *br, const void *ptr, size_t len); void Curl_bufref_free(struct bufref *br); +/* return a strdup() version of the buffer */ +#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x)) + #endif diff --git a/lib/easy.c b/lib/easy.c index 68ec3000f856..bdda114850ad 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -1019,14 +1019,14 @@ CURL *curl_easy_duphandle(CURL *d) if(Curl_bufref_ptr(&data->state.url)) { Curl_bufref_set(&outcurl->state.url, - curlx_strdup(Curl_bufref_ptr(&data->state.url)), 0, + Curl_bufref_dup(&data->state.url), 0, curl_free); if(!Curl_bufref_ptr(&outcurl->state.url)) goto fail; } if(Curl_bufref_ptr(&data->state.referer)) { Curl_bufref_set(&outcurl->state.referer, - curlx_strdup(Curl_bufref_ptr(&data->state.referer)), 0, + Curl_bufref_dup(&data->state.referer), 0, curl_free); if(!Curl_bufref_ptr(&outcurl->state.referer)) goto fail; diff --git a/lib/http.c b/lib/http.c index afe37da5b660..ba42f19ff0f9 100644 --- a/lib/http.c +++ b/lib/http.c @@ -612,7 +612,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) out in bug #2284386 */ curlx_free(data->req.newurl); /* clone URL */ - data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); + data->req.newurl = Curl_bufref_dup(&data->state.url); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; } @@ -626,7 +626,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) if((data->state.httpreq != HTTPREQ_GET) && (data->state.httpreq != HTTPREQ_HEAD)) { /* clone URL */ - data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); + data->req.newurl = Curl_bufref_dup(&data->state.url); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authhost.done = TRUE; @@ -912,7 +912,7 @@ static CURLcode auth_spnego(struct Curl_easy *data, &conn->http_negotiate_state; if(!result) { curlx_free(data->req.newurl); - data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); + data->req.newurl = Curl_bufref_dup(&data->state.url); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authproblem = FALSE; @@ -4051,7 +4051,7 @@ static CURLcode http_on_response(struct Curl_easy *data, data->state.disableexpect = TRUE; Curl_req_abort_sending(data); DEBUGASSERT(!data->req.newurl); - data->req.newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); + data->req.newurl = Curl_bufref_dup(&data->state.url); if(!data->req.newurl) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/lib/multi.c b/lib/multi.c index f87ee012d86b..531ec6605e46 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2011,7 +2011,7 @@ static CURLMcode state_performing(struct Curl_easy *data, data->state.errorbuf = FALSE; if(!newurl) /* typically for HTTP_1_1_REQUIRED error on first flight */ - newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url)); + newurl = Curl_bufref_dup(&data->state.url); if(!newurl) { result = CURLE_OUT_OF_MEMORY; } diff --git a/lib/transfer.c b/lib/transfer.c index 34f0698ebd75..11e7e6e793c3 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -671,7 +671,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) } infof(data, "Connection died, retrying a fresh connect (retry count: %d)", data->state.retrycount); - *url = curlx_strdup(Curl_bufref_ptr(&data->state.url)); + *url = Curl_bufref_dup(&data->state.url); if(!*url) return CURLE_OUT_OF_MEMORY; From 7a1e99eefa20b2a5dc694ef6078051703521fd1e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Dec 2025 17:44:46 +0100 Subject: [PATCH 656/885] badwords: check FAQ with allowlisted 'will', fix a typo Also: - badwords.pl: add support for filename:word exceptions. - badwords.pl: handle `-w` file open errors. Ref: https://github.com/curl/curl/pull/19817#issuecomment-3612386568 Closes #19837 --- .github/scripts/badwords.ok | 7 +++++++ .github/scripts/badwords.pl | 12 +++++++++--- .github/workflows/checkdocs.yml | 2 +- docs/FAQ | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 .github/scripts/badwords.ok diff --git a/.github/scripts/badwords.ok b/.github/scripts/badwords.ok new file mode 100644 index 000000000000..d5401a822870 --- /dev/null +++ b/.github/scripts/badwords.ok @@ -0,0 +1,7 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl +# +# whitelisted uses of bad words +# file:[line]:rule +docs/FAQ::\bwill\b diff --git a/.github/scripts/badwords.pl b/.github/scripts/badwords.pl index 014468c6f99c..1fde5ec4730f 100755 --- a/.github/scripts/badwords.pl +++ b/.github/scripts/badwords.pl @@ -30,13 +30,13 @@ if($ARGV[0] eq "-w") { shift @ARGV; my $file = shift @ARGV; - open(W, "<$file"); + open(W, "<$file") or die "Cannot open '$file': $!"; while() { if(/^#/) { # allow #-comments next; } - if(/^([^:]*):(\d+):(.*)/) { + if(/^([^:]*):(\d*):(.*)/) { $wl{"$1:$2:$3"}=1; #print STDERR "whitelisted $1:$2:$3\n"; } @@ -93,7 +93,13 @@ sub file { my $ch = "$f:$l:$w"; if($wl{$ch}) { - # whitelisted + # whitelisted filename + line + word + print STDERR "$ch found but whitelisted\n"; + next; + } + $ch = $f . "::" . $w; + if($wl{$ch}) { + # whitelisted filename + word print STDERR "$ch found but whitelisted\n"; next; } diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index 6f67b44fca89..60d42301941e 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -140,7 +140,7 @@ jobs: persist-credentials: false - name: 'badwords' - run: .github/scripts/badwords.pl '**.md' docs/TODO docs/KNOWN_BUGS packages/OS400/README.OS400 < .github/scripts/badwords.txt + run: .github/scripts/badwords.pl -w .github/scripts/badwords.ok '**.md' docs/FAQ docs/KNOWN_BUGS docs/TODO packages/OS400/README.OS400 < .github/scripts/badwords.txt - name: 'verify synopsis' run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md diff --git a/docs/FAQ b/docs/FAQ index 6ba339c7d55c..15cfee848cc6 100644 --- a/docs/FAQ +++ b/docs/FAQ @@ -666,7 +666,7 @@ FAQ does not require this, you do not need a client certificate. A client certificate is always used together with a private key, and the - private key has a pass phrase that protects it. + private key has a passphrase that protects it. SERVER CERTIFICATE From 0476e4fc65a67c5d7e6d0229c4073ce2b8fd9325 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 23:11:52 +0100 Subject: [PATCH 657/885] tidy-up: one more round of formatting nits Closes #19835 --- .github/scripts/typos.toml | 2 +- docs/examples/10-at-a-time.c | 2 +- docs/examples/block_ip.c | 4 +- docs/examples/cacertinmem.c | 2 +- docs/examples/crawler.c | 4 +- docs/examples/ephiperfifo.c | 4 +- docs/examples/evhiperfifo.c | 2 +- docs/examples/externalsocket.c | 10 +- docs/examples/ftp-wildcard.c | 2 +- docs/examples/ftpgetresp.c | 2 +- docs/examples/ftpsget.c | 4 +- docs/examples/ftpupload.c | 8 +- docs/examples/ftpuploadresume.c | 1 - docs/examples/ghiper.c | 8 +- docs/examples/hiperfifo.c | 2 +- docs/examples/hsts-preload.c | 2 +- docs/examples/htmltidy.c | 4 +- docs/examples/htmltitle.cpp | 13 +- docs/examples/http2-download.c | 4 +- docs/examples/http2-serverpush.c | 2 +- docs/examples/http2-upload.c | 4 +- docs/examples/imap-append.c | 8 +- docs/examples/maxconnects.c | 3 +- docs/examples/multi-app.c | 2 +- docs/examples/multi-event.c | 6 +- docs/examples/multi-legacy.c | 10 +- docs/examples/multi-uv.c | 6 +- docs/examples/multithread.c | 2 +- docs/examples/post-callback.c | 7 +- docs/examples/postinmemory.c | 2 +- docs/examples/progressfunc.c | 4 +- docs/examples/protofeats.c | 4 +- docs/examples/sendrecv.c | 2 +- docs/examples/sessioninfo.c | 4 +- docs/examples/smtp-authzid.c | 14 +- docs/examples/smtp-mail.c | 8 +- docs/examples/smtp-mime.c | 9 +- docs/examples/smtp-multi.c | 8 +- docs/examples/smtp-ssl.c | 8 +- docs/examples/smtp-tls.c | 8 +- docs/examples/synctime.c | 37 +- docs/examples/websocket-cb.c | 4 +- docs/examples/websocket-updown.c | 5 +- docs/examples/websocket.c | 15 +- lib/bufref.c | 2 +- lib/cookie.c | 2 +- lib/curl_sha512_256.c | 19 +- lib/formdata.c | 24 +- lib/ftp.c | 7 +- lib/hostip.c | 2 +- lib/http_aws_sigv4.c | 2 +- lib/ldap.c | 10 +- lib/url.c | 4 +- lib/vauth/digest_sspi.c | 10 +- lib/vquic/curl_ngtcp2.c | 11 +- lib/vquic/curl_osslq.c | 11 +- lib/vquic/curl_quiche.c | 6 +- lib/vquic/vquic-tls.c | 8 +- lib/vquic/vquic.c | 9 +- lib/vquic/vquic_int.h | 2 +- lib/vtls/apple.c | 32 +- lib/vtls/cipher_suite.c | 6 +- lib/vtls/schannel_verify.c | 6 +- lib/vtls/x509asn1.c | 2 +- tests/libtest/cli_h2_pausing.c | 32 +- tests/libtest/cli_hx_download.c | 10 +- tests/libtest/first.c | 4 +- tests/libtest/first.h | 76 ++-- tests/libtest/lib1156.c | 10 +- tests/libtest/lib1506.c | 2 +- tests/libtest/lib1512.c | 2 +- tests/libtest/lib1514.c | 2 +- tests/libtest/lib1520.c | 2 +- tests/libtest/lib1537.c | 4 +- tests/libtest/lib1541.c | 2 +- tests/libtest/lib1550.c | 4 +- tests/libtest/lib1556.c | 2 +- tests/libtest/lib1560.c | 26 +- tests/libtest/lib1565.c | 2 +- tests/libtest/lib1597.c | 34 +- tests/libtest/lib1911.c | 4 +- tests/libtest/lib1912.c | 4 +- tests/libtest/lib1915.c | 2 +- tests/libtest/lib1918.c | 4 +- tests/libtest/lib1938.c | 2 +- tests/libtest/lib2032.c | 9 +- tests/libtest/lib2301.c | 4 +- tests/libtest/lib2402.c | 2 +- tests/libtest/lib2404.c | 2 +- tests/libtest/lib2405.c | 27 +- tests/libtest/lib2502.c | 2 +- tests/libtest/lib3207.c | 2 +- tests/libtest/lib509.c | 6 +- tests/libtest/lib517.c | 232 +++++------ tests/libtest/lib518.c | 4 +- tests/libtest/lib530.c | 7 +- tests/libtest/lib537.c | 2 +- tests/libtest/lib543.c | 7 +- tests/libtest/lib544.c | 3 +- tests/libtest/lib553.c | 2 +- tests/libtest/lib557.c | 6 +- tests/libtest/lib558.c | 4 +- tests/libtest/lib576.c | 2 +- tests/libtest/lib582.c | 6 +- tests/libtest/lib654.c | 2 +- tests/libtest/lib670.c | 2 +- tests/libtest/lib678.c | 2 +- tests/libtest/lib758.c | 17 +- tests/libtest/memptr.c | 6 +- tests/server/dnsd.c | 7 +- tests/server/getpart.c | 2 +- tests/server/mqttd.c | 11 +- tests/server/rtspd.c | 17 +- tests/server/sockfilt.c | 49 ++- tests/server/socksd.c | 30 +- tests/server/sws.c | 38 +- tests/server/tftpd.c | 38 +- tests/unit/unit1300.c | 10 +- tests/unit/unit1302.c | 148 ++++---- tests/unit/unit1307.c | 18 +- tests/unit/unit1309.c | 4 +- tests/unit/unit1323.c | 8 +- tests/unit/unit1395.c | 6 +- tests/unit/unit1396.c | 52 ++- tests/unit/unit1397.c | 100 ++--- tests/unit/unit1398.c | 2 +- tests/unit/unit1600.c | 27 +- tests/unit/unit1601.c | 2 +- tests/unit/unit1606.c | 2 +- tests/unit/unit1607.c | 2 +- tests/unit/unit1609.c | 2 +- tests/unit/unit1610.c | 6 +- tests/unit/unit1611.c | 6 +- tests/unit/unit1612.c | 6 +- tests/unit/unit1614.c | 196 +++++----- tests/unit/unit1615.c | 103 ++--- tests/unit/unit1620.c | 19 +- tests/unit/unit1650.c | 14 +- tests/unit/unit1651.c | 634 ++++++++++++++++--------------- tests/unit/unit1660.c | 17 +- tests/unit/unit1979.c | 2 +- tests/unit/unit1980.c | 2 +- tests/unit/unit2604.c | 42 +- tests/unit/unit2605.c | 59 ++- tests/unit/unit3200.c | 2 +- tests/unit/unit3205.c | 30 +- tests/unit/unit3211.c | 9 +- tests/unit/unit3212.c | 2 +- tests/unit/unit3213.c | 12 +- 149 files changed, 1383 insertions(+), 1378 deletions(-) diff --git a/.github/scripts/typos.toml b/.github/scripts/typos.toml index 3495823c1bdc..ec6b9bb05015 100644 --- a/.github/scripts/typos.toml +++ b/.github/scripts/typos.toml @@ -9,7 +9,7 @@ extend-ignore-identifiers-re = [ "^(ECT0|ECT1|HELO|htpt|PASE)$", "^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers "^0x[0-9a-fA-F]+FUL$", # unsigned long hex literals ending with 'F' - "^(eyeballers|HELO_smtp|optin|passin|perfec|SMTP_HELO)$", + "^(eyeballers|HELO_smtp|Januar|optin|passin|perfec|SMTP_HELO)$", "^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|Tru64|_stati64)$", "secur32", "proxys", # this should be limited to tests/http/*. Short for secure proxy. diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index 22db7c5fc461..08f1f25f7f7f 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -81,7 +81,7 @@ static const char *urls[] = { }; #define MAX_PARALLEL 10 /* number of simultaneous transfers */ -#define NUM_URLS (sizeof(urls) / sizeof(char *)) +#define NUM_URLS (sizeof(urls) / sizeof(char *)) static size_t write_cb(char *data, size_t n, size_t l, void *userp) { diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index 5cd77cad0e80..04223ddd0363 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -268,7 +268,7 @@ static curl_socket_t opensocket(void *clientp, if(ip && filter->type == CONNECTION_FILTER_BLACKLIST) { if(filter->verbose) { - char buf[128] = {0}; + char buf[128] = { 0 }; inet_ntop(address->family, cinaddr, buf, sizeof(buf)); fprintf(stderr, "* Rejecting IP %s due to blacklist entry %s.\n", buf, ip->str); @@ -277,7 +277,7 @@ static curl_socket_t opensocket(void *clientp, } else if(!ip && filter->type == CONNECTION_FILTER_WHITELIST) { if(filter->verbose) { - char buf[128] = {0}; + char buf[128] = { 0 }; inet_ntop(address->family, cinaddr, buf, sizeof(buf)); fprintf(stderr, "* Rejecting IP %s due to missing whitelist entry.\n", buf); diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c index ed8f40aef454..b37cd6f41485 100644 --- a/docs/examples/cacertinmem.c +++ b/docs/examples/cacertinmem.c @@ -83,7 +83,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) BIO *cbio = BIO_new_mem_buf(mypem, sizeof(mypem)); X509_STORE *cts = SSL_CTX_get_cert_store((SSL_CTX *)sslctx); ossl_valsize_t i; - STACK_OF(X509_INFO) *inf; + STACK_OF(X509_INFO) * inf; (void)curl; (void)pointer; diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index 9207199cdfc9..09c0c7d6923f 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -123,8 +123,8 @@ static CURL *make_handle(const char *url) /* HREF finder implemented in libxml2 but could be any HTML parser */ static size_t follow_links(CURLM *multi, struct memory *mem, const char *url) { - int opts = HTML_PARSE_NOBLANKS | HTML_PARSE_NOERROR | \ - HTML_PARSE_NOWARNING | HTML_PARSE_NONET; + int opts = HTML_PARSE_NOBLANKS | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING | + HTML_PARSE_NONET; htmlDocPtr doc = htmlReadMemory(mem->buf, (int)mem->size, url, NULL, opts); size_t count; int i; diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index e572fffad887..cafea9693fe4 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -244,7 +244,7 @@ static void timer_cb(struct GlobalInfo *g, int revents) } rc = curl_multi_socket_action(g->multi, - CURL_SOCKET_TIMEOUT, 0, &g->still_running); + CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); check_multi_info(g); } @@ -303,7 +303,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { struct GlobalInfo *g = (struct GlobalInfo *)cbp; struct SockInfo *fdp = (struct SockInfo *)sockp; - const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; + const char *whatstr[] = { "none", "IN", "OUT", "INOUT", "REMOVE" }; fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 178be018a3a6..922197c3cb5a 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -270,7 +270,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { struct GlobalInfo *g = (struct GlobalInfo *)cbp; struct SockInfo *fdp = (struct SockInfo *)sockp; - const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; + const char *whatstr[] = { "none", "IN", "OUT", "INOUT", "REMOVE" }; printf("%s e %p s %i what %i cbp %p sockp %p\n", __PRETTY_FUNCTION__, e, s, what, cbp, sockp); diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 632d5f298168..4f1b2e9091e3 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -43,17 +43,17 @@ #ifdef _WIN32 #define close closesocket #else -#include /* socket types */ -#include /* socket definitions */ +#include /* socket types */ +#include /* socket definitions */ #include -#include /* inet (3) functions */ -#include /* misc. Unix functions */ +#include /* inet (3) functions */ +#include /* misc. Unix functions */ #endif #include /* The IP address and port number to connect to */ -#define IPADDR "127.0.0.1" +#define IPADDR "127.0.0.1" #define PORTNUM 80 #ifndef INADDR_NONE diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c index fa66628f1655..9159d3857f54 100644 --- a/docs/examples/ftp-wildcard.c +++ b/docs/examples/ftp-wildcard.c @@ -103,7 +103,7 @@ int main(int argc, char **argv) CURL *curl; /* help data */ - struct callback_data data = {0}; + struct callback_data data = { 0 }; /* global initialization */ CURLcode res = curl_global_init(CURL_GLOBAL_ALL); diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c index 53ada7ccaee6..c46fa057eb80 100644 --- a/docs/examples/ftpgetresp.c +++ b/docs/examples/ftpgetresp.c @@ -42,7 +42,7 @@ static size_t write_response(void *ptr, size_t size, size_t nmemb, void *data) return fwrite(ptr, size, nmemb, writehere); } -#define FTPBODY "ftp-list" +#define FTPBODY "ftp-list" #define FTPHEADERS "ftp-responses" int main(void) diff --git a/docs/examples/ftpsget.c b/docs/examples/ftpsget.c index 22c94b8e9363..38844bb21915 100644 --- a/docs/examples/ftpsget.c +++ b/docs/examples/ftpsget.c @@ -40,8 +40,7 @@ struct FtpFile { FILE *stream; }; -static size_t write_cb(void *buffer, size_t size, size_t nmemb, - void *stream) +static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out = (struct FtpFile *)stream; if(!out->stream) { @@ -53,7 +52,6 @@ static size_t write_cb(void *buffer, size_t size, size_t nmemb, return fwrite(buffer, size, nmemb, out->stream); } - int main(void) { CURL *curl; diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 0a241db21c93..48c76a4898a7 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -52,10 +52,10 @@ #include #endif -#define LOCAL_FILE "/tmp/uploadthis.txt" -#define UPLOAD_FILE_AS "while-uploading.txt" -#define REMOTE_URL "ftp://example.com/" UPLOAD_FILE_AS -#define RENAME_FILE_TO "renamed-and-fine.txt" +#define LOCAL_FILE "/tmp/uploadthis.txt" +#define UPLOAD_FILE_AS "while-uploading.txt" +#define REMOTE_URL "ftp://example.com/" UPLOAD_FILE_AS +#define RENAME_FILE_TO "renamed-and-fine.txt" /* NOTE: if you want this example to work on Windows with libcurl as a DLL, you MUST also provide a read callback with CURLOPT_READFUNCTION. Failing to diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index a9af3f12cd56..30305f62fe6c 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -72,7 +72,6 @@ static size_t read_cb(char *ptr, size_t size, size_t nmemb, void *stream) return n; } - static int upload(CURL *curl, const char *remotepath, const char *localpath, long timeout, long tries) { diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index d7b19abb9be3..8f320a6e5fae 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -66,9 +66,9 @@ #include -#define MSG_OUT g_print /* Change to "g_error" to write to stderr */ -#define SHOW_VERBOSE 0L /* Set to non-zero for libcurl messages */ -#define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */ +#define MSG_OUT g_print /* Change to "g_error" to write to stderr */ +#define SHOW_VERBOSE 0L /* Set to non-zero for libcurl messages */ +#define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */ /* Global information, common to all connections */ struct GlobalInfo { @@ -261,7 +261,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { struct GlobalInfo *g = (struct GlobalInfo *)cbp; struct SockInfo *fdp = (struct SockInfo *)sockp; - static const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; + static const char *whatstr[] = { "none", "IN", "OUT", "INOUT", "REMOVE" }; MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index 576bbb8d2c2f..7b17731ebfb5 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -274,7 +274,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { struct GlobalInfo *g = (struct GlobalInfo *)cbp; struct SockInfo *fdp = (struct SockInfo *)sockp; - const char *whatstr[] = {"none", "IN", "OUT", "INOUT", "REMOVE"}; + const char *whatstr[] = { "none", "IN", "OUT", "INOUT", "REMOVE" }; fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if(what == CURL_POLL_REMOVE) { diff --git a/docs/examples/hsts-preload.c b/docs/examples/hsts-preload.c index b029df2a0a30..cd6c30f9c6b6 100644 --- a/docs/examples/hsts-preload.c +++ b/docs/examples/hsts-preload.c @@ -93,7 +93,7 @@ int main(void) curl = curl_easy_init(); if(curl) { - struct state st = {0}; + struct state st = { 0 }; /* enable HSTS for this handle */ curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE); diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index 9865a633efcd..a3ecc01df175 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -79,8 +79,8 @@ int main(int argc, char **argv) CURL *curl; char curl_errbuf[CURL_ERROR_SIZE]; TidyDoc tdoc; - TidyBuffer docbuf = {0}; - TidyBuffer tidy_errbuf = {0}; + TidyBuffer docbuf = { 0 }; + TidyBuffer tidy_errbuf = { 0 }; CURLcode res; if(argc != 2) { diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index a6f944ff0eb9..ac351a8bf5f7 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -54,7 +54,6 @@ // // libxml callback context structure // - struct Context { Context() : addTitle(false) {} @@ -71,7 +70,6 @@ static std::string buffer; // // libcurl write callback function // - static size_t writer(char *data, size_t size, size_t nmemb, std::string *writerData) { @@ -86,7 +84,6 @@ static size_t writer(char *data, size_t size, size_t nmemb, // // libcurl connection initialization // - static bool init(CURL *&curl, const char *url) { CURLcode res; @@ -134,7 +131,6 @@ static bool init(CURL *&curl, const char *url) // // libxml start element callback function // - static void StartElement(void *voidContext, const xmlChar *name, const xmlChar **attributes) @@ -151,7 +147,6 @@ static void StartElement(void *voidContext, // // libxml end element callback function // - static void EndElement(void *voidContext, const xmlChar *name) { @@ -164,7 +159,6 @@ static void EndElement(void *voidContext, // // Text handling helper function // - static void handleCharacters(Context *context, const xmlChar *chars, int length) @@ -177,7 +171,6 @@ static void handleCharacters(Context *context, // // libxml PCDATA callback function // - static void Characters(void *voidContext, const xmlChar *chars, int length) @@ -190,7 +183,6 @@ static void Characters(void *voidContext, // // libxml CDATA callback function // - static void cdata(void *voidContext, const xmlChar *chars, int length) @@ -203,9 +195,7 @@ static void cdata(void *voidContext, // // libxml SAX callback structure // - -static htmlSAXHandler saxHandler = -{ +static htmlSAXHandler saxHandler = { NULL, NULL, NULL, @@ -243,7 +233,6 @@ static htmlSAXHandler saxHandler = // // Parse given (assumed to be) HTML text and return the title // - static void parseHtml(const std::string &html, std::string &title) { diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index e6fdbd6b9c75..054f697b3e89 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -200,10 +200,10 @@ int main(int argc, char **argv) /* if given a number, do that many transfers */ num_transfers = atoi(argv[1]); if((num_transfers < 1) || (num_transfers > 1000)) - num_transfers = 3; /* a suitable low default */ + num_transfers = 3; /* a suitable low default */ } else - num_transfers = 3; /* a suitable low default */ + num_transfers = 3; /* a suitable low default */ res = curl_global_init(CURL_GLOBAL_ALL); if(res) diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index 5c817ead5893..eb67bfe67108 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -136,7 +136,7 @@ static int setup(CURL *curl, const char *url) { out_download = fopen(OUTPUTFILE, "wb"); if(!out_download) - return 1; /* failed */ + return 1; /* failed */ /* set the same URL */ curl_easy_setopt(curl, CURLOPT_URL, url); diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 9ec8cbf5bc37..e360127a44fd 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -72,8 +72,8 @@ static int my_gettimeofday(struct timeval *tp, void *tzp) { (void)tzp; if(tp) { - /* Offset between 1601-01-01 and 1970-01-01 in 100 nanosec units */ - #define WIN32_FT_OFFSET (116444736000000000) +/* Offset between 1601-01-01 and 1970-01-01 in 100 nanosec units */ +#define WIN32_FT_OFFSET (116444736000000000) union { CURL_TYPEOF_CURL_OFF_T ns100; /* time since 1 Jan 1601 in 100ns units */ FILETIME ft; diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c index 91cbac69151a..e3665d012825 100644 --- a/docs/examples/imap-append.c +++ b/docs/examples/imap-append.c @@ -36,9 +36,9 @@ * Note that this example requires libcurl 7.30.0 or above. */ -#define FROM "" -#define TO "" -#define CC "" +#define FROM "" +#define TO "" +#define CC "" static const char *payload_text = "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n" @@ -95,7 +95,7 @@ int main(void) if(curl) { size_t filesize; long infilesize = LONG_MAX; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); diff --git a/docs/examples/maxconnects.c b/docs/examples/maxconnects.c index 658b38d711e3..2ee1d305a93f 100644 --- a/docs/examples/maxconnects.c +++ b/docs/examples/maxconnects.c @@ -39,7 +39,8 @@ int main(void) curl = curl_easy_init(); if(curl) { - const char *urls[] = { "https://example.com", + const char *urls[] = { + "https://example.com", "https://curl.se", "https://www.example/", NULL /* end of list */ diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index d58181e027f4..51492e8adea4 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -36,7 +36,7 @@ */ #define HTTP_HANDLE 0 /* Index for the HTTP transfer */ -#define FTP_HANDLE 1 /* Index for the FTP transfer */ +#define FTP_HANDLE 1 /* Index for the FTP transfer */ #define HANDLECOUNT 2 /* Number of simultaneous transfers */ int main(void) diff --git a/docs/examples/multi-event.c b/docs/examples/multi-event.c index 901d7dd6e765..2eb3977200ec 100644 --- a/docs/examples/multi-event.c +++ b/docs/examples/multi-event.c @@ -183,8 +183,8 @@ static int handle_socket(CURL *curl, curl_socket_t s, int action, void *userp, case CURL_POLL_IN: case CURL_POLL_OUT: case CURL_POLL_INOUT: - curl_context = socketp ? - (struct curl_context *)socketp : create_curl_context(s); + curl_context = + socketp ? (struct curl_context *)socketp : create_curl_context(s); curl_multi_assign(multi, s, (void *)curl_context); @@ -197,7 +197,7 @@ static int handle_socket(CURL *curl, curl_socket_t s, int action, void *userp, event_del(curl_context->event); event_assign(curl_context->event, base, curl_context->sockfd, - (short)events, curl_perform, curl_context); + (short)events, curl_perform, curl_context); event_add(curl_context->event, NULL); break; diff --git a/docs/examples/multi-legacy.c b/docs/examples/multi-legacy.c index e34d1cd710a2..42670129f944 100644 --- a/docs/examples/multi-legacy.c +++ b/docs/examples/multi-legacy.c @@ -41,9 +41,9 @@ * Download an HTTP file and upload an FTP file simultaneously. */ -#define HTTP_HANDLE 0 /* Index for the HTTP transfer */ -#define FTP_HANDLE 1 /* Index for the FTP transfer */ -#define HANDLECOUNT 2 /* Number of simultaneous transfers */ +#define HTTP_HANDLE 0 /* Index for the HTTP transfer */ +#define FTP_HANDLE 1 /* Index for the FTP transfer */ +#define HANDLECOUNT 2 /* Number of simultaneous transfers */ int main(void) { @@ -140,7 +140,7 @@ int main(void) rc = 0; #else /* Portable sleep for platforms other than Windows. */ - struct timeval wait = {0}; + struct timeval wait = { 0 }; wait.tv_usec = 100 * 1000; /* 100ms */ rc = select(0, NULL, NULL, NULL, &wait); #endif @@ -155,7 +155,7 @@ int main(void) case -1: /* select error */ break; - case 0: /* timeout */ + case 0: /* timeout */ default: /* action */ curl_multi_perform(multi, &still_running); break; diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index 4053cb906112..13689ad3f8ef 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -201,8 +201,8 @@ static int cb_socket(CURL *curl, curl_socket_t s, int action, case CURL_POLL_IN: case CURL_POLL_OUT: case CURL_POLL_INOUT: - curl_context = socketp ? - (struct curl_context *)socketp : create_curl_context(s, uv); + curl_context = + socketp ? (struct curl_context *)socketp : create_curl_context(s, uv); curl_multi_assign(uv->multi, s, (void *)curl_context); @@ -230,7 +230,7 @@ static int cb_socket(CURL *curl, curl_socket_t s, int action, int main(int argc, char **argv) { CURLcode res; - struct datauv uv = {0}; + struct datauv uv = { 0 }; int running_handles; if(argc <= 1) diff --git a/docs/examples/multithread.c b/docs/examples/multithread.c index 308c1168e284..3d2f1df7de0b 100644 --- a/docs/examples/multithread.c +++ b/docs/examples/multithread.c @@ -45,7 +45,7 @@ https://curl.se/libcurl/c/threadsafe.html */ -static const char * const urls[NUMT]= { +static const char * const urls[NUMT] = { "https://curl.se/", "ftp://example.com/", "https://example.net/", diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index c463e3785ceb..0df09a34bf45 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -31,8 +31,9 @@ #include /* silly test data to POST */ -static const char data[]="Lorem ipsum dolor sit amet, consectetur adipiscing " - "elit. Sed vel urna neque. Ut quis leo metus. Quisque eleifend, ex at " +static const char data[] = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + "Sed vel urna neque. Ut quis leo metus. Quisque eleifend, ex at " "laoreet rhoncus, odio ipsum semper metus, at tempus ante urna in mauris. " "Suspendisse ornare tempor venenatis. Ut dui neque, pellentesque a ______ " "eget, mattis vitae ligula. Fusce ut pharetra est. Ut ullamcorper mi ac " @@ -61,7 +62,7 @@ static size_t read_cb(char *dest, size_t size, size_t nmemb, void *userp) return copy_this_much; /* we copied this many bytes */ } - return 0; /* no more data left to deliver */ + return 0; /* no more data left to deliver */ } int main(void) diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index 089d9a9c743c..0a2964f1c64d 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -68,7 +68,7 @@ int main(void) return (int)res; chunk.memory = malloc(1); /* grown as needed by realloc above */ - chunk.size = 0; /* no data at this point */ + chunk.size = 0; /* no data at this point */ curl = curl_easy_init(); if(curl) { diff --git a/docs/examples/progressfunc.c b/docs/examples/progressfunc.c index 59477951f934..41a87f2bf9a0 100644 --- a/docs/examples/progressfunc.c +++ b/docs/examples/progressfunc.c @@ -30,8 +30,8 @@ #include -#define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3000000 -#define STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES 6000 +#define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3000000 +#define STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES 6000 struct myprogress { curl_off_t lastruntime; /* type depends on version, see above */ diff --git a/docs/examples/protofeats.c b/docs/examples/protofeats.c index f93dccef003c..50b31cb9ea57 100644 --- a/docs/examples/protofeats.c +++ b/docs/examples/protofeats.c @@ -29,14 +29,14 @@ #include -#if !CURL_AT_LEAST_VERSION(7,87,0) +#if !CURL_AT_LEAST_VERSION(7, 87, 0) #error "too old libcurl" #endif int main(void) { curl_version_info_data *ver; - const char *const *ptr; + const char * const *ptr; CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if(res) diff --git a/docs/examples/sendrecv.c b/docs/examples/sendrecv.c index 6f7cbb1b5188..e0bf417e481b 100644 --- a/docs/examples/sendrecv.c +++ b/docs/examples/sendrecv.c @@ -128,7 +128,7 @@ int main(void) do { nsent = 0; res = curl_easy_send(curl, request + nsent_total, - request_len - nsent_total, &nsent); + request_len - nsent_total, &nsent); nsent_total += nsent; if(res == CURLE_AGAIN && !wait_on_socket(sockfd, 0, 60000L)) { diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index e90b387da06e..dec9fa988d2e 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -73,8 +73,8 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) gnutls_x509_crt_import(cert, &chainp[i], GNUTLS_X509_FMT_DER)) { if(GNUTLS_E_SUCCESS == gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_FULL, &dn)) { - fprintf(stderr, "Certificate #%u: %.*s", i, - (int)dn.size, dn.data); + fprintf(stderr, "Certificate #%u: %.*s", i, (int)dn.size, + dn.data); gnutls_free(dn.data); } diff --git a/docs/examples/smtp-authzid.c b/docs/examples/smtp-authzid.c index e7dd20f59093..f8e66069f871 100644 --- a/docs/examples/smtp-authzid.c +++ b/docs/examples/smtp-authzid.c @@ -40,13 +40,13 @@ /* The libcurl options want plain addresses, the viewable headers in the mail * can get a full name as well. */ -#define FROM_ADDR "" -#define SENDER_ADDR "" -#define TO_ADDR "" +#define FROM_ADDR "" +#define SENDER_ADDR "" +#define TO_ADDR "" -#define FROM_MAIL "Ursel " FROM_ADDR -#define SENDER_MAIL "Kurt " SENDER_ADDR -#define TO_MAIL "A Receiver " TO_ADDR +#define FROM_MAIL "Ursel " FROM_ADDR +#define SENDER_MAIL "Kurt " SENDER_ADDR +#define TO_MAIL "A Receiver " TO_ADDR static const char *payload_text = "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n" @@ -99,7 +99,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; /* This is the URL for your mailserver. In this example we connect to the smtp-submission port as we require an authenticated connection. */ diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c index d5074abbf2f5..8ed91f55b722 100644 --- a/docs/examples/smtp-mail.c +++ b/docs/examples/smtp-mail.c @@ -37,9 +37,9 @@ /* The libcurl options want plain addresses, the viewable headers in the mail * can get a full name as well. */ -#define FROM_ADDR "" -#define TO_ADDR "" -#define CC_ADDR "" +#define FROM_ADDR "" +#define TO_ADDR "" +#define CC_ADDR "" #define FROM_MAIL "Sender Person " FROM_ADDR #define TO_MAIL "A Receiver " TO_ADDR @@ -96,7 +96,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); diff --git a/docs/examples/smtp-mime.c b/docs/examples/smtp-mime.c index 553947b0976c..89bfebd39da4 100644 --- a/docs/examples/smtp-mime.c +++ b/docs/examples/smtp-mime.c @@ -37,9 +37,9 @@ * Note that this example requires libcurl 7.56.0 or above. */ -#define FROM "" -#define TO "" -#define CC "" +#define FROM "" +#define TO "" +#define CC "" static const char *headers_text[] = { "Date: Tue, 22 Aug 2017 14:08:43 +0100", @@ -47,7 +47,7 @@ static const char *headers_text[] = { "From: " FROM " (Example User)", "Cc: " CC " (Another example User)", "Message-ID: ", + "rfcpedant.example.org>", "Subject: example sending a MIME-formatted message", NULL }; @@ -66,7 +66,6 @@ static const char inline_html[] = "email viewers able to handle HTML.

" "\r\n"; - int main(void) { CURL *curl; diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index 8cb5e65a26b9..acc54bacdfcb 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -34,9 +34,9 @@ * libcurl's multi interface. */ -#define FROM_MAIL "" -#define TO_MAIL "" -#define CC_MAIL "" +#define FROM_MAIL "" +#define TO_MAIL "" +#define CC_MAIL "" static const char *payload_text = "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n" @@ -94,7 +94,7 @@ int main(void) if(multi) { int still_running = 1; struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index 3b140c904c5c..3a5e3304394e 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -38,9 +38,9 @@ * Note that this example requires libcurl 7.20.0 or above. */ -#define FROM_MAIL "" -#define TO_MAIL "" -#define CC_MAIL "" +#define FROM_MAIL "" +#define TO_MAIL "" +#define CC_MAIL "" static const char *payload_text = "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n" @@ -93,7 +93,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index 3bf3b0cddf11..e9221b36c9f2 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -38,9 +38,9 @@ * Note that this example requires libcurl 7.20.0 or above. */ -#define FROM_MAIL "" -#define TO_MAIL "" -#define CC_MAIL "" +#define FROM_MAIL "" +#define TO_MAIL "" +#define CC_MAIL "" static const char *payload_text = "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n" @@ -93,7 +93,7 @@ int main(void) curl = curl_easy_init(); if(curl) { struct curl_slist *recipients = NULL; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index b2a3b926072d..a81f40e3ac21 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -58,8 +58,8 @@ */ #ifdef _MSC_VER #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), fopen(), gmtime(), - localtime(), sscanf() */ +#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), fopen(), gmtime(), + localtime(), sscanf() */ #endif #endif @@ -74,9 +74,9 @@ int main(void) #else #if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)) || \ - defined(WINAPI_FAMILY) + defined(WINAPI_FAMILY) # include -# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) # define CURL_WINDOWS_UWP # endif @@ -100,8 +100,8 @@ int main(void) #define snprintf _snprintf #endif -#define MAX_STRING 256 -#define MAX_STRING1 MAX_STRING + 1 +#define MAX_STRING 256 +#define MAX_STRING1 MAX_STRING + 1 #define SYNCTIME_UA "synctime/1.0" @@ -111,8 +111,7 @@ struct conf { char timeserver[MAX_STRING1]; }; -static const char DefaultTimeServer[3][MAX_STRING1] = -{ +static const char DefaultTimeServer[3][MAX_STRING1] = { "https://nist.time.gov/", "https://www.google.com/" }; @@ -128,8 +127,8 @@ static int AutoSyncTime; static SYSTEMTIME SYSTime; static SYSTEMTIME LOCALTime; -#define HTTP_COMMAND_HEAD 0 -#define HTTP_COMMAND_GET 1 +#define HTTP_COMMAND_HEAD 0 +#define HTTP_COMMAND_GET 1 static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) { @@ -167,17 +166,17 @@ static size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb, if(RetVal == 7) { int i; - SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */ + SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */ for(i = 0; i < 12; i++) { if(strcmp(MthStr[i], TmpStr2) == 0) { SYSTime.wMonth = (WORD)(i + 1); break; } } - AutoSyncTime = 3; /* Computer clock is adjusted */ + AutoSyncTime = 3; /* Computer clock is adjusted */ } else { - AutoSyncTime = 0; /* Error in sscanf() fields conversion */ + AutoSyncTime = 0; /* Error in sscanf() fields conversion */ } } } @@ -222,7 +221,7 @@ static CURLcode SyncTime_CURL_Fetch(CURL *curl, const char *URL_Str, res = curl_easy_perform(curl); if(outfile) fclose(outfile); - return res; /* (CURLE_OK) */ + return res; /* (CURLE_OK) */ } static void showUsage(void) @@ -251,7 +250,7 @@ static int conf_init(struct conf *conf) *conf->http_proxy = 0; for(i = 0; i < MAX_STRING1; i++) - conf->proxy_user[i] = 0; /* Clean up password from memory */ + conf->proxy_user[i] = 0; /* Clean up password from memory */ *conf->timeserver = 0; return 1; } @@ -263,9 +262,9 @@ int main(int argc, char *argv[]) struct conf conf[1]; int RetValue; - ShowAllHeader = 0; /* Do not show HTTP Header */ - AutoSyncTime = 0; /* Do not synchronise computer clock */ - RetValue = 0; /* Successful Exit */ + ShowAllHeader = 0; /* Do not show HTTP Header */ + AutoSyncTime = 0; /* Do not synchronise computer clock */ + RetValue = 0; /* Successful Exit */ conf_init(conf); if(argc > 1) { @@ -295,7 +294,7 @@ int main(int argc, char *argv[]) } } - if(*conf->timeserver == 0) /* Use default server for time information */ + if(*conf->timeserver == 0) /* Use default server for time information */ snprintf(conf->timeserver, MAX_STRING, "%s", DefaultTimeServer[0]); /* Init CURL before usage */ diff --git a/docs/examples/websocket-cb.c b/docs/examples/websocket-cb.c index 78899826fb53..63d07c784146 100644 --- a/docs/examples/websocket-cb.c +++ b/docs/examples/websocket-cb.c @@ -33,8 +33,8 @@ static size_t write_cb(char *b, size_t size, size_t nitems, void *p) CURL *curl = p; size_t i; const struct curl_ws_frame *frame = curl_ws_meta(curl); - fprintf(stderr, "Type: %s\n", frame->flags & CURLWS_BINARY ? - "binary" : "text"); + fprintf(stderr, "Type: %s\n", + frame->flags & CURLWS_BINARY ? "binary" : "text"); fprintf(stderr, "Bytes: %u", (unsigned int)(nitems * size)); for(i = 0; i < nitems; i++) fprintf(stderr, "%02x ", (unsigned char)b[i]); diff --git a/docs/examples/websocket-updown.c b/docs/examples/websocket-updown.c index 87f7aea28752..a40bddf9cfb1 100644 --- a/docs/examples/websocket-updown.c +++ b/docs/examples/websocket-updown.c @@ -35,8 +35,8 @@ static size_t write_cb(char *b, size_t size, size_t nitems, void *p) size_t i; unsigned int blen = (unsigned int)(nitems * size); const struct curl_ws_frame *frame = curl_ws_meta(curl); - fprintf(stderr, "Type: %s\n", frame->flags & CURLWS_BINARY ? - "binary" : "text"); + fprintf(stderr, "Type: %s\n", + frame->flags & CURLWS_BINARY ? "binary" : "text"); if(frame->flags & CURLWS_BINARY) { fprintf(stderr, "Bytes: %u", blen); for(i = 0; i < nitems; i++) @@ -111,7 +111,6 @@ int main(int argc, const char *argv[]) curl_easy_setopt(curl, CURLOPT_READDATA, &rctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); - /* Perform the request, res gets the return code */ res = curl_easy_perform(curl); /* Check for errors */ diff --git a/docs/examples/websocket.c b/docs/examples/websocket.c index 0063f1b59c63..0075f68e6059 100644 --- a/docs/examples/websocket.c +++ b/docs/examples/websocket.c @@ -49,10 +49,10 @@ static CURLcode ping(CURL *curl, const char *send_payload) buf += sent; /* deduct what was sent */ blen -= sent; } - else if(res == CURLE_AGAIN) { /* blocked on sending */ + else if(res == CURLE_AGAIN) { /* blocked on sending */ fprintf(stderr, "ws: sent PING blocked, waiting a second\n"); - sleep(1); /* either select() on socket or max timeout would - be good here. */ + sleep(1); /* either select() on socket or max timeout would + be good here. */ } else /* real error sending */ break; @@ -85,8 +85,7 @@ static CURLcode recv_pong(CURL *curl, const char *expected_payload) same ? "same" : "different"); } else if(meta->flags & CURLWS_TEXT) { - fprintf(stderr, "ws: received TEXT frame '%.*s'\n", (int)rlen, - buffer); + fprintf(stderr, "ws: received TEXT frame '%.*s'\n", (int)rlen, buffer); } else if(meta->flags & CURLWS_BINARY) { fprintf(stderr, "ws: received BINARY frame of %u bytes\n", @@ -99,10 +98,10 @@ static CURLcode recv_pong(CURL *curl, const char *expected_payload) goto retry; } } - else if(res == CURLE_AGAIN) { /* blocked on receiving */ + else if(res == CURLE_AGAIN) { /* blocked on receiving */ fprintf(stderr, "ws: PONG not there yet, waiting a second\n"); - sleep(1); /* either select() on socket or max timeout would - be good here. */ + sleep(1); /* either select() on socket or max timeout would + be good here. */ goto retry; } if(res) diff --git a/lib/bufref.c b/lib/bufref.c index 8f52d48d20a5..e5b5a4d985cd 100644 --- a/lib/bufref.c +++ b/lib/bufref.c @@ -102,7 +102,7 @@ const char *Curl_bufref_ptr(const struct bufref *br) DEBUGASSERT(br->signature == SIGNATURE); DEBUGASSERT(br->ptr || !br->len); - return (const char *) br->ptr; + return (const char *)br->ptr; } /* diff --git a/lib/cookie.c b/lib/cookie.c index dff5198c1162..5c29768bbdfc 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -1036,7 +1036,7 @@ Curl_cookie_add(struct Curl_easy *data, /* Only show this when NOT reading the cookies from a file */ infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, " "expire %" FMT_OFF_T, - replaces ? "Replaced":"Added", co->name, co->value, + replaces ? "Replaced" : "Added", co->name, co->value, co->domain, co->path, co->expires); if(!replaces) diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index cc49aa4c7750..78f60dfc2645 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -238,8 +238,7 @@ static CURLcode Curl_sha512_256_update(void *context, # bytes * @return always CURLE_OK */ -static CURLcode Curl_sha512_256_finish(unsigned char *digest, - void *context) +static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context; @@ -453,19 +452,19 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], /* 'Ch' and 'Maj' macro functions are defined with widely-used optimization. See FIPS PUB 180-4 formulae 4.8, 4.9. */ -#define Sha512_Ch(x, y, z) ( (z) ^ ((x) & ((y) ^ (z))) ) -#define Sha512_Maj(x, y, z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) ) +#define Sha512_Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define Sha512_Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) /* Four 'Sigma' macro functions. See FIPS PUB 180-4 formulae 4.10, 4.11, 4.12, 4.13. */ #define SIG0(x) \ - ( Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39) ) + (Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39)) #define SIG1(x) \ - ( Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41) ) + (Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41)) #define sig0(x) \ - ( Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7) ) + (Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7)) #define sig1(x) \ - ( Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6) ) + (Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6)) if(1) { unsigned int t; @@ -628,9 +627,7 @@ static CURLcode Curl_sha512_256_update(void *context, if(length >= bytes_left) { /* Combine new data with data in the buffer and process the full block. */ - memcpy(((unsigned char *)ctx_buf) + bytes_have, - data, - bytes_left); + memcpy(((unsigned char *)ctx_buf) + bytes_have, data, bytes_left); data += bytes_left; length -= bytes_left; Curl_sha512_256_transform(ctx->H, ctx->buffer); diff --git a/lib/formdata.c b/lib/formdata.c index d5f6776a3d5f..b0c57b8d6f06 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -252,7 +252,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, (form->flags & HTTPPOST_BUFFER)) && !Curl_bufref_ptr(&form->contenttype)) { const char *f = Curl_bufref_ptr((form->flags & HTTPPOST_BUFFER) ? - &form->showfilename : &form->value); + &form->showfilename : &form->value); const char *type = Curl_mime_contenttype(f); if(!type) type = prevtype; @@ -276,7 +276,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form, if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE | HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | HTTPPOST_CALLBACK))) { - if(FormInfoCopyField(&form->value, (size_t) form->contentslength)) + if(FormInfoCopyField(&form->value, (size_t)form->contentslength)) return CURL_FORMADD_MEMORY; } post = AddHttpPost(form, post, httppost, last_post); @@ -315,11 +315,11 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, struct curl_httppost *newchain = NULL; struct curl_httppost *lastnode = NULL; -#define form_ptr_arg(t) (forms ? (t) (void *) avalue : va_arg(params, t)) +#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t)) #ifdef HAVE_STDINT_H -#define form_int_arg(t) (forms ? (t) (uintptr_t) avalue : va_arg(params, t)) +#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t)) #else -#define form_int_arg(t) (forms ? (t) (void *) avalue : va_arg(params, t)) +#define form_int_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t)) #endif /* @@ -391,7 +391,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->namelength) retval = CURL_FORMADD_OPTION_TWICE; else - curr->namelength = (size_t) form_int_arg(long); + curr->namelength = (size_t)form_int_arg(long); break; /* @@ -412,7 +412,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, } break; case CURLFORM_CONTENTSLENGTH: - curr->contentslength = (curl_off_t)(size_t) form_int_arg(long); + curr->contentslength = (curl_off_t)(size_t)form_int_arg(long); break; case CURLFORM_CONTENTLEN: @@ -493,7 +493,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(curr->bufferlength) retval = CURL_FORMADD_OPTION_TWICE; else - curr->bufferlength = (size_t) form_int_arg(long); + curr->bufferlength = (size_t)form_int_arg(long); break; case CURLFORM_STREAM: @@ -521,7 +521,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost, if(avalue) { form = NewFormInfo(); if(!form || Curl_bufref_memdup0(&form->contenttype, avalue, - strlen(avalue))) { + strlen(avalue))) { curlx_free(form); retval = CURL_FORMADD_MEMORY; } @@ -793,10 +793,10 @@ CURLcode Curl_getformdata(CURL *data, #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcast-function-type-strict" #endif - result = curl_mime_data_cb(part, (curl_off_t) -1, - (curl_read_callback) fread, + result = curl_mime_data_cb(part, (curl_off_t)-1, + (curl_read_callback)fread, curlx_fseek, - NULL, (void *) stdin); + NULL, (void *)stdin); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop #endif diff --git a/lib/ftp.c b/lib/ftp.c index 49f042c7c4c7..4e528259c914 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -81,8 +81,8 @@ /* macro to check for a three-digit ftp status code at the start of the given string */ -#define STATUSCODE(line) (ISDIGIT(line[0]) && ISDIGIT(line[1]) && \ - ISDIGIT(line[2])) +#define STATUSCODE(line) \ + (ISDIGIT(line[0]) && ISDIGIT(line[1]) && ISDIGIT(line[2])) /* macro to check for the last line in an FTP server response */ #define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3])) @@ -1749,8 +1749,7 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data, return result; } -static CURLcode ftp_control_addr_dup(struct Curl_easy *data, - char **newhostp) +static CURLcode ftp_control_addr_dup(struct Curl_easy *data, char **newhostp) { struct connectdata *conn = data->conn; struct ip_quadruple ipquad; diff --git a/lib/hostip.c b/lib/hostip.c index ba9e3ddd7ac9..4f4122d6ae1f 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -217,7 +217,7 @@ static timediff_t dnscache_prune(struct Curl_hash *hostcache, user.oldest_ms = 0; Curl_hash_clean_with_criterium(hostcache, - (void *) &user, + (void *)&user, dnscache_entry_is_stale); return user.oldest_ms; diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index da80f1965809..850daf413952 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -448,7 +448,7 @@ static CURLcode calc_payload_hash(struct Curl_easy *data, else post_data_len = (size_t)data->set.postfieldsize; } - result = Curl_sha256it(sha_hash, (const unsigned char *) post_data, + result = Curl_sha256it(sha_hash, (const unsigned char *)post_data, post_data_len); if(!result) sha256_to_hex(sha_hex, sha_hash); diff --git a/lib/ldap.c b/lib/ldap.c index b6ed43d90415..6104ff207344 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -143,11 +143,11 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp); #endif /* !HAVE_LDAP_URL_PARSE */ #ifdef DEBUG_LDAP -#define LDAP_TRACE(x) \ -do { \ - ldap_trace_low("%u: ", __LINE__); \ - ldap_trace_low x; \ -} while(0) +#define LDAP_TRACE(x) \ + do { \ + ldap_trace_low("%u: ", __LINE__); \ + ldap_trace_low x; \ + } while(0) static void ldap_trace_low(const char *fmt, ...) CURL_PRINTF(1, 2); #else diff --git a/lib/url.c b/lib/url.c index 194810553e18..043d7ca72cb3 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1769,7 +1769,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, if(!use_set_uh) { char *newurl; uc = curl_url_set(uh, CURLUPART_URL, Curl_bufref_ptr(&data->state.url), - (unsigned int) (CURLU_GUESS_SCHEME | + (unsigned int)(CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME | (data->set.disallow_username_in_url ? CURLU_DISALLOW_USER : 0) | @@ -3199,7 +3199,7 @@ static CURLcode resolve_server(struct Curl_easy *data, #ifndef CURL_DISABLE_PROXY if(!unix_path && CONN_IS_PROXIED(conn) && conn->socks_proxy.host.name && - !strncmp(UNIX_SOCKET_PREFIX"/", + !strncmp(UNIX_SOCKET_PREFIX "/", conn->socks_proxy.host.name, sizeof(UNIX_SOCKET_PREFIX))) unix_path = conn->socks_proxy.host.name + sizeof(UNIX_SOCKET_PREFIX) - 1; #endif diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index fc2c1393750f..c92b53dcfc22 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -452,10 +452,10 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, chlg_buf[0].cbBuffer = 0; chlg_buf[1].BufferType = SECBUFFER_PKG_PARAMS; chlg_buf[1].pvBuffer = CURL_UNCONST(request); - chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *) request)); + chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *)request)); chlg_buf[2].BufferType = SECBUFFER_PKG_PARAMS; chlg_buf[2].pvBuffer = CURL_UNCONST(uripath); - chlg_buf[2].cbBuffer = curlx_uztoul(strlen((const char *) uripath)); + chlg_buf[2].cbBuffer = curlx_uztoul(strlen((const char *)uripath)); chlg_buf[3].BufferType = SECBUFFER_PKG_PARAMS; chlg_buf[3].pvBuffer = NULL; chlg_buf[3].cbBuffer = 0; @@ -495,7 +495,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, } /* Populate our identity domain */ - if(Curl_override_sspi_http_realm((const char *) digest->input_token, + if(Curl_override_sspi_http_realm((const char *)digest->input_token, &identity)) { Curl_sspi_free_identity(&identity); curlx_free(output_token); @@ -552,7 +552,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, chlg_buf[0].cbBuffer = curlx_uztoul(digest->input_token_len); chlg_buf[1].BufferType = SECBUFFER_PKG_PARAMS; chlg_buf[1].pvBuffer = CURL_UNCONST(request); - chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *) request)); + chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *)request)); chlg_buf[2].BufferType = SECBUFFER_PKG_PARAMS; chlg_buf[2].pvBuffer = NULL; chlg_buf[2].cbBuffer = 0; @@ -565,7 +565,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, resp_buf.pvBuffer = output_token; resp_buf.cbBuffer = curlx_uztoul(token_max); - spn = curlx_convert_UTF8_to_tchar((const char *) uripath); + spn = curlx_convert_UTF8_to_tchar((const char *)uripath); if(!spn) { Curl_pSecFn->FreeCredentialsHandle(&credentials); diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 690ef252a037..b9eaa1e98e2e 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -73,7 +73,7 @@ #include "../curlx/warnless.h" -#define QUIC_MAX_STREAMS (256 * 1024) +#define QUIC_MAX_STREAMS (256 * 1024) #define QUIC_HANDSHAKE_TIMEOUT (10 * NGTCP2_SECONDS) /* A stream window is the maximum amount we need to buffer for @@ -91,12 +91,11 @@ * spares. Memory consumption goes down when streams run empty, * have a large upload done, etc. */ #define H3_STREAM_POOL_SPARES \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2 + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2 /* Receive and Send max number of chunks just follows from the * chunk size and window size */ #define H3_STREAM_SEND_CHUNKS \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) - + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) /* * Store ngtcp2 version info in this buffer. @@ -959,7 +958,7 @@ static CURLcode cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); c_exhaust = want_send && (!ngtcp2_conn_get_cwnd_left(ctx->qconn) || - !ngtcp2_conn_get_max_data_left(ctx->qconn)); + !ngtcp2_conn_get_max_data_left(ctx->qconn)); s_exhaust = want_send && stream && stream->id >= 0 && stream->quic_flow_blocked; want_recv = (want_recv || c_exhaust || s_exhaust); @@ -2513,7 +2512,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, CURLcode result; const struct Curl_sockaddr_ex *sockaddr = NULL; int qfd; - static const struct alpn_spec ALPN_SPEC_H3 = {{ "h3", "h3-29" }, 2}; + static const struct alpn_spec ALPN_SPEC_H3 = { { "h3", "h3-29" }, 2 }; DEBUGASSERT(ctx->initialized); ctx->dcid.datalen = NGTCP2_MAX_CIDLEN; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 73cea21a15dc..4e6e325295e4 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -70,13 +70,13 @@ * spares. Memory consumption goes down when streams run empty, * have a large upload done, etc. */ #define H3_STREAM_POOL_SPARES \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2 + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2 /* Receive and Send max number of chunks just follows from the * chunk size and window size */ #define H3_STREAM_RECV_CHUNKS \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) #define H3_STREAM_SEND_CHUNKS \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) #if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC) typedef uint32_t sslerr_t; @@ -87,8 +87,7 @@ typedef unsigned long sslerr_t; /* How to access `call_data` from a cf_osslq filter */ #undef CF_CTX_CALL_DATA -#define CF_CTX_CALL_DATA(cf) \ - ((struct cf_osslq_ctx *)(cf)->ctx)->call_data +#define CF_CTX_CALL_DATA(cf) ((struct cf_osslq_ctx *)(cf)->ctx)->call_data static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, struct Curl_easy *data); @@ -954,7 +953,7 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id, (void)conn; if(stream && stream->s.ssl) { - SSL_STREAM_RESET_ARGS args = {0}; + SSL_STREAM_RESET_ARGS args = { 0 }; args.quic_error_code = app_error_code; rv = !SSL_stream_reset(stream->s.ssl, &args, sizeof(args)); CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv); diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index 7082d55916b8..feceaf6369d9 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -65,11 +65,11 @@ * stream buffer to not keep spares. Memory consumption goes down when streams * run empty, have a large upload done, etc. */ #define H3_STREAM_POOL_SPARES \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2 + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2 /* Receive and Send max number of chunks just follows from the * chunk size and window size */ #define H3_STREAM_RECV_CHUNKS \ - (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) + (H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) /* * Store quiche version info in this buffer. @@ -1228,7 +1228,7 @@ static CURLcode cf_quiche_ctx_open(struct Curl_cfilter *cf, int rv; CURLcode result; const struct Curl_sockaddr_ex *sockaddr; - static const struct alpn_spec ALPN_SPEC_H3 = {{ "h3" }, 1}; + static const struct alpn_spec ALPN_SPEC_H3 = { { "h3" }, 1 }; DEBUGASSERT(ctx->q.sockfd != CURL_SOCKET_BAD); DEBUGASSERT(ctx->initialized); diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index 99b19b369185..d121b993790b 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -178,12 +178,12 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, if(!cert) result = CURLE_OUT_OF_MEMORY; else if(peer->sni && - (wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, NULL) - == WOLFSSL_FAILURE)) + (wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, + NULL) == WOLFSSL_FAILURE)) result = CURLE_PEER_FAILED_VERIFICATION; else if(!peer->sni && - (wolfSSL_X509_check_ip_asc(cert, peer->hostname, 0) - == WOLFSSL_FAILURE)) + (wolfSSL_X509_check_ip_asc(cert, peer->hostname, + 0) == WOLFSSL_FAILURE)) result = CURLE_PEER_FAILED_VERIFICATION; wolfSSL_X509_free(cert); } diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index a4dea8a77c43..125c31135ed8 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -124,7 +124,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, CURLcode result = CURLE_OK; #ifdef HAVE_SENDMSG struct iovec msg_iov; - struct msghdr msg = {0}; + struct msghdr msg = { 0 }; ssize_t rv; #if defined(__linux__) && defined(UDP_SEGMENT) uint8_t msg_ctrl[32]; @@ -153,8 +153,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, } #endif - while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && - SOCKERRNO == SOCKEINTR) + while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR) ; if(!curlx_sztouz(rv, psent)) { @@ -516,7 +515,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, } curlx_strerror(SOCKERRNO, errstr, sizeof(errstr)); failf(data, "QUIC: recvmsg() unexpectedly returned %zd (errno=%d; %s)", - rc, SOCKERRNO, errstr); + rc, SOCKERRNO, errstr); result = CURLE_RECV_ERROR; goto out; } @@ -581,7 +580,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, } curlx_strerror(SOCKERRNO, errstr, sizeof(errstr)); failf(data, "QUIC: recvfrom() unexpectedly returned %zd (errno=%d; %s)", - rv, SOCKERRNO, errstr); + rv, SOCKERRNO, errstr); result = CURLE_RECV_ERROR; goto out; } diff --git a/lib/vquic/vquic_int.h b/lib/vquic/vquic_int.h index b4f2fd811680..cd8e8989d2ea 100644 --- a/lib/vquic/vquic_int.h +++ b/lib/vquic/vquic_int.h @@ -29,7 +29,7 @@ #ifdef USE_HTTP3 -#define MAX_PKT_BURST 10 +#define MAX_PKT_BURST 10 #define MAX_UDP_PAYLOAD_SIZE 1452 struct cf_quic_ctx { diff --git a/lib/vtls/apple.c b/lib/vtls/apple.c index 31108763a02a..f076caf5ffa2 100644 --- a/lib/vtls/apple.c +++ b/lib/vtls/apple.c @@ -54,31 +54,31 @@ #ifdef USE_APPLE_SECTRUST #define SSL_SYSTEM_VERIFIER -#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) \ - && MAC_OS_X_VERSION_MAX_ALLOWED >= 101400) \ - || (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \ - && __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000) +#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) && \ + MAC_OS_X_VERSION_MAX_ALLOWED >= 101400) || \ + (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \ + __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000) #define SUPPORTS_SecTrustEvaluateWithError 1 #endif -#if defined(SUPPORTS_SecTrustEvaluateWithError) \ - && ((defined(MAC_OS_X_VERSION_MIN_REQUIRED) \ - && MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) \ - || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) \ - && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)) +#if defined(SUPPORTS_SecTrustEvaluateWithError) && \ + ((defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \ + MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || \ + (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \ + __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)) #define REQUIRES_SecTrustEvaluateWithError 1 #endif -#if defined(SUPPORTS_SecTrustEvaluateWithError) \ - && !defined(HAVE_BUILTIN_AVAILABLE) \ - && !defined(REQUIRES_SecTrustEvaluateWithError) +#if defined(SUPPORTS_SecTrustEvaluateWithError) && \ + !defined(HAVE_BUILTIN_AVAILABLE) && \ + !defined(REQUIRES_SecTrustEvaluateWithError) #undef SUPPORTS_SecTrustEvaluateWithError #endif -#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) \ - && MAC_OS_X_VERSION_MAX_ALLOWED >= 100900) \ - || (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \ - && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) +#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) && \ + MAC_OS_X_VERSION_MAX_ALLOWED >= 100900) || \ + (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \ + __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) #define SUPPORTS_SecOCSP 1 #endif diff --git a/lib/vtls/cipher_suite.c b/lib/vtls/cipher_suite.c index 3726187d7fcc..58d755622070 100644 --- a/lib/vtls/cipher_suite.c +++ b/lib/vtls/cipher_suite.c @@ -157,7 +157,7 @@ struct cs_entry { }; /* !checksrc! disable COMMANOSPACE all */ -static const struct cs_entry cs_list [] = { +static const struct cs_entry cs_list[] = { /* TLS 1.3 ciphers */ #if defined(USE_MBEDTLS) || defined(USE_RUSTLS) CS_ENTRY(0x1301, TLS,AES,128,GCM,SHA256,,,), @@ -549,7 +549,7 @@ static const struct cs_entry cs_list [] = { static int cs_str_to_zip(const char *cs_str, size_t cs_len, uint8_t zip[6]) { - uint8_t indexes[8] = {0}; + uint8_t indexes[8] = { 0 }; const char *entry, *cur; const char *nxt = cs_str; const char *end = cs_str + cs_len; @@ -597,7 +597,7 @@ static int cs_str_to_zip(const char *cs_str, size_t cs_len, uint8_t zip[6]) static int cs_zip_to_str(const uint8_t zip[6], char *buf, size_t buf_size) { - uint8_t indexes[8] = {0}; + uint8_t indexes[8] = { 0 }; const char *entry; char separator = '-'; int idx, i, r; diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index e1a3731457b8..77f9177349d7 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -52,8 +52,8 @@ #define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend) #define MAX_CAFILE_SIZE 1048576 /* 1 MiB */ -#define BEGIN_CERT "-----BEGIN CERTIFICATE-----" -#define END_CERT "\n-----END CERTIFICATE-----" +#define BEGIN_CERT "-----BEGIN CERTIFICATE-----" +#define END_CERT "\n-----END CERTIFICATE-----" struct cert_chain_engine_config_win8 { DWORD cbSize; @@ -532,7 +532,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, struct Curl_easy *data) DWORD actual_len = 0; PCERT_ALT_NAME_INFO alt_name_info = NULL; DWORD alt_name_info_size = 0; - struct num_ip_data ip_blob = {0}; + struct num_ip_data ip_blob = { 0 }; bool Win8_compat; struct num_ip_data *p = &ip_blob; DWORD i; diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index f63a9fcb9928..d1329410bfc3 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -153,7 +153,7 @@ static const struct Curl_OID OIDtable[] = { { "2.16.840.1.101.3.4.2.2", "sha384" }, { "2.16.840.1.101.3.4.2.3", "sha512" }, { "1.2.840.113549.1.9.2", "unstructuredName" }, - { (const char *) NULL, (const char *) NULL } + { (const char *)NULL, (const char *)NULL } }; #endif /* WANT_EXTRACT_CERTINFO */ diff --git a/tests/libtest/cli_h2_pausing.c b/tests/libtest/cli_h2_pausing.c index 30bcfcf043a6..740c9c2226c5 100644 --- a/tests/libtest/cli_h2_pausing.c +++ b/tests/libtest/cli_h2_pausing.c @@ -174,22 +174,22 @@ static CURLcode test_cli_h2_pausing(const char *URL) handles[i].fail_write = 1; handles[i].curl = curl_easy_init(); if(!handles[i].curl || - curl_easy_setopt(handles[i].curl, CURLOPT_WRITEFUNCTION, cb) - != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_WRITEDATA, &handles[i]) - != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_FOLLOWLOCATION, 1L) - != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_VERBOSE, 1L) != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb) - != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_SSL_VERIFYPEER, 0L) - != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_RESOLVE, resolve) - != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_PIPEWAIT, 1L) != CURLE_OK || - curl_easy_setopt(handles[i].curl, CURLOPT_URL, url) != CURLE_OK) { - curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n"); + curl_easy_setopt(handles[i].curl, CURLOPT_WRITEFUNCTION, cb) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_WRITEDATA, &handles[i]) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_FOLLOWLOCATION, 1L) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_VERBOSE, 1L) != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_DEBUGFUNCTION, cli_debug_cb) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_SSL_VERIFYPEER, 0L) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_RESOLVE, resolve) + != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_PIPEWAIT, 1L) != CURLE_OK || + curl_easy_setopt(handles[i].curl, CURLOPT_URL, url) != CURLE_OK) { + curl_mfprintf(stderr, "failed configuring easy handle - bailing out\n"); res = (CURLcode)2; goto cleanup; } diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index d139ea28f772..ca1e343a8d88 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -178,8 +178,8 @@ static int my_progress_d_cb(void *userdata, #endif #ifdef USE_MBEDTLS case CURLSSLBACKEND_MBEDTLS: { - const char *version = mbedtls_ssl_get_version( - (mbedtls_ssl_context*)tls->internals); + const char *version = + mbedtls_ssl_get_version((mbedtls_ssl_context *)tls->internals); assert(version); assert(strcmp(version, "unknown")); curl_mfprintf(stderr, "[t-%zu] info mbedTLS using %s\n", @@ -190,7 +190,7 @@ static int my_progress_d_cb(void *userdata, #ifdef USE_RUSTLS case CURLSSLBACKEND_RUSTLS: { int v = rustls_connection_get_protocol_version( - (struct rustls_connection*)tls->internals); + (struct rustls_connection *)tls->internals); assert(v); curl_mfprintf(stderr, "[t-%zu] info rustls TLS version 0x%x\n", t->idx, v); @@ -514,8 +514,8 @@ static CURLcode test_cli_hx_download(const char *URL) if(!t->started) { t->curl = curl_easy_init(); if(!t->curl || - setup_hx_download(t->curl, url, t, http_version, host, share, - use_earlydata, fresh_connect)) { + setup_hx_download(t->curl, url, t, http_version, host, share, + use_earlydata, fresh_connect)) { curl_mfprintf(stderr, "[t-%zu] FAILED setup\n", i); res = (CURLcode)1; goto cleanup; diff --git a/tests/libtest/first.c b/tests/libtest/first.c index e384971c7efc..f060560371ad 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -62,7 +62,7 @@ int unitfail; /* for unittests */ int coptind; const char *coptarg; -int cgetopt(int argc, const char *const argv[], const char *optstring) +int cgetopt(int argc, const char * const argv[], const char *optstring) { static int optpos = 1; int coptopt; @@ -141,7 +141,7 @@ static void memory_tracking_init(void) } } #else -# define memory_tracking_init() Curl_nop_stmt +#define memory_tracking_init() Curl_nop_stmt #endif /* returns a hexdump in a static memory area */ diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 5fa587686b56..2ad600ef60e2 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -59,11 +59,11 @@ extern int unitfail; /* for unittests */ #define CURL_GNUC_DIAG #endif -#define test_setopt(A,B,C) \ +#define test_setopt(A, B, C) \ if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \ goto test_cleanup -#define test_multi_setopt(A,B,C) \ +#define test_multi_setopt(A, B, C) \ if((res = curl_multi_setopt((A), (B), (C))) != CURLE_OK) \ goto test_cleanup @@ -79,7 +79,7 @@ extern struct curltime tv_test_start; /* for test timing */ extern int coptind; extern const char *coptarg; -int cgetopt(int argc, const char *const argv[], const char *optstring); +int cgetopt(int argc, const char * const argv[], const char *optstring); extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc, struct timeval *tv); @@ -100,18 +100,18 @@ void ws_close(CURL *curl); ** For portability reasons TEST_ERR_* values should be less than 127. */ -#define TEST_ERR_MAJOR_BAD CURLE_OBSOLETE20 -#define TEST_ERR_RUNS_FOREVER CURLE_OBSOLETE24 -#define TEST_ERR_EASY_INIT CURLE_OBSOLETE29 -#define TEST_ERR_MULTI CURLE_OBSOLETE32 -#define TEST_ERR_NUM_HANDLES CURLE_OBSOLETE34 -#define TEST_ERR_SELECT CURLE_OBSOLETE40 -#define TEST_ERR_SUCCESS CURLE_OBSOLETE41 -#define TEST_ERR_FAILURE CURLE_OBSOLETE44 -#define TEST_ERR_USAGE CURLE_OBSOLETE46 -#define TEST_ERR_FOPEN CURLE_OBSOLETE50 -#define TEST_ERR_FSTAT CURLE_OBSOLETE51 -#define TEST_ERR_BAD_TIMEOUT CURLE_OBSOLETE57 +#define TEST_ERR_MAJOR_BAD CURLE_OBSOLETE20 +#define TEST_ERR_RUNS_FOREVER CURLE_OBSOLETE24 +#define TEST_ERR_EASY_INIT CURLE_OBSOLETE29 +#define TEST_ERR_MULTI CURLE_OBSOLETE32 +#define TEST_ERR_NUM_HANDLES CURLE_OBSOLETE34 +#define TEST_ERR_SELECT CURLE_OBSOLETE40 +#define TEST_ERR_SUCCESS CURLE_OBSOLETE41 +#define TEST_ERR_FAILURE CURLE_OBSOLETE44 +#define TEST_ERR_USAGE CURLE_OBSOLETE46 +#define TEST_ERR_FOPEN CURLE_OBSOLETE50 +#define TEST_ERR_FSTAT CURLE_OBSOLETE51 +#define TEST_ERR_BAD_TIMEOUT CURLE_OBSOLETE57 /* ** Macros for test source code readability/maintainability. @@ -144,7 +144,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_easy_init(A,Y,Z) do { \ +#define exe_easy_init(A, Y, Z) do { \ if(((A) = curl_easy_init()) == NULL) { \ curl_mfprintf(stderr, "%s:%d curl_easy_init() failed\n", (Y), (Z)); \ res = TEST_ERR_EASY_INIT; \ @@ -154,10 +154,10 @@ void ws_close(CURL *curl); #define res_easy_init(A) \ exe_easy_init((A), (__FILE__), (__LINE__)) -#define chk_easy_init(A,Y,Z) do { \ - exe_easy_init((A), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ +#define chk_easy_init(A, Y, Z) do { \ + exe_easy_init((A), (Y), (Z)); \ + if(res) \ + goto test_cleanup; \ } while(0) #define easy_init(A) \ @@ -165,7 +165,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_multi_init(A,Y,Z) do { \ +#define exe_multi_init(A, Y, Z) do { \ if(((A) = curl_multi_init()) == NULL) { \ curl_mfprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \ res = TEST_ERR_MULTI; \ @@ -175,10 +175,10 @@ void ws_close(CURL *curl); #define res_multi_init(A) \ exe_multi_init((A), (__FILE__), (__LINE__)) -#define chk_multi_init(A,Y,Z) do { \ - exe_multi_init((A), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ +#define chk_multi_init(A, Y, Z) do { \ + exe_multi_init((A), (Y), (Z)); \ + if(res) \ + goto test_cleanup; \ } while(0) #define multi_init(A) \ @@ -186,7 +186,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_easy_setopt(A,B,C,Y,Z) do { \ +#define exe_easy_setopt(A, B, C, Y, Z) do { \ CURLcode ec; \ if((ec = curl_easy_setopt((A), (B), (C))) != CURLE_OK) { \ curl_mfprintf(stderr, "%s:%d curl_easy_setopt() failed, " \ @@ -220,21 +220,21 @@ void ws_close(CURL *curl); } \ } while(0) -#define res_multi_setopt(A,B,C) \ +#define res_multi_setopt(A, B, C) \ exe_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) -#define chk_multi_setopt(A,B,C,Y,Z) do { \ +#define chk_multi_setopt(A, B, C, Y, Z) do { \ exe_multi_setopt((A), (B), (C), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } while(0) -#define multi_setopt(A,B,C) \ +#define multi_setopt(A, B, C) \ chk_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) /* ---------------------------------------------------------------- */ -#define exe_multi_add_handle(A,B,Y,Z) do { \ +#define exe_multi_add_handle(A, B, Y, Z) do { \ CURLMcode ec; \ if((ec = curl_multi_add_handle((A), (B))) != CURLM_OK) { \ curl_mfprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \ @@ -258,7 +258,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_multi_remove_handle(A,B,Y,Z) do { \ +#define exe_multi_remove_handle(A, B, Y, Z) do { \ CURLMcode ec; \ if((ec = curl_multi_remove_handle((A), (B))) != CURLM_OK) { \ curl_mfprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \ @@ -283,7 +283,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_multi_perform(A,B,Y,Z) do { \ +#define exe_multi_perform(A, B, Y, Z) do { \ CURLMcode ec; \ if((ec = curl_multi_perform((A), (B))) != CURLM_OK) { \ curl_mfprintf(stderr, "%s:%d curl_multi_perform() failed, " \ @@ -308,7 +308,7 @@ void ws_close(CURL *curl); goto test_cleanup; \ } while(0) -#define multi_perform(A,B) \ +#define multi_perform(A, B) \ chk_multi_perform((A), (B), (__FILE__), (__LINE__)) /* ---------------------------------------------------------------- */ @@ -343,7 +343,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_multi_timeout(A,B,Y,Z) do { \ +#define exe_multi_timeout(A, B, Y, Z) do { \ CURLMcode ec; \ if((ec = curl_multi_timeout((A), (B))) != CURLM_OK) { \ curl_mfprintf(stderr, "%s:%d curl_multi_timeout() failed, " \ @@ -373,7 +373,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_multi_poll(A,B,C,D,E,Y,Z) do { \ +#define exe_multi_poll(A, B, C, D, E, Y, Z) do { \ CURLMcode ec; \ if((ec = curl_multi_poll((A), (B), (C), (D), (E))) != CURLM_OK) { \ curl_mfprintf(stderr, "%s:%d curl_multi_poll() failed, " \ @@ -403,7 +403,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_multi_wakeup(A,Y,Z) do { \ +#define exe_multi_wakeup(A, Y, Z) do { \ CURLMcode ec; \ if((ec = curl_multi_wakeup((A))) != CURLM_OK) { \ curl_mfprintf(stderr, "%s:%d curl_multi_wakeup() failed, " \ @@ -460,7 +460,7 @@ void ws_close(CURL *curl); #define TEST_HANG_TIMEOUT 60 * 1000 /* global default */ -#define exe_test_timedout(T,Y,Z) do { \ +#define exe_test_timedout(T, Y, Z) do { \ timediff_t timediff = curlx_timediff_ms(curlx_now(), tv_test_start); \ if(timediff > (T)) { \ curl_mfprintf(stderr, "%s:%d ABORTING TEST, since it seems " \ @@ -490,7 +490,7 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_global_init(A,Y,Z) do { \ +#define exe_global_init(A, Y, Z) do { \ CURLcode ec; \ if((ec = curl_global_init((A))) != CURLE_OK) { \ curl_mfprintf(stderr, "%s:%d curl_global_init() failed, " \ diff --git a/tests/libtest/lib1156.c b/tests/libtest/lib1156.c index 1468b35e1cc7..bfabd4b412a3 100644 --- a/tests/libtest/lib1156.c +++ b/tests/libtest/lib1156.c @@ -34,11 +34,11 @@ */ -#define F_RESUME (1 << 0) /* resume/range. */ -#define F_HTTP416 (1 << 1) /* Server returns http code 416. */ -#define F_FAIL (1 << 2) /* Fail on error. */ -#define F_CONTENTRANGE (1 << 3) /* Server sends content-range hdr. */ -#define F_IGNOREBODY (1 << 4) /* Body should be ignored. */ +#define F_RESUME (1 << 0) /* resume/range. */ +#define F_HTTP416 (1 << 1) /* Server returns http code 416. */ +#define F_FAIL (1 << 2) /* Fail on error. */ +#define F_CONTENTRANGE (1 << 3) /* Server sends content-range hdr. */ +#define F_IGNOREBODY (1 << 4) /* Body should be ignored. */ struct testparams { unsigned int flags; /* ORed flags as above. */ diff --git a/tests/libtest/lib1506.c b/tests/libtest/lib1506.c index 8b986c59a029..a2d60e175758 100644 --- a/tests/libtest/lib1506.c +++ b/tests/libtest/lib1506.c @@ -26,7 +26,7 @@ static CURLcode test_lib1506(const char *URL) { CURLcode res = CURLE_OK; - CURL *curl[NUM_HANDLES] = {0}; + CURL *curl[NUM_HANDLES] = { 0 }; int running; CURLM *multi = NULL; size_t i; diff --git a/tests/libtest/lib1512.c b/tests/libtest/lib1512.c index 16648d7e56f4..e5c78d3e63b0 100644 --- a/tests/libtest/lib1512.c +++ b/tests/libtest/lib1512.c @@ -33,7 +33,7 @@ static CURLcode test_lib1512(const char *URL) { CURLcode res = CURLE_OK; - CURL *curl[2] = {NULL, NULL}; + CURL *curl[2] = { NULL, NULL }; const char *port = libtest_arg3; const char *address = libtest_arg2; char dnsentry[256]; diff --git a/tests/libtest/lib1514.c b/tests/libtest/lib1514.c index 0ae61d41e88e..be81c0e556e8 100644 --- a/tests/libtest/lib1514.c +++ b/tests/libtest/lib1514.c @@ -57,7 +57,7 @@ static CURLcode test_lib1514(const char *URL) static char testdata[] = "dummy"; - struct t1514_WriteThis pooh = { testdata, sizeof(testdata)-1 }; + struct t1514_WriteThis pooh = { testdata, sizeof(testdata) - 1 }; global_init(CURL_GLOBAL_ALL); diff --git a/tests/libtest/lib1520.c b/tests/libtest/lib1520.c index 076ab564d016..f6e41f16b12d 100644 --- a/tests/libtest/lib1520.c +++ b/tests/libtest/lib1520.c @@ -68,7 +68,7 @@ static CURLcode test_lib1520(const char *URL) CURLcode res; CURL *curl; struct curl_slist *rcpt_list = NULL; - struct upload_status upload_ctx = {0}; + struct upload_status upload_ctx = { 0 }; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib1537.c b/tests/libtest/lib1537.c index f521986ebc54..9d59725fcf89 100644 --- a/tests/libtest/lib1537.c +++ b/tests/libtest/lib1537.c @@ -25,8 +25,8 @@ static CURLcode test_lib1537(const char *URL) { - const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7}; + const unsigned char a[] = { 0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7 }; CURLcode res = CURLE_OK; char *ptr = NULL; int asize; diff --git a/tests/libtest/lib1541.c b/tests/libtest/lib1541.c index c39bee989cd7..f1c8c6791a9a 100644 --- a/tests/libtest/lib1541.c +++ b/tests/libtest/lib1541.c @@ -29,7 +29,7 @@ struct t1541_transfer_status { int bd_count; }; -#define KN(a) a, #a +#define KN(a) a, #a static void t1541_geterr(const char *name, CURLcode val, int lineno) { diff --git a/tests/libtest/lib1550.c b/tests/libtest/lib1550.c index b328dd27bc2a..bd9fead1eae8 100644 --- a/tests/libtest/lib1550.c +++ b/tests/libtest/lib1550.c @@ -30,9 +30,9 @@ static CURLcode test_lib1550(const char *URL) CURLM *multi; CURLcode res = CURLE_OK; static const char * const bl_servers[] = - {"Microsoft-IIS/6.0", "nginx/0.8.54", NULL}; + { "Microsoft-IIS/6.0", "nginx/0.8.54", NULL }; static const char * const bl_sites[] = - {"curl.se:443", "example.com:80", NULL}; + { "curl.se:443", "example.com:80", NULL }; global_init(CURL_GLOBAL_ALL); multi = curl_multi_init(); diff --git a/tests/libtest/lib1556.c b/tests/libtest/lib1556.c index e852bb322471..94d409295b3f 100644 --- a/tests/libtest/lib1556.c +++ b/tests/libtest/lib1556.c @@ -45,7 +45,7 @@ static CURLcode test_lib1556(const char *URL) CURLcode code; CURL *curl = NULL; CURLcode res = CURLE_OK; - struct headerinfo info = {0}; + struct headerinfo info = { 0 }; global_init(CURL_GLOBAL_ALL); diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index d080d38aa87e..deb24be9dcbc 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -1859,18 +1859,18 @@ static int get_nothing(void) return 0; } -static const struct clearurlcase clear_url_list[] ={ - {CURLUPART_SCHEME, "http", NULL, CURLUE_NO_SCHEME}, - {CURLUPART_USER, "user", NULL, CURLUE_NO_USER}, - {CURLUPART_PASSWORD, "password", NULL, CURLUE_NO_PASSWORD}, - {CURLUPART_OPTIONS, "options", NULL, CURLUE_NO_OPTIONS}, - {CURLUPART_HOST, "host", NULL, CURLUE_NO_HOST}, - {CURLUPART_ZONEID, "eth0", NULL, CURLUE_NO_ZONEID}, - {CURLUPART_PORT, "1234", NULL, CURLUE_NO_PORT}, - {CURLUPART_PATH, "/hello", "/", CURLUE_OK}, - {CURLUPART_QUERY, "a=b", NULL, CURLUE_NO_QUERY}, - {CURLUPART_FRAGMENT, "anchor", NULL, CURLUE_NO_FRAGMENT}, - {CURLUPART_URL, NULL, NULL, CURLUE_OK}, +static const struct clearurlcase clear_url_list[] = { + { CURLUPART_SCHEME, "http", NULL, CURLUE_NO_SCHEME }, + { CURLUPART_USER, "user", NULL, CURLUE_NO_USER }, + { CURLUPART_PASSWORD, "password", NULL, CURLUE_NO_PASSWORD }, + { CURLUPART_OPTIONS, "options", NULL, CURLUE_NO_OPTIONS }, + { CURLUPART_HOST, "host", NULL, CURLUE_NO_HOST }, + { CURLUPART_ZONEID, "eth0", NULL, CURLUE_NO_ZONEID }, + { CURLUPART_PORT, "1234", NULL, CURLUE_NO_PORT }, + { CURLUPART_PATH, "/hello", "/", CURLUE_OK }, + { CURLUPART_QUERY, "a=b", NULL, CURLUE_NO_QUERY }, + { CURLUPART_FRAGMENT, "anchor", NULL, CURLUE_NO_FRAGMENT }, + { CURLUPART_URL, NULL, NULL, CURLUE_OK }, }; static int clear_url(void) @@ -1935,7 +1935,7 @@ static int huge(void) memset(&bigpart[1], 'a', sizeof(bigpart) - 2); bigpart[sizeof(bigpart) - 1] = 0; - for(i = 0; i < 7; i++) { + for(i = 0; i < 7; i++) { char *partp; curl_msnprintf(total, sizeof(total), "%s://%s:%s@%s/%s?%s#%s", diff --git a/tests/libtest/lib1565.c b/tests/libtest/lib1565.c index 506959dd9083..5bc0e3465d58 100644 --- a/tests/libtest/lib1565.c +++ b/tests/libtest/lib1565.c @@ -26,7 +26,7 @@ #ifdef HAVE_PTHREAD_H #include -#define CONN_NUM 3 +#define CONN_NUM 3 #define TIME_BETWEEN_START_SECS 2 static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; diff --git a/tests/libtest/lib1597.c b/tests/libtest/lib1597.c index 0e86517eadb1..d5124a5141e9 100644 --- a/tests/libtest/lib1597.c +++ b/tests/libtest/lib1597.c @@ -36,7 +36,7 @@ static CURLcode test_lib1597(const char *URL) CURL *curl = NULL; CURLcode res = CURLE_OK; curl_version_info_data *curlinfo; - const char *const *proto; + const char * const *proto; int n; int i; static CURLcode ok = CURLE_OK; @@ -47,22 +47,22 @@ static CURLcode test_lib1597(const char *URL) static char protolist[1024]; static const struct pair prots[] = { - {"goobar", &unsup}, - {"http ", &unsup}, - {" http", &unsup}, - {"http", &httpcode}, - {"http,", &httpcode}, - {"https,", &httpscode}, - {"https,http", &httpscode}, - {"http,http", &httpcode}, - {"HTTP,HTTP", &httpcode}, - {",HTTP,HTTP", &httpcode}, - {"http,http,ft", &unsup}, - {"", &bad}, - {",,", &bad}, - {protolist, &ok}, - {"all", &ok}, - {NULL, NULL}, + { "goobar", &unsup }, + { "http ", &unsup }, + { " http", &unsup }, + { "http", &httpcode }, + { "http,", &httpcode }, + { "https,", &httpscode }, + { "https,http", &httpscode }, + { "http,http", &httpcode }, + { "HTTP,HTTP", &httpcode }, + { ",HTTP,HTTP", &httpcode }, + { "http,http,ft", &unsup }, + { "", &bad }, + { ",,", &bad }, + { protolist, &ok }, + { "all", &ok }, + { NULL, NULL }, }; (void)URL; diff --git a/tests/libtest/lib1911.c b/tests/libtest/lib1911.c index 0f88752b6fbd..9ec68749182f 100644 --- a/tests/libtest/lib1911.c +++ b/tests/libtest/lib1911.c @@ -49,9 +49,7 @@ static CURLcode test_lib1911(const char *URL) curl_mprintf("string length: %zu\n", strlen(testbuf)); - for(o = curl_easy_option_next(NULL); - o; - o = curl_easy_option_next(o)) { + for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) { if(o->type == CURLOT_STRING) { CURLcode res; /* diff --git a/tests/libtest/lib1912.c b/tests/libtest/lib1912.c index 76ba51c4479f..98623bd339f5 100644 --- a/tests/libtest/lib1912.c +++ b/tests/libtest/lib1912.c @@ -33,9 +33,7 @@ static CURLcode test_lib1912(const char *URL) int error = 0; #ifdef CURLINC_TYPECHECK_GCC_H const struct curl_easyoption *o; - for(o = curl_easy_option_next(NULL); - o; - o = curl_easy_option_next(o)) { + for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) { /* Test for mismatch OR missing typecheck macros */ if(curlcheck_long_option(o->id) != (o->type == CURLOT_LONG || o->type == CURLOT_VALUES)) { diff --git a/tests/libtest/lib1915.c b/tests/libtest/lib1915.c index adb589a8c0fb..406cea0205e7 100644 --- a/tests/libtest/lib1915.c +++ b/tests/libtest/lib1915.c @@ -97,7 +97,7 @@ static CURLcode test_lib1915(const char *URL) { CURLcode res = CURLE_OK; CURL *curl; - struct state st = {0}; + struct state st = { 0 }; global_init(CURL_GLOBAL_ALL); diff --git a/tests/libtest/lib1918.c b/tests/libtest/lib1918.c index d99563916416..1c8ccb78f984 100644 --- a/tests/libtest/lib1918.c +++ b/tests/libtest/lib1918.c @@ -30,9 +30,7 @@ static CURLcode test_lib1918(const char *URL) curl_global_init(CURL_GLOBAL_ALL); - for(o = curl_easy_option_next(NULL); - o; - o = curl_easy_option_next(o)) { + for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) { const struct curl_easyoption *ename = curl_easy_option_by_name(o->name); const struct curl_easyoption *eid = diff --git a/tests/libtest/lib1938.c b/tests/libtest/lib1938.c index b585c53c0114..b93f993a4541 100644 --- a/tests/libtest/lib1938.c +++ b/tests/libtest/lib1938.c @@ -29,7 +29,7 @@ static CURLcode test_lib1938(const char *URL) CURLcode res = TEST_ERR_MAJOR_BAD; struct curl_slist *connect_to = NULL; struct curl_slist *list = NULL; - unsigned char data[] = {0x70, 0x6f, 0x73, 0x74, 0, 0x44, 0x61, 0x74, 0x61}; + unsigned char data[] = { 0x70, 0x6f, 0x73, 0x74, 0, 0x44, 0x61, 0x74, 0x61 }; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { curl_mfprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib2032.c b/tests/libtest/lib2032.c index a9cb29857130..7dc549f84e60 100644 --- a/tests/libtest/lib2032.c +++ b/tests/libtest/lib2032.c @@ -75,7 +75,7 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) return size * nmemb; } -static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ +static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ { enum HandleState { ReadyForNewHandle, @@ -175,10 +175,9 @@ static CURLcode test_lib2032(const char *URL) /* libntlmconnect */ "handle (trying again)\n"); continue; } - state = num_handles < MAX_EASY_HANDLES ? ReadyForNewHandle - : NoMoreHandles; - curl_mfprintf(stderr, "%s:%d new state %d\n", - __FILE__, __LINE__, state); + state = + num_handles < MAX_EASY_HANDLES ? ReadyForNewHandle : NoMoreHandles; + curl_mfprintf(stderr, "%s:%d new state %d\n", __FILE__, __LINE__, state); } multi_timeout(multi, &timeout); diff --git a/tests/libtest/lib2301.c b/tests/libtest/lib2301.c index 6fb9e48618cb..70c40fa4c75f 100644 --- a/tests/libtest/lib2301.c +++ b/tests/libtest/lib2301.c @@ -46,9 +46,7 @@ static size_t t2301_write_cb(char *b, size_t size, size_t nitems, void *p) unsigned char *buffer = (unsigned char *)b; size_t i; size_t sent; - unsigned char pong[] = { - 0x8a, 0x0 - }; + unsigned char pong[] = { 0x8a, 0x0 }; size_t incoming = nitems; curl_mfprintf(stderr, "Called CURLOPT_WRITEFUNCTION with %zu bytes: ", nitems); diff --git a/tests/libtest/lib2402.c b/tests/libtest/lib2402.c index 49d87d1cd4f1..5f727f98e624 100644 --- a/tests/libtest/lib2402.c +++ b/tests/libtest/lib2402.c @@ -26,7 +26,7 @@ static CURLcode test_lib2402(const char *URL) { CURLcode res = CURLE_OK; - CURL *curl[NUM_HANDLES] = {0}; + CURL *curl[NUM_HANDLES] = { 0 }; int running; CURLM *multi = NULL; size_t i; diff --git a/tests/libtest/lib2404.c b/tests/libtest/lib2404.c index c20259744771..ef83a2509ed7 100644 --- a/tests/libtest/lib2404.c +++ b/tests/libtest/lib2404.c @@ -26,7 +26,7 @@ static CURLcode test_lib2404(const char *URL) { CURLcode res = CURLE_OK; - CURL *curl[NUM_HANDLES] = {0}; + CURL *curl[NUM_HANDLES] = { 0 }; int running; CURLM *multi = NULL; size_t i; diff --git a/tests/libtest/lib2405.c b/tests/libtest/lib2405.c index 89ab659bdd4e..7979d122e4e9 100644 --- a/tests/libtest/lib2405.c +++ b/tests/libtest/lib2405.c @@ -41,22 +41,23 @@ /* ---------------------------------------------------------------- */ -#define test_check(expected_fds) \ - if(res != CURLE_OK) { \ - curl_mfprintf(stderr, "test failed with code: %d\n", res); \ - goto test_cleanup; \ - } \ - else if(fd_count != expected_fds) { \ +#define test_check(expected_fds) \ + if(res != CURLE_OK) { \ + curl_mfprintf(stderr, "test failed with code: %d\n", res); \ + goto test_cleanup; \ + } \ + else if(fd_count != expected_fds) { \ curl_mfprintf(stderr, "Max number of waitfds: %u not as expected: %u\n", \ - fd_count, expected_fds); \ - res = TEST_ERR_FAILURE; \ - goto test_cleanup; \ + fd_count, expected_fds); \ + res = TEST_ERR_FAILURE; \ + goto test_cleanup; \ } -#define test_run_check(option, expected_fds) do { \ - res = test_run(URL, option, &fd_count); \ - test_check(expected_fds); \ -} while(0) +#define test_run_check(option, expected_fds) \ + do { \ + res = test_run(URL, option, &fd_count); \ + test_check(expected_fds); \ + } while(0) /* ---------------------------------------------------------------- */ diff --git a/tests/libtest/lib2502.c b/tests/libtest/lib2502.c index 48a8a93f0f8e..d7ab413f25a8 100644 --- a/tests/libtest/lib2502.c +++ b/tests/libtest/lib2502.c @@ -28,7 +28,7 @@ static CURLcode test_lib2502(const char *URL) { CURLcode res = CURLE_OK; - CURL *curl[NUM_HANDLES] = {0}; + CURL *curl[NUM_HANDLES] = { 0 }; int running; CURLM *multi = NULL; size_t i; diff --git a/tests/libtest/lib3207.c b/tests/libtest/lib3207.c index 8b20b311ebbf..76dcf4bac9a8 100644 --- a/tests/libtest/lib3207.c +++ b/tests/libtest/lib3207.c @@ -29,7 +29,7 @@ #include "curl_threads.h" -#define THREAD_SIZE 16 +#define THREAD_SIZE 16 #define PER_THREAD_SIZE 8 struct Ctx { diff --git a/tests/libtest/lib509.c b/tests/libtest/lib509.c index c065eb87c891..4f074da8ab32 100644 --- a/tests/libtest/lib509.c +++ b/tests/libtest/lib509.c @@ -76,8 +76,10 @@ static void custom_free(void *ptr) static CURLcode test_lib509(const char *URL) { - static const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7}; + static const unsigned char a[] = { + 0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7 + }; CURLcode res; CURL *curl; int asize; diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c index 843c5c03f0ef..379e2e70d0ba 100644 --- a/tests/libtest/lib517.c +++ b/tests/libtest/lib517.c @@ -31,130 +31,130 @@ static CURLcode test_lib517(const char *URL) }; static const struct dcheck dates[] = { - {"Sun, 06 Nov 1994 08:49:37 GMT", 784111777 }, - {"Sunday, 06-Nov-94 08:49:37 GMT", 784111777 }, - {"Sun Nov 6 08:49:37 1994", 784111777 }, - {"Sun Nov 6 8:49:37 1994", 784111777 }, - {"Sun Nov 6 8:9:37 1994", 784109377 }, - {"Sun Nov 6 008:09:37 1994", -1 }, - {"Nov Sun 6 8:9:7 1994", 784109347 }, - {"06 Nov 1994 08:49:37 GMT", 784111777 }, - {"06-Nov-94 08:49:37 GMT", 784111777 }, - {"Nov 6 08:49:37 1994", 784111777 }, - {"06 Nov 1994 08:49:37", 784111777 }, - {"06-Nov-94 08:49:37", 784111777 }, - {"1994 Nov 6 08:49:37", 784111777 }, - {"GMT 08:49:37 06-Nov-94 Sunday", 784111777 }, - {"94 6 Nov 08:49:37", 784111777 }, - {"1994 Nov 6", 784080000 }, - {"06-Nov-94", 784080000 }, - {"Sun Nov 6 94", 784080000 }, - {"1994.Nov.6", 784080000 }, - {"Sun/Nov/6/94/GMT", 784080000 }, - {"Sun, 06 Nov 1994 08:49:37 CET", 784108177 }, - {"06 Nov 1994 08:49:37 EST", 784129777 }, - {"Sun, 06 Nov 1994 08:49:37 UT", 784111777 }, - {"Sun, 12 Sep 2004 15:05:58 -0700", 1095026758 }, - {"Sat, 11 Sep 2004 21:32:11 +0200", 1094931131 }, - {"20040912 15:05:58 -0700", 1095026758 }, - {"20040911 +0200", 1094853600 }, - {"Thu, 01-Jan-1970 00:59:59 GMT", 3599 }, - {"Thu, 01-Jan-1970 01:00:00 GMT", 3600 }, - {"Sat, 15-Apr-17 21:01:22 GMT", 1492290082 }, - {"Thu, 19-Apr-2007 16:00:00 GMT", 1176998400 }, - {"Wed, 25 Apr 2007 21:02:13 GMT", 1177534933 }, - {"Thu, 19/Apr\\2007 16:00:00 GMT", 1176998400 }, - {"Fri, 1 Jan 2010 01:01:50 GMT", 1262307710 }, - {"Wednesday, 1-Jan-2003 00:00:00 GMT", 1041379200 }, - {", 1-Jan-2003 00:00:00 GMT", 1041379200 }, - {"1-Jan-2003 00:00:00 GMT", 1041379200 }, - {"1-Jan-2003 00:00:00 GMT", 1041379200 }, - {"Wed,18-Apr-07 22:50:12 GMT", 1176936612 }, - {"WillyWonka , 18-Apr-07 22:50:12 GMT", -1 }, - {"WillyWonka , 18-Apr-07 22:50:12", -1 }, - {"WillyWonka , 18-apr-07 22:50:12", -1 }, - {"Mon, 18-Apr-1977 22:50:13 GMT", 230251813 }, - {"Mon, 18-Apr-77 22:50:13 GMT", 230251813 }, - {"Sat, 15-Apr-17\"21:01:22\"GMT", 1492290082 }, - {"Partyday, 18- April-07 22:50:12", -1 }, - {"Partyday, 18 - Apri-07 22:50:12", -1 }, - {"Wednes, 1-Januar-2003 00:00:00 GMT", -1 },/* spellchecker:disable-line */ - {"Sat, 15-Apr-17 21:01:22", 1492290082 }, - {"Sat, 15-Apr-17 21:01:22 GMT-2", 1492290082 }, - {"Sat, 15-Apr-17 21:01:22 GMT BLAH", 1492290082 }, - {"Sat, 15-Apr-17 21:01:22 GMT-0400", 1492290082 }, - {"Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)", 1492290082 }, - {"Sat, 15-Apr-17 21:01:22 DST", -1 }, - {"Sat, 15-Apr-17 21:01:22 -0400", 1492304482 }, - {"Sat, 15-Apr-17 21:01:22 (hello there)", -1 }, - {"Sat, 15-Apr-17 21:01:22 11:22:33", -1 }, - {"Sat, 15-Apr-17 ::00 21:01:22", -1 }, - {"Sat, 15-Apr-17 boink:z 21:01:22", -1 }, - {"Sat, 15-Apr-17 91:22:33 21:01:22", -1 }, - {"Thu Apr 18 22:50:12 2007 GMT", 1176936612 }, - {"22:50:12 Thu Apr 18 2007 GMT", 1176936612 }, - {"Thu 22:50:12 Apr 18 2007 GMT", 1176936612 }, - {"Thu Apr 22:50:12 18 2007 GMT", 1176936612 }, - {"Thu Apr 18 22:50:12 2007 GMT", 1176936612 }, - {"Thu Apr 18 2007 22:50:12 GMT", 1176936612 }, - {"Thu Apr 18 2007 GMT 22:50:12", 1176936612 }, + { "Sun, 06 Nov 1994 08:49:37 GMT", 784111777 }, + { "Sunday, 06-Nov-94 08:49:37 GMT", 784111777 }, + { "Sun Nov 6 08:49:37 1994", 784111777 }, + { "Sun Nov 6 8:49:37 1994", 784111777 }, + { "Sun Nov 6 8:9:37 1994", 784109377 }, + { "Sun Nov 6 008:09:37 1994", -1 }, + { "Nov Sun 6 8:9:7 1994", 784109347 }, + { "06 Nov 1994 08:49:37 GMT", 784111777 }, + { "06-Nov-94 08:49:37 GMT", 784111777 }, + { "Nov 6 08:49:37 1994", 784111777 }, + { "06 Nov 1994 08:49:37", 784111777 }, + { "06-Nov-94 08:49:37", 784111777 }, + { "1994 Nov 6 08:49:37", 784111777 }, + { "GMT 08:49:37 06-Nov-94 Sunday", 784111777 }, + { "94 6 Nov 08:49:37", 784111777 }, + { "1994 Nov 6", 784080000 }, + { "06-Nov-94", 784080000 }, + { "Sun Nov 6 94", 784080000 }, + { "1994.Nov.6", 784080000 }, + { "Sun/Nov/6/94/GMT", 784080000 }, + { "Sun, 06 Nov 1994 08:49:37 CET", 784108177 }, + { "06 Nov 1994 08:49:37 EST", 784129777 }, + { "Sun, 06 Nov 1994 08:49:37 UT", 784111777 }, + { "Sun, 12 Sep 2004 15:05:58 -0700", 1095026758 }, + { "Sat, 11 Sep 2004 21:32:11 +0200", 1094931131 }, + { "20040912 15:05:58 -0700", 1095026758 }, + { "20040911 +0200", 1094853600 }, + { "Thu, 01-Jan-1970 00:59:59 GMT", 3599 }, + { "Thu, 01-Jan-1970 01:00:00 GMT", 3600 }, + { "Sat, 15-Apr-17 21:01:22 GMT", 1492290082 }, + { "Thu, 19-Apr-2007 16:00:00 GMT", 1176998400 }, + { "Wed, 25 Apr 2007 21:02:13 GMT", 1177534933 }, + { "Thu, 19/Apr\\2007 16:00:00 GMT", 1176998400 }, + { "Fri, 1 Jan 2010 01:01:50 GMT", 1262307710 }, + { "Wednesday, 1-Jan-2003 00:00:00 GMT", 1041379200 }, + { ", 1-Jan-2003 00:00:00 GMT", 1041379200 }, + { "1-Jan-2003 00:00:00 GMT", 1041379200 }, + { "1-Jan-2003 00:00:00 GMT", 1041379200 }, + { "Wed,18-Apr-07 22:50:12 GMT", 1176936612 }, + { "WillyWonka , 18-Apr-07 22:50:12 GMT", -1 }, + { "WillyWonka , 18-Apr-07 22:50:12", -1 }, + { "WillyWonka , 18-apr-07 22:50:12", -1 }, + { "Mon, 18-Apr-1977 22:50:13 GMT", 230251813 }, + { "Mon, 18-Apr-77 22:50:13 GMT", 230251813 }, + { "Sat, 15-Apr-17\"21:01:22\"GMT", 1492290082 }, + { "Partyday, 18- April-07 22:50:12", -1 }, + { "Partyday, 18 - Apri-07 22:50:12", -1 }, + { "Wednes, 1-Januar-2003 00:00:00 GMT", -1 }, + { "Sat, 15-Apr-17 21:01:22", 1492290082 }, + { "Sat, 15-Apr-17 21:01:22 GMT-2", 1492290082 }, + { "Sat, 15-Apr-17 21:01:22 GMT BLAH", 1492290082 }, + { "Sat, 15-Apr-17 21:01:22 GMT-0400", 1492290082 }, + { "Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)", 1492290082 }, + { "Sat, 15-Apr-17 21:01:22 DST", -1 }, + { "Sat, 15-Apr-17 21:01:22 -0400", 1492304482 }, + { "Sat, 15-Apr-17 21:01:22 (hello there)", -1 }, + { "Sat, 15-Apr-17 21:01:22 11:22:33", -1 }, + { "Sat, 15-Apr-17 ::00 21:01:22", -1 }, + { "Sat, 15-Apr-17 boink:z 21:01:22", -1 }, + { "Sat, 15-Apr-17 91:22:33 21:01:22", -1 }, + { "Thu Apr 18 22:50:12 2007 GMT", 1176936612 }, + { "22:50:12 Thu Apr 18 2007 GMT", 1176936612 }, + { "Thu 22:50:12 Apr 18 2007 GMT", 1176936612 }, + { "Thu Apr 22:50:12 18 2007 GMT", 1176936612 }, + { "Thu Apr 18 22:50:12 2007 GMT", 1176936612 }, + { "Thu Apr 18 2007 22:50:12 GMT", 1176936612 }, + { "Thu Apr 18 2007 GMT 22:50:12", 1176936612 }, - {"\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 }, - {"-\"22:50:12 Thu Apr 18 2007 GMT\"", 1176936612 }, - {"*\"Thu 22:50:12 Apr 18 2007 GMT\"", 1176936612 }, - {";\"Thu Apr 22:50:12 18 2007 GMT\"", 1176936612 }, - {".\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 }, - {"\"Thu Apr 18 2007 22:50:12 GMT\"", 1176936612 }, - {"\"Thu Apr 18 2007 GMT 22:50:12\"", 1176936612 }, + { "\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 }, + { "-\"22:50:12 Thu Apr 18 2007 GMT\"", 1176936612 }, + { "*\"Thu 22:50:12 Apr 18 2007 GMT\"", 1176936612 }, + { ";\"Thu Apr 22:50:12 18 2007 GMT\"", 1176936612 }, + { ".\"Thu Apr 18 22:50:12 2007 GMT\"", 1176936612 }, + { "\"Thu Apr 18 2007 22:50:12 GMT\"", 1176936612 }, + { "\"Thu Apr 18 2007 GMT 22:50:12\"", 1176936612 }, - {"Sat, 15-Apr-17 21:01:22 GMT", 1492290082 }, - {"15-Sat, Apr-17 21:01:22 GMT", 1492290082 }, - {"15-Sat, Apr 21:01:22 GMT 17", 1492290082 }, - {"15-Sat, Apr 21:01:22 GMT 2017", 1492290082 }, - {"15 Apr 21:01:22 2017", 1492290082 }, - {"15 17 Apr 21:01:22", 1492290082 }, - {"Apr 15 17 21:01:22", 1492290082 }, - {"Apr 15 21:01:22 17", 1492290082 }, - {"2017 April 15 21:01:22", -1 }, - {"15 April 2017 21:01:22", -1 }, - {"98 April 17 21:01:22", -1 }, - {"Thu, 012-Aug-2008 20:49:07 GMT", 1218574147 }, - {"Thu, 999999999999-Aug-2007 20:49:07 GMT", -1 }, - {"Thu, 12-Aug-2007 20:61:99999999999 GMT", -1 }, - {"IAintNoDateFool", -1 }, - {"Thu Apr 18 22:50 2007 GMT", 1176936600 }, - {"20110623 12:34:56", 1308832496 }, - {"20110632 12:34:56", -1 }, - {"20110623 56:34:56", -1 }, - {"20111323 12:34:56", -1 }, - {"20110623 12:34:79", -1 }, - {"Wed, 31 Dec 2008 23:59:60 GMT", 1230768000 }, - {"Wed, 31 Dec 2008 23:59:61 GMT", -1 }, - {"Wed, 31 Dec 2008 24:00:00 GMT", -1 }, - {"Wed, 31 Dec 2008 23:60:59 GMT", -1 }, - {"20110623 12:3", 1308830580 }, - {"20110623 1:3", 1308790980 }, - {"20110623 1:30", 1308792600 }, - {"20110623 12:12:3", 1308831123 }, - {"20110623 01:12:3", 1308791523 }, - {"20110623 01:99:30", -1 }, - {"Thu, 01-Jan-1970 00:00:00 GMT", 0 }, - {"Thu, 31-Dec-1969 23:59:58 GMT", -2 }, - {"Thu, 31-Dec-1969 23:59:59 GMT", 0 }, /* avoids -1 ! */ + { "Sat, 15-Apr-17 21:01:22 GMT", 1492290082 }, + { "15-Sat, Apr-17 21:01:22 GMT", 1492290082 }, + { "15-Sat, Apr 21:01:22 GMT 17", 1492290082 }, + { "15-Sat, Apr 21:01:22 GMT 2017", 1492290082 }, + { "15 Apr 21:01:22 2017", 1492290082 }, + { "15 17 Apr 21:01:22", 1492290082 }, + { "Apr 15 17 21:01:22", 1492290082 }, + { "Apr 15 21:01:22 17", 1492290082 }, + { "2017 April 15 21:01:22", -1 }, + { "15 April 2017 21:01:22", -1 }, + { "98 April 17 21:01:22", -1 }, + { "Thu, 012-Aug-2008 20:49:07 GMT", 1218574147 }, + { "Thu, 999999999999-Aug-2007 20:49:07 GMT", -1 }, + { "Thu, 12-Aug-2007 20:61:99999999999 GMT", -1 }, + { "IAintNoDateFool", -1 }, + { "Thu Apr 18 22:50 2007 GMT", 1176936600 }, + { "20110623 12:34:56", 1308832496 }, + { "20110632 12:34:56", -1 }, + { "20110623 56:34:56", -1 }, + { "20111323 12:34:56", -1 }, + { "20110623 12:34:79", -1 }, + { "Wed, 31 Dec 2008 23:59:60 GMT", 1230768000 }, + { "Wed, 31 Dec 2008 23:59:61 GMT", -1 }, + { "Wed, 31 Dec 2008 24:00:00 GMT", -1 }, + { "Wed, 31 Dec 2008 23:60:59 GMT", -1 }, + { "20110623 12:3", 1308830580 }, + { "20110623 1:3", 1308790980 }, + { "20110623 1:30", 1308792600 }, + { "20110623 12:12:3", 1308831123 }, + { "20110623 01:12:3", 1308791523 }, + { "20110623 01:99:30", -1 }, + { "Thu, 01-Jan-1970 00:00:00 GMT", 0 }, + { "Thu, 31-Dec-1969 23:59:58 GMT", -2 }, + { "Thu, 31-Dec-1969 23:59:59 GMT", 0 }, /* avoids -1 ! */ #if SIZEOF_TIME_T > 4 - {"Sun, 06 Nov 2044 08:49:37 GMT", (time_t)2362034977LL }, - {"Sun, 06 Nov 3144 08:49:37 GMT", 37074617377 }, + { "Sun, 06 Nov 2044 08:49:37 GMT", (time_t)2362034977LL }, + { "Sun, 06 Nov 3144 08:49:37 GMT", 37074617377 }, #ifndef HAVE_TIME_T_UNSIGNED - {"Sun, 06 Nov 1900 08:49:37 GMT", (time_t)-2182259423LL }, - {"Sun, 06 Nov 1800 08:49:37 GMT", -5337933023 }, - {"Thu, 01-Jan-1583 00:00:00 GMT", -12212553600 }, + { "Sun, 06 Nov 1900 08:49:37 GMT", (time_t)-2182259423LL }, + { "Sun, 06 Nov 1800 08:49:37 GMT", -5337933023 }, + { "Thu, 01-Jan-1583 00:00:00 GMT", -12212553600 }, #endif /* HAVE_TIME_T_UNSIGNED */ - {"Thu, 01-Jan-1499 00:00:00 GMT", -1 }, + { "Thu, 01-Jan-1499 00:00:00 GMT", -1 }, #else - {"Sun, 06 Nov 2044 08:49:37 GMT", -1 }, + { "Sun, 06 Nov 2044 08:49:37 GMT", -1 }, #endif /* SIZEOF_TIME_T > 4 */ #ifndef HAVE_TIME_T_UNSIGNED - {"Sun, 06 Nov 1968 08:49:37 GMT", -36342623 }, + { "Sun, 06 Nov 1968 08:49:37 GMT", -36342623 }, #endif /* !HAVE_TIME_T_UNSIGNED */ { NULL, 0 } }; diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index d785857bb1c0..5488d4db0444 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -31,8 +31,8 @@ #define T518_SAFETY_MARGIN (16) -#define NUM_OPEN (FD_SETSIZE + 10) -#define NUM_NEEDED (NUM_OPEN + T518_SAFETY_MARGIN) +#define NUM_OPEN (FD_SETSIZE + 10) +#define NUM_NEEDED (NUM_OPEN + T518_SAFETY_MARGIN) #if defined(_WIN32) || defined(MSDOS) #define DEV_NULL "NUL" diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index f32d64b3033f..4e184361362c 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -52,7 +52,6 @@ static void t530_msg(const char *msg) curl_mfprintf(stderr, "%s %s\n", t530_tag(), msg); } - struct t530_Sockets { curl_socket_t *sockets; int count; /* number of sockets actually stored in array */ @@ -285,9 +284,9 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) CURLcode res = CURLE_OK; CURL *curl = NULL; CURLM *multi = NULL; - struct t530_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; + struct t530_ReadWriteSockets sockets = { { NULL, 0, 0 }, { NULL, 0, 0 } }; int success = 0; - struct curltime timeout = {0}; + struct curltime timeout = { 0 }; timeout.tv_sec = (time_t)-1; /* set the limits */ @@ -328,7 +327,7 @@ static CURLcode testone(const char *URL, int timer_fail_at, int socket_fail_at) while(!t530_checkForCompletion(multi, &success)) { fd_set readSet, writeSet; curl_socket_t maxFd = 0; - struct timeval tv = {0}; + struct timeval tv = { 0 }; tv.tv_sec = 10; FD_ZERO(&readSet); diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index 31c5e306125a..24d166b5cc10 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -118,7 +118,7 @@ static int t537_test_rlimit(int keep_open) /* If the OS allows a HUGE number of open files, we do not run. * Modern debian sid reports a limit of 134217724 and this tests * takes minutes. */ -#define LIMIT_CAP (256 * 1024) +#define LIMIT_CAP (256 * 1024) if(rl.rlim_cur > LIMIT_CAP) { curl_mfprintf(stderr, "soft limit above %ld, not running\n", (long)LIMIT_CAP); diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c index 9938d269addc..670f45e54024 100644 --- a/tests/libtest/lib543.c +++ b/tests/libtest/lib543.c @@ -28,9 +28,10 @@ static CURLcode test_lib543(const char *URL) { static const unsigned char a[] = { - 0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1, - 0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa, - 0x1d, 0x57, 0xe1}; + 0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1, + 0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa, + 0x1d, 0x57, 0xe1 + }; CURL *curl; CURLcode res = CURLE_OK; diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c index 0d72af3042d5..77daeb5da8ea 100644 --- a/tests/libtest/lib544.c +++ b/tests/libtest/lib544.c @@ -32,7 +32,8 @@ static CURLcode test_lib544(const char *URL) 'T', 'h', 'i', 's', '\0', ' ', 'i', 's', ' ', 't', 'e', 's', 't', ' ', 'b', 'i', 'n', 'a', 'r', 'y', ' ', 'd', 'a', 't', 'a', ' ', 'w', 'i', 't', 'h', ' ', 'a', 'n', ' ', - 'e', 'm', 'b', 'e', 'd', 'd', 'e', 'd', ' ', 'N', 'U', 'L'}; + 'e', 'm', 'b', 'e', 'd', 'd', 'e', 'd', ' ', 'N', 'U', 'L' + }; char teststring[sizeof(teststring_init)]; diff --git a/tests/libtest/lib553.c b/tests/libtest/lib553.c index 4bc2568a46fd..cbf4b3013ce4 100644 --- a/tests/libtest/lib553.c +++ b/tests/libtest/lib553.c @@ -50,7 +50,7 @@ static size_t myreadfunc(char *ptr, size_t size, size_t nmemb, void *stream) return size; } -#define NUM_HEADERS 8 +#define NUM_HEADERS 8 #define SIZE_HEADERS 5000 static CURLcode test_lib553(const char *URL) diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 9c4f7f9b9f3b..edf75907322c 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -46,7 +46,7 @@ #endif #endif -#define BUFSZ 256 +#define BUFSZ 256 struct unsshort_st { unsigned short num; /* unsigned short */ @@ -1166,9 +1166,9 @@ static int test_width_precision(void) { /* 325 is max precision (and width) for a double */ char larger[1024]; -#define SPACE60 " " +#define SPACE60 " " #define SPACE300 SPACE60 SPACE60 SPACE60 SPACE60 SPACE60 -#define OK325 SPACE300 " 0" +#define OK325 SPACE300 " 0" int rc; int errors = 0; diff --git a/tests/libtest/lib558.c b/tests/libtest/lib558.c index 94dd7f57b80f..27afa3c9d30a 100644 --- a/tests/libtest/lib558.c +++ b/tests/libtest/lib558.c @@ -25,8 +25,8 @@ static CURLcode test_lib558(const char *URL) { - unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7}; + unsigned char a[] = { 0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7 }; CURLcode res = CURLE_OK; char *ptr = NULL; int asize; diff --git a/tests/libtest/lib576.c b/tests/libtest/lib576.c index 7ee7bc9525d4..ae5f5d40b359 100644 --- a/tests/libtest/lib576.c +++ b/tests/libtest/lib576.c @@ -98,7 +98,7 @@ static CURLcode test_lib576(const char *URL) { CURL *curl = NULL; CURLcode res = CURLE_OK; - struct chunk_data chunk_data = {0, 0}; + struct chunk_data chunk_data = { 0, 0 }; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(!curl) { diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index dabebed6ce8f..3940d9c4702c 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -229,9 +229,9 @@ static CURLcode test_lib582(const char *URL) int hd; struct_stat file_info; CURLM *multi = NULL; - struct t582_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; + struct t582_ReadWriteSockets sockets = { { NULL, 0, 0 }, { NULL, 0, 0 } }; int success = 0; - struct curltime timeout = {0}; + struct curltime timeout = { 0 }; timeout.tv_sec = (time_t)-1; assert(test_argc >= 5); @@ -304,7 +304,7 @@ static CURLcode test_lib582(const char *URL) while(!t582_checkForCompletion(multi, &success)) { fd_set readSet, writeSet; curl_socket_t maxFd = 0; - struct timeval tv = {0}; + struct timeval tv = { 0 }; tv.tv_sec = 10; FD_ZERO(&readSet); diff --git a/tests/libtest/lib654.c b/tests/libtest/lib654.c index 7d519d645331..37afec4f5a45 100644 --- a/tests/libtest/lib654.c +++ b/tests/libtest/lib654.c @@ -107,7 +107,7 @@ static CURLcode test_lib654(const char *URL) part = curl_mime_addpart(mime); curl_mime_filedata(part, libtest_arg2); part = curl_mime_addpart(mime); - curl_mime_data_cb(part, (curl_off_t) -1, t654_read_cb, NULL, + curl_mime_data_cb(part, (curl_off_t)-1, t654_read_cb, NULL, free_callback, &pooh); /* Bind mime data to its easy handle. */ diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index 886bf39a72bc..08dd7cfa08f9 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -23,7 +23,7 @@ ***************************************************************************/ #include "first.h" -#define PAUSE_TIME 5 +#define PAUSE_TIME 5 struct t670_ReadThis { CURL *curl; diff --git a/tests/libtest/lib678.c b/tests/libtest/lib678.c index 525407fddc37..3214694c7ddf 100644 --- a/tests/libtest/lib678.c +++ b/tests/libtest/lib678.c @@ -97,7 +97,7 @@ static CURLcode test_lib678(const char *URL) curl_global_init(CURL_GLOBAL_DEFAULT); if(!strcmp("check", URL)) { CURLcode w = CURLE_OK; - struct curl_blob blob = {0}; + struct curl_blob blob = { 0 }; CURL *curl = curl_easy_init(); if(curl) { w = curl_easy_setopt(curl, CURLOPT_CAINFO_BLOB, &blob); diff --git a/tests/libtest/lib758.c b/tests/libtest/lib758.c index fadb1db6fdd7..37bc3b0e62ec 100644 --- a/tests/libtest/lib758.c +++ b/tests/libtest/lib758.c @@ -57,8 +57,7 @@ static struct t758_ctx { static const char *t758_tag(void) { - curl_msnprintf(t758_ctx.buf, sizeof(t758_ctx.buf), - "[T758-%d-%d] [%d/%d]", + curl_msnprintf(t758_ctx.buf, sizeof(t758_ctx.buf), "[T758-%d-%d] [%d/%d]", t758_ctx.max_socket_calls, t758_ctx.max_timer_calls, t758_ctx.socket_calls, t758_ctx.timer_calls); return t758_ctx.buf; @@ -204,8 +203,8 @@ static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg) { SSL *ssl; (void)arg; - ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, - SSL_get_ex_data_X509_STORE_CTX_idx()); + ssl = (SSL *)X509_STORE_CTX_get_ex_data( + ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); t758_ctx.number_of_cert_verify_callbacks++; if(!t758_ctx.fake_async_cert_verification_pending) { t758_ctx.fake_async_cert_verification_pending = 1; @@ -222,8 +221,8 @@ static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg) } } -static CURLcode -t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *clientp) +static CURLcode t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx, + void *clientp) { SSL_CTX *ctx = (SSL_CTX *)ssl_ctx; (void)curl; @@ -333,9 +332,9 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, CURLcode res = CURLE_OK; CURL *curl = NULL; CURLM *multi = NULL; - struct t758_ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; + struct t758_ReadWriteSockets sockets = { { NULL, 0, 0 }, { NULL, 0, 0 } }; int success = 0; - struct curltime timeout = {0}; + struct curltime timeout = { 0 }; timeout.tv_sec = (time_t)-1; /* set the limits */ @@ -390,7 +389,7 @@ static CURLcode t758_one(const char *URL, int timer_fail_at, while(!t758_checkForCompletion(multi, &success)) { fd_set readSet, writeSet; curl_socket_t maxFd = 0; - struct timeval tv = {0}; + struct timeval tv = { 0 }; tv.tv_sec = 10; if(t758_ctx.fake_async_cert_verification_pending && diff --git a/tests/libtest/memptr.c b/tests/libtest/memptr.c index fe90b01a6cb1..3c383d9003e9 100644 --- a/tests/libtest/memptr.c +++ b/tests/libtest/memptr.c @@ -26,8 +26,8 @@ #ifndef CURL_STATICLIB #if defined(_MSC_VER) && defined(_DLL) -# pragma warning(push) -# pragma warning(disable:4232) /* MSVC extension, dllimport identity */ +#pragma warning(push) +#pragma warning(disable:4232) /* MSVC extension, dllimport identity */ #endif /* when libcurl is *not* static and we build libtests, the global pointers in @@ -44,7 +44,7 @@ curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)strdup; curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; #if defined(_MSC_VER) && defined(_DLL) -# pragma warning(pop) +#pragma warning(pop) #endif #endif /* !CURL_STATICLIB */ diff --git a/tests/server/dnsd.c b/tests/server/dnsd.c index 58bbd2f3f88c..eaf56b03fbe6 100644 --- a/tests/server/dnsd.c +++ b/tests/server/dnsd.c @@ -59,8 +59,8 @@ static int qname(const unsigned char **pkt, size_t *size) return 0; } -#define QTYPE_A 1 -#define QTYPE_AAAA 28 +#define QTYPE_A 1 +#define QTYPE_AAAA 28 #define QTYPE_HTTPS 0x41 static const char *type2string(unsigned short qtype) @@ -497,8 +497,7 @@ static int test_dnsd(int argc, char **argv) } flag = 1; - if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag))) { + if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); diff --git a/tests/server/getpart.c b/tests/server/getpart.c index becde4a9bb06..d76368e016a4 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -243,7 +243,7 @@ static int decodedata(char **buf, /* dest buffer */ int getpart(char **outbuf, size_t *outlen, const char *main, const char *sub, FILE *stream) { -# define MAX_TAG_LEN 200 +#define MAX_TAG_LEN 200 char curouter[MAX_TAG_LEN + 1]; /* current outermost section */ char curmain[MAX_TAG_LEN + 1]; /* current main section */ char cursub[MAX_TAG_LEN + 1]; /* current sub section */ diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index 081b038d075b..64ba64dc69ad 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -55,7 +55,7 @@ struct mqttd_configurable { int testnum; }; -#define REQUEST_DUMP "server.input" +#define REQUEST_DUMP "server.input" #define CONFIG_VERSION 5 static struct mqttd_configurable m_config; @@ -152,7 +152,6 @@ static void logprotocol(mqttdir dir, prefix, (int)remlen, data); } - /* return 0 on success */ static int connack(FILE *dump, curl_socket_t fd) { @@ -179,7 +178,7 @@ static int connack(FILE *dump, curl_socket_t fd) /* return 0 on success */ static int suback(FILE *dump, curl_socket_t fd, unsigned short packetid) { - unsigned char packet[]={ + unsigned char packet[] = { MQTT_MSG_SUBACK, 0x03, 0, 0, /* filled in below */ 0x00 @@ -202,7 +201,7 @@ static int suback(FILE *dump, curl_socket_t fd, unsigned short packetid) /* return 0 on success */ static int puback(FILE *dump, curl_socket_t fd, unsigned short packetid) { - unsigned char packet[]={ + unsigned char packet[] = { MQTT_MSG_PUBACK, 0x00, 0, 0 /* filled in below */ }; @@ -225,7 +224,7 @@ static int puback(FILE *dump, curl_socket_t fd, unsigned short packetid) /* return 0 on success */ static int disconnect(FILE *dump, curl_socket_t fd) { - unsigned char packet[]={ + unsigned char packet[] = { MQTT_MSG_DISCONNECT, 0x00, }; ssize_t rc = swrite(fd, (char *)packet, sizeof(packet)); @@ -364,7 +363,7 @@ static int publish(FILE *dump, return 1; } -#define MAX_TOPIC_LENGTH 65535 +#define MAX_TOPIC_LENGTH 65535 #define MAX_CLIENT_ID_LENGTH 32 static char topic[MAX_TOPIC_LENGTH + 1]; diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 842562394058..6c7aa1e9d023 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -88,10 +88,10 @@ struct rtspd_httprequest { #define RESPONSE_DUMP "server.response" /* very-big-path support */ -#define MAXDOCNAMELEN 140000 +#define MAXDOCNAMELEN 140000 #define MAXDOCNAMELEN_TXT "139999" -#define REQUEST_KEYWORD_SIZE 256 +#define REQUEST_KEYWORD_SIZE 256 #define REQUEST_KEYWORD_SIZE_TXT "255" #define CMD_AUTH_REQUIRED "auth_required" @@ -110,14 +110,15 @@ static const char *docquit_rtsp = "HTTP/1.1 200 Goodbye" END_OF_HEADERS; /* sent as reply to a CONNECT */ static const char *docconnect = -"HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS; + "HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS; /* sent as reply to a "bad" CONNECT */ static const char *docbadconnect = -"HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS; + "HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS; /* send back this on HTTP 404 file not found */ -static const char *doc404_HTTP = "HTTP/1.1 404 Not Found\r\n" +static const char *doc404_HTTP = + "HTTP/1.1 404 Not Found\r\n" "Server: " RTSPDVERSION "\r\n" "Connection: close\r\n" "Content-Type: text/html" @@ -128,7 +129,8 @@ static const char *doc404_HTTP = "HTTP/1.1 404 Not Found\r\n" "\n" "

Not Found

\n" "The requested URL was not found on this server.\n" - "


" RTSPDVERSION "
\n" "\n"; + "


" RTSPDVERSION "
\n" + "\n"; /* send back this on RTSP 404 file not found */ static const char *doc404_RTSP = "RTSP/1.0 404 Not Found\r\n" @@ -1021,8 +1023,7 @@ static int test_rtspd(int argc, char *argv[]) curl_off_t num; if(!strcmp("--version", argv[arg])) { printf("rtspd IPv4%s" - "\n" - , + "\n", #ifdef USE_IPV6 "/IPv6" #else diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 9560a3967646..db0261bf144d 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -173,7 +173,7 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count) /* On Windows, we sometimes get this for a broken pipe, seemingly * when the client just closed stdin? */ -#define CURL_WIN32_EPIPE 109 +#define CURL_WIN32_EPIPE 109 /* * fullread is a wrapper around the read() function. This will repeat the call @@ -888,7 +888,6 @@ static bool disc_handshake(void) logmsg("Throwing away data bytes"); if(!read_data_block(buffer, sizeof(buffer), &buffer_len)) return FALSE; - } else if(!memcmp("QUIT", buffer, 4)) { /* just die */ @@ -1339,31 +1338,31 @@ static int test_sockfilt(int argc, char *argv[]) /* Active mode, we should connect to the given port number */ mode = ACTIVE; switch(socket_domain) { - case AF_INET: - memset(&me.sa4, 0, sizeof(me.sa4)); - me.sa4.sin_family = AF_INET; - me.sa4.sin_port = htons(server_connectport); - me.sa4.sin_addr.s_addr = INADDR_ANY; - if(!addr) - addr = "127.0.0.1"; - curlx_inet_pton(AF_INET, addr, &me.sa4.sin_addr); - - rc = connect(sock, &me.sa, sizeof(me.sa4)); - break; + case AF_INET: + memset(&me.sa4, 0, sizeof(me.sa4)); + me.sa4.sin_family = AF_INET; + me.sa4.sin_port = htons(server_connectport); + me.sa4.sin_addr.s_addr = INADDR_ANY; + if(!addr) + addr = "127.0.0.1"; + curlx_inet_pton(AF_INET, addr, &me.sa4.sin_addr); + + rc = connect(sock, &me.sa, sizeof(me.sa4)); + break; #ifdef USE_IPV6 - case AF_INET6: - memset(&me.sa6, 0, sizeof(me.sa6)); - me.sa6.sin6_family = AF_INET6; - me.sa6.sin6_port = htons(server_connectport); - if(!addr) - addr = "::1"; - curlx_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr); - - rc = connect(sock, &me.sa, sizeof(me.sa6)); - break; + case AF_INET6: + memset(&me.sa6, 0, sizeof(me.sa6)); + me.sa6.sin6_family = AF_INET6; + me.sa6.sin6_port = htons(server_connectport); + if(!addr) + addr = "::1"; + curlx_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr); + + rc = connect(sock, &me.sa, sizeof(me.sa6)); + break; #endif /* USE_IPV6 */ - default: - rc = 1; + default: + rc = 1; } if(rc) { error = SOCKERRNO; diff --git a/tests/server/socksd.c b/tests/server/socksd.c index f9fadd211328..99adb727fb9d 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -76,15 +76,15 @@ struct socksd_configurable { char password[256]; }; -#define CONFIG_VERSION 5 -#define CONFIG_NMETHODS_MIN 1 /* unauth, gssapi, auth */ -#define CONFIG_NMETHODS_MAX 3 +#define CONFIG_VERSION 5 +#define CONFIG_NMETHODS_MIN 1 /* unauth, gssapi, auth */ +#define CONFIG_NMETHODS_MAX 3 #define CONFIG_RESPONSEVERSION CONFIG_VERSION -#define CONFIG_RESPONSEMETHOD 0 /* no auth */ -#define CONFIG_REQCMD 1 /* CONNECT */ -#define CONFIG_PORT backendport -#define CONFIG_ADDR backendaddr -#define CONFIG_CONNECTREP 0 +#define CONFIG_RESPONSEMETHOD 0 /* no auth */ +#define CONFIG_REQCMD 1 /* CONNECT */ +#define CONFIG_PORT backendport +#define CONFIG_ADDR backendaddr +#define CONFIG_CONNECTREP 0 static struct socksd_configurable s_config; @@ -185,24 +185,24 @@ static void socksd_getconfig(void) } /* RFC 1928, SOCKS5 byte index */ -#define SOCKS5_VERSION 0 +#define SOCKS5_VERSION 0 #define SOCKS5_NMETHODS 1 /* number of methods that is listed */ /* in the request: */ -#define SOCKS5_REQCMD 1 +#define SOCKS5_REQCMD 1 #define SOCKS5_RESERVED 2 -#define SOCKS5_ATYP 3 -#define SOCKS5_DSTADDR 4 +#define SOCKS5_ATYP 3 +#define SOCKS5_DSTADDR 4 /* connect response */ -#define SOCKS5_REP 1 +#define SOCKS5_REP 1 #define SOCKS5_BNDADDR 4 /* auth request */ -#define SOCKS5_ULEN 1 +#define SOCKS5_ULEN 1 #define SOCKS5_UNAME 2 -#define SOCKS4_CD 1 +#define SOCKS4_CD 1 #define SOCKS4_DSTPORT 2 /* connect to a given IPv4 address, not the one asked for */ diff --git a/tests/server/sws.c b/tests/server/sws.c index 13f745546983..56135a832636 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -104,10 +104,10 @@ static size_t num_sockets = 0; static const char *cmdfile = "log/server.cmd"; /* very-big-path support */ -#define MAXDOCNAMELEN 140000 +#define MAXDOCNAMELEN 140000 #define MAXDOCNAMELEN_TXT "139999" -#define REQUEST_KEYWORD_SIZE 256 +#define REQUEST_KEYWORD_SIZE 256 #define REQUEST_KEYWORD_SIZE_TXT "255" #define CMD_AUTH_REQUIRED "auth_required" @@ -141,7 +141,8 @@ static const char *end_of_headers = END_OF_HEADERS; static const char *docquit_sws = "HTTP/1.1 200 Goodbye" END_OF_HEADERS; /* send back this on 404 file not found */ -static const char *doc404 = "HTTP/1.1 404 Not Found\r\n" +static const char *doc404 = + "HTTP/1.1 404 Not Found\r\n" "Server: " SWSVERSION "\r\n" "Connection: close\r\n" "Content-Type: text/html" @@ -152,7 +153,8 @@ static const char *doc404 = "HTTP/1.1 404 Not Found\r\n" "\n" "

Not Found

\n" "The requested URL was not found on this server.\n" - "


" SWSVERSION "
\n" "\n"; + "


" SWSVERSION "
\n" + "\n"; /* work around for handling trailing headers */ static int already_recv_zeroed_chunk = FALSE; @@ -332,8 +334,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) char *httppath = NULL; size_t npath = 0; /* httppath length */ - if(sscanf(line, - "%" REQUEST_KEYWORD_SIZE_TXT "s ", request) == 1) { + if(sscanf(line, "%" REQUEST_KEYWORD_SIZE_TXT "s ", request) == 1) { http = strstr(line + strlen(request), "HTTP/"); if(http && sscanf(http, "HTTP/%d.%d", &prot_major, &prot_minor) == 2) { @@ -833,7 +834,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) int rc; fd_set input; fd_set output; - struct timeval timeout = {0}; + struct timeval timeout = { 0 }; timeout.tv_sec = 1; /* 1000 ms */ logmsg("Got EAGAIN from sread"); @@ -1318,7 +1319,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port) error = SOCKERRNO; if((error == SOCKEINPROGRESS) || (error == SOCKEWOULDBLOCK)) { fd_set output; - struct timeval timeout = {0}; + struct timeval timeout = { 0 }; timeout.tv_sec = 1; /* 1000 ms */ FD_ZERO(&output); @@ -1386,8 +1387,8 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port) #define data_or_ctrl(x) ((x) ? "DATA" : "CTRL") -#define SWS_CTRL 0 -#define SWS_DATA 1 +#define SWS_CTRL 0 +#define SWS_DATA 1 static void http_connect(curl_socket_t *infdp, curl_socket_t rootfd, @@ -1395,10 +1396,10 @@ static void http_connect(curl_socket_t *infdp, unsigned short ipport, int keepalive_secs) { - curl_socket_t serverfd[2] = {CURL_SOCKET_BAD, CURL_SOCKET_BAD}; - curl_socket_t clientfd[2] = {CURL_SOCKET_BAD, CURL_SOCKET_BAD}; - ssize_t toc[2] = {0, 0}; /* number of bytes to client */ - ssize_t tos[2] = {0, 0}; /* number of bytes to server */ + curl_socket_t serverfd[2] = { CURL_SOCKET_BAD, CURL_SOCKET_BAD }; + curl_socket_t clientfd[2] = { CURL_SOCKET_BAD, CURL_SOCKET_BAD }; + ssize_t toc[2] = { 0, 0 }; /* number of bytes to client */ + ssize_t tos[2] = { 0, 0 }; /* number of bytes to server */ char readclient[2][256]; char readserver[2][256]; bool poll_client_rd[2] = { TRUE, TRUE }; @@ -1441,7 +1442,7 @@ static void http_connect(curl_socket_t *infdp, fd_set output; ssize_t rc; curl_socket_t maxfd = (curl_socket_t)-1; - struct timeval timeout = {0}; + struct timeval timeout = { 0 }; timeout.tv_sec = 1; /* 1000 ms */ FD_ZERO(&input); @@ -2176,8 +2177,7 @@ static int test_sws(int argc, char *argv[]) } flag = 1; - if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag))) { + if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", error, curlx_strerror(error, errbuf, sizeof(errbuf))); @@ -2314,7 +2314,7 @@ static int test_sws(int argc, char *argv[]) fd_set output; curl_socket_t maxfd = (curl_socket_t)-1; int active; - struct timeval timeout = {0}; + struct timeval timeout = { 0 }; timeout.tv_usec = 250000L; /* 250 ms */ /* Clear out closed sockets */ @@ -2458,7 +2458,7 @@ static int test_sws(int argc, char *argv[]) for(socket_idx = 1; socket_idx < num_sockets; ++socket_idx) if((all_sockets[socket_idx] != sock) && - (all_sockets[socket_idx] != CURL_SOCKET_BAD)) + (all_sockets[socket_idx] != CURL_SOCKET_BAD)) sclose(all_sockets[socket_idx]); if(sock != CURL_SOCKET_BAD) diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 99c008031eab..d1867e7c872b 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -70,8 +70,8 @@ #include /***************************************************************************** -* This is a rewrite/clone of the arpa/tftp.h file for systems without it. * -*****************************************************************************/ + * This is a rewrite/clone of the arpa/tftp.h file for systems without it. * + *****************************************************************************/ #define SEGSIZE 512 /* data segment size */ #if defined(__GNUC__) && ((__GNUC__ >= 3) || \ @@ -105,8 +105,8 @@ struct tftphdr { #define TFTP_ENOUSER 7 /***************************************************************************** -* STRUCT DECLARATIONS AND DEFINES * -*****************************************************************************/ + * STRUCT DECLARATIONS AND DEFINES * + *****************************************************************************/ #ifndef PKTSIZE #define PKTSIZE (SEGSIZE + 4) /* SEGSIZE defined in arpa/tftp.h */ @@ -157,13 +157,13 @@ struct bf { #define opcode_ACK 4 #define opcode_ERROR 5 -#define TIMEOUT 5 +#define TIMEOUT 5 -#define REQUEST_DUMP "server.input" +#define REQUEST_DUMP "server.input" /***************************************************************************** -* GLOBAL VARIABLES * -*****************************************************************************/ + * GLOBAL VARIABLES * + *****************************************************************************/ static struct errmsg errmsgs[] = { { TFTP_EUNDEF, "Undefined error code" }, @@ -212,8 +212,8 @@ static const unsigned int rexmtval = TIMEOUT; #endif /***************************************************************************** -* FUNCTION PROTOTYPES * -*****************************************************************************/ + * FUNCTION PROTOTYPES * + *****************************************************************************/ static struct tftphdr *rw_init(int); @@ -249,8 +249,8 @@ static void justtimeout(int signum); #endif /* HAVE_ALARM && SIGALRM */ /***************************************************************************** -* FUNCTION IMPLEMENTATIONS * -*****************************************************************************/ + * FUNCTION IMPLEMENTATIONS * + *****************************************************************************/ #if defined(HAVE_ALARM) && defined(SIGALRM) @@ -482,9 +482,8 @@ static ssize_t write_behind(struct testcase *test, int convert) if(prevchar == '\r') { /* if prev char was cr */ if(c == '\n') /* if have cr,lf then just */ lseek(test->ofile, -1, SEEK_CUR); /* smash lf on top of the cr */ - else - if(c == '\0') /* if have cr,nul then */ - goto skipit; /* just skip over the putc */ + else if(c == '\0') /* if have cr,nul then */ + goto skipit; /* just skip over the putc */ /* else just fall through and allow it */ } /* formerly @@ -1204,8 +1203,7 @@ static void sendtftp(struct testcase *test, const struct formats *pf) (void)sigsetjmp(timeoutbuf, 1); #endif if(test->writedelay) { - logmsg("Pausing %d seconds before %d bytes", test->writedelay, - size); + logmsg("Pausing %d seconds before %d bytes", test->writedelay, size); curlx_wait_ms(1000 * test->writedelay); } @@ -1299,7 +1297,7 @@ static void recvtftp(struct testcase *test, const struct formats *pf) #endif if(got_exit_signal) goto abort; - if(n < 0) { /* really? */ + if(n < 0) { /* really? */ logmsg("read: fail"); goto abort; } @@ -1313,13 +1311,13 @@ static void recvtftp(struct testcase *test, const struct formats *pf) } /* Re-synchronize with the other side */ (void)synchnet(peer); - if(rdp->th_block == (recvblock-1)) + if(rdp->th_block == (recvblock - 1)) goto send_ack; /* rexmit */ } } size = writeit(test, &rdp, (int)(n - 4), pf->f_convert); - if(size != (n-4)) { /* ahem */ + if(size != (n - 4)) { /* ahem */ if(size < 0) nak(errno + 100); else diff --git a/tests/unit/unit1300.c b/tests/unit/unit1300.c index 53da9dd4f661..5fae379dced8 100644 --- a/tests/unit/unit1300.c +++ b/tests/unit/unit1300.c @@ -108,7 +108,7 @@ static CURLcode test_unit1300(const char *arg) Curl_llist_insert_next(&llist, Curl_llist_head(&llist), &unusedData_case3, &case3_list); fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == - &unusedData_case3, + &unusedData_case3, "the node next to head is not getting set correctly"); fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) == &unusedData_case3, "the list tail is not getting set correctly"); @@ -125,7 +125,7 @@ static CURLcode test_unit1300(const char *arg) Curl_llist_insert_next(&llist, Curl_llist_head(&llist), &unusedData_case2, &case2_list); fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == - &unusedData_case2, + &unusedData_case2, "the node next to head is not getting set correctly"); /* better safe than sorry, check that the tail is not corrupted */ fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) != &unusedData_case2, @@ -149,7 +149,7 @@ static CURLcode test_unit1300(const char *arg) Curl_node_remove(Curl_llist_head(&llist)); - fail_unless(Curl_llist_count(&llist) == (llist_size-1), + fail_unless(Curl_llist_count(&llist) == (llist_size - 1), "llist size not decremented as expected"); fail_unless(Curl_llist_head(&llist) == element_next, "llist new head not modified properly"); @@ -243,7 +243,7 @@ static CURLcode test_unit1300(const char *arg) */ Curl_llist_append(&llist, &unusedData_case2, &case2_list); fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == - &unusedData_case2, + &unusedData_case2, "the node next to head is not getting set correctly"); fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) == &unusedData_case2, "the list tail is not getting set correctly"); @@ -258,7 +258,7 @@ static CURLcode test_unit1300(const char *arg) */ Curl_llist_append(&llist, &unusedData_case3, &case3_list); fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == - &unusedData_case2, + &unusedData_case2, "the node next to head did not stay the same"); fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) == &unusedData_case3, "the list tail is not getting set correctly"); diff --git a/tests/unit/unit1302.c b/tests/unit/unit1302.c index 157f1f61ed9c..5fb3d5c6367a 100644 --- a/tests/unit/unit1302.c +++ b/tests/unit/unit1302.c @@ -41,87 +41,87 @@ static CURLcode test_unit1302(const char *arg) /* common base64 encoding */ struct etest encode[] = { - {"iiiiii", 1, "aQ==", 4 }, - {"iiiiii", 2, "aWk=", 4 }, - {"iiiiii", 3, "aWlp", 4 }, - {"iiiiii", 4, "aWlpaQ==", 8 }, - {"iiiiii", 5, "aWlpaWk=", 8 }, - {"iiiiii", 6, "aWlpaWlp", 8 }, - {"iiiiiii", 7, "aWlpaWlpaQ==", 12 }, - {"iiiiiiii", 8, "aWlpaWlpaWk=", 12 }, - {"iiiiiiiii", 9, "aWlpaWlpaWlp", 12 }, - {"iiiiiiiiii", 10, "aWlpaWlpaWlpaQ==", 16 }, - {"iiiiiiiiiii", 11, "aWlpaWlpaWlpaWk=", 16 }, - {"iiiiiiiiiiii", 12, "aWlpaWlpaWlpaWlp", 16 }, - {"\xff\x01\xfe\x02", 4, "/wH+Ag==", 8 }, - {"\xff\xff\xff\xff", 4, "/////w==", 8 }, - {"\x00\x00\x00\x00", 4, "AAAAAA==", 8 }, - {"\x00\x00\x00\x00", 1, "AA==", 4 }, + { "iiiiii", 1, "aQ==", 4 }, + { "iiiiii", 2, "aWk=", 4 }, + { "iiiiii", 3, "aWlp", 4 }, + { "iiiiii", 4, "aWlpaQ==", 8 }, + { "iiiiii", 5, "aWlpaWk=", 8 }, + { "iiiiii", 6, "aWlpaWlp", 8 }, + { "iiiiiii", 7, "aWlpaWlpaQ==", 12 }, + { "iiiiiiii", 8, "aWlpaWlpaWk=", 12 }, + { "iiiiiiiii", 9, "aWlpaWlpaWlp", 12 }, + { "iiiiiiiiii", 10, "aWlpaWlpaWlpaQ==", 16 }, + { "iiiiiiiiiii", 11, "aWlpaWlpaWlpaWk=", 16 }, + { "iiiiiiiiiiii", 12, "aWlpaWlpaWlpaWlp", 16 }, + { "\xff\x01\xfe\x02", 4, "/wH+Ag==", 8 }, + { "\xff\xff\xff\xff", 4, "/////w==", 8 }, + { "\x00\x00\x00\x00", 4, "AAAAAA==", 8 }, + { "\x00\x00\x00\x00", 1, "AA==", 4 }, }; /* base64 URL encoding */ struct etest url[] = { - {"", 0, "", 0 }, - {"iiiiiiiiiii", 1, "aQ", 2 }, - {"iiiiiiiiiii", 2, "aWk", 3 }, - {"iiiiiiiiiii", 3, "aWlp", 4 }, - {"iiiiiiiiiii", 4, "aWlpaQ", 6 }, - {"iiiiiiiiiii", 5, "aWlpaWk", 7 }, - {"iiiiiiiiiii", 6, "aWlpaWlp", 8 }, - {"iiiiiiiiiii", 7, "aWlpaWlpaQ", 10 }, - {"iiiiiiiiiii", 8, "aWlpaWlpaWk", 11 }, - {"iiiiiiiiiii", 9, "aWlpaWlpaWlp", 12 }, - {"iiiiiiiiiii", 10, "aWlpaWlpaWlpaQ", 14 }, - {"iiiiiiiiiii", 11, "aWlpaWlpaWlpaWk", 15 }, - {"iiiiiiiiiiii", 12, "aWlpaWlpaWlpaWlp", 16 }, - {"\xff\x01\xfe\x02", 4, "_wH-Ag", 6 }, - {"\xff\xff\xff\xff", 4, "_____w", 6 }, - {"\xff\x00\xff\x00", 4, "_wD_AA", 6 }, - {"\x00\xff\x00\xff", 4, "AP8A_w", 6 }, - {"\x00\x00\x00\x00", 4, "AAAAAA", 6 }, - {"\x00", 1, "AA", 2 }, - {"\x01", 1, "AQ", 2 }, - {"\x02", 1, "Ag", 2 }, - {"\x03", 1, "Aw", 2 }, - {"\x04", 1, "BA", 2 }, /* spellchecker:disable-line */ - {"\x05", 1, "BQ", 2 }, - {"\x06", 1, "Bg", 2 }, - {"\x07", 1, "Bw", 2 }, - {"\x08", 1, "CA", 2 }, - {"\x09", 1, "CQ", 2 }, - {"\x0a", 1, "Cg", 2 }, - {"\x0b", 1, "Cw", 2 }, - {"\x0c", 1, "DA", 2 }, - {"\x0d", 1, "DQ", 2 }, - {"\x0e", 1, "Dg", 2 }, - {"\x0f", 1, "Dw", 2 }, - {"\x10", 1, "EA", 2 }, + { "", 0, "", 0 }, + { "iiiiiiiiiii", 1, "aQ", 2 }, + { "iiiiiiiiiii", 2, "aWk", 3 }, + { "iiiiiiiiiii", 3, "aWlp", 4 }, + { "iiiiiiiiiii", 4, "aWlpaQ", 6 }, + { "iiiiiiiiiii", 5, "aWlpaWk", 7 }, + { "iiiiiiiiiii", 6, "aWlpaWlp", 8 }, + { "iiiiiiiiiii", 7, "aWlpaWlpaQ", 10 }, + { "iiiiiiiiiii", 8, "aWlpaWlpaWk", 11 }, + { "iiiiiiiiiii", 9, "aWlpaWlpaWlp", 12 }, + { "iiiiiiiiiii", 10, "aWlpaWlpaWlpaQ", 14 }, + { "iiiiiiiiiii", 11, "aWlpaWlpaWlpaWk", 15 }, + { "iiiiiiiiiiii", 12, "aWlpaWlpaWlpaWlp", 16 }, + { "\xff\x01\xfe\x02", 4, "_wH-Ag", 6 }, + { "\xff\xff\xff\xff", 4, "_____w", 6 }, + { "\xff\x00\xff\x00", 4, "_wD_AA", 6 }, + { "\x00\xff\x00\xff", 4, "AP8A_w", 6 }, + { "\x00\x00\x00\x00", 4, "AAAAAA", 6 }, + { "\x00", 1, "AA", 2 }, + { "\x01", 1, "AQ", 2 }, + { "\x02", 1, "Ag", 2 }, + { "\x03", 1, "Aw", 2 }, + { "\x04", 1, "BA", 2 }, /* spellchecker:disable-line */ + { "\x05", 1, "BQ", 2 }, + { "\x06", 1, "Bg", 2 }, + { "\x07", 1, "Bw", 2 }, + { "\x08", 1, "CA", 2 }, + { "\x09", 1, "CQ", 2 }, + { "\x0a", 1, "Cg", 2 }, + { "\x0b", 1, "Cw", 2 }, + { "\x0c", 1, "DA", 2 }, + { "\x0d", 1, "DQ", 2 }, + { "\x0e", 1, "Dg", 2 }, + { "\x0f", 1, "Dw", 2 }, + { "\x10", 1, "EA", 2 }, }; /* bad decode inputs */ struct etest badecode[] = { - {"", 0, "", 0 }, /* no dats means error */ - {"", 0, "a", 1 }, /* data is too short */ - {"", 0, "aQ", 2 }, /* data is too short */ - {"", 0, "aQ=", 3 }, /* data is too short */ - {"", 0, "====", 1 }, /* data is only padding characters */ - {"", 0, "====", 2 }, /* data is only padding characters */ - {"", 0, "====", 3 }, /* data is only padding characters */ - {"", 0, "====", 4 }, /* data is only padding characters */ - {"", 0, "a===", 4 }, /* contains three padding characters */ - {"", 0, "a=Q=", 4 }, /* contains a padding character mid input */ - {"", 0, "aWlpa=Q=", 8 }, /* contains a padding character mid input */ - {"", 0, "a\x1f==", 4 }, /* contains illegal base64 character */ - {"", 0, "abcd ", 5 }, /* contains illegal base64 character */ - {"", 0, "abcd ", 6 }, /* contains illegal base64 character */ - {"", 0, " abcd", 5 }, /* contains illegal base64 character */ - {"", 0, "_abcd", 5 }, /* contains illegal base64 character */ - {"", 0, "abcd-", 5 }, /* contains illegal base64 character */ - {"", 0, "abcd_", 5 }, /* contains illegal base64 character */ - {"", 0, "aWlpaWlpaQ==-", 17}, /* bad character after padding */ - {"", 0, "aWlpaWlpaQ==_", 17}, /* bad character after padding */ - {"", 0, "aWlpaWlpaQ== ", 17}, /* bad character after padding */ - {"", 0, "aWlpaWlpaQ=", 15} /* unaligned size, missing a padding char */ + { "", 0, "", 0 }, /* no dats means error */ + { "", 0, "a", 1 }, /* data is too short */ + { "", 0, "aQ", 2 }, /* data is too short */ + { "", 0, "aQ=", 3 }, /* data is too short */ + { "", 0, "====", 1 }, /* data is only padding characters */ + { "", 0, "====", 2 }, /* data is only padding characters */ + { "", 0, "====", 3 }, /* data is only padding characters */ + { "", 0, "====", 4 }, /* data is only padding characters */ + { "", 0, "a===", 4 }, /* contains three padding characters */ + { "", 0, "a=Q=", 4 }, /* contains a padding character mid input */ + { "", 0, "aWlpa=Q=", 8 }, /* contains a padding character mid input */ + { "", 0, "a\x1f==", 4 }, /* contains illegal base64 character */ + { "", 0, "abcd ", 5 }, /* contains illegal base64 character */ + { "", 0, "abcd ", 6 }, /* contains illegal base64 character */ + { "", 0, " abcd", 5 }, /* contains illegal base64 character */ + { "", 0, "_abcd", 5 }, /* contains illegal base64 character */ + { "", 0, "abcd-", 5 }, /* contains illegal base64 character */ + { "", 0, "abcd_", 5 }, /* contains illegal base64 character */ + { "", 0, "aWlpaWlpaQ==-", 17 }, /* bad character after padding */ + { "", 0, "aWlpaWlpaQ==_", 17 }, /* bad character after padding */ + { "", 0, "aWlpaWlpaQ== ", 17 }, /* bad character after padding */ + { "", 0, "aWlpaWlpaQ=", 15 } /* unaligned size, missing a padding char */ }; for(i = 0; i < CURL_ARRAYSIZE(encode); i++) { @@ -161,7 +161,7 @@ static CURLcode test_unit1302(const char *arg) Curl_safefree(decoded); } - for(i = 0 ; i < CURL_ARRAYSIZE(url); i++) { + for(i = 0; i < CURL_ARRAYSIZE(url); i++) { struct etest *e = &url[i]; char *out; size_t olen; diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c index 3651b341ed39..5c147c6eda1a 100644 --- a/tests/unit/unit1307.c +++ b/tests/unit/unit1307.c @@ -36,17 +36,17 @@ #define MATCH CURL_FNMATCH_MATCH #define NOMATCH CURL_FNMATCH_NOMATCH -#define LINUX_DIFFER 0x80 -#define LINUX_SHIFT 8 -#define LINUX_MATCH ((CURL_FNMATCH_MATCH << LINUX_SHIFT) | LINUX_DIFFER) +#define LINUX_DIFFER 0x80 +#define LINUX_SHIFT 8 +#define LINUX_MATCH ((CURL_FNMATCH_MATCH << LINUX_SHIFT) | LINUX_DIFFER) #define LINUX_NOMATCH ((CURL_FNMATCH_NOMATCH << LINUX_SHIFT) | LINUX_DIFFER) -#define LINUX_FAIL ((CURL_FNMATCH_FAIL << LINUX_SHIFT) | LINUX_DIFFER) +#define LINUX_FAIL ((CURL_FNMATCH_FAIL << LINUX_SHIFT) | LINUX_DIFFER) -#define MAC_DIFFER 0x40 -#define MAC_SHIFT 16 -#define MAC_MATCH ((CURL_FNMATCH_MATCH << MAC_SHIFT) | MAC_DIFFER) -#define MAC_NOMATCH ((CURL_FNMATCH_NOMATCH << MAC_SHIFT) | MAC_DIFFER) -#define MAC_FAIL ((CURL_FNMATCH_FAIL << MAC_SHIFT) | MAC_DIFFER) +#define MAC_DIFFER 0x40 +#define MAC_SHIFT 16 +#define MAC_MATCH ((CURL_FNMATCH_MATCH << MAC_SHIFT) | MAC_DIFFER) +#define MAC_NOMATCH ((CURL_FNMATCH_NOMATCH << MAC_SHIFT) | MAC_DIFFER) +#define MAC_FAIL ((CURL_FNMATCH_FAIL << MAC_SHIFT) | MAC_DIFFER) static const char *ret2name(int i) { diff --git a/tests/unit/unit1309.c b/tests/unit/unit1309.c index af9a29e11085..46596544c610 100644 --- a/tests/unit/unit1309.c +++ b/tests/unit/unit1309.c @@ -67,8 +67,8 @@ static CURLcode test_unit1309(const char *arg) size_t storage[NUM_NODES * 3]; int rc; int i, j; - struct curltime tv_now = {0, 0}; - root = NULL; /* the empty tree */ + struct curltime tv_now = { 0, 0 }; + root = NULL; /* the empty tree */ /* add nodes */ for(i = 0; i < NUM_NODES; i++) { diff --git a/tests/unit/unit1323.c b/tests/unit/unit1323.c index 15d140e10a2a..c705dc96eb57 100644 --- a/tests/unit/unit1323.c +++ b/tests/unit/unit1323.c @@ -34,10 +34,10 @@ static CURLcode test_unit1323(const char *arg) }; struct a tests[] = { - { {36762, 8345}, {36761, 995926}, 13 }, - { {36761, 995926}, {36762, 8345}, -13 }, - { {36761, 995926}, {0, 0}, 36761995 }, - { {0, 0}, {36761, 995926}, -36761995 }, + { { 36762, 8345 }, { 36761, 995926 }, 13 }, + { { 36761, 995926 }, { 36762, 8345 }, -13 }, + { { 36761, 995926 }, { 0, 0 }, 36761995 }, + { { 0, 0 }, { 36761, 995926 }, -36761995 }, }; size_t i; diff --git a/tests/unit/unit1395.c b/tests/unit/unit1395.c index 395f3e7707d7..7ca7f22c105c 100644 --- a/tests/unit/unit1395.c +++ b/tests/unit/unit1395.c @@ -96,9 +96,9 @@ static CURLcode test_unit1395(const char *arg) { "/hello/1/./../2", "/hello/2" }, { "test/this", "test/this" }, { "test/this/../now", "test/now" }, - { "/1../moo../foo", "/1../moo../foo"}, - { "/../../moo", "/moo"}, - { "/../../moo?", "/moo?"}, + { "/1../moo../foo", "/1../moo../foo" }, + { "/../../moo", "/moo" }, + { "/../../moo?", "/moo?" }, { "/123?", "/123?" }, { "/", NULL }, { "", NULL }, diff --git a/tests/unit/unit1396.c b/tests/unit/unit1396.c index 0b74afa84f94..fd58c03b8004 100644 --- a/tests/unit/unit1396.c +++ b/tests/unit/unit1396.c @@ -52,33 +52,33 @@ static CURLcode test_unit1396(const char *arg) /* unescape, this => that */ const struct test list1[] = { - {"%61", 3, "a", 1}, - {"%61a", 4, "aa", 2}, - {"%61b", 4, "ab", 2}, - {"%6 1", 4, "%6 1", 4}, - {"%61", 1, "%", 1}, - {"%61", 2, "%6", 2}, - {"%6%a", 4, "%6%a", 4}, - {"%6a", 0, "j", 1}, - {"%FF", 0, "\xff", 1}, - {"%FF%00%ff", 9, "\xff\x00\xff", 3}, - {"%-2", 0, "%-2", 3}, - {"%FG", 0, "%FG", 3}, - {NULL, 0, NULL, 0} /* end of list marker */ + { "%61", 3, "a", 1 }, + { "%61a", 4, "aa", 2 }, + { "%61b", 4, "ab", 2 }, + { "%6 1", 4, "%6 1", 4 }, + { "%61", 1, "%", 1 }, + { "%61", 2, "%6", 2 }, + { "%6%a", 4, "%6%a", 4 }, + { "%6a", 0, "j", 1 }, + { "%FF", 0, "\xff", 1 }, + { "%FF%00%ff", 9, "\xff\x00\xff", 3 }, + { "%-2", 0, "%-2", 3 }, + { "%FG", 0, "%FG", 3 }, + { NULL, 0, NULL, 0 } /* end of list marker */ }; /* escape, this => that */ const struct test list2[] = { - {"a", 1, "a", 1}, - {"/", 1, "%2F", 3}, - {"a=b", 3, "a%3Db", 5}, - {"a=b", 0, "a%3Db", 5}, - {"a=b", 1, "a", 1}, - {"a=b", 2, "a%3D", 4}, - {"1/./0", 5, "1%2F.%2F0", 9}, - {"-._~!#%&", 0, "-._~%21%23%25%26", 16}, - {"a", 2, "a%00", 4}, - {"a\xff\x01g", 4, "a%FF%01g", 8}, - {NULL, 0, NULL, 0} /* end of list marker */ + { "a", 1, "a", 1 }, + { "/", 1, "%2F", 3 }, + { "a=b", 3, "a%3Db", 5 }, + { "a=b", 0, "a%3Db", 5 }, + { "a=b", 1, "a", 1 }, + { "a=b", 2, "a%3D", 4 }, + { "1/./0", 5, "1%2F.%2F0", 9 }, + { "-._~!#%&", 0, "-._~%21%23%25%26", 16 }, + { "a", 2, "a%00", 4 }, + { "a\xff\x01g", 4, "a%FF%01g", 8 }, + { NULL, 0, NULL, 0 } /* end of list marker */ }; int i; @@ -86,9 +86,7 @@ static CURLcode test_unit1396(const char *arg) abort_unless(easy != NULL, "returned NULL!"); for(i = 0; list1[i].in; i++) { int outlen; - char *out = curl_easy_unescape(easy, - list1[i].in, list1[i].inlen, - &outlen); + char *out = curl_easy_unescape(easy, list1[i].in, list1[i].inlen, &outlen); abort_unless(out != NULL, "returned NULL!"); fail_unless(outlen == list1[i].outlen, "wrong output length returned"); diff --git a/tests/unit/unit1397.c b/tests/unit/unit1397.c index e56b894e36b3..6726c5053064 100644 --- a/tests/unit/unit1397.c +++ b/tests/unit/unit1397.c @@ -39,56 +39,56 @@ static CURLcode test_unit1397(const char *arg) }; static const struct testcase tests[] = { - {"", "", FALSE}, - {"a", "", FALSE}, - {"", "b", FALSE}, - {"a", "b", FALSE}, - {"aa", "bb", FALSE}, - {"\xff", "\xff", TRUE}, - {"aa.aa.aa", "aa.aa.bb", FALSE}, - {"aa.aa.aa", "aa.aa.aa", TRUE}, - {"aa.aa.aa", "*.aa.bb", FALSE}, - {"aa.aa.aa", "*.aa.aa", TRUE}, - {"192.168.0.1", "192.168.0.1", TRUE}, - {"192.168.0.1", "*.168.0.1", FALSE}, - {"192.168.0.1", "*.0.1", FALSE}, - {"h.ello", "*.ello", FALSE}, - {"h.ello.", "*.ello", FALSE}, - {"h.ello", "*.ello.", FALSE}, - {"h.e.llo", "*.e.llo", TRUE}, - {"h.e.llo", " *.e.llo", FALSE}, - {" h.e.llo", "*.e.llo", TRUE}, - {"h.e.llo.", "*.e.llo", TRUE}, - {"*.e.llo.", "*.e.llo", TRUE}, - {"************.e.llo.", "*.e.llo", TRUE}, - {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" - "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" - "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" - "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" - ".e.llo.", "*.e.llo", TRUE}, - {"\xfe\xfe.e.llo.", "*.e.llo", TRUE}, - {"h.e.llo.", "*.e.llo.", TRUE}, - {"h.e.llo", "*.e.llo.", TRUE}, - {".h.e.llo", "*.e.llo.", FALSE}, - {"h.e.llo", "*.*.llo.", FALSE}, - {"h.e.llo", "h.*.llo", FALSE}, - {"h.e.llo", "h.e.*", FALSE}, - {"hello", "*.ello", FALSE}, - {"hello", "**llo", FALSE}, - {"bar.foo.example.com", "*.example.com", FALSE}, - {"foo.example.com", "*.example.com", TRUE}, - {"baz.example.net", "b*z.example.net", FALSE}, - {"foobaz.example.net", "*baz.example.net", FALSE}, - {"xn--l8j.example.local", "x*.example.local", FALSE}, - {"xn--l8j.example.net", "*.example.net", TRUE}, - {"xn--l8j.example.net", "*j.example.net", FALSE}, - {"xn--l8j.example.net", "xn--l8j.example.net", TRUE}, - {"xn--l8j.example.net", "xn--l8j.*.net", FALSE}, - {"xl8j.example.net", "*.example.net", TRUE}, - {"fe80::3285:a9ff:fe46:b619", "*::3285:a9ff:fe46:b619", FALSE}, - {"fe80::3285:a9ff:fe46:b619", "fe80::3285:a9ff:fe46:b619", TRUE}, - {NULL, NULL, FALSE} + { "", "", FALSE }, + { "a", "", FALSE }, + { "", "b", FALSE }, + { "a", "b", FALSE }, + { "aa", "bb", FALSE }, + { "\xff", "\xff", TRUE }, + { "aa.aa.aa", "aa.aa.bb", FALSE }, + { "aa.aa.aa", "aa.aa.aa", TRUE }, + { "aa.aa.aa", "*.aa.bb", FALSE }, + { "aa.aa.aa", "*.aa.aa", TRUE }, + { "192.168.0.1", "192.168.0.1", TRUE }, + { "192.168.0.1", "*.168.0.1", FALSE }, + { "192.168.0.1", "*.0.1", FALSE }, + { "h.ello", "*.ello", FALSE }, + { "h.ello.", "*.ello", FALSE }, + { "h.ello", "*.ello.", FALSE }, + { "h.e.llo", "*.e.llo", TRUE }, + { "h.e.llo", " *.e.llo", FALSE }, + { " h.e.llo", "*.e.llo", TRUE }, + { "h.e.llo.", "*.e.llo", TRUE }, + { "*.e.llo.", "*.e.llo", TRUE }, + { "************.e.llo.", "*.e.llo", TRUE }, + { "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" + "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" + "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" + ".e.llo.", "*.e.llo", TRUE }, + { "\xfe\xfe.e.llo.", "*.e.llo", TRUE }, + { "h.e.llo.", "*.e.llo.", TRUE }, + { "h.e.llo", "*.e.llo.", TRUE }, + { ".h.e.llo", "*.e.llo.", FALSE }, + { "h.e.llo", "*.*.llo.", FALSE }, + { "h.e.llo", "h.*.llo", FALSE }, + { "h.e.llo", "h.e.*", FALSE }, + { "hello", "*.ello", FALSE }, + { "hello", "**llo", FALSE }, + { "bar.foo.example.com", "*.example.com", FALSE }, + { "foo.example.com", "*.example.com", TRUE }, + { "baz.example.net", "b*z.example.net", FALSE }, + { "foobaz.example.net", "*baz.example.net", FALSE }, + { "xn--l8j.example.local", "x*.example.local", FALSE }, + { "xn--l8j.example.net", "*.example.net", TRUE }, + { "xn--l8j.example.net", "*j.example.net", FALSE }, + { "xn--l8j.example.net", "xn--l8j.example.net", TRUE }, + { "xn--l8j.example.net", "xn--l8j.*.net", FALSE }, + { "xl8j.example.net", "*.example.net", TRUE }, + { "fe80::3285:a9ff:fe46:b619", "*::3285:a9ff:fe46:b619", FALSE }, + { "fe80::3285:a9ff:fe46:b619", "fe80::3285:a9ff:fe46:b619", TRUE }, + { NULL, NULL, FALSE } }; int i; diff --git a/tests/unit/unit1398.c b/tests/unit/unit1398.c index abd4447ca464..951a74589f7e 100644 --- a/tests/unit/unit1398.c +++ b/tests/unit/unit1398.c @@ -33,7 +33,7 @@ static CURLcode test_unit1398(const char *arg) UNITTEST_BEGIN_SIMPLE int rc; - char buf[3] = {'b', 'u', 'g'}; + char buf[3] = { 'b', 'u', 'g' }; static const char *str = "bug"; int width = 3; char output[130]; diff --git a/tests/unit/unit1600.c b/tests/unit/unit1600.c index a34720325570..20a299af7370 100644 --- a/tests/unit/unit1600.c +++ b/tests/unit/unit1600.c @@ -51,27 +51,36 @@ static CURLcode test_unit1600(const char *arg) UNITTEST_BEGIN(t1600_setup(&easy)) -#if defined(USE_NTLM) && (!defined(USE_WINDOWS_SSPI) || \ - defined(USE_WIN32_CRYPTO)) +#if defined(USE_NTLM) && \ + (!defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO)) unsigned char output[21]; unsigned char *testp = output; Curl_ntlm_core_mk_nt_hash("1", output); verify_memory(testp, - "\x69\x94\x3c\x5e\x63\xb4\xd2\xc1\x04\xdb" - "\xbc\xc1\x51\x38\xb7\x2b\x00\x00\x00\x00\x00", 21); + "\x69\x94\x3c\x5e\x63\xb4\xd2\xc1\x04\xdb" + "\xbc\xc1\x51\x38\xb7\x2b\x00\x00\x00\x00\x00", + 21); Curl_ntlm_core_mk_nt_hash("hello-you-fool", output); verify_memory(testp, - "\x39\xaf\x87\xa6\x75\x0a\x7a\x00\xba\xa0" - "\xd3\x4f\x04\x9e\xc1\xd0\x00\x00\x00\x00\x00", 21); + "\x39\xaf\x87\xa6\x75\x0a\x7a\x00\xba\xa0" + "\xd3\x4f\x04\x9e\xc1\xd0\x00\x00\x00\x00\x00", + 21); - /* !checksrc! disable LONGLINE 2 */ - Curl_ntlm_core_mk_nt_hash("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", output); + Curl_ntlm_core_mk_nt_hash( + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAA", + output); verify_memory(testp, - "\x36\x9d\xae\x06\x84\x7e\xe1\xc1\x4a\x94\x39\xea\x6f\x44\x8c\x65\x00\x00\x00\x00\x00", 21); + "\x36\x9d\xae\x06\x84\x7e\xe1\xc1\x4a\x94\x39\xea\x6f\x44\x8c" + "\x65\x00\x00\x00\x00\x00", + 21); #endif UNITTEST_END(t1600_stop(easy)) diff --git a/tests/unit/unit1601.c b/tests/unit/unit1601.c index fa7743785dcf..9b0b38486ff9 100644 --- a/tests/unit/unit1601.c +++ b/tests/unit/unit1601.c @@ -42,7 +42,7 @@ static CURLcode test_unit1601(const char *arg) verify_memory(testp, "\xc4\xca\x42\x38\xa0\xb9\x23\x82\x0d\xcc\x50\x9a\x6f" "\x75\x84\x9b", MD5_DIGEST_LEN); - Curl_md5it(output, (const unsigned char *) string2, strlen(string2)); + Curl_md5it(output, (const unsigned char *)string2, strlen(string2)); verify_memory(testp, "\x88\x67\x0b\x6d\x5d\x74\x2f\xad\xa5\xcd\xf9\xb6\x82" "\x87\x5f\x22", MD5_DIGEST_LEN); diff --git a/tests/unit/unit1606.c b/tests/unit/unit1606.c index c7f3d718c7d4..03126a74789f 100644 --- a/tests/unit/unit1606.c +++ b/tests/unit/unit1606.c @@ -52,7 +52,7 @@ static int runawhile(struct Curl_easy *easy, int dec) { int counter = 1; - struct curltime now = {1, 0}; + struct curltime now = { 1, 0 }; CURLcode res; int finaltime; diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 233866da18b6..c23a59fa54db 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -140,7 +140,7 @@ static CURLcode test_unit1607(const char *arg) for(j = 0; j < addressnum; ++j) { uint16_t port = 0; - char ipaddress[MAX_IPADR_LEN] = {0}; + char ipaddress[MAX_IPADR_LEN] = { 0 }; if(!addr && !tests[i].address[j]) break; diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index bf912b99cd1a..b1eac34923dc 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -142,7 +142,7 @@ static CURLcode test_unit1609(const char *arg) for(j = 0; j < addressnum; ++j) { uint16_t port = 0; - char ipaddress[MAX_IPADR_LEN] = {0}; + char ipaddress[MAX_IPADR_LEN] = { 0 }; if(!addr && !tests[i].address[j]) break; diff --git a/tests/unit/unit1610.c b/tests/unit/unit1610.c index 5c47fe28e2c6..ba64a15a9603 100644 --- a/tests/unit/unit1610.c +++ b/tests/unit/unit1610.c @@ -49,14 +49,16 @@ static CURLcode test_unit1610(const char *arg) verify_memory(testp, "\x6b\x86\xb2\x73\xff\x34\xfc\xe1\x9d\x6b\x80\x4e\xff\x5a\x3f" "\x57\x47\xad\xa4\xea\xa2\x2f\x1d\x49\xc0\x1e\x52\xdd\xb7\x87" - "\x5b\x4b", CURL_SHA256_DIGEST_LENGTH); + "\x5b\x4b", + CURL_SHA256_DIGEST_LENGTH); Curl_sha256it(output, (const unsigned char *)string2, strlen(string2)); verify_memory(testp, "\xcb\xb1\x6a\x8a\xb9\xcb\xb9\x35\xa8\xcb\xa0\x2e\x28\xc0\x26" "\x30\xd1\x19\x9c\x1f\x02\x17\xf4\x7c\x96\x20\xf3\xef\xe8\x27" - "\x15\xae", CURL_SHA256_DIGEST_LENGTH); + "\x15\xae", + CURL_SHA256_DIGEST_LENGTH); #endif UNITTEST_END(curl_global_cleanup()) diff --git a/tests/unit/unit1611.c b/tests/unit/unit1611.c index 88c79eb3d9af..fbff7f9211dd 100644 --- a/tests/unit/unit1611.c +++ b/tests/unit/unit1611.c @@ -39,13 +39,15 @@ static CURLcode test_unit1611(const char *arg) verify_memory(testp, "\x8b\xe1\xec\x69\x7b\x14\xad\x3a\x53\xb3\x71\x43\x61\x20\x64" - "\x1d", MD4_DIGEST_LENGTH); + "\x1d", + MD4_DIGEST_LENGTH); Curl_md4it(output, (const unsigned char *)string2, strlen(string2)); verify_memory(testp, "\xa7\x16\x1c\xad\x7e\xbe\xdb\xbc\xf8\xc7\x23\x10\x2d\x2c\xe2" - "\x0b", MD4_DIGEST_LENGTH); + "\x0b", + MD4_DIGEST_LENGTH); #endif UNITTEST_END_SIMPLE diff --git a/tests/unit/unit1612.c b/tests/unit/unit1612.c index 7d8c9acf96b6..313ca0f32934 100644 --- a/tests/unit/unit1612.c +++ b/tests/unit/unit1612.c @@ -46,7 +46,8 @@ static CURLcode test_unit1612(const char *arg) verify_memory(testp, "\xd1\x29\x75\x43\x58\xdc\xab\x78\xdf\xcd\x7f\x2b\x29\x31\x13" - "\x37", HMAC_MD5_LENGTH); + "\x37", + HMAC_MD5_LENGTH); Curl_hmacit(&Curl_HMAC_MD5, (const unsigned char *)password, strlen(password), @@ -55,7 +56,8 @@ static CURLcode test_unit1612(const char *arg) verify_memory(testp, "\x75\xf1\xa7\xb9\xf5\x40\xe5\xa4\x98\x83\x9f\x64\x5a\x27\x6d" - "\xd0", HMAC_MD5_LENGTH); + "\xd0", + HMAC_MD5_LENGTH); #endif UNITTEST_END_SIMPLE diff --git a/tests/unit/unit1614.c b/tests/unit/unit1614.c index 7b66af843119..ed0e3aba9807 100644 --- a/tests/unit/unit1614.c +++ b/tests/unit/unit1614.c @@ -40,28 +40,28 @@ static CURLcode test_unit1614(const char *arg) bool match; }; struct check list4[] = { - { "192.160.0.1", "192.160.0.1", 33, FALSE}, - { "192.160.0.1", "192.160.0.1", 32, TRUE}, - { "192.160.0.1", "192.160.0.1", 0, TRUE}, - { "192.160.0.1", "192.160.0.1", 24, TRUE}, - { "192.160.0.1", "192.160.0.1", 26, TRUE}, - { "192.160.0.1", "192.160.0.1", 20, TRUE}, - { "192.160.0.1", "192.160.0.1", 18, TRUE}, - { "192.160.0.1", "192.160.0.1", 12, TRUE}, - { "192.160.0.1", "192.160.0.1", 8, TRUE}, - { "192.160.0.1", "10.0.0.1", 8, FALSE}, - { "192.160.0.1", "10.0.0.1", 32, FALSE}, - { "192.160.0.1", "10.0.0.1", 0, FALSE}, - { NULL, NULL, 0, FALSE} /* end marker */ + { "192.160.0.1", "192.160.0.1", 33, FALSE }, + { "192.160.0.1", "192.160.0.1", 32, TRUE }, + { "192.160.0.1", "192.160.0.1", 0, TRUE }, + { "192.160.0.1", "192.160.0.1", 24, TRUE }, + { "192.160.0.1", "192.160.0.1", 26, TRUE }, + { "192.160.0.1", "192.160.0.1", 20, TRUE }, + { "192.160.0.1", "192.160.0.1", 18, TRUE }, + { "192.160.0.1", "192.160.0.1", 12, TRUE }, + { "192.160.0.1", "192.160.0.1", 8, TRUE }, + { "192.160.0.1", "10.0.0.1", 8, FALSE }, + { "192.160.0.1", "10.0.0.1", 32, FALSE }, + { "192.160.0.1", "10.0.0.1", 0, FALSE }, + { NULL, NULL, 0, FALSE } /* end marker */ }; #ifdef USE_IPV6 struct check list6[] = { - { "::1", "::1", 0, TRUE}, - { "::1", "::1", 128, TRUE}, - { "::1", "0:0::1", 128, TRUE}, - { "::1", "0:0::1", 129, FALSE}, - { "fe80::ab47:4396:55c9:8474", "fe80::ab47:4396:55c9:8474", 64, TRUE}, - { NULL, NULL, 0, FALSE} /* end marker */ + { "::1", "::1", 0, TRUE }, + { "::1", "::1", 128, TRUE }, + { "::1", "0:0::1", 128, TRUE }, + { "::1", "0:0::1", 129, FALSE }, + { "fe80::ab47:4396:55c9:8474", "fe80::ab47:4396:55c9:8474", 64, TRUE }, + { NULL, NULL, 0, FALSE } /* end marker */ }; #endif struct noproxy { @@ -70,91 +70,91 @@ static CURLcode test_unit1614(const char *arg) bool match; }; struct noproxy list[] = { - { "www.example.com", "localhost .example.com .example.de", FALSE}, - { "www.example.com", "localhost,.example.com,.example.de", TRUE}, - { "www.example.com.", "localhost,.example.com,.example.de", TRUE}, - { "example.com", "localhost,.example.com,.example.de", TRUE}, - { "example.com.", "localhost,.example.com,.example.de", TRUE}, - { "www.example.com", "localhost,.example.com.,.example.de", TRUE}, - { "www.example.com", "localhost,www.example.com.,.example.de", TRUE}, - { "example.com", "localhost,example.com,.example.de", TRUE}, - { "example.com.", "localhost,example.com,.example.de", TRUE}, - { "nexample.com", "localhost,example.com,.example.de", FALSE}, - { "www.example.com", "localhost,example.com,.example.de", TRUE}, - { "127.0.0.1", "127.0.0.1,localhost", TRUE}, - { "127.0.0.1", "127.0.0.1,localhost,", TRUE}, - { "127.0.0.1", "127.0.0.1/8,localhost,", TRUE}, - { "127.0.0.1", "127.0.0.1/28,localhost,", TRUE}, - { "127.0.0.1", "127.0.0.1/31,localhost,", TRUE}, - { "127.0.0.1", "localhost,127.0.0.1", TRUE}, + { "www.example.com", "localhost .example.com .example.de", FALSE }, + { "www.example.com", "localhost,.example.com,.example.de", TRUE }, + { "www.example.com.", "localhost,.example.com,.example.de", TRUE }, + { "example.com", "localhost,.example.com,.example.de", TRUE }, + { "example.com.", "localhost,.example.com,.example.de", TRUE }, + { "www.example.com", "localhost,.example.com.,.example.de", TRUE }, + { "www.example.com", "localhost,www.example.com.,.example.de", TRUE }, + { "example.com", "localhost,example.com,.example.de", TRUE }, + { "example.com.", "localhost,example.com,.example.de", TRUE }, + { "nexample.com", "localhost,example.com,.example.de", FALSE }, + { "www.example.com", "localhost,example.com,.example.de", TRUE }, + { "127.0.0.1", "127.0.0.1,localhost", TRUE }, + { "127.0.0.1", "127.0.0.1,localhost,", TRUE }, + { "127.0.0.1", "127.0.0.1/8,localhost,", TRUE }, + { "127.0.0.1", "127.0.0.1/28,localhost,", TRUE }, + { "127.0.0.1", "127.0.0.1/31,localhost,", TRUE }, + { "127.0.0.1", "localhost,127.0.0.1", TRUE }, { "127.0.0.1", "localhost,127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1." "127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1.127." - "0.0.1.127.0.0.1.127.0.0." /* 128 bytes "address" */, FALSE}, + "0.0.1.127.0.0.1.127.0.0." /* 128 bytes "address" */, FALSE }, { "127.0.0.1", "localhost,127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1." "127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1.127.0.0.1.127." - "0.0.1.127.0.0.1.127.0.0" /* 127 bytes "address" */, FALSE}, - { "localhost", "localhost,127.0.0.1", TRUE}, - { "localhost", "127.0.0.1,localhost", TRUE}, - { "foobar", "barfoo", FALSE}, - { "foobar", "foobar", TRUE}, - { "192.168.0.1", "foobar", FALSE}, - { "192.168.0.1", "192.168.0.0/16", TRUE}, - { "192.168.0.1", "192.168.0.0/16a", FALSE}, - { "192.168.0.1", "192.168.0.0/16 ", TRUE}, - { "192.168.0.1", "192.168.0.0/a16", FALSE}, - { "192.168.0.1", "192.168.0.0/ 16", FALSE}, - { "192.168.0.1", "192.168.0.0/24", TRUE}, - { "192.168.0.1", "192.168.0.0/32", FALSE}, - { "192.168.0.1", "192.168.0.1/32", TRUE}, - { "192.168.0.1", "192.168.0.1/33", FALSE}, - { "192.168.0.1", "192.168.0.0", FALSE}, - { "192.168.1.1", "192.168.0.0/24", FALSE}, - { "192.168.1.1", "192.168.0.0/33", FALSE}, - { "192.168.1.1", "foo, bar, 192.168.0.0/24", FALSE}, - { "192.168.1.1", "foo, bar, 192.168.0.0/16", TRUE}, + "0.0.1.127.0.0.1.127.0.0" /* 127 bytes "address" */, FALSE }, + { "localhost", "localhost,127.0.0.1", TRUE }, + { "localhost", "127.0.0.1,localhost", TRUE }, + { "foobar", "barfoo", FALSE }, + { "foobar", "foobar", TRUE }, + { "192.168.0.1", "foobar", FALSE }, + { "192.168.0.1", "192.168.0.0/16", TRUE }, + { "192.168.0.1", "192.168.0.0/16a", FALSE }, + { "192.168.0.1", "192.168.0.0/16 ", TRUE }, + { "192.168.0.1", "192.168.0.0/a16", FALSE }, + { "192.168.0.1", "192.168.0.0/ 16", FALSE }, + { "192.168.0.1", "192.168.0.0/24", TRUE }, + { "192.168.0.1", "192.168.0.0/32", FALSE }, + { "192.168.0.1", "192.168.0.1/32", TRUE }, + { "192.168.0.1", "192.168.0.1/33", FALSE }, + { "192.168.0.1", "192.168.0.0", FALSE }, + { "192.168.1.1", "192.168.0.0/24", FALSE }, + { "192.168.1.1", "192.168.0.0/33", FALSE }, + { "192.168.1.1", "foo, bar, 192.168.0.0/24", FALSE }, + { "192.168.1.1", "foo, bar, 192.168.0.0/16", TRUE }, #ifdef USE_IPV6 - { "::1", "foo, bar, 192.168.0.0/16", FALSE}, - { "::1", "foo, bar, ::1/64", TRUE}, - { "::1", "::1/64", TRUE}, - { "::1", "::1/96", TRUE}, - { "::1", "::1/129", FALSE}, - { "::1", "::1/128", TRUE}, - { "::1", "::1/127", TRUE}, - { "::1", "::1/a127", FALSE}, - { "::1", "::1/127a", FALSE}, - { "::1", "::1/ 127", FALSE}, - { "::1", "::1/127 ", TRUE}, - { "::1", "::1/126", TRUE}, - { "::1", "::1/125", TRUE}, - { "::1", "::1/124", TRUE}, - { "::1", "::1/123", TRUE}, - { "::1", "::1/122", TRUE}, - { "2001:db8:8000::1", "2001:db8::/65", FALSE}, - { "2001:db8:8000::1", "2001:db8::/66", FALSE}, - { "2001:db8:8000::1", "2001:db8::/67", FALSE}, - { "2001:db8:8000::1", "2001:db8::/68", FALSE}, - { "2001:db8:8000::1", "2001:db8::/69", FALSE}, - { "2001:db8:8000::1", "2001:db8::/70", FALSE}, - { "2001:db8:8000::1", "2001:db8::/71", FALSE}, - { "2001:db8:8000::1", "2001:db8::/72", FALSE}, - { "2001:db8::1", "2001:db8::/65", TRUE}, - { "2001:db8::1", "2001:db8::/66", TRUE}, - { "2001:db8::1", "2001:db8::/67", TRUE}, - { "2001:db8::1", "2001:db8::/68", TRUE}, - { "2001:db8::1", "2001:db8::/69", TRUE}, - { "2001:db8::1", "2001:db8::/70", TRUE}, - { "2001:db8::1", "2001:db8::/71", TRUE}, - { "2001:db8::1", "2001:db8::/72", TRUE}, - { "::1", "::1/129", FALSE}, - { "bar", "foo, bar, ::1/64", TRUE}, - { "BAr", "foo, bar, ::1/64", TRUE}, - { "BAr", "foo,,,,, bar, ::1/64", TRUE}, + { "::1", "foo, bar, 192.168.0.0/16", FALSE }, + { "::1", "foo, bar, ::1/64", TRUE }, + { "::1", "::1/64", TRUE }, + { "::1", "::1/96", TRUE }, + { "::1", "::1/129", FALSE }, + { "::1", "::1/128", TRUE }, + { "::1", "::1/127", TRUE }, + { "::1", "::1/a127", FALSE }, + { "::1", "::1/127a", FALSE }, + { "::1", "::1/ 127", FALSE }, + { "::1", "::1/127 ", TRUE }, + { "::1", "::1/126", TRUE }, + { "::1", "::1/125", TRUE }, + { "::1", "::1/124", TRUE }, + { "::1", "::1/123", TRUE }, + { "::1", "::1/122", TRUE }, + { "2001:db8:8000::1", "2001:db8::/65", FALSE }, + { "2001:db8:8000::1", "2001:db8::/66", FALSE }, + { "2001:db8:8000::1", "2001:db8::/67", FALSE }, + { "2001:db8:8000::1", "2001:db8::/68", FALSE }, + { "2001:db8:8000::1", "2001:db8::/69", FALSE }, + { "2001:db8:8000::1", "2001:db8::/70", FALSE }, + { "2001:db8:8000::1", "2001:db8::/71", FALSE }, + { "2001:db8:8000::1", "2001:db8::/72", FALSE }, + { "2001:db8::1", "2001:db8::/65", TRUE }, + { "2001:db8::1", "2001:db8::/66", TRUE }, + { "2001:db8::1", "2001:db8::/67", TRUE }, + { "2001:db8::1", "2001:db8::/68", TRUE }, + { "2001:db8::1", "2001:db8::/69", TRUE }, + { "2001:db8::1", "2001:db8::/70", TRUE }, + { "2001:db8::1", "2001:db8::/71", TRUE }, + { "2001:db8::1", "2001:db8::/72", TRUE }, + { "::1", "::1/129", FALSE }, + { "bar", "foo, bar, ::1/64", TRUE }, + { "BAr", "foo, bar, ::1/64", TRUE }, + { "BAr", "foo,,,,, bar, ::1/64", TRUE }, #endif - { "www.example.com", "foo, .example.com", TRUE}, - { "www.example.com", "www2.example.com, .example.net", FALSE}, - { "example.com", ".example.com, .example.net", TRUE}, - { "nonexample.com", ".example.com, .example.net", FALSE}, - { NULL, NULL, FALSE} + { "www.example.com", "foo, .example.com", TRUE }, + { "www.example.com", "www2.example.com, .example.net", FALSE }, + { "example.com", ".example.com, .example.net", TRUE }, + { "nonexample.com", ".example.com, .example.net", FALSE }, + { NULL, NULL, FALSE } }; for(i = 0; list4[i].a; i++) { bool match = Curl_cidr4_match(list4[i].a, list4[i].n, list4[i].bits); diff --git a/tests/unit/unit1615.c b/tests/unit/unit1615.c index fadb1aaa59b4..93237db27449 100644 --- a/tests/unit/unit1615.c +++ b/tests/unit/unit1615.c @@ -34,77 +34,78 @@ static CURLcode test_unit1615(const char *arg) static const char test_str1[] = "1"; static const unsigned char precomp_hash1[CURL_SHA512_256_DIGEST_LENGTH] = { - 0x18, 0xd2, 0x75, 0x66, 0xbd, 0x1a, 0xc6, 0x6b, 0x23, 0x32, 0xd8, - 0xc5, 0x4a, 0xd4, 0x3f, 0x7b, 0xb2, 0x20, 0x79, 0xc9, 0x06, 0xd0, - 0x5f, 0x49, 0x1f, 0x3f, 0x07, 0xa2, 0x8d, 0x5c, 0x69, 0x90 + 0x18, 0xd2, 0x75, 0x66, 0xbd, 0x1a, 0xc6, 0x6b, 0x23, 0x32, 0xd8, + 0xc5, 0x4a, 0xd4, 0x3f, 0x7b, 0xb2, 0x20, 0x79, 0xc9, 0x06, 0xd0, + 0x5f, 0x49, 0x1f, 0x3f, 0x07, 0xa2, 0x8d, 0x5c, 0x69, 0x90 }; static const char test_str2[] = "hello-you-fool"; static const unsigned char precomp_hash2[CURL_SHA512_256_DIGEST_LENGTH] = { - 0xaf, 0x6f, 0xb4, 0xb0, 0x13, 0x9b, 0xee, 0x13, 0xd1, 0x95, 0x3c, - 0xb8, 0xc7, 0xcd, 0x5b, 0x19, 0xf9, 0xcd, 0xcd, 0x21, 0xef, 0xdf, - 0xa7, 0x42, 0x5c, 0x07, 0x13, 0xea, 0xcc, 0x1a, 0x39, 0x76 + 0xaf, 0x6f, 0xb4, 0xb0, 0x13, 0x9b, 0xee, 0x13, 0xd1, 0x95, 0x3c, + 0xb8, 0xc7, 0xcd, 0x5b, 0x19, 0xf9, 0xcd, 0xcd, 0x21, 0xef, 0xdf, + 0xa7, 0x42, 0x5c, 0x07, 0x13, 0xea, 0xcc, 0x1a, 0x39, 0x76 }; static const char test_str3[] = "abc"; static const unsigned char precomp_hash3[CURL_SHA512_256_DIGEST_LENGTH] = { - 0x53, 0x04, 0x8E, 0x26, 0x81, 0x94, 0x1E, 0xF9, 0x9B, 0x2E, 0x29, - 0xB7, 0x6B, 0x4C, 0x7D, 0xAB, 0xE4, 0xC2, 0xD0, 0xC6, 0x34, 0xFC, - 0x6D, 0x46, 0xE0, 0xE2, 0xF1, 0x31, 0x07, 0xE7, 0xAF, 0x23 + 0x53, 0x04, 0x8E, 0x26, 0x81, 0x94, 0x1E, 0xF9, 0x9B, 0x2E, 0x29, + 0xB7, 0x6B, 0x4C, 0x7D, 0xAB, 0xE4, 0xC2, 0xD0, 0xC6, 0x34, 0xFC, + 0x6D, 0x46, 0xE0, 0xE2, 0xF1, 0x31, 0x07, 0xE7, 0xAF, 0x23 }; static const char test_str4[] = ""; /* empty, zero size input */ static const unsigned char precomp_hash4[CURL_SHA512_256_DIGEST_LENGTH] = { - 0xc6, 0x72, 0xb8, 0xd1, 0xef, 0x56, 0xed, 0x28, 0xab, 0x87, 0xc3, - 0x62, 0x2c, 0x51, 0x14, 0x06, 0x9b, 0xdd, 0x3a, 0xd7, 0xb8, 0xf9, - 0x73, 0x74, 0x98, 0xd0, 0xc0, 0x1e, 0xce, 0xf0, 0x96, 0x7a + 0xc6, 0x72, 0xb8, 0xd1, 0xef, 0x56, 0xed, 0x28, 0xab, 0x87, 0xc3, + 0x62, 0x2c, 0x51, 0x14, 0x06, 0x9b, 0xdd, 0x3a, 0xd7, 0xb8, 0xf9, + 0x73, 0x74, 0x98, 0xd0, 0xc0, 0x1e, 0xce, 0xf0, 0x96, 0x7a }; static const char test_str5[] = - "abcdefghijklmnopqrstuvwxyzzyxwvutsrqponMLKJIHGFEDCBA" \ - "abcdefghijklmnopqrstuvwxyzzyxwvutsrqponMLKJIHGFEDCBA"; + "abcdefghijklmnopqrstuvwxyzzyxwvutsrqponMLKJIHGFEDCBA" + "abcdefghijklmnopqrstuvwxyzzyxwvutsrqponMLKJIHGFEDCBA"; static const unsigned char precomp_hash5[CURL_SHA512_256_DIGEST_LENGTH] = { - 0xad, 0xe9, 0x5d, 0x55, 0x3b, 0x9e, 0x45, 0x69, 0xdb, 0x53, 0xa4, - 0x04, 0x92, 0xe7, 0x87, 0x94, 0xff, 0xc9, 0x98, 0x5f, 0x93, 0x03, - 0x86, 0x45, 0xe1, 0x97, 0x17, 0x72, 0x7c, 0xbc, 0x31, 0x15 + 0xad, 0xe9, 0x5d, 0x55, 0x3b, 0x9e, 0x45, 0x69, 0xdb, 0x53, 0xa4, + 0x04, 0x92, 0xe7, 0x87, 0x94, 0xff, 0xc9, 0x98, 0x5f, 0x93, 0x03, + 0x86, 0x45, 0xe1, 0x97, 0x17, 0x72, 0x7c, 0xbc, 0x31, 0x15 }; static const char test_str6[] = - "/long/long/long/long/long/long/long/long/long/long/long" \ - "/long/long/long/long/long/long/long/long/long/long/long" \ - "/long/long/long/long/long/long/long/long/long/long/long" \ - "/long/long/long/long/long/long/long/long/long/long/long" \ - "/long/long/long/long/long/long/long/long/long/long/long" \ - "/long/long/long/long/long/long/long/long/long/long/long" \ - "/long/long/long/long/path?with%20some=parameters"; + "/long/long/long/long/long/long/long/long/long/long/long" + "/long/long/long/long/long/long/long/long/long/long/long" + "/long/long/long/long/long/long/long/long/long/long/long" + "/long/long/long/long/long/long/long/long/long/long/long" + "/long/long/long/long/long/long/long/long/long/long/long" + "/long/long/long/long/long/long/long/long/long/long/long" + "/long/long/long/long/path?with%20some=parameters"; static const unsigned char precomp_hash6[CURL_SHA512_256_DIGEST_LENGTH] = { - 0xbc, 0xab, 0xc6, 0x2c, 0x0a, 0x22, 0xd5, 0xcb, 0xac, 0xac, 0xe9, - 0x25, 0xcf, 0xce, 0xaa, 0xaf, 0x0e, 0xa1, 0xed, 0x42, 0x46, 0x8a, - 0xe2, 0x01, 0xee, 0x2f, 0xdb, 0x39, 0x75, 0x47, 0x73, 0xf1 + 0xbc, 0xab, 0xc6, 0x2c, 0x0a, 0x22, 0xd5, 0xcb, 0xac, 0xac, 0xe9, + 0x25, 0xcf, 0xce, 0xaa, 0xaf, 0x0e, 0xa1, 0xed, 0x42, 0x46, 0x8a, + 0xe2, 0x01, 0xee, 0x2f, 0xdb, 0x39, 0x75, 0x47, 0x73, 0xf1 }; static const char test_str7[] = "Simple string."; static const unsigned char precomp_hash7[CURL_SHA512_256_DIGEST_LENGTH] = { - 0xde, 0xcb, 0x3c, 0x81, 0x65, 0x4b, 0xa0, 0xf5, 0xf0, 0x45, 0x6b, - 0x7e, 0x61, 0xf5, 0x0d, 0xf5, 0x38, 0xa4, 0xfc, 0xb1, 0x8a, 0x95, - 0xff, 0x59, 0xbc, 0x04, 0x82, 0xcf, 0x23, 0xb2, 0x32, 0x56 + 0xde, 0xcb, 0x3c, 0x81, 0x65, 0x4b, 0xa0, 0xf5, 0xf0, 0x45, 0x6b, + 0x7e, 0x61, 0xf5, 0x0d, 0xf5, 0x38, 0xa4, 0xfc, 0xb1, 0x8a, 0x95, + 0xff, 0x59, 0xbc, 0x04, 0x82, 0xcf, 0x23, 0xb2, 0x32, 0x56 }; - static const unsigned char test_seq8[]= { - 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, - 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, - 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, - 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, - 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, - 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, - 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, - 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, - 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, - 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, - 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, - 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, - 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, - 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, - 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; /* 255..1 sequence */ + static const unsigned char test_seq8[] = { + 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, + 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, + 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, + 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, + 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, + 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, + 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, + 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, + 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, + 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, + 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, + 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, + 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + }; /* 255..1 sequence */ static const unsigned char precomp_hash8[CURL_SHA512_256_DIGEST_LENGTH] = { - 0x22, 0x31, 0xf2, 0xa1, 0xb4, 0x89, 0xb2, 0x44, 0xf7, 0x66, 0xa0, - 0xb8, 0x31, 0xed, 0xb7, 0x73, 0x8a, 0x34, 0xdc, 0x11, 0xc8, 0x2c, - 0xf2, 0xb5, 0x88, 0x60, 0x39, 0x6b, 0x5c, 0x06, 0x70, 0x37 + 0x22, 0x31, 0xf2, 0xa1, 0xb4, 0x89, 0xb2, 0x44, 0xf7, 0x66, 0xa0, + 0xb8, 0x31, 0xed, 0xb7, 0x73, 0x8a, 0x34, 0xdc, 0x11, 0xc8, 0x2c, + 0xf2, 0xb5, 0x88, 0x60, 0x39, 0x6b, 0x5c, 0x06, 0x70, 0x37 }; unsigned char output_buf[CURL_SHA512_256_DIGEST_LENGTH]; diff --git a/tests/unit/unit1620.c b/tests/unit/unit1620.c index b04424ae3bd3..e6070ad157d4 100644 --- a/tests/unit/unit1620.c +++ b/tests/unit/unit1620.c @@ -33,17 +33,16 @@ static CURLcode t1620_setup(void) return res; } -static void t1620_parse( - const char *input, - const char *exp_username, - const char *exp_password, - const char *exp_options) +static void t1620_parse(const char *input, + const char *exp_username, + const char *exp_password, + const char *exp_options) { char *userstr = NULL; char *passwdstr = NULL; char *options = NULL; - CURLcode rc = Curl_parse_login_details(input, strlen(input), - &userstr, &passwdstr, &options); + CURLcode rc = Curl_parse_login_details(input, strlen(input), &userstr, + &passwdstr, &options); fail_unless(rc == CURLE_OK, "Curl_parse_login_details() failed"); fail_unless(!!exp_username == !!userstr, "username expectation failed"); @@ -52,13 +51,13 @@ static void t1620_parse( if(!unitfail) { fail_unless(!userstr || !exp_username || - strcmp(userstr, exp_username) == 0, + strcmp(userstr, exp_username) == 0, "userstr should be equal to exp_username"); fail_unless(!passwdstr || !exp_password || - strcmp(passwdstr, exp_password) == 0, + strcmp(passwdstr, exp_password) == 0, "passwdstr should be equal to exp_password"); fail_unless(!options || !exp_options || - strcmp(options, exp_options) == 0, + strcmp(options, exp_options) == 0, "options should be equal to exp_options"); } diff --git a/tests/unit/unit1650.c b/tests/unit/unit1650.c index 309515d9b125..c9bb5745c7b7 100644 --- a/tests/unit/unit1650.c +++ b/tests/unit/unit1650.c @@ -31,13 +31,13 @@ static CURLcode test_unit1650(const char *arg) #ifndef CURL_DISABLE_DOH -#define DNS_PREAMBLE "\x00\x00\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00" -#define LABEL_TEST "\x04\x74\x65\x73\x74" -#define LABEL_HOST "\x04\x68\x6f\x73\x74" -#define LABEL_NAME "\x04\x6e\x61\x6d\x65" -#define DNSA_TYPE "\x01" -#define DNSAAAA_TYPE "\x1c" -#define DNSA_EPILOGUE "\x00\x00" DNSA_TYPE "\x00\x01" +#define DNS_PREAMBLE "\x00\x00\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00" +#define LABEL_TEST "\x04\x74\x65\x73\x74" +#define LABEL_HOST "\x04\x68\x6f\x73\x74" +#define LABEL_NAME "\x04\x6e\x61\x6d\x65" +#define DNSA_TYPE "\x01" +#define DNSAAAA_TYPE "\x1c" +#define DNSA_EPILOGUE "\x00\x00" DNSA_TYPE "\x00\x01" #define DNSAAAA_EPILOGUE "\x00\x00" DNSAAAA_TYPE "\x00\x01" #define DNS_Q1 DNS_PREAMBLE LABEL_TEST LABEL_HOST LABEL_NAME DNSA_EPILOGUE diff --git a/tests/unit/unit1651.c b/tests/unit/unit1651.c index ffaea47b20ea..251f2c1c8093 100644 --- a/tests/unit/unit1651.c +++ b/tests/unit/unit1651.c @@ -32,312 +32,336 @@ static CURLcode test_unit1651(const char *arg) #if defined(USE_GNUTLS) || defined(USE_SCHANNEL) /* cert captured from gdb when connecting to curl.se on October 26 - 2018. - !checksrc! disable CLOSEBRACE 1 */ + 2018. */ static unsigned char cert[] = { - 0x30, 0x82, 0x0F, 0x5B, 0x30, 0x82, 0x0E, 0x43, 0xA0, 0x03, 0x02, 0x01, 0x02, - 0x02, 0x0C, 0x08, 0x77, 0x99, 0x2C, 0x6B, 0x67, 0xE1, 0x18, 0xD6, 0x66, 0x66, - 0x9E, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, - 0x0B, 0x05, 0x00, 0x30, 0x57, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, - 0x06, 0x13, 0x02, 0x42, 0x45, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, - 0x0A, 0x13, 0x10, 0x47, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x53, 0x69, 0x67, 0x6E, - 0x20, 0x6E, 0x76, 0x2D, 0x73, 0x61, 0x31, 0x2D, 0x30, 0x2B, 0x06, 0x03, 0x55, - 0x04, 0x03, 0x13, 0x24, 0x47, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x53, 0x69, 0x67, - 0x6E, 0x20, 0x43, 0x6C, 0x6F, 0x75, 0x64, 0x53, 0x53, 0x4C, 0x20, 0x43, 0x41, - 0x20, 0x2D, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x2D, 0x20, 0x47, - 0x33, 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x38, 0x31, 0x30, 0x32, 0x32, 0x31, 0x37, - 0x31, 0x38, 0x32, 0x31, 0x5A, 0x17, 0x0D, 0x31, 0x39, 0x30, 0x33, 0x32, 0x31, - 0x31, 0x33, 0x34, 0x33, 0x34, 0x34, 0x5A, 0x30, 0x77, 0x31, 0x0B, 0x30, 0x09, - 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, - 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x43, 0x61, 0x6C, 0x69, 0x66, 0x6F, - 0x72, 0x6E, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, - 0x0C, 0x0D, 0x53, 0x61, 0x6E, 0x20, 0x46, 0x72, 0x61, 0x6E, 0x63, 0x69, 0x73, - 0x63, 0x6F, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, - 0x46, 0x61, 0x73, 0x74, 0x6C, 0x79, 0x2C, 0x20, 0x49, 0x6E, 0x63, 0x2E, 0x31, - 0x24, 0x30, 0x22, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x1B, 0x6A, 0x32, 0x2E, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, - 0x2E, 0x66, 0x61, 0x73, 0x74, 0x6C, 0x79, 0x2E, 0x6E, 0x65, 0x74, 0x30, 0x82, - 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, - 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82, 0x01, 0x0A, - 0x02, 0x82, 0x01, 0x01, 0x00, 0xC2, 0x72, 0xA2, 0x4A, 0xEF, 0x26, 0x42, 0xD7, - 0x85, 0x74, 0xC9, 0xB4, 0x9F, 0xE3, 0x31, 0xD1, 0x40, 0x77, 0xC9, 0x4B, 0x4D, - 0xFE, 0xC8, 0x75, 0xF3, 0x32, 0x76, 0xAD, 0xF9, 0x08, 0x22, 0x9E, 0xFA, 0x2F, - 0xFE, 0xEC, 0x6C, 0xC4, 0xF5, 0x1F, 0x70, 0xC9, 0x8F, 0x07, 0x48, 0x31, 0xAD, - 0x75, 0x18, 0xFC, 0x06, 0x5A, 0x4F, 0xDD, 0xFD, 0x05, 0x39, 0x6F, 0x22, 0xF9, - 0xAD, 0x62, 0x1A, 0x9E, 0xA6, 0x16, 0x48, 0x75, 0x8F, 0xB8, 0x07, 0x18, 0x25, - 0x1A, 0x87, 0x30, 0xB0, 0x3C, 0x6F, 0xE0, 0x9D, 0x90, 0x63, 0x2A, 0x16, 0x1F, - 0x0D, 0x10, 0xFC, 0x06, 0x7E, 0xEA, 0x51, 0xE2, 0xB0, 0x6D, 0x42, 0x4C, 0x2C, - 0x59, 0xF4, 0x6B, 0x99, 0x3E, 0x82, 0x1D, 0x08, 0x04, 0x2F, 0xA0, 0x63, 0x3C, - 0xAA, 0x0E, 0xE1, 0x5D, 0x67, 0x2D, 0xB3, 0xF4, 0x15, 0xD6, 0x16, 0x4E, 0xAA, - 0x91, 0x45, 0x6B, 0xC5, 0xA6, 0xED, 0x83, 0xAF, 0xF1, 0xD7, 0x42, 0x5E, 0x9B, - 0xC8, 0x39, 0x0C, 0x06, 0x76, 0x7A, 0xB8, 0x3E, 0x16, 0x70, 0xF5, 0xEB, 0x8B, - 0x33, 0x5A, 0xA9, 0x03, 0xED, 0x79, 0x0E, 0xAD, 0xBB, 0xC4, 0xF8, 0xDA, 0x93, - 0x53, 0x2A, 0xC4, 0xC9, 0x1A, 0xD1, 0xC3, 0x44, 0xD7, 0xC6, 0xD0, 0xC6, 0xAC, - 0x13, 0xE3, 0xB5, 0x73, 0x3A, 0xDF, 0x54, 0x15, 0xFB, 0xB4, 0x6B, 0x36, 0x39, - 0x18, 0xB5, 0x61, 0x12, 0xF0, 0x37, 0xAB, 0x81, 0x5F, 0x0C, 0xE7, 0xDF, 0xC1, - 0xC5, 0x5E, 0x99, 0x67, 0x85, 0xFF, 0xAD, 0xD6, 0x82, 0x09, 0x1F, 0x27, 0xE5, - 0x32, 0x52, 0x18, 0xEC, 0x35, 0x2F, 0x6C, 0xC9, 0xE6, 0x87, 0xCE, 0x30, 0xF6, - 0xDA, 0x04, 0x3F, 0xA5, 0x8A, 0x0C, 0xAE, 0x5B, 0xB0, 0xEC, 0x29, 0x9B, 0xEE, - 0x8F, 0x52, 0x1E, 0xE2, 0x56, 0x19, 0x45, 0x80, 0x3C, 0x02, 0x57, 0x5C, 0x52, - 0xD9, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x0C, 0x05, 0x30, 0x82, 0x0C, - 0x01, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, - 0x03, 0x02, 0x05, 0xA0, 0x30, 0x81, 0x8A, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, - 0x05, 0x07, 0x01, 0x01, 0x04, 0x7E, 0x30, 0x7C, 0x30, 0x42, 0x06, 0x08, 0x2B, - 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x36, 0x68, 0x74, 0x74, 0x70, - 0x3A, 0x2F, 0x2F, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x2E, 0x67, 0x6C, 0x6F, - 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x63, - 0x61, 0x63, 0x65, 0x72, 0x74, 0x2F, 0x63, 0x6C, 0x6F, 0x75, 0x64, 0x73, 0x73, - 0x6C, 0x73, 0x68, 0x61, 0x32, 0x67, 0x33, 0x2E, 0x63, 0x72, 0x74, 0x30, 0x36, - 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x2A, 0x68, - 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x6F, 0x63, 0x73, 0x70, 0x32, 0x2E, 0x67, - 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, - 0x2F, 0x63, 0x6C, 0x6F, 0x75, 0x64, 0x73, 0x73, 0x6C, 0x73, 0x68, 0x61, 0x32, - 0x67, 0x33, 0x30, 0x56, 0x06, 0x03, 0x55, 0x1D, 0x20, 0x04, 0x4F, 0x30, 0x4D, - 0x30, 0x41, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xA0, 0x32, 0x01, 0x14, - 0x30, 0x34, 0x30, 0x32, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, - 0x01, 0x16, 0x26, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x77, 0x77, - 0x77, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, - 0x63, 0x6F, 0x6D, 0x2F, 0x72, 0x65, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x6F, 0x72, - 0x79, 0x2F, 0x30, 0x08, 0x06, 0x06, 0x67, 0x81, 0x0C, 0x01, 0x02, 0x02, 0x30, - 0x09, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x82, 0x09, - 0x96, 0x06, 0x03, 0x55, 0x1D, 0x11, 0x04, 0x82, 0x09, 0x8D, 0x30, 0x82, 0x09, - 0x89, 0x82, 0x1B, 0x6A, 0x32, 0x2E, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2E, - 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x2E, 0x66, 0x61, 0x73, 0x74, 0x6C, 0x79, - 0x2E, 0x6E, 0x65, 0x74, 0x82, 0x0D, 0x2A, 0x2E, 0x61, 0x32, 0x70, 0x72, 0x65, - 0x73, 0x73, 0x65, 0x2E, 0x66, 0x72, 0x82, 0x19, 0x2A, 0x2E, 0x61, 0x64, 0x76, - 0x65, 0x6E, 0x74, 0x69, 0x73, 0x74, 0x62, 0x6F, 0x6F, 0x6B, 0x63, 0x65, 0x6E, - 0x74, 0x65, 0x72, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x2A, 0x2E, 0x61, 0x70, - 0x69, 0x2E, 0x6C, 0x6F, 0x6C, 0x65, 0x73, 0x70, 0x6F, 0x72, 0x74, 0x73, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x2A, 0x2E, 0x62, 0x61, 0x61, 0x74, 0x63, 0x68, - 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x17, 0x2A, 0x2E, 0x62, 0x69, 0x6F, 0x74, 0x65, - 0x63, 0x68, 0x77, 0x65, 0x65, 0x6B, 0x62, 0x6F, 0x73, 0x74, 0x6F, 0x6E, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x2A, 0x2E, 0x62, 0x6F, 0x78, 0x6F, 0x66, 0x73, - 0x74, 0x79, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x2A, 0x2E, 0x63, - 0x61, 0x73, 0x70, 0x65, 0x72, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x11, 0x2A, 0x2E, - 0x63, 0x68, 0x61, 0x6B, 0x72, 0x61, 0x6C, 0x69, 0x6E, 0x75, 0x78, 0x2E, 0x6F, - 0x72, 0x67, 0x82, 0x18, 0x2A, 0x2E, 0x63, 0x6F, 0x6E, 0x76, 0x65, 0x72, 0x74, - 0x2E, 0x64, 0x73, 0x2E, 0x76, 0x65, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x15, 0x2A, 0x2E, 0x64, 0x65, 0x76, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x73, 0x68, 0x69, 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x2E, 0x61, 0x75, 0x82, - 0x1B, 0x2A, 0x2E, 0x64, 0x65, 0x76, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x68, - 0x69, 0x70, 0x69, 0x6E, 0x76, 0x65, 0x73, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x2E, - 0x61, 0x75, 0x82, 0x0A, 0x2A, 0x2E, 0x65, 0x63, 0x68, 0x6C, 0x2E, 0x63, 0x6F, - 0x6D, 0x82, 0x0F, 0x2A, 0x2E, 0x66, 0x69, 0x6C, 0x65, 0x73, 0x74, 0x61, 0x63, - 0x6B, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x2A, 0x2E, 0x66, 0x69, 0x6C, 0x65, - 0x73, 0x74, 0x61, 0x63, 0x6B, 0x2E, 0x6F, 0x6E, 0x65, 0x6D, 0x6F, 0x62, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x2A, 0x2E, 0x66, 0x69, 0x73, 0x2D, 0x73, 0x6B, - 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x2A, 0x2E, 0x66, 0x69, 0x73, 0x73, - 0x6B, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x2A, 0x2E, 0x66, 0x70, 0x2E, - 0x62, 0x72, 0x61, 0x6E, 0x64, 0x66, 0x6F, 0x6C, 0x64, 0x65, 0x72, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0F, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x65, 0x6E, 0x70, 0x6C, - 0x75, 0x67, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x2A, 0x2E, 0x66, 0x73, 0x2E, - 0x65, 0x6E, 0x70, 0x6C, 0x75, 0x67, 0x2E, 0x69, 0x6E, 0x82, 0x10, 0x2A, 0x2E, - 0x66, 0x73, 0x2E, 0x68, 0x65, 0x72, 0x6F, 0x69, 0x6E, 0x65, 0x2E, 0x63, 0x6F, - 0x6D, 0x82, 0x18, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x6C, 0x65, 0x61, 0x72, 0x6E, - 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, - 0x6D, 0x82, 0x18, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x6C, 0x6F, 0x63, 0x61, 0x6C, - 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, - 0x6D, 0x82, 0x12, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x6D, 0x69, 0x6E, 0x64, 0x66, - 0x6C, 0x61, 0x73, 0x68, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x2A, 0x2E, 0x66, - 0x73, 0x2E, 0x6F, 0x70, 0x73, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, - 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x2A, 0x2E, 0x66, 0x73, 0x2E, - 0x70, 0x69, 0x78, 0x76, 0x61, 0x6E, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x15, - 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x71, 0x61, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, - 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x17, 0x2A, 0x2E, 0x66, - 0x73, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, - 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x09, 0x2A, 0x2E, 0x68, 0x61, - 0x78, 0x78, 0x2E, 0x73, 0x65, 0x82, 0x0D, 0x2A, 0x2E, 0x68, 0x6F, 0x6D, 0x65, - 0x61, 0x77, 0x61, 0x79, 0x2E, 0x6C, 0x6B, 0x82, 0x0F, 0x2A, 0x2E, 0x69, 0x64, - 0x61, 0x74, 0x61, 0x6C, 0x69, 0x6E, 0x6B, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, - 0x2A, 0x2E, 0x69, 0x64, 0x61, 0x74, 0x61, 0x6C, 0x69, 0x6E, 0x6B, 0x6D, 0x61, - 0x65, 0x73, 0x74, 0x72, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x11, 0x2A, 0x2E, - 0x69, 0x6D, 0x67, 0x2D, 0x74, 0x61, 0x62, 0x6F, 0x6F, 0x6C, 0x61, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0F, 0x2A, 0x2E, 0x6A, 0x75, 0x6C, 0x69, 0x61, 0x6C, 0x61, - 0x6E, 0x67, 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x10, 0x2A, 0x2E, 0x6B, 0x69, 0x6E, - 0x64, 0x73, 0x6E, 0x61, 0x63, 0x6B, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x10, - 0x2A, 0x2E, 0x6B, 0x73, 0x73, 0x76, 0x61, 0x6E, 0x69, 0x6C, 0x6C, 0x61, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x2A, 0x2E, 0x6B, 0x73, 0x74, 0x63, 0x6F, 0x72, - 0x72, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x2A, 0x2E, 0x6B, 0x73, 0x74, - 0x76, 0x61, 0x6E, 0x69, 0x6C, 0x6C, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, - 0x2A, 0x2E, 0x6E, 0x65, 0x77, 0x73, 0x31, 0x32, 0x2E, 0x63, 0x6F, 0x6D, 0x82, - 0x1B, 0x2A, 0x2E, 0x70, 0x61, 0x72, 0x74, 0x69, 0x64, 0x65, 0x6E, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x2E, 0x73, 0x77, 0x69, 0x73, 0x63, 0x6F, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x13, 0x2A, 0x2E, 0x73, 0x68, 0x6F, 0x70, 0x72, 0x61, 0x63, - 0x68, 0x65, 0x6C, 0x7A, 0x6F, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0A, 0x2A, - 0x2E, 0x74, 0x61, 0x73, 0x74, 0x79, 0x2E, 0x63, 0x6F, 0x82, 0x0C, 0x2A, 0x2E, - 0x74, 0x65, 0x64, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x15, 0x2A, - 0x2E, 0x75, 0x70, 0x6C, 0x6F, 0x61, 0x64, 0x73, 0x2E, 0x66, 0x6F, 0x6C, 0x69, - 0x6F, 0x68, 0x64, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x2A, 0x2E, 0x76, 0x6F, - 0x75, 0x63, 0x68, 0x65, 0x72, 0x63, 0x6F, 0x64, 0x65, 0x73, 0x2E, 0x63, 0x6F, - 0x2E, 0x75, 0x6B, 0x82, 0x0D, 0x2A, 0x2E, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, - 0x72, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x61, 0x2E, 0x69, 0x63, 0x61, 0x6E, - 0x76, 0x61, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0B, 0x61, 0x32, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x65, 0x2E, 0x66, 0x72, 0x82, 0x17, 0x61, 0x64, 0x76, 0x65, - 0x6E, 0x74, 0x69, 0x73, 0x74, 0x62, 0x6F, 0x6F, 0x6B, 0x63, 0x65, 0x6E, 0x74, - 0x65, 0x72, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x11, 0x61, 0x70, 0x69, 0x2D, 0x6D, - 0x65, 0x72, 0x72, 0x79, 0x6A, 0x61, 0x6E, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, - 0x12, 0x61, 0x70, 0x69, 0x73, 0x2E, 0x69, 0x64, 0x61, 0x74, 0x61, 0x6C, 0x69, - 0x76, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0F, 0x61, 0x70, 0x70, 0x2D, 0x61, - 0x70, 0x69, 0x2E, 0x74, 0x65, 0x64, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x61, - 0x70, 0x70, 0x2E, 0x62, 0x69, 0x72, 0x63, 0x68, 0x62, 0x6F, 0x78, 0x2E, 0x63, - 0x6F, 0x2E, 0x75, 0x6B, 0x82, 0x0F, 0x61, 0x70, 0x70, 0x2E, 0x62, 0x69, 0x72, - 0x63, 0x68, 0x62, 0x6F, 0x78, 0x2E, 0x65, 0x73, 0x82, 0x1A, 0x61, 0x70, 0x70, - 0x2E, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6E, 0x67, 0x2E, 0x62, 0x69, 0x72, 0x63, - 0x68, 0x62, 0x6F, 0x78, 0x2E, 0x63, 0x6F, 0x2E, 0x75, 0x6B, 0x82, 0x17, 0x61, - 0x70, 0x70, 0x2E, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6E, 0x67, 0x2E, 0x62, 0x69, - 0x72, 0x63, 0x68, 0x62, 0x6F, 0x78, 0x2E, 0x65, 0x73, 0x82, 0x0A, 0x62, 0x61, - 0x61, 0x74, 0x63, 0x68, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x62, 0x65, 0x72, - 0x6E, 0x61, 0x72, 0x64, 0x63, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x73, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x15, 0x62, 0x69, 0x6F, 0x74, 0x65, 0x63, 0x68, 0x77, - 0x65, 0x65, 0x6B, 0x62, 0x6F, 0x73, 0x74, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x0E, 0x62, 0x6F, 0x78, 0x6F, 0x66, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x0A, 0x63, 0x61, 0x73, 0x70, 0x65, 0x72, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0D, 0x63, 0x64, 0x6E, 0x2E, 0x69, 0x72, 0x73, 0x64, 0x6E, - 0x2E, 0x6E, 0x65, 0x74, 0x82, 0x0F, 0x63, 0x68, 0x61, 0x6B, 0x72, 0x61, 0x6C, - 0x69, 0x6E, 0x75, 0x78, 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x13, 0x64, 0x65, 0x76, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x68, 0x69, 0x70, 0x2E, 0x63, 0x6F, 0x6D, - 0x2E, 0x61, 0x75, 0x82, 0x0B, 0x64, 0x69, 0x67, 0x69, 0x64, 0x61, 0x79, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x22, 0x64, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6C, 0x4C, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2E, 0x62, 0x65, 0x72, 0x6E, 0x61, 0x72, - 0x64, 0x63, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x73, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x14, 0x64, 0x72, 0x77, 0x70, 0x2E, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6E, - 0x67, 0x2E, 0x6D, 0x6F, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x08, 0x65, 0x63, - 0x68, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x66, 0x69, 0x6C, 0x65, 0x73, - 0x74, 0x61, 0x63, 0x6B, 0x2E, 0x6F, 0x6E, 0x65, 0x6D, 0x6F, 0x62, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0D, 0x66, 0x73, 0x2E, 0x65, 0x6E, 0x70, 0x6C, 0x75, 0x67, - 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x66, 0x73, 0x2E, 0x6C, 0x65, 0x61, 0x72, - 0x6E, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x16, 0x66, 0x73, 0x2E, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x7A, - 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x14, 0x66, 0x73, 0x2E, 0x6F, 0x70, 0x73, 0x7A, 0x69, 0x6C, 0x6C, 0x69, - 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x66, 0x73, - 0x2E, 0x71, 0x61, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, - 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x15, 0x66, 0x73, 0x2E, 0x74, 0x65, 0x73, 0x74, - 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, - 0x6D, 0x82, 0x0B, 0x68, 0x6F, 0x6D, 0x65, 0x61, 0x77, 0x61, 0x79, 0x2E, 0x6C, - 0x6B, 0x82, 0x12, 0x69, 0x6D, 0x67, 0x2E, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, - 0x72, 0x6D, 0x61, 0x69, 0x6C, 0x2E, 0x69, 0x6F, 0x82, 0x0E, 0x6B, 0x69, 0x6E, - 0x64, 0x73, 0x6E, 0x61, 0x63, 0x6B, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, - 0x6B, 0x73, 0x73, 0x76, 0x61, 0x6E, 0x69, 0x6C, 0x6C, 0x61, 0x2E, 0x63, 0x6F, - 0x6D, 0x82, 0x0C, 0x6B, 0x73, 0x74, 0x63, 0x6F, 0x72, 0x72, 0x61, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0D, 0x6D, 0x65, 0x6E, 0x75, 0x2E, 0x74, 0x72, 0x65, 0x65, - 0x7A, 0x2E, 0x69, 0x6F, 0x82, 0x17, 0x6D, 0x6F, 0x62, 0x69, 0x6C, 0x65, 0x61, - 0x70, 0x69, 0x2E, 0x69, 0x64, 0x61, 0x74, 0x61, 0x6C, 0x69, 0x6E, 0x6B, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x0A, 0x6E, 0x65, 0x77, 0x73, 0x31, 0x32, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0B, 0x6F, 0x6D, 0x6E, 0x69, 0x67, 0x6F, 0x6E, 0x2E, 0x63, - 0x6F, 0x6D, 0x82, 0x0E, 0x6F, 0x72, 0x65, 0x69, 0x6C, 0x6C, 0x79, 0x2E, 0x72, - 0x65, 0x76, 0x69, 0x65, 0x77, 0x82, 0x11, 0x70, 0x6F, 0x70, 0x79, 0x6F, 0x75, - 0x72, 0x62, 0x75, 0x62, 0x62, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x18, - 0x70, 0x72, 0x6F, 0x64, 0x2E, 0x62, 0x65, 0x72, 0x6E, 0x61, 0x72, 0x64, 0x63, - 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x18, - 0x72, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x2D, 0x70, 0x72, 0x69, 0x6D, 0x65, - 0x2E, 0x73, 0x70, 0x6F, 0x6B, 0x65, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x19, - 0x72, 0x65, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x6F, 0x72, 0x69, 0x65, 0x73, 0x2E, - 0x73, 0x65, 0x6E, 0x73, 0x75, 0x61, 0x70, 0x70, 0x2E, 0x6F, 0x72, 0x67, 0x82, - 0x0C, 0x72, 0x6C, 0x2E, 0x74, 0x61, 0x6C, 0x69, 0x73, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x11, 0x73, 0x68, 0x6F, 0x70, 0x72, 0x61, 0x63, 0x68, 0x65, 0x6C, 0x7A, - 0x6F, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0F, 0x73, 0x74, 0x61, 0x67, 0x69, - 0x6E, 0x67, 0x2E, 0x6D, 0x6F, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x63, 0x2E, 0x70, 0x6C, 0x75, 0x6D, 0x63, 0x61, 0x63, - 0x68, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x73, 0x74, 0x61, 0x79, 0x69, - 0x6E, 0x67, 0x61, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x6D, 0x73, 0x66, 0x2E, 0x6F, - 0x72, 0x67, 0x82, 0x08, 0x74, 0x61, 0x73, 0x74, 0x79, 0x2E, 0x63, 0x6F, 0x82, - 0x0C, 0x74, 0x6F, 0x70, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x13, 0x75, 0x70, 0x6C, 0x6F, 0x61, 0x64, 0x73, 0x2E, 0x66, 0x6F, 0x6C, - 0x69, 0x6F, 0x68, 0x64, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x1A, 0x75, 0x73, 0x2D, - 0x65, 0x75, 0x2E, 0x66, 0x69, 0x6C, 0x65, 0x73, 0x74, 0x61, 0x63, 0x6B, 0x63, - 0x6F, 0x6E, 0x74, 0x65, 0x6E, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x76, - 0x6F, 0x75, 0x63, 0x68, 0x65, 0x72, 0x63, 0x6F, 0x64, 0x65, 0x73, 0x2E, 0x63, - 0x6F, 0x2E, 0x75, 0x6B, 0x82, 0x0B, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, - 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x77, 0x6F, 0x6D, 0x65, 0x6E, 0x73, 0x68, - 0x65, 0x61, 0x6C, 0x74, 0x68, 0x2D, 0x6A, 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x82, - 0x19, 0x77, 0x6F, 0x72, 0x6B, 0x65, 0x72, 0x62, 0x65, 0x65, 0x2E, 0x73, 0x74, - 0x61, 0x67, 0x69, 0x6E, 0x67, 0x2E, 0x6D, 0x6F, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x0A, 0x77, 0x77, 0x77, 0x2E, 0x61, 0x67, 0x66, 0x2E, 0x64, 0x6B, 0x82, - 0x14, 0x77, 0x77, 0x77, 0x2E, 0x61, 0x76, 0x65, 0x6E, 0x69, 0x72, 0x2D, 0x73, - 0x75, 0x69, 0x73, 0x73, 0x65, 0x2E, 0x63, 0x68, 0x82, 0x11, 0x77, 0x77, 0x77, - 0x2E, 0x63, 0x61, 0x6E, 0x73, 0x74, 0x61, 0x72, 0x2E, 0x63, 0x6F, 0x2E, 0x6E, - 0x7A, 0x82, 0x15, 0x77, 0x77, 0x77, 0x2E, 0x63, 0x61, 0x6E, 0x73, 0x74, 0x61, - 0x72, 0x62, 0x6C, 0x75, 0x65, 0x2E, 0x63, 0x6F, 0x2E, 0x6E, 0x7A, 0x82, 0x16, - 0x77, 0x77, 0x77, 0x2E, 0x63, 0x61, 0x6E, 0x73, 0x74, 0x61, 0x72, 0x62, 0x6C, - 0x75, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x2E, 0x61, 0x75, 0x82, 0x1D, 0x77, 0x77, - 0x77, 0x2E, 0x63, 0x68, 0x61, 0x6D, 0x70, 0x69, 0x6F, 0x6E, 0x73, 0x68, 0x6F, - 0x63, 0x6B, 0x65, 0x79, 0x6C, 0x65, 0x61, 0x67, 0x75, 0x65, 0x2E, 0x6E, 0x65, - 0x74, 0x82, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x65, 0x78, 0x74, 0x65, 0x72, 0x72, - 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x77, 0x77, 0x77, 0x2E, 0x65, 0x7A, - 0x75, 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0B, 0x77, 0x77, 0x77, 0x2E, 0x65, - 0x7A, 0x75, 0x70, 0x2E, 0x64, 0x65, 0x82, 0x0B, 0x77, 0x77, 0x77, 0x2E, 0x65, - 0x7A, 0x75, 0x70, 0x2E, 0x65, 0x75, 0x82, 0x0B, 0x77, 0x77, 0x77, 0x2E, 0x65, - 0x7A, 0x75, 0x70, 0x2E, 0x6E, 0x6C, 0x82, 0x11, 0x77, 0x77, 0x77, 0x2E, 0x66, - 0x72, 0x61, 0x6E, 0x6B, 0x62, 0x6F, 0x64, 0x79, 0x2E, 0x63, 0x6F, 0x6D, 0x82, - 0x0D, 0x77, 0x77, 0x77, 0x2E, 0x67, 0x6C, 0x6F, 0x73, 0x73, 0x79, 0x2E, 0x63, - 0x6F, 0x82, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x67, 0x6F, 0x6C, 0x64, 0x63, 0x75, - 0x70, 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x63, - 0x61, 0x6E, 0x76, 0x61, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x77, 0x77, - 0x77, 0x2E, 0x6D, 0x6F, 0x6E, 0x69, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, - 0x77, 0x77, 0x77, 0x2E, 0x6F, 0x64, 0x65, 0x6E, 0x73, 0x65, 0x2D, 0x6D, 0x61, - 0x72, 0x63, 0x69, 0x70, 0x61, 0x6E, 0x2E, 0x64, 0x6B, 0x82, 0x15, 0x77, 0x77, - 0x77, 0x2E, 0x6F, 0x6E, 0x65, 0x63, 0x6C, 0x69, 0x63, 0x6B, 0x64, 0x72, 0x69, - 0x76, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x77, 0x77, 0x77, 0x2E, 0x6F, - 0x72, 0x65, 0x69, 0x6C, 0x6C, 0x79, 0x2E, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, - 0x82, 0x15, 0x77, 0x77, 0x77, 0x2E, 0x70, 0x6F, 0x70, 0x79, 0x6F, 0x75, 0x72, - 0x62, 0x75, 0x62, 0x62, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x77, - 0x77, 0x77, 0x2E, 0x72, 0x61, 0x77, 0x6E, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x0E, 0x77, 0x77, 0x77, 0x2E, 0x73, 0x70, 0x6F, 0x6B, 0x65, 0x6F, 0x2E, - 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x77, 0x77, 0x77, 0x2E, 0x74, 0x65, 0x61, 0x72, - 0x73, 0x68, 0x65, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x82, 0x10, 0x77, 0x77, 0x77, - 0x2E, 0x74, 0x6F, 0x70, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2E, 0x63, 0x6F, 0x6D, - 0x82, 0x16, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6B, 0x65, - 0x79, 0x76, 0x69, 0x6C, 0x6C, 0x61, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x1D, - 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, - 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, - 0x07, 0x03, 0x02, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, - 0x14, 0xA8, 0x29, 0xFD, 0xA9, 0xA5, 0x1A, 0x1C, 0x37, 0x0B, 0x20, 0x3B, 0x98, - 0xB7, 0x25, 0x39, 0xCC, 0xE5, 0x2F, 0xF4, 0x94, 0x30, 0x1F, 0x06, 0x03, 0x55, - 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xA9, 0x2B, 0x87, 0xE1, 0xCE, - 0x24, 0x47, 0x3B, 0x1B, 0xBF, 0xCF, 0x85, 0x37, 0x02, 0x55, 0x9D, 0x0D, 0x94, - 0x58, 0xE6, 0x30, 0x82, 0x01, 0x04, 0x06, 0x0A, 0x2B, 0x06, 0x01, 0x04, 0x01, - 0xD6, 0x79, 0x02, 0x04, 0x02, 0x04, 0x81, 0xF5, 0x04, 0x81, 0xF2, 0x00, 0xF0, - 0x00, 0x77, 0x00, 0xA4, 0xB9, 0x09, 0x90, 0xB4, 0x18, 0x58, 0x14, 0x87, 0xBB, - 0x13, 0xA2, 0xCC, 0x67, 0x70, 0x0A, 0x3C, 0x35, 0x98, 0x04, 0xF9, 0x1B, 0xDF, - 0xB8, 0xE3, 0x77, 0xCD, 0x0E, 0xC8, 0x0D, 0xDC, 0x10, 0x00, 0x00, 0x01, 0x66, - 0x9C, 0xC8, 0xE7, 0x38, 0x00, 0x00, 0x04, 0x03, 0x00, 0x48, 0x30, 0x46, 0x02, - 0x21, 0x00, 0xD9, 0x58, 0x6E, 0xFC, 0x4C, 0x3C, 0xAF, 0xF9, 0x5B, 0x7F, 0xDA, - 0x54, 0x95, 0xAF, 0xCF, 0xB3, 0x57, 0xB9, 0x56, 0x2C, 0xE8, 0xE0, 0xB1, 0x20, - 0x9B, 0xCB, 0x75, 0xAC, 0x4E, 0x54, 0xE9, 0x9D, 0x02, 0x21, 0x00, 0xE8, 0xF0, - 0xC0, 0x49, 0x23, 0x8E, 0x3D, 0x9B, 0xA5, 0x87, 0xA3, 0xBE, 0x6C, 0x21, 0x62, - 0xBB, 0xD2, 0x44, 0x5C, 0xE4, 0x7A, 0xCC, 0x46, 0x26, 0x04, 0x19, 0xA4, 0x2D, - 0x9B, 0x1C, 0x5D, 0x3A, 0x00, 0x75, 0x00, 0x6F, 0x53, 0x76, 0xAC, 0x31, 0xF0, - 0x31, 0x19, 0xD8, 0x99, 0x00, 0xA4, 0x51, 0x15, 0xFF, 0x77, 0x15, 0x1C, 0x11, - 0xD9, 0x02, 0xC1, 0x00, 0x29, 0x06, 0x8D, 0xB2, 0x08, 0x9A, 0x37, 0xD9, 0x13, - 0x00, 0x00, 0x01, 0x66, 0x9C, 0xC8, 0xE6, 0x20, 0x00, 0x00, 0x04, 0x03, 0x00, - 0x46, 0x30, 0x44, 0x02, 0x20, 0x14, 0xC8, 0x9F, 0xAC, 0x27, 0x48, 0xBE, 0x4D, - 0x0E, 0xC3, 0x26, 0x2E, 0x34, 0xCA, 0x38, 0xBA, 0x11, 0x3A, 0x68, 0x71, 0x88, - 0xEB, 0x24, 0x26, 0x59, 0x3E, 0xAC, 0xA8, 0x63, 0xCC, 0x8A, 0x0A, 0x02, 0x20, - 0x0F, 0x22, 0xBF, 0x0D, 0x1F, 0x8A, 0x8D, 0x1D, 0x91, 0x33, 0x3A, 0x40, 0xE4, - 0x23, 0x78, 0xFA, 0x22, 0xF5, 0x9B, 0xCB, 0x04, 0x4F, 0x53, 0x2D, 0x20, 0x75, - 0x2F, 0x76, 0x8A, 0xB1, 0xCD, 0x9D, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, - 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, - 0x03, 0x41, 0x0F, 0xF3, 0xA6, 0x62, 0xA2, 0xE5, 0xB4, 0x8D, 0xA8, 0x08, 0x71, - 0x7B, 0xB3, 0xE3, 0x51, 0x61, 0x0D, 0xC0, 0x67, 0x6C, 0x3C, 0x9C, 0x00, 0x0B, - 0x63, 0x77, 0xB6, 0xB6, 0x11, 0x67, 0x77, 0xA5, 0xE1, 0x49, 0xE0, 0x7F, 0xB7, - 0x1D, 0x61, 0xFB, 0x83, 0x9C, 0x83, 0x42, 0xE9, 0x31, 0xCA, 0x51, 0xE3, 0xC1, - 0xBD, 0x9B, 0x2F, 0xB5, 0x35, 0x05, 0x72, 0x7F, 0x40, 0xA6, 0x7C, 0xC9, 0xF1, - 0x59, 0xA7, 0x15, 0xB8, 0x12, 0xDA, 0xF8, 0xCE, 0x83, 0x61, 0xFC, 0x47, 0x96, - 0x9E, 0x74, 0xFE, 0xCD, 0xE4, 0x61, 0x92, 0xF2, 0x2E, 0x0C, 0x08, 0x4B, 0x60, - 0x2D, 0xF6, 0x50, 0x07, 0x83, 0xCA, 0xAF, 0xB9, 0x41, 0x33, 0x4A, 0x3E, 0x84, - 0xC7, 0x73, 0xC6, 0x1F, 0xFF, 0x7A, 0xDF, 0xAE, 0x47, 0x25, 0x32, 0xEB, 0xC0, - 0x43, 0x0C, 0xA6, 0x23, 0x13, 0x46, 0xC3, 0xFA, 0x44, 0xEA, 0x20, 0xEA, 0xCB, - 0x18, 0x17, 0x00, 0xB6, 0xE7, 0x6D, 0x8A, 0x14, 0x8C, 0x6A, 0xCA, 0x88, 0x4C, - 0xDA, 0xA8, 0xB9, 0x08, 0xAF, 0x39, 0xEE, 0xCF, 0xD7, 0xF7, 0x32, 0xC0, 0xF4, - 0xCF, 0x4E, 0x22, 0x38, 0xF7, 0xAF, 0xAE, 0x7D, 0x58, 0x5F, 0xA5, 0x2D, 0x4D, - 0xBB, 0x86, 0x10, 0xB3, 0x93, 0x62, 0x64, 0x27, 0xBF, 0xB1, 0xBB, 0x8F, 0x9F, - 0xFC, 0x07, 0x3C, 0x4B, 0x16, 0x7A, 0x84, 0x5E, 0xAF, 0xAD, 0x57, 0x9C, 0xFF, - 0x7A, 0xA7, 0xE0, 0x90, 0x89, 0x1C, 0xE8, 0xE5, 0x11, 0xF7, 0xB6, 0xDC, 0xCD, - 0x5E, 0xF7, 0x30, 0xA2, 0x2E, 0x67, 0x6D, 0x4A, 0x70, 0x26, 0xEA, 0xCD, 0x27, - 0x70, 0x77, 0x54, 0x57, 0x09, 0x03, 0x56, 0x4A, 0x33, 0x60, 0x00, 0x27, 0xFE, - 0xA7, 0xD7, 0xA9, 0xC4, 0xEC, 0x17, 0x17, 0x8D, 0x87, 0x70, 0x6B, 0x48, 0x88, - 0x61, 0x54, 0x4A, 0x2B, 0xB7, 0x6A, 0x12, 0x08, 0xFB, + 0x30, 0x82, 0x0F, 0x5B, 0x30, 0x82, 0x0E, 0x43, 0xA0, 0x03, 0x02, 0x01, + 0x02, 0x02, 0x0C, 0x08, 0x77, 0x99, 0x2C, 0x6B, 0x67, 0xE1, 0x18, 0xD6, + 0x66, 0x66, 0x9E, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, + 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x57, 0x31, 0x0B, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x42, 0x45, 0x31, 0x19, 0x30, + 0x17, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x10, 0x47, 0x6C, 0x6F, 0x62, + 0x61, 0x6C, 0x53, 0x69, 0x67, 0x6E, 0x20, 0x6E, 0x76, 0x2D, 0x73, 0x61, + 0x31, 0x2D, 0x30, 0x2B, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x24, 0x47, + 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x53, 0x69, 0x67, 0x6E, 0x20, 0x43, 0x6C, + 0x6F, 0x75, 0x64, 0x53, 0x53, 0x4C, 0x20, 0x43, 0x41, 0x20, 0x2D, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x2D, 0x20, 0x47, 0x33, 0x30, + 0x1E, 0x17, 0x0D, 0x31, 0x38, 0x31, 0x30, 0x32, 0x32, 0x31, 0x37, 0x31, + 0x38, 0x32, 0x31, 0x5A, 0x17, 0x0D, 0x31, 0x39, 0x30, 0x33, 0x32, 0x31, + 0x31, 0x33, 0x34, 0x33, 0x34, 0x34, 0x5A, 0x30, 0x77, 0x31, 0x0B, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, + 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x43, 0x61, 0x6C, + 0x69, 0x66, 0x6F, 0x72, 0x6E, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, + 0x03, 0x55, 0x04, 0x07, 0x0C, 0x0D, 0x53, 0x61, 0x6E, 0x20, 0x46, 0x72, + 0x61, 0x6E, 0x63, 0x69, 0x73, 0x63, 0x6F, 0x31, 0x15, 0x30, 0x13, 0x06, + 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x46, 0x61, 0x73, 0x74, 0x6C, 0x79, + 0x2C, 0x20, 0x49, 0x6E, 0x63, 0x2E, 0x31, 0x24, 0x30, 0x22, 0x06, 0x03, + 0x55, 0x04, 0x03, 0x0C, 0x1B, 0x6A, 0x32, 0x2E, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x2E, 0x66, 0x61, + 0x73, 0x74, 0x6C, 0x79, 0x2E, 0x6E, 0x65, 0x74, 0x30, 0x82, 0x01, 0x22, + 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, + 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82, 0x01, 0x0A, + 0x02, 0x82, 0x01, 0x01, 0x00, 0xC2, 0x72, 0xA2, 0x4A, 0xEF, 0x26, 0x42, + 0xD7, 0x85, 0x74, 0xC9, 0xB4, 0x9F, 0xE3, 0x31, 0xD1, 0x40, 0x77, 0xC9, + 0x4B, 0x4D, 0xFE, 0xC8, 0x75, 0xF3, 0x32, 0x76, 0xAD, 0xF9, 0x08, 0x22, + 0x9E, 0xFA, 0x2F, 0xFE, 0xEC, 0x6C, 0xC4, 0xF5, 0x1F, 0x70, 0xC9, 0x8F, + 0x07, 0x48, 0x31, 0xAD, 0x75, 0x18, 0xFC, 0x06, 0x5A, 0x4F, 0xDD, 0xFD, + 0x05, 0x39, 0x6F, 0x22, 0xF9, 0xAD, 0x62, 0x1A, 0x9E, 0xA6, 0x16, 0x48, + 0x75, 0x8F, 0xB8, 0x07, 0x18, 0x25, 0x1A, 0x87, 0x30, 0xB0, 0x3C, 0x6F, + 0xE0, 0x9D, 0x90, 0x63, 0x2A, 0x16, 0x1F, 0x0D, 0x10, 0xFC, 0x06, 0x7E, + 0xEA, 0x51, 0xE2, 0xB0, 0x6D, 0x42, 0x4C, 0x2C, 0x59, 0xF4, 0x6B, 0x99, + 0x3E, 0x82, 0x1D, 0x08, 0x04, 0x2F, 0xA0, 0x63, 0x3C, 0xAA, 0x0E, 0xE1, + 0x5D, 0x67, 0x2D, 0xB3, 0xF4, 0x15, 0xD6, 0x16, 0x4E, 0xAA, 0x91, 0x45, + 0x6B, 0xC5, 0xA6, 0xED, 0x83, 0xAF, 0xF1, 0xD7, 0x42, 0x5E, 0x9B, 0xC8, + 0x39, 0x0C, 0x06, 0x76, 0x7A, 0xB8, 0x3E, 0x16, 0x70, 0xF5, 0xEB, 0x8B, + 0x33, 0x5A, 0xA9, 0x03, 0xED, 0x79, 0x0E, 0xAD, 0xBB, 0xC4, 0xF8, 0xDA, + 0x93, 0x53, 0x2A, 0xC4, 0xC9, 0x1A, 0xD1, 0xC3, 0x44, 0xD7, 0xC6, 0xD0, + 0xC6, 0xAC, 0x13, 0xE3, 0xB5, 0x73, 0x3A, 0xDF, 0x54, 0x15, 0xFB, 0xB4, + 0x6B, 0x36, 0x39, 0x18, 0xB5, 0x61, 0x12, 0xF0, 0x37, 0xAB, 0x81, 0x5F, + 0x0C, 0xE7, 0xDF, 0xC1, 0xC5, 0x5E, 0x99, 0x67, 0x85, 0xFF, 0xAD, 0xD6, + 0x82, 0x09, 0x1F, 0x27, 0xE5, 0x32, 0x52, 0x18, 0xEC, 0x35, 0x2F, 0x6C, + 0xC9, 0xE6, 0x87, 0xCE, 0x30, 0xF6, 0xDA, 0x04, 0x3F, 0xA5, 0x8A, 0x0C, + 0xAE, 0x5B, 0xB0, 0xEC, 0x29, 0x9B, 0xEE, 0x8F, 0x52, 0x1E, 0xE2, 0x56, + 0x19, 0x45, 0x80, 0x3C, 0x02, 0x57, 0x5C, 0x52, 0xD9, 0x02, 0x03, 0x01, + 0x00, 0x01, 0xA3, 0x82, 0x0C, 0x05, 0x30, 0x82, 0x0C, 0x01, 0x30, 0x0E, + 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03, 0x02, + 0x05, 0xA0, 0x30, 0x81, 0x8A, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, + 0x07, 0x01, 0x01, 0x04, 0x7E, 0x30, 0x7C, 0x30, 0x42, 0x06, 0x08, 0x2B, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x36, 0x68, 0x74, 0x74, + 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x2E, 0x67, + 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, + 0x6D, 0x2F, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2F, 0x63, 0x6C, 0x6F, + 0x75, 0x64, 0x73, 0x73, 0x6C, 0x73, 0x68, 0x61, 0x32, 0x67, 0x33, 0x2E, + 0x63, 0x72, 0x74, 0x30, 0x36, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, + 0x07, 0x30, 0x01, 0x86, 0x2A, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, + 0x6F, 0x63, 0x73, 0x70, 0x32, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, + 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x63, 0x6C, 0x6F, + 0x75, 0x64, 0x73, 0x73, 0x6C, 0x73, 0x68, 0x61, 0x32, 0x67, 0x33, 0x30, + 0x56, 0x06, 0x03, 0x55, 0x1D, 0x20, 0x04, 0x4F, 0x30, 0x4D, 0x30, 0x41, + 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xA0, 0x32, 0x01, 0x14, 0x30, + 0x34, 0x30, 0x32, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, + 0x01, 0x16, 0x26, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x77, + 0x77, 0x77, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, + 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x72, 0x65, 0x70, 0x6F, 0x73, 0x69, + 0x74, 0x6F, 0x72, 0x79, 0x2F, 0x30, 0x08, 0x06, 0x06, 0x67, 0x81, 0x0C, + 0x01, 0x02, 0x02, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x02, + 0x30, 0x00, 0x30, 0x82, 0x09, 0x96, 0x06, 0x03, 0x55, 0x1D, 0x11, 0x04, + 0x82, 0x09, 0x8D, 0x30, 0x82, 0x09, 0x89, 0x82, 0x1B, 0x6A, 0x32, 0x2E, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, + 0x6C, 0x2E, 0x66, 0x61, 0x73, 0x74, 0x6C, 0x79, 0x2E, 0x6E, 0x65, 0x74, + 0x82, 0x0D, 0x2A, 0x2E, 0x61, 0x32, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x2E, 0x66, 0x72, 0x82, 0x19, 0x2A, 0x2E, 0x61, 0x64, 0x76, 0x65, 0x6E, + 0x74, 0x69, 0x73, 0x74, 0x62, 0x6F, 0x6F, 0x6B, 0x63, 0x65, 0x6E, 0x74, + 0x65, 0x72, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x2A, 0x2E, 0x61, 0x70, + 0x69, 0x2E, 0x6C, 0x6F, 0x6C, 0x65, 0x73, 0x70, 0x6F, 0x72, 0x74, 0x73, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x2A, 0x2E, 0x62, 0x61, 0x61, 0x74, + 0x63, 0x68, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x17, 0x2A, 0x2E, 0x62, 0x69, + 0x6F, 0x74, 0x65, 0x63, 0x68, 0x77, 0x65, 0x65, 0x6B, 0x62, 0x6F, 0x73, + 0x74, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x2A, 0x2E, 0x62, + 0x6F, 0x78, 0x6F, 0x66, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x2E, 0x63, 0x6F, + 0x6D, 0x82, 0x0C, 0x2A, 0x2E, 0x63, 0x61, 0x73, 0x70, 0x65, 0x72, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x11, 0x2A, 0x2E, 0x63, 0x68, 0x61, 0x6B, 0x72, + 0x61, 0x6C, 0x69, 0x6E, 0x75, 0x78, 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x18, + 0x2A, 0x2E, 0x63, 0x6F, 0x6E, 0x76, 0x65, 0x72, 0x74, 0x2E, 0x64, 0x73, + 0x2E, 0x76, 0x65, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x15, 0x2A, 0x2E, 0x64, 0x65, 0x76, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x73, 0x68, 0x69, 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x2E, 0x61, 0x75, 0x82, + 0x1B, 0x2A, 0x2E, 0x64, 0x65, 0x76, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, + 0x68, 0x69, 0x70, 0x69, 0x6E, 0x76, 0x65, 0x73, 0x74, 0x2E, 0x63, 0x6F, + 0x6D, 0x2E, 0x61, 0x75, 0x82, 0x0A, 0x2A, 0x2E, 0x65, 0x63, 0x68, 0x6C, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0F, 0x2A, 0x2E, 0x66, 0x69, 0x6C, 0x65, + 0x73, 0x74, 0x61, 0x63, 0x6B, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x2A, + 0x2E, 0x66, 0x69, 0x6C, 0x65, 0x73, 0x74, 0x61, 0x63, 0x6B, 0x2E, 0x6F, + 0x6E, 0x65, 0x6D, 0x6F, 0x62, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x2A, + 0x2E, 0x66, 0x69, 0x73, 0x2D, 0x73, 0x6B, 0x69, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x0C, 0x2A, 0x2E, 0x66, 0x69, 0x73, 0x73, 0x6B, 0x69, 0x2E, 0x63, + 0x6F, 0x6D, 0x82, 0x14, 0x2A, 0x2E, 0x66, 0x70, 0x2E, 0x62, 0x72, 0x61, + 0x6E, 0x64, 0x66, 0x6F, 0x6C, 0x64, 0x65, 0x72, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x0F, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x65, 0x6E, 0x70, 0x6C, 0x75, + 0x67, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x2A, 0x2E, 0x66, 0x73, 0x2E, + 0x65, 0x6E, 0x70, 0x6C, 0x75, 0x67, 0x2E, 0x69, 0x6E, 0x82, 0x10, 0x2A, + 0x2E, 0x66, 0x73, 0x2E, 0x68, 0x65, 0x72, 0x6F, 0x69, 0x6E, 0x65, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x18, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x6C, 0x65, + 0x61, 0x72, 0x6E, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, + 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x18, 0x2A, 0x2E, 0x66, 0x73, 0x2E, + 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, + 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x2A, 0x2E, 0x66, + 0x73, 0x2E, 0x6D, 0x69, 0x6E, 0x64, 0x66, 0x6C, 0x61, 0x73, 0x68, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x6F, 0x70, + 0x73, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x2A, 0x2E, 0x66, 0x73, 0x2E, 0x70, 0x69, + 0x78, 0x76, 0x61, 0x6E, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x15, 0x2A, + 0x2E, 0x66, 0x73, 0x2E, 0x71, 0x61, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, + 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x17, 0x2A, 0x2E, + 0x66, 0x73, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x7A, 0x69, 0x6C, 0x6C, 0x69, + 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x09, 0x2A, + 0x2E, 0x68, 0x61, 0x78, 0x78, 0x2E, 0x73, 0x65, 0x82, 0x0D, 0x2A, 0x2E, + 0x68, 0x6F, 0x6D, 0x65, 0x61, 0x77, 0x61, 0x79, 0x2E, 0x6C, 0x6B, 0x82, + 0x0F, 0x2A, 0x2E, 0x69, 0x64, 0x61, 0x74, 0x61, 0x6C, 0x69, 0x6E, 0x6B, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x2A, 0x2E, 0x69, 0x64, 0x61, 0x74, + 0x61, 0x6C, 0x69, 0x6E, 0x6B, 0x6D, 0x61, 0x65, 0x73, 0x74, 0x72, 0x6F, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x11, 0x2A, 0x2E, 0x69, 0x6D, 0x67, 0x2D, + 0x74, 0x61, 0x62, 0x6F, 0x6F, 0x6C, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x0F, 0x2A, 0x2E, 0x6A, 0x75, 0x6C, 0x69, 0x61, 0x6C, 0x61, 0x6E, 0x67, + 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x10, 0x2A, 0x2E, 0x6B, 0x69, 0x6E, 0x64, + 0x73, 0x6E, 0x61, 0x63, 0x6B, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x10, + 0x2A, 0x2E, 0x6B, 0x73, 0x73, 0x76, 0x61, 0x6E, 0x69, 0x6C, 0x6C, 0x61, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x2A, 0x2E, 0x6B, 0x73, 0x74, 0x63, + 0x6F, 0x72, 0x72, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x10, 0x2A, 0x2E, + 0x6B, 0x73, 0x74, 0x76, 0x61, 0x6E, 0x69, 0x6C, 0x6C, 0x61, 0x2E, 0x63, + 0x6F, 0x6D, 0x82, 0x0C, 0x2A, 0x2E, 0x6E, 0x65, 0x77, 0x73, 0x31, 0x32, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x1B, 0x2A, 0x2E, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x64, 0x65, 0x6E, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2E, 0x73, + 0x77, 0x69, 0x73, 0x63, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x2A, + 0x2E, 0x73, 0x68, 0x6F, 0x70, 0x72, 0x61, 0x63, 0x68, 0x65, 0x6C, 0x7A, + 0x6F, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0A, 0x2A, 0x2E, 0x74, 0x61, + 0x73, 0x74, 0x79, 0x2E, 0x63, 0x6F, 0x82, 0x0C, 0x2A, 0x2E, 0x74, 0x65, + 0x64, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x15, 0x2A, 0x2E, + 0x75, 0x70, 0x6C, 0x6F, 0x61, 0x64, 0x73, 0x2E, 0x66, 0x6F, 0x6C, 0x69, + 0x6F, 0x68, 0x64, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x2A, 0x2E, 0x76, + 0x6F, 0x75, 0x63, 0x68, 0x65, 0x72, 0x63, 0x6F, 0x64, 0x65, 0x73, 0x2E, + 0x63, 0x6F, 0x2E, 0x75, 0x6B, 0x82, 0x0D, 0x2A, 0x2E, 0x77, 0x65, 0x61, + 0x74, 0x68, 0x65, 0x72, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x61, 0x2E, + 0x69, 0x63, 0x61, 0x6E, 0x76, 0x61, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x0B, 0x61, 0x32, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x2E, 0x66, 0x72, + 0x82, 0x17, 0x61, 0x64, 0x76, 0x65, 0x6E, 0x74, 0x69, 0x73, 0x74, 0x62, + 0x6F, 0x6F, 0x6B, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x2E, 0x63, 0x6F, + 0x6D, 0x82, 0x11, 0x61, 0x70, 0x69, 0x2D, 0x6D, 0x65, 0x72, 0x72, 0x79, + 0x6A, 0x61, 0x6E, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x61, 0x70, + 0x69, 0x73, 0x2E, 0x69, 0x64, 0x61, 0x74, 0x61, 0x6C, 0x69, 0x76, 0x65, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0F, 0x61, 0x70, 0x70, 0x2D, 0x61, 0x70, + 0x69, 0x2E, 0x74, 0x65, 0x64, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x61, + 0x70, 0x70, 0x2E, 0x62, 0x69, 0x72, 0x63, 0x68, 0x62, 0x6F, 0x78, 0x2E, + 0x63, 0x6F, 0x2E, 0x75, 0x6B, 0x82, 0x0F, 0x61, 0x70, 0x70, 0x2E, 0x62, + 0x69, 0x72, 0x63, 0x68, 0x62, 0x6F, 0x78, 0x2E, 0x65, 0x73, 0x82, 0x1A, + 0x61, 0x70, 0x70, 0x2E, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6E, 0x67, 0x2E, + 0x62, 0x69, 0x72, 0x63, 0x68, 0x62, 0x6F, 0x78, 0x2E, 0x63, 0x6F, 0x2E, + 0x75, 0x6B, 0x82, 0x17, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x74, 0x61, 0x67, + 0x69, 0x6E, 0x67, 0x2E, 0x62, 0x69, 0x72, 0x63, 0x68, 0x62, 0x6F, 0x78, + 0x2E, 0x65, 0x73, 0x82, 0x0A, 0x62, 0x61, 0x61, 0x74, 0x63, 0x68, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x62, 0x65, 0x72, 0x6E, 0x61, 0x72, 0x64, + 0x63, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x73, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x15, 0x62, 0x69, 0x6F, 0x74, 0x65, 0x63, 0x68, 0x77, 0x65, 0x65, + 0x6B, 0x62, 0x6F, 0x73, 0x74, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x0E, 0x62, 0x6F, 0x78, 0x6F, 0x66, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x0A, 0x63, 0x61, 0x73, 0x70, 0x65, 0x72, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x63, 0x64, 0x6E, 0x2E, 0x69, 0x72, 0x73, + 0x64, 0x6E, 0x2E, 0x6E, 0x65, 0x74, 0x82, 0x0F, 0x63, 0x68, 0x61, 0x6B, + 0x72, 0x61, 0x6C, 0x69, 0x6E, 0x75, 0x78, 0x2E, 0x6F, 0x72, 0x67, 0x82, + 0x13, 0x64, 0x65, 0x76, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x68, 0x69, + 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x2E, 0x61, 0x75, 0x82, 0x0B, 0x64, 0x69, + 0x67, 0x69, 0x64, 0x61, 0x79, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x22, 0x64, + 0x69, 0x67, 0x69, 0x74, 0x61, 0x6C, 0x4C, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x2E, 0x62, 0x65, 0x72, 0x6E, 0x61, 0x72, 0x64, 0x63, 0x6F, 0x6E, + 0x74, 0x72, 0x6F, 0x6C, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x64, + 0x72, 0x77, 0x70, 0x2E, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6E, 0x67, 0x2E, + 0x6D, 0x6F, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x08, 0x65, 0x63, 0x68, + 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x66, 0x69, 0x6C, 0x65, 0x73, + 0x74, 0x61, 0x63, 0x6B, 0x2E, 0x6F, 0x6E, 0x65, 0x6D, 0x6F, 0x62, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x66, 0x73, 0x2E, 0x65, 0x6E, 0x70, 0x6C, + 0x75, 0x67, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x66, 0x73, 0x2E, 0x6C, + 0x65, 0x61, 0x72, 0x6E, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, + 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, 0x66, 0x73, 0x2E, 0x6C, + 0x6F, 0x63, 0x61, 0x6C, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, + 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x66, 0x73, 0x2E, 0x6F, + 0x70, 0x73, 0x7A, 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x66, 0x73, 0x2E, 0x71, 0x61, 0x7A, + 0x69, 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, + 0x6D, 0x82, 0x15, 0x66, 0x73, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x7A, 0x69, + 0x6C, 0x6C, 0x69, 0x6F, 0x6E, 0x63, 0x64, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x0B, 0x68, 0x6F, 0x6D, 0x65, 0x61, 0x77, 0x61, 0x79, 0x2E, 0x6C, + 0x6B, 0x82, 0x12, 0x69, 0x6D, 0x67, 0x2E, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x6D, 0x61, 0x69, 0x6C, 0x2E, 0x69, 0x6F, 0x82, 0x0E, 0x6B, + 0x69, 0x6E, 0x64, 0x73, 0x6E, 0x61, 0x63, 0x6B, 0x73, 0x2E, 0x63, 0x6F, + 0x6D, 0x82, 0x0E, 0x6B, 0x73, 0x73, 0x76, 0x61, 0x6E, 0x69, 0x6C, 0x6C, + 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x6B, 0x73, 0x74, 0x63, 0x6F, + 0x72, 0x72, 0x61, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x6D, 0x65, 0x6E, + 0x75, 0x2E, 0x74, 0x72, 0x65, 0x65, 0x7A, 0x2E, 0x69, 0x6F, 0x82, 0x17, + 0x6D, 0x6F, 0x62, 0x69, 0x6C, 0x65, 0x61, 0x70, 0x69, 0x2E, 0x69, 0x64, + 0x61, 0x74, 0x61, 0x6C, 0x69, 0x6E, 0x6B, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x0A, 0x6E, 0x65, 0x77, 0x73, 0x31, 0x32, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x0B, 0x6F, 0x6D, 0x6E, 0x69, 0x67, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x0E, 0x6F, 0x72, 0x65, 0x69, 0x6C, 0x6C, 0x79, 0x2E, 0x72, 0x65, + 0x76, 0x69, 0x65, 0x77, 0x82, 0x11, 0x70, 0x6F, 0x70, 0x79, 0x6F, 0x75, + 0x72, 0x62, 0x75, 0x62, 0x62, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x18, 0x70, 0x72, 0x6F, 0x64, 0x2E, 0x62, 0x65, 0x72, 0x6E, 0x61, 0x72, + 0x64, 0x63, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x73, 0x2E, 0x63, 0x6F, + 0x6D, 0x82, 0x18, 0x72, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x2D, 0x70, + 0x72, 0x69, 0x6D, 0x65, 0x2E, 0x73, 0x70, 0x6F, 0x6B, 0x65, 0x6F, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x19, 0x72, 0x65, 0x70, 0x6F, 0x73, 0x69, 0x74, + 0x6F, 0x72, 0x69, 0x65, 0x73, 0x2E, 0x73, 0x65, 0x6E, 0x73, 0x75, 0x61, + 0x70, 0x70, 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x0C, 0x72, 0x6C, 0x2E, 0x74, + 0x61, 0x6C, 0x69, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x11, 0x73, 0x68, + 0x6F, 0x70, 0x72, 0x61, 0x63, 0x68, 0x65, 0x6C, 0x7A, 0x6F, 0x65, 0x2E, + 0x63, 0x6F, 0x6D, 0x82, 0x0F, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6E, 0x67, + 0x2E, 0x6D, 0x6F, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x2E, 0x70, 0x6C, 0x75, 0x6D, 0x63, 0x61, 0x63, + 0x68, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x73, 0x74, 0x61, 0x79, + 0x69, 0x6E, 0x67, 0x61, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x6D, 0x73, 0x66, + 0x2E, 0x6F, 0x72, 0x67, 0x82, 0x08, 0x74, 0x61, 0x73, 0x74, 0x79, 0x2E, + 0x63, 0x6F, 0x82, 0x0C, 0x74, 0x6F, 0x70, 0x73, 0x70, 0x65, 0x65, 0x64, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x13, 0x75, 0x70, 0x6C, 0x6F, 0x61, 0x64, + 0x73, 0x2E, 0x66, 0x6F, 0x6C, 0x69, 0x6F, 0x68, 0x64, 0x2E, 0x63, 0x6F, + 0x6D, 0x82, 0x1A, 0x75, 0x73, 0x2D, 0x65, 0x75, 0x2E, 0x66, 0x69, 0x6C, + 0x65, 0x73, 0x74, 0x61, 0x63, 0x6B, 0x63, 0x6F, 0x6E, 0x74, 0x65, 0x6E, + 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x76, 0x6F, 0x75, 0x63, 0x68, + 0x65, 0x72, 0x63, 0x6F, 0x64, 0x65, 0x73, 0x2E, 0x63, 0x6F, 0x2E, 0x75, + 0x6B, 0x82, 0x0B, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2E, 0x63, + 0x6F, 0x6D, 0x82, 0x13, 0x77, 0x6F, 0x6D, 0x65, 0x6E, 0x73, 0x68, 0x65, + 0x61, 0x6C, 0x74, 0x68, 0x2D, 0x6A, 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x82, + 0x19, 0x77, 0x6F, 0x72, 0x6B, 0x65, 0x72, 0x62, 0x65, 0x65, 0x2E, 0x73, + 0x74, 0x61, 0x67, 0x69, 0x6E, 0x67, 0x2E, 0x6D, 0x6F, 0x6F, 0x2E, 0x63, + 0x6F, 0x6D, 0x82, 0x0A, 0x77, 0x77, 0x77, 0x2E, 0x61, 0x67, 0x66, 0x2E, + 0x64, 0x6B, 0x82, 0x14, 0x77, 0x77, 0x77, 0x2E, 0x61, 0x76, 0x65, 0x6E, + 0x69, 0x72, 0x2D, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x2E, 0x63, 0x68, + 0x82, 0x11, 0x77, 0x77, 0x77, 0x2E, 0x63, 0x61, 0x6E, 0x73, 0x74, 0x61, + 0x72, 0x2E, 0x63, 0x6F, 0x2E, 0x6E, 0x7A, 0x82, 0x15, 0x77, 0x77, 0x77, + 0x2E, 0x63, 0x61, 0x6E, 0x73, 0x74, 0x61, 0x72, 0x62, 0x6C, 0x75, 0x65, + 0x2E, 0x63, 0x6F, 0x2E, 0x6E, 0x7A, 0x82, 0x16, 0x77, 0x77, 0x77, 0x2E, + 0x63, 0x61, 0x6E, 0x73, 0x74, 0x61, 0x72, 0x62, 0x6C, 0x75, 0x65, 0x2E, + 0x63, 0x6F, 0x6D, 0x2E, 0x61, 0x75, 0x82, 0x1D, 0x77, 0x77, 0x77, 0x2E, + 0x63, 0x68, 0x61, 0x6D, 0x70, 0x69, 0x6F, 0x6E, 0x73, 0x68, 0x6F, 0x63, + 0x6B, 0x65, 0x79, 0x6C, 0x65, 0x61, 0x67, 0x75, 0x65, 0x2E, 0x6E, 0x65, + 0x74, 0x82, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x72, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0C, 0x77, 0x77, 0x77, 0x2E, + 0x65, 0x7A, 0x75, 0x70, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0B, 0x77, 0x77, + 0x77, 0x2E, 0x65, 0x7A, 0x75, 0x70, 0x2E, 0x64, 0x65, 0x82, 0x0B, 0x77, + 0x77, 0x77, 0x2E, 0x65, 0x7A, 0x75, 0x70, 0x2E, 0x65, 0x75, 0x82, 0x0B, + 0x77, 0x77, 0x77, 0x2E, 0x65, 0x7A, 0x75, 0x70, 0x2E, 0x6E, 0x6C, 0x82, + 0x11, 0x77, 0x77, 0x77, 0x2E, 0x66, 0x72, 0x61, 0x6E, 0x6B, 0x62, 0x6F, + 0x64, 0x79, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x77, 0x77, 0x77, 0x2E, + 0x67, 0x6C, 0x6F, 0x73, 0x73, 0x79, 0x2E, 0x63, 0x6F, 0x82, 0x0F, 0x77, + 0x77, 0x77, 0x2E, 0x67, 0x6F, 0x6C, 0x64, 0x63, 0x75, 0x70, 0x2E, 0x6F, + 0x72, 0x67, 0x82, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x63, 0x61, 0x6E, + 0x76, 0x61, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0D, 0x77, 0x77, 0x77, + 0x2E, 0x6D, 0x6F, 0x6E, 0x69, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x16, + 0x77, 0x77, 0x77, 0x2E, 0x6F, 0x64, 0x65, 0x6E, 0x73, 0x65, 0x2D, 0x6D, + 0x61, 0x72, 0x63, 0x69, 0x70, 0x61, 0x6E, 0x2E, 0x64, 0x6B, 0x82, 0x15, + 0x77, 0x77, 0x77, 0x2E, 0x6F, 0x6E, 0x65, 0x63, 0x6C, 0x69, 0x63, 0x6B, + 0x64, 0x72, 0x69, 0x76, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x12, 0x77, + 0x77, 0x77, 0x2E, 0x6F, 0x72, 0x65, 0x69, 0x6C, 0x6C, 0x79, 0x2E, 0x72, + 0x65, 0x76, 0x69, 0x65, 0x77, 0x82, 0x15, 0x77, 0x77, 0x77, 0x2E, 0x70, + 0x6F, 0x70, 0x79, 0x6F, 0x75, 0x72, 0x62, 0x75, 0x62, 0x62, 0x6C, 0x65, + 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x77, 0x77, 0x77, 0x2E, 0x72, 0x61, + 0x77, 0x6E, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x0E, 0x77, 0x77, + 0x77, 0x2E, 0x73, 0x70, 0x6F, 0x6B, 0x65, 0x6F, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x10, 0x77, 0x77, 0x77, 0x2E, 0x74, 0x65, 0x61, 0x72, 0x73, 0x68, + 0x65, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x82, 0x10, 0x77, 0x77, 0x77, 0x2E, + 0x74, 0x6F, 0x70, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2E, 0x63, 0x6F, 0x6D, + 0x82, 0x16, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6B, + 0x65, 0x79, 0x76, 0x69, 0x6C, 0x6C, 0x61, 0x73, 0x2E, 0x63, 0x6F, 0x6D, + 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, + 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x1D, 0x06, 0x03, 0x55, + 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0xA8, 0x29, 0xFD, 0xA9, 0xA5, 0x1A, + 0x1C, 0x37, 0x0B, 0x20, 0x3B, 0x98, 0xB7, 0x25, 0x39, 0xCC, 0xE5, 0x2F, + 0xF4, 0x94, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, + 0x16, 0x80, 0x14, 0xA9, 0x2B, 0x87, 0xE1, 0xCE, 0x24, 0x47, 0x3B, 0x1B, + 0xBF, 0xCF, 0x85, 0x37, 0x02, 0x55, 0x9D, 0x0D, 0x94, 0x58, 0xE6, 0x30, + 0x82, 0x01, 0x04, 0x06, 0x0A, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xD6, 0x79, + 0x02, 0x04, 0x02, 0x04, 0x81, 0xF5, 0x04, 0x81, 0xF2, 0x00, 0xF0, 0x00, + 0x77, 0x00, 0xA4, 0xB9, 0x09, 0x90, 0xB4, 0x18, 0x58, 0x14, 0x87, 0xBB, + 0x13, 0xA2, 0xCC, 0x67, 0x70, 0x0A, 0x3C, 0x35, 0x98, 0x04, 0xF9, 0x1B, + 0xDF, 0xB8, 0xE3, 0x77, 0xCD, 0x0E, 0xC8, 0x0D, 0xDC, 0x10, 0x00, 0x00, + 0x01, 0x66, 0x9C, 0xC8, 0xE7, 0x38, 0x00, 0x00, 0x04, 0x03, 0x00, 0x48, + 0x30, 0x46, 0x02, 0x21, 0x00, 0xD9, 0x58, 0x6E, 0xFC, 0x4C, 0x3C, 0xAF, + 0xF9, 0x5B, 0x7F, 0xDA, 0x54, 0x95, 0xAF, 0xCF, 0xB3, 0x57, 0xB9, 0x56, + 0x2C, 0xE8, 0xE0, 0xB1, 0x20, 0x9B, 0xCB, 0x75, 0xAC, 0x4E, 0x54, 0xE9, + 0x9D, 0x02, 0x21, 0x00, 0xE8, 0xF0, 0xC0, 0x49, 0x23, 0x8E, 0x3D, 0x9B, + 0xA5, 0x87, 0xA3, 0xBE, 0x6C, 0x21, 0x62, 0xBB, 0xD2, 0x44, 0x5C, 0xE4, + 0x7A, 0xCC, 0x46, 0x26, 0x04, 0x19, 0xA4, 0x2D, 0x9B, 0x1C, 0x5D, 0x3A, + 0x00, 0x75, 0x00, 0x6F, 0x53, 0x76, 0xAC, 0x31, 0xF0, 0x31, 0x19, 0xD8, + 0x99, 0x00, 0xA4, 0x51, 0x15, 0xFF, 0x77, 0x15, 0x1C, 0x11, 0xD9, 0x02, + 0xC1, 0x00, 0x29, 0x06, 0x8D, 0xB2, 0x08, 0x9A, 0x37, 0xD9, 0x13, 0x00, + 0x00, 0x01, 0x66, 0x9C, 0xC8, 0xE6, 0x20, 0x00, 0x00, 0x04, 0x03, 0x00, + 0x46, 0x30, 0x44, 0x02, 0x20, 0x14, 0xC8, 0x9F, 0xAC, 0x27, 0x48, 0xBE, + 0x4D, 0x0E, 0xC3, 0x26, 0x2E, 0x34, 0xCA, 0x38, 0xBA, 0x11, 0x3A, 0x68, + 0x71, 0x88, 0xEB, 0x24, 0x26, 0x59, 0x3E, 0xAC, 0xA8, 0x63, 0xCC, 0x8A, + 0x0A, 0x02, 0x20, 0x0F, 0x22, 0xBF, 0x0D, 0x1F, 0x8A, 0x8D, 0x1D, 0x91, + 0x33, 0x3A, 0x40, 0xE4, 0x23, 0x78, 0xFA, 0x22, 0xF5, 0x9B, 0xCB, 0x04, + 0x4F, 0x53, 0x2D, 0x20, 0x75, 0x2F, 0x76, 0x8A, 0xB1, 0xCD, 0x9D, 0x30, + 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x03, 0x41, 0x0F, 0xF3, 0xA6, + 0x62, 0xA2, 0xE5, 0xB4, 0x8D, 0xA8, 0x08, 0x71, 0x7B, 0xB3, 0xE3, 0x51, + 0x61, 0x0D, 0xC0, 0x67, 0x6C, 0x3C, 0x9C, 0x00, 0x0B, 0x63, 0x77, 0xB6, + 0xB6, 0x11, 0x67, 0x77, 0xA5, 0xE1, 0x49, 0xE0, 0x7F, 0xB7, 0x1D, 0x61, + 0xFB, 0x83, 0x9C, 0x83, 0x42, 0xE9, 0x31, 0xCA, 0x51, 0xE3, 0xC1, 0xBD, + 0x9B, 0x2F, 0xB5, 0x35, 0x05, 0x72, 0x7F, 0x40, 0xA6, 0x7C, 0xC9, 0xF1, + 0x59, 0xA7, 0x15, 0xB8, 0x12, 0xDA, 0xF8, 0xCE, 0x83, 0x61, 0xFC, 0x47, + 0x96, 0x9E, 0x74, 0xFE, 0xCD, 0xE4, 0x61, 0x92, 0xF2, 0x2E, 0x0C, 0x08, + 0x4B, 0x60, 0x2D, 0xF6, 0x50, 0x07, 0x83, 0xCA, 0xAF, 0xB9, 0x41, 0x33, + 0x4A, 0x3E, 0x84, 0xC7, 0x73, 0xC6, 0x1F, 0xFF, 0x7A, 0xDF, 0xAE, 0x47, + 0x25, 0x32, 0xEB, 0xC0, 0x43, 0x0C, 0xA6, 0x23, 0x13, 0x46, 0xC3, 0xFA, + 0x44, 0xEA, 0x20, 0xEA, 0xCB, 0x18, 0x17, 0x00, 0xB6, 0xE7, 0x6D, 0x8A, + 0x14, 0x8C, 0x6A, 0xCA, 0x88, 0x4C, 0xDA, 0xA8, 0xB9, 0x08, 0xAF, 0x39, + 0xEE, 0xCF, 0xD7, 0xF7, 0x32, 0xC0, 0xF4, 0xCF, 0x4E, 0x22, 0x38, 0xF7, + 0xAF, 0xAE, 0x7D, 0x58, 0x5F, 0xA5, 0x2D, 0x4D, 0xBB, 0x86, 0x10, 0xB3, + 0x93, 0x62, 0x64, 0x27, 0xBF, 0xB1, 0xBB, 0x8F, 0x9F, 0xFC, 0x07, 0x3C, + 0x4B, 0x16, 0x7A, 0x84, 0x5E, 0xAF, 0xAD, 0x57, 0x9C, 0xFF, 0x7A, 0xA7, + 0xE0, 0x90, 0x89, 0x1C, 0xE8, 0xE5, 0x11, 0xF7, 0xB6, 0xDC, 0xCD, 0x5E, + 0xF7, 0x30, 0xA2, 0x2E, 0x67, 0x6D, 0x4A, 0x70, 0x26, 0xEA, 0xCD, 0x27, + 0x70, 0x77, 0x54, 0x57, 0x09, 0x03, 0x56, 0x4A, 0x33, 0x60, 0x00, 0x27, + 0xFE, 0xA7, 0xD7, 0xA9, 0xC4, 0xEC, 0x17, 0x17, 0x8D, 0x87, 0x70, 0x6B, + 0x48, 0x88, 0x61, 0x54, 0x4A, 0x2B, 0xB7, 0x6A, 0x12, 0x08, 0xFB, }; CURLcode res; diff --git a/tests/unit/unit1660.c b/tests/unit/unit1660.c index 6b1dcce9fc4d..77d72a063135 100644 --- a/tests/unit/unit1660.c +++ b/tests/unit/unit1660.c @@ -52,17 +52,17 @@ static CURLcode test_unit1660(const char *arg) struct testit { const char *host; - const char *chost; /* if non-NULL, use to lookup with */ - const char *hdr; /* if NULL, just do the lookup */ + const char *chost; /* if non-NULL, use to lookup with */ + const char *hdr; /* if NULL, just do the lookup */ const CURLcode res; /* parse result */ }; static const struct testit headers[] = { /* two entries read from disk cache, verify first */ - { "-", "readfrom.example", NULL, CURLE_OK}, - { "-", "old.example", NULL, CURLE_OK}, + { "-", "readfrom.example", NULL, CURLE_OK }, + { "-", "old.example", NULL, CURLE_OK }, /* delete the remaining one read from disk */ - { "readfrom.example", NULL, "max-age=\"0\"", CURLE_OK}, + { "readfrom.example", NULL, "max-age=\"0\"", CURLE_OK }, { "example.com", NULL, "max-age=\"31536000\"\r\n", CURLE_OK }, { "example.com", NULL, "max-age=\"21536000\"\r\n", CURLE_OK }, @@ -90,10 +90,9 @@ static CURLcode test_unit1660(const char *arg) { "3.example.com", NULL, "max-age=\"21536000\"; include; includeSubDomains;", CURLE_OK }, /* remove the "3.example.com" one, should still match the example.com */ - { "3.example.com", NULL, "max-age=\"0\"; includeSubDomains;", - CURLE_OK }, - { "-", "foo.example.com", NULL, CURLE_OK}, - { "-", "foo.xample.com", NULL, CURLE_OK}, + { "3.example.com", NULL, "max-age=\"0\"; includeSubDomains;", CURLE_OK }, + { "-", "foo.example.com", NULL, CURLE_OK }, + { "-", "foo.xample.com", NULL, CURLE_OK }, /* should not match */ { "example.net", "forexample.net", "max-age=\"31536000\"\r\n", CURLE_OK }, diff --git a/tests/unit/unit1979.c b/tests/unit/unit1979.c index c3925d1bc0c5..796099d59280 100644 --- a/tests/unit/unit1979.c +++ b/tests/unit/unit1979.c @@ -127,7 +127,7 @@ static CURLcode test_unit1979(const char *arg) testcases[i].normalize); fail_unless(msnprintf_result >= 0, "curl_msnprintf fails"); fail_unless(!result && canonical_path_string && - !strcmp(canonical_path_string, testcases[i].canonical_url), + !strcmp(canonical_path_string, testcases[i].canonical_url), buffer); curlx_dyn_free(&canonical_path); } diff --git a/tests/unit/unit1980.c b/tests/unit/unit1980.c index 9e38d8a678ce..82bea8415a9f 100644 --- a/tests/unit/unit1980.c +++ b/tests/unit/unit1980.c @@ -98,7 +98,7 @@ static CURLcode test_unit1980(const char *arg) testcases[i].canonical_query); fail_unless(msnprintf_result >= 0, "curl_msnprintf fails"); fail_unless(!result && canonical_query_ptr && - !strcmp(canonical_query_ptr, testcases[i].canonical_query), + !strcmp(canonical_query_ptr, testcases[i].canonical_query), buffer); curlx_dyn_free(&canonical_query); } diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index fb05189714c3..2e61efc0a5f4 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -50,27 +50,27 @@ static CURLcode test_unit2604(const char *arg) int i; const size_t too_long = 90720; struct set list[] = { - { "-too-long-", "", "", "", CURLE_TOO_LARGE}, - { SA540 " c", SA540, "c", "/", CURLE_OK}, - { "\" " SA540 "\" c", " " SA540, "c", "/", CURLE_OK}, - { "a a", "a", "a", "/home/", CURLE_OK}, - { "b a", "b", "a", "/", CURLE_OK}, - { "a", "a", "", "/home/", CURLE_OK}, - { "b", "b", "", "/", CURLE_OK}, - { "\"foo bar\"\tb", "foo bar", "b", "/", CURLE_OK}, - { "/~/hej", "/home/user/hej", "", "/home/user", CURLE_OK}, - { "\"foo bar", "", "", "/", CURLE_QUOTE_ERROR}, - { "\"foo\\\"bar\" a", "foo\"bar", "a", "/", CURLE_OK}, - { "\"foo\\\'bar\" b", "foo\'bar", "b", "/", CURLE_OK}, - { "\"foo\\\\bar\" c", "foo\\bar", "c", "/", CURLE_OK}, - { "\"foo\\pbar\" c", "foo\\bar", "", "/", CURLE_QUOTE_ERROR}, - { "\"\" c", "", "", "", CURLE_QUOTE_ERROR}, - { "foo\"", "foo\"", "", "/", CURLE_OK}, - { "foo \"", "foo", "\"", "/", CURLE_OK}, - { " \t\t \t ", "", "", "/", CURLE_QUOTE_ERROR}, - { " ", "", "", "/", CURLE_QUOTE_ERROR}, - { "", "", "", "/", CURLE_QUOTE_ERROR}, - { " \r \n ", "\r", "\n ", "/", CURLE_OK}, + { "-too-long-", "", "", "", CURLE_TOO_LARGE }, + { SA540 " c", SA540, "c", "/", CURLE_OK }, + { "\" " SA540 "\" c", " " SA540, "c", "/", CURLE_OK }, + { "a a", "a", "a", "/home/", CURLE_OK }, + { "b a", "b", "a", "/", CURLE_OK }, + { "a", "a", "", "/home/", CURLE_OK }, + { "b", "b", "", "/", CURLE_OK }, + { "\"foo bar\"\tb", "foo bar", "b", "/", CURLE_OK }, + { "/~/hej", "/home/user/hej", "", "/home/user", CURLE_OK }, + { "\"foo bar", "", "", "/", CURLE_QUOTE_ERROR }, + { "\"foo\\\"bar\" a", "foo\"bar", "a", "/", CURLE_OK }, + { "\"foo\\\'bar\" b", "foo\'bar", "b", "/", CURLE_OK }, + { "\"foo\\\\bar\" c", "foo\\bar", "c", "/", CURLE_OK }, + { "\"foo\\pbar\" c", "foo\\bar", "", "/", CURLE_QUOTE_ERROR }, + { "\"\" c", "", "", "", CURLE_QUOTE_ERROR }, + { "foo\"", "foo\"", "", "/", CURLE_OK }, + { "foo \"", "foo", "\"", "/", CURLE_OK }, + { " \t\t \t ", "", "", "/", CURLE_QUOTE_ERROR }, + { " ", "", "", "/", CURLE_QUOTE_ERROR }, + { "", "", "", "/", CURLE_QUOTE_ERROR }, + { " \r \n ", "\r", "\n ", "/", CURLE_OK }, { NULL, NULL, NULL, NULL, CURLE_OK } }; diff --git a/tests/unit/unit2605.c b/tests/unit/unit2605.c index 49d0b0b000e9..e8fce4033420 100644 --- a/tests/unit/unit2605.c +++ b/tests/unit/unit2605.c @@ -40,32 +40,32 @@ static CURLcode test_unit2605(const char *arg) int i; struct range list[] = { - { "0-9", 100, 0, 10, CURLE_OK}, - { "1-10", 100, 1, 10, CURLE_OK}, - { "222222-222222", 300000, 222222, 1, CURLE_OK}, - { "4294967296 - 4294967297", 4294967298, 4294967296, 2, CURLE_OK}, - { "-10", 100, 90, 10, CURLE_OK}, - { "-20", 100, 80, 20, CURLE_OK}, - { "-1", 100, 99, 1, CURLE_OK}, - { "-0", 100, 0, 0, CURLE_RANGE_ERROR}, - { "--2", 100, 0, 0, CURLE_RANGE_ERROR}, - { "-100", 100, 0, 100, CURLE_OK}, - { "-101", 100, 0, 100, CURLE_OK}, - { "-1000", 100, 0, 100, CURLE_OK}, - { "2-1000", 100, 2, 98, CURLE_OK}, - { ".2-3", 100, 0, 0, CURLE_RANGE_ERROR}, - { "+2-3", 100, 0, 0, CURLE_RANGE_ERROR}, - { "2 - 3", 100, 2, 2, CURLE_OK}, - { " 2 - 3", 100, 2, 2, CURLE_RANGE_ERROR}, /* no leading space */ - { "2 - 3 ", 100, 2, 2, CURLE_RANGE_ERROR}, /* no trailing space */ - { "3-2", 100, 0, 0, CURLE_RANGE_ERROR}, - { "2.-3", 100, 0, 0, CURLE_RANGE_ERROR}, - { "-3-2", 100, 0, 0, CURLE_RANGE_ERROR}, - { "101-102", 100, 0, 0, CURLE_RANGE_ERROR}, - { "0-", 100, 0, 100, CURLE_OK}, - { "1-", 100, 1, 99, CURLE_OK}, - { "99-", 100, 99, 1, CURLE_OK}, - { "100-", 100, 0, 0, CURLE_RANGE_ERROR}, + { "0-9", 100, 0, 10, CURLE_OK }, + { "1-10", 100, 1, 10, CURLE_OK }, + { "222222-222222", 300000, 222222, 1, CURLE_OK }, + { "4294967296 - 4294967297", 4294967298, 4294967296, 2, CURLE_OK }, + { "-10", 100, 90, 10, CURLE_OK }, + { "-20", 100, 80, 20, CURLE_OK }, + { "-1", 100, 99, 1, CURLE_OK }, + { "-0", 100, 0, 0, CURLE_RANGE_ERROR }, + { "--2", 100, 0, 0, CURLE_RANGE_ERROR }, + { "-100", 100, 0, 100, CURLE_OK }, + { "-101", 100, 0, 100, CURLE_OK }, + { "-1000", 100, 0, 100, CURLE_OK }, + { "2-1000", 100, 2, 98, CURLE_OK }, + { ".2-3", 100, 0, 0, CURLE_RANGE_ERROR }, + { "+2-3", 100, 0, 0, CURLE_RANGE_ERROR }, + { "2 - 3", 100, 2, 2, CURLE_OK }, + { " 2 - 3", 100, 2, 2, CURLE_RANGE_ERROR }, /* no leading space */ + { "2 - 3 ", 100, 2, 2, CURLE_RANGE_ERROR }, /* no trailing space */ + { "3-2", 100, 0, 0, CURLE_RANGE_ERROR }, + { "2.-3", 100, 0, 0, CURLE_RANGE_ERROR }, + { "-3-2", 100, 0, 0, CURLE_RANGE_ERROR }, + { "101-102", 100, 0, 0, CURLE_RANGE_ERROR }, + { "0-", 100, 0, 100, CURLE_OK }, + { "1-", 100, 1, 99, CURLE_OK }, + { "99-", 100, 99, 1, CURLE_OK }, + { "100-", 100, 0, 0, CURLE_RANGE_ERROR }, { NULL, 0, 0, 0, CURLE_OK } }; @@ -78,10 +78,9 @@ static CURLcode test_unit2605(const char *arg) curl_off_t start; curl_off_t size; CURLcode res; - curl_mprintf("%u: '%s' (file size: %" FMT_OFF_T ")\n", - i, list[i].r, list[i].filesize); - res = Curl_ssh_range(curl, list[i].r, list[i].filesize, - &start, &size); + curl_mprintf("%u: '%s' (file size: %" FMT_OFF_T ")\n", i, list[i].r, + list[i].filesize); + res = Curl_ssh_range(curl, list[i].r, list[i].filesize, &start, &size); if(res != list[i].res) { curl_mprintf("... returned %d\n", res); unitfail++; diff --git a/tests/unit/unit3200.c b/tests/unit/unit3200.c index bfd4d1181b84..f7c82cee3768 100644 --- a/tests/unit/unit3200.c +++ b/tests/unit/unit3200.c @@ -28,7 +28,7 @@ static CURLcode test_unit3200(const char *arg) { UNITTEST_BEGIN_SIMPLE -#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \ +#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \ !defined(CURL_DISABLE_HSTS) || !defined(CURL_DISABLE_NETRC) #if defined(CURL_GNUC_DIAG) || defined(__clang__) diff --git a/tests/unit/unit3205.c b/tests/unit/unit3205.c index bb35fb2f8eae..df0ea7f8ddf8 100644 --- a/tests/unit/unit3205.c +++ b/tests/unit/unit3205.c @@ -442,26 +442,26 @@ static CURLcode test_unit3205(const char *arg) const char *str; }; static const struct test_str_entry test_str_list[] = { - { 0x1301, "TLS_AES_128_GCM_SHA256"}, - { 0x1302, "TLS_AES_256_GCM_SHA384"}, - { 0x1303, "TLS_CHACHA20_POLY1305_SHA256"}, - { 0xC02B, "ECDHE-ECDSA-AES128-GCM-SHA256"}, - { 0xC02F, "ECDHE-RSA-AES128-GCM-SHA256"}, - { 0xC02C, "ECDHE-ECDSA-AES256-GCM-SHA384"}, - { 0xC030, "ECDHE-RSA-AES256-GCM-SHA384"}, - { 0xCCA9, "ECDHE-ECDSA-CHACHA20-POLY1305"}, - { 0xCCA8, "ECDHE-RSA-CHACHA20-POLY1305"}, + { 0x1301, "TLS_AES_128_GCM_SHA256" }, + { 0x1302, "TLS_AES_256_GCM_SHA384" }, + { 0x1303, "TLS_CHACHA20_POLY1305_SHA256" }, + { 0xC02B, "ECDHE-ECDSA-AES128-GCM-SHA256" }, + { 0xC02F, "ECDHE-RSA-AES128-GCM-SHA256" }, + { 0xC02C, "ECDHE-ECDSA-AES256-GCM-SHA384" }, + { 0xC030, "ECDHE-RSA-AES256-GCM-SHA384" }, + { 0xCCA9, "ECDHE-ECDSA-CHACHA20-POLY1305" }, + { 0xCCA8, "ECDHE-RSA-CHACHA20-POLY1305" }, #ifdef USE_MBEDTLS - { 0x009E, "DHE-RSA-AES128-GCM-SHA256"}, - { 0x009F, "DHE-RSA-AES256-GCM-SHA384"}, + { 0x009E, "DHE-RSA-AES128-GCM-SHA256" }, + { 0x009F, "DHE-RSA-AES256-GCM-SHA384" }, #else - { 0x0000, "DHE-RSA-AES128-GCM-SHA256"}, - { 0x0000, "DHE-RSA-AES256-GCM-SHA384"}, + { 0x0000, "DHE-RSA-AES128-GCM-SHA256" }, + { 0x0000, "DHE-RSA-AES256-GCM-SHA384" }, #endif #ifdef USE_MBEDTLS - { 0xCCAA, "DHE-RSA-CHACHA20-POLY1305"}, + { 0xCCAA, "DHE-RSA-CHACHA20-POLY1305" }, #else - { 0x0000, "DHE-RSA-CHACHA20-POLY1305"}, + { 0x0000, "DHE-RSA-CHACHA20-POLY1305" }, #endif #ifdef USE_MBEDTLS { 0xC023, "ECDHE-ECDSA-AES128-SHA256" }, diff --git a/tests/unit/unit3211.c b/tests/unit/unit3211.c index 7f6c616909c0..689edb7b2b3f 100644 --- a/tests/unit/unit3211.c +++ b/tests/unit/unit3211.c @@ -127,11 +127,12 @@ static CURLcode test_unit3211(const char *arg) { UNITTEST_BEGIN_SIMPLE - static const unsigned int s1[] = { /* spread numbers, some at slot edges */ - 0, 1, 4, 17, 63, 64, 65, 66, - 90, 99, + static const unsigned int s1[] = { + /* spread numbers, some at slot edges */ + 0, 1, 4, 17, 63, 64, 65, 66, 90, 99, }; - static const unsigned int s2[] = { /* set with all bits in slot1 set */ + static const unsigned int s2[] = { + /* set with all bits in slot1 set */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, diff --git a/tests/unit/unit3212.c b/tests/unit/unit3212.c index 0bffd1f79ce3..3af35f0c575b 100644 --- a/tests/unit/unit3212.c +++ b/tests/unit/unit3212.c @@ -28,7 +28,7 @@ #include "curl_trc.h" #include "unitprotos.h" -#define TBL_SIZE 100 +#define TBL_SIZE 100 static CURLcode t3212_setup(struct uint32_tbl *tbl) { diff --git a/tests/unit/unit3213.c b/tests/unit/unit3213.c index dbd26f4aa49c..c3ec3958e83e 100644 --- a/tests/unit/unit3213.c +++ b/tests/unit/unit3213.c @@ -96,11 +96,12 @@ static CURLcode test_unit3213(const char *arg) { UNITTEST_BEGIN_SIMPLE - static const unsigned int s1[] = { /* spread numbers, some at slot edges */ - 0, 1, 4, 17, 63, 64, 65, 66, - 90, 99, + static const unsigned int s1[] = { + /* spread numbers, some at slot edges */ + 0, 1, 4, 17, 63, 64, 65, 66, 90, 99, }; - static const unsigned int s2[] = { /* set with all bits in slot1 set */ + static const unsigned int s2[] = { + /* set with all bits in slot1 set */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, @@ -110,7 +111,8 @@ static CURLcode test_unit3213(const char *arg) 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, }; - static const unsigned int s3[] = { /* very spread numbers */ + static const unsigned int s3[] = { + /* very spread numbers */ 2232, 5167, 8204, 8526, 8641, 10056, 10140, 10611, 10998, 11626, 13735, 15539, 17947, 24295, 27833, 30318, }; From dfd781ff627991c7b660fe6534c347b1a97bcc17 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Nov 2025 12:34:02 +0100 Subject: [PATCH 658/885] tidy-up: miscellaneous - gnutls, mbedtls: fix casing in log messages. - src/tool_cfgable.h: drop unused header. - appveyor.sh: variable style. - cmakelint.sh: sync with libssh2, catch `.cmake.in` explicitly. - examples: drop obsolete comments, exclamation marks. - fix comment typos, casing. Closes #19839 --- CMakeLists.txt | 4 ++-- appveyor.sh | 4 ++-- docs/examples/anyauthput.c | 2 +- docs/examples/http2-upload.c | 2 +- docs/examples/simplessl.c | 5 ----- lib/urldata.h | 8 ++++---- lib/vtls/gtls.c | 12 ++++++------ lib/vtls/mbedtls.c | 20 ++++++++++---------- packages/OS400/.checksrc | 2 +- scripts/cmakelint.sh | 2 +- src/tool_cfgable.h | 1 - 11 files changed, 28 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b45e7859e090..685335667b9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,9 +66,9 @@ project(CURL LANGUAGES C) # CMake does not recognize some targets accurately. Touch up configuration manually as a workaround. -if(WINDOWS_STORE AND MINGW) # mingw UWP build +if(WINDOWS_STORE AND MINGW) # MinGW UWP build # CMake (as of v3.31.2) gets confused and applies the MSVC rc.exe command-line - # template to windres. Reset it to the windres template via 'Modules/Platform/Windows-windres.cmake': + # template to windres. Reset it to the windres template as in 'Modules/Platform/Windows-windres.cmake': set(CMAKE_RC_COMPILE_OBJECT " -O coff ") elseif(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # DJGPP set(CMAKE_STATIC_LIBRARY_PREFIX "lib") diff --git a/appveyor.sh b/appveyor.sh index 56f8cc35277a..bfcc2b9e5a72 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -45,8 +45,8 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then # Install custom cmake version if [ -n "${CMAKE_VERSION:-}" ]; then cmake_ver=$(printf '%02d%02d' \ - "$(echo "$CMAKE_VERSION" | cut -f1 -d.)" \ - "$(echo "$CMAKE_VERSION" | cut -f2 -d.)") + "$(echo "${CMAKE_VERSION}" | cut -f1 -d.)" \ + "$(echo "${CMAKE_VERSION}" | cut -f2 -d.)") if [ "${cmake_ver}" -ge '0320' ]; then fn="cmake-${CMAKE_VERSION}-windows-x86_64" else diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 247d4d0d3b3a..5a650b64c721 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -150,7 +150,7 @@ int main(int argc, char **argv) /* tell libcurl we can use "any" auth, which lets the lib pick one, but it also costs one extra round-trip and possibly sending of all the PUT - data twice!!! */ + data twice */ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); /* set username and password for the authentication */ diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index e360127a44fd..0f1ed748ca1d 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -27,7 +27,7 @@ */ #ifdef _MSC_VER #ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* for '_snprintf(), fopen(), localtime(), +#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), fopen(), localtime(), strerror() */ #endif #endif diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index 3cf4b462bd50..d08da207bfbf 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -46,11 +46,6 @@ 4. if you do not use a crypto engine: 4.1. set pKeyName to the filename of your client key 4.2. if the format of the key file is DER, set pKeyType to "DER" - - !! verify of the server certificate is not implemented here !! - - **** This example only works with libcurl 7.9.3 and later! **** - */ int main(void) diff --git a/lib/urldata.h b/lib/urldata.h index 899dfff0f10b..bbab0130d318 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -276,13 +276,13 @@ struct ssl_config_data { char *key_type; /* format for private key (default: PEM) */ char *key_passwd; /* plain text private key password */ BIT(certinfo); /* gather lots of certificate info */ - BIT(earlydata); /* use tls1.3 early data */ + BIT(earlydata); /* use TLS 1.3 early data */ BIT(enable_beast); /* allow this flaw for interoperability's sake */ BIT(no_revoke); /* disable SSL certificate revocation checks */ BIT(no_partialchain); /* do not accept partial certificate chains */ BIT(revoke_best_effort); /* ignore SSL revocation offline/missing revocation list errors */ - BIT(native_ca_store); /* use the native ca store of operating system */ + BIT(native_ca_store); /* use the native CA store of operating system */ BIT(auto_client_cert); /* automatically locate and use a client certificate for authentication (Schannel) */ BIT(custom_cafile); /* application has set custom CA file */ @@ -1159,7 +1159,7 @@ enum dupstring { STRING_SSL_PINNEDPUBLICKEY, /* public key file to verify peer against */ STRING_SSL_CIPHER_LIST, /* list of ciphers to use */ STRING_SSL_CIPHER13_LIST, /* list of TLS 1.3 ciphers to use */ - STRING_SSL_CRLFILE, /* crl file to check certificate */ + STRING_SSL_CRLFILE, /* CRL file to check certificate */ STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */ STRING_SERVICE_NAME, /* Service name */ #ifndef CURL_DISABLE_PROXY @@ -1173,7 +1173,7 @@ enum dupstring { STRING_SSL_PINNEDPUBLICKEY_PROXY, /* public key file to verify proxy */ STRING_SSL_CIPHER_LIST_PROXY, /* list of ciphers to use */ STRING_SSL_CIPHER13_LIST_PROXY, /* list of TLS 1.3 ciphers to use */ - STRING_SSL_CRLFILE_PROXY, /* crl file to check certificate */ + STRING_SSL_CRLFILE_PROXY, /* CRL file to check certificate */ STRING_SSL_ISSUERCERT_PROXY, /* issuer cert file to check certificate */ STRING_PROXY_SERVICE_NAME, /* Proxy service name */ #endif diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index e0ba48422b22..667b09c119fa 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -386,7 +386,7 @@ gnutls_set_ssl_version_min_max(struct Curl_easy *data, return CURLE_OK; } - failf(data, "GnuTLS: cannot set ssl protocol"); + failf(data, "GnuTLS: cannot set TLS protocol"); return CURLE_SSL_CONNECT_ERROR; } @@ -460,7 +460,7 @@ static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, #else rc = gnutls_certificate_set_x509_system_trust(creds); if(rc < 0) - infof(data, "error reading native ca store (%s), continuing anyway", + infof(data, "error reading native CA store (%s), continuing anyway", gnutls_strerror(rc)); else { infof(data, " Native: %d certificates from system trust", rc); @@ -483,7 +483,7 @@ static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, GNUTLS_X509_FMT_PEM); creds_are_empty = creds_are_empty && (rc <= 0); if(rc < 0) { - infof(data, "error reading ca cert blob (%s)%s", gnutls_strerror(rc), + infof(data, "error reading CA cert blob (%s)%s", gnutls_strerror(rc), (creds_are_empty ? "" : ", continuing anyway")); if(creds_are_empty) { ssl_config->certverifyresult = rc; @@ -504,7 +504,7 @@ static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, GNUTLS_X509_FMT_PEM); creds_are_empty = creds_are_empty && (rc <= 0); if(rc < 0) { - infof(data, "error reading ca cert file %s (%s)%s", + infof(data, "error reading CA cert file %s (%s)%s", config->CAfile, gnutls_strerror(rc), (creds_are_empty ? "" : ", continuing anyway")); if(creds_are_empty) { @@ -522,7 +522,7 @@ static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, GNUTLS_X509_FMT_PEM); creds_are_empty = creds_are_empty && (rc <= 0); if(rc < 0) { - infof(data, "error reading ca cert file %s (%s)%s", + infof(data, "error reading CA cert file %s (%s)%s", config->CApath, gnutls_strerror(rc), (creds_are_empty ? "" : ", continuing anyway")); if(creds_are_empty) { @@ -542,7 +542,7 @@ static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, rc = gnutls_certificate_set_x509_crl_file(creds, config->CRLfile, GNUTLS_X509_FMT_PEM); if(rc < 0) { - failf(data, "error reading crl file %s (%s)", + failf(data, "error reading CRL file %s (%s)", config->CRLfile, gnutls_strerror(rc)); return CURLE_SSL_CRL_BADFILE; } diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index d33167037162..4eb10d690e5d 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -597,7 +597,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, curlx_free(newblob); if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error importing ca cert blob - mbedTLS: (-0x%04X) %s", + failf(data, "Error importing CA cert blob - mbedTLS: (-0x%04X) %s", -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } @@ -609,12 +609,12 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading ca cert file %s - mbedTLS: (-0x%04X) %s", + failf(data, "Error reading CA cert file %s - mbedTLS: (-0x%04X) %s", ssl_cafile, -ret, errorbuf); return CURLE_SSL_CACERT_BADFILE; } #else - failf(data, "mbedtls: functions that use the file system not built in"); + failf(data, "mbedTLS: functions that use the file system not built in"); return CURLE_NOT_BUILT_IN; #endif } @@ -625,14 +625,14 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading ca cert path %s - mbedTLS: (-0x%04X) %s", + failf(data, "Error reading CA cert path %s - mbedTLS: (-0x%04X) %s", ssl_capath, -ret, errorbuf); if(verifypeer) return CURLE_SSL_CACERT_BADFILE; } #else - failf(data, "mbedtls: functions that use the file system not built in"); + failf(data, "mbedTLS: functions that use the file system not built in"); return CURLE_NOT_BUILT_IN; #endif } @@ -652,7 +652,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, return CURLE_SSL_CERTPROBLEM; } #else - failf(data, "mbedtls: functions that use the file system not built in"); + failf(data, "mbedTLS: functions that use the file system not built in"); return CURLE_NOT_BUILT_IN; #endif } @@ -710,7 +710,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, return CURLE_SSL_CERTPROBLEM; } #else - failf(data, "mbedtls: functions that use the file system not built in"); + failf(data, "mbedTLS: functions that use the file system not built in"); return CURLE_NOT_BUILT_IN; #endif } @@ -766,13 +766,13 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, return CURLE_SSL_CRL_BADFILE; } #else - failf(data, "mbedtls: functions that use the file system not built in"); + failf(data, "mbedTLS: functions that use the file system not built in"); return CURLE_NOT_BUILT_IN; #endif } #else if(ssl_crlfile) { - failf(data, "mbedtls: crl support not built in"); + failf(data, "mbedTLS: CRL support not built in"); return CURLE_NOT_BUILT_IN; } #endif @@ -1161,7 +1161,7 @@ static CURLcode mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data, DEBUGASSERT(backend); *pnwritten = 0; connssl->io_need = CURL_SSL_IO_NEED_NONE; - /* mbedtls is picky when a mbedtls_ssl_write) was previously blocked. + /* mbedTLS is picky when a mbedtls_ssl_write() was previously blocked. * It requires to be called with the same amount of bytes again, or it * will lose bytes, e.g. reporting all was sent but they were not. * Remember the blocked length and use that when set. */ diff --git a/packages/OS400/.checksrc b/packages/OS400/.checksrc index aae405506b9e..3bd88ff1e7db 100644 --- a/packages/OS400/.checksrc +++ b/packages/OS400/.checksrc @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: curl -# Possible not what we want, but cannot test, just silence the warnings +# Possibly not what we want, but cannot test, just silence the warnings allowfunc calloc allowfunc free allowfunc malloc diff --git a/scripts/cmakelint.sh b/scripts/cmakelint.sh index 1e1cc592ed3f..a9bd7472d479 100755 --- a/scripts/cmakelint.sh +++ b/scripts/cmakelint.sh @@ -52,7 +52,7 @@ cd "$(dirname "$0")"/.. # strip off the leading ./ to make the grep regexes work properly find . -type f | sed 's@^\./@@' fi -} | grep -E '(^CMake|/CMake|\.cmake$)' | grep -v -E '(\.h\.cmake|\.c)$' \ +} | grep -E '(^CMake|/CMake|\.cmake$|\.cmake\.in$)' | grep -v -E '(\.h\.cmake|\.c)$' \ | xargs \ cmake-lint \ --suppress-decorations \ diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 5652229d4b79..d02635ce244e 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -24,7 +24,6 @@ * ***************************************************************************/ -#include #include "tool_setup.h" #include "tool_sdecls.h" #include "tool_urlglob.h" From f97e62ff147feff09e1a29a2db6b4a7f928d75a0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 2 Dec 2025 17:45:18 +0100 Subject: [PATCH 659/885] sws: fix binding to unix socket on Windows Windows 10.17063+ (having unix socket support) fails to set for unix sockets the `SO_REUSEADDR` option, with error 10045 (`WSAEOPNOTSUPP`), and also fails to set `SO_KEEPALIVE` with error 10042 (`WSAENOPROTOOPT`). Fix by not enabling these socket options on Windows for unix sockets. Also: - fixing test 1435, 1436 to run in CI. - fixing the `socksd` test server for test 1467, 1468, 1470. But, also disable these for now due to another Windows issue: #19825 Ref: https://stackoverflow.com/questions/68791319/unix-domain-socket-bind-failed-in-windows/68794755#68794755 Ref: #19810 Closes #19812 --- tests/data/test1467 | 2 ++ tests/data/test1468 | 2 ++ tests/data/test1470 | 2 ++ tests/server/sws.c | 39 ++++++++++++++++--------- tests/server/util.c | 70 ++++++++++++++++++++++++--------------------- 5 files changed, 70 insertions(+), 45 deletions(-) diff --git a/tests/data/test1467 b/tests/data/test1467 index 69b04d8bf485..46cb69059ba5 100644 --- a/tests/data/test1467 +++ b/tests/data/test1467 @@ -30,9 +30,11 @@ Funny-head: yesyes # # Client-side +# --socks5 cannot accept Windows absolute paths proxy UnixSockets +!win32 http diff --git a/tests/data/test1468 b/tests/data/test1468 index 7cb9b1345629..1ed654adcc8a 100644 --- a/tests/data/test1468 +++ b/tests/data/test1468 @@ -31,9 +31,11 @@ Funny-head: yesyes # # Client-side +# --socks5h cannot accept Windows absolute paths proxy UnixSockets +!win32 http diff --git a/tests/data/test1470 b/tests/data/test1470 index c93af27f7db3..691fcc9a44cc 100644 --- a/tests/data/test1470 +++ b/tests/data/test1470 @@ -32,9 +32,11 @@ Funny-head: yesyes # # Client-side +# --proxy cannot accept Windows absolute paths proxy UnixSockets +!win32 https diff --git a/tests/server/sws.c b/tests/server/sws.c index 56135a832636..c7ce24922418 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -1863,14 +1863,20 @@ static curl_socket_t accept_connection(curl_socket_t sock) return CURL_SOCKET_BAD; } - if(setsockopt(msgsock, SOL_SOCKET, SO_KEEPALIVE, - (void *)&flag, sizeof(flag))) { - error = SOCKERRNO; - logmsg("setsockopt(SO_KEEPALIVE) failed with error (%d) %s", - error, curlx_strerror(error, errbuf, sizeof(errbuf))); - sclose(msgsock); - return CURL_SOCKET_BAD; +#if defined(_WIN32) && defined(USE_UNIX_SOCKETS) + if(socket_domain != AF_UNIX) { +#endif + if(setsockopt(msgsock, SOL_SOCKET, SO_KEEPALIVE, + (void *)&flag, sizeof(flag))) { + error = SOCKERRNO; + logmsg("setsockopt(SO_KEEPALIVE) failed with error (%d) %s", + error, curlx_strerror(error, errbuf, sizeof(errbuf))); + sclose(msgsock); + return CURL_SOCKET_BAD; + } +#if defined(_WIN32) && defined(USE_UNIX_SOCKETS) } +#endif /* ** As soon as this server accepts a connection from the test harness it @@ -2176,13 +2182,20 @@ static int test_sws(int argc, char *argv[]) goto sws_cleanup; } - flag = 1; - if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { - error = SOCKERRNO; - logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", - error, curlx_strerror(error, errbuf, sizeof(errbuf))); - goto sws_cleanup; +#if defined(_WIN32) && defined(USE_UNIX_SOCKETS) + if(socket_domain != AF_UNIX) { +#endif + flag = 1; + if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, + (void *)&flag, sizeof(flag))) { + error = SOCKERRNO; + logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", + error, curlx_strerror(error, errbuf, sizeof(errbuf))); + goto sws_cleanup; + } +#if defined(_WIN32) && defined(USE_UNIX_SOCKETS) } +#endif if(curlx_nonblock(sock, TRUE)) { error = SOCKERRNO; logmsg("curlx_nonblock failed with error (%d) %s", diff --git a/tests/server/util.c b/tests/server/util.c index 624826571a9f..b021aa43dc91 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -763,42 +763,48 @@ curl_socket_t sockdaemon(curl_socket_t sock, (void)unix_socket; #endif - do { - attempt++; - flag = 1; - rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag)); - if(rc) { - error = SOCKERRNO; - logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", - error, curlx_strerror(error, errbuf, sizeof(errbuf))); - if(maxretr) { - rc = curlx_wait_ms(delay); - if(rc) { - /* should not happen */ - error = SOCKERRNO; - logmsg("curlx_wait_ms() failed with error (%d) %s", - error, curlx_strerror(error, errbuf, sizeof(errbuf))); - sclose(sock); - return CURL_SOCKET_BAD; - } - if(got_exit_signal) { - logmsg("signalled to die, exiting..."); - sclose(sock); - return CURL_SOCKET_BAD; +#if defined(_WIN32) && defined(USE_UNIX_SOCKETS) + if(socket_domain != AF_UNIX) { +#endif + do { + attempt++; + flag = 1; + rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, + (void *)&flag, sizeof(flag)); + if(rc) { + error = SOCKERRNO; + logmsg("setsockopt(SO_REUSEADDR) failed with error (%d) %s", + error, curlx_strerror(error, errbuf, sizeof(errbuf))); + if(maxretr) { + rc = curlx_wait_ms(delay); + if(rc) { + /* should not happen */ + error = SOCKERRNO; + logmsg("curlx_wait_ms() failed with error (%d) %s", + error, curlx_strerror(error, errbuf, sizeof(errbuf))); + sclose(sock); + return CURL_SOCKET_BAD; + } + if(got_exit_signal) { + logmsg("signalled to die, exiting..."); + sclose(sock); + return CURL_SOCKET_BAD; + } + totdelay += delay; + delay *= 2; /* double the sleep for next attempt */ } - totdelay += delay; - delay *= 2; /* double the sleep for next attempt */ } - } - } while(rc && maxretr--); + } while(rc && maxretr--); - if(rc) { - logmsg("setsockopt(SO_REUSEADDR) failed %d times in %d ms. Error (%d) %s", - attempt, totdelay, - error, curlx_strerror(error, errbuf, sizeof(errbuf))); - logmsg("Continuing anyway..."); + if(rc) { + logmsg("setsockopt(SO_REUSEADDR) failed %d times in %d ms. " + "Error (%d) %s", attempt, totdelay, + error, curlx_strerror(error, errbuf, sizeof(errbuf))); + logmsg("Continuing anyway..."); + } +#if defined(_WIN32) && defined(USE_UNIX_SOCKETS) } +#endif /* When the specified listener port is zero, it is actually a request to let the system choose a non-zero available port. */ From df07f431e2077881b13e655083a3929242615056 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 Nov 2025 10:54:28 +0100 Subject: [PATCH 660/885] mbedtls: sync format across log messages Closes #19842 --- lib/vtls/mbedtls.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4eb10d690e5d..49c557de0311 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -597,7 +597,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, curlx_free(newblob); if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error importing CA cert blob - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error importing CA cert blob: (-0x%04X) %s", -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } @@ -609,7 +609,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading CA cert file %s - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error reading CA cert file %s: (-0x%04X) %s", ssl_cafile, -ret, errorbuf); return CURLE_SSL_CACERT_BADFILE; } @@ -625,7 +625,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading CA cert path %s - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error reading CA cert path %s: (-0x%04X) %s", ssl_capath, -ret, errorbuf); if(verifypeer) @@ -646,7 +646,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading client cert file %s - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error reading client cert file %s: (-0x%04X) %s", ssl_cert, -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; @@ -671,7 +671,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading client cert data %s - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error reading client cert data %s: (-0x%04X) %s", ssl_config->key, -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } @@ -705,7 +705,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading private key %s - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error reading private key %s: (-0x%04X) %s", ssl_config->key, -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } @@ -743,7 +743,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error parsing private key - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error parsing private key: (-0x%04X) %s", -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } @@ -760,7 +760,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading CRL file %s - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: error reading CRL file %s: (-0x%04X) %s", ssl_crlfile, -ret, errorbuf); return CURLE_SSL_CRL_BADFILE; @@ -822,7 +822,7 @@ static CURLcode mbed_connect_step1(struct Curl_cfilter *cf, ret = mbedtls_ssl_setup(&backend->ssl, &backend->config); if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "ssl_setup failed - mbedTLS: (-0x%04X) %s", + failf(data, "mbedTLS: ssl_setup failed: (-0x%04X) %s", -ret, errorbuf); return CURLE_SSL_CONNECT_ERROR; } From 6d042273cde6e4f0fd3ea0af25b37c96356ac9c6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Dec 2025 20:28:34 +0100 Subject: [PATCH 661/885] openssl: simplify `HAVE_KEYLOG_CALLBACK` guard non-LibreSSL always includes BoringSSL and AWS-LC, no need to check for them explicitly. Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330 Closes #19843 --- lib/vtls/openssl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h index ff8246b4fae3..c3ba67a8ff41 100644 --- a/lib/vtls/openssl.h +++ b/lib/vtls/openssl.h @@ -51,7 +51,7 @@ * BoringSSL: supported since d28f59c27bac (committed 2015-11-19) * LibreSSL: not supported. 3.5.0+ has a stub function that does nothing. */ -#if !defined(LIBRESSL_VERSION_NUMBER) || defined(HAVE_BORINGSSL_LIKE) +#ifndef LIBRESSL_VERSION_NUMBER #define HAVE_KEYLOG_CALLBACK #endif From ebe6fa08c9df12aa1c66cacf49a6e503a6e45d02 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Dec 2025 20:11:45 +0100 Subject: [PATCH 662/885] docs/libcurl: fix C formatting nits Closes #19844 --- docs/libcurl/curl_easy_nextheader.md | 2 +- docs/libcurl/curl_easy_pause.md | 1 - docs/libcurl/curl_formadd.md | 2 +- docs/libcurl/curl_formget.md | 4 +-- docs/libcurl/curl_mime_data_cb.md | 2 +- docs/libcurl/curl_mprintf.md | 2 +- docs/libcurl/curl_multi_fdset.md | 2 +- docs/libcurl/curl_ws_meta.md | 4 +-- docs/libcurl/libcurl-tutorial.md | 32 +++++++++++----------- docs/libcurl/opts/CURLINFO_USED_PROXY.md | 2 +- docs/libcurl/opts/CURLOPT_COOKIELIST.md | 2 +- docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md | 2 +- docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md | 2 +- 13 files changed, 28 insertions(+), 31 deletions(-) diff --git a/docs/libcurl/curl_easy_nextheader.md b/docs/libcurl/curl_easy_nextheader.md index 2dbdf61ccdbd..c3dd223b8c8c 100644 --- a/docs/libcurl/curl_easy_nextheader.md +++ b/docs/libcurl/curl_easy_nextheader.md @@ -83,7 +83,7 @@ int main(void) } /* extract the normal headers + 1xx + trailers from the last request */ - unsigned int origin = CURLH_HEADER| CURLH_1XX | CURLH_TRAILER; + unsigned int origin = CURLH_HEADER | CURLH_1XX | CURLH_TRAILER; while((h = curl_easy_nextheader(curl, origin, -1, prev))) { printf("%s: %s\n", h->name, h->value); prev = h; diff --git a/docs/libcurl/curl_easy_pause.md b/docs/libcurl/curl_easy_pause.md index 2f47c4ef3f7f..b6390058e89a 100644 --- a/docs/libcurl/curl_easy_pause.md +++ b/docs/libcurl/curl_easy_pause.md @@ -109,7 +109,6 @@ int main(void) if(curl) { /* pause a transfer in both directions */ curl_easy_pause(curl, CURLPAUSE_RECV | CURLPAUSE_SEND); - } } ~~~ diff --git a/docs/libcurl/curl_formadd.md b/docs/libcurl/curl_formadd.md index f35e50eab754..ca05f4310aff 100644 --- a/docs/libcurl/curl_formadd.md +++ b/docs/libcurl/curl_formadd.md @@ -225,7 +225,7 @@ int main(void) char file2[] = "your-face.jpg"; /* add null character into htmlbuffer, to demonstrate that transfers of buffers containing null characters actually work - */ + */ htmlbuffer[8] = '\0'; /* Add simple name/content section */ diff --git a/docs/libcurl/curl_formget.md b/docs/libcurl/curl_formget.md index 264eb5cbcbb3..316609e93a97 100644 --- a/docs/libcurl/curl_formget.md +++ b/docs/libcurl/curl_formget.md @@ -54,7 +54,7 @@ This, because first then does libcurl known which actual read callback to use. size_t print_httppost_callback(void *arg, const char *buf, size_t len) { fwrite(buf, len, 1, stdout); - (*(size_t *) arg) += len; + (*(size_t *)arg) += len; return len; } @@ -62,7 +62,7 @@ size_t print_httppost(struct curl_httppost *post) { size_t total_size = 0; if(curl_formget(post, &total_size, print_httppost_callback)) { - return (size_t) -1; + return (size_t)-1; } return total_size; } diff --git a/docs/libcurl/curl_mime_data_cb.md b/docs/libcurl/curl_mime_data_cb.md index 9b3fdd5593bd..bed7c5d78f47 100644 --- a/docs/libcurl/curl_mime_data_cb.md +++ b/docs/libcurl/curl_mime_data_cb.md @@ -120,7 +120,7 @@ struct ctl { size_t read_callback(char *buffer, size_t size, size_t nitems, void *arg) { - struct ctl *p = (struct ctl *) arg; + struct ctl *p = (struct ctl *)arg; curl_off_t sz = p->size - p->position; nitems *= size; diff --git a/docs/libcurl/curl_mprintf.md b/docs/libcurl/curl_mprintf.md index a592cfb3e661..508dece91974 100644 --- a/docs/libcurl/curl_mprintf.md +++ b/docs/libcurl/curl_mprintf.md @@ -274,7 +274,7 @@ const char *name = "John"; int main(void) { curl_mprintf("My name is %s\n", name); - curl_mprintf("Pi is almost %f\n", (double)25.0/8); + curl_mprintf("Pi is almost %f\n", (double)25.0 / 8); } ~~~ diff --git a/docs/libcurl/curl_multi_fdset.md b/docs/libcurl/curl_multi_fdset.md index 1396738014c3..24d6664f4998 100644 --- a/docs/libcurl/curl_multi_fdset.md +++ b/docs/libcurl/curl_multi_fdset.md @@ -92,7 +92,7 @@ int main(void) int maxfd; int rc; CURLMcode mc; - struct timeval timeout = {1, 0}; + struct timeval timeout = { 1, 0 }; CURLM *multi = curl_multi_init(); diff --git a/docs/libcurl/curl_ws_meta.md b/docs/libcurl/curl_ws_meta.md index e34e5476764a..978520afd8d0 100644 --- a/docs/libcurl/curl_ws_meta.md +++ b/docs/libcurl/curl_ws_meta.md @@ -137,8 +137,7 @@ struct customdata { void *ptr; }; -static size_t writecb(char *buffer, - size_t size, size_t nitems, void *p) +static size_t writecb(char *buffer, size_t size, size_t nitems, void *p) { struct customdata *c = (struct customdata *)p; const struct curl_ws_frame *m = curl_ws_meta(c->easy); @@ -158,7 +157,6 @@ int main(void) curl_easy_setopt(curl, CURLOPT_WRITEDATA, &custom); curl_easy_perform(curl); - } return 0; } diff --git a/docs/libcurl/libcurl-tutorial.md b/docs/libcurl/libcurl-tutorial.md index e515b3b7b067..7b01d234c4c9 100644 --- a/docs/libcurl/libcurl-tutorial.md +++ b/docs/libcurl/libcurl-tutorial.md @@ -448,7 +448,7 @@ claims to support. This method does however add a round-trip since libcurl must first ask the server what it supports: ~~~c - curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC); + curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST | CURLAUTH_BASIC); ~~~ For convenience, you can use the *CURLAUTH_ANY* define (instead of a list with @@ -468,7 +468,7 @@ pages using the \ tag uses. We provide a pointer to the data and tell libcurl to post it all to the remote site: ~~~c - char *data="name=daniel&project=curl"; + char *data = "name=daniel&project=curl"; curl_easy_setopt(handle, CURLOPT_POSTFIELDS, data); curl_easy_setopt(handle, CURLOPT_URL, "http://posthere.com/"); @@ -487,7 +487,7 @@ done in a generic way, by building a list of our own headers and then passing that list to libcurl. ~~~c - struct curl_slist *headers=NULL; + struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Content-Type: text/xml"); /* post binary data */ @@ -574,8 +574,8 @@ parts, you post the whole form. The MIME API example above is expressed as follows using this function: ~~~c - struct curl_httppost *post=NULL; - struct curl_httppost *last=NULL; + struct curl_httppost *post = NULL; + struct curl_httppost *last = NULL; curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_COPYCONTENTS, "daniel", CURLFORM_END); @@ -605,7 +605,7 @@ shows how you set headers to one specific part when you add that to the post handle: ~~~c - struct curl_slist *headers=NULL; + struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Content-Type: text/xml"); curl_formadd(&post, &last, @@ -675,7 +675,7 @@ becomes: ~~~c part = curl_mime_addpart(multipart); curl_mime_name(part, "logotype-image"); - curl_mime_data_cb(part, (curl_off_t) -1, fread, fseek, NULL, stdin); + curl_mime_data_cb(part, (curl_off_t)-1, fread, fseek, NULL, stdin); ~~~ curl_mime_name(3) always copies the field name. The special filename "-" is @@ -717,7 +717,7 @@ becomes: ~~~c part = curl_mime_addpart(multipart); curl_mime_name(part, "stream"); - curl_mime_data_cb(part, (curl_off_t) datasize, + curl_mime_data_cb(part, (curl_off_t)datasize, myreadfunc, NULL, NULL, arg); curl_mime_filename(part, "archive.zip"); curl_mime_type(part, "application/zip"); @@ -738,7 +738,7 @@ becomes: ~~~c part = curl_mime_addpart(multipart); curl_mime_name(part, "memfile"); - curl_mime_data(part, databuffer, (curl_off_t) sizeof databuffer); + curl_mime_data(part, databuffer, (curl_off_t)sizeof(databuffer)); curl_mime_filename(part, "memfile.bin"); ~~~ @@ -802,12 +802,12 @@ Example C++ code: ~~~c class AClass { - static size_t write_data(void *ptr, size_t size, size_t nmemb, - void *ourpointer) - { - /* do what you want with the data */ - } - } + static size_t write_data(void *ptr, size_t size, size_t nmemb, + void *ourpointer) + { + /* do what you want with the data */ + } +} ~~~ # Proxies @@ -1046,7 +1046,7 @@ request, and you are free to pass any amount of extra headers that you think fit. Adding headers is this easy: ~~~c -struct curl_slist *headers=NULL; /* init to NULL is important */ +struct curl_slist *headers = NULL; /* init to NULL is important */ headers = curl_slist_append(headers, "Hey-server-hey: how are you?"); headers = curl_slist_append(headers, "X-silly-content: yes"); diff --git a/docs/libcurl/opts/CURLINFO_USED_PROXY.md b/docs/libcurl/opts/CURLINFO_USED_PROXY.md index 01ef3610db0e..3d652c73b016 100644 --- a/docs/libcurl/opts/CURLINFO_USED_PROXY.md +++ b/docs/libcurl/opts/CURLINFO_USED_PROXY.md @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) long used; res = curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &used); if(!res) { - printf("The proxy was %sused\n", used ? "": "NOT "); + printf("The proxy was %sused\n", used ? "" : "NOT "); } } curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLOPT_COOKIELIST.md b/docs/libcurl/opts/CURLOPT_COOKIELIST.md index a2c43d8dfe2d..5124a53e64b6 100644 --- a/docs/libcurl/opts/CURLOPT_COOKIELIST.md +++ b/docs/libcurl/opts/CURLOPT_COOKIELIST.md @@ -77,7 +77,7 @@ NULL ~~~c /* an inline import of a cookie in Netscape format. */ -#define SEP "\t" /* Tab separates the fields */ +#define SEP "\t" /* Tab separates the fields */ int main(void) { diff --git a/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md b/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md index a9adf6b77d5a..826fc4c1f2b3 100644 --- a/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md +++ b/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md @@ -35,7 +35,7 @@ password with the CURLOPT_PROXYUSERPWD(3) option. # DEFAULT -CURLAUTH_BASIC|CURLAUTH_GSSAPI +CURLAUTH_BASIC | CURLAUTH_GSSAPI # %PROTOCOLS% diff --git a/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md b/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md index 973a0aea754e..ad4b4e0360f3 100644 --- a/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md @@ -106,7 +106,7 @@ static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) int main(void) { - struct memory chunk = {0}; + struct memory chunk = { 0 }; CURLcode res; CURL *curl = curl_easy_init(); if(curl) { From a1531261b1ed6d0936646794cc169eb6f55bf3ff Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 19:57:44 +0100 Subject: [PATCH 663/885] CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use The example code does not use curl_multi_assign(), but its callback function used socketp (called sockp in the function) to get the struct priv pointer instead of the correct clientp (cbp). Reported-by: Greg Hudson Fixes #19840 Closes #19841 --- docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md index fae15d58a2a9..411b856e9328 100644 --- a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md +++ b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md @@ -109,7 +109,7 @@ struct priv { static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { - struct priv *p = sockp; + struct priv *p = cbp; printf("our ptr: %p\n", p->ours); if(what == CURL_POLL_REMOVE) { From f1f76e0ea83921000f228ce49748047e33e1e46d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2025 19:01:02 +0100 Subject: [PATCH 664/885] url: if curl_url_get() fails due to OOM, error out properly Even if the scheme is "file"! Closes #19838 --- lib/url.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/url.c b/lib/url.c index 043d7ca72cb3..0643ceea7f8c 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1919,7 +1919,8 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, uc = curl_url_get(uh, CURLUPART_PORT, &data->state.up.port, CURLU_DEFAULT_PORT); if(uc) { - if(!curl_strequal("file", data->state.up.scheme)) + if((uc == CURLUE_OUT_OF_MEMORY) || + !curl_strequal("file", data->state.up.scheme)) return CURLE_OUT_OF_MEMORY; } else { From 859ce48de12986f5bf846c2800dacab893ff12c1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Dec 2025 15:32:44 +0100 Subject: [PATCH 665/885] ldap: detect version of "legacy" LDAP Legacy LDAP means an OpenLDAP-compatible implementation without the private API `ldap_init_fd()` introduced in OpenLDAP 2.4.6+ (2007-10-31), and not WinLDAP. One known example is Apple's LDAP build, which is based on OpenLDAP 2.4.28 (2011-11-25), without providing this private API. The version query API was introduced around 1998-1999, before the minimum (2.0 2000-08-01) required by curl. Follow-up to 3e2a946926853608d67805bd9f4a58345fff364a #19808 Closes #19832 --- lib/ldap.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/ldap.c b/lib/ldap.c index 6104ff207344..92cfa3967fcf 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -1029,7 +1029,27 @@ void Curl_ldap_version(char *buf, size_t bufsz) #ifdef USE_WIN32_LDAP curl_msnprintf(buf, bufsz, "WinLDAP"); #else - curl_msnprintf(buf, bufsz, "LDAP/1"); +#ifdef __APPLE__ + static const char *flavor = "/Apple"; +#else + static const char *flavor = ""; +#endif + LDAPAPIInfo api; + api.ldapai_info_version = LDAP_API_INFO_VERSION; + + if(ldap_get_option(NULL, LDAP_OPT_API_INFO, &api) == LDAP_OPT_SUCCESS) { + unsigned int patch = (unsigned int)(api.ldapai_vendor_version % 100); + unsigned int major = (unsigned int)(api.ldapai_vendor_version / 10000); + unsigned int minor = + (((unsigned int)api.ldapai_vendor_version - major * 10000) + - patch) / 100; + curl_msnprintf(buf, bufsz, "%s/%u.%u.%u%s", + api.ldapai_vendor_name, major, minor, patch, flavor); + ldap_memfree(api.ldapai_vendor_name); + ber_memvfree((void **)api.ldapai_extensions); + } + else + curl_msnprintf(buf, bufsz, "LDAP/1"); #endif } From 68a44edd500ac36754eea4f80beb5dcbe8534723 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 08:51:11 +0100 Subject: [PATCH 666/885] TODO: remove a mandriva.com reference It's a casino now --- docs/TODO | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/TODO b/docs/TODO index 99e8d1dd605b..817591dfb7cb 100644 --- a/docs/TODO +++ b/docs/TODO @@ -1177,9 +1177,7 @@ -y/-Y) the next attempt does not resume the transfer properly from what was downloaded in the previous attempt but truncates and restarts at the original position where it was at before the previous failed attempt. See - https://curl.se/mail/lib-2008-01/0080.html and Mandriva bug report - https://qa.mandriva.com/show_bug.cgi?id=22565 - + https://curl.se/mail/lib-2008-01/0080.html 19. Build From 8d9aa6d6e12cb35b074dd66da454795c8808a41b Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 2 Dec 2025 15:53:29 +0100 Subject: [PATCH 667/885] tests/servers: put unix-domain-path inside LOGDIR Change Unix domain socket paths from `/tmp/curl-socksd-` to `/drive/path/to/LOGDIR/PIDDIR/*-uds` to avoid having to create and delete them before use. Also to use a path which remains an absolute one while passed from MSYS2 Perl to native Windows curl tool and test server via the command-line, and keep pointing to the same location, fixing: ``` === Start of file commands.log ../src/curl.exe -q --output log/3/curl1468.out --include --trace-ascii log/3/trace1468 --trace-time http://this.is.a.host.name:64405/1468 --proxy socks5h://localhost/tmp/curl-socksd-YnbvRo98 [...] === End of file commands.log === Start of file socks2_server.log [...] 14:11:54.597968 Listening on Unix socket D:/a/_temp/msys64/tmp/curl-socksd-YnbvRo98 ``` Ref: https://github.com/curl/curl/actions/runs/19896583933/job/57028545111?pr=19812 The curl tool is pending #19825 to fix accepting an absolute unix domain socket path on Windows. Assisted-by: Viktor Szakats Closes #19810 --- tests/servers.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/servers.pm b/tests/servers.pm index db4b3757b547..f23d897fdd84 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -195,14 +195,8 @@ use File::Temp qw/ tempfile/; ####################################################################### # Initialize configuration variables sub initserverconfig { - my ($fh, $socks) = tempfile("curl-socksd-XXXXXXXX", TMPDIR => 1); - close($fh); - unlink($socks); - my ($f2, $http) = tempfile("curl-http-XXXXXXXX", TMPDIR => 1); - close($f2); - unlink($http); - $SOCKSUNIXPATH = $socks; # SOCKS Unix domain socket - $HTTPUNIXPATH = $http; # HTTP Unix domain socket + $SOCKSUNIXPATH = "$pwd/$LOGDIR/$PIDDIR/socks-uds"; # SOCKS Unix domain socket + $HTTPUNIXPATH = "$pwd/$LOGDIR/$PIDDIR/http-uds"; # HTTP Unix domain socket $stunnel = checkcmd("stunnel4") || checkcmd("tstunnel") || checkcmd("stunnel"); # get the name of the current user From 2d6ade19fc4261e22e9d32a00bf60eabb8694bcb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 5 Dec 2025 12:43:37 +0100 Subject: [PATCH 668/885] ldap: improve detection of Apple LDAP When detecting the Apple fork of "legacy" LDAP, replace the `__APPLE__` macro (which can be present also when using an old mainline OpenLDAP while building for an Apple platform) with `LDAP_OPT_X_TLS_PASSPHRASE` which is an Apple-specific macro, merged by Apple in 2007, later adding the comment 'Apple Specific code'. This macro hasn't been retrofitted to OpenLDAP since then, and unlikely to happen in the future. Refs: https://github.com/apple-oss-distributions/OpenLDAP/commit/c4d990a6cfa0cb71d6dffe6f6aeeb722fd7c627b#diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R145 https://github.com/apple-oss-distributions/OpenLDAP/commit/49ac28a486d72f36cd9713b41180b41d34f18ef6#diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R166 Follow-up to 859ce48de12986f5bf846c2800dacab893ff12c1 #19832 Closes #19849 --- lib/ldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldap.c b/lib/ldap.c index 92cfa3967fcf..3dfbb330dc94 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -1029,7 +1029,7 @@ void Curl_ldap_version(char *buf, size_t bufsz) #ifdef USE_WIN32_LDAP curl_msnprintf(buf, bufsz, "WinLDAP"); #else -#ifdef __APPLE__ +#ifdef LDAP_OPT_X_TLS_PASSPHRASE static const char *flavor = "/Apple"; #else static const char *flavor = ""; From 4e051ff5506319ee87e3656be8f76b01de217103 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Dec 2025 23:54:25 +0100 Subject: [PATCH 669/885] curlx: limit use of system allocators to the minimum possible Clone a multibye conversion function into curlx/fopen, and use that local copy from curlx/fopen functions. Adjust allocators in curlx/fopen to use curl's in normal builds, and system allocators in TrackMemory builds to avoid recursion. This allows to switch curlx/multibyte functions to curl allocators in all configurations, as they are no longer called by curlx/fopen, and a recursive call can no longer happen. After this patch the system allocator is only used in TrackMemory Windows builds, within curlx `fopen`, `freopen`, `stat` and `open` functions. Also: - test 1, 440, 767: raise allocation limitsto fit the extra allocations in Windows Unicode builds. - replace all uses of `curlx_unicodefree()` macro with `curlx_free()` across the codebase. - curlx/multibyte: delete `curlx_unicodefree()`. - ldap: join Windows and non-Windows codepaths that became identical after moving from `curlx_unicodefree()` to `curlx_free()`. - vauth: drop a strdup from standard to curl allocator since the original allocation is now already done by curl's. - tool_doswin: drop now superfluous strdup from `FindWin32CACert()`. - memanalyzer.pm: sync weirdo `calloc` log message with `malloc`'s. Fixes #19748 Closes #19845 --- lib/curl_sspi.c | 14 ++++---- lib/curlx/curlx.h | 1 - lib/curlx/fopen.c | 69 +++++++++++++++++++++++++++----------- lib/curlx/multibyte.c | 13 +++---- lib/curlx/multibyte.h | 27 ++------------- lib/ldap.c | 15 ++------- lib/rename.c | 8 ++--- lib/socks_sspi.c | 4 +-- lib/vauth/digest_sspi.c | 8 ++--- lib/vauth/vauth.c | 12 ++----- lib/vtls/schannel.c | 16 ++++----- lib/vtls/schannel_verify.c | 4 +-- src/tool_doswin.c | 7 ++-- src/tool_filetime.c | 4 +-- src/tool_getparam.h | 2 +- tests/data/test1 | 2 +- tests/data/test440 | 2 +- tests/data/test767 | 2 +- tests/memanalyzer.pm | 3 +- 19 files changed, 100 insertions(+), 113 deletions(-) diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index 264703d8cd70..712fab2e9e82 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -132,7 +132,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, /* Setup the identity's user and length */ dup_user.tchar_ptr = curlx_tcsdup(user.tchar_ptr); if(!dup_user.tchar_ptr) { - curlx_unicodefree(useranddomain.tchar_ptr); + curlx_free(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } identity->User = dup_user.tbyte_ptr; @@ -142,19 +142,19 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, /* Setup the identity's domain and length */ dup_domain.tchar_ptr = curlx_malloc(sizeof(TCHAR) * (domlen + 1)); if(!dup_domain.tchar_ptr) { - curlx_unicodefree(useranddomain.tchar_ptr); + curlx_free(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } if(_tcsncpy_s(dup_domain.tchar_ptr, domlen + 1, domain.tchar_ptr, domlen)) { - curlx_unicodefree(dup_domain.tchar_ptr); - curlx_unicodefree(useranddomain.tchar_ptr); + curlx_free(dup_domain.tchar_ptr); + curlx_free(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } identity->Domain = dup_domain.tbyte_ptr; identity->DomainLength = curlx_uztoul(domlen); dup_domain.tchar_ptr = NULL; - curlx_unicodefree(useranddomain.tchar_ptr); + curlx_free(useranddomain.tchar_ptr); /* Setup the identity's password and length */ passwd.tchar_ptr = curlx_convert_UTF8_to_tchar(passwdp); @@ -162,14 +162,14 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, return CURLE_OUT_OF_MEMORY; dup_passwd.tchar_ptr = curlx_tcsdup(passwd.tchar_ptr); if(!dup_passwd.tchar_ptr) { - curlx_unicodefree(passwd.tchar_ptr); + curlx_free(passwd.tchar_ptr); return CURLE_OUT_OF_MEMORY; } identity->Password = dup_passwd.tbyte_ptr; identity->PasswordLength = curlx_uztoul(_tcslen(dup_passwd.tchar_ptr)); dup_passwd.tchar_ptr = NULL; - curlx_unicodefree(passwd.tchar_ptr); + curlx_free(passwd.tchar_ptr); /* Setup the identity's flags */ identity->Flags = (unsigned long) diff --git a/lib/curlx/curlx.h b/lib/curlx/curlx.h index 480e91950de0..af46fae671d5 100644 --- a/lib/curlx/curlx.h +++ b/lib/curlx/curlx.h @@ -52,7 +52,6 @@ curlx_convert_wchar_to_UTF8() curlx_convert_UTF8_to_tchar() curlx_convert_tchar_to_UTF8() - curlx_unicodefree() */ #include "version_win32.h" diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index 1838b7de8b8c..c9b7a9c0b590 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -22,11 +22,6 @@ * ***************************************************************************/ -/* - * Use system allocators to avoid infinite recursion when called by curl's - * memory tracker memdebug functions. - */ - #include "../curl_setup.h" #include "fopen.h" @@ -46,10 +41,43 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence) #ifdef _WIN32 -#include "multibyte.h" - #include /* for _SH_DENYNO */ +#ifdef CURLDEBUG +/* + * Use system allocators to avoid infinite recursion when called by curl's + * memory tracker memdebug functions. + */ +#define CURLX_MALLOC(x) malloc(x) +#define CURLX_FREE(x) free(x) +#else +#define CURLX_MALLOC(x) curlx_malloc(x) +#define CURLX_FREE(x) curlx_free(x) +#endif + +#ifdef _UNICODE +static wchar_t *fn_convert_UTF8_to_wchar(const char *str_utf8) +{ + wchar_t *str_w = NULL; + + if(str_utf8) { + int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, + str_utf8, -1, NULL, 0); + if(str_w_len > 0) { + str_w = CURLX_MALLOC(str_w_len * sizeof(wchar_t)); + if(str_w) { + if(MultiByteToWideChar(CP_UTF8, 0, + str_utf8, -1, str_w, str_w_len) == 0) { + CURLX_FREE(str_w); + return NULL; + } + } + } + } + return str_w; +} +#endif + /* declare GetFullPathNameW for mingw-w64 UWP builds targeting old windows */ #if defined(CURL_WINDOWS_UWP) && defined(__MINGW32__) && \ (_WIN32_WINNT < _WIN32_WINNT_WIN10) @@ -228,7 +256,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) const TCHAR *target = NULL; #ifdef _UNICODE - wchar_t *filename_w = curlx_convert_UTF8_to_wchar(filename); + wchar_t *filename_w = fn_convert_UTF8_to_wchar(filename); #endif va_list param; @@ -244,7 +272,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) else target = filename_w; errno = _wsopen_s(&result, target, oflag, _SH_DENYNO, pmode); - curlx_unicodefree(filename_w); + CURLX_FREE(filename_w); } else /* !checksrc! disable ERRNOVAR 1 */ @@ -268,8 +296,8 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) const TCHAR *target = NULL; #ifdef _UNICODE - wchar_t *filename_w = curlx_convert_UTF8_to_wchar(filename); - wchar_t *mode_w = curlx_convert_UTF8_to_wchar(mode); + wchar_t *filename_w = fn_convert_UTF8_to_wchar(filename); + wchar_t *mode_w = fn_convert_UTF8_to_wchar(mode); if(filename_w && mode_w) { if(fix_excessive_path(filename_w, &fixed)) target = fixed; @@ -280,8 +308,8 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) else /* !checksrc! disable ERRNOVAR 1 */ errno = EINVAL; - curlx_unicodefree(filename_w); - curlx_unicodefree(mode_w); + CURLX_FREE(filename_w); + CURLX_FREE(mode_w); #else if(fix_excessive_path(filename, &fixed)) target = fixed; @@ -306,8 +334,8 @@ FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) const TCHAR *target = NULL; #ifdef _UNICODE - wchar_t *filename_w = curlx_convert_UTF8_to_wchar(filename); - wchar_t *mode_w = curlx_convert_UTF8_to_wchar(mode); + wchar_t *filename_w = fn_convert_UTF8_to_wchar(filename); + wchar_t *mode_w = fn_convert_UTF8_to_wchar(mode); if(filename_w && mode_w) { if(fix_excessive_path(filename_w, &fixed)) target = fixed; @@ -318,8 +346,8 @@ FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp) else /* !checksrc! disable ERRNOVAR 1 */ errno = EINVAL; - curlx_unicodefree(filename_w); - curlx_unicodefree(mode_w); + CURLX_FREE(filename_w); + CURLX_FREE(mode_w); #else if(fix_excessive_path(filename, &fixed)) target = fixed; @@ -339,7 +367,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) const TCHAR *target = NULL; #ifdef _UNICODE - wchar_t *path_w = curlx_convert_UTF8_to_wchar(path); + wchar_t *path_w = fn_convert_UTF8_to_wchar(path); if(path_w) { if(fix_excessive_path(path_w, &fixed)) target = fixed; @@ -350,7 +378,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) #else result = _wstati64(target, buffer); #endif - curlx_unicodefree(path_w); + CURLX_FREE(path_w); } else /* !checksrc! disable ERRNOVAR 1 */ @@ -371,4 +399,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) return result; } +#undef CURLX_MALLOC +#undef CURLX_FREE + #endif /* _WIN32 */ diff --git a/lib/curlx/multibyte.c b/lib/curlx/multibyte.c index 3a33fcedfc65..71170df2c549 100644 --- a/lib/curlx/multibyte.c +++ b/lib/curlx/multibyte.c @@ -22,11 +22,6 @@ * ***************************************************************************/ -/* - * Use system allocators to avoid infinite recursion when called by curl's - * memory tracker memdebug functions. - */ - #include "../curl_setup.h" #if defined(_WIN32) && defined(UNICODE) @@ -45,11 +40,11 @@ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8) int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str_utf8, -1, NULL, 0); if(str_w_len > 0) { - str_w = CURLX_MALLOC(str_w_len * sizeof(wchar_t)); + str_w = curlx_malloc(str_w_len * sizeof(wchar_t)); if(str_w) { if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, str_w_len) == 0) { - CURLX_FREE(str_w); + curlx_free(str_w); return NULL; } } @@ -67,11 +62,11 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w) int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL, 0, NULL, NULL); if(bytes > 0) { - str_utf8 = CURLX_MALLOC(bytes); + str_utf8 = curlx_malloc(bytes); if(str_utf8) { if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, bytes, NULL, NULL) == 0) { - CURLX_FREE(str_utf8); + curlx_free(str_utf8); return NULL; } } diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index fd264e180efa..8b19257222ca 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -29,32 +29,16 @@ /* * Macros curlx_convert_UTF8_to_tchar(), curlx_convert_tchar_to_UTF8() - * and curlx_unicodefree() main purpose is to minimize the number of - * preprocessor conditional directives needed by code using these - * to differentiate Unicode from non-Unicode builds. + * main purpose is to minimize the number of preprocessor conditional + * directives needed by code using these to differentiate Unicode from + * non-Unicode builds. * * In the case of a non-Unicode build the tchar strings are char strings that * are duplicated via strdup and remain in whatever the passed in encoding is, * which is assumed to be UTF-8 but may be other encoding. Therefore the * significance of the conversion functions is primarily for Unicode builds. - * - * Allocated memory should be free'd with curlx_unicodefree(). - * - * Use system allocators to avoid infinite recursion when called by curl's - * memory tracker memdebug functions. */ -#ifdef CURLDEBUG -#define CURLX_MALLOC(x) malloc(x) -#define CURLX_FREE(x) free(x) -#else -#define CURLX_MALLOC(x) curlx_malloc(x) -#define CURLX_FREE(x) curlx_free(x) -#endif - -/* the purpose of this macro is to free() without being traced by memdebug */ -#define curlx_unicodefree(ptr) CURLX_FREE(ptr) - #ifdef UNICODE /* MultiByte conversions using Windows kernel32 library. */ @@ -73,13 +57,8 @@ typedef union { #else /* !UNICODE */ -#ifdef CURLDEBUG -#define curlx_convert_UTF8_to_tchar(ptr) _strdup(ptr) -#define curlx_convert_tchar_to_UTF8(ptr) _strdup(ptr) -#else #define curlx_convert_UTF8_to_tchar(ptr) curlx_strdup(ptr) #define curlx_convert_tchar_to_UTF8(ptr) curlx_strdup(ptr) -#endif typedef union { char *tchar_ptr; diff --git a/lib/ldap.c b/lib/ldap.c index 3dfbb330dc94..ba9620b4b185 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -96,7 +96,7 @@ #include "connect.h" #ifdef USE_WIN32_LDAP -#define FREE_ON_WINLDAP(x) curlx_unicodefree(x) +#define FREE_ON_WINLDAP(x) curlx_free(x) #define curl_ldap_num_t ULONG #else #define FREE_ON_WINLDAP(x) @@ -296,8 +296,8 @@ static ULONG ldap_win_bind(struct Curl_easy *data, LDAP *server, rc = ldap_simple_bind_s(server, inuser, inpass); - curlx_unicodefree(inuser); - curlx_unicodefree(inpass); + curlx_free(inuser); + curlx_free(inpass); } #ifdef USE_WINDOWS_SSPI else { @@ -1000,22 +1000,13 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp) if(!ludp) return; -#ifdef USE_WIN32_LDAP - curlx_unicodefree(ludp->lud_dn); - curlx_unicodefree(ludp->lud_filter); -#else curlx_free(ludp->lud_dn); curlx_free(ludp->lud_filter); -#endif if(ludp->lud_attrs) { size_t i; for(i = 0; i < ludp->lud_attrs_dups; i++) { -#ifdef USE_WIN32_LDAP - curlx_unicodefree(ludp->lud_attrs[i]); -#else curlx_free(ludp->lud_attrs[i]); -#endif } curlx_free(ludp->lud_attrs); } diff --git a/lib/rename.c b/lib/rename.c index d3f80422e641..11cd680aa6dd 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -46,14 +46,14 @@ int Curl_rename(const char *oldpath, const char *newpath) for(;;) { timediff_t diff; if(MoveFileEx(tchar_oldpath, tchar_newpath, MOVEFILE_REPLACE_EXISTING)) { - curlx_unicodefree(tchar_oldpath); - curlx_unicodefree(tchar_newpath); + curlx_free(tchar_oldpath); + curlx_free(tchar_newpath); break; } diff = curlx_timediff_ms(curlx_now(), start); if(diff < 0 || diff > max_wait_ms) { - curlx_unicodefree(tchar_oldpath); - curlx_unicodefree(tchar_newpath); + curlx_free(tchar_oldpath); + curlx_free(tchar_newpath); return 1; } Sleep(1); diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 17e875557eea..84d530151c55 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -175,7 +175,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, &output_desc, &sspi_ret_flags, NULL); - curlx_unicodefree(sname); + curlx_free(sname); Curl_safefree(sspi_recv_token.pvBuffer); sspi_recv_token.cbBuffer = 0; @@ -298,7 +298,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, char *user_utf8 = curlx_convert_tchar_to_UTF8(names.sUserName); infof(data, "SOCKS5 server authenticated user %s with GSS-API.", (user_utf8 ? user_utf8 : "(unknown)")); - curlx_unicodefree(user_utf8); + curlx_free(user_utf8); #endif Curl_pSecFn->FreeContextBuffer(names.sUserName); names.sUserName = NULL; diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index c92b53dcfc22..dc3afcc88357 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -273,7 +273,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, dup_domain.tchar_ptr = curlx_tcsdup(domain.tchar_ptr); if(!dup_domain.tchar_ptr) { - curlx_unicodefree(domain.tchar_ptr); + curlx_free(domain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } @@ -282,7 +282,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, identity->DomainLength = curlx_uztoul(_tcslen(dup_domain.tchar_ptr)); dup_domain.tchar_ptr = NULL; - curlx_unicodefree(domain.tchar_ptr); + curlx_free(domain.tchar_ptr); } else { /* Unknown specifier, ignore it! */ @@ -579,7 +579,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, digest->http_context = curlx_calloc(1, sizeof(CtxtHandle)); if(!digest->http_context) { Curl_pSecFn->FreeCredentialsHandle(&credentials); - curlx_unicodefree(spn); + curlx_free(spn); Curl_sspi_free_identity(p_identity); curlx_free(output_token); return CURLE_OUT_OF_MEMORY; @@ -592,7 +592,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, &chlg_desc, 0, digest->http_context, &resp_desc, &attrs, NULL); - curlx_unicodefree(spn); + curlx_free(spn); if(status == SEC_I_COMPLETE_NEEDED || status == SEC_I_COMPLETE_AND_CONTINUE) diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index 9b87bd2c6757..25924806f2b9 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -71,7 +71,6 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host, { char *utf8_spn = NULL; TCHAR *tchar_spn = NULL; - TCHAR *dupe_tchar_spn = NULL; (void)realm; @@ -87,16 +86,11 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host, if(!utf8_spn) return NULL; - /* Allocate and return a TCHAR based SPN. Since curlx_convert_UTF8_to_tchar - must be freed by curlx_unicodefree we will dupe the result so that the - pointer this function returns can be normally free'd. */ + /* Allocate and return a TCHAR based SPN. */ tchar_spn = curlx_convert_UTF8_to_tchar(utf8_spn); curlx_free(utf8_spn); - if(!tchar_spn) - return NULL; - dupe_tchar_spn = curlx_tcsdup(tchar_spn); - curlx_unicodefree(tchar_spn); - return dupe_tchar_spn; + + return tchar_spn; } #endif /* USE_WINDOWS_SSPI */ diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 21314d16ecb3..f1b47cb47fd8 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -547,7 +547,7 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, failf(data, "schannel: Failed to get certificate location" " or file for %s", data->set.ssl.primary.clientcert); - curlx_unicodefree(cert_path); + curlx_free(cert_path); return result; } } @@ -558,7 +558,7 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, " for %s", blob ? "(memory blob)" : data->set.ssl.primary.clientcert); curlx_free(cert_store_path); - curlx_unicodefree(cert_path); + curlx_free(cert_path); if(fInCert) curlx_fclose(fInCert); return CURLE_SSL_CERTPROBLEM; @@ -576,7 +576,7 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, const char *cert_showfilename_error = blob ? "(memory blob)" : data->set.ssl.primary.clientcert; curlx_free(cert_store_path); - curlx_unicodefree(cert_path); + curlx_free(cert_path); if(fInCert) { long cert_tell = 0; bool continue_reading = fseek(fInCert, 0, SEEK_END) == 0; @@ -686,8 +686,8 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, (path_utf8 ? path_utf8 : "(unknown)"), GetLastError()); curlx_free(cert_store_path); - curlx_unicodefree(path_utf8); - curlx_unicodefree(cert_path); + curlx_free(path_utf8); + curlx_free(cert_path); return CURLE_SSL_CERTPROBLEM; } curlx_free(cert_store_path); @@ -701,7 +701,7 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, cert_thumbprint_data, &cert_thumbprint.cbData, NULL, NULL)) { - curlx_unicodefree(cert_path); + curlx_free(cert_path); CertCloseStore(cert_store, 0); return CURLE_SSL_CERTPROBLEM; } @@ -710,7 +710,7 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, cert_store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_HASH, &cert_thumbprint, NULL); - curlx_unicodefree(cert_path); + curlx_free(cert_path); if(!client_certs[0]) { /* CRYPT_E_NOT_FOUND / E_INVALIDARG */ @@ -1485,7 +1485,7 @@ static void schannel_session_free(void *sessionid) cred->refcount--; if(cred->refcount == 0) { Curl_pSecFn->FreeCredentialsHandle(&cred->cred_handle); - curlx_unicodefree(cred->sni_hostname); + curlx_free(cred->sni_hostname); if(cred->client_cert_store) { CertCloseStore(cred->client_cert_store, 0); cred->client_cert_store = NULL; diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index 77f9177349d7..f45977bcb607 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -347,7 +347,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, CloseHandle(ca_file_handle); } Curl_safefree(ca_file_buffer); - curlx_unicodefree(ca_file_tstr); + curlx_free(ca_file_tstr); return result; } @@ -648,7 +648,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, struct Curl_easy *data) result = CURLE_PEER_FAILED_VERIFICATION; } - curlx_unicodefree(cert_hostname); + curlx_free(cert_hostname); } } diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 040792f465a7..855ce0897ca1 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -593,11 +593,8 @@ CURLcode FindWin32CACert(struct OperationConfig *config, res_len = SearchPath(NULL, bundle_file, NULL, PATH_MAX, buf, &ptr); if(res_len > 0) { - char *mstr = curlx_convert_tchar_to_UTF8(buf); - tool_safefree(config->cacert); - if(mstr) - config->cacert = curlx_strdup(mstr); - curlx_unicodefree(mstr); + curlx_free(config->cacert); + config->cacert = curlx_convert_tchar_to_UTF8(buf); if(!config->cacert) result = CURLE_OUT_OF_MEMORY; } diff --git a/src/tool_filetime.c b/src/tool_filetime.c index 2d362b4bb7cb..9e548cd50e3e 100644 --- a/src/tool_filetime.c +++ b/src/tool_filetime.c @@ -47,7 +47,7 @@ int getfiletime(const char *filename, curl_off_t *stamp) (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), NULL, OPEN_EXISTING, 0, NULL); - curlx_unicodefree(tchar_filename); + curlx_free(tchar_filename); if(hfile != INVALID_HANDLE_VALUE) { FILETIME ft; if(GetFileTime(hfile, NULL, NULL, &ft)) { @@ -113,7 +113,7 @@ void setfiletime(curl_off_t filetime, const char *filename) (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), NULL, OPEN_EXISTING, 0, NULL); - curlx_unicodefree(tchar_filename); + curlx_free(tchar_filename); if(hfile != INVALID_HANDLE_VALUE) { curl_off_t converted = ((curl_off_t)filetime * 10000000) + 116444736000000000; diff --git a/src/tool_getparam.h b/src/tool_getparam.h index 10b235187436..1b0d8017d5e5 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -383,7 +383,7 @@ ParameterError parse_args(int argc, argv_item_t argv[]); #define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) #define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) -#define unicodefree(ptr) curlx_unicodefree(ptr) +#define unicodefree(ptr) curlx_free(ptr) #else diff --git a/tests/data/test1 b/tests/data/test1 index ee0b63404884..cee68e69438f 100644 --- a/tests/data/test1 +++ b/tests/data/test1 @@ -50,7 +50,7 @@ Accept: */* -Allocations: 120 +Allocations: 135 Maximum allocated: 136000 diff --git a/tests/data/test440 b/tests/data/test440 index 127fb16270ab..39246e49789b 100644 --- a/tests/data/test440 +++ b/tests/data/test440 @@ -74,7 +74,7 @@ https://this.hsts.example./%TESTNUMBER 56 -Allocations: 145 +Allocations: 160 diff --git a/tests/data/test767 b/tests/data/test767 index 83d68841b010..7561c8adba42 100644 --- a/tests/data/test767 +++ b/tests/data/test767 @@ -51,7 +51,7 @@ Accept: */* -Allocations: 120 +Allocations: 135 Maximum allocated: 136000 diff --git a/tests/memanalyzer.pm b/tests/memanalyzer.pm index 7dbdf7b94a91..8c7515e4ff04 100644 --- a/tests/memanalyzer.pm +++ b/tests/memanalyzer.pm @@ -191,7 +191,8 @@ sub memanalyze { if($sizeataddr{$addr} && $sizeataddr{$addr}>0) { # this means weeeeeirdo - push @res, "Mixed debug compile, rebuild curl now\n"; + push @res, "Mixed debug compile ($source:$linenum at line $lnum), rebuild curl now\n"; + push @res, "We think $sizeataddr{$addr} bytes are already allocated at that memory address: $addr!\n"; } $sizeataddr{$addr} = $size; From af5def0738dd53db84a23221be9bf352d8708917 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Dec 2025 22:48:20 +0100 Subject: [PATCH 670/885] tidy-up: avoid `(())`, clang-format fixes and more - drop redundant parentheses from macro definitions. - apply clang-format in some places missed earlier. - wolfssl: fix a macro guard comment. - curl_setup.h: drop empty lines - FAQ: fix C formatting. Closes #19854 --- docs/FAQ | 2 +- lib/conncache.c | 6 +- lib/curl_setup.h | 19 +- lib/curl_setup_once.h | 10 +- lib/curlx/base64.c | 13 +- lib/curlx/multibyte.h | 4 +- lib/curlx/strparse.h | 2 +- lib/vtls/wolfssl.c | 4 +- src/tool_bname.h | 2 +- src/tool_dirhie.c | 2 +- src/tool_getparam.h | 6 +- tests/libtest/first.h | 541 ++++++++++++++++++++------------------ tests/libtest/unitcheck.h | 3 +- 13 files changed, 322 insertions(+), 292 deletions(-) diff --git a/docs/FAQ b/docs/FAQ index 15cfee848cc6..2e5e5901bef5 100644 --- a/docs/FAQ +++ b/docs/FAQ @@ -1157,7 +1157,7 @@ FAQ struct MemoryStruct *mem = (struct MemoryStruct *)data; mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); - if (mem->memory) { + if(mem->memory) { memcpy(&(mem->memory[mem->size]), ptr, realsize); mem->size += realsize; mem->memory[mem->size] = 0; diff --git a/lib/conncache.c b/lib/conncache.c index 18b760afe052..54248d14ad6e 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -48,9 +48,9 @@ #define CPOOL_IS_LOCKED(c) ((c) && (c)->locked) -#define CPOOL_LOCK(c,d) \ +#define CPOOL_LOCK(c, d) \ do { \ - if((c)) { \ + if(c) { \ if(CURL_SHARE_KEEP_CONNECT((c)->share)) \ Curl_share_lock((d), CURL_LOCK_DATA_CONNECT, \ CURL_LOCK_ACCESS_SINGLE); \ @@ -61,7 +61,7 @@ #define CPOOL_UNLOCK(c,d) \ do { \ - if((c)) { \ + if(c) { \ DEBUGASSERT((c)->locked); \ (c)->locked = FALSE; \ if(CURL_SHARE_KEEP_CONNECT((c)->share)) \ diff --git a/lib/curl_setup.h b/lib/curl_setup.h index ca275df0ada0..c4be90b655e0 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -180,7 +180,6 @@ * AIX 4.3 and newer needs _THREAD_SAFE defined to build * proper reentrant code. Others may also need it. */ - #ifdef NEED_THREAD_SAFE # ifndef _THREAD_SAFE # define _THREAD_SAFE @@ -192,7 +191,6 @@ * things to appear in the system header files. Unixware needs it * to build proper reentrant code. Others may also need it. */ - #ifdef NEED_REENTRANT # ifndef _REENTRANT # define _REENTRANT @@ -219,7 +217,6 @@ /* * Disable other protocols when http is the only one desired. */ - #ifdef HTTP_ONLY # ifndef CURL_DISABLE_DICT # define CURL_DISABLE_DICT @@ -268,7 +265,6 @@ /* * When http is disabled rtsp is not supported. */ - #if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP) # define CURL_DISABLE_RTSP #endif @@ -276,7 +272,6 @@ /* * When HTTP is disabled, disable HTTP-only features */ - #ifdef CURL_DISABLE_HTTP # define CURL_DISABLE_ALTSVC 1 # define CURL_DISABLE_COOKIES 1 @@ -298,7 +293,6 @@ /* * OS/400 setup file includes some system headers. */ - #ifdef __OS400__ # include "setup-os400.h" #endif @@ -306,7 +300,6 @@ /* * VMS setup file includes some system headers. */ - #ifdef __VMS # include "setup-vms.h" #endif @@ -314,7 +307,6 @@ /* * Windows setup file includes some system headers. */ - #ifdef _WIN32 # include "setup-win32.h" #endif @@ -340,7 +332,6 @@ #endif /* based on logic in "curl/mprintf.h" */ - #if (defined(__GNUC__) || defined(__clang__) || \ defined(__IAR_SYSTEMS_ICC__)) && \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ @@ -612,10 +603,10 @@ #if SIZEOF_LONG > SIZEOF_SIZE_T #error "unexpected: 'long' is larger than 'size_t'" #endif + /* * Arg 2 type for gethostname in case it has not been defined in config file. */ - #ifndef GETHOSTNAME_TYPE_ARG2 # ifdef USE_WINSOCK # define GETHOSTNAME_TYPE_ARG2 int @@ -625,10 +616,9 @@ #endif /* Below we define some functions. They should - 4. set the SIGALRM signal timeout 5. set dir/file naming defines - */ + */ #ifdef _WIN32 @@ -664,7 +654,6 @@ /* * Mutually exclusive CURLRES_* definitions. */ - #if defined(USE_IPV6) && defined(HAVE_GETADDRINFO) # define CURLRES_IPV6 #elif defined(USE_IPV6) && (defined(_WIN32) || defined(__CYGWIN__)) @@ -792,7 +781,6 @@ /* * Include macros and defines that should only be processed once. */ - #ifndef HEADER_CURL_SETUP_ONCE_H #include "curl_setup_once.h" #endif @@ -800,7 +788,6 @@ /* * Definition of our NOP statement Object-like macro */ - #ifndef Curl_nop_stmt #define Curl_nop_stmt do { } while(0) #endif @@ -808,7 +795,6 @@ /* * Ensure that Winsock and lwIP TCP/IP stacks are not mixed. */ - #if defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H) # if defined(SOCKET) || defined(USE_WINSOCK) # error "Winsock and lwIP TCP/IP stack definitions shall not coexist!" @@ -818,7 +804,6 @@ /* * shutdown() flags for systems that do not define them */ - #ifndef SHUT_RD #define SHUT_RD 0x00 #endif diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index cf494b2ba8b0..f9395aa7b51a 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -181,15 +181,15 @@ struct timeval { * Function-like macro definition used to close a socket. */ #ifdef HAVE_CLOSESOCKET -# define CURL_SCLOSE(x) closesocket((x)) +# define CURL_SCLOSE(x) closesocket(x) #elif defined(HAVE_CLOSESOCKET_CAMEL) -# define CURL_SCLOSE(x) CloseSocket((x)) +# define CURL_SCLOSE(x) CloseSocket(x) #elif defined(MSDOS) /* Watt-32 */ -# define CURL_SCLOSE(x) close_s((x)) +# define CURL_SCLOSE(x) close_s(x) #elif defined(USE_LWIPSOCK) -# define CURL_SCLOSE(x) lwip_close((x)) +# define CURL_SCLOSE(x) lwip_close(x) #else -# define CURL_SCLOSE(x) close((x)) +# define CURL_SCLOSE(x) close(x) #endif /* diff --git a/lib/curlx/base64.c b/lib/curlx/base64.c index 4fc525387e5f..6ea1e425b49c 100644 --- a/lib/curlx/base64.c +++ b/lib/curlx/base64.c @@ -39,12 +39,13 @@ const char Curl_base64encdec[] = static const char base64url[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; -static const unsigned char decodetable[] = -{ 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, - 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51 }; +static const unsigned char decodetable[] = { + 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, + 255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 +}; /* * curlx_base64_decode() * diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index 8b19257222ca..26da0f0843e0 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -45,8 +45,8 @@ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); -#define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) -#define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) +#define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar(ptr) +#define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8(ptr) typedef union { unsigned short *tchar_ptr; diff --git a/lib/curlx/strparse.h b/lib/curlx/strparse.h index 6a0bf28d6cbc..7fb90ac40f89 100644 --- a/lib/curlx/strparse.h +++ b/lib/curlx/strparse.h @@ -45,7 +45,7 @@ struct Curl_str { void curlx_str_init(struct Curl_str *out); void curlx_str_assign(struct Curl_str *out, const char *str, size_t len); -#define curlx_str(x) ((x)->str) +#define curlx_str(x) ((x)->str) #define curlx_strlen(x) ((x)->len) /* Get a word until the first space diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index cfefeb9320c7..d4d586b0ea35 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1515,7 +1515,7 @@ static CURLcode wssl_connect_step1(struct Curl_cfilter *cf, wolfSSL_BIO_set_data(bio, cf); wolfSSL_set_bio(wssl->ssl, bio, bio); } -#else /* USE_BIO_CHAIN */ +#else /* !USE_BIO_CHAIN */ curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); if(sockfd > INT_MAX) { failf(data, "SSL: socket value too large"); @@ -1526,7 +1526,7 @@ static CURLcode wssl_connect_step1(struct Curl_cfilter *cf, failf(data, "SSL: wolfSSL_set_fd failed"); return CURLE_SSL_CONNECT_ERROR; } -#endif /* !USE_BIO_CHAIN */ +#endif /* USE_BIO_CHAIN */ return CURLE_OK; } diff --git a/src/tool_bname.h b/src/tool_bname.h index d091c2231a8d..4047c5cc78c8 100644 --- a/src/tool_bname.h +++ b/src/tool_bname.h @@ -29,7 +29,7 @@ char *tool_basename(char *path); -#define basename(x) tool_basename((x)) +#define basename(x) tool_basename(x) #endif /* HAVE_BASENAME */ diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index 058403d66688..e0eef03a11a3 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -31,7 +31,7 @@ #include "tool_msgs.h" #if defined(_WIN32) || (defined(MSDOS) && !defined(__DJGPP__)) -# define mkdir(x, y) (mkdir)((x)) +# define mkdir(x, y) (mkdir)(x) # ifndef F_OK # define F_OK 0 # endif diff --git a/src/tool_getparam.h b/src/tool_getparam.h index 1b0d8017d5e5..44eb361edca5 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -381,15 +381,15 @@ ParameterError parse_args(int argc, argv_item_t argv[]); #if defined(UNICODE) && defined(_WIN32) -#define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) -#define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) +#define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar(ptr) +#define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8(ptr) #define unicodefree(ptr) curlx_free(ptr) #else #define convert_UTF8_to_tchar(ptr) (const char *)(ptr) #define convert_tchar_to_UTF8(ptr) (const char *)(ptr) -#define unicodefree(ptr) do {} while(0) +#define unicodefree(ptr) do {} while(0) #endif diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 2ad600ef60e2..c536adc2ca60 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -59,12 +59,12 @@ extern int unitfail; /* for unittests */ #define CURL_GNUC_DIAG #endif -#define test_setopt(A, B, C) \ - if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \ +#define test_setopt(A, B, C) \ + if((res = curl_easy_setopt(A, B, C)) != CURLE_OK) \ goto test_cleanup -#define test_multi_setopt(A, B, C) \ - if((res = curl_multi_setopt((A), (B), (C))) != CURLE_OK) \ +#define test_multi_setopt(A, B, C) \ + if((res = curl_multi_setopt(A, B, C)) != CURLE_OK) \ goto test_cleanup extern const char *libtest_arg2; /* set by first.c to the argv[2] or NULL */ @@ -144,376 +144,419 @@ void ws_close(CURL *curl); /* ---------------------------------------------------------------- */ -#define exe_easy_init(A, Y, Z) do { \ - if(((A) = curl_easy_init()) == NULL) { \ - curl_mfprintf(stderr, "%s:%d curl_easy_init() failed\n", (Y), (Z)); \ - res = TEST_ERR_EASY_INIT; \ - } \ -} while(0) +#define exe_easy_init(A, Y, Z) \ + do { \ + if(((A) = curl_easy_init()) == NULL) { \ + curl_mfprintf(stderr, "%s:%d curl_easy_init() failed\n", Y, Z); \ + res = TEST_ERR_EASY_INIT; \ + } \ + } while(0) #define res_easy_init(A) \ - exe_easy_init((A), (__FILE__), (__LINE__)) + exe_easy_init(A, __FILE__, __LINE__) -#define chk_easy_init(A, Y, Z) do { \ - exe_easy_init((A), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_easy_init(A, Y, Z) \ + do { \ + exe_easy_init(A, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define easy_init(A) \ - chk_easy_init((A), (__FILE__), (__LINE__)) + chk_easy_init(A, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_init(A, Y, Z) do { \ - if(((A) = curl_multi_init()) == NULL) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \ - res = TEST_ERR_MULTI; \ - } \ -} while(0) +#define exe_multi_init(A, Y, Z) \ + do { \ + if(((A) = curl_multi_init()) == NULL) { \ + curl_mfprintf(stderr, "%s:%d curl_multi_init() failed\n", Y, Z); \ + res = TEST_ERR_MULTI; \ + } \ + } while(0) #define res_multi_init(A) \ - exe_multi_init((A), (__FILE__), (__LINE__)) + exe_multi_init(A, __FILE__, __LINE__) -#define chk_multi_init(A, Y, Z) do { \ - exe_multi_init((A), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_multi_init(A, Y, Z) \ + do { \ + exe_multi_init(A, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_init(A) \ - chk_multi_init((A), (__FILE__), (__LINE__)) + chk_multi_init(A, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_easy_setopt(A, B, C, Y, Z) do { \ - CURLcode ec; \ - if((ec = curl_easy_setopt((A), (B), (C))) != CURLE_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_easy_setopt() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_easy_strerror(ec)); \ - res = ec; \ - } \ -} while(0) +#define exe_easy_setopt(A, B, C, Y, Z) \ + do { \ + CURLcode ec; \ + if((ec = curl_easy_setopt(A, B, C)) != CURLE_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_easy_setopt() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_easy_strerror(ec)); \ + res = ec; \ + } \ + } while(0) #define res_easy_setopt(A, B, C) \ - exe_easy_setopt((A), (B), (C), (__FILE__), (__LINE__)) + exe_easy_setopt(A, B, C, __FILE__, __LINE__) -#define chk_easy_setopt(A, B, C, Y, Z) do { \ - exe_easy_setopt((A), (B), (C), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_easy_setopt(A, B, C, Y, Z) \ + do { \ + exe_easy_setopt(A, B, C, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define easy_setopt(A, B, C) \ - chk_easy_setopt((A), (B), (C), (__FILE__), (__LINE__)) + chk_easy_setopt(A, B, C, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_setopt(A, B, C, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_setopt((A), (B), (C))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_setopt() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ -} while(0) +#define exe_multi_setopt(A, B, C, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_setopt(A, B, C)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_setopt() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + } while(0) #define res_multi_setopt(A, B, C) \ - exe_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) + exe_multi_setopt(A, B, C, __FILE__, __LINE__) -#define chk_multi_setopt(A, B, C, Y, Z) do { \ - exe_multi_setopt((A), (B), (C), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_multi_setopt(A, B, C, Y, Z) \ + do { \ + exe_multi_setopt(A, B, C, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_setopt(A, B, C) \ - chk_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) + chk_multi_setopt(A, B, C, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_add_handle(A, B, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_add_handle((A), (B))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ -} while(0) +#define exe_multi_add_handle(A, B, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_add_handle(A, B)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_add_handle() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + } while(0) #define res_multi_add_handle(A, B) \ - exe_multi_add_handle((A), (B), (__FILE__), (__LINE__)) + exe_multi_add_handle(A, B, __FILE__, __LINE__) -#define chk_multi_add_handle(A, B, Y, Z) do { \ - exe_multi_add_handle((A), (B), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_multi_add_handle(A, B, Y, Z) \ + do { \ + exe_multi_add_handle(A, B, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_add_handle(A, B) \ - chk_multi_add_handle((A), (B), (__FILE__), (__LINE__)) + chk_multi_add_handle(A, B, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_remove_handle(A, B, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_remove_handle((A), (B))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ -} while(0) +#define exe_multi_remove_handle(A, B, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_remove_handle(A, B)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_remove_handle() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + } while(0) #define res_multi_remove_handle(A, B) \ - exe_multi_remove_handle((A), (B), (__FILE__), (__LINE__)) - -#define chk_multi_remove_handle(A, B, Y, Z) do { \ - exe_multi_remove_handle((A), (B), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) + exe_multi_remove_handle(A, B, __FILE__, __LINE__) +#define chk_multi_remove_handle(A, B, Y, Z) \ + do { \ + exe_multi_remove_handle(A, B, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_remove_handle(A, B) \ - chk_multi_remove_handle((A), (B), (__FILE__), (__LINE__)) + chk_multi_remove_handle(A, B, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_perform(A, B, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_perform((A), (B))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_perform() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ - else if(*((B)) < 0) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_perform() succeeded, " \ - "but returned invalid running_handles value (%d)\n", \ - (Y), (Z), (int)*((B))); \ - res = TEST_ERR_NUM_HANDLES; \ - } \ -} while(0) +#define exe_multi_perform(A, B, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_perform(A, B)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_perform() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + else if(*(B) < 0) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_perform() succeeded, " \ + "but returned invalid running_handles value (%d)\n", \ + Y, Z, (int)*(B)); \ + res = TEST_ERR_NUM_HANDLES; \ + } \ + } while(0) #define res_multi_perform(A, B) \ - exe_multi_perform((A), (B), (__FILE__), (__LINE__)) + exe_multi_perform(A, B, __FILE__, __LINE__) -#define chk_multi_perform(A, B, Y, Z) do { \ - exe_multi_perform((A), (B), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_multi_perform(A, B, Y, Z) \ + do { \ + exe_multi_perform(A, B, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_perform(A, B) \ - chk_multi_perform((A), (B), (__FILE__), (__LINE__)) + chk_multi_perform(A, B, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_fdset(A, B, C, D, E, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_fdset((A), (B), (C), (D), (E))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_fdset() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ - else if(*((E)) < -1) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_fdset() succeeded, " \ - "but returned invalid max_fd value (%d)\n", \ - (Y), (Z), (int)*((E))); \ - res = TEST_ERR_NUM_HANDLES; \ - } \ -} while(0) +#define exe_multi_fdset(A, B, C, D, E, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_fdset(A, B, C, D, E)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_fdset() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + else if(*(E) < -1) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_fdset() succeeded, " \ + "but returned invalid max_fd value (%d)\n", \ + Y, Z, (int)*(E)); \ + res = TEST_ERR_NUM_HANDLES; \ + } \ + } while(0) #define res_multi_fdset(A, B, C, D, E) \ - exe_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) + exe_multi_fdset(A, B, C, D, E, __FILE__, __LINE__) -#define chk_multi_fdset(A, B, C, D, E, Y, Z) do { \ - exe_multi_fdset((A), (B), (C), (D), (E), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ +#define chk_multi_fdset(A, B, C, D, E, Y, Z) \ + do { \ + exe_multi_fdset(A, B, C, D, E, Y, Z); \ + if(res) \ + goto test_cleanup; \ } while(0) #define multi_fdset(A, B, C, D, E) \ - chk_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) + chk_multi_fdset(A, B, C, D, E, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_timeout(A, B, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_timeout((A), (B))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_timeout() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_BAD_TIMEOUT; \ - } \ - else if(*((B)) < -1L) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_timeout() succeeded, " \ - "but returned invalid timeout value (%ld)\n", \ - (Y), (Z), (long)*((B))); \ - res = TEST_ERR_BAD_TIMEOUT; \ - } \ -} while(0) +#define exe_multi_timeout(A, B, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_timeout(A, B)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_timeout() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_BAD_TIMEOUT; \ + } \ + else if(*(B) < -1L) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_timeout() succeeded, " \ + "but returned invalid timeout value (%ld)\n", \ + Y, Z, (long)*(B)); \ + res = TEST_ERR_BAD_TIMEOUT; \ + } \ + } while(0) #define res_multi_timeout(A, B) \ - exe_multi_timeout((A), (B), (__FILE__), (__LINE__)) + exe_multi_timeout(A, B, __FILE__, __LINE__) -#define chk_multi_timeout(A, B, Y, Z) do { \ - exe_multi_timeout((A), (B), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ +#define chk_multi_timeout(A, B, Y, Z) \ + do { \ + exe_multi_timeout(A, B, Y, Z); \ + if(res) \ + goto test_cleanup; \ } while(0) #define multi_timeout(A, B) \ - chk_multi_timeout((A), (B), (__FILE__), (__LINE__)) + chk_multi_timeout(A, B, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_poll(A, B, C, D, E, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_poll((A), (B), (C), (D), (E))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_poll() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ - else if(*((E)) < 0) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_poll() succeeded, " \ - "but returned invalid numfds value (%d)\n", \ - (Y), (Z), (int)*((E))); \ - res = TEST_ERR_NUM_HANDLES; \ - } \ -} while(0) +#define exe_multi_poll(A, B, C, D, E, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_poll(A, B, C, D, E)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_poll() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + else if(*(E) < 0) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_poll() succeeded, " \ + "but returned invalid numfds value (%d)\n", \ + Y, Z, (int)*(E)); \ + res = TEST_ERR_NUM_HANDLES; \ + } \ + } while(0) #define res_multi_poll(A, B, C, D, E) \ - exe_multi_poll((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) + exe_multi_poll(A, B, C, D, E, __FILE__, __LINE__) -#define chk_multi_poll(A, B, C, D, E, Y, Z) do { \ - exe_multi_poll((A), (B), (C), (D), (E), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_multi_poll(A, B, C, D, E, Y, Z) \ + do { \ + exe_multi_poll(A, B, C, D, E, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_poll(A, B, C, D, E) \ - chk_multi_poll((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) + chk_multi_poll(A, B, C, D, E, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_multi_wakeup(A, Y, Z) do { \ - CURLMcode ec; \ - if((ec = curl_multi_wakeup((A))) != CURLM_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_multi_wakeup() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_multi_strerror(ec)); \ - res = TEST_ERR_MULTI; \ - } \ -} while(0) +#define exe_multi_wakeup(A, Y, Z) \ + do { \ + CURLMcode ec; \ + if((ec = curl_multi_wakeup(A)) != CURLM_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_multi_wakeup() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_multi_strerror(ec)); \ + res = TEST_ERR_MULTI; \ + } \ + } while(0) #define res_multi_wakeup(A) \ - exe_multi_wakeup((A), (__FILE__), (__LINE__)) + exe_multi_wakeup(A, __FILE__, __LINE__) -#define chk_multi_wakeup(A, Y, Z) do { \ - exe_multi_wakeup((A), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ -} while(0) +#define chk_multi_wakeup(A, Y, Z) \ + do { \ + exe_multi_wakeup(A, Y, Z); \ + if(res) \ + goto test_cleanup; \ + } while(0) #define multi_wakeup(A) \ - chk_multi_wakeup((A), (__FILE__), (__LINE__)) + chk_multi_wakeup(A, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_select_test(A, B, C, D, E, Y, Z) do { \ - int ec; \ - if(select_wrapper((A), (B), (C), (D), (E)) == -1) { \ - char ecbuf[STRERROR_LEN]; \ - ec = SOCKERRNO; \ - curl_mfprintf(stderr, "%s:%d select() failed, with " \ - "errno %d (%s)\n", \ - (Y), (Z), \ - ec, curlx_strerror(ec, ecbuf, sizeof(ecbuf))); \ - res = TEST_ERR_SELECT; \ - } \ +#define exe_select_test(A, B, C, D, E, Y, Z) \ + do { \ + int ec; \ + if(select_wrapper(A, B, C, D, E) == -1) { \ + char ecbuf[STRERROR_LEN]; \ + ec = SOCKERRNO; \ + curl_mfprintf(stderr, \ + "%s:%d select() failed, with " \ + "errno %d (%s)\n", \ + Y, Z, ec, curlx_strerror(ec, ecbuf, sizeof(ecbuf))); \ + res = TEST_ERR_SELECT; \ + } \ } while(0) #define res_select_test(A, B, C, D, E) \ - exe_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) + exe_select_test(A, B, C, D, E, __FILE__, __LINE__) -#define chk_select_test(A, B, C, D, E, Y, Z) do { \ - exe_select_test((A), (B), (C), (D), (E), (Y), (Z)); \ - if(res) \ - goto test_cleanup; \ +#define chk_select_test(A, B, C, D, E, Y, Z) \ + do { \ + exe_select_test(A, B, C, D, E, Y, Z); \ + if(res) \ + goto test_cleanup; \ } while(0) #define select_test(A, B, C, D, E) \ - chk_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) + chk_select_test(A, B, C, D, E, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define start_test_timing() do { \ - tv_test_start = curlx_now(); \ -} while(0) +#define start_test_timing() \ + do { \ + tv_test_start = curlx_now(); \ + } while(0) #define TEST_HANG_TIMEOUT 60 * 1000 /* global default */ -#define exe_test_timedout(T, Y, Z) do { \ - timediff_t timediff = curlx_timediff_ms(curlx_now(), tv_test_start); \ - if(timediff > (T)) { \ - curl_mfprintf(stderr, "%s:%d ABORTING TEST, since it seems " \ - "that it would have run forever (%ld ms > %ld ms)\n", \ - (Y), (Z), (long)timediff, (long)(TEST_HANG_TIMEOUT)); \ - res = TEST_ERR_RUNS_FOREVER; \ - } \ -} while(0) +#define exe_test_timedout(T, Y, Z) \ + do { \ + timediff_t timediff = curlx_timediff_ms(curlx_now(), tv_test_start); \ + if(timediff > (T)) { \ + curl_mfprintf(stderr, \ + "%s:%d ABORTING TEST, since it seems " \ + "that it would have run forever (%ld ms > %ld ms)\n", \ + Y, Z, (long)timediff, (long)(TEST_HANG_TIMEOUT)); \ + res = TEST_ERR_RUNS_FOREVER; \ + } \ + } while(0) #define res_test_timedout() \ - exe_test_timedout(TEST_HANG_TIMEOUT, (__FILE__), (__LINE__)) + exe_test_timedout(TEST_HANG_TIMEOUT, __FILE__, __LINE__) #define res_test_timedout_custom(T) \ - exe_test_timedout((T), (__FILE__), (__LINE__)) + exe_test_timedout(T, __FILE__, __LINE__) -#define chk_test_timedout(T, Y, Z) do { \ - exe_test_timedout(T, Y, Z); \ - if(res) \ - goto test_cleanup; \ +#define chk_test_timedout(T, Y, Z) \ + do { \ + exe_test_timedout(T, Y, Z); \ + if(res) \ + goto test_cleanup; \ } while(0) #define abort_on_test_timeout() \ - chk_test_timedout(TEST_HANG_TIMEOUT, (__FILE__), (__LINE__)) + chk_test_timedout(TEST_HANG_TIMEOUT, __FILE__, __LINE__) #define abort_on_test_timeout_custom(T) \ - chk_test_timedout((T), (__FILE__), (__LINE__)) + chk_test_timedout(T, __FILE__, __LINE__) /* ---------------------------------------------------------------- */ -#define exe_global_init(A, Y, Z) do { \ - CURLcode ec; \ - if((ec = curl_global_init((A))) != CURLE_OK) { \ - curl_mfprintf(stderr, "%s:%d curl_global_init() failed, " \ - "with code %d (%s)\n", \ - (Y), (Z), ec, curl_easy_strerror(ec)); \ - res = ec; \ - } \ -} while(0) +#define exe_global_init(A, Y, Z) \ + do { \ + CURLcode ec; \ + if((ec = curl_global_init(A)) != CURLE_OK) { \ + curl_mfprintf(stderr, \ + "%s:%d curl_global_init() failed, " \ + "with code %d (%s)\n", \ + Y, Z, ec, curl_easy_strerror(ec)); \ + res = ec; \ + } \ + } while(0) #define res_global_init(A) \ - exe_global_init((A), (__FILE__), (__LINE__)) + exe_global_init(A, __FILE__, __LINE__) -#define chk_global_init(A, Y, Z) do { \ - exe_global_init((A), (Y), (Z)); \ - if(res) \ - return res; \ +#define chk_global_init(A, Y, Z) \ + do { \ + exe_global_init(A, Y, Z); \ + if(res) \ + return res; \ } while(0) /* global_init() is different than other macros. In case of failure it 'return's instead of going to 'test_cleanup'. */ #define global_init(A) \ - chk_global_init((A), (__FILE__), (__LINE__)) + chk_global_init(A, __FILE__, __LINE__) #define NO_SUPPORT_BUILT_IN \ { \ diff --git a/tests/libtest/unitcheck.h b/tests/libtest/unitcheck.h index 8007f9f8b5ca..231aacff838f 100644 --- a/tests/libtest/unitcheck.h +++ b/tests/libtest/unitcheck.h @@ -56,7 +56,8 @@ /* fail() is for when the test case figured out by itself that a check proved a failure */ -#define fail(msg) do { \ +#define fail(msg) \ + do { \ curl_mfprintf(stderr, "%s:%d test FAILED: '%s'\n", \ __FILE__, __LINE__, msg); \ unitfail++; \ From cca815ccfd98279f704f3bc75ed0cef8976e150f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 5 Dec 2025 16:14:19 +0100 Subject: [PATCH 671/885] test1498: disable 'HTTP PUT from stdin' test on Windows Test became flaky with memanalyze errors after merging #19845, in a TrackMemory Windows Unicode c-ares openssl-quic build: GHA/windows: mingw, AM x86_64 c-ares U. Disable it until further investigation. This test uses the Windows-specific multi-threaded stdin code that caused issues in the past. It's also using `TerminateThread()`, that apps aren't supposed to. Examples: https://github.com/curl/curl/pull/19845#issuecomment-3614921298 https://github.com/curl/curl/actions/runs/19948992659/job/57205061260?pr=19845#step:13:3028 https://github.com/curl/curl/actions/runs/19966429786/job/57259325027?pr=19852#step:13:3030 Also seen to fail earlier while testing torture tests on Windows: https://github.com/curl/curl/pull/19675#issuecomment-3573154110 Ref: 4e051ff5506319ee87e3656be8f76b01de217103 #19845 Closes #19855 --- tests/data/test1498 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/data/test1498 b/tests/data/test1498 index 467730d3a5a8..b9ba70fbc0eb 100644 --- a/tests/data/test1498 +++ b/tests/data/test1498 @@ -25,6 +25,9 @@ blablabla http + +!win32 + HTTP PUT from stdin using period From 0b69c4713147cd7c13d1e006abd95df688d687e2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 13:17:11 +0100 Subject: [PATCH 672/885] docs: remove dead URLs - KNOWN_BUGS: remove dead URL - ECH: remove two dead URLs - MAIL-ETIQUETTE: remove dead URL --- docs/ECH.md | 2 -- docs/KNOWN_BUGS | 2 +- docs/MAIL-ETIQUETTE.md | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/ECH.md b/docs/ECH.md index b40cd17e78b6..6f236a106b52 100644 --- a/docs/ECH.md +++ b/docs/ECH.md @@ -76,8 +76,6 @@ The above works for these test sites: ```sh https://defo.ie/ech-check.php -https://draft-13.esni.defo.ie:8413/stats -https://draft-13.esni.defo.ie:8414/stats https://crypto.cloudflare.com/cdn-cgi/trace https://tls-ech.dev ``` diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS index 15ca40102aa8..278cc2a0977b 100644 --- a/docs/KNOWN_BUGS +++ b/docs/KNOWN_BUGS @@ -311,7 +311,7 @@ problems may have been fixed or changed somewhat since this was written. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's library header files exporting symbols/macros that should be kept private to - the KfW library. See ticket #5601 at https://krbdev.mit.edu/rt/ + the KfW library. 6.3 NTLM in system context uses wrong name diff --git a/docs/MAIL-ETIQUETTE.md b/docs/MAIL-ETIQUETTE.md index 3de77b17bf7a..4c2f95f38bee 100644 --- a/docs/MAIL-ETIQUETTE.md +++ b/docs/MAIL-ETIQUETTE.md @@ -223,8 +223,7 @@ mails to your friends. We speak plain text mails. ### Quoting Quote as little as possible. Just enough to provide the context you cannot -eave out. A lengthy description can be found -[here](https://www.netmeister.org/news/learn2quote.html). +leave out. ### Digest From 58394b1c8c3bad2b4c0a96b3da194c81afedaf7f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 13:33:02 +0100 Subject: [PATCH 673/885] docs: use .example URLs for proxies --- docs/cmdline-opts/proxy-cacert.md | 2 +- docs/cmdline-opts/proxy-capath.md | 2 +- docs/cmdline-opts/proxy-cert-type.md | 2 +- docs/cmdline-opts/proxy-cert.md | 2 +- docs/cmdline-opts/proxy-ciphers.md | 2 +- docs/cmdline-opts/proxy-crlfile.md | 2 +- docs/cmdline-opts/proxy-insecure.md | 2 +- docs/cmdline-opts/proxy-key-type.md | 2 +- docs/cmdline-opts/proxy-key.md | 2 +- docs/cmdline-opts/proxy-pass.md | 2 +- docs/cmdline-opts/proxy-ssl-allow-beast.md | 2 +- docs/cmdline-opts/proxy-ssl-auto-client-cert.md | 2 +- docs/cmdline-opts/proxy-tlsauthtype.md | 2 +- docs/cmdline-opts/proxy-tlspassword.md | 2 +- docs/cmdline-opts/proxy-tlsuser.md | 2 +- docs/cmdline-opts/proxy-tlsv1.md | 2 +- docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/cmdline-opts/proxy-cacert.md b/docs/cmdline-opts/proxy-cacert.md index 682349a7e260..0b2405d1c96a 100644 --- a/docs/cmdline-opts/proxy-cacert.md +++ b/docs/cmdline-opts/proxy-cacert.md @@ -14,7 +14,7 @@ See-also: - dump-ca-embed - proxy Example: - - --proxy-cacert CA-file.txt -x https://proxy $URL + - --proxy-cacert CA-file.txt -x https://proxy.example $URL --- # `--proxy-cacert` diff --git a/docs/cmdline-opts/proxy-capath.md b/docs/cmdline-opts/proxy-capath.md index 91575ae4d8b8..344756a43ebb 100644 --- a/docs/cmdline-opts/proxy-capath.md +++ b/docs/cmdline-opts/proxy-capath.md @@ -13,7 +13,7 @@ See-also: - capath - dump-ca-embed Example: - - --proxy-capath /local/directory -x https://proxy $URL + - --proxy-capath /local/directory -x https://proxy.example $URL --- # `--proxy-capath` diff --git a/docs/cmdline-opts/proxy-cert-type.md b/docs/cmdline-opts/proxy-cert-type.md index 8a1121bb36b3..3dcd2017c46e 100644 --- a/docs/cmdline-opts/proxy-cert-type.md +++ b/docs/cmdline-opts/proxy-cert-type.md @@ -11,7 +11,7 @@ See-also: - proxy-cert - proxy-key Example: - - --proxy-cert-type PEM --proxy-cert file -x https://proxy $URL + - --proxy-cert-type PEM --proxy-cert file -x https://proxy.example $URL --- # `--proxy-cert-type` diff --git a/docs/cmdline-opts/proxy-cert.md b/docs/cmdline-opts/proxy-cert.md index 734766730c67..929791e3a152 100644 --- a/docs/cmdline-opts/proxy-cert.md +++ b/docs/cmdline-opts/proxy-cert.md @@ -12,7 +12,7 @@ See-also: - proxy-key - proxy-cert-type Example: - - --proxy-cert file -x https://proxy $URL + - --proxy-cert file -x https://proxy.example $URL --- # `--proxy-cert` diff --git a/docs/cmdline-opts/proxy-ciphers.md b/docs/cmdline-opts/proxy-ciphers.md index 420e7563bdd7..4cb85e1e67fa 100644 --- a/docs/cmdline-opts/proxy-ciphers.md +++ b/docs/cmdline-opts/proxy-ciphers.md @@ -13,7 +13,7 @@ See-also: - ciphers - proxy Example: - - --proxy-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 -x https://proxy $URL + - --proxy-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 -x https://proxy.example $URL --- # `--proxy-ciphers` diff --git a/docs/cmdline-opts/proxy-crlfile.md b/docs/cmdline-opts/proxy-crlfile.md index 726e44955781..9f7d3304fa2b 100644 --- a/docs/cmdline-opts/proxy-crlfile.md +++ b/docs/cmdline-opts/proxy-crlfile.md @@ -11,7 +11,7 @@ See-also: - crlfile - proxy Example: - - --proxy-crlfile rejects.txt -x https://proxy $URL + - --proxy-crlfile rejects.txt -x https://proxy.example $URL --- # `--proxy-crlfile` diff --git a/docs/cmdline-opts/proxy-insecure.md b/docs/cmdline-opts/proxy-insecure.md index 5796c36237d5..0c2d8b99bc08 100644 --- a/docs/cmdline-opts/proxy-insecure.md +++ b/docs/cmdline-opts/proxy-insecure.md @@ -10,7 +10,7 @@ See-also: - proxy - insecure Example: - - --proxy-insecure -x https://proxy $URL + - --proxy-insecure -x https://proxy.example $URL --- # `--proxy-insecure` diff --git a/docs/cmdline-opts/proxy-key-type.md b/docs/cmdline-opts/proxy-key-type.md index 587c13c59284..e4551400168d 100644 --- a/docs/cmdline-opts/proxy-key-type.md +++ b/docs/cmdline-opts/proxy-key-type.md @@ -11,7 +11,7 @@ See-also: - proxy-key - proxy Example: - - --proxy-key-type DER --proxy-key here -x https://proxy $URL + - --proxy-key-type DER --proxy-key here -x https://proxy.example $URL --- # `--proxy-key-type` diff --git a/docs/cmdline-opts/proxy-key.md b/docs/cmdline-opts/proxy-key.md index 7caa636e363f..8ee78c46eac6 100644 --- a/docs/cmdline-opts/proxy-key.md +++ b/docs/cmdline-opts/proxy-key.md @@ -11,7 +11,7 @@ See-also: - proxy-key-type - proxy Example: - - --proxy-key here -x https://proxy $URL + - --proxy-key here -x https://proxy.example $URL --- # `--proxy-key` diff --git a/docs/cmdline-opts/proxy-pass.md b/docs/cmdline-opts/proxy-pass.md index 88cefd54c894..1005d95d2f3a 100644 --- a/docs/cmdline-opts/proxy-pass.md +++ b/docs/cmdline-opts/proxy-pass.md @@ -11,7 +11,7 @@ See-also: - proxy - proxy-key Example: - - --proxy-pass secret --proxy-key here -x https://proxy $URL + - --proxy-pass secret --proxy-key here -x https://proxy.example $URL --- # `--proxy-pass` diff --git a/docs/cmdline-opts/proxy-ssl-allow-beast.md b/docs/cmdline-opts/proxy-ssl-allow-beast.md index 089038dec49d..909a7f026ed1 100644 --- a/docs/cmdline-opts/proxy-ssl-allow-beast.md +++ b/docs/cmdline-opts/proxy-ssl-allow-beast.md @@ -10,7 +10,7 @@ See-also: - ssl-allow-beast - proxy Example: - - --proxy-ssl-allow-beast -x https://proxy $URL + - --proxy-ssl-allow-beast -x https://proxy.example $URL --- # `--proxy-ssl-allow-beast` diff --git a/docs/cmdline-opts/proxy-ssl-auto-client-cert.md b/docs/cmdline-opts/proxy-ssl-auto-client-cert.md index 578a7a6417cd..e041b81523a2 100644 --- a/docs/cmdline-opts/proxy-ssl-auto-client-cert.md +++ b/docs/cmdline-opts/proxy-ssl-auto-client-cert.md @@ -10,7 +10,7 @@ See-also: - ssl-auto-client-cert - proxy Example: - - --proxy-ssl-auto-client-cert -x https://proxy $URL + - --proxy-ssl-auto-client-cert -x https://proxy.example $URL --- # `--proxy-ssl-auto-client-cert` diff --git a/docs/cmdline-opts/proxy-tlsauthtype.md b/docs/cmdline-opts/proxy-tlsauthtype.md index 684a7d55ef06..84becc149e99 100644 --- a/docs/cmdline-opts/proxy-tlsauthtype.md +++ b/docs/cmdline-opts/proxy-tlsauthtype.md @@ -12,7 +12,7 @@ See-also: - proxy-tlsuser - proxy-tlspassword Example: - - --proxy-tlsauthtype SRP -x https://proxy $URL + - --proxy-tlsauthtype SRP -x https://proxy.example $URL --- # `--proxy-tlsauthtype` diff --git a/docs/cmdline-opts/proxy-tlspassword.md b/docs/cmdline-opts/proxy-tlspassword.md index fe9ae7d2e200..63c252156627 100644 --- a/docs/cmdline-opts/proxy-tlspassword.md +++ b/docs/cmdline-opts/proxy-tlspassword.md @@ -11,7 +11,7 @@ See-also: - proxy - proxy-tlsuser Example: - - --proxy-tlspassword passwd -x https://proxy $URL + - --proxy-tlspassword passwd -x https://proxy.example $URL --- # `--proxy-tlspassword` diff --git a/docs/cmdline-opts/proxy-tlsuser.md b/docs/cmdline-opts/proxy-tlsuser.md index 351770111948..610a2169b885 100644 --- a/docs/cmdline-opts/proxy-tlsuser.md +++ b/docs/cmdline-opts/proxy-tlsuser.md @@ -11,7 +11,7 @@ See-also: - proxy - proxy-tlspassword Example: - - --proxy-tlsuser smith -x https://proxy $URL + - --proxy-tlsuser smith -x https://proxy.example $URL --- # `--proxy-tlsuser` diff --git a/docs/cmdline-opts/proxy-tlsv1.md b/docs/cmdline-opts/proxy-tlsv1.md index 7b322e3a32de..20643fd82b80 100644 --- a/docs/cmdline-opts/proxy-tlsv1.md +++ b/docs/cmdline-opts/proxy-tlsv1.md @@ -9,7 +9,7 @@ Multi: mutex See-also: - proxy Example: - - --proxy-tlsv1 -x https://proxy $URL + - --proxy-tlsv1 -x https://proxy.example $URL --- # `--proxy-tlsv1` diff --git a/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md b/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md index 17dab0e32419..39fe1c70d2b9 100644 --- a/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md +++ b/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md @@ -50,7 +50,7 @@ int main(void) long verifyresult; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); res = curl_easy_perform(curl); if(res) { diff --git a/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md b/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md index 6be10774db83..55c97b769f7e 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md @@ -72,7 +72,7 @@ int main(void) CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* using an HTTPS proxy */ - curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO, "/etc/certs/cabundle.pem"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md b/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md index 16af56e5cda6..5efc5e5f089e 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md @@ -73,7 +73,7 @@ int main(void) struct curl_blob blob; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* using an HTTPS proxy */ - curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); blob.data = strpem; blob.len = strlen(strpem); blob.flags = CURL_BLOB_COPY; diff --git a/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md b/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md index d0fce53cae06..0cb17c31bfaa 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md @@ -64,7 +64,7 @@ int main(void) CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* using an HTTPS proxy */ - curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); curl_easy_setopt(curl, CURLOPT_PROXY_CAPATH, "/etc/cert-dir"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md b/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md index 88af6f8ed9d1..54e900d2fdb3 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md @@ -70,7 +70,7 @@ int main(void) CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* using an HTTPS proxy */ - curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); curl_easy_setopt(curl, CURLOPT_PROXY_ISSUERCERT, "/etc/certs/cacert.pem"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md b/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md index a6977513974b..dd8e81b8d40a 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md @@ -77,7 +77,7 @@ int main(void) struct curl_blob blob; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* using an HTTPS proxy */ - curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); blob.data = certificateData; blob.len = filesize; blob.flags = CURL_BLOB_COPY; diff --git a/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md b/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md index 4d8287095312..9b59ec1fd1a7 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md @@ -61,7 +61,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "superman"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md b/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md index 49c28a7b6e6e..70c294c5ac5b 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md @@ -67,7 +67,7 @@ int main(void) CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); curl_easy_setopt(curl, CURLOPT_PROXY_PINNEDPUBLICKEY, "sha256//YhKJKSzoTt2b5FP18fvpHo7fJYqQCjA" "a3HWY3tvRMwE=;sha256//t62CeU2tQiqkexU74" diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md index f54832839f45..efea446a25e5 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md @@ -64,7 +64,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret"); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md index f616c75e4034..e0c07e325d0b 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md @@ -60,7 +60,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERTTYPE, "PEM"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem"); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md index e3b947b14615..83bd4d6ea814 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md @@ -68,7 +68,7 @@ int main(void) blob.len = filesize; blob.flags = CURL_BLOB_COPY; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT_BLOB, &blob); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md index 74b431a6b06e..443097dfb452 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md @@ -64,7 +64,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret"); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md index df14f081f5cd..cf44f3718ab9 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md @@ -53,7 +53,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem"); curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEYTYPE, "PEM"); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md index 91e91468493d..da997695d04b 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md @@ -62,7 +62,7 @@ int main(void) CURLcode res; struct curl_blob blob; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); blob.data = certificateData; blob.len = filesize; blob.flags = CURL_BLOB_COPY; diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md b/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md index 18b7ce6b36a1..ec9ccc16c8c0 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md @@ -106,7 +106,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); /* weaken TLS only for use with silly proxies */ curl_easy_setopt(curl, CURLOPT_PROXY_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST | CURLSSLOPT_NO_REVOKE); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md b/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md index 91f211071641..540d96149feb 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md @@ -58,7 +58,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret"); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md b/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md index 4c7cfd700f91..ceb1c1c09184 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md @@ -65,7 +65,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret"); diff --git a/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md b/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md index 44e32299ee04..cbc895275355 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md @@ -58,7 +58,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy"); + curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret"); From e80682d4296087972ea8e02fc7bf026b982f007e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 14:04:25 +0100 Subject: [PATCH 674/885] FAQ: fix hackerone URL --- docs/FAQ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/FAQ b/docs/FAQ index 2e5e5901bef5..b8a39474590f 100644 --- a/docs/FAQ +++ b/docs/FAQ @@ -292,7 +292,7 @@ FAQ from having to repeat ourselves even more. Thanks for respecting this. If you have found or simply suspect a security problem in curl or libcurl, - submit all the details at https://hackerone.one/curl. On there we keep the + submit all the details at https://hackerone.com/curl. On there we keep the issue private while we investigate, confirm it, work and validate a fix and agree on a time schedule for publication etc. That way we produce a fix in a timely manner before the flaw is announced to the world, reducing the impact From ca24b6a061cf1ab99ccf7c79e8b79193534cf70d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 14:11:39 +0100 Subject: [PATCH 675/885] DISTROS: remove broken URLs for buildroot --- docs/DISTROS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/DISTROS.md b/docs/DISTROS.md index 132ad86a0cfe..451de7fc1a84 100644 --- a/docs/DISTROS.md +++ b/docs/DISTROS.md @@ -49,8 +49,8 @@ archives](https://curl.se/mail/list.cgi?list=curl-distros)). *Rolling Release* -- curl package source and patches: https://git.buildroot.net/buildroot/tree/package/libcurl -- curl issues: https://bugs.buildroot.org/buglist.cgi?quicksearch=curl +- curl package source and patches: **missing URL** +- curl issues: **missing URL** ## Chimera From 51587f6f14af22e932d2448ed3a7b0052e880ea1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 11:45:35 +0100 Subject: [PATCH 676/885] mdlinkcheck: detect and check "raw" links - URLs specified outside of the markdown []() are now extracted and checked - also check TODO, FAQ and KNOWN_BUGS - more aggressive avoiding to check github.com/curl/curl, all uses of example domains and some more established URLs on the curl.se site - list all errors in the end to make them easier to spot in CI logs Closes #19848 --- .github/workflows/checkdocs.yml | 6 +-- scripts/mdlinkcheck | 80 +++++++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 18 deletions(-) diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index 60d42301941e..ba3858f66c46 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -15,8 +15,7 @@ name: 'Docs' paths: - '.github/workflows/checkdocs.yml' - '.github/scripts/**' - - '.github/scripts/mdlinkcheck' - - '/scripts/**' + - 'scripts/**' - '**.md' - 'docs/*' pull_request: @@ -25,8 +24,7 @@ name: 'Docs' paths: - '.github/workflows/checkdocs.yml' - '.github/scripts/**' - - '.github/scripts/mdlinkcheck' - - '/scripts/**' + - 'scripts/**' - '**.md' - 'docs/*' diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index 6b648786f33e..734617949d2d 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -27,7 +27,10 @@ use strict; use warnings; my %whitelist = ( + 'https://curl.se' => 1, 'https://curl.se/' => 1, + 'https://curl.se/bug/' => 1, + 'https://curl.se/bug/view.cgi' => 1, 'https://curl.se/changes.html' => 1, 'https://curl.se/dev/advisory.html' => 1, 'https://curl.se/dev/builds.html' => 1, @@ -40,19 +43,25 @@ my %whitelist = ( 'https://curl.se/docs/bugbounty.html' => 1, 'https://curl.se/docs/caextract.html' => 1, 'https://curl.se/docs/copyright.html' => 1, + 'https://curl.se/docs/http-cookies.html' => 1, 'https://curl.se/docs/install.html' => 1, 'https://curl.se/docs/knownbugs.html' => 1, 'https://curl.se/docs/manpage.html' => 1, + 'https://curl.se/docs/releases.html' => 1, 'https://curl.se/docs/security.html' => 1, + 'https://curl.se/docs/ssl-ciphers.html' => 1, + 'https://curl.se/docs/ssl-compared.html' => 1, 'https://curl.se/docs/sslcerts.html' => 1, 'https://curl.se/docs/thanks.html' => 1, 'https://curl.se/docs/todo.html' => 1, 'https://curl.se/docs/vulnerabilities.html' => 1, + 'https://curl.se/download.html' => 1, 'https://curl.se/libcurl/' => 1, - 'https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html' => 1, 'https://curl.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html' => 1, + 'https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html' => 1, 'https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html' => 1, 'https://curl.se/libcurl/c/libcurl.html' => 1, + 'https://curl.se/libcurl/c/threadsafe.html' => 1, 'https://curl.se/logo/curl-logo.svg' => 1, 'https://curl.se/mail/' => 1, 'https://curl.se/mail/etiquette.html' => 1, @@ -62,14 +71,15 @@ my %whitelist = ( 'https://curl.se/rfc/rfc2255.txt' => 1, 'https://curl.se/sponsors.html' => 1, 'https://curl.se/support.html' => 1, + 'https://curl.se/windows' => 1, + 'https://curl.se/windows/' => 1, + + 'https://testclutch.curl.se/' => 1, - 'https://github.com/curl/curl' => 1, 'https://github.com/curl/curl-fuzzer' => 1, 'https://github.com/curl/curl-www' => 1, - 'https://github.com/curl/curl/discussions' => 1, - 'https://github.com/curl/curl/issues' => 1, - 'https://github.com/curl/curl/labels/help%20wanted' => 1, - 'https://github.com/curl/curl/pulls' => 1, + 'https://github.com/curl/curl.git' => 1, + 'https://github.com/curl/curl/wcurl' => 1, ); @@ -77,7 +87,7 @@ my %url; my %flink; # list all .md files in the repo -my @files=`git ls-files '**.md'`; +my @files=`git ls-files '**.md' docs/TODO docs/KNOWN_BUGS docs/FAQ`; sub storelink { my ($f, $line, $link) = @_; @@ -91,7 +101,29 @@ sub storelink { $link =~ s:\#.*\z::; if($link =~ /^(https|http):/) { - $url{$link} .= "$f:$line "; + if($whitelist{$link}) { + #print "-- whitelisted: $link\n"; + } + # example.com is just example + elsif($link =~ /^https:\/\/(.*)example.(com|org|net)/) { + #print "-- example: $link\n"; + } + # so is using the .example TLD + elsif($link =~ /^https:\/\/(.*)\.example(\/|$|:)/) { + #print "-- .example: $link\n"; + } + # so is using anything on localhost + elsif($link =~ /^http(s|):\/\/localhost/) { + #print "-- localhost: $link\n"; + } + # ignore all links to curl's github repo + elsif($link =~ /^https:\/\/github.com\/curl\/curl(\/|$)/) { + #print "-- curl github repo: $link\n"; + } + else { + #print "ADD '$link'\n"; + $url{$link} .= "$f:$line "; + } return; } @@ -119,11 +151,19 @@ sub findlinks { return; while() { + chomp; if(/\]\(([^)]*)/) { my $link = $1; #print "$f:$line $link\n"; storelink($f, $line, $link); } + # ignore trailing: dot, quote, asterisk, hash, comma, question mark, + # colon, closing parenthesis, closing angle bracket, whitespace, pipe, + # backtick, semicolon + elsif(/(https:\/\/[a-z0-9.\/:%_-]+[^."*\#,?:\)> \t|`;])/i) { + #print "RAW "; + storelink($f, $line, $1); + } $line++; } close(F); @@ -133,11 +173,10 @@ sub checkurl { my ($url) = @_; if($whitelist{$url}) { - #print "$url is whitelisted\n"; + #print STDERR "$url is whitelisted\n"; return 0; } - print "check $url\n"; $url =~ s/\+/%2B/g; my @content; if(open(my $fh, '-|', 'curl', '-ILfsm10', '--retry', '2', '--retry-delay', '5', @@ -146,9 +185,10 @@ sub checkurl { close $fh; } if(!$content[0]) { - print STDERR "FAIL\n"; + print "FAIL: $url\n"; return 1; # fail } + print "OK: $url\n"; return 0; # ok } @@ -157,14 +197,19 @@ for my $f (@files) { findlinks($f); } -my $error; +#for my $u (sort keys %url) { +# print "$u\n"; +#} +#exit; +my $error; +my @errlist; for my $u (sort keys %url) { my $r = checkurl($u); if($r) { for my $f (split(/ /, $url{$u})) { - printf "%s ERROR links to missing URL %s\n", $f, $u; + push @errlist, sprintf "%s ERROR links to missing URL %s\n", $f, $u; $error++; } } @@ -173,10 +218,17 @@ for my $u (sort keys %url) { for my $l (sort keys %flink) { if(! -r $l) { for my $f (split(/ /, $flink{$l})) { - printf "%s ERROR links to missing file %s\n", $f, $l; + push @errlist, sprintf "%s ERROR links to missing file %s\n", $f, $l; $error++; } } } +printf "Checked %d URLs\n", scalar(keys %url); +if($error) { + print "$error URLs had problems:\n"; + for(@errlist) { + print $_; + } +} exit 1 if($error); From 15e5ac6da8d4827e04c5a32d4672f58492615729 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Dec 2025 23:51:47 +0100 Subject: [PATCH 677/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 76 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 512bc5425d57..af81fffb902f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3554 + Contributors: 3556 This release includes the following changes: @@ -50,11 +50,13 @@ This release includes the following bugfixes: o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] o conncontrol: reuse handling [170] o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100] + o connection: attached transfer count [228] o cookie: propagate errors better, cleanup the internal API [118] o cookie: return error on OOM [131] o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] o curl_fopen: do not pass invalid mode flags to `open()` on Windows [84] + o curl_gssapi: make sure Curl_gss_log_error() has an initialized buffer [257] o curl_sasl: make Curl_sasl_decode_mech compare case insensitively [160] o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124] o curl_setup.h: drop stray `#undef stat` (Windows) [103] @@ -62,21 +64,28 @@ This release includes the following bugfixes: o CURLINFO: remove 'get' and 'get the' from each short desc [50] o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48] o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] + o CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use [206] o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example o curlx/fopen: replace open CRT functions their with `_s` counterparts (Windows) [204] o curlx/multibyte: stop setting macros for non-Windows [226] o curlx/strerr: use `strerror_s()` on Windows [75] + o curlx: limit use of system allocators to the minimum possible [169] o curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows) [143] o curlx: replace `sprintf` with `snprintf` [194] o curlx: use curlx allocators in non-memdebug builds (Windows) [155] o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] o DISTROS.md: add OpenBSD [126] + o DISTROS: remove broken URLs for buildroot o doc: some returned in-memory data may not be altered [196] + o docs/libcurl: fix C formatting nits [207] + o docs: clarify how to do unix domain sockets with SOCKS proxy [240] o docs: fix checksrc `EQUALSPACE` warnings [21] o docs: mention umask need when curl creates files [56] + o docs: remove dead URLs o docs: spell it Rustls with a capital R [181] + o docs: use .example URLs for proxies o example: fix formatting nits [232] o examples/crawler: fix variable [92] o examples/multi-uv: fix invalid req->data access [177] @@ -84,6 +93,7 @@ This release includes the following bugfixes: o examples: fix minor typo [203] o examples: make functions/data static where missing [139] o examples: tidy-up headers and includes [138] + o FAQ: fix hackerone URL o file: do not pass invalid mode flags to `open()` on upload (Windows) [83] o ftp: refactor a piece of code by merging the repeated part [40] o ftp: remove #ifdef for define that is always defined [76] @@ -103,16 +113,22 @@ This release includes the following bugfixes: o http: handle oom error from Curl_input_digest() [192] o http: replace atoi use in Curl_http_follow with curlx_str_number [65] o http: the :authority header should never contain user+password [147] + o idn: avoid allocations and wcslen on Windows [247] o idn: fix memory leak in `win32_ascii_to_idn()` [173] o idn: use curlx allocators on Windows [165] o imap: make sure Curl_pgrsSetDownloadSize() does not overflow [200] o INSTALL-CMAKE.md: document static option defaults more [37] o krb5: fix detecting channel binding feature [187] o krb5_sspi: unify a part of error handling [80] + o ldap: call ldap_init() before setting the options [236] + o ldap: improve detection of Apple LDAP [174] + o ldap: provide version for "legacy" ldap as well [254] o lib/sendf.h: forward declare two structs [221] o lib: cleanup for some typos about spaces and code style [3] o lib: eliminate size_t casts [112] o lib: error for OOM when extracting URL query [127] + o lib: fix formatting nits (part 2) [253] + o lib: fix formatting nits (part 3) [248] o lib: fix formatting nits [215] o lib: fix gssapi.h include on IBMi [55] o lib: refactor the type of funcs which have useless return and checks [1] @@ -129,6 +145,7 @@ This release includes the following bugfixes: o m4/sectrust: fix test(1) operator [4] o manage: expand the 'libcurl support required' message [208] o mbedtls: fix potential use of uninitialized `nread` [8] + o mbedtls: sync format across log messages [213] o mbedtls_threadlock: avoid calloc, use array [244] o memdebug: add mutex for thread safety [184] o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] @@ -139,6 +156,7 @@ This release includes the following bugfixes: o multibyte: limit `curlx_convert_*wchar*()` functions to Unicode builds [135] o ngtcp2+openssl: fix leak of session [172] o ngtcp2: remove the unused Curl_conn_is_ngtcp2 function [85] + o noproxy: fix ipv6 handling [239] o noproxy: replace atoi with curlx_str_number [67] o openssl: exit properly on OOM when getting certchain [133] o openssl: fix a potential memory leak of bio_out [150] @@ -146,6 +164,7 @@ This release includes the following bugfixes: o openssl: no verify failf message unless strict [166] o openssl: release ssl_session if sess_reuse_cb fails [43] o openssl: remove code handling default version [28] + o openssl: simplify `HAVE_KEYLOG_CALLBACK` guard [212] o OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs [94] o OS400/makefile.sh: fix shellcheck warning SC2038 [86] o osslq: code readability [5] @@ -153,7 +172,10 @@ This release includes the following bugfixes: o projects/README.md: Markdown fixes [148] o pytest fixes and improvements [159] o pytest: disable two H3 earlydata tests for all platforms (was: macOS) [116] + o pytest: fix and improve reliability [251] + o pytest: improve stragglers [252] o pytest: skip H2 tests if feature missing from curl [46] + o quiche: use client writer [255] o ratelimit: redesign [209] o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] @@ -161,6 +183,7 @@ This release includes the following bugfixes: o runtests: detect bad libssh differently for test 1459 [11] o runtests: drop Python 2 support remains [45] o runtests: enable torture testing with threaded resolver [176] + o runtests: make memanalyzer a Perl module (for 1.1-2x speed-up per test run) [238] o rustls: fix a potential memory issue [81] o rustls: minor adjustment of sizeof() [38] o rustls: simplify init err path [219] @@ -178,21 +201,29 @@ This release includes the following bugfixes: o socks_sspi: use free() not FreeContextBuffer() [93] o speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE [113] o speedlimit: also reset on send unpausing [197] + o src: fix formatting nits [246] o ssh: tracing and better pollset handling [230] + o sws: fix binding to unix socket on Windows [214] o telnet: replace atoi for BINARY handling with curlx_str_number [66] o TEST-SUITE.md: correct the man page's path [136] o test07_22: fix flakiness [95] + o test1498: disable 'HTTP PUT from stdin' test on Windows [115] o test2045: replace HTML multi-line comment markup with `#` comments [36] + o test3207: enable memdebug for this test again [249] o test363: delete stray character (typo) from a section tag [52] + o test787: fix possible typo `&` -> `%` in curl option [241] o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33] o tests/data: support using native newlines on disk, drop `.gitattributes` [91] o tests/server: do not fall back to original data file in `test2fopen()` [32] o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110] + o tests: add `%AMP` macro, use it in two tests [245] o tests: allow 2500-2503 to use ~2MB malloc [31] o tests: fix formatting nits [225] o tftp: release filename if conn_get_remote_addr fails [42] o tftpd: fix/tidy up `open()` mode flags [57] + o tidy-up: avoid `(())`, clang-format fixes and more [141] o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] + o TODO: remove a mandriva.com reference o tool: consider (some) curl_easy_setopt errors fatal [7] o tool: log when loading .curlrc in verbose mode [191] o tool_cfgable: free ssl-sessions at exit [123] @@ -212,6 +243,7 @@ This release includes the following bugfixes: o tool_urlglob: clean up used memory on errors better [44] o tool_writeout: bail out proper on OOM [104] o url: fix return code for OOM in parse_proxy() [193] + o url: if curl_url_get() fails due to OOM, error out properly [205] o url: if OOM in parse_proxy() return error [132] o urlapi: fix mem-leaks in curl_url_get error paths [22] o urlapi: handle OOM properly when setting URL [180] @@ -253,14 +285,15 @@ advice from friends like these: Aleksandr Sergeev, Aleksei Bavshin, Andrew Kirillov, BANADDA, boingball, Brad King, bttrfl on github, Christian Schmitz, Dan Fandrich, Daniel McCarney, Daniel Stenberg, Deniz Parlak, Fd929c2CE5fA on github, - ffath-vo on github, Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Kai Pastor, - Leonardo Taccari, letshack9707 on hackerone, Marc Aldorasi, Marcel Raad, - Max Faxälv, nait-furry, ncaklovic on github, Nick Korepanov, - Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro, - renovate[bot], Samuel Henrique, st751228051 on github, Stanislav Fort, - Stefan Eissing, Sunny, Thomas Klausner, Viktor Szakats, Wesley Moore, + ffath-vo on github, Georg Schulz-Allgaier, Gisle Vanem, Greg Hudson, + Jiyong Yang, Juliusz Sosinowicz, Kai Pastor, Leonardo Taccari, + letshack9707 on hackerone, Marc Aldorasi, Marcel Raad, Max Faxälv, + nait-furry, ncaklovic on github, Nick Korepanov, Omdahake on github, + Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot], + Samuel Henrique, st751228051 on github, Stanislav Fort, Stefan Eissing, + Sunny, Theo Buehler, Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang, Yedaya Katsman - (41 contributors) + (44 contributors) References to bug reports and discussions on issues: @@ -377,6 +410,7 @@ References to bug reports and discussions on issues: [112] = https://curl.se/bug/?i=19495 [113] = https://curl.se/bug/?i=19653 [114] = https://curl.se/bug/?i=19605 + [115] = https://curl.se/bug/?i=19855 [116] = https://curl.se/bug/?i=19724 [117] = https://curl.se/bug/?i=19644 [118] = https://curl.se/bug/?i=19493 @@ -402,6 +436,7 @@ References to bug reports and discussions on issues: [138] = https://curl.se/bug/?i=19580 [139] = https://curl.se/bug/?i=19579 [140] = https://curl.se/bug/?i=19175 + [141] = https://curl.se/bug/?i=19854 [142] = https://curl.se/bug/?i=19572 [143] = https://curl.se/bug/?i=19581 [144] = https://curl.se/bug/?i=19571 @@ -429,10 +464,12 @@ References to bug reports and discussions on issues: [166] = https://curl.se/bug/?i=19615 [167] = https://curl.se/bug/?i=19609 [168] = https://curl.se/bug/?i=19612 + [169] = https://curl.se/bug/?i=19748 [170] = https://curl.se/bug/?i=19333 [171] = https://curl.se/bug/?i=19714 [172] = https://curl.se/bug/?i=19717 [173] = https://curl.se/bug/?i=19789 + [174] = https://curl.se/bug/?i=19849 [175] = https://curl.se/bug/?i=19784 [176] = https://curl.se/bug/?i=19786 [177] = https://curl.se/bug/?i=19462 @@ -461,10 +498,16 @@ References to bug reports and discussions on issues: [202] = https://curl.se/bug/?i=19669 [203] = https://curl.se/bug/?i=19683 [204] = https://curl.se/bug/?i=19643 + [205] = https://curl.se/bug/?i=19838 + [206] = https://curl.se/bug/?i=19840 + [207] = https://curl.se/bug/?i=19844 [208] = https://curl.se/bug/?i=19665 [209] = https://curl.se/bug/?i=19384 [210] = https://curl.se/bug/?i=19769 [211] = https://curl.se/bug/?i=19768 + [212] = https://curl.se/bug/?i=19843 + [213] = https://curl.se/bug/?i=19842 + [214] = https://curl.se/bug/?i=19812 [215] = https://curl.se/bug/?i=19764 [217] = https://curl.se/bug/?i=19763 [219] = https://curl.se/bug/?i=19759 @@ -474,8 +517,25 @@ References to bug reports and discussions on issues: [223] = https://curl.se/bug/?i=16973 [225] = https://curl.se/bug/?i=19754 [226] = https://curl.se/bug/?i=19751 + [228] = https://curl.se/bug/?i=19836 [230] = https://curl.se/bug/?i=19745 [232] = https://curl.se/bug/?i=19746 + [236] = https://curl.se/bug/?i=19830 + [238] = https://curl.se/bug/?i=19786 + [239] = https://curl.se/bug/?i=19828 + [240] = https://curl.se/bug/?i=19829 + [241] = https://curl.se/bug/?i=19826 [242] = https://curl.se/bug/?i=19734 [243] = https://curl.se/bug/?i=19733 [244] = https://curl.se/bug/?i=19732 + [245] = https://curl.se/bug/?i=19824 + [246] = https://curl.se/bug/?i=19823 + [247] = https://curl.se/bug/?i=19798 + [248] = https://curl.se/bug/?i=19811 + [249] = https://curl.se/bug/?i=19813 + [251] = https://curl.se/bug/?i=19970 + [252] = https://curl.se/bug/?i=19809 + [253] = https://curl.se/bug/?i=19800 + [254] = https://curl.se/bug/?i=19808 + [255] = https://curl.se/bug/?i=19803 + [257] = https://curl.se/bug/?i=19802 From 891566c72da47250c13047f7df0d8aa94a6ff842 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 5 Dec 2025 14:12:47 +0100 Subject: [PATCH 678/885] ftp: make EPRT connections non-blocking On platforms where neither accept4 nor fcntl was available, an EPRT connection did not send the accepted socket as non-blocking. This became apparent when TLS was in use and the test receive on shutdown did simply hang. Reported-by: Denis Goleshchikhin Fixes #19753 Closes #19851 --- lib/cf-socket.c | 17 ++- tests/http/test_30_vsftpd.py | 13 ++- tests/http/test_31_vsftpds.py | 13 ++- tests/http/test_32_ftps_vsftpd.py | 13 ++- tests/libtest/Makefile.inc | 1 + tests/libtest/cli_ftp_upload.c | 182 ++++++++++++++++++++++++++++++ 6 files changed, 231 insertions(+), 8 deletions(-) create mode 100644 tests/libtest/cli_ftp_upload.c diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 1881683cc8ed..469e9229fd69 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -2114,15 +2114,22 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf))); return CURLE_FTP_ACCEPT_FAILED; } -#if !defined(HAVE_ACCEPT4) && defined(HAVE_FCNTL) - if((fcntl(s_accepted, F_SETFD, FD_CLOEXEC) < 0) || - (curlx_nonblock(s_accepted, TRUE) < 0)) { - failf(data, "fcntl set CLOEXEC/NONBLOCK: %s", +#ifndef HAVE_ACCEPT4 +#ifdef HAVE_FCNTL + if(fcntl(s_accepted, F_SETFD, FD_CLOEXEC) < 0) { + failf(data, "fcntl set CLOEXEC: %s", curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf))); Curl_socket_close(data, cf->conn, s_accepted); return CURLE_FTP_ACCEPT_FAILED; } -#endif +#endif /* HAVE_FCNTL */ + if(curlx_nonblock(s_accepted, TRUE) < 0) { + failf(data, "set socket NONBLOCK: %s", + curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf))); + Curl_socket_close(data, cf->conn, s_accepted); + return CURLE_FTP_ACCEPT_FAILED; + } +#endif /* !HAVE_ACCEPT4 */ infof(data, "Connection accepted from server"); /* Replace any filter on SECONDARY with one listening on this socket */ diff --git a/tests/http/test_30_vsftpd.py b/tests/http/test_30_vsftpd.py index 7d113d5363fe..bcc8b76fddeb 100644 --- a/tests/http/test_30_vsftpd.py +++ b/tests/http/test_30_vsftpd.py @@ -31,7 +31,7 @@ import shutil import pytest -from testenv import Env, CurlClient, VsFTPD +from testenv import Env, CurlClient, VsFTPD, LocalClient log = logging.getLogger(__name__) @@ -235,6 +235,17 @@ def test_30_11_download_non_existing(self, env: Env, vsftpd: VsFTPD): r.check_stats(count=1, exitcode=78) r.check_stats_timelines() + def test_30_12_upload_eprt(self, env: Env, vsftpd: VsFTPD): + docname = 'test_30_12' + client = LocalClient(name='cli_ftp_upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/{docname}' + r = client.run(args=['-r', f'{env.ftp_domain}:{vsftpd.port}:127.0.0.1', url]) + r.check_exit_code(0) + dstfile = os.path.join(vsftpd.docs_dir, docname) + assert os.path.exists(dstfile), f'{r.dump_logs()}' + def check_downloads(self, client, srcfile: str, count: int, complete: bool = True): for i in range(count): diff --git a/tests/http/test_31_vsftpds.py b/tests/http/test_31_vsftpds.py index 93fef708ccdd..ba4696c0cb29 100644 --- a/tests/http/test_31_vsftpds.py +++ b/tests/http/test_31_vsftpds.py @@ -31,7 +31,7 @@ import shutil import pytest -from testenv import Env, CurlClient, VsFTPD +from testenv import Env, CurlClient, VsFTPD, LocalClient log = logging.getLogger(__name__) @@ -260,6 +260,17 @@ def test_31_11_download_non_existing(self, env: Env, vsftpds: VsFTPD): r.check_exit_code(78) r.check_stats(count=1, exitcode=78) + def test_31_12_upload_eprt(self, env: Env, vsftpds: VsFTPD): + docname = 'test_31_12' + client = LocalClient(name='cli_ftp_upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}' + r = client.run(args=['-r', f'{env.ftp_domain}:{vsftpds.port}:127.0.0.1', url]) + r.check_exit_code(0) + dstfile = os.path.join(vsftpds.docs_dir, docname) + assert os.path.exists(dstfile), f'{r.dump_logs()}' + def check_downloads(self, client, srcfile: str, count: int, complete: bool = True): for i in range(count): diff --git a/tests/http/test_32_ftps_vsftpd.py b/tests/http/test_32_ftps_vsftpd.py index 7a849d374044..bac40580eecb 100644 --- a/tests/http/test_32_ftps_vsftpd.py +++ b/tests/http/test_32_ftps_vsftpd.py @@ -31,7 +31,7 @@ import shutil import pytest -from testenv import Env, CurlClient, VsFTPD +from testenv import Env, CurlClient, VsFTPD, LocalClient log = logging.getLogger(__name__) @@ -273,6 +273,17 @@ def test_32_11_download_non_existing(self, env: Env, vsftpds: VsFTPD): r.check_exit_code(78) r.check_stats(count=1, exitcode=78) + def test_32_12_upload_eprt(self, env: Env, vsftpds: VsFTPD): + docname = 'test_32_12' + client = LocalClient(name='cli_ftp_upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + url = f'ftps://{env.ftp_domain}:{vsftpds.port}/{docname}' + r = client.run(args=['-r', f'{env.ftp_domain}:{vsftpds.port}:127.0.0.1', url]) + r.check_exit_code(0) + dstfile = os.path.join(vsftpds.docs_dir, docname) + assert os.path.exists(dstfile), f'{r.dump_logs()}' + def check_downloads(self, client, srcfile: str, count: int, complete: bool = True): for i in range(count): diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc index 8efeba914df8..a0d78f96c381 100644 --- a/tests/libtest/Makefile.inc +++ b/tests/libtest/Makefile.inc @@ -48,6 +48,7 @@ CURLX_C = \ # All libtest programs TESTS_C = \ + cli_ftp_upload.c \ cli_h2_pausing.c \ cli_h2_serverpush.c \ cli_h2_upgrade_extreme.c \ diff --git a/tests/libtest/cli_ftp_upload.c b/tests/libtest/cli_ftp_upload.c new file mode 100644 index 000000000000..7493a210e6e9 --- /dev/null +++ b/tests/libtest/cli_ftp_upload.c @@ -0,0 +1,182 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#include "first.h" + +#include "testtrace.h" + + +#ifndef CURL_DISABLE_FTP + +struct test_cli_ftp_upload_data { + const char *data; + size_t data_len; + size_t offset; + int done; +}; + +static size_t test_cli_ftp_upload_read(char *buf, + size_t nitems, size_t blen, + void *userdata) +{ + struct test_cli_ftp_upload_data *d = userdata; + size_t nread = d->data_len - d->offset; + + if(nread) { + if(nread > (nitems * blen)) + nread = (nitems * blen); + memcpy(buf, d->data + d->offset, nread); + d->offset += nread; + } + else + d->done = 1; + return nread; +} + +static void usage_ftp_upload(const char *msg) +{ + if(msg) + curl_mfprintf(stderr, "%s\n", msg); + curl_mfprintf(stderr, + "usage: [options] url\n" + " -r :: resolve information\n" + ); +} + +#endif + +static CURLcode test_cli_ftp_upload(const char *URL) +{ +#ifndef CURL_DISABLE_FTP + CURLM *multi_handle; + CURL *curl_handle; + int running_handles = 0; + int max_fd = -1; + struct timeval timeout = { 1, 0 }; + fd_set fdread; + fd_set fdwrite; + fd_set fdexcep; + struct test_cli_ftp_upload_data data; + struct curl_slist *host = NULL; + const char *resolve = NULL, *url; + int ch; + CURLcode result = CURLE_FAILED_INIT; + curl_off_t uploadsize = -1; + + (void)URL; + while((ch = cgetopt(test_argc, test_argv, "r:")) + != -1) { + switch(ch) { + case 'r': + resolve = coptarg; + break; + default: + usage_ftp_upload("unknown option"); + return (CURLcode)1; + } + } + test_argc -= coptind; + test_argv += coptind; + if(test_argc != 1) { + usage_ftp_upload("not enough arguments"); + return (CURLcode)2; + } + url = test_argv[0]; + + if(resolve) + host = curl_slist_append(NULL, resolve); + + memset(&data, 0, sizeof(data)); + data.data = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + data.data_len = strlen(data.data); + + curl_global_init(CURL_GLOBAL_ALL); + multi_handle = curl_multi_init(); + curl_handle = curl_easy_init(); + + curl_easy_setopt(curl_handle, CURLOPT_FTPPORT, "-"); + curl_easy_setopt(curl_handle, CURLOPT_FTP_USE_EPRT, 1L); + curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl_handle, CURLOPT_USE_SSL, CURLUSESSL_TRY); + curl_easy_setopt(curl_handle, CURLOPT_URL, url); + curl_easy_setopt(curl_handle, CURLOPT_USERPWD, NULL); + curl_easy_setopt(curl_handle, CURLOPT_FTP_CREATE_MISSING_DIRS, + CURLFTP_CREATE_DIR); + curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, + test_cli_ftp_upload_read); + curl_easy_setopt(curl_handle, CURLOPT_READDATA, &data); + curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE_LARGE, uploadsize); + + curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl_handle, CURLOPT_DEBUGFUNCTION, cli_debug_cb); + if(host) + curl_easy_setopt(curl_handle, CURLOPT_RESOLVE, host); + + curl_multi_add_handle(multi_handle, curl_handle); + curl_multi_perform(multi_handle, &running_handles); + while(running_handles && !data.done) { + FD_ZERO(&fdread); + FD_ZERO(&fdwrite); + FD_ZERO(&fdexcep); + + curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &max_fd); + select(max_fd + 1, &fdread, &fdwrite, &fdexcep, &timeout); + curl_multi_perform(multi_handle, &running_handles); + } + while(running_handles) { + curl_mfprintf(stderr, "reports to hang herel\n"); + curl_multi_perform(multi_handle, &running_handles); + } + + while(1) { + int msgq = 0; + struct CURLMsg *msg = curl_multi_info_read(multi_handle, &msgq); + if(msg && (msg->msg == CURLMSG_DONE)) { + if(msg->easy_handle == curl_handle) { + result = msg->data.result; + } + } + else + break; + } + + curl_multi_remove_handle(multi_handle, curl_handle); + + curl_easy_reset(curl_handle); + curl_easy_cleanup(curl_handle); + curl_multi_cleanup(multi_handle); + curl_global_cleanup(); + curl_slist_free_all(host); + + curl_mfprintf(stderr, "transfer result: %d\n", result); + return result; +#else /* !CURL_DISABLE_FTP */ + (void)URL; + curl_mfprintf(stderr, "FTP not enabled in libcurl\n"); + return (CURLcode)1; +#endif /* CURL_DISABLE_FTP */ +} From 1c0822e8cb4ba96e4bf555d4c46bcae1d85ca343 Mon Sep 17 00:00:00 2001 From: "Robert W. Van Kirk" Date: Sat, 6 Dec 2025 12:00:00 -0600 Subject: [PATCH 679/885] formdata: validate callback is non-NULL before use curl_formget() accepts a user-provided callback function but does not validate it is non-NULL before calling it. If a caller passes NULL, the function will crash with SIGSEGV. Add NULL check at the start of the function to return an appropriate error code instead of crashing. Signed-off-by: Robert W. Van Kirk Closes #19858 --- lib/formdata.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/formdata.c b/lib/formdata.c index b0c57b8d6f06..8f95fc3df036 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -636,6 +636,10 @@ int curl_formget(struct curl_httppost *form, void *arg, CURLcode result; curl_mimepart toppart; + /* Validate callback is provided */ + if(!append) + return (int)CURLE_BAD_FUNCTION_ARGUMENT; + Curl_mime_initpart(&toppart); /* default form is empty */ result = Curl_getformdata(NULL, &toppart, form, NULL); if(!result) From 0b5ece553cf97f16b36bb7a6bf1071d0ae3cb3aa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 6 Dec 2025 18:01:09 +0100 Subject: [PATCH 680/885] altsvc: make it one malloc instead of three per entry Also return OOM correctly. Closes #19857 --- lib/altsvc.c | 47 ++++++++++++++++++++--------------------------- lib/setopt.c | 2 +- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index f2906ad4e379..31f6b515bec2 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -64,12 +64,7 @@ const char *Curl_alpnid2str(enum alpnid id) } } -static void altsvc_free(struct altsvc *as) -{ - curlx_free(as->src.host); - curlx_free(as->dst.host); - curlx_free(as); -} +#define altsvc_free(x) curlx_free(x) static struct altsvc *altsvc_createid(const char *srchost, size_t hlen, @@ -80,38 +75,35 @@ static struct altsvc *altsvc_createid(const char *srchost, size_t srcport, size_t dstport) { - struct altsvc *as = curlx_calloc(1, sizeof(struct altsvc)); - if(!as) - return NULL; - DEBUGASSERT(hlen); - DEBUGASSERT(dlen); - if(!hlen || !dlen) - /* bad input */ - goto error; + struct altsvc *as; if((hlen > 2) && srchost[0] == '[') { /* IPv6 address, strip off brackets */ srchost++; hlen -= 2; } - else if(srchost[hlen - 1] == '.') { + else if(hlen && (srchost[hlen - 1] == '.')) { /* strip off trailing dot */ hlen--; - if(!hlen) - goto error; } if((dlen > 2) && dsthost[0] == '[') { /* IPv6 address, strip off brackets */ dsthost++; dlen -= 2; } + if(!hlen || !dlen) + /* bad input */ + return NULL; + /* struct size plus both strings */ + as = curlx_calloc(1, sizeof(struct altsvc) + (hlen + 1) + (dlen + 1)); + if(!as) + return NULL; + as->src.host = (char *)as + sizeof(struct altsvc); + memcpy(as->src.host, srchost, hlen); + /* the null terminator is already there */ - as->src.host = Curl_memdup0(srchost, hlen); - if(!as->src.host) - goto error; - - as->dst.host = Curl_memdup0(dsthost, dlen); - if(!as->dst.host) - goto error; + as->dst.host = (char *)as + sizeof(struct altsvc) + hlen + 1; + memcpy(as->dst.host, dsthost, dlen); + /* the null terminator is already there */ as->src.alpnid = srcalpnid; as->dst.alpnid = dstalpnid; @@ -119,9 +111,6 @@ static struct altsvc *altsvc_createid(const char *srchost, as->dst.port = (unsigned short)dstport; return as; -error: - altsvc_free(as); - return NULL; } static struct altsvc *altsvc_create(struct Curl_str *srchost, @@ -194,6 +183,8 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, const char *line) as->persist = persist ? 1 : 0; Curl_llist_append(&asi->list, as, &as->node); } + else + return CURLE_OUT_OF_MEMORY; } return CURLE_OK; @@ -600,6 +591,8 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, (int)curlx_strlen(&dsthost), curlx_str(&dsthost), dstport, Curl_alpnid2str(dstalpnid)); } + else + return CURLE_OUT_OF_MEMORY; } } else diff --git a/lib/setopt.c b/lib/setopt.c index 476506dad4dc..24d8fe8de060 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2532,7 +2532,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, if(result) return result; if(ptr) - (void)Curl_altsvc_load(data->asi, ptr); + return Curl_altsvc_load(data->asi, ptr); break; #endif /* ! CURL_DISABLE_ALTSVC */ #ifdef USE_ECH From f4b56f34ba881efad011ce1361c52340e3de3a2e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 6 Dec 2025 23:45:06 +0100 Subject: [PATCH 681/885] asyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo Follow-up to ce06fe77710525 Bug: https://github.com/curl/curl/commit/ce06fe7771052549ff430c86173b2eaca91f8a9c#r172215567 Reported-by: Harry Sintonen Closes #19859 --- lib/asyn-thrdd.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index e5bf0629d38f..aa686271a0dd 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -725,24 +725,18 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) /* * Curl_async_getaddrinfo() - for platforms without getaddrinfo */ -struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, - const char *hostname, - int port, - int ip_version, - int *waitp) +CURLcode Curl_async_getaddrinfo(struct Curl_easy *data, const char *hostname, + int port, int ip_version) { (void)ip_version; - *waitp = 0; /* default to synchronous response */ /* fire up a new resolver thread! */ if(async_thrdd_init(data, hostname, port, ip_version, NULL)) { - *waitp = 1; /* expect asynchronous response */ - return NULL; + return CURLE_OK; } failf(data, "getaddrinfo() thread failed"); - - return NULL; + return CURLE_FAILED_INIT; } #else /* !HAVE_GETADDRINFO */ From 65597f8fc92671400ddd3572749e58b07c3c8477 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 00:03:56 +0100 Subject: [PATCH 682/885] noproxy: fix build on systems without IPv6 Follow-up to ff2aaed9ba6f186feb57f89fc6854 Reported-by: Harry Sintonen Closes #19860 --- lib/noproxy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/noproxy.c b/lib/noproxy.c index e0d0877fdc4f..86acf8ba2b91 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -211,8 +211,10 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) namelen = strlen(name); if(curlx_inet_pton(AF_INET, name, &address) == 1) type = TYPE_IPV4; +#ifdef USE_IPV6 else if(curlx_inet_pton(AF_INET6, name, &address) == 1) type = TYPE_IPV6; +#endif else { /* ignore trailing dots in the hostname */ if(name[namelen - 1] == '.') From 9ec63d8565c9d3194c70e2ad3433b623308ee467 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 12:24:33 +0100 Subject: [PATCH 683/885] hsts: use one malloc instead of two per entry Closes #19861 --- lib/hsts.c | 21 +++++---------------- lib/hsts.h | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/lib/hsts.c b/lib/hsts.c index 66f983e493fb..62c4c587dfb3 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -75,11 +75,7 @@ struct hsts *Curl_hsts_init(void) return h; } -static void hsts_free(struct stsentry *e) -{ - curlx_free(CURL_UNCONST(e->host)); - curlx_free(e); -} +#define hsts_free(x) curlx_free(x) void Curl_hsts_cleanup(struct hsts **hp) { @@ -111,18 +107,11 @@ static CURLcode hsts_create(struct hsts *h, /* strip off any trailing dot */ --hlen; if(hlen) { - char *duphost; - struct stsentry *sts = curlx_calloc(1, sizeof(struct stsentry)); + struct stsentry *sts = curlx_calloc(1, sizeof(struct stsentry) + hlen); if(!sts) return CURLE_OUT_OF_MEMORY; - - duphost = Curl_memdup0(hostname, hlen); - if(!duphost) { - curlx_free(sts); - return CURLE_OUT_OF_MEMORY; - } - - sts->host = duphost; + /* the null terminator is already there */ + memcpy(sts->host, hostname, hlen); sts->expires = expires; sts->includeSubDomains = subdomains; Curl_llist_append(&h->list, sts, &sts->node); @@ -294,7 +283,7 @@ static CURLcode hsts_push(struct Curl_easy *data, struct tm stamp; CURLcode result; - e.name = (char *)CURL_UNCONST(sts->host); + e.name = (char *)sts->host; e.namelen = strlen(sts->host); e.includeSubDomains = sts->includeSubDomains; diff --git a/lib/hsts.h b/lib/hsts.h index 91fe778788c7..bd6ebba4dea4 100644 --- a/lib/hsts.h +++ b/lib/hsts.h @@ -35,9 +35,9 @@ extern time_t deltatime; struct stsentry { struct Curl_llist_node node; - const char *host; curl_off_t expires; /* the timestamp of this entry's expiry */ BIT(includeSubDomains); + char host[1]; }; /* The HSTS cache. Needs to be able to tailmatch hostnames. */ From a3f4fd25d3991fe955afa2f5e3994c04339cc842 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 12:35:42 +0100 Subject: [PATCH 684/885] http: return OOM errors from hsts properly When Curl_hsts_parse() fails with out of memory, return it to parent. Closes #19862 --- lib/http.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index ba42f19ff0f9..ce5f5becdf0e 100644 --- a/lib/http.c +++ b/lib/http.c @@ -3501,8 +3501,11 @@ static CURLcode http_header_s(struct Curl_easy *data, if(v) { CURLcode check = Curl_hsts_parse(data->hsts, conn->host.name, v); - if(check) + if(check) { + if(check == CURLE_OUT_OF_MEMORY) + return check; infof(data, "Illegal STS header skipped"); + } #ifdef DEBUGBUILD else infof(data, "Parsed STS header fine (%zu entries)", From cc5c1553fbdb8c1391d0cf81134583ee32da64d4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 5 Dec 2025 14:53:35 +0100 Subject: [PATCH 685/885] wolfssl: fix possible assert with `!HAVE_NO_EX` wolfSSL builds Without this option `wolfSSL_get_app_data()` always returns NULL. Disable codepaths using it (and its `set` pair) when curl is built against a wolfSSL library with this option missing. Fixing: ``` curl: ../../lib/vtls/wolfssl.c:486: wssl_vtls_new_session_cb: Assertion `cf != ((void *)0)' failed. ``` wolfSSL can be built with the `--enable-context-extra-user-data` or `-DWOLFSSL_EX_DATA` option to enable this feature. Some higher-level features also enable it automatically like QUIC, ASIO. Reported-by: Yedaya Katsman Bug: https://github.com/curl/curl/pull/19816#issuecomment-3606447845 Ref: https://github.com/curl/curl/actions/runs/19871780796/job/56949160740 Closes #19852 --- lib/vtls/wolfssl.c | 8 ++++++++ lib/vtls/wolfssl.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index d4d586b0ea35..0c47e9c2eefb 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -414,6 +414,7 @@ static void wssl_bio_cf_free_methods(void) #endif /* !USE_BIO_CHAIN */ +#ifdef HAVE_EX_DATA CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, struct Curl_easy *data, const char *ssl_peer_key, @@ -497,6 +498,7 @@ static int wssl_vtls_new_session_cb(WOLFSSL *ssl, WOLFSSL_SESSION *session) } return 0; } +#endif static CURLcode wssl_on_session_reuse(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -1260,10 +1262,12 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, } #endif +#ifdef HAVE_EX_DATA if(Curl_ssl_scache_use(cf, data) && (transport != TRNSPRT_QUIC)) { /* Register to get notified when a new session is received */ wolfSSL_CTX_sess_set_new_cb(wctx->ssl_ctx, wssl_vtls_new_session_cb); } +#endif if(cb_setup) { result = cb_setup(cf, data, cb_user_data); @@ -1304,7 +1308,11 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, goto out; } +#ifdef HAVE_EX_DATA wolfSSL_set_app_data(wctx->ssl, ssl_user_data); +#else + (void)ssl_user_data; +#endif #ifdef WOLFSSL_QUIC if(transport == TRNSPRT_QUIC) wolfSSL_set_quic_use_legacy_codepoint(wctx->ssl, 0); diff --git a/lib/vtls/wolfssl.h b/lib/vtls/wolfssl.h index 5e3c9e2c5dd6..736da9a1a6a2 100644 --- a/lib/vtls/wolfssl.h +++ b/lib/vtls/wolfssl.h @@ -75,6 +75,7 @@ CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf, struct Curl_easy *data, struct wssl_ctx *wssl); +#ifdef HAVE_EX_DATA CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, struct Curl_easy *data, const char *ssl_peer_key, @@ -83,6 +84,7 @@ CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, const char *alpn, unsigned char *quic_tp, size_t quic_tp_len); +#endif CURLcode Curl_wssl_verify_pinned(struct Curl_cfilter *cf, struct Curl_easy *data, From f08417c4259a3b9a2e4d72a48fa02ce6502cb587 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Dec 2025 16:58:34 +0100 Subject: [PATCH 686/885] runner.pm: run memanalyzer as a Perl module To improve performance of torture tests. Also on Windows, where this patch may make those viable for CI. Linux !FTP 4m47 -> 4m24 (-shallow=25) Linux FTP 2m30 -> 2m23 (-shallow=25) macOS !FTP 14m30 -> 13m07 (-shallow=25) macOS FTP 3m57 -> 3m59 (-shallow=25) Windows !FTP >25m -> 4m47 to 14m45 (-shallow=5 to 25) (not in CI) Linux Before: https://github.com/curl/curl/actions/runs/20006771767/job/57370205514 After: https://github.com/curl/curl/actions/runs/20006783210/job/57370236911?pr=19863 macOS: Before: https://github.com/curl/curl/actions/runs/20006771786/job/57370205769 After: https://github.com/curl/curl/actions/runs/20006783177/job/57370236995?pr=19863 Windows: Before: https://github.com/curl/curl/actions/runs/19667198537/job/56326962912?pr=19675 After: https://github.com/curl/curl/actions/runs/20007175773/job/57371768734?pr=19863 After shallow=25: https://github.com/curl/curl/actions/runs/20008523913/job/57374427449?pr=19865 Ref: #19675 Follow-up to 472bc9032374f98f48f7a2df6c644cff91fe142c #19821 Closes #19863 --- tests/runner.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/runner.pm b/tests/runner.pm index b69bbf2420aa..10be04bd4b49 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -107,6 +107,7 @@ use testutil qw( subnewlines ); use valgrind; +use memanalyzer; ####################################################################### @@ -449,7 +450,7 @@ sub torture { # memanalyze -v is our friend, get the number of allocations made my $count=0; - my @out = `$memanalyze -v "$LOGDIR/$MEMDUMP"`; + my @out = memanalyze("$LOGDIR/$MEMDUMP", 1, 0, 0); for(@out) { if(/^Operations: (\d+)/) { $count = $1; @@ -549,7 +550,7 @@ sub torture { $fail=1; } else { - my @memdata=`$memanalyze "$LOGDIR/$MEMDUMP"`; + my @memdata = memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 0); my $leak=0; for(@memdata) { if($_ ne "") { @@ -561,7 +562,7 @@ sub torture { if($leak) { logmsg "** MEMORY FAILURE\n"; logmsg @memdata; - logmsg `$memanalyze -l "$LOGDIR/$MEMDUMP"`; + logmsg memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 1); $fail = 1; } } From c6e5dfa2c67570f98225959148a6e78c1e2180f2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 13:17:24 +0100 Subject: [PATCH 687/885] cookie: allocate the main struct once cookie is fine This delays the allocating of the cookie struct until after all the checks have been done, as many cookies are received and discarded instead of accepted and this then saves one allocation for every discarded cookie. Closes #19864 --- lib/cookie.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index 5c29768bbdfc..743ed56404a5 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -65,14 +65,15 @@ static void cap_expires(time_t now, struct Cookie *co) } } -static void freecookie(struct Cookie *co) +static void freecookie(struct Cookie *co, bool maintoo) { curlx_free(co->domain); curlx_free(co->path); curlx_free(co->spath); curlx_free(co->name); curlx_free(co->value); - curlx_free(co); + if(maintoo) + curlx_free(co); } static bool cookie_tailmatch(const char *cookie_domain, @@ -312,7 +313,7 @@ static void remove_expired(struct CookieInfo *ci) if(co->expires) { if(co->expires < now) { Curl_node_remove(n); - freecookie(co); + freecookie(co, TRUE); ci->numcookies--; } else if(co->expires < ci->next_expiration) @@ -938,7 +939,7 @@ static bool replace_existing(struct Curl_easy *data, Curl_node_remove(replace_n); /* free the old cookie */ - freecookie(repl); + freecookie(repl, TRUE); } *replacep = replace_old; return TRUE; @@ -964,6 +965,7 @@ Curl_cookie_add(struct Curl_easy *data, unless set */ bool secure) /* TRUE if connection is over secure origin */ { + struct Cookie comem; struct Cookie *co; size_t myhash; CURLcode result; @@ -975,10 +977,8 @@ Curl_cookie_add(struct Curl_easy *data, if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT) return CURLE_OK; /* silently ignore */ - /* First, alloc and init a new struct for it */ - co = curlx_calloc(1, sizeof(struct Cookie)); - if(!co) - return CURLE_OUT_OF_MEMORY; /* bail out if we are this low on memory */ + co = &comem; + memset(co, 0, sizeof(comem)); if(httpheader) result = parse_cookie_header(data, co, ci, &okay, @@ -1028,6 +1028,13 @@ Curl_cookie_add(struct Curl_easy *data, if(!replace_existing(data, co, ci, secure, &replaces)) goto fail; + /* clone the stack struct into heap */ + co = Curl_memdup(&comem, sizeof(comem)); + if(!co) { + co = &comem; + goto fail; /* bail out if we are this low on memory */ + } + /* add this cookie to the list */ myhash = cookiehash(co->domain); Curl_llist_append(&ci->cookielist[myhash], co, &co->node); @@ -1054,7 +1061,7 @@ Curl_cookie_add(struct Curl_easy *data, return result; fail: - freecookie(co); + freecookie(co, FALSE); return result; } @@ -1382,7 +1389,7 @@ void Curl_cookie_clearall(struct CookieInfo *ci) struct Cookie *c = Curl_node_elem(n); struct Curl_llist_node *e = Curl_node_next(n); Curl_node_remove(n); - freecookie(c); + freecookie(c, TRUE); n = e; } } @@ -1411,7 +1418,7 @@ void Curl_cookie_clearsess(struct CookieInfo *ci) e = Curl_node_next(n); /* in case the node is removed, get it early */ if(!curr->expires) { Curl_node_remove(n); - freecookie(curr); + freecookie(curr, TRUE); ci->numcookies--; } } From 524936fbebf2a37f5d02c97da2842fa6655a25bd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 13:49:33 +0100 Subject: [PATCH 688/885] cookie: when parsing a cookie header, delay all allocations until okay To avoid wasting time allocating data for incoming cookies that are discarded for one reason or another, delay allocations until after verifications are done. Closes #19864 --- lib/cookie.c | 145 +++++++++++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 68 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index 743ed56404a5..743a7a832860 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -43,8 +43,6 @@ #include "bufref.h" #include "curlx/strparse.h" -static void strstore(char **str, const char *newstr, size_t len); - /* number of seconds in 400 days */ #define COOKIES_MAXAGE (400 * 24 * 3600) @@ -263,15 +261,17 @@ static char *sanitize_cookie_path(const char *cookie_path) * parsing in a last-wins scenario. The caller is responsible for checking * for OOM errors. */ -static void strstore(char **str, const char *newstr, size_t len) +static CURLcode strstore(char **str, const char *newstr, size_t len) { DEBUGASSERT(str); - curlx_free(*str); if(!len) { len++; newstr = ""; } *str = Curl_memdup0(newstr, len); + if(!*str) + return CURLE_OUT_OF_MEMORY; + return CURLE_OK; } /* @@ -356,14 +356,15 @@ static bool bad_domain(const char *domain, size_t len) fine. The prime reason for filtering out control bytes is that some HTTP servers return 400 for requests that contain such. */ -static bool invalid_octets(const char *ptr) +static bool invalid_octets(const char *ptr, size_t len) { const unsigned char *p = (const unsigned char *)ptr; /* Reject all bytes \x01 - \x1f (*except* \x09, TAB) + \x7f */ - while(*p) { + while(len && *p) { if(((*p != 9) && (*p < 0x20)) || (*p == 0x7f)) return TRUE; p++; + len--; } return FALSE; } @@ -375,6 +376,57 @@ static bool invalid_octets(const char *ptr) */ #define MAX_DATE_LENGTH 80 +#define COOKIE_NAME 0 +#define COOKIE_VALUE 1 +#define COOKIE_DOMAIN 2 +#define COOKIE_PATH 3 + +#define COOKIE_PIECES 4 /* the list above */ + +static CURLcode storecookie(struct Cookie *co, struct Curl_str *cp, + const char *path, const char *domain) +{ + CURLcode result; + result = strstore(&co->name, curlx_str(&cp[COOKIE_NAME]), + curlx_strlen(&cp[COOKIE_NAME])); + if(!result) + result = strstore(&co->value, curlx_str(&cp[COOKIE_VALUE]), + curlx_strlen(&cp[COOKIE_VALUE])); + if(!result) { + if(curlx_strlen(&cp[COOKIE_PATH])) + result = strstore(&co->path, curlx_str(&cp[COOKIE_PATH]), + curlx_strlen(&cp[COOKIE_PATH])); + else if(path) { + /* No path was given in the header line, set the default */ + const char *endslash = strrchr(path, '/'); + if(endslash) { + size_t pathlen = (endslash - path + 1); /* include end slash */ + co->path = Curl_memdup0(path, pathlen); + if(!co->path) + result = CURLE_OUT_OF_MEMORY; + } + } + + if(!result && co->path) { + co->spath = sanitize_cookie_path(co->path); + if(!co->spath) + result = CURLE_OUT_OF_MEMORY; + } + } + if(!result) { + if(curlx_strlen(&cp[COOKIE_DOMAIN])) + result = strstore(&co->domain, curlx_str(&cp[COOKIE_DOMAIN]), + curlx_strlen(&cp[COOKIE_DOMAIN])); + else if(domain) { + /* no domain was given in the header line, set the default */ + co->domain = curlx_strdup(domain); + if(!co->domain) + result = CURLE_OUT_OF_MEMORY; + } + } + return result; +} + /* this function return errors on OOM etc, not on plain cookie format problems */ static CURLcode @@ -393,6 +445,8 @@ parse_cookie_header(struct Curl_easy *data, /* This line was read off an HTTP-header */ time_t now; size_t linelength = strlen(ptr); + CURLcode result; + struct Curl_str cookie[COOKIE_PIECES] = { 0 }; *okay = FALSE; if(linelength > MAX_COOKIE_LINE) /* discard overly long lines at once */ @@ -449,29 +503,18 @@ parse_cookie_header(struct Curl_easy *data, else if(!strncmp("__Host-", curlx_str(&name), 7)) co->prefix_host = TRUE; - /* - * Use strstore() below to properly deal with received cookie - * headers that have the same string property set more than once, - * and then we use the last one. - */ - - if(!co->name) { + if(!curlx_strlen(&cookie[COOKIE_NAME])) { /* The first name/value pair is the actual cookie name */ - if(!sep) - /* Bad name/value pair. */ - return CURLE_OK; - - strstore(&co->name, curlx_str(&name), curlx_strlen(&name)); - if(co->name) - strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); - if(!co->name || !co->value) - return CURLE_OUT_OF_MEMORY; - done = TRUE; - - if(invalid_octets(co->value) || invalid_octets(co->name)) { + if(!sep || + /* Bad name/value pair. */ + invalid_octets(curlx_str(&name), curlx_strlen(&name)) || + invalid_octets(curlx_str(&val), curlx_strlen(&val))) { infof(data, "invalid octets in name/value, cookie dropped"); return CURLE_OK; } + cookie[COOKIE_NAME] = name; + cookie[COOKIE_VALUE] = val; + done = TRUE; } else if(!curlx_strlen(&val)) { /* @@ -501,13 +544,7 @@ parse_cookie_header(struct Curl_easy *data, if(done) ; else if(curlx_str_casecompare(&name, "path")) { - strstore(&co->path, curlx_str(&val), curlx_strlen(&val)); - if(!co->path) - return CURLE_OUT_OF_MEMORY; - curlx_free(co->spath); /* if this is set again */ - co->spath = sanitize_cookie_path(co->path); - if(!co->spath) - return CURLE_OUT_OF_MEMORY; + cookie[COOKIE_PATH] = val; } else if(curlx_str_casecompare(&name, "domain") && curlx_strlen(&val)) { bool is_ip; @@ -538,10 +575,7 @@ parse_cookie_header(struct Curl_easy *data, (curlx_strlen(&val) == strlen(domain))) || (!is_ip && cookie_tailmatch(curlx_str(&val), curlx_strlen(&val), domain))) { - strstore(&co->domain, curlx_str(&val), curlx_strlen(&val)); - if(!co->domain) - return CURLE_OUT_OF_MEMORY; - + cookie[COOKIE_DOMAIN] = val; if(!is_ip) co->tailmatch = TRUE; /* we always do that if the domain name was given */ @@ -627,40 +661,15 @@ parse_cookie_header(struct Curl_easy *data, break; } while(1); - if(!co->domain && domain) { - /* no domain was given in the header line, set the default */ - co->domain = curlx_strdup(domain); - if(!co->domain) - return CURLE_OUT_OF_MEMORY; - } - - if(!co->path && path) { - /* - * No path was given in the header line, set the default. - */ - const char *endslash = strrchr(path, '/'); - if(endslash) { - size_t pathlen = (endslash - path + 1); /* include end slash */ - co->path = Curl_memdup0(path, pathlen); - if(co->path) { - co->spath = sanitize_cookie_path(co->path); - if(!co->spath) - return CURLE_OUT_OF_MEMORY; - } - else - return CURLE_OUT_OF_MEMORY; - } - } - - /* - * If we did not get a cookie name, or a bad one, the this is an illegal - * line so bail out. - */ - if(!co->name) + if(!curlx_strlen(&cookie[COOKIE_NAME])) + /* If we did not get a cookie name, or a bad one, bail out. */ return CURLE_OK; - *okay = TRUE; - return CURLE_OK; + /* the header was fine, now store the data */ + result = storecookie(co, &cookie[0], path, domain); + if(!result) + *okay = TRUE; + return result; } static CURLcode parse_netscape(struct Cookie *co, From a093c93994d2afed3beed94809844c961d3f4a64 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 16:09:13 +0100 Subject: [PATCH 689/885] cookie: only keep and use the canonical cleaned up path Instead of keeping both versions around. Closes #19864 --- lib/cookie.c | 82 ++++++++++++++++-------------------- lib/cookie.h | 3 +- tests/data/test1105 | 4 +- tests/data/test1561 | 2 +- tests/data/test1903 | 4 +- tests/data/test1905 | 4 +- tests/data/test31 | 28 ++++++------- tests/data/test420 | 8 ++-- tests/data/test444 | 100 ++++++++++++++++++++++---------------------- tests/data/test46 | 2 +- tests/data/test61 | 4 +- 11 files changed, 116 insertions(+), 125 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index 743a7a832860..7efce5611f2a 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -67,7 +67,6 @@ static void freecookie(struct Cookie *co, bool maintoo) { curlx_free(co->domain); curlx_free(co->path); - curlx_free(co->spath); curlx_free(co->name); curlx_free(co->value); if(maintoo) @@ -227,20 +226,19 @@ static size_t cookiehash(const char * const domain) /* * cookie path sanitize */ -static char *sanitize_cookie_path(const char *cookie_path) +static char *sanitize_cookie_path(const char *cookie_path, size_t len) { - size_t len = strlen(cookie_path); - /* some sites send path attribute within '"'. */ - if(cookie_path[0] == '\"') { + if(len && (cookie_path[0] == '\"')) { cookie_path++; len--; + + if(len && (cookie_path[len - 1] == '\"')) + len--; } - if(len && (cookie_path[len - 1] == '\"')) - len--; /* RFC6265 5.2.4 The Path Attribute */ - if(cookie_path[0] != '/') + if(!len || (cookie_path[0] != '/')) /* Let cookie-path be the default-path. */ return curlx_strdup("/"); @@ -393,23 +391,23 @@ static CURLcode storecookie(struct Cookie *co, struct Curl_str *cp, result = strstore(&co->value, curlx_str(&cp[COOKIE_VALUE]), curlx_strlen(&cp[COOKIE_VALUE])); if(!result) { - if(curlx_strlen(&cp[COOKIE_PATH])) - result = strstore(&co->path, curlx_str(&cp[COOKIE_PATH]), - curlx_strlen(&cp[COOKIE_PATH])); + size_t plen = 0; + if(curlx_strlen(&cp[COOKIE_PATH])) { + path = curlx_str(&cp[COOKIE_PATH]); + plen = curlx_strlen(&cp[COOKIE_PATH]); + } else if(path) { /* No path was given in the header line, set the default */ const char *endslash = strrchr(path, '/'); - if(endslash) { - size_t pathlen = (endslash - path + 1); /* include end slash */ - co->path = Curl_memdup0(path, pathlen); - if(!co->path) - result = CURLE_OUT_OF_MEMORY; - } + if(endslash) + plen = (endslash - path + 1); /* include end slash */ + else + plen = strlen(path); } - if(!result && co->path) { - co->spath = sanitize_cookie_path(co->path); - if(!co->spath) + if(path) { + co->path = sanitize_cookie_path(path, plen); + if(!co->path) result = CURLE_OUT_OF_MEMORY; } } @@ -734,23 +732,17 @@ static CURLcode parse_netscape(struct Cookie *co, /* The file format allows the path field to remain not filled in */ if(strncmp("TRUE", ptr, len) && strncmp("FALSE", ptr, len)) { /* only if the path does not look like a boolean option! */ - co->path = Curl_memdup0(ptr, len); + co->path = sanitize_cookie_path(ptr, len); if(!co->path) return CURLE_OUT_OF_MEMORY; - else { - co->spath = sanitize_cookie_path(co->path); - if(!co->spath) - return CURLE_OUT_OF_MEMORY; - } break; } - /* this does not look like a path, make one up! */ - co->path = curlx_strdup("/"); - if(!co->path) - return CURLE_OUT_OF_MEMORY; - co->spath = curlx_strdup("/"); - if(!co->spath) - return CURLE_OUT_OF_MEMORY; + else { + /* this does not look like a path, make one up! */ + co->path = curlx_strdup("/"); + if(!co->path) + return CURLE_OUT_OF_MEMORY; + } fields++; /* add a field and fall down to secure */ FALLTHROUGH(); case 3: @@ -875,7 +867,7 @@ static bool replace_existing(struct Curl_easy *data, matching_domains = TRUE; if(matching_domains && /* the domains were identical */ - clist->spath && co->spath && /* both have paths */ + clist->path && co->path && /* both have paths */ clist->secure && !co->secure && !secure) { size_t cllen; const char *sep = NULL; @@ -887,15 +879,15 @@ static bool replace_existing(struct Curl_easy *data, * "/loginhelper" is ok. */ - DEBUGASSERT(clist->spath[0]); - if(clist->spath[0]) - sep = strchr(clist->spath + 1, '/'); + DEBUGASSERT(clist->path[0]); + if(clist->path[0]) + sep = strchr(clist->path + 1, '/'); if(sep) - cllen = sep - clist->spath; + cllen = sep - clist->path; else - cllen = strlen(clist->spath); + cllen = strlen(clist->path); - if(curl_strnequal(clist->spath, co->spath, cllen)) { + if(curl_strnequal(clist->path, co->path, cllen)) { infof(data, "cookie '%s' for domain '%s' dropped, would " "overlay an existing cookie", co->name, co->domain); return FALSE; @@ -918,10 +910,10 @@ static bool replace_existing(struct Curl_easy *data, if(replace_old) { /* the domains were identical */ - if(clist->spath && co->spath && - !curl_strequal(clist->spath, co->spath)) + if(clist->path && co->path && + !curl_strequal(clist->path, co->path)) replace_old = FALSE; - else if(!clist->spath != !co->spath) + else if(!clist->path != !co->path) replace_old = FALSE; } @@ -1007,7 +999,7 @@ Curl_cookie_add(struct Curl_easy *data, * The __Host- prefix requires the cookie to be secure, have a "/" path * and not have a domain set. */ - if(co->secure && co->path && strcmp(co->path, "/") == 0 && !co->tailmatch) + if(co->secure && co->path && !strcmp(co->path, "/") && !co->tailmatch) ; else goto fail; @@ -1324,7 +1316,7 @@ CURLcode Curl_cookie_getlist(struct Curl_easy *data, * now check the left part of the path with the cookies path * requirement */ - if(!co->spath || pathmatch(co->spath, path)) { + if(!co->path || pathmatch(co->path, path)) { /* * This is a match and we add it to the return-linked-list diff --git a/lib/cookie.h b/lib/cookie.h index c1fb23ee4c23..03877e509f1d 100644 --- a/lib/cookie.h +++ b/lib/cookie.h @@ -34,8 +34,7 @@ struct Cookie { struct Curl_llist_node getnode; /* for getlist */ char *name; /* = value */ char *value; /* name = */ - char *path; /* path = which is in Set-Cookie: */ - char *spath; /* sanitized cookie path */ + char *path; /* canonical path */ char *domain; /* domain = */ curl_off_t expires; /* expires = */ unsigned int creationtime; /* time when the cookie was written */ diff --git a/tests/data/test1105 b/tests/data/test1105 index ea42efb6a9c0..e0766817295e 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -61,8 +61,8 @@ userid=myname&password=mypassword # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -127.0.0.1 FALSE "/silly/" FALSE 0 mismatch this -127.0.0.1 FALSE /we/want/ FALSE 0 foobar name +127.0.0.1 FALSE /silly FALSE 0 mismatch this +127.0.0.1 FALSE /we/want FALSE 0 foobar name diff --git a/tests/data/test1561 b/tests/data/test1561 index df9477dd47bd..84b291b12e26 100644 --- a/tests/data/test1561 +++ b/tests/data/test1561 @@ -98,7 +98,7 @@ Accept: */* www.example.com FALSE / TRUE 0 __Host-SID 12346 .example.com TRUE / TRUE 0 supersupersuper secret .example.com TRUE / TRUE 0 __SecURE-SID 12346 -.example.com TRUE /%TESTNUMBER/login/ TRUE 0 supersuper secret +.example.com TRUE /%TESTNUMBER/login TRUE 0 supersuper secret .example.com TRUE /1561 TRUE 0 super secret diff --git a/tests/data/test1903 b/tests/data/test1903 index 228b4d6ae46f..9b90151c0962 100644 --- a/tests/data/test1903 +++ b/tests/data/test1903 @@ -55,8 +55,8 @@ cookies # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -%HOSTIP FALSE /we/want/ FALSE 0 foobar name -%HOSTIP FALSE /we/want/ FALSE 0 secondcookie present +%HOSTIP FALSE /we/want FALSE 0 foobar name +%HOSTIP FALSE /we/want FALSE 0 secondcookie present diff --git a/tests/data/test1905 b/tests/data/test1905 index 690e8553ec0f..e09f8dc60eaf 100644 --- a/tests/data/test1905 +++ b/tests/data/test1905 @@ -53,8 +53,8 @@ Accept: */* # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -%HOSTIP FALSE /we/want/ FALSE 0 secondcookie present -%HOSTIP FALSE /we/want/ FALSE 0 foobar name +%HOSTIP FALSE /we/want FALSE 0 secondcookie present +%HOSTIP FALSE /we/want FALSE 0 foobar name diff --git a/tests/data/test31 b/tests/data/test31 index 8d99df6da8af..8353b709fc09 100644 --- a/tests/data/test31 +++ b/tests/data/test31 @@ -111,22 +111,22 @@ Accept: */* # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -test31.curl FALSE /we/want/ FALSE 0 %hex[%c3%82%c2%b3%c3%83%5c%78%39%32%c3%83%5c%78%39%61%c3%83%5c%78%38%64%c3%83%5c%78%39%37]hex% %96%A6g%9Ay%B0%A5g%A7tm%7C%95%9A -test31.curl FALSE /we/want/ FALSE 0 prespace yes before -test31.curl FALSE /we/want/ FALSE 0 withspaces2 before equals -test31.curl FALSE /we/want/ FALSE 0 withspaces yes within and around -.test31.curl TRUE /we/want/ FALSE 0 blexp yesyes -#HttpOnly_test31.curl FALSE /silly/ FALSE 0 magic yessir -test31.curl FALSE /we/want/ FALSE %days[400] nodomain value +test31.curl FALSE /we/want FALSE 0 %hex[%c3%82%c2%b3%c3%83%5c%78%39%32%c3%83%5c%78%39%61%c3%83%5c%78%38%64%c3%83%5c%78%39%37]hex% %96%A6g%9Ay%B0%A5g%A7tm%7C%95%9A +test31.curl FALSE /we/want FALSE 0 prespace yes before +test31.curl FALSE /we/want FALSE 0 withspaces2 before equals +test31.curl FALSE /we/want FALSE 0 withspaces yes within and around +.test31.curl TRUE /we/want FALSE 0 blexp yesyes +#HttpOnly_test31.curl FALSE /silly FALSE 0 magic yessir +test31.curl FALSE /we/want FALSE %days[400] nodomain value .test31.curl TRUE / FALSE 0 partmatch present -#HttpOnly_.test31.curl TRUE /p4/ FALSE 0 httponly myvalue1 -#HttpOnly_.test31.curl TRUE /p4/ FALSE 0 httpo4 value4 -#HttpOnly_.test31.curl TRUE /p3/ FALSE 0 httpo3 value3 -#HttpOnly_.test31.curl TRUE /p2/ FALSE 0 httpo2 value2 -#HttpOnly_.test31.curl TRUE /p1/ FALSE 0 httpo1 value1 +#HttpOnly_.test31.curl TRUE /p4 FALSE 0 httponly myvalue1 +#HttpOnly_.test31.curl TRUE /p4 FALSE 0 httpo4 value4 +#HttpOnly_.test31.curl TRUE /p3 FALSE 0 httpo3 value3 +#HttpOnly_.test31.curl TRUE /p2 FALSE 0 httpo2 value2 +#HttpOnly_.test31.curl TRUE /p1 FALSE 0 httpo1 value1 .test31.curl TRUE /overwrite FALSE 0 overwrite this2 -.test31.curl TRUE /silly/ FALSE 0 ISMATCH this -.test31.curl TRUE /silly/ FALSE 0 ismatch this +.test31.curl TRUE /silly FALSE 0 ISMATCH this +.test31.curl TRUE /silly FALSE 0 ismatch this test31.curl FALSE / FALSE 0 blankdomain sure diff --git a/tests/data/test420 b/tests/data/test420 index c1d6173f4fea..7b8bd08fde00 100644 --- a/tests/data/test420 +++ b/tests/data/test420 @@ -44,9 +44,9 @@ http://%HOSTIP:%HTTPPORT/func_test/del_cookie -b %LOGDIR/cookie%TESTNUMBER -c %L #HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie5 990 #HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie4 950 #HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie3 900 -#HttpOnly_%HOSTIP FALSE /func_test/ FALSE 21709598616 mycookie2 5900 +#HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie2 5900 #HttpOnly_%HOSTIP FALSE / FALSE 21709598616 mycookie1 4900 -#HttpOnly_%HOSTIP FALSE /func_test/ FALSE 0 mycookie 1200 +#HttpOnly_%HOSTIP FALSE /func_test FALSE 0 mycookie 1200 cookies @@ -61,7 +61,7 @@ GET /func_test/del_cookie HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -Cookie: mycookie2=5900; mycookie=1200; mycookie3=900; mycookie4=950; mycookie5=990; mycookie6=991; mycookie1=4900 +Cookie: mycookie2=5900; mycookie3=900; mycookie4=950; mycookie5=990; mycookie6=991; mycookie=1200; mycookie1=4900 @@ -69,7 +69,7 @@ Cookie: mycookie2=5900; mycookie=1200; mycookie3=900; mycookie4=950; mycookie5=9 # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -#HttpOnly_127.0.0.1 FALSE /func_test/ FALSE 21709598616 mycookie2 5900 +#HttpOnly_127.0.0.1 FALSE /func_test FALSE 21709598616 mycookie2 5900 diff --git a/tests/data/test444 b/tests/data/test444 index 4c092bef1b94..0b050e114676 100644 --- a/tests/data/test444 +++ b/tests/data/test444 @@ -138,56 +138,56 @@ Accept: */* # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -attack.invalid FALSE /a/b/ FALSE 0 cookie-50 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-49 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-48 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-47 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-46 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-45 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-44 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-43 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-42 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-41 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-40 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-39 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-38 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-37 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-36 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-35 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-34 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-33 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-32 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-31 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-30 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-29 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-28 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-27 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-26 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-25 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-24 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-23 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-22 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-21 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-20 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-19 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-18 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-17 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-16 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-15 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-14 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-13 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-12 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-11 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-10 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-9 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-8 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-7 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-6 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-5 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-4 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-3 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-2 yes -attack.invalid FALSE /a/b/ FALSE 0 cookie-1 yes +attack.invalid FALSE /a/b FALSE 0 cookie-50 yes +attack.invalid FALSE /a/b FALSE 0 cookie-49 yes +attack.invalid FALSE /a/b FALSE 0 cookie-48 yes +attack.invalid FALSE /a/b FALSE 0 cookie-47 yes +attack.invalid FALSE /a/b FALSE 0 cookie-46 yes +attack.invalid FALSE /a/b FALSE 0 cookie-45 yes +attack.invalid FALSE /a/b FALSE 0 cookie-44 yes +attack.invalid FALSE /a/b FALSE 0 cookie-43 yes +attack.invalid FALSE /a/b FALSE 0 cookie-42 yes +attack.invalid FALSE /a/b FALSE 0 cookie-41 yes +attack.invalid FALSE /a/b FALSE 0 cookie-40 yes +attack.invalid FALSE /a/b FALSE 0 cookie-39 yes +attack.invalid FALSE /a/b FALSE 0 cookie-38 yes +attack.invalid FALSE /a/b FALSE 0 cookie-37 yes +attack.invalid FALSE /a/b FALSE 0 cookie-36 yes +attack.invalid FALSE /a/b FALSE 0 cookie-35 yes +attack.invalid FALSE /a/b FALSE 0 cookie-34 yes +attack.invalid FALSE /a/b FALSE 0 cookie-33 yes +attack.invalid FALSE /a/b FALSE 0 cookie-32 yes +attack.invalid FALSE /a/b FALSE 0 cookie-31 yes +attack.invalid FALSE /a/b FALSE 0 cookie-30 yes +attack.invalid FALSE /a/b FALSE 0 cookie-29 yes +attack.invalid FALSE /a/b FALSE 0 cookie-28 yes +attack.invalid FALSE /a/b FALSE 0 cookie-27 yes +attack.invalid FALSE /a/b FALSE 0 cookie-26 yes +attack.invalid FALSE /a/b FALSE 0 cookie-25 yes +attack.invalid FALSE /a/b FALSE 0 cookie-24 yes +attack.invalid FALSE /a/b FALSE 0 cookie-23 yes +attack.invalid FALSE /a/b FALSE 0 cookie-22 yes +attack.invalid FALSE /a/b FALSE 0 cookie-21 yes +attack.invalid FALSE /a/b FALSE 0 cookie-20 yes +attack.invalid FALSE /a/b FALSE 0 cookie-19 yes +attack.invalid FALSE /a/b FALSE 0 cookie-18 yes +attack.invalid FALSE /a/b FALSE 0 cookie-17 yes +attack.invalid FALSE /a/b FALSE 0 cookie-16 yes +attack.invalid FALSE /a/b FALSE 0 cookie-15 yes +attack.invalid FALSE /a/b FALSE 0 cookie-14 yes +attack.invalid FALSE /a/b FALSE 0 cookie-13 yes +attack.invalid FALSE /a/b FALSE 0 cookie-12 yes +attack.invalid FALSE /a/b FALSE 0 cookie-11 yes +attack.invalid FALSE /a/b FALSE 0 cookie-10 yes +attack.invalid FALSE /a/b FALSE 0 cookie-9 yes +attack.invalid FALSE /a/b FALSE 0 cookie-8 yes +attack.invalid FALSE /a/b FALSE 0 cookie-7 yes +attack.invalid FALSE /a/b FALSE 0 cookie-6 yes +attack.invalid FALSE /a/b FALSE 0 cookie-5 yes +attack.invalid FALSE /a/b FALSE 0 cookie-4 yes +attack.invalid FALSE /a/b FALSE 0 cookie-3 yes +attack.invalid FALSE /a/b FALSE 0 cookie-2 yes +attack.invalid FALSE /a/b FALSE 0 cookie-1 yes diff --git a/tests/data/test46 b/tests/data/test46 index 715616e23c23..9d872bab6d87 100644 --- a/tests/data/test46 +++ b/tests/data/test46 @@ -87,7 +87,7 @@ Cookie: empty=; mooo2=indeed2; mooo=indeed # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -domain..tld FALSE /want/ FALSE 0 simplyhuge %repeat[3998 x z]% +domain..tld FALSE /want FALSE 0 simplyhuge %repeat[3998 x z]% domain..tld FALSE / FALSE 0 justaname%TAB domain..tld FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ GKNBDIFAAOFDPDAIEAKDIBKE domain..tld FALSE / FALSE 0 ckySession temporary diff --git a/tests/data/test61 b/tests/data/test61 index cd38c000051b..050d0b393cb7 100644 --- a/tests/data/test61 +++ b/tests/data/test61 @@ -71,8 +71,8 @@ Accept: */* # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -.host.foo.com TRUE /we/want/ FALSE %days[400] test2 yes -#HttpOnly_.foo.com TRUE /we/want/ FALSE %days[400] test yes +.host.foo.com TRUE /we/want FALSE %days[400] test2 yes +#HttpOnly_.foo.com TRUE /we/want FALSE %days[400] test yes From a78a07d3a9dc808a51f464d0dd297939e544e2a4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Dec 2025 23:44:31 +0100 Subject: [PATCH 690/885] cookie: cleanups and improvements - Stricter cookie validation with earlier rejection of empty/invalid cookie names - secure and httponly attributes no longer accept = with empty values (only bare keywords) - Validation checks (length, TAB, prefixes) moved into the first name/value pair block for better code organization - Deferred time(NULL) calls for better performance when expires/max-age aren't used - Simplified loop control flow by removing done flag - The cookie size restriction now only applies to name + value, not other parts of the header line. - Fixed a gcc 4.8.1 quirk Closes #19868 --- lib/cookie.c | 160 +++++++++++++++++++------------------------- tests/data/test1160 | 2 +- tests/data/test31 | 30 +++++---- 3 files changed, 87 insertions(+), 105 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index 7efce5611f2a..716a487750e2 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -441,85 +441,79 @@ parse_cookie_header(struct Curl_easy *data, origin */ { /* This line was read off an HTTP-header */ - time_t now; + time_t now = 0; size_t linelength = strlen(ptr); - CURLcode result; - struct Curl_str cookie[COOKIE_PIECES] = { 0 }; + CURLcode result = CURLE_OK; + struct Curl_str cookie[COOKIE_PIECES]; *okay = FALSE; if(linelength > MAX_COOKIE_LINE) /* discard overly long lines at once */ return CURLE_OK; - now = time(NULL); + /* memset instead of initializer because gcc 4.8.1 is silly */ + memset(cookie, 0, sizeof(cookie)); do { struct Curl_str name; struct Curl_str val; /* we have a = pair or a stand-alone word here */ if(!curlx_str_cspn(&ptr, &name, ";\t\r\n=")) { - bool done = FALSE; bool sep = FALSE; curlx_str_trimblanks(&name); if(!curlx_str_single(&ptr, '=')) { sep = TRUE; /* a '=' was used */ - if(!curlx_str_cspn(&ptr, &val, ";\r\n")) { + if(!curlx_str_cspn(&ptr, &val, ";\r\n")) curlx_str_trimblanks(&val); - - /* Reject cookies with a TAB inside the value */ - if(memchr(curlx_str(&val), '\t', curlx_strlen(&val))) { - infof(data, "cookie contains TAB, dropping"); - return CURLE_OK; - } - } } - else { + else curlx_str_init(&val); - } - - /* - * Check for too long individual name or contents, or too long - * combination of name + contents. Chrome and Firefox support 4095 or - * 4096 bytes combo - */ - if(curlx_strlen(&name) >= (MAX_NAME - 1) || - curlx_strlen(&val) >= (MAX_NAME - 1) || - ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) { - infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", - curlx_strlen(&name), curlx_strlen(&val)); - return CURLE_OK; - } - - /* - * Check if we have a reserved prefix set before anything else, as we - * otherwise have to test for the prefix in both the cookie name and - * "the rest". Prefixes must start with '__' and end with a '-', so - * only test for names where that can possibly be true. - */ - if(!strncmp("__Secure-", curlx_str(&name), 9)) - co->prefix_secure = TRUE; - else if(!strncmp("__Host-", curlx_str(&name), 7)) - co->prefix_host = TRUE; if(!curlx_strlen(&cookie[COOKIE_NAME])) { /* The first name/value pair is the actual cookie name */ if(!sep || /* Bad name/value pair. */ invalid_octets(curlx_str(&name), curlx_strlen(&name)) || - invalid_octets(curlx_str(&val), curlx_strlen(&val))) { + invalid_octets(curlx_str(&val), curlx_strlen(&val)) || + !curlx_strlen(&name)) { infof(data, "invalid octets in name/value, cookie dropped"); return CURLE_OK; } + + /* + * Check for too long individual name or contents, or too long + * combination of name + contents. Chrome and Firefox support 4095 or + * 4096 bytes combo + */ + if(curlx_strlen(&name) >= (MAX_NAME - 1) || + curlx_strlen(&val) >= (MAX_NAME - 1) || + ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) { + infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", + curlx_strlen(&name), curlx_strlen(&val)); + return CURLE_OK; + } + + /* Reject cookies with a TAB inside the value */ + if(curlx_strlen(&val) && + memchr(curlx_str(&val), '\t', curlx_strlen(&val))) { + infof(data, "cookie contains TAB, dropping"); + return CURLE_OK; + } + + /* Check if we have a reserved prefix set. */ + if(!strncmp("__Secure-", curlx_str(&name), 9)) + co->prefix_secure = TRUE; + else if(!strncmp("__Host-", curlx_str(&name), 7)) + co->prefix_host = TRUE; + cookie[COOKIE_NAME] = name; cookie[COOKIE_VALUE] = val; - done = TRUE; } - else if(!curlx_strlen(&val)) { + else if(!sep) { /* - * this was a "=" with no content, and we must allow - * 'secure' and 'httponly' specified this weirdly + * this is a "" with no content */ - done = TRUE; + /* * secure cookies are only allowed to be set when the connection is * using a secure protocol, or when the cookie is being set by @@ -529,18 +523,13 @@ parse_cookie_header(struct Curl_easy *data, if(secure || !ci->running) co->secure = TRUE; else { - infof(data, "skipped cookie %s because not 'secure'", co->name); + infof(data, "skipped cookie because not 'secure'"); return CURLE_OK; } } else if(curlx_str_casecompare(&name, "httponly")) co->httponly = TRUE; - else if(sep) - /* there was a '=' so we are not done parsing this field */ - done = FALSE; } - if(done) - ; else if(curlx_str_casecompare(&name, "path")) { cookie[COOKIE_PATH] = val; } @@ -588,9 +577,6 @@ parse_cookie_header(struct Curl_easy *data, return CURLE_OK; } } - else if(curlx_str_casecompare(&name, "version")) { - /* just ignore */ - } else if(curlx_str_casecompare(&name, "max-age") && curlx_strlen(&val)) { /* * Defined in RFC2109: @@ -606,6 +592,8 @@ parse_cookie_header(struct Curl_easy *data, if(*maxage == '\"') maxage++; rc = curlx_str_number(&maxage, &co->expires, CURL_OFF_T_MAX); + if(!now) + now = time(NULL); switch(rc) { case STRE_OVERFLOW: /* overflow, used max value */ @@ -627,46 +615,38 @@ parse_cookie_header(struct Curl_easy *data, } cap_expires(now, co); } - else if(curlx_str_casecompare(&name, "expires") && curlx_strlen(&val)) { - if(!co->expires && (curlx_strlen(&val) < MAX_DATE_LENGTH)) { - /* - * Let max-age have priority. - * - * If the date cannot get parsed for whatever reason, the cookie - * will be treated as a session cookie - */ - char dbuf[MAX_DATE_LENGTH + 1]; - time_t date = 0; - memcpy(dbuf, curlx_str(&val), curlx_strlen(&val)); - dbuf[curlx_strlen(&val)] = 0; - if(!Curl_getdate_capped(dbuf, &date)) { - if(!date) - date++; - co->expires = (curl_off_t)date; - } - else - co->expires = 0; - cap_expires(now, co); + else if(curlx_str_casecompare(&name, "expires") && curlx_strlen(&val) && + !co->expires && (curlx_strlen(&val) < MAX_DATE_LENGTH)) { + /* + * Let max-age have priority. + * + * If the date cannot get parsed for whatever reason, the cookie + * will be treated as a session cookie + */ + char dbuf[MAX_DATE_LENGTH + 1]; + time_t date = 0; + memcpy(dbuf, curlx_str(&val), curlx_strlen(&val)); + dbuf[curlx_strlen(&val)] = 0; + if(!Curl_getdate_capped(dbuf, &date)) { + if(!date) + date++; + co->expires = (curl_off_t)date; } + else + co->expires = 0; + if(!now) + now = time(NULL); + cap_expires(now, co); } - - /* - * Else, this is the second (or more) name we do not know about! - */ } + } while(!curlx_str_single(&ptr, ';')); - if(curlx_str_single(&ptr, ';')) - break; - } while(1); - - if(!curlx_strlen(&cookie[COOKIE_NAME])) - /* If we did not get a cookie name, or a bad one, bail out. */ - return CURLE_OK; - - /* the header was fine, now store the data */ - result = storecookie(co, &cookie[0], path, domain); - if(!result) - *okay = TRUE; + if(curlx_strlen(&cookie[COOKIE_NAME])) { + /* the header was fine, now store the data */ + result = storecookie(co, &cookie[0], path, domain); + if(!result) + *okay = TRUE; + } return result; } diff --git a/tests/data/test1160 b/tests/data/test1160 index 9eca524c658f..d26ad4133f21 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -14,7 +14,7 @@ cookies HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 -Set-Cookie: ____________%hex[%ff]hex%= ;%repeat[117 x %20]%%hex[%ff]hex%%repeat[2602 x %20]%%repeat[434 x z]%%hex[%86%85%85%80]hex%%repeat[49 x z]%%hex[%fa]hex%%repeat[540 x z]%%hex[%f3%a0%81%96]hex%zzzzzzzzzzzz~%repeat[82 x z]%%hex[%b6]hex%%repeat[364 x z]% +Set-Cookie: %repeat[4000 x n]%=%repeat[4096 x v]% diff --git a/tests/data/test31 b/tests/data/test31 index 8353b709fc09..e13fed55c625 100644 --- a/tests/data/test31 +++ b/tests/data/test31 @@ -18,6 +18,8 @@ Server: test-server/fake%CR Content-Length: 4%CR Content-Type: text/html%CR Funny-head: yesyes%CR +Set-Cookie: +Set-Cookie: ; Set-Cookie: blankdomain=sure; domain=; path=/ Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure%CR Set-Cookie:ismatch=this ; domain=test31.curl; path=/silly/%CR @@ -25,27 +27,27 @@ Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/%CR Set-Cookie: overwrite=this ; domain=test31.curl; path=/overwrite/%CR Set-Cookie: overwrite=this2 ; domain=test31.curl; path=/overwrite%CR Set-Cookie: sec1value=secure1 ; domain=test31.curl; path=/secure1/ ; secure%CR -Set-Cookie: sec2value=secure2 ; domain=test31.curl; path=/secure2/ ; secure=%CR -Set-Cookie: sec3value=secure3 ; domain=test31.curl; path=/secure3/ ; secure=%CR -Set-Cookie: sec4value=secure4 ; secure=; domain=test31.curl; path=/secure4/ ; %CR +Set-Cookie: sec2value=secure2 ; domain=test31.curl; path=/secure2/ ; secure%CR +Set-Cookie: sec3value=secure3 ; domain=test31.curl; path=/secure3/ ; secure%CR +Set-Cookie: sec4value=secure4 ; secure; domain=test31.curl; path=/secure4/ ; %CR Set-Cookie: sec5value=secure5 ; secure; domain=test31.curl; path=/secure5/ ; %CR Set-Cookie: sec6value=secure6 ; secure ; domain=test31.curl; path=/secure6/ ; %CR Set-Cookie: sec7value=secure7 ; secure ; domain=test31.curl; path=/secure7/ ; %CR -Set-Cookie: sec8value=secure8 ; secure= ; domain=test31.curl; path=/secure8/ ; %CR -Set-Cookie: secure=very1 ; secure=; domain=test31.curl; path=/secure9/; %CR +Set-Cookie: sec8value=secure8 ; secure ; domain=test31.curl; path=/secure8/ ; %CR +Set-Cookie: secure=very1 ; secure; domain=test31.curl; path=/secure9/; %CR Set-Cookie: httpo1=value1 ; domain=test31.curl; path=/p1/; httponly%CR -Set-Cookie: httpo2=value2 ; domain=test31.curl; path=/p2/; httponly=%CR +Set-Cookie: httpo2=value2 ; domain=test31.curl; path=/p2/; httponly%CR Set-Cookie: httpo3=value3 ; httponly; domain=test31.curl; path=/p3/;%CR -Set-Cookie: httpo4=value4 ; httponly=; domain=test31.curl; path=/p4/; %CR +Set-Cookie: httpo4=value4 ; httponly; domain=test31.curl; path=/p4/; %CR Set-Cookie: httponly=myvalue1 ; domain=test31.curl; path=/p4/; httponly%CR Set-Cookie: httpandsec=myvalue2 ; domain=test31.curl; path=/p4/; httponly; secure%CR -Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure%CR -Set-Cookie: httpandsec3=myvalue4 ; domain=test31.curl; path=/p4/; httponly; secure=%CR -Set-Cookie: httpandsec4=myvalue5 ; domain=test31.curl; path=/p4/; httponly=; secure=%CR -Set-Cookie: httpandsec5=myvalue6 ; domain=test31.curl; path=/p4/; secure; httponly=%CR -Set-Cookie: httpandsec6=myvalue7 ; domain=test31.curl; path=/p4/; secure=; httponly=%CR +Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly; secure%CR +Set-Cookie: httpandsec3=myvalue4 ; domain=test31.curl; path=/p4/; httponly; secure%CR +Set-Cookie: httpandsec4=myvalue5 ; domain=test31.curl; path=/p4/; httponly; secure%CR +Set-Cookie: httpandsec5=myvalue6 ; domain=test31.curl; path=/p4/; secure; httponly%CR +Set-Cookie: httpandsec6=myvalue7 ; domain=test31.curl; path=/p4/; secure; httponly%CR Set-Cookie: httpandsec7=myvalue8 ; domain=test31.curl; path=/p4/; secure; httponly%CR -Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly%CR +Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure; httponly%CR Set-Cookie: partmatch=present; domain=test31.curl ; path=/;%CR Set-Cookie:eat=this; domain=moo.foo.moo;%CR Set-Cookie: eat=this-too; domain=.foo.moo;%CR @@ -67,7 +69,7 @@ Set-Cookie: partialip=nono; domain=.0.0.1;%CR Set-Cookie: withspaces= yes within and around ;%CR Set-Cookie: withspaces2 =before equals;%CR Set-Cookie: prespace= yes before;%CR -Set-Cookie: securewithspace=after ; secure =%CR +Set-Cookie: securewithspace=after ; secure %CR Set-Cookie: %hex[%c3%82%c2%b3%c3%83%5c%78%39%32%c3%83%5c%78%39%61%c3%83%5c%78%38%64%c3%83%5c%78%39%37]hex%=%96%A6g%9Ay%B0%A5g%A7tm%7C%95%9A %CR boo From 121c54016869622729131fe36d111f52cb1fac89 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Dec 2025 20:03:38 +0100 Subject: [PATCH 691/885] sspi: fix memory leaks on error paths in `Curl_create_sspi_identity()` Detected by Windows torture test 1072 (with `-shallow=20/13`), test 579 (with `-shallow=18/14/13`), and test 1286 (with `-shallow=15`). ``` ** MEMORY FAILURE Leak detected: memory still allocated: 20 bytes At 1a1e8136328, there is 18 bytes. allocated by D:/a/curl/curl/lib/curl_sspi.c:133 At 1a1e8139368, there is 2 bytes. allocated by D:/a/curl/curl/lib/curl_sspi.c:143 1072: torture FAILED: function number 207 in test. invoke with "-t207" to repeat this single case. Warning: http2 server unexpectedly alive ``` Ref: https://github.com/curl/curl/actions/runs/20008523913/job/57374427439?pr=19865 Also simplify the code a little. Cherry-picked from #19865 Closes #19866 --- lib/curl_sspi.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index 712fab2e9e82..35a9bc33e6cc 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -135,33 +135,34 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, curlx_free(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } - identity->User = dup_user.tbyte_ptr; - identity->UserLength = curlx_uztoul(_tcslen(dup_user.tchar_ptr)); - dup_user.tchar_ptr = NULL; /* Setup the identity's domain and length */ dup_domain.tchar_ptr = curlx_malloc(sizeof(TCHAR) * (domlen + 1)); if(!dup_domain.tchar_ptr) { + curlx_free(dup_user.tchar_ptr); curlx_free(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } if(_tcsncpy_s(dup_domain.tchar_ptr, domlen + 1, domain.tchar_ptr, domlen)) { + curlx_free(dup_user.tchar_ptr); curlx_free(dup_domain.tchar_ptr); curlx_free(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } - identity->Domain = dup_domain.tbyte_ptr; - identity->DomainLength = curlx_uztoul(domlen); - dup_domain.tchar_ptr = NULL; curlx_free(useranddomain.tchar_ptr); /* Setup the identity's password and length */ passwd.tchar_ptr = curlx_convert_UTF8_to_tchar(passwdp); - if(!passwd.tchar_ptr) + if(!passwd.tchar_ptr) { + curlx_free(dup_user.tchar_ptr); + curlx_free(dup_domain.tchar_ptr); return CURLE_OUT_OF_MEMORY; + } dup_passwd.tchar_ptr = curlx_tcsdup(passwd.tchar_ptr); if(!dup_passwd.tchar_ptr) { + curlx_free(dup_user.tchar_ptr); + curlx_free(dup_domain.tchar_ptr); curlx_free(passwd.tchar_ptr); return CURLE_OUT_OF_MEMORY; } @@ -171,6 +172,13 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, curlx_free(passwd.tchar_ptr); + identity->User = dup_user.tbyte_ptr; + identity->UserLength = curlx_uztoul(_tcslen(dup_user.tchar_ptr)); + dup_user.tchar_ptr = NULL; + identity->Domain = dup_domain.tbyte_ptr; + identity->DomainLength = curlx_uztoul(domlen); + dup_domain.tchar_ptr = NULL; + /* Setup the identity's flags */ identity->Flags = (unsigned long) #ifdef UNICODE From 2535c4298fede065c80b9255328c18b68d739522 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 10:20:04 +0100 Subject: [PATCH 692/885] hostcheck: fail wildcard match if host starts with a dot A hostname cannot start with a dot when DNS is used, but there are other ways. Amend unit test 1397 Closes #19869 --- lib/vtls/hostcheck.c | 4 ++-- tests/unit/unit1397.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vtls/hostcheck.c b/lib/vtls/hostcheck.c index fbd460bc15b1..e56860a35ba9 100644 --- a/lib/vtls/hostcheck.c +++ b/lib/vtls/hostcheck.c @@ -92,8 +92,8 @@ static bool hostmatch(const char *hostname, if(strncmp(pattern, "*.", 2)) return pmatch(hostname, hostlen, pattern, patternlen); - /* detect IP address as hostname and fail the match if so */ - else if(Curl_host_is_ipnum(hostname)) + /* detect host as IP address or starting with a dot and fail if so */ + else if(Curl_host_is_ipnum(hostname) || (hostname[0] == '.')) return FALSE; /* We require at least 2 dots in the pattern to avoid too wide wildcard diff --git a/tests/unit/unit1397.c b/tests/unit/unit1397.c index 6726c5053064..dc4f13583790 100644 --- a/tests/unit/unit1397.c +++ b/tests/unit/unit1397.c @@ -39,6 +39,8 @@ static CURLcode test_unit1397(const char *arg) }; static const struct testcase tests[] = { + {".hello.com", "*.hello.com", FALSE }, + {"a.hello.com", "*.hello.com", TRUE }, { "", "", FALSE }, { "a", "", FALSE }, { "", "b", FALSE }, From d360ddb1b2e5cc350307f7829ffccdcae062d319 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 7 Dec 2025 15:23:00 +0100 Subject: [PATCH 693/885] test1475: consistently use %CR in headers Gets the test working when using Privoxy as proxy. Closes #19870 --- tests/data/test1475 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/test1475 b/tests/data/test1475 index 1f11829d72e4..b35009d9a8f7 100644 --- a/tests/data/test1475 +++ b/tests/data/test1475 @@ -15,7 +15,7 @@ Resume HTTP/1.1 416 Invalid range%CR Connection: close%CR Content-Length: 0%CR -Content-Range: */100 +Content-Range: */100%CR %CR @@ -35,7 +35,7 @@ Content-Range: */100 HTTP/1.1 416 Invalid range%CR Connection: close%CR Content-Length: 0%CR -Content-Range: */100 +Content-Range: */100%CR %CR From 96ba7a79fc561ef8e7bedafacb70d9659224ee1f Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 5 Dec 2025 15:38:12 +0100 Subject: [PATCH 694/885] gnutls: add PROFILE_MEDIUM as default Raise the default GnuTLS priority settings by adding PROFILE_MEDIUM for more secure connection handling. Reported-by: Harry Sintonen Closes #19853 --- lib/vtls/gtls.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 667b09c119fa..c7f8f346739a 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -305,16 +305,17 @@ static gnutls_x509_crt_fmt_t gnutls_do_file_type(const char *type) return GNUTLS_X509_FMT_PEM; /* default to PEM */ } -#define GNUTLS_CIPHERS "NORMAL:-ARCFOUR-128:-CTYPE-ALL:+CTYPE-X509" +#define GNUTLS_CIPHERS "NORMAL:%PROFILE_MEDIUM:-ARCFOUR-128:"\ + "-CTYPE-ALL:+CTYPE-X509" /* If GnuTLS was compiled without support for SRP it will error out if SRP is requested in the priority string, so treat it specially */ #define GNUTLS_SRP "+SRP" #define QUIC_PRIORITY \ - "NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-128-GCM:+AES-256-GCM:" \ - "+CHACHA20-POLY1305:+AES-128-CCM:-GROUP-ALL:+GROUP-SECP256R1:" \ - "+GROUP-X25519:+GROUP-SECP384R1:+GROUP-SECP521R1:" \ + "NORMAL:%PROFILE_MEDIUM:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-128-GCM:" \ + "+AES-256-GCM:+CHACHA20-POLY1305:+AES-128-CCM:-GROUP-ALL:" \ + "+GROUP-SECP256R1:+GROUP-X25519:+GROUP-SECP384R1:+GROUP-SECP521R1:" \ "%DISABLE_TLS13_COMPAT_MODE" static CURLcode From 4a92afce703541732489b67d9600ab1d78d2a0f7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 11:43:12 +0100 Subject: [PATCH 695/885] DISTROS: fix a Mageia URL Since we check the provided URLs now, use the direct, working URL. --- docs/DISTROS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DISTROS.md b/docs/DISTROS.md index 451de7fc1a84..7f61e2aa3f5b 100644 --- a/docs/DISTROS.md +++ b/docs/DISTROS.md @@ -165,7 +165,7 @@ unless it is specific to Homebrew's way of packaging software. - curl: https://svnweb.mageia.org/packages/cauldron/curl/current/SPECS/curl.spec?view=markup - curl issues: https://bugs.mageia.org/buglist.cgi?bug_status=NEW&bug_status=UNCONFIRMED&bug_status=NEEDINFO&bug_status=UPSTREAM&bug_status=ASSIGNED&component=RPM%20Packages&f1=cf_rpmpkg&list_id=176576&o1=casesubstring&product=Mageia&query_format=advanced&v1=curl - curl patches: https://svnweb.mageia.org/packages/cauldron/curl/current/SOURCES/ -- curl patches in stable distro releases: https://svnweb.mageia.org/packages/updates//curl/current/SOURCES/ +- curl patches in stable distro releases: https://svnweb.mageia.org/packages/updates/9/curl/current/SOURCES/ - curl security: https://advisories.mageia.org/src_curl.html ## MSYS2 From 81e5e2434e03cf32c843650a9e08f193419e2f3d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Dec 2025 11:06:49 +0100 Subject: [PATCH 696/885] GHA/linux: blind try to make Renovate detect Fil-C releases 0.675 has been out for 2 weeks, Renovate did not detect it with `semver-partial`. Try with `semver-coerced`. Refs: https://docs.renovatebot.com/modules/versioning/semver-coerced/ https://docs.renovatebot.com/modules/versioning/semver-partial/ Follow-up to 16c6ea36cca6684aacbcb33578af61b28e3fee0d #19391 --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 390cab72923f..7eb54125ff87 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -57,7 +57,7 @@ env: OPENLDAP_VERSION: 2.6.10 # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com NGHTTP2_VERSION: 1.68.0 - # renovate: datasource=github-tags depName=pizlonator/fil-c versioning=semver-partial registryUrl=https://github.com + # renovate: datasource=github-tags depName=pizlonator/fil-c versioning=semver-coerced registryUrl=https://github.com FIL_C_VERSION: 0.674 jobs: From c56ee2ab784d2031e125ba6dc7bcdef3aec9b3d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:07:26 +0000 Subject: [PATCH 697/885] GHA/linux: update dependency pizlonator/fil-c to v0.675 Closes #19873 --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7eb54125ff87..27ad6b739331 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -58,7 +58,7 @@ env: # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com NGHTTP2_VERSION: 1.68.0 # renovate: datasource=github-tags depName=pizlonator/fil-c versioning=semver-coerced registryUrl=https://github.com - FIL_C_VERSION: 0.674 + FIL_C_VERSION: 0.675 jobs: linux: From a1c01b2015cb0082ec9ad2235953e46690410309 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 11:16:18 +0100 Subject: [PATCH 698/885] mdlinkcheck: ignore IP numbers, allow '@' in raw URLs --- scripts/mdlinkcheck | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index 734617949d2d..dfeeac0f60e6 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -120,6 +120,9 @@ sub storelink { elsif($link =~ /^https:\/\/github.com\/curl\/curl(\/|$)/) { #print "-- curl github repo: $link\n"; } + elsif($link =~ /^(https|http):\/\/[0-9.]+(\/|$)/) { + #print "-- IPv4 number: $link\n"; + } else { #print "ADD '$link'\n"; $url{$link} .= "$f:$line "; @@ -160,7 +163,7 @@ sub findlinks { # ignore trailing: dot, quote, asterisk, hash, comma, question mark, # colon, closing parenthesis, closing angle bracket, whitespace, pipe, # backtick, semicolon - elsif(/(https:\/\/[a-z0-9.\/:%_-]+[^."*\#,?:\)> \t|`;])/i) { + elsif(/(https:\/\/[a-z0-9.\/:%_+@-]+[^."*\#,?:\)> \t|`;])/i) { #print "RAW "; storelink($f, $line, $1); } From ab9beda1b3e5fc9c163111ff93ff17b73217a74c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 11:11:02 +0100 Subject: [PATCH 699/885] docs: switch more URLs to https:// Normalize using https:// almost everywhere instead of http:// Closes #19872 --- .github/scripts/codespell-ignore.words | 2 +- .github/scripts/typos.toml | 2 +- docs/FAQ | 16 ++--- docs/MANUAL.md | 64 +++++++++---------- docs/TheArtOfHttpScripting.md | 54 ++++++++-------- docs/URL-SYNTAX.md | 10 +-- docs/cmdline-opts/_ENVIRONMENT.md | 4 +- docs/cmdline-opts/_GLOBBING.md | 10 +-- docs/libcurl/libcurl-security.md | 22 +++---- docs/libcurl/libcurl-tutorial.md | 4 +- docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md | 2 +- docs/libcurl/opts/CURLOPT_NOPROXY.md | 2 +- docs/libcurl/opts/CURLOPT_PROXY.md | 2 +- .../opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md | 2 +- 14 files changed, 99 insertions(+), 97 deletions(-) diff --git a/.github/scripts/codespell-ignore.words b/.github/scripts/codespell-ignore.words index fa8a432b95aa..1a5e106400a6 100644 --- a/.github/scripts/codespell-ignore.words +++ b/.github/scripts/codespell-ignore.words @@ -7,7 +7,7 @@ bu clen CNA hel -htpt +htpts inout PASE passwor diff --git a/.github/scripts/typos.toml b/.github/scripts/typos.toml index ec6b9bb05015..2b12004f489d 100644 --- a/.github/scripts/typos.toml +++ b/.github/scripts/typos.toml @@ -6,7 +6,7 @@ extend-ignore-identifiers-re = [ "^(ba|fo|pn|PN|UE)$", "^(CNA|ser)$", - "^(ECT0|ECT1|HELO|htpt|PASE)$", + "^(ECT0|ECT1|HELO|htpts|PASE)$", "^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers "^0x[0-9a-fA-F]+FUL$", # unsigned long hex literals ending with 'F' "^(eyeballers|HELO_smtp|Januar|optin|passin|perfec|SMTP_HELO)$", diff --git a/docs/FAQ b/docs/FAQ index b8a39474590f..230b850bac80 100644 --- a/docs/FAQ +++ b/docs/FAQ @@ -533,7 +533,7 @@ FAQ that informs the client about this is only interpreted if you are using the -L/--location option. As in: - curl -L http://example.com + curl -L https://example.com Not all redirects are HTTP ones, see 4.14 @@ -719,13 +719,13 @@ FAQ Set a custom Host: header that identifies the server name you want to reach but use the target IP address in the URL: - curl --header "Host: www.example.com" http://127.0.0.1/ + curl --header "Host: www.example.com" https://somewhere.example/ You can also opt to add faked hostname entries to curl with the --resolve option. That has the added benefit that things like redirects will also work properly. The above operation would instead be done as: - curl --resolve www.example.com:80:127.0.0.1 http://www.example.com/ + curl --resolve www.example.com:80:127.0.0.1 https://www.example.com/ 3.20 How to SFTP from my user's home directory? @@ -753,8 +753,8 @@ FAQ be disabled or not supported. Note that this error will also occur if you pass a wrongly spelled protocol - part as in "htpt://example.com" or as in the less evident case if you prefix - the protocol part with a space as in " http://example.com/". + part as in "htpts://example.com" or as in the less evident case if you + prefix the protocol part with a space as in " https://example.com/". 3.22 curl -X gives me HTTP problems @@ -762,7 +762,7 @@ FAQ By default you use curl without explicitly saying which request method to use when the URL identifies an HTTP transfer. If you just pass in a URL like - "curl http://example.com" it will use GET. If you use -d or -F curl will use + "curl https://example.com" it will use GET. If you use -d or -F curl will use POST, -I will cause a HEAD and -T will make it a PUT. If for whatever reason you are not happy with these default choices that curl @@ -796,7 +796,7 @@ FAQ An example that would invoke a remote CGI that uses &-symbols could be: - curl 'http://www.example.com/cgi-bin/query?text=yes&q=curl' + curl 'https://www.example.com/cgi-bin/query?text=yes&q=curl' In Windows, the standard DOS shell treats the percent sign specially and you need to use TWO percent signs for each single one you want to use in the @@ -865,7 +865,7 @@ FAQ If you get this return code and an HTML output similar to this:

Moved Permanently

The document has moved here. + HREF="https://same_url_now_with_a_trailing_slash.example/">here. it might be because you requested a directory URL but without the trailing slash. Try the same operation again _with_ the trailing URL, or use the diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 9ff5c097c7f7..1acb4d2244e2 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -34,7 +34,7 @@ Get the definition of curl from a dictionary: Fetch two documents at once: - curl ftp://ftp.example.com/ http://www.example.com:8000/ + curl ftp://ftp.example.com/ https://www.example.com:8000/ Get a file off an FTPS server: @@ -71,12 +71,12 @@ Get a file from an SMB server: Get a webpage and store in a local file with a specific name: - curl -o thatpage.html http://www.example.com/ + curl -o thatpage.html https://www.example.com/ Get a webpage and store in a local file, make the local file get the name of the remote document (if no filename part is specified in the URL, this fails): - curl -O http://www.example.com/index.html + curl -O https://www.example.com/index.html Fetch two files and store them with their remote names: @@ -115,14 +115,14 @@ matching public key file must be specified using the `--pubkey` option. ### HTTP -curl also supports user and password in HTTP URLs, thus you can pick a file +curl also supports user and password in HTTP(S) URLs. You can download a file like: - curl http://name:passwd@http.server.example/full/path/to/file + curl https://name:passwd@http.server.example/full/path/to/file or specify user and password separately like in - curl -u name:passwd http://http.server.example/full/path/to/file + curl -u name:passwd https://http.server.example/full/path/to/file HTTP offers many different methods of authentication and curl supports several: Basic, Digest, NTLM and Negotiate (SPNEGO). Without telling which @@ -151,19 +151,19 @@ Get an ftp file using an HTTP proxy named my-proxy that uses port 888: curl -x my-proxy:888 ftp://ftp.example.com/README -Get a file from an HTTP server that requires user and password, using the +Get a file from an HTTPS server that requires user and password, using the same proxy as above: - curl -u user:passwd -x my-proxy:888 http://www.example.com/ + curl -u user:passwd -x my-proxy:888 https://www.example.com/ Some proxies require special authentication. Specify by using -U as above: - curl -U user:passwd -x my-proxy:888 http://www.example.com/ + curl -U user:passwd -x my-proxy:888 https://www.example.com/ A comma-separated list of hosts and domains which do not use the proxy can be specified as: - curl --noproxy example.com -x my-proxy:888 http://www.example.com/ + curl --noproxy example.com -x my-proxy:888 https://www.example.com/ If the proxy is specified with `--proxy1.0` instead of `--proxy` or `-x`, then curl uses HTTP/1.0 instead of HTTP/1.1 for any `CONNECT` attempts. @@ -204,11 +204,11 @@ one or more sub-parts of a specified document. curl supports this with the Get the first 100 bytes of a document: - curl -r 0-99 http://www.example.com/ + curl -r 0-99 https://www.example.com/ Get the last 500 bytes of a document: - curl -r -500 http://www.example.com/ + curl -r -500 https://www.example.com/ curl also supports simple ranges for FTP files as well. Then you can only specify start and stop position. @@ -251,9 +251,9 @@ fashion similar to: ### HTTP -Upload all data on stdin to a specified HTTP site: +Upload all data on stdin to a specified HTTPS site: - curl -T - http://www.example.com/myfile + curl -T - https://www.example.com/myfile Note that the HTTP server must have been configured to accept PUT before this can be done successfully. @@ -305,12 +305,12 @@ The post data must be urlencoded. Post a simple `name` and `phone` guestbook. - curl -d "name=Rafael%20Sagula&phone=3320780" http://www.example.com/guest.cgi + curl -d "name=Rafael%20Sagula&phone=3320780" https://www.example.com/guest.cgi Or automatically [URL encode the data](https://everything.curl.dev/http/post/url-encode). curl --data-urlencode "name=Rafael Sagula&phone=3320780" - http://www.example.com/guest.cgi + https://www.example.com/guest.cgi How to post a form with curl, lesson #1: @@ -329,7 +329,7 @@ of the letter's ASCII code. Example: -(say if `http://example.com` had the following html) +(say if `https://example.com` had the following html) ```html
@@ -345,7 +345,7 @@ We want to enter user `foobar` with password `12345`. To post to this, you would enter a curl command line like: curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" - http://example.com/post.cgi + https://example.com/post.cgi While `-d` uses the application/x-www-form-urlencoded mime-type, generally understood by CGI's and similar, curl also supports the more capable @@ -359,7 +359,7 @@ example, the field name `coolfiles` is used to send three files, with different content types using the following syntax: curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html" - http://www.example.com/postit.cgi + https://www.example.com/postit.cgi If the content-type is not specified, curl tries to guess from the file extension (it only knows a few), or use the previously specified type (from an @@ -376,7 +376,7 @@ the names of the input fields. In our example, the input field names are curl -F "file=@cooltext.txt" -F "yourname=Daniel" -F "filedescription=Cool text file with cool text inside" - http://www.example.com/postit.cgi + https://www.example.com/postit.cgi To send two files in one post you can do it in two ways: @@ -402,7 +402,7 @@ used on the command line. It is especially useful to fool or trick stupid servers or CGI scripts that rely on that information being available or contain certain data. - curl -e www.example.org http://www.example.com/ + curl -e www.example.org https://www.example.com/ ## User Agent @@ -413,7 +413,7 @@ accept certain browsers. Example: - curl -A 'Mozilla/3.0 (Win95; I)' http://www.bank.example.com/ + curl -A 'Mozilla/3.0 (Win95; I)' https://www.bank.example.com/ Other common strings: @@ -596,14 +596,14 @@ Force curl to get and display a local help page in case it is invoked without URL by making a config file similar to: # default url to get - url = "http://help.with.curl.example.com/curlhelp.html" + url = "https://help.with.curl.example.com/curlhelp.html" You can specify another config file to be read by using the `-K`/`--config` flag. If you set config filename to `-` it reads the config from stdin, which can be handy if you want to hide options from being visible in process tables etc: - echo "user = user:passwd" | curl -K - http://that.secret.example.com + echo "user = user:passwd" | curl -K - https://that.secret.example.com ## Extra Headers @@ -685,11 +685,11 @@ Download with `PORT` but use 192.168.0.10 as our IP address to use: Get a webpage from a server using a specified port for the interface: - curl --interface eth0:1 http://www.example.com/ + curl --interface eth0:1 https://www.example.com/ or - curl --interface 192.168.1.10 http://www.example.com/ + curl --interface 192.168.1.10 https://www.example.com/ ## HTTPS @@ -740,7 +740,7 @@ Continue uploading a document: Continue downloading a document from a web server - curl -C - -o file http://www.example.com/ + curl -C - -o file https://www.example.com/ ## Time Conditions @@ -751,17 +751,17 @@ them with the `-z`/`--time-cond` flag. For example, you can easily make a download that only gets performed if the remote file is newer than a local copy. It would be made like: - curl -z local.html http://remote.example.com/remote.html + curl -z local.html https://remote.example.com/remote.html Or you can download a file only if the local file is newer than the remote one. Do this by prepending the date string with a `-`, as in: - curl -z -local.html http://remote.example.com/remote.html + curl -z -local.html https://remote.example.com/remote.html You can specify a plain text date as condition. Tell curl to only download the file if it was updated since January 12, 2012: - curl -z "Jan 12 2012" http://remote.example.com/remote.html + curl -z "Jan 12 2012" https://remote.example.com/remote.html curl accepts a wide range of date formats. You always make the date check the other way around by prepending it with a dash (`-`). @@ -944,7 +944,7 @@ URL you specify. Note that this also goes for the `-O` option (but not For example: get two files and use `-O` for the first and a custom file name for the second: - curl -O http://example.com/file.txt ftp://example.com/moo.exe -o moo.jpg + curl -O https://example.com/file.txt ftp://example.com/moo.exe -o moo.jpg You can also upload multiple files in a similar fashion: @@ -957,7 +957,7 @@ and fall back to IPv4 if the connection fails. The `--ipv4` and `--ipv6` options can specify which address to use when both are available. IPv6 addresses can also be specified directly in URLs using the syntax: - http://[2001:1890:1112:1::20]/overview.html + https://[2001:1890:1112:1::20]/overview.html When this style is used, the `-g` option must be given to stop curl from interpreting the square brackets as special globbing characters. Link local diff --git a/docs/TheArtOfHttpScripting.md b/docs/TheArtOfHttpScripting.md index 46369d6eafb0..f7cf43602d90 100644 --- a/docs/TheArtOfHttpScripting.md +++ b/docs/TheArtOfHttpScripting.md @@ -57,7 +57,7 @@ SPDX-License-Identifier: curl offer even more details as they show **everything** curl sends and receives. Use it like this: - curl --trace-ascii debugdump.txt http://www.example.com/ + curl --trace-ascii debugdump.txt https://www.example.com/ ## See the Timing @@ -67,7 +67,7 @@ SPDX-License-Identifier: curl [`--trace-time`](https://curl.se/docs/manpage.html#--trace-time) option is what you need. It prepends the time to each trace output line: - curl --trace-ascii d.txt --trace-time http://example.com/ + curl --trace-ascii d.txt --trace-time https://example.com/ ## See which Transfer @@ -78,7 +78,7 @@ SPDX-License-Identifier: curl you need. It prepends the transfer and connection identifier to each trace output line: - curl --trace-ascii d.txt --trace-ids http://example.com/ + curl --trace-ascii d.txt --trace-ids https://example.com/ ## See the Response @@ -104,7 +104,7 @@ SPDX-License-Identifier: curl IP address for a hostname than what would otherwise be used, by using curl's [`--resolve`](https://curl.se/docs/manpage.html#--resolve) option: - curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/ + curl --resolve www.example.org:80:127.0.0.1 https://www.example.org/ ## Port number @@ -115,14 +115,14 @@ SPDX-License-Identifier: curl number immediately following the hostname. Like when doing HTTP to port 1234: - curl http://www.example.org:1234/ + curl https://www.example.org:1234/ The port number you specify in the URL is the number that the server uses to offer its services. Sometimes you may use a proxy, and then you may need to specify that proxy's port number separately from what curl needs to connect to the server. Like when using an HTTP proxy on port 4321: - curl --proxy http://proxy.example.org:4321 http://remote.example.org/ + curl --proxy http://proxy.example.org:4321 https://remote.example.org/ ## Username and password @@ -133,11 +133,11 @@ SPDX-License-Identifier: curl You can opt to either insert the user and password in the URL or you can provide them separately: - curl http://user:password@example.org/ + curl https://user:password@example.org/ or - curl -u user:password http://example.org/ + curl -u user:password https://example.org/ You need to pay attention that this kind of HTTP authentication is not what is usually done and requested by user-oriented websites these days. They tend @@ -188,7 +188,7 @@ SPDX-License-Identifier: curl Example, send two GET requests: - curl http://url1.example.com http://url2.example.com + curl https://url1.example.com https://url2.example.com If you use [`--data`](https://curl.se/docs/manpage.html#-d) to POST to the URL, using multiple URLs means that you send that same POST to all the @@ -196,7 +196,7 @@ SPDX-License-Identifier: curl Example, send two POSTs: - curl --data name=curl http://url1.example.com http://url2.example.com + curl --data name=curl https://url1.example.com https://url2.example.com ## Multiple HTTP methods in a single command line @@ -214,11 +214,11 @@ SPDX-License-Identifier: curl Perhaps this is best shown with a few examples. To send first a HEAD and then a GET: - curl -I http://example.com --next http://example.com + curl -I https://example.com --next https://example.com To first send a POST and then a GET: - curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html + curl -d score=10 https://example.com/post.cgi --next https://example.com/results.html # HTML forms @@ -261,7 +261,7 @@ SPDX-License-Identifier: curl To make curl do the GET form post for you, just enter the expected created URL: - curl "http://www.example.com/when/junk.cgi?birthyear=1905&press=OK" + curl "https://www.example.com/when/junk.cgi?birthyear=1905&press=OK" ## POST @@ -287,7 +287,7 @@ SPDX-License-Identifier: curl And to use curl to post this form with the same data filled in as before, we could do it like: - curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when/junk.cgi + curl --data "birthyear=1905&press=%20OK%20" https://www.example.com/when/junk.cgi This kind of POST uses the Content-Type `application/x-www-form-urlencoded` and is the most widely used POST kind. @@ -299,7 +299,7 @@ SPDX-License-Identifier: curl Recent curl versions can in fact url-encode POST data for you, like this: - curl --data-urlencode "name=I am Daniel" http://www.example.com + curl --data-urlencode "name=I am Daniel" https://www.example.com If you repeat `--data` several times on the command line, curl concatenates all the given data pieces - and put a `&` symbol between each data segment. @@ -371,7 +371,7 @@ SPDX-License-Identifier: curl Put a file to an HTTP server with curl: - curl --upload-file uploadfile http://www.example.com/receive.cgi + curl --upload-file uploadfile https://www.example.com/receive.cgi # HTTP Authentication @@ -386,7 +386,7 @@ SPDX-License-Identifier: curl To tell curl to use a user and password for authentication: - curl --user name:password http://www.example.com + curl --user name:password https://www.example.com ## Other Authentication @@ -440,7 +440,7 @@ SPDX-License-Identifier: curl Use curl to set the referer field with: - curl --referer http://www.example.come http://www.example.com + curl --referer https://www.example.come https://www.example.com ## User Agent @@ -481,7 +481,7 @@ SPDX-License-Identifier: curl To tell curl to follow a Location: - curl --location http://www.example.com + curl --location https://www.example.com If you use curl to POST to a site that immediately redirects you to another page, you can safely use [`--location`](https://curl.se/docs/manpage.html#-L) @@ -519,14 +519,14 @@ SPDX-License-Identifier: curl The simplest way to send a few cookies to the server when getting a page with curl is to add them on the command line like: - curl --cookie "name=Daniel" http://www.example.com + curl --cookie "name=Daniel" https://www.example.com Cookies are sent as common HTTP headers. This is practical as it allows curl to record cookies simply by recording headers. Record cookies with curl by using the [`--dump-header`](https://curl.se/docs/manpage.html#-D) (`-D`) option like: - curl --dump-header headers_and_cookies http://www.example.com + curl --dump-header headers_and_cookies https://www.example.com (Take note that the [`--cookie-jar`](https://curl.se/docs/manpage.html#-c) option described @@ -538,7 +538,7 @@ SPDX-License-Identifier: curl believing you had a previous connection). To use previously stored cookies, you run curl like: - curl --cookie stored_cookies_in_file http://www.example.com + curl --cookie stored_cookies_in_file https://www.example.com curl's "cookie engine" gets enabled when you use the [`--cookie`](https://curl.se/docs/manpage.html#-b) option. If you only @@ -547,7 +547,7 @@ SPDX-License-Identifier: curl page and follow a location (and thus possibly send back cookies it received), you can invoke it like: - curl --cookie nada --location http://www.example.com + curl --cookie nada --location https://www.example.com curl has the ability to read and write cookie files that use the same file format that Netscape and Mozilla once used. It is a convenient way to share @@ -557,7 +557,7 @@ SPDX-License-Identifier: curl cookie file at the end of an operation: curl --cookie cookies.txt --cookie-jar newcookies.txt \ - http://www.example.com + https://www.example.com # HTTPS @@ -620,12 +620,12 @@ SPDX-License-Identifier: curl You can delete a default header by providing one without content. Like you can ruin the request by chopping off the `Host:` header: - curl --header "Host:" http://www.example.com + curl --header "Host:" https://www.example.com You can add headers the same way. Your server may want a `Destination:` header, and you can add it: - curl --header "Destination: http://nowhere" http://example.com + curl --header "Destination: nowhere" https://example.com ## More on changed methods @@ -638,7 +638,7 @@ SPDX-License-Identifier: curl thinks it sends a POST. You can change the normal GET to a POST method by simply adding `-X POST` in a command line like: - curl -X POST http://example.org/ + curl -X POST https://example.org/ curl however still acts as if it sent a GET so it does not send any request body etc. diff --git a/docs/URL-SYNTAX.md b/docs/URL-SYNTAX.md index 6232e3f609b8..d69ab674796d 100644 --- a/docs/URL-SYNTAX.md +++ b/docs/URL-SYNTAX.md @@ -130,7 +130,7 @@ character or string. For example, this could look like: - http://user:password@www.example.com:80/index.html?foo=bar#top + https://user:password@www.example.com:80/index.html?foo=bar#top ## Scheme @@ -169,13 +169,13 @@ local network name of the machine on your network or the IP address of the server or machine represented by either an IPv4 or IPv6 address (within brackets). For example: - http://www.example.com/ + https://www.example.com/ - http://hostname/ + https://hostname.example/ - http://192.168.0.1/ + https://192.168.0.1/ - http://[2001:1890:1112:1::20]/ + https://[2001:1890:1112:1::20]/ ### "localhost" diff --git a/docs/cmdline-opts/_ENVIRONMENT.md b/docs/cmdline-opts/_ENVIRONMENT.md index 53fe5c34212f..1ac85fb12841 100644 --- a/docs/cmdline-opts/_ENVIRONMENT.md +++ b/docs/cmdline-opts/_ENVIRONMENT.md @@ -31,12 +31,12 @@ This environment variable disables use of the proxy even when specified with the --proxy option. That is NO_PROXY=direct.example.com curl -x http://proxy.example.com - http://direct.example.com + https://direct.example.com accesses the target URL directly, and NO_PROXY=direct.example.com curl -x http://proxy.example.com - http://somewhere.example.com + https://somewhere.example.com accesses the target URL through the proxy. diff --git a/docs/cmdline-opts/_GLOBBING.md b/docs/cmdline-opts/_GLOBBING.md index c3c7951acb27..37c8d430693d 100644 --- a/docs/cmdline-opts/_GLOBBING.md +++ b/docs/cmdline-opts/_GLOBBING.md @@ -6,7 +6,9 @@ or ranges within brackets. We call this "globbing". Provide a list with three different names like this: - http://site.{one,two,three}.com + https://fun.example/{one,two,three}.jpg + + sftp://{one,two,three}.example/README Do sequences of alphanumeric series by using [] as in: @@ -23,14 +25,14 @@ With letters through the alphabet: Nested sequences are not supported, but you can use several ones next to each other: - http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html + https://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html You can specify a step counter for the ranges to get every Nth number or letter: - http://example.com/file[1-100:10].txt + https://example.com/file[1-100:10].txt - http://example.com/file[a-z:2].txt + https://example.com/file[a-z:2].txt When using [] or {} sequences when invoked from a command line prompt, you probably have to put the full URL within double quotes to avoid the shell from diff --git a/docs/libcurl/libcurl-security.md b/docs/libcurl/libcurl-security.md index 7fbd32974d2c..62dc12e97e35 100644 --- a/docs/libcurl/libcurl-security.md +++ b/docs/libcurl/libcurl-security.md @@ -144,9 +144,10 @@ The CURLOPT_REDIR_PROTOCOLS_STR(3) and CURLOPT_NETRC(3) options can be used to mitigate against this kind of attack. A redirect can also specify a location available only on the machine running -libcurl, including servers hidden behind a firewall from the attacker. -E.g. **http://127.0.0.1/** or **http://intranet/delete-stuff.cgi?delete=all** or -**tftp://bootp-server/pc-config-data** +libcurl, including servers hidden behind a firewall from the attacker. E.g. +**https://127.0.0.1/** or +**https://intranet.example/delete-stuff.cgi?delete=all** or +**tftp://bootp-server.example/pc-config-data** Applications can mitigate against this by disabling CURLOPT_FOLLOWLOCATION(3) and handling redirects itself, sanitizing URLs @@ -172,11 +173,10 @@ way you did not intend such as injecting new headers. A user who can control the DNS server of a domain being passed in within a URL can change the address of the host to a local, private address which a server-side libcurl-using application could then use. E.g. the innocuous URL -**http://fuzzybunnies.example.com/** could actually resolve to the IP -address of a server behind a firewall, such as 127.0.0.1 or -10.1.2.3. Applications can mitigate against this by setting a -CURLOPT_OPENSOCKETFUNCTION(3) or CURLOPT_PREREQFUNCTION(3) and -checking the address before a connection. +**https://fuzzybunnies.example.com/** could actually resolve to the IP address +of a server behind a firewall, such as 127.0.0.1 or 10.1.2.3. Applications can +mitigate against this by setting a CURLOPT_OPENSOCKETFUNCTION(3) or +CURLOPT_PREREQFUNCTION(3) and checking the address before a connection. All the malicious scenarios regarding redirected URLs apply just as well to non-redirected URLs, if the user is allowed to specify an arbitrary URL that @@ -254,7 +254,7 @@ the request. If cookies are enabled and cached, then a user could craft a URL which performs some malicious action to a site whose authentication is already stored in a cookie. E.g. -**http://mail.example.com/delete-stuff.cgi?delete=all** Applications can +**https://mail.example.com/delete-stuff.cgi?delete=all** Applications can mitigate against this by disabling cookies or clearing them between requests. # Dangerous SCP URLs @@ -315,8 +315,8 @@ if creative use of special characters are applied? If the user can set the URL, the user can also specify the scheme part to other protocols that you did not intend for users to use and perhaps did not -consider. curl supports over 20 different URL schemes. "http://" might be what -you thought, "ftp://" or "imap://" might be what the user gives your +consider. curl supports over 27 different URL schemes. `https://` might be +what you expect, `ftp://` or `imap://` might be what the user gives your application. Also, cross-protocol operations might be done by using a particular scheme in the URL but point to a server doing a different protocol on a non-standard port. diff --git a/docs/libcurl/libcurl-tutorial.md b/docs/libcurl/libcurl-tutorial.md index 7b01d234c4c9..a5bebc665598 100644 --- a/docs/libcurl/libcurl-tutorial.md +++ b/docs/libcurl/libcurl-tutorial.md @@ -194,7 +194,7 @@ One of the most basic properties to set in the handle is the URL. You set your preferred URL to transfer with CURLOPT_URL(3) in a manner similar to: ~~~c - curl_easy_setopt(handle, CURLOPT_URL, "http://example.com/"); + curl_easy_setopt(handle, CURLOPT_URL, "https://example.com/"); ~~~ Let's assume for a while that you want to receive data as the URL identifies a @@ -470,7 +470,7 @@ libcurl to post it all to the remote site: ~~~c char *data = "name=daniel&project=curl"; curl_easy_setopt(handle, CURLOPT_POSTFIELDS, data); - curl_easy_setopt(handle, CURLOPT_URL, "http://posthere.com/"); + curl_easy_setopt(handle, CURLOPT_URL, "https://posthere.example/"); curl_easy_perform(handle); /* post away! */ ~~~ diff --git a/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md b/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md index 92316f1a3eb8..eace7222d11a 100644 --- a/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md +++ b/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md @@ -45,7 +45,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); - curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example.com"); + curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example"); curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST); curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "shrek"); diff --git a/docs/libcurl/opts/CURLOPT_NOPROXY.md b/docs/libcurl/opts/CURLOPT_NOPROXY.md index 117cf09be887..40f3d4cc6547 100644 --- a/docs/libcurl/opts/CURLOPT_NOPROXY.md +++ b/docs/libcurl/opts/CURLOPT_NOPROXY.md @@ -76,7 +76,7 @@ int main(void) /* accept various URLs */ curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* use this proxy */ - curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80"); + curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example:80"); /* ... but make sure this host name is not proxied */ curl_easy_setopt(curl, CURLOPT_NOPROXY, "www.example.com"); curl_easy_perform(curl); diff --git a/docs/libcurl/opts/CURLOPT_PROXY.md b/docs/libcurl/opts/CURLOPT_PROXY.md index fca07f23f6f9..2d9d456dba9f 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY.md +++ b/docs/libcurl/opts/CURLOPT_PROXY.md @@ -138,7 +138,7 @@ int main(void) CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/file.txt"); - curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80"); + curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example:80"); curl_easy_perform(curl); } } diff --git a/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md b/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md index b05824630bb7..e86be358edf6 100644 --- a/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md +++ b/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md @@ -83,7 +83,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); curl_easy_setopt(curl, CURLOPT_HEADER, 1L); - curl_easy_setopt(curl, CURLOPT_PROXY, "http://foo:3128"); + curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example:3128"); curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); curl_easy_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS, 1L); From 7dd5bb77c397e7b7a7f323224c34488f1130399a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Dec 2025 17:36:54 +0100 Subject: [PATCH 700/885] CI/windows: add torture tests with Schannel With Schannel and Unicode, `-shallow=13`. It finishes in 12 minutes, making it the slowest Windows job. It's still on par with torture jobs on other platforms (though they manage to fit `-shallow=25`). Also `-shallow=13` still caught leaks in multiple tests. Also: - test2300: exclude from CI Windows torture tests. - experimental. The downside of going with deeper torture tests, is that it requires increasing the job timeout. This in turns means that a hung job takes more minutes to be killed (due to GitHub bugs where a hung step does not honor the per-step timeout on Windows, another bug where a hung job gets killed +5 minutes above the workflow timeout, and another bug (or feature?) where other failed/hung jobs in the the workflow cannot be restarted till the last job finishes or gets killed. And all this probably related to a Perl bug which makes it hang on fork errors, which is turn related to Cygwin/MSYS2 runtime bugs which breaks fork in case of curl's mixed MSYS2-Perl/native-curl-binaries environment.) The end result in longer forced waits before being able to restart flaky jobs, which slows down iterations and annoying. Also tried: - non-c-ares job: detected known issues much less often. - replaced libidn2 with WinIDN: detected known issues much less often. - runtests -j9-j20 values: did not make a difference. - other `-shallow` values: 20 is the max feasible, but comes with the downside described above. Ref: #19675 (reboot of) Follow-up to f08417c4259a3b9a2e4d72a48fa02ce6502cb587 #19863 Closes #19865 --- .github/workflows/windows.yml | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d2e97851fc69..8dca6ce891e4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -198,25 +198,26 @@ jobs: matrix: include: # MSYS - - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --disable-threaded-resolver --disable-proxy', install: 'openssl-devel libssh2-devel', name: '!proxy' } - - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: 'skiprun', config: '--enable-debug --with-openssl --disable-threaded-resolver', install: 'openssl-devel libssh2-devel', name: 'default' } - - { build: 'cmake' , sys: 'msys' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF', install: 'openssl-devel libssh2-devel', name: 'default' } - - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '' , config: '--with-openssl', install: 'openssl-devel libssh2-devel', name: 'default R' } + - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --disable-threaded-resolver --disable-proxy', install: 'openssl-devel libssh2-devel', name: '!proxy' } + - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --with-openssl --disable-threaded-resolver', install: 'openssl-devel libssh2-devel', name: 'default' } + - { build: 'cmake' , sys: 'msys' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF', install: 'openssl-devel libssh2-devel', name: 'default' } + - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '' , config: '--with-openssl', install: 'openssl-devel libssh2-devel', name: 'default R' } # MinGW - - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: 'skiprun', config: '--enable-debug --with-openssl --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib CPPFLAGS=-D_WIN32_WINNT=0x0501', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-libssh2', name: 'default XP' } - - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --enable-windows-unicode --enable-ares --with-openssl-quic --enable-shared=no', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-openssl mingw-w64-x86_64-nghttp3 mingw-w64-x86_64-libssh2', name: 'c-ares U' } - - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-libssh2', type: 'Debug', name: 'schannel c-ares U' } + - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --with-openssl --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib CPPFLAGS=-D_WIN32_WINNT=0x0501', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-libssh2', name: 'default XP' } + - { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --enable-windows-unicode --enable-ares --with-openssl-quic --enable-shared=no', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-openssl mingw-w64-x86_64-nghttp3 mingw-w64-x86_64-libssh2', name: 'c-ares U' } + - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-libssh2', type: 'Debug', name: 'schannel c-ares U' } + - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: '-t --shallow=13 !FTP', config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', install: 'mingw-w64-x86_64-c-ares mingw-w64-x86_64-libssh2', type: 'Debug', name: 'schannel U torture' } # WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to # read its configuration from, making it vulnerable to attacks on # Windows. Do not use this component till there is a fix for these. # https://github.com/curl/curl-for-win/blob/3951808deb04df9489ee17430f236ed54436f81a/libssh.sh#L6-L8 - - { build: 'cmake' , sys: 'clang64' , env: 'clang-x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_GNUTLS=ON -DENABLE_UNICODE=OFF -DUSE_NGTCP2=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON', install: 'mingw-w64-clang-x86_64-gnutls mingw-w64-clang-x86_64-nghttp3 mingw-w64-clang-x86_64-ngtcp2 mingw-w64-clang-x86_64-libssh', type: 'Debug', name: 'gnutls libssh' } - - { build: 'cmake' , sys: 'clangarm64', env: 'clang-aarch64', tflags: 'skiprun', config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', install: 'mingw-w64-clang-aarch64-libssh2', type: 'Release', name: 'schannel R TrackMemory', image: 'windows-11-arm' } - - { build: 'cmake' , sys: 'clang64' , env: 'clang-x86_64' , tflags: 'skiprun', config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF -DUSE_NGTCP2=ON', install: 'mingw-w64-clang-x86_64-openssl mingw-w64-clang-x86_64-nghttp3 mingw-w64-clang-x86_64-ngtcp2 mingw-w64-clang-x86_64-libssh2', type: 'Release', name: 'openssl', chkprefill: '_chkprefill' } - - { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun', config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_OPENSSL=ON', install: 'mingw-w64-ucrt-x86_64-openssl mingw-w64-ucrt-x86_64-libssh2', type: 'Release', test: 'uwp', name: 'schannel' } - # { build: 'autotools', sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun', config: '--without-debug --with-schannel --enable-shared', install: 'mingw-w64-ucrt-x86_64-libssh2', type: 'Release', test: 'uwp', name: 'schannel' } - - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: 'skiprun', config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON', install: 'mingw-w64-x86_64-libssh2', type: 'Debug', cflags: '-DCURL_SCHANNEL_DEV_DEBUG', name: 'schannel dev debug', image: 'windows-2025' } - - { build: 'cmake' , sys: 'mingw32' , env: 'i686' , tflags: 'skiprun', config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', install: 'mingw-w64-i686-libssh2', type: 'Release', name: 'schannel R' } + - { build: 'cmake' , sys: 'clang64' , env: 'clang-x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_GNUTLS=ON -DENABLE_UNICODE=OFF -DUSE_NGTCP2=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON', install: 'mingw-w64-clang-x86_64-gnutls mingw-w64-clang-x86_64-nghttp3 mingw-w64-clang-x86_64-ngtcp2 mingw-w64-clang-x86_64-libssh', type: 'Debug', name: 'gnutls libssh' } + - { build: 'cmake' , sys: 'clangarm64', env: 'clang-aarch64', tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', install: 'mingw-w64-clang-aarch64-libssh2', type: 'Release', name: 'schannel R TrackMemory', image: 'windows-11-arm' } + - { build: 'cmake' , sys: 'clang64' , env: 'clang-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF -DUSE_NGTCP2=ON', install: 'mingw-w64-clang-x86_64-openssl mingw-w64-clang-x86_64-nghttp3 mingw-w64-clang-x86_64-ngtcp2 mingw-w64-clang-x86_64-libssh2', type: 'Release', name: 'openssl', chkprefill: '_chkprefill' } + - { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_OPENSSL=ON', install: 'mingw-w64-ucrt-x86_64-openssl mingw-w64-ucrt-x86_64-libssh2', type: 'Release', test: 'uwp', name: 'schannel' } + # { build: 'autotools', sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '--without-debug --with-schannel --enable-shared', install: 'mingw-w64-ucrt-x86_64-libssh2', type: 'Release', test: 'uwp', name: 'schannel' } + - { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON', install: 'mingw-w64-x86_64-libssh2', type: 'Debug', cflags: '-DCURL_SCHANNEL_DEV_DEBUG', name: 'schannel dev debug', image: 'windows-2025' } + - { build: 'cmake' , sys: 'mingw32' , env: 'i686' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', install: 'mingw-w64-i686-libssh2', type: 'Release', name: 'schannel R' } fail-fast: false steps: - uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0 @@ -367,7 +368,7 @@ jobs: - name: 'run tests' if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} - timeout-minutes: 10 + timeout-minutes: ${{ contains(matrix.tflags, '-t') && 15 || 10 }} env: MATRIX_INSTALL: '${{ matrix.install }}' TFLAGS: '${{ matrix.tflags }}' @@ -378,6 +379,9 @@ jobs: if [[ "${MATRIX_INSTALL}" = *'libssh2-wincng'* ]]; then TFLAGS+=' ~SCP ~SFTP' # Flaky: `-8, Unable to exchange encryption keys`. https://github.com/libssh2/libssh2/issues/804 fi + if [[ "${TFLAGS}" = *'-t'* ]]; then + TFLAGS+=' !2300' # Leaks memory and file handle via tool_doswin.c / win32_stdin_read_thread() + fi fi if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" From cc853ddc3dcf6478690a60c2cfd529e4c94e462c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:20:54 +0000 Subject: [PATCH 701/885] GHA: bump pip-dependencies ruff, psutil, pytest - update `ruff` from 0.14.5 to 0.14.8 - update `psutil` from 7.1.2 to 7.1.3 - update `pytest` from 8.4.2 to 9.0.1 Closes #19876 --- .github/scripts/requirements.txt | 2 +- tests/http/requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 874e710997fe..537f329acafd 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -6,4 +6,4 @@ cmakelang==0.6.13 codespell==2.4.1 pytype==2024.10.11 reuse==6.2.0 -ruff==0.14.5 +ruff==0.14.8 diff --git a/tests/http/requirements.txt b/tests/http/requirements.txt index a27bf48ea196..fde20ec152ce 100644 --- a/tests/http/requirements.txt +++ b/tests/http/requirements.txt @@ -4,7 +4,7 @@ cryptography==46.0.3 filelock==3.20.0 -psutil==7.1.2 -pytest==8.4.2 +psutil==7.1.3 +pytest==9.0.1 pytest-xdist==3.8.0 websockets==15.0.1 From 64a1092a7953446299b1114a15e7e82e7b5fefd2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Dec 2025 17:02:26 +0100 Subject: [PATCH 702/885] IPFS.md: wrap long lines Closes #19880 --- docs/IPFS.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/IPFS.md b/docs/IPFS.md index 8ce51325bfd2..c39f802dd918 100644 --- a/docs/IPFS.md +++ b/docs/IPFS.md @@ -7,22 +7,38 @@ SPDX-License-Identifier: curl # IPFS For an overview about IPFS, visit the [IPFS project site](https://ipfs.tech/). -In IPFS there are two protocols. IPFS and IPNS (their workings are explained in detail [here](https://docs.ipfs.tech/concepts/)). The ideal way to access data on the IPFS network is through those protocols. For example to access the Big Buck Bunny video the ideal way to access it is like: `ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi` +In IPFS there are two protocols. IPFS and IPNS (their workings are explained +in detail [here](https://docs.ipfs.tech/concepts/)). The ideal way to access +data on the IPFS network is through those protocols. For example to access +the Big Buck Bunny video the ideal way to access it is like: +`ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi` ## IPFS Gateways IPFS Gateway acts as a bridge between traditional HTTP clients and IPFS. -IPFS Gateway specifications of HTTP semantics can be found [here](https://specs.ipfs.tech/http-gateways/). +IPFS Gateway specifications of HTTP semantics can be found +[here](https://specs.ipfs.tech/http-gateways/). ### Deserialized responses -By default, a gateway acts as a bridge between traditional HTTP clients and IPFS and performs necessary hash verification and deserialization. Through such gateway, users can download files, directories, and other content-addressed data stored with IPFS or IPNS as if they were stored in a traditional web server. +By default, a gateway acts as a bridge between traditional HTTP clients and +IPFS and performs necessary hash verification and deserialization. Through such +gateway, users can download files, directories, and other content-addressed +data stored with IPFS or IPNS as if they were stored in a traditional web +server. ### Verifiable responses -By explicitly requesting [application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw) or [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) responses, by means defined in [Trustless Gateway Specification](https://specs.ipfs.tech/http-gateways/trustless-gateway/), the user is able to fetch raw content-addressed data and [perform hash verification themselves](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval). +By explicitly requesting +[application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw) or +[application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) +responses, by means defined in +[Trustless Gateway Specification](https://specs.ipfs.tech/http-gateways/trustless-gateway/), +the user is able to fetch raw content-addressed data and +[perform hash verification themselves](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval). -This enables users to use untrusted, public gateways without worrying they might return invalid/malicious bytes. +This enables users to use untrusted, public gateways without worrying they +might return invalid/malicious bytes. ## IPFS and IPNS protocol handling From 16f4b2038503aac2e32dca2abff8dd44e7591810 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 15:54:38 +0100 Subject: [PATCH 703/885] KNOWN_BUGS: remove link to codepoints.net The site is so slow it often triggers a failure for the link checker. Closes #19878 --- docs/KNOWN_BUGS | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS index 278cc2a0977b..e28a90053dd9 100644 --- a/docs/KNOWN_BUGS +++ b/docs/KNOWN_BUGS @@ -322,7 +322,6 @@ problems may have been fixed or changed somewhat since this was written. 6.5 NTLM does not support password with Unicode 'SECTION SIGN' character https://en.wikipedia.org/wiki/Section_sign - https://codepoints.net/U+00A7 SECTION SIGN https://github.com/curl/curl/issues/2120 6.6 libcurl can fail to try alternatives with --proxy-any From 09e48d5a046fc9b97c15f9b1d2e21de38eda508d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 15:50:48 +0100 Subject: [PATCH 704/885] mk-ca-bundle.md: the file format docs URL is permaredirected Closes #19877 --- docs/mk-ca-bundle.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/mk-ca-bundle.md b/docs/mk-ca-bundle.md index fe68635263a6..bb5b7b1a48f9 100644 --- a/docs/mk-ca-bundle.md +++ b/docs/mk-ca-bundle.md @@ -122,6 +122,5 @@ Returns 0 on success. Returns 1 if it fails to download data. # FILE FORMAT -The file format used by Mozilla for this trust information is documented here: - -https://p11-glue.freedesktop.org/doc/storing-trust-policy/storing-trust-existing.html +The file format used by Mozilla for this trust information is [documented +here](https://p11-glue.github.io/p11-glue/doc/storing-trust-policy/storing-trust-existing.html). From 2ae983bf4ea5ef86f0e68ea0ff219a91b1aa3428 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Dec 2025 16:44:29 +0100 Subject: [PATCH 705/885] tidy-up: URLs - to avoid dupes. - missing slashes. - drop `.git` suffix from GitHub git repo URLs for a few outliers. - use short YouTube URL like curl-www does. - sync two RFC doc URLs with others. Closes #19879 --- README | 2 +- README.md | 2 +- docs/CONTRIBUTE.md | 2 +- docs/DISTROS.md | 2 +- docs/ECH.md | 2 +- docs/FAQ | 2 +- docs/HTTP3.md | 6 +++--- docs/INSTALL.md | 4 ++-- docs/KNOWN_BUGS | 2 ++ docs/TODO | 2 +- docs/testcurl.md | 2 +- 11 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README b/README index df320f94810e..2f68ef0c9f4f 100644 --- a/README +++ b/README @@ -38,7 +38,7 @@ GIT To download the latest source code off the GIT server, do this: - git clone https://github.com/curl/curl.git + git clone https://github.com/curl/curl (you will get a directory named curl created, filled with the source code) diff --git a/README.md b/README.md index 2fe531628188..69e8b937dc17 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Visit the [curl website](https://curl.se/) for the latest news and downloads. Download the latest source from the Git server: - git clone https://github.com/curl/curl.git + git clone https://github.com/curl/curl ## Security problems diff --git a/docs/CONTRIBUTE.md b/docs/CONTRIBUTE.md index 4a34a539bbe9..3abf729598a7 100644 --- a/docs/CONTRIBUTE.md +++ b/docs/CONTRIBUTE.md @@ -289,7 +289,7 @@ Just ask if this is what you would want. You are required to have posted several high quality patches first, before you can be granted push access. ## Useful resources - - [Webinar on getting code into curl](https://www.youtube.com/watch?v=QmZ3W1d6LQI) + - [Webinar on getting code into curl](https://youtu.be/QmZ3W1d6LQI) # Update copyright and license information diff --git a/docs/DISTROS.md b/docs/DISTROS.md index 7f61e2aa3f5b..8810cc999150 100644 --- a/docs/DISTROS.md +++ b/docs/DISTROS.md @@ -256,7 +256,7 @@ can also be used on other distributions ## Rocky Linux - curl: https://git.rockylinux.org/staging/rpms/curl/-/blob/r9/SPECS/curl.spec -- curl issues: https://bugs.rockylinux.org +- curl issues: https://bugs.rockylinux.org/ - curl patches: https://git.rockylinux.org/staging/rpms/curl/-/tree/r9/SOURCES ## SerenityOS diff --git a/docs/ECH.md b/docs/ECH.md index 6f236a106b52..042719245c0c 100644 --- a/docs/ECH.md +++ b/docs/ECH.md @@ -77,7 +77,7 @@ The above works for these test sites: ```sh https://defo.ie/ech-check.php https://crypto.cloudflare.com/cdn-cgi/trace -https://tls-ech.dev +https://tls-ech.dev/ ``` The list above has 4 different server technologies, implemented by 3 different diff --git a/docs/FAQ b/docs/FAQ index 230b850bac80..ef93c91c4153 100644 --- a/docs/FAQ +++ b/docs/FAQ @@ -1043,7 +1043,7 @@ FAQ you will find that even if D:\blah.txt does exist, curl returns a 'file not found' error. - According to RFC 1738 (https://www.ietf.org/rfc/rfc1738.txt), + According to RFC 1738 (https://datatracker.ietf.org/doc/html/rfc1738), file:// URLs must contain a host component, but it is ignored by most implementations. In the above example, 'D:' is treated as the host component, and is taken away. Thus, curl tries to open '/blah.txt'. diff --git a/docs/HTTP3.md b/docs/HTTP3.md index def30798ecca..2b0a4c72b872 100644 --- a/docs/HTTP3.md +++ b/docs/HTTP3.md @@ -140,7 +140,7 @@ Build curl: Build GnuTLS: - % git clone --depth 1 https://gitlab.com/gnutls/gnutls.git + % git clone --depth 1 https://gitlab.com/gnutls/gnutls % cd gnutls % ./bootstrap % ./configure --prefix= @@ -182,7 +182,7 @@ Build curl: Build wolfSSL: - % git clone https://github.com/wolfSSL/wolfssl.git + % git clone https://github.com/wolfSSL/wolfssl % cd wolfssl % autoreconf -fi % ./configure --prefix= --enable-quic --enable-session-ticket --enable-earlydata --enable-psk --enable-harden --enable-altcertchains @@ -386,7 +386,7 @@ above. Get, build and install nghttp2: - % git clone https://github.com/nghttp2/nghttp2.git + % git clone https://github.com/nghttp2/nghttp2 % cd nghttp2 % autoreconf -fi % PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/daniel/build-quictls/lib/pkgconfig:/home/daniel/build-nghttp3/lib/pkgconfig:/home/daniel/build-ngtcp2/lib/pkgconfig LDFLAGS=-L/home/daniel/build-quictls/lib CFLAGS=-I/home/daniel/build-quictls/include ./configure --enable-maintainer-mode --prefix=/home/daniel/build-nghttp2 --disable-shared --enable-app --enable-http3 --without-jemalloc --without-libxml2 --without-systemd diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 1859dc21ae7f..751b21e62051 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -18,7 +18,7 @@ libcurl from [source code](https://curl.se/download.html). You can download and install curl and libcurl using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: - git clone https://github.com/Microsoft/vcpkg.git + git clone https://github.com/Microsoft/vcpkg cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install @@ -244,7 +244,7 @@ Either run setup-x86_64.exe, then search and select packages individually, or tr setup-x86_64.exe -P binutils -P gcc-core -P libpsl-devel -P libtool -P perl -P make If the latter, matching packages should appear in the install rows (*is fickle though*) after selecting -the download site i.e. `https://mirrors.kernel.org`. In either case, follow the GUI prompts +the download site i.e. `https://mirrors.kernel.org/`. In either case, follow the GUI prompts until you reach the "Select Packages" window; then select packages, click next, and finish the `cygwin` package installation. diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS index e28a90053dd9..f65e9f1ae264 100644 --- a/docs/KNOWN_BUGS +++ b/docs/KNOWN_BUGS @@ -321,6 +321,8 @@ problems may have been fixed or changed somewhat since this was written. 6.5 NTLM does not support password with Unicode 'SECTION SIGN' character + Code point: U+00A7 + https://en.wikipedia.org/wiki/Section_sign https://github.com/curl/curl/issues/2120 diff --git a/docs/TODO b/docs/TODO index 817591dfb7cb..22ca27f88d99 100644 --- a/docs/TODO +++ b/docs/TODO @@ -771,7 +771,7 @@ DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL keys and certs over DNS using DNSSEC as an alternative to the CA model. - https://www.rfc-editor.org/rfc/rfc6698.txt + https://datatracker.ietf.org/doc/html/rfc6698 An initial patch was posted by Suresh Krishnaswamy on March 7th 2013 (https://curl.se/mail/lib-2013-03/0075.html) but it was a too simple diff --git a/docs/testcurl.md b/docs/testcurl.md index e4acab6db7de..b5149e098b57 100644 --- a/docs/testcurl.md +++ b/docs/testcurl.md @@ -102,7 +102,7 @@ snapshots automatically): $ mkdir curl-testing $ cd curl-testing - $ git clone https://github.com/curl/curl.git + $ git clone https://github.com/curl/curl With the curl sources checked out, or downloaded, you can start testing right away. If you want to use *testcurl* without command line arguments and to have From d75716e4e55c7074566f48d8c03bfd721461e105 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Dec 2025 13:31:42 +0100 Subject: [PATCH 706/885] tests/data: move `--libcurl` output to external data files To make the test files XML-compliant, and the expected results possibly easier to manage by keeping them in `.c` files. Non-XML-compliant files are down to 36 after this patch. Also: - make all macro expansions apply to `%includetext` contents. Closes #19799 --- docs/tests/FILEFORMAT.md | 3 +- scripts/checksrc-all.pl | 1 + tests/data/Makefile.am | 4 +- tests/data/data1400.c | 46 +++++++++++++++++++++ tests/data/data1401.c | 58 +++++++++++++++++++++++++++ tests/data/data1402.c | 48 ++++++++++++++++++++++ tests/data/data1403.c | 46 +++++++++++++++++++++ tests/data/data1404.c | 83 ++++++++++++++++++++++++++++++++++++++ tests/data/data1405.c | 66 ++++++++++++++++++++++++++++++ tests/data/data1406.c | 56 ++++++++++++++++++++++++++ tests/data/data1407.c | 46 +++++++++++++++++++++ tests/data/data1420.c | 46 +++++++++++++++++++++ tests/data/data1465.c | 48 ++++++++++++++++++++++ tests/data/data1481.c | 49 ++++++++++++++++++++++ tests/data/test1400 | 49 +--------------------- tests/data/test1401 | 60 +-------------------------- tests/data/test1402 | 51 +---------------------- tests/data/test1403 | 49 +--------------------- tests/data/test1404 | 87 +--------------------------------------- tests/data/test1405 | 72 ++------------------------------- tests/data/test1406 | 62 ++-------------------------- tests/data/test1407 | 53 ++---------------------- tests/data/test1420 | 52 ++---------------------- tests/data/test1465 | 51 +---------------------- tests/data/test1481 | 52 +----------------------- tests/runner.pm | 6 +++ tests/testutil.pm | 31 +++++++++----- 27 files changed, 645 insertions(+), 630 deletions(-) create mode 100644 tests/data/data1400.c create mode 100644 tests/data/data1401.c create mode 100644 tests/data/data1402.c create mode 100644 tests/data/data1403.c create mode 100644 tests/data/data1404.c create mode 100644 tests/data/data1405.c create mode 100644 tests/data/data1406.c create mode 100644 tests/data/data1407.c create mode 100644 tests/data/data1420.c create mode 100644 tests/data/data1465.c create mode 100644 tests/data/data1481.c diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 90a249fac2d2..c655a4d863d3 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -115,7 +115,8 @@ the include instruction: %include filename% Or, a variant of the above where the file is loaded as a newline-agnostic -text file, and `%CR`, `%SP`, `%TAB` macros are expanded after inclusion: +text file, and whitespace, special character macros and variables expanded +after inclusion: %includetext filename% diff --git a/scripts/checksrc-all.pl b/scripts/checksrc-all.pl index 08ff6cfbf5fb..764895148e50 100755 --- a/scripts/checksrc-all.pl +++ b/scripts/checksrc-all.pl @@ -22,6 +22,7 @@ } @files = grep !/\/CMakeFiles\//, @files; +@files = grep !/tests\/data\/data.+\.c/, @files; @files = map { dirname($_) } @files; my @dirs = sort { $a cmp $b } keys %{{ map { $_ => 1 } @files }}; diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 18c6969391be..910dbd69915a 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -283,4 +283,6 @@ test3200 test3201 test3202 test3203 test3204 test3205 test3206 test3207 test3208 test3209 test3210 test3211 test3212 test3213 test3214 test3215 test3216 \ test4000 test4001 -EXTRA_DIST = $(TESTCASES) DISABLED data-xml1 +EXTRA_DIST = $(TESTCASES) DISABLED data-xml1 \ +data1400.c data1401.c data1402.c data1403.c data1404.c data1405.c data1406.c \ +data1407.c data1420.c data1465.c data1481.c diff --git a/tests/data/data1400.c b/tests/data/data1400.c new file mode 100644 index 000000000000..8aeb3c8fc88b --- /dev/null +++ b/tests/data/data1400.c @@ -0,0 +1,46 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1401.c b/tests/data/data1401.c new file mode 100644 index 000000000000..dfea0bb673e7 --- /dev/null +++ b/tests/data/data1401.c @@ -0,0 +1,58 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + struct curl_slist *slist1; + + slist1 = NULL; + slist1 = curl_slist_append(slist1, "X-Files: Mulder"); + slist1 = curl_slist_append(slist1, "X-Men: cyclops, iceman"); + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user"); + curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC); + curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "MyUA"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_COOKIE, "chocolate=chip"); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + curl_easy_setopt(hnd, CURLOPT_PROTOCOLS_STR, "file,ftp,http"); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + curl_slist_free_all(slist1); + slist1 = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1402.c b/tests/data/data1402.c new file mode 100644 index 000000000000..917b4aa82290 --- /dev/null +++ b/tests/data/data1402.c @@ -0,0 +1,48 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux"); + curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1403.c b/tests/data/data1403.c new file mode 100644 index 000000000000..38226573cde4 --- /dev/null +++ b/tests/data/data1403.c @@ -0,0 +1,46 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER\?foo=bar&baz=quux"); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1404.c b/tests/data/data1404.c new file mode 100644 index 000000000000..24b68adb064d --- /dev/null +++ b/tests/data/data1404.c @@ -0,0 +1,83 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + curl_mime *mime1; + curl_mimepart *part1; + curl_mime *mime2; + curl_mimepart *part2; + struct curl_slist *slist1; + + mime1 = NULL; + mime2 = NULL; + slist1 = NULL; + slist1 = curl_slist_append(slist1, "X-testheader-1: header 1"); + slist1 = curl_slist_append(slist1, "X-testheader-2: header 2"); + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); + mime1 = curl_mime_init(hnd); + part1 = curl_mime_addpart(mime1); + curl_mime_data(part1, "value", CURL_ZERO_TERMINATED); + curl_mime_name(part1, "name"); + part1 = curl_mime_addpart(mime1); + mime2 = curl_mime_init(hnd); + part2 = curl_mime_addpart(mime2); + curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt"); + part2 = curl_mime_addpart(mime2); + curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt"); + curl_mime_encoder(part2, "8bit"); + curl_mime_type(part2, "magic/content"); + part2 = curl_mime_addpart(mime2); + curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt"); + curl_mime_headers(part2, slist1, 1); + slist1 = NULL; + curl_mime_subparts(part1, mime2); + mime2 = NULL; + curl_mime_name(part1, "file"); + curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime1); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + curl_mime_free(mime1); + mime1 = NULL; + curl_mime_free(mime2); + mime2 = NULL; + curl_slist_free_all(slist1); + slist1 = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1405.c b/tests/data/data1405.c new file mode 100644 index 000000000000..e80b77eddad2 --- /dev/null +++ b/tests/data/data1405.c @@ -0,0 +1,66 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + struct curl_slist *slist1; + struct curl_slist *slist2; + struct curl_slist *slist3; + + slist1 = NULL; + slist1 = curl_slist_append(slist1, "NOOP 1"); + slist1 = curl_slist_append(slist1, "*FAIL"); + slist2 = NULL; + slist2 = curl_slist_append(slist2, "NOOP 3"); + slist3 = NULL; + slist3 = curl_slist_append(slist3, "NOOP 2"); + slist3 = curl_slist_append(slist3, "*FAIL HARD"); + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L); + curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1); + curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, slist2); + curl_easy_setopt(hnd, CURLOPT_PREQUOTE, slist3); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + curl_slist_free_all(slist1); + slist1 = NULL; + curl_slist_free_all(slist2); + slist2 = NULL; + curl_slist_free_all(slist3); + slist3 = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1406.c b/tests/data/data1406.c new file mode 100644 index 000000000000..b71dffa88f5a --- /dev/null +++ b/tests/data/data1406.c @@ -0,0 +1,56 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + struct curl_slist *slist1; + + slist1 = NULL; + slist1 = curl_slist_append(slist1, "recipient.one@example.com"); + slist1 = curl_slist_append(slist1, "recipient.two@example.com"); + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, "sender@example.com"); + curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, slist1); + curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + curl_slist_free_all(slist1); + slist1 = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1407.c b/tests/data/data1407.c new file mode 100644 index 000000000000..f1d2b30f0f0b --- /dev/null +++ b/tests/data/data1407.c @@ -0,0 +1,46 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L); + curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret"); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1420.c b/tests/data/data1420.c new file mode 100644 index 000000000000..8405d8ba4c94 --- /dev/null +++ b/tests/data/data1420.c @@ -0,0 +1,46 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1"); + curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret"); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1465.c b/tests/data/data1465.c new file mode 100644 index 000000000000..09e13f28d564 --- /dev/null +++ b/tests/data/data1465.c @@ -0,0 +1,48 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); + curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "ab\201cd\000e\\\"\?\r\n\t\001fghi\x1ajklm\xfd"); + curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)24); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/data1481.c b/tests/data/data1481.c new file mode 100644 index 000000000000..b8741c0d95bc --- /dev/null +++ b/tests/data/data1481.c @@ -0,0 +1,49 @@ +/********* Sample code generated by the curl command line tool ********** + * All curl_easy_setopt() options are documented at: + * https://curl.se/libcurl/c/curl_easy_setopt.html + ************************************************************************/ +#include + +int main(int argc, char *argv[]) +{ + CURLcode ret; + CURL *hnd; + + hnd = curl_easy_init(); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); + curl_easy_setopt(hnd, CURLOPT_URL, "http://moo/"); + curl_easy_setopt(hnd, CURLOPT_PROXY, "http://%HOSTIP:%HTTPPORT"); + curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); + curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_SSLVERSION, (long)(CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_3)); + curl_easy_setopt(hnd, CURLOPT_PROXY_SSLVERSION, (long)CURL_SSLVERSION_TLSv1); + curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); + + /* Here is a list of options the curl code used that cannot get generated + as source easily. You may choose to either not use them or implement + them yourself. + + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_WRITEDATA was set to an object pointer + CURLOPT_WRITEFUNCTION was set to a function pointer + CURLOPT_READDATA was set to an object pointer + CURLOPT_READFUNCTION was set to a function pointer + CURLOPT_SEEKDATA was set to an object pointer + CURLOPT_SEEKFUNCTION was set to a function pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA was set to an object pointer + CURLOPT_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + + */ + + ret = curl_easy_perform(hnd); + + curl_easy_cleanup(hnd); + hnd = NULL; + + return (int)ret; +} +/**** End of sample code ****/ diff --git a/tests/data/test1400 b/tests/data/test1400 index 9c54240c2f1a..5b7758fae8f2 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -4,7 +4,6 @@ HTTP HTTP GET --libcurl -notxml @@ -49,7 +48,6 @@ Accept: */* -s/(USERAGENT, \")[^\"]+/${1}stripped/ # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with # CURLOPT_INTERLEAVEDATA requires RTSP protocol # configurations - just ignore them @@ -62,52 +60,7 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1400.c% diff --git a/tests/data/test1401 b/tests/data/test1401 index e2f51f39112b..87ed2e4543f6 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -7,7 +7,6 @@ HTTP Basic auth HTTP set cookie cookies --libcurl -notxml @@ -71,64 +70,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - struct curl_slist *slist1; - - slist1 = NULL; - slist1 = curl_slist_append(slist1, "X-Files: Mulder"); - slist1 = curl_slist_append(slist1, "X-Men: cyclops, iceman"); - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user"); - curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC); - curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "MyUA"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_COOKIE, "chocolate=chip"); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - curl_easy_setopt(hnd, CURLOPT_PROTOCOLS_STR, "file,ftp,http"); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - curl_slist_free_all(slist1); - slist1 = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1401.c% diff --git a/tests/data/test1402 b/tests/data/test1402 index 77c0798da287..86eb102045e5 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -53,8 +53,6 @@ Content-Type: application/x-www-form-urlencoded foo=bar&baz=quux -# curl's default user-agent varies with version, libraries etc. -s/(USERAGENT, \")[^\"]+/${1}stripped/ # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with # configurations - just ignore them $_ = '' if /CURLOPT_SSL_VERIFYPEER/ @@ -65,54 +63,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux"); - curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1402.c% diff --git a/tests/data/test1403 b/tests/data/test1403 index 94ada0fdd9cd..6627b70aa1f3 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -50,8 +50,6 @@ Accept: */* -# curl's default user-agent varies with version, libraries etc. -s/(USERAGENT, \")[^\"]+/${1}stripped/ # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with # configurations - just ignore them $_ = '' if /CURLOPT_SSL_VERIFYPEER/ @@ -62,52 +60,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER\?foo=bar&baz=quux"); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1403.c% diff --git a/tests/data/test1404 b/tests/data/test1404 index 3ffcde893903..4471101246c0 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -6,7 +6,6 @@ HTTP HTTP FORMPOST HTTP file upload --libcurl -notxml @@ -95,8 +94,6 @@ dummy data ------------------------------9ef8d6205763--%CR -# curl's default user-agent varies with version, libraries etc. -s/(USERAGENT, \")[^\"]+/${1}stripped/ # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with # configurations - just ignore them $_ = '' if /CURLOPT_SSL_VERIFYPEER/ @@ -109,89 +106,7 @@ $_ = '' if /CURLOPT_TIMEOUT_MS/ $_ = '' if /\/\* "value" \*\// -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - curl_mime *mime1; - curl_mimepart *part1; - curl_mime *mime2; - curl_mimepart *part2; - struct curl_slist *slist1; - - mime1 = NULL; - mime2 = NULL; - slist1 = NULL; - slist1 = curl_slist_append(slist1, "X-testheader-1: header 1"); - slist1 = curl_slist_append(slist1, "X-testheader-2: header 2"); - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); - mime1 = curl_mime_init(hnd); - part1 = curl_mime_addpart(mime1); - curl_mime_data(part1, "value", CURL_ZERO_TERMINATED); - curl_mime_name(part1, "name"); - part1 = curl_mime_addpart(mime1); - mime2 = curl_mime_init(hnd); - part2 = curl_mime_addpart(mime2); - curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt"); - part2 = curl_mime_addpart(mime2); - curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt"); - curl_mime_encoder(part2, "8bit"); - curl_mime_type(part2, "magic/content"); - part2 = curl_mime_addpart(mime2); - curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt"); - curl_mime_headers(part2, slist1, 1); - slist1 = NULL; - curl_mime_subparts(part1, mime2); - mime2 = NULL; - curl_mime_name(part1, "file"); - curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime1); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - curl_mime_free(mime1); - mime1 = NULL; - curl_mime_free(mime2); - mime2 = NULL; - curl_slist_free_all(slist1); - slist1 = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1404.c% diff --git a/tests/data/test1405 b/tests/data/test1405 index 84ccd6a0fb59..880f345e7270 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -6,7 +6,6 @@ FTP post-quote pre-quote --libcurl -notxml # Server-side @@ -62,74 +61,6 @@ RETR %TESTNUMBER NOOP 3 QUIT - -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - struct curl_slist *slist1; - struct curl_slist *slist2; - struct curl_slist *slist3; - - slist1 = NULL; - slist1 = curl_slist_append(slist1, "NOOP 1"); - slist1 = curl_slist_append(slist1, "*FAIL"); - slist2 = NULL; - slist2 = curl_slist_append(slist2, "NOOP 3"); - slist3 = NULL; - slist3 = curl_slist_append(slist3, "NOOP 2"); - slist3 = curl_slist_append(slist3, "*FAIL HARD"); - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L); - curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1); - curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, slist2); - curl_easy_setopt(hnd, CURLOPT_PREQUOTE, slist3); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - curl_slist_free_all(slist1); - slist1 = NULL; - curl_slist_free_all(slist2); - slist2 = NULL; - curl_slist_free_all(slist3); - slist3 = NULL; - - return (int)ret; -} -/**** End of sample code ****/ - # CURLOPT_USERAGENT and CURLOPT_MAXREDIRS requires HTTP protocol # CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol @@ -146,5 +77,8 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ + +%includetext %SRCDIR/data/data1405.c% + diff --git a/tests/data/test1406 b/tests/data/test1406 index 776c880dad67..0dfa41839b17 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -5,7 +5,6 @@ SMTP --libcurl -notxml @@ -63,67 +62,9 @@ To: another body . - -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - struct curl_slist *slist1; - - slist1 = NULL; - slist1 = curl_slist_append(slist1, "recipient.one@example.com"); - slist1 = curl_slist_append(slist1, "recipient.two@example.com"); - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, "sender@example.com"); - curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, slist1); - curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - curl_slist_free_all(slist1); - slist1 = NULL; - - return (int)ret; -} -/**** End of sample code ****/ - # These options vary with configurations - just ignore them # CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol -$_ = '' if /CURLOPT_USERAGENT/ $_ = '' if /CURLOPT_MAXREDIRS/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ @@ -133,5 +74,8 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ + +%includetext %SRCDIR/data/data1406.c% + diff --git a/tests/data/test1407 b/tests/data/test1407 index f767622b0b04..300b5efdaea3 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -6,7 +6,6 @@ POP3 Clear Text LIST --libcurl -notxml @@ -50,56 +49,9 @@ PASS secret LIST %TESTNUMBER QUIT - -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L); - curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret"); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ - # These options vary with configurations - just ignore them +# CURLOPT_USERAGENT and CURLOPT_MAXREDIRS requires HTTP protocol # CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol $_ = '' if /CURLOPT_USERAGENT/ $_ = '' if /CURLOPT_MAXREDIRS/ @@ -111,5 +63,8 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ + +%includetext %SRCDIR/data/data1407.c% + diff --git a/tests/data/test1420 b/tests/data/test1420 index 22d918acf521..530cf985bd2c 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -6,7 +6,6 @@ IMAP Clear Text FETCH --libcurl -notxml @@ -56,57 +55,9 @@ A003 SELECT %TESTNUMBER A004 FETCH 1 BODY[] A005 LOGOUT - -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1"); - curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret"); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ - # These options vary with configurations - just ignore them # CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol -$_ = '' if /CURLOPT_USERAGENT/ $_ = '' if /CURLOPT_MAXREDIRS/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ @@ -115,5 +66,8 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ + +%includetext %SRCDIR/data/data1420.c% + diff --git a/tests/data/test1465 b/tests/data/test1465 index b9e85535bac0..0026ae383122 100644 --- a/tests/data/test1465 +++ b/tests/data/test1465 @@ -4,7 +4,6 @@ HTTP HTTP POST --libcurl -notxml @@ -57,7 +56,6 @@ Content-Type: application/x-www-form-urlencoded %hex[ab%81cd%00e\"?%0D%0A%09%01fghi%1Ajklm%FD]hex% - # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with # configurations - just ignore them $_ = '' if /CURLOPT_SSL_VERIFYPEER/ @@ -68,54 +66,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER"); - curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "ab\201cd\000e\\\"\?\r\n\t\001fghi\x1ajklm\xfd"); - curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)24); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1465.c% diff --git a/tests/data/test1481 b/tests/data/test1481 index 30b6d420e1e7..a3e259545047 100644 --- a/tests/data/test1481 +++ b/tests/data/test1481 @@ -4,7 +4,6 @@ HTTP HTTP GET --libcurl -notxml @@ -52,7 +51,6 @@ Proxy-Connection: Keep-Alive -s/(USERAGENT, \")[^\"]+/${1}stripped/ # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with # CURLOPT_INTERLEAVEDATA requires RTSP protocol # configurations - just ignore them @@ -64,55 +62,7 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -/********* Sample code generated by the curl command line tool ********** - * All curl_easy_setopt() options are documented at: - * https://curl.se/libcurl/c/curl_easy_setopt.html - ************************************************************************/ -#include - -int main(int argc, char *argv[]) -{ - CURLcode ret; - CURL *hnd; - - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); - curl_easy_setopt(hnd, CURLOPT_URL, "http://moo/"); - curl_easy_setopt(hnd, CURLOPT_PROXY, "http://%HOSTIP:%HTTPPORT"); - curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); - curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_SSLVERSION, (long)(CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_3)); - curl_easy_setopt(hnd, CURLOPT_PROXY_SSLVERSION, (long)CURL_SSLVERSION_TLSv1); - curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); - - /* Here is a list of options the curl code used that cannot get generated - as source easily. You may choose to either not use them or implement - them yourself. - - CURLOPT_DEBUGFUNCTION was set to a function pointer - CURLOPT_DEBUGDATA was set to an object pointer - CURLOPT_WRITEDATA was set to an object pointer - CURLOPT_WRITEFUNCTION was set to a function pointer - CURLOPT_READDATA was set to an object pointer - CURLOPT_READFUNCTION was set to a function pointer - CURLOPT_SEEKDATA was set to an object pointer - CURLOPT_SEEKFUNCTION was set to a function pointer - CURLOPT_HEADERFUNCTION was set to a function pointer - CURLOPT_HEADERDATA was set to an object pointer - CURLOPT_ERRORBUFFER was set to an object pointer - CURLOPT_STDERR was set to an object pointer - - */ - - ret = curl_easy_perform(hnd); - - curl_easy_cleanup(hnd); - hnd = NULL; - - return (int)ret; -} -/**** End of sample code ****/ +%includetext %SRCDIR/data/data1481.c% diff --git a/tests/runner.pm b/tests/runner.pm index 10be04bd4b49..97c62023dddb 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -101,6 +101,8 @@ use testutil qw( logmsg runclient exerunner + subtextfile + subchars subbase64 subsha256base64file substrippemfile @@ -367,6 +369,10 @@ sub prepro { $data_crlf = ""; } subvariables(\$s, $testnum, "%"); + if(subtextfile(\$s)) { + subvariables(\$s, $testnum, "%"); + } + subchars(\$s); subbase64(\$s); subsha256base64file(\$s); substrippemfile(\$s); diff --git a/tests/testutil.pm b/tests/testutil.pm index 4666770f072d..80479a0c7524 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -38,6 +38,8 @@ BEGIN { runclientoutput setlogfunc exerunner + subtextfile + subchars subbase64 subnewlines subsha256base64file @@ -110,6 +112,25 @@ sub includefile { return join("", @a); } +sub subtextfile { + my ($thing) = @_; + + my $count = ($$thing =~ s/%includetext ([^%]*)%[\n\r]+/includefile($1, 1)/ge); + + return $count > 0; +} + +sub subchars { + my ($thing) = @_; + + $$thing =~ s/%SP/ /g; # space + $$thing =~ s/%TAB/\t/g; # horizontal tab + $$thing =~ s/%CR/\r/g; # carriage return aka \r aka 0x0d + $$thing =~ s/%LT//g; + $$thing =~ s/%AMP/&/g; +} + sub subbase64 { my ($thing) = @_; @@ -150,16 +171,6 @@ sub subbase64 { $$thing =~ s/%%DAYS%%/%alternatives[$d,$d2]/; } - # include a file, expand space macros - $$thing =~ s/%includetext ([^%]*)%[\n\r]+/includefile($1, 1)/ge; - - $$thing =~ s/%SP/ /g; # space - $$thing =~ s/%TAB/\t/g; # horizontal tab - $$thing =~ s/%CR/\r/g; # carriage return aka \r aka 0x0d - $$thing =~ s/%LT//g; - $$thing =~ s/%AMP/&/g; - # include a file $$thing =~ s/%include ([^%]*)%[\n\r]+/includefile($1, 0)/ge; } From cce660693ceddd6006b5775de8e97f1d5a6434d7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 01:46:06 +0100 Subject: [PATCH 707/885] tests/data: use more `%TESTNUMBER` macro for previous patch Follow-up to d75716e4e55c7074566f48d8c03bfd721461e105 #19799 Cherry-picked from #19882 Closes #19885 --- tests/data/test1400 | 2 +- tests/data/test1401 | 2 +- tests/data/test1402 | 2 +- tests/data/test1403 | 2 +- tests/data/test1404 | 2 +- tests/data/test1405 | 2 +- tests/data/test1406 | 2 +- tests/data/test1407 | 2 +- tests/data/test1420 | 2 +- tests/data/test1465 | 2 +- tests/data/test1481 | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/data/test1400 b/tests/data/test1400 index 5b7758fae8f2..289f35720891 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -60,7 +60,7 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1400.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1401 b/tests/data/test1401 index 87ed2e4543f6..c66517c414c7 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -70,7 +70,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1401.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1402 b/tests/data/test1402 index 86eb102045e5..401daa3ba5b7 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -63,7 +63,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1402.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1403 b/tests/data/test1403 index 6627b70aa1f3..2a9cba0bed15 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -60,7 +60,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1403.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1404 b/tests/data/test1404 index 4471101246c0..173214c8c120 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -106,7 +106,7 @@ $_ = '' if /CURLOPT_TIMEOUT_MS/ $_ = '' if /\/\* "value" \*\// -%includetext %SRCDIR/data/data1404.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1405 b/tests/data/test1405 index 880f345e7270..5464d6ad316e 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -78,7 +78,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1405.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1406 b/tests/data/test1406 index 0dfa41839b17..83319c07d9e7 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -75,7 +75,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1406.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1407 b/tests/data/test1407 index 300b5efdaea3..b2da0479ae42 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -64,7 +64,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1407.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1420 b/tests/data/test1420 index 530cf985bd2c..6194d81e8119 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -67,7 +67,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1420.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1465 b/tests/data/test1465 index 0026ae383122..58f202499f4e 100644 --- a/tests/data/test1465 +++ b/tests/data/test1465 @@ -66,7 +66,7 @@ $_ = '' if /CURLOPT_SSLVERSION/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1465.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% diff --git a/tests/data/test1481 b/tests/data/test1481 index a3e259545047..490206895595 100644 --- a/tests/data/test1481 +++ b/tests/data/test1481 @@ -62,7 +62,7 @@ $_ = '' if /CURLOPT_INTERLEAVEDATA/ $_ = '' if /CURLOPT_TIMEOUT_MS/ -%includetext %SRCDIR/data/data1481.c% +%includetext %SRCDIR/data/data%TESTNUMBER.c% From 86f5bd3c6e67809e4feac4df42e422c54277df05 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 21 Aug 2025 13:59:46 +0200 Subject: [PATCH 708/885] curl_setup.h: fix `FMT_SOCKET_T` to be unsigned on Windows To match the Windows socket type. Ref: https://learn.microsoft.com/windows/win32/winsock/socket-data-type-2 Cherry-picked from #18343 Closes #19881 --- lib/curl_setup.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index c4be90b655e0..829650aee4d4 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -519,9 +519,13 @@ #endif #if SIZEOF_CURL_SOCKET_T < 8 +#ifdef _WIN32 +# define FMT_SOCKET_T "u" +#else # define FMT_SOCKET_T "d" -#elif defined(__MINGW32__) -# define FMT_SOCKET_T "zd" +#endif +#elif defined(_WIN32) +# define FMT_SOCKET_T "zu" #else # define FMT_SOCKET_T "qd" #endif From bf70031518ee1e0d222246edf308585fb692371b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Dec 2025 09:23:35 +0100 Subject: [PATCH 709/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 64 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 11 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index af81fffb902f..d34291718ae4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3556 + Contributors: 3557 This release includes the following changes: @@ -17,10 +17,12 @@ This release includes the following changes: This release includes the following bugfixes: o _PROGRESS.md: add the E unit, mention kibibyte [24] + o altsvc: make it one malloc instead of three per entry [266] o AmigaOS: increase minimum stack size for tool_main [137] o apple-sectrust: always ask when `native_ca_store` is in use [162] o asyn-ares: handle Curl_dnscache_mk_entry() OOM error [199] o asyn-ares: remove hostname free on OOM [122] + o asyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo [265] o asyn-thrdd: release rrname if ares_init_options fails [41] o auth: always treat Curl_auth_ntlm_get() returning NULL as OOM [186] o autotools: add nettle library detection via pkg-config (for GnuTLS) [178] @@ -51,8 +53,11 @@ This release includes the following bugfixes: o conncontrol: reuse handling [170] o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100] o connection: attached transfer count [228] + o cookie: allocate the main struct once cookie is fine [259] + o cookie: only keep and use the canonical cleaned up path [256] o cookie: propagate errors better, cleanup the internal API [118] o cookie: return error on OOM [131] + o cookie: when parsing a cookie header, delay all allocations until okay [258] o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25] o curl: fix progress meter in parallel mode [15] o curl_fopen: do not pass invalid mode flags to `open()` on Windows [84] @@ -77,6 +82,7 @@ This release includes the following bugfixes: o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] o DISTROS.md: add OpenBSD [126] + o DISTROS: fix a Mageia URL o DISTROS: remove broken URLs for buildroot o doc: some returned in-memory data may not be altered [196] o docs/libcurl: fix C formatting nits [207] @@ -85,6 +91,7 @@ This release includes the following bugfixes: o docs: mention umask need when curl creates files [56] o docs: remove dead URLs o docs: spell it Rustls with a capital R [181] + o docs: switch more URLs to https:// [229] o docs: use .example URLs for proxies o example: fix formatting nits [232] o examples/crawler: fix variable [92] @@ -95,23 +102,29 @@ This release includes the following bugfixes: o examples: tidy-up headers and includes [138] o FAQ: fix hackerone URL o file: do not pass invalid mode flags to `open()` on upload (Windows) [83] + o formdata: validate callback is non-NULL before use [267] + o ftp: make EPRT connections non-blocking [268] o ftp: refactor a piece of code by merging the repeated part [40] o ftp: remove #ifdef for define that is always defined [76] o getinfo: improve perf in debug mode [99] + o gnutls: add PROFILE_MEDIUM as default [233] o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] o gtls: skip session resumption when verifystatus is set o h2/h3: handle methods with spaces [146] + o hostcheck: fail wildcard match if host starts with a dot [235] o hostip: don't store negative lookup on OOM [61] o hostip: make more functions return CURLcode [202] o hostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST [183] o hsts: propagate and error out correctly on OOM [130] + o hsts: use one malloc instead of two per entry [263] o http: acknowledge OOM errors from Curl_input_ntlm [185] o http: avoid two strdup()s and do minor simplifications [144] o http: error on OOM when creating range header [59] o http: fix OOM exit in Curl_http_follow [179] o http: handle oom error from Curl_input_digest() [192] o http: replace atoi use in Curl_http_follow with curlx_str_number [65] + o http: return OOM errors from hsts properly [262] o http: the :authority header should never contain user+password [147] o idn: avoid allocations and wcslen on Windows [247] o idn: fix memory leak in `win32_ascii_to_idn()` [173] @@ -147,7 +160,9 @@ This release includes the following bugfixes: o mbedtls: fix potential use of uninitialized `nread` [8] o mbedtls: sync format across log messages [213] o mbedtls_threadlock: avoid calloc, use array [244] + o mdlinkcheck: ignore IP numbers, allow '@' in raw URLs o memdebug: add mutex for thread safety [184] + o mk-ca-bundle.md: the file format docs URL is permaredirected [188] o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] @@ -156,6 +171,7 @@ This release includes the following bugfixes: o multibyte: limit `curlx_convert_*wchar*()` functions to Unicode builds [135] o ngtcp2+openssl: fix leak of session [172] o ngtcp2: remove the unused Curl_conn_is_ngtcp2 function [85] + o noproxy: fix build on systems without IPv6 [264] o noproxy: fix ipv6 handling [239] o noproxy: replace atoi with curlx_str_number [67] o openssl: exit properly on OOM when getting certchain [133] @@ -180,6 +196,7 @@ This release includes the following bugfixes: o rtmp: fix double-free on URL parse errors [27] o rtmp: precaution for a potential integer truncation [54] o rtmp: stop redefining `setsockopt` system symbol on Windows [211] + o runner.pm: run memanalyzer as a Perl module [260] o runtests: detect bad libssh differently for test 1459 [11] o runtests: drop Python 2 support remains [45] o runtests: enable torture testing with threaded resolver [176] @@ -203,15 +220,18 @@ This release includes the following bugfixes: o speedlimit: also reset on send unpausing [197] o src: fix formatting nits [246] o ssh: tracing and better pollset handling [230] + o sspi: fix memory leaks on error paths in `Curl_create_sspi_identity()` [237] o sws: fix binding to unix socket on Windows [214] o telnet: replace atoi for BINARY handling with curlx_str_number [66] o TEST-SUITE.md: correct the man page's path [136] o test07_22: fix flakiness [95] + o test1475: consistently use %CR in headers [234] o test1498: disable 'HTTP PUT from stdin' test on Windows [115] o test2045: replace HTML multi-line comment markup with `#` comments [36] o test3207: enable memdebug for this test again [249] o test363: delete stray character (typo) from a section tag [52] o test787: fix possible typo `&` -> `%` in curl option [241] + o tests/data: move `--libcurl` output to external data files [34] o tests/data: replace hard-coded test numbers with `%TESTNUMBER` [33] o tests/data: support using native newlines on disk, drop `.gitattributes` [91] o tests/server: do not fall back to original data file in `test2fopen()` [32] @@ -223,6 +243,7 @@ This release includes the following bugfixes: o tftpd: fix/tidy up `open()` mode flags [57] o tidy-up: avoid `(())`, clang-format fixes and more [141] o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] + o tidy-up: URLs [182] o TODO: remove a mandriva.com reference o tool: consider (some) curl_easy_setopt errors fatal [7] o tool: log when loading .curlrc in verbose mode [191] @@ -260,6 +281,7 @@ This release includes the following bugfixes: o wolfssl: avoid NULL dereference in OOM situation [77] o wolfssl: fix a potential memory leak of session [6] o wolfssl: fix cipher list, skip 5.8.4 regression [117] + o wolfssl: fix possible assert with `!HAVE_NO_EX` wolfSSL builds [261] o wolfssl: simplify wssl_send_earlydata [111] This release includes the following known bugs: @@ -284,16 +306,16 @@ advice from friends like these: Aleksandr Sergeev, Aleksei Bavshin, Andrew Kirillov, BANADDA, boingball, Brad King, bttrfl on github, Christian Schmitz, Dan Fandrich, - Daniel McCarney, Daniel Stenberg, Deniz Parlak, Fd929c2CE5fA on github, - ffath-vo on github, Georg Schulz-Allgaier, Gisle Vanem, Greg Hudson, - Jiyong Yang, Juliusz Sosinowicz, Kai Pastor, Leonardo Taccari, - letshack9707 on hackerone, Marc Aldorasi, Marcel Raad, Max Faxälv, - nait-furry, ncaklovic on github, Nick Korepanov, Omdahake on github, - Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot], - Samuel Henrique, st751228051 on github, Stanislav Fort, Stefan Eissing, - Sunny, Theo Buehler, Thomas Klausner, Viktor Szakats, Wesley Moore, - Xiaoke Wang, Yedaya Katsman - (44 contributors) + Daniel McCarney, Daniel Stenberg, Denis Goleshchikhin, Deniz Parlak, + dependabot[bot], Fabian Keil, Fd929c2CE5fA on github, ffath-vo on github, + Georg Schulz-Allgaier, Gisle Vanem, Greg Hudson, Harry Sintonen, Jiyong Yang, + Juliusz Sosinowicz, Kai Pastor, Leonardo Taccari, letshack9707 on hackerone, + Marc Aldorasi, Marcel Raad, Max Faxälv, nait-furry, ncaklovic on github, + Nick Korepanov, Omdahake on github, Patrick Monnerat, pelioro on hackerone, + Ray Satiro, renovate[bot], Robert W. Van Kirk, Samuel Henrique, + st751228051 on github, Stanislav Fort, Stefan Eissing, Sunny, Theo Buehler, + Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang, Yedaya Katsman + (49 contributors) References to bug reports and discussions on issues: @@ -330,6 +352,7 @@ References to bug reports and discussions on issues: [31] = https://curl.se/bug/?i=19716 [32] = https://curl.se/bug/?i=19429 [33] = https://curl.se/bug/?i=19427 + [34] = https://curl.se/bug/?i=19799 [35] = https://curl.se/bug/?i=19420 [36] = https://curl.se/bug/?i=19498 [37] = https://curl.se/bug/?i=19419 @@ -477,11 +500,13 @@ References to bug reports and discussions on issues: [179] = https://curl.se/bug/?i=19705 [180] = https://curl.se/bug/?i=19704 [181] = https://curl.se/bug/?i=19702 + [182] = https://curl.se/bug/?i=19879 [183] = https://curl.se/bug/?i=19701 [184] = https://curl.se/bug/?i=19785 [185] = https://curl.se/bug/?i=19781 [186] = https://curl.se/bug/?i=19782 [187] = https://curl.se/bug/?i=19164 + [188] = https://curl.se/bug/?i=19877 [189] = https://curl.se/bug/?i=19604 [190] = https://curl.se/bug/?i=19269 [191] = https://curl.se/bug/?i=19663 @@ -518,9 +543,14 @@ References to bug reports and discussions on issues: [225] = https://curl.se/bug/?i=19754 [226] = https://curl.se/bug/?i=19751 [228] = https://curl.se/bug/?i=19836 + [229] = https://curl.se/bug/?i=19872 [230] = https://curl.se/bug/?i=19745 [232] = https://curl.se/bug/?i=19746 + [233] = https://curl.se/bug/?i=19853 + [234] = https://curl.se/bug/?i=19870 + [235] = https://curl.se/bug/?i=19869 [236] = https://curl.se/bug/?i=19830 + [237] = https://curl.se/bug/?i=19866 [238] = https://curl.se/bug/?i=19786 [239] = https://curl.se/bug/?i=19828 [240] = https://curl.se/bug/?i=19829 @@ -538,4 +568,16 @@ References to bug reports and discussions on issues: [253] = https://curl.se/bug/?i=19800 [254] = https://curl.se/bug/?i=19808 [255] = https://curl.se/bug/?i=19803 + [256] = https://curl.se/bug/?i=19864 [257] = https://curl.se/bug/?i=19802 + [258] = https://curl.se/bug/?i=19864 + [259] = https://curl.se/bug/?i=19864 + [260] = https://curl.se/bug/?i=19863 + [261] = https://curl.se/bug/?i=19816 + [262] = https://curl.se/bug/?i=19862 + [263] = https://curl.se/bug/?i=19861 + [264] = https://curl.se/bug/?i=19860 + [265] = https://github.com/curl/curl/commit/ce06fe7771052549ff430c86173b2eaca91f8a9c#r172215567 + [266] = https://curl.se/bug/?i=19857 + [267] = https://curl.se/bug/?i=19858 + [268] = https://curl.se/bug/?i=19753 From 70d71e8761843ac81e388f15b373bd025d77a4dc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 01:15:29 +0100 Subject: [PATCH 710/885] tests/data: move section data to external files To make the test files XML-compliant, and the expected results possibly easier to manage by keeping them in `.md`, `.html`, `.1` and `.txt` files. Non-XML-compliant files are down to 31 (1.6%) after this patch. Closes #19882 --- .github/scripts/pyspelling.yaml | 2 +- .github/scripts/spacecheck.pl | 1 + tests/data/Makefile.am | 7 +- tests/data/data1461.txt | 21 +++ tests/data/data1463.txt | 5 + tests/data/data1705-1.md | 11 ++ tests/data/data1705-2.md | 40 +++++ tests/data/data1705-3.md | 48 ++++++ tests/data/data1705-4.md | 22 +++ tests/data/data1705-stdout.1 | 126 ++++++++++++++++ tests/data/data1706-1.md | 11 ++ tests/data/data1706-2.md | 36 +++++ tests/data/data1706-3.md | 48 ++++++ tests/data/data1706-4.md | 22 +++ tests/data/data1706-stdout.txt | 116 +++++++++++++++ tests/data/data320.html | 20 +++ tests/data/test1461 | 23 +-- tests/data/test1463 | 7 +- tests/data/test1464 | 6 +- tests/data/test1705 | 253 +------------------------------- tests/data/test1706 | 239 +----------------------------- tests/data/test320 | 26 +--- 22 files changed, 547 insertions(+), 543 deletions(-) create mode 100644 tests/data/data1461.txt create mode 100644 tests/data/data1463.txt create mode 100644 tests/data/data1705-1.md create mode 100644 tests/data/data1705-2.md create mode 100644 tests/data/data1705-3.md create mode 100644 tests/data/data1705-4.md create mode 100644 tests/data/data1705-stdout.1 create mode 100644 tests/data/data1706-1.md create mode 100644 tests/data/data1706-2.md create mode 100644 tests/data/data1706-3.md create mode 100644 tests/data/data1706-4.md create mode 100644 tests/data/data1706-stdout.txt create mode 100644 tests/data/data320.html diff --git a/.github/scripts/pyspelling.yaml b/.github/scripts/pyspelling.yaml index 8e26b76189bc..bb0585ab7ab8 100644 --- a/.github/scripts/pyspelling.yaml +++ b/.github/scripts/pyspelling.yaml @@ -30,4 +30,4 @@ matrix: - 'strong' - 'em' sources: - - '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md' + - '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md|!tests/data/data*.md' diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl index d0776a97d1fe..2c3a2e3b0a61 100755 --- a/.github/scripts/spacecheck.pl +++ b/.github/scripts/spacecheck.pl @@ -31,6 +31,7 @@ "Makefile\\.(am|example)\$", "/mkfile", "\\.sln\$", + "^tests/data/data1706-stdout.txt", "^tests/data/test", ); diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 910dbd69915a..140d507d777a 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -283,6 +283,9 @@ test3200 test3201 test3202 test3203 test3204 test3205 test3206 test3207 test3208 test3209 test3210 test3211 test3212 test3213 test3214 test3215 test3216 \ test4000 test4001 -EXTRA_DIST = $(TESTCASES) DISABLED data-xml1 \ +EXTRA_DIST = $(TESTCASES) DISABLED data-xml1 data320.html \ +data1461.txt data1463.txt \ data1400.c data1401.c data1402.c data1403.c data1404.c data1405.c data1406.c \ -data1407.c data1420.c data1465.c data1481.c +data1407.c data1420.c data1465.c data1481.c \ +data1705-1.md data1705-2.md data1705-3.md data1705-4.md data1705-stdout.1 \ +data1706-1.md data1706-2.md data1706-3.md data1706-4.md data1706-stdout.txt diff --git a/tests/data/data1461.txt b/tests/data/data1461.txt new file mode 100644 index 000000000000..62fe8de989c7 --- /dev/null +++ b/tests/data/data1461.txt @@ -0,0 +1,21 @@ +Usage: curl [options...] + -d, --data HTTP POST data + -f, --fail Fail fast with no output on HTTP errors + -h, --help Get help for commands + -o, --output Write to file instead of stdout + -O, --remote-name Write output to file named as remote file + -i, --show-headers Show response headers in output + -s, --silent Silent mode + -T, --upload-file Transfer local FILE to destination + -u, --user Server user and password + -A, --user-agent Send User-Agent to server + -v, --verbose Make the operation more talkative + -V, --version Show version number and quit + +This is not the full help; this menu is split into categories. +Use "--help category" to get an overview of all categories, which are: +auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap,%SP +output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls,%SP +upload, verbose. +Use "--help all" to list all options +Use "--help [option]" to view documentation for a given option diff --git a/tests/data/data1463.txt b/tests/data/data1463.txt new file mode 100644 index 000000000000..830377fc0dc2 --- /dev/null +++ b/tests/data/data1463.txt @@ -0,0 +1,5 @@ +file: FILE protocol + --create-file-mode File mode for created files + -I, --head Show document info only + -l, --list-only List only mode + -r, --range Retrieve only the bytes within RANGE diff --git a/tests/data/data1705-1.md b/tests/data/data1705-1.md new file mode 100644 index 000000000000..3e06c1b38ffe --- /dev/null +++ b/tests/data/data1705-1.md @@ -0,0 +1,11 @@ + + +# DESCRIPTION + +**curl** is a tool for transferring data from or to a server using URLs. It +supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, +IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, +SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + +curl is powered by libcurl for all transfer-related features. See +*libcurl(3)* for details. diff --git a/tests/data/data1705-2.md b/tests/data/data1705-2.md new file mode 100644 index 000000000000..812862a952e5 --- /dev/null +++ b/tests/data/data1705-2.md @@ -0,0 +1,40 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: v +Long: fakeitreal +Mutexed: trace trace-ascii +Help: Make the operation more talkative +Category: important verbose global +Added: 4.0 +Multi: boolean +Scope: global +See-also: + - include + - silent + - trace + - trace-ascii +Example: + - --fakeitreal $URL +--- + +# `--verbose` + +Makes curl verbose during the operation. Useful for debugging and seeing +what's going on under the hood. A line starting with \> means header data sent +by curl, \< means header data received by curl that is hidden in normal cases, +and a line starting with * means additional info provided by curl. + +If you only want HTTP headers in the output, --include or --dump-header might +be more suitable options. + +If you think this option still does not give you enough details, consider using +--trace or --trace-ascii instead. + +Note that verbose output of curl activities and network traffic might contain +sensitive data, including usernames, credentials or secret data content. Be +aware and be careful when sharing trace logs with others. + +End with a quote + + hello diff --git a/tests/data/data1705-3.md b/tests/data/data1705-3.md new file mode 100644 index 000000000000..5041962d4045 --- /dev/null +++ b/tests/data/data1705-3.md @@ -0,0 +1,48 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proto +Arg: +Help: Enable/disable PROTOCOLS +Added: 7.20.2 +Category: connection curl +Multi: single +See-also: + - fakeitreal + - proto-default +Example: + - --proto =http,https,sftp $URL +--- + +# `--proto` + +Limit what protocols to allow for transfers. Protocols are evaluated left to +right, are comma separated, and are each a protocol name or 'all', optionally +prefixed by zero or more modifiers. Available modifiers are: + +## + +Permit this protocol in addition to protocols already permitted (this is +the default if no modifier is used). + +## - +Deny this protocol, removing it from the list of protocols already permitted. + +## = +Permit only this protocol (ignoring the list already permitted), though +subject to later modification by subsequent entries in the comma separated +list. + +## + +For example: --proto -ftps uses the default protocols, but disables ftps + +--proto -all,https,+http only enables http and https + +--proto =http,https also only enables http and https + +Unknown and disabled protocols produce a warning. This allows scripts to +safely rely on being able to disable potentially dangerous protocols, without +relying upon support for that protocol being built into curl to avoid an error. + +This option can be used multiple times, in which case the effect is the same +as concatenating the protocols into one instance of the option. diff --git a/tests/data/data1705-4.md b/tests/data/data1705-4.md new file mode 100644 index 000000000000..297b56c4b64c --- /dev/null +++ b/tests/data/data1705-4.md @@ -0,0 +1,22 @@ + + +# PROXY PROTOCOL PREFIXES +The proxy string may be specified with a protocol:// prefix to specify +alternative proxy protocols. (Added in 7.21.7) + +If no protocol is specified in the proxy string or if the string does not +match a supported one, the proxy is treated as an HTTP proxy. + +The supported proxy protocol prefixes are as follows: +## http:// +Makes it use it as an HTTP proxy. The default if no scheme prefix is used. +## https:// +Makes it treated as an **HTTPS** proxy. +## socks4:// +Makes it the equivalent of --socks4 +## socks4a:// +Makes it the equivalent of --socks4a +## socks5:// +Makes it the equivalent of --socks5 +## socks5h:// +Makes it the equivalent of --socks5-hostname diff --git a/tests/data/data1705-stdout.1 b/tests/data/data1705-stdout.1 new file mode 100644 index 000000000000..f4439a21f121 --- /dev/null +++ b/tests/data/data1705-stdout.1 @@ -0,0 +1,126 @@ +.\" ************************************************************************** +.\" * _ _ ____ _ +.\" * Project ___| | | | _ \| | +.\" * / __| | | | |_) | | +.\" * | (__| |_| | _ <| |___ +.\" * \___|\___/|_| \_\_____| +.\" * +.\" * Copyright (C) Daniel Stenberg, , et al. +.\" * +.\" * This software is licensed as described in the file COPYING, which +.\" * you should have received as part of this distribution. The terms +.\" * are also available at https://curl.se/docs/copyright.html. +.\" * +.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell +.\" * copies of the Software, and permit persons to whom the Software is +.\" * furnished to do so, under the terms of the COPYING file. +.\" * +.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +.\" * KIND, either express or implied. +.\" * +.\" * SPDX-License-Identifier: curl +.\" * +.\" ************************************************************************** +.\" +.\" DO NOT EDIT. Generated by the curl project managen man page generator. +.\" +.TH curl 1 "%DATE" "curl %VERNUM" "curl Manual" +.SH DESCRIPTION +\fBcurl\fP is a tool for transferring data from or to a server using URLs. It +supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, +IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, +SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + +curl is powered by libcurl for all transfer\-related features. See +\fIlibcurl(3)\fP for details. +.IP "\-v, \-\-fakeitreal" +Makes curl verbose during the operation. Useful for debugging and seeing +what\(aqs going on under the hood. A line starting with > means header data sent +by curl, < means header data received by curl that is hidden in normal cases, +and a line starting with * means additional info provided by curl. + +If you only want HTTP headers in the output, \fI\-\-include\fP or \fI\-\-dump\-header\fP might +be more suitable options. + +If you think this option still does not give you enough details, consider using +\fI\-\-trace\fP or \fI\-\-trace\-ascii\fP instead. + +Note that verbose output of curl activities and network traffic might contain +sensitive data, including usernames, credentials or secret data content. Be +aware and be careful when sharing trace logs with others. + +End with a quote + +.nf +hello +.fi + +This option is global and does not need to be specified for each use of \fI\-\-next\fP. + +Providing \fI\-\-fakeitreal\fP multiple times has no extra effect. +Disable it again with \-\-no-fakeitreal. + +Example: +.nf +curl --fakeitreal https://example.com +.fi + +This option is mutually exclusive with \fI\-\-trace\fP and \fI\-\-trace\-ascii\fP. +See also \fI\-\-include\fP, \fI\-\-silent\fP, \fI\-\-trace\fP and \fI\-\-trace\-ascii\fP. +.IP "\-\-proto " +Limit what protocols to allow for transfers. Protocols are evaluated left to +right, are comma separated, and are each a protocol name or \(aqall\(aq, optionally +prefixed by zero or more modifiers. Available modifiers are: +.RS +.IP + +Permit this protocol in addition to protocols already permitted (this is +the default if no modifier is used). +.IP - +Deny this protocol, removing it from the list of protocols already permitted. +.IP = +Permit only this protocol (ignoring the list already permitted), though +subject to later modification by subsequent entries in the comma separated +list. +.RE +.IP +For example: \fI\-\-proto\fP \-ftps uses the default protocols, but disables ftps + +\fI\-\-proto\fP \-all,https,+http only enables http and https + +\fI\-\-proto\fP =http,https also only enables http and https + +Unknown and disabled protocols produce a warning. This allows scripts to +safely rely on being able to disable potentially dangerous protocols, without +relying upon support for that protocol being built into curl to avoid an error. + +This option can be used multiple times, in which case the effect is the same +as concatenating the protocols into one instance of the option. + +If \fI\-\-proto\fP is provided several times, the last set value is used. + +Example: +.nf +curl --proto =http,https,sftp https://example.com +.fi + +See also \fI\-\-fakeitreal\fP and \fI\-\-proto\-default\fP. +.SH PROXY PROTOCOL PREFIXES +The proxy string may be specified with a protocol:// prefix to specify +alternative proxy protocols. + +If no protocol is specified in the proxy string or if the string does not +match a supported one, the proxy is treated as an HTTP proxy. + +The supported proxy protocol prefixes are as follows: +.IP http:// +Makes it use it as an HTTP proxy. The default if no scheme prefix is used. +.IP https:// +Makes it treated as an \fBHTTPS\fP proxy. +.IP socks4:// +Makes it the equivalent of \fI\-\-socks4\fP +.IP socks4a:// +Makes it the equivalent of \fI\-\-socks4a\fP +.IP socks5:// +Makes it the equivalent of \fI\-\-socks5\fP +.IP socks5h:// +Makes it the equivalent of \fI\-\-socks5\-hostname\fP diff --git a/tests/data/data1706-1.md b/tests/data/data1706-1.md new file mode 100644 index 000000000000..3e06c1b38ffe --- /dev/null +++ b/tests/data/data1706-1.md @@ -0,0 +1,11 @@ + + +# DESCRIPTION + +**curl** is a tool for transferring data from or to a server using URLs. It +supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, +IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, +SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + +curl is powered by libcurl for all transfer-related features. See +*libcurl(3)* for details. diff --git a/tests/data/data1706-2.md b/tests/data/data1706-2.md new file mode 100644 index 000000000000..6665c5b21c4d --- /dev/null +++ b/tests/data/data1706-2.md @@ -0,0 +1,36 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: v +Long: fakeitreal +Mutexed: trace trace-ascii +Help: Make the operation more talkative +Category: important verbose global +Added: 4.0 +Multi: boolean +Scope: global +See-also: + - include + - silent + - trace + - trace-ascii +Example: + - --fakeitreal $URL +--- + +# `--verbose` + +Makes curl verbose during the operation. Useful for debugging and seeing +what's going on under the hood. A line starting with \> means header data sent +by curl, \< means header data received by curl that is hidden in normal cases, +and a line starting with * means additional info provided by curl. + +If you only want HTTP headers in the output, --include or --dump-header might +be more suitable options. + +If you think this option still does not give you enough details, consider using +--trace or --trace-ascii instead. + +Note that verbose output of curl activities and network traffic might contain +sensitive data, including usernames, credentials or secret data content. Be +aware and be careful when sharing trace logs with others. diff --git a/tests/data/data1706-3.md b/tests/data/data1706-3.md new file mode 100644 index 000000000000..5041962d4045 --- /dev/null +++ b/tests/data/data1706-3.md @@ -0,0 +1,48 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proto +Arg: +Help: Enable/disable PROTOCOLS +Added: 7.20.2 +Category: connection curl +Multi: single +See-also: + - fakeitreal + - proto-default +Example: + - --proto =http,https,sftp $URL +--- + +# `--proto` + +Limit what protocols to allow for transfers. Protocols are evaluated left to +right, are comma separated, and are each a protocol name or 'all', optionally +prefixed by zero or more modifiers. Available modifiers are: + +## + +Permit this protocol in addition to protocols already permitted (this is +the default if no modifier is used). + +## - +Deny this protocol, removing it from the list of protocols already permitted. + +## = +Permit only this protocol (ignoring the list already permitted), though +subject to later modification by subsequent entries in the comma separated +list. + +## + +For example: --proto -ftps uses the default protocols, but disables ftps + +--proto -all,https,+http only enables http and https + +--proto =http,https also only enables http and https + +Unknown and disabled protocols produce a warning. This allows scripts to +safely rely on being able to disable potentially dangerous protocols, without +relying upon support for that protocol being built into curl to avoid an error. + +This option can be used multiple times, in which case the effect is the same +as concatenating the protocols into one instance of the option. diff --git a/tests/data/data1706-4.md b/tests/data/data1706-4.md new file mode 100644 index 000000000000..297b56c4b64c --- /dev/null +++ b/tests/data/data1706-4.md @@ -0,0 +1,22 @@ + + +# PROXY PROTOCOL PREFIXES +The proxy string may be specified with a protocol:// prefix to specify +alternative proxy protocols. (Added in 7.21.7) + +If no protocol is specified in the proxy string or if the string does not +match a supported one, the proxy is treated as an HTTP proxy. + +The supported proxy protocol prefixes are as follows: +## http:// +Makes it use it as an HTTP proxy. The default if no scheme prefix is used. +## https:// +Makes it treated as an **HTTPS** proxy. +## socks4:// +Makes it the equivalent of --socks4 +## socks4a:// +Makes it the equivalent of --socks4a +## socks5:// +Makes it the equivalent of --socks5 +## socks5h:// +Makes it the equivalent of --socks5-hostname diff --git a/tests/data/data1706-stdout.txt b/tests/data/data1706-stdout.txt new file mode 100644 index 000000000000..b352864a8d75 --- /dev/null +++ b/tests/data/data1706-stdout.txt @@ -0,0 +1,116 @@ +DESCRIPTION + + curl is a tool for transferring data from or to a server using URLs. It + supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, + HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, + SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + + curl is powered by libcurl for all transfer-related features. See + libcurl(3) for details. + + -v, --fakeitreal + Makes curl verbose during the operation. Useful for debugging and + seeing what's going on under the hood. A line starting with > + means header data sent by curl, < means header data received by + curl that is hidden in normal cases, and a line starting with * + means additional info provided by curl. + + If you only want HTTP headers in the output, --include or + --dump-header might be more suitable options. + + If you think this option still does not give you enough details, + consider using --trace or --trace-ascii instead. + + Note that verbose output of curl activities and network traffic + might contain sensitive data, including usernames, credentials or + secret data content. Be aware and be careful when sharing trace + logs with others. + + This option is global and does not need to be specified for each + use of --next. Providing --fakeitreal multiple times has no extra + effect. Disable it again with --no-fakeitreal. + + Example: + curl --fakeitreal https://example.com + + This option is mutually exclusive with --trace and --trace-ascii. + See also --include, --silent, --trace and --trace-ascii. + + --proto + Limit what protocols to allow for transfers. Protocols are + evaluated left to right, are comma separated, and are each a + protocol name or 'all', optionally prefixed by zero or more + modifiers. Available modifiers are: + + + + + Permit this protocol in addition to protocols already + permitted (this is the default if no modifier is used). + + - + + Deny this protocol, removing it from the list of protocols + already permitted. + + = + + Permit only this protocol (ignoring the list already + permitted), though subject to later modification by subsequent + entries in the comma separated list. + + For example: --proto -ftps uses the default protocols, but + disables ftps + + --proto -all,https,+http only enables http and https + + --proto =http,https also only enables http and https + + Unknown and disabled protocols produce a warning. This allows + scripts to safely rely on being able to disable potentially + dangerous protocols, without relying upon support for that + protocol being built into curl to avoid an error. + + This option can be used multiple times, in which case the effect + is the same as concatenating the protocols into one instance of + the option. If --proto is provided several times, the last set + value is used. + + Example: + curl --proto =http,https,sftp https://example.com + + See also --fakeitreal and --proto-default. + +PROXY PROTOCOL PREFIXES + + The proxy string may be specified with a protocol:// prefix to specify + alternative proxy protocols. + + If no protocol is specified in the proxy string or if the string does not + match a supported one, the proxy is treated as an HTTP proxy. + + The supported proxy protocol prefixes are as follows: + + http:// + + Makes it use it as an HTTP proxy. The default if no scheme prefix is + used. + + https:// + + Makes it treated as an HTTPS proxy. + + socks4:// + + Makes it the equivalent of --socks4 + + socks4a:// + + Makes it the equivalent of --socks4a + + socks5:// + + Makes it the equivalent of --socks5 + + socks5h:// + + Makes it the equivalent of --socks5-hostname diff --git a/tests/data/data320.html b/tests/data/data320.html new file mode 100644 index 000000000000..2756af5f3b98 --- /dev/null +++ b/tests/data/data320.html @@ -0,0 +1,20 @@ + +

This is GnuTLS

+ + +

Session ID: 003030000100000001000000000000000030330001000000B062410001000000

+
If your browser supports session resuming, then you should see the same session ID, when you press the reload button.
+

Connected as user 'jsmith'.

+

+ + + + + +

Protocol version:TLS1.2
Key Exchange:SRP
CompressionNULL
CipherAES-NNN-CBC
MACSHA1
CiphersuiteSRP_SHA_AES_NNN_CBC_SHA1
+


Your HTTP header was:

Host: localhost:9011%CR
+User-Agent: curl-test-suite%CR
+Accept: */*%CR
+%CR
+

+ diff --git a/tests/data/test1461 b/tests/data/test1461 index f45d0dcd1229..27c58bfeea8c 100644 --- a/tests/data/test1461 +++ b/tests/data/test1461 @@ -2,7 +2,6 @@ --help -notxml @@ -32,27 +31,7 @@ curl important --help 0 -Usage: curl [options...] - -d, --data HTTP POST data - -f, --fail Fail fast with no output on HTTP errors - -h, --help Get help for commands - -o, --output Write to file instead of stdout - -O, --remote-name Write output to file named as remote file - -i, --show-headers Show response headers in output - -s, --silent Silent mode - -T, --upload-file Transfer local FILE to destination - -u, --user Server user and password - -A, --user-agent Send User-Agent to server - -v, --verbose Make the operation more talkative - -V, --version Show version number and quit - -This is not the full help; this menu is split into categories. -Use "--help category" to get an overview of all categories, which are: -auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap,%SP -output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls,%SP -upload, verbose. -Use "--help all" to list all options -Use "--help [option]" to view documentation for a given option +%includetext %SRCDIR/data/data%TESTNUMBER.txt% diff --git a/tests/data/test1463 b/tests/data/test1463 index e67bdfdae452..61168ad303a2 100644 --- a/tests/data/test1463 +++ b/tests/data/test1463 @@ -3,7 +3,6 @@ FILE --help -notxml @@ -33,11 +32,7 @@ curl file category --help 0 -file: FILE protocol - --create-file-mode File mode for created files - -I, --head Show document info only - -l, --list-only List only mode - -r, --range Retrieve only the bytes within RANGE +%includetext %SRCDIR/data/data%TESTNUMBER.txt% diff --git a/tests/data/test1464 b/tests/data/test1464 index 4a4f6b3633c9..be0b0c5f4d7c 100644 --- a/tests/data/test1464 +++ b/tests/data/test1464 @@ -33,11 +33,7 @@ curl file category --help with lower/upper mix 0 -file: FILE protocol - --create-file-mode File mode for created files - -I, --head Show document info only - -l, --list-only List only mode - -r, --range Retrieve only the bytes within RANGE +%includetext %SRCDIR/data/data1463.txt% diff --git a/tests/data/test1705 b/tests/data/test1705 index dc2120786054..5db0039d825c 100644 --- a/tests/data/test1705 +++ b/tests/data/test1705 @@ -4,7 +4,6 @@ script documentation managen -notxml @@ -23,133 +22,16 @@ _footer.md
- - -# DESCRIPTION - -**curl** is a tool for transferring data from or to a server using URLs. It -supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, -IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, -SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. - -curl is powered by libcurl for all transfer-related features. See -*libcurl(3)* for details. +%includetext %SRCDIR/data/data%TESTNUMBER-1.md% ---- -c: Copyright (C) Daniel Stenberg, , et al. -SPDX-License-Identifier: curl -Short: v -Long: fakeitreal -Mutexed: trace trace-ascii -Help: Make the operation more talkative -Category: important verbose global -Added: 4.0 -Multi: boolean -Scope: global -See-also: - - include - - silent - - trace - - trace-ascii -Example: - - --fakeitreal $URL ---- - -# `--verbose` - -Makes curl verbose during the operation. Useful for debugging and seeing -what's going on under the hood. A line starting with \> means header data sent -by curl, \< means header data received by curl that is hidden in normal cases, -and a line starting with * means additional info provided by curl. - -If you only want HTTP headers in the output, --include or --dump-header might -be more suitable options. - -If you think this option still does not give you enough details, consider using ---trace or --trace-ascii instead. - -Note that verbose output of curl activities and network traffic might contain -sensitive data, including usernames, credentials or secret data content. Be -aware and be careful when sharing trace logs with others. - -End with a quote - - hello +%includetext %SRCDIR/data/data%TESTNUMBER-2.md% ---- -c: Copyright (C) Daniel Stenberg, , et al. -SPDX-License-Identifier: curl -Long: proto -Arg: -Help: Enable/disable PROTOCOLS -Added: 7.20.2 -Category: connection curl -Multi: single -See-also: - - fakeitreal - - proto-default -Example: - - --proto =http,https,sftp $URL ---- - -# `--proto` - -Limit what protocols to allow for transfers. Protocols are evaluated left to -right, are comma separated, and are each a protocol name or 'all', optionally -prefixed by zero or more modifiers. Available modifiers are: - -## + -Permit this protocol in addition to protocols already permitted (this is -the default if no modifier is used). - -## - -Deny this protocol, removing it from the list of protocols already permitted. - -## = -Permit only this protocol (ignoring the list already permitted), though -subject to later modification by subsequent entries in the comma separated -list. - -## - -For example: --proto -ftps uses the default protocols, but disables ftps - ---proto -all,https,+http only enables http and https - ---proto =http,https also only enables http and https - -Unknown and disabled protocols produce a warning. This allows scripts to -safely rely on being able to disable potentially dangerous protocols, without -relying upon support for that protocol being built into curl to avoid an error. - -This option can be used multiple times, in which case the effect is the same -as concatenating the protocols into one instance of the option. +%includetext %SRCDIR/data/data%TESTNUMBER-3.md% - - -# PROXY PROTOCOL PREFIXES -The proxy string may be specified with a protocol:// prefix to specify -alternative proxy protocols. (Added in 7.21.7) - -If no protocol is specified in the proxy string or if the string does not -match a supported one, the proxy is treated as an HTTP proxy. - -The supported proxy protocol prefixes are as follows: -## http:// -Makes it use it as an HTTP proxy. The default if no scheme prefix is used. -## https:// -Makes it treated as an **HTTPS** proxy. -## socks4:// -Makes it the equivalent of --socks4 -## socks4a:// -Makes it the equivalent of --socks4a -## socks5:// -Makes it the equivalent of --socks5 -## socks5h:// -Makes it the equivalent of --socks5-hostname +%includetext %SRCDIR/data/data%TESTNUMBER-4.md% @@ -168,132 +50,7 @@ WARN: option1.md mutexes a non-existing option: trace-ascii option2.md:15:1:WARN: see-also a non-existing option: proto-default -.\" ************************************************************************** -.\" * _ _ ____ _ -.\" * Project ___| | | | _ \| | -.\" * / __| | | | |_) | | -.\" * | (__| |_| | _ <| |___ -.\" * \___|\___/|_| \_\_____| -.\" * -.\" * Copyright (C) Daniel Stenberg, , et al. -.\" * -.\" * This software is licensed as described in the file COPYING, which -.\" * you should have received as part of this distribution. The terms -.\" * are also available at https://curl.se/docs/copyright.html. -.\" * -.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell -.\" * copies of the Software, and permit persons to whom the Software is -.\" * furnished to do so, under the terms of the COPYING file. -.\" * -.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -.\" * KIND, either express or implied. -.\" * -.\" * SPDX-License-Identifier: curl -.\" * -.\" ************************************************************************** -.\" -.\" DO NOT EDIT. Generated by the curl project managen man page generator. -.\" -.TH curl 1 "%DATE" "curl %VERNUM" "curl Manual" -.SH DESCRIPTION -\fBcurl\fP is a tool for transferring data from or to a server using URLs. It -supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, -IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, -SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. - -curl is powered by libcurl for all transfer\-related features. See -\fIlibcurl(3)\fP for details. -.IP "\-v, \-\-fakeitreal" -Makes curl verbose during the operation. Useful for debugging and seeing -what\(aqs going on under the hood. A line starting with > means header data sent -by curl, < means header data received by curl that is hidden in normal cases, -and a line starting with * means additional info provided by curl. - -If you only want HTTP headers in the output, \fI\-\-include\fP or \fI\-\-dump\-header\fP might -be more suitable options. - -If you think this option still does not give you enough details, consider using -\fI\-\-trace\fP or \fI\-\-trace\-ascii\fP instead. - -Note that verbose output of curl activities and network traffic might contain -sensitive data, including usernames, credentials or secret data content. Be -aware and be careful when sharing trace logs with others. - -End with a quote - -.nf -hello -.fi - -This option is global and does not need to be specified for each use of \fI\-\-next\fP. - -Providing \fI\-\-fakeitreal\fP multiple times has no extra effect. -Disable it again with \-\-no-fakeitreal. - -Example: -.nf -curl --fakeitreal https://example.com -.fi - -This option is mutually exclusive with \fI\-\-trace\fP and \fI\-\-trace\-ascii\fP. -See also \fI\-\-include\fP, \fI\-\-silent\fP, \fI\-\-trace\fP and \fI\-\-trace\-ascii\fP. -.IP "\-\-proto " -Limit what protocols to allow for transfers. Protocols are evaluated left to -right, are comma separated, and are each a protocol name or \(aqall\(aq, optionally -prefixed by zero or more modifiers. Available modifiers are: -.RS -.IP + -Permit this protocol in addition to protocols already permitted (this is -the default if no modifier is used). -.IP - -Deny this protocol, removing it from the list of protocols already permitted. -.IP = -Permit only this protocol (ignoring the list already permitted), though -subject to later modification by subsequent entries in the comma separated -list. -.RE -.IP -For example: \fI\-\-proto\fP \-ftps uses the default protocols, but disables ftps - -\fI\-\-proto\fP \-all,https,+http only enables http and https - -\fI\-\-proto\fP =http,https also only enables http and https - -Unknown and disabled protocols produce a warning. This allows scripts to -safely rely on being able to disable potentially dangerous protocols, without -relying upon support for that protocol being built into curl to avoid an error. - -This option can be used multiple times, in which case the effect is the same -as concatenating the protocols into one instance of the option. - -If \fI\-\-proto\fP is provided several times, the last set value is used. - -Example: -.nf -curl --proto =http,https,sftp https://example.com -.fi - -See also \fI\-\-fakeitreal\fP and \fI\-\-proto\-default\fP. -.SH PROXY PROTOCOL PREFIXES -The proxy string may be specified with a protocol:// prefix to specify -alternative proxy protocols. - -If no protocol is specified in the proxy string or if the string does not -match a supported one, the proxy is treated as an HTTP proxy. - -The supported proxy protocol prefixes are as follows: -.IP http:// -Makes it use it as an HTTP proxy. The default if no scheme prefix is used. -.IP https:// -Makes it treated as an \fBHTTPS\fP proxy. -.IP socks4:// -Makes it the equivalent of \fI\-\-socks4\fP -.IP socks4a:// -Makes it the equivalent of \fI\-\-socks4a\fP -.IP socks5:// -Makes it the equivalent of \fI\-\-socks5\fP -.IP socks5h:// -Makes it the equivalent of \fI\-\-socks5\-hostname\fP +%includetext %SRCDIR/data/data%TESTNUMBER-stdout.1% diff --git a/tests/data/test1706 b/tests/data/test1706 index dd24365d056b..cfe628530863 100644 --- a/tests/data/test1706 +++ b/tests/data/test1706 @@ -4,7 +4,6 @@ script documentation managen -notxml @@ -23,129 +22,16 @@ _footer.md
- - -# DESCRIPTION - -**curl** is a tool for transferring data from or to a server using URLs. It -supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, -IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, -SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. - -curl is powered by libcurl for all transfer-related features. See -*libcurl(3)* for details. +%includetext %SRCDIR/data/data%TESTNUMBER-1.md% ---- -c: Copyright (C) Daniel Stenberg, , et al. -SPDX-License-Identifier: curl -Short: v -Long: fakeitreal -Mutexed: trace trace-ascii -Help: Make the operation more talkative -Category: important verbose global -Added: 4.0 -Multi: boolean -Scope: global -See-also: - - include - - silent - - trace - - trace-ascii -Example: - - --fakeitreal $URL ---- - -# `--verbose` - -Makes curl verbose during the operation. Useful for debugging and seeing -what's going on under the hood. A line starting with \> means header data sent -by curl, \< means header data received by curl that is hidden in normal cases, -and a line starting with * means additional info provided by curl. - -If you only want HTTP headers in the output, --include or --dump-header might -be more suitable options. - -If you think this option still does not give you enough details, consider using ---trace or --trace-ascii instead. - -Note that verbose output of curl activities and network traffic might contain -sensitive data, including usernames, credentials or secret data content. Be -aware and be careful when sharing trace logs with others. +%includetext %SRCDIR/data/data%TESTNUMBER-2.md% ---- -c: Copyright (C) Daniel Stenberg, , et al. -SPDX-License-Identifier: curl -Long: proto -Arg: -Help: Enable/disable PROTOCOLS -Added: 7.20.2 -Category: connection curl -Multi: single -See-also: - - fakeitreal - - proto-default -Example: - - --proto =http,https,sftp $URL ---- - -# `--proto` - -Limit what protocols to allow for transfers. Protocols are evaluated left to -right, are comma separated, and are each a protocol name or 'all', optionally -prefixed by zero or more modifiers. Available modifiers are: - -## + -Permit this protocol in addition to protocols already permitted (this is -the default if no modifier is used). - -## - -Deny this protocol, removing it from the list of protocols already permitted. - -## = -Permit only this protocol (ignoring the list already permitted), though -subject to later modification by subsequent entries in the comma separated -list. - -## - -For example: --proto -ftps uses the default protocols, but disables ftps - ---proto -all,https,+http only enables http and https - ---proto =http,https also only enables http and https - -Unknown and disabled protocols produce a warning. This allows scripts to -safely rely on being able to disable potentially dangerous protocols, without -relying upon support for that protocol being built into curl to avoid an error. - -This option can be used multiple times, in which case the effect is the same -as concatenating the protocols into one instance of the option. +%includetext %SRCDIR/data/data%TESTNUMBER-3.md% - - -# PROXY PROTOCOL PREFIXES -The proxy string may be specified with a protocol:// prefix to specify -alternative proxy protocols. (Added in 7.21.7) - -If no protocol is specified in the proxy string or if the string does not -match a supported one, the proxy is treated as an HTTP proxy. - -The supported proxy protocol prefixes are as follows: -## http:// -Makes it use it as an HTTP proxy. The default if no scheme prefix is used. -## https:// -Makes it treated as an **HTTPS** proxy. -## socks4:// -Makes it the equivalent of --socks4 -## socks4a:// -Makes it the equivalent of --socks4a -## socks5:// -Makes it the equivalent of --socks5 -## socks5h:// -Makes it the equivalent of --socks5-hostname +%includetext %SRCDIR/data/data%TESTNUMBER-4.md% @@ -164,122 +50,7 @@ WARN: option1.md mutexes a non-existing option: trace-ascii option2.md:15:1:WARN: see-also a non-existing option: proto-default -DESCRIPTION - - curl is a tool for transferring data from or to a server using URLs. It - supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, - HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, - SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. - - curl is powered by libcurl for all transfer-related features. See - libcurl(3) for details. - - -v, --fakeitreal - Makes curl verbose during the operation. Useful for debugging and - seeing what's going on under the hood. A line starting with > - means header data sent by curl, < means header data received by - curl that is hidden in normal cases, and a line starting with * - means additional info provided by curl. - - If you only want HTTP headers in the output, --include or - --dump-header might be more suitable options. - - If you think this option still does not give you enough details, - consider using --trace or --trace-ascii instead. - - Note that verbose output of curl activities and network traffic - might contain sensitive data, including usernames, credentials or - secret data content. Be aware and be careful when sharing trace - logs with others. - - This option is global and does not need to be specified for each - use of --next. Providing --fakeitreal multiple times has no extra - effect. Disable it again with --no-fakeitreal. - - Example: - curl --fakeitreal https://example.com - - This option is mutually exclusive with --trace and --trace-ascii. - See also --include, --silent, --trace and --trace-ascii. - - --proto - Limit what protocols to allow for transfers. Protocols are - evaluated left to right, are comma separated, and are each a - protocol name or 'all', optionally prefixed by zero or more - modifiers. Available modifiers are: - - + - - Permit this protocol in addition to protocols already - permitted (this is the default if no modifier is used). - - - - - Deny this protocol, removing it from the list of protocols - already permitted. - - = - - Permit only this protocol (ignoring the list already - permitted), though subject to later modification by subsequent - entries in the comma separated list. - - For example: --proto -ftps uses the default protocols, but - disables ftps - - --proto -all,https,+http only enables http and https - - --proto =http,https also only enables http and https - - Unknown and disabled protocols produce a warning. This allows - scripts to safely rely on being able to disable potentially - dangerous protocols, without relying upon support for that - protocol being built into curl to avoid an error. - - This option can be used multiple times, in which case the effect - is the same as concatenating the protocols into one instance of - the option. If --proto is provided several times, the last set - value is used. - - Example: - curl --proto =http,https,sftp https://example.com - - See also --fakeitreal and --proto-default. - -PROXY PROTOCOL PREFIXES - - The proxy string may be specified with a protocol:// prefix to specify - alternative proxy protocols. - - If no protocol is specified in the proxy string or if the string does not - match a supported one, the proxy is treated as an HTTP proxy. - - The supported proxy protocol prefixes are as follows: - - http:// - - Makes it use it as an HTTP proxy. The default if no scheme prefix is - used. - - https:// - - Makes it treated as an HTTPS proxy. - - socks4:// - - Makes it the equivalent of --socks4 - - socks4a:// - - Makes it the equivalent of --socks4a - - socks5:// - - Makes it the equivalent of --socks5 - - socks5h:// - - Makes it the equivalent of --socks5-hostname +%includetext %SRCDIR/data/data%TESTNUMBER-stdout.txt% diff --git a/tests/data/test320 b/tests/data/test320 index 0967823d388b..ca68674571f4 100644 --- a/tests/data/test320 +++ b/tests/data/test320 @@ -11,31 +11,7 @@ notxml # Server-side -HTTP/1.0 200 OK%CR -Content-type: text/html%CR -%CR - - -

This is GnuTLS

- - -

Session ID: 003030000100000001000000000000000030330001000000B062410001000000

-
If your browser supports session resuming, then you should see the same session ID, when you press the reload button.
-

Connected as user 'jsmith'.

-

- - - - - -

Protocol version:TLS1.2
Key Exchange:SRP
CompressionNULL
CipherAES-NNN-CBC
MACSHA1
CiphersuiteSRP_SHA_AES_NNN_CBC_SHA1
-


Your HTTP header was:

Host: localhost:9011%CR
-User-Agent: curl-test-suite%CR
-Accept: */*%CR
-%CR
-

- - +%includetext %SRCDIR/data/data%TESTNUMBER.html%
From 4c3614304faf07a643ca060eeccde21c8896940b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Dec 2025 09:58:48 +0100 Subject: [PATCH 711/885] headers: add length argument to Curl_headers_push() - the length is already known by parent functions - avoids strlen() calls - avoids strchr() calls for trimming off newline characters Closes #19886 --- lib/headers.c | 25 +++++++++++++------------ lib/headers.h | 4 ++-- lib/http2.c | 7 ++++--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/headers.c b/lib/headers.c index 7cf215c0800e..46de5d107bc9 100644 --- a/lib/headers.c +++ b/lib/headers.c @@ -266,30 +266,31 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value, /* * Curl_headers_push() gets passed a full HTTP header to store. It gets called - * immediately before the header callback. The header is CRLF terminated. + * immediately before the header callback. The header is CRLF, CR or LF + * terminated. */ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, + size_t hlen, /* length of header */ unsigned char type) { char *value = NULL; char *name = NULL; - char *end; - size_t hlen; /* length of the incoming header */ struct Curl_header_store *hs; CURLcode result = CURLE_OUT_OF_MEMORY; + const size_t ilen = hlen; if((header[0] == '\r') || (header[0] == '\n')) /* ignore the body separator */ return CURLE_OK; - end = strchr(header, '\r'); - if(!end) { - end = strchr(header, '\n'); - if(!end) - /* neither CR nor LF as terminator is not a valid header */ - return CURLE_WEIRD_SERVER_REPLY; - } - hlen = end - header; + /* trim off newline characters */ + if(hlen && (header[hlen - 1] == '\n')) + hlen--; + if(hlen && (header[hlen - 1] == '\r')) + hlen--; + if(hlen == ilen) + /* neither CR nor LF as terminator is not a valid header */ + return CURLE_WEIRD_SERVER_REPLY; if((header[0] == ' ') || (header[0] == '\t')) { if(data->state.prevhead) @@ -359,7 +360,7 @@ static CURLcode hds_cw_collect_write(struct Curl_easy *data, (type & CLIENTWRITE_1XX ? CURLH_1XX : (type & CLIENTWRITE_TRAILER ? CURLH_TRAILER : CURLH_HEADER))); - CURLcode result = Curl_headers_push(data, buf, htype); + CURLcode result = Curl_headers_push(data, buf, blen, htype); CURL_TRC_WRITE(data, "header_collect pushed(type=%x, len=%zu) -> %d", htype, blen, result); if(result) diff --git a/lib/headers.h b/lib/headers.h index 7249355f0ccd..adb03af75b5e 100644 --- a/lib/headers.h +++ b/lib/headers.h @@ -46,7 +46,7 @@ CURLcode Curl_headers_init(struct Curl_easy *data); * Curl_headers_push() gets passed a full header to store. */ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, - unsigned char type); + size_t hlen, unsigned char type); /* * Curl_headers_cleanup(). Free all stored headers and associated memory. @@ -55,7 +55,7 @@ CURLcode Curl_headers_cleanup(struct Curl_easy *data); #else #define Curl_headers_init(x) CURLE_OK -#define Curl_headers_push(x, y, z) CURLE_OK +#define Curl_headers_push(x,y,z,a) CURLE_OK #define Curl_headers_cleanup(x) Curl_nop_stmt #endif diff --git a/lib/http2.c b/lib/http2.c index deed6ece7ee1..83b9280b2a15 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1664,15 +1664,16 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, memcmp(HTTP_PSEUDO_STATUS, name, namelen) == 0) { /* nghttp2 guarantees :status is received first and only once. */ char buffer[32]; + size_t hlen; result = Curl_http_decode_status(&stream->status_code, (const char *)value, valuelen); if(result) { cf_h2_header_error(cf, data_s, stream, result); return NGHTTP2_ERR_CALLBACK_FAILURE; } - curl_msnprintf(buffer, sizeof(buffer), HTTP_PSEUDO_STATUS ":%u\r", - stream->status_code); - result = Curl_headers_push(data_s, buffer, CURLH_PSEUDO); + hlen = curl_msnprintf(buffer, sizeof(buffer), HTTP_PSEUDO_STATUS ":%u\r", + stream->status_code); + result = Curl_headers_push(data_s, buffer, hlen, CURLH_PSEUDO); if(result) { cf_h2_header_error(cf, data_s, stream, result); return NGHTTP2_ERR_CALLBACK_FAILURE; From 43c781a1162f9be92b4a938660da62a02039b2b3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Dec 2025 10:04:34 +0100 Subject: [PATCH 712/885] imap: check buffer length before accessing it Pointed out by ZeroPath Closes #19887 --- lib/imap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index cbc4506a9d85..05d195ec58f4 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1308,13 +1308,13 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, imapstate instate) { CURLcode result = CURLE_OK; - const char *line = curlx_dyn_ptr(&imapc->pp.recvbuf); - (void)instate; if(imapcode == '*') { /* See if this is an UIDVALIDITY response */ - if(checkprefix("OK [UIDVALIDITY ", line + 2)) { + const char *line = curlx_dyn_ptr(&imapc->pp.recvbuf); + size_t len = curlx_dyn_len(&imapc->pp.recvbuf); + if((len >= 18) && checkprefix("OK [UIDVALIDITY ", &line[2])) { curl_off_t value; const char *p = &line[2] + strlen("OK [UIDVALIDITY "); if(!curlx_str_number(&p, &value, UINT_MAX)) { From 3dd1ffdeb0efc1b222383102a2fc328ddb850fce Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Dec 2025 13:07:49 +0100 Subject: [PATCH 713/885] FAQ/TODO/KNOWN_BUGS: convert to markdown - convert to markdown - auto-generate the TOCs on the website, remove them from the docs - cleanups - spellchecked - updated links Closes #19875 --- .github/scripts/badwords.ok | 2 +- .github/scripts/pyspelling.words | 15 + .github/workflows/checkdocs.yml | 2 +- README | 3 +- REUSE.toml | 3 - docs/FAQ | 1559 ------------------------------ docs/FAQ.md | 1432 +++++++++++++++++++++++++++ docs/KNOWN_BUGS | 663 ------------- docs/KNOWN_BUGS.md | 546 +++++++++++ docs/Makefile.am | 7 +- docs/TODO | 1301 ------------------------- docs/TODO.md | 1111 +++++++++++++++++++++ packages/OS400/makefile.sh | 2 +- scripts/mdlinkcheck | 2 +- 14 files changed, 3114 insertions(+), 3534 deletions(-) delete mode 100644 docs/FAQ create mode 100644 docs/FAQ.md delete mode 100644 docs/KNOWN_BUGS create mode 100644 docs/KNOWN_BUGS.md delete mode 100644 docs/TODO create mode 100644 docs/TODO.md diff --git a/.github/scripts/badwords.ok b/.github/scripts/badwords.ok index d5401a822870..fe2d9cfaf1ed 100644 --- a/.github/scripts/badwords.ok +++ b/.github/scripts/badwords.ok @@ -4,4 +4,4 @@ # # whitelisted uses of bad words # file:[line]:rule -docs/FAQ::\bwill\b +docs/FAQ.md::\bwill\b diff --git a/.github/scripts/pyspelling.words b/.github/scripts/pyspelling.words index 984424200b9e..6b755d2043d7 100644 --- a/.github/scripts/pyspelling.words +++ b/.github/scripts/pyspelling.words @@ -53,6 +53,7 @@ axTLS backend backends backoff +backtick backticks balancers Baratov @@ -171,8 +172,10 @@ dbg Debian DEBUGBUILD decrypt +decrypted decrypting deepcode +defacto DELE DER dereference @@ -201,6 +204,7 @@ DLLs DNS dns dnsop +DNSSEC DoH DoT doxygen @@ -214,6 +218,7 @@ dynbuf EAGAIN EBCDIC ECC +ECCN ECDHE ECH ECHConfig @@ -258,6 +263,7 @@ Fedora Feltzing ffi filesize +filesystem FindCURL FLOSS fnmatch @@ -299,6 +305,7 @@ Ghedini giga Gisle Glesys +glibc globbed globbing gmail @@ -380,6 +387,7 @@ imap IMAPS imaps impacket +implementers init initializer inlined @@ -433,6 +441,7 @@ ldap LDAPS ldaps LF +LGPL LGTM libbacktrace libbrotlidec @@ -568,6 +577,7 @@ Necko NetBSD netrc netstat +NetWare Netware NFS nghttp @@ -711,6 +721,7 @@ ROADMAP Roadmap Rockbox roffit +RPC RPG RR RRs @@ -798,6 +809,7 @@ sprintf src SRP SRWLOCK +SSI SSL ssl SSLeay @@ -962,8 +974,10 @@ wcurl WebDAV WebOS webpage +webpages WebSocket WEBSOCKET +Wget WHATWG whitespace Whitespaces @@ -982,6 +996,7 @@ www Xbox XDG xdigit +XHTML Xilinx xmllint XP diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index ba3858f66c46..a079aeaa7062 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -138,7 +138,7 @@ jobs: persist-credentials: false - name: 'badwords' - run: .github/scripts/badwords.pl -w .github/scripts/badwords.ok '**.md' docs/FAQ docs/KNOWN_BUGS docs/TODO packages/OS400/README.OS400 < .github/scripts/badwords.txt + run: .github/scripts/badwords.pl -w .github/scripts/badwords.ok '**.md' packages/OS400/README.OS400 < .github/scripts/badwords.txt - name: 'verify synopsis' run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md diff --git a/README b/README index 2f68ef0c9f4f..9401434b484e 100644 --- a/README +++ b/README @@ -15,7 +15,8 @@ README available to be used by your software. Read the libcurl.3 man page to learn how. - You find answers to the most frequent questions we get in the FAQ document. + You find answers to the most frequent questions we get in the FAQ.md + document. Study the COPYING file for distribution terms. diff --git a/REUSE.toml b/REUSE.toml index e9e9ecf03d32..e341973ad3d3 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -13,14 +13,11 @@ SPDX-PackageDownloadLocation = "https://curl.se/" [[annotations]] path = [ - "docs/FAQ", "docs/INSTALL", - "docs/KNOWN_BUGS", "docs/libcurl/symbols-in-versions", "docs/MAIL-ETIQUETTE", "docs/options-in-versions", "docs/THANKS", - "docs/TODO", "lib/libcurl.vers.in", "lib/libcurl.def", "packages/OS400/README.OS400", diff --git a/docs/FAQ b/docs/FAQ deleted file mode 100644 index ef93c91c4153..000000000000 --- a/docs/FAQ +++ /dev/null @@ -1,1559 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -FAQ - - 1. Philosophy - 1.1 What is curl? - 1.2 What is libcurl? - 1.3 What is curl not? - 1.4 When will you make curl do XXXX ? - 1.5 Who makes curl? - 1.6 What do you get for making curl? - 1.7 What about CURL from curl.com? - 1.8 I have a problem, who do I mail? - 1.9 Where do I buy commercial support for curl? - 1.10 How many are using curl? - 1.11 Why do you not update ca-bundle.crt - 1.12 I have a problem, who can I chat with? - 1.13 curl's ECCN number? - 1.14 How do I submit my patch? - 1.15 How do I port libcurl to my OS? - - 2. Install Related Problems - 2.1 configure fails when using static libraries - 2.2 Does curl work/build with other SSL libraries? - 2.3 How do I upgrade curl.exe in Windows? - 2.4 Does curl support SOCKS (RFC 1928) ? - - 3. Usage Problems - 3.1 curl: (1) SSL is disabled, https: not supported - 3.2 How do I tell curl to resume a transfer? - 3.3 Why does my posting using -F not work? - 3.4 How do I tell curl to run custom FTP commands? - 3.5 How can I disable the Accept: */* header? - 3.6 Does curl support ASP, XML, XHTML or HTML version Y? - 3.7 Can I use curl to delete/rename a file through FTP? - 3.8 How do I tell curl to follow HTTP redirects? - 3.9 How do I use curl in my favorite programming language? - 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? - 3.11 How do I POST with a different Content-Type? - 3.12 Why do FTP-specific features over HTTP proxy fail? - 3.13 Why do my single/double quotes fail? - 3.14 Does curl support JavaScript or PAC (automated proxy config)? - 3.15 Can I do recursive fetches with curl? - 3.16 What certificates do I need when I use SSL? - 3.17 How do I list the root directory of an FTP server? - 3.18 Can I use curl to send a POST/PUT and not wait for a response? - 3.19 How do I get HTTP from a host using a specific IP address? - 3.20 How to SFTP from my user's home directory? - 3.21 Protocol xxx not supported or disabled in libcurl - 3.22 curl -X gives me HTTP problems - - 4. Running Problems - 4.2 Why do I get problems when I use & or % in the URL? - 4.3 How can I use {, }, [ or ] to specify multiple URLs? - 4.4 Why do I get downloaded data even though the webpage does not exist? - 4.5 Why do I get return code XXX from an HTTP server? - 4.5.1 "400 Bad Request" - 4.5.2 "401 Unauthorized" - 4.5.3 "403 Forbidden" - 4.5.4 "404 Not Found" - 4.5.5 "405 Method Not Allowed" - 4.5.6 "301 Moved Permanently" - 4.6 Can you tell me what error code 142 means? - 4.7 How do I keep usernames and passwords secret in curl command lines? - 4.8 I found a bug - 4.9 curl cannot authenticate to a server that requires NTLM? - 4.10 My HTTP request using HEAD, PUT or DELETE does not work - 4.11 Why do my HTTP range requests return the full document? - 4.12 Why do I get "certificate verify failed" ? - 4.13 Why is curl -R on Windows one hour off? - 4.14 Redirects work in browser but not with curl - 4.15 FTPS does not work - 4.16 My HTTP POST or PUT requests are slow - 4.17 Non-functional connect timeouts on Windows - 4.18 file:// URLs containing drive letters (Windows, NetWare) - 4.19 Why does not curl return an error when the network cable is unplugged? - 4.20 curl does not return error for HTTP non-200 responses - - 5. libcurl Issues - 5.1 Is libcurl thread-safe? - 5.2 How can I receive all data into a large memory chunk? - 5.3 How do I fetch multiple files with libcurl? - 5.4 Does libcurl do Winsock initialization on Win32 systems? - 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ? - 5.6 What about Keep-Alive or persistent connections? - 5.7 Link errors when building libcurl on Windows - 5.8 libcurl.so.X: open failed: No such file or directory - 5.9 How does libcurl resolve hostnames? - 5.10 How do I prevent libcurl from writing the response to stdout? - 5.11 How do I make libcurl not receive the whole HTTP response? - 5.12 Can I make libcurl fake or hide my real IP address? - 5.13 How do I stop an ongoing transfer? - 5.14 Using C++ non-static functions for callbacks? - 5.15 How do I get an FTP directory listing? - 5.16 I want a different time-out - 5.17 Can I write a server with libcurl? - 5.18 Does libcurl use threads? - - 6. License Issues - 6.1 I have a GPL program, can I use the libcurl library? - 6.2 I have a closed-source program, can I use the libcurl library? - 6.3 I have a BSD licensed program, can I use the libcurl library? - 6.4 I have a program that uses LGPL libraries, can I use libcurl? - 6.5 Can I modify curl/libcurl for my program and keep the changes secret? - 6.6 Can you please change the curl/libcurl license to XXXX? - 6.7 What are my obligations when using libcurl in my commercial apps? - - 7. PHP/CURL Issues - 7.1 What is PHP/CURL? - 7.2 Who wrote PHP/CURL? - 7.3 Can I perform multiple requests using the same handle? - 7.4 Does PHP/CURL have dependencies? - - 8. Development - 8.1 Why does curl use C89? - 8.2 Will curl be rewritten? - -============================================================================== - -1. Philosophy - - 1.1 What is curl? - - curl is the name of the project. The name is a play on 'Client for URLs', - originally with URL spelled in uppercase to make it obvious it deals with - URLs. The fact it can also be read as 'see URL' also helped, it works as - an abbreviation for "Client URL Request Library" or why not the recursive - version: "curl URL Request Library". - - The curl project produces two products: - - libcurl - - A client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, - GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, - RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS - and WSS. - - libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, - Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password - authentication, file transfer resume, http proxy tunneling and more. - - libcurl is highly portable, it builds and works identically on numerous - platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HP-UX, - IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, macOS, - Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS, Symbian, OSF, Android, - Minix, IBM TPF and more... - - libcurl is free, thread-safe, IPv6 compatible, feature rich, well - supported and fast. - - curl - - A command line tool for getting or sending data using URL syntax. - - Since curl uses libcurl, curl supports the same wide range of common - Internet protocols that libcurl does. - - We pronounce curl with an initial k sound. It rhymes with words like girl - and earl. This is a short WAV file to help you: - - https://media.merriam-webster.com/soundc11/c/curl0001.wav - - There are numerous sub-projects and related projects that also use the word - curl in the project names in various combinations, but you should take - notice that this FAQ is directed at the command-line tool named curl (and - libcurl the library), and may therefore not be valid for other curl-related - projects. (There is however a small section for the PHP/CURL in this FAQ.) - - 1.2 What is libcurl? - - libcurl is a reliable and portable library for doing Internet data transfers - using one or more of its supported Internet protocols. - - You can use libcurl freely in your application, be it open source, - commercial or closed-source. - - libcurl is most probably the most portable, most powerful and most often - used C-based multi-platform file transfer library on this planet - be it - open source or commercial. - - 1.3 What is curl not? - - curl is not a wget clone. That is a common misconception. Never, during - curl's development, have we intended curl to replace wget or compete on its - market. curl is targeted at single-shot file transfers. - - curl is not a website mirroring program. If you want to use curl to mirror - something: fine, go ahead and write a script that wraps around curl or use - libcurl to make it reality. - - curl is not an FTP site mirroring program. Sure, get and send FTP with curl - but if you want systematic and sequential behavior you should write a - script (or write a new program that interfaces libcurl) and do it. - - curl is not a PHP tool, even though it works perfectly well when used from - or with PHP (when using the PHP/CURL module). - - curl is not a program for a single operating system. curl exists, compiles, - builds and runs under a wide range of operating systems, including all - modern Unixes (and a bunch of older ones too), Windows, Amiga, OS/2, macOS, - QNX etc. - - 1.4 When will you make curl do XXXX ? - - We love suggestions of what to change in order to make curl and libcurl - better. We do however believe in a few rules when it comes to the future of - curl: - - curl -- the command line tool -- is to remain a non-graphical command line - tool. If you want GUIs or fancy scripting capabilities, you should look for - another tool that uses libcurl. - - We do not add things to curl that other small and available tools already do - well at the side. curl's output can be piped into another program or - redirected to another file for the next program to interpret. - - We focus on protocol related issues and improvements. If you want to do more - magic with the supported protocols than curl currently does, chances are - good we will agree. If you want to add more protocols, we may agree. - - If you want someone else to do all the work while you wait for us to - implement it for you, that is not a friendly attitude. We spend a - considerable time already on maintaining and developing curl. In order to - get more out of us, you should consider trading in some of your time and - effort in return. Simply go to the GitHub repository which resides at - https://github.com/curl/curl, fork the project, and create pull requests - with your proposed changes. - - If you write the code, chances are better that it will get into curl faster. - - 1.5 Who makes curl? - - curl and libcurl are not made by any single individual. Daniel Stenberg is - project leader and main developer, but other persons' submissions are - important and crucial. Anyone can contribute and post their changes and - improvements and have them inserted in the main sources (of course on the - condition that developers agree that the fixes are good). - - The full list of all contributors is found in the docs/THANKS file. - - curl is developed by a community, with Daniel at the wheel. - - 1.6 What do you get for making curl? - - Project curl is entirely free and open. We do this voluntarily, mostly in - our spare time. Companies may pay individual developers to work on curl. - This is not controlled by nor supervised in any way by the curl project. - - We get help from companies. Haxx provides website, bandwidth, mailing lists - etc, GitHub hosts the primary git repository and other services like the bug - tracker at https://github.com/curl/curl. Also again, some companies have - sponsored certain parts of the development in the past and I hope some will - continue to do so in the future. - - If you want to support our project, consider a donation or a banner-program - or even better: by helping us with coding, documenting or testing etc. - - See also: https://curl.se/sponsors.html - - 1.7 What about CURL from curl.com? - - During the summer of 2001, curl.com was busy advertising their client-side - programming language for the web, named CURL. - - We are in no way associated with curl.com or their CURL programming - language. - - Our project name curl has been in effective use since 1998. We were not the - first computer related project to use the name "curl" and do not claim any - rights to the name. - - We recognize that we will be living in parallel with curl.com and wish them - every success. - - 1.8 I have a problem, who do I mail? - - Please do not mail any single individual unless you really need to. Keep - curl-related questions on a suitable mailing list. All available mailing - lists are listed in the MANUAL document and online at - https://curl.se/mail/ - - Keeping curl-related questions and discussions on mailing lists allows - others to join in and help, to share their ideas, to contribute their - suggestions and to spread their wisdom. Keeping discussions on public mailing - lists also allows for others to learn from this (both current and future - users thanks to the web based archives of the mailing lists), thus saving us - from having to repeat ourselves even more. Thanks for respecting this. - - If you have found or simply suspect a security problem in curl or libcurl, - submit all the details at https://hackerone.com/curl. On there we keep the - issue private while we investigate, confirm it, work and validate a fix and - agree on a time schedule for publication etc. That way we produce a fix in a - timely manner before the flaw is announced to the world, reducing the impact - the problem risks having on existing users. - - Security issues can also be taking to the curl security team by emailing - security at curl.se (closed list of receivers, mails are not disclosed). - - 1.9 Where do I buy commercial support for curl? - - curl is fully open source. It means you can hire any skilled engineer to fix - your curl-related problems. - - We list available alternatives on the curl website: - https://curl.se/support.html - - 1.10 How many are using curl? - - It is impossible to tell. - - We do not know how many users that knowingly have installed and use curl. - - We do not know how many users that use curl without knowing that they are in - fact using it. - - We do not know how many users that downloaded or installed curl and then - never use it. - - In 2020, we estimate that curl runs in roughly ten billion installations - world wide. - - 1.11 Why do you not update ca-bundle.crt - - In the curl project we have decided not to attempt to keep this file updated - (or even present) since deciding what to add to a ca cert bundle is an - undertaking we have not been ready to accept, and the one we can get from - Mozilla is perfectly fine so there is no need to duplicate that work. - - Today, with many services performed over HTTPS, every operating system - should come with a default ca cert bundle that can be deemed somewhat - trustworthy and that collection (if reasonably updated) should be deemed to - be a lot better than a private curl version. - - If you want the most recent collection of ca certs that Mozilla Firefox - uses, we recommend that you extract the collection yourself from Mozilla - Firefox (by running 'make ca-bundle), or by using our online service setup - for this purpose: https://curl.se/docs/caextract.html - - 1.12 I have a problem who, can I chat with? - - There is a bunch of friendly people hanging out in the #curl channel on the - IRC network libera.chat. If you are polite and nice, chances are good that - you can get -- or provide -- help instantly. - - 1.13 curl's ECCN number? - - The US government restricts exports of software that contains or uses - cryptography. When doing so, the Export Control Classification Number (ECCN) - is used to identify the level of export control etc. - - Apache Software Foundation gives a good explanation of ECCNs at - https://www.apache.org/dev/crypto.html - - We believe curl's number might be ECCN 5D002, another possibility is - 5D992. It seems necessary to write them (the authority that administers ECCN - numbers), asking to confirm. - - Comprehensible explanations of the meaning of such numbers and how to obtain - them (resp.) are here - - https://www.bis.doc.gov/licensing/exportingbasics.htm - https://www.bis.doc.gov/licensing/do_i_needaneccn.html - - An incomprehensible description of the two numbers above is here - https://www.bis.doc.gov/index.php/documents/new-encryption/1653-ccl5-pt2-3 - - 1.14 How do I submit my patch? - - We strongly encourage you to submit changes and improvements directly as - "pull requests" on GitHub: https://github.com/curl/curl/pulls - - If you for any reason cannot or will not deal with GitHub, send your patch to - the curl-library mailing list. We are many subscribers there and there are - lots of people who can review patches, comment on them and "receive" them - properly. - - Lots of more details are found in the CONTRIBUTE.md and INTERNALS.md - documents. - - 1.15 How do I port libcurl to my OS? - - Here's a rough step-by-step: - - 1. copy a suitable lib/config-*.h file as a start to lib/config-[youros].h - - 2. edit lib/config-[youros].h to match your OS and setup - - 3. edit lib/curl_setup.h to include config-[youros].h when your OS is - detected by the preprocessor, in the style others already exist - - 4. compile lib/*.c and make them into a library - - -2. Install Related Problems - - 2.1 configure fails when using static libraries - - You may find that configure fails to properly detect the entire dependency - chain of libraries when you provide static versions of the libraries that - configure checks for. - - The reason why static libraries is much harder to deal with is that for them - we do not get any help but the script itself must know or check what more - libraries that are needed (with shared libraries, that dependency "chain" is - handled automatically). This is an error-prone process and one that also - tends to vary over time depending on the release versions of the involved - components and may also differ between operating systems. - - For that reason, configure does few attempts to actually figure this out and - you are instead encouraged to set LIBS and LDFLAGS accordingly when you - invoke configure, and point out the needed libraries and set the necessary - flags yourself. - - 2.2 Does curl work with other SSL libraries? - - curl has been written to use a generic SSL function layer internally, and - that SSL functionality can then be provided by one out of many different SSL - backends. - - curl can be built to use one of the following SSL alternatives: OpenSSL, - LibreSSL, BoringSSL, AWS-LC, GnuTLS, wolfSSL, mbedTLS, Schannel (native - Windows) or Rustls. They all have their pros and cons, and we try to - maintain a comparison of them here: https://curl.se/docs/ssl-compared.html - - 2.3 How do I upgrade curl.exe in Windows? - - The curl tool that is shipped as an integrated component of Windows 10 and - Windows 11 is managed by Microsoft. If you were to delete the file or - replace it with a newer version downloaded from https://curl.se/windows, - then Windows Update will cease to work on your system. - - There is no way to independently force an upgrade of the curl.exe that is - part of Windows other than through the regular Windows update process. There - is also nothing the curl project itself can do about this, since this is - managed and controlled entirely by Microsoft as owners of the operating - system. - - You can always download and install the latest version of curl for Windows - from https://curl.se/windows into a separate location. - - 2.4 Does curl support SOCKS (RFC 1928) ? - - Yes, SOCKS 4 and 5 are supported. - -3. Usage problems - - 3.1 curl: (1) SSL is disabled, https: not supported - - If you get this output when trying to get anything from an HTTPS server, it - means that the instance of curl/libcurl that you are using was built without - support for this protocol. - - This could have happened if the configure script that was run at build time - could not find all libs and include files curl requires for SSL to work. If - the configure script fails to find them, curl is simply built without SSL - support. - - To get HTTPS support into a curl that was previously built but that reports - that HTTPS is not supported, you should dig through the document and logs - and check out why the configure script does not find the SSL libs and/or - include files. - - Also, check out the other paragraph in this FAQ labeled "configure does not - find OpenSSL even when it is installed". - - 3.2 How do I tell curl to resume a transfer? - - curl supports resumed transfers both ways on both FTP and HTTP. - Try the -C option. - - 3.3 Why does my posting using -F not work? - - You cannot arbitrarily use -F or -d, the choice between -F or -d depends on - the HTTP operation you need curl to do and what the web server that will - receive your post expects. - - If the form you are trying to submit uses the type 'multipart/form-data', - then and only then you must use the -F type. In all the most common cases, - you should use -d which then causes a posting with the type - 'application/x-www-form-urlencoded'. - - This is described in some detail in the MANUAL and TheArtOfHttpScripting - documents, and if you do not understand it the first time, read it again - before you post questions about this to the mailing list. Also, try reading - through the mailing list archives for old postings and questions regarding - this. - - 3.4 How do I tell curl to run custom FTP commands? - - You can tell curl to perform optional commands both before and/or after a - file transfer. Study the -Q/--quote option. - - Since curl is used for file transfers, you do not normally use curl to - perform FTP commands without transferring anything. Therefore you must - always specify a URL to transfer to/from even when doing custom FTP - commands, or use -I which implies the "no body" option sent to libcurl. - - 3.5 How can I disable the Accept: */* header? - - You can change all internally generated headers by adding a replacement with - the -H/--header option. By adding a header with empty contents you safely - disable that one. Use -H "Accept:" to disable that specific header. - - 3.6 Does curl support ASP, XML, XHTML or HTML version Y? - - To curl, all contents are alike. It does not matter how the page was - generated. It may be ASP, PHP, Perl, shell-script, SSI or plain HTML - files. There is no difference to curl and it does not even know what kind of - language that generated the page. - - See also item 3.14 regarding JavaScript. - - 3.7 Can I use curl to delete/rename a file through FTP? - - Yes. You specify custom FTP commands with -Q/--quote. - - One example would be to delete a file after you have downloaded it: - - curl -O ftp://example.com/coolfile -Q '-DELE coolfile' - - or rename a file after upload: - - curl -T infile ftp://example.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname" - - 3.8 How do I tell curl to follow HTTP redirects? - - curl does not follow so-called redirects by default. The Location: header - that informs the client about this is only interpreted if you are using the - -L/--location option. As in: - - curl -L https://example.com - - Not all redirects are HTTP ones, see 4.14 - - 3.9 How do I use curl in my favorite programming language? - - Many programming languages have interfaces/bindings that allow you to use - curl without having to use the command line tool. If you are fluent in such - a language, you may prefer to use one of these interfaces instead. - - Find out more about which languages that support curl directly, and how to - install and use them, in the libcurl section of the curl website: - https://curl.se/libcurl/ - - All the various bindings to libcurl are made by other projects and people, - outside of the curl project. The curl project itself only produces libcurl - with its plain C API. If you do not find anywhere else to ask you can ask - about bindings on the curl-library list too, but be prepared that people on - that list may not know anything about bindings. - - In December 2021, there were interfaces available for the following - languages: Ada95, Basic, C, C++, Ch, Cocoa, D, Delphi, Dylan, Eiffel, - Euphoria, Falcon, Ferite, Gambas, glib/GTK+, Go, Guile, Harbour, Haskell, - Java, Julia, Lisp, Lua, Mono, .NET, node.js, Object-Pascal, OCaml, Pascal, - Perl, PHP, PostgreSQL, Python, R, Rexx, Ring, RPG, Ruby, Rust, Scheme, - Scilab, S-Lang, Smalltalk, SP-Forth, SPL, Tcl, Visual Basic, Visual FoxPro, - Q, wxwidgets, XBLite and Xoho. By the time you read this, additional ones - may have appeared. - - 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? - - curl adheres to the HTTP spec, which basically means you can play with *any* - protocol that is built on top of HTTP. Protocols such as SOAP, WebDAV and - XML-RPC are all such ones. You can use -X to set custom requests and -H to - set custom headers (or replace internally generated ones). - - Using libcurl is of course just as good and you would just use the proper - library options to do the same. - - 3.11 How do I POST with a different Content-Type? - - You can always replace the internally generated headers with -H/--header. - To make a simple HTTP POST with text/xml as content-type, do something like: - - curl -d "datatopost" -H "Content-Type: text/xml" [URL] - - 3.12 Why do FTP-specific features over HTTP proxy fail? - - Because when you use an HTTP proxy, the protocol spoken on the network will - be HTTP, even if you specify an FTP URL. This effectively means that you - normally cannot use FTP-specific features such as FTP upload and FTP quote - etc. - - There is one exception to this rule, and that is if you can "tunnel through" - the given HTTP proxy. Proxy tunneling is enabled with a special option (-p) - and is generally not available as proxy admins usually disable tunneling to - ports other than 443 (which is used for HTTPS access through proxies). - - 3.13 Why do my single/double quotes fail? - - To specify a command line option that includes spaces, you might need to - put the entire option within quotes. Like in: - - curl -d " with spaces " example.com - - or perhaps - - curl -d ' with spaces ' example.com - - Exactly what kind of quotes and how to do this is entirely up to the shell - or command line interpreter that you are using. For most Unix shells, you - can more or less pick either single (') or double (") quotes. For - Windows/DOS command prompts you must use double (") quotes, and if the - option string contains inner double quotes you can escape them with a - backslash. - - For Windows powershell the arguments are not always passed on as expected - because curl is not a powershell script. You may or may not be able to use - single quotes. To escape inner double quotes seems to require a - backslash-backtick escape sequence and the outer quotes as double quotes. - - Please study the documentation for your particular environment. Examples in - the curl docs will use a mix of both of these as shown above. You must - adjust them to work in your environment. - - Remember that curl works and runs on more operating systems than most single - individuals have ever tried. - - 3.14 Does curl support JavaScript or PAC (automated proxy config)? - - Many webpages do magic stuff using embedded JavaScript. curl and libcurl - have no built-in support for that, so it will be treated just like any other - contents. - - .pac files are a Netscape invention and are sometimes used by organizations - to allow them to differentiate which proxies to use. The .pac contents is - just a JavaScript program that gets invoked by the browser and that returns - the name of the proxy to connect to. Since curl does not support JavaScript, - it cannot support .pac proxy configuration either. - - Some workarounds usually suggested to overcome this JavaScript dependency: - - Depending on the JavaScript complexity, write up a script that translates it - to another language and execute that. - - Read the JavaScript code and rewrite the same logic in another language. - - Implement a JavaScript interpreter, people have successfully used the - Mozilla JavaScript engine in the past. - - Ask your admins to stop this, for a static proxy setup or similar. - - 3.15 Can I do recursive fetches with curl? - - No. curl itself has no code that performs recursive operations, such as - those performed by wget and similar tools. - - There exists wrapper scripts with that functionality (for example the - curlmirror perl script), and you can write programs based on libcurl to do - it, but the command line tool curl itself cannot. - - 3.16 What certificates do I need when I use SSL? - - There are three different kinds of "certificates" to keep track of when we - talk about using SSL-based protocols (HTTPS or FTPS) using curl or libcurl. - - CLIENT CERTIFICATE - - The server you communicate with may require that you can provide this in - order to prove that you actually are who you claim to be. If the server - does not require this, you do not need a client certificate. - - A client certificate is always used together with a private key, and the - private key has a passphrase that protects it. - - SERVER CERTIFICATE - - The server you communicate with has a server certificate. You can and should - verify this certificate to make sure that you are truly talking to the real - server and not a server impersonating it. - - CERTIFICATE AUTHORITY CERTIFICATE ("CA cert") - - You often have several CA certs in a CA cert bundle that can be used to - verify a server certificate that was signed by one of the authorities in the - bundle. curl does not come with a CA cert bundle but most curl installs - provide one. You can also override the default. - - The server certificate verification process is made by using a Certificate - Authority certificate ("CA cert") that was used to sign the server - certificate. Server certificate verification is enabled by default in curl - and libcurl and is often the reason for problems as explained in FAQ entry - 4.12 and the SSLCERTS document - (https://curl.se/docs/sslcerts.html). Server certificates that are - "self-signed" or otherwise signed by a CA that you do not have a CA cert - for, cannot be verified. If the verification during a connect fails, you are - refused access. You then need to explicitly disable the verification to - connect to the server. - - 3.17 How do I list the root directory of an FTP server? - - There are two ways. The way defined in the RFC is to use an encoded slash - in the first path part. List the "/tmp" directory like this: - - curl ftp://ftp.example.com/%2ftmp/ - - or the not-quite-kosher-but-more-readable way, by simply starting the path - section of the URL with a slash: - - curl ftp://ftp.example.com//tmp/ - - 3.18 Can I use curl to send a POST/PUT and not wait for a response? - - No. - - You can easily write your own program using libcurl to do such stunts. - - 3.19 How do I get HTTP from a host using a specific IP address? - - For example, you may be trying out a website installation that is not yet in - the DNS. Or you have a site using multiple IP addresses for a given host - name and you want to address a specific one out of the set. - - Set a custom Host: header that identifies the server name you want to reach - but use the target IP address in the URL: - - curl --header "Host: www.example.com" https://somewhere.example/ - - You can also opt to add faked hostname entries to curl with the --resolve - option. That has the added benefit that things like redirects will also work - properly. The above operation would instead be done as: - - curl --resolve www.example.com:80:127.0.0.1 https://www.example.com/ - - 3.20 How to SFTP from my user's home directory? - - Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to - work with. It means that if you do not specify that you want the user's home - directory, you get the actual root directory. - - To specify a file in your user's home directory, you need to use the correct - URL syntax which for SFTP might look similar to: - - curl -O -u user:password sftp://example.com/~/file.txt - - and for SCP it is just a different protocol prefix: - - curl -O -u user:password scp://example.com/~/file.txt - - 3.21 Protocol xxx not supported or disabled in libcurl - - When passing on a URL to curl to use, it may respond that the particular - protocol is not supported or disabled. The particular way this error message - is phrased is because curl does not make a distinction internally of whether - a particular protocol is not supported (i.e. never got any code added that - knows how to speak that protocol) or if it was explicitly disabled. curl can - be built to only support a given set of protocols, and the rest would then - be disabled or not supported. - - Note that this error will also occur if you pass a wrongly spelled protocol - part as in "htpts://example.com" or as in the less evident case if you - prefix the protocol part with a space as in " https://example.com/". - - 3.22 curl -X gives me HTTP problems - - In normal circumstances, -X should hardly ever be used. - - By default you use curl without explicitly saying which request method to - use when the URL identifies an HTTP transfer. If you just pass in a URL like - "curl https://example.com" it will use GET. If you use -d or -F curl will use - POST, -I will cause a HEAD and -T will make it a PUT. - - If for whatever reason you are not happy with these default choices that curl - does for you, you can override those request methods by specifying -X - [WHATEVER]. This way you can for example send a DELETE by doing "curl -X - DELETE [URL]". - - It is thus pointless to do "curl -XGET [URL]" as GET would be used anyway. - In the same vein it is pointless to do "curl -X POST -d data [URL]". You can - make a fun and somewhat rare request that sends a request-body in a GET - request with something like "curl -X GET -d data [URL]" - - Note that -X does not actually change curl's behavior as it only modifies the - actual string sent in the request, but that may of course trigger a - different set of events. - - Accordingly, by using -XPOST on a command line that for example would follow - a 303 redirect, you will effectively prevent curl from behaving - correctly. Be aware. - - -4. Running Problems - - 4.2 Why do I get problems when I use & or % in the URL? - - In general Unix shells, the & symbol is treated specially and when used, it - runs the specified command in the background. To safely send the & as a part - of a URL, you should quote the entire URL by using single (') or double (") - quotes around it. Similar problems can also occur on some shells with other - characters, including ?*!$~(){}<>\|;`. When in doubt, quote the URL. - - An example that would invoke a remote CGI that uses &-symbols could be: - - curl 'https://www.example.com/cgi-bin/query?text=yes&q=curl' - - In Windows, the standard DOS shell treats the percent sign specially and you - need to use TWO percent signs for each single one you want to use in the - URL. - - If you want a literal percent sign to be part of the data you pass in a POST - using -d/--data you must encode it as '%25' (which then also needs the - percent sign doubled on Windows machines). - - 4.3 How can I use {, }, [ or ] to specify multiple URLs? - - Because those letters have a special meaning to the shell, to be used in - a URL specified to curl you must quote them. - - An example that downloads two URLs (sequentially) would be: - - curl '{curl,www}.haxx.se' - - To be able to use those characters as actual parts of the URL (without using - them for the curl URL "globbing" system), use the -g/--globoff option: - - curl -g 'www.example.com/weirdname[].html' - - 4.4 Why do I get downloaded data even though the webpage does not exist? - - curl asks remote servers for the page you specify. If the page does not exist - at the server, the HTTP protocol defines how the server should respond and - that means that headers and a "page" will be returned. That is simply how - HTTP works. - - By using the --fail option you can tell curl explicitly to not get any data - if the HTTP return code does not say success. - - 4.5 Why do I get return code XXX from an HTTP server? - - RFC 2616 clearly explains the return codes. This is a short transcript. Go - read the RFC for exact details: - - 4.5.1 "400 Bad Request" - - The request could not be understood by the server due to malformed - syntax. The client SHOULD NOT repeat the request without modifications. - - 4.5.2 "401 Unauthorized" - - The request requires user authentication. - - 4.5.3 "403 Forbidden" - - The server understood the request, but is refusing to fulfill it. - Authorization will not help and the request SHOULD NOT be repeated. - - 4.5.4 "404 Not Found" - - The server has not found anything matching the Request-URI. No indication - is given as to whether the condition is temporary or permanent. - - 4.5.5 "405 Method Not Allowed" - - The method specified in the Request-Line is not allowed for the resource - identified by the Request-URI. The response MUST include an Allow header - containing a list of valid methods for the requested resource. - - 4.5.6 "301 Moved Permanently" - - If you get this return code and an HTML output similar to this: - -

Moved Permanently

The document has moved here. - - it might be because you requested a directory URL but without the trailing - slash. Try the same operation again _with_ the trailing URL, or use the - -L/--location option to follow the redirection. - - 4.6 Can you tell me what error code 142 means? - - All curl error codes are described at the end of the man page, in the - section called "EXIT CODES". - - Error codes that are larger than the highest documented error code means - that curl has exited due to a crash. This is a serious error, and we - appreciate a detailed bug report from you that describes how we could go - ahead and repeat this. - - 4.7 How do I keep usernames and passwords secret in curl command lines? - - This problem has two sides: - - The first part is to avoid having clear-text passwords in the command line - so that they do not appear in 'ps' outputs and similar. That is easily - avoided by using the "-K" option to tell curl to read parameters from a file - or stdin to which you can pass the secret info. curl itself will also - attempt to "hide" the given password by blanking out the option - this - does not work on all platforms. - - To keep the passwords in your account secret from the rest of the world is - not a task that curl addresses. You could of course encrypt them somehow to - at least hide them from being read by human eyes, but that is not what - anyone would call security. - - Also note that regular HTTP (using Basic authentication) and FTP passwords - are sent as cleartext across the network. All it takes for anyone to fetch - them is to listen on the network. Eavesdropping is easy. Use more secure - authentication methods (like Digest, Negotiate or even NTLM) or consider the - SSL-based alternatives HTTPS and FTPS. - - 4.8 I found a bug - - It is not a bug if the behavior is documented. Read the docs first. - Especially check out the KNOWN_BUGS file, it may be a documented bug. - - If it is a problem with a binary you have downloaded or a package for your - particular platform, try contacting the person who built the package/archive - you have. - - If there is a bug, read the BUGS document first. Then report it as described - in there. - - 4.9 curl cannot authenticate to a server that requires NTLM? - - NTLM support requires OpenSSL, GnuTLS, mbedTLS or Microsoft Windows - libraries at build-time to provide this functionality. - - 4.10 My HTTP request using HEAD, PUT or DELETE does not work - - Many web servers allow or demand that the administrator configures the - server properly for these requests to work on the web server. - - Some servers seem to support HEAD only on certain kinds of URLs. - - To fully grasp this, try the documentation for the particular server - software you are trying to interact with. This is not anything curl can do - anything about. - - 4.11 Why do my HTTP range requests return the full document? - - Because the range may not be supported by the server, or the server may - choose to ignore it and return the full document anyway. - - 4.12 Why do I get "certificate verify failed" ? - - When you invoke curl and get an error 60 error back it means that curl - could not verify that the server's certificate was good. curl verifies the - certificate using the CA cert bundle and verifying for which names the - certificate has been granted. - - To completely disable the certificate verification, use -k. This does - however enable man-in-the-middle attacks and makes the transfer INSECURE. - We strongly advise against doing this for more than experiments. - - If you get this failure with a CA cert bundle installed and used, the - server's certificate might not be signed by one of the CA's in your CA - store. It might for example be self-signed. You then correct this problem by - obtaining a valid CA cert for the server. Or again, decrease the security by - disabling this check. - - At times, you find that the verification works in your favorite browser but - fails in curl. When this happens, the reason is usually that the server - sends an incomplete cert chain. The server is mandated to send all - "intermediate certificates" but does not. This typically works with browsers - anyway since they A) cache such certs and B) supports AIA which downloads - such missing certificates on demand. This is a server misconfiguration. A - good way to figure out if this is the case it to use the SSL Labs server - test and check the certificate chain: https://www.ssllabs.com/ssltest/ - - Details are also in the SSLCERTS.md document, found online here: - https://curl.se/docs/sslcerts.html - - 4.13 Why is curl -R on Windows one hour off? - - Since curl 7.53.0 this issue should be fixed as long as curl was built with - any modern compiler that allows for a 64-bit curl_off_t type. For older - compilers or prior curl versions it may set a time that appears one hour off. - This happens due to a flaw in how Windows stores and uses file modification - times and it is not easily worked around. For more details read this: - https://www.codeproject.com/Articles/1144/Beating-the-Daylight-Savings-Time-bug-and-getting - - 4.14 Redirects work in browser but not with curl - - curl supports HTTP redirects well (see item 3.8). Browsers generally support - at least two other ways to perform redirects that curl does not: - - Meta tags. You can write an HTML tag that will cause the browser to redirect - to another given URL after a certain time. - - JavaScript. You can write a JavaScript program embedded in an HTML page that - redirects the browser to another given URL. - - There is no way to make curl follow these redirects. You must either - manually figure out what the page is set to do, or write a script that parses - the results and fetches the new URL. - - 4.15 FTPS does not work - - curl supports FTPS (sometimes known as FTP-SSL) both implicit and explicit - mode. - - When a URL is used that starts with FTPS://, curl assumes implicit SSL on - the control connection and will therefore immediately connect and try to - speak SSL. FTPS:// connections default to port 990. - - To use explicit FTPS, you use an FTP:// URL and the --ssl-reqd option (or one - of its related flavors). This is the most common method, and the one - mandated by RFC 4217. This kind of connection will then of course use the - standard FTP port 21 by default. - - 4.16 My HTTP POST or PUT requests are slow - - libcurl makes all POST and PUT requests (except for requests with a small - request body) use the "Expect: 100-continue" header. This header allows the - server to deny the operation early so that libcurl can bail out before having - to send any data. This is useful in authentication cases and others. - - However, many servers do not implement the Expect: stuff properly and if the - server does not respond (positively) within 1 second libcurl will continue - and send off the data anyway. - - You can disable libcurl's use of the Expect: header the same way you disable - any header, using -H / CURLOPT_HTTPHEADER, or by forcing it to use HTTP 1.0. - - 4.17 Non-functional connect timeouts - - In most Windows setups having a timeout longer than 21 seconds make no - difference, as it will only send 3 TCP SYN packets and no more. The second - packet sent three seconds after the first and the third six seconds after - the second. No more than three packets are sent, no matter how long the - timeout is set. - - See option TcpMaxConnectRetransmissions on this page: - https://web.archive.org/web/20160819015101/support.microsoft.com/en-us/kb/175523 - - Also, even on non-Windows systems there may run a firewall or anti-virus - software or similar that accepts the connection but does not actually do - anything else. This will make (lib)curl to consider the connection connected - and thus the connect timeout will not trigger. - - 4.18 file:// URLs containing drive letters (Windows, NetWare) - - When using curl to try to download a local file, one might use a URL - in this format: - - file://D:/blah.txt - - you will find that even if D:\blah.txt does exist, curl returns a 'file - not found' error. - - According to RFC 1738 (https://datatracker.ietf.org/doc/html/rfc1738), - file:// URLs must contain a host component, but it is ignored by - most implementations. In the above example, 'D:' is treated as the - host component, and is taken away. Thus, curl tries to open '/blah.txt'. - If your system is installed to drive C:, that will resolve to 'C:\blah.txt', - and if that does not exist you will get the not found error. - - To fix this problem, use file:// URLs with *three* leading slashes: - - file:///D:/blah.txt - - Alternatively, if it makes more sense, specify 'localhost' as the host - component: - - file://localhost/D:/blah.txt - - In either case, curl should now be looking for the correct file. - - 4.19 Why does not curl return an error when the network cable is unplugged? - - Unplugging a cable is not an error situation. The TCP/IP protocol stack - was designed to be fault tolerant, so even though there may be a physical - break somewhere the connection should not be affected, just possibly - delayed. Eventually, the physical break will be fixed or the data will be - re-routed around the physical problem through another path. - - In such cases, the TCP/IP stack is responsible for detecting when the - network connection is irrevocably lost. Since with some protocols it is - perfectly legal for the client to wait indefinitely for data, the stack may - never report a problem, and even when it does, it can take up to 20 minutes - for it to detect an issue. The curl option --keepalive-time enables - keep-alive support in the TCP/IP stack which makes it periodically probe the - connection to make sure it is still available to send data. That should - reliably detect any TCP/IP network failure. - - TCP keep alive will not detect the network going down before the TCP/IP - connection is established (e.g. during a DNS lookup) or using protocols that - do not use TCP. To handle those situations, curl offers a number of timeouts - on its own. --speed-limit/--speed-time will abort if the data transfer rate - falls too low, and --connect-timeout and --max-time can be used to put an - overall timeout on the connection phase or the entire transfer. - - A libcurl-using application running in a known physical environment (e.g. - an embedded device with only a single network connection) may want to act - immediately if its lone network connection goes down. That can be achieved - by having the application monitor the network connection on its own using an - OS-specific mechanism, then signaling libcurl to abort (see also item 5.13). - - 4.20 curl does not return error for HTTP non-200 responses - - Correct. Unless you use -f (--fail). - - When doing HTTP transfers, curl will perform exactly what you are asking it - to do and if successful it will not return an error. You can use curl to - test your web server's "file not found" page (that gets 404 back), you can - use it to check your authentication protected webpages (that gets a 401 - back) and so on. - - The specific HTTP response code does not constitute a problem or error for - curl. It simply sends and delivers HTTP as you asked and if that worked, - everything is fine and dandy. The response code is generally providing more - higher level error information that curl does not care about. The error was - not in the HTTP transfer. - - If you want your command line to treat error codes in the 400 and up range - as errors and thus return a non-zero value and possibly show an error - message, curl has a dedicated option for that: -f (CURLOPT_FAILONERROR in - libcurl speak). - - You can also use the -w option and the variable %{response_code} to extract - the exact response code that was returned in the response. - -5. libcurl Issues - - 5.1 Is libcurl thread-safe? - - Yes. - - We have written the libcurl code specifically adjusted for multi-threaded - programs. libcurl will use thread-safe functions instead of non-safe ones if - your system has such. Note that you must never share the same handle in - multiple threads. - - There may be some exceptions to thread safety depending on how libcurl was - built. Please review the guidelines for thread safety to learn more: - https://curl.se/libcurl/c/threadsafe.html - - 5.2 How can I receive all data into a large memory chunk? - - [ See also the examples/getinmemory.c source ] - - You are in full control of the callback function that gets called every time - there is data received from the remote server. You can make that callback do - whatever you want. You do not have to write the received data to a file. - - One solution to this problem could be to have a pointer to a struct that you - pass to the callback function. You set the pointer using the - CURLOPT_WRITEDATA option. Then that pointer will be passed to the callback - instead of a FILE * to a file: - - /* imaginary struct */ - struct MemoryStruct { - char *memory; - size_t size; - }; - - /* imaginary callback function */ - size_t - WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) - { - size_t realsize = size * nmemb; - struct MemoryStruct *mem = (struct MemoryStruct *)data; - - mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); - if(mem->memory) { - memcpy(&(mem->memory[mem->size]), ptr, realsize); - mem->size += realsize; - mem->memory[mem->size] = 0; - } - return realsize; - } - - 5.3 How do I fetch multiple files with libcurl? - - libcurl has excellent support for transferring multiple files. You should - just repeatedly set new URLs with curl_easy_setopt() and then transfer it - with curl_easy_perform(). The handle you get from curl_easy_init() is not - only reusable, but you are even encouraged to reuse it if you can, as that - will enable libcurl to use persistent connections. - - 5.4 Does libcurl do Winsock initialization on Win32 systems? - - Yes, if told to in the curl_global_init() call. - - 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ? - - Yes, but you cannot open a FILE * and pass the pointer to a DLL and have - that DLL use the FILE * (as the DLL and the client application cannot access - each others' variable memory areas). If you set CURLOPT_WRITEDATA you must - also use CURLOPT_WRITEFUNCTION as well to set a function that writes the - file, even if that simply writes the data to the specified FILE *. - Similarly, if you use CURLOPT_READDATA you must also specify - CURLOPT_READFUNCTION. - - 5.6 What about Keep-Alive or persistent connections? - - curl and libcurl have excellent support for persistent connections when - transferring several files from the same server. curl will attempt to reuse - connections for all URLs specified on the same command line/config file, and - libcurl will reuse connections for all transfers that are made using the - same libcurl handle. - - When you use the easy interface the connection cache is kept within the easy - handle. If you instead use the multi interface, the connection cache will be - kept within the multi handle and will be shared among all the easy handles - that are used within the same multi handle. - - 5.7 Link errors when building libcurl on Windows - - You need to make sure that your project, and all the libraries (both static - and dynamic) that it links against, are compiled/linked against the same run - time library. - - This is determined by the /MD, /ML, /MT (and their corresponding /M?d) - options to the command line compiler. /MD (linking against MSVCRT dll) seems - to be the most commonly used option. - - When building an application that uses the static libcurl library, you must - add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker will look for - dynamic import symbols. If you are using Visual Studio, you need to instead - add CURL_STATICLIB in the "Preprocessor Definitions" section. - - If you get a linker error like "unknown symbol __imp__curl_easy_init ..." you - have linked against the wrong (static) library. If you want to use the - libcurl.dll and import lib, you do not need any extra CFLAGS, but use one of - the import libraries below. These are the libraries produced by the various - lib/Makefile.* files: - - Target: static lib. import lib for libcurl*.dll. - ----------------------------------------------------------- - MinGW: libcurl.a libcurldll.a - MSVC (release): libcurl.lib libcurl_imp.lib - MSVC (debug): libcurld.lib libcurld_imp.lib - Borland: libcurl.lib libcurl_imp.lib - - 5.8 libcurl.so.X: open failed: No such file or directory - - This is an error message you might get when you try to run a program linked - with a shared version of libcurl and your runtime linker (ld.so) could not - find the shared library named libcurl.so.X. (Where X is the number of the - current libcurl ABI, typically 3 or 4). - - You need to make sure that ld.so finds libcurl.so.X. You can do that - multiple ways, and it differs somewhat between different operating systems. - They are usually: - - * Add an option to the linker command line that specify the hard-coded path - the runtime linker should check for the lib (usually -R) - - * Set an environment variable (LD_LIBRARY_PATH for example) where ld.so - should check for libs - - * Adjust the system's config to check for libs in the directory where you have - put the library (like Linux's /etc/ld.so.conf) - - 'man ld.so' and 'man ld' will tell you more details - - 5.9 How does libcurl resolve hostnames? - - libcurl supports a large number of name resolve functions. One of them is - picked at build-time and will be used unconditionally. Thus, if you want to - change name resolver function you must rebuild libcurl and tell it to use a - different function. - - - The non-IPv6 resolver that can use one of four different hostname resolve - calls (depending on what your system supports): - - A - gethostbyname() - B - gethostbyname_r() with 3 arguments - C - gethostbyname_r() with 5 arguments - D - gethostbyname_r() with 6 arguments - - - The IPv6-resolver that uses getaddrinfo() - - - The c-ares based name resolver that uses the c-ares library for resolves. - Using this offers asynchronous name resolves. - - - The threaded resolver (default option on Windows). It uses: - - A - gethostbyname() on plain IPv4 hosts - B - getaddrinfo() on IPv6 enabled hosts - - Also note that libcurl never resolves or reverse-lookups addresses given as - pure numbers, such as 127.0.0.1 or ::1. - - 5.10 How do I prevent libcurl from writing the response to stdout? - - libcurl provides a default built-in write function that writes received data - to stdout. Set the CURLOPT_WRITEFUNCTION to receive the data, or possibly - set CURLOPT_WRITEDATA to a different FILE * handle. - - 5.11 How do I make libcurl not receive the whole HTTP response? - - You make the write callback (or progress callback) return an error and - libcurl will then abort the transfer. - - 5.12 Can I make libcurl fake or hide my real IP address? - - No. libcurl operates on a higher level. Besides, faking IP address would - imply sending IP packets with a made-up source address, and then you normally - get a problem with receiving the packet sent back as they would then not be - routed to you. - - If you use a proxy to access remote sites, the sites will not see your local - IP address but instead the address of the proxy. - - Also note that on many networks NATs or other IP-munging techniques are used - that makes you see and use a different IP address locally than what the - remote server will see you coming from. You may also consider using - https://www.torproject.org/ . - - 5.13 How do I stop an ongoing transfer? - - With the easy interface you make sure to return the correct error code from - one of the callbacks, but none of them are instant. There is no function you - can call from another thread or similar that will stop it immediately. - Instead, you need to make sure that one of the callbacks you use returns an - appropriate value that will stop the transfer. Suitable callbacks that you - can do this with include the progress callback, the read callback and the - write callback. - - If you are using the multi interface, you can also stop a transfer by - removing the particular easy handle from the multi stack at any moment you - think the transfer is done or when you wish to abort the transfer. - - 5.14 Using C++ non-static functions for callbacks? - - libcurl is a C library, it does not know anything about C++ member functions. - - You can overcome this "limitation" with relative ease using a static - member function that is passed a pointer to the class: - - // f is the pointer to your object. - static size_t YourClass::func(void *buffer, size_t sz, size_t n, void *f) - { - // Call non-static member function. - static_cast(f)->nonStaticFunction(); - } - - // This is how you pass pointer to the static function: - curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass::func); - curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this); - - 5.15 How do I get an FTP directory listing? - - If you end the FTP URL you request with a slash, libcurl will provide you - with a directory listing of that given directory. You can also set - CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use - to list the files. - - The follow-up question tends to be how is a program supposed to parse the - directory listing. How does it know what's a file and what's a directory and - what's a symlink etc. If the FTP server supports the MLSD command then it - will return data in a machine-readable format that can be parsed for type. - The types are specified by RFC 3659 section 7.5.1. If MLSD is not supported - then you have to work with what you are given. The LIST output format is - entirely at the server's own liking and the NLST output does not reveal any - types and in many cases does not even include all the directory entries. - Also, both LIST and NLST tend to hide Unix-style hidden files (those that - start with a dot) by default so you need to do "LIST -a" or similar to see - them. - - Example - List only directories. - ftp.funet.fi supports MLSD and ftp.kernel.org does not: - - curl -s ftp.funet.fi/pub/ -X MLSD | \ - perl -lne 'print if s/(?:^|;)type=dir;[^ ]+ (.+)$/$1/' - - curl -s ftp.kernel.org/pub/linux/kernel/ | \ - perl -lne 'print if s/^d[-rwx]{9}(?: +[^ ]+){7} (.+)$/$1/' - - If you need to parse LIST output in libcurl one such existing - list parser is available at https://cr.yp.to/ftpparse.html Versions of - libcurl since 7.21.0 also provide the ability to specify a wildcard to - download multiple files from one FTP directory. - - 5.16 I want a different time-out - - Sometimes users realize that CURLOPT_TIMEOUT and CURLOPT_CONNECTIMEOUT are - not sufficiently advanced or flexible to cover all the various use cases and - scenarios applications end up with. - - libcurl offers many more ways to time-out operations. A common alternative - is to use the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME options to - specify the lowest possible speed to accept before to consider the transfer - timed out. - - The most flexible way is by writing your own time-out logic and using - CURLOPT_XFERINFOFUNCTION (perhaps in combination with other callbacks) and - use that to figure out exactly when the right condition is met when the - transfer should get stopped. - - 5.17 Can I write a server with libcurl? - - No. libcurl offers no functions or building blocks to build any kind of - Internet protocol server. libcurl is only a client-side library. For server - libraries, you need to continue your search elsewhere but there exist many - good open source ones out there for most protocols you could want a server - for. There are also really good stand-alone servers that have been tested - and proven for many years. There is no need for you to reinvent them. - - 5.18 Does libcurl use threads? - - Put simply: no, libcurl will execute in the same thread you call it in. All - callbacks will be called in the same thread as the one you call libcurl in. - - If you want to avoid your thread to be blocked by the libcurl call, you make - sure you use the non-blocking multi API which will do transfers - asynchronously - still in the same single thread. - - libcurl will potentially internally use threads for name resolving, if it - was built to work like that, but in those cases it will create the child - threads by itself and they will only be used and then killed internally by - libcurl and never exposed to the outside. - -6. License Issues - - curl and libcurl are released under an MIT/X derivative license. The license - is liberal and should not impose a problem for your project. This section is - just a brief summary for the cases we get the most questions. (Parts of this - section was much enhanced by Bjorn Reese.) - - We are not lawyers and this is not legal advice. You should probably consult - one if you want true and accurate legal insights without our prejudice. Note - especially that this section concerns the libcurl license only; compiling in - features of libcurl that depend on other libraries (e.g. OpenSSL) may affect - the licensing obligations of your application. - - 6.1 I have a GPL program, can I use the libcurl library? - - Yes - - Since libcurl may be distributed under the MIT/X derivative license, it can - be used together with GPL in any software. - - 6.2 I have a closed-source program, can I use the libcurl library? - - Yes - - libcurl does not put any restrictions on the program that uses the library. - - 6.3 I have a BSD licensed program, can I use the libcurl library? - - Yes - - libcurl does not put any restrictions on the program that uses the library. - - 6.4 I have a program that uses LGPL libraries, can I use libcurl? - - Yes - - The LGPL license does not clash with other licenses. - - 6.5 Can I modify curl/libcurl for my program and keep the changes secret? - - Yes - - The MIT/X derivative license practically allows you to do almost anything - with the sources, on the condition that the copyright texts in the sources - are left intact. - - 6.6 Can you please change the curl/libcurl license to XXXX? - - No. - - We have carefully picked this license after years of development and - discussions and a large amount of people have contributed with source code - knowing that this is the license we use. This license puts the restrictions - we want on curl/libcurl and it does not spread to other programs or - libraries that use it. It should be possible for everyone to use libcurl or - curl in their projects, no matter what license they already have in use. - - 6.7 What are my obligations when using libcurl in my commercial apps? - - Next to none. All you need to adhere to is the MIT-style license (stated in - the COPYING file) which basically says you have to include the copyright - notice in "all copies" and that you may not use the copyright holder's name - when promoting your software. - - You do not have to release any of your source code. - - You do not have to reveal or make public any changes to the libcurl source - code. - - You do not have to broadcast to the world that you are using libcurl within - your app. - - All we ask is that you disclose "the copyright notice and this permission - notice" somewhere. Most probably like in the documentation or in the section - where other third party dependencies already are mentioned and acknowledged. - - As can be seen here: https://curl.se/docs/companies.html and elsewhere, - more and more companies are discovering the power of libcurl and take - advantage of it even in commercial environments. - - -7. PHP/CURL Issues - - 7.1 What is PHP/CURL? - - The module for PHP that makes it possible for PHP programs to access curl- - functions from within PHP. - - In the curl project we call this module PHP/CURL to differentiate it from - curl the command line tool and libcurl the library. The PHP team however - does not refer to it like this (for unknown reasons). They call it plain - CURL (often using all caps) or sometimes ext/curl, but both cause much - confusion to users which in turn gives us a higher question load. - - 7.2 Who wrote PHP/CURL? - - PHP/CURL was initially written by Sterling Hughes. - - 7.3 Can I perform multiple requests using the same handle? - - Yes - at least in PHP version 4.3.8 and later (this has been known to not - work in earlier versions, but the exact version when it started to work is - unknown to me). - - After a transfer, you just set new options in the handle and make another - transfer. This will make libcurl reuse the same connection if it can. - - 7.4 Does PHP/CURL have dependencies? - - PHP/CURL is a module that comes with the regular PHP package. It depends on - and uses libcurl, so you need to have libcurl installed properly before - PHP/CURL can be used. - -8. Development - - 8.1 Why does curl use C89? - - As with everything in curl, there is a history and we keep using what we have - used before until someone brings up the subject and argues for and works on - changing it. - - We started out using C89 in the 1990s because that was the only way to write - a truly portable C program and have it run as widely as possible. C89 was for - a long time even necessary to make things work on otherwise considered modern - platforms such as Windows. Today, we do not really know how many users that - still require the use of a C89 compiler. - - We will continue to use C89 for as long as nobody brings up a strong enough - reason for us to change our minds. The core developers of the project do not - feel restricted by this and we are not convinced that going C99 will offer us - enough of a benefit to warrant the risk of cutting off a share of users. - - 8.2 Will curl be rewritten? - - In one go: no. Little by little over time? Maybe. - - Over the years, new languages and clever operating environments come and go. - Every now and then the urge apparently arises to request that we rewrite curl - in another language. - - Some the most important properties in curl are maintaining the API and ABI - for libcurl and keeping the behavior for the command line tool. As long as we - can do that, everything else is up for discussion. To maintain the ABI, we - probably have to maintain a certain amount of code in C, and to remain rock - stable, we will never risk anything by rewriting a lot of things in one go. - That said, we can certainly offer more and more optional backends written in - other languages, as long as those backends can be plugged in at build-time. - Backends can be written in any language, but should probably provide APIs - usable from C to ease integration and transition. diff --git a/docs/FAQ.md b/docs/FAQ.md new file mode 100644 index 000000000000..ffef644418b2 --- /dev/null +++ b/docs/FAQ.md @@ -0,0 +1,1432 @@ + + +# Frequently Asked Questions + +# Philosophy + +## What is curl? + +curl is the name of the project. The name is a play on *Client for URLs*, +originally with URL spelled in uppercase to make it obvious it deals with +URLs. The fact it can also be read as *see URL* also helped, it works as an +abbreviation for *Client URL Request Library* or why not the recursive +version: *curl URL Request Library*. + +The curl project produces two products: + +### libcurl + +A client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, +GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, +RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + +libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, +Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password +authentication, file transfer resume, http proxy tunneling and more. + +libcurl is highly portable, it builds and works identically on numerous +platforms. The [internals document](https://curl.se/docs/install.html#Ports) +lists more than 110 operating systems and 28 CPU architectures on which curl +has been reported to run. + +libcurl is free, thread-safe, IPv6 compatible, feature rich, well supported +and fast. + +### curl + +A command line tool for getting or sending data using URL syntax. + +Since curl uses libcurl, curl supports the same wide range of common Internet +protocols that libcurl does. + +We pronounce curl with an initial k sound. It rhymes with words like girl and +earl. [This is a short WAV +file](https://media.merriam-webster.com/soundc11/c/curl0001.wav) to help you. + +There are numerous sub-projects and related projects that also use the word +curl in the project names in various combinations, but you should take notice +that this FAQ is directed at the command-line tool named curl (and libcurl the +library), and may therefore not be valid for other curl-related projects. +(There is however a small section for the PHP/CURL in this FAQ.) + +## What is libcurl? + +libcurl is a reliable and portable library for doing Internet data transfers +using one or more of its supported Internet protocols. + +You can use libcurl freely in your application, be it open source, commercial +or closed-source. + +libcurl is most probably the most portable, most powerful and most often used +C-based multi-platform file transfer library on this planet - be it open +source or commercial. + +## What is curl not? + +curl is not a Wget clone. That is a common misconception. Never, during curl's +development, have we intended curl to replace Wget or compete on its market. +curl is targeted at single-shot file transfers. + +curl is not a website mirroring program. If you want to use curl to mirror +something: fine, go ahead and write a script that wraps around curl or use +libcurl to make it reality. + +curl is not an FTP site mirroring program. Sure, get and send FTP with curl +but if you want systematic and sequential behavior you should write a script +(or write a new program that interfaces libcurl) and do it. + +curl is not a PHP tool, even though it works perfectly well when used from or +with PHP (when using the PHP/CURL module). + +curl is not a program for a single operating system. curl exists, compiles, +builds and runs under a wide range of operating systems, including all modern +Unixes (and a bunch of older ones too), Windows, Amiga, OS/2, macOS, QNX etc. + +## When will you make curl do ... ? + +We love suggestions of what to change in order to make curl and libcurl +better. We do however believe in a few rules when it comes to the future of +curl: + +curl the command line tool is to remain a non-graphical command line tool. If +you want GUIs or fancy scripting capabilities, you should look for another +tool that uses libcurl. + +We do not add things to curl that other small and available tools already do +well at the side. curl's output can be piped into another program or +redirected to another file for the next program to interpret. + +We focus on protocol related issues and improvements. If you want to do more +magic with the supported protocols than curl currently does, chances are good +we will agree. If you want to add more protocols, we may agree. + +If you want someone else to do all the work while you wait for us to implement +it for you, that is not a friendly attitude. We spend a considerable time +already on maintaining and developing curl. In order to get more out of us, +you should consider trading in some of your time and effort in return. Simply +go to the [GitHub repository](https://github.com/curl/curl), fork the project, +and create pull requests with your proposed changes. + +If you write the code, chances are better that it will get into curl faster. + +## Who makes curl? + +curl and libcurl are not made by any single individual. Daniel Stenberg is +project leader and main developer, but other persons' submissions are +important and crucial. Anyone can contribute and post their changes and +improvements and have them inserted in the main sources (of course on the +condition that developers agree that the fixes are good). + +The full list of all contributors is found in the docs/THANKS file. + +curl is developed by a community, with Daniel at the wheel. + +## What do you get for making curl? + +Project curl is entirely free and open. We do this voluntarily, mostly in our +spare time. Companies may pay individual developers to work on curl. This is +not controlled by nor supervised in any way by the curl project. + +We get help from companies. Haxx provides website, bandwidth, mailing lists +etc, GitHub hosts [the primary git repository](https://github.com/curl/curl) +and other services like the bug tracker. Also again, some companies have +sponsored certain parts of the development in the past and I hope some will +continue to do so in the future. + +If you want to [support our project](https://curl.se/sponsors.html), consider +a donation or a banner-program or even better: by helping us with coding, +documenting or testing etc. + +## What about CURL from curl.com? + +During the summer of 2001, curl.com was busy advertising their client-side +programming language for the web, named CURL. + +We are in no way associated with curl.com or their CURL programming language. + +Our project name curl has been in effective use since 1998. We were not the +first computer related project to use the name *curl* and do not claim any +rights to the name. + +We recognize that we will be living in parallel with curl.com and wish them +every success. + +## I have a problem, who do I mail? + +Please do not mail any single individual unless you really need to. Keep +curl-related questions on a suitable mailing list. All available mailing lists +are listed [online](https://curl.se/mail/). + +Keeping curl-related questions and discussions on mailing lists allows others +to join in and help, to share their ideas, to contribute their suggestions and +to spread their wisdom. Keeping discussions on public mailing lists also +allows for others to learn from this (both current and future users thanks to +the web based archives of the mailing lists), thus saving us from having to +repeat ourselves even more. Thanks for respecting this. + +If you have found or simply suspect a security problem in curl or libcurl, +submit all the details at [HackerOne](https://hackerone.com/curl). On there we +keep the issue private while we investigate, confirm it, work and validate a +fix and agree on a time schedule for publication etc. That way we produce a +fix in a timely manner before the flaw is announced to the world, reducing the +impact the problem risks having on existing users. + +Security issues can also be taking to the curl security team by emailing +security at curl.se (closed list of receivers, mails are not disclosed). + +## Where do I buy commercial support for curl? + +curl is fully open source. It means you can hire any skilled engineer to fix +your curl-related problems. + +We list [available alternatives](https://curl.se/support.html). + +## How many are using curl? + +It is impossible to tell. + +We do not know how many users that knowingly have installed and use curl. + +We do not know how many users that use curl without knowing that they are in +fact using it. + +We do not know how many users that downloaded or installed curl and then never +use it. + +In 2025, we estimate that curl runs in roughly thirty billion installations +world wide. + +## Why do you not update ca-bundle.crt + +In the curl project we have decided not to attempt to keep this file updated +(or even present) since deciding what to add to a ca cert bundle is an +undertaking we have not been ready to accept, and the one we can get from +Mozilla is perfectly fine so there is no need to duplicate that work. + +Today, with many services performed over HTTPS, every operating system should +come with a default ca cert bundle that can be deemed somewhat trustworthy and +that collection (if reasonably updated) should be deemed to be a lot better +than a private curl version. + +If you want the most recent collection of ca certs that Mozilla Firefox uses, +we recommend that using our online [CA certificate +service](https://curl.se/docs/caextract.html) setup for this purpose. + +## I have a problem who, can I chat with? + +There is a bunch of friendly people hanging out in the #curl channel on the +IRC network libera.chat. If you are polite and nice, chances are good that you +can get -- or provide -- help instantly. + +## curl's ECCN number? + +The US government restricts exports of software that contains or uses +cryptography. When doing so, the Export Control Classification Number (ECCN) +is used to identify the level of export control etc. + +Apache Software Foundation has [a good explanation of +ECCN](https://www.apache.org/dev/crypto.html). + +We believe curl's number might be ECCN 5D002, another possibility is 5D992. It +seems necessary to write them (the authority that administers ECCN numbers), +asking to confirm. + +Comprehensible explanations of the meaning of such numbers and how to obtain +them (resp.) are [here](https://www.bis.gov/licensing/classify-your-item) +and [here](https://www.bis.gov/licensing/classify-your-item/publicly-available-classification-information). + +An incomprehensible description of the two numbers above is available on +[bis.doc.gov](https://www.bis.doc.gov/index.php/documents/new-encryption/1653-ccl5-pt2-3) + +## How do I submit my patch? + +We strongly encourage you to submit changes and improvements directly as [pull +requests on GitHub](https://github.com/curl/curl/pulls). + +If you for any reason cannot or will not deal with GitHub, send your patch to +the curl-library mailing list. We are many subscribers there and there are +lots of people who can review patches, comment on them and receive them +properly. + +Lots of more details are found in the +[contribute](https://curl.se/dev/contribute.html) and +[internals](https://curl.se/dev/internals.html) +documents. + +## How do I port libcurl to my OS? + +Here's a rough step-by-step: + +1. copy a suitable lib/config-*.h file as a start to `lib/config-[youros].h` +2. edit `lib/config-[youros].h` to match your OS and setup +3. edit `lib/curl_setup.h` to include `config-[youros].h` when your OS is + detected by the preprocessor, in the style others already exist +4. compile `lib/*.c` and make them into a library + +# Install + +## configure fails when using static libraries + +You may find that configure fails to properly detect the entire dependency +chain of libraries when you provide static versions of the libraries that +configure checks for. + +The reason why static libraries is much harder to deal with is that for them +we do not get any help but the script itself must know or check what more +libraries that are needed (with shared libraries, that dependency chain is +handled automatically). This is an error-prone process and one that also tends +to vary over time depending on the release versions of the involved components +and may also differ between operating systems. + +For that reason, configure does few attempts to actually figure this out and +you are instead encouraged to set `LIBS` and `LDFLAGS` accordingly when you invoke +configure, and point out the needed libraries and set the necessary flags +yourself. + +## Does curl work with other SSL libraries? + +curl has been written to use a generic SSL function layer internally, and +that SSL functionality can then be provided by one out of many different SSL +backends. + +curl can be built to use one of the following SSL alternatives: OpenSSL, +LibreSSL, BoringSSL, AWS-LC, GnuTLS, wolfSSL, mbedTLS, Schannel (native +Windows) or Rustls. They all have their pros and cons, and we maintain [a TLS +library comparison](https://curl.se/docs/ssl-compared.html). + +## How do I upgrade curl.exe in Windows? + +The curl tool that is shipped as an integrated component of Windows 10 and +Windows 11 is managed by Microsoft. If you were to delete the file or replace +it with a newer version downloaded from [the curl +website](https://curl.se/windows), then Windows Update will cease to work on +your system. + +There is no way to independently force an upgrade of the curl.exe that is part +of Windows other than through the regular Windows update process. There is +also nothing the curl project itself can do about this, since this is managed +and controlled entirely by Microsoft as owners of the operating system. + +You can always download and install [the latest version of curl for +Windows](https://curl.se/windows) into a separate location. + +## Does curl support SOCKS (RFC 1928) ? + +Yes, SOCKS 4 and 5 are supported. + +# Usage + +## curl: (1) SSL is disabled, https: not supported + +If you get this output when trying to get anything from an HTTPS server, it +means that the instance of curl/libcurl that you are using was built without +support for this protocol. + +This could have happened if the configure script that was run at build time +could not find all libs and include files curl requires for SSL to work. If +the configure script fails to find them, curl is simply built without SSL +support. + +To get HTTPS support into a curl that was previously built but that reports +that HTTPS is not supported, you should dig through the document and logs and +check out why the configure script does not find the SSL libs and/or include +files. + +## How do I tell curl to resume a transfer? + +curl supports resumed transfers both ways on both FTP and HTTP. Try the `-C` +option. + +## Why does my posting using -F not work? + +You cannot arbitrarily use `-F` or `-d`, the choice between `-F` or `-d` +depends on the HTTP operation you need curl to do and what the web server that +will receive your post expects. + +If the form you are trying to submit uses the type 'multipart/form-data', +then and only then you must use the -F type. In all the most common cases, +you should use `-d` which then causes a posting with the type +`application/x-www-form-urlencoded`. + +This is described in some detail in the +[Manual](https://curl.se/docs/tutorial.html) and [The Art Of HTTP +Scripting](https://curl.se/docs/httpscripting.html) documents, and if you do +not understand it the first time, read it again before you post questions +about this to the mailing list. Also, try reading through the mailing list +archives for old postings and questions regarding this. + +## How do I tell curl to run custom FTP commands? + +You can tell curl to perform optional commands both before and/or after a file +transfer. Study the `-Q`/`--quote` option. + +Since curl is used for file transfers, you do not normally use curl to perform +FTP commands without transferring anything. Therefore you must always specify +a URL to transfer to/from even when doing custom FTP commands, or use `-I` +which implies the *no body*" option sent to libcurl. + +## How can I disable the Accept: header? + +You can change this and all internally generated headers by adding a +replacement with the `-H`/`--header` option. By adding a header with empty +contents you safely disable that one. Use `-H Accept:` to disable that +specific header. + +## Does curl support ASP, XML, XHTML or HTML version Y? + +To curl, all contents are alike. It does not matter how the page was +generated. It may be ASP, PHP, Perl, shell-script, SSI or plain HTML +files. There is no difference to curl and it does not even know what kind of +language that generated the page. + +See also the separate question about JavaScript. + +## Can I use curl to delete/rename a file through FTP? + +Yes. You specify custom FTP commands with `-Q`/`--quote`. + +One example would be to delete a file after you have downloaded it: + + curl -O ftp://example.com/coolfile -Q '-DELE coolfile' + +or rename a file after upload: + + curl -T infile ftp://example.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname" + +## How do I tell curl to follow HTTP redirects? + +curl does not follow so-called redirects by default. The `Location:` header that +informs the client about this is only interpreted if you are using the +`-L`/`--location` option. As in: + + curl -L https://example.com + +Not all redirects are HTTP ones. See [Redirects work in browser but not with +curl](#redirects-work-in-browser-but-not-with-curl) + +## How do I use curl in my favorite programming language? + +Many programming languages have interfaces and bindings that allow you to use +curl without having to use the command line tool. If you are fluent in such a +language, you may prefer to use one of these interfaces instead. + +Find out more about which languages that support curl directly, and how to +install and use them, in the [libcurl section of the curl +website](https://curl.se/libcurl/). + +All the various bindings to libcurl are made by other projects and people, +outside of the curl project. The curl project itself only produces libcurl +with its plain C API. If you do not find anywhere else to ask you can ask +about bindings on the curl-library list too, but be prepared that people on +that list may not know anything about bindings. + +In December 2025 there were around **60** different [interfaces +available](https://curl.se/libcurl/bindings.html) for just about all the +languages you can imagine. + +## What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? + +curl adheres to the HTTP spec, which basically means you can play with *any* +protocol that is built on top of HTTP. Protocols such as SOAP, WebDAV and +XML-RPC are all such ones. You can use `-X` to set custom requests and -H to +set custom headers (or replace internally generated ones). + +Using libcurl is of course just as good and you would just use the proper +library options to do the same. + +## How do I POST with a different Content-Type? + +You can always replace the internally generated headers with `-H`/`--header`. +To make a simple HTTP POST with `text/xml` as content-type, do something like: + + curl -d "datatopost" -H "Content-Type: text/xml" [URL] + +## Why do FTP-specific features over HTTP proxy fail? + +Because when you use an HTTP proxy, the protocol spoken on the network will be +HTTP, even if you specify an FTP URL. This effectively means that you normally +cannot use FTP-specific features such as FTP upload and FTP quote etc. + +There is one exception to this rule, and that is if you can *tunnel through* +the given HTTP proxy. Proxy tunneling is enabled with a special option (`-p`) +and is generally not available as proxy admins usually disable tunneling to +ports other than 443 (which is used for HTTPS access through proxies). + +## Why do my single/double quotes fail? + +To specify a command line option that includes spaces, you might need to put +the entire option within quotes. Like in: + + curl -d " with spaces " example.com + +or perhaps + + curl -d ' with spaces ' example.com + +Exactly what kind of quotes and how to do this is entirely up to the shell or +command line interpreter that you are using. For most Unix shells, you can +more or less pick either single (`'`) or double (`"`) quotes. For Windows/DOS +command prompts you must use double (") quotes, and if the option string +contains inner double quotes you can escape them with a backslash. + +For Windows PowerShell the arguments are not always passed on as expected +because curl is not a PowerShell script. You may or may not be able to use +single quotes. To escape inner double quotes seems to require a +backslash-backtick escape sequence and the outer quotes as double quotes. + +Please study the documentation for your particular environment. Examples in +the curl docs will use a mix of both of these as shown above. You must adjust +them to work in your environment. + +Remember that curl works and runs on more operating systems than most single +individuals have ever tried. + +## Does curl support JavaScript or PAC (automated proxy config)? + +Many webpages do magic stuff using embedded JavaScript. curl and libcurl have +no built-in support for that, so it will be treated just like any other +contents. + +`.pac` files are a Netscape invention and are sometimes used by organizations +to allow them to differentiate which proxies to use. The `.pac` contents is +just a JavaScript program that gets invoked by the browser and that returns +the name of the proxy to connect to. Since curl does not support JavaScript, +it cannot support .pac proxy configuration either. + +Some workarounds usually suggested to overcome this JavaScript dependency: + +Depending on the JavaScript complexity, write up a script that translates it +to another language and execute that. + +Read the JavaScript code and rewrite the same logic in another language. + +Implement a JavaScript interpreter, people have successfully used the +Mozilla JavaScript engine in the past. + +Ask your admins to stop this, for a static proxy setup or similar. + +## Can I do recursive fetches with curl? + +No. curl itself has no code that performs recursive operations, such as those +performed by Wget and similar tools. + +There exists curl using scripts with that functionality, and you can write +programs based on libcurl to do it, but the command line tool curl itself +cannot. + +## What certificates do I need when I use SSL? + +There are three different kinds of certificates to keep track of when we talk +about using SSL-based protocols (HTTPS or FTPS) using curl or libcurl. + +### Client certificate + +The server you communicate with may require that you can provide this in +order to prove that you actually are who you claim to be. If the server +does not require this, you do not need a client certificate. + +A client certificate is always used together with a private key, and the +private key has a passphrase that protects it. + +### Server certificate + +The server you communicate with has a server certificate. You can and should +verify this certificate to make sure that you are truly talking to the real +server and not a server impersonating it. + +Servers often also provide an intermediate certificate. It acts as a bridge +between a website's SSL certificate and a Certificate Authority's (CA) root +certificate, creating a "chain of trust". + +### Certificate Authority Certificate ("CA cert") + +You often have several CA certs in a CA cert bundle that can be used to verify +a server certificate that was signed by one of the authorities in the bundle. +curl does not come with a CA cert bundle but most curl installs provide one. +You can also override the default. + +Server certificate verification is enabled by default in curl and libcurl. +Server certificates that are *self-signed* or otherwise signed by a CA that +you do not have a CA cert for, cannot be verified. If the verification during +a connect fails, you are refused access. You then might have to explicitly +disable the verification to connect to the server. + +## How do I list the root directory of an FTP server? + +There are two ways. The way defined in the RFC is to use an encoded slash in +the first path part. List the `/tmp` directory like this: + + curl ftp://ftp.example.com/%2ftmp/ + +or the not-quite-kosher-but-more-readable way, by simply starting the path +section of the URL with a slash: + + curl ftp://ftp.example.com//tmp/ + +## Can I use curl to send a POST/PUT and not wait for a response? + +No. + +You can easily write your own program using libcurl to do such stunts. + +## How do I get HTTP from a host using a specific IP address? + +For example, you may be trying out a website installation that is not yet in +the DNS. Or you have a site using multiple IP addresses for a given host +name and you want to address a specific one out of the set. + +Set a custom `Host:` header that identifies the server name you want to reach +but use the target IP address in the URL: + + curl --header "Host: www.example.com" https://somewhere.example/ + +You can also opt to add faked hostname entries to curl with the --resolve +option. That has the added benefit that things like redirects will also work +properly. The above operation would instead be done as: + + curl --resolve www.example.com:80:127.0.0.1 https://www.example.com/ + +## How to SFTP from my user's home directory? + +Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to +work with. It means that if you do not specify that you want the user's home +directory, you get the actual root directory. + +To specify a file in your user's home directory, you need to use the correct +URL syntax which for SFTP might look similar to: + + curl -O -u user:password sftp://example.com/~/file.txt + +and for SCP it is just a different protocol prefix: + + curl -O -u user:password scp://example.com/~/file.txt + +## Protocol xxx not supported or disabled in libcurl + +When passing on a URL to curl to use, it may respond that the particular +protocol is not supported or disabled. The particular way this error message +is phrased is because curl does not make a distinction internally of whether a +particular protocol is not supported (i.e. never got any code added that knows +how to speak that protocol) or if it was explicitly disabled. curl can be +built to only support a given set of protocols, and the rest would then be +disabled or not supported. + +Note that this error will also occur if you pass a wrongly spelled protocol +part as in `htpts://example.com` or as in the less evident case if you prefix +the protocol part with a space as in `" https://example.com/"`. + +## curl `-X` gives me HTTP problems + +In normal circumstances, `-X` should hardly ever be used. + +By default you use curl without explicitly saying which request method to use +when the URL identifies an HTTP transfer. If you just pass in a URL like `curl +https://example.com` it will use GET. If you use `-d` or `-F`, curl will use +POST, `-I` will cause a HEAD and `-T` will make it a PUT. + +If for whatever reason you are not happy with these default choices that curl +does for you, you can override those request methods by specifying `-X +[WHATEVER]`. This way you can for example send a DELETE by doing +`curl -X DELETE [URL]`. + +It is thus pointless to do `curl -XGET [URL]` as GET would be used anyway. In +the same vein it is pointless to do `curl -X POST -d data [URL`. You can make +a fun and somewhat rare request that sends a request-body in a GET request +with something like `curl -X GET -d data [URL]`. + +Note that `-X` does not actually change curl's behavior as it only modifies +the actual string sent in the request, but that may of course trigger a +different set of events. + +Accordingly, by using `-XPOST` on a command line that for example would follow +a 303 redirect, you will effectively prevent curl from behaving correctly. Be +aware. + +# Running + +## Why do I get problems when I use & or % in the URL? + +In general Unix shells, the & symbol is treated specially and when used, it +runs the specified command in the background. To safely send the & as a part +of a URL, you should quote the entire URL by using single (`'`) or double +(`"`) quotes around it. Similar problems can also occur on some shells with +other characters, including ?*!$~(){}<>\|;`. When in doubt, quote the URL. + +An example that would invoke a remote CGI that uses &-symbols could be: + + curl 'https://www.example.com/cgi-bin/query?text=yes&q=curl' + +In Windows, the standard DOS shell treats the percent sign specially and you +need to use TWO percent signs for each single one you want to use in the URL. + +If you want a literal percent sign to be part of the data you pass in a POST +using `-d`/`--data` you must encode it as `%25` (which then also needs the +percent sign doubled on Windows machines). + +## How can I use {, }, [ or ] to specify multiple URLs? + +Because those letters have a special meaning to the shell, to be used in a URL +specified to curl you must quote them. + +An example that downloads two URLs (sequentially) would be: + + curl '{curl,www}.haxx.se' + +To be able to use those characters as actual parts of the URL (without using +them for the curl URL *globbing* system), use the `-g`/`--globoff` option: + + curl -g 'www.example.com/weirdname[].html' + +## Why do I get downloaded data even though the webpage does not exist? + +curl asks remote servers for the page you specify. If the page does not exist +at the server, the HTTP protocol defines how the server should respond and +that means that headers and a page will be returned. That is simply how HTTP +works. + +By using the `--fail` option you can tell curl explicitly to not get any data +if the HTTP return code does not say success. + +## Why do I get return code XXX from an HTTP server? + +RFC 2616 clearly explains the return codes. This is a short transcript. Go +read the RFC for exact details: + +### 400 Bad Request + +The request could not be understood by the server due to malformed +syntax. The client SHOULD NOT repeat the request without modifications. + +### 401 Unauthorized + +The request requires user authentication. + +### 403 Forbidden + +The server understood the request, but is refusing to fulfill it. +Authorization will not help and the request SHOULD NOT be repeated. + +### 404 Not Found + +The server has not found anything matching the Request-URI. No indication is +given as to whether the condition is temporary or permanent. + +### 405 Method Not Allowed + +The method specified in the Request-Line is not allowed for the resource +identified by the Request-URI. The response MUST include an `Allow:` header +containing a list of valid methods for the requested resource. + +### 301 Moved Permanently + +If you get this return code and an HTML output similar to this: + +

Moved Permanently

The document has moved here. + +it might be because you requested a directory URL but without the trailing +slash. Try the same operation again _with_ the trailing URL, or use the +`-L`/`--location` option to follow the redirection. + +## Can you tell me what error code 142 means? + +All curl error codes are described at the end of the man page, in the section +called **EXIT CODES**. + +Error codes that are larger than the highest documented error code means that +curl has exited due to a crash. This is a serious error, and we appreciate a +detailed bug report from you that describes how we could go ahead and repeat +this. + +## How do I keep usernames and passwords secret in curl command lines? + +This problem has two sides: + +The first part is to avoid having clear-text passwords in the command line so +that they do not appear in *ps* outputs and similar. That is easily avoided by +using the `-K` option to tell curl to read parameters from a file or stdin to +which you can pass the secret info. curl itself will also attempt to hide the +given password by blanking out the option - this does not work on all +platforms. + +To keep the passwords in your account secret from the rest of the world is +not a task that curl addresses. You could of course encrypt them somehow to +at least hide them from being read by human eyes, but that is not what +anyone would call security. + +Also note that regular HTTP (using Basic authentication) and FTP passwords are +sent as cleartext across the network. All it takes for anyone to fetch them is +to listen on the network. Eavesdropping is easy. Use more secure +authentication methods (like Digest, Negotiate or even NTLM) or consider the +SSL-based alternatives HTTPS and FTPS. + +## I found a bug + +It is not a bug if the behavior is documented. Read the docs first. Especially +check out the KNOWN_BUGS file, it may be a documented bug. + +If it is a problem with a binary you have downloaded or a package for your +particular platform, try contacting the person who built the package/archive +you have. + +If there is a bug, read the BUGS document first. Then report it as described +in there. + +## curl cannot authenticate to a server that requires NTLM? + +NTLM support requires OpenSSL, GnuTLS, mbedTLS or Microsoft Windows libraries +at build-time to provide this functionality. + +## My HTTP request using HEAD, PUT or DELETE does not work + +Many web servers allow or demand that the administrator configures the server +properly for these requests to work on the web server. + +Some servers seem to support HEAD only on certain kinds of URLs. + +To fully grasp this, try the documentation for the particular server software +you are trying to interact with. This is not anything curl can do anything +about. + +## Why do my HTTP range requests return the full document? + +Because the range may not be supported by the server, or the server may choose +to ignore it and return the full document anyway. + +## Why do I get "certificate verify failed" ? + +When you invoke curl and get an error 60 error back it means that curl could +not verify that the server's certificate was good. curl verifies the +certificate using the CA cert bundle and verifying for which names the +certificate has been granted. + +To completely disable the certificate verification, use `-k`. This does +however enable man-in-the-middle attacks and makes the transfer **insecure**. +We strongly advise against doing this for more than experiments. + +If you get this failure with a CA cert bundle installed and used, the server's +certificate might not be signed by one of the certificate authorities in your +CA store. It might for example be self-signed. You then correct this problem +by obtaining a valid CA cert for the server. Or again, decrease the security +by disabling this check. + +At times, you find that the verification works in your favorite browser but +fails in curl. When this happens, the reason is usually that the server sends +an incomplete cert chain. The server is mandated to send all *intermediate +certificates* but does not. This typically works with browsers anyway since +they A) cache such certs and B) supports AIA which downloads such missing +certificates on demand. This is a bad server configuration. A good way to +figure out if this is the case it to use [the SSL Labs +server](https://www.ssllabs.com/ssltest/) test and check the certificate +chain. + +Details are also in [the SSL certificates +document](https://curl.se/docs/sslcerts.html). + + +## Why is curl -R on Windows one hour off? + +Since curl 7.53.0 this issue should be fixed as long as curl was built with +any modern compiler that allows for a 64-bit curl_off_t type. For older +compilers or prior curl versions it may set a time that appears one hour off. +This happens due to a flaw in how Windows stores and uses file modification +times and it is not easily worked around. For more details [read +this](https://www.codeproject.com/articles/Beating-the-Daylight-Savings-Time-Bug-and-Getting#comments-section). + +## Redirects work in browser but not with curl + +curl supports HTTP redirects well (see a previous question above). Browsers +generally support at least two other ways to perform redirects that curl does +not: + +Meta tags. You can write an HTML tag that will cause the browser to redirect +to another given URL after a certain time. + +JavaScript. You can write a JavaScript program embedded in an HTML page that +redirects the browser to another given URL. + +There is no way to make curl follow these redirects. You must either manually +figure out what the page is set to do, or write a script that parses the +results and fetches the new URL. + +## FTPS does not work + +curl supports FTPS (sometimes known as FTP-SSL) both implicit and explicit +mode. + +When a URL is used that starts with `FTPS://`, curl assumes implicit SSL on +the control connection and will therefore immediately connect and try to speak +SSL. `FTPS://` connections default to port 990. + +To use explicit FTPS, you use an `FTP://` URL and the `--ssl-reqd` option (or +one of its related flavors). This is the most common method, and the one +mandated by RFC 4217. This kind of connection will then of course use the +standard FTP port 21 by default. + +## My HTTP POST or PUT requests are slow + +libcurl makes all POST and PUT requests (except for requests with a small +request body) use the `Expect: 100-continue` header. This header allows the +server to deny the operation early so that libcurl can bail out before having +to send any data. This is useful in authentication cases and others. + +However, many servers do not implement the `Expect:` stuff properly and if the +server does not respond (positively) within 1 second libcurl will continue and +send off the data anyway. + +You can disable libcurl's use of the `Expect:` header the same way you disable +any header, using `-H` / `CURLOPT_HTTPHEADER`, or by forcing it to use HTTP +1.0. + +## Non-functional connect timeouts + +In most Windows setups having a timeout longer than 21 seconds make no +difference, as it will only send 3 TCP SYN packets and no more. The second +packet sent three seconds after the first and the third six seconds after +the second. No more than three packets are sent, no matter how long the +timeout is set. + +See option `TcpMaxConnectRetransmissions` on [this +page](https://support.microsoft.com/bg-bg/topic/hotfix-enables-the-configuration-of-the-tcp-maximum-syn-retransmission-amount-in-windows-7-or-windows-server-2008-r2-1b6f8352-2c5f-58bb-ead7-2cf021407c8e). + +Also, even on non-Windows systems there may run a firewall or anti-virus +software or similar that accepts the connection but does not actually do +anything else. This will make (lib)curl to consider the connection connected +and thus the connect timeout will not trigger. + +## file:// URLs containing drive letters (Windows, NetWare) + +When using curl to try to download a local file, one might use a URL in this +format: + + file://D:/blah.txt + +you will find that even if `D:\blah.txt` does exist, curl returns a 'file not +found' error. + +According to [RFC 1738](https://www.ietf.org/rfc/rfc1738.txt), `file://` URLs +must contain a host component, but it is ignored by most implementations. In +the above example, `D:` is treated as the host component, and is taken away. +Thus, curl tries to open `/blah.txt`. If your system is installed to drive C:, +that will resolve to `C:\blah.txt`, and if that does not exist you will get +the not found error. + +To fix this problem, use `file://` URLs with *three* leading slashes: + + file:///D:/blah.txt + +Alternatively, if it makes more sense, specify `localhost` as the host +component: + + file://localhost/D:/blah.txt + +In either case, curl should now be looking for the correct file. + +## Why does not curl return an error when the network cable is unplugged? + +Unplugging a cable is not an error situation. The TCP/IP protocol stack was +designed to be fault tolerant, so even though there may be a physical break +somewhere the connection should not be affected, just possibly delayed. +Eventually, the physical break will be fixed or the data will be re-routed +around the physical problem through another path. + +In such cases, the TCP/IP stack is responsible for detecting when the network +connection is irrevocably lost. Since with some protocols it is perfectly +legal for the client to wait indefinitely for data, the stack may never report +a problem, and even when it does, it can take up to 20 minutes for it to +detect an issue. The curl option `--keepalive-time` enables keep-alive support +in the TCP/IP stack which makes it periodically probe the connection to make +sure it is still available to send data. That should reliably detect any +TCP/IP network failure. + +TCP keep alive will not detect the network going down before the TCP/IP +connection is established (e.g. during a DNS lookup) or using protocols that +do not use TCP. To handle those situations, curl offers a number of timeouts +on its own. `--speed-limit`/`--speed-time` will abort if the data transfer +rate falls too low, and `--connect-timeout` and `--max-time` can be used to +put an overall timeout on the connection phase or the entire transfer. + +A libcurl-using application running in a known physical environment (e.g. an +embedded device with only a single network connection) may want to act +immediately if its lone network connection goes down. That can be achieved by +having the application monitor the network connection on its own using an +OS-specific mechanism, then signaling libcurl to abort. + +## curl does not return error for HTTP non-200 responses + +Correct. Unless you use `-f` (`--fail`) or `--fail-with-body`. + +When doing HTTP transfers, curl will perform exactly what you are asking it to +do and if successful it will not return an error. You can use curl to test +your web server's "file not found" page (that gets 404 back), you can use it +to check your authentication protected webpages (that gets a 401 back) and so +on. + +The specific HTTP response code does not constitute a problem or error for +curl. It simply sends and delivers HTTP as you asked and if that worked, +everything is fine and dandy. The response code is generally providing more +higher level error information that curl does not care about. The error was +not in the HTTP transfer. + +If you want your command line to treat error codes in the 400 and up range as +errors and thus return a non-zero value and possibly show an error message, +curl has a dedicated option for that: `-f` (`CURLOPT_FAILONERROR` in libcurl +speak). + +You can also use the `-w` option and the variable `%{response_code}` to +extract the exact response code that was returned in the response. + +# libcurl + +## Is libcurl thread-safe? + +Yes. + +We have written the libcurl code specifically adjusted for multi-threaded +programs. libcurl will use thread-safe functions instead of non-safe ones if +your system has such. Note that you must never share the same handle in +multiple threads. + +There may be some exceptions to thread safety depending on how libcurl was +built. Please review [the guidelines for thread +safety](https://curl.se/libcurl/c/threadsafe.html) to learn more. + +## How can I receive all data into a large memory chunk? + +(See the [get in memory](https://curl.se/libcurl/c/getinmemory.html) example.) + +You are in full control of the callback function that gets called every time +there is data received from the remote server. You can make that callback do +whatever you want. You do not have to write the received data to a file. + +One solution to this problem could be to have a pointer to a struct that you +pass to the callback function. You set the pointer using the CURLOPT_WRITEDATA +option. Then that pointer will be passed to the callback instead of a FILE * +to a file: + +~~~c +/* store data this struct */ +struct MemoryStruct { + char *memory; + size_t size; +}; + +/* imaginary callback function */ +size_t +WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) +{ + size_t realsize = size * nmemb; + struct MemoryStruct *mem = (struct MemoryStruct *)data; + + mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); + if(mem->memory) { + memcpy(&(mem->memory[mem->size]), ptr, realsize); + mem->size += realsize; + mem->memory[mem->size] = 0; + } + return realsize; +} +~~~ + +## How do I fetch multiple files with libcurl? + +libcurl has excellent support for transferring multiple files. You should just +repeatedly set new URLs with `curl_easy_setopt()` and then transfer it with +`curl_easy_perform()`. The handle you get from curl_easy_init() is not only +reusable, but you are even encouraged to reuse it if you can, as that will +enable libcurl to use persistent connections. + +## Does libcurl do Winsock initialization on Win32 systems? + +Yes, if told to in the `curl_global_init()` call. + +## Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ? + +Yes, but you cannot open a FILE * and pass the pointer to a DLL and have that +DLL use the FILE * (as the DLL and the client application cannot access each +others' variable memory areas). If you set `CURLOPT_WRITEDATA` you must also use +`CURLOPT_WRITEFUNCTION` as well to set a function that writes the file, even if +that simply writes the data to the specified FILE *. Similarly, if you use +`CURLOPT_READDATA` you must also specify `CURLOPT_READFUNCTION`. + +## What about Keep-Alive or persistent connections? + +curl and libcurl have excellent support for persistent connections when +transferring several files from the same server. curl will attempt to reuse +connections for all URLs specified on the same command line/config file, and +libcurl will reuse connections for all transfers that are made using the same +libcurl handle. + +When you use the easy interface the connection cache is kept within the easy +handle. If you instead use the multi interface, the connection cache will be +kept within the multi handle and will be shared among all the easy handles +that are used within the same multi handle. + +## Link errors when building libcurl on Windows + +You need to make sure that your project, and all the libraries (both static +and dynamic) that it links against, are compiled/linked against the same run +time library. + +This is determined by the `/MD`, `/ML`, `/MT` (and their corresponding `/M?d`) +options to the command line compiler. `/MD` (linking against `MSVCRT.dll`) +seems to be the most commonly used option. + +When building an application that uses the static libcurl library, you must +add `-DCURL_STATICLIB` to your `CFLAGS`. Otherwise the linker will look for +dynamic import symbols. If you are using Visual Studio, you need to instead +add `CURL_STATICLIB` in the "Preprocessor Definitions" section. + +If you get a linker error like `unknown symbol __imp__curl_easy_init ...` you +have linked against the wrong (static) library. If you want to use the +libcurl.dll and import lib, you do not need any extra `CFLAGS`, but use one of +the import libraries below. These are the libraries produced by the various +lib/Makefile.* files: + +| Target | static lib | import lib for DLL | +|----------------|----------------|--------------------| +| MinGW | `libcurl.a` | `libcurldll.a` | +| MSVC (release) | `libcurl.lib` | `libcurl_imp.lib` | +| MSVC (debug) | `libcurld.lib` | `libcurld_imp.lib` | + +## libcurl.so.X: open failed: No such file or directory + +This is an error message you might get when you try to run a program linked +with a shared version of libcurl and your runtime linker (`ld.so`) could not +find the shared library named `libcurl.so.X`. (Where X is the number of the +current libcurl ABI, typically 3 or 4). + +You need to make sure that `ld.so` finds `libcurl.so.X`. You can do that +multiple ways, and it differs somewhat between different operating systems. +They are usually: + +* Add an option to the linker command line that specify the hard-coded path + the runtime linker should check for the lib (usually `-R`) +* Set an environment variable (`LD_LIBRARY_PATH` for example) where `ld.so` + should check for libs +* Adjust the system's config to check for libs in the directory where you have + put the library (like Linux's `/etc/ld.so.conf`) + +`man ld.so` and`'man ld` will tell you more details + +## How does libcurl resolve hostnames? + +libcurl supports a large number of name resolve functions. One of them is +picked at build-time and will be used unconditionally. Thus, if you want to +change name resolver function you must rebuild libcurl and tell it to use a +different function. + +### The non-IPv6 resolver + +The non-IPv6 resolver that can use one of four different hostname resolve +calls depending on what your system supports: + +1. gethostbyname() +2. gethostbyname_r() with 3 arguments +3. gethostbyname_r() with 5 arguments +4. gethostbyname_r() with 6 arguments + +### The IPv6 resolver + +Uses getaddrinfo() + +### The cares resolver + +The c-ares based name resolver that uses the c-ares library for resolves. +Using this offers asynchronous name resolves. + +## The threaded resolver + +It uses the IPv6 or the non-IPv6 resolver solution in a temporary thread. + +## How do I prevent libcurl from writing the response to stdout? + +libcurl provides a default built-in write function that writes received data +to stdout. Set the `CURLOPT_WRITEFUNCTION` to receive the data, or possibly +set `CURLOPT_WRITEDATA` to a different FILE * handle. + +## How do I make libcurl not receive the whole HTTP response? + +You make the write callback (or progress callback) return an error and libcurl +will then abort the transfer. + +## Can I make libcurl fake or hide my real IP address? + +No. libcurl operates on a higher level. Besides, faking IP address would +imply sending IP packets with a made-up source address, and then you normally +get a problem with receiving the packet sent back as they would then not be +routed to you. + +If you use a proxy to access remote sites, the sites will not see your local +IP address but instead the address of the proxy. + +Also note that on many networks NATs or other IP-munging techniques are used +that makes you see and use a different IP address locally than what the remote +server will see you coming from. You may also consider using +[Tor]()https://www.torproject.org/). + +## How do I stop an ongoing transfer? + +With the easy interface you make sure to return the correct error code from +one of the callbacks, but none of them are instant. There is no function you +can call from another thread or similar that will stop it immediately. +Instead, you need to make sure that one of the callbacks you use returns an +appropriate value that will stop the transfer. Suitable callbacks that you can +do this with include the progress callback, the read callback and the write +callback. + +If you are using the multi interface, you can also stop a transfer by removing +the particular easy handle from the multi stack at any moment you think the +transfer is done or when you wish to abort the transfer. + +## Using C++ non-static functions for callbacks? + +libcurl is a C library, it does not know anything about C++ member functions. + +You can overcome this limitation with relative ease using a static member +function that is passed a pointer to the class: + +~~~c++ +// f is the pointer to your object. +static size_t YourClass::func(void *buffer, size_t sz, size_t n, void *f) +{ + // Call non-static member function. + static_cast(f)->nonStaticFunction(); +} + +// This is how you pass pointer to the static function: +curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass::func); +curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this); +~~~ + +## How do I get an FTP directory listing? + +If you end the FTP URL you request with a slash, libcurl will provide you with +a directory listing of that given directory. You can also set +`CURLOPT_CUSTOMREQUEST` to alter what exact listing command libcurl would use +to list the files. + +The follow-up question tends to be how is a program supposed to parse the +directory listing. How does it know what's a file and what's a directory and +what's a symlink etc. If the FTP server supports the `MLSD` command then it +will return data in a machine-readable format that can be parsed for type. The +types are specified by RFC 3659 section 7.5.1. If `MLSD` is not supported then +you have to work with what you are given. The `LIST` output format is entirely +at the server's own liking and the `NLST` output does not reveal any types and +in many cases does not even include all the directory entries. Also, both +`LIST` and `NLST` tend to hide Unix-style hidden files (those that start with +a dot) by default so you need to do `LIST -a` or similar to see them. + +Example - List only directories. `ftp.funet.fi` supports `MLSD` and +`ftp.kernel.org` does not: + + curl -s ftp.funet.fi/pub/ -X MLSD | \ + perl -lne 'print if s/(?:^|;)type=dir;[^ ]+ (.+)$/$1/' + + curl -s ftp.kernel.org/pub/linux/kernel/ | \ + perl -lne 'print if s/^d[-rwx]{9}(?: +[^ ]+){7} (.+)$/$1/' + +If you need to parse LIST output, libcurl provides the ability to specify a +wildcard to download multiple files from an FTP directory. + +## I want a different time-out + +Sometimes users realize that `CURLOPT_TIMEOUT` and `CURLOPT_CONNECTIMEOUT` are +not sufficiently advanced or flexible to cover all the various use cases and +scenarios applications end up with. + +libcurl offers many more ways to time-out operations. A common alternative is +to use the `CURLOPT_LOW_SPEED_LIMIT` and `CURLOPT_LOW_SPEED_TIME` options to +specify the lowest possible speed to accept before to consider the transfer +timed out. + +The most flexible way is by writing your own time-out logic and using +`CURLOPT_XFERINFOFUNCTION` (perhaps in combination with other callbacks) and +use that to figure out exactly when the right condition is met when the +transfer should get stopped. + +## Can I write a server with libcurl? + +No. libcurl offers no functions or building blocks to build any kind of +Internet protocol server. libcurl is only a client-side library. For server +libraries, you need to continue your search elsewhere but there exist many +good open source ones out there for most protocols you could want a server +for. There are also really good stand-alone servers that have been tested and +proven for many years. There is no need for you to reinvent them. + +## Does libcurl use threads? + +Put simply: no, libcurl will execute in the same thread you call it in. All +callbacks will be called in the same thread as the one you call libcurl in. + +If you want to avoid your thread to be blocked by the libcurl call, you make +sure you use the non-blocking multi API which will do transfers +asynchronously - still in the same single thread. + +libcurl will potentially internally use threads for name resolving, if it was +built to work like that, but in those cases it will create the child threads +by itself and they will only be used and then killed internally by libcurl and +never exposed to the outside. + +# License + +curl and libcurl are released under an MIT/X derivative license. The license +is liberal and should not impose a problem for your project. This section is +just a brief summary for the cases we get the most questions. + +We are not lawyers and this is not legal advice. You should probably consult +one if you want true and accurate legal insights without our prejudice. Note +especially that this section concerns the libcurl license only; compiling in +features of libcurl that depend on other libraries (e.g. OpenSSL) may affect +the licensing obligations of your application. + +## I have a GPL program, can I use the libcurl library? + +Yes + +Since libcurl may be distributed under the MIT/X derivative license, it can be +used together with GPL in any software. + +## I have a closed-source program, can I use the libcurl library? + +Yes + +libcurl does not put any restrictions on the program that uses the library. + +## I have a BSD licensed program, can I use the libcurl library? + +Yes + +libcurl does not put any restrictions on the program that uses the library. + +## I have a program that uses LGPL libraries, can I use libcurl? + +Yes + +The LGPL license does not clash with other licenses. + +## Can I modify curl/libcurl for my program and keep the changes secret? + +Yes + +The MIT/X derivative license practically allows you to do almost anything with +the sources, on the condition that the copyright texts in the sources are left +intact. + +## Can you please change the curl/libcurl license? + +No. + +We have carefully picked this license after years of development and +discussions and a large amount of people have contributed with source code +knowing that this is the license we use. This license puts the restrictions we +want on curl/libcurl and it does not spread to other programs or libraries +that use it. It should be possible for everyone to use libcurl or curl in +their projects, no matter what license they already have in use. + +## What are my obligations when using libcurl in my commercial apps? + +Next to none. All you need to adhere to is the MIT-style license (stated in +the COPYING file) which basically says you have to include the copyright +notice in *all copies* and that you may not use the copyright holder's name +when promoting your software. + +You do not have to release any of your source code. + +You do not have to reveal or make public any changes to the libcurl source +code. + +You do not have to broadcast to the world that you are using libcurl within +your app. + +All we ask is that you disclose *the copyright notice and this permission +notice* somewhere. Most probably like in the documentation or in the section +where other third party dependencies already are mentioned and acknowledged. + +As can be seen [here](https://curl.se/docs/companies.html) and elsewhere, more +and more companies are discovering the power of libcurl and take advantage of +it even in commercial environments. + +## What license does curl use exactly? + +curl is released under an [MIT derivative +license](https://curl.se/docs/copyright.html). It is similar but not identical +to the MIT license. + +The difference is considered big enough to make SPDX list it under its own +identifier: [curl](https://spdx.org/licenses/curl.html). + +The changes done to the license that make it uniquely curl were tiny and +well-intended, but the reasons for them have been forgotten and we strongly +discourage others from doing the same thing. + +# PHP/CURL + +## What is PHP/CURL? + +The module for PHP that makes it possible for PHP programs to access curl +functions from within PHP. + +In the curl project we call this module PHP/CURL to differentiate it from curl +the command line tool and libcurl the library. The PHP team however does not +refer to it like this (for unknown reasons). They call it plain CURL (often +using all caps) or sometimes ext/curl, but both cause much confusion to users +which in turn gives us a higher question load. + +## Who wrote PHP/CURL? + +PHP/CURL was initially written by Sterling Hughes. + +## Can I perform multiple requests using the same handle? + +Yes. + +After a transfer, you just set new options in the handle and make another +transfer. This will make libcurl reuse the same connection if it can. + +## Does PHP/CURL have dependencies? + +PHP/CURL is a module that comes with the regular PHP package. It depends on +and uses libcurl, so you need to have libcurl installed properly before +PHP/CURL can be used. + +# Development + +## Why does curl use C89? + +As with everything in curl, there is a history and we keep using what we have +used before until someone brings up the subject and argues for and works on +changing it. + +We started out using C89 in the 1990s because that was the only way to write a +truly portable C program and have it run as widely as possible. C89 was for a +long time even necessary to make things work on otherwise considered modern +platforms such as Windows. Today, we do not really know how many users that +still require the use of a C89 compiler. + +We will continue to use C89 for as long as nobody brings up a strong enough +reason for us to change our minds. The core developers of the project do not +feel restricted by this and we are not convinced that going C99 will offer us +enough of a benefit to warrant the risk of cutting off a share of users. + +## Will curl be rewritten? + +In one go: no. Little by little over time? Sure. + +Over the years, new languages and clever operating environments come and go. +Every now and then the urge apparently arises to request that we rewrite curl +in another language. + +Some the most important properties in curl are maintaining the API and ABI for +libcurl and keeping the behavior for the command line tool. As long as we can +do that, everything else is up for discussion. To maintain the ABI, we +probably have to maintain a certain amount of code in C, and to remain rock +stable, we will never risk anything by rewriting a lot of things in one go. +That said, we can certainly offer more and more optional backends written in +other languages, as long as those backends can be plugged in at build-time. +Backends can be written in any language, but should probably provide APIs +usable from C to ease integration and transition. diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS deleted file mode 100644 index f65e9f1ae264..000000000000 --- a/docs/KNOWN_BUGS +++ /dev/null @@ -1,663 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Known Bugs - -These are problems and bugs known to exist at the time of this release. Feel -free to join in and help us correct one or more of these. Also be sure to -check the changelog of the current development status, as one or more of these -problems may have been fixed or changed somewhat since this was written. - - 1. HTTP - - 2. TLS - 2.1 IMAPS connection fails with Rustls error - 2.2 Access violation sending client cert with Schannel - 2.5 Client cert handling with Issuer DN differs between backends - 2.7 Client cert (MTLS) issues with Schannel - 2.11 Schannel TLS 1.2 handshake bug in old Windows versions - 2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel - 2.14 mbedTLS and CURLE_AGAIN handling - - 3. Email protocols - 3.1 IMAP SEARCH ALL truncated response - 3.2 No disconnect command - 3.4 AUTH PLAIN for SMTP is not working on all servers - 3.5 APOP authentication fails on POP3 - 3.6 POP3 issue when reading small chunks - - 4. Command line - 4.1 -T /dev/stdin may upload with an incorrect content length - 4.2 -T - always uploads chunked - - 5. Build and portability issues - 5.1 OS400 port requires deprecated IBM library - 5.2 curl-config --libs contains private details - 5.3 LDFLAGS passed too late making libs linked incorrectly - 5.6 Cygwin: make install installs curl-config.1 twice - 5.12 flaky CI builds - 5.13 long paths are not fully supported on Windows - 5.15 Unicode on Windows - - 6. Authentication - 6.1 Digest auth-int for PUT/POST - 6.2 MIT Kerberos for Windows build - 6.3 NTLM in system context uses wrong name - 6.5 NTLM does not support password with Unicode 'SECTION SIGN' character - 6.6 libcurl can fail to try alternatives with --proxy-any - 6.7 Do not clear digest for single realm - 6.9 SHA-256 digest not supported in Windows SSPI builds - 6.10 curl never completes Negotiate over HTTP - 6.11 Negotiate on Windows fails - 6.13 Negotiate against Hadoop HDFS - - 7. FTP - 7.4 FTP with ACCT - 7.12 FTPS directory listing hangs on Windows with Schannel - - 9. SFTP and SCP - 9.1 SFTP does not do CURLOPT_POSTQUOTE correct - 9.3 Remote recursive folder creation with SFTP - 9.4 libssh blocking and infinite loop problem - 9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" - - 10. Connection - 10.1 --interface with link-scoped IPv6 address - 10.2 Does not acknowledge getaddrinfo sorting policy - 10.3 SOCKS-SSPI discards the security context - - 11. Internals - 11.1 gssapi library name + version is missing in curl_version_info() - 11.2 error buffer not set if connection to multiple addresses fails - 11.4 HTTP test server 'connection-monitor' problems - 11.5 Connection information when using TCP Fast Open - 11.6 test cases sometimes timeout - 11.7 CURLOPT_CONNECT_TO does not work for HTTPS proxy - 11.8 WinIDN test failures - 11.9 setting a disabled option should return CURLE_NOT_BUILT_IN - - 12. LDAP - 12.1 OpenLDAP hangs after returning results - 12.2 LDAP on Windows does authentication wrong? - 12.3 LDAP on Windows does not work - 12.4 LDAPS requests to ActiveDirectory server hang - - 13. TCP/IP - 13.1 telnet code does not handle partial writes properly - 13.2 Trying local ports fails on Windows - - 15. CMake - 15.1 cmake outputs: no version information available - 15.6 uses -lpthread instead of Threads::Threads - 15.7 generated .pc file contains strange entries - 15.13 CMake build with MIT Kerberos does not work - - 16. aws-sigv4 - 16.2 aws-sigv4 does not handle multipart/form-data correctly - - 17. HTTP/2 - 17.1 HTTP/2 prior knowledge over proxy - 17.2 HTTP/2 frames while in the connection pool kill reuse - 17.3 ENHANCE_YOUR_CALM causes infinite retries - 17.4 HTTP/2 + TLS spends a lot of time in recv - - 18. HTTP/3 - 18.1 connection migration does not work - 18.2 quiche: QUIC connection is draining - 18.3 OpenSSL-QUIC problems on google.com - - 19. RTSP - 19.1 Some methods do not support response bodies - -============================================================================== - -1. HTTP - -2. TLS - -2.1 IMAPS connection fails with Rustls error - - https://github.com/curl/curl/issues/10457 - -2.2 Access violation sending client cert with Schannel - - When using Schannel to do client certs, curl sets PKCS12_NO_PERSIST_KEY to - avoid leaking the private key into the filesystem. Unfortunately that flag - instead seems to trigger a crash. - - See https://github.com/curl/curl/issues/17626 - -2.5 Client cert handling with Issuer DN differs between backends - - When the specified client certificate does not match any of the - server-specified DNs, the OpenSSL and GnuTLS backends behave differently. - The github discussion may contain a solution. - - See https://github.com/curl/curl/issues/1411 - -2.7 Client cert (MTLS) issues with Schannel - - See https://github.com/curl/curl/issues/3145 - -2.11 Schannel TLS 1.2 handshake bug in old Windows versions - - In old versions of Windows such as 7 and 8.1 the Schannel TLS 1.2 handshake - implementation likely has a bug that can rarely cause the key exchange to - fail, resulting in error SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED. - - https://github.com/curl/curl/issues/5488 - -2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel - - https://github.com/curl/curl/issues/8741 - -2.14 mbedTLS and CURLE_AGAIN handling - - https://github.com/curl/curl/issues/15801 - -3. Email protocols - -3.1 IMAP SEARCH ALL truncated response - - IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the - code reveals that pingpong.c contains some truncation code, at line 408, when - it deems the server response to be too large truncating it to 40 characters" - https://curl.se/bug/view.cgi?id=1366 - -3.2 No disconnect command - - The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3 and - SMTP if a failure occurs during the authentication phase of a connection. - -3.4 AUTH PLAIN for SMTP is not working on all servers - - Specifying "--login-options AUTH=PLAIN" on the command line does not seem to - work correctly. - - See https://github.com/curl/curl/issues/4080 - -3.5 APOP authentication fails on POP3 - - See https://github.com/curl/curl/issues/10073 - -3.6 POP3 issue when reading small chunks - - CURL_DBG_SOCK_RMAX=4 ./runtests.pl -v 982 - - See https://github.com/curl/curl/issues/12063 - -4. Command line - -4.1 -T /dev/stdin may upload with an incorrect content length - - -T stats the path to figure out its size in bytes to use it as Content-Length - if it is a regular file. - - The problem with that is that, on BSDs and some other UNIXes (not Linux), - open(path) may not give you a file descriptor with a 0 offset from the start - of the file. - - See https://github.com/curl/curl/issues/12177 - -4.2 -T - always uploads chunked - - When the `<` shell operator is used. curl should realise that stdin is a - regular file in this case, and that it can do a non-chunked upload, like it - would do if you used -T file. - - See https://github.com/curl/curl/issues/12171 - -5. Build and portability issues - -5.1 OS400 port requires deprecated IBM library - - curl for OS400 requires QADRT to build, which provides ASCII wrappers for - libc/POSIX functions in the ILE, but IBM no longer supports or even offers - this library to download. - - See https://github.com/curl/curl/issues/5176 - -5.2 curl-config --libs contains private details - - "curl-config --libs" include details set in LDFLAGS when configure is run - that might be needed only for building libcurl. Further, curl-config --cflags - suffers from the same effects with CFLAGS/CPPFLAGS. - -5.3 LDFLAGS passed too late making libs linked incorrectly - - Compiling latest curl on HP-UX and linking against a custom OpenSSL (which is - on the default loader/linker path), fails because the generated Makefile has - LDFLAGS passed on after LIBS. - - See https://github.com/curl/curl/issues/14893 - -5.6 Cygwin: make install installs curl-config.1 twice - - https://github.com/curl/curl/issues/8839 - -5.12 flaky CI builds - - We run many CI builds for each commit and PR on github, and especially a - number of the Windows builds are flaky. This means that we rarely get all CI - builds go green and complete without errors. This is unfortunate as it makes - us sometimes miss actual build problems and it is surprising to newcomers to - the project who (rightfully) do not expect this. - - See https://github.com/curl/curl/issues/6972 - -5.13 long paths are not fully supported on Windows - - curl on Windows cannot access long paths (paths longer than 260 characters). - However, as a workaround, the Windows path prefix \\?\ which disables all - path interpretation may work to allow curl to access the path. For example: - \\?\c:\longpath. - - See https://github.com/curl/curl/issues/8361 - -5.15 Unicode on Windows - - Passing in a Unicode filename with -o: - - https://github.com/curl/curl/issues/11461 - - Passing in Unicode character with -d: - - https://github.com/curl/curl/issues/12231 - - Windows Unicode builds use homedir in current locale - - The Windows Unicode builds of curl use the current locale, but expect Unicode - UTF-8 encoded paths for internal use such as open, access and stat. The - user's home directory is retrieved via curl_getenv in the current locale and - not as UTF-8 encoded Unicode. - - See https://github.com/curl/curl/pull/7252 and - https://github.com/curl/curl/pull/7281 - - Cannot handle Unicode arguments in non-Unicode builds on Windows - - If a URL or filename cannot be encoded using the user's current codepage then - it can only be encoded properly in the Unicode character set. Windows uses - UTF-16 encoding for Unicode and stores it in wide characters, however curl - and libcurl are not equipped for that at the moment except when built with - _UNICODE and UNICODE defined. Except for Cygwin, Windows cannot use UTF-8 as - a locale. - - https://curl.se/bug/?i=345 - https://curl.se/bug/?i=731 - https://curl.se/bug/?i=3747 - - NTLM authentication and Unicode - - NTLM authentication involving Unicode username or password only works - properly if built with UNICODE defined together with the Schannel backend. - The original problem was mentioned in: - https://curl.se/mail/lib-2009-10/0024.html - https://curl.se/bug/view.cgi?id=896 - - The Schannel version verified to work as mentioned in - https://curl.se/mail/lib-2012-07/0073.html - -6. Authentication - -6.1 Digest auth-int for PUT/POST - - We do not support auth-int for Digest using PUT or POST - -6.2 MIT Kerberos for Windows build - - libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's - library header files exporting symbols/macros that should be kept private to - the KfW library. - -6.3 NTLM in system context uses wrong name - - NTLM authentication using SSPI (on Windows) when (lib)curl is running in - "system context" makes it use wrong(?) username - at least when compared to - what winhttp does. See https://curl.se/bug/view.cgi?id=535 - -6.5 NTLM does not support password with Unicode 'SECTION SIGN' character - - Code point: U+00A7 - - https://en.wikipedia.org/wiki/Section_sign - https://github.com/curl/curl/issues/2120 - -6.6 libcurl can fail to try alternatives with --proxy-any - - When connecting via a proxy using --proxy-any, a failure to establish an - authentication causes libcurl to abort trying other options if the failed - method has a higher preference than the alternatives. As an example, - --proxy-any against a proxy which advertise Negotiate and NTLM, but which - fails to set up Kerberos authentication does not proceed to try - authentication using NTLM. - - https://github.com/curl/curl/issues/876 - -6.7 Do not clear digest for single realm - - https://github.com/curl/curl/issues/3267 - -6.9 SHA-256 digest not supported in Windows SSPI builds - - Windows builds of curl that have SSPI enabled use the native Windows API calls - to create authentication strings. The call to InitializeSecurityContext fails - with SEC_E_QOP_NOT_SUPPORTED which causes curl to fail with CURLE_AUTH_ERROR. - - Microsoft does not document supported digest algorithms and that SEC_E error - code is not a documented error for InitializeSecurityContext (digest). - - https://github.com/curl/curl/issues/6302 - -6.10 curl never completes Negotiate over HTTP - - Apparently it is not working correctly...? - - See https://github.com/curl/curl/issues/5235 - -6.11 Negotiate on Windows fails - - When using --negotiate (or NTLM) with curl on Windows, SSL/TLS handshake - fails despite having a valid kerberos ticket cached. Works without any issue - in Unix/Linux. - - https://github.com/curl/curl/issues/5881 - -6.13 Negotiate authentication against Hadoop HDFS - - https://github.com/curl/curl/issues/8264 - -7. FTP - -7.4 FTP with ACCT - - When doing an operation over FTP that requires the ACCT command (but not when - logging in), the operation fails since libcurl does not detect this and thus - fails to issue the correct command: https://curl.se/bug/view.cgi?id=635 - -7.12 FTPS server compatibility on Windows with Schannel - - FTPS is not widely used with the Schannel TLS backend and so there may be - more bugs compared to other TLS backends such as OpenSSL. In the past users - have reported hanging and failed connections. It is likely some changes to - curl since then fixed the issues. None of the reported issues can be - reproduced any longer. - - If you encounter an issue connecting to your server via FTPS with the latest - curl and Schannel then please search for open issues or file a new issue. - -9. SFTP and SCP - -9.1 SFTP does not do CURLOPT_POSTQUOTE correct - - When libcurl sends CURLOPT_POSTQUOTE commands when connected to an SFTP - server using the multi interface, the commands are not being sent correctly - and instead the connection is "cancelled" (the operation is considered done) - prematurely. There is a half-baked (busy-looping) patch provided in the bug - report but it cannot be accepted as-is. See - https://curl.se/bug/view.cgi?id=748 - -9.3 Remote recursive folder creation with SFTP - - On this servers, the curl fails to create directories on the remote server - even when the CURLOPT_FTP_CREATE_MISSING_DIRS option is set. - - See https://github.com/curl/curl/issues/5204 - -9.4 libssh blocking and infinite loop problem - - In the SSH_SFTP_INIT state for libssh, the ssh session working mode is set to - blocking mode. If the network is suddenly disconnected during sftp - transmission, curl is stuck, even if curl is configured with a timeout. - - https://github.com/curl/curl/issues/8632 - -9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" - - Running SCP and SFTP tests on Cygwin makes this warning message appear. - - https://github.com/curl/curl/issues/11244 - -10. Connection - -10.1 --interface with link-scoped IPv6 address - - When you give the `--interface` option telling curl to use a specific - interface for its outgoing traffic in combination with an IPv6 address in the - URL that uses a link-local scope, curl might pick the wrong address from the - named interface and the subsequent transfer fails. - - Example command line: - - curl --interface eth0 'http://[fe80:928d:xxff:fexx:xxxx]/' - - The fact that the given IP address is link-scoped should probably be used as - input to somehow make curl make a better choice for this. - - https://github.com/curl/curl/issues/14782 - -10.2 Does not acknowledge getaddrinfo sorting policy - - Even if a user edits /etc/gai.conf to prefer IPv4, curl still prefers and - tries IPv6 addresses first. - - https://github.com/curl/curl/issues/16718 - - -10.3 SOCKS-SSPI discards the security context - - After a successful SSPI/GSS-API exchange, the function queries and logs the - authenticated username and reports the supported data-protection level, but - then immediately deletes the negotiated SSPI security context and frees the - credentials before returning. The negotiated context is not stored on the - connection and is therefore never used to protect later SOCKS5 traffic. - -11. Internals - -11.1 gssapi library name + version is missing in curl_version_info() - - The struct needs to be expanded and code added to store this info. - - See https://github.com/curl/curl/issues/13492 - -11.2 error buffer not set if connection to multiple addresses fails - - If you ask libcurl to resolve a hostname like example.com to IPv6 addresses - when you only have IPv4 connectivity. libcurl fails with - CURLE_COULDNT_CONNECT, but the error buffer set by CURLOPT_ERRORBUFFER - remains empty. Issue: https://github.com/curl/curl/issues/544 - -11.4 HTTP test server 'connection-monitor' problems - - The 'connection-monitor' feature of the sws HTTP test server does not work - properly if some tests are run in unexpected order. Like 1509 and then 1525. - - See https://github.com/curl/curl/issues/868 - -11.5 Connection information when using TCP Fast Open - - CURLINFO_LOCAL_PORT (and possibly a few other) fails when TCP Fast Open is - enabled. - - See https://github.com/curl/curl/issues/1332 and - https://github.com/curl/curl/issues/4296 - -11.6 test cases sometimes timeout - - Occasionally, one of the tests timeouts. Inexplicably. - - See https://github.com/curl/curl/issues/13350 - -11.7 CURLOPT_CONNECT_TO does not work for HTTPS proxy - - It is unclear if the same option should even cover the proxy connection or if - if requires a separate option. - - See https://github.com/curl/curl/issues/14481 - -11.8 WinIDN test failures - - Test 165 disabled when built with WinIDN. - -11.9 setting a disabled option should return CURLE_NOT_BUILT_IN - - When curl has been built with specific features or protocols disabled, - setting such options with curl_easy_setopt() should rather return - CURLE_NOT_BUILT_IN instead of CURLE_UNKNOWN_OPTION to signal the difference - to the application - - See https://github.com/curl/curl/issues/15472 - -12. LDAP - -12.1 OpenLDAP hangs after returning results - - By configuration defaults, OpenLDAP automatically chase referrals on - secondary socket descriptors. The OpenLDAP backend is asynchronous and thus - should monitor all socket descriptors involved. Currently, these secondary - descriptors are not monitored, causing OpenLDAP library to never receive - data from them. - - As a temporary workaround, disable referrals chasing by configuration. - - The fix is not easy: proper automatic referrals chasing requires a - synchronous bind callback and monitoring an arbitrary number of socket - descriptors for a single easy handle (currently limited to 5). - - Generic LDAP is synchronous: OK. - - See https://github.com/curl/curl/issues/622 and - https://curl.se/mail/lib-2016-01/0101.html - -12.2 LDAP on Windows does authentication wrong? - - https://github.com/curl/curl/issues/3116 - -12.3 LDAP on Windows does not work - - A simple curl command line getting "ldap://ldap.forumsys.com" returns an - error that says "no memory" ! - - https://github.com/curl/curl/issues/4261 - -12.4 LDAPS requests to ActiveDirectory server hang - - https://github.com/curl/curl/issues/9580 - -13. TCP/IP - -13.1 telnet code does not handle partial writes properly - - It probably does not happen too easily because of how slow and infrequent - sends are normally performed. - -13.2 Trying local ports fails on Windows - - This makes '--local-port [range]' to not work since curl cannot properly - detect if a port is already in use, so it tries the first port, uses that and - then subsequently fails anyway if that was actually in use. - - https://github.com/curl/curl/issues/8112 - -15. CMake - -15.1 cmake outputs: no version information available - - Something in the SONAME generation seems to be wrong in the cmake build. - - https://github.com/curl/curl/issues/11158 - -15.6 uses -lpthread instead of Threads::Threads - - See https://github.com/curl/curl/issues/6166 - -15.7 generated .pc file contains strange entries - - The Libs.private field of the generated .pc file contains -lgcc -lgcc_s -lc - -lgcc -lgcc_s - - See https://github.com/curl/curl/issues/6167 - -15.13 CMake build with MIT Kerberos does not work - - Minimum CMake version was bumped in curl 7.71.0 (#5358) Since CMake 3.2 - try_compile started respecting the CMAKE_EXE_FLAGS. The code dealing with - MIT Kerberos detection sets few variables to potentially weird mix of space, - and ;-separated flags. It had to blow up at some point. All the CMake checks - that involve compilation are doomed from that point, the configured tree - cannot be built. - - https://github.com/curl/curl/issues/6904 - -16. aws-sigv4 - -16.2 aws-sigv4 does not handle multipart/form-data correctly - - https://github.com/curl/curl/issues/13351 - -17. HTTP/2 - -17.1 HTTP/2 prior knowledge over proxy - - https://github.com/curl/curl/issues/12641 - -17.2 HTTP/2 frames while in the connection pool kill reuse - - If the server sends HTTP/2 frames (like for example an HTTP/2 PING frame) to - curl while the connection is held in curl's connection pool, the socket is - found readable when considered for reuse and that makes curl think it is dead - and then it is closed and a new connection gets created instead. - - This is *best* fixed by adding monitoring to connections while they are kept - in the pool so that pings can be responded to appropriately. - -17.3 ENHANCE_YOUR_CALM causes infinite retries - - Infinite retries with 2 parallel requests on one connection receiving GOAWAY - with ENHANCE_YOUR_CALM error code. - - See https://github.com/curl/curl/issues/5119 - -17.4 HTTP/2 + TLS spends a lot of time in recv - - It has been observed that by making the speed limit less accurate we could - improve this performance. (by reverting - https://github.com/curl/curl/commit/db5c9f4f9e0779b49624752b135281a0717b277b) - Can we find a golden middle ground? - - See https://curl.se/mail/lib-2024-05/0026.html and - https://github.com/curl/curl/issues/13416 - -18. HTTP/3 - -18.1 connection migration does not work - - https://github.com/curl/curl/issues/7695 - -18.2 quiche: QUIC connection is draining - - The transfer ends with error "QUIC connection is draining". - - https://github.com/curl/curl/issues/12037 - -18.3 OpenSSL-QUIC problems on google.com - - With some specific Google servers, and seemingly timing dependent, the - OpenSSL-QUIC backend seems to not actually send off the HTTP/3 request which - makes the QUIC connection just sit idle until killed by the server. curl or - OpenSSL bug? - - https://github.com/curl/curl/issues/18336 - -19. RTSP - -19.1 Some methods do not support response bodies - - The RTSP implementation is written to assume that a number of RTSP methods - always get responses without bodies, even though there seems to be no - indication in the RFC that this is always the case. - - https://github.com/curl/curl/issues/12414 diff --git a/docs/KNOWN_BUGS.md b/docs/KNOWN_BUGS.md new file mode 100644 index 000000000000..1f5cebee27c7 --- /dev/null +++ b/docs/KNOWN_BUGS.md @@ -0,0 +1,546 @@ + + +# Known bugs intro + +These are problems and bugs known to exist at the time of this release. Feel +free to join in and help us correct one or more of these. Also be sure to +check the changelog of the current development status, as one or more of these +problems may have been fixed or changed somewhat since this was written. + +# TLS + +## IMAPS connection fails with Rustls error + +[curl issue 10457](https://github.com/curl/curl/issues/10457) + +## Access violation sending client cert with Schannel + +When using Schannel to do client certs, curl sets `PKCS12_NO_PERSIST_KEY` to +avoid leaking the private key into the filesystem. Unfortunately that flag +instead seems to trigger a crash. + +See [curl issue 17626](https://github.com/curl/curl/issues/17626) + +## Client cert handling with Issuer `DN` differs between backends + +When the specified client certificate does not match any of the +server-specified `DN` fields, the OpenSSL and GnuTLS backends behave +differently. The GitHub discussion may contain a solution. + +See [curl issue 1411](https://github.com/curl/curl/issues/1411) + +## Client cert (MTLS) issues with Schannel + +See [curl issue 3145](https://github.com/curl/curl/issues/3145) + +## Schannel TLS 1.2 handshake bug in old Windows versions + +In old versions of Windows such as 7 and 8.1 the Schannel TLS 1.2 handshake +implementation likely has a bug that can rarely cause the key exchange to +fail, resulting in error SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED. + +[curl issue 5488](https://github.com/curl/curl/issues/5488) + +## `CURLOPT_CERTINFO` results in `CURLE_OUT_OF_MEMORY` with Schannel + +[curl issue 8741](https://github.com/curl/curl/issues/8741) + +## mbedTLS and CURLE_AGAIN handling + +[curl issue 15801](https://github.com/curl/curl/issues/15801) + +# Email protocols + +## IMAP `SEARCH ALL` truncated response + +IMAP `SEARCH ALL` truncates output on large boxes. "A quick search of the code +reveals that `pingpong.c` contains some truncation code, at line 408, when it +deems the server response to be too large truncating it to 40 characters" + +https://curl.se/bug/view.cgi?id=1366 + +## No disconnect command + +The disconnect commands (`LOGOUT` and `QUIT`) may not be sent by IMAP, POP3 +and SMTP if a failure occurs during the authentication phase of a connection. + +## `AUTH PLAIN` for SMTP is not working on all servers + +Specifying `--login-options AUTH=PLAIN` on the command line does not seem to +work correctly. + +See [curl issue 4080](https://github.com/curl/curl/issues/4080) + +## `APOP` authentication fails on POP3 + +See [curl issue 10073](https://github.com/curl/curl/issues/10073) + +## POP3 issue when reading small chunks + + CURL_DBG_SOCK_RMAX=4 ./runtests.pl -v 982 + +See [curl issue 12063](https://github.com/curl/curl/issues/12063) + +# Command line + +## `-T /dev/stdin` may upload with an incorrect content length + +`-T` stats the path to figure out its size in bytes to use it as +`Content-Length` if it is a regular file. + +The problem with that is that on BSD and some other UNIX systems (not Linux), +open(path) may not give you a file descriptor with a 0 offset from the start +of the file. + +See [curl issue 12177](https://github.com/curl/curl/issues/12177) + +## `-T -` always uploads chunked + +When the `<` shell operator is used. curl should realize that stdin is a +regular file in this case, and that it can do a non-chunked upload, like it +would do if you used `-T` file. + +See [curl issue 12171](https://github.com/curl/curl/issues/12171) + +# Build and portability issues + +## OS400 port requires deprecated IBM library + +curl for OS400 requires `QADRT` to build, which provides ASCII wrappers for +libc/POSIX functions in the ILE, but IBM no longer supports or even offers +this library to download. + +See [curl issue 5176](https://github.com/curl/curl/issues/5176) + +## `curl-config --libs` contains private details + +`curl-config --libs` include details set in `LDFLAGS` when configure is run +that might be needed only for building libcurl. Further, `curl-config +--cflags` suffers from the same effects with `CFLAGS`/`CPPFLAGS`. + +## `LDFLAGS` passed too late making libs linked incorrectly + +Compiling latest curl on HP-UX and linking against a custom OpenSSL (which is +on the default loader/linker path), fails because the generated Makefile has +`LDFLAGS` passed on after `LIBS`. + +See [curl issue 14893](https://github.com/curl/curl/issues/14893) + +## Cygwin: make install installs curl-config.1 twice + +[curl issue 8839](https://github.com/curl/curl/issues/8839) + +## flaky CI builds + +We run many CI builds for each commit and PR on GitHub, and especially a +number of the Windows builds are flaky. This means that we rarely get all CI +builds go green and complete without errors. This is unfortunate as it makes +us sometimes miss actual build problems and it is surprising to newcomers to +the project who (rightfully) do not expect this. + +See [curl issue 6972](https://github.com/curl/curl/issues/6972) + +## long paths are not fully supported on Windows + +curl on Windows cannot access long paths (paths longer than 260 characters). +However, as a workaround, the Windows path prefix `\\?\` which disables all +path interpretation may work to allow curl to access the path. For example: +`\\?\c:\longpath`. + +See [curl issue 8361](https://github.com/curl/curl/issues/8361) + +## Unicode on Windows + +Passing in a Unicode filename with -o: + +[curl issue 11461](https://github.com/curl/curl/issues/11461) + +Passing in Unicode character with -d: + + [curl issue 12231](https://github.com/curl/curl/issues/12231) + +Windows Unicode builds use the home directory in current locale. + +The Windows Unicode builds of curl use the current locale, but expect Unicode +UTF-8 encoded paths for internal use such as open, access and stat. The user's +home directory is retrieved via curl_getenv in the current locale and not as +UTF-8 encoded Unicode. + +See [curl pull request 7252](https://github.com/curl/curl/pull/7252) and [curl pull request 7281](https://github.com/curl/curl/pull/7281) + +Cannot handle Unicode arguments in non-Unicode builds on Windows + +If a URL or filename cannot be encoded using the user's current code page then +it can only be encoded properly in the Unicode character set. Windows uses +UTF-16 encoding for Unicode and stores it in wide characters, however curl and +libcurl are not equipped for that at the moment except when built with +_UNICODE and UNICODE defined. Except for Cygwin, Windows cannot use UTF-8 as a +locale. + + https://curl.se/bug/?i=345 + https://curl.se/bug/?i=731 + https://curl.se/bug/?i=3747 + +NTLM authentication and Unicode + +NTLM authentication involving Unicode username or password only works properly +if built with UNICODE defined together with the Schannel backend. The original +problem was mentioned in: https://curl.se/mail/lib-2009-10/0024.html and +https://curl.se/bug/view.cgi?id=896 + +The Schannel version verified to work as mentioned in +https://curl.se/mail/lib-2012-07/0073.html + +# Authentication + +## Digest `auth-int` for PUT/POST + +We do not support auth-int for Digest using PUT or POST + +## MIT Kerberos for Windows build + +libcurl fails to build with MIT Kerberos for Windows (`KfW`) due to its +library header files exporting symbols/macros that should be kept private to +the library. + +## NTLM in system context uses wrong name + +NTLM authentication using SSPI (on Windows) when (lib)curl is running in +"system context" makes it use wrong(?) username - at least when compared to +what `winhttp` does. See https://curl.se/bug/view.cgi?id=535 + +## NTLM does not support password with Unicode 'SECTION SIGN' character + + https://en.wikipedia.org/wiki/Section_sign + [curl issue 2120](https://github.com/curl/curl/issues/2120) + +## libcurl can fail to try alternatives with `--proxy-any` + +When connecting via a proxy using `--proxy-any`, a failure to establish an +authentication causes libcurl to abort trying other options if the failed +method has a higher preference than the alternatives. As an example, +`--proxy-any` against a proxy which advertise Negotiate and NTLM, but which +fails to set up Kerberos authentication does not proceed to try authentication +using NTLM. + +[curl issue 876](https://github.com/curl/curl/issues/876) + +## Do not clear digest for single realm + + [curl issue 3267](https://github.com/curl/curl/issues/3267) + +## SHA-256 digest not supported in Windows SSPI builds + +Windows builds of curl that have SSPI enabled use the native Windows API calls +to create authentication strings. The call to `InitializeSecurityContext` fails +with `SEC_E_QOP_NOT_SUPPORTED` which causes curl to fail with +`CURLE_AUTH_ERROR`. + +Microsoft does not document supported digest algorithms and that `SEC_E` error +code is not a documented error for `InitializeSecurityContext` (digest). + + [curl issue 6302](https://github.com/curl/curl/issues/6302) + +## curl never completes Negotiate over HTTP + +Apparently it is not working correctly...? + +See [curl issue 5235](https://github.com/curl/curl/issues/5235) + +## Negotiate on Windows fails + +When using `--negotiate` (or NTLM) with curl on Windows, SSL/TLS handshake +fails despite having a valid kerberos ticket cached. Works without any issue +in Unix/Linux. + +[curl issue 5881](https://github.com/curl/curl/issues/5881) + +## Negotiate authentication against Hadoop + +[curl issue 8264](https://github.com/curl/curl/issues/8264) + +# FTP + +## FTP with ACCT + +When doing an operation over FTP that requires the `ACCT` command (but not when +logging in), the operation fails since libcurl does not detect this and thus +fails to issue the correct command: https://curl.se/bug/view.cgi?id=635 + +## FTPS server compatibility on Windows with Schannel + +FTPS is not widely used with the Schannel TLS backend and so there may be more +bugs compared to other TLS backends such as OpenSSL. In the past users have +reported hanging and failed connections. It is likely some changes to curl +since then fixed the issues. None of the reported issues can be reproduced any +longer. + +If you encounter an issue connecting to your server via FTPS with the latest +curl and Schannel then please search for open issues or file a new issue. + +# SFTP and SCP + +## SFTP does not do `CURLOPT_POSTQUOTE` correct + +When libcurl sends `CURLOPT_POSTQUOTE` commands when connected to an SFTP +server using the multi interface, the commands are not being sent correctly +and instead the connection is canceled (the operation is considered done) +prematurely. There is a half-baked (busy-looping) patch provided in the bug +report but it cannot be accepted as-is. See +https://curl.se/bug/view.cgi?id=748 + +## Remote recursive folder creation with SFTP + +On this servers, the curl fails to create directories on the remote server +even when the `CURLOPT_FTP_CREATE_MISSING_DIRS` option is set. + +See [curl issue 5204](https://github.com/curl/curl/issues/5204) + +## libssh blocking and infinite loop problem + +In the `SSH_SFTP_INIT` state for libssh, the ssh session working mode is set +to blocking mode. If the network is suddenly disconnected during sftp +transmission, curl is stuck, even if curl is configured with a timeout. + + [curl issue 8632](https://github.com/curl/curl/issues/8632) + +## Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" + +Running SCP and SFTP tests on Cygwin makes this warning message appear. + +[curl issue 11244](https://github.com/curl/curl/issues/11244) + +# Connection + +## `--interface` with link-scoped IPv6 address + +When you give the `--interface` option telling curl to use a specific +interface for its outgoing traffic in combination with an IPv6 address in the +URL that uses a link-local scope, curl might pick the wrong address from the +named interface and the subsequent transfer fails. + +Example command line: + + curl --interface eth0 'http://[fe80:928d:xxff:fexx:xxxx]/' + +The fact that the given IP address is link-scoped should probably be used as +input to somehow make curl make a better choice for this. + +[curl issue 14782](https://github.com/curl/curl/issues/14782) + +## Does not acknowledge getaddrinfo sorting policy + +Even if a user edits `/etc/gai.conf` to prefer IPv4, curl still prefers and +tries IPv6 addresses first. + +[curl issue 16718](https://github.com/curl/curl/issues/16718) + +## SOCKS-SSPI discards the security context + +After a successful SSPI/GSS-API exchange, the function queries and logs the +authenticated username and reports the supported data-protection level, but +then immediately deletes the negotiated SSPI security context and frees the +credentials before returning. The negotiated context is not stored on the +connection and is therefore never used to protect later SOCKS5 traffic. + +# Internals + +## GSSAPI library name + version is missing in `curl_version_info()` + +The struct needs to be expanded and code added to store this info. + +See [curl issue 13492](https://github.com/curl/curl/issues/13492) + +## error buffer not set if connection to multiple addresses fails + +If you ask libcurl to resolve a hostname like example.com to IPv6 addresses +when you only have IPv4 connectivity. libcurl fails with +`CURLE_COULDNT_CONNECT`, but the error buffer set by `CURLOPT_ERRORBUFFER` +remains empty. Issue: [curl issue 544](https://github.com/curl/curl/issues/544) + +## HTTP test server 'connection-monitor' problems + +The `connection-monitor` feature of the HTTP test server does not work +properly if some tests are run in unexpected order. Like 1509 and then 1525. + +See [curl issue 868](https://github.com/curl/curl/issues/868) + +## Connection information when using TCP Fast Open + +`CURLINFO_LOCAL_PORT` (and possibly a few other) fails when TCP Fast Open is +enabled. + +See [curl issue 1332](https://github.com/curl/curl/issues/1332) and +[curl issue 4296](https://github.com/curl/curl/issues/4296) + +## test cases sometimes timeout + +Occasionally, one of the tests timeouts. Inexplicably. + +See [curl issue 13350](https://github.com/curl/curl/issues/13350) + +## `CURLOPT_CONNECT_TO` does not work for HTTPS proxy + +It is unclear if the same option should even cover the proxy connection or if +if requires a separate option. + +See [curl issue 14481](https://github.com/curl/curl/issues/14481) + +## WinIDN test failures + +Test 165 disabled when built with WinIDN. + +## setting a disabled option should return `CURLE_NOT_BUILT_IN` + +When curl has been built with specific features or protocols disabled, setting +such options with `curl_easy_setopt()` should rather return +`CURLE_NOT_BUILT_IN` instead of `CURLE_UNKNOWN_OPTION` to signal the +difference to the application + +See [curl issue 15472](https://github.com/curl/curl/issues/15472) + +# LDAP + +## OpenLDAP hangs after returning results + +By configuration defaults, OpenLDAP automatically chase referrals on secondary +socket descriptors. The OpenLDAP backend is asynchronous and thus should +monitor all socket descriptors involved. Currently, these secondary +descriptors are not monitored, causing OpenLDAP library to never receive data +from them. + +As a temporary workaround, disable referrals chasing by configuration. + +The fix is not easy: proper automatic referrals chasing requires a synchronous +bind callback and monitoring an arbitrary number of socket descriptors for a +single easy handle (currently limited to 5). + +Generic LDAP is synchronous: OK. + +See [curl issue 622](https://github.com/curl/curl/issues/622) and +https://curl.se/mail/lib-2016-01/0101.html + +## LDAP on Windows does authentication wrong? + +[curl issue 3116](https://github.com/curl/curl/issues/3116) + +## LDAP on Windows does not work + +A simple curl command line getting `ldap://ldap.forumsys.com` returns an error +that says `no memory` ! + +[curl issue 4261](https://github.com/curl/curl/issues/4261) + +## LDAPS requests to Active Directory server hang + +[curl issue 9580](https://github.com/curl/curl/issues/9580) + +# TCP/IP + +## telnet code does not handle partial writes properly + +It probably does not happen too easily because of how slow and infrequent +sends are normally performed. + +## Trying local ports fails on Windows + +This makes `--local-port [range]` to not work since curl cannot properly +detect if a port is already in use, so it tries the first port, uses that and +then subsequently fails anyway if that was actually in use. + +[curl issue 8112](https://github.com/curl/curl/issues/8112) + +# CMake + +## cmake outputs: no version information available + +Something in the SONAME generation seems to be wrong in the cmake build. + +[curl issue 11158](https://github.com/curl/curl/issues/11158) + +## uses `-lpthread` instead of `Threads::Threads` + +See [curl issue 6166](https://github.com/curl/curl/issues/6166) + +## generated `.pc` file contains strange entries + +The `Libs.private` field of the generated `.pc` file contains `-lgcc -lgcc_s +-lc -lgcc -lgcc_s`. + +See [curl issue 6167](https://github.com/curl/curl/issues/6167) + +## CMake build with MIT Kerberos does not work + +Minimum CMake version was bumped in curl 7.71.0 (#5358) Since CMake 3.2 +try_compile started respecting the `CMAKE_EXE_FLAGS`. The code dealing with +MIT Kerberos detection sets few variables to potentially weird mix of space, +and ;-separated flags. It had to blow up at some point. All the CMake checks +that involve compilation are doomed from that point, the configured tree +cannot be built. + +[curl issue 6904](https://github.com/curl/curl/issues/6904) + +# Authentication + +## `--aws-sigv4` does not handle multipart/form-data correctly + +[curl issue 13351](https://github.com/curl/curl/issues/13351) + +# HTTP/2 + +## HTTP/2 prior knowledge over proxy + + [curl issue 12641](https://github.com/curl/curl/issues/12641) + +## HTTP/2 frames while in the connection pool kill reuse + +If the server sends HTTP/2 frames (like for example an HTTP/2 PING frame) to +curl while the connection is held in curl's connection pool, the socket is +found readable when considered for reuse and that makes curl think it is dead +and then it is closed and a new connection gets created instead. + +This is *best* fixed by adding monitoring to connections while they are kept +in the pool so that pings can be responded to appropriately. + +## `ENHANCE_YOUR_CALM` causes infinite retries + +Infinite retries with 2 parallel requests on one connection receiving `GOAWAY` +with `ENHANCE_YOUR_CALM` error code. + +See [curl issue 5119](https://github.com/curl/curl/issues/5119) + +## HTTP/2 + TLS spends a lot of time in recv + +It has been observed that by making the speed limit less accurate we could +improve this performance. (by reverting +[db5c9f4f9e0779](https://github.com/curl/curl/commit/db5c9f4f9e0779b49624752b135281a0717b277b)) +Can we find a golden middle ground? + +See https://curl.se/mail/lib-2024-05/0026.html and +[curl issue 13416](https://github.com/curl/curl/issues/13416) + +# HTTP/3 + +## connection migration does not work + +[curl issue 7695](https://github.com/curl/curl/issues/7695) + +## quiche: QUIC connection is draining + +The transfer ends with error "QUIC connection is draining". + +[curl issue 12037](https://github.com/curl/curl/issues/12037) + +# RTSP + +## Some methods do not support response bodies + +The RTSP implementation is written to assume that a number of RTSP methods +always get responses without bodies, even though there seems to be no +indication in the RFC that this is always the case. + +[curl issue 12414](https://github.com/curl/curl/issues/12414) diff --git a/docs/Makefile.am b/docs/Makefile.am index da5812a0eb76..0b619b600883 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -93,7 +93,7 @@ EXTRA_DIST = \ EARLY-RELEASE.md \ ECH.md \ EXPERIMENTAL.md \ - FAQ \ + FAQ.md \ FEATURES.md \ GOVERNANCE.md \ HELP-US.md \ @@ -108,7 +108,7 @@ EXTRA_DIST = \ INSTALL.md \ INTERNALS.md \ IPFS.md \ - KNOWN_BUGS \ + KNOWN_BUGS.md \ KNOWN_RISKS.md \ MAIL-ETIQUETTE.md \ MANUAL.md \ @@ -121,7 +121,8 @@ EXTRA_DIST = \ SPONSORS.md \ SSL-PROBLEMS.md \ SSLCERTS.md \ - THANKS TODO \ + THANKS \ + TODO.md \ TheArtOfHttpScripting.md \ URL-SYNTAX.md \ VERSIONS.md \ diff --git a/docs/TODO b/docs/TODO deleted file mode 100644 index 22ca27f88d99..000000000000 --- a/docs/TODO +++ /dev/null @@ -1,1301 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Things that could be nice to do in the future - - Things to do in project curl. Please tell us what you think, contribute and - send us patches that improve things. - - Be aware that these are things that we could do, or have once been considered - things we could do. If you want to work on any of these areas, please - consider bringing it up for discussions first on the mailing list so that we - all agree it is still a good idea for the project. - - All bugs documented in the KNOWN_BUGS document are subject for fixing. - - 1. libcurl - 1.1 TFO support on Windows - 1.2 Consult %APPDATA% also for .netrc - 1.3 struct lifreq - 1.4 alt-svc sharing - 1.5 get rid of PATH_MAX - 1.6 thread-safe sharing - 1.10 auto-detect proxy - 1.12 updated DNS server while running - 1.13 c-ares and CURLOPT_OPENSOCKETFUNCTION - 1.15 Monitor connections in the connection pool - 1.16 Try to URL encode given URL - 1.17 Add support for IRIs - 1.18 try next proxy if one does not work - 1.19 provide timing info for each redirect - 1.20 SRV and URI DNS records - 1.22 CURLINFO_PAUSE_STATE - 1.25 Expose tried IP addresses that failed - 1.30 config file parsing - 1.31 erase secrets from heap/stack after use - 1.32 add asynch getaddrinfo support - 1.33 make DoH inherit more transfer properties - - 2. libcurl - multi interface - 2.1 More non-blocking - 2.2 Better support for same name resolves - 2.3 Non-blocking curl_multi_remove_handle() - 2.4 Split connect and authentication process - 2.5 Edge-triggered sockets should work - 2.6 multi upkeep - 2.7 Virtual external sockets - 2.8 dynamically decide to use socketpair - - 3. Documentation - 3.1 Improve documentation about fork safety - - 4. FTP - 4.1 HOST - 4.2 A fixed directory listing format - 4.6 GSSAPI via Windows SSPI - 4.7 STAT for LIST without data connection - 4.8 Passive transfer could try other IP addresses - - 5. HTTP - 5.1 Provide the error body from a CONNECT response - 5.2 Obey Retry-After in redirects - 5.3 Rearrange request header order - 5.4 Allow SAN names in HTTP/2 server push - 5.5 auth= in URLs - 5.6 alt-svc should fallback if alt-svc does not work - 5.7 Require HTTP version X or higher - - 6. TELNET - 6.1 ditch stdin - 6.2 ditch telnet-specific select - 6.3 feature negotiation debug data - 6.4 exit immediately upon connection if stdin is /dev/null - - 7. SMTP - 7.1 Passing NOTIFY option to CURLOPT_MAIL_RCPT - 7.2 Enhanced capability support - 7.3 Add CURLOPT_MAIL_CLIENT option - - 8. POP3 - 8.2 Enhanced capability support - - 9. IMAP - 9.1 Enhanced capability support - - 10. LDAP - 10.1 SASL based authentication mechanisms - 10.2 CURLOPT_SSL_CTX_FUNCTION for LDAPS - 10.3 Paged searches on LDAP server - 10.4 Certificate-Based Authentication - - 11. SMB - 11.1 File listing support - 11.2 Honor file timestamps - 11.3 Use NTLMv2 - 11.4 Create remote directories - - 12. FILE - 12.1 Directory listing on non-POSIX - - 13. TLS - 13.1 TLS-PSK with OpenSSL - 13.2 TLS channel binding - 13.3 Defeat TLS fingerprinting - 13.4 Consider OCSP stapling by default - 13.6 Provide callback for cert verification - 13.7 Less memory massaging with Schannel - 13.8 Support DANE - 13.9 TLS record padding - 13.10 Support Authority Information Access certificate extension (AIA) - 13.11 Some TLS options are not offered for HTTPS proxies - 13.13 Make sure we forbid TLS 1.3 post-handshake authentication - 13.14 Support the clienthello extension - 13.16 Share the CA cache - 13.17 Add missing features to TLS backends - - 14. Proxy - 14.1 Retry SOCKS handshake on address type not supported - - 15. Schannel - 15.1 Extend support for client certificate authentication - 15.2 Extend support for the --ciphers option - 15.4 Add option to allow abrupt server closure - - 16. SASL - 16.1 Other authentication mechanisms - 16.2 Add QOP support to GSSAPI authentication - - 17. SSH protocols - 17.1 Multiplexing - 17.2 Handle growing SFTP files - 17.3 Read keys from ~/.ssh/id_ecdsa, id_ed25519 - 17.4 Support CURLOPT_PREQUOTE - 17.5 SSH over HTTPS proxy with more backends - 17.6 SFTP with SCP:// - - 18. Command line tool - 18.1 sync - 18.2 glob posts - 18.4 --proxycommand - 18.5 UTF-8 filenames in Content-Disposition - 18.6 Option to make -Z merge lined based outputs on stdout - 18.7 specify which response codes that make -f/--fail return error - 18.9 Choose the name of file in braces for complex URLs - 18.10 improve how curl works in a Windows console window - 18.11 Windows: set attribute 'archive' for completed downloads - 18.12 keep running, read instructions from pipe/socket - 18.13 Acknowledge Ratelimit headers - 18.14 --dry-run - 18.15 --retry should resume - 18.17 consider filename from the redirected URL with -O ? - 18.18 retry on network is unreachable - 18.20 hostname sections in config files - 18.21 retry on the redirected-to URL - 18.23 Set the modification date on an uploaded file - 18.24 Use multiple parallel transfers for a single download - 18.25 Prevent terminal injection when writing to terminal - 18.26 Custom progress meter update interval - 18.27 -J and -O with %-encoded filenames - 18.28 -J with -C - - 18.29 --retry and transfer timeouts - - 19. Build - 19.2 Enable PIE and RELRO by default - 19.3 Do not use GNU libtool on OpenBSD - 19.4 Package curl for Windows in a signed installer - 19.5 make configure use --cache-file more and better - - 20. Test suite - 20.1 SSL tunnel - 20.2 more protocols supported - 20.3 more platforms supported - 20.4 write an SMB test server to replace impacket - 20.5 Use the RFC 6265 test suite - 20.6 Run web-platform-tests URL tests - - 21. MQTT - 21.1 Support rate-limiting - 21.2 Support MQTTS - 21.3 Handle network blocks - 21.4 large payloads - - 22. TFTP - 22.1 TFTP does not convert LF to CRLF for mode=netascii - - 23. Gopher - 23.1 Handle network blocks - -============================================================================== - -1. libcurl - -1.1 TFO support on Windows - - libcurl supports the CURLOPT_TCP_FASTOPEN option since 7.49.0 for Linux and - macOS. Windows supports TCP Fast Open starting with Windows 10, version 1607 - and we should add support for it. - - TCP Fast Open is supported on several platforms but not on Windows. Work on - this was once started but never finished. - - See https://github.com/curl/curl/pull/3378 - -1.2 Consult %APPDATA% also for .netrc - - %APPDATA%\.netrc is not considered when running on Windows. should not it? - - See https://github.com/curl/curl/issues/4016 - -1.3 struct lifreq - - Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and - SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete. - To support IPv6 interface addresses for network interfaces properly. - -1.4 alt-svc sharing - - The share interface could benefit from allowing the alt-svc cache to be - possible to share between easy handles. - - See https://github.com/curl/curl/issues/4476 - - The share interface offers CURL_LOCK_DATA_CONNECT to have multiple easy - handle share a connection cache, but due to how connections are used they are - still not thread-safe when used shared. - - See https://github.com/curl/curl/issues/4915 and lib1541.c - - The share interface offers CURL_LOCK_DATA_HSTS to have multiple easy handle - share an HSTS cache, but this is not thread-safe. - -1.5 get rid of PATH_MAX - - Having code use and rely on PATH_MAX is not nice: - https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html - - Currently the libssh2 SSH based code uses it, but to remove PATH_MAX from - there we need libssh2 to properly tell us when we pass in a too small buffer - and its current API (as of libssh2 1.2.7) does not. - -1.6 thread-safe sharing - - Using the share interface users can share some data between easy handles but - several of the sharing options are documented as not safe and supported to - share between multiple concurrent threads. Fixing this would enable more - users to share data in more powerful ways. - -1.10 auto-detect proxy - - libcurl could be made to detect the system proxy setup automatically and use - that. On Windows, macOS and Linux desktops for example. - - The pull-request to use libproxy for this was deferred due to doubts on the - reliability of the dependency and how to use it: - https://github.com/curl/curl/pull/977 - - libdetectproxy is a (C++) library for detecting the proxy on Windows - https://github.com/paulharris/libdetectproxy - -1.12 updated DNS server while running - - If /etc/resolv.conf gets updated while a program using libcurl is running, it - is may cause name resolves to fail unless res_init() is called. We should - consider calling res_init() + retry once unconditionally on all name resolve - failures to mitigate against this. Firefox works like that. Note that Windows - does not have res_init() or an alternative. - - https://github.com/curl/curl/issues/2251 - -1.13 c-ares and CURLOPT_OPENSOCKETFUNCTION - - curl creates most sockets via the CURLOPT_OPENSOCKETFUNCTION callback and - close them with the CURLOPT_CLOSESOCKETFUNCTION callback. However, c-ares - does not use those functions and instead opens and closes the sockets itself. - This means that when curl passes the c-ares socket to the - CURLMOPT_SOCKETFUNCTION it is not owned by the application like other - sockets. - - See https://github.com/curl/curl/issues/2734 - -1.15 Monitor connections in the connection pool - - libcurl's connection cache or pool holds a number of open connections for the - purpose of possible subsequent connection reuse. It may contain a few up to a - significant amount of connections. Currently, libcurl leaves all connections - as they are and first when a connection is iterated over for matching or - reuse purpose it is verified that it is still alive. - - Those connections may get closed by the server side for idleness or they may - get an HTTP/2 ping from the peer to verify that they are still alive. By - adding monitoring of the connections while in the pool, libcurl can detect - dead connections (and close them) better and earlier, and it can handle - HTTP/2 pings to keep such ones alive even when not actively doing transfers - on them. - -1.16 Try to URL encode given URL - - Given a URL that for example contains spaces, libcurl could have an option - that would try somewhat harder than it does now and convert spaces to %20 and - perhaps URL encoded byte values over 128 etc (basically do what the redirect - following code already does). - - https://github.com/curl/curl/issues/514 - -1.17 Add support for IRIs - - IRIs (RFC 3987) allow localized, non-ASCII, names in the URL. To properly - support this, curl/libcurl would need to translate/encode the given input - from the input string encoding into percent encoded output "over the wire". - - To make that work smoothly for curl users even on Windows, curl would - probably need to be able to convert from several input encodings. - -1.18 try next proxy if one does not work - - Allow an application to specify a list of proxies to try, and failing to - connect to the first go on and try the next instead until the list is - exhausted. Browsers support this feature at least when they specify proxies - using PACs. - - https://github.com/curl/curl/issues/896 - -1.19 provide timing info for each redirect - - curl and libcurl provide timing information via a set of different - time-stamps (CURLINFO_*_TIME). When curl is following redirects, those - returned time value are the accumulated sums. An improvement could be to - offer separate timings for each redirect. - - https://github.com/curl/curl/issues/6743 - -1.20 SRV and URI DNS records - - Offer support for resolving SRV and URI DNS records for libcurl to know which - server to connect to for various protocols (including HTTP). - -1.22 CURLINFO_PAUSE_STATE - - Return information about the transfer's current pause state, in both - directions. https://github.com/curl/curl/issues/2588 - -1.25 Expose tried IP addresses that failed - - When libcurl fails to connect to a host, it could offer the application the - addresses that were used in the attempt. Source + dest IP, source + dest port - and protocol (UDP or TCP) for each failure. Possibly as a callback. Perhaps - also provide "reason". - - https://github.com/curl/curl/issues/2126 - -1.30 config file parsing - - Consider providing an API, possibly in a separate companion library, for - parsing a config file like curl's -K/--config option to allow applications to - get the same ability to read curl options from files. - - See https://github.com/curl/curl/issues/3698 - -1.31 erase secrets from heap/stack after use - - Introducing a concept and system to erase secrets from memory after use, it - could help mitigate and lessen the impact of (future) security problems etc. - However: most secrets are passed to libcurl as clear text from the - application and then clearing them within the library adds nothing... - - https://github.com/curl/curl/issues/7268 - -1.32 add asynch getaddrinfo support - - Use getaddrinfo_a() to provide an asynch name resolver backend to libcurl - that does not use threads and does not depend on c-ares. The getaddrinfo_a - function is (probably?) glibc specific but that is a widely used libc among - our users. - - https://github.com/curl/curl/pull/6746 - -1.33 make DoH inherit more transfer properties - - Some options are not inherited because they are not relevant for the DoH SSL - connections, or inheriting the option may result in unexpected behavior. For - example the user's debug function callback is not inherited because it would - be unexpected for internal handles (ie DoH handles) to be passed to that - callback. - - If an option is not inherited then it is not possible to set it separately - for DoH without a DoH-specific option. For example: - CURLOPT_DOH_SSL_VERIFYHOST, CURLOPT_DOH_SSL_VERIFYPEER and - CURLOPT_DOH_SSL_VERIFYSTATUS. - - See https://github.com/curl/curl/issues/6605 - -2. libcurl - multi interface - -2.1 More non-blocking - - Make sure we do not ever loop because of non-blocking sockets returning - EWOULDBLOCK or similar. Blocking cases include: - - - Name resolves on non-Windows unless c-ares or the threaded resolver is used. - - - The threaded resolver may block on cleanup: - https://github.com/curl/curl/issues/4852 - - - file:// transfers - - - TELNET transfers - - - GSSAPI authentication for FTP transfers - - - The "DONE" operation (post transfer protocol-specific actions) for the - protocols SFTP, SMTP, FTP. Fixing multi_done() for this is a worthy task. - - - curl_multi_remove_handle for any of the above. See section 2.3. - - - Calling curl_ws_send() from a callback - -2.2 Better support for same name resolves - - If a name resolve has been initiated for name NN and a second easy handle - wants to resolve that name as well, make it wait for the first resolve to end - up in the cache instead of doing a second separate resolve. This is - especially needed when adding many simultaneous handles using the same host - name when the DNS resolver can get flooded. - -2.3 Non-blocking curl_multi_remove_handle() - - The multi interface has a few API calls that assume a blocking behavior, like - add_handle() and remove_handle() which limits what we can do internally. The - multi API need to be moved even more into a single function that "drives" - everything in a non-blocking manner and signals when something is done. A - remove or add would then only ask for the action to get started and then - multi_perform() etc still be called until the add/remove is completed. - -2.4 Split connect and authentication process - - The multi interface treats the authentication process as part of the connect - phase. As such any failures during authentication does not trigger the - relevant QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP. - -2.5 Edge-triggered sockets should work - - The multi_socket API should work with edge-triggered socket events. One of - the internal actions that need to be improved for this to work perfectly is - the 'maxloops' handling in transfer.c:readwrite_data(). - -2.6 multi upkeep - - In libcurl 7.62.0 we introduced curl_easy_upkeep. It unfortunately only works - on easy handles. We should introduces a version of that for the multi handle, - and also consider doing "upkeep" automatically on connections in the - connection pool when the multi handle is in used. - - See https://github.com/curl/curl/issues/3199 - -2.7 Virtual external sockets - - libcurl performs operations on the given file descriptor that presumes it is - a socket and an application cannot replace them at the moment. Allowing an - application to fully replace those would allow a larger degree of freedom and - flexibility. - - See https://github.com/curl/curl/issues/5835 - -2.8 dynamically decide to use socketpair - - For users who do not use curl_multi_wait() or do not care for - curl_multi_wakeup(), we could introduce a way to make libcurl NOT - create a socketpair in the multi handle. - - See https://github.com/curl/curl/issues/4829 - -3. Documentation - -3.1 Improve documentation about fork safety - - See https://github.com/curl/curl/issues/6968 - -4. FTP - -4.1 HOST - - HOST is a command for a client to tell which hostname to use, to offer FTP - servers named-based virtual hosting: - - https://datatracker.ietf.org/doc/html/rfc7151 - -4.2 A fixed directory listing format - - Since listing the contents of a remove directory with FTP is returning the - list in a format and style the server likes without any estblished or even - defactor standard existing, it would be a feature to users if curl could - parse the directory listing and output a general curl format that is fixed - and the same, independent of the server's choice. This would allow users to - better and more reliably extract information about remote content via FTP - directory listings. - -4.6 GSSAPI via Windows SSPI - - In addition to currently supporting the SASL GSSAPI mechanism (Kerberos V5) - via third-party GSS-API libraries, such as MIT Kerberos, also add support - for GSSAPI authentication via Windows SSPI. - -4.7 STAT for LIST without data connection - - Some FTP servers allow STAT for listing directories instead of using LIST, - and the response is then sent over the control connection instead of as the - otherwise usedw data connection: https://www.nsftools.com/tips/RawFTP.htm#STAT - - This is not detailed in any FTP specification. - -4.8 Passive transfer could try other IP addresses - - When doing FTP operations through a proxy at localhost, the reported spotted - that curl only tried to connect once to the proxy, while it had multiple - addresses and a failed connect on one address should make it try the next. - - After switching to passive mode (EPSV), curl could try all IP addresses for - "localhost". Currently it tries ::1, but it should also try 127.0.0.1. - - See https://github.com/curl/curl/issues/1508 - -5. HTTP - -5.1 Provide the error body from a CONNECT response - - When curl receives a body response from a CONNECT request to a proxy, it - always just reads and ignores it. It would make some users happy if curl - instead optionally would be able to make that responsible available. Via a - new callback? Through some other means? - - See https://github.com/curl/curl/issues/9513 - -5.2 Obey Retry-After in redirects - - The Retry-After is said to dictate "the minimum time that the user agent is - asked to wait before issuing the redirected request" and libcurl does not - obey this. - - See https://github.com/curl/curl/issues/11447 - -5.3 Rearrange request header order - - Server implementers often make an effort to detect browser and to reject - clients it can detect to not match. One of the last details we cannot yet - control in libcurl's HTTP requests, which also can be exploited to detect - that libcurl is in fact used even when it tries to impersonate a browser, is - the order of the request headers. I propose that we introduce a new option in - which you give headers a value, and then when the HTTP request is built it - sorts the headers based on that number. We could then have internally created - headers use a default value so only headers that need to be moved have to be - specified. - -5.4 Allow SAN names in HTTP/2 server push - - curl only allows HTTP/2 push promise if the provided :authority header value - exactly matches the hostname given in the URL. It could be extended to allow - any name that would match the Subject Alternative Names in the server's TLS - certificate. - - See https://github.com/curl/curl/pull/3581 - -5.5 auth= in URLs - - Add the ability to specify the preferred authentication mechanism to use by - using ;auth= in the login part of the URL. - - For example: - - http://test:pass;auth=NTLM@example.com would be equivalent to specifying - --user test:pass;auth=NTLM or --user test:pass --ntlm from the command line. - - Additionally this should be implemented for proxy base URLs as well. - -5.6 alt-svc should fallback if alt-svc does not work - - The alt-svc: header provides a set of alternative services for curl to use - instead of the original. If the first attempted one fails, it should try the - next etc and if all alternatives fail go back to the original. - - See https://github.com/curl/curl/issues/4908 - -5.7 Require HTTP version X or higher - - curl and libcurl provide options for trying higher HTTP versions (for example - HTTP/2) but then still allows the server to pick version 1.1. We could - consider adding a way to require a minimum version. - - See https://github.com/curl/curl/issues/7980 - -6. TELNET - -6.1 ditch stdin - - Reading input (to send to the remote server) on stdin is a crappy solution - for library purposes. We need to invent a good way for the application to be - able to provide the data to send. - -6.2 ditch telnet-specific select - - Move the telnet support's network select() loop go away and merge the code - into the main transfer loop. Until this is done, the multi interface does not - work for telnet. - -6.3 feature negotiation debug data - - Add telnet feature negotiation data to the debug callback as header data. - -6.4 exit immediately upon connection if stdin is /dev/null - - If it did, curl could be used to probe if there is an server there listening - on a specific port. That is, the following command would exit immediately - after the connection is established with exit code 0: - - curl -s --connect-timeout 2 telnet://example.com:80 NOTIFY=SUCCESS,FAILURE" ); - - https://github.com/curl/curl/issues/8232 - -7.2 Enhanced capability support - - Add the ability, for an application that uses libcurl, to obtain the list of - capabilities returned from the EHLO command. - -7.3 Add CURLOPT_MAIL_CLIENT option - - Rather than use the URL to specify the mail client string to present in the - HELO and EHLO commands, libcurl should support a new CURLOPT specifically for - specifying this data as the URL is non-standard and to be honest a bit of a - hack ;-) - - Please see the following thread for more information: - https://curl.se/mail/lib-2012-05/0178.html - - -8. POP3 - -8.2 Enhanced capability support - - Add the ability, for an application that uses libcurl, to obtain the list of - capabilities returned from the CAPA command. - -9. IMAP - -9.1 Enhanced capability support - - Add the ability, for an application that uses libcurl, to obtain the list of - capabilities returned from the CAPABILITY command. - -10. LDAP - -10.1 SASL based authentication mechanisms - - Currently the LDAP module only supports ldap_simple_bind_s() in order to bind - to an LDAP server. However, this function sends username and password details - using the simple authentication mechanism (as clear text). However, it should - be possible to use ldap_bind_s() instead specifying the security context - information ourselves. - -10.2 CURLOPT_SSL_CTX_FUNCTION for LDAPS - - CURLOPT_SSL_CTX_FUNCTION works perfectly for HTTPS and email protocols, but - it has no effect for LDAPS connections. - - https://github.com/curl/curl/issues/4108 - -10.3 Paged searches on LDAP server - - https://github.com/curl/curl/issues/4452 - -10.4 Certificate-Based Authentication - - LDAPS not possible with macOS and Windows with Certificate-Based Authentication - - https://github.com/curl/curl/issues/9641 - -11. SMB - -11.1 File listing support - - Add support for listing the contents of an SMB share. The output should - probably be the same as/similar to FTP. - -11.2 Honor file timestamps - - The timestamp of the transferred file should reflect that of the original - file. - -11.3 Use NTLMv2 - - Currently the SMB authentication uses NTLMv1. - -11.4 Create remote directories - - Support for creating remote directories when uploading a file to a directory - that does not exist on the server, just like --ftp-create-dirs. - - -12. FILE - -12.1 Directory listing on non-POSIX - - Listing the contents of a directory accessed with FILE only works on - platforms with opendir. Support could be added for more systems, like - Windows. - -13. TLS - -13.1 TLS-PSK with OpenSSL - - Transport Layer Security pre-shared key ciphersuites (TLS-PSK) is a set of - cryptographic protocols that provide secure communication based on pre-shared - keys (PSKs). These pre-shared keys are symmetric keys shared in advance among - the communicating parties. - - https://github.com/curl/curl/issues/5081 - -13.2 TLS channel binding - - TLS 1.2 and 1.3 provide the ability to extract some secret data from the TLS - connection and use it in the client request (usually in some sort of - authentication) to ensure that the data sent is bound to the specific TLS - connection and cannot be successfully intercepted by a proxy. This - functionality can be used in a standard authentication mechanism such as - GSS-API or SCRAM, or in custom approaches like custom HTTP Authentication - headers. - - For TLS 1.2, the binding type is usually tls-unique, and for TLS 1.3 it is - tls-exporter. - - https://datatracker.ietf.org/doc/html/rfc5929 - https://datatracker.ietf.org/doc/html/rfc9266 - https://github.com/curl/curl/issues/9226 - -13.3 Defeat TLS fingerprinting - - By changing the order of TLS extensions provided in the TLS handshake, it is - sometimes possible to circumvent TLS fingerprinting by servers. The TLS - extension order is of course not the only way to fingerprint a client. - -13.4 Consider OCSP stapling by default - - Treat a negative response a reason for aborting the connection. Since OCSP - stapling is presumed to get used much less in the future when Let's Encrypt - drops the OCSP support, the benefit of this might however be limited. - - https://github.com/curl/curl/issues/15483 - -13.6 Provide callback for cert verification - - OpenSSL supports a callback for customised verification of the peer - certificate, but this does not seem to be exposed in the libcurl APIs. Could - it be? There is so much that could be done if it were. - -13.7 Less memory massaging with Schannel - - The Schannel backend does a lot of custom memory management we would rather - avoid: the repeated alloc + free in sends and the custom memory + realloc - system for encrypted and decrypted data. That should be avoided and reduced - for 1) efficiency and 2) safety. - -13.8 Support DANE - - DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL - keys and certs over DNS using DNSSEC as an alternative to the CA model. - https://datatracker.ietf.org/doc/html/rfc6698 - - An initial patch was posted by Suresh Krishnaswamy on March 7th 2013 - (https://curl.se/mail/lib-2013-03/0075.html) but it was a too simple - approach. See Daniel's comments: - https://curl.se/mail/lib-2013-03/0103.html . libunbound may be the - correct library to base this development on. - - Björn Stenberg wrote a separate initial take on DANE that was never - completed. - -13.9 TLS record padding - - TLS (1.3) offers optional record padding and OpenSSL provides an API for it. - I could make sense for libcurl to offer this ability to applications to make - traffic patterns harder to figure out by network traffic observers. - - See https://github.com/curl/curl/issues/5398 - -13.10 Support Authority Information Access certificate extension (AIA) - - AIA can provide various things like CRLs but more importantly information - about intermediate CA certificates that can allow validation path to be - fulfilled when the HTTPS server does not itself provide them. - - Since AIA is about downloading certs on demand to complete a TLS handshake, - it is probably a bit tricky to get done right. - - See https://github.com/curl/curl/issues/2793 - -13.11 Some TLS options are not offered for HTTPS proxies - - Some TLS related options to the command line tool and libcurl are only - provided for the server and not for HTTPS proxies. --proxy-tls-max, - --proxy-tlsv1.3, --proxy-curves and a few more. - For more Documentation on this see: - https://curl.se/libcurl/c/tls-options.html - - https://github.com/curl/curl/issues/12286 - -13.13 Make sure we forbid TLS 1.3 post-handshake authentication - - RFC 8740 explains how using HTTP/2 must forbid the use of TLS 1.3 - post-handshake authentication. We should make sure to live up to that. - - See https://github.com/curl/curl/issues/5396 - -13.14 Support the clienthello extension - - Certain stupid networks and middle boxes have a problem with SSL handshake - packets that are within a certain size range because how that sets some bits - that previously (in older TLS version) were not set. The clienthello - extension adds padding to avoid that size range. - - https://datatracker.ietf.org/doc/html/rfc7685 - https://github.com/curl/curl/issues/2299 - -13.16 Share the CA cache - - For TLS backends that supports CA caching, it makes sense to allow the share - object to be used to store the CA cache as well via the share API. Would - allow multiple easy handles to reuse the CA cache and save themselves from a - lot of extra processing overhead. - -13.17 Add missing features to TLS backends - - The feature matrix at https://curl.se/libcurl/c/tls-options.html shows which - features are supported by which TLS backends, and thus also where there are - feature gaps. - -14. Proxy - -14.1 Retry SOCKS handshake on address type not supported - - When curl resolves a hostname, it might get a mix of IPv6 and IPv4 returned. - curl might then use an IPv6 address with a SOCKS5 proxy, which - if it does - not support IPv6 - returns "Address type not supported" and curl exits with - that error. - - Perhaps it is preferred if curl would in this situation instead first retry - the SOCKS handshake again for this case and then use one of the IPv4 - addresses for the target host. - - See https://github.com/curl/curl/issues/17222 - -15. Schannel - -15.1 Extend support for client certificate authentication - - The existing support for the -E/--cert and --key options could be - extended by supplying a custom certificate and key in PEM format, see: - - Getting a Certificate for Schannel - https://learn.microsoft.com/windows/win32/secauthn/getting-a-certificate-for-schannel - -15.2 Extend support for the --ciphers option - - The existing support for the --ciphers option could be extended - by mapping the OpenSSL/GnuTLS cipher suites to the Schannel APIs, see - - Specifying Schannel Ciphers and Cipher Strengths - https://learn.microsoft.com/windows/win32/secauthn/specifying-schannel-ciphers-and-cipher-strengths - -15.4 Add option to allow abrupt server closure - - libcurl with Schannel errors without a known termination point from the server - (such as length of transfer, or SSL "close notify" alert) to prevent against - a truncation attack. Really old servers may neglect to send any termination - point. An option could be added to ignore such abrupt closures. - - https://github.com/curl/curl/issues/4427 - -16. SASL - -16.1 Other authentication mechanisms - - Add support for other authentication mechanisms such as OLP, - GSS-SPNEGO and others. - -16.2 Add QOP support to GSSAPI authentication - - Currently the GSSAPI authentication only supports the default QOP of auth - (Authentication), whilst Kerberos V5 supports both auth-int (Authentication - with integrity protection) and auth-conf (Authentication with integrity and - privacy protection). - - -17. SSH protocols - -17.1 Multiplexing - - SSH is a perfectly fine multiplexed protocols which would allow libcurl to do - multiple parallel transfers from the same host using the same connection, - much in the same spirit as HTTP/2 does. libcurl however does not take - advantage of that ability but does instead always create a new connection for - new transfers even if an existing connection already exists to the host. - - To fix this, libcurl would have to detect an existing connection and "attach" - the new transfer to the existing one. - -17.2 Handle growing SFTP files - - The SFTP code in libcurl checks the file size *before* a transfer starts and - then proceeds to transfer exactly that amount of data. If the remote file - grows while the transfer is in progress libcurl does not notice and does not - adapt. The OpenSSH SFTP command line tool does and libcurl could also just - attempt to download more to see if there is more to get... - - https://github.com/curl/curl/issues/4344 - -17.3 Read keys from ~/.ssh/id_ecdsa, id_ed25519 - - The libssh2 backend in curl is limited to only reading keys from id_rsa and - id_dsa, which makes it fail connecting to servers that use more modern key - types. - - https://github.com/curl/curl/issues/8586 - -17.4 Support CURLOPT_PREQUOTE - - The two other QUOTE options are supported for SFTP, but this was left out for - unknown reasons. - -17.5 SSH over HTTPS proxy with more backends - - The SSH based protocols SFTP and SCP did not work over HTTPS proxy at - all until PR https://github.com/curl/curl/pull/6021 brought the - functionality with the libssh2 backend. Presumably, this support - can/could be added for the other backends as well. - -17.6 SFTP with SCP:// - - OpenSSH 9 switched their 'scp' tool to speak SFTP under the hood. Going - forward it might be worth having curl or libcurl attempt SFTP if SCP fails to - follow suite. - -18. Command line tool - -18.1 sync - - "curl --sync http://example.com/feed[1-100].rss" or - "curl --sync http://example.net/{index,calendar,history}.html" - - Downloads a range or set of URLs using the remote name, but only if the - remote file is newer than the local file. A Last-Modified HTTP date header - should also be used to set the mod date on the downloaded file. - -18.2 glob posts - - Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'. - This is easily scripted though. - -18.4 --proxycommand - - Allow the user to make curl run a command and use its stdio to make requests - and not do any network connection by itself. Example: - - curl --proxycommand 'ssh pi@raspberrypi.local -W 10.1.1.75 80' \ - http://some/otherwise/unavailable/service.php - - See https://github.com/curl/curl/issues/4941 - -18.5 UTF-8 filenames in Content-Disposition - - RFC 6266 documents how UTF-8 names can be passed to a client in the - Content-Disposition header, and curl does not support this. - - https://github.com/curl/curl/issues/1888 - -18.6 Option to make -Z merge lined based outputs on stdout - - When a user requests multiple lined based files using -Z and sends them to - stdout, curl does not "merge" and send complete lines fine but may send - partial lines from several sources. - - https://github.com/curl/curl/issues/5175 - -18.7 specify which response codes that make -f/--fail return error - - Allows a user to better specify exactly which error code(s) that are fine - and which are errors for their specific uses cases - -18.9 Choose the name of file in braces for complex URLs - - When using braces to download a list of URLs and you use complicated names - in the list of alternatives, it could be handy to allow curl to use other - names when saving. - - Consider a way to offer that. Possibly like - {partURL1:name1,partURL2:name2,partURL3:name3} where the name following the - colon is the output name. - - See https://github.com/curl/curl/issues/221 - -18.10 improve how curl works in a Windows console window - - If you pull the scrollbar when transferring with curl in a Windows console - window, the transfer is interrupted and can get disconnected. This can - probably be improved. See https://github.com/curl/curl/issues/322 - -18.11 Windows: set attribute 'archive' for completed downloads - - The archive bit (FILE_ATTRIBUTE_ARCHIVE, 0x20) separates files that shall be - backed up from those that are either not ready or have not changed. - - Downloads in progress are neither ready to be backed up, nor should they be - opened by a different process. Only after a download has been completed it is - sensible to include it in any integer snapshot or backup of the system. - - See https://github.com/curl/curl/issues/3354 - -18.12 keep running, read instructions from pipe/socket - - Provide an option that makes curl not exit after the last URL (or even work - without a given URL), and then make it read instructions passed on a pipe or - over a socket to make further instructions so that a second subsequent curl - invoke can talk to the still running instance and ask for transfers to get - done, and thus maintain its connection pool, DNS cache and more. - -18.13 Acknowledge Ratelimit headers - - Consider a command line option that can make curl do multiple serial requests - while acknowledging server specified rate limits: - https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/ - - See https://github.com/curl/curl/issues/5406 - -18.14 --dry-run - - A command line option that makes curl show exactly what it would do and send - if it would run for real. - - See https://github.com/curl/curl/issues/5426 - -18.15 --retry should resume - - When --retry is used and curl actually retries transfer, it should use the - already transferred data and do a resumed transfer for the rest (when - possible) so that it does not have to transfer the same data again that was - already transferred before the retry. - - See https://github.com/curl/curl/issues/1084 - -18.17 consider filename from the redirected URL with -O ? - - When a user gives a URL and uses -O, and curl follows a redirect to a new - URL, the filename is not extracted and used from the newly redirected-to URL - even if the new URL may have a much more sensible filename. - - This is clearly documented and helps for security since there is no surprise - to users which filename that might get overwritten, but maybe a new option - could allow for this or maybe -J should imply such a treatment as well as -J - already allows for the server to decide what filename to use so it already - provides the "may overwrite any file" risk. - - This is extra tricky if the original URL has no filename part at all since - then the current code path does error out with an error message, and we - cannot *know* already at that point if curl is redirected to a URL that has a - filename... - - See https://github.com/curl/curl/issues/1241 - -18.18 retry on network is unreachable - - The --retry option retries transfers on "transient failures". We later added - --retry-connrefused to also retry for "connection refused" errors. - - Suggestions have been brought to also allow retry on "network is unreachable" - errors and while totally reasonable, maybe we should consider a way to make - this more configurable than to add a new option for every new error people - want to retry for? - - https://github.com/curl/curl/issues/1603 - -18.20 hostname sections in config files - - config files would be more powerful if they could set different - configurations depending on used URLs, hostname or possibly origin. Then a - default .curlrc could a specific user-agent only when doing requests against - a certain site. - -18.21 retry on the redirected-to URL - - When curl is told to --retry a failed transfer and follows redirects, it - might get an HTTP 429 response from the redirected-to URL and not the - original one, which then could make curl decide to rather retry the transfer - on that URL only instead of the original operation to the original URL. - - Perhaps extra emphasized if the original transfer is a large POST that - redirects to a separate GET, and that GET is what gets the 529 - - See https://github.com/curl/curl/issues/5462 - -18.23 Set the modification date on an uploaded file - - For SFTP and possibly FTP, curl could offer an option to set the - modification time for the uploaded file. - - See https://github.com/curl/curl/issues/5768 - -18.24 Use multiple parallel transfers for a single download - - To enhance transfer speed, downloading a single URL can be split up into - multiple separate range downloads that get combined into a single final - result. - - An ideal implementation would not use a specified number of parallel - transfers, but curl could: - - First start getting the full file as transfer A - - If after N seconds have passed and the transfer is expected to continue for - M seconds or more, add a new transfer (B) that asks for the second half of - A's content (and stop A at the middle). - - If splitting up the work improves the transfer rate, it could then be done - again. Then again, etc up to a limit. - - This way, if transfer B fails (because Range: is not supported) it lets - transfer A remain the single one. N and M could be set to some sensible - defaults. - - See https://github.com/curl/curl/issues/5774 - -18.25 Prevent terminal injection when writing to terminal - - curl could offer an option to make escape sequence either non-functional or - avoid cursor moves or similar to reduce the risk of a user getting tricked by - clever tricks. - - See https://github.com/curl/curl/issues/6150 - -18.26 Custom progress meter update interval - - Users who are for example doing large downloads in CI or remote setups might - want the occasional progress meter update to see that the transfer is - progressing and has not stuck, but they may not appreciate the - many-times-a-second frequency curl can end up doing it with now. - -18.27 -J and -O with %-encoded filenames - - -J/--remote-header-name does not decode %-encoded filenames. RFC 6266 details - how it should be done. The can of worm is basically that we have no charset - handling in curl and ASCII >=128 is a challenge for us. Not to mention that - decoding also means that we need to check for nastiness that is attempted, - like "../" sequences and the like. Probably everything to the left of any - embedded slashes should be cut off. - https://curl.se/bug/view.cgi?id=1294 - - -O also does not decode %-encoded names, and while it has even less - information about the charset involved the process is similar to the -J case. - - Note that we do not decode -O without the user asking for it with some other - means, since -O has always been documented to use the name exactly as - specified in the URL. - -18.28 -J with -C - - - When using -J (with -O), automatically resumed downloading together with "-C - -" fails. Without -J the same command line works. This happens because the - resume logic is worked out before the target filename (and thus its - pre-transfer size) has been figured out. This can be improved. - - https://curl.se/bug/view.cgi?id=1169 - -18.29 --retry and transfer timeouts - - If using --retry and the transfer timeouts (possibly due to using -m or - -y/-Y) the next attempt does not resume the transfer properly from what was - downloaded in the previous attempt but truncates and restarts at the original - position where it was at before the previous failed attempt. See - https://curl.se/mail/lib-2008-01/0080.html - -19. Build - -19.2 Enable PIE and RELRO by default - - Especially when having programs that execute curl via the command line, PIE - renders the exploitation of memory corruption vulnerabilities a lot more - difficult. This can be attributed to the additional information leaks being - required to conduct a successful attack. RELRO, on the other hand, masks - different binary sections like the GOT as read-only and thus kills a handful - of techniques that come in handy when attackers are able to arbitrarily - overwrite memory. A few tests showed that enabling these features had close - to no impact, neither on the performance nor on the general functionality of - curl. - -19.3 Do not use GNU libtool on OpenBSD - - When compiling curl on OpenBSD with "--enable-debug" it gives linking errors - when you use GNU libtool. This can be fixed by using the libtool provided by - OpenBSD itself. However for this the user always needs to invoke make with - "LIBTOOL=/usr/bin/libtool". It would be nice if the script could have some - magic to detect if this system is an OpenBSD host and then use the OpenBSD - libtool instead. - - See https://github.com/curl/curl/issues/5862 - -19.4 Package curl for Windows in a signed installer - - See https://github.com/curl/curl/issues/5424 - -19.5 make configure use --cache-file more and better - - The configure script can be improved to cache more values so that repeated - invokes run much faster. - - See https://github.com/curl/curl/issues/7753 - -20. Test suite - -20.1 SSL tunnel - - Make our own version of stunnel for simple port forwarding to enable HTTPS - and FTP-SSL tests without the stunnel dependency, and it could allow us to - provide test tools built with either OpenSSL or GnuTLS - -20.2 more protocols supported - - Extend the test suite to include more protocols. The telnet could just do FTP - or http operations (for which we have test servers). - -20.3 more platforms supported - - Make the test suite work on more platforms. OpenBSD and macOS. Remove - fork()s and it should become even more portable. - -20.4 write an SMB test server to replace impacket - - This would allow us to run SMB tests on more platforms and do better and more - covering tests. - - See https://github.com/curl/curl/issues/15697 - -20.5 Use the RFC 6265 test suite - - A test suite made for HTTP cookies (RFC 6265) by Adam Barth is available at - https://github.com/abarth/http-state/tree/master/tests - - It would be good if someone would write a script/setup that would run curl - with that test suite and detect deviances. Ideally, that would even be - incorporated into our regular test suite. - -20.6 Run web-platform-tests URL tests - - Run web-platform-tests URL tests and compare results with browsers on wpt.fyi - - It would help us find issues to fix and help us document where our parser - differs from the WHATWG URL spec parsers. - - See https://github.com/curl/curl/issues/4477 - -21. MQTT - -21.1 Support rate-limiting - - The rate-limiting logic is done in the PERFORMING state in multi.c but MQTT - is not (yet) implemented to use that. - -21.2 Support MQTTS - -21.3 Handle network blocks - - Running test suite with `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes - several MQTT test cases fail where they should not. - -21.4 large payloads - - libcurl unnecessarily allocates heap memory to hold the entire payload to get - sent, when the data is already perfectly accessible where it is when - `CURLOPT_POSTFIELDS` is used. This is highly inefficient for larger payloads. - Additionally, libcurl does not support using the read callback for sending - MQTT which is yet another way to avoid having to hold large payload in - memory. - -22. TFTP - -22.1 TFTP does not convert LF to CRLF for mode=netascii - - RFC 3617 defines that an TFTP transfer can be done using "netascii" mode. - curl does not support extracting that mode from the URL nor does it treat - such transfers specifically. It should probably do LF to CRLF translations - for them. - - See https://github.com/curl/curl/issues/12655 - -23. Gopher - -23.1 Handle network blocks - - Running test suite with - `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a 1200 to 1300` makes several - Gopher test cases fail where they should not. diff --git a/docs/TODO.md b/docs/TODO.md new file mode 100644 index 000000000000..09b45443c791 --- /dev/null +++ b/docs/TODO.md @@ -0,0 +1,1111 @@ + + +# TODO intro + +Things to do in project curl. Please tell us what you think, contribute and +send us patches that improve things. + +Be aware that these are things that we could do, or have once been considered +things we could do. If you want to work on any of these areas, please consider +bringing it up for discussions first on the mailing list so that we all agree +it is still a good idea for the project. + +All bugs documented in the [known_bugs +document](https://curl.se/docs/knownbugs.html) are subject for fixing. + +# libcurl + +## TCP Fast Open support on Windows + +libcurl supports the `CURLOPT_TCP_FASTOPEN` option since 7.49.0 for Linux and +macOS. Windows supports TCP Fast Open starting with Windows 10, version 1607 +and we should add support for it. + +TCP Fast Open is supported on several platforms but not on Windows. Work on +this was once started but never finished. + +See [curl pull request 3378](https://github.com/curl/curl/pull/3378) + +## Consult `%APPDATA%` also for `.netrc` + +`%APPDATA%\.netrc` is not considered when running on Windows. Should not it? + +See [curl issue 4016](https://github.com/curl/curl/issues/4016) + +## `struct lifreq` + +Use `struct lifreq` and `SIOCGLIFADDR` instead of `struct ifreq` and +`SIOCGIFADDR` on newer Solaris versions as they claim the latter is obsolete. +To support IPv6 interface addresses for network interfaces properly. + +## alt-svc sharing + +The share interface could benefit from allowing the alt-svc cache to be +possible to share between easy handles. + +See [curl issue 4476](https://github.com/curl/curl/issues/4476) + +The share interface offers CURL_LOCK_DATA_CONNECT to have multiple easy +handle share a connection cache, but due to how connections are used they are +still not thread-safe when used shared. + +See [curl issue 4915](https://github.com/curl/curl/issues/4915) and lib1541.c + +The share interface offers CURL_LOCK_DATA_HSTS to have multiple easy handle +share an HSTS cache, but this is not thread-safe. + +## get rid of PATH_MAX + +Having code use and rely on PATH_MAX is not nice: +https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html + +Currently the libssh2 SSH based code uses it, but to remove PATH_MAX from +there we need libssh2 to properly tell us when we pass in a too small buffer +and its current API (as of libssh2 1.2.7) does not. + +## thread-safe sharing + +Using the share interface users can share some data between easy handles but +several of the sharing options are documented as not safe and supported to +share between multiple concurrent threads. Fixing this would enable more users +to share data in more powerful ways. + +## auto-detect proxy + +libcurl could be made to detect the system proxy setup automatically and use +that. On Windows, macOS and Linux desktops for example. + +The [pull-request to use *libproxy*](https://github.com/curl/curl/pull/977) +for this was deferred due to doubts on the reliability of the dependency and +how to use it. + +[*libdetectproxy*](https://github.com/paulharris/libdetectproxy) is a (C++) +library for detecting the proxy on Windows. + +## updated DNS server while running + +If `/etc/resolv.conf` gets updated while a program using libcurl is running, it +is may cause name resolves to fail unless `res_init()` is called. We should +consider calling `res_init()` + retry once unconditionally on all name resolve +failures to mitigate against this. Firefox works like that. Note that Windows +does not have `res_init()` or an alternative. + +[curl issue 2251](https://github.com/curl/curl/issues/2251) + +## c-ares and CURLOPT_OPENSOCKETFUNCTION + +curl creates most sockets via the CURLOPT_OPENSOCKETFUNCTION callback and +close them with the CURLOPT_CLOSESOCKETFUNCTION callback. However, c-ares does +not use those functions and instead opens and closes the sockets itself. This +means that when curl passes the c-ares socket to the CURLMOPT_SOCKETFUNCTION +it is not owned by the application like other sockets. + +See [curl issue 2734](https://github.com/curl/curl/issues/2734) + +## Monitor connections in the connection pool + +libcurl's connection cache or pool holds a number of open connections for the +purpose of possible subsequent connection reuse. It may contain a few up to a +significant amount of connections. Currently, libcurl leaves all connections +as they are and first when a connection is iterated over for matching or reuse +purpose it is verified that it is still alive. + +Those connections may get closed by the server side for idleness or they may +get an HTTP/2 ping from the peer to verify that they are still alive. By +adding monitoring of the connections while in the pool, libcurl can detect +dead connections (and close them) better and earlier, and it can handle HTTP/2 +pings to keep such ones alive even when not actively doing transfers on them. + +## Try to URL encode given URL + +Given a URL that for example contains spaces, libcurl could have an option +that would try somewhat harder than it does now and convert spaces to %20 and +perhaps URL encoded byte values over 128 etc (basically do what the redirect +following code already does). + +[curl issue 514](https://github.com/curl/curl/issues/514) + +## Add support for IRIs + +IRIs (RFC 3987) allow localized, non-ASCII, names in the URL. To properly +support this, curl/libcurl would need to translate/encode the given input +from the input string encoding into percent encoded output "over the wire". + +To make that work smoothly for curl users even on Windows, curl would probably +need to be able to convert from several input encodings. + +## try next proxy if one does not work + +Allow an application to specify a list of proxies to try, and failing to +connect to the first go on and try the next instead until the list is +exhausted. Browsers support this feature at least when they specify proxies +using `PAC`. + +[curl issue 896](https://github.com/curl/curl/issues/896) + +## provide timing info for each redirect + +curl and libcurl provide timing information via a set of different time-stamps +(CURLINFO_*_TIME). When curl is following redirects, those returned time value +are the accumulated sums. An improvement could be to offer separate timings +for each redirect. + +[curl issue 6743](https://github.com/curl/curl/issues/6743) + +## `SRV` and `URI` DNS records + +Offer support for resolving `SRV` and `URI` DNS records for libcurl to know which +server to connect to for various protocols (including HTTP). + +## CURLINFO_PAUSE_STATE + +Return information about the transfer's current pause state, in both +directions. See [curl issue 2588](https://github.com/curl/curl/issues/2588) + +## Expose tried IP addresses that failed + +When libcurl fails to connect to a host, it could offer the application the +addresses that were used in the attempt. Source + destination IP, source + +destination port and protocol (UDP or TCP) for each failure. Possibly as a +callback. Perhaps also provide reason. + +[curl issue 2126](https://github.com/curl/curl/issues/2126) + +## config file parsing + +Consider providing an API, possibly in a separate companion library, for +parsing a config file like curl's `-K`/`--config` option to allow applications +to get the same ability to read curl options from files. + +See [curl issue 3698](https://github.com/curl/curl/issues/3698) + +## erase secrets from heap/stack after use + +Introducing a concept and system to erase secrets from memory after use, it +could help mitigate and lessen the impact of (future) security problems etc. +However: most secrets are passed to libcurl as clear text from the application +and then clearing them within the library adds nothing... + +[curl issue 7268](https://github.com/curl/curl/issues/7268) + +## add asynch getaddrinfo support + +Use `getaddrinfo_a()` to provide an asynch name resolver backend to libcurl +that does not use threads and does not depend on c-ares. The `getaddrinfo_a` +function is (probably?) glibc specific but that is a widely used libc among +our users. + +[curl pull request 6746](https://github.com/curl/curl/pull/6746) + +## make DoH inherit more transfer properties + +Some options are not inherited because they are not relevant for the DoH SSL +connections, or inheriting the option may result in unexpected behavior. For +example the user's debug function callback is not inherited because it would +be unexpected for internal handles (i.e DoH handles) to be passed to that +callback. + +If an option is not inherited then it is not possible to set it separately +for DoH without a DoH-specific option. For example: +`CURLOPT_DOH_SSL_VERIFYHOST`, `CURLOPT_DOH_SSL_VERIFYPEER` and +`CURLOPT_DOH_SSL_VERIFYSTATUS`. + +See [curl issue 6605](https://github.com/curl/curl/issues/6605) + +# libcurl - multi interface + +## More non-blocking + +Make sure we do not ever loop because of non-blocking sockets returning +`EWOULDBLOCK` or similar. Blocking cases include: + +- Name resolves on non-Windows unless c-ares or the threaded resolver is used. +- The threaded resolver may block on cleanup: + [curl issue 4852](https://github.com/curl/curl/issues/4852) +- `file://` transfers +- TELNET transfers +- GSSAPI authentication for FTP transfers +- The "DONE" operation (post transfer protocol-specific actions) for the +protocols SFTP, SMTP, FTP. Fixing `multi_done()` for this is a worthy task. +- `curl_multi_remove_handle()` for any of the above. +- Calling `curl_ws_send()` from a callback + +## Better support for same name resolves + +If a name resolve has been initiated for a given name and a second easy handle +wants to resolve that same name as well, make it wait for the first resolve to +end up in the cache instead of doing a second separate resolve. This is +especially needed when adding many simultaneous handles using the same +hostname when the DNS resolver can get flooded. + +## Non-blocking `curl_multi_remove_handle()` + +The multi interface has a few API calls that assume a blocking behavior, like +`add_handle()` and `remove_handle()` which limits what we can do internally. +The multi API need to be moved even more into a single function that "drives" +everything in a non-blocking manner and signals when something is done. A +remove or add would then only ask for the action to get started and then +`multi_perform()` etc still be called until the add/remove is completed. + +## Split connect and authentication process + +The multi interface treats the authentication process as part of the connect +phase. As such any failures during authentication does not trigger the +relevant QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP. + +## Edge-triggered sockets should work + +The multi_socket API should work with edge-triggered socket events. One of the +internal actions that need to be improved for this to work perfectly is the +`maxloops` handling in `transfer.c:readwrite_data()`. + +## multi upkeep + +In libcurl 7.62.0 we introduced `curl_easy_upkeep`. It unfortunately only +works on easy handles. We should introduces a version of that for the multi +handle, and also consider doing `upkeep` automatically on connections in the +connection pool when the multi handle is in used. + +See [curl issue 3199](https://github.com/curl/curl/issues/3199) + +## Virtual external sockets + +libcurl performs operations on the given file descriptor that presumes it is a +socket and an application cannot replace them at the moment. Allowing an +application to fully replace those would allow a larger degree of freedom and +flexibility. + +See [curl issue 5835](https://github.com/curl/curl/issues/5835) + +## dynamically decide to use socketpair + +For users who do not use `curl_multi_wait()` or do not care for +`curl_multi_wakeup()`, we could introduce a way to make libcurl NOT create a +socketpair in the multi handle. + +See [curl issue 4829](https://github.com/curl/curl/issues/4829) + +# Documentation + +## Improve documentation about fork safety + +See [curl issue 6968](https://github.com/curl/curl/issues/6968) + +# FTP + +## HOST + +HOST is a command for a client to tell which hostname to use, to offer FTP +servers named-based virtual hosting: + +https://datatracker.ietf.org/doc/html/rfc7151 + +## A fixed directory listing format + +Since listing the contents of a remove directory with FTP is returning the +list in a format and style the server likes without any established or even +defacto standard existing, it would be a feature to users if curl could parse +the directory listing and output a general curl format that is fixed and the +same, independent of the server's choice. This would allow users to better and +more reliably extract information about remote content via FTP directory +listings. + +## GSSAPI via Windows SSPI + +In addition to currently supporting the SASL GSSAPI mechanism (Kerberos V5) +via third-party GSS-API libraries, such as MIT Kerberos, also add support for +GSSAPI authentication via Windows SSPI. + +## STAT for LIST without data connection + +Some FTP servers allow STAT for listing directories instead of using LIST, and +the response is then sent over the control connection instead of as the +otherwise used data connection. + +This is not detailed in any FTP specification. + +## Passive transfer could try other IP addresses + +When doing FTP operations through a proxy at localhost, the reported spotted +that curl only tried to connect once to the proxy, while it had multiple +addresses and a failed connect on one address should make it try the next. + +After switching to passive mode (EPSV), curl could try all IP addresses for +`localhost`. Currently it tries `::1`, but it should also try `127.0.0.1`. + +See [curl issue 1508](https://github.com/curl/curl/issues/1508) + +# HTTP + +## Provide the error body from a CONNECT response + +When curl receives a body response from a CONNECT request to a proxy, it +always just reads and ignores it. It would make some users happy if curl +instead optionally would be able to make that responsible available. Via a new +callback? Through some other means? + +See [curl issue 9513](https://github.com/curl/curl/issues/9513) + +## Obey `Retry-After` in redirects + +The `Retry-After` response header is said to dictate "the minimum time that +the user agent is asked to wait before issuing the redirected request" and +libcurl does not obey this. + +See [curl issue 11447](https://github.com/curl/curl/issues/11447) + +## Rearrange request header order + +Server implementers often make an effort to detect browser and to reject +clients it can detect to not match. One of the last details we cannot yet +control in libcurl's HTTP requests, which also can be exploited to detect that +libcurl is in fact used even when it tries to impersonate a browser, is the +order of the request headers. I propose that we introduce a new option in +which you give headers a value, and then when the HTTP request is built it +sorts the headers based on that number. We could then have internally created +headers use a default value so only headers that need to be moved have to be +specified. + +## Allow SAN names in HTTP/2 server push + +curl only allows HTTP/2 push promise if the provided :authority header value +exactly matches the hostname given in the URL. It could be extended to allow +any name that would match the Subject Alternative Names in the server's TLS +certificate. + +See [curl pull request 3581](https://github.com/curl/curl/pull/3581) + +## `auth=` in URLs + +Add the ability to specify the preferred authentication mechanism to use by +using `;auth=` in the login part of the URL. + +For example: + +`http://test:pass;auth=NTLM@example.com` would be equivalent to specifying +`--user test:pass;auth=NTLM` or `--user test:pass --ntlm` from the command +line. + +Additionally this should be implemented for proxy base URLs as well. + +## alt-svc should fallback if alt-svc does not work + +The `alt-svc:` header provides a set of alternative services for curl to use +instead of the original. If the first attempted one fails, it should try the +next etc and if all alternatives fail go back to the original. + +See [curl issue 4908](https://github.com/curl/curl/issues/4908) + +## Require HTTP version X or higher + +curl and libcurl provide options for trying higher HTTP versions (for example +HTTP/2) but then still allows the server to pick version 1.1. We could +consider adding a way to require a minimum version. + +See [curl issue 7980](https://github.com/curl/curl/issues/7980) + +# TELNET + +## ditch stdin + +Reading input (to send to the remote server) on stdin is a crappy solution for +library purposes. We need to invent a good way for the application to be able +to provide the data to send. + +## ditch telnet-specific select + +Move the telnet support's network `select()` loop go away and merge the code +into the main transfer loop. Until this is done, the multi interface does not +work for telnet. + +## feature negotiation debug data + +Add telnet feature negotiation data to the debug callback as header data. + +## exit immediately upon connection if stdin is /dev/null + +If it did, curl could be used to probe if there is an server there listening +on a specific port. That is, the following command would exit immediately +after the connection is established with exit code 0: + + curl -s --connect-timeout 2 telnet://example.com:80 NOTIFY=SUCCESS,FAILURE");`. + +[curl issue 8232](https://github.com/curl/curl/issues/8232) + +## Enhanced capability support + +Add the ability, for an application that uses libcurl, to obtain the list of +capabilities returned from the EHLO command. + +## Add `CURLOPT_MAIL_CLIENT` option + +Rather than use the URL to specify the mail client string to present in the +`HELO` and `EHLO` commands, libcurl should support a new `CURLOPT` +specifically for specifying this data as the URL is non-standard and to be +honest a bit of a hack. + +Please see the following thread for more information: +https://curl.se/mail/lib-2012-05/0178.html + + +# POP3 + +## Enhanced capability support + +Add the ability, for an application that uses libcurl, to obtain the list of +capabilities returned from the CAPA command. + +# IMAP + +## Enhanced capability support + + Add the ability, for an application that uses libcurl, to obtain the list of + capabilities returned from the CAPABILITY command. + +# LDAP + +## SASL based authentication mechanisms + +Currently the LDAP module only supports ldap_simple_bind_s() in order to bind +to an LDAP server. However, this function sends username and password details +using the simple authentication mechanism (as clear text). However, it should +be possible to use ldap_bind_s() instead specifying the security context +information ourselves. + +## `CURLOPT_SSL_CTX_FUNCTION` for LDAPS + +`CURLOPT_SSL_CTX_FUNCTION` works perfectly for HTTPS and email protocols, but +it has no effect for LDAPS connections. + + [curl issue 4108](https://github.com/curl/curl/issues/4108) + +## Paged searches on LDAP server + +[curl issue 4452](https://github.com/curl/curl/issues/4452) + +## Certificate-Based Authentication + +LDAPS not possible with macOS and Windows with Certificate-Based Authentication + +[curl issue 9641](https://github.com/curl/curl/issues/9641) + +# SMB + +## Support modern versions + +curl only supports version 1, which barely anyone is using anymore. + +## File listing support + +Add support for listing the contents of an SMB share. The output should +probably be the same as/similar to FTP. + +## Honor file timestamps + +The timestamp of the transferred file should reflect that of the original +file. + +## Use NTLMv2 + +Currently the SMB authentication uses NTLMv1. + +## Create remote directories + +Support for creating remote directories when uploading a file to a directory +that does not exist on the server, just like `--ftp-create-dirs`. + +# FILE + +## Directory listing on non-POSIX + +Listing the contents of a directory accessed with FILE only works on platforms +with `opendir()`. Support could be added for more systems, like Windows. + +# TLS + +## `TLS-PSK` with OpenSSL + +Transport Layer Security pre-shared key cipher suites (`TLS-PSK`) is a set of +cryptographic protocols that provide secure communication based on pre-shared +keys (`PSK`). These pre-shared keys are symmetric keys shared in advance among +the communicating parties. + +[curl issue 5081](https://github.com/curl/curl/issues/5081) + +## TLS channel binding + +TLS 1.2 and 1.3 provide the ability to extract some secret data from the TLS +connection and use it in the client request (usually in some sort of +authentication) to ensure that the data sent is bound to the specific TLS +connection and cannot be successfully intercepted by a proxy. This +functionality can be used in a standard authentication mechanism such as +GSS-API or SCRAM, or in custom approaches like custom HTTP Authentication +headers. + +For TLS 1.2, the binding type is usually `tls-unique`, and for TLS 1.3 it is +`tls-exporter`. + +- https://datatracker.ietf.org/doc/html/rfc5929 +- https://datatracker.ietf.org/doc/html/rfc9266 +- [curl issue 9226](https://github.com/curl/curl/issues/9226) + +## Defeat TLS fingerprinting + +By changing the order of TLS extensions provided in the TLS handshake, it is +sometimes possible to circumvent TLS fingerprinting by servers. The TLS +extension order is of course not the only way to fingerprint a client. + +## Consider OCSP stapling by default + +Treat a negative response a reason for aborting the connection. Since OCSP +stapling is presumed to get used much less in the future when Let's Encrypt +drops the OCSP support, the benefit of this might however be limited. + +[curl issue 15483](https://github.com/curl/curl/issues/15483) + +## Provide callback for cert verification + +OpenSSL supports a callback for customized verification of the peer +certificate, but this does not seem to be exposed in the libcurl APIs. Could +it be? There is so much that could be done if it were. + +## Less memory massaging with Schannel + +The Schannel backend does a lot of custom memory management we would rather +avoid: the repeated allocation + free in sends and the custom memory + realloc +system for encrypted and decrypted data. That should be avoided and reduced +for 1) efficiency and 2) safety. + +## Support DANE + +[DNS-Based Authentication of Named Entities +(DANE)](https://www.rfc-editor.org/rfc/rfc6698.txt) is a way to provide SSL +keys and certs over DNS using DNSSEC as an alternative to the CA model. + +A patch was posted on March 7 2013 +(https://curl.se/mail/lib-2013-03/0075.html) but it was a too simple approach. +See Daniel's comments: https://curl.se/mail/lib-2013-03/0103.html + +Björn Stenberg once wrote a separate initial take on DANE that was never +completed. + +## TLS record padding + +TLS (1.3) offers optional record padding and OpenSSL provides an API for it. I +could make sense for libcurl to offer this ability to applications to make +traffic patterns harder to figure out by network traffic observers. + +See [curl issue 5398](https://github.com/curl/curl/issues/5398) + +## Support Authority Information Access certificate extension (AIA) + +AIA can provide various things like certificate revocation lists but more +importantly information about intermediate CA certificates that can allow +validation path to be fulfilled when the HTTPS server does not itself provide +them. + +Since AIA is about downloading certs on demand to complete a TLS handshake, it +is probably a bit tricky to get done right and a serious privacy leak. + +See [curl issue 2793](https://github.com/curl/curl/issues/2793) + +## Some TLS options are not offered for HTTPS proxies + +Some TLS related options to the command line tool and libcurl are only +provided for the server and not for HTTPS proxies. `--proxy-tls-max`, +`--proxy-tlsv1.3`, `--proxy-curves` and a few more. For more Documentation on +this see: https://curl.se/libcurl/c/tls-options.html + +[curl issue 12286](https://github.com/curl/curl/issues/12286) + +## Make sure we forbid TLS 1.3 post-handshake authentication + +RFC 8740 explains how using HTTP/2 must forbid the use of TLS 1.3 +post-handshake authentication. We should make sure to live up to that. + +See [curl issue 5396](https://github.com/curl/curl/issues/5396) + +## Support the `clienthello` extension + +Certain stupid networks and middle boxes have a problem with SSL handshake +packets that are within a certain size range because how that sets some bits +that previously (in older TLS version) were not set. The `clienthello` +extension adds padding to avoid that size range. + +- https://datatracker.ietf.org/doc/html/rfc7685 +- [curl issue 2299](https://github.com/curl/curl/issues/2299) + +## Share the CA cache + +For TLS backends that supports CA caching, it makes sense to allow the share +object to be used to store the CA cache as well via the share API. Would allow +multiple easy handles to reuse the CA cache and save themselves from a lot of +extra processing overhead. + +## Add missing features to TLS backends + +The feature matrix at https://curl.se/libcurl/c/tls-options.html shows which +features are supported by which TLS backends, and thus also where there are +feature gaps. + +# Proxy + +## Retry SOCKS handshake on address type not supported + +When curl resolves a hostname, it might get a mix of IPv6 and IPv4 returned. +curl might then use an IPv6 address with a SOCKS5 proxy, which - if it does +not support IPv6 - returns "Address type not supported" and curl exits with +that error. + +Perhaps it is preferred if curl would in this situation instead first retry +the SOCKS handshake again for this case and then use one of the IPv4 addresses +for the target host. + +See [curl issue 17222](https://github.com/curl/curl/issues/17222) + +# Schannel + +## Extend support for client certificate authentication + +The existing support for the `-E`/`--cert` and `--key` options could be +extended by supplying a custom certificate and key in PEM format, see: +[Getting a Certificate for +Schannel](https://learn.microsoft.com/windows/win32/secauthn/getting-a-certificate-for-schannel) + +## Extend support for the `--ciphers` option + +The existing support for the `--ciphers` option could be extended by mapping +the OpenSSL/GnuTLS cipher suites to the Schannel APIs, see [Specifying +Schannel Ciphers and Cipher +Strengths](https://learn.microsoft.com/windows/win32/secauthn/specifying-schannel-ciphers-and-cipher-strengths). + +## Add option to allow abrupt server closure + +libcurl with Schannel errors without a known termination point from the server +(such as length of transfer, or SSL "close notify" alert) to prevent against a +truncation attack. Really old servers may neglect to send any termination +point. An option could be added to ignore such abrupt closures. + +[curl issue 4427](https://github.com/curl/curl/issues/4427) + +# SASL + +## Other authentication mechanisms + +Add support for other authentication mechanisms such as `OLP`, `GSS-SPNEGO` +and others. + +## Add `QOP` support to GSSAPI authentication + +Currently the GSSAPI authentication only supports the default `QOP` of auth +(Authentication), whilst Kerberos V5 supports both `auth-int` (Authentication +with integrity protection) and `auth-conf` (Authentication with integrity and +privacy protection). + +# SSH protocols + +## Multiplexing + +SSH is a perfectly fine multiplexed protocols which would allow libcurl to do +multiple parallel transfers from the same host using the same connection, much +in the same spirit as HTTP/2 does. libcurl however does not take advantage of +that ability but does instead always create a new connection for new transfers +even if an existing connection already exists to the host. + +To fix this, libcurl would have to detect an existing connection and "attach" +the new transfer to the existing one. + +## Handle growing SFTP files + +The SFTP code in libcurl checks the file size *before* a transfer starts and +then proceeds to transfer exactly that amount of data. If the remote file +grows while the transfer is in progress libcurl does not notice and does not +adapt. The OpenSSH SFTP command line tool does and libcurl could also just +attempt to download more to see if there is more to get... + +[curl issue 4344](https://github.com/curl/curl/issues/4344) + +## Read keys from `~/.ssh/id_ecdsa`, `id_ed25519` + +The libssh2 backend in curl is limited to only reading keys from `id_rsa` and +`id_dsa`, which makes it fail connecting to servers that use more modern key +types. + +[curl issue 8586](https://github.com/curl/curl/issues/8586) + +## Support `CURLOPT_PREQUOTE` + +The two other `QUOTE` options are supported for SFTP, but this was left out +for unknown reasons. + +## SSH over HTTPS proxy for libssh + +The SSH based protocols SFTP and SCP did not work over HTTPS proxy at all +until [curl pull request 6021](https://github.com/curl/curl/pull/6021) brought +the functionality with the libssh2 backend. Presumably, this support can/could +be added for the libssh backend as well. + +## SFTP with `SCP://` + +OpenSSH 9 switched their `scp` tool to speak SFTP under the hood. Going +forward it might be worth having curl or libcurl attempt SFTP if SCP fails to +follow suite. + +# Command line tool + +## sync + +`curl --sync http://example.com/feed[1-100].rss` or +`curl --sync http://example.net/{index,calendar,history}.html` + +Downloads a range or set of URLs using the remote name, but only if the remote +file is newer than the local file. A `Last-Modified` HTTP date header should +also be used to set the mod date on the downloaded file. + +## glob posts + +Globbing support for `-d` and `-F`, as in `curl -d "name=foo[0-9]" URL`. This +is easily scripted though. + +## `--proxycommand` + +Allow the user to make curl run a command and use its stdio to make requests +and not do any network connection by itself. Example: + + curl --proxycommand 'ssh pi@raspberrypi.local -W 10.1.1.75 80' \ + http://some/otherwise/unavailable/service.php + +See [curl issue 4941](https://github.com/curl/curl/issues/4941) + +## UTF-8 filenames in Content-Disposition + +RFC 6266 documents how UTF-8 names can be passed to a client in the +`Content-Disposition` header, and curl does not support this. + +[curl issue 1888](https://github.com/curl/curl/issues/1888) + +## Option to make `-Z` merge lined based outputs on stdout + +When a user requests multiple lined based files using `-Z` and sends them to +stdout, curl does not *merge* and send complete lines fine but may send +partial lines from several sources. + +[curl issue 5175](https://github.com/curl/curl/issues/5175) + +## specify which response codes that make `-f`/`--fail` return error + +Allows a user to better specify exactly which error code(s) that are fine and +which are errors for their specific uses cases + +## Choose the name of file in braces for complex URLs + +When using braces to download a list of URLs and you use complicated names +in the list of alternatives, it could be handy to allow curl to use other +names when saving. + +Consider a way to offer that. Possibly like +`{partURL1:name1,partURL2:name2,partURL3:name3}` where the name following the +colon is the output name. + +See [curl issue 221](https://github.com/curl/curl/issues/221) + +## improve how curl works in a Windows console window + +If you pull the scroll bar when transferring with curl in a Windows console +window, the transfer is interrupted and can get disconnected. This can +probably be improved. See [curl issue 322](https://github.com/curl/curl/issues/322) + +## Windows: set attribute 'archive' for completed downloads + +The archive bit (`FILE_ATTRIBUTE_ARCHIVE, 0x20`) separates files that shall be +backed up from those that are either not ready or have not changed. + +Downloads in progress are neither ready to be backed up, nor should they be +opened by a different process. Only after a download has been completed it is +sensible to include it in any integer snapshot or backup of the system. + +See [curl issue 3354](https://github.com/curl/curl/issues/3354) + +## keep running, read instructions from pipe/socket + +Provide an option that makes curl not exit after the last URL (or even work +without a given URL), and then make it read instructions passed on a pipe or +over a socket to make further instructions so that a second subsequent curl +invoke can talk to the still running instance and ask for transfers to get +done, and thus maintain its connection pool, DNS cache and more. + +## Acknowledge `Ratelimit` headers + +Consider a command line option that can make curl do multiple serial requests +while acknowledging server specified [rate +limits](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/). + +See [curl issue 5406](https://github.com/curl/curl/issues/5406) + +## `--dry-run` + +A command line option that makes curl show exactly what it would do and send +if it would run for real. + +See [curl issue 5426](https://github.com/curl/curl/issues/5426) + +## `--retry` should resume + +When `--retry` is used and curl actually retries transfer, it should use the +already transferred data and do a resumed transfer for the rest (when +possible) so that it does not have to transfer the same data again that was +already transferred before the retry. + +See [curl issue 1084](https://github.com/curl/curl/issues/1084) + +## consider filename from the redirected URL with `-O` ? + +When a user gives a URL and uses `-O`, and curl follows a redirect to a new +URL, the filename is not extracted and used from the newly redirected-to URL +even if the new URL may have a much more sensible filename. + +This is clearly documented and helps for security since there is no surprise +to users which filename that might get overwritten, but maybe a new option +could allow for this or maybe `-J` should imply such a treatment as well as +`-J` already allows for the server to decide what filename to use so it +already provides the "may overwrite any file" risk. + +This is extra tricky if the original URL has no filename part at all since +then the current code path does error out with an error message, and we cannot +*know* already at that point if curl is redirected to a URL that has a +filename... + +See [curl issue 1241](https://github.com/curl/curl/issues/1241) + +## retry on network is unreachable + +The `--retry` option retries transfers on *transient failures*. We later added +`--retry-connrefused` to also retry for *connection refused* errors. + +Suggestions have been brought to also allow retry on *network is unreachable* +errors and while totally reasonable, maybe we should consider a way to make +this more configurable than to add a new option for every new error people +want to retry for? + +[curl issue 1603](https://github.com/curl/curl/issues/1603) + +## hostname sections in config files + +config files would be more powerful if they could set different configurations +depending on used URLs, hostname or possibly origin. Then a default `.curlrc` +could a specific user-agent only when doing requests against a certain site. + +## retry on the redirected-to URL + +When curl is told to `--retry` a failed transfer and follows redirects, it +might get an HTTP 429 response from the redirected-to URL and not the original +one, which then could make curl decide to rather retry the transfer on that +URL only instead of the original operation to the original URL. + +Perhaps extra emphasized if the original transfer is a large POST that +redirects to a separate GET, and that GET is what gets the 529 + +See [curl issue 5462](https://github.com/curl/curl/issues/5462) + +## Set the modification date on an uploaded file + +For SFTP and possibly FTP, curl could offer an option to set the modification +time for the uploaded file. + +See [curl issue 5768](https://github.com/curl/curl/issues/5768) + +## Use multiple parallel transfers for a single download + +To enhance transfer speed, downloading a single URL can be split up into +multiple separate range downloads that get combined into a single final +result. + +An ideal implementation would not use a specified number of parallel +transfers, but curl could: +- First start getting the full file as transfer A +- If after N seconds have passed and the transfer is expected to continue for + M seconds or more, add a new transfer (B) that asks for the second half of + A's content (and stop A at the middle). +- If splitting up the work improves the transfer rate, it could then be done + again. Then again, etc up to a limit. + +This way, if transfer B fails (because Range: is not supported) it lets +transfer A remain the single one. N and M could be set to some sensible +defaults. + +See [curl issue 5774](https://github.com/curl/curl/issues/5774) + +## Prevent terminal injection when writing to terminal + +curl could offer an option to make escape sequence either non-functional or +avoid cursor moves or similar to reduce the risk of a user getting tricked by +clever tricks. + +See [curl issue 6150](https://github.com/curl/curl/issues/6150) + +## `-J` and `-O` with %-encoded filenames + +`-J`/`--remote-header-name` does not decode %-encoded filenames. RFC 6266 +details how it should be done. The can of worm is basically that we have no +charset handling in curl and ASCII >=128 is a challenge for us. Not to mention +that decoding also means that we need to check for nastiness that is +attempted, like `../` sequences and the like. Probably everything to the left +of any embedded slashes should be cut off. See +https://curl.se/bug/view.cgi?id=1294 + +`-O` also does not decode %-encoded names, and while it has even less +information about the charset involved the process is similar to the `-J` +case. + +Note that we do not decode `-O` without the user asking for it with some other +means, since `-O` has always been documented to use the name exactly as +specified in the URL. + +## `-J` with `-C -` + +When using `-J` (with `-O`), automatically resumed downloading together with +`-C -` fails. Without `-J` the same command line works. This happens because +the resume logic is worked out before the target filename (and thus its +pre-transfer size) has been figured out. This can be improved. + +https://curl.se/bug/view.cgi?id=1169 + +## `--retry` and transfer timeouts + +If using `--retry` and the transfer timeouts (possibly due to using -m or +`-y`/`-Y`) the next attempt does not resume the transfer properly from what +was downloaded in the previous attempt but truncates and restarts at the +original position where it was at before the previous failed attempt. See +https://curl.se/mail/lib-2008-01/0080.html + +# Build + +## Enable `PIE` and `RELRO` by default + +Especially when having programs that execute curl via the command line, `PIE` +renders the exploitation of memory corruption vulnerabilities a lot more +difficult. This can be attributed to the additional information leaks being +required to conduct a successful attack. `RELRO`, on the other hand, masks +different binary sections like the `GOT` as read-only and thus kills a handful +of techniques that come in handy when attackers are able to arbitrarily +overwrite memory. A few tests showed that enabling these features had close to +no impact, neither on the performance nor on the general functionality of +curl. + +## Do not use GNU libtool on OpenBSD + +When compiling curl on OpenBSD with `--enable-debug` it gives linking errors +when you use GNU libtool. This can be fixed by using the libtool provided by +OpenBSD itself. However for this the user always needs to invoke make with +`LIBTOOL=/usr/bin/libtool`. It would be nice if the script could have some +magic to detect if this system is an OpenBSD host and then use the OpenBSD +libtool instead. + +See [curl issue 5862](https://github.com/curl/curl/issues/5862) + +## Package curl for Windows in a signed installer + +See [curl issue 5424](https://github.com/curl/curl/issues/5424) + +## make configure use `--cache-file` more and better + +The configure script can be improved to cache more values so that repeated +invokes run much faster. + +See [curl issue 7753](https://github.com/curl/curl/issues/7753) + +# Test suite + +## SSL tunnel + +Make our own version of stunnel for simple port forwarding to enable HTTPS and +FTP-SSL tests without the stunnel dependency, and it could allow us to provide +test tools built with either OpenSSL or GnuTLS + +## more protocols supported + +Extend the test suite to include more protocols. The telnet could just do FTP +or http operations (for which we have test servers). + +## more platforms supported + +Make the test suite work on more platforms. OpenBSD and macOS. Remove fork()s +and it should become even more portable. + +## write an SMB test server to replace impacket + +This would allow us to run SMB tests on more platforms and do better and more +covering tests. + +See [curl issue 15697](https://github.com/curl/curl/issues/15697) + +## Use the RFC 6265 test suite + +A test suite made for HTTP cookies (RFC 6265) by Adam Barth [is +available](https://github.com/abarth/http-state/tree/master/tests). + +It would be good if someone would write a script/setup that would run curl +with that test suite and detect deviance. Ideally, that would even be +incorporated into our regular test suite. + +## Run web-platform-tests URL tests + +Run web-platform-tests URL tests and compare results with browsers on +`wpt.fyi`. + +It would help us find issues to fix and help us document where our parser +differs from the WHATWG URL spec parsers. + +See [curl issue 4477](https://github.com/curl/curl/issues/4477) + +# MQTT + +## Support rate-limiting + +The rate-limiting logic is done in the PERFORMING state in multi.c but MQTT is +not (yet) implemented to use that. + +## Support MQTTS + +## Handle network blocks + +Running test suite with `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes +several MQTT test cases fail where they should not. + +## large payloads + +libcurl unnecessarily allocates heap memory to hold the entire payload to get +sent, when the data is already perfectly accessible where it is when +`CURLOPT_POSTFIELDS` is used. This is highly inefficient for larger payloads. +Additionally, libcurl does not support using the read callback for sending +MQTT which is yet another way to avoid having to hold large payload in memory. + +# TFTP + +## TFTP does not convert LF to CRLF for `mode=netascii` + +RFC 3617 defines that an TFTP transfer can be done using `netascii` mode. curl +does not support extracting that mode from the URL nor does it treat such +transfers specifically. It should probably do LF to CRLF translations for +them. + +See [curl issue 12655](https://github.com/curl/curl/issues/12655) + +# Gopher + +## Handle network blocks + +Running test suite with `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a 1200 to +1300` makes several Gopher test cases fail where they should not. diff --git a/packages/OS400/makefile.sh b/packages/OS400/makefile.sh index df47a7441e50..2b688a4421d4 100755 --- a/packages/OS400/makefile.sh +++ b/packages/OS400/makefile.sh @@ -67,7 +67,7 @@ fi # Copy some documentation files if needed. for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README.OS400" \ - "${TOPDIR}/CHANGES.md" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ" \ + "${TOPDIR}/CHANGES.md" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ.md" \ "${TOPDIR}/docs/FEATURES" "${TOPDIR}/docs/SSLCERTS.md" \ "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS.md" \ "${TOPDIR}/docs/HISTORY.md" diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index dfeeac0f60e6..bce3ca3fd56c 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -87,7 +87,7 @@ my %url; my %flink; # list all .md files in the repo -my @files=`git ls-files '**.md' docs/TODO docs/KNOWN_BUGS docs/FAQ`; +my @files=`git ls-files '**.md'`; sub storelink { my ($f, $line, $link) = @_; From 4fb609f9633d199f84ac255e8efd5ef2858e6185 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Dec 2025 11:13:31 +0100 Subject: [PATCH 714/885] FAQ: fix minor link syntax mistake --- docs/FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index ffef644418b2..f6911990d94b 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -1167,7 +1167,7 @@ IP address but instead the address of the proxy. Also note that on many networks NATs or other IP-munging techniques are used that makes you see and use a different IP address locally than what the remote server will see you coming from. You may also consider using -[Tor]()https://www.torproject.org/). +[Tor](https://www.torproject.org/). ## How do I stop an ongoing transfer? From 761750b9dea1873ec2dac3d2352062057feb3f8b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 04:48:05 +0000 Subject: [PATCH 715/885] Dockerfile: update debian:bookworm-slim digest to 1371f81 Closes #19883 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d2e942cdff4..36daff397b10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ # $ ./scripts/maketgz 8.7.1 # To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags -FROM debian:bookworm-slim@sha256:936abff852736f951dab72d91a1b6337cf04217b2a77a5eaadc7c0f2f1ec1758 +FROM debian:bookworm-slim@sha256:1371f816c47921a144436ca5a420122a30de85f95401752fd464d9d4e1e08271 RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \ build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \ From 4fe629c12a446a2e7b9090e7cfbaaf3be47c68d3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 11:03:54 +0000 Subject: [PATCH 716/885] Dockerfile: update debian:bookworm-slim digest to e899040 Closes #19891 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 36daff397b10..e5f2b4073af0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ # $ ./scripts/maketgz 8.7.1 # To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags -FROM debian:bookworm-slim@sha256:1371f816c47921a144436ca5a420122a30de85f95401752fd464d9d4e1e08271 +FROM debian:bookworm-slim@sha256:e899040a73d36e2b36fa33216943539d9957cba8172b858097c2cabcdb20a3e2 RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \ build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \ From 1dd758b36d281cbdc4f26cf223760b53b3333b7e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 12:14:21 +0100 Subject: [PATCH 717/885] test1464: mark XML-compliant Closes #19892 --- tests/data/test1464 | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/data/test1464 b/tests/data/test1464 index be0b0c5f4d7c..a0562d286034 100644 --- a/tests/data/test1464 +++ b/tests/data/test1464 @@ -3,7 +3,6 @@ FILE --help -notxml From d14bf19fdaec3734cb2ffd0d8685ac1cc5302814 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 12:18:31 +0100 Subject: [PATCH 718/885] test1025, 1221: fold long command-lines Closes #19893 --- tests/data/test1015 | 6 +++++- tests/data/test1221 | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/data/test1015 b/tests/data/test1015 index 4fe79c7b9902..2cd937806043 100644 --- a/tests/data/test1015 +++ b/tests/data/test1015 @@ -29,7 +29,11 @@ http --data-urlencode -http://%HOSTIP:%HTTPPORT/%TESTNUMBER --data-urlencode "my name is moo[]" --data-urlencode "y e s=s_i_r" --data-urlencode "v_alue@%LOGDIR/%TESTNUMBER.txt" --data-urlencode @%LOGDIR/%TESTNUMBER.txt +http://%HOSTIP:%HTTPPORT/%TESTNUMBER +--data-urlencode "my name is moo[]" +--data-urlencode "y e s=s_i_r" +--data-urlencode "v_alue@%LOGDIR/%TESTNUMBER.txt" +--data-urlencode @%LOGDIR/%TESTNUMBER.txt content to _?!#$'|%LT%GT diff --git a/tests/data/test1221 b/tests/data/test1221 index 12a82be1ee74..5f200c17abbe 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -30,7 +30,13 @@ http --url-query with --data-urlencode -http://%HOSTIP:%HTTPPORT/%TESTNUMBER --url-query "my name is moo[]" --url-query "yes=s i r" --url-query "v_alue@%LOGDIR/%TESTNUMBER.txt" --url-query @%LOGDIR/%TESTNUMBER.txt --url-query "+%3d%3d" --data-urlencode "start=once upon the time" +http://%HOSTIP:%HTTPPORT/%TESTNUMBER +--url-query "my name is moo[]" +--url-query "yes=s i r" +--url-query "v_alue@%LOGDIR/%TESTNUMBER.txt" +--url-query @%LOGDIR/%TESTNUMBER.txt +--url-query "+%3d%3d" +--data-urlencode "start=once upon the time" content to _?!#$'|%LT%GT From b739102ea6eee0a609da5d9547f18930b89a0a87 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Dec 2025 11:53:45 +0100 Subject: [PATCH 719/885] TODO: remove ancient entries no longer considered - TCP Fast Open support on Windows TFO doesn't really work on the internet and isn't really used anywhere. We use QUIC now. - get rid of PATH_MAX Not a priority and when using 3rd party libraries not really up to us. - auto-detect proxy A dream we can just stop having. - config file parsing Let's not do that in our library. - add asynch getaddrinfo support Let's not add a limited glibc specific backend with bad API - FTP HOST If we managed this far without name based vhost FTP, let's not. Closes #19890 --- docs/TODO.md | 75 +++++----------------------------------------------- 1 file changed, 7 insertions(+), 68 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index 09b45443c791..2b77b8ce0b9e 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -19,17 +19,6 @@ document](https://curl.se/docs/knownbugs.html) are subject for fixing. # libcurl -## TCP Fast Open support on Windows - -libcurl supports the `CURLOPT_TCP_FASTOPEN` option since 7.49.0 for Linux and -macOS. Windows supports TCP Fast Open starting with Windows 10, version 1607 -and we should add support for it. - -TCP Fast Open is supported on several platforms but not on Windows. Work on -this was once started but never finished. - -See [curl pull request 3378](https://github.com/curl/curl/pull/3378) - ## Consult `%APPDATA%` also for `.netrc` `%APPDATA%\.netrc` is not considered when running on Windows. Should not it? @@ -58,15 +47,6 @@ See [curl issue 4915](https://github.com/curl/curl/issues/4915) and lib1541.c The share interface offers CURL_LOCK_DATA_HSTS to have multiple easy handle share an HSTS cache, but this is not thread-safe. -## get rid of PATH_MAX - -Having code use and rely on PATH_MAX is not nice: -https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html - -Currently the libssh2 SSH based code uses it, but to remove PATH_MAX from -there we need libssh2 to properly tell us when we pass in a too small buffer -and its current API (as of libssh2 1.2.7) does not. - ## thread-safe sharing Using the share interface users can share some data between easy handles but @@ -74,18 +54,6 @@ several of the sharing options are documented as not safe and supported to share between multiple concurrent threads. Fixing this would enable more users to share data in more powerful ways. -## auto-detect proxy - -libcurl could be made to detect the system proxy setup automatically and use -that. On Windows, macOS and Linux desktops for example. - -The [pull-request to use *libproxy*](https://github.com/curl/curl/pull/977) -for this was deferred due to doubts on the reliability of the dependency and -how to use it. - -[*libdetectproxy*](https://github.com/paulharris/libdetectproxy) is a (C++) -library for detecting the proxy on Windows. - ## updated DNS server while running If `/etc/resolv.conf` gets updated while a program using libcurl is running, it @@ -156,11 +124,6 @@ for each redirect. [curl issue 6743](https://github.com/curl/curl/issues/6743) -## `SRV` and `URI` DNS records - -Offer support for resolving `SRV` and `URI` DNS records for libcurl to know which -server to connect to for various protocols (including HTTP). - ## CURLINFO_PAUSE_STATE Return information about the transfer's current pause state, in both @@ -175,14 +138,6 @@ callback. Perhaps also provide reason. [curl issue 2126](https://github.com/curl/curl/issues/2126) -## config file parsing - -Consider providing an API, possibly in a separate companion library, for -parsing a config file like curl's `-K`/`--config` option to allow applications -to get the same ability to read curl options from files. - -See [curl issue 3698](https://github.com/curl/curl/issues/3698) - ## erase secrets from heap/stack after use Introducing a concept and system to erase secrets from memory after use, it @@ -192,15 +147,6 @@ and then clearing them within the library adds nothing... [curl issue 7268](https://github.com/curl/curl/issues/7268) -## add asynch getaddrinfo support - -Use `getaddrinfo_a()` to provide an asynch name resolver backend to libcurl -that does not use threads and does not depend on c-ares. The `getaddrinfo_a` -function is (probably?) glibc specific but that is a widely used libc among -our users. - -[curl pull request 6746](https://github.com/curl/curl/pull/6746) - ## make DoH inherit more transfer properties Some options are not inherited because they are not relevant for the DoH SSL @@ -297,13 +243,6 @@ See [curl issue 6968](https://github.com/curl/curl/issues/6968) # FTP -## HOST - -HOST is a command for a client to tell which hostname to use, to offer FTP -servers named-based virtual hosting: - -https://datatracker.ietf.org/doc/html/rfc7151 - ## A fixed directory listing format Since listing the contents of a remove directory with FTP is returning the @@ -471,18 +410,18 @@ capabilities returned from the CAPA command. ## Enhanced capability support - Add the ability, for an application that uses libcurl, to obtain the list of - capabilities returned from the CAPABILITY command. +Add the ability, for an application that uses libcurl, to obtain the list of +capabilities returned from the CAPABILITY command. # LDAP ## SASL based authentication mechanisms -Currently the LDAP module only supports ldap_simple_bind_s() in order to bind -to an LDAP server. However, this function sends username and password details -using the simple authentication mechanism (as clear text). However, it should -be possible to use ldap_bind_s() instead specifying the security context -information ourselves. +Currently the LDAP module only supports `ldap_simple_bind_s()` in order to +bind to an LDAP server. However, this function sends username and password +details using the simple authentication mechanism (as clear text). However, it +should be possible to use `ldap_bind_s()` instead specifying the security +context information ourselves. ## `CURLOPT_SSL_CTX_FUNCTION` for LDAPS From e28dc58b6525241fb8e90f7cc6bd91c13616f27c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 12:55:26 +0100 Subject: [PATCH 720/885] examples: use 64-bit `fstat` on Windows Closes #19896 --- docs/examples/anyauthput.c | 4 ++-- docs/examples/fileupload.c | 4 ++-- docs/examples/ftpupload.c | 4 ++-- docs/examples/http2-upload.c | 4 ++-- docs/examples/httpput.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 5a650b64c721..a8f179e8e75d 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -41,9 +41,9 @@ #ifdef _WIN32 #undef stat -#define stat _stat +#define stat _stati64 #undef fstat -#define fstat _fstat +#define fstat _fstati64 #define fileno _fileno #endif diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index da69e4a8ead1..4639b6b12f3e 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -39,9 +39,9 @@ #ifdef _WIN32 #undef stat -#define stat _stat +#define stat _stati64 #undef fstat -#define fstat _fstat +#define fstat _fstati64 #define fileno _fileno #endif diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 48c76a4898a7..36663d5afb31 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -44,9 +44,9 @@ #ifdef _WIN32 #include #undef stat -#define stat _stat +#define stat _stati64 #undef fstat -#define fstat _fstat +#define fstat _fstati64 #define fileno _fileno #else #include diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 0f1ed748ca1d..8ed6568542a1 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -56,9 +56,9 @@ #ifdef _WIN32 #undef stat -#define stat _stat +#define stat _stati64 #undef fstat -#define fstat _fstat +#define fstat _fstati64 #define fileno _fileno #endif diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 026fde1210ea..8892d76f077a 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -39,9 +39,9 @@ #ifdef _WIN32 #undef stat -#define stat _stat +#define stat _stati64 #undef fstat -#define fstat _fstat +#define fstat _fstati64 #define fileno _fileno #endif From e76080fb73f3f73d415427678843b643462448cd Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Tue, 2 Dec 2025 19:40:07 +0200 Subject: [PATCH 721/885] test: add test 2090 for SSLKEYLOGFILE structure Only the TLS 1.2 structure for now since it's simpler, and only has a single label type. This has the bonus of also testing libressl that only supports logging keys in TLS 1.2 Closes #19816 --- tests/data/Makefile.am | 2 +- tests/data/test2090 | 61 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 tests/data/test2090 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 140d507d777a..63cc4729f314 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -253,7 +253,7 @@ test2056 test2057 test2058 test2059 test2060 test2061 test2062 test2063 \ test2064 test2065 test2066 test2067 test2068 test2069 test2070 test2071 \ test2072 test2073 test2074 test2075 test2076 test2077 test2078 test2079 \ test2080 test2081 test2082 test2083 test2084 test2085 test2086 test2087 \ -test2088 test2089 \ +test2088 test2089 test2090 \ test2100 test2101 test2102 test2103 test2104 \ \ test2200 test2201 test2202 test2203 test2204 test2205 \ diff --git a/tests/data/test2090 b/tests/data/test2090 new file mode 100644 index 000000000000..8e1223b99e1f --- /dev/null +++ b/tests/data/test2090 @@ -0,0 +1,61 @@ + + + +HTTPS +TLS + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 7 + +MooMoo + + + +# +# Client-side + + +SSL +!Schannel +!mbedtls + + +SSLKEYLOGFILE=%LOGDIR/%TESTNUMBER.log.ssl + + +https + + +HTTPS request with SSLKEYLOGFILE set + + +--cacert %CERTDIR/certs/test-ca.crt --tls-max 1.2 https://localhost:%HTTPSPORT/%TESTNUMBER + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: localhost:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + + + +CLIENT_RANDOM %repeat[32 x 9A]% %repeat[48 x BC]% + + +s/^CLIENT_RANDOM [0-9a-fA-F]{64} [0-9a-fA-F]{96}/CLIENT_RANDOM %repeat[32 x 9A]% %repeat[48 x BC]%/g + + + From 8e847fa5364be06737cd6c08beeb866006817a8d Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Tue, 2 Dec 2025 21:59:53 +0200 Subject: [PATCH 722/885] gtls: Call keylog_close in cleanup --- lib/vtls/gtls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index c7f8f346739a..d1236aefba0c 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -169,6 +169,7 @@ static int gtls_init(void) static void gtls_cleanup(void) { gnutls_global_deinit(); + Curl_tls_keylog_close(); } #ifndef CURL_DISABLE_VERBOSE_STRINGS From f450f3801b6b9dff0ea280f5fb4bf28203f7b313 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 14:27:44 +0100 Subject: [PATCH 723/885] GHA/windows: re-enable `taskkill` Nothing conclusive for the last ~30 days when `taskkill` was made a no-op. Jobs remained flaky with all known failure modes. Sometimes they finish green on the first run, sometimes they fail. Hard to say more without comparing detailed stats for this period and the preceding (or upcoming) one. In almost all runs, the PID to be killed did not exist at the time of check. Follow-up to 2701ac6a4d16a62130dad05be1c484903b8545c7 #19421 Closes #19897 --- .github/workflows/windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8dca6ce891e4..9d7f0dc88d32 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -37,7 +37,6 @@ permissions: {} env: CURL_CI: github - CURL_TEST_NO_TASKKILL: '1' jobs: cygwin: From 5ed7b5b01bb1a5645a9937573fddbf34782b5c83 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 8 Dec 2025 13:36:19 +0100 Subject: [PATCH 724/885] alt-svc: more flexibility on same destination When the Alt-Svc points to the same host and port, add the destination ALPN to the `wanted` versions and set it also as the `preferred` version in negotiations. This allows Alt-Svc for h3 to point to h2 and have it tried first. Also, this allows Alt-Svc to say http/1.1 is preferred and changes the ALPN protocol ordering for the TLS handshake. Add tests in various combination to verify this works. Reported-by: yushicheng7788 on github Fixes #19740 Closes #19874 --- lib/altsvc.c | 6 ++- lib/altsvc.h | 3 +- lib/cf-https-connect.c | 25 ++++++++++++ lib/http.h | 1 + lib/url.c | 28 ++++++++++++-- lib/vtls/vtls.c | 23 +++++++---- tests/http/test_06_eyeballs.py | 16 ++++++++ tests/http/test_12_reuse.py | 71 ++++++++++++++++++---------------- tests/http/testenv/curl.py | 11 +++++- 9 files changed, 135 insertions(+), 49 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index 31f6b515bec2..c422736fd230 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -622,7 +622,8 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, enum alpnid srcalpnid, const char *srchost, int srcport, struct altsvc **dstentry, - const int versions) /* one or more bits */ + const int versions, /* one or more bits */ + bool *psame_destination) { struct Curl_llist_node *e; struct Curl_llist_node *n; @@ -631,6 +632,7 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, DEBUGASSERT(srchost); DEBUGASSERT(dstentry); + *psame_destination = FALSE; for(e = Curl_llist_head(&asi->list); e; e = n) { struct altsvc *as = Curl_node_elem(e); n = Curl_node_next(e); @@ -646,6 +648,8 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, (versions & (int)as->dst.alpnid)) { /* match */ *dstentry = as; + *psame_destination = (srcport == as->dst.port) && + hostcompare(srchost, as->dst.host); return TRUE; } } diff --git a/lib/altsvc.h b/lib/altsvc.h index d370b4e4b195..c6f1b902c78a 100644 --- a/lib/altsvc.h +++ b/lib/altsvc.h @@ -65,7 +65,8 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, enum alpnid srcalpnid, const char *srchost, int srcport, struct altsvc **dstentry, - const int versions); /* CURLALTSVC_H* bits */ + const int versions, /* CURLALTSVC_H* bits */ + bool *psame_destination); #else /* disabled */ #define Curl_altsvc_save(a, b, c) diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index acb3bcdd3a7a..47555fed94f2 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -710,6 +710,31 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data, } #endif + /* Add preferred HTTP version ALPN first */ + if(data->state.http_neg.preferred && + (alpn_count < CURL_ARRAYSIZE(alpn_ids)) && + (data->state.http_neg.preferred & data->state.http_neg.allowed)) { + enum alpnid alpn_pref = ALPN_none; + switch(data->state.http_neg.preferred) { + case CURL_HTTP_V3x: + if(!Curl_conn_may_http3(data, conn, conn->transport_wanted)) + alpn_pref = ALPN_h3; + break; + case CURL_HTTP_V2x: + alpn_pref = ALPN_h2; + break; + case CURL_HTTP_V1x: + alpn_pref = ALPN_h1; + break; + default: + break; + } + if(alpn_pref && + !cf_https_alpns_contain(alpn_pref, alpn_ids, alpn_count)) { + alpn_ids[alpn_count++] = alpn_pref; + } + } + if((alpn_count < CURL_ARRAYSIZE(alpn_ids)) && (data->state.http_neg.wanted & CURL_HTTP_V3x) && !cf_https_alpns_contain(ALPN_h3, alpn_ids, alpn_count)) { diff --git a/lib/http.h b/lib/http.h index 1c7ebdf8d7f1..c0f13ce1b0e3 100644 --- a/lib/http.h +++ b/lib/http.h @@ -72,6 +72,7 @@ struct http_negotiation { unsigned char rcvd_min; /* minimum version seen in responses, 09, 10, 11 */ http_majors wanted; /* wanted major versions when talking to server */ http_majors allowed; /* allowed major versions when talking to server */ + http_majors preferred; /* preferred major version when talking to server */ BIT(h2_upgrade); /* Do HTTP Upgrade from 1.1 to 2 */ BIT(h2_prior_knowledge); /* Directly do HTTP/2 without ALPN/SSL */ BIT(accept_09); /* Accept an HTTP/0.9 response */ diff --git a/lib/url.c b/lib/url.c index 0643ceea7f8c..98fc8ce44f87 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3060,6 +3060,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, struct altsvc *as = NULL; int allowed_alpns = ALPN_none; struct http_negotiation *neg = &data->state.http_neg; + bool same_dest = FALSE; DEBUGF(infof(data, "Alt-svc check wanted=%x, allowed=%x", neg->wanted, neg->allowed)); @@ -3083,7 +3084,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, hit = Curl_altsvc_lookup(data->asi, ALPN_h3, host, conn->remote_port, /* from */ &as /* to */, - allowed_alpns); + allowed_alpns, &same_dest); } #endif #ifdef USE_HTTP2 @@ -3093,7 +3094,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, hit = Curl_altsvc_lookup(data->asi, ALPN_h2, host, conn->remote_port, /* from */ &as /* to */, - allowed_alpns); + allowed_alpns, &same_dest); } #endif if(!hit && (neg->wanted & CURL_HTTP_V1x) && @@ -3102,10 +3103,29 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, hit = Curl_altsvc_lookup(data->asi, ALPN_h1, host, conn->remote_port, /* from */ &as /* to */, - allowed_alpns); + allowed_alpns, &same_dest); } - if(hit) { + if(hit && same_dest) { + /* same destination, but more HTTPS version options */ + switch(as->dst.alpnid) { + case ALPN_h1: + neg->wanted |= CURL_HTTP_V1x; + neg->preferred = CURL_HTTP_V1x; + break; + case ALPN_h2: + neg->wanted |= CURL_HTTP_V2x; + neg->preferred = CURL_HTTP_V2x; + break; + case ALPN_h3: + neg->wanted |= CURL_HTTP_V3x; + neg->preferred = CURL_HTTP_V3x; + break; + default: /* should not be possible */ + break; + } + } + else if(hit) { char *hostd = curlx_strdup((char *)as->dst.host); if(!hostd) return CURLE_OUT_OF_MEMORY; diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index e342953778b0..696c7fbaf860 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -145,22 +145,28 @@ static const struct alpn_spec ALPN_SPEC_H2 = { static const struct alpn_spec ALPN_SPEC_H2_H11 = { { ALPN_H2, ALPN_HTTP_1_1 }, 2 }; +static const struct alpn_spec ALPN_SPEC_H11_H2 = { + { ALPN_HTTP_1_1, ALPN_H2 }, 2 +}; #endif #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_PROXY) -static const struct alpn_spec *alpn_get_spec(http_majors allowed, +static const struct alpn_spec *alpn_get_spec(http_majors wanted, + http_majors preferred, bool use_alpn) { if(!use_alpn) return NULL; #ifdef USE_HTTP2 - if(allowed & CURL_HTTP_V2x) { - if(allowed & CURL_HTTP_V1x) - return &ALPN_SPEC_H2_H11; + if(wanted & CURL_HTTP_V2x) { + if(wanted & CURL_HTTP_V1x) + return (preferred == CURL_HTTP_V1x) ? + &ALPN_SPEC_H11_H2 : &ALPN_SPEC_H2_H11; return &ALPN_SPEC_H2; } #else - (void)allowed; + (void)wanted; + (void)preferred; #endif /* Use the ALPN protocol "http/1.1" for HTTP/1.x. Avoid "http/1.0" because some servers do not support it. */ @@ -1718,6 +1724,7 @@ static CURLcode cf_ssl_create(struct Curl_cfilter **pcf, ctx = cf_ctx_new(data, NULL); #else ctx = cf_ctx_new(data, alpn_get_spec(data->state.http_neg.wanted, + data->state.http_neg.preferred, conn->bits.tls_enable_alpn)); #endif if(!ctx) { @@ -1770,17 +1777,17 @@ static CURLcode cf_ssl_proxy_create(struct Curl_cfilter **pcf, CURLcode result; /* ALPN is default, but if user explicitly disables it, obey */ bool use_alpn = data->set.ssl_enable_alpn; - http_majors allowed = CURL_HTTP_V1x; + http_majors wanted = CURL_HTTP_V1x; (void)conn; #ifdef USE_HTTP2 if(conn->http_proxy.proxytype == CURLPROXY_HTTPS2) { use_alpn = TRUE; - allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x); + wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x); } #endif - ctx = cf_ctx_new(data, alpn_get_spec(allowed, use_alpn)); + ctx = cf_ctx_new(data, alpn_get_spec(wanted, 0, use_alpn)); if(!ctx) { result = CURLE_OUT_OF_MEMORY; goto out; diff --git a/tests/http/test_06_eyeballs.py b/tests/http/test_06_eyeballs.py index 7d2677447671..3b374e8158e3 100644 --- a/tests/http/test_06_eyeballs.py +++ b/tests/http/test_06_eyeballs.py @@ -133,3 +133,19 @@ def test_06_13_timers(self, env: Env): he_timers_set = [line for line in r.trace_lines if re.match(r'.*\[TIMER] \[HAPPY_EYEBALLS] set for', line)] assert len(he_timers_set) == 2, f'found: {"".join(he_timers_set)}\n{r.dump_logs()}' + + # download using HTTP/3 on missing server with alt-svc pointing there + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") + def test_06_20_h2_altsvc_h3_fallback(self, env: Env, httpd, nghttpx): + curl = CurlClient(env=env) + urln = f'https://{env.domain1}:{env.https_only_tcp_port}/data.json' + altsvc_file = curl.mk_altsvc_file('test_06', + 'h2', env.domain1, env.https_only_tcp_port, + 'h3', env.domain1, env.https_only_tcp_port) + r = curl.http_download(urls=[urln], extra_args=[ + '--alt-svc', altsvc_file + ]) + # Should try a QUIC connection that fails and fallback to h2 + r.check_exit_code(0) + r.check_response(count=1, http_status=200) + assert r.stats[0]['http_version'] == '2' diff --git a/tests/http/test_12_reuse.py b/tests/http/test_12_reuse.py index 1d4a4a0ae2f8..522df92708cf 100644 --- a/tests/http/test_12_reuse.py +++ b/tests/http/test_12_reuse.py @@ -26,6 +26,7 @@ # import logging import os +import re from datetime import datetime, timedelta import pytest @@ -77,10 +78,11 @@ def test_12_02_h1_conn_timeout(self, env: Env, httpd, configures_httpd, nghttpx, @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") def test_12_03_as_follow_h2h3(self, env: Env, httpd, configures_httpd, nghttpx): - # write an alt-svc file that advises h3 instead of h2 - asfile = os.path.join(env.gen_dir, 'alt-svc-12_03.txt') - self.create_asfile(asfile, f'h2 {env.domain1} {env.https_port} h3 {env.domain1} {env.h3_port}') curl = CurlClient(env=env) + # write an alt-svc file that advises h3 instead of h2 + asfile = curl.mk_altsvc_file('test_12', + 'h2', env.domain1, env.https_port, + 'h3', env.domain1, env.h3_port) urln = f'https://{env.authority_for(env.domain1, "h2")}/data.json' r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ '--alt-svc', f'{asfile}', @@ -112,54 +114,47 @@ def test_12_04_as_follow_h3h2(self, env: Env, httpd, configures_httpd, nghttpx): @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") def test_12_05_as_follow_h3h1(self, env: Env, httpd, configures_httpd, nghttpx): # With '--http3` an Alt-Svc redirection from h3 to h1 is allowed - count = 2 # write an alt-svc file the advises h1 instead of h3 - asfile = os.path.join(env.gen_dir, 'alt-svc-12_05.txt') - ts = datetime.now() + timedelta(hours=24) - expires = f'{ts.year:04}{ts.month:02}{ts.day:02} {ts.hour:02}:{ts.minute:02}:{ts.second:02}' - with open(asfile, 'w') as fd: - fd.write(f'h3 {env.domain1} {env.https_port} http/1.1 {env.domain1} {env.https_port} "{expires}" 0 0') - log.info(f'altscv: {open(asfile).readlines()}') curl = CurlClient(env=env) - urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json?[0-{count-1}]' + asfile = curl.mk_altsvc_file('test_12', + 'h3', env.domain1, env.https_port, + 'http/1.1', env.domain1, env.https_port) + urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json' r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ '--alt-svc', f'{asfile}', '--http3' ]) - r.check_response(count=count, http_status=200) - # We expect the connection to be reused and use HTTP/1.1 + r.check_response(count=1, http_status=200) + # We expect the connection to be preferring HTTP/1.1 in the ALPN assert r.total_connects == 1 - for s in r.stats: - assert s['http_version'] == '1.1', f'{s}' + re_m = re.compile(r'.* ALPN: curl offers http/1.1,h2') + lines = [line for line in r.trace_lines if re_m.match(line)] + assert len(lines), f'{r.dump_logs()}' @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") def test_12_06_as_ignore_h3h1(self, env: Env, httpd, configures_httpd, nghttpx): # With '--http3-only` an Alt-Svc redirection from h3 to h1 is ignored - count = 2 # write an alt-svc file the advises h1 instead of h3 - asfile = os.path.join(env.gen_dir, 'alt-svc-12_05.txt') - ts = datetime.now() + timedelta(hours=24) - expires = f'{ts.year:04}{ts.month:02}{ts.day:02} {ts.hour:02}:{ts.minute:02}:{ts.second:02}' - with open(asfile, 'w') as fd: - fd.write(f'h3 {env.domain1} {env.https_port} http/1.1 {env.domain1} {env.https_port} "{expires}" 0 0') - log.info(f'altscv: {open(asfile).readlines()}') curl = CurlClient(env=env) - urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json?[0-{count-1}]' + asfile = curl.mk_altsvc_file('test_12', + 'h3', env.domain1, env.https_port, + 'http/1.1', env.domain1, env.https_port) + urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json' r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ '--alt-svc', f'{asfile}', '--http3-only' ]) - r.check_response(count=count, http_status=200) + r.check_response(count=1, http_status=200) # We expect the connection to be stay on h3, since we used --http3-only assert r.total_connects == 1 - for s in r.stats: - assert s['http_version'] == '3', f'{s}' + assert r.stats[0]['http_version'] == '3', f'{r.stats}' @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") def test_12_07_as_ignore_h2h3(self, env: Env, httpd, configures_httpd, nghttpx): # With '--http2` an Alt-Svc redirection from h2 to h3 is ignored # write an alt-svc file that advises h3 instead of h2 - asfile = os.path.join(env.gen_dir, 'alt-svc-12_03.txt') - self.create_asfile(asfile, f'h2 {env.domain1} {env.https_port} h3 {env.domain1} {env.h3_port}') curl = CurlClient(env=env) + asfile = curl.mk_altsvc_file('test_12', + 'h2', env.domain1, env.https_port, + 'h3', env.domain1, env.h3_port) urln = f'https://{env.authority_for(env.domain1, "h2")}/data.json' r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ '--alt-svc', f'{asfile}', '--http2' @@ -167,9 +162,17 @@ def test_12_07_as_ignore_h2h3(self, env: Env, httpd, configures_httpd, nghttpx): r.check_response(count=1, http_status=200) assert r.stats[0]['http_version'] == '2', f'{r.stats}' - def create_asfile(self, fpath, line): - ts = datetime.now() + timedelta(hours=24) - expires = f'{ts.year:04}{ts.month:02}{ts.day:02} {ts.hour:02}:{ts.minute:02}:{ts.second:02}' - with open(fpath, 'w') as fd: - fd.write(f'{line} "{expires}" 0 0') - log.info(f'altscv: {open(fpath).readlines()}') + # download using HTTP/3 on available server with alt-svc to h2, use h2 + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") + def test_12_08_h3_altsvc_h2_used(self, env: Env, httpd, nghttpx): + curl = CurlClient(env=env) + urln = f'https://{env.domain1}:{env.https_port}/data.json' + altsvc_file = curl.mk_altsvc_file('test_12', + 'h3', env.domain1, env.https_port, + 'h2', env.domain1, env.https_port) + r = curl.http_download(urls=[urln], extra_args=[ + '--http3', '--alt-svc', altsvc_file + ]) + r.check_exit_code(0) + r.check_response(count=1, http_status=200) + assert r.stats[0]['http_version'] == '2' diff --git a/tests/http/testenv/curl.py b/tests/http/testenv/curl.py index f54170baba58..d9fe0706ac43 100644 --- a/tests/http/testenv/curl.py +++ b/tests/http/testenv/curl.py @@ -36,7 +36,7 @@ import shutil import subprocess from statistics import mean, fmean -from datetime import timedelta, datetime +from datetime import timedelta, datetime, timezone from typing import List, Optional, Dict, Union, Any from urllib.parse import urlparse @@ -1211,3 +1211,12 @@ def _generate_flame(self, curl_args: List[str], rc = p.returncode if rc != 0: raise Exception(f'{fg_gen_flame} returned error {rc}') + + def mk_altsvc_file(self, name, src_alpn, src_host, src_port, + dest_alpn, dest_host, dest_port): + fpath = os.path.join(self.run_dir, f'{name}.altsvc') + ts = datetime.now(timezone.utc) + timedelta(hours=1) + ts = ts.strftime('%Y%m%d %H:%M:%S') + with open(fpath, 'w') as fd: + fd.write(f'{src_alpn} {src_host} {src_port} {dest_alpn} {dest_host} {dest_port} "{ts}" 1 0\n') + return fpath From 9711c986ba832507e8248bfff112623916cbc367 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 9 Dec 2025 12:51:17 +0100 Subject: [PATCH 725/885] multi: remove MSTATE_TUNNELING MSTATE_TUNNELING is no longer in use now that we have proxy connection filters. Remove the state. Remove the http handler `connect_it` method as it was merely a NOP. Closes #19894 --- lib/cfilters.c | 6 +++++- lib/curl_trc.c | 1 - lib/http.c | 13 ++---------- lib/http.h | 1 - lib/multi.c | 53 ++++++++++------------------------------------- lib/multihandle.h | 37 +++++++++++++++------------------ lib/rtsp.c | 7 ++----- lib/ws.c | 4 ++-- 8 files changed, 39 insertions(+), 83 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index f51da8521aff..acffae3f0035 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -577,7 +577,11 @@ bool Curl_conn_is_connected(struct connectdata *conn, int sockindex) if(!CONN_SOCK_IDX_VALID(sockindex)) return FALSE; cf = conn->cfilter[sockindex]; - return cf && cf->connected; + if(cf) + return cf->connected; + else if(conn->handler->flags & PROTOPT_NONETWORK) + return TRUE; + return FALSE; } bool Curl_conn_is_ip_connected(struct Curl_easy *data, int sockindex) diff --git a/lib/curl_trc.c b/lib/curl_trc.c index 430d4c56a198..169f7a7d6d47 100644 --- a/lib/curl_trc.c +++ b/lib/curl_trc.c @@ -332,7 +332,6 @@ static const char * const Curl_trc_mstate_names[] = { "CONNECT", "RESOLVING", "CONNECTING", - "TUNNELING", "PROTOCONNECT", "PROTOCONNECTING", "DO", diff --git a/lib/http.c b/lib/http.c index ce5f5becdf0e..d5aca0e8005b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -121,7 +121,7 @@ const struct Curl_handler Curl_handler_http = { Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ - Curl_http_connect, /* connect_it */ + ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_pollset */ @@ -152,7 +152,7 @@ const struct Curl_handler Curl_handler_https = { Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ - Curl_http_connect, /* connect_it */ + ZERO_NULL, /* connect_it */ NULL, /* connecting */ ZERO_NULL, /* doing */ NULL, /* proto_pollset */ @@ -1533,15 +1533,6 @@ bool Curl_compareheader(const char *headerline, /* line to check */ return FALSE; /* no match */ } -/* - * Curl_http_connect() performs HTTP stuff to do at connect-time, called from - * the generic Curl_connect(). - */ -CURLcode Curl_http_connect(struct Curl_easy *data, bool *done) -{ - return Curl_conn_connect(data, FIRSTSOCKET, FALSE, done); -} - /* this returns the socket to wait for in the DO and DOING state for the multi interface and then we are always _sending_ a request and thus we wait for the single socket to become writable only */ diff --git a/lib/http.h b/lib/http.h index c0f13ce1b0e3..26762b62058b 100644 --- a/lib/http.h +++ b/lib/http.h @@ -113,7 +113,6 @@ CURLcode Curl_http_setup_conn(struct Curl_easy *data, struct connectdata *conn); CURLcode Curl_http(struct Curl_easy *data, bool *done); CURLcode Curl_http_done(struct Curl_easy *data, CURLcode, bool premature); -CURLcode Curl_http_connect(struct Curl_easy *data, bool *done); CURLcode Curl_http_doing_pollset(struct Curl_easy *data, struct easy_pollset *ps); CURLcode Curl_http_perform_pollset(struct Curl_easy *data, diff --git a/lib/multi.c b/lib/multi.c index 531ec6605e46..760f03186d67 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -142,7 +142,6 @@ static void mstate(struct Curl_easy *data, CURLMstate state Curl_init_CONNECT, /* CONNECT */ NULL, /* RESOLVING */ NULL, /* CONNECTING */ - NULL, /* TUNNELING */ NULL, /* PROTOCONNECT */ NULL, /* PROTOCONNECTING */ NULL, /* DO */ @@ -1122,7 +1121,6 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data, break; case MSTATE_CONNECTING: - case MSTATE_TUNNELING: result = mstate_connecting_pollset(data, ps); break; @@ -1862,43 +1860,29 @@ static CURLcode protocol_doing(struct Curl_easy *data, bool *done) */ static CURLcode protocol_connect(struct Curl_easy *data, bool *protocol_done) { - CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; + CURLcode result = CURLE_OK; + DEBUGASSERT(conn); DEBUGASSERT(protocol_done); + DEBUGASSERT(Curl_conn_is_connected(conn, FIRSTSOCKET)); *protocol_done = FALSE; - - if(Curl_conn_is_connected(conn, FIRSTSOCKET) && conn->bits.protoconnstart) { - /* We already are connected, get back. This may happen when the connect - worked fine in the first call, like when we connect to a local server - or proxy. Note that we do not know if the protocol is actually done. - - Unless this protocol does not have any protocol-connect callback, as - then we know we are done. */ - if(!conn->handler->connecting) - *protocol_done = TRUE; - - return CURLE_OK; - } - if(!conn->bits.protoconnstart) { if(conn->handler->connect_it) { - /* is there a protocol-specific connect() procedure? */ - /* Call the protocol-specific connect function */ result = conn->handler->connect_it(data, protocol_done); + if(result) + return result; } - else - *protocol_done = TRUE; - - /* it has started, possibly even completed but that knowledge is not stored - in this bit! */ - if(!result) - conn->bits.protoconnstart = TRUE; + conn->bits.protoconnstart = TRUE; } - return result; /* pass back status */ + /* Unless this protocol does not have any protocol-connect callback, as + then we know we are done. */ + if(!conn->handler->connecting) + *protocol_done = TRUE; + return CURLE_OK; } static void set_in_callback(struct Curl_multi *multi, bool value) @@ -2469,21 +2453,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, rc = state_resolving(multi, data, &stream_error, &result); break; -#ifndef CURL_DISABLE_HTTP - case MSTATE_TUNNELING: - /* this is HTTP-specific, but sending CONNECT to a proxy is HTTP... */ - DEBUGASSERT(data->conn); - result = Curl_http_connect(data, &protocol_connected); - if(!result) { - rc = CURLM_CALL_MULTI_PERFORM; - /* initiate protocol connect phase */ - multistate(data, MSTATE_PROTOCONNECT); - } - else - stream_error = TRUE; - break; -#endif - case MSTATE_CONNECTING: /* awaiting a completion of an asynch TCP connect */ DEBUGASSERT(data->conn); diff --git a/lib/multihandle.h b/lib/multihandle.h index a267a209ee56..d71958c414f2 100644 --- a/lib/multihandle.h +++ b/lib/multihandle.h @@ -51,26 +51,23 @@ struct Curl_message { */ typedef enum { MSTATE_INIT, /* 0 - start in this state */ - MSTATE_PENDING, /* 1 - no connections, waiting for one */ - MSTATE_SETUP, /* 2 - start a new transfer */ - MSTATE_CONNECT, /* 3 - resolve/connect has been sent off */ - MSTATE_RESOLVING, /* 4 - awaiting the resolve to finalize */ - MSTATE_CONNECTING, /* 5 - awaiting the TCP connect to finalize */ - MSTATE_TUNNELING, /* 6 - awaiting HTTPS proxy SSL initialization to - complete and/or proxy CONNECT to finalize */ - MSTATE_PROTOCONNECT, /* 7 - initiate protocol connect procedure */ - MSTATE_PROTOCONNECTING, /* 8 - completing the protocol-specific connect - phase */ - MSTATE_DO, /* 9 - start send off the request (part 1) */ - MSTATE_DOING, /* 10 - sending off the request (part 1) */ - MSTATE_DOING_MORE, /* 11 - send off the request (part 2) */ - MSTATE_DID, /* 12 - done sending off request */ - MSTATE_PERFORMING, /* 13 - transfer data */ - MSTATE_RATELIMITING, /* 14 - wait because limit-rate exceeded */ - MSTATE_DONE, /* 15 - post data transfer operation */ - MSTATE_COMPLETED, /* 16 - operation complete */ - MSTATE_MSGSENT, /* 17 - the operation complete message is sent */ - MSTATE_LAST /* 18 - not a true state, never use this */ + MSTATE_PENDING, /* no connections, waiting for one */ + MSTATE_SETUP, /* start a new transfer */ + MSTATE_CONNECT, /* resolve/connect has been sent off */ + MSTATE_RESOLVING, /* awaiting the resolve to finalize */ + MSTATE_CONNECTING, /* awaiting the TCP connect to finalize */ + MSTATE_PROTOCONNECT, /* initiate protocol connect procedure */ + MSTATE_PROTOCONNECTING, /* completing the protocol-specific connect phase */ + MSTATE_DO, /* start send off the request (part 1) */ + MSTATE_DOING, /* sending off the request (part 1) */ + MSTATE_DOING_MORE, /* send off the request (part 2) */ + MSTATE_DID, /* done sending off request */ + MSTATE_PERFORMING, /* transfer data */ + MSTATE_RATELIMITING, /* wait because limit-rate exceeded */ + MSTATE_DONE, /* post data transfer operation */ + MSTATE_COMPLETED, /* operation complete */ + MSTATE_MSGSENT, /* the operation complete message is sent */ + MSTATE_LAST /* not a true state, never use this */ } CURLMstate; #define CURLPIPE_ANY (CURLPIPE_MULTIPLEX) diff --git a/lib/rtsp.c b/lib/rtsp.c index 0a807899f9a9..8cd756c4a7f9 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -214,13 +214,10 @@ static CURLcode rtsp_connect(struct Curl_easy *data, bool *done) { struct rtsp_conn *rtspc = Curl_conn_meta_get(data->conn, CURL_META_RTSP_CONN); - CURLcode httpStatus; if(!rtspc) return CURLE_FAILED_INIT; - httpStatus = Curl_http_connect(data, done); - /* Initialize the CSeq if not already done */ if(data->state.rtsp_next_client_CSeq == 0) data->state.rtsp_next_client_CSeq = 1; @@ -228,8 +225,8 @@ static CURLcode rtsp_connect(struct Curl_easy *data, bool *done) data->state.rtsp_next_server_CSeq = 1; rtspc->rtp_channel = -1; - - return httpStatus; + *done = TRUE; + return CURLE_OK; } static CURLcode rtsp_done(struct Curl_easy *data, diff --git a/lib/ws.c b/lib/ws.c index eab06f4f118c..38d4195879e1 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -1914,7 +1914,7 @@ const struct Curl_handler Curl_handler_ws = { Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ - Curl_http_connect, /* connect_it */ + ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_pollset */ @@ -1941,7 +1941,7 @@ const struct Curl_handler Curl_handler_wss = { Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ - Curl_http_connect, /* connect_it */ + ZERO_NULL, /* connect_it */ NULL, /* connecting */ ZERO_NULL, /* doing */ NULL, /* proto_pollset */ From 44e64919cf11c6027d02123c0a02371c0fbf1b48 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 9 Dec 2025 12:54:00 +0100 Subject: [PATCH 726/885] pytest: socksd startup delay Add a small delay after the startup of the danted socks daemon to give it more time to become responsive. Closes #19895 --- tests/http/test_40_socks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/http/test_40_socks.py b/tests/http/test_40_socks.py index 8c6a81f4f6ad..1c844b82aae8 100644 --- a/tests/http/test_40_socks.py +++ b/tests/http/test_40_socks.py @@ -26,6 +26,7 @@ # import logging import os +import time from typing import Generator import pytest @@ -42,6 +43,7 @@ class TestSocks: def danted(self, env: Env) -> Generator[Dante, None, None]: danted = Dante(env=env) assert danted.initial_start() + time.sleep(1) yield danted danted.stop() From 197904d4b1f816ff6a05f0123b9a31663e5a454c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 15:32:42 +0100 Subject: [PATCH 727/885] config-win32.h: delete obsolete, non-Windows comments Closes #19899 --- lib/config-win32.h | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/lib/config-win32.h b/lib/config-win32.h index 4bf034bea31b..4b9ba3e32cb6 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -79,9 +79,6 @@ /* HEADER FILES */ /* ---------------------------------------------------------------- */ -/* Define if you have the header file. */ -/* #define HAVE_ARPA_INET_H 1 */ - /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 @@ -91,12 +88,6 @@ /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 -/* Define if you have the header file. */ -/* #define HAVE_NETDB_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_NETINET_IN_H 1 */ - /* Define to 1 if you have the header file. */ #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__) #define HAVE_STDBOOL_H 1 @@ -112,24 +103,12 @@ #define HAVE_SYS_PARAM_H 1 #endif -/* Define if you have the header file. */ -/* #define HAVE_SYS_SELECT_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SOCKIO_H 1 */ - /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the header file. */ #define HAVE_SYS_UTIME_H 1 -/* Define if you have the header file. */ -/* #define HAVE_TERMIO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMIOS_H 1 */ - /* Define if you have the header file. */ #ifdef __MINGW32__ #define HAVE_UNISTD_H 1 @@ -286,9 +265,6 @@ /* Define to the size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 -/* Define to the size of `long long', as computed by sizeof. */ -/* #define SIZEOF_LONG_LONG 8 */ - /* Define to the size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -306,15 +282,6 @@ /* COMPILER SPECIFIC */ /* ---------------------------------------------------------------- */ -/* Define to nothing if compiler does not support 'const' qualifier. */ -/* #define const */ - -/* Define to nothing if compiler does not support 'volatile' qualifier. */ -/* #define volatile */ - -/* Windows should not have HAVE_GMTIME_R defined */ -/* #undef HAVE_GMTIME_R */ - /* Define if the compiler supports the 'long long' data type. */ #if defined(_MSC_VER) || defined(__MINGW32__) #define HAVE_LONGLONG 1 @@ -377,9 +344,6 @@ * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS. */ -/* Define to enable c-ares asynchronous DNS lookups. */ -/* #define USE_ARES 1 */ - /* Default define to enable threaded asynchronous DNS lookups. */ #if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \ !defined(USE_THREADS_WIN32) From 74bc0c80b31c98dc9e49f261d0f2a196ff6b145f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 15:55:25 +0100 Subject: [PATCH 728/885] configure: delete unused variable Follow-up to 4d73854462f30948acab12984b611e9e33ee41e6 #9044 Closes #19901 --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1481a096b2bc..f0d05b18278e 100644 --- a/configure.ac +++ b/configure.ac @@ -4066,7 +4066,6 @@ CPPFLAGS=$o AC_CHECK_TYPE(long long, [AC_DEFINE(HAVE_LONGLONG, 1, [Define to 1 if the compiler supports the 'long long' data type.])] - longlong="yes" ) if test ${ac_cv_sizeof_curl_off_t} -lt 8; then From 073b85cefe30e27316c6bcbb382b746e9a412e73 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Dec 2025 14:39:16 +0100 Subject: [PATCH 729/885] GHA: make links get checked daily Assisted-by: Viktor Szakats Closes #19898 --- .github/workflows/checkdocs.yml | 11 ----------- .github/workflows/checkurls.yml | 28 ++++++++++++++++++++++++++++ scripts/mdlinkcheck | 4 ++-- 3 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/checkurls.yml diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index a079aeaa7062..7962034e9673 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -89,17 +89,6 @@ jobs: # - name: 'check special prose' # run: proselint docs/internals/CHECKSRC.md docs/libcurl/curl_mprintf.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md - linkcheck: - name: 'linkcheck' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - with: - persist-credentials: false - - - name: 'mdlinkcheck' - run: ./scripts/mdlinkcheck - pyspelling: name: 'pyspelling' runs-on: ubuntu-latest diff --git a/.github/workflows/checkurls.yml b/.github/workflows/checkurls.yml new file mode 100644 index 000000000000..f407859c75fd --- /dev/null +++ b/.github/workflows/checkurls.yml @@ -0,0 +1,28 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +name: 'URLs' + +'on': + schedule: + - cron: '10 5 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + linkcheck: + if: ${{ github.repository_owner == 'curl' }} + name: 'linkcheck' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + with: + persist-credentials: false + + - name: 'mdlinkcheck' + run: ./scripts/mdlinkcheck diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index bce3ca3fd56c..c28f7dd1ed1a 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -86,8 +86,8 @@ my %whitelist = ( my %url; my %flink; -# list all .md files in the repo -my @files=`git ls-files '**.md'`; +# list all files to scan for links +my @files=`git ls-files docs src lib scripts`; sub storelink { my ($f, $line, $link) = @_; From 163705db756557e6c07ac9386663f0576ebfd64e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 10:31:20 +0100 Subject: [PATCH 730/885] windows: assume `USE_WIN32_LARGE_FILES` All Windows platforms support it. It was permanently enabled with most build methods. The exception is autotools where it is enabled by default, with an option to disable it. It changed the build in a few places for rarely tested code paths, but not bringing other advantages (and used some 64-bit APIs anyway). This patch makes autotools' `--disable-largefile` option a no-op for Windows. Closes #19888 --- CMakeLists.txt | 5 +---- acinclude.m4 | 27 --------------------------- configure.ac | 1 - lib/config-win32.h | 13 ++++--------- lib/curl_config.h.cmake | 3 --- lib/curl_setup.h | 23 +++++++---------------- lib/curlx/fopen.c | 10 +--------- lib/version.c | 3 +-- src/tool_cb_see.c | 2 +- 9 files changed, 15 insertions(+), 72 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 685335667b9f..8b3cbecc51f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1772,8 +1772,6 @@ if(WIN32) endif() list(APPEND CURL_LIBS "bcrypt") - set(USE_WIN32_LARGE_FILES ON) - # We use crypto functions that are not available for UWP apps if(NOT WINDOWS_STORE) set(USE_WIN32_CRYPTO ON) @@ -1972,8 +1970,7 @@ curl_add_if("asyn-rr" USE_ARES AND ENABLE_THREADED_RESOLVER AND USE_HTTPSR curl_add_if("IDN" (HAVE_LIBIDN2 AND HAVE_IDN2_H) OR USE_WIN32_IDN OR USE_APPLE_IDN) -curl_add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND - ((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) +curl_add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND ((SIZEOF_OFF_T GREATER 4) OR WIN32)) curl_add_if("SSPI" USE_WINDOWS_SSPI) curl_add_if("GSS-API" HAVE_GSSAPI) curl_add_if("alt-svc" NOT CURL_DISABLE_ALTSVC) diff --git a/acinclude.m4 b/acinclude.m4 index 60e05add111e..0627ed1fd7e5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1307,33 +1307,6 @@ AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the cu fi ]) -dnl CURL_CHECK_WIN32_LARGEFILE -dnl ------------------------------------------------- -dnl Check if curl's Win32 large file will be used - -AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ - AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl - if test "$curl_cv_native_windows" = 'yes'; then - AC_MSG_CHECKING([whether build target supports Win32 large files]) - dnl All mingw-w64 versions support large files - curl_win32_has_largefile='yes' - case "$curl_win32_has_largefile" in - yes) - if test x"$enable_largefile" = 'xno'; then - AC_MSG_RESULT([yes (large file disabled)]) - else - AC_MSG_RESULT([yes (large file enabled)]) - AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1, - [Define to 1 if you are building a Windows target with large file support.]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac - fi -]) - dnl CURL_CHECK_WIN32_CRYPTO dnl ------------------------------------------------- dnl Check if curl's Win32 crypto lib can be used diff --git a/configure.ac b/configure.ac index f0d05b18278e..64fa6516ec8f 100644 --- a/configure.ac +++ b/configure.ac @@ -618,7 +618,6 @@ dnl ********************************************************************** dnl Compilation based checks should not be done before this point. dnl ********************************************************************** -CURL_CHECK_WIN32_LARGEFILE CURL_CHECK_WIN32_CRYPTO curl_cv_apple='no' diff --git a/lib/config-win32.h b/lib/config-win32.h index 4b9ba3e32cb6..2bdb555084cf 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -318,19 +318,14 @@ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ -#if defined(_MSC_VER) || defined(__MINGW32__) -# define USE_WIN32_LARGE_FILES /* Number of bits in a file offset, on hosts where this is settable. */ -# ifdef __MINGW32__ -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# endif +#ifdef __MINGW32__ +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 #endif /* Define to the size of `off_t', as computed by sizeof. */ -#if defined(__MINGW32__) && \ - defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +#ifdef __MINGW32__ # define SIZEOF_OFF_T 8 #else # define SIZEOF_OFF_T 4 diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 37ec3d9a6551..eaac11ec00da 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -761,9 +761,6 @@ ${SIZEOF_TIME_T_CODE} /* if Unix domain sockets are enabled */ #cmakedefine USE_UNIX_SOCKETS 1 -/* Define to 1 if you are building a Windows target with large file support. */ -#cmakedefine USE_WIN32_LARGE_FILES 1 - /* to enable SSPI support */ #cmakedefine USE_WINDOWS_SSPI 1 diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 829650aee4d4..a7dc41493c0f 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -471,22 +471,13 @@ # endif # include # include -# ifdef USE_WIN32_LARGE_FILES - /* Large file (>2Gb) support using Win32 functions. */ -# undef lseek -# define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence) -# undef fstat -# define fstat(fdes, stp) _fstati64(fdes, stp) -# define struct_stat struct _stati64 -# define LSEEK_ERROR (__int64)-1 -# else - /* Small file (<2Gb) support using Win32 functions. */ -# undef lseek -# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence) -# define fstat(fdes, stp) _fstat(fdes, stp) -# define struct_stat struct _stat -# define LSEEK_ERROR (long)-1 -# endif + /* Large file (>2Gb) support using Win32 functions. */ +# undef lseek +# define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence) +# undef fstat +# define fstat(fdes, stp) _fstati64(fdes, stp) +# define struct_stat struct _stati64 +# define LSEEK_ERROR (__int64)-1 #elif defined(__DJGPP__) /* Requires DJGPP 2.04 */ # include diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index c9b7a9c0b590..75ff63901e81 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -28,7 +28,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence) { -#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) +#ifdef _WIN32 return _fseeki64(stream, (__int64)offset, whence); #elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) return fseeko(stream, (off_t)offset, whence); @@ -373,11 +373,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) target = fixed; else target = path_w; -#ifndef USE_WIN32_LARGE_FILES - result = _wstat(target, buffer); -#else result = _wstati64(target, buffer); -#endif CURLX_FREE(path_w); } else @@ -388,11 +384,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) target = fixed; else target = path; -#ifndef USE_WIN32_LARGE_FILES - result = _stat(target, buffer); -#else result = _stati64(target, buffer); -#endif #endif CURLX_FREE(fixed); diff --git a/lib/version.c b/lib/version.c index 79654fa9755c..fe4f637d6796 100644 --- a/lib/version.c +++ b/lib/version.c @@ -500,8 +500,7 @@ static const struct feat features_table[] = { #ifdef USE_KERBEROS5 FEATURE("Kerberos", NULL, CURL_VERSION_KERBEROS5), #endif -#if (SIZEOF_CURL_OFF_T > 4) && \ - ( (SIZEOF_OFF_T > 4) || defined(USE_WIN32_LARGE_FILES) ) +#if (SIZEOF_CURL_OFF_T > 4) && ((SIZEOF_OFF_T > 4) || defined(_WIN32)) FEATURE("Largefile", NULL, CURL_VERSION_LARGEFILE), #endif #ifdef HAVE_LIBZ diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index ea5c8e313b40..6c3cadc7f58f 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -38,7 +38,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) { struct per_transfer *per = userdata; -#if (SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES) +#if (SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(_WIN32) /* OUR_MAX_SEEK_L has 'long' data type, OUR_MAX_SEEK_O has 'curl_off_t, both represent the same value. Maximum offset used here when we lseek From a7c974e038572bd1d4a653afbd6de5fad5a10215 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 8 Oct 2025 16:20:54 +0200 Subject: [PATCH 731/885] DEPRECATE: add CMake <3.18 deprecation for April 2026 CMake 3.18 was released on 2020-07-15. It enables using (and/or dropping workarounds) for these features: LTO support, better performance and pkg-config support, `OBJECT` target, `-S`, `-B`, `--verbose`, `--install` on the command-line, lib directory support in interface targets, target_link_options(), LINK_OPTIONS, FetchContent, `list(PREPEND ...)`, unity, Ninja, fixed imported global issues. Ref: https://github.com/curl/curl/discussions/18704 Closes #19902 --- docs/DEPRECATE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 2a3cbfc78d88..2219bd32645e 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -50,6 +50,12 @@ RTMP in curl is powered by the 3rd party library librtmp. Support for RTMP in libcurl gets removed in April 2026. +## CMake 3.17 and earlier + +We remove support for CMake <3.18 in April 2026. + +CMake 3.18 was released on 2020-07-15. + ## Past removals - axTLS (removed in 7.63.0) From 920319855de090b0eacc27812baf71e82c178ea3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 22:26:41 +0100 Subject: [PATCH 732/885] mdlinkcheck: exclude self from URL search To avoid picking up the whitelist. Closes #19909 --- scripts/mdlinkcheck | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index c28f7dd1ed1a..f83144108e39 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -197,7 +197,9 @@ sub checkurl { for my $f (@files) { chomp $f; - findlinks($f); + if($f !~ /\/mdlinkcheck$/) { + findlinks($f); + } } #for my $u (sort keys %url) { From 3fb932d49255d92141c27d3e9a040752622620b7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 23:27:34 +0100 Subject: [PATCH 733/885] mdlinkcheck: do not pick up single quote and backslash after URLs Closes #19910 --- scripts/mdlinkcheck | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index f83144108e39..446cb9f1dd6e 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -160,10 +160,10 @@ sub findlinks { #print "$f:$line $link\n"; storelink($f, $line, $link); } - # ignore trailing: dot, quote, asterisk, hash, comma, question mark, - # colon, closing parenthesis, closing angle bracket, whitespace, pipe, - # backtick, semicolon - elsif(/(https:\/\/[a-z0-9.\/:%_+@-]+[^."*\#,?:\)> \t|`;])/i) { + # ignore trailing: dot, double quote, single quote, asterisk, hash, + # comma, question mark, colon, closing parenthesis, backslash, + # closing angle bracket, whitespace, pipe, backtick, semicolon + elsif(/(https:\/\/[a-z0-9.\/:%_+@-]+[^."'*\#,?:\)> \t|`;\\])/i) { #print "RAW "; storelink($f, $line, $1); } From bd19433b0ebbd719487577f8ffa25ba6bdb8f909 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 20:06:33 +0100 Subject: [PATCH 734/885] build: set `-Wno-format-signedness` Explicitly disable these warnings to allow using `-Weverything`. There are around 600 of them across the codebase. Silencing them has some drawbacks: - enums (`CURLcode` mostly) would have to be cast to int to avoid different signedness depending on C compiler. (llvm/gcc: unsigned, MSVC/clang-cl: signed by default) - hex masks need casts to unsigned to avoid the warning. - fixing remaining warnings is annoying without fixing the above. - without fixing all warnings the option cannot be enabled, to keep the codebase warning free. Ref: #18343 (silenced all warnings, but without the enum cast) Follow-up to 92f215fea1aa8bd5b1709d38f42aab77ab3fc662 #18477 Closes #19907 --- CMake/PickyWarnings.cmake | 7 +++++++ m4/curl-compilers.m4 | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/CMake/PickyWarnings.cmake b/CMake/PickyWarnings.cmake index e9a0d61c0ef6..00451f7480bd 100644 --- a/CMake/PickyWarnings.cmake +++ b/CMake/PickyWarnings.cmake @@ -232,6 +232,12 @@ if(PICKY_COMPILER) -Wcast-function-type-strict # clang 16.0 appleclang 16.0 ) endif() + if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR + (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)) + list(APPEND _picky_enable + -Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default + ) + endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) list(APPEND _picky_enable -Warray-compare # clang 20.1 gcc 12.0 appleclang ? @@ -282,6 +288,7 @@ if(PICKY_COMPILER) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) list(APPEND _picky_enable -Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds) + -Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 ) endif() if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index dda5b7934ef3..343391d6020c 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -936,6 +936,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$compiler_num" -ge "1700"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [cast-function-type-strict]) # with Apple clang it requires 16.0 or above fi + dnl clang 19 or later + if test "$compiler_num" -ge "1901"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-format-signedness" + fi dnl clang 20 or later if test "$compiler_num" -ge "2001"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [array-compare]) @@ -1115,6 +1119,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Only gcc 5 or later if test "$compiler_num" -ge "500"; then tmp_CFLAGS="$tmp_CFLAGS -Warray-bounds=2" + tmp_CFLAGS="$tmp_CFLAGS -Wno-format-signedness" fi # dnl Only gcc 6 or later From d371288de73465efb1b26958150d04f8adfe6fd2 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 9 Dec 2025 17:00:52 +0100 Subject: [PATCH 735/885] test: increase altsvc test reliability Move new tests from test_12 to test_06 (eyeballing) where they better fit. Increase reliability by check Alt-Svc redirects from h3 to a lower version for a port where no h3 is available. Closes #19903 --- tests/http/test_06_eyeballs.py | 66 +++++++++++++++++++++ tests/http/test_12_reuse.py | 104 --------------------------------- 2 files changed, 66 insertions(+), 104 deletions(-) diff --git a/tests/http/test_06_eyeballs.py b/tests/http/test_06_eyeballs.py index 3b374e8158e3..6129ab5f1755 100644 --- a/tests/http/test_06_eyeballs.py +++ b/tests/http/test_06_eyeballs.py @@ -149,3 +149,69 @@ def test_06_20_h2_altsvc_h3_fallback(self, env: Env, httpd, nghttpx): r.check_exit_code(0) r.check_response(count=1, http_status=200) assert r.stats[0]['http_version'] == '2' + + @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") + def test_06_21_as_follow_h3h1(self, env: Env, httpd, configures_httpd, nghttpx): + # With '--http3` an Alt-Svc redirection from h3 to h1 is allowed + # write an alt-svc file the advises h1 instead of h3 + curl = CurlClient(env=env) + asfile = curl.mk_altsvc_file('test_12', + 'h3', env.domain1, env.https_only_tcp_port, + 'http/1.1', env.domain1, env.https_only_tcp_port) + urln = f'https://{env.domain1}:{env.https_only_tcp_port}/data.json' + r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ + '--alt-svc', f'{asfile}', '--http3' + ]) + r.check_response(count=1, http_status=200) + # We expect the connection to be preferring HTTP/1.1 in the ALPN + assert r.total_connects == 1, f'{r.dump_logs()}' + re_m = re.compile(r'.* ALPN: curl offers http/1.1,h2') + lines = [line for line in r.trace_lines if re_m.match(line)] + assert len(lines), f'{r.dump_logs()}' + + @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") + def test_06_22_as_ignore_h3h1(self, env: Env, httpd, configures_httpd, nghttpx): + # With '--http3-only` an Alt-Svc redirection from h3 to h1 is ignored + # write an alt-svc file the advises h1 instead of h3 + curl = CurlClient(env=env) + asfile = curl.mk_altsvc_file('test_12', + 'h3', env.domain1, env.https_port, + 'http/1.1', env.domain1, env.https_port) + urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json' + r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ + '--alt-svc', f'{asfile}', '--http3-only' + ]) + r.check_response(count=1, http_status=200) + # We expect the connection to be stay on h3, since we used --http3-only + assert r.total_connects == 1 + assert r.stats[0]['http_version'] == '3', f'{r.stats}' + + @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") + def test_06_23_as_ignore_h2h3(self, env: Env, httpd, configures_httpd, nghttpx): + # With '--http2` an Alt-Svc redirection from h2 to h3 is ignored + # write an alt-svc file that advises h3 instead of h2 + curl = CurlClient(env=env) + asfile = curl.mk_altsvc_file('test_12', + 'h2', env.domain1, env.https_port, + 'h3', env.domain1, env.h3_port) + urln = f'https://{env.authority_for(env.domain1, "h2")}/data.json' + r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ + '--alt-svc', f'{asfile}', '--http2' + ]) + r.check_response(count=1, http_status=200) + assert r.stats[0]['http_version'] == '2', f'{r.stats}' + + # download using HTTP/3 on available server with alt-svc to h2, use h2 + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") + def test_06_24_h3_altsvc_h2_used(self, env: Env, httpd, nghttpx): + curl = CurlClient(env=env) + urln = f'https://{env.domain1}:{env.https_only_tcp_port}/data.json' + altsvc_file = curl.mk_altsvc_file('test_12', + 'h3', env.domain1, env.https_only_tcp_port, + 'h2', env.domain1, env.https_only_tcp_port) + r = curl.http_download(urls=[urln], extra_args=[ + '--http3', '--alt-svc', altsvc_file + ]) + r.check_exit_code(0) + r.check_response(count=1, http_status=200) + assert r.stats[0]['http_version'] == '2' diff --git a/tests/http/test_12_reuse.py b/tests/http/test_12_reuse.py index 522df92708cf..6f267d986283 100644 --- a/tests/http/test_12_reuse.py +++ b/tests/http/test_12_reuse.py @@ -25,9 +25,6 @@ ########################################################################### # import logging -import os -import re -from datetime import datetime, timedelta import pytest from testenv import Env, CurlClient @@ -75,104 +72,3 @@ def test_12_02_h1_conn_timeout(self, env: Env, httpd, configures_httpd, nghttpx, r.check_response(count=count, http_status=200) # Connections time out on server before we send another request, assert r.total_connects == count - - @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") - def test_12_03_as_follow_h2h3(self, env: Env, httpd, configures_httpd, nghttpx): - curl = CurlClient(env=env) - # write an alt-svc file that advises h3 instead of h2 - asfile = curl.mk_altsvc_file('test_12', - 'h2', env.domain1, env.https_port, - 'h3', env.domain1, env.h3_port) - urln = f'https://{env.authority_for(env.domain1, "h2")}/data.json' - r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ - '--alt-svc', f'{asfile}', - ]) - r.check_response(count=1, http_status=200) - assert r.stats[0]['http_version'] == '3', f'{r.stats}' - - @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") - def test_12_04_as_follow_h3h2(self, env: Env, httpd, configures_httpd, nghttpx): - count = 2 - # write an alt-svc file the advises h2 instead of h3 - asfile = os.path.join(env.gen_dir, 'alt-svc-12_04.txt') - ts = datetime.now() + timedelta(hours=24) - expires = f'{ts.year:04}{ts.month:02}{ts.day:02} {ts.hour:02}:{ts.minute:02}:{ts.second:02}' - with open(asfile, 'w') as fd: - fd.write(f'h3 {env.domain1} {env.https_port} h2 {env.domain1} {env.https_port} "{expires}" 0 0') - log.info(f'altscv: {open(asfile).readlines()}') - curl = CurlClient(env=env) - urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json?[0-{count-1}]' - r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ - '--alt-svc', f'{asfile}', '--http3' - ]) - r.check_response(count=count, http_status=200) - # We expect the connection to be reused and use HTTP/2 - assert r.total_connects == 1 - for s in r.stats: - assert s['http_version'] == '2', f'{s}' - - @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") - def test_12_05_as_follow_h3h1(self, env: Env, httpd, configures_httpd, nghttpx): - # With '--http3` an Alt-Svc redirection from h3 to h1 is allowed - # write an alt-svc file the advises h1 instead of h3 - curl = CurlClient(env=env) - asfile = curl.mk_altsvc_file('test_12', - 'h3', env.domain1, env.https_port, - 'http/1.1', env.domain1, env.https_port) - urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json' - r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ - '--alt-svc', f'{asfile}', '--http3' - ]) - r.check_response(count=1, http_status=200) - # We expect the connection to be preferring HTTP/1.1 in the ALPN - assert r.total_connects == 1 - re_m = re.compile(r'.* ALPN: curl offers http/1.1,h2') - lines = [line for line in r.trace_lines if re_m.match(line)] - assert len(lines), f'{r.dump_logs()}' - - @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") - def test_12_06_as_ignore_h3h1(self, env: Env, httpd, configures_httpd, nghttpx): - # With '--http3-only` an Alt-Svc redirection from h3 to h1 is ignored - # write an alt-svc file the advises h1 instead of h3 - curl = CurlClient(env=env) - asfile = curl.mk_altsvc_file('test_12', - 'h3', env.domain1, env.https_port, - 'http/1.1', env.domain1, env.https_port) - urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json' - r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ - '--alt-svc', f'{asfile}', '--http3-only' - ]) - r.check_response(count=1, http_status=200) - # We expect the connection to be stay on h3, since we used --http3-only - assert r.total_connects == 1 - assert r.stats[0]['http_version'] == '3', f'{r.stats}' - - @pytest.mark.skipif(condition=not Env.have_h3(), reason="h3 not supported") - def test_12_07_as_ignore_h2h3(self, env: Env, httpd, configures_httpd, nghttpx): - # With '--http2` an Alt-Svc redirection from h2 to h3 is ignored - # write an alt-svc file that advises h3 instead of h2 - curl = CurlClient(env=env) - asfile = curl.mk_altsvc_file('test_12', - 'h2', env.domain1, env.https_port, - 'h3', env.domain1, env.h3_port) - urln = f'https://{env.authority_for(env.domain1, "h2")}/data.json' - r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ - '--alt-svc', f'{asfile}', '--http2' - ]) - r.check_response(count=1, http_status=200) - assert r.stats[0]['http_version'] == '2', f'{r.stats}' - - # download using HTTP/3 on available server with alt-svc to h2, use h2 - @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") - def test_12_08_h3_altsvc_h2_used(self, env: Env, httpd, nghttpx): - curl = CurlClient(env=env) - urln = f'https://{env.domain1}:{env.https_port}/data.json' - altsvc_file = curl.mk_altsvc_file('test_12', - 'h3', env.domain1, env.https_port, - 'h2', env.domain1, env.https_port) - r = curl.http_download(urls=[urln], extra_args=[ - '--http3', '--alt-svc', altsvc_file - ]) - r.check_exit_code(0) - r.check_response(count=1, http_status=200) - assert r.stats[0]['http_version'] == '2' From 00f06127ce4e0d9115770a2896c816fde087ae71 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 9 Dec 2025 15:48:52 +0100 Subject: [PATCH 736/885] memdebug: fix realloc logging Do the whole realloc and the subsequent logging under mutex lock. This fixed log entries that state allocation a memory location before realloc logs it as being freed. Closes #19900 --- lib/memdebug.c | 88 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 65 insertions(+), 23 deletions(-) diff --git a/lib/memdebug.c b/lib/memdebug.c index 991c9eb921c3..05cd45a6f9bd 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -71,6 +71,29 @@ static bool dbg_mutex_init = 0; static curl_mutex_t dbg_mutex; #endif +static bool curl_dbg_lock(void) +{ +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + if(dbg_mutex_init) { + Curl_mutex_acquire(&dbg_mutex); + return TRUE; + } +#endif + return FALSE; +} + +static void curl_dbg_unlock(bool was_locked) +{ +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + if(was_locked) + Curl_mutex_release(&dbg_mutex); +#else + (void)was_locked; +#endif +} + +static void curl_dbg_log_locked(const char *format, ...) CURL_PRINTF(1, 2); + /* LeakSantizier (LSAN) calls _exit() instead of exit() when a leak is detected on exit so the logfile must be closed explicitly or data could be lost. Though _exit() does not call atexit handlers such as this, LSAN's call to @@ -295,6 +318,7 @@ void *curl_dbg_realloc(void *ptr, size_t wantedsize, int line, const char *source) { struct memdebug *mem = NULL; + bool was_locked; size_t size = sizeof(struct memdebug) + wantedsize; @@ -303,6 +327,10 @@ void *curl_dbg_realloc(void *ptr, size_t wantedsize, if(countcheck("realloc", line, source)) return NULL; + /* need to realloc under lock, as we get out-of-order log + * entries otherwise, since another thread might alloc the + * memory released by realloc() before otherwise would log it. */ + was_locked = curl_dbg_lock(); #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:1684) @@ -318,10 +346,11 @@ void *curl_dbg_realloc(void *ptr, size_t wantedsize, mem = (Curl_crealloc)(mem, size); if(source) - curl_dbg_log("MEM %s:%d realloc(%p, %zu) = %p\n", - source, line, (void *)ptr, wantedsize, - mem ? (void *)mem->mem : (void *)0); + curl_dbg_log_locked("MEM %s:%d realloc(%p, %zu) = %p\n", + source, line, (void *)ptr, wantedsize, + mem ? (void *)mem->mem : (void *)0); + curl_dbg_unlock(was_locked); if(mem) { mem->size = wantedsize; return mem->mem; @@ -522,29 +551,18 @@ int curl_dbg_fclose(FILE *file, int line, const char *source) return res; } -/* this does the writing to the memory tracking log file */ -void curl_dbg_log(const char *format, ...) +static void curl_dbg_vlog(const char * const fmt, + va_list ap) CURL_PRINTF(1, 0); + +static void curl_dbg_vlog(const char * const fmt, va_list ap) { char buf[1024]; - size_t nchars; - va_list ap; - - if(!curl_dbg_logfile) - return; - - va_start(ap, format); - nchars = curl_mvsnprintf(buf, sizeof(buf), format, ap); - va_end(ap); + size_t nchars = curl_mvsnprintf(buf, sizeof(buf), fmt, ap); if(nchars > (int)sizeof(buf) - 1) nchars = (int)sizeof(buf) - 1; if(nchars > 0) { -#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) - bool lock_mutex = dbg_mutex_init; - if(lock_mutex) - Curl_mutex_acquire(&dbg_mutex); -#endif if(sizeof(membuf) - nchars < memwidx) { /* flush */ fwrite(membuf, 1, memwidx, curl_dbg_logfile); @@ -557,11 +575,35 @@ void curl_dbg_log(const char *format, ...) } memcpy(&membuf[memwidx], buf, nchars); memwidx += nchars; -#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) - if(lock_mutex) - Curl_mutex_release(&dbg_mutex); -#endif } } +static void curl_dbg_log_locked(const char *format, ...) +{ + va_list ap; + + if(!curl_dbg_logfile) + return; + + va_start(ap, format); + curl_dbg_vlog(format, ap); + va_end(ap); +} + +/* this does the writing to the memory tracking log file */ +void curl_dbg_log(const char *format, ...) +{ + bool was_locked; + va_list ap; + + if(!curl_dbg_logfile) + return; + + was_locked = curl_dbg_lock(); + va_start(ap, format); + curl_dbg_vlog(format, ap); + va_end(ap); + curl_dbg_unlock(was_locked); +} + #endif /* CURLDEBUG */ From d9d2e339ced3fa02dd0e72e68b0a9b68069c0801 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Dec 2025 21:24:28 +0100 Subject: [PATCH 737/885] tidy-up: URLs (cont.) and mdlinkcheck - add missing ending slashes. To avoid duplicates and to use canonical URLs. - reapply lost updates. Follow-up to 2ae983bf4ea5ef86f0e68ea0ff219a91b1aa3428 #19879 - mdlinkcheck: include the `include` directory. - mdlinkcheck: show unused whitelist items. - mdlinkcheck: improve debug output. - mdlinkcheck: delete redundant whitelist items. - examples/simplessl: lowercase the protocol part. - BINDINGS: replace one remaining HTTP URL with HTTPS. Issue: https://github.com/pycurl/pycurl/issues/892 - BINDINGS: fix a broken link. - BINDINGS: follow a refresh content redirect. - KNOWN_BUGS: whitespace. Closes #19911 --- docs/BINDINGS.md | 6 +- docs/FAQ.md | 16 ++--- docs/INFRASTRUCTURE.md | 6 +- docs/KNOWN_BUGS.md | 16 ++--- docs/TODO.md | 4 +- docs/TheArtOfHttpScripting.md | 4 +- docs/cmdline-opts/_WWW.md | 2 +- docs/examples/10-at-a-time.c | 90 +++++++++++++-------------- docs/examples/crawler.c | 2 +- docs/examples/maxconnects.c | 4 +- docs/examples/simplessl.c | 2 +- docs/internals/CONNECTION-FILTERS.md | 8 +-- docs/tests/TEST-SUITE.md | 4 +- lib/curl_rtmp.c | 2 +- packages/vms/curl_gnv_build_steps.txt | 2 +- scripts/mdlinkcheck | 21 ++++--- 16 files changed, 98 insertions(+), 91 deletions(-) diff --git a/docs/BINDINGS.md b/docs/BINDINGS.md index 065126efd723..56f0376b6415 100644 --- a/docs/BINDINGS.md +++ b/docs/BINDINGS.md @@ -49,7 +49,7 @@ Clojure: [clj-curl](https://github.com/lsevero/clj-curl) by Lucas Severo [Fortran](https://github.com/interkosmos/fortran-curl) Written by Philipp Engel -[Gambas](https://gambas.sourceforge.net/) +[Gambas](https://gambaswiki.org/website/en/main.html) [glib/GTK+](https://web.archive.org/web/20100526203452/atterer.net/glibcurl) Written by Richard Atterer @@ -102,7 +102,7 @@ Bailiff and Bálint Szilakszi, [PureBasic](https://web.archive.org/web/20250325015028/www.purebasic.com/documentation/http/index.html) uses libcurl in its "native" HTTP subsystem -[Python](http://pycurl.io/) PycURL by Kjetil Jacobsen +[Python](https://github.com/pycurl/pycurl) PycURL by Kjetil Jacobsen [Python](https://pypi.org/project/pymcurl/) mcurl by Ganesh Viswanathan @@ -112,7 +112,7 @@ Bailiff and Bálint Szilakszi, [Rexx](https://rexxcurl.sourceforge.net/) Written Mark Hessling -[Ring](https://ring-lang.sourceforge.io/doc1.3/libcurl.html) RingLibCurl by Mahmoud Fayed +[Ring](https://ring-lang.github.io/doc1.24/libcurl.html) RingLibCurl by Mahmoud Fayed RPG, support for ILE/RPG on OS/400 is included in source distribution diff --git a/docs/FAQ.md b/docs/FAQ.md index f6911990d94b..eba30f1fefd5 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -303,7 +303,7 @@ library comparison](https://curl.se/docs/ssl-compared.html). The curl tool that is shipped as an integrated component of Windows 10 and Windows 11 is managed by Microsoft. If you were to delete the file or replace it with a newer version downloaded from [the curl -website](https://curl.se/windows), then Windows Update will cease to work on +website](https://curl.se/windows/), then Windows Update will cease to work on your system. There is no way to independently force an upgrade of the curl.exe that is part @@ -312,7 +312,7 @@ also nothing the curl project itself can do about this, since this is managed and controlled entirely by Microsoft as owners of the operating system. You can always download and install [the latest version of curl for -Windows](https://curl.se/windows) into a separate location. +Windows](https://curl.se/windows/) into a separate location. ## Does curl support SOCKS (RFC 1928) ? @@ -908,12 +908,12 @@ format: you will find that even if `D:\blah.txt` does exist, curl returns a 'file not found' error. -According to [RFC 1738](https://www.ietf.org/rfc/rfc1738.txt), `file://` URLs -must contain a host component, but it is ignored by most implementations. In -the above example, `D:` is treated as the host component, and is taken away. -Thus, curl tries to open `/blah.txt`. If your system is installed to drive C:, -that will resolve to `C:\blah.txt`, and if that does not exist you will get -the not found error. +According to [RFC 1738](https://datatracker.ietf.org/doc/html/rfc1738), +`file://` URLs must contain a host component, but it is ignored by most +implementations. In the above example, `D:` is treated as the host component, +and is taken away. Thus, curl tries to open `/blah.txt`. If your system is +installed to drive C:, that will resolve to `C:\blah.txt`, and if that does +not exist you will get the not found error. To fix this problem, use `file://` URLs with *three* leading slashes: diff --git a/docs/INFRASTRUCTURE.md b/docs/INFRASTRUCTURE.md index 13240b31b5fa..7a6bafb9dbab 100644 --- a/docs/INFRASTRUCTURE.md +++ b/docs/INFRASTRUCTURE.md @@ -100,11 +100,11 @@ company). The machine is physically located in Sweden. curl release tarballs are hosted on https://curl.se/download.html. They are uploaded there at release-time by the release manager. -curl-for-win downloads are hosted on https://curl.se/windows and are uploaded +curl-for-win downloads are hosted on https://curl.se/windows/ and are uploaded to the server by Viktor Szakats. -curl-for-QNX downloads are hosted on and are uploaded to -the server by Daniel Stenberg. +curl-for-QNX downloads are hosted on and are uploaded +to the server by Daniel Stenberg. Daily release tarball-like snapshots are generated automatically and are provided for download at . diff --git a/docs/KNOWN_BUGS.md b/docs/KNOWN_BUGS.md index 1f5cebee27c7..83a30fd9e897 100644 --- a/docs/KNOWN_BUGS.md +++ b/docs/KNOWN_BUGS.md @@ -161,7 +161,7 @@ Passing in a Unicode filename with -o: Passing in Unicode character with -d: - [curl issue 12231](https://github.com/curl/curl/issues/12231) +[curl issue 12231](https://github.com/curl/curl/issues/12231) Windows Unicode builds use the home directory in current locale. @@ -215,8 +215,10 @@ what `winhttp` does. See https://curl.se/bug/view.cgi?id=535 ## NTLM does not support password with Unicode 'SECTION SIGN' character - https://en.wikipedia.org/wiki/Section_sign - [curl issue 2120](https://github.com/curl/curl/issues/2120) +Code point: U+00A7 + +https://en.wikipedia.org/wiki/Section_sign +[curl issue 2120](https://github.com/curl/curl/issues/2120) ## libcurl can fail to try alternatives with `--proxy-any` @@ -231,7 +233,7 @@ using NTLM. ## Do not clear digest for single realm - [curl issue 3267](https://github.com/curl/curl/issues/3267) +[curl issue 3267](https://github.com/curl/curl/issues/3267) ## SHA-256 digest not supported in Windows SSPI builds @@ -243,7 +245,7 @@ with `SEC_E_QOP_NOT_SUPPORTED` which causes curl to fail with Microsoft does not document supported digest algorithms and that `SEC_E` error code is not a documented error for `InitializeSecurityContext` (digest). - [curl issue 6302](https://github.com/curl/curl/issues/6302) +[curl issue 6302](https://github.com/curl/curl/issues/6302) ## curl never completes Negotiate over HTTP @@ -306,7 +308,7 @@ In the `SSH_SFTP_INIT` state for libssh, the ssh session working mode is set to blocking mode. If the network is suddenly disconnected during sftp transmission, curl is stuck, even if curl is configured with a timeout. - [curl issue 8632](https://github.com/curl/curl/issues/8632) +[curl issue 8632](https://github.com/curl/curl/issues/8632) ## Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" @@ -494,7 +496,7 @@ cannot be built. ## HTTP/2 prior knowledge over proxy - [curl issue 12641](https://github.com/curl/curl/issues/12641) +[curl issue 12641](https://github.com/curl/curl/issues/12641) ## HTTP/2 frames while in the connection pool kill reuse diff --git a/docs/TODO.md b/docs/TODO.md index 2b77b8ce0b9e..0224ae87332c 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -530,8 +530,8 @@ for 1) efficiency and 2) safety. ## Support DANE [DNS-Based Authentication of Named Entities -(DANE)](https://www.rfc-editor.org/rfc/rfc6698.txt) is a way to provide SSL -keys and certs over DNS using DNSSEC as an alternative to the CA model. +(DANE)](https://datatracker.ietf.org/doc/html/rfc6698) is a way to provide +SSL keys and certs over DNS using DNSSEC as an alternative to the CA model. A patch was posted on March 7 2013 (https://curl.se/mail/lib-2013-03/0075.html) but it was a too simple approach. diff --git a/docs/TheArtOfHttpScripting.md b/docs/TheArtOfHttpScripting.md index f7cf43602d90..ab4961c5781c 100644 --- a/docs/TheArtOfHttpScripting.md +++ b/docs/TheArtOfHttpScripting.md @@ -91,7 +91,7 @@ SPDX-License-Identifier: curl The Uniform Resource Locator format is how you specify the address of a particular resource on the Internet. You know these, you have seen URLs like - https://curl.se or https://example.com a million times. RFC 3986 is the + https://curl.se/ or https://example.com/ a million times. RFC 3986 is the canonical spec. The formal name is not URL, it is **URI**. ## Host @@ -158,7 +158,7 @@ SPDX-License-Identifier: curl issues a GET request to the server and receives the document it asked for. If you issue the command line - curl https://curl.se + curl https://curl.se/ you get a webpage returned in your terminal window. The entire HTML document this URL identifies. diff --git a/docs/cmdline-opts/_WWW.md b/docs/cmdline-opts/_WWW.md index 35d946697f94..8656e9ee8c8f 100644 --- a/docs/cmdline-opts/_WWW.md +++ b/docs/cmdline-opts/_WWW.md @@ -1,4 +1,4 @@ # WWW -https://curl.se +https://curl.se/ diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index 08f1f25f7f7f..db420eebfb67 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -31,53 +31,53 @@ #include static const char *urls[] = { - "https://www.microsoft.com", - "https://opensource.org", - "https://www.google.com", - "https://www.yahoo.com", - "https://www.ibm.com", - "https://www.mysql.com", - "https://www.oracle.com", - "https://www.ripe.net", - "https://www.iana.org", - "https://www.amazon.com", - "https://www.netcraft.com", - "https://www.heise.de", - "https://www.chip.de", - "https://www.ca.com", - "https://www.cnet.com", - "https://www.mozilla.org", - "https://www.cnn.com", - "https://www.wikipedia.org", - "https://www.dell.com", - "https://www.hp.com", - "https://www.cert.org", - "https://www.mit.edu", - "https://www.nist.gov", - "https://www.ebay.com", - "https://www.playstation.com", - "https://www.uefa.com", - "https://www.ieee.org", - "https://www.apple.com", - "https://www.symantec.com", - "https://www.zdnet.com", + "https://www.microsoft.com/", + "https://opensource.org/", + "https://www.google.com/", + "https://www.yahoo.com/", + "https://www.ibm.com/", + "https://www.mysql.com/", + "https://www.oracle.com/", + "https://www.ripe.net/", + "https://www.iana.org/", + "https://www.amazon.com/", + "https://www.netcraft.com/", + "https://www.heise.de/", + "https://www.chip.de/", + "https://www.ca.com/", + "https://www.cnet.com/", + "https://www.mozilla.org/", + "https://www.cnn.com/", + "https://www.wikipedia.org/", + "https://www.dell.com/", + "https://www.hp.com/", + "https://www.cert.org/", + "https://www.mit.edu/", + "https://www.nist.gov/", + "https://www.ebay.com/", + "https://www.playstation.com/", + "https://www.uefa.com/", + "https://www.ieee.org/", + "https://www.apple.com/", + "https://www.symantec.com/", + "https://www.zdnet.com/", "https://www.fujitsu.com/global/", - "https://www.supermicro.com", - "https://www.hotmail.com", - "https://www.ietf.org", - "https://www.bbc.co.uk", - "https://news.google.com", - "https://www.foxnews.com", - "https://www.msn.com", - "https://www.wired.com", - "https://www.sky.com", - "https://www.usatoday.com", - "https://www.cbs.com", + "https://www.supermicro.com/", + "https://www.hotmail.com/", + "https://www.ietf.org/", + "https://www.bbc.co.uk/", + "https://news.google.com/", + "https://www.foxnews.com/", + "https://www.msn.com/", + "https://www.wired.com/", + "https://www.sky.com/", + "https://www.usatoday.com/", + "https://www.cbs.com/", "https://www.nbc.com/", - "https://slashdot.org", - "https://www.informationweek.com", - "https://apache.org", - "https://www.un.org", + "https://slashdot.org/", + "https://www.informationweek.com/", + "https://apache.org/", + "https://www.un.org/", }; #define MAX_PARALLEL 10 /* number of simultaneous transfers */ diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index 09c0c7d6923f..d153cc21c5ac 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -47,7 +47,7 @@ static int max_total = 20000; static int max_requests = 500; static size_t max_link_per_page = 5; static int follow_relative_links = 0; -static const char *start_page = "https://www.reuters.com"; +static const char *start_page = "https://www.reuters.com/"; static int pending_interrupt = 0; static void sighandler(int dummy) diff --git a/docs/examples/maxconnects.c b/docs/examples/maxconnects.c index 2ee1d305a93f..95231d600268 100644 --- a/docs/examples/maxconnects.c +++ b/docs/examples/maxconnects.c @@ -40,8 +40,8 @@ int main(void) curl = curl_easy_init(); if(curl) { const char *urls[] = { - "https://example.com", - "https://curl.se", + "https://example.com/", + "https://curl.se/", "https://www.example/", NULL /* end of list */ }; diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index d08da207bfbf..c60b91057e9a 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -84,7 +84,7 @@ int main(void) goto error; /* what call to write: */ - curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://secure.site.example"); + curl_easy_setopt(curl, CURLOPT_URL, "https://secure.site.example/"); curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile); #ifdef USE_ENGINE diff --git a/docs/internals/CONNECTION-FILTERS.md b/docs/internals/CONNECTION-FILTERS.md index 09acc7ad9560..08fb36738578 100644 --- a/docs/internals/CONNECTION-FILTERS.md +++ b/docs/internals/CONNECTION-FILTERS.md @@ -233,7 +233,7 @@ Users of `curl` may activate them by adding the name of the filter type to the of an HTTP/2 request, invoke curl with: ``` -> curl -v --trace-config ids,time,http/2 https://curl.se +> curl -v --trace-config ids,time,http/2 https://curl.se/ ``` Which gives you trace output with time information, transfer+connection ids @@ -260,7 +260,7 @@ into IPv4 and IPv6 and makes parallel attempts. The connection filter chain looks like this: ``` -* create connection for http://curl.se +* create connection for http://curl.se/ conn[curl.se] --> SETUP[TCP] --> HAPPY-EYEBALLS --> NULL * start connect conn[curl.se] --> SETUP[TCP] --> HAPPY-EYEBALLS --> NULL @@ -276,7 +276,7 @@ The modular design of connection filters and that we can plug them into each oth The `HAPPY-EYEBALLS` on the other hand stays focused on its side of the problem. We can use it also to make other type of connection by just giving it another filter type to try to have happy eyeballing for QUIC: ``` -* create connection for --http3-only https://curl.se +* create connection for --http3-only https://curl.se/ conn[curl.se] --> SETUP[QUIC] --> HAPPY-EYEBALLS --> NULL * start connect conn[curl.se] --> SETUP[QUIC] --> HAPPY-EYEBALLS --> NULL @@ -292,7 +292,7 @@ type that is used for `--http3` when **both** HTTP/3 and HTTP/2 or HTTP/1.1 shall be attempted: ``` -* create connection for --http3 https://curl.se +* create connection for --http3 https://curl.se/ conn[curl.se] --> HTTPS-CONNECT --> NULL * start connect conn[curl.se] --> HTTPS-CONNECT --> NULL diff --git a/docs/tests/TEST-SUITE.md b/docs/tests/TEST-SUITE.md index 527a8599eafd..6a2e60c81759 100644 --- a/docs/tests/TEST-SUITE.md +++ b/docs/tests/TEST-SUITE.md @@ -214,13 +214,13 @@ SPDX-License-Identifier: curl to drown in output. The newly introduced *connection filters* allows one to dynamically increase log verbosity for a particular *filter type*. Example: - CURL_DEBUG=ssl curl -v https://curl.se + CURL_DEBUG=ssl curl -v https://curl.se/ makes the `ssl` connection filter log more details. One may do that for every filter type and also use a combination of names, separated by `,` or space. - CURL_DEBUG=ssl,http/2 curl -v https://curl.se + CURL_DEBUG=ssl,http/2 curl -v https://curl.se/ The order of filter type names is not relevant. Names used here are case insensitive. Note that these names are implementation internals and diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index e0597cdcca92..45a50674f50b 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -62,7 +62,7 @@ static Curl_recv rtmp_recv; static Curl_send rtmp_send; /* - * RTMP protocol handler.h, based on https://rtmpdump.mplayerhq.hu + * RTMP protocol handler.h, based on https://rtmpdump.mplayerhq.hu/ */ const struct Curl_handler Curl_handler_rtmp = { diff --git a/packages/vms/curl_gnv_build_steps.txt b/packages/vms/curl_gnv_build_steps.txt index 0c30924998ea..c84431f7faee 100644 --- a/packages/vms/curl_gnv_build_steps.txt +++ b/packages/vms/curl_gnv_build_steps.txt @@ -38,7 +38,7 @@ time that this document was written. [gnv.common_src]curl_*_original_src.bck is the original source of the curl kit as provided by the curl project. [gnv.vms_src]curl-*_vms_src.bck, if present, has the OpenVMS specific files that are used for building that are not yet in -the curl source kits for that release distributed https://curl.se +the curl source kits for that release distributed https://curl.se/ These backup savesets should be restored to different directory trees on an ODS-5 volume(s) which are referenced by concealed rooted logical names. diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index 446cb9f1dd6e..f50d77527a29 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -71,14 +71,12 @@ my %whitelist = ( 'https://curl.se/rfc/rfc2255.txt' => 1, 'https://curl.se/sponsors.html' => 1, 'https://curl.se/support.html' => 1, - 'https://curl.se/windows' => 1, 'https://curl.se/windows/' => 1, 'https://testclutch.curl.se/' => 1, 'https://github.com/curl/curl-fuzzer' => 1, 'https://github.com/curl/curl-www' => 1, - 'https://github.com/curl/curl.git' => 1, 'https://github.com/curl/curl/wcurl' => 1, ); @@ -87,7 +85,7 @@ my %url; my %flink; # list all files to scan for links -my @files=`git ls-files docs src lib scripts`; +my @files=`git ls-files docs include lib scripts src`; sub storelink { my ($f, $line, $link) = @_; @@ -103,6 +101,7 @@ sub storelink { if($link =~ /^(https|http):/) { if($whitelist{$link}) { #print "-- whitelisted: $link\n"; + $whitelist{$link}++; } # example.com is just example elsif($link =~ /^https:\/\/(.*)example.(com|org|net)/) { @@ -164,7 +163,7 @@ sub findlinks { # comma, question mark, colon, closing parenthesis, backslash, # closing angle bracket, whitespace, pipe, backtick, semicolon elsif(/(https:\/\/[a-z0-9.\/:%_+@-]+[^."'*\#,?:\)> \t|`;\\])/i) { - #print "RAW "; + #print "RAW '$_'\n"; storelink($f, $line, $1); } $line++; @@ -202,10 +201,16 @@ for my $f (@files) { } } -#for my $u (sort keys %url) { -# print "$u\n"; -#} -#exit; +for my $u (sort keys %whitelist) { + if($whitelist{$u} == 1) { + printf "warning: unused whitelist entry: '$u'\n"; + } +} + +for my $u (sort keys %url) { + print "$u\n"; +} +exit; my $error; my @errlist; From 6532398af4b0bbde31d7b25a8896beaf143fa86a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 01:51:54 +0000 Subject: [PATCH 738/885] GHA: update dependencies and actions - update dependency awslabs/aws-lc to v1.65.1 - update dependency pizlonator/fil-c to v0.676 - update github/codeql-action action to v4.31.7 Closes #19905 Closes #19912 Closes #19913 --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9ee723cf73ec..32220298077e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -50,13 +50,13 @@ jobs: persist-credentials: false - name: 'initialize' - uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7 with: languages: actions, python queries: security-extended - name: 'perform analysis' - uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7 c: if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }} @@ -87,7 +87,7 @@ jobs: persist-credentials: false - name: 'initialize' - uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7 with: languages: cpp build-mode: manual @@ -131,4 +131,4 @@ jobs: fi - name: 'perform analysis' - uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7 diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 77fd1edc09aa..86c9f3459d7c 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -43,7 +43,7 @@ env: # renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com LIBRESSL_VERSION: 4.2.1 # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com - AWSLC_VERSION: 1.63.0 + AWSLC_VERSION: 1.65.1 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251124.0 # renovate: datasource=github-tags depName=gnutls/nettle versioning=semver registryUrl=https://github.com diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 27ad6b739331..2bcdf4e223ba 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,7 +46,7 @@ env: # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver:^3.0.0 registryUrl=https://github.com MBEDTLS_VERSION_PREV: 3.6.4 # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com - AWSLC_VERSION: 1.63.0 + AWSLC_VERSION: 1.65.1 # renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com BORINGSSL_VERSION: 0.20251124.0 # handled in renovate.json @@ -58,7 +58,7 @@ env: # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com NGHTTP2_VERSION: 1.68.0 # renovate: datasource=github-tags depName=pizlonator/fil-c versioning=semver-coerced registryUrl=https://github.com - FIL_C_VERSION: 0.675 + FIL_C_VERSION: 0.676 jobs: linux: From b11b67c96fe2b027c6985f7071b33b5a2d36b65e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2025 09:29:43 +0100 Subject: [PATCH 739/885] test318: tweak the name a little to make it properly differ from test 317 --- tests/data/test318 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test318 b/tests/data/test318 index 990b6371a011..8d42d0c68112 100644 --- a/tests/data/test318 +++ b/tests/data/test318 @@ -62,7 +62,7 @@ contents http -HTTP with custom Authorization: and redirect to new host +HTTP with custom Authorization: then trusted redirect to new host http://first.host.it.is/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT -H "Authorization: s3cr3t" --proxy-user testing:this --location-trusted From 2180d7b4bc126b1920eab139f9ca0b253e7c02f0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2025 09:19:32 +0100 Subject: [PATCH 740/885] CURLOPT_FOLLOWLOCATION.md: s/Authentication:/Authorization:/ Closes #19915 --- docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md b/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md index f3e3b99bd3aa..f67f85c6f2f4 100644 --- a/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md +++ b/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md @@ -63,7 +63,7 @@ or just lacks features, it is easy to instead implement your own redirect follow logic with the use of curl_easy_getinfo(3)'s CURLINFO_REDIRECT_URL(3) option instead of using CURLOPT_FOLLOWLOCATION(3). -By default, libcurl only sends `Authentication:` or explicitly set `Cookie:` +By default, libcurl only sends `Authorization:` or explicitly set `Cookie:` headers to the initial host given in the original URL, to avoid leaking username + password to other sites. CURLOPT_UNRESTRICTED_AUTH(3) is provided to change that behavior. From 26d766596e12e0ca9b00422789a8b6afbc0c7fe8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2025 08:45:34 +0100 Subject: [PATCH 741/885] mdlinkcheck: add --dry-run to only show all found URLs - remove the debug tracing leftovers from d9d2e339ced3fa02 that made exit unconditonally Closes #19914 --- scripts/mdlinkcheck | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index f50d77527a29..bd54d96fe2ea 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -84,6 +84,12 @@ my %whitelist = ( my %url; my %flink; +my $dry; +if(defined $ARGV[0] && $ARGV[0] eq "--dry-run") { + $dry = 1; + shift @ARGV; +} + # list all files to scan for links my @files=`git ls-files docs include lib scripts src`; @@ -207,10 +213,12 @@ for my $u (sort keys %whitelist) { } } -for my $u (sort keys %url) { - print "$u\n"; +if($dry) { + for my $u (sort keys %url) { + print "$u\n"; + } + exit; } -exit; my $error; my @errlist; From 0b96f7573f18fd1fbc6317e0ef232d20a40cc874 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 11:47:40 +0100 Subject: [PATCH 742/885] GHA/checkurls: add dry run on push To verify if the basics work. Downside is that the scheduled (live) runs are intermixed with the dry runs and less obvious to find in the default list: https://github.com/curl/curl/actions/workflows/checkurls.yml This URL filters for scheduled runs only: https://github.com/curl/curl/actions/workflows/checkurls.yml?query=event%3Aschedule Seems fine, because we're only interested in red runs. Closes #19917 --- .github/workflows/checkurls.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkurls.yml b/.github/workflows/checkurls.yml index f407859c75fd..b9d5f185d485 100644 --- a/.github/workflows/checkurls.yml +++ b/.github/workflows/checkurls.yml @@ -5,6 +5,13 @@ name: 'URLs' 'on': + push: + branches: + - master + - '*/ci' + pull_request: + branches: + - master schedule: - cron: '10 5 * * *' @@ -16,7 +23,7 @@ permissions: {} jobs: linkcheck: - if: ${{ github.repository_owner == 'curl' }} + if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }} name: 'linkcheck' runs-on: ubuntu-latest steps: @@ -24,5 +31,10 @@ jobs: with: persist-credentials: false + - name: 'mdlinkcheck (dry run)' + if: ${{ github.event_name != 'schedule' }} + run: ./scripts/mdlinkcheck --dry-run + - name: 'mdlinkcheck' + if: ${{ github.event_name == 'schedule' }} run: ./scripts/mdlinkcheck From 14478429e71ef0eee6d12b73113e9ff8e3ae9e75 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 10 Dec 2025 11:17:49 +0100 Subject: [PATCH 743/885] pytest: quiche flakiness Let nghttpx only use http/1.1 to backend. This reproduces the bug in quiche with higher frequency. Allow test_14_05 to now return a 400 in addition to the 431 we get from a h2 backend to nghttpx. Skip test_05_02 in h3 on quiche not newer than version 0.24.4 in which its bug is fixed: https://github.com/cloudflare/quiche/pull/2278 Ref: https://github.com/cloudflare/quiche/issues/2277 Closes #19770 (original Issue) Closes #19916 --- tests/http/test_05_errors.py | 3 +++ tests/http/test_14_auth.py | 5 +++-- tests/http/testenv/nghttpx.py | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/http/test_05_errors.py b/tests/http/test_05_errors.py index 102b92e20256..5fada1500593 100644 --- a/tests/http/test_05_errors.py +++ b/tests/http/test_05_errors.py @@ -60,6 +60,9 @@ def test_05_01_partial_1(self, env: Env, httpd, nghttpx, proto): def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("openssl-quic is flaky in yielding proper error codes") + if proto == 'h3' and env.curl_uses_lib('quiche') and \ + not env.curl_lib_version_at_least('quiche', '0.24.5'): + pytest.skip("quiche issue #2277 not fixed") count = 20 curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, proto)}' \ diff --git a/tests/http/test_14_auth.py b/tests/http/test_14_auth.py index 0187c76a6a70..9f2ae7a27f0f 100644 --- a/tests/http/test_14_auth.py +++ b/tests/http/test_14_auth.py @@ -107,8 +107,9 @@ def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto): '--basic', '--user', f'test:{password}', '--trace-config', 'http/2,http/3' ]) - # but apache denies on length limit - r.check_response(http_status=431) + # but apache either denies on length limit or gives a 400 + r.check_exit_code(0) + assert r.stats[0]['http_code'] in [400, 431] # PUT data, basic auth with very large pw @pytest.mark.parametrize("proto", Env.http_mplx_protos()) diff --git a/tests/http/testenv/nghttpx.py b/tests/http/testenv/nghttpx.py index 106766fc0fe7..950d567f24b8 100644 --- a/tests/http/testenv/nghttpx.py +++ b/tests/http/testenv/nghttpx.py @@ -247,7 +247,6 @@ def start(self, wait_live=True): '--frontend-quic-early-data', ]) args.extend([ - f'--backend=127.0.0.1,{self.env.https_port};{self._domain};sni={self._domain};proto=h2;tls', f'--backend=127.0.0.1,{self.env.http_port}', '--log-level=ERROR', f'--pid-file={self._pid_file}', From 0295c9401d5bfe8bd490c3f14fecda54c6032fce Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 15:37:44 +0100 Subject: [PATCH 744/885] ldap: drop PP logic for old, unsupported, Windows SDKs `LDAP_VENDOR_NAME` and `winber.h` are available in all supported MS SDK and mingw-w64 versions. Stop checking for them. Also drop redundant parenthesis in PP expression. Closes #19918 --- lib/ldap.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/ldap.c b/lib/ldap.c index ba9620b4b185..b51aab56fb44 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -64,19 +64,14 @@ # pragma warning(pop) # endif # include -# ifndef LDAP_VENDOR_NAME -# error Your Platform SDK is NOT sufficient for LDAP support! \ - Update your Platform SDK, or disable LDAP support! -# else -# include -# endif +# include #else # define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */ # ifdef HAVE_LBER_H # include # endif # include -# if (defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H)) +# if defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H) # include # endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */ #endif From edbbcbb1273d513b0a484c7a28df000c41148ddd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 15:48:31 +0100 Subject: [PATCH 745/885] config-win32.h: drop unused/obsolete `CURL_HAS_OPENLDAP_LDAPSDK` Meant for use from `Makefile.mk`. The suggested replacement is CMake or autotools. Follow-up to ba8752e5566076acc8bdec7ae4ec78901f7050f4 #12224 Closes #19920 --- lib/config-win32.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/config-win32.h b/lib/config-win32.h index 2bdb555084cf..002782c6ea9e 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -353,10 +353,7 @@ /* LDAP SUPPORT */ /* ---------------------------------------------------------------- */ -#ifdef CURL_HAS_OPENLDAP_LDAPSDK -#undef USE_WIN32_LDAP -#define HAVE_LDAP_URL_PARSE 1 -#elif !defined(CURL_WINDOWS_UWP) +#ifndef CURL_WINDOWS_UWP #undef HAVE_LDAP_URL_PARSE #define HAVE_LDAP_SSL 1 #define USE_WIN32_LDAP 1 From a73040ac8abb979d50e5c13306dee8adcf8f33a8 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 10 Dec 2025 16:07:59 +0100 Subject: [PATCH 746/885] quiche: fix version for skip due to flakiness 0.24.6 is the quiche version without the fix for proper handling fo RESET streams. Require a verion higher than that to run test_05_02. Follow-up to 14478429e71ef0eee6d12b73113e9ff8e3ae9e75 #19916 Closes #19921 --- tests/http/test_05_errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/http/test_05_errors.py b/tests/http/test_05_errors.py index 5fada1500593..89a8acdebef3 100644 --- a/tests/http/test_05_errors.py +++ b/tests/http/test_05_errors.py @@ -61,7 +61,7 @@ def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("openssl-quic is flaky in yielding proper error codes") if proto == 'h3' and env.curl_uses_lib('quiche') and \ - not env.curl_lib_version_at_least('quiche', '0.24.5'): + not env.curl_lib_version_at_least('quiche', '0.24.7'): pytest.skip("quiche issue #2277 not fixed") count = 20 curl = CurlClient(env=env) From cc285649dc95b73eef5d498d93d0cdcc75b1e5c7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 18:45:06 +0100 Subject: [PATCH 747/885] autotools: fix LargeFile feature display on Windows (after prev patch) Always show it on Windows, regardless of the `--disable-largefile` build option. Follow-up to 163705db756557e6c07ac9386663f0576ebfd64e #19888 Closes #19922 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 64fa6516ec8f..40d4fc29fe4e 100644 --- a/configure.ac +++ b/configure.ac @@ -5317,7 +5317,7 @@ fi if test ${ac_cv_sizeof_curl_off_t} -gt 4; then if test ${ac_cv_sizeof_off_t} -gt 4 -o \ - "$curl_win32_file_api" = "win32_large_files"; then + "$curl_cv_native_windows" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile" fi fi From 8db0e286b363ad788d6dc0779d605b83c7ed4caf Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 5 Aug 2025 16:07:21 +0200 Subject: [PATCH 748/885] autotools: tidy-up `if` expressions - drop x-hacks for curl internal variables and certain autotools ones that do not hold custom values. - make x-hacks consistently use `"x$var" = "xval"` style. - add a few x-hacks for input/external variables that may hold custom values. - prefer `-z` and `-n` to test empty/non-empty. This also makes some x-hacks unnecessary. - optimized negated test `-z` and `-n` options. - prefer `&&` and `||` over `-a` and `-o`. For better POSIX compatibility: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html - quote variables passed to `test`, where missing. - quote string literals in comparisons. - fix some indentation, whitespace. Note that a few `case` statements also use the x-hack, which looks unnecessary. This patch does not change them. Verified by comparing feature detection results with a reference CI run from before this patch (PR #19922). Refs: https://www.shellcheck.net/wiki/SC2268 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html https://www.vidarholen.net/contents/blog/?p=1035 https://mywiki.wooledge.org/BashPitfalls#A.5B_.24foo_.3D_.22bar.22_.5D Closes #18189 --- acinclude.m4 | 52 ++-- configure.ac | 618 +++++++++++++++++++------------------- curl-config.in | 2 +- docs/libcurl/libcurl.m4 | 30 +- m4/curl-amissl.m4 | 4 +- m4/curl-apple-sectrust.m4 | 6 +- m4/curl-compilers.m4 | 35 +-- m4/curl-confopts.m4 | 18 +- m4/curl-functions.m4 | 24 +- m4/curl-gnutls.m4 | 18 +- m4/curl-mbedtls.m4 | 18 +- m4/curl-openssl.m4 | 28 +- m4/curl-rustls.m4 | 18 +- m4/curl-schannel.m4 | 8 +- m4/curl-sysconfig.m4 | 2 +- m4/curl-wolfssl.m4 | 20 +- m4/xc-lt-iface.m4 | 26 +- m4/xc-val-flgs.m4 | 24 +- m4/zz40-xc-ovr.m4 | 4 +- 19 files changed, 478 insertions(+), 477 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 0627ed1fd7e5..d95cbd3f5b6d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -190,7 +190,7 @@ AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [ curl_cv_native_windows="no" ]) ]) - AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$curl_cv_native_windows" = xyes) + AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "$curl_cv_native_windows" = "yes") ]) @@ -910,7 +910,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ curl_func_clock_gettime="yes" ;; *) - if test "x$dontwant_rt" = "xyes" ; then + if test "$dontwant_rt" = "yes"; then AC_MSG_WARN([needs -lrt but asked not to use it, HAVE_CLOCK_GETTIME_MONOTONIC will not be defined]) curl_func_clock_gettime="no" else @@ -926,7 +926,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ esac # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$curl_func_clock_gettime" = "yes"; then AC_MSG_CHECKING([if monotonic clock_gettime works]) CURL_RUN_IFELSE([ @@ -1082,7 +1082,7 @@ dnl macro. It must also run AFTER all lib-checking macros are complete. AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [ dnl this test is of course not sensible if we are cross-compiling! - if test "x$cross_compiling" != xyes; then + if test "$cross_compiling" != "yes"; then dnl just run a program to verify that the libs checked for previous to this dnl point also is available runtime! @@ -1149,22 +1149,22 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]), capath_warning=" (warning: certs not found)" check_capath="" - if test "x$APPLE_SECTRUST_ENABLED" = "x1"; then + if test "$APPLE_SECTRUST_ENABLED" = "1"; then ca_native="Apple SecTrust" else ca_native="no" fi - if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \ - "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then + if test "x$want_ca" != "xno" && test "x$want_ca" != "xunset" && + test "x$want_capath" != "xno" && test "x$want_capath" != "xunset"; then dnl both given ca="$want_ca" capath="$want_capath" - elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then + elif test "x$want_ca" != "xno" && test "x$want_ca" != "xunset"; then dnl --with-ca-bundle given ca="$want_ca" capath="no" - elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then + elif test "x$want_capath" != "xno" && test "x$want_capath" != "xunset"; then dnl --with-ca-path given capath="$want_capath" ca="no" @@ -1177,15 +1177,15 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]), dnl Both auto-detections can be skipped by --without-ca-* ca="no" capath="no" - if test "x$cross_compiling" != "xyes" -a \ - "x$curl_cv_native_windows" != "xyes"; then + if test "$cross_compiling" != "yes" && + test "$curl_cv_native_windows" != "yes"; then dnl NOT cross-compiling and... dnl neither of the --with-ca-* options are provided if test "x$want_ca" = "xunset"; then dnl the path we previously would have installed the curl CA bundle dnl to, and thus we now check for an already existing cert in that dnl place in case we find no other - if test "x$prefix" != xNONE; then + if test "x$prefix" != "xNONE"; then cac="${prefix}/share/curl/curl-ca-bundle.crt" else cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt" @@ -1221,7 +1221,7 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]), check_capath="$capath" fi - if test ! -z "$check_capath"; then + if test -n "$check_capath"; then for a in "$check_capath"; do if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then if test "x$capath" = "xno"; then @@ -1257,14 +1257,14 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]), AS_HELP_STRING([--with-ca-fallback], [Use OpenSSL's built-in CA store]) AS_HELP_STRING([--without-ca-fallback], [Do not use OpenSSL's built-in CA store]), [ - if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then + if test "x$with_ca_fallback" != "xyes" && test "x$with_ca_fallback" != "xno"; then AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter]) fi ], [ with_ca_fallback="no"]) AC_MSG_RESULT([$with_ca_fallback]) if test "x$with_ca_fallback" = "xyes"; then - if test "x$OPENSSL_ENABLED" != "x1"; then + if test "$OPENSSL_ENABLED" != "1"; then AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL]) fi AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use OpenSSL's built-in CA store]) @@ -1293,7 +1293,7 @@ AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the cu [ want_ca_embed="unset" ]) CURL_CA_EMBED='' - if test "x$want_ca_embed" != "xno" -a "x$want_ca_embed" != "xunset" -a -f "$want_ca_embed"; then + if test "x$want_ca_embed" != "xno" && test "x$want_ca_embed" != "xunset" && test -f "$want_ca_embed"; then if test -n "$PERL"; then CURL_CA_EMBED="$want_ca_embed" AC_SUBST(CURL_CA_EMBED) @@ -1315,7 +1315,7 @@ AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl AC_MSG_CHECKING([whether build target supports Win32 crypto API]) curl_win32_crypto_api="no" - if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then + if test "$curl_cv_native_windows" = "yes" && test "$curl_cv_winuwp" != "yes"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline @@ -1382,7 +1382,7 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [ [$PATH:/usr/bin:/usr/local/bin]) fi - if test "x$PKGCONFIG" != "xno"; then + if test "$PKGCONFIG" != "no"; then AC_MSG_CHECKING([for $1 options with pkg-config]) dnl ask pkg-config about $1 itexists=`CURL_EXPORT_PCDIR([$2]) dnl @@ -1423,7 +1423,7 @@ dnl Save build info for test runner to pick up and log AC_DEFUN([CURL_PREPARE_BUILDINFO], [ curl_pflags="" - if test "$curl_cv_apple" = 'yes'; then + if test "$curl_cv_apple" = "yes"; then curl_pflags="${curl_pflags} APPLE" fi case $host in @@ -1443,20 +1443,20 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [ fi ;; esac - if test "$curl_cv_native_windows" = 'yes'; then + if test "$curl_cv_native_windows" = "yes"; then curl_pflags="${curl_pflags} WIN32" fi - if test "$curl_cv_winuwp" = 'yes'; then + if test "$curl_cv_winuwp" = "yes"; then curl_pflags="${curl_pflags} UWP" fi - if test "$curl_cv_cygwin" = 'yes'; then + if test "$curl_cv_cygwin" = "yes"; then curl_pflags="${curl_pflags} CYGWIN" fi case $host_os in msdos*) curl_pflags="${curl_pflags} DOS";; amiga*) curl_pflags="${curl_pflags} AMIGA";; esac - if test "x$compiler_id" = 'xGNU_C'; then + if test "$compiler_id" = "GNU_C"; then curl_pflags="${curl_pflags} GCC" fi if test "$compiler_id" = "APPLECLANG"; then @@ -1467,7 +1467,7 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [ case $host_os in mingw*) curl_pflags="${curl_pflags} MINGW";; esac - if test "x$cross_compiling" = 'xyes'; then + if test "$cross_compiling" = "yes"; then curl_pflags="${curl_pflags} CROSS" fi squeeze curl_pflags @@ -1509,7 +1509,7 @@ TEST EINVAL TEST AC_MSG_RESULT([$cpp]) dnl we need cpp -P so check if it works then - if test "x$cpp" = "xyes"; then + if test "$cpp" = "yes"; then AC_MSG_CHECKING([if cpp -P works]) OLDCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -P" @@ -1519,7 +1519,7 @@ TEST EINVAL TEST ], [cpp_p=yes], [cpp_p=no]) AC_MSG_RESULT([$cpp_p]) - if test "x$cpp_p" = "xno"; then + if test "$cpp_p" = "no"; then AC_MSG_WARN([failed to figure out cpp -P alternative]) # without -P CPPPFLAG="" diff --git a/configure.ac b/configure.ac index 40d4fc29fe4e..3c0bfaa3531f 100644 --- a/configure.ac +++ b/configure.ac @@ -44,12 +44,12 @@ AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) CURL_CHECK_OPTION_DEBUG -AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes) +AM_CONDITIONAL(DEBUGBUILD, test "$want_debug" = "yes") CURL_CHECK_OPTION_OPTIMIZE CURL_CHECK_OPTION_WARNINGS CURL_CHECK_OPTION_WERROR CURL_CHECK_OPTION_CURLDEBUG -AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) +AM_CONDITIONAL(CURLDEBUG, test "$want_curldebug" = "yes") CURL_CHECK_OPTION_SYMBOL_HIDING CURL_CHECK_OPTION_ARES CURL_CHECK_OPTION_RT @@ -225,7 +225,7 @@ AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl]) AS_HELP_STRING([--without-ssl], [build without any TLS library]),[ OPT_SSL=$withval OPT_OPENSSL=$withval - if test X"$withval" != Xno; then + if test "x$withval" != "xno"; then TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" else SSL_DISABLED="D" @@ -235,7 +235,7 @@ AS_HELP_STRING([--without-ssl], [build without any TLS library]),[ AC_ARG_WITH(openssl,dnl AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),[ OPT_OPENSSL=$withval - if test X"$withval" != Xno; then + if test "x$withval" != "xno"; then TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" fi ]) @@ -244,7 +244,7 @@ OPT_GNUTLS=no AC_ARG_WITH(gnutls,dnl AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[ OPT_GNUTLS=$withval - if test X"$withval" != Xno; then + if test "x$withval" != "xno"; then TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS" fi ]) @@ -253,7 +253,7 @@ OPT_MBEDTLS=no AC_ARG_WITH(mbedtls,dnl AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[ OPT_MBEDTLS=$withval - if test X"$withval" != Xno; then + if test "x$withval" != "xno"; then TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS" fi ]) @@ -262,7 +262,7 @@ OPT_WOLFSSL=no AC_ARG_WITH(wolfssl,dnl AS_HELP_STRING([--with-wolfssl=PATH],[where to look for wolfSSL, PATH points to the installation root (default: system lib default)]),[ OPT_WOLFSSL=$withval - if test X"$withval" != Xno; then + if test "x$withval" != "xno"; then TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL" fi ]) @@ -271,7 +271,7 @@ OPT_RUSTLS=no AC_ARG_WITH(rustls,dnl AS_HELP_STRING([--with-rustls=PATH],[where to look for Rustls, PATH points to the installation root]),[ OPT_RUSTLS=$withval - if test X"$withval" != Xno; then + if test "x$withval" != "xno"; then TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Rustls" experimental="$experimental Rustls" fi @@ -291,7 +291,7 @@ TEST_NGHTTPX=nghttpx AC_ARG_WITH(test-nghttpx,dnl AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]), TEST_NGHTTPX=$withval - if test X"$TEST_NGHTTPX" = "Xno"; then + if test "x$TEST_NGHTTPX" = "xno"; then TEST_NGHTTPX="" fi ) @@ -307,7 +307,7 @@ fi AC_ARG_WITH(test-caddy,dnl AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]), CADDY=$withval - if test X"$CADDY" = "Xno"; then + if test "x$CADDY" = "xno"; then CADDY="" fi ) @@ -323,7 +323,7 @@ fi AC_ARG_WITH(test-vsftpd,dnl AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]), VSFTPD=$withval - if test X"$VSFTPD" = "Xno"; then + if test "x$VSFTPD" = "xno"; then VSFTPD="" fi ) @@ -335,31 +335,31 @@ HTTPD_ENABLED="maybe" AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH], [where to find httpd/apache2 for testing])], [request_httpd=$withval], [request_httpd=check]) -if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then +if test "x$request_httpd" = "xcheck" || test "x$request_httpd" = "xyes"; then if test -x "/usr/sbin/apache2"; then # common location on distros (debian/ubuntu) HTTPD="/usr/sbin/apache2" AC_PATH_PROG([APXS], [apxs]) - if test "x$APXS" = "x"; then + if test -z "$APXS"; then AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled]) HTTPD_ENABLED="no" fi else AC_PATH_PROG([HTTPD], [httpd]) - if test "x$HTTPD" = "x"; then + if test -z "$HTTPD"; then AC_PATH_PROG([HTTPD], [apache2]) fi AC_PATH_PROG([APXS], [apxs]) - if test "x$HTTPD" = "x"; then + if test -z "$HTTPD"; then AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled]) HTTPD_ENABLED="no" fi - if test "x$APXS" = "x"; then + if test -z "$APXS"; then AC_MSG_NOTICE([apxs not in PATH, http tests disabled]) HTTPD_ENABLED="no" fi fi -elif test x"$request_httpd" != "xno"; then +elif test "x$request_httpd" != "xno"; then HTTPD="${request_httpd}/bin/httpd" APXS="${request_httpd}/bin/apxs" if test ! -x "${HTTPD}"; then @@ -372,7 +372,7 @@ elif test x"$request_httpd" != "xno"; then AC_MSG_NOTICE([using HTTPD=$HTTPD for tests]) fi fi -if test x"$HTTPD_ENABLED" = "xno"; then +if test "$HTTPD_ENABLED" = "no"; then HTTPD="" APXS="" fi @@ -385,17 +385,17 @@ DANTED_ENABLED="maybe" AC_ARG_WITH(test-danted, [AS_HELP_STRING([--with-test-danted=PATH], [where to find danted socks daemon for testing])], [request_danted=$withval], [request_danted=check]) -if test x"$request_danted" = "xcheck" -o x"$request_danted" = "xyes"; then +if test "x$request_danted" = "xcheck" || test "x$request_danted" = "xyes"; then if test -x "/usr/sbin/danted"; then # common location on distros (debian/ubuntu) DANTED="/usr/sbin/danted" else AC_PATH_PROG([DANTED], [danted]) - if test "x$DANTED" = "x"; then + if test -z "$DANTED"; then AC_PATH_PROG([DANTED], [danted]) fi fi -elif test x"$request_danted" != "xno"; then +elif test "x$request_danted" != "xno"; then DANTED="${request_danted}" if test ! -x "${DANTED}"; then AC_MSG_NOTICE([danted not found as ${DANTED}, danted tests disabled]) @@ -404,13 +404,13 @@ elif test x"$request_danted" != "xno"; then AC_MSG_NOTICE([using DANTED=$DANTED for tests]) fi fi -if test x"$DANTED_ENABLED" = "xno"; then +if test "$DANTED_ENABLED" = "no"; then DANTED="" fi AC_SUBST(DANTED) dnl the nghttpx we might use in httpd testing -if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then +if test -n "$TEST_NGHTTPX" && test "x$TEST_NGHTTPX" != "xnghttpx"; then HTTPD_NGHTTPX="$TEST_NGHTTPX" else AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [], @@ -419,7 +419,7 @@ fi AC_SUBST(HTTPD_NGHTTPX) dnl the Caddy server we might use in testing -if test "x$TEST_CADDY" != "x"; then +if test -n "$TEST_CADDY"; then CADDY="$TEST_CADDY" else AC_PATH_PROG([CADDY], [caddy]) @@ -480,11 +480,11 @@ AM_CONDITIONAL(NOT_CURL_CI, test -z "$CURL_CI") # AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO], - [test "x$xc_lt_shlib_use_version_info" = 'xyes']) + [test "$xc_lt_shlib_use_version_info" = "yes"]) AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED], - [test "x$xc_lt_shlib_use_no_undefined" = 'xyes']) + [test "$xc_lt_shlib_use_no_undefined" = "yes"]) AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT], - [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes']) + [test "$xc_lt_shlib_use_mimpure_text" = "yes"]) # # Due to libtool and automake machinery limitations of not allowing @@ -503,7 +503,7 @@ AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT], # AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB], - [test "x$xc_lt_build_static_only" = 'xyes']) + [test "$xc_lt_build_static_only" = "yes"]) # # Make staticlib CPPFLAG variable and its definition visible in output @@ -515,7 +515,7 @@ LIBCURL_PC_CFLAGS_PRIVATE='-DCURL_STATICLIB' AC_SUBST(LIBCURL_PC_CFLAGS_PRIVATE) LIBCURL_PC_CFLAGS= -if test "x$xc_lt_build_static_only" = 'xyes'; then +if test "$xc_lt_build_static_only" = "yes"; then LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}" fi AC_SUBST([LIBCURL_PC_CFLAGS]) @@ -555,7 +555,7 @@ if test "$compiler_id" = "INTEL_UNIX_C"; then fi CURL_CFLAG_EXTRAS="" -if test X"$want_werror" = Xyes; then +if test "$want_werror" = "yes"; then CURL_CFLAG_EXTRAS="-Werror" if test "$compiler_id" = "GNU_C"; then dnl enable -pedantic-errors for GCC 5 and later, @@ -563,12 +563,12 @@ if test X"$want_werror" = Xyes; then if test "$compiler_num" -ge "500"; then CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" fi - elif test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then + elif test "$compiler_id" = "CLANG" || test "$compiler_id" = "APPLECLANG"; then CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" fi fi AC_SUBST(CURL_CFLAG_EXTRAS) -AM_CONDITIONAL(CURL_WERROR, test X"$want_werror" = Xyes) +AM_CONDITIONAL(CURL_WERROR, test "$want_werror" = "yes") CURL_CHECK_COMPILER_HALT_ON_ERROR CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE @@ -579,8 +579,8 @@ supports_unittests=yes # cross-compilation of unit tests static library/programs fails when # libcurl shared library is built. This might be due to a libtool or # automake issue. In this case we disable unit tests. -if test "x$cross_compiling" != "xno" && - test "x$enable_shared" != "xno"; then +if test "$cross_compiling" != "no" && + test "$enable_shared" != "no"; then supports_unittests=no fi @@ -604,7 +604,7 @@ case $host_os in ;; esac -AM_CONDITIONAL(BUILD_UNITTESTS, test x$supports_unittests = xyes) +AM_CONDITIONAL(BUILD_UNITTESTS, test "$supports_unittests" = "yes") # In order to detect support of sendmmsg() and accept4(), we need to escape the POSIX # jail by defining _GNU_SOURCE or will not expose it. @@ -625,7 +625,7 @@ case $host in *-apple-*) curl_cv_apple='yes';; esac -if test "$curl_cv_apple" = 'yes'; then +if test "$curl_cv_apple" = "yes"; then CURL_DARWIN_CFLAGS CURL_SUPPORTS_BUILTIN_AVAILABLE fi @@ -663,11 +663,11 @@ AS_HELP_STRING([--disable-unity],[Disable unity (default)]), esac ], AC_MSG_RESULT([no]) ) -if test -z "$PERL" -a "$want_unity" = 'yes'; then +if test -z "$PERL" && test "$want_unity" = "yes"; then AC_MSG_WARN([perl was not found. Will not enable unity.]) want_unity='no' fi -AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes']) +AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = "yes"]) dnl ************************************************************ dnl switch off particular protocols @@ -745,7 +745,7 @@ AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]), CURL_DISABLE_IPFS=1 ;; *) - if test x$CURL_DISABLE_HTTP = x1; then + if test "$CURL_DISABLE_HTTP" = "1"; then AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!) else AC_MSG_RESULT(yes) @@ -753,7 +753,7 @@ AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]), fi ;; esac ], - if test "x$CURL_DISABLE_HTTP" != "x1"; then + if test "$CURL_DISABLE_HTTP" != "1"; then AC_MSG_RESULT(yes) curl_ipfs_msg="enabled" else @@ -791,7 +791,7 @@ AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), CURL_DISABLE_LDAPS=1 ;; *) - if test "x$CURL_DISABLE_LDAP" = "x1"; then + if test "$CURL_DISABLE_LDAP" = "1"; then AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) CURL_DISABLE_LDAPS=1 @@ -802,7 +802,7 @@ AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), fi ;; esac ],[ - if test "x$CURL_DISABLE_LDAP" = "x1"; then + if test "$CURL_DISABLE_LDAP" = "1"; then AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) CURL_DISABLE_LDAPS=1 @@ -817,27 +817,27 @@ AC_MSG_CHECKING([whether to support rtsp]) AC_ARG_ENABLE(rtsp, AS_HELP_STRING([--enable-rtsp],[Enable RTSP support]) AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]), - [ case "$enableval" in - no) +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) + CURL_DISABLE_RTSP=1 + ;; + *) + if test "$CURL_DISABLE_HTTP" = "1"; then + AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) + else + AC_MSG_RESULT(yes) + curl_rtsp_msg="enabled" + fi + ;; + esac ], + if test "$CURL_DISABLE_HTTP" != "1"; then + AC_MSG_RESULT(yes) + curl_rtsp_msg="enabled" + else AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) - CURL_DISABLE_RTSP=1 - ;; - *) - if test x$CURL_DISABLE_HTTP = x1; then - AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) - else - AC_MSG_RESULT(yes) - curl_rtsp_msg="enabled" - fi - ;; - esac ], - if test "x$CURL_DISABLE_HTTP" != "x1"; then - AC_MSG_RESULT(yes) - curl_rtsp_msg="enabled" - else - AC_MSG_RESULT(no) - fi + fi ) AC_MSG_CHECKING([whether to support proxies]) @@ -892,7 +892,7 @@ AS_HELP_STRING([--disable-telnet],[Disable TELNET support]), AC_MSG_RESULT(yes) ) -if test "$curl_cv_winuwp" = 'yes'; then +if test "$curl_cv_winuwp" = "yes"; then AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) CURL_DISABLE_TELNET=1 fi @@ -1063,7 +1063,7 @@ AS_HELP_STRING([--disable-docs],[Disable documentation]), AC_MSG_RESULT(yes) BUILD_DOCS=1 ) -if test -z "$PERL" -a "x$BUILD_DOCS" != "x0"; then +if test -z "$PERL" && test "$BUILD_DOCS" != "0"; then AC_MSG_WARN([perl was not found. Will not build documentation.]) BUILD_DOCS=0 fi @@ -1191,14 +1191,14 @@ fi # In UWP mode gethostbyname gets detected via the core libs, but some # code (in6addr_any) still need ws2_32, so let us detect and add it. -if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then +if test "$HAVE_GETHOSTBYNAME" != "1" || test "$curl_cv_winuwp" = "yes"; then if test "$curl_cv_native_windows" = "yes"; then dnl This is for Winsock systems winsock_LIB="-lws2_32" if test "$curl_cv_winuwp" != "yes"; then winsock_LIB="$winsock_LIB -liphlpapi" fi - if test ! -z "$winsock_LIB"; then + if test -n "$winsock_LIB"; then my_ac_save_LIBS=$LIBS LIBS="$winsock_LIB $LIBS" AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) @@ -1261,7 +1261,7 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set; then +if test "$HAVE_GETHOSTBYNAME" != "1" || test "${with_amissl+set}" = "set"; then dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library]) AC_LINK_IFELSE([ @@ -1331,10 +1331,10 @@ AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) AS_HELP_STRING([--without-zlib],[disable use of zlib]), [OPT_ZLIB="$withval"]) -if test "$OPT_ZLIB" = "no"; then +if test "x$OPT_ZLIB" = "xno"; then AC_MSG_WARN([zlib disabled]) else - if test "$OPT_ZLIB" = "yes"; then + if test "x$OPT_ZLIB" = "xyes"; then OPT_ZLIB="" fi @@ -1434,7 +1434,7 @@ else fi dnl set variable for use in automakefile(s) -AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1) +AM_CONDITIONAL(HAVE_LIBZ, test "$AMFIXLIB" = "1") AC_SUBST(ZLIB_LIBS) dnl ********************************************************************** @@ -1450,7 +1450,7 @@ AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to th AS_HELP_STRING([--without-brotli], [disable BROTLI]), OPT_BROTLI=$withval) -if test X"$OPT_BROTLI" != Xno; then +if test "x$OPT_BROTLI" != "xno"; then dnl backup the pre-brotli variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -1509,7 +1509,7 @@ if test X"$OPT_BROTLI" != Xno; then AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use]) ) - if test X"$OPT_BROTLI" != Xoff && + if test "x$OPT_BROTLI" != "xoff" && test "$HAVE_BROTLI" != "1"; then AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!]) fi @@ -1520,7 +1520,7 @@ if test X"$OPT_BROTLI" != Xno; then dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH]) @@ -1547,7 +1547,7 @@ AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the AS_HELP_STRING([--without-zstd], [disable libzstd]), OPT_ZSTD=$withval) -if test X"$OPT_ZSTD" != Xno; then +if test "x$OPT_ZSTD" != "xno"; then dnl backup the pre-zstd variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -1598,7 +1598,7 @@ if test X"$OPT_ZSTD" != Xno; then AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use]) ) - if test X"$OPT_ZSTD" != Xoff && + if test "x$OPT_ZSTD" != "xoff" && test "$HAVE_ZSTD" != "1"; then AC_MSG_ERROR([libzstd was not found where specified!]) fi @@ -1610,7 +1610,7 @@ if test X"$OPT_ZSTD" != Xno; then dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to dnl this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH]) @@ -1674,7 +1674,7 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), ) ) -if test "$ipv6" = yes; then +if test "$ipv6" = "yes"; then curl_ipv6_msg="enabled" AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) IPV6_ENABLED=1 @@ -1732,7 +1732,7 @@ int main(int argc, char **argv) ],[ curl_cv_writable_argv=cross ]) -if test "$curl_cv_writable_argv" = 'cross' -a "$curl_cv_apple" = 'yes'; then +if test "$curl_cv_writable_argv" = "cross" && test "$curl_cv_apple" = "yes"; then curl_cv_writable_argv=yes fi case $curl_cv_writable_argv in @@ -1773,9 +1773,9 @@ AC_ARG_WITH(gssapi-libs, AC_ARG_WITH(gssapi, AS_HELP_STRING([--with-gssapi=DIR], [Where to look for GSS-API]), [ GSSAPI_ROOT="$withval" - if test x"$GSSAPI_ROOT" != xno; then + if test "$GSSAPI_ROOT" != "no"; then want_gss="yes" - if test x"$GSSAPI_ROOT" = xyes; then + if test "$GSSAPI_ROOT" = "yes"; then dnl if yes, then use default root GSSAPI_ROOT="/usr" fi @@ -1787,16 +1787,16 @@ AC_ARG_WITH(gssapi, save_CPPFLAGS="$CPPFLAGS" AC_MSG_CHECKING([if GSS-API support is requested]) -if test x"$want_gss" = xyes; then +if test "$want_gss" = "yes"; then AC_MSG_RESULT(yes) - if test $GSSAPI_ROOT != "/usr"; then + if test "$GSSAPI_ROOT" != "/usr"; then CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) else CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) fi if test -z "$GSSAPI_INCS"; then - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + if test -n "$host_alias" && test -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` elif test "$PKGCONFIG" != "no"; then GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi` @@ -1821,7 +1821,7 @@ if test x"$want_gss" = xyes; then [gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h], [], [not_mit=1]) - if test "x$not_mit" = "x1"; then + if test "$not_mit" = "1"; then dnl MIT not found AC_MSG_ERROR([MIT or GNU GSS library required, but not found]) fi @@ -1830,7 +1830,7 @@ if test x"$want_gss" = xyes; then else AC_MSG_RESULT(no) fi -if test x"$want_gss" = xyes; then +if test "$want_gss" = "yes"; then AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries]) HAVE_GSSAPI=1 curl_gss_msg="enabled (MIT Kerberos)" @@ -1843,15 +1843,15 @@ if test x"$want_gss" = xyes; then LIBS="-lgss $LIBS" link_pkgconfig=1 elif test -z "$GSSAPI_LIB_DIR"; then - if test "$curl_cv_apple" = 'yes'; then + if test "$curl_cv_apple" = "yes"; then LIBS="-lgssapi_krb5 -lresolv $LIBS" else - if test $GSSAPI_ROOT != "/usr"; then + if test "$GSSAPI_ROOT" != "/usr"; then CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) else CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) fi - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + if test -n "$host_alias" && test -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then dnl krb5-config does not have --libs-only-L or similar, put everything dnl into LIBS gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` @@ -1886,7 +1886,7 @@ if test x"$want_gss" = xyes; then fi fi gss_version="" - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + if test -n "$host_alias" && test -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then gss_version=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --version | $SED 's/Kerberos 5 release //'` elif test "$PKGCONFIG" != "no"; then gss_version=`$PKGCONFIG --modversion mit-krb5-gssapi` @@ -1920,7 +1920,7 @@ else CPPFLAGS="$save_CPPFLAGS" fi -if test x"$want_gss" = xyes; then +if test "$want_gss" = "yes"; then AC_MSG_CHECKING([if we can link against GSS-API library]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gss_init_sec_context]) @@ -1933,11 +1933,11 @@ if test x"$want_gss" = xyes; then fi build_libstubgss=no -if test x"$want_gss" = "xyes"; then +if test "$want_gss" = "yes"; then build_libstubgss=yes fi -AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes") +AM_CONDITIONAL(BUILD_STUB_GSS, test "$build_libstubgss" = "yes") dnl ------------------------------------------------------------- dnl parse --with-default-ssl-backend so it can be validated below @@ -1974,12 +1974,12 @@ CURL_WITH_RUSTLS CURL_WITH_APPLE_SECTRUST dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED -if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then +if test "$USE_WIN32_CRYPTO" = "1" || test "$SCHANNEL_ENABLED" = "1"; then LIBS="-ladvapi32 -lcrypt32 $LIBS" fi dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer) -if test "x$curl_cv_native_windows" = "xyes"; then +if test "$curl_cv_native_windows" = "yes"; then LIBS="-lbcrypt $LIBS" fi @@ -2014,13 +2014,13 @@ if test -n "$ssl_backends"; then curl_ssl_msg="enabled ($ssl_backends)" fi -if test no = "$VALID_DEFAULT_SSL_BACKEND"; then +if test "$VALID_DEFAULT_SSL_BACKEND" = "no"; then if test -n "$SSL_ENABLED"; then AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!]) else AC_MSG_ERROR([Default SSL backend requires SSL!]) fi -elif test yes = "$VALID_DEFAULT_SSL_BACKEND"; then +elif test "$VALID_DEFAULT_SSL_BACKEND" = "yes"; then AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend]) fi @@ -2033,7 +2033,7 @@ if test -n "$check_for_ca_bundle"; then CURL_CHECK_CA_EMBED fi -AM_CONDITIONAL(CURL_CA_EMBED_SET, test "x$CURL_CA_EMBED" != "x") +AM_CONDITIONAL(CURL_CA_EMBED_SET, test -n "$CURL_CA_EMBED") dnl ---------------------- dnl check unsafe CA search @@ -2090,7 +2090,7 @@ AS_HELP_STRING([--with-libpsl=PATH],[Where to look for libpsl, PATH points to th AS_HELP_STRING([--without-libpsl], [disable LIBPSL]), OPT_LIBPSL=$withval) -if test X"$OPT_LIBPSL" != Xno; then +if test "x$OPT_LIBPSL" != "xno"; then dnl backup the pre-libpsl variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -2163,7 +2163,7 @@ AS_HELP_STRING([--with-libgsasl=PATH],[Where to look for libgsasl, PATH points t AS_HELP_STRING([--without-libgsasl], [disable libgsasl support for SCRAM]), OPT_LIBGSASL=$withval) -if test "$OPT_LIBGSASL" != no; then +if test "x$OPT_LIBGSASL" != "xno"; then dnl backup the pre-libgsasl variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -2243,7 +2243,7 @@ AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to th AS_HELP_STRING([--with-libssh], [enable libssh]), OPT_LIBSSH=$withval, OPT_LIBSSH=no) -if test X"$OPT_LIBSSH2" != Xno; then +if test "x$OPT_LIBSSH2" != "xno"; then dnl backup the pre-libssh2 variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -2295,7 +2295,7 @@ if test X"$OPT_LIBSSH2" != Xno; then USE_LIBSSH2=1 ) - if test X"$OPT_LIBSSH2" != Xoff && + if test "x$OPT_LIBSSH2" != "xoff" && test "$USE_LIBSSH2" != "1"; then AC_MSG_ERROR([libssh2 libs and/or directories were not found where specified!]) fi @@ -2306,7 +2306,7 @@ if test X"$OPT_LIBSSH2" != Xno; then dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH]) @@ -2320,7 +2320,7 @@ if test X"$OPT_LIBSSH2" != Xno; then CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS fi -elif test X"$OPT_LIBSSH" != Xno; then +elif test "x$OPT_LIBSSH" != "xno"; then dnl backup the pre-libssh variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -2371,7 +2371,7 @@ elif test X"$OPT_LIBSSH" != Xno; then USE_LIBSSH=1 ) - if test X"$OPT_LIBSSH" != Xoff && + if test "x$OPT_LIBSSH" != "xoff" && test "$USE_LIBSSH" != "1"; then AC_MSG_ERROR([libssh libs and/or directories were not found where specified!]) fi @@ -2386,7 +2386,7 @@ elif test X"$OPT_LIBSSH" != Xno; then dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH]) @@ -2456,14 +2456,14 @@ case "$OPT_LDAP" in ;; esac -if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then +if test "$CURL_DISABLE_LDAP" != "1" && test "$want_ldap" != "no"; then CURL_CHECK_HEADER_LBER CURL_CHECK_HEADER_LDAP CURL_CHECK_HEADER_LDAP_SSL if test -z "$LDAPLIBNAME"; then - if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then + if test "$curl_cv_native_windows" = "yes" && test "$curl_cv_winuwp" != "yes"; then dnl Windows uses a single and unique LDAP library name LDAPLIBNAME="wldap32" LBERLIBNAME="no" @@ -2472,7 +2472,7 @@ if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then if test "$LDAPLIBNAME"; then dnl If we have both LDAP and LBER library names, check if we need both - if test "$LBERLIBNAME" -a "$LBERLIBNAME" != "no"; then + if test "$LBERLIBNAME" && test "$LBERLIBNAME" != "no"; then dnl Try LDAP first, then with LBER if needed AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes], [ldap_lib_ok=no]) if test "$ldap_lib_ok" = "no"; then @@ -2527,7 +2527,7 @@ if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then fi fi -if test x$CURL_DISABLE_LDAP != x1; then +if test "$CURL_DISABLE_LDAP" != "1"; then dnl Add to library path if needed if test -n "$DIR_LDAP"; then dnl when the ldap shared lib were found in a path that the runtime @@ -2535,7 +2535,7 @@ if test x$CURL_DISABLE_LDAP != x1; then dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to dnl this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LDAP" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_LDAP to CURL_LIBRARY_PATH]) @@ -2546,7 +2546,7 @@ if test x$CURL_DISABLE_LDAP != x1; then dnl If name is "no" then do not define this library at all dnl (it is only needed if libldap.so's dependencies are broken). dnl Skip this check if we already determined we need both libraries above - if test "$LBERLIBNAME" != "no" -a "$ldap_lib_ok" != "yes"; then + if test "$LBERLIBNAME" != "no" && test "$ldap_lib_ok" != "yes"; then AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) @@ -2563,7 +2563,7 @@ if test x$CURL_DISABLE_LDAP != x1; then fi fi -if test x$CURL_DISABLE_LDAP != x1; then +if test "$CURL_DISABLE_LDAP" != "1"; then AC_CHECK_FUNCS([ldap_url_parse \ ldap_init_fd]) @@ -2571,7 +2571,7 @@ if test x$CURL_DISABLE_LDAP != x1; then curl_ldap_msg="enabled (winldap)" AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation]) else - if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then + if test "$ac_cv_func_ldap_init_fd" = "yes"; then curl_ldap_msg="enabled (OpenLDAP)" AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code]) USE_OPENLDAP=1 @@ -2581,7 +2581,7 @@ if test x$CURL_DISABLE_LDAP != x1; then fi fi -if test x$CURL_DISABLE_LDAPS != x1; then +if test "$CURL_DISABLE_LDAPS" != "1"; then curl_ldaps_msg="enabled" fi @@ -2596,7 +2596,7 @@ AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]), OPT_LIBRTMP=$withval) -if test X"$OPT_LIBRTMP" != Xno; then +if test "x$OPT_LIBRTMP" != "xno"; then dnl backup the pre-librtmp variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -2660,7 +2660,7 @@ if test X"$OPT_LIBRTMP" != Xno; then LIBS=$CLEANLIBS ) - if test X"$OPT_LIBRTMP" != Xoff && + if test "x$OPT_LIBRTMP" != "xoff" && test "$USE_LIBRTMP" != "1"; then AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) fi @@ -2690,17 +2690,17 @@ AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shar AC_MSG_RESULT(yes) if test "x$enableval" != "xyes"; then versioned_symbols_flavour="$enableval" - elif test "x$CURL_WITH_MULTI_SSL" = "x1"; then + elif test "$CURL_WITH_MULTI_SSL" = "1"; then versioned_symbols_flavour="MULTISSL_" - elif test "x$OPENSSL_ENABLED" = "x1"; then + elif test "$OPENSSL_ENABLED" = "1"; then versioned_symbols_flavour="OPENSSL_" - elif test "x$MBEDTLS_ENABLED" = "x1"; then + elif test "$MBEDTLS_ENABLED" = "1"; then versioned_symbols_flavour="MBEDTLS_" - elif test "x$WOLFSSL_ENABLED" = "x1"; then + elif test "$WOLFSSL_ENABLED" = "1"; then versioned_symbols_flavour="WOLFSSL_" - elif test "x$GNUTLS_ENABLED" = "x1"; then + elif test "$GNUTLS_ENABLED" = "1"; then versioned_symbols_flavour="GNUTLS_" - elif test "x$RUSTLS_ENABLED" = "x1"; then + elif test "$RUSTLS_ENABLED" = "1"; then versioned_symbols_flavour="RUSTLS_" else versioned_symbols_flavour="" @@ -2718,7 +2718,7 @@ AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shar AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX], ["$versioned_symbols_flavour"]) AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME], ["4"]) dnl Keep in sync with VERSIONCHANGE - VERSIONDEL in lib/Makefile.soname AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS], - [test "x$versioned_symbols" = 'xyes']) + [test "$versioned_symbols" = "yes"]) dnl ---------------------------- dnl check Windows Unicode option @@ -2726,7 +2726,7 @@ dnl ---------------------------- want_winuni="no" if test "$curl_cv_native_windows" = "yes"; then - if test "$curl_cv_winuwp" = 'yes'; then + if test "$curl_cv_winuwp" = "yes"; then want_winuni="yes" else AC_MSG_CHECKING([whether to enable Windows Unicode (Windows native builds only)]) @@ -2758,7 +2758,7 @@ dnl check WinIDN option before other IDN libraries dnl ------------------------------------------------- tst_links_winidn='no' -if test "$curl_cv_native_windows" = 'yes'; then +if test "$curl_cv_native_windows" = "yes"; then AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) OPT_WINIDN="default" AC_ARG_WITH(winidn, @@ -2848,7 +2848,7 @@ dnl Check for the presence of AppleIDN dnl ********************************************************************** tst_links_appleidn='no' -if test "$curl_cv_apple" = 'yes'; then +if test "$curl_cv_apple" = "yes"; then AC_MSG_CHECKING([whether to build with Apple IDN]) OPT_IDN="default" AC_ARG_WITH(apple-idn, @@ -2887,10 +2887,10 @@ AC_ARG_WITH(libidn2, AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage]) AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]), [OPT_IDN=$withval]) -if test "x$tst_links_winidn" = "xyes"; then +if test "$tst_links_winidn" = "yes"; then want_idn="no" AC_MSG_RESULT([no (using WinIDN instead)]) -elif test "x$tst_links_appleidn" = "xyes"; then +elif test "$tst_links_appleidn" = "yes"; then want_idn="no" AC_MSG_RESULT([no (using AppleIDN instead)]) else @@ -2998,7 +2998,7 @@ if test "$want_idn" = "yes"; then IDN_ENABLED=1 curl_idn_msg="enabled (libidn2)" - if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then + if test -n "$IDN_DIR" && test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH]) @@ -3020,7 +3020,7 @@ dnl ********************************************************************** OPT_H2="yes" -if test "x$disable_http" = "xyes"; then +if test "$disable_http" = "yes"; then # without HTTP nghttp2 is no use OPT_H2="no" fi @@ -3048,7 +3048,7 @@ case "$OPT_H2" in ;; esac -if test X"$want_nghttp2" != Xno; then +if test "$want_nghttp2" != "no"; then dnl backup the pre-nghttp2 variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3071,12 +3071,12 @@ if test X"$want_nghttp2" != Xno; then AC_MSG_NOTICE([-L is $LD_H2]) DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'` - elif test x"$want_nghttp2_path" != x; then + elif test -n "$want_nghttp2_path"; then LIB_H2="-lnghttp2" LD_H2=-L${want_nghttp2_path}/lib$libsuff CPP_H2=-I${want_nghttp2_path}/include DIR_H2=${want_nghttp2_path}/lib$libsuff - elif test X"$want_nghttp2" != Xdefault; then + elif test "$want_nghttp2" != "default"; then dnl no nghttp2 pkg-config found and no custom directory specified, dnl deal with it AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.]) @@ -3118,7 +3118,7 @@ dnl ********************************************************************** OPT_TCP2="no" -if test "x$disable_http" = "xyes"; then +if test "$disable_http" = "yes"; then # without HTTP, ngtcp2 is no use OPT_TCP2="no" fi @@ -3145,7 +3145,7 @@ case "$OPT_TCP2" in esac curl_tcp2_msg="no (--with-ngtcp2)" -if test X"$want_tcp2" != Xno; then +if test "$want_tcp2" != "no"; then if test "$QUIC_ENABLED" != "yes"; then AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no]) @@ -3177,7 +3177,7 @@ if test X"$want_tcp2" != Xno; then CPPFLAGS="$CPPFLAGS $CPP_TCP2" LIBS="$LIB_TCP2 $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned, @@ -3200,7 +3200,7 @@ if test X"$want_tcp2" != Xno; then else dnl no ngtcp2 pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.]) @@ -3208,7 +3208,8 @@ if test X"$want_tcp2" != Xno; then fi fi -if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" = "1"; then +if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" && test "$HAVE_LIBRESSL" = "1"; then + dnl backup the pre-ngtcp2_crypto_libressl variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3235,7 +3236,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_LIBRESSL" LIBS="$LIB_NGTCP2_CRYPTO_LIBRESSL $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGTCP2_CRYPTO_LIBRESSL=`echo $LD_NGTCP2_CRYPTO_LIBRESSL | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2_crypto_libressl, ngtcp2_crypto_recv_client_initial_cb, @@ -3257,7 +3258,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" else dnl no ngtcp2_crypto_libressl pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_WARN([--with-ngtcp2 was specified but could not find ngtcp2_crypto_libressl pkg-config file.]) @@ -3267,8 +3268,9 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" fi fi -if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" != "1" -a \ - "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" != "x1"; then +if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" && test "$OPENSSL_IS_BORINGSSL" != "1" && + test "$OPENSSL_QUIC_API2" != "1"; then + dnl backup the pre-ngtcp2_crypto_quictls variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3295,7 +3297,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2_crypto_quictls, ngtcp2_crypto_recv_client_initial_cb, @@ -3317,7 +3319,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" else dnl no ngtcp2_crypto_quictls pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_quictls pkg-config file.]) @@ -3325,8 +3327,9 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "$HAVE_LIBRESSL" fi fi -if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ - "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" = "x1"; then +if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" && test "$OPENSSL_IS_BORINGSSL" != "1" && + test "$OPENSSL_QUIC_API2" = "1"; then + dnl backup the pre-ngtcp2_crypto_ossl variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3353,7 +3356,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OSSL" LIBS="$LIB_NGTCP2_CRYPTO_OSSL $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGTCP2_CRYPTO_OSSL=`echo $LD_NGTCP2_CRYPTO_OSSL | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2_crypto_ossl, ngtcp2_crypto_recv_client_initial_cb, @@ -3376,7 +3379,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ else dnl no ngtcp2_crypto_ossl pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_ossl pkg-config file.]) @@ -3384,7 +3387,8 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ fi fi -if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BORINGSSL" = "x1"; then +if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" && test "$OPENSSL_IS_BORINGSSL" = "1"; then + dnl backup the pre-ngtcp2_crypto_boringssl variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3411,7 +3415,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BOR CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_BORINGSSL" LIBS="$LIB_NGTCP2_CRYPTO_BORINGSSL $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGTCP2_CRYPTO_BORINGSSL=`echo $LD_NGTCP2_CRYPTO_BORINGSSL | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2_crypto_boringssl, ngtcp2_crypto_recv_client_initial_cb, @@ -3433,7 +3437,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BOR else dnl no ngtcp2_crypto_boringssl pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file.]) @@ -3441,7 +3445,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BOR fi fi -if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then +if test "$USE_NGTCP2" = "1" && test "$GNUTLS_ENABLED" = "1"; then dnl backup the pre-ngtcp2_crypto_gnutls variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3468,7 +3472,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS" LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb, @@ -3490,7 +3494,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then else dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.]) @@ -3498,7 +3502,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then fi fi -if test "x$USE_NGTCP2" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then +if test "$USE_NGTCP2" = "1" && test "$WOLFSSL_ENABLED" = "1"; then dnl backup the pre-ngtcp2_crypto_wolfssl variables CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGSPC="$LDFLAGSPC" @@ -3525,7 +3529,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL" LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'` fi AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb, @@ -3547,7 +3551,7 @@ if test "x$USE_NGTCP2" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then else dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it - if test X"$want_tcp2" != Xdefault; then + if test "$want_tcp2" != "default"; then dnl To avoid link errors, we do not allow --with-ngtcp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.]) @@ -3561,7 +3565,7 @@ dnl ********************************************************************** OPT_OPENSSL_QUIC="no" -if test "x$disable_http" = "xyes" -o "x$OPENSSL_ENABLED" != "x1"; then +if test "$disable_http" = "yes" || test "$OPENSSL_ENABLED" != "1"; then # without HTTP or without openssl, no use OPT_OPENSSL_QUIC="no" fi @@ -3582,12 +3586,12 @@ case "$OPT_OPENSSL_QUIC" in esac curl_openssl_quic_msg="no (--with-openssl-quic)" -if test "x$want_openssl_quic" = "xyes"; then +if test "$want_openssl_quic" = "yes"; then - if test "$USE_NGTCP2" = 1; then + if test "$USE_NGTCP2" = "1"; then AC_MSG_ERROR([--with-openssl-quic and --with-ngtcp2 are mutually exclusive]) fi - if test "$have_openssl_quic" != 1; then + if test "$have_openssl_quic" != "1"; then AC_MSG_ERROR([--with-openssl-quic requires quic support and OpenSSL >= 3.3.0]) fi AC_DEFINE(USE_OPENSSL_QUIC, 1, [if openssl QUIC is in use]) @@ -3600,7 +3604,7 @@ dnl ********************************************************************** OPT_NGHTTP3="yes" -if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then +if test "$USE_NGTCP2" != "1" && test "$USE_OPENSSL_QUIC" != "1"; then # without ngtcp2 or openssl quic, nghttp3 is of no use for us OPT_NGHTTP3="no" want_nghttp3="no" @@ -3628,9 +3632,9 @@ case "$OPT_NGHTTP3" in esac curl_http3_msg="no (--with-nghttp3)" -if test X"$want_nghttp3" != Xno; then +if test "$want_nghttp3" != "no"; then - if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then + if test "$USE_NGTCP2" != "1" && test "$USE_OPENSSL_QUIC" != "1"; then # without ngtcp2 or openssl quic, nghttp3 is of no use for us AC_MSG_ERROR([nghttp3 enabled without a QUIC library; enable ngtcp2 or OpenSSL-QUIC]) fi @@ -3661,7 +3665,7 @@ if test X"$want_nghttp3" != Xno; then CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3" LIBS="$LIB_NGHTTP3 $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'` fi AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned, @@ -3684,7 +3688,7 @@ if test X"$want_nghttp3" != Xno; then else dnl no nghttp3 pkg-config found, deal with it - if test X"$want_nghttp3" != Xdefault; then + if test "$want_nghttp3" != "default"; then dnl To avoid link errors, we do not allow --with-nghttp3 without dnl a pkgconfig file AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.]) @@ -3696,7 +3700,7 @@ dnl ********************************************************************** dnl Check for ngtcp2 and nghttp3 (HTTP/3 with ngtcp2 + nghttp3) dnl ********************************************************************** -if test "x$USE_NGTCP2" = "x1" -a "x$USE_NGHTTP3" = "x1"; then +if test "$USE_NGTCP2" = "1" && test "$USE_NGHTTP3" = "1"; then USE_NGTCP2_H3=1 AC_MSG_NOTICE([HTTP3 support is experimental]) curl_h3_msg="enabled (ngtcp2 + nghttp3)" @@ -3706,7 +3710,7 @@ dnl ********************************************************************** dnl Check for OpenSSL and nghttp3 (HTTP/3 with nghttp3 using OpenSSL QUIC) dnl ********************************************************************** -if test "x$USE_OPENSSL_QUIC" = "x1" -a "x$USE_NGHTTP3" = "x1"; then +if test "$USE_OPENSSL_QUIC" = "1" && test "$USE_NGHTTP3" = "1"; then experimental="$experimental HTTP3" USE_OPENSSL_H3=1 AC_MSG_NOTICE([HTTP3 support is experimental]) @@ -3719,7 +3723,7 @@ dnl ********************************************************************** OPT_QUICHE="no" -if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then +if test "$disable_http" = "yes" || test "$USE_NGTCP" = "1"; then # without HTTP or with ngtcp2, quiche is no use OPT_QUICHE="no" fi @@ -3745,13 +3749,13 @@ case "$OPT_QUICHE" in ;; esac -if test X"$want_quiche" != Xno; then +if test "$want_quiche" != "no"; then if test "$QUIC_ENABLED" != "yes"; then AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-quiche a no-no]) fi - if test "$NGHTTP3_ENABLED" = 1; then + if test "$NGHTTP3_ENABLED" = "1"; then AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive]) fi @@ -3781,7 +3785,7 @@ if test X"$want_quiche" != Xno; then CPPFLAGS="$CPPFLAGS $CPP_QUICHE" LIBS="$LIB_QUICHE $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'` fi AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting, @@ -3809,7 +3813,7 @@ if test X"$want_quiche" != Xno; then ) else dnl no quiche pkg-config found, deal with it - if test X"$want_quiche" != Xdefault; then + if test "$want_quiche" != "default"; then dnl To avoid link errors, we do not allow --with-quiche without dnl a pkgconfig file AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.]) @@ -3843,8 +3847,8 @@ case "$OPT_LIBUV" in ;; esac -if test X"$want_libuv" != Xno; then - if test x$want_debug != xyes; then +if test "$want_libuv" != "no"; then + if test "$want_debug" != "yes"; then AC_MSG_ERROR([Using libuv without debug support enabled is useless]) fi @@ -3874,7 +3878,7 @@ if test X"$want_libuv" != Xno; then CPPFLAGS="$CPPFLAGS $CPP_LIBUV" LIBS="$LIB_LIBUV $LIBS" - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then DIR_LIBUV=`echo $LD_LIBUV | $SED -e 's/^-L//'` fi AC_CHECK_LIB(uv, uv_default_loop, @@ -3897,7 +3901,7 @@ if test X"$want_libuv" != Xno; then else dnl no libuv pkg-config found, deal with it - if test X"$want_libuv" != Xdefault; then + if test "$want_libuv" != "default"; then dnl To avoid link errors, we do not allow --with-libuv without dnl a pkgconfig file AC_MSG_ERROR([--with-libuv was specified but could not find libuv pkg-config file.]) @@ -3930,11 +3934,11 @@ case "$OPT_ZSH_FPATH" in AC_SUBST(ZSH_FUNCTIONS_DIR) ;; esac -if test -z "$PERL" -a x"$ZSH_FUNCTIONS_DIR" != x; then +if test -z "$PERL" && test -n "$ZSH_FUNCTIONS_DIR"; then AC_MSG_WARN([perl was not found. Will not install zsh completions.]) ZSH_FUNCTIONS_DIR='' fi -AM_CONDITIONAL(USE_ZSH_COMPLETION, test x"$ZSH_FUNCTIONS_DIR" != x) +AM_CONDITIONAL(USE_ZSH_COMPLETION, test -n "$ZSH_FUNCTIONS_DIR") dnl ********************************************************************** dnl Check for fish completion path @@ -3965,11 +3969,11 @@ case "$OPT_FISH_FPATH" in AC_SUBST(FISH_FUNCTIONS_DIR) ;; esac -if test -z "$PERL" -a x"$FISH_FUNCTIONS_DIR" != x; then +if test -z "$PERL" && test -n "$FISH_FUNCTIONS_DIR"; then AC_MSG_WARN([perl was not found. Will not install fish completions.]) FISH_FUNCTIONS_DIR='' fi -AM_CONDITIONAL(USE_FISH_COMPLETION, test x"$FISH_FUNCTIONS_DIR" != x) +AM_CONDITIONAL(USE_FISH_COMPLETION, test -n "$FISH_FUNCTIONS_DIR") dnl Now check for the most basic headers. Then we can use these dnl ones as default-headers when checking for the rest! @@ -4067,7 +4071,7 @@ AC_CHECK_TYPE(long long, [Define to 1 if the compiler supports the 'long long' data type.])] ) -if test ${ac_cv_sizeof_curl_off_t} -lt 8; then +if test "$ac_cv_sizeof_curl_off_t" -lt 8; then AC_MSG_ERROR([64-bit curl_off_t is required]) fi @@ -4088,7 +4092,7 @@ AC_CHECK_TYPE([bool],[ #endif ]) -if test "$curl_cv_native_windows" != 'yes'; then +if test "$curl_cv_native_windows" != "yes"; then # check for sa_family_t AC_CHECK_TYPE(sa_family_t, AC_DEFINE(HAVE_SA_FAMILY_T, 1, [Define to 1 if symbol `sa_family_t' exists]),, @@ -4203,7 +4207,7 @@ AC_CHECK_FUNCS([\ utimes \ ]) -if test "$curl_cv_native_windows" = 'yes'; then +if test "$curl_cv_native_windows" = "yes"; then AC_MSG_CHECKING([for if_nametoindex on Windows]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ @@ -4236,7 +4240,7 @@ else fi AC_CHECK_FUNCS([setmode]) -if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then +if test "$curl_cv_native_windows" = "yes" || test "$curl_cv_cygwin" = "yes"; then AC_CHECK_FUNCS([_setmode]) fi @@ -4244,7 +4248,7 @@ if test -z "$ssl_backends"; then AC_CHECK_FUNCS([arc4random]) fi -if test "$curl_cv_native_windows" != 'yes'; then +if test "$curl_cv_native_windows" != "yes"; then AC_CHECK_FUNCS([fseeko]) dnl On Android, the only way to know if fseeko can be used is to see if it is @@ -4260,7 +4264,7 @@ fi CURL_CHECK_NONBLOCKING_SOCKET dnl set variable for use in automakefile(s) -AM_CONDITIONAL(BUILD_DOCS, test x"$BUILD_DOCS" = x1) +AM_CONDITIONAL(BUILD_DOCS, test "$BUILD_DOCS" = "1") dnl ************************************************************************* dnl If the manual variable still is set, then we go with providing a built-in @@ -4271,12 +4275,12 @@ if test "$USE_MANUAL" = "1"; then fi dnl set variable for use in automakefile(s) -AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) +AM_CONDITIONAL(USE_MANUAL, test "$USE_MANUAL" = "1") CURL_CHECK_LIB_ARES CURL_CHECK_OPTION_THREADED_RESOLVER -if test "$ipv6" = yes -a "$curl_cv_apple" = 'yes'; then +if test "$ipv6" = "yes" && test "$curl_cv_apple" = "yes"; then CURL_DARWIN_SYSTEMCONFIGURATION fi @@ -4321,7 +4325,7 @@ if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; t *-ibm-aix*) dnl Check if compiler is xlC COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` - if test x"$COMPILER_VERSION" = "x"; then + if test -z "$COMPILER_VERSION"; then CFLAGS="$CFLAGS -pthread" else CFLAGS="$CFLAGS -qthreaded" @@ -4340,7 +4344,7 @@ if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; t [ CFLAGS="$save_CFLAGS"]) fi - if test "x$USE_THREADS_POSIX" = "x1"; then + if test "$USE_THREADS_POSIX" = "1"; then AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) curl_res_msg="POSIX threaded" fi @@ -4348,7 +4352,7 @@ if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; t fi dnl Did we find a threading option? -if test "$want_threaded_resolver" != "no" -a "x$USE_THREADS_POSIX" != "x1" -a "x$USE_THREADS_WIN32" != "x1"; then +if test "$want_threaded_resolver" != "no" && test "$USE_THREADS_POSIX" != "1" && test "$USE_THREADS_WIN32" != "1"; then AC_MSG_ERROR([Threaded resolver enabled but no thread library found]) fi @@ -4400,7 +4404,7 @@ AS_HELP_STRING([--disable-verbose],[Disable verbose strings]), AC_MSG_RESULT(yes) ) -if test "$curl_cv_winuwp" != 'yes'; then +if test "$curl_cv_winuwp" != "yes"; then dnl ************************************************************ dnl enable SSPI support dnl @@ -4421,7 +4425,7 @@ if test "$curl_cv_winuwp" != 'yes'; then fi ;; *) - if test "x$SCHANNEL_ENABLED" = "x1"; then + if test "$SCHANNEL_ENABLED" = "1"; then # --with-schannel implies --enable-sspi AC_MSG_RESULT(yes) else @@ -4429,7 +4433,7 @@ if test "$curl_cv_winuwp" != 'yes'; then fi ;; esac ], - if test "x$SCHANNEL_ENABLED" = "x1"; then + if test "$SCHANNEL_ENABLED" = "1"; then # --with-schannel implies --enable-sspi AC_MSG_RESULT(yes) else @@ -4437,7 +4441,7 @@ if test "$curl_cv_winuwp" != 'yes'; then fi ) - if test "x$USE_WINDOWS_SSPI" = "x1"; then + if test "$USE_WINDOWS_SSPI" = "1"; then LIBS="-lsecur32 $LIBS" fi fi @@ -4599,7 +4603,7 @@ AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), want_tls_srp=yes ) -if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1"); then +if test "$want_tls_srp" = "yes" && (test "$HAVE_GNUTLS_SRP" = "1" || test "$HAVE_OPENSSL_SRP" = "1"); then AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) USE_TLS_SRP=1 curl_tls_srp_msg="enabled" @@ -4626,8 +4630,8 @@ AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), want_unix_sockets=auto ] ) -if test "x$want_unix_sockets" != "xno"; then - if test "x$curl_cv_native_windows" = "xyes"; then +if test "$want_unix_sockets" != "no"; then + if test "$curl_cv_native_windows" = "yes"; then USE_UNIX_SOCKETS=1 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) curl_unix_sockets_msg="enabled" @@ -4637,7 +4641,7 @@ if test "x$want_unix_sockets" != "xno"; then USE_UNIX_SOCKETS=1 curl_unix_sockets_msg="enabled" ], [ - if test "x$want_unix_sockets" = "xyes"; then + if test "$want_unix_sockets" = "yes"; then AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!]) fi ], [ @@ -4774,12 +4778,12 @@ AS_HELP_STRING([--disable-form-api],[Disable form API support]), ;; *) AC_MSG_RESULT(yes) - test "$enable_mime" = no && + test "x$enable_mime" = "xno" && AC_MSG_ERROR(MIME support needs to be enabled in order to enable form API support) ;; esac ], [ - if test "$enable_mime" = no; then + if test "x$enable_mime" = "xno"; then enable_form_api=no AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) @@ -4968,7 +4972,7 @@ else hsts="no" fi -if test "x$hsts" != "xyes"; then +if test "$hsts" != "yes"; then curl_hsts_msg="no (--enable-hsts)"; AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc]) fi @@ -4977,7 +4981,7 @@ fi dnl ************************************************************* dnl check whether ECH support, if desired, is actually available dnl -if test "x$want_ech" != "xno"; then +if test "$want_ech" != "no"; then AC_MSG_CHECKING([whether ECH support is available]) dnl assume NOT and look for sufficient condition @@ -4988,25 +4992,25 @@ if test "x$want_ech" != "xno"; then ECH_SUPPORT='' dnl check for OpenSSL equivalent - if test "x$OPENSSL_ENABLED" = "x1"; then + if test "$OPENSSL_ENABLED" = "1"; then AC_CHECK_FUNCS(SSL_set1_ech_config_list, ECH_SUPPORT="$ECH_SUPPORT OpenSSL" ECH_ENABLED_OPENSSL=1) fi - if test "x$WOLFSSL_ENABLED" = "x1"; then + if test "$WOLFSSL_ENABLED" = "1"; then AC_CHECK_FUNCS(wolfSSL_CTX_GenerateEchConfig, ECH_SUPPORT="$ECH_SUPPORT wolfSSL" ECH_ENABLED_WOLFSSL=1) fi - if test "x$RUSTLS_ENABLED" = "x1"; then + if test "$RUSTLS_ENABLED" = "1"; then ECH_SUPPORT="$ECH_SUPPORT rustls-ffi" ECH_ENABLED_RUSTLS=1 fi dnl now deal with whatever we found - if test "x$ECH_ENABLED_OPENSSL" = "x1" -o \ - "x$ECH_ENABLED_WOLFSSL" = "x1" -o \ - "x$ECH_ENABLED_RUSTLS" = "x1"; then + if test "$ECH_ENABLED_OPENSSL" = "1" || + test "$ECH_ENABLED_WOLFSSL" = "1" || + test "$ECH_ENABLED_RUSTLS" = "1"; then AC_DEFINE(USE_ECH, 1, [if ECH support is available]) AC_MSG_RESULT(ECH support available via:$ECH_SUPPORT) experimental="$experimental ECH" @@ -5022,7 +5026,7 @@ AC_MSG_CHECKING([whether to enable HTTPS-RR support]) dnl ************************************************************* dnl check whether HTTPSRR support if desired dnl -if test "x$want_httpsrr" != "xno"; then +if test "$want_httpsrr" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE(USE_HTTPSRR, 1, [enable HTTPS RR support]) experimental="$experimental HTTPSRR" @@ -5032,7 +5036,7 @@ else # no HTTPSRR wanted if test "$want_threaded_resolver" = "yes"; then # and using the threaded resolver - if test "x$USE_ARES" = "x1"; then + if test "$USE_ARES" = "1"; then AC_MSG_ERROR([without HTTPS-RR support, asking for both threaded resolver and c-ares support is ambivalent. Please drop one of them.]) fi fi @@ -5042,11 +5046,11 @@ fi dnl ************************************************************* dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio dnl -if test "x$OPENSSL_ENABLED" = "x1"; then +if test "$OPENSSL_ENABLED" = "1"; then AC_CHECK_FUNCS([SSL_set0_wbio]) fi -if test "x$CURL_DISABLE_HTTP" != "x1"; then +if test "$CURL_DISABLE_HTTP" != "1"; then dnl ************************************************************* dnl WebSockets dnl @@ -5061,7 +5065,7 @@ if test "x$CURL_DISABLE_HTTP" != "x1"; then CURL_DISABLE_WEBSOCKETS=1 ;; *) - if test ${ac_cv_sizeof_curl_off_t} -gt 4; then + if test "$ac_cv_sizeof_curl_off_t" -gt 4; then AC_MSG_RESULT(yes) else dnl WebSockets requires >32-bit curl_off_t @@ -5083,14 +5087,14 @@ fi dnl ************************************************************* dnl check whether experimental SSL Session Im-/Export is enabled dnl -if test "x$want_ssls_export" != "xno"; then +if test "$want_ssls_export" != "no"; then AC_MSG_CHECKING([whether SSL session export support is available]) dnl assume NOT and look for sufficient condition SSLS_EXPORT_ENABLED=0 SSLS_EXPORT_SUPPORT='' - if test "x$SSL_ENABLED" != "x1"; then + if test "$SSL_ENABLED" != "1"; then AC_MSG_WARN([--enable-ssls-export ignored: No SSL support]) else SSLS_EXPORT_ENABLED=1 @@ -5139,7 +5143,7 @@ dnl all link targets in given makefile. BLANK_AT_MAKETIME= AC_SUBST(BLANK_AT_MAKETIME) -AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes) +AM_CONDITIONAL(CROSSCOMPILING, test "$cross_compiling" = "yes") dnl yes or no ENABLE_SHARED="$enable_shared" @@ -5155,7 +5159,7 @@ LIBCURL_PC_REQUIRES_PRIVATE=`echo $LIBCURL_PC_REQUIRES_PRIVATE | tr ' ' ','` AC_SUBST(LIBCURL_PC_REQUIRES_PRIVATE) dnl Merge pkg-config private fields into public ones when static-only -if test "x$enable_shared" = "xno"; then +if test "$enable_shared" = "no"; then LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE else @@ -5172,119 +5176,117 @@ dnl For keeping supported features and protocols also in pkg-config file dnl since it is more cross-compile friendly than curl-config dnl -if test "x$OPENSSL_ENABLED" = "x1"; then +if test "$OPENSSL_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" elif test -n "$SSL_ENABLED"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" fi -if test "x$IPV6_ENABLED" = "x1"; then +if test "$IPV6_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6" fi -if test "x$USE_UNIX_SOCKETS" = "x1"; then +if test "$USE_UNIX_SOCKETS" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets" fi -if test "x$HAVE_LIBZ" = "x1"; then +if test "$HAVE_LIBZ" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES libz" fi -if test "x$HAVE_BROTLI" = "x1"; then +if test "$HAVE_BROTLI" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES brotli" fi -if test "x$HAVE_ZSTD" = "x1"; then +if test "$HAVE_ZSTD" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES zstd" fi -if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \ - -o "x$USE_THREADS_WIN32" = "x1"; then +if test "$USE_ARES" = "1" || test "$USE_THREADS_POSIX" = "1" || test "$USE_THREADS_WIN32" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" fi -if test "x$USE_ARES" = "x1" -a "$want_threaded_resolver" = "yes" -a "x$want_httpsrr" != "xno"; then +if test "$USE_ARES" = "1" && test "$want_threaded_resolver" = "yes" && test "$want_httpsrr" != "no"; then SUPPORT_FEATURES="$SUPPORT_FEATURES asyn-rr" fi -if test "x$IDN_ENABLED" = "x1"; then +if test "$IDN_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" fi -if test "x$USE_WINDOWS_SSPI" = "x1"; then +if test "$USE_WINDOWS_SSPI" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI" fi -if test "x$HAVE_GSSAPI" = "x1"; then +if test "$HAVE_GSSAPI" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API" fi -if test "x$curl_psl_msg" = "xenabled"; then +if test "$curl_psl_msg" = "enabled"; then SUPPORT_FEATURES="$SUPPORT_FEATURES PSL" fi -if test "x$curl_gsasl_msg" = "xenabled"; then +if test "$curl_gsasl_msg" = "enabled"; then SUPPORT_FEATURES="$SUPPORT_FEATURES gsasl" fi -if test "x$enable_altsvc" = "xyes"; then +if test "$enable_altsvc" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc" fi -if test "x$hsts" = "xyes"; then +if test "$hsts" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS" fi -if test "x$CURL_DISABLE_NEGOTIATE_AUTH" != "x1" -a \ - \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then +if test "$CURL_DISABLE_NEGOTIATE_AUTH" != "1" && (test "$HAVE_GSSAPI" = "1" || test "$USE_WINDOWS_SSPI" = "1"); then SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO" fi -if test "x$CURL_DISABLE_KERBEROS_AUTH" != "x1" -a \ - \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then +if test "$CURL_DISABLE_KERBEROS_AUTH" != "1" && (test "$HAVE_GSSAPI" = "1" || test "$USE_WINDOWS_SSPI" = "1"); then SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos" fi use_curl_ntlm_core=no -if test "x$CURL_DISABLE_NTLM" != "x1"; then - if test "x$HAVE_DES_ECB_ENCRYPT" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" \ - -o "x$USE_WIN32_CRYPTO" = "x1" \ - -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1" \ - -o "x$HAVE_MBEDTLS_DES_CRYPT_ECB" = "x1"; then +if test "$CURL_DISABLE_NTLM" != "1"; then + if test "$HAVE_DES_ECB_ENCRYPT" = "1" || + test "$GNUTLS_ENABLED" = "1" || + test "$USE_WIN32_CRYPTO" = "1" || + test "$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "1" || + test "$HAVE_MBEDTLS_DES_CRYPT_ECB" = "1"; then use_curl_ntlm_core=yes fi - if test "x$use_curl_ntlm_core" = "xyes" \ - -o "x$USE_WINDOWS_SSPI" = "x1"; then + if test "$use_curl_ntlm_core" = "yes" || + test "$USE_WINDOWS_SSPI" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" fi fi -if test "x$USE_TLS_SRP" = "x1"; then +if test "$USE_TLS_SRP" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP" fi -if test "x$USE_NGHTTP2" = "x1"; then +if test "$USE_NGHTTP2" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" fi -if test "x$USE_NGTCP2_H3" = "x1" -o "x$USE_QUICHE" = "x1" \ - -o "x$USE_OPENSSL_H3" = "x1"; then - if test "x$CURL_WITH_MULTI_SSL" = "x1"; then +if test "$USE_NGTCP2_H3" = "1" || + test "$USE_QUICHE" = "1" || + test "$USE_OPENSSL_H3" = "1"; then + if test "$CURL_WITH_MULTI_SSL" = "1"; then AC_MSG_ERROR([MultiSSL cannot be enabled with HTTP/3 and vice versa]) fi SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3" fi -if test "x$CURL_WITH_MULTI_SSL" = "x1"; then +if test "$CURL_WITH_MULTI_SSL" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL" fi AC_MSG_CHECKING([if this build supports HTTPS-proxy]) dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends -if test "x$CURL_DISABLE_HTTP" != "x1"; then - if test "x$https_proxy" != "xno"; then - if test "x$OPENSSL_ENABLED" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" \ - -o "x$RUSTLS_ENABLED" = "x1" \ - -o "x$SCHANNEL_ENABLED" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" \ - -o "x$MBEDTLS_ENABLED" = "x1"; then +if test "$CURL_DISABLE_HTTP" != "1"; then + if test "$https_proxy" != "no"; then + if test "$OPENSSL_ENABLED" = "1" || + test "$GNUTLS_ENABLED" = "1" || + test "$RUSTLS_ENABLED" = "1" || + test "$SCHANNEL_ENABLED" = "1" || + test "$GNUTLS_ENABLED" = "1" || + test "$MBEDTLS_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" AC_MSG_RESULT([yes]) - elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$HAVE_WOLFSSL_BIO_NEW" = "x1"; then + elif test "$WOLFSSL_ENABLED" = "1" && test "$HAVE_WOLFSSL_BIO_NEW" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" AC_MSG_RESULT([yes]) else @@ -5297,35 +5299,34 @@ else AC_MSG_RESULT([no]) fi -if test "x$OPENSSL_ENABLED" = "x1" -o -n "$SSL_ENABLED"; then - if test "x$ECH_ENABLED" = "x1"; then +if test "$OPENSSL_ENABLED" = "1" || test -n "$SSL_ENABLED"; then + if test "$ECH_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES ECH" fi fi -if test "x$APPLE_SECTRUST_ENABLED" = "x1"; then +if test "$APPLE_SECTRUST_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES AppleSecTrust" fi -if test "x$want_httpsrr" != "xno"; then +if test "$want_httpsrr" != "no"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPSRR" fi -if test "x$SSLS_EXPORT_ENABLED" = "x1"; then +if test "$SSLS_EXPORT_ENABLED" = "1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSLS-EXPORT" fi -if test ${ac_cv_sizeof_curl_off_t} -gt 4; then - if test ${ac_cv_sizeof_off_t} -gt 4 -o \ - "$curl_cv_native_windows" = "yes"; then +if test "$ac_cv_sizeof_curl_off_t" -gt 4; then + if test "$ac_cv_sizeof_off_t" -gt 4 || + test "$curl_cv_native_windows" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile" fi fi if test "$tst_atomic" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" -elif test "x$USE_THREADS_POSIX" = "x1" -a \ - "x$ac_cv_header_pthread_h" = "xyes"; then +elif test "$USE_THREADS_POSIX" = "1" && test "$ac_cv_header_pthread_h" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" else AC_COMPILE_IFELSE([ @@ -5342,16 +5343,16 @@ else ]) fi -if test "x$want_winuni" = "xyes"; then +if test "$want_winuni" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES Unicode" fi -if test "x$want_debug" = "xyes"; then +if test "$want_debug" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES Debug" fi -if test "x$want_curldebug" = "xyes"; then +if test "$want_curldebug" = "yes"; then SUPPORT_FEATURES="$SUPPORT_FEATURES TrackMemory" fi -if test "x$CURL_CA_EMBED" != "x"; then +if test -n "$CURL_CA_EMBED"; then SUPPORT_FEATURES="$SUPPORT_FEATURES CAcert" CURL_CA_EMBED_msg="$CURL_CA_EMBED" else @@ -5369,93 +5370,92 @@ fi AC_SUBST(SUPPORT_FEATURES) dnl For supported protocols in pkg-config file -if test "x$CURL_DISABLE_HTTP" != "x1"; then +if test "$CURL_DISABLE_HTTP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" fi fi -if test "x$CURL_DISABLE_FTP" != "x1"; then +if test "$CURL_DISABLE_FTP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS" fi fi -if test "x$CURL_DISABLE_FILE" != "x1"; then +if test "$CURL_DISABLE_FILE" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE" fi -if test "x$CURL_DISABLE_TELNET" != "x1"; then +if test "$CURL_DISABLE_TELNET" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET" fi -if test "x$CURL_DISABLE_LDAP" != "x1"; then +if test "$CURL_DISABLE_LDAP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" - if test "x$CURL_DISABLE_LDAPS" != "x1"; then - if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || - (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then + if test "$CURL_DISABLE_LDAPS" != "1"; then + if (test "$USE_OPENLDAP" = "1" && test "$SSL_ENABLED" = "1") || + (test "$USE_OPENLDAP" != "1" && test "$HAVE_LDAP_SSL" = "1"); then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" fi fi fi -if test "x$CURL_DISABLE_DICT" != "x1"; then +if test "$CURL_DISABLE_DICT" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT" fi -if test "x$CURL_DISABLE_TFTP" != "x1"; then +if test "$CURL_DISABLE_TFTP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP" fi -if test "x$CURL_DISABLE_GOPHER" != "x1"; then +if test "$CURL_DISABLE_GOPHER" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS" fi fi -if test "x$CURL_DISABLE_MQTT" != "x1"; then +if test "$CURL_DISABLE_MQTT" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT" fi -if test "x$CURL_DISABLE_POP3" != "x1"; then +if test "$CURL_DISABLE_POP3" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S" fi fi -if test "x$CURL_DISABLE_IMAP" != "x1"; then +if test "$CURL_DISABLE_IMAP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS" fi fi -if test "x$CURL_DISABLE_SMB" != "x1" \ - -a "x$use_curl_ntlm_core" = "xyes"; then +if test "$CURL_DISABLE_SMB" != "1" && test "$use_curl_ntlm_core" = "yes"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS" fi fi -if test "x$CURL_DISABLE_SMTP" != "x1"; then +if test "$CURL_DISABLE_SMTP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS" fi fi -if test "x$USE_LIBSSH2" = "x1"; then +if test "$USE_LIBSSH2" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi -if test "x$USE_LIBSSH" = "x1"; then +if test "$USE_LIBSSH" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi -if test "x$CURL_DISABLE_IPFS" != "x1"; then +if test "$CURL_DISABLE_IPFS" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IPFS IPNS" fi -if test "x$CURL_DISABLE_RTSP" != "x1"; then +if test "$CURL_DISABLE_RTSP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi -if test "x$USE_LIBRTMP" = "x1"; then +if test "$USE_LIBRTMP" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" fi -if test "x$CURL_DISABLE_WEBSOCKETS" != "x1"; then +if test "$CURL_DISABLE_WEBSOCKETS" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" - if test "x$SSL_ENABLED" = "x1"; then + if test "$SSL_ENABLED" = "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS" fi fi @@ -5487,8 +5487,8 @@ XC_CHECK_BUILD_FLAGS SSL_BACKENDS=${ssl_backends} AC_SUBST(SSL_BACKENDS) -if test "x$want_curldebug_assumed" = "xyes" && - test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then +if test "$want_curldebug_assumed" = "yes" && + test "$want_curldebug" = "yes" && test "$USE_ARES" = "1"; then ac_configure_args="$ac_configure_args --enable-curldebug" fi diff --git a/curl-config.in b/curl-config.in index ce23519c3306..a1c81858753f 100644 --- a/curl-config.in +++ b/curl-config.in @@ -149,7 +149,7 @@ while test "$#" -gt 0; do ;; --libs) - if test "@libdir@" != '/usr/lib' -a "@libdir@" != '/usr/lib64'; then + if test "@libdir@" != '/usr/lib' && test "@libdir@" != '/usr/lib64'; then curllibdir="-L@libdir@ " else curllibdir='' diff --git a/docs/libcurl/libcurl.m4 b/docs/libcurl/libcurl.m4 index 973493f03af5..96248ddc25f4 100644 --- a/docs/libcurl/libcurl.m4 +++ b/docs/libcurl/libcurl.m4 @@ -86,7 +86,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], AS_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]), [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])]) - if test "$_libcurl_with" != "no"; then + if test "x$_libcurl_with" != "xno"; then AC_PROG_AWK @@ -102,7 +102,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH]) fi - if test x$_libcurl_config != "x"; then + if test -n "$_libcurl_config"; then AC_CACHE_CHECK([for the version of libcurl], [libcurl_cv_lib_curl_version], [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`]) @@ -110,11 +110,11 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse` - if test $_libcurl_wanted -gt 0; then + if test "$_libcurl_wanted" -gt 0; then AC_CACHE_CHECK([for libcurl >= version $2], [libcurl_cv_lib_version_ok], [ - if test $_libcurl_version -ge $_libcurl_wanted; then + if test "$_libcurl_version" -ge "$_libcurl_wanted"; then libcurl_cv_lib_version_ok=yes else libcurl_cv_lib_version_ok=no @@ -122,11 +122,11 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], ]) fi - if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes; then - if test x"$LIBCURL_CPPFLAGS" = "x"; then + if test "$_libcurl_wanted" -eq 0 || test "$libcurl_cv_lib_version_ok" = "yes"; then + if test -z "$LIBCURL_CPPFLAGS"; then LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi - if test x"$LIBCURL" = "x"; then + if test -z "$LIBCURL"; then LIBCURL=`$_libcurl_config --libs` # This is so silly, but Apple actually has a bug in their @@ -143,7 +143,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], _libcurl_features=`$_libcurl_config --feature` # Is it modern enough to have --protocols? (7.12.4) - if test $_libcurl_version -ge 461828; then + if test "$_libcurl_version" -ge 461828; then _libcurl_protocols=`$_libcurl_config --protocols` fi else @@ -153,7 +153,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], unset _libcurl_wanted fi - if test $_libcurl_try_link = yes; then + if test "$_libcurl_try_link" = "yes"; then # we did not find curl-config, so let's see if the user-supplied # link line (or failing that, "-lcurl") is enough. @@ -187,7 +187,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], unset _libcurl_save_libs ]) - if test $libcurl_cv_lib_curl_usable = yes; then + if test "$libcurl_cv_lib_curl_usable" = "yes"; then # Does curl_free() exist in this version of libcurl? # If not, fake it with free() @@ -217,25 +217,25 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes done - if test "x$_libcurl_protocols" = "x"; then + if test -z "$_libcurl_protocols"; then # We do not have --protocols, so just assume that all # protocols are available _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP" - if test x$libcurl_feature_SSL = xyes; then + if test "$libcurl_feature_SSL" = "yes"; then _libcurl_protocols="$_libcurl_protocols HTTPS" # FTPS was not standards-compliant until version # 7.11.0 (0x070b00 == 461568) - if test $_libcurl_version -ge 461568; then + if test "$_libcurl_version" -ge 461568; then _libcurl_protocols="$_libcurl_protocols FTPS" fi fi # RTSP, IMAP, POP3 and SMTP were added in # 7.20.0 (0x071400 == 463872) - if test $_libcurl_version -ge 463872; then + if test "$_libcurl_version" -ge 463872; then _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP" fi fi @@ -261,7 +261,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], unset _libcurl_ldflags fi - if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes; then + if test "x$_libcurl_with" = "xno" || test "$libcurl_cv_lib_curl_usable" != "yes"; then # This is the IF-NO path ifelse([$4],,:,[$4]) else diff --git a/m4/curl-amissl.m4 b/m4/curl-amissl.m4 index a70a5366321e..86468890e86b 100644 --- a/m4/curl-amissl.m4 +++ b/m4/curl-amissl.m4 @@ -25,7 +25,7 @@ AC_DEFUN([CURL_WITH_AMISSL], [ AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL v5)]) if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then - if test "x$OPT_AMISSL" != xno; then + if test "x$OPT_AMISSL" != "xno"; then ssl_msg= AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ @@ -43,7 +43,7 @@ if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then ],[ AC_MSG_RESULT([yes]) ssl_msg="AmiSSL" - test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "amissl" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes AMISSL_ENABLED=1 OPENSSL_ENABLED=1 # Use AmiSSL's built-in ca bundle diff --git a/m4/curl-apple-sectrust.m4 b/m4/curl-apple-sectrust.m4 index d42fe860a5fa..c70b7ac8cd61 100644 --- a/m4/curl-apple-sectrust.m4 +++ b/m4/curl-apple-sectrust.m4 @@ -24,7 +24,7 @@ AC_DEFUN([CURL_WITH_APPLE_SECTRUST], [ AC_MSG_CHECKING([whether to enable Apple OS native certificate validation]) -if test "x$OPT_APPLE_SECTRUST" = xyes; then +if test "x$OPT_APPLE_SECTRUST" = "xyes"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include @@ -41,10 +41,10 @@ if test "x$OPT_APPLE_SECTRUST" = xyes; then ],[ build_for_apple="no" ]) - if test "x$build_for_apple" = "xno"; then + if test "$build_for_apple" = "no"; then AC_MSG_ERROR([Apple SecTrust can only be enabled for Apple OS targets]) fi - if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then + if test "$OPENSSL_ENABLED" = "1" || test "$GNUTLS_ENABLED" = "1"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_APPLE_SECTRUST, 1, [enable Apple OS certificate validation]) APPLE_SECTRUST_ENABLED=1 diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 343391d6020c..7b4b5bed2318 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -88,7 +88,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ AC_MSG_RESULT([yes]) AC_MSG_CHECKING([if compiler is xlclang]) CURL_CHECK_DEF([__ibmxl__], [], [silent]) - if test "$curl_cv_have_def___ibmxl__" = "yes" ; then + if test "$curl_cv_have_def___ibmxl__" = "yes"; then dnl IBM's almost-compatible clang version AC_MSG_RESULT([yes]) compiler_id="XLCLANG" @@ -118,7 +118,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ clangvlo=`echo $clangver | cut -d . -f2` compiler_ver="$clangver" compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` - if test "$appleclang" = '1' && test "$oldapple" = '0'; then + if test "$appleclang" = "1" && test "$oldapple" = "0"; then dnl Starting with Xcode 7 / clang 3.7, Apple clang does not tell its upstream version if test "$compiler_num" -ge '1700'; then compiler_num='1901' elif test "$compiler_num" -ge '1600'; then compiler_num='1700' @@ -396,7 +396,8 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl AC_MSG_CHECKING([convert -I options to -isystem]) if test "$compiler_id" = "GNU_C" || - test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then + test "$compiler_id" = "CLANG" || + test "$compiler_id" = "APPLECLANG"; then AC_MSG_RESULT([yes]) tmp_has_include="no" tmp_chg_FLAGS="$CFLAGS" @@ -475,7 +476,7 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ ]) fi dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tmp_compiler_works" = "yes"; then CURL_RUN_IFELSE([ AC_LANG_PROGRAM([[ @@ -632,7 +633,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # - if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then + if test -n "$tmp_CFLAGS" || test -n "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts some basic options]) CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" @@ -972,7 +973,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # dnl Do not enable -pedantic when cross-compiling with a gcc older dnl than 3.0, to avoid warnings from third party system headers. - if test "x$cross_compiling" != "xyes" || + if test "$cross_compiling" != "yes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" fi @@ -985,7 +986,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$compiler_num" -ge "104"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [pointer-arith write-strings]) dnl If not cross-compiling with a gcc older than 3.0 - if test "x$cross_compiling" != "xyes" || + if test "$cross_compiling" != "yes" || test "$compiler_num" -ge "300"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unused shadow]) fi @@ -995,7 +996,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$compiler_num" -ge "207"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [nested-externs]) dnl If not cross-compiling with a gcc older than 3.0 - if test "x$cross_compiling" != "xyes" || + if test "$cross_compiling" != "yes" || test "$compiler_num" -ge "300"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [missing-declarations]) CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [missing-prototypes]) @@ -1173,7 +1174,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ else dnl When cross-compiling with a gcc older than 3.0, disable dnl some warnings triggered on third party system headers. - if test "x$cross_compiling" = "xyes"; then + if test "$cross_compiling" = "yes"; then if test "$compiler_num" -ge "104"; then dnl gcc 1.4 or later tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" @@ -1190,19 +1191,19 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wno-shadow" tmp_CFLAGS="$tmp_CFLAGS -Wno-unreachable-code" fi - if test "$compiler_num" -ge "402" -a "$compiler_num" -lt "406"; then + if test "$compiler_num" -ge "402" && test "$compiler_num" -lt "406"; then dnl GCC <4.6 do not support #pragma to suppress warnings locally. Disable globally instead. tmp_CFLAGS="$tmp_CFLAGS -Wno-overlength-strings" fi - if test "$compiler_num" -ge "400" -a "$compiler_num" -lt "407"; then + if test "$compiler_num" -ge "400" && test "$compiler_num" -lt "407"; then dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84685 tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-field-initializers" fi - if test "$compiler_num" -ge "403" -a "$compiler_num" -lt "408"; then + if test "$compiler_num" -ge "403" && test "$compiler_num" -lt "408"; then dnl Avoid false positives tmp_CFLAGS="$tmp_CFLAGS -Wno-type-limits" fi - if test "$compiler_num" -ge "501" -a "$compiler_num" -lt "505"; then + if test "$compiler_num" -ge "501" && test "$compiler_num" -lt "505"; then dnl Avoid false positives tmp_CFLAGS="$tmp_CFLAGS -Wno-conversion" fi @@ -1308,7 +1309,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # - if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then + if test -n "$tmp_CFLAGS" || test -n "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts strict warning options]) CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" @@ -1491,7 +1492,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ GNU_C) dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then - if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null ; then + if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null; then tmp_EXTERN="__attribute__((__visibility__(\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" @@ -1501,7 +1502,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ INTEL_UNIX_C) dnl Only icc 9.0 or later if test "$compiler_num" -ge "900"; then - if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_LINK_IFELSE([ @@ -1520,7 +1521,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ fi ;; SUNPRO_C) - if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then + if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null; then tmp_EXTERN="__global" tmp_CFLAGS="-xldscope=hidden" supports_symbol_hiding="yes" diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4 index 5149e8a34ae9..a54037369267 100644 --- a/m4/curl-confopts.m4 +++ b/m4/curl-confopts.m4 @@ -93,7 +93,7 @@ AS_HELP_STRING([--disable-ares],[Disable c-ares for DNS lookups]), *) dnl --enable-ares option used want_ares="yes" - if test -n "$enableval" && test "$enableval" != "yes"; then + if test -n "$enableval" && test "x$enableval" != "xyes"; then want_ares_path="$enableval" fi ;; @@ -392,15 +392,15 @@ AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [ tst_method="unknown" AC_MSG_CHECKING([how to set a socket into non-blocking mode]) - if test "x$curl_cv_func_fcntl_o_nonblock" = "xyes"; then + if test "$curl_cv_func_fcntl_o_nonblock" = "yes"; then tst_method="fcntl O_NONBLOCK" - elif test "x$curl_cv_func_ioctl_fionbio" = "xyes"; then + elif test "$curl_cv_func_ioctl_fionbio" = "yes"; then tst_method="ioctl FIONBIO" - elif test "x$curl_cv_func_ioctlsocket_fionbio" = "xyes"; then + elif test "$curl_cv_func_ioctlsocket_fionbio" = "yes"; then tst_method="ioctlsocket FIONBIO" - elif test "x$curl_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then + elif test "$curl_cv_func_ioctlsocket_camel_fionbio" = "yes"; then tst_method="IoctlSocket FIONBIO" - elif test "x$curl_cv_func_setsockopt_so_nonblock" = "xyes"; then + elif test "$curl_cv_func_setsockopt_so_nonblock" = "yes"; then tst_method="setsockopt SO_NONBLOCK" fi AC_MSG_RESULT([$tst_method]) @@ -433,7 +433,7 @@ AC_DEFUN([CURL_CONFIGURE_SYMBOL_HIDING], [ else AC_MSG_RESULT([no]) fi - AM_CONDITIONAL(DOING_CURL_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes) + AM_CONDITIONAL(DOING_CURL_SYMBOL_HIDING, test "$doing_symbol_hiding" = "yes") AC_SUBST(CFLAG_CURL_SYMBOL_HIDING) ]) @@ -456,7 +456,7 @@ AC_DEFUN([CURL_CHECK_LIB_ARES], [ dnl c-ares library path has been specified ARES_PCDIR="$want_ares_path/lib/pkgconfig" CURL_CHECK_PKGCONFIG(libcares, [$ARES_PCDIR]) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then ares_LIBS=`CURL_EXPORT_PCDIR([$ARES_PCDIR]) $PKGCONFIG --libs-only-l libcares` ares_LDFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR]) @@ -475,7 +475,7 @@ AC_DEFUN([CURL_CHECK_LIB_ARES], [ else dnl c-ares path not specified, use defaults CURL_CHECK_PKGCONFIG(libcares) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then ares_LIBS=`$PKGCONFIG --libs-only-l libcares` ares_LDFLAGS=`$PKGCONFIG --libs-only-L libcares` ares_CPPFLAGS=`$PKGCONFIG --cflags-only-I libcares` diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index a9b9ee58449e..5512a5d28c4c 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -1339,7 +1339,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_compi_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo seems to work]) CURL_RUN_IFELSE([ @@ -1415,7 +1415,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ # if test "$curl_cv_func_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is threadsafe]) - if test "$curl_cv_apple" = 'yes'; then + if test "$curl_cv_apple" = "yes"; then dnl Darwin 6.0 and macOS 10.2.X and newer tst_tsafe_getaddrinfo="yes" fi @@ -2027,7 +2027,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_compi_getifaddrs" = "yes"; then AC_MSG_CHECKING([if getifaddrs seems to work]) CURL_RUN_IFELSE([ @@ -2148,7 +2148,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_compi_gmtime_r" = "yes"; then AC_MSG_CHECKING([if gmtime_r seems to work]) CURL_RUN_IFELSE([ @@ -2268,7 +2268,7 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_compi_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop seems to work]) CURL_RUN_IFELSE([ @@ -2429,7 +2429,7 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_compi_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton seems to work]) CURL_RUN_IFELSE([ @@ -4016,7 +4016,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_glibc_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r seems to work]) CURL_RUN_IFELSE([ @@ -4079,7 +4079,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [ fi # dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && + if test "$cross_compiling" != "yes" && test "$tst_posix_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r seems to work]) CURL_RUN_IFELSE([ @@ -4259,7 +4259,7 @@ dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH dnl changes contained within this macro. AC_DEFUN([CURL_RUN_IFELSE], [ - if test "$curl_cv_apple" = 'yes'; then + if test "$curl_cv_apple" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4) else oldcc=$CC @@ -4291,7 +4291,7 @@ AC_DEFUN([CURL_COVERAGE],[ coverage="$enableval") dnl if not gcc or clang switch off again - AS_IF([test "$compiler_id" != "GNU_C" -a "$compiler_id" != "CLANG" -a "$compiler_id" != "APPLECLANG"], coverage="no" ) + AS_IF([test "$compiler_id" != "GNU_C" && test "$compiler_id" != "CLANG" && test "$compiler_id" != "APPLECLANG"], coverage="no" ) AC_MSG_RESULT($coverage) if test "x$coverage" = "xyes"; then @@ -4390,11 +4390,11 @@ AC_DEFUN([CURL_SIZEOF], [ r=0 ]) dnl get out of the loop once matched - if test $r -gt 0; then + if test "$r" -gt 0; then break; fi done - if test $r -eq 0; then + if test "$r" -eq 0; then AC_MSG_ERROR([Failed to find size of $1]) fi AC_MSG_RESULT($r) diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index f1aa04d3faf6..533d72129eb0 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -27,10 +27,10 @@ dnl check for GnuTLS dnl ---------------------------------------------------- AC_DEFUN([CURL_WITH_GNUTLS], [ -if test "x$OPT_GNUTLS" != xno; then +if test "x$OPT_GNUTLS" != "xno"; then ssl_msg= - if test X"$OPT_GNUTLS" != Xno; then + if test "x$OPT_GNUTLS" != "xno"; then addld="" addlib="" @@ -42,7 +42,7 @@ if test "x$OPT_GNUTLS" != xno; then dnl this is with no particular path given CURL_CHECK_PKGCONFIG(gnutls) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then addlib=`$PKGCONFIG --libs-only-l gnutls` addld=`$PKGCONFIG --libs-only-L gnutls` addcflags=`$PKGCONFIG --cflags-only-I gnutls` @@ -106,7 +106,7 @@ if test "x$OPT_GNUTLS" != xno; then USE_GNUTLS="yes" ssl_msg="GnuTLS" QUIC_ENABLED=yes - test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "gnutls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes ], [ LIBS="$CLEANLIBS" @@ -115,7 +115,7 @@ if test "x$OPT_GNUTLS" != xno; then LDFLAGSPC="$CLEANLDFLAGSPC" ]) - if test "x$USE_GNUTLS" = "xyes"; then + if test "$USE_GNUTLS" = "yes"; then AC_MSG_NOTICE([detected GnuTLS version $version]) check_for_ca_bundle=1 if test -n "$gtlslib"; then @@ -123,7 +123,7 @@ if test "x$OPT_GNUTLS" != xno; then dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH]) @@ -147,12 +147,12 @@ if test "$GNUTLS_ENABLED" = "1"; then AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) # If not, try linking directly to both of them to see if they are available - if test "$USE_GNUTLS_NETTLE" = ""; then + if test -z "$USE_GNUTLS_NETTLE"; then dnl this is with no particular path given CURL_CHECK_PKGCONFIG(nettle) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then addlib=`$PKGCONFIG --libs-only-l nettle` addld=`$PKGCONFIG --libs-only-L nettle` addcflags=`$PKGCONFIG --cflags-only-I nettle` @@ -192,7 +192,7 @@ if test "$GNUTLS_ENABLED" = "1"; then fi fi fi - if test "$USE_GNUTLS_NETTLE" = ""; then + if test -z "$USE_GNUTLS_NETTLE"; then AC_MSG_ERROR([GnuTLS found, but nettle was not found]) fi else diff --git a/m4/curl-mbedtls.m4 b/m4/curl-mbedtls.m4 index 93da5b25e068..7c5bccd22983 100644 --- a/m4/curl-mbedtls.m4 +++ b/m4/curl-mbedtls.m4 @@ -27,19 +27,19 @@ dnl check for mbedTLS dnl ---------------------------------------------------- AC_DEFUN([CURL_WITH_MBEDTLS], [ -if test "x$OPT_MBEDTLS" != xno; then +if test "x$OPT_MBEDTLS" != "xno"; then _cppflags=$CPPFLAGS _ldflags=$LDFLAGS _ldflagspc=$LDFLAGSPC ssl_msg= - if test X"$OPT_MBEDTLS" != Xno; then + if test "x$OPT_MBEDTLS" != "xno"; then - if test "$OPT_MBEDTLS" = "yes"; then + if test "x$OPT_MBEDTLS" = "xyes"; then OPT_MBEDTLS="" fi - if test -z "$OPT_MBEDTLS" ; then + if test -z "$OPT_MBEDTLS"; then dnl check for lib first without setting any new path AC_CHECK_LIB(mbedtls, mbedtls_havege_init, @@ -49,7 +49,7 @@ if test "x$OPT_MBEDTLS" != xno; then MBEDTLS_ENABLED=1 USE_MBEDTLS="yes" ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "mbedtls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes ], [], -lmbedx509 -lmbedcrypto) fi @@ -58,7 +58,7 @@ if test "x$OPT_MBEDTLS" != xno; then addcflags="" mbedtlslib="" - if test "x$USE_MBEDTLS" != "xyes"; then + if test "$USE_MBEDTLS" != "yes"; then dnl add the path and test again addld=-L$OPT_MBEDTLS/lib$libsuff addcflags=-I$OPT_MBEDTLS/include @@ -76,7 +76,7 @@ if test "x$OPT_MBEDTLS" != xno; then MBEDTLS_ENABLED=1 USE_MBEDTLS="yes" ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "mbedtls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes ], [ CPPFLAGS=$_cppflags @@ -85,7 +85,7 @@ if test "x$OPT_MBEDTLS" != xno; then ], -lmbedx509 -lmbedcrypto) fi - if test "x$USE_MBEDTLS" = "xyes"; then + if test "$USE_MBEDTLS" = "yes"; then AC_MSG_NOTICE([detected mbedTLS]) check_for_ca_bundle=1 @@ -96,7 +96,7 @@ if test "x$OPT_MBEDTLS" != xno; then dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH]) diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index b9b93e2ea01f..3892e0e89f02 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -30,7 +30,7 @@ dnl Check for OpenSSL libraries and headers dnl ********************************************************************** AC_DEFUN([CURL_WITH_OPENSSL], [ -if test "x$OPT_OPENSSL" != xno; then +if test "x$OPT_OPENSSL" != "xno"; then ssl_msg= dnl backup the pre-ssl variables @@ -102,7 +102,7 @@ if test "x$OPT_OPENSSL" != xno; then dnl in case pkg-config comes up empty, use what we got dnl via --with-openssl LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - if test "$PREFIX_OPENSSL" != "/usr" ; then + if test "$PREFIX_OPENSSL" != "/usr"; then SSL_LDFLAGS="-L$LIB_OPENSSL" SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" fi @@ -113,7 +113,7 @@ if test "x$OPT_OPENSSL" != xno; then CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR]) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null` @@ -148,11 +148,11 @@ if test "x$OPT_OPENSSL" != xno; then HAVECRYPTO="yes" LIBS="-lcrypto $LIBS" ],[ - if test -n "$LIB_OPENSSL" ; then + if test -n "$LIB_OPENSSL"; then LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" LDFLAGSPC="$CLEANLDFLAGSPC -L$LIB_OPENSSL" fi - if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then + if test "$PKGCONFIG" = "no" && test -n "$PREFIX_OPENSSL"; then # only set this if pkg-config was not used CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" fi @@ -203,33 +203,33 @@ if test "x$OPT_OPENSSL" != xno; then ]) ]) - if test X"$HAVECRYPTO" = X"yes"; then + if test "$HAVECRYPTO" = "yes"; then dnl This is only reasonable to do if crypto actually is there: check for dnl SSL libs NOTE: it is important to do this AFTER the crypto lib AC_CHECK_LIB(ssl, SSL_connect) - if test "$ac_cv_lib_ssl_SSL_connect" = yes; then + if test "$ac_cv_lib_ssl_SSL_connect" = "yes"; then dnl Have the libraries--check for OpenSSL headers AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ openssl/pem.h openssl/ssl.h openssl/err.h, ssl_msg="OpenSSL" - test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "openssl" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes OPENSSL_ENABLED=1 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])) fi - if test X"$OPENSSL_ENABLED" != X"1"; then + if test "$OPENSSL_ENABLED" != "1"; then LIBS="$CLEANLIBS" fi - if test X"$OPT_OPENSSL" != Xoff && + if test "x$OPT_OPENSSL" != "xoff" && test "$OPENSSL_ENABLED" != "1"; then AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!]) fi fi - if test X"$OPENSSL_ENABLED" = X"1"; then + if test "$OPENSSL_ENABLED" = "1"; then dnl These can only exist if OpenSSL exists AC_MSG_CHECKING([for BoringSSL]) @@ -319,7 +319,7 @@ if test "x$OPT_OPENSSL" != xno; then dnl when the ssl shared libs were found in a path that the runtime dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH dnl to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH]) @@ -332,7 +332,7 @@ if test "x$OPT_OPENSSL" != xno; then test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi -if test X"$OPT_OPENSSL" != Xno && +if test "x$OPT_OPENSSL" != "xno" && test "$OPENSSL_ENABLED" != "1"; then AC_MSG_NOTICE([OPT_OPENSSL: $OPT_OPENSSL]) AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED]) @@ -389,7 +389,7 @@ if test "$OPENSSL_ENABLED" = "1"; then AC_ARG_ENABLE(openssl-auto-load-config, AS_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration]) AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]), - [ if test X"$enableval" = X"no"; then + [ if test "x$enableval" = "xno"; then AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled]) AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration will not be loaded automatically]) fi diff --git a/m4/curl-rustls.m4 b/m4/curl-rustls.m4 index 7b7e9975240c..f1b5d6b1df44 100644 --- a/m4/curl-rustls.m4 +++ b/m4/curl-rustls.m4 @@ -27,7 +27,7 @@ dnl ---------------------------------------------------- dnl check for Rustls dnl ---------------------------------------------------- -if test "x$OPT_RUSTLS" != xno; then +if test "x$OPT_RUSTLS" != "xno"; then ssl_msg= dnl backup the pre-ssl variables @@ -83,14 +83,14 @@ if test "x$OPT_RUSTLS" != xno; then CPPFLAGS="$CPPFLAGS $addcflags" fi - if test "$curl_cv_apple" = 'yes'; then + if test "$curl_cv_apple" = "yes"; then RUSTLS_LDFLAGS="-framework Security -framework Foundation" else RUSTLS_LDFLAGS="-lpthread -ldl -lm" fi LIB_RUSTLS="$PREFIX_RUSTLS/lib$libsuff" - if test "$PREFIX_RUSTLS" != "/usr" ; then + if test "$PREFIX_RUSTLS" != "/usr"; then SSL_LDFLAGS="-L$LIB_RUSTLS $RUSTLS_LDFLAGS" SSL_CPPFLAGS="-I$PREFIX_RUSTLS/include" fi @@ -108,7 +108,7 @@ if test "x$OPT_RUSTLS" != xno; then CURL_CHECK_PKGCONFIG(rustls, [$RUSTLS_PCDIR]) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then SSL_LIBS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR]) dnl $PKGCONFIG --libs-only-l --libs-only-other rustls 2>/dev/null` @@ -136,7 +136,7 @@ if test "x$OPT_RUSTLS" != xno; then AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled]) USE_RUSTLS="yes" RUSTLS_ENABLED=1 - test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "rustls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes else AC_MSG_ERROR([pkg-config: Could not find Rustls]) fi @@ -152,7 +152,7 @@ if test "x$OPT_RUSTLS" != xno; then LDFLAGS="$CLEANLDFLAGS $SSL_LDFLAGS" LDFLAGSPC="$CLEANLDFLAGSPC $SSL_LDFLAGS" - if test "x$USE_RUSTLS" = "xyes"; then + if test "$USE_RUSTLS" = "yes"; then AC_MSG_NOTICE([detected Rustls]) check_for_ca_bundle=1 @@ -161,7 +161,7 @@ if test "x$OPT_RUSTLS" != xno; then dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH so that further configure tests do not dnl fail due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_RUSTLS" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $LIB_RUSTLS to CURL_LIBRARY_PATH]) @@ -177,7 +177,7 @@ if test "x$OPT_RUSTLS" != xno; then RUSTLS_ENABLED=1 USE_RUSTLS="yes" ssl_msg="Rustls" - test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "rustls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes ], AC_MSG_ERROR([--with-rustls was specified but could not find compatible Rustls.]), $RUSTLS_LDFLAGS) @@ -185,7 +185,7 @@ if test "x$OPT_RUSTLS" != xno; then test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" - if test X"$OPT_RUSTLS" != Xno && + if test "x$OPT_RUSTLS" != "xno" && test "$RUSTLS_ENABLED" != "1"; then AC_MSG_NOTICE([OPT_RUSTLS: $OPT_RUSTLS]) AC_MSG_NOTICE([RUSTLS_ENABLED: $RUSTLS_ENABLED]) diff --git a/m4/curl-schannel.m4 b/m4/curl-schannel.m4 index 1aa66dc2c84a..c67098fa113e 100644 --- a/m4/curl-schannel.m4 +++ b/m4/curl-schannel.m4 @@ -24,17 +24,17 @@ AC_DEFUN([CURL_WITH_SCHANNEL], [ AC_MSG_CHECKING([whether to enable Windows native SSL/TLS]) -if test "x$OPT_SCHANNEL" != xno; then +if test "x$OPT_SCHANNEL" != "xno"; then ssl_msg= if test "x$OPT_SCHANNEL" != "xno" && - test "x$curl_cv_native_windows" = "xyes"; then - if test "$curl_cv_winuwp" = 'yes'; then + test "$curl_cv_native_windows" = "yes"; then + if test "$curl_cv_winuwp" = "yes"; then AC_MSG_ERROR([UWP does not support Schannel.]) fi AC_MSG_RESULT(yes) AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support]) ssl_msg="Schannel" - test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "schannel" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes SCHANNEL_ENABLED=1 # --with-schannel implies --enable-sspi AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) diff --git a/m4/curl-sysconfig.m4 b/m4/curl-sysconfig.m4 index f5ebe0391b20..7ad1285ef2df 100644 --- a/m4/curl-sysconfig.m4 +++ b/m4/curl-sysconfig.m4 @@ -40,7 +40,7 @@ AC_MSG_CHECKING([whether to link macOS CoreFoundation, CoreServices, and SystemC ],[ build_for_macos="no" ]) - if test "x$build_for_macos" != xno; then + if test "$build_for_macos" != "no"; then AC_MSG_RESULT(yes) SYSCONFIG_LDFLAGS='-framework CoreFoundation -framework CoreServices -framework SystemConfiguration' LDFLAGS="$LDFLAGS $SYSCONFIG_LDFLAGS" diff --git a/m4/curl-wolfssl.m4 b/m4/curl-wolfssl.m4 index 0eba972b633b..4cbc6f5c0c4e 100644 --- a/m4/curl-wolfssl.m4 +++ b/m4/curl-wolfssl.m4 @@ -36,14 +36,14 @@ case "$OPT_WOLFSSL" in ;; esac -if test "x$OPT_WOLFSSL" != xno; then +if test "$OPT_WOLFSSL" != "no"; then _cppflags=$CPPFLAGS _ldflags=$LDFLAGS _ldflagspc=$LDFLAGSPC ssl_msg= - if test X"$OPT_WOLFSSL" != Xno; then + if test "$OPT_WOLFSSL" != "no"; then if test "$OPT_WOLFSSL" = "yes"; then OPT_WOLFSSL="" @@ -56,7 +56,7 @@ if test "x$OPT_WOLFSSL" != xno; then addld="" addlib="" addcflags="" - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then addlib=`CURL_EXPORT_PCDIR([$wolfpkg]) $PKGCONFIG --libs-only-l wolfssl` addld=`CURL_EXPORT_PCDIR([$wolfpkg]) @@ -76,13 +76,13 @@ if test "x$OPT_WOLFSSL" != xno; then fi fi - if test "$curl_cv_apple" = 'yes'; then + if test "$curl_cv_apple" = "yes"; then addlib="$addlib -framework Security -framework CoreFoundation" else addlib="$addlib -lm" fi - if test "x$USE_WOLFSSL" != "xyes"; then + if test "$USE_WOLFSSL" != "yes"; then LDFLAGS="$LDFLAGS $addld" LDFLAGSPC="$LDFLAGSPC $addld" @@ -114,7 +114,7 @@ if test "x$OPT_WOLFSSL" != xno; then WOLFSSL_ENABLED=1 USE_WOLFSSL="yes" ssl_msg="wolfSSL" - test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + test "wolfssl" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes ], [ AC_MSG_RESULT(no) @@ -126,7 +126,7 @@ if test "x$OPT_WOLFSSL" != xno; then LIBS="$my_ac_save_LIBS" fi - if test "x$USE_WOLFSSL" = "xyes"; then + if test "$USE_WOLFSSL" = "yes"; then AC_MSG_NOTICE([detected wolfSSL]) check_for_ca_bundle=1 @@ -150,12 +150,12 @@ if test "x$OPT_WOLFSSL" != xno; then dnl if this symbol is present, we want the include path to include the dnl OpenSSL API root as well - if test "x$ac_cv_func_wolfSSL_DES_ecb_encrypt" = 'xyes'; then + if test "$ac_cv_func_wolfSSL_DES_ecb_encrypt" = "yes"; then HAVE_WOLFSSL_DES_ECB_ENCRYPT=1 fi dnl if this symbol is present, we can make use of BIO filter chains - if test "x$ac_cv_func_wolfSSL_BIO_new" = 'xyes'; then + if test "$ac_cv_func_wolfSSL_BIO_new" = "yes"; then HAVE_WOLFSSL_BIO_NEW=1 fi @@ -164,7 +164,7 @@ if test "x$OPT_WOLFSSL" != xno; then dnl linker does not search through, we need to add it to dnl CURL_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - if test "x$cross_compiling" != "xyes"; then + if test "$cross_compiling" != "yes"; then CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$wolfssllibpath" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $wolfssllibpath to CURL_LIBRARY_PATH]) diff --git a/m4/xc-lt-iface.m4 b/m4/xc-lt-iface.m4 index 22eecd349f20..83bf62ccf6cf 100644 --- a/m4/xc-lt-iface.m4 +++ b/m4/xc-lt-iface.m4 @@ -59,8 +59,8 @@ case "x$enable_static" in @%:@ ( xc_lt_want_enable_static='no' ;; esac -if test "x$xc_lt_want_enable_shared" = 'xno' && - test "x$xc_lt_want_enable_static" = 'xno'; then +if test "$xc_lt_want_enable_shared" = "no" && + test "$xc_lt_want_enable_static" = "no"; then AC_MSG_ERROR([can not disable shared and static libraries simultaneously]) fi @@ -71,8 +71,8 @@ fi # must be used in order to build a proper static library. # -if test "x$xc_lt_want_enable_shared" = 'xyes' && - test "x$xc_lt_want_enable_static" = 'xyes'; then +if test "$xc_lt_want_enable_shared" = "yes" && + test "$xc_lt_want_enable_static" = "yes"; then case $host_os in @%:@ ( os2* | aix*) xc_lt_want_enable_static='no' @@ -117,7 +117,7 @@ esac # be overridden using 'configure --disable-shared --without-pic'. # -if test "x$xc_lt_want_with_pic" = 'xdefault'; then +if test "$xc_lt_want_with_pic" = "default"; then case $host_cpu in @%:@ ( x86_64 | amd64 | ia64) case $host_os in @%:@ ( @@ -229,7 +229,7 @@ m4_define([_XC_CHECK_LT_SHLIB_USE_VERSION_INFO], AC_MSG_CHECKING([whether to build shared libraries with -version-info]) xc_lt_shlib_use_version_info='yes' -if test "x$version_type" = 'xnone'; then +if test "$version_type" = "none"; then xc_lt_shlib_use_version_info='no' fi case $host_os in @%:@ ( @@ -259,9 +259,9 @@ m4_define([_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED], AC_MSG_CHECKING([whether to build shared libraries with -no-undefined]) xc_lt_shlib_use_no_undefined='no' -if test "x$allow_undefined" = 'xno'; then +if test "x$allow_undefined" = "xno"; then xc_lt_shlib_use_no_undefined='yes' -elif test "x$allow_undefined_flag" = 'xunsupported'; then +elif test "x$allow_undefined_flag" = "xunsupported"; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in @%:@ ( @@ -293,7 +293,7 @@ AC_MSG_CHECKING([whether to build shared libraries with -mimpure-text]) xc_lt_shlib_use_mimpure_text='no' case $host_os in @%:@ ( solaris2*) - if test "x$GCC" = 'xyes'; then + if test "x$GCC" = "xyes"; then xc_lt_shlib_use_mimpure_text='yes' fi ;; @@ -367,8 +367,8 @@ m4_define([_XC_CHECK_LT_BUILD_SINGLE_VERSION], # AC_MSG_CHECKING([whether to build shared libraries only]) -if test "$xc_lt_build_shared" = 'yes' && - test "$xc_lt_build_static" = 'no'; then +if test "$xc_lt_build_shared" = "yes" && + test "$xc_lt_build_static" = "no"; then xc_lt_build_shared_only='yes' else xc_lt_build_shared_only='no' @@ -380,8 +380,8 @@ AC_MSG_RESULT([$xc_lt_build_shared_only]) # AC_MSG_CHECKING([whether to build static libraries only]) -if test "$xc_lt_build_static" = 'yes' && - test "$xc_lt_build_shared" = 'no'; then +if test "$xc_lt_build_static" = "yes" && + test "$xc_lt_build_shared" = "no"; then xc_lt_build_static_only='yes' else xc_lt_build_static_only='no' diff --git a/m4/xc-val-flgs.m4 b/m4/xc-val-flgs.m4 index 4715163c9e7e..fd906434966e 100644 --- a/m4/xc-val-flgs.m4 +++ b/m4/xc-val-flgs.m4 @@ -39,7 +39,7 @@ AC_DEFUN([_XC_CHECK_VAR_LIBS], [ ;; esac done - if test $xc_bad_var_libs = yes; then + if test "$xc_bad_var_libs" = "yes"; then AC_MSG_NOTICE([using LIBS: $LIBS]) AC_MSG_NOTICE([LIBS note: LIBS should only be used to specify libraries (-lname).]) fi @@ -68,7 +68,7 @@ AC_DEFUN([_XC_CHECK_VAR_LDFLAGS], [ ;; esac done - if test $xc_bad_var_ldflags = yes; then + if test "$xc_bad_var_ldflags" = "yes"; then AC_MSG_NOTICE([using LDFLAGS: $LDFLAGS]) xc_bad_var_msg="LDFLAGS note: LDFLAGS should only be used to specify linker flags, not" for xc_word in $LDFLAGS; do @@ -110,7 +110,7 @@ AC_DEFUN([_XC_CHECK_VAR_CPPFLAGS], [ ;; esac done - if test $xc_bad_var_cppflags = yes; then + if test "$xc_bad_var_cppflags" = "yes"; then AC_MSG_NOTICE([using CPPFLAGS: $CPPFLAGS]) xc_bad_var_msg="CPPFLAGS note: CPPFLAGS should only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do @@ -158,7 +158,7 @@ AC_DEFUN([_XC_CHECK_VAR_CFLAGS], [ ;; esac done - if test $xc_bad_var_cflags = yes; then + if test "$xc_bad_var_cflags" = "yes"; then AC_MSG_NOTICE([using CFLAGS: $CFLAGS]) xc_bad_var_msg="CFLAGS note: CFLAGS should only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do @@ -207,10 +207,10 @@ AC_DEFUN([XC_CHECK_USER_FLAGS], [ _XC_CHECK_VAR_LDFLAGS _XC_CHECK_VAR_CPPFLAGS _XC_CHECK_VAR_CFLAGS - if test $xc_bad_var_libs = yes || - test $xc_bad_var_cflags = yes || - test $xc_bad_var_ldflags = yes || - test $xc_bad_var_cppflags = yes; then + if test "$xc_bad_var_libs" = "yes" || + test "$xc_bad_var_cflags" = "yes" || + test "$xc_bad_var_ldflags" = "yes" || + test "$xc_bad_var_cppflags" = "yes"; then AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) fi ]) @@ -235,10 +235,10 @@ AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ _XC_CHECK_VAR_LDFLAGS _XC_CHECK_VAR_CPPFLAGS _XC_CHECK_VAR_CFLAGS - if test $xc_bad_var_libs = yes || - test $xc_bad_var_cflags = yes || - test $xc_bad_var_ldflags = yes || - test $xc_bad_var_cppflags = yes; then + if test "$xc_bad_var_libs" = "yes" || + test "$xc_bad_var_cflags" = "yes" || + test "$xc_bad_var_ldflags" = "yes" || + test "$xc_bad_var_cppflags" = "yes"; then AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) fi ]) diff --git a/m4/zz40-xc-ovr.m4 b/m4/zz40-xc-ovr.m4 index 5389a455614c..02c86c9eeaad 100644 --- a/m4/zz40-xc-ovr.m4 +++ b/m4/zz40-xc-ovr.m4 @@ -393,7 +393,7 @@ done IFS=$xc_tst_prev_IFS xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'` -if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then +if test "$xc_tst_dirs_sem" -eq "$xc_tst_dirs_col"; then # When both counting methods give the same result we do not want to # chose one over the other, and consider auto-detection not possible. if test -z "$PATH_SEPARATOR"; then @@ -404,7 +404,7 @@ if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then fi else # Separator with the greater directory count is the auto-detected one. - if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then + if test "$xc_tst_dirs_sem" -gt "$xc_tst_dirs_col"; then xc_tst_auto_separator=';' else xc_tst_auto_separator=':' From 73b732e3e8d3b23bc8b11ee8024448f9e61ced7d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 22:42:35 +0100 Subject: [PATCH 749/885] tests/data: replace `&` with `%AMP` For XML-compliance. Closes #19923 --- tests/data/test1011 | 7 +++---- tests/data/test1012 | 7 +++---- tests/data/test1015 | 3 +-- tests/data/test1076 | 7 +++---- tests/data/test1105 | 7 +++---- tests/data/test1138 | 7 +++---- tests/data/test1221 | 3 +-- tests/data/test1332 | 7 +++---- tests/data/test1402 | 3 +-- tests/data/test1403 | 3 +-- tests/data/test1598 | 3 +-- tests/data/test1977 | 5 ++--- tests/data/test199 | 7 +++---- tests/data/test3 | 5 ++--- tests/data/test32 | 5 ++--- tests/data/test40 | 7 +++---- tests/data/test439 | 5 ++--- tests/data/test48 | 7 +++---- tests/data/test568 | 3 +-- tests/data/test733 | 5 ++--- tests/data/test734 | 5 ++--- tests/data/test735 | 5 ++--- tests/data/test739 | 3 +-- 23 files changed, 48 insertions(+), 71 deletions(-) diff --git a/tests/data/test1011 b/tests/data/test1011 index 4f5111dea23b..c15fab06dc64 100644 --- a/tests/data/test1011 +++ b/tests/data/test1011 @@ -4,7 +4,6 @@ HTTP HTTP POST followlocation -notxml # @@ -12,7 +11,7 @@ notxml HTTP/1.1 301 OK -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 @@ -27,7 +26,7 @@ body HTTP/1.1 301 OK -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 0 @@ -65,7 +64,7 @@ Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded -mooGET /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +mooGET /blah/moo.html%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1012 b/tests/data/test1012 index ef2d679bfc4c..fe678aa00696 100644 --- a/tests/data/test1012 +++ b/tests/data/test1012 @@ -4,7 +4,6 @@ HTTP HTTP POST followlocation -notxml # @@ -12,7 +11,7 @@ notxml HTTP/1.1 301 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -27,7 +26,7 @@ body HTTP/1.1 301 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -65,7 +64,7 @@ Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded -mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +mooPOST /blah/moo.html%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1015 b/tests/data/test1015 index 2cd937806043..0f5ec3f6329b 100644 --- a/tests/data/test1015 +++ b/tests/data/test1015 @@ -4,7 +4,6 @@ HTTP HTTP POST --data-urlencode -notxml @@ -51,7 +50,7 @@ Accept: */* Content-Length: 119 Content-Type: application/x-www-form-urlencoded -my+name+is+moo%5B%5D&y e s=s_i_r&v_alue=content+to+_%3F%21%23%24%27%7C%3C%3E%0A&content+to+_%3F%21%23%24%27%7C%3C%3E%0A +my+name+is+moo%5B%5D%AMPy e s=s_i_r%AMPv_alue=content+to+_%3F%21%23%24%27%7C%3C%3E%0A%AMPcontent+to+_%3F%21%23%24%27%7C%3C%3E%0A diff --git a/tests/data/test1076 b/tests/data/test1076 index 08eba396c597..8d9f0f1a326e 100644 --- a/tests/data/test1076 +++ b/tests/data/test1076 @@ -4,7 +4,6 @@ HTTP HTTP POST followlocation -notxml # @@ -12,7 +11,7 @@ notxml HTTP/1.1 302 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -27,7 +26,7 @@ body HTTP/1.1 302 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -65,7 +64,7 @@ Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded -mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +mooPOST /blah/moo.html%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1105 b/tests/data/test1105 index e0766817295e..5c850cd6d4af 100644 --- a/tests/data/test1105 +++ b/tests/data/test1105 @@ -5,7 +5,6 @@ HTTP HTTP POST cookies cookiejar -notxml @@ -36,7 +35,7 @@ http HTTP with cookie parser and header recording -"http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER?parm1=this*that/other/thing&parm2=foobar/%TESTNUMBER" -c %LOGDIR/cookie%TESTNUMBER.txt -d "userid=myname&password=mypassword" +"http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER?parm1=this*that/other/thing%AMPparm2=foobar/%TESTNUMBER" -c %LOGDIR/cookie%TESTNUMBER.txt -d "userid=myname%AMPpassword=mypassword" cookies @@ -47,14 +46,14 @@ local-http # Verify data after the test has been "shot" -POST /we/want/%TESTNUMBER?parm1=this*that/other/thing&parm2=foobar/%TESTNUMBER HTTP/1.1 +POST /we/want/%TESTNUMBER?parm1=this*that/other/thing%AMPparm2=foobar/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* Content-Length: 33 Content-Type: application/x-www-form-urlencoded -userid=myname&password=mypassword +userid=myname%AMPpassword=mypassword # Netscape HTTP Cookie File diff --git a/tests/data/test1138 b/tests/data/test1138 index a3e65d0e0fb7..71a44a5a4256 100644 --- a/tests/data/test1138 +++ b/tests/data/test1138 @@ -4,7 +4,6 @@ HTTP HTTP GET followlocation -notxml # @@ -12,7 +11,7 @@ notxml HTTP/1.1 302 OK swsclose -Location: ../moo.html/?name=%hex[%d8%a2%d8%ba%d8%a7%d8%b2%2d%d8%b3%d9%85%2d%d8%b2%d8%af%d8%a7%db%8c%db%8c%2d%d8%a7%d8%b2%2d%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1%2d%d9%be%d9%88%d9%84]hex%&testcase=/%TESTNUMBER0002 +Location: ../moo.html/?name=%hex[%d8%a2%d8%ba%d8%a7%d8%b2%2d%d8%b3%d9%85%2d%d8%b2%d8%af%d8%a7%db%8c%db%8c%2d%d8%a7%d8%b2%2d%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1%2d%d9%be%d9%88%d9%84]hex%%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -27,7 +26,7 @@ body HTTP/1.1 302 OK swsclose -Location: ../moo.html/?name=%hex[%d8%a2%d8%ba%d8%a7%d8%b2%2d%d8%b3%d9%85%2d%d8%b2%d8%af%d8%a7%db%8c%db%8c%2d%d8%a7%d8%b2%2d%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1%2d%d9%be%d9%88%d9%84]hex%&testcase=/%TESTNUMBER0002 +Location: ../moo.html/?name=%hex[%d8%a2%d8%ba%d8%a7%d8%b2%2d%d8%b3%d9%85%2d%d8%b2%d8%af%d8%a7%db%8c%db%8c%2d%d8%a7%d8%b2%2d%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1%2d%d9%be%d9%88%d9%84]hex%%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -63,7 +62,7 @@ Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -GET /we/are/all/moo.html/?name=%D8%A2%D8%BA%D8%A7%D8%B2-%D8%B3%D9%85-%D8%B2%D8%AF%D8%A7%DB%8C%DB%8C-%D8%A7%D8%B2-%D8%A8%D8%A7%D8%B2%D8%A7%D8%B1-%D9%BE%D9%88%D9%84&testcase=/%TESTNUMBER0002 HTTP/1.1 +GET /we/are/all/moo.html/?name=%D8%A2%D8%BA%D8%A7%D8%B2-%D8%B3%D9%85-%D8%B2%D8%AF%D8%A7%DB%8C%DB%8C-%D8%A7%D8%B2-%D8%A8%D8%A7%D8%B2%D8%A7%D8%B1-%D9%BE%D9%88%D9%84%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1221 b/tests/data/test1221 index 5f200c17abbe..2f1df8d2aa94 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -5,7 +5,6 @@ HTTP HTTP POST --data-urlencode --url-query -notxml @@ -47,7 +46,7 @@ content to _?!#$'|%LT%GT # Verify data after the test has been "shot" -POST /%TESTNUMBER?my+name+is+moo%5b%5d&yes=s+i+r&v_alue=content+to+_%3f%21%23%24%27%7c%3c%3e%0a&content+to+_%3f%21%23%24%27%7c%3c%3e%0a&%3d%3d HTTP/1.1 +POST /%TESTNUMBER?my+name+is+moo%5b%5d%AMPyes=s+i+r%AMPv_alue=content+to+_%3f%21%23%24%27%7c%3c%3e%0a%AMPcontent+to+_%3f%21%23%24%27%7c%3c%3e%0a%AMP%3d%3d HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1332 b/tests/data/test1332 index f1b596e31016..032cca7b5383 100644 --- a/tests/data/test1332 +++ b/tests/data/test1332 @@ -5,7 +5,6 @@ HTTP HTTP POST followlocation -notxml # @@ -13,7 +12,7 @@ notxml HTTP/1.1 303 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -28,7 +27,7 @@ body HTTP/1.1 303 OK swsclose -Location: moo.html&testcase=/%TESTNUMBER0002 +Location: moo.html%AMPtestcase=/%TESTNUMBER0002 Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -66,7 +65,7 @@ Accept: */* Content-Length: 3 Content-Type: application/x-www-form-urlencoded -mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1 +mooPOST /blah/moo.html%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1402 b/tests/data/test1402 index 401daa3ba5b7..66d3c9dc3d72 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -4,7 +4,6 @@ HTTP HTTP POST --libcurl -notxml @@ -50,7 +49,7 @@ Accept: */* Content-Length: 16 Content-Type: application/x-www-form-urlencoded -foo=bar&baz=quux +foo=bar%AMPbaz=quux # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with diff --git a/tests/data/test1403 b/tests/data/test1403 index 2a9cba0bed15..1055d29a83a4 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -4,7 +4,6 @@ HTTP HTTP GET --libcurl -notxml @@ -43,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --libcurl %LOGDIR/test%TESTNUMBER.c # Verify data after the test has been "shot" -GET /we/want/%TESTNUMBER?foo=bar&baz=quux HTTP/1.1 +GET /we/want/%TESTNUMBER?foo=bar%AMPbaz=quux HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1598 b/tests/data/test1598 index f3143432edd0..f7c935a19013 100644 --- a/tests/data/test1598 +++ b/tests/data/test1598 @@ -5,7 +5,6 @@ HTTP HTTP POST CURLOPT_HTTPTRAILER_FUNCTION CURLOPT_HTTPTRAILER_DATA -notxml @@ -50,7 +49,7 @@ Transfer-Encoding: chunked Content-Type: application/x-www-form-urlencoded 11 -xxx=yyy&aaa=bbbbb +xxx=yyy%AMPaaa=bbbbb 0 my-super-awesome-trailer: trail1 my-other-awesome-trailer: trail2 diff --git a/tests/data/test1977 b/tests/data/test1977 index d62ed337e61a..dba5504e1030 100644 --- a/tests/data/test1977 +++ b/tests/data/test1977 @@ -3,7 +3,6 @@ CURLOPT_CURLU CURLINFO_EFFECTIVE_URL -notxml @@ -43,7 +42,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo -effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo&bar +effective URL: http://%HOSTIP:%HTTPPORT/%TESTNUMBER?foo%AMPbar GET /%TESTNUMBER HTTP/1.1 @@ -54,7 +53,7 @@ GET /%TESTNUMBER?foo HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* -GET /%TESTNUMBER?foo&bar HTTP/1.1 +GET /%TESTNUMBER?foo%AMPbar HTTP/1.1 Host: %HOSTIP:%HTTPPORT Accept: */* diff --git a/tests/data/test199 b/tests/data/test199 index fc8a8e96a0dc..996abb089e8f 100644 --- a/tests/data/test199 +++ b/tests/data/test199 @@ -4,7 +4,6 @@ HTTP HTTP GET globbing -notxml # @@ -36,7 +35,7 @@ http HTTP with -d, -G and {} --d "foo=moo&moo=poo" "http://%HOSTIP:%HTTPPORT/{%TESTNUMBER,%TESTNUMBER}" -G +-d "foo=moo%AMPmoo=poo" "http://%HOSTIP:%HTTPPORT/{%TESTNUMBER,%TESTNUMBER}" -G @@ -44,12 +43,12 @@ HTTP with -d, -G and {} # Verify data after the test has been "shot" -GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +GET /%TESTNUMBER?foo=moo%AMPmoo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +GET /%TESTNUMBER?foo=moo%AMPmoo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test3 b/tests/data/test3 index 50fdfeea48c3..c2f8e11a9c57 100644 --- a/tests/data/test3 +++ b/tests/data/test3 @@ -4,7 +4,6 @@ HTTP HTTP POST HTTP Basic auth -notxml # @@ -37,7 +36,7 @@ http HTTP POST with auth and contents but with content-length set to 0 - -d "fooo=mooo&pooo=clue&doo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/%TESTNUMBER + -d "fooo=mooo%AMPpooo=clue%AMPdoo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/%TESTNUMBER @@ -53,7 +52,7 @@ Accept: */* Content-Length: 37 Content-Type: application/x-www-form-urlencoded -fooo=mooo&pooo=clue&doo=%20%20%20++++ +fooo=mooo%AMPpooo=clue%AMPdoo=%20%20%20++++ diff --git a/tests/data/test32 b/tests/data/test32 index 94b9531ca5ed..e96389f98972 100644 --- a/tests/data/test32 +++ b/tests/data/test32 @@ -4,7 +4,6 @@ HTTP HTTP GET -G -notxml # @@ -36,7 +35,7 @@ http HTTP with -d and -G --d "foo=moo&moo=poo" http://%HOSTIP:%HTTPPORT/%TESTNUMBER -G +-d "foo=moo%AMPmoo=poo" http://%HOSTIP:%HTTPPORT/%TESTNUMBER -G @@ -44,7 +43,7 @@ HTTP with -d and -G # Verify data after the test has been "shot" -GET /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +GET /%TESTNUMBER?foo=moo%AMPmoo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test40 b/tests/data/test40 index 04efdbbc70b4..4f728fe8623b 100644 --- a/tests/data/test40 +++ b/tests/data/test40 @@ -4,7 +4,6 @@ HTTP HTTP GET followlocation -notxml # @@ -12,7 +11,7 @@ notxml HTTP/1.1 302 OK swsclose -Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002%repeat[4 x ]% +Location: ../moo.html/?name=d a niel%AMPtestcase=/%TESTNUMBER0002%repeat[4 x ]% Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -27,7 +26,7 @@ body HTTP/1.1 302 OK swsclose -Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002%repeat[4 x ]% +Location: ../moo.html/?name=d a niel%AMPtestcase=/%TESTNUMBER0002%repeat[4 x ]% Date: Tue, 09 Nov 2010 14:49:00 GMT Connection: close @@ -63,7 +62,7 @@ Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -GET /we/are/all/moo.html/?name=d+a+niel&testcase=/%TESTNUMBER0002 HTTP/1.1 +GET /we/are/all/moo.html/?name=d+a+niel%AMPtestcase=/%TESTNUMBER0002 HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test439 b/tests/data/test439 index 8529797242b9..949f887ef909 100644 --- a/tests/data/test439 +++ b/tests/data/test439 @@ -3,7 +3,6 @@ HTTP aws-sigv4 -notxml @@ -40,7 +39,7 @@ aws aws-sigv4 with query -"http://fake.fake.fake:8000/%TESTNUMBER/?name=me&noval&aim=b%aad&&&weirdo=*.//-" -u user:secret --aws-sigv4 "aws:amz:us-east-2:es" --connect-to fake.fake.fake:8000:%HOSTIP:%HTTPPORT +"http://fake.fake.fake:8000/%TESTNUMBER/?name=me%AMPnoval%AMPaim=b%aad%AMP%AMP%AMPweirdo=*.//-" -u user:secret --aws-sigv4 "aws:amz:us-east-2:es" --connect-to fake.fake.fake:8000:%HOSTIP:%HTTPPORT @@ -48,7 +47,7 @@ aws-sigv4 with query # Verify data after the test has been "shot" -GET /%TESTNUMBER/?name=me&noval&aim=b%aad&&&weirdo=*.//- HTTP/1.1 +GET /%TESTNUMBER/?name=me%AMPnoval%AMPaim=b%aad%AMP%AMP%AMPweirdo=*.//- HTTP/1.1 Host: fake.fake.fake:8000 Authorization: AWS4-HMAC-SHA256 Credential=user/19700101/us-east-2/es/aws4_request, SignedHeaders=host;x-amz-date, Signature=9dd8592929306832a6673d10063491391e486e5f50de4647ea7c2c797277e0a6 X-Amz-Date: 19700101T000000Z diff --git a/tests/data/test48 b/tests/data/test48 index c161ba5dca91..21cdbd368f94 100644 --- a/tests/data/test48 +++ b/tests/data/test48 @@ -4,7 +4,6 @@ HTTP HTTP HEAD -G -notxml # @@ -30,7 +29,7 @@ http HTTP with -d and -G and -I --d "foo=moo&moo=poo" http://%HOSTIP:%HTTPPORT/%TESTNUMBER -G -I http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-d "foo=moo%AMPmoo=poo" http://%HOSTIP:%HTTPPORT/%TESTNUMBER -G -I http://%HOSTIP:%HTTPPORT/%TESTNUMBER @@ -38,12 +37,12 @@ HTTP with -d and -G and -I # Verify data after the test has been "shot" -HEAD /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +HEAD /%TESTNUMBER?foo=moo%AMPmoo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* -HEAD /%TESTNUMBER?foo=moo&moo=poo HTTP/1.1 +HEAD /%TESTNUMBER?foo=moo%AMPmoo=poo HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test568 b/tests/data/test568 index a2438916d46e..6c8eaade7389 100644 --- a/tests/data/test568 +++ b/tests/data/test568 @@ -5,7 +5,6 @@ RTSP ANNOUNCE -notxml @@ -107,7 +106,7 @@ CSeq: 3 Content-Type: posty goodness Content-Length: 35 -postyfield=postystuff&project=curl +postyfield=postystuff%AMPproject=curl OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER0004 RTSP/1.0 CSeq: 4 diff --git a/tests/data/test733 b/tests/data/test733 index 0bf953cca210..8235e7199973 100644 --- a/tests/data/test733 +++ b/tests/data/test733 @@ -2,7 +2,6 @@ IPFS -notxml @@ -38,7 +37,7 @@ http IPFS with path and query args ---ipfs-gateway http://%HOSTIP:%HTTPPORT "ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar&aaa=bbb" +--ipfs-gateway http://%HOSTIP:%HTTPPORT "ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar%AMPaaa=bbb" @@ -46,7 +45,7 @@ IPFS with path and query args # Verify data after the test has been "shot" -GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar&aaa=bbb HTTP/1.1 +GET /ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar%AMPaaa=bbb HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test734 b/tests/data/test734 index 01107fbf6b3d..6c87bd1eb49c 100644 --- a/tests/data/test734 +++ b/tests/data/test734 @@ -2,7 +2,6 @@ IPFS -notxml @@ -38,7 +37,7 @@ http IPFS with path, query args and gateway with path ---ipfs-gateway http://%HOSTIP:%HTTPPORT/some/path "ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar&aaa=bbb" +--ipfs-gateway http://%HOSTIP:%HTTPPORT/some/path "ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar%AMPaaa=bbb" @@ -46,7 +45,7 @@ IPFS with path, query args and gateway with path # Verify data after the test has been "shot" -GET /some/path/ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar&aaa=bbb HTTP/1.1 +GET /some/path/ipfs/bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u/a/b?foo=bar%AMPaaa=bbb HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test735 b/tests/data/test735 index 574d8bd492ba..d23a0fe6d970 100644 --- a/tests/data/test735 +++ b/tests/data/test735 @@ -2,7 +2,6 @@ IPFS -notxml @@ -38,7 +37,7 @@ http IPNS with path, query args and gateway with path ---ipfs-gateway http://%HOSTIP:%HTTPPORT/some/path "ipns://fancy.tld/a/b?foo=bar&aaa=bbb" +--ipfs-gateway http://%HOSTIP:%HTTPPORT/some/path "ipns://fancy.tld/a/b?foo=bar%AMPaaa=bbb" @@ -46,7 +45,7 @@ IPNS with path, query args and gateway with path # Verify data after the test has been "shot" -GET /some/path/ipns/fancy.tld/a/b?foo=bar&aaa=bbb HTTP/1.1 +GET /some/path/ipns/fancy.tld/a/b?foo=bar%AMPaaa=bbb HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test739 b/tests/data/test739 index 3e712f513e39..b51afb5a412c 100644 --- a/tests/data/test739 +++ b/tests/data/test739 @@ -2,7 +2,6 @@ IPFS -notxml @@ -24,7 +23,7 @@ http IPNS path and query args for gateway and IPFS URL (malformed gateway URL) ---ipfs-gateway "http://%HOSTIP:%HTTPPORT/some/path?biz=baz" "ipns://fancy.tld/a/b?foo=bar&aaa=bbb" +--ipfs-gateway "http://%HOSTIP:%HTTPPORT/some/path?biz=baz" "ipns://fancy.tld/a/b?foo=bar%AMPaaa=bbb" From 7109b427fbf0711ba1a6e22f0ff565f93fbeb9ea Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 22:57:58 +0100 Subject: [PATCH 750/885] tests/data: replace `<` with `%LT` For XML-compliance. Closes #19924 --- tests/data/test1189 | 5 ++--- tests/data/test163 | 3 +-- tests/data/test39 | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/data/test1189 b/tests/data/test1189 index b5574cef507d..8fdb3d9ac193 100644 --- a/tests/data/test1189 +++ b/tests/data/test1189 @@ -3,7 +3,6 @@ HTTP HTTP FORMPOST -notxml # Server-side @@ -34,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape -F name=daniel -F tool=curl --form-string "str1=@literal" ---form-string "str2= HTTP HTTP POST -notxml @@ -31,7 +30,7 @@ http HTTP multipart formpost with contents from a file -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=<%LOGDIR/field%TESTNUMBER" -F tool=curl +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=%LT%LOGDIR/field%TESTNUMBER" -F tool=curl # We create this file before the command is invoked! diff --git a/tests/data/test39 b/tests/data/test39 index b0062543378c..c1c8ab6aca3d 100644 --- a/tests/data/test39 +++ b/tests/data/test39 @@ -3,7 +3,6 @@ HTTP HTTP FORMPOST -notxml # Server-side @@ -34,7 +33,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=daniel -F tool=curl --form-string "str1=@literal" ---form-string "str2= Date: Wed, 10 Dec 2025 23:07:50 +0100 Subject: [PATCH 751/885] tests/data: replace `<`, `>` with `%LT`, `%GT` For XML-compliance. Closes #19925 --- tests/data/test1683 | 5 ++--- tests/data/test320 | 5 ++--- tests/data/test646 | 7 +++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/data/test1683 b/tests/data/test1683 index 47d280cd14a1..dd0c80528a43 100644 --- a/tests/data/test1683 +++ b/tests/data/test1683 @@ -4,7 +4,6 @@ HTTP HTTP GET --no-clobber -notxml @@ -40,7 +39,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/exist%TESTNUMBER --no-clobber to stay the same -%PERL -e 'for my $i ((1..100)) { my $filename = "%LOGDIR/exist%TESTNUMBER.$i"; open(FH, ">", $filename) or die $!; print FH "to stay the same" ; close(FH) }' +%PERL -e 'for my $i ((1..100)) { my $filename = "%LOGDIR/exist%TESTNUMBER.$i"; open(FH, "%GT", $filename) or die $!; print FH "to stay the same" ; close(FH) }' @@ -54,7 +53,7 @@ to stay the same to stay the same -%PERL -e 'for my $i ((1..100)) { my $filename = "%LOGDIR/exist%TESTNUMBER.$i"; open(FH, "<", $filename) or die $!; ( eq "to stay the same" and eq "") or die "incorrect $filename" ; close(FH) }' +%PERL -e 'for my $i ((1..100)) { my $filename = "%LOGDIR/exist%TESTNUMBER.$i"; open(FH, "%LT", $filename) or die $!; (%LTFH%GT eq "to stay the same" and %LTFH%GT eq "") or die "incorrect $filename" ; close(FH) }' diff --git a/tests/data/test320 b/tests/data/test320 index ca68674571f4..e046b4db45ca 100644 --- a/tests/data/test320 +++ b/tests/data/test320 @@ -4,7 +4,6 @@ HTTPS HTTP GET TLS-SRP -notxml @@ -43,11 +42,11 @@ Accept: */* -s/^

Connected as user 'jsmith'.*/FINE/ +s/^%LTp%GTConnected as user 'jsmith'.*/FINE/ s/Protocol version:.*[0-9]// s/GNUTLS/GnuTLS/ s/(AES[-_])\d\d\d([-_]CBC)/$1NNN$2/ -s/^<.*\n// +s/^%LT.*\n// s/^\n// diff --git a/tests/data/test646 b/tests/data/test646 index 39fafa573ce5..0ded08bcace2 100644 --- a/tests/data/test646 +++ b/tests/data/test646 @@ -3,7 +3,6 @@ SMTP MULTIPART -notxml @@ -35,10 +34,10 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=(;type=multipart/alternative" --F "= This is the html version;headers=X-test1: this is a header;type=text/html;headers=X-test2: this is another header " +-F "= %LTbody%GTThis is the html version%LT/body%GT;headers=X-test1: this is a header;type=text/html;headers=X-test2: this is another header " -F "=This is the plain text version;headers=@%LOGDIR/headers%TESTNUMBER" -F "=)" --F "=@%LOGDIR/test%TESTNUMBER.txt;headers=<%LOGDIR/headers%TESTNUMBER" +-F "=@%LOGDIR/test%TESTNUMBER.txt;headers=%LT%LOGDIR/headers%TESTNUMBER" -H "From: different" -H "To: another" -H "Reply-To: %LTfollowup@example.com%GT" @@ -88,7 +87,7 @@ Content-Transfer-Encoding: 8bit%CR X-test1: this is a header%CR X-test2: this is another header%CR %CR -This is the html version%CR +%LTbody%GTThis is the html version%LT/body%GT%CR ------------------------------%CR X-fileheader1: This is a header from a file%CR X-fileheader2: This is #a folded header%CR From 319298484f212bfd6a673fbbab21c7afcf6259ad Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 23:21:10 +0100 Subject: [PATCH 752/885] runtests: add support for single-quoted attributes, use it With this, all test data files are XML-compliant. Also: - test1158, test1186: use single quotes for the test filename attribute containing a double quote. For XML-compliance. - drop support for unquoted attributes. For XML-compliance. Closes #19926 --- tests/data/test1158 | 3 +-- tests/data/test1186 | 3 +-- tests/getpart.pm | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/data/test1158 b/tests/data/test1158 index a791c6fd4ccf..befecd763bdb 100644 --- a/tests/data/test1158 +++ b/tests/data/test1158 @@ -3,7 +3,6 @@ HTTP HTTP FORMPOST -notxml # Server-side @@ -37,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"' # We create this file before the command is invoked! - + foo bar This is a bar foo bar diff --git a/tests/data/test1186 b/tests/data/test1186 index 7a8b69486b7d..439dbebcf54e 100644 --- a/tests/data/test1186 +++ b/tests/data/test1186 @@ -3,7 +3,6 @@ HTTP HTTP FORMPOST -notxml # Server-side @@ -37,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"' # We create this file before the command is invoked! - + foo bar This is a bar foo bar diff --git a/tests/getpart.pm b/tests/getpart.pm index 7fa703d0b178..69b810db5c47 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -76,9 +76,10 @@ sub testcaseattr { for(@xml) { if(($_ =~ /^ *\]*)/)) { my $attr=$1; - while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|([^\> ]*))//) { + while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|\'([^\']*)\')//) { my ($var, $cont)=($1, $2); $cont =~ s/^\"(.*)\"$/$1/; + $cont =~ s/^\'(.*)\'$/$1/; $hash{$var}=$cont; } } @@ -108,9 +109,10 @@ sub getpartattr { $inside++; my $attr=$1; - while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|([^\> ]*))//) { + while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|\'([^\']*)\')//) { my ($var, $cont)=($1, $2); $cont =~ s/^\"(.*)\"$/$1/; + $cont =~ s/^\'(.*)\'$/$1/; $hash{$var}=$cont; } last; From bfe6eb1c06f295a45c4d2c9c7aa8f09895706313 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 23:44:43 +0100 Subject: [PATCH 753/885] runtests: drop `notxml` keyword, verify all test data files as XML Follow-up to 7f3731ce142c1d74023abad183cc8ce0fd527fab #19595 Closes #19927 --- .github/workflows/checksrc.yml | 4 ++-- docs/tests/FILEFORMAT.md | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 1b471e50cfe7..8552ad4c7950 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -139,8 +139,8 @@ jobs: - name: 'check' run: | { - git grep -z -i -l -E '^<\?xml' || true - git grep -z -L -F 'notxml' 'tests/data/test*' || true + git grep -i -l -E '^<\?xml' -z || true + git ls-files 'tests/data/test*' -z || true } | xargs -0 -r xmllint >/dev/null miscchecks: diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index c655a4d863d3..84188e9dd9dc 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -257,11 +257,6 @@ often run on overloaded machines with unpredictable timing. Tests using non-7-bit-ASCII characters must provide them with `%hex[]` or similar. -In most cases test files comply with the XML format, and pass xmllint cleanly. -If the data file uses the `&` character, or has other, non-compliant content, -and making it XML-compliant is not possible or unpractical, use the `notxml` -keyword to exclude it from linter checks. - ## `` ### `` From bb134bba293ffd2128a43d17137e1fb2a84bdd47 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Dec 2025 09:11:45 +0100 Subject: [PATCH 754/885] test3214: allow a larger struct Curl_easy In my local build it is now 5840 bytes. Add a 10 byte margin. Closes #19932 --- tests/unit/unit3214.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/unit3214.c b/tests/unit/unit3214.c index d992a35dc0db..ae03d5410ca9 100644 --- a/tests/unit/unit3214.c +++ b/tests/unit/unit3214.c @@ -41,7 +41,7 @@ static void checksize(const char *name, size_t size, size_t allowed) } /* the maximum sizes we allow specific structs to grow to */ -#define MAX_CURL_EASY 5800 +#define MAX_CURL_EASY 5850 #define MAX_CONNECTDATA 1300 #define MAX_CURL_MULTI 850 #define MAX_CURL_HTTPPOST 112 From 1a822275d333dc6da6043497160fd04c8fa48640 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2025 11:40:47 +0100 Subject: [PATCH 755/885] curl_sasl: if redirected, require permission to use bearer Closes #19933 --- lib/curl_sasl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 3e4bafc19ae4..b93bafbefac3 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -452,7 +452,9 @@ static bool sasl_choose_ntlm(struct Curl_easy *data, struct sasl_ctx *sctx) static bool sasl_choose_oauth(struct Curl_easy *data, struct sasl_ctx *sctx) { - const char *oauth_bearer = data->set.str[STRING_BEARER]; + const char *oauth_bearer = + (!data->state.this_is_a_follow || data->set.allow_auth_to_other_hosts) ? + data->set.str[STRING_BEARER] : NULL; if(sctx->user && oauth_bearer && (sctx->enabledmechs & SASL_MECH_OAUTHBEARER)) { @@ -477,7 +479,9 @@ static bool sasl_choose_oauth(struct Curl_easy *data, struct sasl_ctx *sctx) static bool sasl_choose_oauth2(struct Curl_easy *data, struct sasl_ctx *sctx) { - const char *oauth_bearer = data->set.str[STRING_BEARER]; + const char *oauth_bearer = + (!data->state.this_is_a_follow || data->set.allow_auth_to_other_hosts) ? + data->set.str[STRING_BEARER] : NULL; if(sctx->user && oauth_bearer && (sctx->enabledmechs & SASL_MECH_XOAUTH2)) { From f72c3779144955def08c493ed7aef3661b0bb43e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2025 10:49:54 +0100 Subject: [PATCH 756/885] tests: verify setting bearer and doing redirects Test 778, 779 and 795 --- tests/data/Makefile.am | 6 +-- tests/data/test778 | 97 ++++++++++++++++++++++++++++++++++++++++++ tests/data/test779 | 76 +++++++++++++++++++++++++++++++++ tests/data/test795 | 74 ++++++++++++++++++++++++++++++++ 4 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 tests/data/test778 create mode 100644 tests/data/test779 create mode 100644 tests/data/test795 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 63cc4729f314..7faa27da3545 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -110,9 +110,9 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \ test745 test746 test747 test748 test749 test750 test751 test752 test753 \ test754 test755 test756 test757 test758 test759 test760 test761 test762 \ test763 test764 test765 test766 test767 test768 test769 test770 test771 \ -test772 test773 test774 test775 test776 test777 \ -test780 test781 test782 test783 test784 test785 test786 test787 test788 \ -test789 test790 test791 test792 test793 test794 test796 test797 \ +test772 test773 test774 test775 test776 test777 test778 test779 test780 \ +test781 test782 test783 test784 test785 test786 test787 test788 test789 \ +test790 test791 test792 test793 test794 test795 test796 test797 \ \ test799 test800 test801 test802 test803 test804 test805 test806 test807 \ test808 test809 test810 test811 test812 test813 test814 test815 test816 \ diff --git a/tests/data/test778 b/tests/data/test778 new file mode 100644 index 000000000000..84e84b8cd3b8 --- /dev/null +++ b/tests/data/test778 @@ -0,0 +1,97 @@ + + + +HTTP +HTTP proxy +HTTP Basic auth +HTTP proxy Basic auth +followlocation +oauth2-bearer + + +# +# Server-side + + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: http://goto.second.host.now/%TESTNUMBER0002 +Content-Length: 8 +Connection: close + +contents + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 + +contents + + + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: http://goto.second.host.now/%TESTNUMBER0002 +Content-Length: 8 +Connection: close + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Content-Length: 9 + +contents + + + +# +# Client-side + + +http + + +HTTP --oauth2-bearer redirect to new host (not passed on) + + +http://first.host.it.is/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT --oauth2-bearer s3cr3t --proxy-user testing:this --location + + +proxy + + + +# +# Verify data after the test has been "shot" + + +GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1 +Host: first.host.it.is +Proxy-Authorization: Basic %b64[testing:this]b64% +Authorization: Bearer s3cr3t +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + +GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1 +Host: goto.second.host.now +Proxy-Authorization: Basic %b64[testing:this]b64% +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + + + + diff --git a/tests/data/test779 b/tests/data/test779 new file mode 100644 index 000000000000..f833c3782c62 --- /dev/null +++ b/tests/data/test779 @@ -0,0 +1,76 @@ + + + +HTTP +IMAP +oauth2-bearer +followlocation + + +# +# Server-side + + +AUTH XOAUTH2 +REPLY AUTHENTICATE + +REPLY dXNlcj12AWF1dGg9QmVhcmVyIHMzY3IzdAEB B002 OK AUTHENTICATE completed + + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/ +Content-Length: 8 +Connection: close + +contents + + + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/ +Content-Length: 8 +Connection: close + + + + +# +# Client-side + + +http +imap + + +HTTP --oauth2-bearer redirects to IMAP + + +http://%HOSTIP:%HTTPPORT/page/%TESTNUMBER --oauth2-bearer s3cr3t --location --proto-redir imap --resolve host:%IMAPPORT:%HOSTIP + + + +# +# Verify data after the test has been "shot" + + +GET /page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Bearer s3cr3t +User-Agent: curl/%VERSION +Accept: */* + +B001 CAPABILITY + +# curl: (67) Login denied + +67 + + + diff --git a/tests/data/test795 b/tests/data/test795 new file mode 100644 index 000000000000..ab33ea5be6fa --- /dev/null +++ b/tests/data/test795 @@ -0,0 +1,74 @@ + + + +HTTP +IMAP +followlocation + + +# +# Server-side + + +AUTH PLAIN +CAPA SASL-IR +REPLY AUTHENTICATE B002 OK AUTHENTICATE completed + + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/ +Content-Length: 8 +Connection: close + +contents + + + +HTTP/1.1 302 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Funny-head: yesyes +Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/ +Content-Length: 8 +Connection: close + + + + +# +# Client-side + + +http +imap + + +HTTP with credentials redirects to IMAP + + +http://@%HOSTIP:%HTTPPORT/page/%TESTNUMBER -u user:secret --location --proto-redir imap --resolve host:%IMAPPORT:%HOSTIP + + + +# +# Verify data after the test has been "shot" + + +GET /page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Authorization: Basic %b64[user:secret]b64% +User-Agent: curl/%VERSION +Accept: */* + +B001 CAPABILITY +B002 AUTHENTICATE PLAIN AHYA +B003 LIST "%TESTNUMBER0002" * +B004 LOGOUT + + + From 869248cc3e53f0f0e183e057e7c95ffa03ef84c7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Dec 2025 01:43:21 +0100 Subject: [PATCH 757/885] autotools: drop reference to deleted `CURL_CHECK_CURLDEBUG` The referred function has been deleted earlier. Also: - drop commented reference to deleted `CURL_CHECK_OPTION_THREADS`. 0d4fdbf15d8eec908b3e63b606f112b18a63015e #16054 Follow-up to 96a1a05f662677af64b16d862c4126ed52ea4b30 #14096 Closes #19928 --- m4/curl-confopts.m4 | 2 -- 1 file changed, 2 deletions(-) diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4 index a54037369267..ff1b8b744ed3 100644 --- a/m4/curl-confopts.m4 +++ b/m4/curl-confopts.m4 @@ -73,7 +73,6 @@ dnl --enable-ares or --disable-ares, and dnl set shell variable want_ares as appropriate. AC_DEFUN([CURL_CHECK_OPTION_ARES], [ -dnl AC_BEFORE([$0],[CURL_CHECK_OPTION_THREADS])dnl AC_BEFORE([$0],[CURL_CHECK_LIB_ARES])dnl AC_MSG_CHECKING([whether to enable c-ares for DNS lookups]) OPT_ARES="default" @@ -109,7 +108,6 @@ dnl --enable-curldebug or --disable-curldebug, and set dnl shell variable want_curldebug value as appropriate. AC_DEFUN([CURL_CHECK_OPTION_CURLDEBUG], [ - AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG])dnl AC_MSG_CHECKING([whether to enable curl debug memory tracking]) OPT_CURLDEBUG_BUILD="default" AC_ARG_ENABLE(curldebug, From 421f931e7aafb9b64c0b15555ec8d828c8e62948 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Dec 2025 01:52:58 +0100 Subject: [PATCH 758/885] test1165: drop reference to deleted `CURL_DISABLE_TESTS` Follow-up to bf823397bad09791277e983e44e8f0edc3c089b2 #16134 Closes #19929 --- tests/test1165.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test1165.pl b/tests/test1165.pl index 049b764647fd..49806c66ca31 100755 --- a/tests/test1165.pl +++ b/tests/test1165.pl @@ -70,7 +70,7 @@ sub scanconf_cmake { while() { if(/(CURL_DISABLE_[A-Z0-9_]+)/g) { my ($sym)=($1); - if(not $sym =~ /^(CURL_DISABLE_INSTALL|CURL_DISABLE_TESTS|CURL_DISABLE_SRP)$/) { + if(not $sym =~ /^(CURL_DISABLE_INSTALL|CURL_DISABLE_SRP)$/) { $hashr->{$sym} = 1; } } From 8ff5222b4e2b4c18c941fde483b53d1be2674604 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Dec 2025 02:13:46 +0100 Subject: [PATCH 759/885] docs: fold long lines Also: - replace a 'will' found by badwords. - drop duplicate empty lines. Closes #19930 --- docs/ALTSVC.md | 3 +- docs/internals/BUFQ.md | 2 - docs/internals/CLIENT-READERS.md | 139 ++++++++++++++++++++------- docs/internals/CLIENT-WRITERS.md | 93 +++++++++++++----- docs/internals/CONNECTION-FILTERS.md | 11 ++- docs/internals/MQTT.md | 12 +-- docs/internals/SCORECARD.md | 45 +++++---- docs/internals/TLS-SESSIONS.md | 1 - docs/internals/UINT_SETS.md | 124 +++++++++++++----------- docs/tests/HTTP.md | 90 +++++++++++++---- 10 files changed, 352 insertions(+), 168 deletions(-) diff --git a/docs/ALTSVC.md b/docs/ALTSVC.md index bcdf5650743b..24b961a3fb4a 100644 --- a/docs/ALTSVC.md +++ b/docs/ALTSVC.md @@ -35,7 +35,8 @@ space separated fields. 4. The ALPN id for the destination host 5. The hostname for the destination host 6. The port number for the destination host -7. The expiration date and time of this entry within double quotes. The date format is "YYYYMMDD HH:MM:SS" and the time zone is GMT. +7. The expiration date and time of this entry within double quotes. + The date format is "YYYYMMDD HH:MM:SS" and the time zone is GMT. 8. Boolean (1 or 0) if "persist" was set for this entry 9. Integer priority value (not currently used) diff --git a/docs/internals/BUFQ.md b/docs/internals/BUFQ.md index 6028711d2c50..8136d588f6e9 100644 --- a/docs/internals/BUFQ.md +++ b/docs/internals/BUFQ.md @@ -14,7 +14,6 @@ to and read from. It manages read and write positions and has a maximum size. Its basic read/write functions have a similar signature and return code handling as many internal curl read and write ones. - ``` ssize_t Curl_bufq_write(struct bufq *q, const unsigned char *buf, size_t len, CURLcode *err); @@ -150,7 +149,6 @@ reports **full**, but one can **still** write. This option is necessary, if partial writes need to be avoided. It means that you need other checks to keep the `bufq` from growing ever larger and larger. - ## pools A `struct bufc_pool` may be used to create chunks for a `bufq` and keep spare diff --git a/docs/internals/CLIENT-READERS.md b/docs/internals/CLIENT-READERS.md index 35caaa6bfc6d..bb94bba95f11 100644 --- a/docs/internals/CLIENT-READERS.md +++ b/docs/internals/CLIENT-READERS.md @@ -6,26 +6,41 @@ SPDX-License-Identifier: curl # curl client readers -Client readers is a design in the internals of libcurl, not visible in its public API. They were started -in curl v8.7.0. This document describes the concepts, its high level implementation and the motivations. +Client readers is a design in the internals of libcurl, not visible in its +public API. They were started in curl v8.7.0. This document describes +the concepts, its high level implementation and the motivations. ## Naming -`libcurl` operates between clients and servers. A *client* is the application using libcurl, like the command line tool `curl` itself. Data to be uploaded to a server is **read** from the client and **sent** to the server, the servers response is **received** by `libcurl` and then **written** to the client. +`libcurl` operates between clients and servers. A *client* is the application +using libcurl, like the command line tool `curl` itself. Data to be uploaded +to a server is **read** from the client and **sent** to the server, the servers +response is **received** by `libcurl` and then **written** to the client. -With this naming established, client readers are concerned with providing data from the application to the server. Applications register callbacks via `CURLOPT_READFUNCTION`, data via `CURLOPT_POSTFIELDS` and other options to be used by `libcurl` when the request is send. +With this naming established, client readers are concerned with providing data +from the application to the server. Applications register callbacks via +`CURLOPT_READFUNCTION`, data via `CURLOPT_POSTFIELDS` and other options to be +used by `libcurl` when the request is send. ## Invoking -The transfer loop that sends and receives, is using `Curl_client_read()` to get more data to send for a transfer. If no specific reader has been installed yet, the default one that uses `CURLOPT_READFUNCTION` is added. The prototype is +The transfer loop that sends and receives, is using `Curl_client_read()` to get +more data to send for a transfer. If no specific reader has been installed yet, +the default one that uses `CURLOPT_READFUNCTION` is added. The prototype is ``` CURLcode Curl_client_read(struct Curl_easy *data, char *buf, size_t blen, size_t *nread, bool *eos); ``` -The arguments are the transfer to read for, a buffer to hold the read data, its length, the actual number of bytes placed into the buffer and the `eos` (*end of stream*) flag indicating that no more data is available. The `eos` flag may be set for a read amount, if that amount was the last. That way curl can avoid to read an additional time. +The arguments are the transfer to read for, a buffer to hold the read data, its +length, the actual number of bytes placed into the buffer and the `eos` (*end of +stream*) flag indicating that no more data is available. The `eos` flag may be +set for a read amount, if that amount was the last. That way curl can avoid to +read an additional time. -The implementation of `Curl_client_read()` uses a chain of *client reader* instances to get the data. This is similar to the design of *client writers*. The chain of readers allows processing of the data to send. +The implementation of `Curl_client_read()` uses a chain of *client reader* +instances to get the data. This is similar to the design of *client writers*. +The chain of readers allows processing of the data to send. The definition of a reader is: @@ -51,11 +66,17 @@ struct Curl_creader { }; ``` -`Curl_creader` is a reader instance with a `next` pointer to form the chain. It as a type `crt` which provides the implementation. The main callback is `do_read()` which provides the data to the caller. The others are for setup and tear down. `needs_rewind()` is explained further below. +`Curl_creader` is a reader instance with a `next` pointer to form the chain. +It as a type `crt` which provides the implementation. The main callback is +`do_read()` which provides the data to the caller. The others are for setup +and tear down. `needs_rewind()` is explained further below. ## Phases and Ordering -Since client readers may transform the data being read through the chain, the order in which they are called is relevant for the outcome. When a reader is created, it gets the `phase` property in which it operates. Reader phases are defined like: +Since client readers may transform the data being read through the chain, +the order in which they are called is relevant for the outcome. When a reader +is created, it gets the `phase` property in which it operates. Reader phases +are defined like: ``` typedef enum { @@ -67,65 +88,115 @@ typedef enum { } Curl_creader_phase; ``` -If a reader for phase `PROTOCOL` is added to the chain, it is always added *after* any `NET` or `TRANSFER_ENCODE` readers and *before* and `CONTENT_ENCODE` and `CLIENT` readers. If there is already a reader for the same phase, the new reader is added before the existing one(s). +If a reader for phase `PROTOCOL` is added to the chain, it is always added +*after* any `NET` or `TRANSFER_ENCODE` readers and *before* and +`CONTENT_ENCODE` and `CLIENT` readers. If there is already a reader for the +same phase, the new reader is added before the existing one(s). ### Example: `chunked` reader -In `http_chunks.c` a client reader for chunked uploads is implemented. This one operates at phase `CURL_CR_TRANSFER_ENCODE`. Any data coming from the reader "below" has the HTTP/1.1 chunk handling applied and returned to the caller. +In `http_chunks.c` a client reader for chunked uploads is implemented. This +one operates at phase `CURL_CR_TRANSFER_ENCODE`. Any data coming from the +reader "below" has the HTTP/1.1 chunk handling applied and returned to the +caller. -When this reader sees an `eos` from below, it generates the terminal chunk, adding trailers if provided by the application. When that last chunk is fully returned, it also sets `eos` to the caller. +When this reader sees an `eos` from below, it generates the terminal chunk, +adding trailers if provided by the application. When that last chunk is fully +returned, it also sets `eos` to the caller. ### Example: `lineconv` reader -In `sendf.c` a client reader that does line-end conversions is implemented. It operates at `CURL_CR_CONTENT_ENCODE` and converts any "\n" to "\r\n". This is used for FTP ASCII uploads or when the general `crlf` options has been set. +In `sendf.c` a client reader that does line-end conversions is implemented. It +operates at `CURL_CR_CONTENT_ENCODE` and converts any "\n" to "\r\n". This is +used for FTP ASCII uploads or when the general `crlf` options has been set. ### Example: `null` reader -Implemented in `sendf.c` for phase `CURL_CR_CLIENT`, this reader has the simple job of providing transfer bytes of length 0 to the caller, immediately indicating an `eos`. This reader is installed by HTTP for all GET/HEAD requests and when authentication is being negotiated. +Implemented in `sendf.c` for phase `CURL_CR_CLIENT`, this reader has the +simple job of providing transfer bytes of length 0 to the caller, immediately +indicating an `eos`. This reader is installed by HTTP for all GET/HEAD +requests and when authentication is being negotiated. ### Example: `buf` reader -Implemented in `sendf.c` for phase `CURL_CR_CLIENT`, this reader get a buffer pointer and a length and provides exactly these bytes. This one is used in HTTP for sending `postfields` provided by the application. +Implemented in `sendf.c` for phase `CURL_CR_CLIENT`, this reader get a buffer +pointer and a length and provides exactly these bytes. This one is used in +HTTP for sending `postfields` provided by the application. ## Request retries -Sometimes it is necessary to send a request with client data again. Transfer handling can inquire via `Curl_client_read_needs_rewind()` if a rewind (e.g. a reset of the client data) is necessary. This asks all installed readers if they need it and give `FALSE` of none does. +Sometimes it is necessary to send a request with client data again. Transfer +handling can inquire via `Curl_client_read_needs_rewind()` if a rewind (e.g. a +reset of the client data) is necessary. This asks all installed readers if +they need it and give `FALSE` of none does. ## Upload Size -Many protocols need to know the amount of bytes delivered by the client readers in advance. They may invoke `Curl_creader_total_length(data)` to retrieve that. However, not all reader chains know the exact value beforehand. In that case, the call returns `-1` for "unknown". +Many protocols need to know the amount of bytes delivered by the client +readers in advance. They may invoke `Curl_creader_total_length(data)` to +retrieve that. However, not all reader chains know the exact value beforehand. +In that case, the call returns `-1` for "unknown". -Even if the length of the "raw" data is known, the length that is send may not. Example: with option `--crlf` the uploaded content undergoes line-end conversion. The line converting reader does not know in advance how many newlines it may encounter. Therefore it must return `-1` for any positive raw content length. +Even if the length of the "raw" data is known, the length that is send may +not. Example: with option `--crlf` the uploaded content undergoes line-end +conversion. The line converting reader does not know in advance how many +newlines it may encounter. Therefore it must return `-1` for any positive raw +content length. -In HTTP, once the correct client readers are installed, the protocol asks the readers for the total length. If that is known, it can set `Content-Length:` accordingly. If not, it may choose to add an HTTP "chunked" reader. +In HTTP, once the correct client readers are installed, the protocol asks the +readers for the total length. If that is known, it can set `Content-Length:` +accordingly. If not, it may choose to add an HTTP "chunked" reader. -In addition, there is `Curl_creader_client_length(data)` which gives the total length as reported by the reader in phase `CURL_CR_CLIENT` without asking other readers that may transform the raw data. This is useful in estimating the size of an upload. The HTTP protocol uses this to determine if `Expect: 100-continue` shall be done. +In addition, there is `Curl_creader_client_length(data)` which gives the total +length as reported by the reader in phase `CURL_CR_CLIENT` without asking +other readers that may transform the raw data. This is useful in estimating +the size of an upload. The HTTP protocol uses this to determine if `Expect: +100-continue` shall be done. ## Resuming -Uploads can start at a specific offset, if so requested. The "resume from" that offset. This applies to the reader in phase `CURL_CR_CLIENT` that delivers the "raw" content. Resumption can fail if the installed reader does not support it or if the offset is too large. +Uploads can start at a specific offset, if so requested. The "resume from" +that offset. This applies to the reader in phase `CURL_CR_CLIENT` that +delivers the "raw" content. Resumption can fail if the installed reader does +not support it or if the offset is too large. -The total length reported by the reader changes when resuming. Example: resuming an upload of 100 bytes by 25 reports a total length of 75 afterwards. +The total length reported by the reader changes when resuming. Example: +resuming an upload of 100 bytes by 25 reports a total length of 75 afterwards. -If `resume_from()` is invoked twice, it is additive. There is currently no way to undo a resume. +If `resume_from()` is invoked twice, it is additive. There is currently no way +to undo a resume. ## Rewinding -When a request is retried, installed client readers are discarded and replaced by new ones. This works only if the new readers upload the same data. For many readers, this is not an issue. The "null" reader always does the same. Also the `buf` reader, initialized with the same buffer, does this. - -Readers operating on callbacks to the application need to "rewind" the underlying content. For example, when reading from a `FILE*`, the reader needs to `fseek()` to the beginning. The following methods are used: - -1. `Curl_creader_needs_rewind(data)`: tells if a rewind is necessary, given the current state of the reader chain. If nothing really has been read so far, this returns `FALSE`. -2. `Curl_creader_will_rewind(data)`: tells if the reader chain rewinds at the start of the next request. -3. `Curl_creader_set_rewind(data, TRUE)`: marks the reader chain for rewinding at the start of the next request. -4. `Curl_client_start(data)`: tells the readers that a new request starts and they need to rewind if requested. - +When a request is retried, installed client readers are discarded and replaced +by new ones. This works only if the new readers upload the same data. For many +readers, this is not an issue. The "null" reader always does the same. Also +the `buf` reader, initialized with the same buffer, does this. + +Readers operating on callbacks to the application need to "rewind" the +underlying content. For example, when reading from a `FILE*`, the reader needs +to `fseek()` to the beginning. The following methods are used: + +1. `Curl_creader_needs_rewind(data)`: tells if a rewind is necessary, given + the current state of the reader chain. If nothing really has been read so + far, this returns `FALSE`. +2. `Curl_creader_will_rewind(data)`: tells if the reader chain rewinds at + the start of the next request. +3. `Curl_creader_set_rewind(data, TRUE)`: marks the reader chain for rewinding + at the start of the next request. +4. `Curl_client_start(data)`: tells the readers that a new request starts and + they need to rewind if requested. ## Summary and Outlook -By adding the client reader interface, any protocol can control how/if it wants the curl transfer to send bytes for a request. The transfer loop becomes then blissfully ignorant of the specifics. +By adding the client reader interface, any protocol can control how/if it wants +the curl transfer to send bytes for a request. The transfer loop becomes then +blissfully ignorant of the specifics. -The protocols on the other hand no longer have to care to package data most efficiently. At any time, should more data be needed, it can be read from the client. This is used when sending HTTP requests headers to add as much request body data to the initial sending as there is room for. +The protocols on the other hand no longer have to care to package data most +efficiently. At any time, should more data be needed, it can be read from the +client. This is used when sending HTTP requests headers to add as much request +body data to the initial sending as there is room for. Future enhancements based on the client readers: * `expect-100` handling: place that into an HTTP specific reader at diff --git a/docs/internals/CLIENT-WRITERS.md b/docs/internals/CLIENT-WRITERS.md index 9f7197d22890..b07a562afbfb 100644 --- a/docs/internals/CLIENT-WRITERS.md +++ b/docs/internals/CLIENT-WRITERS.md @@ -6,24 +6,35 @@ SPDX-License-Identifier: curl # curl client writers -Client writers is a design in the internals of libcurl, not visible in its public API. They were started -in curl v8.5.0. This document describes the concepts, its high level implementation and the motivations. +Client writers is a design in the internals of libcurl, not visible in its +public API. They were started in curl v8.5.0. This document describes the +concepts, its high level implementation and the motivations. ## Naming -`libcurl` operates between clients and servers. A *client* is the application using libcurl, like the command line tool `curl` itself. Data to be uploaded to a server is **read** from the client and **send** to the server, the servers response is **received** by `libcurl` and then **written** to the client. +`libcurl` operates between clients and servers. A *client* is the application +using libcurl, like the command line tool `curl` itself. Data to be uploaded +to a server is **read** from the client and **send** to the server, the +servers response is **received** by `libcurl` and then **written** to the +client. -With this naming established, client writers are concerned with writing responses from the server to the application. Applications register callbacks via `CURLOPT_WRITEFUNCTION` and `CURLOPT_HEADERFUNCTION` to be invoked by `libcurl` when the response is received. +With this naming established, client writers are concerned with writing +responses from the server to the application. Applications register callbacks +via `CURLOPT_WRITEFUNCTION` and `CURLOPT_HEADERFUNCTION` to be invoked by +`libcurl` when the response is received. ## Invoking -All code in `libcurl` that handles response data is ultimately expected to forward this data via `Curl_client_write()` to the application. The exact prototype of this function is: +All code in `libcurl` that handles response data is ultimately expected to +forward this data via `Curl_client_write()` to the application. The exact +prototype of this function is: ``` CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, size_t blen); ``` -The `type` argument specifies what the bytes in `buf` actually are. The following bits are defined: +The `type` argument specifies what the bytes in `buf` actually are. +The following bits are defined: ``` #define CLIENTWRITE_BODY (1<<0) /* non-meta information, BODY */ #define CLIENTWRITE_INFO (1<<1) /* meta information, not a HEADER */ @@ -35,11 +46,15 @@ The `type` argument specifies what the bytes in `buf` actually are. The followin ``` The main types here are `CLIENTWRITE_BODY` and `CLIENTWRITE_HEADER`. They are -mutually exclusive. The other bits are enhancements to `CLIENTWRITE_HEADER` to -specify what the header is about. They are only used in HTTP and related +mutually exclusive. The other bits are enhancements to `CLIENTWRITE_HEADER` +to specify what the header is about. They are only used in HTTP and related protocols (RTSP and WebSocket). -The implementation of `Curl_client_write()` uses a chain of *client writer* instances to process the call and make sure that the bytes reach the proper application callbacks. This is similar to the design of connection filters: client writers can be chained to process the bytes written through them. The definition is: +The implementation of `Curl_client_write()` uses a chain of *client writer* +instances to process the call and make sure that the bytes reach the proper +application callbacks. This is similar to the design of connection filters: +client writers can be chained to process the bytes written through them. The +definition is: ``` struct Curl_cwtype { @@ -60,11 +75,17 @@ struct Curl_cwriter { }; ``` -`Curl_cwriter` is a writer instance with a `next` pointer to form the chain. It has a type `cwt` which provides the implementation. The main callback is `do_write()` that processes the data and calls then the `next` writer. The others are for setup and tear down. +`Curl_cwriter` is a writer instance with a `next` pointer to form the chain. +It has a type `cwt` which provides the implementation. The main callback is +`do_write()` that processes the data and calls then the `next` writer. The +others are for setup and tear down. ## Phases and Ordering -Since client writers may transform the bytes written through them, the order in which the are called is relevant for the outcome. When a writer is created, one property it gets is the `phase` in which it operates. Writer phases are defined like: +Since client writers may transform the bytes written through them, the order +in which the are called is relevant for the outcome. When a writer is created, +one property it gets is the `phase` in which it operates. Writer phases are +defined like: ``` typedef enum { @@ -76,15 +97,28 @@ typedef enum { } Curl_cwriter_phase; ``` -If a writer for phase `PROTOCOL` is added to the chain, it is always added *after* any `RAW` or `TRANSFER_DECODE` and *before* any `CONTENT_DECODE` and `CLIENT` phase writer. If there is already a writer for the same phase present, the new writer is inserted just before that one. - -All transfers have a chain of 3 writers by default. A specific protocol handler may alter that by adding additional writers. The 3 standard writers are (name, phase): - -1. `"raw", CURL_CW_RAW `: if the transfer is verbose, it forwards the body data to the debug function. -1. `"download", CURL_CW_PROTOCOL`: checks that protocol limits are kept and updates progress counters. When a download has a known length, it checks that it is not exceeded and errors otherwise. -1. `"client", CURL_CW_CLIENT`: the main work horse. It invokes the application callbacks or writes to the configured file handles. It chops large writes into smaller parts, as documented for `CURLOPT_WRITEFUNCTION`. If also handles *pausing* of transfers when the application callback returns `CURL_WRITEFUNC_PAUSE`. - -With these writers always in place, libcurl's protocol handlers automatically have these implemented. +If a writer for phase `PROTOCOL` is added to the chain, it is always added +*after* any `RAW` or `TRANSFER_DECODE` and *before* any `CONTENT_DECODE` and +`CLIENT` phase writer. If there is already a writer for the same phase +present, the new writer is inserted just before that one. + +All transfers have a chain of 3 writers by default. A specific protocol +handler may alter that by adding additional writers. The 3 standard writers +are (name, phase): + +1. `"raw", CURL_CW_RAW `: if the transfer is verbose, it forwards the body data + to the debug function. +1. `"download", CURL_CW_PROTOCOL`: checks that protocol limits are kept and + updates progress counters. When a download has a known length, it checks + that it is not exceeded and errors otherwise. +1. `"client", CURL_CW_CLIENT`: the main work horse. It invokes the application + callbacks or writes to the configured file handles. It chops large writes + into smaller parts, as documented for `CURLOPT_WRITEFUNCTION`. If also + handles *pausing* of transfers when the application callback returns + `CURL_WRITEFUNC_PAUSE`. + +With these writers always in place, libcurl's protocol handlers automatically +have these implemented. ## Enhanced Use @@ -112,12 +146,23 @@ which always is ordered before writers in phase `CURL_CW_CONTENT_DECODE`. What else? -Well, HTTP servers may also apply a `Transfer-Encoding` to the body of a response. The most well-known one is `chunked`, but algorithms like `gzip` and friends could also be applied. The difference to content encodings is that decoding needs to happen *before* protocol checks, for example on length, are done. +Well, HTTP servers may also apply a `Transfer-Encoding` to the body of a +response. The most well-known one is `chunked`, but algorithms like `gzip` and +friends could also be applied. The difference to content encodings is that +decoding needs to happen *before* protocol checks, for example on length, are +done. -That is why transfer decoding writers are added for phase `CURL_CW_TRANSFER_DECODE`. Which makes their operation happen *before* phase `CURL_CW_PROTOCOL` where length may be checked. +That is why transfer decoding writers are added for phase +`CURL_CW_TRANSFER_DECODE`. Which makes their operation happen *before* phase +`CURL_CW_PROTOCOL` where length may be checked. ## Summary -By adding the common behavior of all protocols into `Curl_client_write()` we make sure that they do apply everywhere. Protocol handler have less to worry about. Changes to default behavior can be done without affecting handler implementations. +By adding the common behavior of all protocols into `Curl_client_write()` we +make sure that they do apply everywhere. Protocol handler have less to worry +about. Changes to default behavior can be done without affecting handler +implementations. -Having a writer chain as implementation allows protocol handlers with extra needs, like HTTP, to add to this for special behavior. The common way of writing the actual response data stays the same. +Having a writer chain as implementation allows protocol handlers with extra +needs, like HTTP, to add to this for special behavior. The common way of +writing the actual response data stays the same. diff --git a/docs/internals/CONNECTION-FILTERS.md b/docs/internals/CONNECTION-FILTERS.md index 08fb36738578..3fbb041a16d8 100644 --- a/docs/internals/CONNECTION-FILTERS.md +++ b/docs/internals/CONNECTION-FILTERS.md @@ -271,9 +271,14 @@ conn[curl.se] --> SETUP[TCP] --> HAPPY-EYEBALLS --> TCP[2a04:4e42:c00::347]:443 * transfer ``` -The modular design of connection filters and that we can plug them into each other is used to control the parallel attempts. When a `TCP` filter does not connect (in time), it is torn down and another one is created for the next address. This keeps the `TCP` filter simple. - -The `HAPPY-EYEBALLS` on the other hand stays focused on its side of the problem. We can use it also to make other type of connection by just giving it another filter type to try to have happy eyeballing for QUIC: +The modular design of connection filters and that we can plug them into each +other is used to control the parallel attempts. When a `TCP` filter does not +connect (in time), it is torn down and another one is created for the next +address. This keeps the `TCP` filter simple. + +The `HAPPY-EYEBALLS` on the other hand stays focused on its side of the +problem. We can use it also to make other type of connection by just giving it +another filter type to try to have happy eyeballing for QUIC: ``` * create connection for --http3-only https://curl.se/ diff --git a/docs/internals/MQTT.md b/docs/internals/MQTT.md index 9b8d0efaae2d..acf7464be55c 100644 --- a/docs/internals/MQTT.md +++ b/docs/internals/MQTT.md @@ -12,7 +12,6 @@ A plain "GET" subscribes to the topic and prints all published messages. Doing a "POST" publishes the post data to the topic and exits. - ### Subscribing Command usage: @@ -26,9 +25,10 @@ Example subscribe: This sends an MQTT SUBSCRIBE packet for the topic `bedroom/temp` and listen in for incoming PUBLISH packets. -You can set the upkeep interval ms option to make curl send MQTT ping requests to the -server at an internal, to prevent the connection to get closed because of idleness. -You might then need to use the progress callback to cancel the operation. +You can set the upkeep interval ms option to make curl send MQTT ping requests +to the server at an internal, to prevent the connection to get closed because +of idleness. You might then need to use the progress callback to cancel the +operation. ### Publishing @@ -45,8 +45,8 @@ payload `75`. ## What does curl deliver as a response to a subscribe -Whenever a PUBLISH packet is received, curl outputs two bytes topic length (MSB | LSB), the topic followed by the -payload. +Whenever a PUBLISH packet is received, curl outputs two bytes topic length +(MSB | LSB), the topic followed by the payload. ## Caveats diff --git a/docs/internals/SCORECARD.md b/docs/internals/SCORECARD.md index 546959760417..145267f8c3a6 100644 --- a/docs/internals/SCORECARD.md +++ b/docs/internals/SCORECARD.md @@ -12,14 +12,14 @@ curl/libcurl in a reproducible fashion to judge improvements or detect regressions. They are not intended to represent real world scenarios as such. -This script is not part of any official interface and we may -change it in the future according to the project's needs. +This script is not part of any official interface and we may change it in +the future according to the project's needs. ## setup -When you are able to run curl's `pytest` suite, scorecard should work -for you as well. They start a local Apache httpd or Caddy server and -invoke the locally build `src/curl` (by default). +When you are able to run curl's `pytest` suite, scorecard should work for you +as well. They start a local Apache httpd or Caddy server and invoke the +locally build `src/curl` (by default). ## invocation @@ -29,8 +29,9 @@ A typical invocation for measuring performance of HTTP/2 downloads would be: curl> python3 tests/http/scorecard.py -d h2 ``` -and this prints a table with the results. The last argument is the protocol to test and -it can be `h1`, `h2` or `h3`. You can add `--json` to get results in JSON instead of text. +and this prints a table with the results. The last argument is the protocol to +test and it can be `h1`, `h2` or `h3`. You can add `--json` to get results in +JSON instead of text. Help for all command line options are available via: @@ -40,11 +41,12 @@ curl> python3 tests/http/scorecard.py -h ## scenarios -Apart from `-d/--downloads` there is `-u/--uploads` and `-r/--requests`. These are run with -a variation of resource sizes and parallelism by default. You can specify these in some way -if you are just interested in a particular case. +Apart from `-d/--downloads` there is `-u/--uploads` and `-r/--requests`. These +are run with a variation of resource sizes and parallelism by default. You can +specify these in some way if you are just interested in a particular case. -For example, to run downloads of a 1 MB resource only, 100 times with at max 6 parallel transfers, use: +For example, to run downloads of a 1 MB resource only, 100 times with at max 6 +parallel transfers, use: ``` curl> python3 tests/http/scorecard.py -d --download-sizes=1mb --download-count=100 --download-parallel=6 h2 @@ -61,21 +63,28 @@ involved. (Note: this does not work for HTTP/3) ## flame graphs -With the excellent [Flame Graph](https://github.com/brendangregg/FlameGraph) by Brendan Gregg, scorecard can turn `perf`/`dtrace` samples into an interactive SVG. Either clone the `Flamegraph` repository next to your `curl` project or set the environment variable `FLAMEGRAPH` to the location of your clone. Then run scorecard with the `--flame` option, like +With the excellent [Flame Graph](https://github.com/brendangregg/FlameGraph) +by Brendan Gregg, scorecard can turn `perf`/`dtrace` samples into an +interactive SVG. Either clone the `Flamegraph` repository next to your `curl` +project or set the environment variable `FLAMEGRAPH` to the location of your +clone. Then run scorecard with the `--flame` option, like ``` curl> FLAMEGRAPH=/Users/sei/projects/FlameGraph python3 tests/http/scorecard.py \ -r --request-count=50000 --request-parallels=100 --samples=1 --flame h2 ``` -and the SVG of the run is in `tests/http/gen/curl/curl.flamegraph.svg`. You can open that in Firefox and zoom in/out of stacks of interest. -The flame graph is about the last run of `curl`. That is why you should add scorecard arguments -that restrict measurements to a single run. +and the SVG of the run is in `tests/http/gen/curl/curl.flamegraph.svg`. You +can open that in Firefox and zoom in/out of stacks of interest. + +The flame graph is about the last run of `curl`. That is why you should add +scorecard arguments that restrict measurements to a single run. ### Measures/Privileges -The `--flame` option uses `perf` on linux and `dtrace` on macOS. Since both tools require special -privileges, they are run via the `sudo` command by scorecard. This means you need to issue a -`sudo` recently enough before running scorecard, so no new password check is needed. +The `--flame` option uses `perf` on linux and `dtrace` on macOS. Since both +tools require special privileges, they are run via the `sudo` command by +scorecard. This means you need to issue a `sudo` recently enough before +running scorecard, so no new password check is needed. There is no support right now for measurements on other platforms. diff --git a/docs/internals/TLS-SESSIONS.md b/docs/internals/TLS-SESSIONS.md index 8f887d2e071d..add735bb03bd 100644 --- a/docs/internals/TLS-SESSIONS.md +++ b/docs/internals/TLS-SESSIONS.md @@ -68,7 +68,6 @@ peer keys for this reason. a previous ticket, curl might trust a server which no longer has a root certificate in the file. - ## Session Cache Access #### Lookups diff --git a/docs/internals/UINT_SETS.md b/docs/internals/UINT_SETS.md index 85952c9803fe..5158d7e6bdde 100644 --- a/docs/internals/UINT_SETS.md +++ b/docs/internals/UINT_SETS.md @@ -6,27 +6,26 @@ SPDX-License-Identifier: curl # `uint32_t` Sets -The multi handle tracks added easy handles via an `uint32_t` -it calls an `mid`. There are four data structures for `uint32_t` -optimized for the multi use case. +The multi handle tracks added easy handles via an `uint32_t` it calls an +`mid`. There are four data structures for `uint32_t` optimized for the multi +use case. ## `uint32_tbl` -`uint32_table`, implemented in `uint-table.[ch]` manages an array -of `void *`. The `uint32_t` is the index into this array. It is -created with a *capacity* which can be *resized*. The table assigns -the index when a `void *` is *added*. It keeps track of the last -assigned index and uses the next available larger index for a -subsequent add. Reaching *capacity* it wraps around. +`uint32_table`, implemented in `uint-table.[ch]` manages an array of `void *`. +The `uint32_t` is the index into this array. It is created with a *capacity* +which can be *resized*. The table assigns the index when a `void *` is +*added*. It keeps track of the last assigned index and uses the next available +larger index for a subsequent add. Reaching *capacity* it wraps around. The table *can not* store `NULL` values. The largest possible index is `UINT32_MAX - 1`. -The table is iterated over by asking for the *first* existing index, -meaning the smallest number that has an entry, if the table is not -empty. To get the *next* entry, one passes the index of the previous -iteration step. It does not matter if the previous index is still -in the table. Sample code for a table iteration would look like this: +The table is iterated over by asking for the *first* existing index, meaning +the smallest number that has an entry, if the table is not empty. To get +the *next* entry, one passes the index of the previous iteration step. It does +not matter if the previous index is still in the table. Sample code for a table +iteration would look like this: ```c uint32_t int mid; @@ -50,46 +49,50 @@ This iteration has the following properties: ### Memory -For storing 1000 entries, the table would allocate one block of 8KB on a 64-bit system, -plus the 2 pointers and 3 `uint32_t` in its base `struct uint32_tbl`. A resize -allocates a completely new pointer array, copy the existing entries and free the previous one. +For storing 1000 entries, the table would allocate one block of 8KB on +a 64-bit system, plus the 2 pointers and 3 `uint32_t` in its base `struct +uint32_tbl`. A resize allocates a completely new pointer array, copy +the existing entries and free the previous one. ### Performance -Lookups of entries are only an index into the array, O(1) with a tiny 1. Adding -entries and iterations are more work: +Lookups of entries are only an index into the array, O(1) with a tiny 1. +Adding entries and iterations are more work: -1. adding an entry means "find the first free index larger than the previous assigned - one". Worst case for this is a table with only a single free index where `capacity - 1` - checks on `NULL` values would be performed, O(N). If the single free index is randomly - distributed, this would be O(N/2). -2. iterating a table scans for the first not `NULL` entry after the start index. This - makes a complete iteration O(N) work. +1. adding an entry means "find the first free index larger than the previous + assigned one". Worst case for this is a table with only a single free index + where `capacity - 1` checks on `NULL` values would be performed, O(N). If + the single free index is randomly distributed, this would be O(N/2). +2. iterating a table scans for the first not `NULL` entry after the start + index. This makes a complete iteration O(N) work. -In the multi use case, point 1 is remedied by growing the table so that a good chunk -of free entries always exists. +In the multi use case, point 1 is remedied by growing the table so that a good +chunk of free entries always exists. -Point 2 is less of an issue for a multi, since it does not really matter when the -number of transfer is relatively small. A multi managing a larger set needs to operate -event based anyway and table iterations rarely are needed. +Point 2 is less of an issue for a multi, since it does not really matter when +the number of transfer is relatively small. A multi managing a larger set +needs to operate event based anyway and table iterations rarely are needed. For these reasons, the simple implementation was preferred. Should this become -a concern, there are options like "free index lists" or, alternatively, an internal -bitset that scans better. +a concern, there are options like "free index lists" or, alternatively, an +internal bitset that scans better. ## `uint32_bset` -A bitset for `uint32_t` values, allowing fast add/remove operations. It is initialized -with a *capacity*, meaning it can store only the numbers in the range `[0, capacity-1]`. -It can be *resized* and safely *iterated*. `uint32_bset` is designed to operate in combination with `uint_tbl`. +A bitset for `uint32_t` values, allowing fast add/remove operations. It is +initialized with a *capacity*, meaning it can store only the numbers in the +range `[0, capacity-1]`. It can be *resized* and safely *iterated*. +`uint32_bset` is designed to operate in combination with `uint_tbl`. -The bitset keeps an array of `uint64_t`. The first array entry keeps the numbers 0 to 63, the -second 64 to 127 and so on. A bitset with capacity 1024 would therefore allocate an array -of 16 64-bit values (128 bytes). Operations for an unsigned int divide it by 64 for the array index and then check/set/clear the bit of the remainder. +The bitset keeps an array of `uint64_t`. The first array entry keeps the +numbers 0 to 63, the second 64 to 127 and so on. A bitset with capacity 1024 +would therefore allocate an array of 16 64-bit values (128 bytes). Operations +for an unsigned int divide it by 64 for the array index and then +check/set/clear the bit of the remainder. -Iterator works the same as with `uint32_tbl`: ask the bitset for the *first* number present and -then use that to get the *next* higher number present. Like the table, this safe for -adds/removes and growing the set while iterating. +Iterator works the same as with `uint32_tbl`: ask the bitset for the *first* +number present and then use that to get the *next* higher number present. Like +the table, this safe for adds/removes and growing the set while iterating. ### Memory @@ -98,31 +101,36 @@ A bitset for 40000 transfers occupies 5KB of memory. ## Performance -Operations for add/remove/check are O(1). Iteration needs to scan for the next bit set. The -number of scans is small (see memory footprint) and, for checking bits, many compilers -offer primitives for special CPU instructions. +Operations for add/remove/check are O(1). Iteration needs to scan for the next +bit set. The number of scans is small (see memory footprint) and, for checking +bits, many compilers offer primitives for special CPU instructions. ## `uint32_spbset` -While the memory footprint of `uint32_bset` is good, it still needs 5KB to store the single number 40000. This -is not optimal when many are needed. For example, in event based processing, each socket needs to -keep track of the transfers involved. There are many sockets potentially, but each one mostly tracks -a single transfer or few (on HTTP/2 connection borderline up to 100). +While the memory footprint of `uint32_bset` is good, it still needs 5KB to +store the single number 40000. This is not optimal when many are needed. For +example, in event based processing, each socket needs to keep track of the +transfers involved. There are many sockets potentially, but each one mostly +tracks a single transfer or few (on HTTP/2 connection borderline up to 100). -For such uses cases, the `uint32_spbset` is intended: track a small number of unsigned int, potentially -rather "close" together. It keeps "chunks" with an offset and has no capacity limit. +For such uses cases, the `uint32_spbset` is intended: track a small number of +unsigned int, potentially rather "close" together. It keeps "chunks" with an +offset and has no capacity limit. -Example: adding the number 40000 to an empty sparse bitset would have one chunk with offset 39936, keeping -track of the numbers 39936 to 40192 (a chunk has 4 64-bit values). The numbers in that range can be handled -without further allocations. +Example: adding the number 40000 to an empty sparse bitset would have one +chunk with offset 39936, keeping track of the numbers 39936 to 40192 (a chunk +has 4 64-bit values). The numbers in that range can be handled without further +allocations. -The worst case is then storing 100 numbers that lie in separate intervals. Then 100 chunks -would need to be allocated and linked, resulting in overall 4 KB of memory used. +The worst case is then storing 100 numbers that lie in separate intervals. +Then 100 chunks would need to be allocated and linked, resulting in overall 4 +KB of memory used. Iterating a sparse bitset works the same as for bitset and table. ## `uint32_hash` -At last, there are places in libcurl such as the HTTP/2 and HTTP/3 protocol implementations that need -to store their own data related to a transfer. `uint32_hash` allows then to associate an unsigned int, -e.g. the transfer's `mid`, to their own data. +At last, there are places in libcurl such as the HTTP/2 and HTTP/3 protocol +implementations that need to store their own data related to a transfer. +`uint32_hash` allows then to associate an unsigned int, e.g. the transfer's +`mid`, to their own data. diff --git a/docs/tests/HTTP.md b/docs/tests/HTTP.md index afbfe9e5bd96..658abac25505 100644 --- a/docs/tests/HTTP.md +++ b/docs/tests/HTTP.md @@ -6,7 +6,9 @@ SPDX-License-Identifier: curl # The curl HTTP Test Suite -This is an additional test suite using a combination of Apache httpd and nghttpx servers to perform various tests beyond the capabilities of the standard curl test suite. +This is an additional test suite using a combination of Apache httpd and +nghttpx servers to perform various tests beyond the capabilities of the +standard curl test suite. # Usage @@ -23,13 +25,17 @@ collected 5 items tests/http/test_01_basic.py ..... ``` -Pytest takes arguments. `-v` increases its verbosity and can be used several times. `-k ` can be used to run only matching test cases. The `expr` can be something resembling a python test or just a string that needs to match test cases in their names. +Pytest takes arguments. `-v` increases its verbosity and can be used several +times. `-k ` can be used to run only matching test cases. The `expr` can +be something resembling a python test or just a string that needs to match +test cases in their names. ``` curl/tests/http> pytest -vv -k test_01_02 ``` -runs all test cases that have `test_01_02` in their name. This does not have to be the start of the name. +runs all test cases that have `test_01_02` in their name. This does not have +to be the start of the name. Depending on your setup, some test cases may be skipped and appear as `s` in the output. If you run pytest verbose, it also gives you the reason for @@ -40,7 +46,8 @@ skipping. You need: 1. a recent Python, the `cryptography` module and, of course, `pytest` -2. an apache httpd development version. On Debian/Ubuntu, the package `apache2-dev` has this +2. an apache httpd development version. On Debian/Ubuntu, the package + `apache2-dev` has this 3. a local `curl` project build 3. optionally, a `nghttpx` with HTTP/3 enabled or h3 test cases are skipped @@ -48,33 +55,49 @@ You need: Via curl's `configure` script you may specify: - * `--with-test-nghttpx=` if you have nghttpx to use somewhere outside your `$PATH`. - * `--with-test-httpd=` if you have an Apache httpd installed somewhere else. On Debian/Ubuntu it will otherwise look into `/usr/bin` and `/usr/sbin` to find those. - * `--with-test-caddy=` if you have a Caddy web server installed somewhere else. - * `--with-test-vsftpd=` if you have a vsftpd ftp server installed somewhere else. + * `--with-test-nghttpx=` if you have nghttpx to use + somewhere outside your `$PATH`. + + * `--with-test-httpd=` if you have an Apache httpd + installed somewhere else. On Debian/Ubuntu it otherwise looks into + `/usr/bin` and `/usr/sbin` to find those. + + * `--with-test-caddy=` if you have a Caddy web server + installed somewhere else. + + * `--with-test-vsftpd=` if you have a vsftpd ftp + server installed somewhere else. + * `--with-test-danted=` if you have `dante-server` installed ## Usage Tips -Several test cases are parameterized, for example with the HTTP version to use. If you want to run a test with a particular protocol only, use a command line like: +Several test cases are parameterized, for example with the HTTP version to +use. If you want to run a test with a particular protocol only, use a command +line like: ``` curl/tests/http> pytest -k "test_02_06 and h2" ``` -Test cases can be repeated, with the `pytest-repeat` module (`pip install pytest-repeat`). Like in: +Test cases can be repeated, with the `pytest-repeat` module (`pip install +pytest-repeat`). Like in: ``` curl/tests/http> pytest -k "test_02_06 and h2" --count=100 ``` -which then runs this test case a hundred times. In case of flaky tests, you can make pytest stop on the first one with: +which then runs this test case a hundred times. In case of flaky tests, you +can make pytest stop on the first one with: ``` curl/tests/http> pytest -k "test_02_06 and h2" --count=100 --maxfail=1 ``` -which allow you to inspect output and log files for the failed run. Speaking of log files, the verbosity of pytest is also used to collect curl trace output. If you specify `-v` three times, the `curl` command is started with `--trace`: +which allow you to inspect output and log files for the failed run. Speaking +of log files, the verbosity of pytest is also used to collect curl trace +output. If you specify `-v` three times, the `curl` command is started with +`--trace`: ``` curl/tests/http> pytest -vvv -k "test_02_06 and h2" --count=100 --maxfail=1 @@ -84,7 +107,10 @@ all of curl's output and trace file are found in `tests/http/gen/curl`. ## Writing Tests -There is a lot of [`pytest` documentation](https://docs.pytest.org/) with examples. No use in repeating that here. Assuming you are somewhat familiar with it, it is useful how *this* general test suite is setup. Especially if you want to add test cases. +There is a lot of [`pytest` documentation](https://docs.pytest.org/) with +examples. No use in repeating that here. Assuming you are somewhat familiar +with it, it is useful how *this* general test suite is setup. Especially if +you want to add test cases. ### Servers @@ -110,22 +136,44 @@ left behind. ### Test Cases -Tests making use of these fixtures have them in their parameter list. This tells pytest that a particular test needs them, so it has to create them. Since one can invoke pytest for just a single test, it is important that a test references the ones it needs. +Tests making use of these fixtures have them in their parameter list. This +tells pytest that a particular test needs them, so it has to create them. +Since one can invoke pytest for just a single test, it is important that a +test references the ones it needs. -All test cases start with `test_` in their name. We use a double number scheme to group them. This makes it ease to run only specific tests and also give a short mnemonic to communicate trouble with others in the project. Otherwise you are free to name test cases as you think fitting. +All test cases start with `test_` in their name. We use a double number scheme +to group them. This makes it ease to run only specific tests and also give a +short mnemonic to communicate trouble with others in the project. Otherwise +you are free to name test cases as you think fitting. -Tests are grouped thematically in a file with a single Python test class. This is convenient if you need a special "fixture" for several tests. "fixtures" can have "class" scope. +Tests are grouped thematically in a file with a single Python test class. This +is convenient if you need a special "fixture" for several tests. "fixtures" +can have "class" scope. -There is a curl helper class that knows how to invoke curl and interpret its output. Among other things, it does add the local CA to the command line, so that SSL connections to the test servers are verified. Nothing prevents anyone from running curl directly, for specific uses not covered by the `CurlClient` class. +There is a curl helper class that knows how to invoke curl and interpret its +output. Among other things, it does add the local CA to the command line, so +that SSL connections to the test servers are verified. Nothing prevents anyone +from running curl directly, for specific uses not covered by the `CurlClient` +class. ### mod_curltest -The module source code is found in `testenv/mod_curltest`. It is compiled using the `apxs` command, commonly provided via the `apache2-dev` package. Compilation is quick and done once at the start of a test run. +The module source code is found in `testenv/mod_curltest`. It is compiled +using the `apxs` command, commonly provided via the `apache2-dev` package. +Compilation is quick and done once at the start of a test run. + +The module adds 2 "handlers" to the Apache server (right now). Handler are +pieces of code that receive HTTP requests and generate the response. Those +handlers are: + +* `curltest-echo`: hooked up on the path `/curltest/echo`. This one echoes + a request and copies all data from the request body to the response body. + Useful for simulating upload and checking that the data arrived as intended. -The module adds 2 "handlers" to the Apache server (right now). Handler are pieces of code that receive HTTP requests and generate the response. Those handlers are: +* `curltest-tweak`: hooked up on the path `/curltest/tweak`. This handler is + more of a Swiss army knife. It interprets parameters from the URL query + string to drive its behavior. -* `curltest-echo`: hooked up on the path `/curltest/echo`. This one echoes a request and copies all data from the request body to the response body. Useful for simulating upload and checking that the data arrived as intended. -* `curltest-tweak`: hooked up on the path `/curltest/tweak`. This handler is more of a Swiss army knife. It interprets parameters from the URL query string to drive its behavior. * `status=nnn`: generate a response with HTTP status code `nnn`. * `chunks=n`: generate `n` chunks of data in the response body, defaults to 3. * `chunk_size=nnn`: each chunk should contain `nnn` bytes of data. Maximum is 16KB right now. From 46429d6f44d89bf09ec5c802fbeb8b1e68da2b5e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Dec 2025 02:46:24 +0100 Subject: [PATCH 760/885] GHA/checkdocs: re-enable proselint, update setup, fix issues found - update configuration and invocation. - install via pip. - drop a file exception. - alpha sort proselint settings. - FILEFORMAT: update text about XML compliance. - CI job takes 22 seconds total. Ref: https://github.com/amperser/proselint/releases/tag/v0.16.0 Follow-up to 38bfe1c2aa2a6c8af29d525eb231ad66861199b1 #15314 Closes #19931 --- .github/scripts/requirements-proselint.txt | 5 + .github/workflows/checkdocs.yml | 104 ++++++++++----------- docs/HTTP3.md | 2 +- docs/INFRASTRUCTURE.md | 4 +- docs/cmdline-opts/form.md | 2 +- docs/cmdline-opts/ssl.md | 3 +- docs/cmdline-opts/upload-flags.md | 2 +- docs/internals/CODE_STYLE.md | 4 +- docs/libcurl/opts/CURLOPT_USE_SSL.md | 2 +- docs/tests/FILEFORMAT.md | 7 +- 10 files changed, 68 insertions(+), 67 deletions(-) create mode 100644 .github/scripts/requirements-proselint.txt diff --git a/.github/scripts/requirements-proselint.txt b/.github/scripts/requirements-proselint.txt new file mode 100644 index 000000000000..189610944297 --- /dev/null +++ b/.github/scripts/requirements-proselint.txt @@ -0,0 +1,5 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +proselint==0.16.0 diff --git a/.github/workflows/checkdocs.yml b/.github/workflows/checkdocs.yml index 7962034e9673..9272969275da 100644 --- a/.github/workflows/checkdocs.yml +++ b/.github/workflows/checkdocs.yml @@ -35,59 +35,57 @@ concurrency: permissions: {} jobs: - # proselint: - # name: 'proselint' - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - # with: - # persist-credentials: false - # - # - name: 'install prereqs' - # run: | - # sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - # sudo apt-get -o Dpkg::Use-Pty=0 update - # sudo rm -f /var/lib/man-db/auto-update - # sudo apt-get -o Dpkg::Use-Pty=0 install python3-proselint - # - # # config file help: https://github.com/amperser/proselint/ - # - name: 'create proselint config' - # run: | - # cat < ~/.proselintrc.json - # { - # "checks": { - # "typography.diacritical_marks": false, - # "typography.symbols": false, - # "annotations.misc": false, - # "security.password": false, - # "misc.annotations": false - # } - # } - # JSON - # - # - name: 'trim headers off all *.md files' - # run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl - # - # - name: 'check prose' - # run: git ls-files '*.md' -z | grep -Evz 'CHECKSRC\.md|DISTROS\.md|curl_mprintf\.md|CURLOPT_INTERFACE\.md|interface\.md' | xargs -0 proselint -- README - # - # # This is for CHECKSRC and files with aggressive exclamation mark needs - # - name: 'create second proselint config' - # run: | - # cat < ~/.proselintrc.json - # { - # "checks": { - # "typography.diacritical_marks": false, - # "typography.symbols": false, - # "typography.exclamation": false, - # "lexical_illusions.misc": false, - # "annotations.misc": false - # } - # } - # JSON - # - # - name: 'check special prose' - # run: proselint docs/internals/CHECKSRC.md docs/libcurl/curl_mprintf.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md + # config file help: https://github.com/amperser/proselint/ + proselint: + name: 'proselint' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + with: + persist-credentials: false + + - name: 'install prereqs' + run: | + python3 -m venv ~/venv + ~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r .github/scripts/requirements-proselint.txt + + - name: 'trim headers off all *.md files' + run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl + + - name: 'check prose' + run: | + cat < ~/.proselintrc.json + { + "checks": { + "annotations.misc": false, + "lexical_illusions": false, + "misc.annotations": false, + "redundancy.misc.garner": false, + "security.password": false, + "spelling.ve_of": false, + "typography.diacritical_marks": false, + "typography.symbols": false + } + } + JSON + source ~/venv/bin/activate + git ls-files README '*.md' -z | grep -Evz '(CHECKSRC|DISTROS|CURLOPT_INTERFACE|interface)\.md' | xargs -0 proselint check -- + + - name: 'check special prose' # For CHECKSRC and files with aggressive exclamation mark needs + run: | + cat < ~/.proselintrc.json + { + "checks": { + "annotations.misc": false, + "lexical_illusions": false, + "typography.diacritical_marks": false, + "typography.punctuation.exclamation": false, + "typography.symbols": false + } + } + JSON + source ~/venv/bin/activate + proselint check docs/internals/CHECKSRC.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md pyspelling: name: 'pyspelling' diff --git a/docs/HTTP3.md b/docs/HTTP3.md index 2b0a4c72b872..e18277cb3c87 100644 --- a/docs/HTTP3.md +++ b/docs/HTTP3.md @@ -317,7 +317,7 @@ See this [list of public HTTP/3 servers](https://bagder.github.io/HTTP3-test/) ### HTTPS eyeballing With option `--http3` curl attempts earlier HTTP versions as well should the -connect attempt via HTTP/3 not succeed "fast enough". This strategy is similar +connect attempt via HTTP/3 fail "fast enough". This strategy is similar to IPv4/6 happy eyeballing where the alternate address family is used in parallel after a short delay. diff --git a/docs/INFRASTRUCTURE.md b/docs/INFRASTRUCTURE.md index 7a6bafb9dbab..6acc8757f010 100644 --- a/docs/INFRASTRUCTURE.md +++ b/docs/INFRASTRUCTURE.md @@ -60,7 +60,7 @@ account. We regularly run our code through the [Coverity static code analyzer](https://scan.coverity.com/) thanks to them offering this service to -us for free. +us free of charge. ## CodeSonar @@ -76,7 +76,7 @@ domain names, including `curl.se` and `curl.dev`. Daniel Stenberg owns these domain names. Until a few years ago, the curl website was present at `curl.haxx.se`. The -`haxx.se` domain is owned by Haxx AB, administrated by Daniel Stenberg. The +`haxx.se` domain is owned by Haxx AB, administered by Daniel Stenberg. The curl.haxx.se name is meant to keep working and be redirecting to curl.se for the foreseeable future. diff --git a/docs/cmdline-opts/form.md b/docs/cmdline-opts/form.md index 100e29e5716e..abe4fa998b25 100644 --- a/docs/cmdline-opts/form.md +++ b/docs/cmdline-opts/form.md @@ -127,7 +127,7 @@ text file: curl -F '=(;type=multipart/alternative' \ -F '=plain text message' \ -F '= HTML message;type=text/html' \ - -F '=)' -F '=@textfile.txt' ... smtp://example.com + -F '=)' -F '=@textfile.txt' ... smtp://example.com Data can be encoded for transfer using encoder=. Available encodings are *binary* and *8bit* that do nothing else than adding the corresponding diff --git a/docs/cmdline-opts/ssl.md b/docs/cmdline-opts/ssl.md index 0c0f28172acb..5951d0199123 100644 --- a/docs/cmdline-opts/ssl.md +++ b/docs/cmdline-opts/ssl.md @@ -28,8 +28,7 @@ different levels of encryption required. This option is handled in LDAP (added in 7.81.0). It is fully supported by the OpenLDAP backend and ignored by the generic ldap backend. -Please note that a server may close the connection if the negotiation does -not succeed. +Please note that a server may close the connection if the negotiation fails. This option was formerly known as --ftp-ssl (added in 7.11.0). That option name can still be used but might be removed in a future version. diff --git a/docs/cmdline-opts/upload-flags.md b/docs/cmdline-opts/upload-flags.md index d17614876836..6c014d0895f3 100644 --- a/docs/cmdline-opts/upload-flags.md +++ b/docs/cmdline-opts/upload-flags.md @@ -21,5 +21,5 @@ specified as either a single flag value or a comma-separated list of flag values. These values are case-sensitive and may be negated by prepending them with a '-' character. Currently the following flag values are accepted: answered, deleted, draft, flagged, and -seen. The currently-accepted flag values are used to set flags on +seen. The currently accepted flag values are used to set flags on IMAP uploads. diff --git a/docs/internals/CODE_STYLE.md b/docs/internals/CODE_STYLE.md index 43b873be9b37..d8f97594f5bf 100644 --- a/docs/internals/CODE_STYLE.md +++ b/docs/internals/CODE_STYLE.md @@ -24,8 +24,8 @@ need to copy the style already used in the source code and there are no particularly unusual rules in our set of rules. We also work hard on writing code that are warning-free on all the major -platforms and in general on as many platforms as possible. Code that obviously -causes warnings is not accepted as-is. +platforms and in general on as many platforms as possible. Code that causes +warnings is not accepted as-is. ## Readability diff --git a/docs/libcurl/opts/CURLOPT_USE_SSL.md b/docs/libcurl/opts/CURLOPT_USE_SSL.md index 9a2d2abe5e9a..0729f6e84ee2 100644 --- a/docs/libcurl/opts/CURLOPT_USE_SSL.md +++ b/docs/libcurl/opts/CURLOPT_USE_SSL.md @@ -45,7 +45,7 @@ do not attempt to use SSL. ## CURLUSESSL_TRY Try using SSL, proceed as normal otherwise. Note that server may close the -connection if the negotiation does not succeed. +connection if the negotiation fails. ## CURLUSESSL_CONTROL diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 84188e9dd9dc..4749d809e0d2 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -11,10 +11,9 @@ XML. All data for a single test case resides in a single ASCII file. Labels mark the beginning and the end of all sections, and each label must be written in its own line. Comments are either XML-style (enclosed with ``) or shell script style (beginning with `#`) and must appear on their own -lines and not alongside actual test data. Most test data files are -syntactically-valid XML (a few files are not); lack of support for character -entities is a big difference but macros like %CR fill that particular role -here. +lines and not alongside actual test data. Test data files are syntactically +valid XML; lack of support for character entities is a big difference but macros +like %CR fill that particular role here. Each test case source exists as a file matching the format `tests/data/testNUM`, where `NUM` is the unique test number, and must begin From 624d98e79ccde1304f40967509b56c32feb2da48 Mon Sep 17 00:00:00 2001 From: Christian Schmitz Date: Thu, 11 Dec 2025 14:37:13 +0100 Subject: [PATCH 761/885] transfer: remove @param for err for xfer_recv_resp function. The err parameter in xfer_recv_resp doesn't exist anymore. Removed in cb2bcb681fc9044d2a7adaaa621. Closes #19937 --- lib/transfer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/transfer.c b/lib/transfer.c index 11e7e6e793c3..bd6be821dc2a 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -181,7 +181,6 @@ CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done) * @param buf buffer to keep response data received * @param blen length of `buf` * @param eos_reliable if EOS detection in underlying connection is reliable - * @param err error code in case of -1 return * @return number of bytes read or -1 for error */ static CURLcode xfer_recv_resp(struct Curl_easy *data, From 846eaf4e6b5518f95423b8e95b6a2f70cc144bd4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Dec 2025 15:38:00 +0100 Subject: [PATCH 762/885] RELEASE-NOTES: synced --- RELEASE-NOTES | 72 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d34291718ae4..df1e2a1de13f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,7 +4,7 @@ curl and libcurl 8.18.0 Command line options: 273 curl_easy_setopt() options: 308 Public functions in libcurl: 100 - Contributors: 3557 + Contributors: 3559 This release includes the following changes: @@ -17,6 +17,7 @@ This release includes the following changes: This release includes the following bugfixes: o _PROGRESS.md: add the E unit, mention kibibyte [24] + o alt-svc: more flexibility on same destination [298] o altsvc: make it one malloc instead of three per entry [266] o AmigaOS: increase minimum stack size for tool_main [137] o apple-sectrust: always ask when `native_ca_store` is in use [162] @@ -27,10 +28,13 @@ This release includes the following bugfixes: o auth: always treat Curl_auth_ntlm_get() returning NULL as OOM [186] o autotools: add nettle library detection via pkg-config (for GnuTLS) [178] o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70] + o autotools: fix LargeFile feature display on Windows (after prev patch) [276] + o autotools: tidy-up `if` expressions [275] o badwords: fix issues found in scripts and other files [142] o badwords: fix issues found in tests [156] o build: add build-level `CURL_DISABLE_TYPECHECK` options [163] o build: exclude clang prereleases from compiler warning options [154] + o build: set `-Wno-format-signedness` [288] o build: tidy-up MSVC CRT warning suppression macros [140] o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74] o cf-https-connect: allocate ctx at first in cf_hc_create() [79] @@ -47,8 +51,11 @@ This release includes the following bugfixes: o cmake: save and restore `CMAKE_MODULE_PATH` in `curl-config.cmake` [222] o code: minor indent fixes before closing braces [107] o CODE_STYLE.md: sync banned function list with checksrc.pl [243] + o config-win32.h: delete obsolete, non-Windows comments [295] + o config-win32.h: drop unused/obsolete `CURL_HAS_OPENLDAP_LDAPSDK` [278] o config2setopts: bail out if curl_url_get() returns OOM [102] o config2setopts: exit if curl_url_set() fails on OOM [105] + o configure: delete unused variable [294] o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17] o conncontrol: reuse handling [170] o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100] @@ -62,6 +69,7 @@ This release includes the following bugfixes: o curl: fix progress meter in parallel mode [15] o curl_fopen: do not pass invalid mode flags to `open()` on Windows [84] o curl_gssapi: make sure Curl_gss_log_error() has an initialized buffer [257] + o curl_sasl: if redirected, require permission to use bearer [250] o curl_sasl: make Curl_sasl_decode_mech compare case insensitively [160] o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124] o curl_setup.h: drop stray `#undef stat` (Windows) [103] @@ -70,6 +78,7 @@ This release includes the following bugfixes: o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48] o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49] o CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use [206] + o CURLOPT_FOLLOWLOCATION.md: s/Authentication:/Authorization:/ [283] o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47] o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example o curlx/fopen: replace open CRT functions their with `_s` counterparts (Windows) [204] @@ -79,12 +88,14 @@ This release includes the following bugfixes: o curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows) [143] o curlx: replace `sprintf` with `snprintf` [194] o curlx: use curlx allocators in non-memdebug builds (Windows) [155] + o DEPRECATE: add CMake <3.18 deprecation for April 2026 [291] o digest_sspi: fix a memory leak on error path [149] o digest_sspi: properly free sspi identity [12] o DISTROS.md: add OpenBSD [126] o DISTROS: fix a Mageia URL o DISTROS: remove broken URLs for buildroot o doc: some returned in-memory data may not be altered [196] + o Dockerfile: update debian:bookworm-slim digest to e899040 [305] o docs/libcurl: fix C formatting nits [207] o docs: clarify how to do unix domain sockets with SOCKS proxy [240] o docs: fix checksrc `EQUALSPACE` warnings [21] @@ -100,6 +111,8 @@ This release includes the following bugfixes: o examples: fix minor typo [203] o examples: make functions/data static where missing [139] o examples: tidy-up headers and includes [138] + o examples: use 64-bit `fstat` on Windows [301] + o FAQ/TODO/KNOWN_BUGS: convert to markdown [307] o FAQ: fix hackerone URL o file: do not pass invalid mode flags to `open()` on upload (Windows) [83] o formdata: validate callback is non-NULL before use [267] @@ -110,8 +123,10 @@ This release includes the following bugfixes: o gnutls: add PROFILE_MEDIUM as default [233] o gnutls: report accurate error when TLS-SRP is not built-in [18] o gtls: add return checks and optimize the code [2] + o gtls: Call keylog_close in cleanup o gtls: skip session resumption when verifystatus is set o h2/h3: handle methods with spaces [146] + o headers: add length argument to Curl_headers_push() [309] o hostcheck: fail wildcard match if host starts with a dot [235] o hostip: don't store negative lookup on OOM [61] o hostip: make more functions return CURLcode [202] @@ -129,11 +144,13 @@ This release includes the following bugfixes: o idn: avoid allocations and wcslen on Windows [247] o idn: fix memory leak in `win32_ascii_to_idn()` [173] o idn: use curlx allocators on Windows [165] + o imap: check buffer length before accessing it [308] o imap: make sure Curl_pgrsSetDownloadSize() does not overflow [200] o INSTALL-CMAKE.md: document static option defaults more [37] o krb5: fix detecting channel binding feature [187] o krb5_sspi: unify a part of error handling [80] o ldap: call ldap_init() before setting the options [236] + o ldap: drop PP logic for old, unsupported, Windows SDKs [279] o ldap: improve detection of Apple LDAP [174] o ldap: provide version for "legacy" ldap as well [254] o lib/sendf.h: forward declare two structs [221] @@ -162,11 +179,13 @@ This release includes the following bugfixes: o mbedtls_threadlock: avoid calloc, use array [244] o mdlinkcheck: ignore IP numbers, allow '@' in raw URLs o memdebug: add mutex for thread safety [184] + o memdebug: fix realloc logging [286] o mk-ca-bundle.md: the file format docs URL is permaredirected [188] o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73] o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71] o mqtt: reject overly big messages [39] o multi: make max_total_* members size_t [158] + o multi: remove MSTATE_TUNNELING [297] o multi: simplify admin handle processing [189] o multibyte: limit `curlx_convert_*wchar*()` functions to Unicode builds [135] o ngtcp2+openssl: fix leak of session [172] @@ -190,6 +209,7 @@ This release includes the following bugfixes: o pytest: disable two H3 earlydata tests for all platforms (was: macOS) [116] o pytest: fix and improve reliability [251] o pytest: improve stragglers [252] + o pytest: quiche flakiness [280] o pytest: skip H2 tests if feature missing from curl [46] o quiche: use client writer [255] o ratelimit: redesign [209] @@ -228,6 +248,7 @@ This release includes the following bugfixes: o test1475: consistently use %CR in headers [234] o test1498: disable 'HTTP PUT from stdin' test on Windows [115] o test2045: replace HTML multi-line comment markup with `#` comments [36] + o test318: tweak the name a little o test3207: enable memdebug for this test again [249] o test363: delete stray character (typo) from a section tag [52] o test787: fix possible typo `&` -> `%` in curl option [241] @@ -243,6 +264,7 @@ This release includes the following bugfixes: o tftpd: fix/tidy up `open()` mode flags [57] o tidy-up: avoid `(())`, clang-format fixes and more [141] o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121] + o tidy-up: URLs (cont.) and mdlinkcheck [285] o tidy-up: URLs [182] o TODO: remove a mandriva.com reference o tool: consider (some) curl_easy_setopt errors fatal [7] @@ -276,6 +298,7 @@ This release includes the following bugfixes: o vtls: handle possible malicious certs_num from peer [53] o vtls: pinned key check [98] o wcurl: import v2025.11.09 [29] + o windows: assume `USE_WIN32_LARGE_FILES` [292] o windows: use `_strdup()` instead of `strdup()` where missing [145] o wolfSSL: able to differentiate between IP and DNS in alt names [13] o wolfssl: avoid NULL dereference in OOM situation [77] @@ -304,18 +327,20 @@ Planned upcoming removals include: This release would not have looked like this without help, code, reports and advice from friends like these: - Aleksandr Sergeev, Aleksei Bavshin, Andrew Kirillov, BANADDA, boingball, - Brad King, bttrfl on github, Christian Schmitz, Dan Fandrich, - Daniel McCarney, Daniel Stenberg, Denis Goleshchikhin, Deniz Parlak, - dependabot[bot], Fabian Keil, Fd929c2CE5fA on github, ffath-vo on github, - Georg Schulz-Allgaier, Gisle Vanem, Greg Hudson, Harry Sintonen, Jiyong Yang, - Juliusz Sosinowicz, Kai Pastor, Leonardo Taccari, letshack9707 on hackerone, - Marc Aldorasi, Marcel Raad, Max Faxälv, nait-furry, ncaklovic on github, - Nick Korepanov, Omdahake on github, Patrick Monnerat, pelioro on hackerone, - Ray Satiro, renovate[bot], Robert W. Van Kirk, Samuel Henrique, - st751228051 on github, Stanislav Fort, Stefan Eissing, Sunny, Theo Buehler, - Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang, Yedaya Katsman - (49 contributors) + Aleksandr Sergeev, Aleksei Bavshin, Andrew Kirillov, + anonymous237 on hackerone, BANADDA, boingball, Brad King, bttrfl on github, + Christian Schmitz, Dan Fandrich, Daniel McCarney, Daniel Stenberg, + Denis Goleshchikhin, Deniz Parlak, dependabot[bot], Fabian Keil, + Fd929c2CE5fA on github, ffath-vo on github, Georg Schulz-Allgaier, + Gisle Vanem, Greg Hudson, Harry Sintonen, Jiyong Yang, Juliusz Sosinowicz, + Kai Pastor, Leonardo Taccari, letshack9707 on hackerone, Marc Aldorasi, + Marcel Raad, Max Faxälv, nait-furry, ncaklovic on github, Nick Korepanov, + Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro, + renovate[bot], Robert W. Van Kirk, Samuel Henrique, st751228051 on github, + Stanislav Fort, Stefan Eissing, Sunny, Theo Buehler, Thomas Klausner, + Viktor Szakats, Wesley Moore, Xiaoke Wang, Yedaya Katsman, Yuhao Jiang, + yushicheng7788 on github + (52 contributors) References to bug reports and discussions on issues: @@ -563,6 +588,7 @@ References to bug reports and discussions on issues: [247] = https://curl.se/bug/?i=19798 [248] = https://curl.se/bug/?i=19811 [249] = https://curl.se/bug/?i=19813 + [250] = https://curl.se/bug/?i=19933 [251] = https://curl.se/bug/?i=19970 [252] = https://curl.se/bug/?i=19809 [253] = https://curl.se/bug/?i=19800 @@ -581,3 +607,23 @@ References to bug reports and discussions on issues: [266] = https://curl.se/bug/?i=19857 [267] = https://curl.se/bug/?i=19858 [268] = https://curl.se/bug/?i=19753 + [275] = https://curl.se/bug/?i=18189 + [276] = https://curl.se/bug/?i=19922 + [278] = https://curl.se/bug/?i=19920 + [279] = https://curl.se/bug/?i=19918 + [280] = https://curl.se/bug/?i=19770 + [283] = https://curl.se/bug/?i=19915 + [285] = https://curl.se/bug/?i=19911 + [286] = https://curl.se/bug/?i=19900 + [288] = https://curl.se/bug/?i=19907 + [291] = https://curl.se/bug/?i=19902 + [292] = https://curl.se/bug/?i=19888 + [294] = https://curl.se/bug/?i=19901 + [295] = https://curl.se/bug/?i=19899 + [297] = https://curl.se/bug/?i=19894 + [298] = https://curl.se/bug/?i=19740 + [301] = https://curl.se/bug/?i=19896 + [305] = https://curl.se/bug/?i=19891 + [307] = https://curl.se/bug/?i=19875 + [308] = https://curl.se/bug/?i=19887 + [309] = https://curl.se/bug/?i=19886 From 2e3687c60c5c9720992a7cebf9493ec2d28a1cf6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Dec 2025 17:16:37 +0100 Subject: [PATCH 763/885] mdlinkcheck: only look for markdown links in markdown files It finds debug outputs in source code otherwise. Output the whitelist "warnings" to stderr to better allow us to count URLs with `./mdlinkcheck --dry-run | wc -l`. Closes #19938 --- scripts/mdlinkcheck | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/mdlinkcheck b/scripts/mdlinkcheck index bd54d96fe2ea..4ee0b537525a 100755 --- a/scripts/mdlinkcheck +++ b/scripts/mdlinkcheck @@ -158,9 +158,12 @@ sub findlinks { open(F, "<:crlf", "$f") || return; + # is it a markdown extension? + my $md = ($f =~ /\.md$/i); + while() { chomp; - if(/\]\(([^)]*)/) { + if($md && /\]\(([^)]*)/) { my $link = $1; #print "$f:$line $link\n"; storelink($f, $line, $link); @@ -209,7 +212,7 @@ for my $f (@files) { for my $u (sort keys %whitelist) { if($whitelist{$u} == 1) { - printf "warning: unused whitelist entry: '$u'\n"; + printf STDERR "warning: unused whitelist entry: '$u'\n"; } } From 141ce4be64aaf79cfdd5f66f6d1e8466c3c7d2e4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:24:51 +0000 Subject: [PATCH 764/885] GHA: update actions/cache action to v5 Closes #19940 --- .github/workflows/http3-linux.yml | 46 +++++++++++++++---------------- .github/workflows/linux.yml | 24 ++++++++-------- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 86c9f3459d7c..a9b8c44f0006 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -68,7 +68,7 @@ jobs: steps: - name: 'cache openssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-openssl-http3-no-deprecated env: cache-name: cache-openssl-http3-no-deprecated @@ -77,7 +77,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }} - name: 'cache libressl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-libressl env: cache-name: cache-libressl @@ -86,7 +86,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }} - name: 'cache awslc' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-awslc env: cache-name: cache-awslc @@ -95,7 +95,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }} - name: 'cache boringssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-boringssl env: cache-name: cache-boringssl @@ -104,7 +104,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }} - name: 'cache nettle' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nettle env: cache-name: cache-nettle @@ -113,7 +113,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }} - name: 'cache gnutls' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-gnutls env: cache-name: cache-gnutls @@ -122,7 +122,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }} - name: 'cache wolfssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-wolfssl env: cache-name: cache-wolfssl @@ -131,7 +131,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }} - name: 'cache nghttp3' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nghttp3 env: cache-name: cache-nghttp3 @@ -140,7 +140,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP3_VERSION }} - name: 'cache ngtcp2' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-ngtcp2 env: cache-name: cache-ngtcp2 @@ -149,7 +149,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }} - name: 'cache ngtcp2 boringssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-ngtcp2-boringssl env: cache-name: cache-ngtcp2-boringssl @@ -158,7 +158,7 @@ jobs: key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.BORINGSSL_VERSION }} - name: 'cache nghttp2' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nghttp2 env: cache-name: cache-nghttp2 @@ -486,7 +486,7 @@ jobs: echo 'CXX=g++-12' >> "$GITHUB_ENV" - name: 'cache openssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-openssl-http3-no-deprecated env: cache-name: cache-openssl-http3-no-deprecated @@ -496,7 +496,7 @@ jobs: fail-on-cache-miss: true - name: 'cache libressl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-libressl env: cache-name: cache-libressl @@ -506,7 +506,7 @@ jobs: fail-on-cache-miss: true - name: 'cache awslc' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-awslc env: cache-name: cache-awslc @@ -516,7 +516,7 @@ jobs: fail-on-cache-miss: true - name: 'cache boringssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-boringssl env: cache-name: cache-boringssl @@ -527,7 +527,7 @@ jobs: - name: 'cache nettle' if: ${{ matrix.build.name == 'gnutls' }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nettle env: cache-name: cache-nettle @@ -538,7 +538,7 @@ jobs: - name: 'cache gnutls' if: ${{ matrix.build.name == 'gnutls' }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-gnutls env: cache-name: cache-gnutls @@ -549,7 +549,7 @@ jobs: - name: 'cache wolfssl' if: ${{ matrix.build.name == 'wolfssl' }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-wolfssl env: cache-name: cache-wolfssl @@ -559,7 +559,7 @@ jobs: fail-on-cache-miss: true - name: 'cache nghttp3' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nghttp3 env: cache-name: cache-nghttp3 @@ -569,7 +569,7 @@ jobs: fail-on-cache-miss: true - name: 'cache ngtcp2' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-ngtcp2 env: cache-name: cache-ngtcp2 @@ -579,7 +579,7 @@ jobs: fail-on-cache-miss: true - name: 'cache ngtcp2 boringssl' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-ngtcp2-boringssl env: cache-name: cache-ngtcp2-boringssl @@ -589,7 +589,7 @@ jobs: fail-on-cache-miss: true - name: 'cache nghttp2' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nghttp2 env: cache-name: cache-nghttp2 @@ -600,7 +600,7 @@ jobs: - name: 'cache quiche' if: ${{ matrix.build.name == 'quiche' }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-quiche env: cache-name: cache-quiche diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2bcdf4e223ba..3a9c35fe385c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -399,7 +399,7 @@ jobs: - name: 'cache libressl' if: ${{ contains(matrix.build.install_steps, 'libressl') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-libressl env: cache-name: cache-libressl @@ -419,7 +419,7 @@ jobs: - name: 'cache libressl (filc)' if: ${{ contains(matrix.build.install_steps, 'libressl-filc') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-libressl-filc env: cache-name: cache-libressl-filc @@ -440,7 +440,7 @@ jobs: - name: 'cache nghttp2 (filc)' if: ${{ contains(matrix.build.install_steps, 'nghttp2-filc') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-nghttp2-filc env: cache-name: cache-nghttp2-filc @@ -462,7 +462,7 @@ jobs: - name: 'cache wolfssl (all)' if: ${{ contains(matrix.build.install_steps, 'wolfssl-all') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-wolfssl-all env: cache-name: cache-wolfssl-all @@ -483,7 +483,7 @@ jobs: - name: 'cache wolfssl (opensslextra)' # does support `OPENSSL_COEXIST` if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-wolfssl-opensslextra env: cache-name: cache-wolfssl-opensslextra @@ -504,7 +504,7 @@ jobs: - name: 'cache mbedtls' if: ${{ contains(matrix.build.install_steps, 'mbedtls') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-mbedtls-threadsafe env: cache-name: cache-mbedtls-threadsafe @@ -527,7 +527,7 @@ jobs: - name: 'cache mbedtls (prev)' if: ${{ contains(matrix.build.install_steps, 'mbedtls-prev') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-mbedtls-threadsafe-prev env: cache-name: cache-mbedtls-threadsafe-prev @@ -550,7 +550,7 @@ jobs: - name: 'cache openldap (static)' if: ${{ contains(matrix.build.install_steps, 'openldap-static') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-openldap-static env: cache-name: cache-openldap-static @@ -569,7 +569,7 @@ jobs: - name: 'cache openssl (thread sanitizer)' if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-openssl-tsan env: cache-name: cache-openssl-tsan @@ -588,7 +588,7 @@ jobs: - name: 'cache awslc' if: ${{ contains(matrix.build.install_steps, 'awslc') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-awslc env: cache-name: cache-awslc @@ -608,7 +608,7 @@ jobs: - name: 'cache boringssl' if: ${{ contains(matrix.build.install_steps, 'boringssl') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-boringssl env: cache-name: cache-boringssl @@ -629,7 +629,7 @@ jobs: - name: 'cache rustls' if: ${{ contains(matrix.build.install_steps, 'rustls') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-rustls env: cache-name: cache-rustls diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 25ac41c61ee1..8ed4ef14eab2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -112,7 +112,7 @@ jobs: - name: 'cache libressl' if: ${{ contains(matrix.build.install_steps, 'libressl') }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-libressl env: cache-name: cache-libressl diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9d7f0dc88d32..d3d3de8522da 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -480,7 +480,7 @@ jobs: ${{ matrix.install }} - name: 'cache compiler (gcc ${{ matrix.ver }}-${{ matrix.env }})' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 id: cache-compiler with: path: D:\my-cache From fe8393d7db8c9c708f7dc45e5ee3b2c1eb9d979a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Dec 2025 16:49:55 +0100 Subject: [PATCH 765/885] tidy-up: miscellaneous - drop stray duplicate empty lines in docs, scripts, test data, include, examples, tests. - drop duplicate PP parenthesis. - curl-functions.m4: move literals to the right side in if expressions, to match rest of the source code. - FAQ.md: delete language designator from an URL. - packages: apply clang-format (OS400, VMS). - scripts/schemetable.c: apply clang-format. - data320: delete duplicate empty line that doesn't change the outcome. - spacecheck: extend to check for duplicate empty lines (with exceptions.) - fix whitespace nits Closes #19936 --- .github/scripts/cmp-config.pl | 1 - .github/scripts/randcurl.pl | 1 - .github/scripts/spacecheck.pl | 26 +- .github/scripts/verify-synopsis.pl | 1 - .github/workflows/macos.yml | 2 +- CMake/CurlTests.c | 19 +- CMakeLists.txt | 1 - acinclude.m4 | 2 +- configure.ac | 9 - docs/FAQ.md | 3 +- docs/MANUAL.md | 1 - docs/SSLCERTS.md | 1 - docs/TODO.md | 1 - docs/TheArtOfHttpScripting.md | 1 - docs/examples/ephiperfifo.c | 1 - docs/examples/evhiperfifo.c | 1 - docs/examples/ghiper.c | 1 - docs/examples/hiperfifo.c | 1 - docs/examples/htmltitle.cpp | 4 +- docs/examples/http2-upload.c | 2 +- docs/examples/postit2-formadd.c | 1 - docs/libcurl/curl_easy_getinfo.md | 1 - include/curl/curl.h | 38 +-- include/curl/easy.h | 2 - include/curl/multi.h | 94 +++--- include/curl/typecheck-gcc.h | 7 +- lib/cf-https-connect.h | 1 - lib/cfilters.h | 1 - lib/config-os400.h | 1 - lib/curl_hmac.h | 1 - lib/curl_memrchr.h | 2 +- lib/curl_setup_once.h | 1 - lib/curl_trc.h | 1 - lib/cw-pause.h | 1 - lib/dynhds.h | 1 - lib/functypes.h | 1 - lib/hostip.h | 1 - lib/http.h | 1 - lib/ldap.c | 2 +- lib/optiontable.pl | 2 - lib/setup-os400.h | 4 - lib/urldata.h | 1 - lib/vquic/vquic.h | 1 - lib/vtls/gtls.c | 2 +- lib/vtls/x509asn1.c | 2 +- m4/curl-amissl.m4 | 3 +- m4/curl-functions.m4 | 162 +++++----- packages/OS400/ccsidcurl.c | 420 +++++++++++--------------- packages/OS400/ccsidcurl.h | 1 - packages/OS400/curlcl.c | 25 +- packages/OS400/curlmain.c | 14 +- packages/OS400/os400sys.c | 255 +++++++--------- packages/OS400/os400sys.h | 35 +-- packages/vms/curl_crtl_init.c | 56 ++-- packages/vms/curlmsg.h | 170 +++++------ packages/vms/report_openssl_version.c | 15 +- scripts/cd2cd | 1 - scripts/checksrc.pl | 1 - scripts/ciconfig.pl | 2 - scripts/delta | 2 +- scripts/firefox-db2pem.sh | 1 - scripts/managen | 3 - scripts/mk-ca-bundle.pl | 1 - scripts/schemetable.c | 85 +++--- src/tool_parsecfg.c | 1 - tests/appveyor.pm | 1 - tests/data/data320.html | 1 - tests/data/test1109 | 1 - tests/data/test1110 | 1 - tests/data/test1111 | 1 - tests/data/test1331 | 2 - tests/data/test1408 | 2 - tests/data/test1409 | 1 - tests/data/test1410 | 1 - tests/data/test1411 | 1 - tests/data/test161 | 1 - tests/data/test2030 | 1 - tests/data/test2045 | 1 - tests/data/test206 | 1 - tests/data/test2202 | 1 - tests/data/test228 | 1 - tests/data/test3105 | 1 - tests/data/test399 | 1 - tests/data/test698 | 1 - tests/devtest.pl | 3 - tests/directories.pm | 1 - tests/getpart.pm | 11 +- tests/globalconfig.pm | 1 - tests/libtest/cli_ftp_upload.c | 5 +- tests/libtest/lib651.c | 1 - tests/libtest/mk-lib1521.pl | 2 - tests/libtest/unitcheck.h | 1 + tests/negtelnetserver.py | 11 - tests/pathhelp.pm | 1 - tests/processhelp.pm | 3 - tests/runner.pm | 15 - tests/runtests.pl | 23 +- tests/serverhelp.pm | 16 - tests/servers.pm | 13 - tests/smbserver.py | 1 - tests/sshhelp.pm | 23 -- tests/sshserver.pl | 34 --- tests/test1119.pl | 1 - tests/test1139.pl | 2 - tests/test1140.pl | 3 - tests/test1165.pl | 1 - tests/test1167.pl | 1 - tests/test1173.pl | 2 - tests/test1222.pl | 4 +- tests/test1275.pl | 1 - tests/test1477.pl | 1 - tests/testcurl.pl | 1 - tests/testutil.pm | 2 - tests/unit/unit1397.c | 4 +- tests/util.py | 3 - tests/valgrind.pm | 1 - 116 files changed, 675 insertions(+), 1040 deletions(-) diff --git a/.github/scripts/cmp-config.pl b/.github/scripts/cmp-config.pl index 3ad0570e2839..a74389637f16 100755 --- a/.github/scripts/cmp-config.pl +++ b/.github/scripts/cmp-config.pl @@ -136,6 +136,5 @@ sub grepit { } } - # return the exit code from diff exit system("diff -u /tmp/autotools /tmp/cmake") >> 8; diff --git a/.github/scripts/randcurl.pl b/.github/scripts/randcurl.pl index b085d2ef13d5..f9c24d90db6c 100755 --- a/.github/scripts/randcurl.pl +++ b/.github/scripts/randcurl.pl @@ -116,7 +116,6 @@ sub randarg { '26' => 1, ); - sub runone { my $a; my $nargs = getnum(60) + 1; diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl index 2c3a2e3b0a61..f06766570c75 100755 --- a/.github/scripts/spacecheck.pl +++ b/.github/scripts/spacecheck.pl @@ -39,6 +39,13 @@ "\\.(bat|sln)\$", ); +my @double_empty_lines = ( + "^lib/.+\\.(c|h)\$", + "^packages/", + "^tests/data/test", + "\\.(m4|py)\$", +); + my @non_ascii_allowed = ( '\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS ); @@ -100,7 +107,7 @@ sub eol_detect { my @err = (); if(!fn_match($filename, @tabs) && - $content =~ /\t/) { + $content =~ /\t/) { push @err, "content: has tab"; } @@ -111,12 +118,12 @@ sub eol_detect { } if($eol ne "crlf" && - fn_match($filename, @need_crlf)) { + fn_match($filename, @need_crlf)) { push @err, "content: must use CRLF EOL for this file type"; } if($eol ne "lf" && $content ne "" && - !fn_match($filename, @need_crlf)) { + !fn_match($filename, @need_crlf)) { push @err, "content: must use LF EOL for this file type"; } @@ -131,20 +138,27 @@ sub eol_detect { } if($content ne "" && - $content !~ /\n\z/) { + $content !~ /\n\z/) { push @err, "content: has no EOL at EOF"; } if($content =~ /\n\n\z/ || - $content =~ /\r\n\r\n\z/) { + $content =~ /\r\n\r\n\z/) { push @err, "content: has multiple EOL at EOF"; } if($content =~ /\n\n\n\n/ || - $content =~ /\r\n\r\n\r\n\r\n/) { + $content =~ /\r\n\r\n\r\n\r\n/) { push @err, "content: has 3 or more consecutive empty lines"; } + if(!fn_match($filename, @double_empty_lines)) { + if($content =~ /\n\n\n/ || + $content =~ /\r\n\r\n\r\n/) { + push @err, "content: has 2 consecutive empty lines"; + } + } + if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) { push @err, "content: has binary contents"; } diff --git a/.github/scripts/verify-synopsis.pl b/.github/scripts/verify-synopsis.pl index 1c6b00b60bd1..19fbc31a7c81 100755 --- a/.github/scripts/verify-synopsis.pl +++ b/.github/scripts/verify-synopsis.pl @@ -39,7 +39,6 @@ sub testcompile { return $rc; } - sub extract { my($f) = @_; my $syn = 0; diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8ed4ef14eab2..cae51f5f7ec7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -618,7 +618,7 @@ jobs: - name: 'configure / ${{ matrix.build }}' run: | - if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ] ; then + if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ]; then # Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2793243409 /opt/homebrew/opt/gcc@13/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders fi diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c index 40fa50fe83dc..a06c7701f57b 100644 --- a/CMake/CurlTests.c +++ b/CMake/CurlTests.c @@ -29,7 +29,7 @@ #include /* */ #if defined(sun) || defined(__sun__) || \ - defined(__SUNPRO_C) || defined(__SUNPRO_CC) + defined(__SUNPRO_C) || defined(__SUNPRO_CC) # if defined(__SVR4) || defined(__srv4__) # define PLATFORM_SOLARIS # else @@ -119,7 +119,10 @@ int main(void) #include #include #include -int main(void) { return 0; } +int main(void) +{ + return 0; +} #endif #ifdef HAVE_FILE_OFFSET_BITS @@ -128,7 +131,7 @@ int main(void) { return 0; } We cannot simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -272,7 +275,10 @@ int main(void) #include #include -static void check(char c) { (void)c; } +static void check(char c) +{ + (void)c; +} int main(void) { @@ -289,7 +295,10 @@ int main(void) #include /* Float, because a pointer cannot be implicitly cast to float */ -static void check(float f) { (void)f; } +static void check(float f) +{ + (void)f; +} int main(void) { diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b3cbecc51f0..af3d1f88464e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1833,7 +1833,6 @@ if(CURL_LTO) endif() endif() - # Ugly (but functional) way to include "Makefile.inc" by transforming it # (= regenerate it). function(curl_transform_makefile_inc _input_file _output_file) diff --git a/acinclude.m4 b/acinclude.m4 index d95cbd3f5b6d..f38eac821107 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -769,7 +769,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ #include ]],[[ struct timeval ts; - ts.tv_sec = 0; + ts.tv_sec = 0; ts.tv_usec = 0; (void)ts; ]]) diff --git a/configure.ac b/configure.ac index 3c0bfaa3531f..e465ee6a8aef 100644 --- a/configure.ac +++ b/configure.ac @@ -520,7 +520,6 @@ if test "$xc_lt_build_static_only" = "yes"; then fi AC_SUBST([LIBCURL_PC_CFLAGS]) - dnl ********************************************************************** dnl platform/compiler/architecture specific checks/flags dnl ********************************************************************** @@ -2152,7 +2151,6 @@ if test "x$OPT_LIBPSL" != "xno"; then fi AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"]) - dnl ********************************************************************** dnl Check for libgsasl dnl ********************************************************************** @@ -2236,7 +2234,6 @@ AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to AS_HELP_STRING([--with-libssh2], [enable libssh2]), OPT_LIBSSH2=$withval, OPT_LIBSSH2=no) - OPT_LIBSSH=off AC_ARG_WITH(libssh,dnl AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) @@ -2619,7 +2616,6 @@ if test "x$OPT_LIBRTMP" != "xno"; then dnl a pkgconfig file AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) fi - ;; off) dnl no --with-librtmp option given, just check default places @@ -3685,7 +3681,6 @@ if test "$want_nghttp3" != "no"; then CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS ) - else dnl no nghttp3 pkg-config found, deal with it if test "$want_nghttp3" != "default"; then @@ -3898,7 +3893,6 @@ if test "$want_libuv" != "no"; then CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS ) - else dnl no libuv pkg-config found, deal with it if test "$want_libuv" != "default"; then @@ -4042,7 +4036,6 @@ dnl default includes ] ) - dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T @@ -4977,7 +4970,6 @@ if test "$hsts" != "yes"; then AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc]) fi - dnl ************************************************************* dnl check whether ECH support, if desired, is actually available dnl @@ -5042,7 +5034,6 @@ else fi fi - dnl ************************************************************* dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio dnl diff --git a/docs/FAQ.md b/docs/FAQ.md index eba30f1fefd5..0febe1b73ca6 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -827,7 +827,6 @@ chain. Details are also in [the SSL certificates document](https://curl.se/docs/sslcerts.html). - ## Why is curl -R on Windows one hour off? Since curl 7.53.0 this issue should be fixed as long as curl was built with @@ -891,7 +890,7 @@ the second. No more than three packets are sent, no matter how long the timeout is set. See option `TcpMaxConnectRetransmissions` on [this -page](https://support.microsoft.com/bg-bg/topic/hotfix-enables-the-configuration-of-the-tcp-maximum-syn-retransmission-amount-in-windows-7-or-windows-server-2008-r2-1b6f8352-2c5f-58bb-ead7-2cf021407c8e). +page](https://support.microsoft.com/topic/hotfix-enables-the-configuration-of-the-tcp-maximum-syn-retransmission-amount-in-windows-7-or-windows-server-2008-r2-1b6f8352-2c5f-58bb-ead7-2cf021407c8e). Also, even on non-Windows systems there may run a firewall or anti-virus software or similar that accepts the connection but does not actually do diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 1acb4d2244e2..c52e231bdc47 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -276,7 +276,6 @@ this: curl --trace my-trace.txt www.haxx.se - ## Detailed Information Different protocols provide different ways of getting detailed information diff --git a/docs/SSLCERTS.md b/docs/SSLCERTS.md index de3954553421..3506fbd787d1 100644 --- a/docs/SSLCERTS.md +++ b/docs/SSLCERTS.md @@ -133,7 +133,6 @@ Apple SecTrust and your own file to be considered, use: curl --ca-native --cacert mycerts.pem https://example.com - #### Other Combinations How well the use of native CA stores work in all other combinations depends diff --git a/docs/TODO.md b/docs/TODO.md index 0224ae87332c..3d2eec531268 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -398,7 +398,6 @@ honest a bit of a hack. Please see the following thread for more information: https://curl.se/mail/lib-2012-05/0178.html - # POP3 ## Enhanced capability support diff --git a/docs/TheArtOfHttpScripting.md b/docs/TheArtOfHttpScripting.md index ab4961c5781c..bab52cca47b3 100644 --- a/docs/TheArtOfHttpScripting.md +++ b/docs/TheArtOfHttpScripting.md @@ -198,7 +198,6 @@ SPDX-License-Identifier: curl curl --data name=curl https://url1.example.com https://url2.example.com - ## Multiple HTTP methods in a single command line Sometimes you need to operate on several URLs in a single command line and do diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index cafea9693fe4..14a381753851 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -41,7 +41,6 @@ Whenever there is input into the fifo, the program reads the input as a list of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. - Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 922197c3cb5a..46cfc0a85937 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -44,7 +44,6 @@ Whenever there is input into the fifo, the program reads the input as a list of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. - Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index 8f320a6e5fae..b3e080355098 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -41,7 +41,6 @@ of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. - Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index 7b17731ebfb5..79af5268c830 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -41,7 +41,6 @@ Whenever there is input into the fifo, the program reads the input as a list of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. - Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index ac351a8bf5f7..4d698f253c13 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -46,9 +46,9 @@ // #ifdef _WIN32 -#define COMPARE(a, b) (!_stricmp((a), (b))) +#define COMPARE(a, b) (!_stricmp(a, b)) #else -#define COMPARE(a, b) (!strcasecmp((a), (b))) +#define COMPARE(a, b) (!strcasecmp(a, b)) #endif // diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 8ed6568542a1..7becf5116926 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -67,7 +67,7 @@ #endif #ifdef _MSC_VER -#define gettimeofday(a, b) my_gettimeofday((a), (b)) +#define gettimeofday(a, b) my_gettimeofday(a, b) static int my_gettimeofday(struct timeval *tp, void *tzp) { (void)tzp; diff --git a/docs/examples/postit2-formadd.c b/docs/examples/postit2-formadd.c index 086cae0e51b9..7e5f08ef6617 100644 --- a/docs/examples/postit2-formadd.c +++ b/docs/examples/postit2-formadd.c @@ -74,7 +74,6 @@ int main(int argc, char *argv[]) CURLFORM_COPYCONTENTS, "postit2-formadd.c", CURLFORM_END); - /* Fill in the submit field too, even if this is rarely needed */ curl_formadd(&formpost, &lastptr, diff --git a/docs/libcurl/curl_easy_getinfo.md b/docs/libcurl/curl_easy_getinfo.md index 9515fadeed2c..e05beb614e08 100644 --- a/docs/libcurl/curl_easy_getinfo.md +++ b/docs/libcurl/curl_easy_getinfo.md @@ -398,7 +398,6 @@ An overview of the time values available from curl_easy_getinfo(3) |--|--|--|--|--|--|--|--TOTAL |--|--|--|--|--|--|--|--REDIRECT - CURLINFO_QUEUE_TIME_T(3), CURLINFO_NAMELOOKUP_TIME_T(3), CURLINFO_CONNECT_TIME_T(3), CURLINFO_APPCONNECT_TIME_T(3), CURLINFO_PRETRANSFER_TIME_T(3), CURLINFO_POSTTRANSFER_TIME_T(3), diff --git a/include/curl/curl.h b/include/curl/curl.h index 9e07527dc9c4..250f3f679aab 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -229,7 +229,6 @@ struct curl_httppost { set. Added in 7.46.0 */ }; - /* This is a return code for the progress callback that, when returned, will signal libcurl to continue executing the default progress function */ #define CURL_PROGRESSFUNC_CONTINUE 0x10000001 @@ -844,7 +843,7 @@ typedef enum { #define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7) #define CURLAUTH_ONLY (((unsigned long)1)<<31) #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) -#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) +#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE)) #define CURLSSH_AUTH_ANY ~0L /* all types supported by the server */ #define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */ @@ -916,7 +915,6 @@ typedef int /* return CURLE_OK to accept */ /* or something else to refuse */ - /* parameter for the CURLOPT_USE_SSL option */ #define CURLUSESSL_NONE 0L /* do not attempt to use SSL */ #define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */ @@ -1115,7 +1113,6 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy, /* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the string options from the header file */ - #define CURLOPT(na,t,nu) na = t + nu #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu @@ -1874,9 +1871,7 @@ typedef enum { libcurl will ask for the compressed methods it knows of, and if that is not any, it will not ask for transfer-encoding at all even if this - option is set to 1. - - */ + option is set to 1. */ CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207), /* Callback function for closing socket (instead of close(2)). The callback @@ -2294,10 +2289,9 @@ typedef enum { #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ #endif - - /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host - name resolves addresses using more than one IP protocol version, this - option might be handy to force libcurl to use a specific IP version. */ +/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host + name resolves addresses using more than one IP protocol version, this + option might be handy to force libcurl to use a specific IP version. */ #define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP versions that your system allows */ #define CURL_IPRESOLVE_V4 1L /* uses only IPv4 addresses/connections */ @@ -2381,7 +2375,7 @@ enum CURL_NETRC_OPTION { #define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16) #define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16) - /* never use, keep last */ +/* never use, keep last */ #define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16) #define CURL_TLSAUTH_NONE 0L @@ -2403,7 +2397,7 @@ enum CURL_TLSAUTH { #define CURL_REDIR_POST_302 2L #define CURL_REDIR_POST_303 4L #define CURL_REDIR_POST_ALL \ - (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) + (CURL_REDIR_POST_301 | CURL_REDIR_POST_302 | CURL_REDIR_POST_303) #define CURL_TIMECOND_NONE 0L #define CURL_TIMECOND_IFMODSINCE 1L @@ -2418,7 +2412,7 @@ typedef enum { } curl_TimeCond; /* Special size_t value signaling a null-terminated string. */ -#define CURL_ZERO_TERMINATED ((size_t) -1) +#define CURL_ZERO_TERMINATED ((size_t)-1) /* curl_strequal() and curl_strnequal() are subject for removal in a future release */ @@ -2705,7 +2699,6 @@ CURL_EXTERN char *curl_easy_escape(CURL *handle, CURL_EXTERN char *curl_escape(const char *string, int length); - /* * NAME curl_easy_unescape() * @@ -2743,10 +2736,9 @@ CURL_EXTERN void curl_free(void *p); * * curl_global_init() should be invoked exactly once for each application that * uses libcurl and before any call of other libcurl functions. - + * * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the * curl_version_info_data.features flag (fetch by curl_version_info()). - */ CURL_EXTERN CURLcode curl_global_init(long flags); @@ -2787,10 +2779,9 @@ CURL_EXTERN void curl_global_cleanup(void); * * curl_global_trace() can be invoked at application start to * configure which components in curl should participate in tracing. - + * * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the * curl_version_info_data.features flag (fetch by curl_version_info()). - */ CURL_EXTERN CURLcode curl_global_trace(const char *config); @@ -3017,12 +3008,11 @@ typedef enum { #define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */ #define CURL_GLOBAL_WIN32 (1<<1) -#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) +#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32) #define CURL_GLOBAL_NOTHING 0 #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL #define CURL_GLOBAL_ACK_EINTR (1<<2) - /***************************************************************************** * Setup defines, protos etc for the sharing stuff. */ @@ -3060,7 +3050,6 @@ typedef void (*curl_unlock_function)(CURL *handle, curl_lock_data data, void *userptr); - typedef enum { CURLSHE_OK, /* all is fine */ CURLSHE_BAD_OPTION, /* 1 */ @@ -3264,8 +3253,8 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); #define CURLPAUSE_SEND (1<<2) #define CURLPAUSE_SEND_CONT (0) -#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) -#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) +#define CURLPAUSE_ALL (CURLPAUSE_RECV | CURLPAUSE_SEND) +#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT) /* * NAME curl_easy_ssls_import() @@ -3310,7 +3299,6 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle, curl_ssls_export_cb *export_fn, void *userptr); - #ifdef __cplusplus } /* end of extern "C" */ #endif diff --git a/include/curl/easy.h b/include/curl/easy.h index 8a1d68dfd8b9..85cfd830f7e2 100644 --- a/include/curl/easy.h +++ b/include/curl/easy.h @@ -58,7 +58,6 @@ CURL_EXTERN void curl_easy_cleanup(CURL *curl); */ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); - /* * NAME curl_easy_duphandle() * @@ -108,7 +107,6 @@ CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen, size_t *n); - /* * NAME curl_easy_upkeep() * diff --git a/include/curl/multi.h b/include/curl/multi.h index e307b98f4c25..f3f66030ca25 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -136,25 +136,25 @@ CURL_EXTERN CURLM *curl_multi_init(void); CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *curl_handle); - /* - * Name: curl_multi_remove_handle() - * - * Desc: removes a curl handle from the multi stack again - * - * Returns: CURLMcode type, general multi error code. - */ +/* + * Name: curl_multi_remove_handle() + * + * Desc: removes a curl handle from the multi stack again + * + * Returns: CURLMcode type, general multi error code. + */ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_handle); - /* - * Name: curl_multi_fdset() - * - * Desc: Ask curl for its fd_set sets. The app can use these to select() or - * poll() on. We want curl_multi_perform() called as soon as one of - * them are ready. - * - * Returns: CURLMcode type, general multi error code. - */ +/* + * Name: curl_multi_fdset() + * + * Desc: Ask curl for its fd_set sets. The app can use these to select() or + * poll() on. We want curl_multi_perform() called as soon as one of + * them are ready. + * + * Returns: CURLMcode type, general multi error code. + */ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, fd_set *read_fd_set, fd_set *write_fd_set, @@ -198,35 +198,35 @@ CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle, */ CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle); - /* - * Name: curl_multi_perform() - * - * Desc: When the app thinks there is data available for curl it calls this - * function to read/write whatever there is right now. This returns - * as soon as the reads and writes are done. This function does not - * require that there actually is data available for reading or that - * data can be written, it can be called just in case. It returns - * the number of handles that still transfer data in the second - * argument's integer-pointer. - * - * Returns: CURLMcode type, general multi error code. *NOTE* that this only - * returns errors etc regarding the whole multi stack. There might - * still have occurred problems on individual transfers even when - * this returns OK. - */ +/* + * Name: curl_multi_perform() + * + * Desc: When the app thinks there is data available for curl it calls this + * function to read/write whatever there is right now. This returns + * as soon as the reads and writes are done. This function does not + * require that there actually is data available for reading or that + * data can be written, it can be called just in case. It returns + * the number of handles that still transfer data in the second + * argument's integer-pointer. + * + * Returns: CURLMcode type, general multi error code. *NOTE* that this only + * returns errors etc regarding the whole multi stack. There might + * still have occurred problems on individual transfers even when + * this returns OK. + */ CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles); - /* - * Name: curl_multi_cleanup() - * - * Desc: Cleans up and removes a whole multi stack. It does not free or - * touch any individual easy handles in any way. We need to define - * in what state those handles will be if this function is called - * in the middle of a transfer. - * - * Returns: CURLMcode type, general multi error code. - */ +/* + * Name: curl_multi_cleanup() + * + * Desc: Cleans up and removes a whole multi stack. It does not free or + * touch any individual easy handles in any way. We need to define + * in what state those handles will be if this function is called + * in the middle of a transfer. + * + * Returns: CURLMcode type, general multi error code. + */ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); /* @@ -327,8 +327,8 @@ curl_multi_socket_all(CURLM *multi_handle, int *running_handles); #ifndef CURL_ALLOW_OLD_MULTI_SOCKET /* This macro below was added in 7.16.3 to push users who recompile to use - the new curl_multi_socket_action() instead of the old curl_multi_socket() -*/ + * the new curl_multi_socket_action() instead of the old curl_multi_socket() + */ #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) #endif @@ -351,10 +351,10 @@ typedef enum { /* This is the argument passed to the socket callback */ CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2), - /* set to 1 to enable pipelining for this multi handle */ + /* set to 1 to enable pipelining for this multi handle */ CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3), - /* This is the timer callback function pointer */ + /* This is the timer callback function pointer */ CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4), /* This is the argument passed to the timer callback */ @@ -429,7 +429,6 @@ typedef enum { CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, CURLMoption option, ...); - /* * Name: curl_multi_assign() * @@ -454,7 +453,6 @@ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, */ CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle); - typedef enum { CURLMINFO_NONE, /* first, never use this */ /* The number of easy handles currently managed by the multi handle, diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index bf03e0d9359b..0642afd91ed2 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -264,7 +264,6 @@ */ #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) - /* the actual warnings, triggered by calling the Wcurl_easy_setopt_err* * functions */ @@ -590,8 +589,9 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, #define curlcheck_off_t_info(info) \ (CURLINFO_OFF_T < (info)) - -/* typecheck helpers -- check whether given expression has requested type */ +/* + * typecheck helpers -- check whether given expression has requested type + */ /* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros, * otherwise define a new macro. Search for __builtin_types_compatible_p @@ -641,7 +641,6 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, (curlcheck_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), CURL *)) - /* evaluates to true if expr is a long (no matter the signedness) * XXX: for now, int is also accepted (and therefore short and char, which * are promoted to int when passed to a variadic function) */ diff --git a/lib/cf-https-connect.h b/lib/cf-https-connect.h index df51b62479d7..df29c8ddd7e1 100644 --- a/lib/cf-https-connect.h +++ b/lib/cf-https-connect.h @@ -44,6 +44,5 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data, struct connectdata *conn, int sockindex); - #endif /* !CURL_DISABLE_HTTP */ #endif /* HEADER_CURL_CF_HTTP_H */ diff --git a/lib/cfilters.h b/lib/cfilters.h index 73b9cb03e034..6834c4133a75 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -316,7 +316,6 @@ void Curl_conn_cf_discard_all(struct Curl_easy *data, struct connectdata *conn, int sockindex); - CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, struct Curl_easy *data, bool *done); diff --git a/lib/config-os400.h b/lib/config-os400.h index b08400fe972a..3a48406b2a62 100644 --- a/lib/config-os400.h +++ b/lib/config-os400.h @@ -132,7 +132,6 @@ /* Define if you have the `socket' function. */ #define HAVE_SOCKET - /* The following define is needed on OS400 to enable strcmpi(), stricmp() and strdup(). */ #define __cplusplus__strings__ diff --git a/lib/curl_hmac.h b/lib/curl_hmac.h index 285846afe705..5444d62bd207 100644 --- a/lib/curl_hmac.h +++ b/lib/curl_hmac.h @@ -48,7 +48,6 @@ struct HMAC_params { unsigned int resultlen; /* Result length (bytes). */ }; - /* HMAC computation context. */ struct HMAC_context { const struct HMAC_params *hash; /* Hash function definition. */ diff --git a/lib/curl_memrchr.h b/lib/curl_memrchr.h index 73bd346cdee6..8e5d17708b39 100644 --- a/lib/curl_memrchr.h +++ b/lib/curl_memrchr.h @@ -35,7 +35,7 @@ #else /* HAVE_MEMRCHR */ void *Curl_memrchr(const void *s, int c, size_t n); -#define memrchr(x, y, z) Curl_memrchr((x), (y), (z)) +#define memrchr(x, y, z) Curl_memrchr(x, y, z) #endif /* HAVE_MEMRCHR */ diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index f9395aa7b51a..742d000b8556 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -160,7 +160,6 @@ struct timeval { #endif #endif /* HAVE_RECV */ - #ifdef __minix /* Minix does not support send on TCP sockets */ #define swrite(x, y, z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ diff --git a/lib/curl_trc.h b/lib/curl_trc.h index 0c47d58798dc..6d6a22ef9909 100644 --- a/lib/curl_trc.h +++ b/lib/curl_trc.h @@ -65,7 +65,6 @@ void Curl_failf(struct Curl_easy *data, #define CURL_LOG_LVL_NONE 0 #define CURL_LOG_LVL_INFO 1 - #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CURL_HAVE_C99 #endif diff --git a/lib/cw-pause.h b/lib/cw-pause.h index 2aa1a499cddd..5421bfd663f7 100644 --- a/lib/cw-pause.h +++ b/lib/cw-pause.h @@ -36,5 +36,4 @@ extern const struct Curl_cwtype Curl_cwt_pause; CURLcode Curl_cw_pause_flush(struct Curl_easy *data); - #endif /* HEADER_CURL_CW_PAUSE_H */ diff --git a/lib/dynhds.h b/lib/dynhds.h index e533dcc3699e..d405a60c2193 100644 --- a/lib/dynhds.h +++ b/lib/dynhds.h @@ -126,7 +126,6 @@ size_t Curl_dynhds_remove(struct dynhds *dynhds, const char *name, size_t namelen); size_t Curl_dynhds_cremove(struct dynhds *dynhds, const char *name); - /** * Set the give header name and value, replacing any entries with * the same name. The header is added at the end of all (remaining) diff --git a/lib/functypes.h b/lib/functypes.h index b4dccc0ce487..92f6b45cd200 100644 --- a/lib/functypes.h +++ b/lib/functypes.h @@ -68,7 +68,6 @@ #define SEND_TYPE_RETV int #endif - #ifndef RECV_TYPE_ARG1 #define RECV_TYPE_ARG1 int #endif diff --git a/lib/hostip.h b/lib/hostip.h index 780d93038f93..3672a03506b3 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -116,7 +116,6 @@ bool Curl_ipv6works(struct Curl_easy *data); #define Curl_ipv6works(x) FALSE #endif - /* unlink a dns entry, potentially shared with a cache */ void Curl_resolv_unlink(struct Curl_easy *data, struct Curl_dns_entry **pdns); diff --git a/lib/http.h b/lib/http.h index 26762b62058b..b193a1dfc857 100644 --- a/lib/http.h +++ b/lib/http.h @@ -213,7 +213,6 @@ Curl_http_output_auth(struct Curl_easy *data, /* Decode HTTP status code string. */ CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len); - /** * All about a core HTTP request, excluding body and trailers */ diff --git a/lib/ldap.c b/lib/ldap.c index b51aab56fb44..b94fff34d847 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -95,7 +95,7 @@ #define curl_ldap_num_t ULONG #else #define FREE_ON_WINLDAP(x) -#define curl_ldap_num_t int +#define curl_ldap_num_t int #endif #ifndef HAVE_LDAP_URL_PARSE diff --git a/lib/optiontable.pl b/lib/optiontable.pl index 54b86d72e1ed..5e0c720f04e3 100755 --- a/lib/optiontable.pl +++ b/lib/optiontable.pl @@ -77,7 +77,6 @@ sub add { } } - my $fl; while() { my $l = $_; @@ -122,7 +121,6 @@ sub add { } } - for my $name (sort @names) { my $oname = $name; my $a = $alias{$name}; diff --git a/lib/setup-os400.h b/lib/setup-os400.h index 01f939951008..4cb0d89c3882 100644 --- a/lib/setup-os400.h +++ b/lib/setup-os400.h @@ -76,7 +76,6 @@ extern OM_uint32 Curl_gss_import_name_a(OM_uint32 * minor_status, 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, OM_uint32 status_value, int status_type, gss_OID mech_type, @@ -84,7 +83,6 @@ extern OM_uint32 Curl_gss_display_status_a(OM_uint32 * minor_status, 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, gss_cred_id_t cred_handle, gss_ctx_id_t * context_handle, @@ -101,13 +99,11 @@ extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status, 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, gss_ctx_id_t *context_handle, gss_buffer_t output_token); #define gss_delete_sec_context Curl_gss_delete_sec_context_a - /* LDAP wrappers. */ #define BerValue struct berval diff --git a/lib/urldata.h b/lib/urldata.h index bbab0130d318..7d5166e8e06f 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -133,7 +133,6 @@ typedef unsigned int curl_prot_t; input easier and better. */ #define CURL_MAX_INPUT_LENGTH 8000000 - #include "cookie.h" #include "psl.h" #include "formdata.h" diff --git a/lib/vquic/vquic.h b/lib/vquic/vquic.h index fd2dac7c22eb..fa2c0d4e816e 100644 --- a/lib/vquic/vquic.h +++ b/lib/vquic/vquic.h @@ -40,7 +40,6 @@ CURLcode Curl_qlogdir(struct Curl_easy *data, size_t scidlen, int *qlogfdp); - CURLcode Curl_cf_quic_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index d1236aefba0c..a98ff4a62059 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -306,7 +306,7 @@ static gnutls_x509_crt_fmt_t gnutls_do_file_type(const char *type) return GNUTLS_X509_FMT_PEM; /* default to PEM */ } -#define GNUTLS_CIPHERS "NORMAL:%PROFILE_MEDIUM:-ARCFOUR-128:"\ +#define GNUTLS_CIPHERS "NORMAL:%PROFILE_MEDIUM:-ARCFOUR-128:" \ "-CTYPE-ALL:+CTYPE-X509" /* If GnuTLS was compiled without support for SRP it will error out if SRP is requested in the priority string, so treat it specially diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index d1329410bfc3..4f3c6ca170b9 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -54,7 +54,7 @@ */ /* Largest supported ASN.1 structure. */ -#define CURL_ASN1_MAX ((size_t) 0x40000) /* 256K */ +#define CURL_ASN1_MAX ((size_t)0x40000) /* 256K */ /* ASN.1 classes. */ /* #define CURL_ASN1_UNIVERSAL 0 */ diff --git a/m4/curl-amissl.m4 b/m4/curl-amissl.m4 index 86468890e86b..a1c2d3979cbd 100644 --- a/m4/curl-amissl.m4 +++ b/m4/curl-amissl.m4 @@ -33,8 +33,7 @@ if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then #include ]],[[ #if defined(AMISSL_CURRENT_VERSION) && defined(AMISSL_V3xx) && \ - (OPENSSL_VERSION_NUMBER >= 0x30000000L) && \ - defined(PROTO_AMISSL_H) + (OPENSSL_VERSION_NUMBER >= 0x30000000L) && defined(PROTO_AMISSL_H) return 0; #else #error not AmiSSL v5 / OpenSSL 3 diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index 5512a5d28c4c..85ccd1ff6ca9 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -508,7 +508,7 @@ AC_DEFUN([CURL_CHECK_FUNC_ALARM], [ AC_LANG_PROGRAM([[ $curl_includes_unistd ]],[[ - if(0 != alarm(0)) + if(alarm(0) != 0) return 1; ]]) ],[ @@ -599,7 +599,7 @@ AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [ $curl_includes_libgen $curl_includes_unistd ]],[[ - if(0 != basename(0)) + if(basename(0) != 0) return 1; ]]) ],[ @@ -659,7 +659,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ - if(0 != closesocket(0)) + if(closesocket(0) != 0) return 1; ]]) ],[ @@ -689,7 +689,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ - if(0 != closesocket(0)) + if(closesocket(0) != 0) return 1; ]]) ],[ @@ -750,7 +750,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != CloseSocket(0)) + if(CloseSocket(0) != 0) return 1; ]]) ],[ @@ -768,7 +768,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != CloseSocket(0)) + if(CloseSocket(0) != 0) return 1; ]]) ],[ @@ -851,7 +851,7 @@ AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [ AC_LANG_PROGRAM([[ $curl_includes_fcntl ]],[[ - if(0 != fcntl(0, 0, 0)) + if(fcntl(0, 0, 0) != 0) return 1; ]]) ],[ @@ -917,7 +917,7 @@ AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [ $curl_includes_fcntl ]],[[ int flags = 0; - if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) + if(fcntl(0, F_SETFL, flags | O_NONBLOCK) != 0) return 1; ]]) ],[ @@ -1098,7 +1098,7 @@ AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ - if(0 != fsetxattr(0, "", 0, 0, 0)) + if(fsetxattr(0, "", 0, 0, 0) != 0) return 1; ]]) ],[ @@ -1116,7 +1116,7 @@ AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ - if(0 != fsetxattr(0, 0, 0, 0, 0, 0)) + if(fsetxattr(0, 0, 0, 0, 0, 0) != 0) return 1; ]]) ],[ @@ -1218,7 +1218,7 @@ AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [ AC_LANG_PROGRAM([[ $curl_includes_unistd ]],[[ - if(0 != ftruncate(0, 0)) + if(ftruncate(0, 0) != 0) return 1; ]]) ],[ @@ -1291,7 +1291,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ $curl_includes_netdb ]],[[ struct addrinfo *ai = 0; - if(0 != getaddrinfo(0, 0, 0, &ai)) + if(getaddrinfo(0, 0, 0, &ai) != 0) return 1; ]]) ],[ @@ -1326,7 +1326,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ $curl_includes_netdb ]],[[ struct addrinfo *ai = 0; - if(0 != getaddrinfo(0, 0, 0, &ai)) + if(getaddrinfo(0, 0, 0, &ai) != 0) return 1; ]]) ],[ @@ -1537,7 +1537,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [ $curl_includes_netdb $curl_includes_bsdsocket ]],[[ - if(0 != gethostbyname_r(0, 0, 0)) + if(gethostbyname_r(0, 0, 0) != 0) return 1; ]]) ],[ @@ -1556,7 +1556,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [ $curl_includes_netdb $curl_includes_bsdsocket ]],[[ - if(0 != gethostbyname_r(0, 0, 0, 0, 0)) + if(gethostbyname_r(0, 0, 0, 0, 0) != 0) return 1; ]]) ],[ @@ -1575,7 +1575,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [ $curl_includes_netdb $curl_includes_bsdsocket ]],[[ - if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0)) + if(gethostbyname_r(0, 0, 0, 0, 0, 0) != 0) return 1; ]]) ],[ @@ -1660,7 +1660,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [ $curl_includes_bsdsocket ]],[[ char s[1]; - if(0 != gethostname((void *)s, 0)) + if(gethostname((void *)s, 0) != 0) return 1; ]]) ],[ @@ -1695,7 +1695,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [ $curl_includes_bsdsocket ]],[[ char s[1]; - if(0 != gethostname((void *)s, 0)) + if(gethostname((void *)s, 0) != 0) return 1; ]]) ],[ @@ -1727,7 +1727,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [ int FUNCALLCONV gethostname($tst_arg1, $tst_arg2); ]],[[ char s[1]; - if(0 != gethostname(($tst_arg1)s, 0)) + if(gethostname(($tst_arg1)s, 0) != 0) return 1; ]]) ],[ @@ -1795,7 +1795,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETPEERNAME], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != getpeername(0, (void *)0, (void *)0)) + if(getpeername(0, (void *)0, (void *)0) != 0) return 1; ]]) ],[ @@ -1829,7 +1829,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETPEERNAME], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != getpeername(0, (void *)0, (void *)0)) + if(getpeername(0, (void *)0, (void *)0) != 0) return 1; ]]) ],[ @@ -1893,7 +1893,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETSOCKNAME], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != getsockname(0, (void *)0, (void *)0)) + if(getsockname(0, (void *)0, (void *)0) != 0) return 1; ]]) ],[ @@ -1927,7 +1927,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETSOCKNAME], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != getsockname(0, (void *)0, (void *)0)) + if(getsockname(0, (void *)0, (void *)0) != 0) return 1; ]]) ],[ @@ -2014,7 +2014,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [ AC_LANG_PROGRAM([[ $curl_includes_ifaddrs ]],[[ - if(0 != getifaddrs(0)) + if(getifaddrs(0) != 0) return 1; ]]) ],[ @@ -2134,7 +2134,7 @@ AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [ ]],[[ time_t tm = 1170352587; struct tm result; - if(0 != gmtime_r(&tm, &result)) + if(gmtime_r(&tm, &result) != 0) return 1; (void)result; ]]) @@ -2255,7 +2255,7 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [ ]],[[ char ipv4res[sizeof("255.255.255.255")]; unsigned char ipv4a[5] = ""; - if(0 != inet_ntop(0, ipv4a, ipv4res, 0)) + if(inet_ntop(0, ipv4a, ipv4res, 0) != 0) return 1; ]]) ],[ @@ -2414,9 +2414,9 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [ AC_LANG_PROGRAM([[ $curl_includes_arpa_inet ]],[[ - unsigned char ipv4a[4+1] = ""; + unsigned char ipv4a[4 + 1] = ""; const char *ipv4src = "192.168.100.1"; - if(0 != inet_pton(0, ipv4src, ipv4a)) + if(inet_pton(0, ipv4src, ipv4a) != 0) return 1; ]]) ],[ @@ -2438,45 +2438,45 @@ AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [ $curl_includes_arpa_inet $curl_includes_string ]],[[ - unsigned char ipv6a[16+1]; - unsigned char ipv4a[4+1]; + unsigned char ipv6a[16 + 1]; + unsigned char ipv4a[4 + 1]; const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; const char *ipv4src = "192.168.100.1"; /* - */ memset(ipv4a, 1, sizeof(ipv4a)); - if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) + if(inet_pton(AF_INET, ipv4src, ipv4a) != 1) return 1; /* fail */ /* - */ - if( (ipv4a[0] != 0xc0) || - (ipv4a[1] != 0xa8) || - (ipv4a[2] != 0x64) || - (ipv4a[3] != 0x01) || - (ipv4a[4] != 0x01) ) + if((ipv4a[0] != 0xc0) || + (ipv4a[1] != 0xa8) || + (ipv4a[2] != 0x64) || + (ipv4a[3] != 0x01) || + (ipv4a[4] != 0x01)) return 1; /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); - if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) + if(inet_pton(AF_INET6, ipv6src, ipv6a) != 1) return 1; /* fail */ /* - */ - if( (ipv6a[0] != 0xfe) || - (ipv6a[1] != 0x80) || - (ipv6a[8] != 0x02) || - (ipv6a[9] != 0x14) || - (ipv6a[10] != 0x4f) || - (ipv6a[11] != 0xff) || - (ipv6a[12] != 0xfe) || - (ipv6a[13] != 0x0b) || - (ipv6a[14] != 0x76) || - (ipv6a[15] != 0xc8) || - (ipv6a[16] != 0x01) ) + if((ipv6a[0] != 0xfe) || + (ipv6a[1] != 0x80) || + (ipv6a[8] != 0x02) || + (ipv6a[9] != 0x14) || + (ipv6a[10] != 0x4f) || + (ipv6a[11] != 0xff) || + (ipv6a[12] != 0xfe) || + (ipv6a[13] != 0x0b) || + (ipv6a[14] != 0x76) || + (ipv6a[15] != 0xc8) || + (ipv6a[16] != 0x01)) return 1; /* fail */ /* - */ - if( (ipv6a[2] != 0x0) || - (ipv6a[3] != 0x0) || - (ipv6a[4] != 0x0) || - (ipv6a[5] != 0x0) || - (ipv6a[6] != 0x0) || - (ipv6a[7] != 0x0) ) + if((ipv6a[2] != 0x0) || + (ipv6a[3] != 0x0) || + (ipv6a[4] != 0x0) || + (ipv6a[5] != 0x0) || + (ipv6a[6] != 0x0) || + (ipv6a[7] != 0x0)) return 1; /* fail */ /* - */ return 0; @@ -2565,7 +2565,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [ AC_LANG_PROGRAM([[ $curl_includes_stropts ]],[[ - if(0 != ioctl(0, 0, 0)) + if(ioctl(0, 0, 0) != 0) return 1; ]]) ],[ @@ -2623,7 +2623,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [ $curl_includes_stropts ]],[[ int flags = 0; - if(0 != ioctl(0, FIONBIO, &flags)) + if(ioctl(0, FIONBIO, &flags) != 0) return 1; ]]) ],[ @@ -2680,7 +2680,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [ #include ]],[[ struct ifreq ifr; - if(0 != ioctl(0, SIOCGIFADDR, &ifr)) + if(ioctl(0, SIOCGIFADDR, &ifr) != 0) return 1; ]]) ],[ @@ -2738,7 +2738,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ - if(0 != ioctlsocket(0, 0, 0)) + if(ioctlsocket(0, 0, 0) != 0) return 1; ]]) ],[ @@ -2768,7 +2768,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ - if(0 != ioctlsocket(0, 0, 0)) + if(ioctlsocket(0, 0, 0) != 0) return 1; ]]) ],[ @@ -2827,7 +2827,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [ $curl_includes_winsock2 ]],[[ unsigned long flags = 0; - if(0 != ioctlsocket(0, FIONBIO, &flags)) + if(ioctlsocket(0, FIONBIO, &flags) != 0) return 1; ]]) ],[ @@ -2884,7 +2884,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [ AC_LANG_PROGRAM([[ $curl_includes_bsdsocket ]],[[ - if(0 != IoctlSocket(0, 0, 0)) + if(IoctlSocket(0, 0, 0) != 0) return 1; ]]) ],[ @@ -2901,7 +2901,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [ AC_LANG_PROGRAM([[ $curl_includes_bsdsocket ]],[[ - if(0 != IoctlSocket(0, 0, 0)) + if(IoctlSocket(0, 0, 0) != 0) return 1; ]]) ],[ @@ -2959,7 +2959,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [ $curl_includes_bsdsocket ]],[[ long flags = 0; - if(0 != IoctlSocket(0, FIONBIO, &flags)) + if(IoctlSocket(0, FIONBIO, &flags) != 0) return 1; ]]) ],[ @@ -3030,7 +3030,7 @@ AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ - if(0 != memrchr("", 0, 0)) + if(memrchr("", 0, 0) != 0) return 1; ]]) ],[ @@ -3062,7 +3062,7 @@ AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ - if(0 != memrchr("", 0, 0)) + if(memrchr("", 0, 0) != 0) return 1; ]]) ],[ @@ -3147,7 +3147,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [ AC_LANG_PROGRAM([[ $curl_includes_signal ]],[[ - if(0 != sigaction(0, 0, 0)) + if(sigaction(0, 0, 0) != 0) return 1; ]]) ],[ @@ -3232,7 +3232,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [ AC_LANG_PROGRAM([[ $curl_includes_signal ]],[[ - if(0 != siginterrupt(0, 0)) + if(siginterrupt(0, 0) != 0) return 1; ]]) ],[ @@ -3317,7 +3317,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [ AC_LANG_PROGRAM([[ $curl_includes_signal ]],[[ - if(0 != signal(0, 0)) + if(signal(0, 0) != 0) return 1; ]]) ],[ @@ -3391,7 +3391,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [ $curl_includes_setjmp ]],[[ sigjmp_buf env; - if(0 != sigsetjmp(env, 0)) + if(sigsetjmp(env, 0) != 0) return 1; ]]) ],[ @@ -3424,7 +3424,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [ $curl_includes_setjmp ]],[[ sigjmp_buf env; - if(0 != sigsetjmp(env, 0)) + if(sigsetjmp(env, 0) != 0) return 1; ]]) ],[ @@ -3487,7 +3487,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != socket(0, 0, 0)) + if(socket(0, 0, 0) != 0) return 1; ]]) ],[ @@ -3521,7 +3521,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ $curl_includes_bsdsocket $curl_includes_sys_socket ]],[[ - if(0 != socket(0, 0, 0)) + if(socket(0, 0, 0) != 0) return 1; ]]) ],[ @@ -3607,7 +3607,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [ $curl_includes_sys_socket ]],[[ int sv[2]; - if(0 != socketpair(0, 0, 0, sv)) + if(socketpair(0, 0, 0, sv) != 0) return 1; ]]) ],[ @@ -3692,7 +3692,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ - if(0 != strcasecmp("", "")) + if(strcasecmp("", "") != 0) return 1; ]]) ],[ @@ -3776,7 +3776,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ - if(0 != strcmpi(0, 0)) + if(strcmpi(0, 0) != 0) return 1; ]]) ],[ @@ -3971,7 +3971,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [ $curl_includes_string ]],[[ char s[1]; - if(0 != strerror_r(0, s, 0)) + if(strerror_r(0, s, 0) != 0) return 1; ]]) ],[ @@ -3994,7 +3994,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [ char *strerror_r(int errnum, char *workbuf, $arg3 bufsize); ]],[[ char s[1]; - if(0 != strerror_r(0, s, 0)) + if(strerror_r(0, s, 0) != 0) return 1; (void)s; ]]) @@ -4057,7 +4057,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [ int strerror_r(int errnum, char *resultbuf, $arg3 bufsize); ]],[[ char s[1]; - if(0 != strerror_r(0, s, 0)) + if(strerror_r(0, s, 0) != 0) return 1; (void)s; ]]) @@ -4213,7 +4213,7 @@ AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ - if(0 != stricmp(0, 0)) + if(stricmp(0, 0) != 0) return 1; ]]) ],[ @@ -4380,8 +4380,8 @@ AC_DEFUN([CURL_SIZEOF], [ $2 ]],[ switch(0) { - case 0: - case (sizeof($1) == $typesize):; + case 0: + case (sizeof($1) == $typesize):; } ]) ],[ diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index b176def67d18..0982eed639f7 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -46,20 +46,17 @@ #include "os400sys.h" #ifndef SIZE_MAX -#define SIZE_MAX ((size_t) ~0) /* Is unsigned on OS/400. */ +#define SIZE_MAX ((size_t)~0) /* Is unsigned on OS/400. */ #endif +#define ASCII_CCSID 819 /* Use ISO-8859-1 as ASCII. */ +#define NOCONV_CCSID 65535 /* No conversion. */ +#define ICONV_ID_SIZE 32 /* Size of iconv_open() code identifier. */ +#define ICONV_OPEN_ERROR(t) ((t).return_value == -1) -#define ASCII_CCSID 819 /* Use ISO-8859-1 as ASCII. */ -#define NOCONV_CCSID 65535 /* No conversion. */ -#define ICONV_ID_SIZE 32 /* Size of iconv_open() code identifier. */ -#define ICONV_OPEN_ERROR(t) ((t).return_value == -1) +#define ALLOC_GRANULE 8 /* Alloc. granule for curl_formadd_ccsid(). */ -#define ALLOC_GRANULE 8 /* Alloc. granule for curl_formadd_ccsid(). */ - - -static void -makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid) +static void makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid) { /** *** Convert a CCSID to the corresponding IBM iconv_open() character @@ -78,10 +75,8 @@ makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid) curl_msprintf(buf, "IBMCCSID%05u0000000", ccsid); } - -static iconv_t -iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin, - unsigned int cstr) +static iconv_t iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin, + unsigned int cstr) { char fromcode[ICONV_ID_SIZE]; char tocode[ICONV_ID_SIZE]; @@ -95,18 +90,16 @@ iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin, makeOS400IconvCode(fromcode, ccsidin); makeOS400IconvCode(tocode, ccsidout); - memset(tocode + 13, 0, sizeof(tocode) - 13); /* Dest. code id format. */ + memset(tocode + 13, 0, sizeof(tocode) - 13); /* Dest. code id format. */ if(cstr) - fromcode[18] = '1'; /* Set null-terminator flag. */ + fromcode[18] = '1'; /* Set null-terminator flag. */ return iconv_open(tocode, fromcode); } - -static int -convert(char *d, size_t dlen, int dccsid, - const char *s, int slen, int sccsid) +static int convert(char *d, size_t dlen, int dccsid, const char *s, int slen, + int sccsid) { int i; iconv_t cd; @@ -141,7 +134,7 @@ convert(char *d, size_t dlen, int dccsid, cd = iconv_open_CCSID(dccsid, sccsid, 1); } else { - lslen = (size_t) slen; + lslen = (size_t)slen; cd = iconv_open_CCSID(dccsid, sccsid, 0); } @@ -150,7 +143,7 @@ convert(char *d, size_t dlen, int dccsid, i = dlen; - if((int) iconv(cd, (char * *) &s, &lslen, &d, &dlen) < 0) + if((int)iconv(cd, (char **)&s, &lslen, &d, &dlen) < 0) i = -1; else i -= dlen; @@ -159,7 +152,6 @@ convert(char *d, size_t dlen, int dccsid, return i; } - static char *dynconvert(int dccsid, const char *s, int slen, int sccsid, int *olen) { @@ -171,18 +163,18 @@ static char *dynconvert(int dccsid, const char *s, int slen, int sccsid, /* Like convert, but the destination is allocated and returned. */ - dlen = (size_t) (slen < 0 ? strlen(s) : slen) + 1; - dlen *= MAX_CONV_EXPANSION; /* Allow some expansion. */ + dlen = (size_t)(slen < 0 ? strlen(s) : slen) + 1; + dlen *= MAX_CONV_EXPANSION; /* Allow some expansion. */ d = malloc(dlen); if(!d) - return (char *) NULL; + return (char *)NULL; l = convert(d, dlen, dccsid, s, slen, sccsid); if(l < 0) { free(d); - return (char *) NULL; + return (char *)NULL; } if(slen < 0) { @@ -194,14 +186,14 @@ static char *dynconvert(int dccsid, const char *s, int slen, int sccsid, if(l2 < 0) { free(d); - return (char *) NULL; + return (char *)NULL; } l += l2; } - if((size_t) l < dlen) { - cp = realloc(d, l); /* Shorten to minimum needed. */ + if((size_t)l < dlen) { + cp = realloc(d, l); /* Shorten to minimum needed. */ if(cp) d = cp; @@ -212,11 +204,10 @@ static char *dynconvert(int dccsid, const char *s, int slen, int sccsid, return d; } - -static struct curl_slist * -slist_convert(int dccsid, struct curl_slist *from, int sccsid) +static struct curl_slist *slist_convert(int dccsid, struct curl_slist *from, + int sccsid) { - struct curl_slist *to = (struct curl_slist *) NULL; + struct curl_slist *to = (struct curl_slist *)NULL; for(; from; from = from->next) { struct curl_slist *nl; @@ -224,7 +215,7 @@ slist_convert(int dccsid, struct curl_slist *from, int sccsid) if(!cp) { curl_slist_free_all(to); - return (struct curl_slist *) NULL; + return (struct curl_slist *)NULL; } nl = Curl_slist_append_nodup(to, cp); if(!nl) { @@ -237,15 +228,14 @@ slist_convert(int dccsid, struct curl_slist *from, int sccsid) return to; } - -static char * -keyed_string(localkey_t key, const char *ascii, unsigned int ccsid) +static char *keyed_string(localkey_t key, const char *ascii, + unsigned int ccsid) { int i; char *ebcdic; if(!ascii) - return (char *) NULL; + return (char *)NULL; i = MAX_CONV_EXPANSION * (strlen(ascii) + 1); @@ -254,40 +244,32 @@ keyed_string(localkey_t key, const char *ascii, unsigned int ccsid) return ebcdic; if(convert(ebcdic, i, ccsid, ascii, -1, ASCII_CCSID) < 0) - return (char *) NULL; + return (char *)NULL; return ebcdic; } - -const char * -curl_to_ccsid(const char *s, unsigned int ccsid) +const char *curl_to_ccsid(const char *s, unsigned int ccsid) { if(s) s = dynconvert(ccsid, s, -1, ASCII_CCSID, NULL); return s; } - -const char * -curl_from_ccsid(const char *s, unsigned int ccsid) +const char *curl_from_ccsid(const char *s, unsigned int ccsid) { if(s) s = dynconvert(ASCII_CCSID, s, -1, ccsid, NULL); return s; } - -char * -curl_version_ccsid(unsigned int ccsid) +char *curl_version_ccsid(unsigned int ccsid) { return keyed_string(LK_CURL_VERSION, curl_version(), ccsid); } - -char * -curl_easy_escape_ccsid(CURL *handle, const char *string, int length, - unsigned int sccsid, unsigned int dccsid) +char *curl_easy_escape_ccsid(CURL *handle, const char *string, int length, + unsigned int sccsid, unsigned int dccsid) { char *s; char *d; @@ -295,30 +277,28 @@ curl_easy_escape_ccsid(CURL *handle, const char *string, int length, if(!string) { /* !checksrc! disable ERRNOVAR 1 */ errno = EINVAL; - return (char *) NULL; + return (char *)NULL; } s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL); if(!s) - return (char *) NULL; + return (char *)NULL; d = curl_easy_escape(handle, s, 0); free(s); if(!d) - return (char *) NULL; + return (char *)NULL; s = dynconvert(dccsid, d, -1, ASCII_CCSID, NULL); free(d); return s; } - -char * -curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, - int *outlength, - unsigned int sccsid, unsigned int dccsid) +char *curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, + int *outlength, unsigned int sccsid, + unsigned int dccsid) { char *s; char *d; @@ -326,19 +306,19 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, if(!string) { /* !checksrc! disable ERRNOVAR 1 */ errno = EINVAL; - return (char *) NULL; + return (char *)NULL; } s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL); if(!s) - return (char *) NULL; + return (char *)NULL; d = curl_easy_unescape(handle, s, 0, outlength); free(s); if(!d) - return (char *) NULL; + return (char *)NULL; s = dynconvert(dccsid, d, -1, ASCII_CCSID, NULL); free(d); @@ -349,14 +329,13 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length, return s; } - -struct curl_slist * -curl_slist_append_ccsid(struct curl_slist *list, - const char *data, unsigned int ccsid) +struct curl_slist *curl_slist_append_ccsid(struct curl_slist *list, + const char *data, + unsigned int ccsid) { char *s; - s = (char *) NULL; + s = (char *)NULL; if(!data) return curl_slist_append(list, data); @@ -364,16 +343,15 @@ curl_slist_append_ccsid(struct curl_slist *list, s = dynconvert(ASCII_CCSID, data, -1, ccsid, NULL); if(!s) - return (struct curl_slist *) NULL; + return (struct curl_slist *)NULL; list = curl_slist_append(list, s); free(s); return list; } - -time_t -curl_getdate_ccsid(const char *p, const time_t *unused, unsigned int ccsid) +time_t curl_getdate_ccsid(const char *p, const time_t *unused, + unsigned int ccsid) { char *s; time_t t; @@ -384,17 +362,15 @@ curl_getdate_ccsid(const char *p, const time_t *unused, unsigned int ccsid) s = dynconvert(ASCII_CCSID, p, -1, ccsid, NULL); if(!s) - return (time_t) -1; + return (time_t)-1; t = curl_getdate(s, unused); free(s); return t; } - -static int -convert_version_info_string(const char **stringp, - char **bufp, int *left, unsigned int ccsid) +static int convert_version_info_string(const char **stringp, char **bufp, + int *left, unsigned int ccsid) { /* Helper for curl_version_info_ccsid(): convert a string if defined. Result is stored in the `*left'-byte buffer at `*bufp'. @@ -415,9 +391,8 @@ convert_version_info_string(const char **stringp, return 0; } - -curl_version_info_data * -curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) +curl_version_info_data *curl_version_info_ccsid(CURLversion stamp, + unsigned int ccsid) { curl_version_info_data *p; char *cp; @@ -457,7 +432,7 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) /* If caller has been compiled with a newer version, error. */ if(stamp > CURLVERSION_NOW) - return (curl_version_info_data *) NULL; + return (curl_version_info_data *)NULL; p = curl_version_info(stamp); @@ -477,7 +452,7 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) } for(i = 0; i < sizeof(charfields) / sizeof(charfields[0]); i++) { - cpp = (const char **) ((char *) p + charfields[i]); + cpp = (const char **)((char *)p + charfields[i]); if(*cpp) n += strlen(*cpp) + 1; } @@ -490,70 +465,60 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) n += nproto * sizeof(const char *); cp = Curl_thread_buffer(LK_VERSION_INFO_DATA, n); - id = (curl_version_info_data *) Curl_thread_buffer(LK_VERSION_INFO, - sizeof(*id)); + id = (curl_version_info_data *)Curl_thread_buffer(LK_VERSION_INFO, + sizeof(*id)); if(!id || !cp) - return (curl_version_info_data *) NULL; + return (curl_version_info_data *)NULL; /* Copy data and convert strings. */ - memcpy((char *) id, (char *) p, sizeof(*p)); + memcpy((char *)id, (char *)p, sizeof(*p)); if(id->protocols) { i = nproto * sizeof(id->protocols[0]); - id->protocols = (const char * const *) cp; - memcpy(cp, (char *) p->protocols, i); + id->protocols = (const char * const *)cp; + memcpy(cp, (char *)p->protocols, i); cp += i; n -= i; for(i = 0; id->protocols[i]; i++) - if(convert_version_info_string(((const char * *) id->protocols) + i, - &cp, &n, ccsid)) - return (curl_version_info_data *) NULL; + if(convert_version_info_string(((const char **)id->protocols) + i, + &cp, &n, ccsid)) + return (curl_version_info_data *)NULL; } for(i = 0; i < sizeof(charfields) / sizeof(charfields[0]); i++) { - cpp = (const char **) ((char *) p + charfields[i]); + cpp = (const char **)((char *)p + charfields[i]); if(*cpp && convert_version_info_string(cpp, &cp, &n, ccsid)) - return (curl_version_info_data *) NULL; + return (curl_version_info_data *)NULL; } return id; } - -const char * -curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid) +const char *curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid) { return keyed_string(LK_EASY_STRERROR, curl_easy_strerror(error), ccsid); } - -const char * -curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid) +const char *curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid) { return keyed_string(LK_SHARE_STRERROR, curl_share_strerror(error), ccsid); } - -const char * -curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid) +const char *curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid) { return keyed_string(LK_MULTI_STRERROR, curl_multi_strerror(error), ccsid); } - -const char * -curl_url_strerror_ccsid(CURLUcode error, unsigned int ccsid) +const char *curl_url_strerror_ccsid(CURLUcode error, unsigned int ccsid) { return keyed_string(LK_URL_STRERROR, curl_url_strerror(error), ccsid); } - -void -curl_certinfo_free_all(struct curl_certinfo *info) +void curl_certinfo_free_all(struct curl_certinfo *info) { /* Free all memory used by certificate info. */ if(info) { @@ -562,15 +527,13 @@ curl_certinfo_free_all(struct curl_certinfo *info) for(i = 0; i < info->num_of_certs; i++) curl_slist_free_all(info->certinfo[i]); - free((char *) info->certinfo); + free((char *)info->certinfo); } - free((char *) info); + free((char *)info); } } - -CURLcode -curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) +CURLcode curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) { va_list arg; void *paramp; @@ -580,7 +543,7 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) /* WARNING: unlike curl_easy_getinfo(), the strings returned by this procedure have to be free'ed. */ - data = (struct Curl_easy *) curl; + data = (struct Curl_easy *)curl; va_start(arg, info); paramp = va_arg(arg, void *); ret = Curl_getinfo(data, info, paramp); @@ -592,11 +555,11 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) struct curl_certinfo *cipf; struct curl_certinfo *cipt; - switch((int) info & CURLINFO_TYPEMASK) { + switch((int)info & CURLINFO_TYPEMASK) { case CURLINFO_STRING: ccsid = va_arg(arg, unsigned int); - cpp = (char * *) paramp; + cpp = (char **)paramp; if(*cpp) { *cpp = dynconvert(ccsid, *cpp, -1, ASCII_CCSID, NULL); @@ -611,15 +574,15 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) ccsid = va_arg(arg, unsigned int); switch(info) { case CURLINFO_CERTINFO: - cipf = *(struct curl_certinfo * *) paramp; + cipf = *(struct curl_certinfo **)paramp; if(cipf) { - cipt = (struct curl_certinfo *) malloc(sizeof(*cipt)); + cipt = (struct curl_certinfo *)malloc(sizeof(*cipt)); if(!cipt) ret = CURLE_OUT_OF_MEMORY; else { - cipt->certinfo = (struct curl_slist **) - calloc(cipf->num_of_certs + - 1, sizeof(struct curl_slist *)); + cipt->certinfo = + (struct curl_slist **)calloc(cipf->num_of_certs + 1, + sizeof(struct curl_slist *)); if(!cipt->certinfo) ret = CURLE_OUT_OF_MEMORY; else { @@ -629,20 +592,20 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) for(i = 0; i < cipf->num_of_certs; i++) if(cipf->certinfo[i]) if(!(cipt->certinfo[i] = slist_convert(ccsid, - cipf->certinfo[i], - ASCII_CCSID))) { + cipf->certinfo[i], + ASCII_CCSID))) { ret = CURLE_OUT_OF_MEMORY; break; } - } } + } if(ret != CURLE_OK) { curl_certinfo_free_all(cipt); - cipt = (struct curl_certinfo *) NULL; + cipt = (struct curl_certinfo *)NULL; } - *(struct curl_certinfo * *) paramp = cipt; + *(struct curl_certinfo **)paramp = cipt; } break; @@ -653,7 +616,7 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) break; default: - slp = (struct curl_slist **) paramp; + slp = (struct curl_slist **)paramp; if(*slp) { *slp = slist_convert(ccsid, *slp, ASCII_CCSID); if(!*slp) @@ -668,9 +631,7 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) return ret; } - -static int -Curl_is_formadd_string(CURLformoption option) +static int Curl_is_formadd_string(CURLformoption option) { switch(option) { @@ -687,23 +648,20 @@ Curl_is_formadd_string(CURLformoption option) return 0; } - -static void -Curl_formadd_release_local(struct curl_forms *forms, int nargs, int skip) +static void Curl_formadd_release_local(struct curl_forms *forms, int nargs, + int skip) { while(nargs--) if(nargs != skip) if(Curl_is_formadd_string(forms[nargs].option)) if(forms[nargs].value) - free((char *) forms[nargs].value); + free((char *)forms[nargs].value); - free((char *) forms); + free((char *)forms); } - -static int -Curl_formadd_convert(struct curl_forms *forms, - int formx, int lengthx, unsigned int ccsid) +static int Curl_formadd_convert(struct curl_forms *forms, int formx, + int lengthx, unsigned int ccsid) { int l; char *cp; @@ -713,7 +671,7 @@ Curl_formadd_convert(struct curl_forms *forms, return 0; if(lengthx >= 0) - l = (int) forms[lengthx].value; + l = (int)forms[lengthx].value; else l = strlen(forms[formx].value) + 1; @@ -722,15 +680,15 @@ Curl_formadd_convert(struct curl_forms *forms, if(!cp) return -1; - l = convert(cp, MAX_CONV_EXPANSION * l, ASCII_CCSID, - forms[formx].value, l, ccsid); + l = convert(cp, MAX_CONV_EXPANSION * l, ASCII_CCSID, forms[formx].value, l, + ccsid); if(l < 0) { free(cp); return -1; } - cp2 = realloc(cp, l); /* Shorten buffer to the string size. */ + cp2 = realloc(cp, l); /* Shorten buffer to the string size. */ if(cp2) cp = cp2; @@ -738,15 +696,13 @@ Curl_formadd_convert(struct curl_forms *forms, forms[formx].value = cp; if(lengthx >= 0) - forms[lengthx].value = (char *) l; /* Update length after conversion. */ + forms[lengthx].value = (char *)l; /* Update length after conversion. */ return l; } - -CURLFORMcode -curl_formadd_ccsid(struct curl_httppost **httppost, - struct curl_httppost **last_post, ...) +CURLFORMcode curl_formadd_ccsid(struct curl_httppost **httppost, + struct curl_httppost **last_post, ...) { va_list arg; CURLformoption option; @@ -797,7 +753,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, lengthx = -1; namex = -1; namelengthx = -1; - forms = (struct curl_forms *) NULL; + forms = (struct curl_forms *)NULL; va_start(arg, last_post); for(;;) { @@ -831,14 +787,14 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(option == CURLFORM_END) break; - } + } /* Dispatch by option. */ switch(option) { case CURLFORM_END: - forms = (struct curl_forms *) NULL; /* Leave array mode. */ + forms = (struct curl_forms *)NULL; /* Leave array mode. */ continue; case CURLFORM_ARRAY: @@ -851,7 +807,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, break; case CURLFORM_COPYNAME: - option = CURLFORM_PTRNAME; /* Static for now. */ + option = CURLFORM_PTRNAME; /* Static for now. */ case CURLFORM_PTRNAME: if(namex >= 0) @@ -861,10 +817,10 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!forms) { value = va_arg(arg, char *); - nameccsid = (unsigned int) va_arg(arg, long); + nameccsid = (unsigned int)va_arg(arg, long); } else { - nameccsid = (unsigned int) forms->value; + nameccsid = (unsigned int)forms->value; forms++; } @@ -878,10 +834,10 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!forms) { value = va_arg(arg, char *); - contentccsid = (unsigned int) va_arg(arg, long); + contentccsid = (unsigned int)va_arg(arg, long); } else { - contentccsid = (unsigned int) forms->value; + contentccsid = (unsigned int)forms->value; forms++; } @@ -890,7 +846,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, case CURLFORM_PTRCONTENTS: case CURLFORM_BUFFERPTR: if(!forms) - value = va_arg(arg, char *); /* No conversion. */ + value = va_arg(arg, char *); /* No conversion. */ break; @@ -898,7 +854,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, lengthx = nargs; if(!forms) - value = (char *) va_arg(arg, long); + value = (char *)va_arg(arg, long); break; @@ -906,7 +862,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, lengthx = nargs; if(!forms) - value = (char *) va_arg(arg, curl_off_t); + value = (char *)va_arg(arg, curl_off_t); break; @@ -914,25 +870,25 @@ curl_formadd_ccsid(struct curl_httppost **httppost, namelengthx = nargs; if(!forms) - value = (char *) va_arg(arg, long); + value = (char *)va_arg(arg, long); break; case CURLFORM_BUFFERLENGTH: if(!forms) - value = (char *) va_arg(arg, long); + value = (char *)va_arg(arg, long); break; case CURLFORM_CONTENTHEADER: if(!forms) - value = (char *) va_arg(arg, struct curl_slist *); + value = (char *)va_arg(arg, struct curl_slist *); break; case CURLFORM_STREAM: if(!forms) - value = (char *) va_arg(arg, void *); + value = (char *)va_arg(arg, void *); break; @@ -958,10 +914,10 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(!forms) { value = va_arg(arg, char *); - ccsid = (unsigned int) va_arg(arg, long); + ccsid = (unsigned int)va_arg(arg, long); } else { - ccsid = (unsigned int) forms->value; + ccsid = (unsigned int)forms->value; forms++; } @@ -992,15 +948,15 @@ curl_formadd_ccsid(struct curl_httppost **httppost, if(Curl_formadd_convert(lforms, namex, namelengthx, nameccsid) < 0) result = CURL_FORMADD_MEMORY; else - lforms[namex].option = CURLFORM_COPYNAME; /* Force copy. */ - } + lforms[namex].option = CURLFORM_COPYNAME; /* Force copy. */ + } if(result == CURL_FORMADD_OK) { if(Curl_formadd_convert(lforms, contentx, lengthx, contentccsid) < 0) result = CURL_FORMADD_MEMORY; else contentx = -1; - } + } /* Do the formadd with our converted parameters. */ @@ -1008,7 +964,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost, lforms[nargs].option = CURLFORM_END; result = curl_formadd(httppost, last_post, CURLFORM_ARRAY, lforms, CURLFORM_END); - } + } /* Terminate. */ @@ -1016,37 +972,35 @@ curl_formadd_ccsid(struct curl_httppost **httppost, return result; } - struct cfcdata { curl_formget_callback append; void * arg; unsigned int ccsid; }; - -static size_t -Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len) +static size_t Curl_formget_callback_ccsid(void *arg, const char *buf, + size_t len) { struct cfcdata *p; char *b; int l; size_t ret; - p = (struct cfcdata *) arg; + p = (struct cfcdata *)arg; - if((long) len <= 0) + if((long)len <= 0) return (*p->append)(p->arg, buf, len); b = malloc(MAX_CONV_EXPANSION * len); if(!b) - return (size_t) -1; + return (size_t)-1; l = convert(b, MAX_CONV_EXPANSION * len, p->ccsid, buf, len, ASCII_CCSID); if(l < 0) { free(b); - return (size_t) -1; + return (size_t)-1; } ret = (*p->append)(p->arg, b, l); @@ -1054,22 +1008,18 @@ Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len) return ret == l ? len : -1; } - -int -curl_formget_ccsid(struct curl_httppost *form, void *arg, - curl_formget_callback append, unsigned int ccsid) +int curl_formget_ccsid(struct curl_httppost *form, void *arg, + curl_formget_callback append, unsigned int ccsid) { struct cfcdata lcfc; lcfc.append = append; lcfc.arg = arg; lcfc.ccsid = ccsid; - return curl_formget(form, (void *) &lcfc, Curl_formget_callback_ccsid); + return curl_formget(form, (void *)&lcfc, Curl_formget_callback_ccsid); } - -CURLcode -curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) +CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) { CURLcode result; va_list arg; @@ -1247,13 +1197,13 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) break; } - data->set.postfieldsize = pfsize; /* Replace data size. */ + data->set.postfieldsize = pfsize; /* Replace data size. */ s = cp; cp = NULL; } result = curl_easy_setopt(easy, CURLOPT_POSTFIELDS, s); - data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */ + data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */ break; default: @@ -1265,7 +1215,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) if(bp && bp->data && bp->len && ccsid != NOCONV_CCSID && ccsid != ASCII_CCSID) { - pfsize = (curl_off_t) bp->len * MAX_CONV_EXPANSION; + pfsize = (curl_off_t)bp->len * MAX_CONV_EXPANSION; if(pfsize > SIZE_MAX) pfsize = SIZE_MAX; @@ -1293,7 +1243,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) break; } FALLTHROUGH(); - case CURLOPT_ERRORBUFFER: /* This is an output buffer. */ + case CURLOPT_ERRORBUFFER: /* This is an output buffer. */ result = Curl_vsetopt(easy, tag, arg); break; } @@ -1303,46 +1253,39 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) return result; } - /* ILE/RPG helper functions. */ -char * -curl_form_long_value(long value) +char *curl_form_long_value(long value) { /* ILE/RPG cannot cast an integer to a pointer. This procedure does it. */ - return (char *) value; + return (char *)value; } - -CURLcode -curl_easy_setopt_RPGnum_(CURL *easy, CURLoption tag, curl_off_t arg) +CURLcode curl_easy_setopt_RPGnum_(CURL *easy, CURLoption tag, curl_off_t arg) { /* ILE/RPG procedure overloading cannot discriminate between different size and/or signedness of format arguments. This provides a generic wrapper that adapts size to the given tag expectation. This procedure is not intended to be explicitly called from user code. */ if(tag / 10000 != CURLOPTTYPE_OFF_T) - return curl_easy_setopt(easy, tag, (long) arg); + return curl_easy_setopt(easy, tag, (long)arg); return curl_easy_setopt(easy, tag, arg); } - -CURLcode -curl_multi_setopt_RPGnum_(CURLM *multi, CURLMoption tag, curl_off_t arg) +CURLcode curl_multi_setopt_RPGnum_(CURLM *multi, CURLMoption tag, + curl_off_t arg) { /* Likewise, for multi handle. */ if(tag / 10000 != CURLOPTTYPE_OFF_T) - return curl_multi_setopt(multi, tag, (long) arg); + return curl_multi_setopt(multi, tag, (long)arg); return curl_multi_setopt(multi, tag, arg); } - -char * -curl_pushheader_bynum_cssid(struct curl_pushheaders *h, - size_t num, unsigned int ccsid) +char *curl_pushheader_bynum_cssid(struct curl_pushheaders *h, size_t num, + unsigned int ccsid) { - char *d = (char *) NULL; + char *d = (char *)NULL; char *s = curl_pushheader_bynum(h, num); if(s) @@ -1351,19 +1294,18 @@ curl_pushheader_bynum_cssid(struct curl_pushheaders *h, return d; } - -char * -curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header, - unsigned int ccsidin, unsigned int ccsidout) +char *curl_pushheader_byname_ccsid(struct curl_pushheaders *h, + const char *header, unsigned int ccsidin, + unsigned int ccsidout) { - char *d = (char *) NULL; + char *d = (char *)NULL; if(header) { header = dynconvert(ASCII_CCSID, header, -1, ccsidin, NULL); if(header) { char *s = curl_pushheader_byname(h, header); - free((char *) header); + free((char *)header); if(s) d = dynconvert(ccsidout, s, -1, ASCII_CCSID, NULL); @@ -1377,7 +1319,7 @@ static CURLcode mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid, CURLcode (*mimefunc)(curl_mimepart *part, const char *string)) { - char *s = (char *) NULL; + char *s = (char *)NULL; CURLcode result; if(!string) @@ -1391,45 +1333,40 @@ mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid, return result; } -CURLcode -curl_mime_name_ccsid(curl_mimepart *part, const char *name, unsigned int ccsid) +CURLcode curl_mime_name_ccsid(curl_mimepart *part, const char *name, + unsigned int ccsid) { return mime_string_call(part, name, ccsid, curl_mime_name); } -CURLcode -curl_mime_filename_ccsid(curl_mimepart *part, - const char *filename, unsigned int ccsid) +CURLcode curl_mime_filename_ccsid(curl_mimepart *part, const char *filename, + unsigned int ccsid) { return mime_string_call(part, filename, ccsid, curl_mime_filename); } -CURLcode -curl_mime_type_ccsid(curl_mimepart *part, - const char *mimetype, unsigned int ccsid) +CURLcode curl_mime_type_ccsid(curl_mimepart *part, const char *mimetype, + unsigned int ccsid) { return mime_string_call(part, mimetype, ccsid, curl_mime_type); } -CURLcode -curl_mime_encoder_ccsid(curl_mimepart *part, - const char *encoding, unsigned int ccsid) +CURLcode curl_mime_encoder_ccsid(curl_mimepart *part, const char *encoding, + unsigned int ccsid) { return mime_string_call(part, encoding, ccsid, curl_mime_encoder); } -CURLcode -curl_mime_filedata_ccsid(curl_mimepart *part, - const char *filename, unsigned int ccsid) +CURLcode curl_mime_filedata_ccsid(curl_mimepart *part, const char *filename, + unsigned int ccsid) { return mime_string_call(part, filename, ccsid, curl_mime_filedata); } -CURLcode -curl_mime_data_ccsid(curl_mimepart *part, - const char *data, size_t datasize, unsigned int ccsid) +CURLcode curl_mime_data_ccsid(curl_mimepart *part, const char *data, + size_t datasize, unsigned int ccsid) { - char *s = (char *) NULL; + char *s = (char *)NULL; CURLcode result; int osize; @@ -1444,9 +1381,8 @@ curl_mime_data_ccsid(curl_mimepart *part, return result; } -CURLUcode -curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part, - unsigned int flags, unsigned int ccsid) +CURLUcode curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part, + unsigned int flags, unsigned int ccsid) { char *s = (char *)NULL; CURLUcode result; @@ -1468,9 +1404,8 @@ curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part, return result; } -CURLUcode -curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part, - unsigned int flags, unsigned int ccsid) +CURLUcode curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part, + unsigned int flags, unsigned int ccsid) { char *s = (char *)NULL; CURLUcode result; @@ -1513,14 +1448,13 @@ curl_easy_option_get_name_ccsid(const struct curl_easyoption *option, if(option && option->name) name = dynconvert(ccsid, option->name, -1, ASCII_CCSID, NULL); - return (const char *) name; + return (const char *)name; } /* Header API CCSID support. */ -CURLHcode -curl_easy_header_ccsid(CURL *easy, const char *name, size_t index, - unsigned int origin, int request, - struct curl_header **hout, unsigned int ccsid) +CURLHcode curl_easy_header_ccsid(CURL *easy, const char *name, size_t index, + unsigned int origin, int request, + struct curl_header **hout, unsigned int ccsid) { CURLHcode result = CURLHE_BAD_ARGUMENT; diff --git a/packages/OS400/ccsidcurl.h b/packages/OS400/ccsidcurl.h index ab01d32b854b..f9e667a9e41c 100644 --- a/packages/OS400/ccsidcurl.h +++ b/packages/OS400/ccsidcurl.h @@ -28,7 +28,6 @@ #include "easy.h" #include "multi.h" - CURL_EXTERN char *curl_version_ccsid(unsigned int ccsid); CURL_EXTERN char *curl_easy_escape_ccsid(CURL *handle, const char *string, int length, diff --git a/packages/OS400/curlcl.c b/packages/OS400/curlcl.c index ca497b351d43..7a7f3c6459d6 100644 --- a/packages/OS400/curlcl.c +++ b/packages/OS400/curlcl.c @@ -48,16 +48,13 @@ struct arguments { struct vary2 *cmdargs; /* Command line arguments. */ }; -static int -is_ifs(char c) +static int is_ifs(char c) { return c == ' ' || c == '\t' || c == '\r' || c == '\n'; } -static int -parse_command_line(const char *cmdargs, size_t len, - size_t *argc, char **argv, - size_t *argsize, char *argbuf) +static int parse_command_line(const char *cmdargs, size_t len, size_t *argc, + char **argv, size_t *argsize, char *argbuf) { const char *endline = cmdargs + len; char quote = '\0'; @@ -126,9 +123,7 @@ parse_command_line(const char *cmdargs, size_t len, return 0; } - -int -main(int argsc, struct arguments *args) +int main(int argsc, struct arguments *args) { size_t argc; char **argv; @@ -154,20 +149,20 @@ main(int argsc, struct arguments *args) if(!exitcode) { /* Allocate space for parsed arguments. */ - argv = (char **) malloc((argc + 1) * sizeof(*argv) + argsize); + argv = (char **)malloc((argc + 1) * sizeof(*argv) + argsize); if(!argv) { fputs("Memory allocation error\n", stderr); exitcode = -2; } else { - _SYSPTR pgmptr = rslvsp(WLI_PGM, (char *) CURLPGM, library, _AUTH_NONE); - _LU_Work_Area_T *luwrka = (_LU_Work_Area_T *) _LUWRKA(); + _SYSPTR pgmptr = rslvsp(WLI_PGM, (char *)CURLPGM, library, _AUTH_NONE); + _LU_Work_Area_T *luwrka = (_LU_Work_Area_T *)_LUWRKA(); - parse_command_line(args->cmdargs->string, args->cmdargs->len, - &argc, argv, &argsize, (char *) (argv + argc + 1)); + parse_command_line(args->cmdargs->string, args->cmdargs->len, &argc, + argv, &argsize, (char *)(argv + argc + 1)); /* Call program. */ - _CALLPGMV((void *) &pgmptr, argv, argc); + _CALLPGMV((void *)&pgmptr, argv, argc); exitcode = luwrka->LU_RC; free(argv); diff --git a/packages/OS400/curlmain.c b/packages/OS400/curlmain.c index 19328f7c8446..54ca865264dd 100644 --- a/packages/OS400/curlmain.c +++ b/packages/OS400/curlmain.c @@ -41,15 +41,13 @@ extern int QadrtFreeConversionTable(void); extern int QadrtFreeEnviron(void); extern char * setlocale_a(int, const char *); - /* The ASCII main program. */ -extern int main_a(int argc, char * * argv); +extern int main_a(int argc, char **argv); /* Global values of original EBCDIC arguments. */ int ebcdic_argc; char ** ebcdic_argv; - int main(int argc, char **argv) { int i; @@ -63,8 +61,8 @@ int main(int argc, char **argv) char dummybuf[128]; /* To/From codes are 32 byte long strings with reserved fields initialized to ZEROs */ - const char tocode[32] = {"IBMCCSID01208"}; /* Use UTF-8. */ - const char fromcode[32] = {"IBMCCSID000000000010"}; + const char tocode[32] = { "IBMCCSID01208" }; /* Use UTF-8. */ + const char fromcode[32] = { "IBMCCSID000000000010" }; ebcdic_argc = argc; ebcdic_argv = argv; @@ -88,10 +86,10 @@ int main(int argc, char **argv) } /* Allocate memory for the ASCII arguments and vector. */ - argv = (char **) malloc((argc + 1) * sizeof(*argv) + bytecount); + argv = (char **)malloc((argc + 1) * sizeof(*argv) + bytecount); /* Build the vector and convert argument encoding. */ - outbuf = (char *) (argv + argc + 1); + outbuf = (char *)(argv + argc + 1); outbytesleft = bytecount; for(i = 0; i < argc; i++) { @@ -112,7 +110,7 @@ int main(int argc, char **argv) i = main_a(argc, argv); /* Clean-up allocated items. */ - free((char *) argv); + free((char *)argv); QadrtFreeConversionTable(); QadrtFreeEnviron(); diff --git a/packages/OS400/os400sys.c b/packages/OS400/os400sys.c index 4d31d3827c88..04be163617a8 100644 --- a/packages/OS400/os400sys.c +++ b/packages/OS400/os400sys.c @@ -65,14 +65,13 @@ #pragma convert(0) /* Restore EBCDIC. */ -#define MIN_BYTE_GAIN 1024 /* Minimum gain when shortening a buffer. */ +#define MIN_BYTE_GAIN 1024 /* Minimum gain when shortening a buffer. */ struct buffer_t { unsigned long size; /* Buffer size. */ char *buf; /* Buffer address. */ }; - static char *buffer_undef(localkey_t key, long size); static char *buffer_threaded(localkey_t key, long size); static char *buffer_unthreaded(localkey_t key, long size); @@ -86,10 +85,10 @@ char *(*Curl_thread_buffer)(localkey_t key, long size) = buffer_undef; static void thdbufdestroy(void *private) { if(private) { - struct buffer_t *p = (struct buffer_t *) private; + struct buffer_t *p = (struct buffer_t *)private; localkey_t i; - for(i = (localkey_t) 0; i < LK_LAST; i++) { + for(i = (localkey_t)0; i < LK_LAST; i++) { free(p->buf); p++; } @@ -98,27 +97,23 @@ static void thdbufdestroy(void *private) } } - -static void -terminate(void) +static void terminate(void) { if(Curl_thread_buffer == buffer_threaded) { locbufs = pthread_getspecific(thdkey); - pthread_setspecific(thdkey, (void *) NULL); + pthread_setspecific(thdkey, (void *)NULL); pthread_key_delete(thdkey); } if(Curl_thread_buffer != buffer_undef) { - thdbufdestroy((void *) locbufs); - locbufs = (struct buffer_t *) NULL; + thdbufdestroy((void *)locbufs); + locbufs = (struct buffer_t *)NULL; } Curl_thread_buffer = buffer_undef; } - -static char * -get_buffer(struct buffer_t *buf, long size) +static char *get_buffer(struct buffer_t *buf, long size) { char *cp; @@ -136,7 +131,7 @@ get_buffer(struct buffer_t *buf, long size) return buf->buf; } - if((unsigned long) size <= buf->size) { + if((unsigned long)size <= buf->size) { /* Shorten the buffer only if it frees a significant byte count. This avoids some realloc() overhead. */ @@ -157,27 +152,23 @@ get_buffer(struct buffer_t *buf, long size) return cp; } - /* * Get buffer address for the given local key. * This is always called though `Curl_thread_buffer' and when threads are * NOT made available by the os, so no mutex lock/unlock occurs. */ -static char * -buffer_unthreaded(localkey_t key, long size) +static char *buffer_unthreaded(localkey_t key, long size) { return get_buffer(locbufs + key, size); } - /* * Get buffer address for the given local key, taking care of * concurrent threads. * This is always called though `Curl_thread_buffer' and when threads are * made available by the os. */ -static char * -buffer_threaded(localkey_t key, long size) +static char *buffer_threaded(localkey_t key, long size) { struct buffer_t *bufs; @@ -185,30 +176,28 @@ buffer_threaded(localkey_t key, long size) make sure it is at least `size'-byte long. Set `size' to < 0 to get its address only. */ - bufs = (struct buffer_t *) pthread_getspecific(thdkey); + bufs = (struct buffer_t *)pthread_getspecific(thdkey); if(!bufs) { if(size < 0) - return (char *) NULL; /* No buffer yet. */ + return (char *)NULL; /* No buffer yet. */ /* Allocate buffer descriptors for the current thread. */ - bufs = calloc((size_t) LK_LAST, sizeof(*bufs)); + bufs = calloc((size_t)LK_LAST, sizeof(*bufs)); if(!bufs) - return (char *) NULL; + return (char *)NULL; - if(pthread_setspecific(thdkey, (void *) bufs)) { + if(pthread_setspecific(thdkey, (void *)bufs)) { free(bufs); - return (char *) NULL; + return (char *)NULL; } } return get_buffer(bufs + key, size); } - -static char * -buffer_undef(localkey_t key, long size) +static char *buffer_undef(localkey_t key, long size) { /* Define the buffer system, get the buffer for the given local key in the current thread, and make sure it is at least `size'-byte long. @@ -218,7 +207,7 @@ buffer_undef(localkey_t key, long size) /* Determine if we can use pthread-specific data. */ - if(Curl_thread_buffer == buffer_undef) { /* If unchanged during lock. */ + if(Curl_thread_buffer == buffer_undef) { /* If unchanged during lock. */ /* OS400 interactive jobs do not support threads: check here. */ if(!pthread_key_create(&thdkey, thdbufdestroy)) { /* Threads are supported: use the thread-aware buffer procedure. */ @@ -227,10 +216,10 @@ buffer_undef(localkey_t key, long size) else { /* No multi-threading available: allocate storage for single-thread * buffer headers. */ - locbufs = calloc((size_t) LK_LAST, sizeof(*locbufs)); + locbufs = calloc((size_t)LK_LAST, sizeof(*locbufs)); if(!locbufs) { - pthread_mutex_unlock(&mutex); /* For symetry: will probably fail. */ - return (char *) NULL; + pthread_mutex_unlock(&mutex); /* For symetry: will probably fail. */ + return (char *)NULL; } else Curl_thread_buffer = buffer_unthreaded; /* Use unthreaded version. */ @@ -243,15 +232,13 @@ buffer_undef(localkey_t key, long size) return Curl_thread_buffer(key, size); } - -static char * -set_thread_string(localkey_t key, const char *s) +static char *set_thread_string(localkey_t key, const char *s) { int i; char *cp; if(!s) - return (char *) NULL; + return (char *)NULL; i = strlen(s) + 1; cp = Curl_thread_buffer(key, MAX_CONV_EXPANSION * i + 1); @@ -264,12 +251,10 @@ set_thread_string(localkey_t key, const char *s) return cp; } - -int -Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen, - char *nodename, socklen_t nodenamelen, - char *servname, socklen_t servnamelen, - int flags) +int Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen, + char *nodename, socklen_t nodenamelen, + char *servname, socklen_t servnamelen, + int flags) { char *enodename = NULL; char *eservname = NULL; @@ -289,20 +274,20 @@ Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen, } } - status = getnameinfo(sa, salen, enodename, nodenamelen, - eservname, servnamelen, flags); + status = getnameinfo(sa, salen, enodename, nodenamelen, eservname, + servnamelen, flags); if(!status) { int i; if(enodename) { - i = QadrtConvertE2A(nodename, enodename, - nodenamelen - 1, strlen(enodename)); + i = QadrtConvertE2A(nodename, enodename, nodenamelen - 1, + strlen(enodename)); nodename[i] = '\0'; } if(eservname) { - i = QadrtConvertE2A(servname, eservname, - servnamelen - 1, strlen(eservname)); + i = QadrtConvertE2A(servname, eservname, servnamelen - 1, + strlen(eservname)); servname[i] = '\0'; } } @@ -312,18 +297,16 @@ Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen, return status; } -int -Curl_getaddrinfo_a(const char *nodename, const char *servname, - const struct addrinfo *hints, - struct addrinfo **res) +int Curl_getaddrinfo_a(const char *nodename, const char *servname, + const struct addrinfo *hints, struct addrinfo **res) { char *enodename; char *eservname; int status; int i; - enodename = (char *) NULL; - eservname = (char *) NULL; + enodename = (char *)NULL; + eservname = (char *)NULL; if(nodename) { i = strlen(nodename); @@ -360,8 +343,7 @@ Curl_getaddrinfo_a(const char *nodename, const char *servname, /* ASCII wrappers for the GSSAPI procedures. */ -static int -Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf) +static int Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf) { unsigned int i = buf->length; @@ -388,10 +370,8 @@ Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf) return 0; } - -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) +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) { OM_uint32 rc; unsigned int i; @@ -400,7 +380,7 @@ Curl_gss_import_name_a(OM_uint32 *minor_status, gss_buffer_t in_name, if(!in_name || !in_name->value || !in_name->length) return gss_import_name(minor_status, in_name, in_name_type, out_name); - memcpy((char *) &in, (char *) in_name, sizeof(in)); + memcpy((char *)&in, (char *)in_name, sizeof(in)); i = in.length; in.value = malloc(i + 1); @@ -413,17 +393,17 @@ Curl_gss_import_name_a(OM_uint32 *minor_status, gss_buffer_t in_name, } QadrtConvertA2E(in.value, in_name->value, i, i); - ((char *) in.value)[i] = '\0'; + ((char *)in.value)[i] = '\0'; rc = gss_import_name(minor_status, &in, in_name_type, out_name); free(in.value); return rc; } -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_buffer_t status_string) +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_buffer_t status_string) { int rc; @@ -477,7 +457,7 @@ Curl_gss_init_sec_context_a(OM_uint32 *minor_status, } QadrtConvertA2E(in.value, input_token->value, i, i); - ((char *) in.value)[i] = '\0'; + ((char *)in.value)[i] = '\0'; in.length = i; inp = ∈ } @@ -503,11 +483,9 @@ Curl_gss_init_sec_context_a(OM_uint32 *minor_status, return rc; } - -OM_uint32 -Curl_gss_delete_sec_context_a(OM_uint32 *minor_status, - gss_ctx_id_t *context_handle, - gss_buffer_t output_token) +OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 *minor_status, + gss_ctx_id_t *context_handle, + gss_buffer_t output_token) { OM_uint32 rc; @@ -533,38 +511,36 @@ Curl_gss_delete_sec_context_a(OM_uint32 *minor_status, /* ASCII wrappers for the LDAP procedures. */ -void * -Curl_ldap_init_a(char *host, int port) +void *Curl_ldap_init_a(char *host, int port) { size_t i; char *ehost; void *result; if(!host) - return (void *) ldap_init(host, port); + return (void *)ldap_init(host, port); i = strlen(host); ehost = malloc(i + 1); if(!ehost) - return (void *) NULL; + return (void *)NULL; QadrtConvertA2E(ehost, host, i, i); ehost[i] = '\0'; - result = (void *) ldap_init(ehost, port); + result = (void *)ldap_init(ehost, port); free(ehost); return result; } -int -Curl_ldap_simple_bind_s_a(void *ld, char *dn, char *passwd) +int Curl_ldap_simple_bind_s_a(void *ld, char *dn, char *passwd) { int i; char *edn; char *epasswd; - edn = (char *) NULL; - epasswd = (char *) NULL; + edn = (char *)NULL; + epasswd = (char *)NULL; if(dn) { i = strlen(dn); @@ -596,9 +572,8 @@ Curl_ldap_simple_bind_s_a(void *ld, char *dn, char *passwd) return i; } -int -Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter, - char **attrs, int attrsonly, LDAPMessage **res) +int Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter, + char **attrs, int attrsonly, LDAPMessage **res) { int i; int j; @@ -607,9 +582,9 @@ Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter, char **eattrs; int status; - ebase = (char *) NULL; - efilter = (char *) NULL; - eattrs = (char **) NULL; + ebase = (char *)NULL; + efilter = (char *)NULL; + eattrs = (char **)NULL; status = LDAP_SUCCESS; if(base) { @@ -676,14 +651,13 @@ Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter, return status; } - -struct berval ** -Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr) +struct berval **Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, + const char *attr) { char *cp; struct berval **result; - cp = (char *) NULL; + cp = (char *)NULL; if(attr) { int i = strlen(attr); @@ -692,7 +666,7 @@ Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr) if(!cp) { ldap_set_lderrno(ld, LDAP_NO_MEMORY, NULL, ldap_err2string(LDAP_NO_MEMORY)); - return (struct berval **) NULL; + return (struct berval **)NULL; } QadrtConvertA2E(cp, attr, i, i); @@ -708,14 +682,12 @@ Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr) return result; } -char * -Curl_ldap_err2string_a(int error) +char *Curl_ldap_err2string_a(int error) { return set_thread_string(LK_LDAP_ERROR, ldap_err2string(error)); } -char * -Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry) +char *Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry) { int i; char *cp; @@ -744,9 +716,8 @@ Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry) return cp; } -char * -Curl_ldap_first_attribute_a(void *ld, - LDAPMessage *entry, BerElement **berptr) +char *Curl_ldap_first_attribute_a(void *ld, LDAPMessage *entry, + BerElement **berptr) { int i; char *cp; @@ -775,9 +746,8 @@ Curl_ldap_first_attribute_a(void *ld, return cp; } -char * -Curl_ldap_next_attribute_a(void *ld, - LDAPMessage *entry, BerElement *berptr) +char *Curl_ldap_next_attribute_a(void *ld, LDAPMessage *entry, + BerElement *berptr) { int i; char *cp; @@ -808,9 +778,8 @@ Curl_ldap_next_attribute_a(void *ld, #endif /* CURL_DISABLE_LDAP */ -static int -sockaddr2ebcdic(struct sockaddr_storage *dstaddr, - const struct sockaddr *srcaddr, int srclen) +static int sockaddr2ebcdic(struct sockaddr_storage *dstaddr, + const struct sockaddr *srcaddr, int srclen) { const struct sockaddr_un *srcu; struct sockaddr_un *dstu; @@ -826,13 +795,13 @@ sockaddr2ebcdic(struct sockaddr_storage *dstaddr, return -1; } - memcpy((char *) dstaddr, (char *) srcaddr, srclen); + memcpy((char *)dstaddr, (char *)srcaddr, srclen); switch(srcaddr->sa_family) { case AF_UNIX: - srcu = (const struct sockaddr_un *) srcaddr; - dstu = (struct sockaddr_un *) dstaddr; + srcu = (const struct sockaddr_un *)srcaddr; + dstu = (struct sockaddr_un *)dstaddr; dstsize = sizeof(*dstaddr) - offsetof(struct sockaddr_un, sun_path); srclen -= offsetof(struct sockaddr_un, sun_path); i = QadrtConvertA2E(dstu->sun_path, srcu->sun_path, dstsize - 1, srclen); @@ -843,10 +812,8 @@ sockaddr2ebcdic(struct sockaddr_storage *dstaddr, return srclen; } - -static int -sockaddr2ascii(struct sockaddr *dstaddr, int dstlen, - const struct sockaddr_storage *srcaddr, int srclen) +static int sockaddr2ascii(struct sockaddr *dstaddr, int dstlen, + const struct sockaddr_storage *srcaddr, int srclen) { const struct sockaddr_un *srcu; struct sockaddr_un *dstu; @@ -864,15 +831,15 @@ sockaddr2ascii(struct sockaddr *dstaddr, int dstlen, return -1; } - memcpy((char *) dstaddr, (char *) srcaddr, srclen); + memcpy((char *)dstaddr, (char *)srcaddr, srclen); if(srclen >= offsetof(struct sockaddr_storage, ss_family) + sizeof(srcaddr->ss_family)) { switch(srcaddr->ss_family) { case AF_UNIX: - srcu = (const struct sockaddr_un *) srcaddr; - dstu = (struct sockaddr_un *) dstaddr; + srcu = (const struct sockaddr_un *)srcaddr; + dstu = (struct sockaddr_un *)dstaddr; dstsize = dstlen - offsetof(struct sockaddr_un, sun_path); srclen -= offsetof(struct sockaddr_un, sun_path); if(dstsize > 0 && srclen > 0) { @@ -887,8 +854,7 @@ sockaddr2ascii(struct sockaddr *dstaddr, int dstlen, return srclen; } -int -Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen) +int Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen) { int i; struct sockaddr_storage laddr; @@ -898,11 +864,10 @@ Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen) if(i < 0) return -1; - return connect(sd, (struct sockaddr *) &laddr, i); + return connect(sd, (struct sockaddr *)&laddr, i); } -int -Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen) +int Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen) { int i; struct sockaddr_storage laddr; @@ -912,12 +877,11 @@ Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen) if(i < 0) return -1; - return bind(sd, (struct sockaddr *) &laddr, i); + return bind(sd, (struct sockaddr *)&laddr, i); } -int -Curl_os400_sendto(int sd, char *buffer, int buflen, int flags, - const struct sockaddr *dstaddr, int addrlen) +int Curl_os400_sendto(int sd, char *buffer, int buflen, int flags, + const struct sockaddr *dstaddr, int addrlen) { int i; struct sockaddr_storage laddr; @@ -927,12 +891,11 @@ Curl_os400_sendto(int sd, char *buffer, int buflen, int flags, if(i < 0) return -1; - return sendto(sd, buffer, buflen, flags, (struct sockaddr *) &laddr, i); + return sendto(sd, buffer, buflen, flags, (struct sockaddr *)&laddr, i); } -int -Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags, - struct sockaddr *fromaddr, int *addrlen) +int Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags, + struct sockaddr *fromaddr, int *addrlen) { int rcvlen; struct sockaddr_storage laddr; @@ -943,7 +906,7 @@ Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags, laddr.ss_family = AF_UNSPEC; /* To detect if unused. */ rcvlen = recvfrom(sd, buffer, buflen, flags, - (struct sockaddr *) &laddr, &laddrlen); + (struct sockaddr *)&laddr, &laddrlen); if(rcvlen < 0) return rcvlen; @@ -959,12 +922,11 @@ Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags, return rcvlen; } -int -Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen) +int Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen) { struct sockaddr_storage laddr; int laddrlen = sizeof(laddr); - int retcode = getpeername(sd, (struct sockaddr *) &laddr, &laddrlen); + int retcode = getpeername(sd, (struct sockaddr *)&laddr, &laddrlen); if(!retcode) { laddrlen = sockaddr2ascii(addr, *addrlen, &laddr, laddrlen); @@ -976,12 +938,11 @@ Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen) return retcode; } -int -Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen) +int Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen) { struct sockaddr_storage laddr; int laddrlen = sizeof(laddr); - int retcode = getsockname(sd, (struct sockaddr *) &laddr, &laddrlen); + int retcode = getsockname(sd, (struct sockaddr *)&laddr, &laddrlen); if(!retcode) { laddrlen = sockaddr2ascii(addr, *addrlen, &laddr, laddrlen); @@ -993,17 +954,14 @@ Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen) return retcode; } - #ifdef HAVE_LIBZ -const char * -Curl_os400_zlibVersion(void) +const char *Curl_os400_zlibVersion(void) { return set_thread_string(LK_ZLIB_VERSION, zlibVersion()); } - -int -Curl_os400_inflateInit_(z_streamp strm, const char *version, int stream_size) +int Curl_os400_inflateInit_(z_streamp strm, const char *version, + int stream_size) { z_const char *msgb4 = strm->msg; int ret; @@ -1016,9 +974,8 @@ Curl_os400_inflateInit_(z_streamp strm, const char *version, int stream_size) return ret; } -int -Curl_os400_inflateInit2_(z_streamp strm, int windowBits, - const char *version, int stream_size) +int Curl_os400_inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size) { z_const char *msgb4 = strm->msg; int ret; @@ -1031,8 +988,7 @@ Curl_os400_inflateInit2_(z_streamp strm, int windowBits, return ret; } -int -Curl_os400_inflate(z_streamp strm, int flush) +int Curl_os400_inflate(z_streamp strm, int flush) { z_const char *msgb4 = strm->msg; int ret; @@ -1045,8 +1001,7 @@ Curl_os400_inflate(z_streamp strm, int flush) return ret; } -int -Curl_os400_inflateEnd(z_streamp strm) +int Curl_os400_inflateEnd(z_streamp strm) { z_const char *msgb4 = strm->msg; int ret; diff --git a/packages/OS400/os400sys.h b/packages/OS400/os400sys.h index d5ff412f2852..eb2cdb828ace 100644 --- a/packages/OS400/os400sys.h +++ b/packages/OS400/os400sys.h @@ -28,30 +28,27 @@ #ifndef __OS400_SYS_ #define __OS400_SYS_ - /* Per-thread item identifiers. */ typedef enum { - LK_GSK_ERROR, - LK_LDAP_ERROR, - LK_CURL_VERSION, - LK_VERSION_INFO, - LK_VERSION_INFO_DATA, - LK_EASY_STRERROR, - LK_SHARE_STRERROR, - LK_MULTI_STRERROR, - LK_URL_STRERROR, - LK_ZLIB_VERSION, - LK_ZLIB_MSG, - LK_LAST -} localkey_t; - - -extern char * (* Curl_thread_buffer)(localkey_t key, long size); - + LK_GSK_ERROR, + LK_LDAP_ERROR, + LK_CURL_VERSION, + LK_VERSION_INFO, + LK_VERSION_INFO_DATA, + LK_EASY_STRERROR, + LK_SHARE_STRERROR, + LK_MULTI_STRERROR, + LK_URL_STRERROR, + LK_ZLIB_VERSION, + LK_ZLIB_MSG, + LK_LAST +} localkey_t; + +extern char *(*Curl_thread_buffer)(localkey_t key, long size); /* Maximum string expansion factor due to character code conversion. */ -#define MAX_CONV_EXPANSION 4 /* Can deal with UTF-8. */ +#define MAX_CONV_EXPANSION 4 /* Can deal with UTF-8. */ #endif diff --git a/packages/vms/curl_crtl_init.c b/packages/vms/curl_crtl_init.c index d6500c08cde3..7966a38f820b 100644 --- a/packages/vms/curl_crtl_init.c +++ b/packages/vms/curl_crtl_init.c @@ -78,34 +78,29 @@ struct itmlst_3 { #pragma member_alignment restore #ifdef __VAX -#define ENABLE "ENABLE" +#define ENABLE "ENABLE" #define DISABLE "DISABLE" #else -#define ENABLE TRUE +#define ENABLE TRUE #define DISABLE 0 -int decc$feature_get_index (const char *name); -int decc$feature_set_value (int index, int mode, int value); +int decc$feature_get_index(const char *name); +int decc$feature_set_value(int index, int mode, int value); #endif -int SYS$TRNLNM( - const unsigned long *attr, - const struct dsc$descriptor_s *table_dsc, - struct dsc$descriptor_s *name_dsc, - const unsigned char *acmode, - const struct itmlst_3 *item_list); -int SYS$CRELNM( - const unsigned long *attr, - const struct dsc$descriptor_s *table_dsc, - const struct dsc$descriptor_s *name_dsc, - const unsigned char *acmode, - const struct itmlst_3 *item_list); - +int SYS$TRNLNM(const unsigned long *attr, + const struct dsc$descriptor_s *table_dsc, + struct dsc$descriptor_s *name_dsc, + const unsigned char *acmode, + const struct itmlst_3 *item_list); +int SYS$CRELNM(const unsigned long *attr, + const struct dsc$descriptor_s *table_dsc, + const struct dsc$descriptor_s *name_dsc, + const unsigned char *acmode, + const struct itmlst_3 *item_list); /* Take all the fun out of simply looking up a logical name */ -static int sys_trnlnm(const char *logname, - char *value, - int value_len) +static int sys_trnlnm(const char *logname, char *value, int value_len) { const $DESCRIPTOR(table_dsc, "LNM$FILE_DEV"); const unsigned long attr = LNM$M_CASE_BLIND; @@ -140,8 +135,7 @@ static int sys_trnlnm(const char *logname, } /* How to simply create a logical name */ -static int sys_crelnm(const char *logname, - const char *value) +static int sys_crelnm(const char *logname, const char *value) { int ret_val; const char *proc_table = "LNM$PROCESS_TABLE"; @@ -149,12 +143,12 @@ static int sys_crelnm(const char *logname, struct dsc$descriptor_s logname_dsc; struct itmlst_3 item_list[2]; - proc_table_dsc.dsc$a_pointer = (char *) proc_table; + proc_table_dsc.dsc$a_pointer = (char *)proc_table; proc_table_dsc.dsc$w_length = strlen(proc_table); proc_table_dsc.dsc$b_dtype = DSC$K_DTYPE_T; proc_table_dsc.dsc$b_class = DSC$K_CLASS_S; - logname_dsc.dsc$a_pointer = (char *) logname; + logname_dsc.dsc$a_pointer = (char *)logname; logname_dsc.dsc$w_length = strlen(logname); logname_dsc.dsc$b_dtype = DSC$K_DTYPE_T; logname_dsc.dsc$b_class = DSC$K_CLASS_S; @@ -172,7 +166,6 @@ static int sys_crelnm(const char *logname, return ret_val; } - /* Start of DECC RTL Feature handling */ /* @@ -191,7 +184,7 @@ static void set_feature_default(const char *name, int value) index = decc$feature_get_index(name); if(index > 0) - decc$feature_set_value (index, 0, value); + decc$feature_set_value(index, 0, value); } #endif @@ -202,7 +195,7 @@ static void set_features(void) int use_unix_settings = 1; status = sys_trnlnm("GNV$UNIX_SHELL", - unix_shell_name, sizeof(unix_shell_name) -1); + unix_shell_name, sizeof(unix_shell_name) - 1); if(!$VMS_STATUS_SUCCESS(status)) { use_unix_settings = 0; } @@ -262,7 +255,6 @@ static void set_features(void) set_feature_default("DECC$FILE_OWNER_UNIX", ENABLE); set_feature_default("DECC$POSIX_SEEK_STREAM_FILE", ENABLE); - } else { set_feature_default("DECC$FILENAME_UNIX_REPORT", ENABLE); @@ -285,10 +277,9 @@ static void set_features(void) /* Commented here to prevent future bugs: A program or user should */ /* never ever enable DECC$POSIX_STYLE_UID. */ /* It will probably break all code that accesses UIDs */ - /* do_not_set_default ("DECC$POSIX_STYLE_UID", TRUE); */ + /* do_not_set_default("DECC$POSIX_STYLE_UID", TRUE); */ } - /* Some boilerplate to force this to be a proper LIB$INITIALIZE section */ #pragma nostandard @@ -306,7 +297,7 @@ static void set_features(void) # endif #endif /* Set our contribution to the LIB$INITIALIZE array */ -void (* const iniarray[])(void) = {set_features }; +void (* const iniarray[])(void) = { set_features }; #ifndef __VAX # if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore @@ -315,7 +306,6 @@ void (* const iniarray[])(void) = {set_features }; # endif #endif - /* ** Force a reference to LIB$INITIALIZE to ensure it ** exists in the image. @@ -324,7 +314,7 @@ int LIB$INITIALIZE(void); #ifdef __DECC #pragma extern_model strict_refdef #endif - int lib_init_ref = (int) LIB$INITIALIZE; +int lib_init_ref = (int)LIB$INITIALIZE; #ifdef __DECC #pragma extern_model restore #pragma standard diff --git a/packages/vms/curlmsg.h b/packages/vms/curlmsg.h index 9b5c4c76d144..f05c3a8f5a03 100644 --- a/packages/vms/curlmsg.h +++ b/packages/vms/curlmsg.h @@ -50,93 +50,93 @@ /* IF YOU UPDATE THIS FILE, UPDATE CURLMSG_VMS.H SO THAT THEY ARE IN SYNC */ /* */ -#define CURL_FACILITY 3841 -#define CURL_OK 251756553 -#define CURL_UNSUPPORTED_PROTOCOL 251756562 -#define CURL_FAILED_INIT 251756570 -#define CURL_URL_MALFORMAT 251756578 -#define CURL_OBSOLETE4 251756586 -#define CURL_COULDNT_RESOLVE_PROXY 251756594 -#define CURL_COULDNT_RESOLVE_HOST 251756602 -#define CURL_COULDNT_CONNECT 251756610 -#define CURL_WEIRD_SERVER_REPLY 251756618 +#define CURL_FACILITY 3841 +#define CURL_OK 251756553 +#define CURL_UNSUPPORTED_PROTOCOL 251756562 +#define CURL_FAILED_INIT 251756570 +#define CURL_URL_MALFORMAT 251756578 +#define CURL_OBSOLETE4 251756586 +#define CURL_COULDNT_RESOLVE_PROXY 251756594 +#define CURL_COULDNT_RESOLVE_HOST 251756602 +#define CURL_COULDNT_CONNECT 251756610 +#define CURL_WEIRD_SERVER_REPLY 251756618 #define CURL_FTP_WEIRD_SERVER_REPLY CURL_WEIRD_SERVER_REPLY -#define CURL_FTP_ACCESS_DENIED 251756626 -#define CURL_OBSOLETE10 251756634 -#define CURL_FTP_WEIRD_PASS_REPLY 251756642 -#define CURL_OBSOLETE12 251756650 -#define CURL_FTP_WEIRD_PASV_REPLY 251756658 -#define CURL_FTP_WEIRD_227_FORMAT 251756666 -#define CURL_FTP_CANT_GET_HOST 251756674 -#define CURL_OBSOLETE16 251756682 -#define CURL_FTP_COULDNT_SET_TYPE 251756690 -#define CURL_PARTIAL_FILE 251756698 -#define CURL_FTP_COULDNT_RETR_FILE 251756706 -#define CURL_OBSOLETE20 251756714 -#define CURL_QUOTE_ERROR 251756722 -#define CURL_HTTP_RETURNED_ERROR 251756730 -#define CURL_WRITE_ERROR 251756738 -#define CURL_OBSOLETE24 251756746 -#define CURL_UPLOAD_FAILED 251756754 -#define CURL_READ_ERROR 251756762 -#define CURL_OUT_OF_MEMORY 251756770 -#define CURL_OPERATION_TIMEOUTED 251756778 -#define CURL_OBSOLETE29 251756786 -#define CURL_FTP_PORT_FAILED 251756794 -#define CURL_FTP_COULDNT_USE_REST 251756802 -#define CURL_OBSOLETE32 251756810 -#define CURL_RANGE_ERROR 251756818 -#define CURL_HTTP_POST_ERROR 251756826 -#define CURL_SSL_CONNECT_ERROR 251756834 -#define CURL_BAD_DOWNLOAD_RESUME 251756842 +#define CURL_FTP_ACCESS_DENIED 251756626 +#define CURL_OBSOLETE10 251756634 +#define CURL_FTP_WEIRD_PASS_REPLY 251756642 +#define CURL_OBSOLETE12 251756650 +#define CURL_FTP_WEIRD_PASV_REPLY 251756658 +#define CURL_FTP_WEIRD_227_FORMAT 251756666 +#define CURL_FTP_CANT_GET_HOST 251756674 +#define CURL_OBSOLETE16 251756682 +#define CURL_FTP_COULDNT_SET_TYPE 251756690 +#define CURL_PARTIAL_FILE 251756698 +#define CURL_FTP_COULDNT_RETR_FILE 251756706 +#define CURL_OBSOLETE20 251756714 +#define CURL_QUOTE_ERROR 251756722 +#define CURL_HTTP_RETURNED_ERROR 251756730 +#define CURL_WRITE_ERROR 251756738 +#define CURL_OBSOLETE24 251756746 +#define CURL_UPLOAD_FAILED 251756754 +#define CURL_READ_ERROR 251756762 +#define CURL_OUT_OF_MEMORY 251756770 +#define CURL_OPERATION_TIMEOUTED 251756778 +#define CURL_OBSOLETE29 251756786 +#define CURL_FTP_PORT_FAILED 251756794 +#define CURL_FTP_COULDNT_USE_REST 251756802 +#define CURL_OBSOLETE32 251756810 +#define CURL_RANGE_ERROR 251756818 +#define CURL_HTTP_POST_ERROR 251756826 +#define CURL_SSL_CONNECT_ERROR 251756834 +#define CURL_BAD_DOWNLOAD_RESUME 251756842 #define CURL_FILE_COULDNT_READ_FILE 251756850 -#define CURL_LDAP_CANNOT_BIND 251756858 -#define CURL_LDAP_SEARCH_FAILED 251756866 -#define CURL_OBSOLETE40 251756874 -#define CURL_FUNCTION_NOT_FOUND 251756882 -#define CURL_ABORTED_BY_CALLBACK 251756890 -#define CURL_BAD_FUNCTION_ARGUMENT 251756898 -#define CURL_OBSOLETE44 251756906 -#define CURL_INTERFACE_FAILED 251756914 -#define CURL_OBSOLETE46 251756922 -#define CURL_TOO_MANY_REDIRECTS 251756930 -#define CURL_UNKNOWN_TELNET_OPTION 251756938 -#define CURL_TELNET_OPTION_SYNTAX 251756946 -#define CURL_OBSOLETE50 251756954 -#define CURL_PEER_FAILED_VERIF 251756962 -#define CURL_GOT_NOTHING 251756970 -#define CURL_SSL_ENGINE_NOTFOUND 251756978 -#define CURL_SSL_ENGINE_SETFAILED 251756986 -#define CURL_SEND_ERROR 251756994 -#define CURL_RECV_ERROR 251757002 -#define CURL_OBSOLETE57 251757010 -#define CURL_SSL_CERTPROBLEM 251757018 -#define CURL_SSL_CIPHER 251757026 -#define CURL_SSL_CACERT 251757034 -#define CURL_BAD_CONTENT_ENCODING 251757042 -#define CURL_LDAP_INVALID_URL 251757050 -#define CURL_FILESIZE_EXCEEDED 251757058 -#define CURL_USE_SSL_FAILED 251757066 -#define CURL_SEND_FAIL_REWIND 251757074 -#define CURL_SSL_ENGINE_INITFAILED 251757082 -#define CURL_LOGIN_DENIED 251757090 -#define CURL_TFTP_NOTFOUND 251757098 -#define CURL_TFTP_PERM 251757106 -#define CURL_REMOTE_DISK_FULL 251757114 -#define CURL_TFTP_ILLEGAL 251757122 -#define CURL_TFTP_UNKNOWNID 251757130 -#define CURL_REMOTE_FILE_EXISTS 251757138 -#define CURL_TFTP_NOSUCHUSER 251757146 -#define CURL_CONV_FAILED 251757154 -#define CURL_CONV_REQD 251757162 -#define CURL_SSL_CACERT_BADFILE 251757170 -#define CURL_REMOTE_FILE_NOT_FOUND 251757178 -#define CURL_SSH 251757186 -#define CURL_SSL_SHUTDOWN_FAILED 251757194 -#define CURL_AGAIN 251757202 -#define CURL_SSL_CRL_BADFILE 251757210 -#define CURL_SSL_ISSUER_ERROR 251757218 -#define CURL_CURL_LAST 251757226 +#define CURL_LDAP_CANNOT_BIND 251756858 +#define CURL_LDAP_SEARCH_FAILED 251756866 +#define CURL_OBSOLETE40 251756874 +#define CURL_FUNCTION_NOT_FOUND 251756882 +#define CURL_ABORTED_BY_CALLBACK 251756890 +#define CURL_BAD_FUNCTION_ARGUMENT 251756898 +#define CURL_OBSOLETE44 251756906 +#define CURL_INTERFACE_FAILED 251756914 +#define CURL_OBSOLETE46 251756922 +#define CURL_TOO_MANY_REDIRECTS 251756930 +#define CURL_UNKNOWN_TELNET_OPTION 251756938 +#define CURL_TELNET_OPTION_SYNTAX 251756946 +#define CURL_OBSOLETE50 251756954 +#define CURL_PEER_FAILED_VERIF 251756962 +#define CURL_GOT_NOTHING 251756970 +#define CURL_SSL_ENGINE_NOTFOUND 251756978 +#define CURL_SSL_ENGINE_SETFAILED 251756986 +#define CURL_SEND_ERROR 251756994 +#define CURL_RECV_ERROR 251757002 +#define CURL_OBSOLETE57 251757010 +#define CURL_SSL_CERTPROBLEM 251757018 +#define CURL_SSL_CIPHER 251757026 +#define CURL_SSL_CACERT 251757034 +#define CURL_BAD_CONTENT_ENCODING 251757042 +#define CURL_LDAP_INVALID_URL 251757050 +#define CURL_FILESIZE_EXCEEDED 251757058 +#define CURL_USE_SSL_FAILED 251757066 +#define CURL_SEND_FAIL_REWIND 251757074 +#define CURL_SSL_ENGINE_INITFAILED 251757082 +#define CURL_LOGIN_DENIED 251757090 +#define CURL_TFTP_NOTFOUND 251757098 +#define CURL_TFTP_PERM 251757106 +#define CURL_REMOTE_DISK_FULL 251757114 +#define CURL_TFTP_ILLEGAL 251757122 +#define CURL_TFTP_UNKNOWNID 251757130 +#define CURL_REMOTE_FILE_EXISTS 251757138 +#define CURL_TFTP_NOSUCHUSER 251757146 +#define CURL_CONV_FAILED 251757154 +#define CURL_CONV_REQD 251757162 +#define CURL_SSL_CACERT_BADFILE 251757170 +#define CURL_REMOTE_FILE_NOT_FOUND 251757178 +#define CURL_SSH 251757186 +#define CURL_SSL_SHUTDOWN_FAILED 251757194 +#define CURL_AGAIN 251757202 +#define CURL_SSL_CRL_BADFILE 251757210 +#define CURL_SSL_ISSUER_ERROR 251757218 +#define CURL_CURL_LAST 251757226 #pragma __member_alignment __restore diff --git a/packages/vms/report_openssl_version.c b/packages/vms/report_openssl_version.c index dd1713b24446..d2b0d367bc49 100644 --- a/packages/vms/report_openssl_version.c +++ b/packages/vms/report_openssl_version.c @@ -35,15 +35,14 @@ #include #include -unsigned long LIB$SET_SYMBOL( - const struct dsc$descriptor_s * symbol, - const struct dsc$descriptor_s * value, - const unsigned long *table_type); +unsigned long LIB$SET_SYMBOL(const struct dsc$descriptor_s *symbol, + const struct dsc$descriptor_s *value, + const unsigned long *table_type); int main(int argc, char **argv) { void *libptr; - const char * (*ssl_version)(int t); + const char *(*ssl_version)(int t); const char *version; if(argc < 1) { @@ -53,11 +52,11 @@ int main(int argc, char **argv) libptr = dlopen(argv[1], 0); - ssl_version = (const char * (*)(int))dlsym(libptr, "SSLeay_version"); + ssl_version = (const char *(*)(int))dlsym(libptr, "SSLeay_version"); if(!ssl_version) { - ssl_version = (const char * (*)(int))dlsym(libptr, "ssleay_version"); + ssl_version = (const char *(*)(int))dlsym(libptr, "ssleay_version"); if(!ssl_version) { - ssl_version = (const char * (*)(int))dlsym(libptr, "SSLEAY_VERSION"); + ssl_version = (const char *(*)(int))dlsym(libptr, "SSLEAY_VERSION"); } } diff --git a/scripts/cd2cd b/scripts/cd2cd index 9356ade6e63b..d593e9a579ba 100755 --- a/scripts/cd2cd +++ b/scripts/cd2cd @@ -54,7 +54,6 @@ while(1) { } } - use POSIX qw(strftime); my @ts; if(defined($ENV{SOURCE_DATE_EPOCH})) { diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 87b72af96326..54436b8358ea 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -1205,7 +1205,6 @@ sub scanfile { } - if($errors || $warnings || $verbose) { printf "checksrc: %d errors and %d warnings\n", $errors, $warnings; if($suppressed) { diff --git a/scripts/ciconfig.pl b/scripts/ciconfig.pl index c56c31e2be62..95ce0fb877ed 100755 --- a/scripts/ciconfig.pl +++ b/scripts/ciconfig.pl @@ -108,7 +108,6 @@ ); - sub configureopts { my ($opts)=@_; my %thisin; @@ -189,7 +188,6 @@ sub scanjobs { } } - print "ENABLED configure options that are not available\n"; for my $w (sort keys %with) { if(!$avail{$w}) { diff --git a/scripts/delta b/scripts/delta index b6a1df8a17e2..c67d98a2c3d4 100755 --- a/scripts/delta +++ b/scripts/delta @@ -95,7 +95,7 @@ my $deletes=`git diff-tree --diff-filter=A -r --summary origin/$branch $start 2> my $creates=`git diff-tree --diff-filter=D -r --summary origin/$branch $start 2>/dev/null | wc -l`; # Time since that tag -my $tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # Unix timestamp +my $tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut '-d|' -f2`; # Unix timestamp my $taggednice=`git for-each-ref --format="%(refname:short) | %(creatordate)" refs/tags/* | grep ^$start | cut '-d|' -f2`; # human readable time chomp $taggednice; my $now=POSIX::strftime("%s", localtime()); diff --git a/scripts/firefox-db2pem.sh b/scripts/firefox-db2pem.sh index 634e429b504f..7d31b1288693 100755 --- a/scripts/firefox-db2pem.sh +++ b/scripts/firefox-db2pem.sh @@ -54,7 +54,6 @@ cat > "$out" < 4)" }, - {"smbs", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMB) && \\\n" - " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" }, - {"smtp", "#ifndef CURL_DISABLE_SMTP" }, - {"smtps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMTP)" }, - {"telnet", "#ifndef CURL_DISABLE_TELNET" }, - {"tftp", "#ifndef CURL_DISABLE_TFTP" }, - {"ws", - "#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)" }, - {"wss", "#if !defined(CURL_DISABLE_WEBSOCKETS) && \\\n" - " defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" }, + { "dict", "#ifndef CURL_DISABLE_DICT" }, + { "file", "#ifndef CURL_DISABLE_FILE" }, + { "ftp", "#ifndef CURL_DISABLE_FTP" }, + { "ftps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_FTP)" }, + { "gopher", "#ifndef CURL_DISABLE_GOPHER" }, + { "gophers", "#if defined(USE_SSL) && !defined(CURL_DISABLE_GOPHER)" }, + { "http", "#ifndef CURL_DISABLE_HTTP" }, + { "https", "#if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" }, + { "imap", "#ifndef CURL_DISABLE_IMAP" }, + { "imaps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP)" }, + { "ldap", "#ifndef CURL_DISABLE_LDAP" }, + { "ldaps", "#if !defined(CURL_DISABLE_LDAP) && \\\n" + " !defined(CURL_DISABLE_LDAPS) && \\\n" + " ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \\\n" + " (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))" }, + { "mqtt", "#ifndef CURL_DISABLE_MQTT" }, + { "pop3", "#ifndef CURL_DISABLE_POP3" }, + { "pop3s", "#if defined(USE_SSL) && !defined(CURL_DISABLE_POP3)" }, + { "rtmp", "#ifdef USE_LIBRTMP" }, + { "rtmpt", "#ifdef USE_LIBRTMP" }, + { "rtmpe", "#ifdef USE_LIBRTMP" }, + { "rtmpte", "#ifdef USE_LIBRTMP" }, + { "rtmps", "#ifdef USE_LIBRTMP" }, + { "rtmpts", "#ifdef USE_LIBRTMP" }, + { "rtsp", "#ifndef CURL_DISABLE_RTSP" }, + { "scp", "#ifdef USE_SSH" }, + { "sftp", "#ifdef USE_SSH" }, + { "smb", "#if !defined(CURL_DISABLE_SMB) && \\\n" + " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" }, + { "smbs", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMB) && \\\n" + " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" }, + { "smtp", "#ifndef CURL_DISABLE_SMTP" }, + { "smtps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMTP)" }, + { "telnet", "#ifndef CURL_DISABLE_TELNET" }, + { "tftp", "#ifndef CURL_DISABLE_TFTP" }, + { "ws", + "#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)" }, + { "wss", "#if !defined(CURL_DISABLE_WEBSOCKETS) && \\\n" + " defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" }, { NULL, NULL } }; @@ -108,7 +108,8 @@ static void showtable(int try, int init, int shift) " s++;\n" " l--;\n" " }\n" - "*/\n", init, shift); + "*/\n", + init, shift); printf(" static const struct Curl_handler * const protocols[%d] = {", try); @@ -158,10 +159,10 @@ int main(void) for(j = 0; j < i; j++) { if(num[j] == v) { - /* +#if 0 printf("NOPE: %u is a dupe (%s and %s)\n", v, scheme[i], scheme[j]); - */ +#endif badcombo = 1; break; } diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 0466c547c3e3..fd669f96cf9a 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -273,7 +273,6 @@ ParameterError parseconfig(const char *filename, int max_recursive, return err; } - static bool get_line(FILE *input, struct dynbuf *buf, bool *error) { CURLcode result; diff --git a/tests/appveyor.pm b/tests/appveyor.pm index ed1728682c53..f332bc2b277a 100644 --- a/tests/appveyor.pm +++ b/tests/appveyor.pm @@ -38,7 +38,6 @@ BEGIN { ); } - my %APPVEYOR_TEST_NAMES; # JSON and shell-quoted test names by test number sub appveyor_check_environment { diff --git a/tests/data/data320.html b/tests/data/data320.html index 2756af5f3b98..307bb87c473c 100644 --- a/tests/data/data320.html +++ b/tests/data/data320.html @@ -1,7 +1,6 @@

This is GnuTLS

-

Session ID: 003030000100000001000000000000000030330001000000B062410001000000

If your browser supports session resuming, then you should see the same session ID, when you press the reload button.

Connected as user 'jsmith'.

diff --git a/tests/data/test1109 b/tests/data/test1109 index 043e22cd0829..667e09821597 100644 --- a/tests/data/test1109 +++ b/tests/data/test1109 @@ -30,7 +30,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER#test
- # Verify data after the test has been "shot" diff --git a/tests/data/test1110 b/tests/data/test1110 index 2d57e49d61e1..ac282f572caa 100644 --- a/tests/data/test1110 +++ b/tests/data/test1110 @@ -31,7 +31,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?q=foobar#fragment - # Verify data after the test has been "shot" diff --git a/tests/data/test1111 b/tests/data/test1111 index 8cf705afe7e1..9d9232248a95 100644 --- a/tests/data/test1111 +++ b/tests/data/test1111 @@ -31,7 +31,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER?q=foobar#fragment#fragment2 - # Verify data after the test has been "shot" diff --git a/tests/data/test1331 b/tests/data/test1331 index 7f8ff7868001..10df80f16a3f 100644 --- a/tests/data/test1331 +++ b/tests/data/test1331 @@ -49,8 +49,6 @@ Content-Length: 6 hello - - # Client-side diff --git a/tests/data/test1408 b/tests/data/test1408 index 1ae279c34887..88436dab0ee3 100644 --- a/tests/data/test1408 +++ b/tests/data/test1408 @@ -31,8 +31,6 @@ Set-Cookie: time=2 -foo- - - # diff --git a/tests/data/test1409 b/tests/data/test1409 index e0c32be188a5..de145ff9d619 100644 --- a/tests/data/test1409 +++ b/tests/data/test1409 @@ -6,7 +6,6 @@ FAILURE - # # Client-side diff --git a/tests/data/test1410 b/tests/data/test1410 index 73362dc00588..c370e1da5f60 100644 --- a/tests/data/test1410 +++ b/tests/data/test1410 @@ -6,7 +6,6 @@ FAILURE - # # Client-side diff --git a/tests/data/test1411 b/tests/data/test1411 index 6eaa65d32889..309dc1692a69 100644 --- a/tests/data/test1411 +++ b/tests/data/test1411 @@ -23,7 +23,6 @@ Funny-head: yesyes
- # # Client-side diff --git a/tests/data/test161 b/tests/data/test161 index 7908c41d2a93..80a03882da74 100644 --- a/tests/data/test161 +++ b/tests/data/test161 @@ -29,7 +29,6 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER - # Verify data after the test has been "shot" # This does not send QUIT because of known bug: diff --git a/tests/data/test2030 b/tests/data/test2030 index 47f01a14ed69..307b223264c4 100644 --- a/tests/data/test2030 +++ b/tests/data/test2030 @@ -25,7 +25,6 @@ ensure that the order does not matter. --> --> - HTTP/1.1 401 Need Digest or NTLM auth diff --git a/tests/data/test2045 b/tests/data/test2045 index 241d9fc14f6b..0532be5708fa 100644 --- a/tests/data/test2045 +++ b/tests/data/test2045 @@ -6,7 +6,6 @@ FTP - # # Server-side diff --git a/tests/data/test206 b/tests/data/test206 index 7a2acac7005f..b036eb9d405d 100644 --- a/tests/data/test206 +++ b/tests/data/test206 @@ -17,7 +17,6 @@ connection-monitor auth_required - # this is returned first since we get no proxy-auth HTTP/1.1 407 Authorization Required to proxy me my dear diff --git a/tests/data/test2202 b/tests/data/test2202 index 9bb03799362f..6330b9519d26 100644 --- a/tests/data/test2202 +++ b/tests/data/test2202 @@ -50,7 +50,6 @@ client CONNECT 2e 00044d51545404c2003c000c6375726c server CONNACK 2 20020005 - # 8 is CURLE_WEIRD_SERVER_REPLY 8 diff --git a/tests/data/test228 b/tests/data/test228 index e9acda8ddb3d..e609aaa74175 100644 --- a/tests/data/test228 +++ b/tests/data/test228 @@ -34,7 +34,6 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-account "one count" - # Verify data after the test has been "shot" diff --git a/tests/data/test3105 b/tests/data/test3105 index 543d52e43234..64f1c5ab4cd2 100644 --- a/tests/data/test3105 +++ b/tests/data/test3105 @@ -5,7 +5,6 @@ curl_multi_remove_handle - # # Client-side diff --git a/tests/data/test399 b/tests/data/test399 index bd73155253a2..8495446c0d9c 100644 --- a/tests/data/test399 +++ b/tests/data/test399 @@ -5,7 +5,6 @@ URL - # # Client-side diff --git a/tests/data/test698 b/tests/data/test698 index 3335e3875d6f..a3e16a511e2c 100644 --- a/tests/data/test698 +++ b/tests/data/test698 @@ -34,7 +34,6 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-account "one count" ftp://%HOSTIP:%FTPP - # Verify data after the test has been "shot" diff --git a/tests/devtest.pl b/tests/devtest.pl index a2a9cde87543..46adb6136a50 100755 --- a/tests/devtest.pl +++ b/tests/devtest.pl @@ -64,7 +64,6 @@ BEGIN ); use getpart; - ####################################################################### # logmsg is our general message logging subroutine. # This function is currently required to be here by servers.pm @@ -105,7 +104,6 @@ sub parseprotocols { push @protocols, 'none'; } - ####################################################################### # Initialize @protocols from the curl binary under test # @@ -117,7 +115,6 @@ sub init_protocols { } } - ####################################################################### # Initialize the test harness to run tests # diff --git a/tests/directories.pm b/tests/directories.pm index 8b3c1addfaa7..cbb5921cd396 100644 --- a/tests/directories.pm +++ b/tests/directories.pm @@ -37,7 +37,6 @@ BEGIN { ); } - my %file_chmod1 = ( 'name' => 'chmod1', 'content' => "This file should have permissions 444\n", diff --git a/tests/getpart.pm b/tests/getpart.pm index 69b810db5c47..b88cce628bc8 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -103,8 +103,8 @@ sub getpartattr { if(!$inside && ($_ =~ /^ *\<$section/)) { $inside++; } - if((1 ==$inside) && ( ($_ =~ /^ *\<$part ([^>]*)/) || - !(defined($part)) ) + if((1 == $inside) && (($_ =~ /^ *\<$part ([^>]*)/) || + !(defined($part))) ) { $inside++; my $attr=$1; @@ -118,10 +118,10 @@ sub getpartattr { last; } # detect end of section when part was not found - elsif((1 ==$inside) && ($_ =~ /^ *\<\/$section\>/)) { + elsif((1 == $inside) && ($_ =~ /^ *\<\/$section\>/)) { last; } - elsif((2 ==$inside) && ($_ =~ /^ *\<\/$part/)) { + elsif((2 == $inside) && ($_ =~ /^ *\<\/$part/)) { $inside--; } } @@ -252,7 +252,6 @@ sub loadtest { return 0; } - # Return entire document as list of lines sub fulltest { return @xml; @@ -323,7 +322,6 @@ sub savetest { # Strip off all lines that match the specified pattern and return # the new array. # - sub striparray { my ($pattern, $arrayref) = @_; @@ -423,5 +421,4 @@ sub loadarray { return @array; } - 1; diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 8543b3aec440..8d5105a36c61 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -85,7 +85,6 @@ use pathhelp qw( use Cwd qw(getcwd); use File::Spec; - ####################################################################### # global configuration variables # diff --git a/tests/libtest/cli_ftp_upload.c b/tests/libtest/cli_ftp_upload.c index 7493a210e6e9..32835bc12329 100644 --- a/tests/libtest/cli_ftp_upload.c +++ b/tests/libtest/cli_ftp_upload.c @@ -21,12 +21,10 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "first.h" #include "testtrace.h" - #ifndef CURL_DISABLE_FTP struct test_cli_ftp_upload_data { @@ -85,8 +83,7 @@ static CURLcode test_cli_ftp_upload(const char *URL) curl_off_t uploadsize = -1; (void)URL; - while((ch = cgetopt(test_argc, test_argv, "r:")) - != -1) { + while((ch = cgetopt(test_argc, test_argv, "r:")) != -1) { switch(ch) { case 'r': resolve = coptarg; diff --git a/tests/libtest/lib651.c b/tests/libtest/lib651.c index 1e38d18895cc..0a7684abe454 100644 --- a/tests/libtest/lib651.c +++ b/tests/libtest/lib651.c @@ -55,7 +55,6 @@ static CURLcode test_lib651(const char *URL) if(formrc) curl_mprintf("curl_formadd(1) = %d\n", formrc); - curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "curl_easy_init() failed\n"); diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index bfb0e590e78f..77e10a05d90f 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -74,7 +74,6 @@ 'CURLOPT_SOCKS5_AUTH', ); - # # Generate a set of string checks # @@ -626,7 +625,6 @@ } } - print $fh <